lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] help implementation


From: Greg Chicares
Subject: Re: [lmi] help implementation
Date: Tue, 26 Feb 2008 12:35:33 +0000
User-agent: Thunderbird 2.0.0.9 (Windows/20071031)

On 2008-02-25 18:06Z, Vaclav Slavik wrote:
[...]
> If you use <help> for controls inside a dialog, the dialog 
> should also use
> 
>     <exstyle>wxDIALOG_EX_CONTEXTHELP</exstyle>
> 
> to add the [?] button to its titlebar, but it's not strictly required.

There seems to be some issue with that XRC line, at least in the
context in which lmi uses it. I've seen this since wx-2.5.1 IIRC,
and still see it with wx-2.8.7 today.

I see the [?] button when I run lmi and do
  File | New | Illustration
So far so good. But if I build with the patch below, then do
  File | New | Illustration
again, the [?] button does not appear on the notebook dialog.

The patch suppresses an lmi workaround that seems necessary for
the [?] button to appear, as documented in 'mvc_controller.cpp':

// WX !! wxDIALOG_EX_CONTEXTHELP is unknown to wxxrc.
// 'Extra' styles (such as wxWS_EX_VALIDATE_RECURSIVELY) that wxxrc
// recognizes can be specified as an <exstyle> attribute, which is
// tidier than setting them dynamically as in this message:
//   http://lists.wxwindows.org/archive/wxPython-users/msg15676.html
// But that technique is needed for wxDIALOG_EX_CONTEXTHELP, which
// wxxrc does not recognize; it must be specified here, before
// LoadDialog() is called.

Here's the patch (for demonstration only) that suppresses the
workaround:

Index: mvc_controller.cpp
===================================================================
RCS file: /sources/lmi/lmi/mvc_controller.cpp,v
retrieving revision 1.18
diff -u -3 -r1.18 mvc_controller.cpp
--- mvc_controller.cpp  6 Feb 2008 03:46:36 -0000       1.18
+++ mvc_controller.cpp  26 Feb 2008 12:05:37 -0000
@@ -95,7 +95,7 @@
 {
     model_.TestInitialConsistency();

-    SetExtraStyle(GetExtraStyle() | wxDIALOG_EX_CONTEXTHELP);
+//    SetExtraStyle(GetExtraStyle() | wxDIALOG_EX_CONTEXTHELP);
     if(!wxXmlResource::Get()->LoadDialog(this, parent, view_.MainDialogName()))
         {
         fatal_error() << "Unable to load dialog." << LMI_FLUSH;
Index: skin.xrc
===================================================================
RCS file: /sources/lmi/lmi/skin.xrc,v
retrieving revision 1.1
diff -u -3 -r1.1 skin.xrc
--- skin.xrc    18 Feb 2008 17:44:00 -0000      1.1
+++ skin.xrc    26 Feb 2008 12:05:40 -0000
@@ -2791,6 +2791,7 @@
     <title>Let me illustrate...</title>
     <style>wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU</style>
     <exstyle>wxWS_EX_VALIDATE_RECURSIVELY</exstyle>
+    <exstyle>wxDIALOG_EX_CONTEXTHELP</exstyle>
 <!-- WX !! This style flag is unknown to wxxrc:
     <exstyle>wxDIALOG_EX_CONTEXTHELP</exstyle>
 -->




reply via email to

[Prev in Thread] Current Thread [Next in Thread]