]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/statbar/statbar.cpp
Make it possible to use svn-find-native-eols script without svn checkout.
[wxWidgets.git] / samples / statbar / statbar.cpp
index 31a26ddfbbcbf921ded1e586ad5c9c19e2346688..d81ddd46060c53c616d94892acdd6d3f5c0d31e3 100644 (file)
@@ -50,7 +50,7 @@
 #include "wx/numdlg.h"
 #include "wx/fontdlg.h"
 
 #include "wx/numdlg.h"
 #include "wx/fontdlg.h"
 
-#ifndef __WXMSW__
+#ifndef wxHAS_IMAGES_IN_RESOURCES
     #include "../sample.xpm"
 #endif
 
     #include "../sample.xpm"
 #endif
 
@@ -218,6 +218,7 @@ enum
     StatusBar_SetPaneStyleNormal,
     StatusBar_SetPaneStyleFlat,
     StatusBar_SetPaneStyleRaised,
     StatusBar_SetPaneStyleNormal,
     StatusBar_SetPaneStyleFlat,
     StatusBar_SetPaneStyleRaised,
+    StatusBar_SetPaneStyleSunken,
 
     StatusBar_SetStyleSizeGrip,
     StatusBar_SetStyleEllipsizeStart,
 
     StatusBar_SetStyleSizeGrip,
     StatusBar_SetStyleEllipsizeStart,
@@ -256,6 +257,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
     EVT_MENU(StatusBar_SetPaneStyleNormal, MyFrame::OnSetPaneStyle)
     EVT_MENU(StatusBar_SetPaneStyleFlat, MyFrame::OnSetPaneStyle)
     EVT_MENU(StatusBar_SetPaneStyleRaised, MyFrame::OnSetPaneStyle)
     EVT_MENU(StatusBar_SetPaneStyleNormal, MyFrame::OnSetPaneStyle)
     EVT_MENU(StatusBar_SetPaneStyleFlat, MyFrame::OnSetPaneStyle)
     EVT_MENU(StatusBar_SetPaneStyleRaised, MyFrame::OnSetPaneStyle)
+    EVT_MENU(StatusBar_SetPaneStyleSunken, MyFrame::OnSetPaneStyle)
 
     EVT_MENU(StatusBar_SetStyleSizeGrip, MyFrame::OnSetStyle)
     EVT_MENU(StatusBar_SetStyleEllipsizeStart, MyFrame::OnSetStyle)
 
     EVT_MENU(StatusBar_SetStyleSizeGrip, MyFrame::OnSetStyle)
     EVT_MENU(StatusBar_SetStyleEllipsizeStart, MyFrame::OnSetStyle)
@@ -267,7 +269,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
                         MyFrame::OnUpdateForDefaultStatusbar)
     EVT_UPDATE_UI(StatusBar_Toggle, MyFrame::OnUpdateStatusBarToggle)
     EVT_UPDATE_UI_RANGE(StatusBar_SetPaneStyleNormal,
                         MyFrame::OnUpdateForDefaultStatusbar)
     EVT_UPDATE_UI(StatusBar_Toggle, MyFrame::OnUpdateStatusBarToggle)
     EVT_UPDATE_UI_RANGE(StatusBar_SetPaneStyleNormal,
-                        StatusBar_SetPaneStyleRaised,
+                        StatusBar_SetPaneStyleSunken,
                         MyFrame::OnUpdateSetPaneStyle)
     EVT_UPDATE_UI_RANGE(StatusBar_SetStyleSizeGrip, StatusBar_SetStyleShowTips,
                         MyFrame::OnUpdateSetStyle)
                         MyFrame::OnUpdateSetPaneStyle)
     EVT_UPDATE_UI_RANGE(StatusBar_SetStyleSizeGrip, StatusBar_SetStyleShowTips,
                         MyFrame::OnUpdateSetStyle)
@@ -396,6 +398,12 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
             wxT("&Raised"),
             wxT("Sets the style of the first field to raised look")
         );
             wxT("&Raised"),
             wxT("Sets the style of the first field to raised look")
         );
+    statbarPaneStyleMenu->AppendCheckItem
+        (
+            StatusBar_SetPaneStyleSunken,
+            wxT("&Sunken"),
+            wxT("Sets the style of the first field to sunken look")
+        );
     statbarMenu->Append(StatusBar_SetPaneStyle, wxT("Field style"),
                         statbarPaneStyleMenu);
 
     statbarMenu->Append(StatusBar_SetPaneStyle, wxT("Field style"),
                         statbarPaneStyleMenu);
 
@@ -722,6 +730,9 @@ void MyFrame::OnUpdateSetPaneStyle(wxUpdateUIEvent& event)
         case StatusBar_SetPaneStyleRaised:
             event.Check(m_statbarPaneStyle == wxSB_RAISED);
             break;
         case StatusBar_SetPaneStyleRaised:
             event.Check(m_statbarPaneStyle == wxSB_RAISED);
             break;
+        case StatusBar_SetPaneStyleSunken:
+            event.Check(m_statbarPaneStyle == wxSB_SUNKEN);
+            break;
     }
 }
 
     }
 }
 
@@ -738,6 +749,9 @@ void MyFrame::OnSetPaneStyle(wxCommandEvent& event)
         case StatusBar_SetPaneStyleRaised:
             m_statbarPaneStyle = wxSB_RAISED;
             break;
         case StatusBar_SetPaneStyleRaised:
             m_statbarPaneStyle = wxSB_RAISED;
             break;
+        case StatusBar_SetPaneStyleSunken:
+            m_statbarPaneStyle = wxSB_SUNKEN;
+            break;
     }
 
     ApplyPaneStyle();
     }
 
     ApplyPaneStyle();
@@ -947,11 +961,6 @@ void MyStatusBar::OnSize(wxSizeEvent& event)
         return;
 #endif
 
         return;
 #endif
 
-    // TEMPORARY HACK: TODO find a more general solution
-#ifdef wxStatusBarGeneric
-    wxStatusBar::OnSize(event);
-#endif
-
     wxRect rect;
     if (!GetFieldRect(Field_Checkbox, rect))
     {
     wxRect rect;
     if (!GetFieldRect(Field_Checkbox, rect))
     {