- virtual void Refresh( bool eraseBackground = TRUE, const wxRect *rect = (const wxRect *) NULL );
- virtual void Clear();
-
- virtual wxRegion GetUpdateRegion() const;
- virtual bool IsExposed( int x, int y ) const;
- virtual bool IsExposed( int x, int y, int w, int h ) const;
- virtual bool IsExposed( const wxPoint& pt ) const;
- virtual bool IsExposed( const wxRect& rect ) const;
-
- virtual wxColour GetBackgroundColour() const;
- virtual void SetBackgroundColour( const wxColour &colour );
- virtual wxColour GetForegroundColour() const;
- virtual void SetForegroundColour( const wxColour &colour );
-
- virtual int GetCharHeight() const;
- virtual int GetCharWidth() const;
- virtual void GetTextExtent( const wxString& string, int *x, int *y,
- int *descent = (int *) NULL,
- int *externalLeading = (int *) NULL,
- const wxFont *theFont = (const wxFont *) NULL, bool use16 = FALSE) const;
-
- virtual void SetFont( const wxFont &font );
- virtual wxFont& GetFont() { return m_font; }
-
- // For backward compatibility
- virtual void SetButtonFont(const wxFont& font) { SetFont(font); }
- virtual void SetLabelFont(const wxFont& font) { SetFont(font); }
- virtual wxFont& GetLabelFont() { return GetFont(); };
- virtual wxFont& GetButtonFont() { return GetFont(); };
-
- virtual void SetWindowStyleFlag( long flag );
- virtual long GetWindowStyleFlag() const;
-
- virtual void CaptureMouse();
- virtual void ReleaseMouse();
-
- virtual void SetTitle( const wxString &title );
- virtual wxString GetTitle() const;
- virtual void SetName( const wxString &name );
- virtual wxString GetName() const;
- virtual wxString GetLabel() const;
-
- void OnSysColourChanged( wxSysColourChangedEvent &WXUNUSED(event) ) { }
- void OnKeyDown( wxKeyEvent &event );
+ // Called when a window should delay showing itself
+ // until idle time used in Reparent().
+ void GTKShowOnIdle() { m_showOnIdle = true; }
+
+ // This is called from the various OnInternalIdle methods
+ bool GTKShowFromOnIdle();
+
+ // is this window transparent for the mouse events (as wxStaticBox is)?
+ virtual bool GTKIsTransparentForMouse() const { return false; }
+
+ // Common scroll event handling code for wxWindow and wxScrollBar
+ wxEventType GTKGetScrollEventType(GtkRange* range);
+
+ // position and size of the window
+ int m_x, m_y;
+ int m_width, m_height;
+ int m_oldClientWidth,m_oldClientHeight;
+
+ // see the docs in src/gtk/window.cpp
+ GtkWidget *m_widget; // mostly the widget seen by the rest of GTK
+ GtkWidget *m_wxwindow; // mostly the client area as per wxWidgets
+
+ // label for use with GetLabelSetLabel
+ wxString m_gtkLabel;
+
+ // return true if the window is of a standard (i.e. not wxWidgets') class
+ bool IsOfStandardClass() const { return m_wxwindow == NULL; }
+
+ // this widget will be queried for GTK's focus events
+ GtkWidget *m_focusWidget;
+
+ void GTKDisableFocusOutEvent();
+ void GTKEnableFocusOutEvent();
+
+ wxGtkIMData *m_imData;
+
+ // indices for the arrays below
+ enum ScrollDir { ScrollDir_Horz, ScrollDir_Vert, ScrollDir_Max };
+
+ // horizontal/vertical scroll bar
+ GtkRange* m_scrollBar[ScrollDir_Max];
+
+ // horizontal/vertical scroll position
+ double m_scrollPos[ScrollDir_Max];
+
+ // return the scroll direction index corresponding to the given orientation
+ // (which is wxVERTICAL or wxHORIZONTAL)
+ static ScrollDir ScrollDirFromOrient(int orient)
+ {
+ return orient == wxVERTICAL ? ScrollDir_Vert : ScrollDir_Horz;
+ }
+
+ // return the orientation for the given scrolling direction
+ static int OrientFromScrollDir(ScrollDir dir)
+ {
+ return dir == ScrollDir_Horz ? wxHORIZONTAL : wxVERTICAL;
+ }
+
+ // find the direction of the given scrollbar (must be one of ours)
+ ScrollDir ScrollDirFromRange(GtkRange *range) const;
+
+ // set the current cursor for all GdkWindows making part of this widget
+ // (see GTKGetWindow)
+ void GTKUpdateCursor(bool update_self = true, bool recurse = true);
+
+ // extra (wxGTK-specific) flags
+ bool m_noExpose:1; // wxGLCanvas has its own redrawing
+ bool m_nativeSizeEvent:1; // wxGLCanvas sends wxSizeEvent upon "alloc_size"
+ bool m_hasVMT:1; // set after PostCreation() is called
+ bool m_isScrolling:1; // dragging scrollbar thumb?
+ bool m_clipPaintRegion:1; // true after ScrollWindow()
+ wxRegion m_nativeUpdateRegion; // not transformed for RTL
+ bool m_dirtyTabOrder:1; // tab order changed, GTK focus
+ // chain needs update
+ bool m_needsStyleChange:1; // May not be able to change
+ // background style until OnIdle
+ bool m_mouseButtonDown:1;
+
+ bool m_showOnIdle:1; // postpone showing the window until idle
+
+protected:
+ // implement the base class pure virtuals
+ virtual void DoGetTextExtent(const wxString& string,
+ int *x, int *y,
+ int *descent = NULL,
+ int *externalLeading = NULL,
+ const wxFont *font = NULL) const;
+ virtual void DoClientToScreen( int *x, int *y ) const;
+ virtual void DoScreenToClient( int *x, int *y ) const;
+ virtual void DoGetPosition( int *x, int *y ) const;
+ virtual void DoGetSize( int *width, int *height ) const;
+ virtual void DoGetClientSize( int *width, int *height ) const;
+ virtual void DoSetSize(int x, int y,
+ int width, int height,
+ int sizeFlags = wxSIZE_AUTO);
+ virtual void DoSetClientSize(int width, int height);
+ virtual wxSize DoGetBorderSize() const;
+ virtual void DoMoveWindow(int x, int y, int width, int height);
+ virtual void DoEnable(bool enable);
+
+#if wxUSE_MENUS_NATIVE
+ virtual bool DoPopupMenu( wxMenu *menu, int x, int y );
+#endif // wxUSE_MENUS_NATIVE
+
+ virtual void DoCaptureMouse();
+ virtual void DoReleaseMouse();
+
+ virtual void DoFreeze();
+ virtual void DoThaw();
+
+ void GTKFreezeWidget(GtkWidget *w);
+ void GTKThawWidget(GtkWidget *w);