Patch #3060 2010-09-12 04:25

cryogen

Corrects oversights in controls added to wxSmith
Download
3060-Corrects_overs.patch (3.4 KB)
Category
Plugin::Refinement
Status
Accepted
Close date
2010-09-21 05:21
Assigned to
mortenmacfly
Index: src/plugins/contrib/wxSmith/wxwidgets/defitems/wxsfindreplacedialog.h
===================================================================
--- src/plugins/contrib/wxSmith/wxwidgets/defitems/wxsfindreplacedialog.h    (revision 6575)
+++ src/plugins/contrib/wxSmith/wxwidgets/defitems/wxsfindreplacedialog.h    (working copy)
@@ -23,7 +23,9 @@
 
 #include "../wxstool.h"
 
-/** \brief Class for wxFindReplaceDialog dialogue. */
+/** \brief Class for wxFindReplaceDialog dialogue.
+    \note In order for events to connect properly you must set the ID of your wxFindReplaceDialog to -1 in wxSmith.
+*/
 class wxsFindReplaceDialog: public wxsTool
 {
     public:
Index: src/plugins/contrib/wxSmith/wxwidgets/defitems/wxsrichtextformattingdialog.cpp
===================================================================
--- src/plugins/contrib/wxSmith/wxwidgets/defitems/wxsrichtextformattingdialog.cpp    (revision 6575)
+++ src/plugins/contrib/wxSmith/wxwidgets/defitems/wxsrichtextformattingdialog.cpp    (working copy)
@@ -96,9 +96,9 @@
             }
 
             #if wxCHECK_VERSION(2, 9, 0)
-            Codef(_T("%C(%s, %W, %t, %I, %P, %S, %T);\n"), sFlags.wx_str(), m_sTitle.wx_str());
+            Codef(_T("%C(%s, %W, %t, %I, %P, %S);\n"), sFlags.wx_str(), m_sTitle.wx_str());
             #else
-            Codef(_T("%C(%s, %W, %t, %I, %P, %S, %T);\n"), sFlags.c_str(), m_sTitle.c_str());
+            Codef(_T("%C(%s, %W, %t, %I, %P, %S);\n"), sFlags.c_str(), m_sTitle.c_str());
             #endif
 
             BuildSetupWindowCode();
Index: src/plugins/contrib/wxSmith/wxwidgets/defitems/wxsrichtextstyleorganiserdialog.cpp
===================================================================
--- src/plugins/contrib/wxSmith/wxwidgets/defitems/wxsrichtextstyleorganiserdialog.cpp    (revision 6575)
+++ src/plugins/contrib/wxSmith/wxwidgets/defitems/wxsrichtextstyleorganiserdialog.cpp    (working copy)
@@ -87,6 +87,7 @@
 void wxsRichTextStyleOrganiserDialog::OnBuildCreatingCode()
 {
     wxString sFlags;
+    wxString sStyleSheetName = GetCoderContext()->GetUniqueName(_T("richTextStyleSheet"));
     switch(GetLanguage())
     {
         case wxsCPP:
@@ -105,17 +106,25 @@
             }
 
             #if wxCHECK_VERSION(2, 9, 0)
-            Codef(_T("%C(%s, NULL, NULL, %W, %I, %t, ")
+            AddDeclaration(wxString::Format(wxT("wxRichTextStyleSheet  *%s;"), sStyleSheetName.wx_str()));
+            Codef(_T("\t%s = new wxRichTextStyleSheet;\n"), sStyleSheetName.wx_str());
+            #else
+            AddDeclaration(wxString::Format(wxT("wxRichTextStyleSheet  *%s;"), sStyleSheetName.c_str()));
+            Codef(_T("\t%s = new wxRichTextStyleSheet;\n"), sStyleSheetName.c_str());
+            #endif
+
+            #if wxCHECK_VERSION(2, 9, 0)
+            Codef(_T("%C(%s, %s, NULL, %W, %I, %t, ")
                             wxT("SYMBOL_WXRICHTEXTSTYLEORGANISERDIALOG_POSITION, ")
                             wxT("SYMBOL_WXRICHTEXTSTYLEORGANISERDIALOG_SIZE, ")
                             wxT("SYMBOL_WXRICHTEXTSTYLEORGANISERDIALOG_STYLE);\n"),
-                            sFlags.wx_str(), m_sCaption.wx_str());
+                            sFlags.wx_str(), sStyleSheetName.wx_str(), m_sCaption.wx_str());
             #else
-            Codef(_T("%C(%s, NULL, NULL, %W, %I, %t, ")
+            Codef(_T("%C(%s, %s, NULL, %W, %I, %t, ")
                             wxT("SYMBOL_WXRICHTEXTSTYLEORGANISERDIALOG_POSITION, ")
                             wxT("SYMBOL_WXRICHTEXTSTYLEORGANISERDIALOG_SIZE, ")
                             wxT("SYMBOL_WXRICHTEXTSTYLEORGANISERDIALOG_STYLE);\n"),
-                            sFlags.c_str(), m_sCaption.c_str());
+                            sFlags.c_str(), sStyleSheetName.c_str(), m_sCaption.c_str());
             #endif
 
             BuildSetupWindowCode();
cryogen 2010-09-12 04:25

-Documented the important event ID requirement for wxFindReplaceDialog;

-Generate a wxRichTextStyleSheet for wxRichTextStyleOrganiserDialog;

-Fixed a bug in wxsRichTextStyleOrganiserDialog that caused dialogue styles to be omitted.

http://forums.codeblocks.org/index.php/topic,13286.0.html