08-25-2020 03:26 PM
Hi all,
I'm developing an application that involves asynchronous alarms. These alarms can be automatically displayed to the user in small pop-up windows that disappear once the user acknowledges the alarm, or when the alarm condition is no longer active.
Ideally I'd like for the alarms to be "docked" to the side of the main application window, like so:
The behavior of the "Alarm column" would be governed by a window manager, the way a (very limited) tiling window manager might, eg:
- When a window is added to the alarm column, it will occupy the first available space
- All tiles within the column are the same size
- When an alarm closes, the remaining alarms will be arranged so that the newest active alarm is on top of the stack
- When more alarms than can be shown are in the column, the newest alarm window is placed on top of the oldest existing alarm (or some way to make sure new alarms always shown to the user, given the limited available space in the Alarm column)
I tried searching for this on Github, DuckDuckGo, and in the VIPM but didn't find anything. Anyone got a nice QMH or similar that takes care of this sort of functionality?
08-25-2020 03:35 PM
Splitter bars and subpanels. Give those a looksie.
Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.
08-25-2020 03:43 PM
Ideally I'd want this area to have nothing at all when there's no alarms; proper popup windows and not just a vacant "notification area". Subpanels and splitters would not satisfy that.
Also I was certain this is a generic enough problem that someone would have solved it before!
08-25-2020 03:43 PM
Also, side note, we definitely are both from the same small town in WNC. Small world!
08-25-2020 03:54 PM - edited 08-25-2020 03:55 PM
@ijustlovemath wrote:
Ideally I'd want this area to have nothing at all when there's no alarms; proper popup windows and not just a vacant "notification area". Subpanels and splitters would not satisfy that.
Also I was certain this is a generic enough problem that someone would have solved it before!
That was the first thing that came to my mind. I feel like you could dynamically change the location of the vertical splitter bar based on if there are or aren't any alarms at a given time. But yeah maybe someone has made something similar that they can just give you and save you the trouble.
@ijustlovemath wrote:
Also, side note, we definitely are both from the same small town in WNC. Small world!
I'm from Blacksburg, Virginia lol. That can't be part of WNC right?
Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.
08-25-2020 03:58 PM
Oh, my bad! I thought Moog was exclusively in Asheville. And yes, I do see what you're saying and am inclined to code a generic ish solution myself, but if there's opportunity to re-use code, I'm all for it!
08-25-2020 04:00 PM
Have you tried: NI's Windows API Function Utilities (32-bit) for LabVIEW at:
https://forums.ni.com/t5/Example-Code/Windows-API-Function-Utilities-32-bit-for-LabVIEW/ta-p/3996462
08-25-2020 04:18 PM
Aside from the setting Z position, this doesn't seem to be what I'm looking for. I'll hang on to this in case I have to implement it myself!
08-25-2020 04:24 PM - edited 08-25-2020 04:26 PM
Absolutely no idea if this will help you in any way or not. But either way, it is a really cool demo IMO and might be useful to you elsewhere.
Also, Moog operates in 20 countries!
Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.
08-25-2020 04:30 PM
A couple ideas come to mind. As far as I know, there is no way to have a window actually appear and stay docked to the side of another LabVIEW window. In fact, I've never seen that as part of any other Windows application.
The "simplest" solution would probably be to add a splitter bar and an array of clusters, each of which can hold its own notification. (You can also use subpanels but you can't add new subpanels at runtime, and you can't put them in an array so there's lots of manual switching and moving to do.)
If there are no notifications, you can adjust the width of your main window to hide the alarm area. If there are notifications, widen the screen to show the alarms, and add new ones to the "Alarm list" array. You could detect value change events on the array (or Mouse Down, etc), then process the array to see which element changed, then delete that element. That would be a simple way to do it.
You could also get WAY more complicated and implement an MDI: https://www.mooregoodideas.com/mgi-library/panel-manager/dotnet-panels/
I haven't used that one in particular but MGI's other panel management stuff is fantastic.