Get(Class)DefaultAttributes() for wxGTK controls
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27115 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -71,6 +71,9 @@ public:
|
||||
// to override this here too...
|
||||
virtual bool ShouldInheritColours() const { return false; }
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
protected:
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
|
@@ -45,6 +45,9 @@ public:
|
||||
virtual void SetLabel( const wxString& label );
|
||||
virtual bool Enable( bool enable = TRUE );
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
// implementation
|
||||
// --------------
|
||||
|
||||
|
@@ -77,6 +77,9 @@ public:
|
||||
wxString GetString( int n ) const;
|
||||
void SetString( int n, const wxString& string );
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
protected:
|
||||
wxList m_clientList; // contains the client data for the items
|
||||
|
||||
@@ -92,6 +95,7 @@ protected:
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
virtual bool IsOwnGtkWindow( GdkWindow *window );
|
||||
|
||||
private:
|
||||
// common part of Create() and DoAppend()
|
||||
int GtkAddHelper(GtkWidget *menu, int pos, const wxString& item);
|
||||
|
@@ -134,6 +134,9 @@ public:
|
||||
|
||||
wxCONTROL_ITEMCONTAINER_CLIENTDATAOBJECT_RECAST
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
protected:
|
||||
virtual int DoAppend(const wxString& item);
|
||||
virtual int DoInsert(const wxString& item, int pos);
|
||||
@@ -145,6 +148,10 @@ protected:
|
||||
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
// Widgets that use the style->base colour for the BG colour should
|
||||
// override this and return true.
|
||||
virtual bool UseGTKStyleBase() const { return true; }
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxComboBox)
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
@@ -53,6 +53,8 @@ public:
|
||||
virtual void SetLabel( const wxString &label );
|
||||
virtual wxString GetLabel() const;
|
||||
|
||||
virtual wxVisualAttributes GetDefaultAttributes() const;
|
||||
|
||||
protected:
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
void PostCreation(const wxSize& size);
|
||||
@@ -61,6 +63,29 @@ protected:
|
||||
wxString PrepareLabelMnemonics( const wxString &label ) const;
|
||||
#endif
|
||||
|
||||
// These are used by GetDefaultAttributes
|
||||
static wxVisualAttributes
|
||||
GetDefaultAttributesFromGTKWidget(GtkWidget* widget,
|
||||
bool useBase = false,
|
||||
int state = -1);
|
||||
static wxVisualAttributes
|
||||
GetDefaultAttributesFromGTKWidget(GtkWidget* (*widget_new)(void),
|
||||
bool useBase = false,
|
||||
int state = -1);
|
||||
static wxVisualAttributes
|
||||
GetDefaultAttributesFromGTKWidget(GtkWidget* (*widget_new)(const gchar*),
|
||||
bool useBase = false,
|
||||
int state = -1);
|
||||
|
||||
static wxVisualAttributes
|
||||
GetDefaultAttributesFromGTKWidget(GtkWidget* (*widget_new)(GtkAdjustment*),
|
||||
bool useBase = false,
|
||||
int state = -1);
|
||||
|
||||
// Widgets that use the style->base colour for the BG colour should
|
||||
// override this and return true.
|
||||
virtual bool UseGTKStyleBase() const { return false; }
|
||||
|
||||
wxString m_label;
|
||||
char m_chAccel; // enabled to avoid breaking binary compatibility later on
|
||||
|
||||
|
@@ -77,6 +77,9 @@ public:
|
||||
|
||||
bool IsVertical() const { return HasFlag(wxGA_VERTICAL); }
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
// implementation
|
||||
// -------------
|
||||
|
||||
@@ -100,6 +103,8 @@ protected:
|
||||
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
virtual wxVisualAttributes GetDefaultAttributes() const;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxGauge)
|
||||
};
|
||||
|
@@ -96,6 +96,9 @@ public:
|
||||
virtual void DoSetItemClientObject(int n, wxClientData* clientData);
|
||||
virtual wxClientData* DoGetItemClientObject(int n) const;
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
// implementation from now on
|
||||
|
||||
void GtkAddItem( const wxString &item, int pos=-1 );
|
||||
@@ -127,6 +130,10 @@ protected:
|
||||
// return the string label for the given item
|
||||
wxString GetRealLabel(struct _GList *item) const;
|
||||
|
||||
// Widgets that use the style->base colour for the BG colour should
|
||||
// override this and return true.
|
||||
virtual bool UseGTKStyleBase() const { return true; }
|
||||
|
||||
private:
|
||||
// this array is only used for controls with wxCB_SORT style, so only
|
||||
// allocate it if it's needed (hence using pointer)
|
||||
|
@@ -98,6 +98,10 @@ public:
|
||||
// --------------------------
|
||||
void OnNavigationKey(wxNavigationKeyEvent& event);
|
||||
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
// implementation
|
||||
// --------------
|
||||
|
||||
|
@@ -111,6 +111,9 @@ public:
|
||||
virtual bool Show( bool show = TRUE );
|
||||
virtual bool Enable( bool enable = TRUE );
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
// implementation
|
||||
// --------------
|
||||
|
||||
|
@@ -49,6 +49,9 @@ public:
|
||||
virtual bool GetValue() const;
|
||||
virtual bool Enable( bool enable = TRUE );
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
// implementation
|
||||
|
||||
virtual bool IsRadioButton() const { return TRUE; }
|
||||
|
@@ -68,6 +68,9 @@ public:
|
||||
void SetObjectLength( int objectLength );
|
||||
void SetViewLength( int viewLength );
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
// implementation
|
||||
// --------------
|
||||
|
||||
|
@@ -60,6 +60,9 @@ public:
|
||||
virtual void SetThumbLength(int lenPixels);
|
||||
virtual int GetThumbLength() const;
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
// implementation
|
||||
bool IsOwnGtkWindow( GdkWindow *window );
|
||||
void ApplyWidgetStyle();
|
||||
|
@@ -46,6 +46,9 @@ public:
|
||||
virtual int GetMin() const;
|
||||
virtual int GetMax() const;
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
// implementation
|
||||
void OnSize( wxSizeEvent &event );
|
||||
|
||||
|
@@ -59,6 +59,9 @@ public:
|
||||
virtual int GetMin() const;
|
||||
virtual int GetMax() const;
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
// implementation
|
||||
void OnChar( wxKeyEvent &event );
|
||||
|
||||
@@ -73,6 +76,10 @@ public:
|
||||
protected:
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
// Widgets that use the style->base colour for the BG colour should
|
||||
// override this and return true.
|
||||
virtual bool UseGTKStyleBase() const { return true; }
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxSpinCtrl)
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
@@ -52,6 +52,9 @@ public:
|
||||
return (const wxIcon &)m_bitmap;
|
||||
}
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
private:
|
||||
// creates the new pixmap widget
|
||||
void CreatePixmapWidget();
|
||||
|
@@ -40,6 +40,9 @@ public:
|
||||
|
||||
virtual void SetLabel( const wxString &label );
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
// implementation
|
||||
|
||||
virtual void ApplyWidgetStyle();
|
||||
|
@@ -45,6 +45,10 @@ public:
|
||||
bool Create( wxWindow *parent, wxWindowID id,
|
||||
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
||||
long style = wxLI_HORIZONTAL, const wxString &name = wxStaticTextNameStr );
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -59,6 +59,9 @@ public:
|
||||
|
||||
bool SetFont( const wxFont &font );
|
||||
bool SetForegroundColour( const wxColour& colour );
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
// implementation
|
||||
// --------------
|
||||
|
@@ -56,6 +56,9 @@ public:
|
||||
|
||||
virtual void SetWindowStyleFlag( long style );
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
// implementation from now on
|
||||
// --------------------------
|
||||
|
||||
|
@@ -162,6 +162,9 @@ public:
|
||||
// should we ignore the changed signal? always resets the flag
|
||||
bool IgnoreTextUpdate();
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
protected:
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
@@ -175,6 +178,10 @@ protected:
|
||||
// scroll position changed
|
||||
bool DoScroll(GtkAdjustment *adj, int diff);
|
||||
|
||||
// Widgets that use the style->base colour for the BG colour should
|
||||
// override this and return true.
|
||||
virtual bool UseGTKStyleBase() const { return true; }
|
||||
|
||||
private:
|
||||
// change the font for everything in this control
|
||||
void ChangeFontGlobally();
|
||||
|
@@ -66,7 +66,9 @@ public:
|
||||
void SetLabel(const wxBitmap& label);
|
||||
bool Enable(bool enable = TRUE);
|
||||
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
// implementation
|
||||
bool m_blockEvent;
|
||||
wxBitmap m_bitmap;
|
||||
@@ -81,6 +83,7 @@ public:
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxToggleBitmapButton)
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxToggleButton
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -119,6 +122,8 @@ public:
|
||||
void SetLabel(const wxString& label);
|
||||
bool Enable(bool enable = TRUE);
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
// implementation
|
||||
bool m_blockEvent;
|
||||
|
Reference in New Issue
Block a user