]> git.saurik.com Git - wxWidgets.git/commitdiff
Second part of '[ 1216148 ] cleanup: unused variables and declarations'.
authorWłodzimierz Skiba <abx@abx.art.pl>
Wed, 8 Jun 2005 14:49:36 +0000 (14:49 +0000)
committerWłodzimierz Skiba <abx@abx.art.pl>
Wed, 8 Jun 2005 14:49:36 +0000 (14:49 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34596 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

18 files changed:
src/gtk/dcclient.cpp
src/gtk/dialog.cpp
src/gtk/filedlg.cpp
src/gtk/frame.cpp
src/gtk/renderer.cpp
src/gtk/scrolbar.cpp
src/gtk/tbargtk.cpp
src/gtk/textctrl.cpp
src/gtk/tglbtn.cpp
src/gtk1/dcclient.cpp
src/gtk1/dialog.cpp
src/gtk1/filedlg.cpp
src/gtk1/frame.cpp
src/gtk1/renderer.cpp
src/gtk1/scrolbar.cpp
src/gtk1/tbargtk.cpp
src/gtk1/textctrl.cpp
src/gtk1/tglbtn.cpp

index 5eb1d99388d6893e8290b17599411f3cf16b1f55..339aab1a31c41aa9e2c3de4df13c382cd493e520 100644 (file)
@@ -143,8 +143,6 @@ void gdk_wx_draw_bitmap(GdkDrawable  *drawable,
 // Implement Pool of Graphic contexts. Creating them takes too much time.
 //-----------------------------------------------------------------------------
 
-#define GC_POOL_SIZE 200
-
 enum wxPoolGCType
 {
    wxGC_ERROR = 0,
index 9f8a2f64500241d956aa16be2273a42e73d4e465..115965adc4bd380586589c531dbcd68b5818f197 100644 (file)
 #include "wx/gtk/win_gtk.h"
 
 //-----------------------------------------------------------------------------
-// idle system
+// global data
 //-----------------------------------------------------------------------------
 
-extern void wxapp_install_idle_handler();
-extern bool g_isIdle;
 extern int g_openDialogs;
 
 //-----------------------------------------------------------------------------
@@ -49,9 +47,9 @@ IMPLEMENT_DYNAMIC_CLASS(wxDialog,wxTopLevelWindow)
 void wxDialog::Init()
 {
     m_returnCode = 0;
-    m_sizeSet = FALSE;
-    m_modalShowing = FALSE;
-    m_themeEnabled = TRUE;
+    m_sizeSet = false;
+    m_modalShowing = false;
+    m_themeEnabled = true;
 }
 
 wxDialog::wxDialog( wxWindow *parent,
@@ -92,7 +90,7 @@ void wxDialog::OnCancel( wxCommandEvent &WXUNUSED(event) )
     else
     {
         SetReturnCode(wxID_CANCEL);
-        Show(FALSE);
+        Show(false);
     }
 }
 
@@ -107,7 +105,7 @@ void wxDialog::OnOK( wxCommandEvent &WXUNUSED(event) )
         else
         {
             SetReturnCode(wxID_OK);
-            Show(FALSE);
+            Show(false);
         }
     }
 }
@@ -204,12 +202,12 @@ int wxDialog::ShowModal()
     }
 
     wxBusyCursorSuspender cs; // temporarily suppress the busy cursor
-    
-    Show( TRUE );
+
+    Show( true );
 
     SetFocus();
 
-    m_modalShowing = TRUE;
+    m_modalShowing = true;
 
     g_openDialogs++;
 
@@ -232,9 +230,9 @@ void wxDialog::EndModal( int retCode )
         return;
     }
 
-    m_modalShowing = FALSE;
+    m_modalShowing = false;
 
     gtk_main_quit();
 
-    Show( FALSE );
+    Show( false );
 }
index 04040bd548ed0555849e2f6e55e728df38724953..500acf64ef8f7d4c96944784968ab1d930872bfa 100644 (file)
@@ -39,7 +39,6 @@
 //-----------------------------------------------------------------------------
 
 extern void wxapp_install_idle_handler();
-extern bool g_isIdle;
 
 //-----------------------------------------------------------------------------
 // "clicked" for OK-button
index 1bf86a39a5f9f74d21efbb6114c526787b27de2e..2e602ab9dc4d440f075b9a28864a2e657d274f82 100644 (file)
@@ -58,7 +58,6 @@ const int wxPLACE_HOLDER   = 0;
 
 extern void wxapp_install_idle_handler();
 extern bool g_isIdle;
-extern int g_openDialogs;
 
 // ----------------------------------------------------------------------------
 // event tables
@@ -85,7 +84,7 @@ static void gtk_menu_attached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *
 {
     if (!win->m_hasVMT) return;
 
-    win->m_menuBarDetached = FALSE;
+    win->m_menuBarDetached = false;
     win->GtkUpdateSize();
 }
 }
@@ -105,7 +104,7 @@ static void gtk_menu_detached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *
     // Raise the client area area
     gdk_window_raise( win->m_wxwindow->window );
 
-    win->m_menuBarDetached = TRUE;
+    win->m_menuBarDetached = true;
     win->GtkUpdateSize();
 }
 }
@@ -122,7 +121,7 @@ static void gtk_toolbar_attached_callback( GtkWidget *WXUNUSED(widget), GtkWidge
 {
     if (!win->m_hasVMT) return;
 
-    win->m_toolBarDetached = FALSE;
+    win->m_toolBarDetached = false;
     win->GtkUpdateSize();
 }
 }
@@ -142,7 +141,7 @@ static void gtk_toolbar_detached_callback( GtkWidget *WXUNUSED(widget), GtkWidge
     // Raise the client area area
     gdk_window_raise( win->m_wxwindow->window );
 
-    win->m_toolBarDetached = TRUE;
+    win->m_toolBarDetached = true;
     win->GtkUpdateSize();
 }
 }
@@ -176,7 +175,7 @@ static void wxInsertChildInFrame( wxFrame* parent, wxWindow* child )
                          child->m_y,
                          child->m_width,
                          child->m_height );
-                         
+
 #if wxUSE_TOOLBAR_NATIVE
         // We connect to these events for recalculating the client area
         // space when the toolbar is floating
@@ -204,7 +203,7 @@ static void wxInsertChildInFrame( wxFrame* parent, wxWindow* child )
                          child->m_width,
                          child->m_height );
     }
-    
+
     // Resize on OnInternalIdle
     parent->GtkUpdateSize();
 }
@@ -215,8 +214,8 @@ static void wxInsertChildInFrame( wxFrame* parent, wxWindow* child )
 
 void wxFrame::Init()
 {
-    m_menuBarDetached = FALSE;
-    m_toolBarDetached = FALSE;
+    m_menuBarDetached = false;
+    m_toolBarDetached = false;
     m_menuBarHeight = 2;
 }
 
@@ -231,13 +230,13 @@ bool wxFrame::Create( wxWindow *parent,
     bool rt = wxTopLevelWindow::Create(parent, id, title, pos, sizeOrig,
                                        style, name);
     m_insertCallback = (wxInsertChildFunction) wxInsertChildInFrame;
-    
+
     return rt;
 }
 
 wxFrame::~wxFrame()
 {
-    m_isBeingDeleted = TRUE;
+    m_isBeingDeleted = true;
     DeleteAllBars();
 }
 
@@ -352,7 +351,7 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y),
 
     // avoid recursions
     if (m_resizing) return;
-    m_resizing = TRUE;
+    m_resizing = true;
 
     // this shouldn't happen: wxFrame, wxMDIParentFrame and wxMDIChildFrame have m_wxwindow
     wxASSERT_MSG( (m_wxwindow != NULL), wxT("invalid frame") );
@@ -498,7 +497,7 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y),
     }
 #endif // wxUSE_STATUSBAR
 
-    m_sizeSet = TRUE;
+    m_sizeSet = true;
 
     // send size event to frame
     wxSizeEvent event( wxSize(m_width,m_height), GetId() );
@@ -515,7 +514,7 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y),
     }
 #endif // wxUSE_STATUSBAR
 
-    m_resizing = FALSE;
+    m_resizing = false;
 }
 
 void wxFrame::OnInternalIdle()
@@ -602,7 +601,7 @@ void wxFrame::AttachMenuBar( wxMenuBar *menuBar )
             gtk_signal_connect( GTK_OBJECT(menuBar->m_widget), "child_detached",
                 GTK_SIGNAL_FUNC(gtk_menu_detached_callback), (gpointer)this );
         }
-        
+
         gtk_widget_show( m_frameMenuBar->m_widget );
 
         UpdateMenuBarSize();
@@ -620,7 +619,7 @@ void wxFrame::UpdateMenuBarSize()
 
     req.width = 2;
     req.height = 2;
-    
+
     // this is called after Remove with a NULL m_frameMenuBar
     if ( m_frameMenuBar )
     (* GTK_WIDGET_CLASS( GTK_OBJECT_GET_CLASS(m_frameMenuBar->m_widget) )->size_request )
@@ -641,11 +640,11 @@ wxToolBar* wxFrame::CreateToolBar( long style, wxWindowID id, const wxString& na
 {
     wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") );
 
-    m_insertInClientArea = FALSE;
+    m_insertInClientArea = false;
 
     m_frameToolBar = wxFrameBase::CreateToolBar( style, id, name );
 
-    m_insertInClientArea = TRUE;
+    m_insertInClientArea = true;
 
     GtkUpdateSize();
 
@@ -700,10 +699,10 @@ wxStatusBar* wxFrame::CreateStatusBar(int number,
 void wxFrame::SetStatusBar(wxStatusBar *statbar)
 {
     bool hadStatBar = m_frameStatusBar != NULL;
-    
+
     wxFrameBase::SetStatusBar(statbar);
-    
-    if (hadStatBar && !m_frameStatusBar) 
+
+    if (hadStatBar && !m_frameStatusBar)
         GtkUpdateSize();
 }
 
index 67768b216c95d47f1a3137e6cf819657b0164610..7c0a375e803e904d49d93fefc9505c69c3aedff2 100644 (file)
     #define WXUNUSED_IN_GTK1(arg)
 #endif
 
+// RR: After a correction to the orientation of the sash
+//     this doesn't seem to be required anymore and it
+//     seems to confuse some themes so USE_ERASE_RECT=0
+#define USE_ERASE_RECT 0
+
 // ----------------------------------------------------------------------------
 // wxRendererGTK: our wxRendererNative implementation
 // ----------------------------------------------------------------------------
@@ -196,7 +201,7 @@ wxRendererGTK::DrawTreeItemButton(wxWindow* win,
         state = GTK_STATE_PRELIGHT;
     else
         state = GTK_STATE_NORMAL;
-        
+
     // VZ: I don't know how to get the size of the expander so as to centre it
     //     in the given rectangle, +2/3 below is just what looks good here...
     gtk_paint_expander
@@ -237,7 +242,7 @@ static int GetGtkSplitterFullSize()
 
     gint handle_size;
     gtk_widget_style_get (s_paned, "handle_size", &handle_size, NULL);
-      
+
     return handle_size;
 #else
     return SASH_SIZE + SASH_MARGIN;
@@ -282,14 +287,17 @@ wxRendererGTK::DrawSplitterSash(wxWindow *win,
         // window not realized yet
         return;
     }
-    
+
     wxCoord full_size = GetGtkSplitterFullSize();
 
     // are we drawing vertical or horizontal splitter?
     const bool isVert = orient == wxVERTICAL;
 
     GdkRectangle rect;
+#if USE_ERASE_RECT
     GdkRectangle erase_rect;
+#endif
+
     if ( isVert )
     {
         int h = win->GetClientSize().GetHeight();
@@ -299,10 +307,12 @@ wxRendererGTK::DrawSplitterSash(wxWindow *win,
         rect.width = full_size;
         rect.height = h;
 
+#if USE_ERASE_RECT
         erase_rect.x = position;
         erase_rect.y = 0;
         erase_rect.width = full_size;
         erase_rect.height = h;
+#endif
     }
     else // horz
     {
@@ -313,17 +323,15 @@ wxRendererGTK::DrawSplitterSash(wxWindow *win,
         rect.height = full_size;
         rect.width = w;
 
+#if USE_ERASE_RECT
         erase_rect.y = position;
         erase_rect.x = 0;
         erase_rect.height = full_size;
         erase_rect.width = w;
+#endif
     }
 
-#if 0
-    // RR: After a correction to the orientation of the sash
-    //     this doesn't seem to be required anymore and it
-    //     seems to confuse some themes
-
+#if USE_ERASE_RECT
     // we must erase everything first, otherwise the garbage
     // from the old sash is left when dragging it
     gtk_paint_flat_box
index 7c8b236b7f542e55e26276686c575406eeaa0509..8e327cb62e0db8c720838f71051ea77832aac750 100644 (file)
@@ -35,7 +35,6 @@ extern bool g_isIdle;
 //-----------------------------------------------------------------------------
 
 extern bool   g_blockEventsOnDrag;
-extern bool   g_blockEventsOnScroll;
 static wxEventType g_currentUpDownEvent = wxEVT_NULL;
 
 static const float sensitivity = 0.02;
@@ -71,13 +70,13 @@ static void gtk_scrollbar_callback( GtkAdjustment *adjust,
     // throw a LINEUP / LINEDOWN event if necessary
     if (g_currentUpDownEvent != wxEVT_NULL)
     {
-        wxScrollEvent event( g_currentUpDownEvent, win->GetId(), value, orient );   
+        wxScrollEvent event( g_currentUpDownEvent, win->GetId(), value, orient );
         event.SetEventObject( win );
         win->GetEventHandler()->ProcessEvent( event );
-      }
-    
-       // throw other event (wxEVT_SCROLL_THUMBTRACK)
-       wxScrollEvent event( command, win->GetId(), value, orient );
+    }
+
+    // throw other event (wxEVT_SCROLL_THUMBTRACK)
+    wxScrollEvent event( command, win->GetId(), value, orient );
     event.SetEventObject( win );
     win->GetEventHandler()->ProcessEvent( event );
 
@@ -105,9 +104,9 @@ static gint gtk_scrollbar_button_press_callback( GtkRange *widget,
     {
         int scroll_height, mouse_pos;
 
-        // get the mouse position when the click is done 
-        if (win->HasFlag(wxSB_VERTICAL))        
-        {   
+        // get the mouse position when the click is done
+        if (win->HasFlag(wxSB_VERTICAL))
+        {
             scroll_height = GTK_WIDGET(widget)->allocation.height - 16;
             mouse_pos = (int)gdk_event->y;
         }
@@ -116,7 +115,7 @@ static gint gtk_scrollbar_button_press_callback( GtkRange *widget,
             scroll_height = GTK_WIDGET(widget)->allocation.width - 16;
             mouse_pos = (int)gdk_event->x;
         }
-       
+
         // compare mouse position to scrollbar height
         if  (mouse_pos > scroll_height)
             g_currentUpDownEvent = wxEVT_SCROLL_LINEDOWN;
@@ -157,7 +156,7 @@ gtk_scrollbar_button_release_callback( GtkRange *WXUNUSED(widget),
         win->GetEventHandler()->ProcessEvent( event );
     }
 
-    win->m_isScrolling = FALSE;
+    win->m_isScrolling = false;
 
     // reset the LINEUP/LINEDOWN flag when the mouse button is released
     g_currentUpDownEvent = wxEVT_NULL;
@@ -180,14 +179,14 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id,
            const wxPoint& pos, const wxSize& size,
            long style, const wxValidator& validator, const wxString& name )
 {
-    m_needParent = TRUE;
-    m_acceptsFocus = TRUE;
+    m_needParent = true;
+    m_acceptsFocus = true;
 
     if (!PreCreation( parent, pos, size ) ||
         !CreateBase( parent, id, pos, size, style, validator, name ))
     {
         wxFAIL_MSG( wxT("wxScrollBar creation failed") );
-        return FALSE;
+        return false;
     }
 
     m_oldPos = 0.0;
@@ -216,7 +215,7 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id,
 
     PostCreation(size);
 
-    return TRUE;
+    return true;
 }
 
 int wxScrollBar::GetThumbPosition() const
index c62103dc535ea70a41f0f107a7f8ee0a58e215cd..46cc7afe7fa448d717add1004fdc0413b0c9d50f 100644 (file)
@@ -32,8 +32,6 @@
 #include <glib.h>
 #include "wx/gtk/private.h"
 
-extern GdkFont *GtkGetDefaultGuiFont();
-
 // ----------------------------------------------------------------------------
 // globals
 // ----------------------------------------------------------------------------
@@ -271,7 +269,7 @@ wxToolBarToolBase *wxToolBar::CreateTool(wxControl *control)
 void wxToolBar::Init()
 {
     m_toolbar = (GtkToolbar *)NULL;
-    m_blockEvent = FALSE;
+    m_blockEvent = false;
     m_defaultWidth = 32;
     m_defaultHeight = 32;
 }
@@ -287,7 +285,7 @@ bool wxToolBar::Create( wxWindow *parent,
                         long style,
                         const wxString& name )
 {
-    m_needParent = TRUE;
+    m_needParent = true;
     m_insertCallback = (wxInsertChildFunction)wxInsertChildInToolBar;
 
     if ( !PreCreation( parent, pos, size ) ||
@@ -295,7 +293,7 @@ bool wxToolBar::Create( wxWindow *parent,
     {
         wxFAIL_MSG( wxT("wxToolBar creation failed") );
 
-        return FALSE;
+        return false;
     }
 
 #ifdef __WXGTK20__
@@ -344,7 +342,7 @@ bool wxToolBar::Create( wxWindow *parent,
 
     PostCreation(size);
 
-    return TRUE;
+    return true;
 }
 
 void wxToolBar::GtkSetStyle()
@@ -383,13 +381,13 @@ bool wxToolBar::DoInsertTool(size_t pos, wxToolBarToolBase *toolBase)
         {
             wxBitmap bitmap = tool->GetNormalBitmap();
 
-            wxCHECK_MSG( bitmap.Ok(), FALSE,
+            wxCHECK_MSG( bitmap.Ok(), false,
                          wxT("invalid bitmap for wxToolBar icon") );
 
-            wxCHECK_MSG( bitmap.GetBitmap() == NULL, FALSE,
+            wxCHECK_MSG( bitmap.GetBitmap() == NULL, false,
                          wxT("wxToolBar doesn't support GdkBitmap") );
 
-            wxCHECK_MSG( bitmap.GetPixmap() != NULL, FALSE,
+            wxCHECK_MSG( bitmap.GetPixmap() != NULL, false,
                          wxT("wxToolBar::Add needs a wxBitmap") );
 
             GtkWidget *tool_pixmap = (GtkWidget *)NULL;
@@ -410,7 +408,7 @@ bool wxToolBar::DoInsertTool(size_t pos, wxToolBarToolBase *toolBase)
                 GdkBitmap *mask = (GdkBitmap *)NULL;
                 if ( bitmap.GetMask() )
                     mask = bitmap.GetMask()->GetBitmap();
-            
+
                 tool_pixmap = gtk_pixmap_new( pixmap, mask );
                 gtk_pixmap_set_build_insensitive( GTK_PIXMAP(tool_pixmap), TRUE );
             }
@@ -452,7 +450,7 @@ bool wxToolBar::DoInsertTool(size_t pos, wxToolBarToolBase *toolBase)
                         // this is the first button in the radio button group,
                         // it will be toggled automatically by GTK so bring the
                         // internal flag in sync
-                        tool->Toggle(TRUE);
+                        tool->Toggle(true);
                     }
                 }
 
@@ -478,7 +476,7 @@ bool wxToolBar::DoInsertTool(size_t pos, wxToolBarToolBase *toolBase)
                 {
                     wxFAIL_MSG( _T("gtk_toolbar_insert_element() failed") );
 
-                    return FALSE;
+                    return false;
                 }
 
                 gtk_signal_connect( GTK_OBJECT(tool->m_item),
@@ -496,7 +494,7 @@ bool wxToolBar::DoInsertTool(size_t pos, wxToolBarToolBase *toolBase)
             gtk_toolbar_insert_space( m_toolbar, posGtk );
 
             // skip the rest
-            return TRUE;
+            return true;
 
         case wxTOOL_STYLE_CONTROL:
             gtk_toolbar_insert_widget(
@@ -516,7 +514,7 @@ bool wxToolBar::DoInsertTool(size_t pos, wxToolBarToolBase *toolBase)
     m_height = req.height + 2*m_yMargin;
     InvalidateBestSize();
 
-    return TRUE;
+    return true;
 }
 
 bool wxToolBar::DoDeleteTool(size_t pos, wxToolBarToolBase *toolBase)
@@ -541,7 +539,7 @@ bool wxToolBar::DoDeleteTool(size_t pos, wxToolBarToolBase *toolBase)
     }
 
     InvalidateBestSize();
-    return TRUE;
+    return true;
 }
 
 // ----------------------------------------------------------------------------
@@ -567,11 +565,11 @@ void wxToolBar::DoToggleTool( wxToolBarToolBase *toolBase, bool toggle )
     {
         tool->SetPixmap(tool->GetBitmap());
 
-        m_blockEvent = TRUE;
+        m_blockEvent = true;
 
         gtk_toggle_button_set_state( GTK_TOGGLE_BUTTON(item), toggle );
 
-        m_blockEvent = FALSE;
+        m_blockEvent = false;
     }
 }
 
index 52c1f01d66f0bb8150ca4b6f0b0c5a32b1833aa1..e8525301078558339a6bbefaf2106f0f1511afb3 100644 (file)
@@ -42,7 +42,6 @@ extern bool g_isIdle;
 // data
 //-----------------------------------------------------------------------------
 
-extern bool       g_blockEventsOnDrag;
 extern wxCursor   g_globalCursor;
 extern wxWindowGTK *g_delayedFocus;
 
index 1bf01efef71d7fc91f9d83236dab0405316f7971..cf8a289b9e722b95a4bb249fcf013d460614d6de 100644 (file)
@@ -24,24 +24,23 @@ extern void wxapp_install_idle_handler();
 extern bool g_isIdle;
 extern bool      g_blockEventsOnDrag;
 extern wxCursor   g_globalCursor;
-extern wxWindowGTK *g_delayedFocus;
 
 extern "C" {
 static void gtk_togglebutton_clicked_callback(GtkWidget *WXUNUSED(widget), wxToggleButton *cb)
 {
-   if (g_isIdle)
-      wxapp_install_idle_handler();
-
-   if (!cb->m_hasVMT || g_blockEventsOnDrag)
-      return;
-      
-   if (cb->m_blockEvent) return;
-
-   // Generate a wx event.
-   wxCommandEvent event(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, cb->GetId());
-   event.SetInt(cb->GetValue());
-   event.SetEventObject(cb);
-   cb->GetEventHandler()->ProcessEvent(event);
+    if (g_isIdle)
+        wxapp_install_idle_handler();
+
+    if (!cb->m_hasVMT || g_blockEventsOnDrag)
+        return;
+
+    if (cb->m_blockEvent) return;
+
+    // Generate a wx event.
+    wxCommandEvent event(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, cb->GetId());
+    event.SetInt(cb->GetValue());
+    event.SetEventObject(cb);
+    cb->GetEventHandler()->ProcessEvent(event);
 }
 }
 
@@ -59,18 +58,18 @@ bool wxToggleBitmapButton::Create(wxWindow *parent, wxWindowID id,
                             const wxValidator& validator,
                             const wxString &name)
 {
-    m_needParent = TRUE;
-    m_acceptsFocus = TRUE;
-   
-    m_blockEvent = FALSE;
+    m_needParent = true;
+    m_acceptsFocus = true;
+
+    m_blockEvent = false;
 
     if (!PreCreation(parent, pos, size) ||
        !CreateBase(parent, id, pos, size, style, validator, name ))
     {
         wxFAIL_MSG(wxT("wxToggleBitmapButton creation failed"));
-        return FALSE;
+        return false;
     }
-    
+
     m_bitmap = label;
 
     // Create the gtk widget.
@@ -92,32 +91,32 @@ bool wxToggleBitmapButton::Create(wxWindow *parent, wxWindowID id,
 
     PostCreation(size);
 
-    return TRUE;
+    return true;
 }
 
 // void SetValue(bool state)
 // Set the value of the toggle button.
 void wxToggleBitmapButton::SetValue(bool state)
 {
-   wxCHECK_RET(m_widget != NULL, wxT("invalid toggle button"));
+    wxCHECK_RET(m_widget != NULL, wxT("invalid toggle button"));
 
-   if (state == GetValue())
-      return;
+    if (state == GetValue())
+        return;
 
-   m_blockEvent = TRUE;
+    m_blockEvent = true;
 
-   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m_widget), state);
+    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m_widget), state);
 
-   m_blockEvent = FALSE;
+    m_blockEvent = false;
 }
 
 // bool GetValue() const
 // Get the value of the toggle button.
 bool wxToggleBitmapButton::GetValue() const
 {
-   wxCHECK_MSG(m_widget != NULL, FALSE, wxT("invalid toggle button"));
+    wxCHECK_MSG(m_widget != NULL, false, wxT("invalid toggle button"));
 
-   return GTK_TOGGLE_BUTTON(m_widget)->active;
+    return GTK_TOGGLE_BUTTON(m_widget)->active;
 }
 
 void wxToggleBitmapButton::SetLabel(const wxBitmap& label)
@@ -126,7 +125,7 @@ void wxToggleBitmapButton::SetLabel(const wxBitmap& label)
 
     m_bitmap = label;
     InvalidateBestSize();
-    
+
     OnSetBitmap();
 }
 
@@ -152,14 +151,14 @@ void wxToggleBitmapButton::OnSetBitmap()
     }
 }
 
-bool wxToggleBitmapButton::Enable(bool enable /*=TRUE*/)
+bool wxToggleBitmapButton::Enable(bool enable /*=true*/)
 {
     if (!wxControl::Enable(enable))
-        return FALSE;
+        return false;
 
     gtk_widget_set_sensitive(BUTTON_CHILD(m_widget), enable);
 
-    return TRUE;
+    return true;
 }
 
 void wxToggleBitmapButton::DoApplyWidgetStyle(GtkRcStyle *style)
@@ -176,7 +175,7 @@ bool wxToggleBitmapButton::IsOwnGtkWindow(GdkWindow *window)
 void wxToggleBitmapButton::OnInternalIdle()
 {
     wxCursor cursor = m_cursor;
-    
+
     if (g_globalCursor.Ok())
         cursor = g_globalCursor;
 
@@ -200,7 +199,7 @@ void wxToggleBitmapButton::OnInternalIdle()
 wxSize wxToggleBitmapButton::DoGetBestSize() const
 {
     wxSize best;
-    
+
     if (m_bitmap.Ok())
     {
         int border = HasFlag(wxNO_BORDER) ? 4 : 10;
@@ -232,56 +231,56 @@ bool wxToggleButton::Create(wxWindow *parent, wxWindowID id,
                             const wxValidator& validator,
                             const wxString &name)
 {
-   m_needParent = TRUE;
-   m_acceptsFocus = TRUE;
-   
-   m_blockEvent = FALSE;
+    m_needParent = true;
+    m_acceptsFocus = true;
 
-   if (!PreCreation(parent, pos, size) ||
-       !CreateBase(parent, id, pos, size, style, validator, name )) {
-      wxFAIL_MSG(wxT("wxToggleButton creation failed"));
-      return FALSE;
-   }
+    m_blockEvent = false;
 
-   wxControl::SetLabel(label);
+    if (!PreCreation(parent, pos, size) ||
+        !CreateBase(parent, id, pos, size, style, validator, name )) {
+        wxFAIL_MSG(wxT("wxToggleButton creation failed"));
+        return false;
+    }
 
-   // Create the gtk widget.
-   m_widget = gtk_toggle_button_new_with_label( wxGTK_CONV( m_label ) );
+    wxControl::SetLabel(label);
 
-   gtk_signal_connect(GTK_OBJECT(m_widget), "clicked",
-                      GTK_SIGNAL_FUNC(gtk_togglebutton_clicked_callback),
-                      (gpointer *)this);
+    // Create the gtk widget.
+    m_widget = gtk_toggle_button_new_with_label( wxGTK_CONV( m_label ) );
 
-   m_parent->DoAddChild(this);
+    gtk_signal_connect(GTK_OBJECT(m_widget), "clicked",
+                       GTK_SIGNAL_FUNC(gtk_togglebutton_clicked_callback),
+                       (gpointer *)this);
 
-   PostCreation(size);
+    m_parent->DoAddChild(this);
 
-   return TRUE;
+    PostCreation(size);
+
+    return true;
 }
 
 // void SetValue(bool state)
 // Set the value of the toggle button.
 void wxToggleButton::SetValue(bool state)
 {
-   wxCHECK_RET(m_widget != NULL, wxT("invalid toggle button"));
+    wxCHECK_RET(m_widget != NULL, wxT("invalid toggle button"));
 
-   if (state == GetValue())
-      return;
+    if (state == GetValue())
+        return;
 
-   m_blockEvent = TRUE;
+    m_blockEvent = true;
 
-   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m_widget), state);
+    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m_widget), state);
 
-   m_blockEvent = FALSE;
+    m_blockEvent = false;
 }
 
 // bool GetValue() const
 // Get the value of the toggle button.
 bool wxToggleButton::GetValue() const
 {
-   wxCHECK_MSG(m_widget != NULL, FALSE, wxT("invalid toggle button"));
+    wxCHECK_MSG(m_widget != NULL, false, wxT("invalid toggle button"));
 
-   return GTK_TOGGLE_BUTTON(m_widget)->active;
+    return GTK_TOGGLE_BUTTON(m_widget)->active;
 }
 
 void wxToggleButton::SetLabel(const wxString& label)
@@ -293,14 +292,14 @@ void wxToggleButton::SetLabel(const wxString& label)
     gtk_label_set(GTK_LABEL(BUTTON_CHILD(m_widget)), wxGTK_CONV( GetLabel() ) );
 }
 
-bool wxToggleButton::Enable(bool enable /*=TRUE*/)
+bool wxToggleButton::Enable(bool enable /*=true*/)
 {
     if (!wxControl::Enable(enable))
-        return FALSE;
+        return false;
 
     gtk_widget_set_sensitive(BUTTON_CHILD(m_widget), enable);
 
-    return TRUE;
+    return true;
 }
 
 void wxToggleButton::DoApplyWidgetStyle(GtkRcStyle *style)
@@ -317,7 +316,7 @@ bool wxToggleButton::IsOwnGtkWindow(GdkWindow *window)
 void wxToggleButton::OnInternalIdle()
 {
     wxCursor cursor = m_cursor;
-    
+
     if (g_globalCursor.Ok())
         cursor = g_globalCursor;
 
@@ -341,12 +340,12 @@ void wxToggleButton::OnInternalIdle()
 wxSize wxToggleButton::DoGetBestSize() const
 {
     wxSize ret(wxControl::DoGetBestSize());
-   
+
     if (!HasFlag(wxBU_EXACTFIT))
     {
         if (ret.x < 80) ret.x = 80;
     }
-    
+
     CacheBestSize(ret);
     return ret;
 }
index 5eb1d99388d6893e8290b17599411f3cf16b1f55..339aab1a31c41aa9e2c3de4df13c382cd493e520 100644 (file)
@@ -143,8 +143,6 @@ void gdk_wx_draw_bitmap(GdkDrawable  *drawable,
 // Implement Pool of Graphic contexts. Creating them takes too much time.
 //-----------------------------------------------------------------------------
 
-#define GC_POOL_SIZE 200
-
 enum wxPoolGCType
 {
    wxGC_ERROR = 0,
index 9f8a2f64500241d956aa16be2273a42e73d4e465..115965adc4bd380586589c531dbcd68b5818f197 100644 (file)
 #include "wx/gtk/win_gtk.h"
 
 //-----------------------------------------------------------------------------
-// idle system
+// global data
 //-----------------------------------------------------------------------------
 
-extern void wxapp_install_idle_handler();
-extern bool g_isIdle;
 extern int g_openDialogs;
 
 //-----------------------------------------------------------------------------
@@ -49,9 +47,9 @@ IMPLEMENT_DYNAMIC_CLASS(wxDialog,wxTopLevelWindow)
 void wxDialog::Init()
 {
     m_returnCode = 0;
-    m_sizeSet = FALSE;
-    m_modalShowing = FALSE;
-    m_themeEnabled = TRUE;
+    m_sizeSet = false;
+    m_modalShowing = false;
+    m_themeEnabled = true;
 }
 
 wxDialog::wxDialog( wxWindow *parent,
@@ -92,7 +90,7 @@ void wxDialog::OnCancel( wxCommandEvent &WXUNUSED(event) )
     else
     {
         SetReturnCode(wxID_CANCEL);
-        Show(FALSE);
+        Show(false);
     }
 }
 
@@ -107,7 +105,7 @@ void wxDialog::OnOK( wxCommandEvent &WXUNUSED(event) )
         else
         {
             SetReturnCode(wxID_OK);
-            Show(FALSE);
+            Show(false);
         }
     }
 }
@@ -204,12 +202,12 @@ int wxDialog::ShowModal()
     }
 
     wxBusyCursorSuspender cs; // temporarily suppress the busy cursor
-    
-    Show( TRUE );
+
+    Show( true );
 
     SetFocus();
 
-    m_modalShowing = TRUE;
+    m_modalShowing = true;
 
     g_openDialogs++;
 
@@ -232,9 +230,9 @@ void wxDialog::EndModal( int retCode )
         return;
     }
 
-    m_modalShowing = FALSE;
+    m_modalShowing = false;
 
     gtk_main_quit();
 
-    Show( FALSE );
+    Show( false );
 }
index 04040bd548ed0555849e2f6e55e728df38724953..500acf64ef8f7d4c96944784968ab1d930872bfa 100644 (file)
@@ -39,7 +39,6 @@
 //-----------------------------------------------------------------------------
 
 extern void wxapp_install_idle_handler();
-extern bool g_isIdle;
 
 //-----------------------------------------------------------------------------
 // "clicked" for OK-button
index 1bf86a39a5f9f74d21efbb6114c526787b27de2e..2e602ab9dc4d440f075b9a28864a2e657d274f82 100644 (file)
@@ -58,7 +58,6 @@ const int wxPLACE_HOLDER   = 0;
 
 extern void wxapp_install_idle_handler();
 extern bool g_isIdle;
-extern int g_openDialogs;
 
 // ----------------------------------------------------------------------------
 // event tables
@@ -85,7 +84,7 @@ static void gtk_menu_attached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *
 {
     if (!win->m_hasVMT) return;
 
-    win->m_menuBarDetached = FALSE;
+    win->m_menuBarDetached = false;
     win->GtkUpdateSize();
 }
 }
@@ -105,7 +104,7 @@ static void gtk_menu_detached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *
     // Raise the client area area
     gdk_window_raise( win->m_wxwindow->window );
 
-    win->m_menuBarDetached = TRUE;
+    win->m_menuBarDetached = true;
     win->GtkUpdateSize();
 }
 }
@@ -122,7 +121,7 @@ static void gtk_toolbar_attached_callback( GtkWidget *WXUNUSED(widget), GtkWidge
 {
     if (!win->m_hasVMT) return;
 
-    win->m_toolBarDetached = FALSE;
+    win->m_toolBarDetached = false;
     win->GtkUpdateSize();
 }
 }
@@ -142,7 +141,7 @@ static void gtk_toolbar_detached_callback( GtkWidget *WXUNUSED(widget), GtkWidge
     // Raise the client area area
     gdk_window_raise( win->m_wxwindow->window );
 
-    win->m_toolBarDetached = TRUE;
+    win->m_toolBarDetached = true;
     win->GtkUpdateSize();
 }
 }
@@ -176,7 +175,7 @@ static void wxInsertChildInFrame( wxFrame* parent, wxWindow* child )
                          child->m_y,
                          child->m_width,
                          child->m_height );
-                         
+
 #if wxUSE_TOOLBAR_NATIVE
         // We connect to these events for recalculating the client area
         // space when the toolbar is floating
@@ -204,7 +203,7 @@ static void wxInsertChildInFrame( wxFrame* parent, wxWindow* child )
                          child->m_width,
                          child->m_height );
     }
-    
+
     // Resize on OnInternalIdle
     parent->GtkUpdateSize();
 }
@@ -215,8 +214,8 @@ static void wxInsertChildInFrame( wxFrame* parent, wxWindow* child )
 
 void wxFrame::Init()
 {
-    m_menuBarDetached = FALSE;
-    m_toolBarDetached = FALSE;
+    m_menuBarDetached = false;
+    m_toolBarDetached = false;
     m_menuBarHeight = 2;
 }
 
@@ -231,13 +230,13 @@ bool wxFrame::Create( wxWindow *parent,
     bool rt = wxTopLevelWindow::Create(parent, id, title, pos, sizeOrig,
                                        style, name);
     m_insertCallback = (wxInsertChildFunction) wxInsertChildInFrame;
-    
+
     return rt;
 }
 
 wxFrame::~wxFrame()
 {
-    m_isBeingDeleted = TRUE;
+    m_isBeingDeleted = true;
     DeleteAllBars();
 }
 
@@ -352,7 +351,7 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y),
 
     // avoid recursions
     if (m_resizing) return;
-    m_resizing = TRUE;
+    m_resizing = true;
 
     // this shouldn't happen: wxFrame, wxMDIParentFrame and wxMDIChildFrame have m_wxwindow
     wxASSERT_MSG( (m_wxwindow != NULL), wxT("invalid frame") );
@@ -498,7 +497,7 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y),
     }
 #endif // wxUSE_STATUSBAR
 
-    m_sizeSet = TRUE;
+    m_sizeSet = true;
 
     // send size event to frame
     wxSizeEvent event( wxSize(m_width,m_height), GetId() );
@@ -515,7 +514,7 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y),
     }
 #endif // wxUSE_STATUSBAR
 
-    m_resizing = FALSE;
+    m_resizing = false;
 }
 
 void wxFrame::OnInternalIdle()
@@ -602,7 +601,7 @@ void wxFrame::AttachMenuBar( wxMenuBar *menuBar )
             gtk_signal_connect( GTK_OBJECT(menuBar->m_widget), "child_detached",
                 GTK_SIGNAL_FUNC(gtk_menu_detached_callback), (gpointer)this );
         }
-        
+
         gtk_widget_show( m_frameMenuBar->m_widget );
 
         UpdateMenuBarSize();
@@ -620,7 +619,7 @@ void wxFrame::UpdateMenuBarSize()
 
     req.width = 2;
     req.height = 2;
-    
+
     // this is called after Remove with a NULL m_frameMenuBar
     if ( m_frameMenuBar )
     (* GTK_WIDGET_CLASS( GTK_OBJECT_GET_CLASS(m_frameMenuBar->m_widget) )->size_request )
@@ -641,11 +640,11 @@ wxToolBar* wxFrame::CreateToolBar( long style, wxWindowID id, const wxString& na
 {
     wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") );
 
-    m_insertInClientArea = FALSE;
+    m_insertInClientArea = false;
 
     m_frameToolBar = wxFrameBase::CreateToolBar( style, id, name );
 
-    m_insertInClientArea = TRUE;
+    m_insertInClientArea = true;
 
     GtkUpdateSize();
 
@@ -700,10 +699,10 @@ wxStatusBar* wxFrame::CreateStatusBar(int number,
 void wxFrame::SetStatusBar(wxStatusBar *statbar)
 {
     bool hadStatBar = m_frameStatusBar != NULL;
-    
+
     wxFrameBase::SetStatusBar(statbar);
-    
-    if (hadStatBar && !m_frameStatusBar) 
+
+    if (hadStatBar && !m_frameStatusBar)
         GtkUpdateSize();
 }
 
index 67768b216c95d47f1a3137e6cf819657b0164610..7c0a375e803e904d49d93fefc9505c69c3aedff2 100644 (file)
     #define WXUNUSED_IN_GTK1(arg)
 #endif
 
+// RR: After a correction to the orientation of the sash
+//     this doesn't seem to be required anymore and it
+//     seems to confuse some themes so USE_ERASE_RECT=0
+#define USE_ERASE_RECT 0
+
 // ----------------------------------------------------------------------------
 // wxRendererGTK: our wxRendererNative implementation
 // ----------------------------------------------------------------------------
@@ -196,7 +201,7 @@ wxRendererGTK::DrawTreeItemButton(wxWindow* win,
         state = GTK_STATE_PRELIGHT;
     else
         state = GTK_STATE_NORMAL;
-        
+
     // VZ: I don't know how to get the size of the expander so as to centre it
     //     in the given rectangle, +2/3 below is just what looks good here...
     gtk_paint_expander
@@ -237,7 +242,7 @@ static int GetGtkSplitterFullSize()
 
     gint handle_size;
     gtk_widget_style_get (s_paned, "handle_size", &handle_size, NULL);
-      
+
     return handle_size;
 #else
     return SASH_SIZE + SASH_MARGIN;
@@ -282,14 +287,17 @@ wxRendererGTK::DrawSplitterSash(wxWindow *win,
         // window not realized yet
         return;
     }
-    
+
     wxCoord full_size = GetGtkSplitterFullSize();
 
     // are we drawing vertical or horizontal splitter?
     const bool isVert = orient == wxVERTICAL;
 
     GdkRectangle rect;
+#if USE_ERASE_RECT
     GdkRectangle erase_rect;
+#endif
+
     if ( isVert )
     {
         int h = win->GetClientSize().GetHeight();
@@ -299,10 +307,12 @@ wxRendererGTK::DrawSplitterSash(wxWindow *win,
         rect.width = full_size;
         rect.height = h;
 
+#if USE_ERASE_RECT
         erase_rect.x = position;
         erase_rect.y = 0;
         erase_rect.width = full_size;
         erase_rect.height = h;
+#endif
     }
     else // horz
     {
@@ -313,17 +323,15 @@ wxRendererGTK::DrawSplitterSash(wxWindow *win,
         rect.height = full_size;
         rect.width = w;
 
+#if USE_ERASE_RECT
         erase_rect.y = position;
         erase_rect.x = 0;
         erase_rect.height = full_size;
         erase_rect.width = w;
+#endif
     }
 
-#if 0
-    // RR: After a correction to the orientation of the sash
-    //     this doesn't seem to be required anymore and it
-    //     seems to confuse some themes
-
+#if USE_ERASE_RECT
     // we must erase everything first, otherwise the garbage
     // from the old sash is left when dragging it
     gtk_paint_flat_box
index 7c8b236b7f542e55e26276686c575406eeaa0509..8e327cb62e0db8c720838f71051ea77832aac750 100644 (file)
@@ -35,7 +35,6 @@ extern bool g_isIdle;
 //-----------------------------------------------------------------------------
 
 extern bool   g_blockEventsOnDrag;
-extern bool   g_blockEventsOnScroll;
 static wxEventType g_currentUpDownEvent = wxEVT_NULL;
 
 static const float sensitivity = 0.02;
@@ -71,13 +70,13 @@ static void gtk_scrollbar_callback( GtkAdjustment *adjust,
     // throw a LINEUP / LINEDOWN event if necessary
     if (g_currentUpDownEvent != wxEVT_NULL)
     {
-        wxScrollEvent event( g_currentUpDownEvent, win->GetId(), value, orient );   
+        wxScrollEvent event( g_currentUpDownEvent, win->GetId(), value, orient );
         event.SetEventObject( win );
         win->GetEventHandler()->ProcessEvent( event );
-      }
-    
-       // throw other event (wxEVT_SCROLL_THUMBTRACK)
-       wxScrollEvent event( command, win->GetId(), value, orient );
+    }
+
+    // throw other event (wxEVT_SCROLL_THUMBTRACK)
+    wxScrollEvent event( command, win->GetId(), value, orient );
     event.SetEventObject( win );
     win->GetEventHandler()->ProcessEvent( event );
 
@@ -105,9 +104,9 @@ static gint gtk_scrollbar_button_press_callback( GtkRange *widget,
     {
         int scroll_height, mouse_pos;
 
-        // get the mouse position when the click is done 
-        if (win->HasFlag(wxSB_VERTICAL))        
-        {   
+        // get the mouse position when the click is done
+        if (win->HasFlag(wxSB_VERTICAL))
+        {
             scroll_height = GTK_WIDGET(widget)->allocation.height - 16;
             mouse_pos = (int)gdk_event->y;
         }
@@ -116,7 +115,7 @@ static gint gtk_scrollbar_button_press_callback( GtkRange *widget,
             scroll_height = GTK_WIDGET(widget)->allocation.width - 16;
             mouse_pos = (int)gdk_event->x;
         }
-       
+
         // compare mouse position to scrollbar height
         if  (mouse_pos > scroll_height)
             g_currentUpDownEvent = wxEVT_SCROLL_LINEDOWN;
@@ -157,7 +156,7 @@ gtk_scrollbar_button_release_callback( GtkRange *WXUNUSED(widget),
         win->GetEventHandler()->ProcessEvent( event );
     }
 
-    win->m_isScrolling = FALSE;
+    win->m_isScrolling = false;
 
     // reset the LINEUP/LINEDOWN flag when the mouse button is released
     g_currentUpDownEvent = wxEVT_NULL;
@@ -180,14 +179,14 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id,
            const wxPoint& pos, const wxSize& size,
            long style, const wxValidator& validator, const wxString& name )
 {
-    m_needParent = TRUE;
-    m_acceptsFocus = TRUE;
+    m_needParent = true;
+    m_acceptsFocus = true;
 
     if (!PreCreation( parent, pos, size ) ||
         !CreateBase( parent, id, pos, size, style, validator, name ))
     {
         wxFAIL_MSG( wxT("wxScrollBar creation failed") );
-        return FALSE;
+        return false;
     }
 
     m_oldPos = 0.0;
@@ -216,7 +215,7 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id,
 
     PostCreation(size);
 
-    return TRUE;
+    return true;
 }
 
 int wxScrollBar::GetThumbPosition() const
index c62103dc535ea70a41f0f107a7f8ee0a58e215cd..46cc7afe7fa448d717add1004fdc0413b0c9d50f 100644 (file)
@@ -32,8 +32,6 @@
 #include <glib.h>
 #include "wx/gtk/private.h"
 
-extern GdkFont *GtkGetDefaultGuiFont();
-
 // ----------------------------------------------------------------------------
 // globals
 // ----------------------------------------------------------------------------
@@ -271,7 +269,7 @@ wxToolBarToolBase *wxToolBar::CreateTool(wxControl *control)
 void wxToolBar::Init()
 {
     m_toolbar = (GtkToolbar *)NULL;
-    m_blockEvent = FALSE;
+    m_blockEvent = false;
     m_defaultWidth = 32;
     m_defaultHeight = 32;
 }
@@ -287,7 +285,7 @@ bool wxToolBar::Create( wxWindow *parent,
                         long style,
                         const wxString& name )
 {
-    m_needParent = TRUE;
+    m_needParent = true;
     m_insertCallback = (wxInsertChildFunction)wxInsertChildInToolBar;
 
     if ( !PreCreation( parent, pos, size ) ||
@@ -295,7 +293,7 @@ bool wxToolBar::Create( wxWindow *parent,
     {
         wxFAIL_MSG( wxT("wxToolBar creation failed") );
 
-        return FALSE;
+        return false;
     }
 
 #ifdef __WXGTK20__
@@ -344,7 +342,7 @@ bool wxToolBar::Create( wxWindow *parent,
 
     PostCreation(size);
 
-    return TRUE;
+    return true;
 }
 
 void wxToolBar::GtkSetStyle()
@@ -383,13 +381,13 @@ bool wxToolBar::DoInsertTool(size_t pos, wxToolBarToolBase *toolBase)
         {
             wxBitmap bitmap = tool->GetNormalBitmap();
 
-            wxCHECK_MSG( bitmap.Ok(), FALSE,
+            wxCHECK_MSG( bitmap.Ok(), false,
                          wxT("invalid bitmap for wxToolBar icon") );
 
-            wxCHECK_MSG( bitmap.GetBitmap() == NULL, FALSE,
+            wxCHECK_MSG( bitmap.GetBitmap() == NULL, false,
                          wxT("wxToolBar doesn't support GdkBitmap") );
 
-            wxCHECK_MSG( bitmap.GetPixmap() != NULL, FALSE,
+            wxCHECK_MSG( bitmap.GetPixmap() != NULL, false,
                          wxT("wxToolBar::Add needs a wxBitmap") );
 
             GtkWidget *tool_pixmap = (GtkWidget *)NULL;
@@ -410,7 +408,7 @@ bool wxToolBar::DoInsertTool(size_t pos, wxToolBarToolBase *toolBase)
                 GdkBitmap *mask = (GdkBitmap *)NULL;
                 if ( bitmap.GetMask() )
                     mask = bitmap.GetMask()->GetBitmap();
-            
+
                 tool_pixmap = gtk_pixmap_new( pixmap, mask );
                 gtk_pixmap_set_build_insensitive( GTK_PIXMAP(tool_pixmap), TRUE );
             }
@@ -452,7 +450,7 @@ bool wxToolBar::DoInsertTool(size_t pos, wxToolBarToolBase *toolBase)
                         // this is the first button in the radio button group,
                         // it will be toggled automatically by GTK so bring the
                         // internal flag in sync
-                        tool->Toggle(TRUE);
+                        tool->Toggle(true);
                     }
                 }
 
@@ -478,7 +476,7 @@ bool wxToolBar::DoInsertTool(size_t pos, wxToolBarToolBase *toolBase)
                 {
                     wxFAIL_MSG( _T("gtk_toolbar_insert_element() failed") );
 
-                    return FALSE;
+                    return false;
                 }
 
                 gtk_signal_connect( GTK_OBJECT(tool->m_item),
@@ -496,7 +494,7 @@ bool wxToolBar::DoInsertTool(size_t pos, wxToolBarToolBase *toolBase)
             gtk_toolbar_insert_space( m_toolbar, posGtk );
 
             // skip the rest
-            return TRUE;
+            return true;
 
         case wxTOOL_STYLE_CONTROL:
             gtk_toolbar_insert_widget(
@@ -516,7 +514,7 @@ bool wxToolBar::DoInsertTool(size_t pos, wxToolBarToolBase *toolBase)
     m_height = req.height + 2*m_yMargin;
     InvalidateBestSize();
 
-    return TRUE;
+    return true;
 }
 
 bool wxToolBar::DoDeleteTool(size_t pos, wxToolBarToolBase *toolBase)
@@ -541,7 +539,7 @@ bool wxToolBar::DoDeleteTool(size_t pos, wxToolBarToolBase *toolBase)
     }
 
     InvalidateBestSize();
-    return TRUE;
+    return true;
 }
 
 // ----------------------------------------------------------------------------
@@ -567,11 +565,11 @@ void wxToolBar::DoToggleTool( wxToolBarToolBase *toolBase, bool toggle )
     {
         tool->SetPixmap(tool->GetBitmap());
 
-        m_blockEvent = TRUE;
+        m_blockEvent = true;
 
         gtk_toggle_button_set_state( GTK_TOGGLE_BUTTON(item), toggle );
 
-        m_blockEvent = FALSE;
+        m_blockEvent = false;
     }
 }
 
index 52c1f01d66f0bb8150ca4b6f0b0c5a32b1833aa1..e8525301078558339a6bbefaf2106f0f1511afb3 100644 (file)
@@ -42,7 +42,6 @@ extern bool g_isIdle;
 // data
 //-----------------------------------------------------------------------------
 
-extern bool       g_blockEventsOnDrag;
 extern wxCursor   g_globalCursor;
 extern wxWindowGTK *g_delayedFocus;
 
index 1bf01efef71d7fc91f9d83236dab0405316f7971..cf8a289b9e722b95a4bb249fcf013d460614d6de 100644 (file)
@@ -24,24 +24,23 @@ extern void wxapp_install_idle_handler();
 extern bool g_isIdle;
 extern bool      g_blockEventsOnDrag;
 extern wxCursor   g_globalCursor;
-extern wxWindowGTK *g_delayedFocus;
 
 extern "C" {
 static void gtk_togglebutton_clicked_callback(GtkWidget *WXUNUSED(widget), wxToggleButton *cb)
 {
-   if (g_isIdle)
-      wxapp_install_idle_handler();
-
-   if (!cb->m_hasVMT || g_blockEventsOnDrag)
-      return;
-      
-   if (cb->m_blockEvent) return;
-
-   // Generate a wx event.
-   wxCommandEvent event(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, cb->GetId());
-   event.SetInt(cb->GetValue());
-   event.SetEventObject(cb);
-   cb->GetEventHandler()->ProcessEvent(event);
+    if (g_isIdle)
+        wxapp_install_idle_handler();
+
+    if (!cb->m_hasVMT || g_blockEventsOnDrag)
+        return;
+
+    if (cb->m_blockEvent) return;
+
+    // Generate a wx event.
+    wxCommandEvent event(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, cb->GetId());
+    event.SetInt(cb->GetValue());
+    event.SetEventObject(cb);
+    cb->GetEventHandler()->ProcessEvent(event);
 }
 }
 
@@ -59,18 +58,18 @@ bool wxToggleBitmapButton::Create(wxWindow *parent, wxWindowID id,
                             const wxValidator& validator,
                             const wxString &name)
 {
-    m_needParent = TRUE;
-    m_acceptsFocus = TRUE;
-   
-    m_blockEvent = FALSE;
+    m_needParent = true;
+    m_acceptsFocus = true;
+
+    m_blockEvent = false;
 
     if (!PreCreation(parent, pos, size) ||
        !CreateBase(parent, id, pos, size, style, validator, name ))
     {
         wxFAIL_MSG(wxT("wxToggleBitmapButton creation failed"));
-        return FALSE;
+        return false;
     }
-    
+
     m_bitmap = label;
 
     // Create the gtk widget.
@@ -92,32 +91,32 @@ bool wxToggleBitmapButton::Create(wxWindow *parent, wxWindowID id,
 
     PostCreation(size);
 
-    return TRUE;
+    return true;
 }
 
 // void SetValue(bool state)
 // Set the value of the toggle button.
 void wxToggleBitmapButton::SetValue(bool state)
 {
-   wxCHECK_RET(m_widget != NULL, wxT("invalid toggle button"));
+    wxCHECK_RET(m_widget != NULL, wxT("invalid toggle button"));
 
-   if (state == GetValue())
-      return;
+    if (state == GetValue())
+        return;
 
-   m_blockEvent = TRUE;
+    m_blockEvent = true;
 
-   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m_widget), state);
+    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m_widget), state);
 
-   m_blockEvent = FALSE;
+    m_blockEvent = false;
 }
 
 // bool GetValue() const
 // Get the value of the toggle button.
 bool wxToggleBitmapButton::GetValue() const
 {
-   wxCHECK_MSG(m_widget != NULL, FALSE, wxT("invalid toggle button"));
+    wxCHECK_MSG(m_widget != NULL, false, wxT("invalid toggle button"));
 
-   return GTK_TOGGLE_BUTTON(m_widget)->active;
+    return GTK_TOGGLE_BUTTON(m_widget)->active;
 }
 
 void wxToggleBitmapButton::SetLabel(const wxBitmap& label)
@@ -126,7 +125,7 @@ void wxToggleBitmapButton::SetLabel(const wxBitmap& label)
 
     m_bitmap = label;
     InvalidateBestSize();
-    
+
     OnSetBitmap();
 }
 
@@ -152,14 +151,14 @@ void wxToggleBitmapButton::OnSetBitmap()
     }
 }
 
-bool wxToggleBitmapButton::Enable(bool enable /*=TRUE*/)
+bool wxToggleBitmapButton::Enable(bool enable /*=true*/)
 {
     if (!wxControl::Enable(enable))
-        return FALSE;
+        return false;
 
     gtk_widget_set_sensitive(BUTTON_CHILD(m_widget), enable);
 
-    return TRUE;
+    return true;
 }
 
 void wxToggleBitmapButton::DoApplyWidgetStyle(GtkRcStyle *style)
@@ -176,7 +175,7 @@ bool wxToggleBitmapButton::IsOwnGtkWindow(GdkWindow *window)
 void wxToggleBitmapButton::OnInternalIdle()
 {
     wxCursor cursor = m_cursor;
-    
+
     if (g_globalCursor.Ok())
         cursor = g_globalCursor;
 
@@ -200,7 +199,7 @@ void wxToggleBitmapButton::OnInternalIdle()
 wxSize wxToggleBitmapButton::DoGetBestSize() const
 {
     wxSize best;
-    
+
     if (m_bitmap.Ok())
     {
         int border = HasFlag(wxNO_BORDER) ? 4 : 10;
@@ -232,56 +231,56 @@ bool wxToggleButton::Create(wxWindow *parent, wxWindowID id,
                             const wxValidator& validator,
                             const wxString &name)
 {
-   m_needParent = TRUE;
-   m_acceptsFocus = TRUE;
-   
-   m_blockEvent = FALSE;
+    m_needParent = true;
+    m_acceptsFocus = true;
 
-   if (!PreCreation(parent, pos, size) ||
-       !CreateBase(parent, id, pos, size, style, validator, name )) {
-      wxFAIL_MSG(wxT("wxToggleButton creation failed"));
-      return FALSE;
-   }
+    m_blockEvent = false;
 
-   wxControl::SetLabel(label);
+    if (!PreCreation(parent, pos, size) ||
+        !CreateBase(parent, id, pos, size, style, validator, name )) {
+        wxFAIL_MSG(wxT("wxToggleButton creation failed"));
+        return false;
+    }
 
-   // Create the gtk widget.
-   m_widget = gtk_toggle_button_new_with_label( wxGTK_CONV( m_label ) );
+    wxControl::SetLabel(label);
 
-   gtk_signal_connect(GTK_OBJECT(m_widget), "clicked",
-                      GTK_SIGNAL_FUNC(gtk_togglebutton_clicked_callback),
-                      (gpointer *)this);
+    // Create the gtk widget.
+    m_widget = gtk_toggle_button_new_with_label( wxGTK_CONV( m_label ) );
 
-   m_parent->DoAddChild(this);
+    gtk_signal_connect(GTK_OBJECT(m_widget), "clicked",
+                       GTK_SIGNAL_FUNC(gtk_togglebutton_clicked_callback),
+                       (gpointer *)this);
 
-   PostCreation(size);
+    m_parent->DoAddChild(this);
 
-   return TRUE;
+    PostCreation(size);
+
+    return true;
 }
 
 // void SetValue(bool state)
 // Set the value of the toggle button.
 void wxToggleButton::SetValue(bool state)
 {
-   wxCHECK_RET(m_widget != NULL, wxT("invalid toggle button"));
+    wxCHECK_RET(m_widget != NULL, wxT("invalid toggle button"));
 
-   if (state == GetValue())
-      return;
+    if (state == GetValue())
+        return;
 
-   m_blockEvent = TRUE;
+    m_blockEvent = true;
 
-   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m_widget), state);
+    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m_widget), state);
 
-   m_blockEvent = FALSE;
+    m_blockEvent = false;
 }
 
 // bool GetValue() const
 // Get the value of the toggle button.
 bool wxToggleButton::GetValue() const
 {
-   wxCHECK_MSG(m_widget != NULL, FALSE, wxT("invalid toggle button"));
+    wxCHECK_MSG(m_widget != NULL, false, wxT("invalid toggle button"));
 
-   return GTK_TOGGLE_BUTTON(m_widget)->active;
+    return GTK_TOGGLE_BUTTON(m_widget)->active;
 }
 
 void wxToggleButton::SetLabel(const wxString& label)
@@ -293,14 +292,14 @@ void wxToggleButton::SetLabel(const wxString& label)
     gtk_label_set(GTK_LABEL(BUTTON_CHILD(m_widget)), wxGTK_CONV( GetLabel() ) );
 }
 
-bool wxToggleButton::Enable(bool enable /*=TRUE*/)
+bool wxToggleButton::Enable(bool enable /*=true*/)
 {
     if (!wxControl::Enable(enable))
-        return FALSE;
+        return false;
 
     gtk_widget_set_sensitive(BUTTON_CHILD(m_widget), enable);
 
-    return TRUE;
+    return true;
 }
 
 void wxToggleButton::DoApplyWidgetStyle(GtkRcStyle *style)
@@ -317,7 +316,7 @@ bool wxToggleButton::IsOwnGtkWindow(GdkWindow *window)
 void wxToggleButton::OnInternalIdle()
 {
     wxCursor cursor = m_cursor;
-    
+
     if (g_globalCursor.Ok())
         cursor = g_globalCursor;
 
@@ -341,12 +340,12 @@ void wxToggleButton::OnInternalIdle()
 wxSize wxToggleButton::DoGetBestSize() const
 {
     wxSize ret(wxControl::DoGetBestSize());
-   
+
     if (!HasFlag(wxBU_EXACTFIT))
     {
         if (ret.x < 80) ret.x = 80;
     }
-    
+
     CacheBestSize(ret);
     return ret;
 }