fix the menu item bitmaps for wxMSW;

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
This commit is contained in:
Francesco Montorsi
2008-10-11 15:55:23 +00:00
parent c615d6491f
commit 1bda839923
5 changed files with 28 additions and 23 deletions

View File

@@ -166,6 +166,10 @@ wxBitmap AutoCaptureMechanism::Capture(Control& ctrl)
ctrl.name.StartsWith(_T("wx"), &(ctrl.name)); ctrl.name.StartsWith(_T("wx"), &(ctrl.name));
ctrl.name.MakeLower(); ctrl.name.MakeLower();
// AD-HOC FIX for wxHyperlink
if (ctrl.name == "generichyperlinkctrl")
ctrl.name = "hyperlinkctrl";
// take the screenshot // take the screenshot
wxBitmap screenshot = Capture(rect); wxBitmap screenshot = Capture(rect);

View File

@@ -70,7 +70,7 @@
<event name="OnSetFocus"></event> <event name="OnSetFocus"></event>
<event name="OnSize"></event> <event name="OnSize"></event>
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
<object class="wxMenuBar" expanded="0"> <object class="wxMenuBar" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="enabled">1</property> <property name="enabled">1</property>
@@ -172,7 +172,7 @@
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
</object> </object>
<object class="wxMenuItem" expanded="1"> <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="checked">0</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="help">Manually specify rectangular regions for the screenshots.</property> <property name="help">Manually specify rectangular regions for the screenshots.</property>
@@ -180,14 +180,14 @@
<property name="kind">wxITEM_NORMAL</property> <property name="kind">wxITEM_NORMAL</property>
<property name="label">Regions&lt;Begin&gt;</property> <property name="label">Regions&lt;Begin&gt;</property>
<property name="name">m_menuCapRect</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="shortcut">Ctrl+Alt+R</property>
<property name="unchecked_bitmap"></property> <property name="unchecked_bitmap"></property>
<event name="OnMenuSelection">OnCaptureRect</event> <event name="OnMenuSelection">OnCaptureRect</event>
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
</object> </object>
<object class="wxMenuItem" expanded="1"> <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="checked">0</property>
<property name="enabled">0</property> <property name="enabled">0</property>
<property name="help">Stop manually generating screenshots.</property> <property name="help">Stop manually generating screenshots.</property>
@@ -195,7 +195,7 @@
<property name="kind">wxITEM_NORMAL</property> <property name="kind">wxITEM_NORMAL</property>
<property name="label">Regions&lt;End&gt;</property> <property name="label">Regions&lt;End&gt;</property>
<property name="name">m_menuEndCapRect</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="shortcut">Ctrl+Alt+E</property>
<property name="unchecked_bitmap"></property> <property name="unchecked_bitmap"></property>
<event name="OnMenuSelection">OnEndCaptureRect</event> <event name="OnMenuSelection">OnEndCaptureRect</event>
@@ -1589,7 +1589,7 @@
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pos"></property> <property name="pos"></property>
<property name="size"></property> <property name="size"></property>
<property name="style"></property> <property name="style">wxLC_REPORT</property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip">wxListCtrl</property> <property name="tooltip">wxListCtrl</property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>

View 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/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // 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 ); 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 ); 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 ); captureMenu->Append( m_menuEndCapRect );
m_menuEndCapRect->Enable( false ); 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 ); 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 ); 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") ); m_listCtrl1->SetToolTip( _("wxListCtrl") );
fgSizer2->Add( m_listCtrl1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 20 ); fgSizer2->Add( m_listCtrl1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 20 );

View 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/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
@@ -80,6 +80,8 @@ class GUIFrame : public wxFrame
wxMenuBar* mbar; wxMenuBar* mbar;
wxMenu* fileMenu; wxMenu* fileMenu;
wxMenu* captureMenu; wxMenu* captureMenu;
wxMenuItem* m_menuCapRect;
wxMenuItem* m_menuEndCapRect;
wxMenu* helpMenu; wxMenu* helpMenu;
wxNotebook* m_notebook1; wxNotebook* m_notebook1;
wxPanel* m_panel1; wxPanel* m_panel1;

View File

@@ -34,6 +34,9 @@
#include "ctrlmaskout.h" #include "ctrlmaskout.h"
#include "autocapture.h" #include "autocapture.h"
#include "bitmaps/play.xpm"
#include "bitmaps/stop.xpm"
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// ScreenshotFrame // ScreenshotFrame
@@ -104,8 +107,12 @@ void ScreenshotFrame::InitFBControls()
m_treeCtrl1->ExpandAll(); m_treeCtrl1->ExpandAll();
// Add items into wxListCtrl // Add items into wxListCtrl
for(long index = 0; index < 5; index++) m_listCtrl1->InsertColumn(0, "Names");
m_listCtrl1->InsertItem( index, wxString::Format(_("Item\n(0,%d)"),index)); 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 // Check the first item in wxCheckListBox
m_checkList1->Check(0); m_checkList1->Check(0);
@@ -119,6 +126,10 @@ void ScreenshotFrame::InitFBControls()
// set minimum size hints // set minimum size hints
GetSizer()->SetSizeHints(this); GetSizer()->SetSizeHints(this);
// add bitmaps to the menus
m_menuCapRect->SetBitmaps( wxIcon(play_xpm) );
m_menuEndCapRect->SetBitmaps( wxIcon(stop_xpm) );
} }