]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk1/control.h
1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling, Julian Smart
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 #ifndef __GTKCONTROLH__
11 #define __GTKCONTROLH__
13 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
18 #include "wx/object.h"
20 #include "wx/window.h"
22 //-----------------------------------------------------------------------------
24 //-----------------------------------------------------------------------------
28 //-----------------------------------------------------------------------------
30 //-----------------------------------------------------------------------------
32 class wxControl
: public wxControlBase
36 wxControl(wxWindow
*parent
, wxWindowID id
,
37 const wxPoint
& pos
= wxDefaultPosition
,
38 const wxSize
& size
= wxDefaultSize
, long style
= 0,
39 const wxValidator
& validator
= wxDefaultValidator
,
40 const wxString
& name
= wxControlNameStr
)
42 Create(parent
, id
, pos
, size
, style
, validator
, name
);
45 bool Create(wxWindow
*parent
, wxWindowID id
,
46 const wxPoint
& pos
= wxDefaultPosition
,
47 const wxSize
& size
= wxDefaultSize
, long style
= 0,
48 const wxValidator
& validator
= wxDefaultValidator
,
49 const wxString
& name
= wxControlNameStr
);
51 // this function will filter out '&' characters and will put the accelerator
52 // char (the one immediately after '&') into m_chAccel (TODO not yet)
53 virtual void SetLabel( const wxString
&label
);
54 virtual wxString
GetLabel() const;
56 virtual wxVisualAttributes
GetDefaultAttributes() const;
59 virtual void ApplyWidgetStyle(bool forceStyle
= false);
60 // helper function to ease native widgets wrapping, called by
61 // ApplyWidgetStyle -- override this, not ApplyWidgetStyle
62 virtual void DoApplyWidgetStyle(GtkRcStyle
*style
);
64 virtual wxSize
DoGetBestSize() const;
65 void PostCreation(const wxSize
& size
);
69 wxString
PrepareLabelMnemonics( const wxString
&label
) const;
72 // These are used by GetDefaultAttributes
73 static wxVisualAttributes
74 GetDefaultAttributesFromGTKWidget(GtkWidget
* widget
,
77 static wxVisualAttributes
78 GetDefaultAttributesFromGTKWidget(GtkWidget
* (*widget_new
)(void),
81 static wxVisualAttributes
82 GetDefaultAttributesFromGTKWidget(GtkWidget
* (*widget_new
)(const gchar
*),
86 static wxVisualAttributes
87 GetDefaultAttributesFromGTKWidget(GtkWidget
* (*widget_new
)(GtkAdjustment
*),
91 // Widgets that use the style->base colour for the BG colour should
92 // override this and return true.
93 virtual bool UseGTKStyleBase() const { return false; }
96 char m_chAccel
; // enabled to avoid breaking binary compatibility later on
97 bool m_createComplete
;
100 DECLARE_DYNAMIC_CLASS(wxControl
)
103 #endif // __GTKCONTROLH__