10-08-2024 11:06 AM
I'm probably using the wrong terminology here, which is why I can't find it in Google, so apologies if this is dumb.
I have an application where a user can load in a test file, do some stuff, then save it if they want to.
I'd like to add "asterisk appears in the window title when the file is unsaved" functionality to my program.
Obviously, I can just read the current window title and append an asterisk, but I wondered if this might be an OS-level thing where I can tell the OS that this window should have the "dirty dot".
For example, I don't use Macs or Linux much, but I could imagine they may have a different style to indicate a changed document than Windows. I could also imagine other languages might have a different dirty dot scheme.
So, I wouldn't be surprised to learn that there's a "set dirty dot" function that calls OS stuff to set this, and I'd rather use that if it already exists.
Solved! Go to Solution.
10-08-2024 11:21 AM - edited 10-08-2024 11:25 AM
Just go ahead and set the Windows Title property. There won't be an easier way and, the property node will give you a great place to attach the BD comment explaining what you did.
That "Wheel" is round enough, no need to reinvent a new one.
You might consider also setting a file unsaved flag to throw a user prompt for save in the "application Close?" Event.
10-08-2024 11:34 AM
Fair enough. I already have the user save warning popup, I just wanted to spruce up the UI a bit. I figured if the OS could handle appending the dot and removing it, it would save me the bit of time to make a function to do it. Plus if Windows comes up with some kind of "stick a red dot on the window icon to indicate file changed" in the future, then this would be forward-compatible 🙂
I'm using MGI's Panel Actor library so I'll probably just make a message to set or clear the dot.
10-09-2024 03:06 AM - edited 10-09-2024 03:07 AM
@BertMcMahan wrote:
Fair enough. I already have the user save warning popup, I just wanted to spruce up the UI a bit. I figured if the OS could handle appending the dot and removing it, it would save me the bit of time to make a function to do it. Plus if Windows comes up with some kind of "stick a red dot on the window icon to indicate file changed" in the future, then this would be forward-compatible 🙂
There is no such thing as a Windows dirty dot window naming flag! It may be implemented by some specific UI widget libraries but generally, applications all handle that individually by modifying the window title as needed. I sometimes enhance that by also showing the currently used configuration file or data file, with or without full path, to the window title too.
10-09-2024 10:30 AM
@rolfk wrote:
There is no such thing as a Windows dirty dot window naming flag!
Thanks for confirming! I'd tried Googling it but didn't get much relevant info. I assumed this was the case, but wanted to ask around to be sure.