Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
Show Message Box
Show Message Box
Hi everyone,
There are a lot of helpful features in EventGhost, but recently I missed one:
I wanted to show a simple popup message on screen (with a button to close it).
It's not too difficult to do in python, however, a UI to customize such a Message Box would be nice, so I created one.
I integrated it in THE EventGhost plugin, as it's a very basic feature in my opinion.
There are a lot of helpful features in EventGhost, but recently I missed one:
I wanted to show a simple popup message on screen (with a button to close it).
It's not too difficult to do in python, however, a UI to customize such a Message Box would be nice, so I created one.
I integrated it in THE EventGhost plugin, as it's a very basic feature in my opinion.
- Attachments
-
- __init__.py
- 1.0.4
- (26.32 KiB) Downloaded 176 times
-
krambriw
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: Show Message Box
Dear Sem;colon,
Nice feature!
Would it be OK to wish for a setting of a time-out? So that the message box could close itself in an unattended system?
Kind regards, Walter
Nice feature!
Would it be OK to wish for a setting of a time-out? So that the message box could close itself in an unattended system?
Kind regards, Walter
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Show Message Box
It certainly is possible.krambriw wrote:Would it be OK to wish for a setting of a time-out?
I've used it in several plugins such as Nmap (try adding a "Named device" and press OK without filling).
Another option is a warning sound (Yes/No) when opening a MessageBox window.
Pako
You know flattr ? You can 

Re: Show Message Box
Well, I used win32gui.MessageBox() which doesn't provide a native functionality for a time-out.Pako wrote:It certainly is possible.
I've used it in several plugins such as Nmap (try adding a "Named device" and press OK without filling).
A possibility to set a timeout or have a proper action to close the MessageBox on an event would be cool, but I don't know how to do it.
If somebody knows and is willing to extend the MessageBox by this feature or any other feature or just wants to change some UI elements etc. please feel free to do so!
Actually the OS plays the sound of the "icon" you choose, I don't even know how to disable that, but I like it that way.Pako wrote: Another option is a warning sound (Yes/No) when opening a MessageBox window.
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Show Message Box
Sem;colon wrote:Well, I used win32gui.MessageBox() which doesn't provide a native functionality for a time-out.
I think if we want to have an improved MessageBox, we can not use win32gui.MessageBox().Sem;colon wrote:Actually the OS plays the sound of the "icon" you choose, I don't even know how to disable that, but I like it that way.
For example, we can use my class MessageBox (for example, from Nmap plugin).
There is a need to finish only a few things (especially configurable buttons).
Pako
You know flattr ? You can 

Re: Show Message Box
I took a look into that plugin and I have to say that this class you wrote is pretty cool (beyond my python skills, I suck at writing GUI in Python)Pako wrote:I think if we want to have an improved MessageBox, we can not use win32gui.MessageBox().
For example, we can use my class MessageBox (for example, from Nmap plugin).
But there are also some advantages with using the win32gui function, such as:
- Buttons are always in OS language
- If you select "Allways on top" the box runs in system context and is also visible on the lock screen <- I like that one very much
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Show Message Box
Yes, these two functions I can not do with wx.Dialog (I now do not take into account the possibilities of internationalization EventGhost).Sem;colon wrote:But there are also some advantages with using the win32gui function, such as:
- Buttons are always in OS language
- If you select "Allways on top" the box runs in system context and is also visible on the lock screen
So we can either accept the fact that some features can never have, or we can do it so, that we can have a choice of all the features
(but will not be able to select some functions simultaneously).
If you want, I can do it.
Pako
You know flattr ? You can 

Re: Show Message Box
yes, of course, I'd really appreciate that!Pako wrote:we can do it so, that we can have a choice of all the features
(but will not be able to select some functions simultaneously).
If you want, I can do it.
It took me hours to create the UI as it is now ^^┬░
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Show Message Box
Here is the first version. You can thoroughly test it, please?
Note:
I tried it and your version of the "System modal" never really was modal.
It was only as "Always on top" (with the exception that it does not work to the lock screen). For you it worked in another way?
Pako
Note:
I tried it and your version of the "System modal" never really was modal.
It was only as "Always on top" (with the exception that it does not work to the lock screen). For you it worked in another way?
Pako
- Attachments
-
- __init__.py
- 1.0.5
- (37.86 KiB) Downloaded 142 times
You know flattr ? You can 

Re: Show Message Box
Awesome!!
It's all fine when I hardcode the 0 (don't know why)
Since the handle seems to have no effect anyway, I guess it's better to leave it out.
Another thing I noticed with the "Always on top" property: It's only visible on the lock screen if "Wait for the Message Box to close" is not set.
Maybe we should disable the box/Option if on or the other is selected?
On thing regarding the Tweaked MessageBox; we should consider to make the style closer to the system default, so that the Boxes look similar no matter which type is chosen. (Just an idea, i'd also be happy with as it is right now)
I attached a modified version, in this version I disabled the handle hand over for the system box and I changed the style of the Tweaked box to be like the system box.
Yes, that's the main difference I found as well, I took the name because the constant was called "MB_SYSTEMMODAL".Pako wrote:I tried it and your version of the "System modal" never really was modal.
It was only as "Always on top" (with the exception that it does not work to the lock screen). For you it worked in another way?
I found one strange bug in the win32gui.MessageBox part; I noticed that you handover the EG handle if it's a "system modal" box, this seems to somehow brake something (I can't explain it).Pako wrote:Here is the first version. You can thoroughly test it, please?
It's all fine when I hardcode the 0 (don't know why)
Since the handle seems to have no effect anyway, I guess it's better to leave it out.
Another thing I noticed with the "Always on top" property: It's only visible on the lock screen if "Wait for the Message Box to close" is not set.
Maybe we should disable the box/Option if on or the other is selected?
On thing regarding the Tweaked MessageBox; we should consider to make the style closer to the system default, so that the Boxes look similar no matter which type is chosen. (Just an idea, i'd also be happy with as it is right now)
I attached a modified version, in this version I disabled the handle hand over for the system box and I changed the style of the Tweaked box to be like the system box.
- Attachments
-
- __init__.py
- 1.0.6
- (37.3 KiB) Downloaded 168 times
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Show Message Box
I have not had that problem and I noticed a significant difference.Sem;colon wrote:I found one strange bug in the win32gui.MessageBox part; I noticed that you handover the EG handle if it's a "system modal" box, this seems to somehow brake something (I can't explain it).
It's all fine when I hardcode the 0 (don't know why)
Since the handle seems to have no effect anyway, I guess it's better to leave it out.
Now I know how to explain.
The difference is that the window actually behaves modally (relative to EventGhost).
But it has one condition: EventGhost window must be open.
If this is not, so MessageBox is not open (routine is terminated due to an unhandled error because eg.document.frame == None).
It would be possible to give the condition "if eg.document.frame is not None:"
but I think it is unnecessary. I agree with your solution.
To me sometimes happens that it did not work even in another case.Sem;colon wrote:Another thing I noticed with the "Always on top" property: It's only visible on the lock screen if "Wait for the Message Box to close" is not set.
Maybe we should disable the box/Option if on or the other is selected?
So I do not believe a lot of this feature.
However, I certainly can do what you suggest.
Pako
- Attachments
-
- __init__.py
- 1.0.7
- (37.63 KiB) Downloaded 169 times
You know flattr ? You can 

Re: Show Message Box
Nice 
No further ideas/bugs from my side.
Thank you!
No further ideas/bugs from my side.
Thank you!
