Discussion:
Processing wxMessageDialog wxHelp buttons on MSW
jon bird
2014-09-12 20:33:23 UTC
Permalink
Hello,


Does anyone have any clarification on how the wxHelp button on a
wxMessageDialog can be processed in line with normal MSW behaviour?

From my experience with the native Win32 API, a standard MessageBox call
which includes the MB_HELP button will dispatch a WM_HELP notification
to the message queue, whilst leaving the dialog activated (this being
the key thing).

As best as I can figure out, a wxMessageDialog class, will de-activate
the dialog regardless of which button is pressed.

Any assistance appreciated,



Jon.
--
== jon bird - software engineer
== <reply to address _may_ be invalid, real mail below>
== <reduce rsi, stop using the shift key>
== posted as: news 'at' onastick 'dot' clara.co.uk
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Vadim Zeitlin
2014-09-12 23:34:51 UTC
Permalink
On Fri, 12 Sep 2014 21:33:23 +0100 jon bird wrote:

jb> Does anyone have any clarification on how the wxHelp button on a
jb> wxMessageDialog can be processed in line with normal MSW behaviour?
jb>
jb> From my experience with the native Win32 API, a standard MessageBox call
jb> which includes the MB_HELP button will dispatch a WM_HELP notification
jb> to the message queue, whilst leaving the dialog activated (this being
jb> the key thing).
jb>
jb> As best as I can figure out, a wxMessageDialog class, will de-activate
jb> the dialog regardless of which button is pressed.

Yes, I'm afraid this is indeed the current behaviour. The reason for it is
that we needed "Help" button more like a placeholder for another custom
button to be able to show message boxes with 4 buttons, so using it for
actually displaying "Help" hasn't been really tested.

Unfortunately it isn't even obvious how could the API be changed to handle
this button specially. If you have any ideas or, better yet, implementation
proposals, please let us know.

Thanks,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
Steve Barnes
2014-09-13 06:15:29 UTC
Permalink
Post by Vadim Zeitlin
jb> Does anyone have any clarification on how the wxHelp button on a
jb> wxMessageDialog can be processed in line with normal MSW behaviour?
jb>
jb> From my experience with the native Win32 API, a standard MessageBox call
jb> which includes the MB_HELP button will dispatch a WM_HELP notification
jb> to the message queue, whilst leaving the dialog activated (this being
jb> the key thing).
jb>
jb> As best as I can figure out, a wxMessageDialog class, will de-activate
jb> the dialog regardless of which button is pressed.
Yes, I'm afraid this is indeed the current behaviour. The reason for it is
that we needed "Help" button more like a placeholder for another custom
button to be able to show message boxes with 4 buttons, so using it for
actually displaying "Help" hasn't been really tested.
Unfortunately it isn't even obvious how could the API be changed to handle
this button specially. If you have any ideas or, better yet, implementation
proposals, please let us know.
Thanks,
VZ
Possibly add to the constructor another entry, (non-close-buttons), or
allow buttons to be added to an extended style - this could also be
useful for some dialogues that need a reset or defaults button? Then
those buttons could raise an event without returning from the dialogue.

Just wish I had some time to work on this.

Gadget/Steve
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
jon bird
2014-09-13 08:47:39 UTC
Permalink
Post by Vadim Zeitlin
jb> Does anyone have any clarification on how the wxHelp button on a
jb> wxMessageDialog can be processed in line with normal MSW behaviour?
jb>
jb> From my experience with the native Win32 API, a standard MessageBox call
jb> which includes the MB_HELP button will dispatch a WM_HELP notification
jb> to the message queue, whilst leaving the dialog activated (this being
jb> the key thing).
jb>
jb> As best as I can figure out, a wxMessageDialog class, will de-activate
jb> the dialog regardless of which button is pressed.
Yes, I'm afraid this is indeed the current behaviour. The reason for it is
that we needed "Help" button more like a placeholder for another custom
button to be able to show message boxes with 4 buttons, so using it for
actually displaying "Help" hasn't been really tested.
Unfortunately it isn't even obvious how could the API be changed to handle
this button specially. If you have any ideas or, better yet, implementation
proposals, please let us know.
Ah, ok, unfortunately I'm just getting starting with wxWidgets so don't
yet have the experience to suggest anything useful on this one. I'll
probably just work round it using the native Win32 calls for now...

Rgs,


Jon.
--
== jon bird - software engineer
== <reply to address _may_ be invalid, real mail below>
== <reduce rsi, stop using the shift key>
== posted as: news 'at' onastick 'dot' clara.co.uk
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Steve Cookson - gmail
2014-09-15 09:18:50 UTC
Permalink
Hi Jon,
There are lots of dialogues which could be more beautifully designed or
behave better.

I have written a blank dialogue (I use Perl), which conforms to my
project standards and then I just sub-class and create a new dialogue
box. This means that rather that using

wxMessageDialog

With its inbuilt button, I have my own programmed button which calls
help like this (sorry it's not c++):

Wx::Event::EVT_BUTTON($dialog_1, $dialog_1->{Ctl_Message_Help_Btn},
sub {
my( $self, $event ) = @_;

my $help_file =
$gl_cfg->{installation_path}.'/help/'.$gl_language_country.'/iMage_help.htb';

$self->{html_help}->AddBook( $help_file, 1 );
$self->{html_help}->Display(__t("Configuration and setup
menu"));

}
);

It means I don't call any platform specific stuff.

Regards

Steve.
Post by jon bird
Ah, ok, unfortunately I'm just getting starting with wxWidgets so
don't yet have the experience to suggest anything useful on this one.
I'll probably just work round it using the native Win32 calls for now...
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
jon bird
2014-09-16 18:42:04 UTC
Permalink
Hi Steve,

Thanks, that could prove quite helpful and avoid me introducing messy
platform specific code. As I said earlier, still getting to grips with
the API so I'll keep this as a reference for when I'm a bit more
familiar with it all and can create something suitable in code.

Rgs,


Jon.
Post by Steve Cookson - gmail
Hi Jon,
There are lots of dialogues which could be more beautifully designed or
behave better.
I have written a blank dialogue (I use Perl), which conforms to my
project standards and then I just sub-class and create a new dialogue
box. This means that rather that using
wxMessageDialog
With its inbuilt button, I have my own programmed button which calls
Wx::Event::EVT_BUTTON($dialog_1, $dialog_1->{Ctl_Message_Help_Btn},
sub {
my $help_file =
$gl_cfg->{installation_path}.'/help/'.$gl_language_country.'/iMage_help.
htb';
$self->{html_help}->AddBook( $help_file, 1 );
$self->{html_help}->Display(__t("Configuration and setup
menu"));
}
);
It means I don't call any platform specific stuff.
Regards
Steve.
Post by jon bird
Ah, ok, unfortunately I'm just getting starting with wxWidgets so
don't yet have the experience to suggest anything useful on this one.
I'll probably just work round it using the native Win32 calls for now...
--
== jon bird - software engineer
== <reply to address _may_ be invalid, real mail below>
== <reduce rsi, stop using the shift key>
== posted as: news 'at' onastick 'dot' clara.co.uk
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Loading...