1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling, Julian Smart
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 #ifndef __GTKCONTROLH__
11 #define __GTKCONTROLH__
14 #include "wx/object.h"
16 #include "wx/window.h"
18 //-----------------------------------------------------------------------------
20 //-----------------------------------------------------------------------------
22 class WXDLLIMPEXP_CORE wxControl
;
24 //-----------------------------------------------------------------------------
26 //-----------------------------------------------------------------------------
28 // C-linkage function pointer types for GetDefaultAttributesFromGTKWidget
30 typedef GtkWidget
* (*wxGtkWidgetNew_t
)(void);
31 typedef GtkWidget
* (*wxGtkWidgetNewFromStr_t
)(const gchar
*);
32 typedef GtkWidget
* (*wxGtkWidgetNewFromAdj_t
)(GtkAdjustment
*);
35 class WXDLLIMPEXP_CORE wxControl
: public wxControlBase
39 wxControl(wxWindow
*parent
, wxWindowID id
,
40 const wxPoint
& pos
= wxDefaultPosition
,
41 const wxSize
& size
= wxDefaultSize
, long style
= 0,
42 const wxValidator
& validator
= wxDefaultValidator
,
43 const wxString
& name
= wxControlNameStr
)
45 Create(parent
, id
, pos
, size
, style
, validator
, name
);
48 bool Create(wxWindow
*parent
, wxWindowID id
,
49 const wxPoint
& pos
= wxDefaultPosition
,
50 const wxSize
& size
= wxDefaultSize
, long style
= 0,
51 const wxValidator
& validator
= wxDefaultValidator
,
52 const wxString
& name
= wxControlNameStr
);
54 // this function will filter out '&' characters and will put the accelerator
55 // char (the one immediately after '&') into m_chAccel (TODO not yet)
56 virtual void SetLabel( const wxString
&label
);
57 virtual wxString
GetLabel() const;
59 virtual wxVisualAttributes
GetDefaultAttributes() const;
62 virtual wxSize
DoGetBestSize() const;
63 void PostCreation(const wxSize
& size
);
66 wxString
PrepareLabelMnemonics( const wxString
&label
) const;
69 // These are used by GetDefaultAttributes
70 static wxVisualAttributes
71 GetDefaultAttributesFromGTKWidget(GtkWidget
* widget
,
74 static wxVisualAttributes
75 GetDefaultAttributesFromGTKWidget(wxGtkWidgetNew_t
,
78 static wxVisualAttributes
79 GetDefaultAttributesFromGTKWidget(wxGtkWidgetNewFromStr_t
,
83 static wxVisualAttributes
84 GetDefaultAttributesFromGTKWidget(wxGtkWidgetNewFromAdj_t
,
88 // Widgets that use the style->base colour for the BG colour should
89 // override this and return true.
90 virtual bool UseGTKStyleBase() const { return false; }
93 char m_chAccel
; // enabled to avoid breaking binary compatibility later on
96 DECLARE_DYNAMIC_CLASS(wxControl
)
99 #endif // __GTKCONTROLH__