]> git.saurik.com Git - wxWidgets.git/commitdiff
fix the menu item bitmaps for wxMSW;
authorFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Sat, 11 Oct 2008 15:55:23 +0000 (15:55 +0000)
committerFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Sat, 11 Oct 2008 15:55:23 +0000 (15:55 +0000)
fix the name of the screenshot generated for wxHyperlinkCtrl on platforms != wxGTK

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56231 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

utils/screenshotgen/src/autocapture.cpp
utils/screenshotgen/src/guidesign.fbp
utils/screenshotgen/src/guiframe.cpp
utils/screenshotgen/src/guiframe.h
utils/screenshotgen/src/screenshot_main.cpp

index 026a797cce5bd1e9760e9beba01ae6a40354382d..48f5dd0b1904350c30b7e5e5cbd570f8e5321aae 100644 (file)
@@ -166,6 +166,10 @@ wxBitmap AutoCaptureMechanism::Capture(Control& ctrl)
     ctrl.name.StartsWith(_T("wx"), &(ctrl.name));
     ctrl.name.MakeLower();
 
     ctrl.name.StartsWith(_T("wx"), &(ctrl.name));
     ctrl.name.MakeLower();
 
+       // AD-HOC FIX for wxHyperlink
+       if (ctrl.name == "generichyperlinkctrl")
+               ctrl.name = "hyperlinkctrl";
+
     // take the screenshot
     wxBitmap screenshot = Capture(rect);
 
     // take the screenshot
     wxBitmap screenshot = Capture(rect);
 
index 6cb2d47a4b2a5817b0298ce0a511c2c3ba63bf32..02c8386e69c07e54ef22d70edf200d0e8c2e2c1d 100644 (file)
@@ -70,7 +70,7 @@
             <event name="OnSetFocus"></event>
             <event name="OnSize"></event>
             <event name="OnUpdateUI"></event>
             <event name="OnSetFocus"></event>
             <event name="OnSize"></event>
             <event name="OnUpdateUI"></event>
-            <object class="wxMenuBar" expanded="0">
+            <object class="wxMenuBar" expanded="1">
                 <property name="bg"></property>
                 <property name="context_help"></property>
                 <property name="enabled">1</property>
                 <property name="bg"></property>
                 <property name="context_help"></property>
                 <property name="enabled">1</property>
                         <event name="OnUpdateUI"></event>
                     </object>
                     <object class="wxMenuItem" expanded="1">
                         <event name="OnUpdateUI"></event>
                     </object>
                     <object class="wxMenuItem" expanded="1">
-                        <property name="bitmap">play; Load From Icon Resource [-1; -1]</property>
+                        <property name="bitmap">; Load From File</property>
                         <property name="checked">0</property>
                         <property name="enabled">1</property>
                         <property name="help">Manually specify rectangular regions for the screenshots.</property>
                         <property name="checked">0</property>
                         <property name="enabled">1</property>
                         <property name="help">Manually specify rectangular regions for the screenshots.</property>
                         <property name="kind">wxITEM_NORMAL</property>
                         <property name="label">Regions&lt;Begin&gt;</property>
                         <property name="name">m_menuCapRect</property>
                         <property name="kind">wxITEM_NORMAL</property>
                         <property name="label">Regions&lt;Begin&gt;</property>
                         <property name="name">m_menuCapRect</property>
-                        <property name="permission">none</property>
+                        <property name="permission">protected</property>
                         <property name="shortcut">Ctrl+Alt+R</property>
                         <property name="unchecked_bitmap"></property>
                         <event name="OnMenuSelection">OnCaptureRect</event>
                         <event name="OnUpdateUI"></event>
                     </object>
                     <object class="wxMenuItem" expanded="1">
                         <property name="shortcut">Ctrl+Alt+R</property>
                         <property name="unchecked_bitmap"></property>
                         <event name="OnMenuSelection">OnCaptureRect</event>
                         <event name="OnUpdateUI"></event>
                     </object>
                     <object class="wxMenuItem" expanded="1">
-                        <property name="bitmap">stop; Load From Icon Resource [-1; -1]</property>
+                        <property name="bitmap">; Load From Icon Resource [-1; -1]</property>
                         <property name="checked">0</property>
                         <property name="enabled">0</property>
                         <property name="help">Stop manually generating screenshots.</property>
                         <property name="checked">0</property>
                         <property name="enabled">0</property>
                         <property name="help">Stop manually generating screenshots.</property>
                         <property name="kind">wxITEM_NORMAL</property>
                         <property name="label">Regions&lt;End&gt;</property>
                         <property name="name">m_menuEndCapRect</property>
                         <property name="kind">wxITEM_NORMAL</property>
                         <property name="label">Regions&lt;End&gt;</property>
                         <property name="name">m_menuEndCapRect</property>
-                        <property name="permission">none</property>
+                        <property name="permission">protected</property>
                         <property name="shortcut">Ctrl+Alt+E</property>
                         <property name="unchecked_bitmap"></property>
                         <event name="OnMenuSelection">OnEndCaptureRect</event>
                         <property name="shortcut">Ctrl+Alt+E</property>
                         <property name="unchecked_bitmap"></property>
                         <event name="OnMenuSelection">OnEndCaptureRect</event>
                                             <property name="permission">protected</property>
                                             <property name="pos"></property>
                                             <property name="size"></property>
                                             <property name="permission">protected</property>
                                             <property name="pos"></property>
                                             <property name="size"></property>
-                                            <property name="style"></property>
+                                            <property name="style">wxLC_REPORT</property>
                                             <property name="subclass"></property>
                                             <property name="tooltip">wxListCtrl</property>
                                             <property name="window_extra_style"></property>
                                             <property name="subclass"></property>
                                             <property name="tooltip">wxListCtrl</property>
                                             <property name="window_extra_style"></property>
index 5244014005dd6ec305fb207df27a24a204a21773..89ab522e3e4364398440b62e77cfe4a4ab0d73e0 100644 (file)
@@ -1,5 +1,5 @@
 ///////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////
-// C++ code generated with wxFormBuilder (version Apr 21 2008)
+// C++ code generated with wxFormBuilder (version Apr 16 2008)
 // http://www.wxformbuilder.org/
 //
 // PLEASE DO "NOT" EDIT THIS FILE!
 // http://www.wxformbuilder.org/
 //
 // PLEASE DO "NOT" EDIT THIS FILE!
@@ -52,22 +52,10 @@ GUIFrame::GUIFrame( wxWindow* parent, wxWindowID id, const wxString& title, cons
        m_menuCapFullScreen = new wxMenuItem( captureMenu, idMenuCapFullScreen, wxString( _("&Full Screen") ) + wxT('\t') + wxT("Ctrl+Alt+F"), _("Takes a screenshot of the entire screen."), wxITEM_NORMAL );
        captureMenu->Append( m_menuCapFullScreen );
        
        m_menuCapFullScreen = new wxMenuItem( captureMenu, idMenuCapFullScreen, wxString( _("&Full Screen") ) + wxT('\t') + wxT("Ctrl+Alt+F"), _("Takes a screenshot of the entire screen."), wxITEM_NORMAL );
        captureMenu->Append( m_menuCapFullScreen );
        
-       wxMenuItem* m_menuCapRect;
        m_menuCapRect = new wxMenuItem( captureMenu, idMenuCapRect, wxString( _("Regions<Begin>") ) + wxT('\t') + wxT("Ctrl+Alt+R"), _("Manually specify rectangular regions for the screenshots."), wxITEM_NORMAL );
        m_menuCapRect = new wxMenuItem( captureMenu, idMenuCapRect, wxString( _("Regions<Begin>") ) + wxT('\t') + wxT("Ctrl+Alt+R"), _("Manually specify rectangular regions for the screenshots."), wxITEM_NORMAL );
-       #ifdef __WXMSW__
-       m_menuCapRect->SetBitmaps( wxICON( play ) );
-       #elif defined( __WXGTK__ )
-       m_menuCapRect->SetBitmap( wxICON( play ) );
-       #endif
        captureMenu->Append( m_menuCapRect );
        
        captureMenu->Append( m_menuCapRect );
        
-       wxMenuItem* m_menuEndCapRect;
        m_menuEndCapRect = new wxMenuItem( captureMenu, idMenuEndCapRect, wxString( _("Regions<End>") ) + wxT('\t') + wxT("Ctrl+Alt+E"), _("Stop manually generating screenshots."), wxITEM_NORMAL );
        m_menuEndCapRect = new wxMenuItem( captureMenu, idMenuEndCapRect, wxString( _("Regions<End>") ) + wxT('\t') + wxT("Ctrl+Alt+E"), _("Stop manually generating screenshots."), wxITEM_NORMAL );
-       #ifdef __WXMSW__
-       m_menuEndCapRect->SetBitmaps( wxICON( stop ) );
-       #elif defined( __WXGTK__ )
-       m_menuEndCapRect->SetBitmap( wxICON( stop ) );
-       #endif
        captureMenu->Append( m_menuEndCapRect );
        m_menuEndCapRect->Enable( false );
        
        captureMenu->Append( m_menuEndCapRect );
        m_menuEndCapRect->Enable( false );
        
@@ -216,7 +204,7 @@ GUIFrame::GUIFrame( wxWindow* parent, wxWindowID id, const wxString& title, cons
        m_treeCtrl1 = new wxTreeCtrl( m_panel2, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTR_DEFAULT_STYLE|wxSUNKEN_BORDER );
        fgSizer2->Add( m_treeCtrl1, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
        
        m_treeCtrl1 = new wxTreeCtrl( m_panel2, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTR_DEFAULT_STYLE|wxSUNKEN_BORDER );
        fgSizer2->Add( m_treeCtrl1, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
        
-       m_listCtrl1 = new wxListCtrl( m_panel2, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0|wxSUNKEN_BORDER );
+       m_listCtrl1 = new wxListCtrl( m_panel2, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxSUNKEN_BORDER );
        m_listCtrl1->SetToolTip( _("wxListCtrl") );
        
        fgSizer2->Add( m_listCtrl1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 20 );
        m_listCtrl1->SetToolTip( _("wxListCtrl") );
        
        fgSizer2->Add( m_listCtrl1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 20 );
index 89105a1e6276f27a0b0a0d88534e653254f0d7f6..940f41c81a396b8997dabd04aa077314ddcc9e72 100644 (file)
@@ -1,5 +1,5 @@
 ///////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////
-// C++ code generated with wxFormBuilder (version Apr 21 2008)
+// C++ code generated with wxFormBuilder (version Apr 16 2008)
 // http://www.wxformbuilder.org/
 //
 // PLEASE DO "NOT" EDIT THIS FILE!
 // http://www.wxformbuilder.org/
 //
 // PLEASE DO "NOT" EDIT THIS FILE!
@@ -80,6 +80,8 @@ class GUIFrame : public wxFrame
                wxMenuBar* mbar;
                wxMenu* fileMenu;
                wxMenu* captureMenu;
                wxMenuBar* mbar;
                wxMenu* fileMenu;
                wxMenu* captureMenu;
+               wxMenuItem* m_menuCapRect;
+               wxMenuItem* m_menuEndCapRect;
                wxMenu* helpMenu;
                wxNotebook* m_notebook1;
                wxPanel* m_panel1;
                wxMenu* helpMenu;
                wxNotebook* m_notebook1;
                wxPanel* m_panel1;
index 02c3ef537511c23a087a07681e3c0a5bff7d93d9..165f71441455e005ddc2b1dd10ffd0b776d1ca07 100644 (file)
@@ -34,6 +34,9 @@
 #include "ctrlmaskout.h"
 #include "autocapture.h"
 
 #include "ctrlmaskout.h"
 #include "autocapture.h"
 
+#include "bitmaps/play.xpm"
+#include "bitmaps/stop.xpm"
+
 
 // ----------------------------------------------------------------------------
 // ScreenshotFrame
 
 // ----------------------------------------------------------------------------
 // ScreenshotFrame
@@ -104,8 +107,12 @@ void ScreenshotFrame::InitFBControls()
     m_treeCtrl1->ExpandAll();
 
     // Add items into wxListCtrl
     m_treeCtrl1->ExpandAll();
 
     // Add items into wxListCtrl
-    for(long index = 0; index < 5; index++)
-        m_listCtrl1->InsertItem( index, wxString::Format(_("Item\n(0,%d)"),index));
+       m_listCtrl1->InsertColumn(0, "Names");
+       m_listCtrl1->InsertColumn(1, "Values");
+       for(long index = 0; index < 5; index++) {
+        m_listCtrl1->InsertItem( index, wxString::Format(_("Item%d"),index));
+               m_listCtrl1->SetItem(index, 1, wxString::Format("%d", index));
+       }
 
     // Check the first item in wxCheckListBox
     m_checkList1->Check(0);
 
     // Check the first item in wxCheckListBox
     m_checkList1->Check(0);
@@ -119,6 +126,10 @@ void ScreenshotFrame::InitFBControls()
 
     // set minimum size hints
     GetSizer()->SetSizeHints(this);
 
     // set minimum size hints
     GetSizer()->SetSizeHints(this);
+
+       // add bitmaps to the menus
+       m_menuCapRect->SetBitmaps( wxIcon(play_xpm) );
+       m_menuEndCapRect->SetBitmaps( wxIcon(stop_xpm) );
 }
 
 
 }