]> git.saurik.com Git - wxWidgets.git/commitdiff
other cleanup; adjusted english in the UI
authorFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Mon, 6 Oct 2008 14:08:08 +0000 (14:08 +0000)
committerFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Mon, 6 Oct 2008 14:08:08 +0000 (14:08 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56121 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

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

index 382c4451720a5127a9d60848cf91465278bd4bae..8263e38b7ec0e68acacdad41e6eb5196518547d3 100644 (file)
@@ -89,6 +89,35 @@ wxBitmap Capture(wxRect rect)
 // AutoCaptureMechanism
 // ----------------------------------------------------------------------------
 
 // AutoCaptureMechanism
 // ----------------------------------------------------------------------------
 
+void AutoCaptureMechanism::CaptureAll()
+{
+    m_notebook->SetSelection(0);
+    wxYield();
+
+    for(ControlList::iterator it = m_controlList.begin();
+        it != m_controlList.end();
+        ++it)
+    {
+        Control & ctrl = *it;
+
+        if(ctrl.flag == AJ_TurnPage) // Turn to next page
+        {
+            m_notebook->SetSelection(m_notebook->GetSelection() + 1);
+            wxYield();
+            continue;
+        }
+
+        wxBitmap screenshot = Capture(ctrl);
+
+        if(ctrl.flag & AJ_Union)
+        {
+            screenshot = Union(screenshot, Capture(*(++it)));
+        }
+
+        Save(screenshot, ctrl.name);
+    }
+}
+
 wxBitmap AutoCaptureMechanism::Capture(Control & ctrl)
 {
     if(ctrl.name == wxT("")) //no mannual specification for the control name
 wxBitmap AutoCaptureMechanism::Capture(Control & ctrl)
 {
     if(ctrl.name == wxT("")) //no mannual specification for the control name
index e07b43f19be4feda63ef98e2af8958432be51847..10ea3c8bd4cb52b8509dda046ff31d04b4fd3db3 100644 (file)
@@ -40,6 +40,7 @@ public:
                          wxString directory = wxT("screenshots"),
                          int border = 5)
         : m_notebook(notebook), m_dir(directory), m_border(border) {}
                          wxString directory = wxT("screenshots"),
                          int border = 5)
         : m_notebook(notebook), m_dir(directory), m_border(border) {}
+
     ~AutoCaptureMechanism(){}
 
     /*
     ~AutoCaptureMechanism(){}
 
     /*
@@ -62,34 +63,7 @@ public:
         m_controlList.push_back(Control(0, wxT(""), AJ_TurnPage));
     }
 
         m_controlList.push_back(Control(0, wxT(""), AJ_TurnPage));
     }
 
-    void CaptureAll()
-    {
-        m_notebook->SetSelection(0);
-        wxYield();
-
-        for(ControlList::iterator it = m_controlList.begin();
-            it != m_controlList.end();
-            ++it)
-        {
-            Control & ctrl = *it;
-
-            if(ctrl.flag == AJ_TurnPage) // Turn to next page
-            {
-                m_notebook->SetSelection(m_notebook->GetSelection() + 1);
-                wxYield();
-                continue;
-            }
-
-            wxBitmap screenshot = Capture(ctrl);
-
-            if(ctrl.flag & AJ_Union)
-            {
-                screenshot = Union(screenshot, Capture(*(++it)));
-            }
-
-            Save(screenshot, ctrl.name);
-        }
-    }
+    void CaptureAll();
 
 protected:      // internal utils
     struct Control
 
 protected:      // internal utils
     struct Control
index 124788c911730e36a5d3736c7a42b67ae8ae5731..660d96df9120ff4602a466c4b2c996acb5341496 100644 (file)
@@ -30,7 +30,14 @@ public:
     void Capture(wxRect rect, wxString fileName);
     void Capture(int x, int y, int width, int height, wxString fileName);
 
     void Capture(wxRect rect, wxString fileName);
     void Capture(int x, int y, int width, int height, wxString fileName);
 
-    wxString GetDefaultDirectory(){return m_defaultDir;}
+    wxString GetDefaultDirectory() const
+        { return m_defaultDir; }
+    wxString GetDefaultDirectoryAbsPath() const
+        {
+            wxFileName output = wxFileName::DirName(GetDefaultDirectory());
+            output.MakeAbsolute();
+            return output.GetFullPath();
+        }
 
 private:
     // Helper functions
 
 private:
     // Helper functions
index 8902abd3d6698a09b306b9563c6d37cc24ed506a..ba3d52a75eb16d47782f86f089f9351ba6d732b9 100644 (file)
@@ -60,7 +60,8 @@ public:
                                   wxLC_LIST|wxLC_VRULES|wxBORDER_THEME);
     }
 
                                   wxLC_LIST|wxLC_VRULES|wxBORDER_THEME);
     }
 
-    virtual wxWindow *GetControl() { return this; }
+    virtual wxWindow *GetControl()
+        { return this; }
 
     virtual void SetStringValue( const wxString& s )
     {
 
     virtual void SetStringValue( const wxString& s )
     {
@@ -113,8 +114,8 @@ public:
     }
 
 protected:
     }
 
 protected:
-    int             m_value; // current item index
-    int             m_itemHere; // hot item in popup
+    int             m_value;        // current item index
+    int             m_itemHere;     // hot item in popup
 
 private:
     DECLARE_EVENT_TABLE()
 
 private:
     DECLARE_EVENT_TABLE()
@@ -158,7 +159,8 @@ public:
         return wxSize(minWidth, wxMin(80, maxHeight));
     }
 
         return wxSize(minWidth, wxMin(80, maxHeight));
     }
 
-    virtual wxWindow *GetControl() { return this; }
+    virtual wxWindow *GetControl()
+        { return this; }
 
     // Needed by SetStringValue
     wxTreeItemId FindItemByText( wxTreeItemId parent, const wxString& text )
 
     // Needed by SetStringValue
     wxTreeItemId FindItemByText( wxTreeItemId parent, const wxString& text )
@@ -236,9 +238,8 @@ public:
     }
 
 protected:
     }
 
 protected:
-
-    wxTreeItemId        m_value; // current item index
-    wxTreeItemId        m_itemHere; // hot item in popup
+    wxTreeItemId        m_value;        // current item index
+    wxTreeItemId        m_itemHere;     // hot item in popup
 
 private:
     DECLARE_EVENT_TABLE()
 
 private:
     DECLARE_EVENT_TABLE()
index 2340fc4e14708fc0a7b3436692fb61b8bdaa079f..19eb9d6a0df9a301aab8ca63e37e00185f04864e 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="1">
+            <object class="wxMenuBar" expanded="0">
                 <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>
                         <property name="bitmap"></property>
                         <property name="checked">0</property>
                         <property name="enabled">1</property>
                         <property name="bitmap"></property>
                         <property name="checked">0</property>
                         <property name="enabled">1</property>
-                        <property name="help">Open the directory where the screenshots generated.</property>
+                        <property name="help">Opens the directory where the screenshots are saved.</property>
                         <property name="id">wxID_ZOOM_IN</property>
                         <property name="kind">wxITEM_NORMAL</property>
                         <property name="id">wxID_ZOOM_IN</property>
                         <property name="kind">wxITEM_NORMAL</property>
-                        <property name="label">&amp;View screenshots...</property>
+                        <property name="label">&amp;Open screenshots folder...</property>
                         <property name="name">m_menuSeeScr</property>
                         <property name="permission">none</property>
                         <property name="shortcut">Ctrl+O</property>
                         <property name="name">m_menuSeeScr</property>
                         <property name="permission">none</property>
                         <property name="shortcut">Ctrl+O</property>
                         <property name="bitmap"></property>
                         <property name="checked">0</property>
                         <property name="enabled">1</property>
                         <property name="bitmap"></property>
                         <property name="checked">0</property>
                         <property name="enabled">1</property>
-                        <property name="help">Quit the application</property>
+                        <property name="help">Quits the application.</property>
                         <property name="id">wxID_EXIT</property>
                         <property name="kind">wxITEM_NORMAL</property>
                         <property name="label">&amp;Quit</property>
                         <property name="id">wxID_EXIT</property>
                         <property name="kind">wxITEM_NORMAL</property>
                         <property name="label">&amp;Quit</property>
                         <property name="bitmap"></property>
                         <property name="checked">0</property>
                         <property name="enabled">1</property>
                         <property name="bitmap"></property>
                         <property name="checked">0</property>
                         <property name="enabled">1</property>
-                        <property name="help">Can screenshot be taken properly?</property>
+                        <property name="help">Takes a screenshot of the entire screen.</property>
                         <property name="id">idMenuCapFullScreen</property>
                         <property name="kind">wxITEM_NORMAL</property>
                         <property name="label">&amp;Full Screen</property>
                         <property name="id">idMenuCapFullScreen</property>
                         <property name="kind">wxITEM_NORMAL</property>
                         <property name="label">&amp;Full Screen</property>
                         <property name="bitmap">play; Load From Icon Resource [-1; -1]</property>
                         <property name="checked">0</property>
                         <property name="enabled">1</property>
                         <property name="bitmap">play; Load From Icon Resource [-1; -1]</property>
                         <property name="checked">0</property>
                         <property name="enabled">1</property>
-                        <property name="help">Manually specify rectangular regions</property>
+                        <property name="help">Manually specify rectangular regions for the screenshots.</property>
                         <property name="id">idMenuCapRect</property>
                         <property name="kind">wxITEM_NORMAL</property>
                         <property name="label">Regions&lt;Begin&gt;</property>
                         <property name="id">idMenuCapRect</property>
                         <property name="kind">wxITEM_NORMAL</property>
                         <property name="label">Regions&lt;Begin&gt;</property>
                         <property name="bitmap">stop; Load From Icon Resource [-1; -1]</property>
                         <property name="checked">0</property>
                         <property name="enabled">0</property>
                         <property name="bitmap">stop; Load From Icon Resource [-1; -1]</property>
                         <property name="checked">0</property>
                         <property name="enabled">0</property>
-                        <property name="help">Stop generating screenshots...</property>
+                        <property name="help">Stop manually generating screenshots.</property>
                         <property name="id">idMenuEndCapRect</property>
                         <property name="kind">wxITEM_NORMAL</property>
                         <property name="label">Regions&lt;End&gt;</property>
                         <property name="id">idMenuEndCapRect</property>
                         <property name="kind">wxITEM_NORMAL</property>
                         <property name="label">Regions&lt;End&gt;</property>
                         <property name="bitmap">; Load From Resource</property>
                         <property name="checked">0</property>
                         <property name="enabled">1</property>
                         <property name="bitmap">; Load From Resource</property>
                         <property name="checked">0</property>
                         <property name="enabled">1</property>
-                        <property name="help">Take screenshot for all controls autoly.</property>
+                        <property name="help">Takes screenshots for all controls automatically.</property>
                         <property name="id">idMenuCapAll</property>
                         <property name="kind">wxITEM_NORMAL</property>
                         <property name="label">Capture All</property>
                         <property name="id">idMenuCapAll</property>
                         <property name="kind">wxITEM_NORMAL</property>
                         <property name="label">Capture All</property>
                         <property name="bitmap"></property>
                         <property name="checked">0</property>
                         <property name="enabled">1</property>
                         <property name="bitmap"></property>
                         <property name="checked">0</property>
                         <property name="enabled">1</property>
-                        <property name="help">Show info about this application</property>
+                        <property name="help">Shows info about this application.</property>
                         <property name="id">wxID_ABOUT</property>
                         <property name="kind">wxITEM_NORMAL</property>
                         <property name="label">&amp;About...</property>
                         <property name="id">wxID_ABOUT</property>
                         <property name="kind">wxITEM_NORMAL</property>
                         <property name="label">&amp;About...</property>
                     </object>
                 </object>
             </object>
                     </object>
                 </object>
             </object>
-            <object class="wxBoxSizer" expanded="1">
+            <object class="wxBoxSizer" expanded="0">
                 <property name="minimum_size"></property>
                 <property name="name">bSizer0</property>
                 <property name="orient">wxVERTICAL</property>
                 <property name="minimum_size"></property>
                 <property name="name">bSizer0</property>
                 <property name="orient">wxVERTICAL</property>
                                             <property name="font"></property>
                                             <property name="hidden">0</property>
                                             <property name="id">wxID_ANY</property>
                                             <property name="font"></property>
                                             <property name="hidden">0</property>
                                             <property name="id">wxID_ANY</property>
-                                            <property name="label">Not checked</property>
+                                            <property name="label">Unchecked</property>
                                             <property name="maximum_size"></property>
                                             <property name="minimum_size"></property>
                                             <property name="name">m_checkBox2</property>
                                             <property name="maximum_size"></property>
                                             <property name="minimum_size"></property>
                                             <property name="name">m_checkBox2</property>
                                             <property name="font"></property>
                                             <property name="hidden">0</property>
                                             <property name="id">wxID_ANY</property>
                                             <property name="font"></property>
                                             <property name="hidden">0</property>
                                             <property name="id">wxID_ANY</property>
-                                            <property name="label">Chosen</property>
+                                            <property name="label">Checked</property>
                                             <property name="maximum_size"></property>
                                             <property name="minimum_size"></property>
                                             <property name="name">m_radioBtn1</property>
                                             <property name="maximum_size"></property>
                                             <property name="minimum_size"></property>
                                             <property name="name">m_radioBtn1</property>
                                             <property name="font"></property>
                                             <property name="hidden">0</property>
                                             <property name="id">wxID_ANY</property>
                                             <property name="font"></property>
                                             <property name="hidden">0</property>
                                             <property name="id">wxID_ANY</property>
-                                            <property name="label">Not chosen</property>
+                                            <property name="label">Unchecked</property>
                                             <property name="maximum_size"></property>
                                             <property name="minimum_size"></property>
                                             <property name="name">m_radioBtn2</property>
                                             <property name="maximum_size"></property>
                                             <property name="minimum_size"></property>
                                             <property name="name">m_radioBtn2</property>
                                             <property name="font"></property>
                                             <property name="hidden">0</property>
                                             <property name="id">wxID_ANY</property>
                                             <property name="font"></property>
                                             <property name="hidden">0</property>
                                             <property name="id">wxID_ANY</property>
-                                            <property name="label">Not Toggled</property>
+                                            <property name="label">Untoggled</property>
                                             <property name="maximum_size"></property>
                                             <property name="minimum_size"></property>
                                             <property name="name">m_toggleBtn1</property>
                                             <property name="maximum_size"></property>
                                             <property name="minimum_size"></property>
                                             <property name="name">m_toggleBtn1</property>
                         </object>
                         <object class="notebookpage" expanded="1">
                             <property name="bitmap"></property>
                         </object>
                         <object class="notebookpage" expanded="1">
                             <property name="bitmap"></property>
-                            <property name="label">Choosing Controls</property>
-                            <property name="select">1</property>
+                            <property name="label">Multiple choice Controls</property>
+                            <property name="select">0</property>
                             <object class="wxPanel" expanded="1">
                                 <property name="bg"></property>
                                 <property name="context_help"></property>
                             <object class="wxPanel" expanded="1">
                                 <property name="bg"></property>
                                 <property name="context_help"></property>
                         </object>
                         <object class="notebookpage" expanded="1">
                             <property name="bitmap"></property>
                         </object>
                         <object class="notebookpage" expanded="1">
                             <property name="bitmap"></property>
-                            <property name="label">Text Richtext</property>
+                            <property name="label">[Rich]Text Controls</property>
                             <property name="select">0</property>
                             <object class="wxPanel" expanded="1">
                                 <property name="bg"></property>
                             <property name="select">0</property>
                             <object class="wxPanel" expanded="1">
                                 <property name="bg"></property>
                         <object class="notebookpage" expanded="1">
                             <property name="bitmap"></property>
                             <property name="label">Picker Controls</property>
                         <object class="notebookpage" expanded="1">
                             <property name="bitmap"></property>
                             <property name="label">Picker Controls</property>
-                            <property name="select">0</property>
+                            <property name="select">1</property>
                             <object class="wxPanel" expanded="1">
                                 <property name="bg"></property>
                                 <property name="context_help"></property>
                             <object class="wxPanel" expanded="1">
                                 <property name="bg"></property>
                                 <property name="context_help"></property>
                                     </object>
                                     <object class="sizeritem" expanded="1">
                                         <property name="border">20</property>
                                     </object>
                                     <object class="sizeritem" expanded="1">
                                         <property name="border">20</property>
-                                        <property name="flag">wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</property>
+                                        <property name="flag">wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL</property>
                                         <property name="proportion">0</property>
                                         <object class="wxFontPickerCtrl" expanded="1">
                                             <property name="bg"></property>
                                         <property name="proportion">0</property>
                                         <object class="wxFontPickerCtrl" expanded="1">
                                             <property name="bg"></property>
                                     </object>
                                     <object class="sizeritem" expanded="1">
                                         <property name="border">20</property>
                                     </object>
                                     <object class="sizeritem" expanded="1">
                                         <property name="border">20</property>
-                                        <property name="flag">wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</property>
+                                        <property name="flag">wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL</property>
                                         <property name="proportion">0</property>
                                         <object class="wxFilePickerCtrl" expanded="1">
                                             <property name="bg"></property>
                                         <property name="proportion">0</property>
                                         <object class="wxFilePickerCtrl" expanded="1">
                                             <property name="bg"></property>
                         </object>
                         <object class="notebookpage" expanded="1">
                             <property name="bitmap"></property>
                         </object>
                         <object class="notebookpage" expanded="1">
                             <property name="bitmap"></property>
-                            <property name="label">Drop Down Controls</property>
+                            <property name="label">Drop-down Controls</property>
                             <property name="select">0</property>
                             <object class="wxPanel" expanded="1">
                                 <property name="bg"></property>
                             <property name="select">0</property>
                             <object class="wxPanel" expanded="1">
                                 <property name="bg"></property>
index 541e63fb1ab23f64e5ecf10ad63c16a4c3145bab..08b31816ec1da1dde124a54156079130a3184bc4 100644 (file)
@@ -36,24 +36,24 @@ GUIFrame::GUIFrame( wxWindow* parent, wxWindowID id, const wxString& title, cons
        mbar = new wxMenuBar( 0 );
        fileMenu = new wxMenu();
        wxMenuItem* m_menuSeeScr;
        mbar = new wxMenuBar( 0 );
        fileMenu = new wxMenu();
        wxMenuItem* m_menuSeeScr;
-       m_menuSeeScr = new wxMenuItem( fileMenu, wxID_ZOOM_IN, wxString( _("&View screenshots...") ) + wxT('\t') + wxT("Ctrl+O"), _("Open the directory where the screenshots generated."), wxITEM_NORMAL );
+       m_menuSeeScr = new wxMenuItem( fileMenu, wxID_ZOOM_IN, wxString( _("&Open screenshots folder...") ) + wxT('\t') + wxT("Ctrl+O"), _("Opens the directory where the screenshots are saved."), wxITEM_NORMAL );
        fileMenu->Append( m_menuSeeScr );
        
        fileMenu->AppendSeparator();
        
        wxMenuItem* m_menuFileQuit;
        fileMenu->Append( m_menuSeeScr );
        
        fileMenu->AppendSeparator();
        
        wxMenuItem* m_menuFileQuit;
-       m_menuFileQuit = new wxMenuItem( fileMenu, wxID_EXIT, wxString( _("&Quit") ) + wxT('\t') + wxT("Alt+F4"), _("Quit the application"), wxITEM_NORMAL );
+       m_menuFileQuit = new wxMenuItem( fileMenu, wxID_EXIT, wxString( _("&Quit") ) + wxT('\t') + wxT("Alt+F4"), _("Quits the application."), wxITEM_NORMAL );
        fileMenu->Append( m_menuFileQuit );
        
        mbar->Append( fileMenu, _("&File") );
        
        captureMenu = new wxMenu();
        wxMenuItem* m_menuCapFullScreen;
        fileMenu->Append( m_menuFileQuit );
        
        mbar->Append( fileMenu, _("&File") );
        
        captureMenu = new wxMenu();
        wxMenuItem* m_menuCapFullScreen;
-       m_menuCapFullScreen = new wxMenuItem( captureMenu, idMenuCapFullScreen, wxString( _("&Full Screen") ) + wxT('\t') + wxT("Ctrl+Alt+F"), _("Can screenshot be taken properly?"), 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 );
        
        wxMenuItem* m_menuCapRect;
        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"), 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__ )
        #ifdef __WXMSW__
        m_menuCapRect->SetBitmaps( wxICON( play ) );
        #elif defined( __WXGTK__ )
@@ -62,7 +62,7 @@ GUIFrame::GUIFrame( wxWindow* parent, wxWindowID id, const wxString& title, cons
        captureMenu->Append( m_menuCapRect );
        
        wxMenuItem* m_menuEndCapRect;
        captureMenu->Append( m_menuCapRect );
        
        wxMenuItem* m_menuEndCapRect;
-       m_menuEndCapRect = new wxMenuItem( captureMenu, idMenuEndCapRect, wxString( _("Regions<End>") ) + wxT('\t') + wxT("Ctrl+Alt+E"), _("Stop 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__ )
        #ifdef __WXMSW__
        m_menuEndCapRect->SetBitmaps( wxICON( stop ) );
        #elif defined( __WXGTK__ )
@@ -72,14 +72,14 @@ GUIFrame::GUIFrame( wxWindow* parent, wxWindowID id, const wxString& title, cons
        m_menuEndCapRect->Enable( false );
        
        wxMenuItem* m_menuCapAll;
        m_menuEndCapRect->Enable( false );
        
        wxMenuItem* m_menuCapAll;
-       m_menuCapAll = new wxMenuItem( captureMenu, idMenuCapAll, wxString( _("Capture All") ) + wxT('\t') + wxT("Ctrl+Alt+A"), _("Take screenshot for all controls autoly."), wxITEM_NORMAL );
+       m_menuCapAll = new wxMenuItem( captureMenu, idMenuCapAll, wxString( _("Capture All") ) + wxT('\t') + wxT("Ctrl+Alt+A"), _("Takes screenshots for all controls automatically."), wxITEM_NORMAL );
        captureMenu->Append( m_menuCapAll );
        
        mbar->Append( captureMenu, _("&Capture") );
        
        helpMenu = new wxMenu();
        wxMenuItem* m_menuHelpAbout;
        captureMenu->Append( m_menuCapAll );
        
        mbar->Append( captureMenu, _("&Capture") );
        
        helpMenu = new wxMenu();
        wxMenuItem* m_menuHelpAbout;
-       m_menuHelpAbout = new wxMenuItem( helpMenu, wxID_ABOUT, wxString( _("&About...") ) + wxT('\t') + wxT("F1"), _("Show info about this application"), wxITEM_NORMAL );
+       m_menuHelpAbout = new wxMenuItem( helpMenu, wxID_ABOUT, wxString( _("&About...") ) + wxT('\t') + wxT("F1"), _("Shows info about this application."), wxITEM_NORMAL );
        helpMenu->Append( m_menuHelpAbout );
        
        mbar->Append( helpMenu, _("&Help") );
        helpMenu->Append( m_menuHelpAbout );
        
        mbar->Append( helpMenu, _("&Help") );
@@ -110,19 +110,19 @@ GUIFrame::GUIFrame( wxWindow* parent, wxWindowID id, const wxString& title, cons
        
        fgSizer1->Add( m_checkBox1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
        
        
        fgSizer1->Add( m_checkBox1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
        
-       m_checkBox2 = new wxCheckBox( m_panel1, wxID_ANY, _("Not checked"), wxDefaultPosition, wxDefaultSize, 0 );
+       m_checkBox2 = new wxCheckBox( m_panel1, wxID_ANY, _("Unchecked"), wxDefaultPosition, wxDefaultSize, 0 );
        
        m_checkBox2->SetToolTip( _("wxCheckBox") );
        
        fgSizer1->Add( m_checkBox2, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 20 );
        
        
        m_checkBox2->SetToolTip( _("wxCheckBox") );
        
        fgSizer1->Add( m_checkBox2, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 20 );
        
-       m_radioBtn1 = new wxRadioButton( m_panel1, wxID_ANY, _("Chosen"), wxDefaultPosition, wxDefaultSize, 0 );
+       m_radioBtn1 = new wxRadioButton( m_panel1, wxID_ANY, _("Checked"), wxDefaultPosition, wxDefaultSize, 0 );
        m_radioBtn1->SetValue( true ); 
        m_radioBtn1->SetToolTip( _("wxRadioButton") );
        
        fgSizer1->Add( m_radioBtn1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
        
        m_radioBtn1->SetValue( true ); 
        m_radioBtn1->SetToolTip( _("wxRadioButton") );
        
        fgSizer1->Add( m_radioBtn1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
        
-       m_radioBtn2 = new wxRadioButton( m_panel1, wxID_ANY, _("Not chosen"), wxDefaultPosition, wxDefaultSize, 0 );
+       m_radioBtn2 = new wxRadioButton( m_panel1, wxID_ANY, _("Unchecked"), wxDefaultPosition, wxDefaultSize, 0 );
        m_radioBtn2->SetToolTip( _("wxRadioButton") );
        
        fgSizer1->Add( m_radioBtn2, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
        m_radioBtn2->SetToolTip( _("wxRadioButton") );
        
        fgSizer1->Add( m_radioBtn2, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
@@ -164,7 +164,7 @@ GUIFrame::GUIFrame( wxWindow* parent, wxWindowID id, const wxString& title, cons
        
        fgSizer1->Add( m_slider1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 20 );
        
        
        fgSizer1->Add( m_slider1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 20 );
        
-       m_toggleBtn1 = new wxToggleButton( m_panel1, wxID_ANY, _("Not Toggled"), wxDefaultPosition, wxDefaultSize, 0 );
+       m_toggleBtn1 = new wxToggleButton( m_panel1, wxID_ANY, _("Untoggled"), wxDefaultPosition, wxDefaultSize, 0 );
        m_toggleBtn1->SetToolTip( _("wxToggleButton") );
        
        fgSizer1->Add( m_toggleBtn1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
        m_toggleBtn1->SetToolTip( _("wxToggleButton") );
        
        fgSizer1->Add( m_toggleBtn1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
@@ -274,7 +274,7 @@ GUIFrame::GUIFrame( wxWindow* parent, wxWindowID id, const wxString& title, cons
        m_panel2->SetSizer( fgSizer2 );
        m_panel2->Layout();
        fgSizer2->Fit( m_panel2 );
        m_panel2->SetSizer( fgSizer2 );
        m_panel2->Layout();
        fgSizer2->Fit( m_panel2 );
-       m_notebook1->AddPage( m_panel2, _("Choosing Controls"), true );
+       m_notebook1->AddPage( m_panel2, _("Multiple choice Controls"), false );
        m_panel3 = new wxPanel( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
        wxBoxSizer* bSizer2;
        bSizer2 = new wxBoxSizer( wxVERTICAL );
        m_panel3 = new wxPanel( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
        wxBoxSizer* bSizer2;
        bSizer2 = new wxBoxSizer( wxVERTICAL );
@@ -301,7 +301,7 @@ GUIFrame::GUIFrame( wxWindow* parent, wxWindowID id, const wxString& title, cons
        m_panel3->SetSizer( bSizer2 );
        m_panel3->Layout();
        bSizer2->Fit( m_panel3 );
        m_panel3->SetSizer( bSizer2 );
        m_panel3->Layout();
        bSizer2->Fit( m_panel3 );
-       m_notebook1->AddPage( m_panel3, _("Text Richtext"), false );
+       m_notebook1->AddPage( m_panel3, _("[Rich]Text Controls"), false );
        m_panel4 = new wxPanel( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
        wxFlexGridSizer* fgSizer5;
        fgSizer5 = new wxFlexGridSizer( 2, 2, 10, 10 );
        m_panel4 = new wxPanel( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
        wxFlexGridSizer* fgSizer5;
        fgSizer5 = new wxFlexGridSizer( 2, 2, 10, 10 );
@@ -317,12 +317,12 @@ GUIFrame::GUIFrame( wxWindow* parent, wxWindowID id, const wxString& title, cons
        m_fontPicker1->SetMaxPointSize( 100 ); 
        m_fontPicker1->SetToolTip( _("wxFontPickerCtrl") );
        
        m_fontPicker1->SetMaxPointSize( 100 ); 
        m_fontPicker1->SetToolTip( _("wxFontPickerCtrl") );
        
-       fgSizer5->Add( m_fontPicker1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
+       fgSizer5->Add( m_fontPicker1, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 20 );
        
        m_filePicker1 = new wxFilePickerCtrl( m_panel4, wxID_ANY, wxEmptyString, _("Select a file"), wxT("*.*"), wxDefaultPosition, wxDefaultSize, wxFLP_DEFAULT_STYLE, wxDefaultValidator, wxT("_FilePickerCtrl") );
        m_filePicker1->SetToolTip( _("wxFilePickerCtrl") );
        
        
        m_filePicker1 = new wxFilePickerCtrl( m_panel4, wxID_ANY, wxEmptyString, _("Select a file"), wxT("*.*"), wxDefaultPosition, wxDefaultSize, wxFLP_DEFAULT_STYLE, wxDefaultValidator, wxT("_FilePickerCtrl") );
        m_filePicker1->SetToolTip( _("wxFilePickerCtrl") );
        
-       fgSizer5->Add( m_filePicker1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
+       fgSizer5->Add( m_filePicker1, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 20 );
        
        
        fgSizer5->Add( 0, 0, 1, wxEXPAND, 5 );
        
        
        fgSizer5->Add( 0, 0, 1, wxEXPAND, 5 );
@@ -353,7 +353,7 @@ GUIFrame::GUIFrame( wxWindow* parent, wxWindowID id, const wxString& title, cons
        m_panel4->SetSizer( fgSizer5 );
        m_panel4->Layout();
        fgSizer5->Fit( m_panel4 );
        m_panel4->SetSizer( fgSizer5 );
        m_panel4->Layout();
        fgSizer5->Fit( m_panel4 );
-       m_notebook1->AddPage( m_panel4, _("Picker Controls"), false );
+       m_notebook1->AddPage( m_panel4, _("Picker Controls"), true );
        m_panel5 = new wxPanel( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
        wxFlexGridSizer* fgSizer4;
        fgSizer4 = new wxFlexGridSizer( 2, 2, 0, 0 );
        m_panel5 = new wxPanel( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
        wxFlexGridSizer* fgSizer4;
        fgSizer4 = new wxFlexGridSizer( 2, 2, 0, 0 );
@@ -444,7 +444,7 @@ GUIFrame::GUIFrame( wxWindow* parent, wxWindowID id, const wxString& title, cons
        m_panel5->SetSizer( fgSizer4 );
        m_panel5->Layout();
        fgSizer4->Fit( m_panel5 );
        m_panel5->SetSizer( fgSizer4 );
        m_panel5->Layout();
        fgSizer4->Fit( m_panel5 );
-       m_notebook1->AddPage( m_panel5, _("Drop Down Controls"), false );
+       m_notebook1->AddPage( m_panel5, _("Drop-down Controls"), false );
        
        bSizer0->Add( m_notebook1, 1, wxEXPAND | wxALL, 0 );
        
        
        bSizer0->Add( m_notebook1, 1, wxEXPAND | wxALL, 0 );
        
index c9966ff50234aec3228d6a19457ea0b284ffd00e..00f95ac13a5bc65d79fca4b51e1fab19e640107b 100644 (file)
 
 #include <wx/dir.h>
 #include <wx/aboutdlg.h>
 
 #include <wx/dir.h>
 #include <wx/aboutdlg.h>
+#include <wx/msgdlg.h>
+#include <wx/dcscreen.h>
+#include <wx/filesys.h>
+#include <wx/utils.h>
 
 #include "screenshot_main.h"
 #include "ctrlmaskout.h"
 #include "autocapture.h"
 
 
 #include "screenshot_main.h"
 #include "ctrlmaskout.h"
 #include "autocapture.h"
 
-/*
-// Global helper functions
-enum wxBuildInfoFormat
-{
-    short_f,
-    long_f
-};
-
-wxString wxbuildinfo(wxBuildInfoFormat format)
-{
-    wxString wxbuild(wxVERSION_STRING);
-
-    if (format == long_f )
-    {
-    #if defined(__WXMSW__)
-        wxbuild << _T("-Windows");
-    #elif defined(__WXMAC__)
-        wxbuild << _T("-Mac");
-    #elif defined(__UNIX__)
-        wxbuild << _T("-Linux");
-    #endif
-
-    #if wxUSE_UNICODE
-        wxbuild << _T("-Unicode build");
-    #else
-        wxbuild << _T("-ANSI build");
-    #endif // wxUSE_UNICODE
-    }
-
-    return wxbuild;
-}*/
-
 
 // ----------------------------------------------------------------------------
 // ScreenshotFrame
 
 // ----------------------------------------------------------------------------
 // ScreenshotFrame
@@ -75,11 +47,10 @@ ScreenshotFrame::ScreenshotFrame(wxFrame *frame)
 #endif
 {
 #if wxUSE_STATUSBAR
 #endif
 {
 #if wxUSE_STATUSBAR
-    statusBar->SetStatusText(_("Hello wxWidgets user!"), 0);
-    // statusBar->SetStatusText(wxbuildinfo(short_f), 1);
+    statusBar->SetStatusText(_("Welcome to the Automatic Screenshot Generator!"), 0);
 #endif
 
 #endif
 
-    // We will hold one during the whole life time of the main frame
+    // We will hold one ctrlmaskout during the whole life time of the main frame
     m_maskout = new CtrlMaskOut();
 
     // At the begining, we are not specifying the rect region
     m_maskout = new CtrlMaskOut();
 
     // At the begining, we are not specifying the rect region
@@ -102,9 +73,8 @@ ScreenshotFrame::~ScreenshotFrame()
 /*
     Do some further customization on some controls generated by wxFormBuilder.
 
 /*
     Do some further customization on some controls generated by wxFormBuilder.
 
-    Some controls can only be generated by wxFormBuilder without further
-    customization, e.g. unable to load a richtext file in a wxRichtextCtrl
-    during initialization.
+    wxFormBuilder does not allow customizations on some controls;
+    e.g. you cannot load a richtext file in a wxRichtextCtrl during initialization.
 
     Those customizations will be done here.
 */
 
     Those customizations will be done here.
 */
@@ -120,12 +90,9 @@ void ScreenshotFrame::InitFBControls()
 
     // Add a root and some nodes for wxTreeCtrl
     wxTreeItemId root = m_treeCtrl1->AddRoot(_("wxTreeCtrl"));
 
     // Add a root and some nodes for wxTreeCtrl
     wxTreeItemId root = m_treeCtrl1->AddRoot(_("wxTreeCtrl"));
-
     m_treeCtrl1->AppendItem(root, _("Node1"));
     m_treeCtrl1->AppendItem(root, _("Node1"));
-
     wxTreeItemId node2 = m_treeCtrl1->AppendItem(root, _("Node2"));
     m_treeCtrl1->AppendItem(node2, _("Node3"));
     wxTreeItemId node2 = m_treeCtrl1->AppendItem(root, _("Node2"));
     m_treeCtrl1->AppendItem(node2, _("Node3"));
-
     m_treeCtrl1->ExpandAll();
 
     // Add items into wxListCtrl
     m_treeCtrl1->ExpandAll();
 
     // Add items into wxListCtrl
@@ -137,7 +104,13 @@ void ScreenshotFrame::InitFBControls()
 
     // Load richtext.xml into wxRichtextCtrl
     m_richText1->LoadFile(_T("richtext.xml"));
 
     // Load richtext.xml into wxRichtextCtrl
     m_richText1->LoadFile(_T("richtext.xml"));
-    m_richText1->ShowPosition(335);
+    //m_richText1->ShowPosition(335);
+
+    // select first page in the main notebook ctrl
+    m_notebook1->ChangeSelection(0);
+
+    // set minimum size hints
+    GetSizer()->SetSizeHints(this);
 }
 
 
 }
 
 
@@ -161,21 +134,11 @@ void ScreenshotFrame::OnSeeScreenshots(wxCommandEvent& WXUNUSED(event))
     wxString defaultDir = m_maskout->GetDefaultDirectory();
 
     // Check if defaultDir already existed
     wxString defaultDir = m_maskout->GetDefaultDirectory();
 
     // Check if defaultDir already existed
-    if(!wxDirExists(defaultDir))
+    if (!wxDirExists(defaultDir))
         wxMkdir(defaultDir);
 
     // Use the native file browser to open defaultDir
         wxMkdir(defaultDir);
 
     // Use the native file browser to open defaultDir
-    #if defined(__WXMSW__)
-        wxExecute(_T("explorer ") + defaultDir);
-    #elif defined(__UNIX__) // nautilus is the GNOME file browser but works also for KDE
-        wxExecute(_T("nautilus ") + defaultDir);
-    #elif defined(_WXMAC_)
-        wxExecute(_T("open ") + defaultDir);
-    #else
-        wxMessageBox(_("Sorry, not Implemeted for this platform yet! Please open subdirectory \"")
-                    + defaultDir
-                    + _("\" manually.") );
-    #endif
+    wxLaunchDefaultBrowser(wxFileSystem::FileNameToURL(defaultDir));
 }
 
 void ScreenshotFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
 }
 
 void ScreenshotFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
@@ -199,6 +162,11 @@ void ScreenshotFrame::OnCaptureFullScreen(wxCommandEvent& WXUNUSED(event))
     dcScreen.GetSize(&screenWidth, &screenHeight);
 
     m_maskout->Capture(0, 0, screenWidth, screenHeight, _T("fullscreen"));
     dcScreen.GetSize(&screenWidth, &screenHeight);
 
     m_maskout->Capture(0, 0, screenWidth, screenHeight, _T("fullscreen"));
+
+    // Inform the user
+    wxMessageBox(_("A screenshot of the entire screen was saved as:\n\n  ") +
+                 m_maskout->GetDefaultDirectoryAbsPath() + wxFileName::GetPathSeparator() + "fullscreen.png",
+                 _("Full screen capture"), wxICON_INFORMATION|wxOK, this);
 }
 
 void ScreenshotFrame::OnCaptureRect(wxCommandEvent& WXUNUSED(event))
 }
 
 void ScreenshotFrame::OnCaptureRect(wxCommandEvent& WXUNUSED(event))
@@ -260,7 +228,7 @@ wxNotebookEvent& event
 #endif
 )
 {
 #endif
 )
 {
-    if(!capturingRect)
+    if (!capturingRect)
     {
         event.Skip();
         return;
     {
         event.Skip();
         return;
@@ -277,31 +245,35 @@ wxNotebookEvent& event
 
 void ScreenshotFrame::OnCaptureAllControls(wxCommandEvent& WXUNUSED(event))
 {
 
 void ScreenshotFrame::OnCaptureAllControls(wxCommandEvent& WXUNUSED(event))
 {
-    wxString dir = wxT("screenshots");
+    wxString dir = m_maskout->GetDefaultDirectoryAbsPath();
 
 
+    // check if there are other screenshots taken before
     if (wxFileName::DirExists(dir))
     {
     if (wxFileName::DirExists(dir))
     {
-        int choice = wxMessageBox(_("It seems that you have already generated some screenshots.\nClick YES to delete them all(recommended), NO to preserve them\nCANCEL to cancel this auto-capture(so you can save them elsewhere)."),
-                            _("Do you want to delete the existing screenshots?"),
+        int choice = wxMessageBox(_("It seems that you have already generated some screenshots.\nClick YES to delete them all (recommended) or NO to preserve them.\nClick CANCEL to cancel this auto-capture operation."),
+                            _("Delete existing screenshots?"),
                             wxYES_NO|wxCANCEL|wxICON_QUESTION, this);
         switch(choice)
         {
                             wxYES_NO|wxCANCEL|wxICON_QUESTION, this);
         switch(choice)
         {
-            case wxYES :
+            case wxYES:
             {
                 wxArrayString files;
                 wxDir::GetAllFiles(dir, &files, wxT("*.png"), wxDIR_FILES);
 
             {
                 wxArrayString files;
                 wxDir::GetAllFiles(dir, &files, wxT("*.png"), wxDIR_FILES);
 
+                // remove all PNG files from the screenshots folder
                 int n = files.GetCount();
                 for (int i = 0; i < n; ++i)
                     wxRemoveFile(files[i]);
             }
             break;
 
                 int n = files.GetCount();
                 for (int i = 0; i < n; ++i)
                     wxRemoveFile(files[i]);
             }
             break;
 
-            case wxNO : break;
-            case wxCANCEL : return;
+            case wxNO: break;
+            case wxCANCEL: return;
         }
     }
 
         }
     }
 
+    // proceed with the automatic screenshot capture
+
     this->Maximize();
 
     AutoCaptureMechanism auto_cap(m_notebook1);
     this->Maximize();
 
     AutoCaptureMechanism auto_cap(m_notebook1);
@@ -363,6 +335,6 @@ void ScreenshotFrame::OnCaptureAllControls(wxCommandEvent& WXUNUSED(event))
 
     auto_cap.CaptureAll();
 
 
     auto_cap.CaptureAll();
 
-    wxMessageBox(_("All screenshots are generated successfully.\nSelect \"File->See screenshots\" to see them."),
-                 _("Success"), wxOK, this);
+    wxMessageBox(_("All screenshots were generated successfully in the folder:\n  ") + dir,
+                 _("Success"), wxOK|wxICON_INFORMATION, this);
 }
 }