]>
Commit | Line | Data |
---|---|---|
c801d85f KB |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: control.h | |
3 | // Purpose: | |
4 | // Author: Robert Roebling | |
dbf858b5 RR |
5 | // Id: $Id$ |
6 | // Copyright: (c) 1998 Robert Roebling, Julian Smart | |
65571936 | 7 | // Licence: wxWindows licence |
c801d85f KB |
8 | ///////////////////////////////////////////////////////////////////////////// |
9 | ||
c801d85f KB |
10 | #ifndef __GTKCONTROLH__ |
11 | #define __GTKCONTROLH__ | |
12 | ||
12028905 | 13 | #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) |
c801d85f KB |
14 | #pragma interface |
15 | #endif | |
16 | ||
17 | #include "wx/defs.h" | |
18 | #include "wx/object.h" | |
19 | #include "wx/list.h" | |
20 | #include "wx/window.h" | |
21 | ||
22 | //----------------------------------------------------------------------------- | |
23 | // classes | |
24 | //----------------------------------------------------------------------------- | |
25 | ||
26 | class wxControl; | |
27 | ||
28 | //----------------------------------------------------------------------------- | |
29 | // wxControl | |
30 | //----------------------------------------------------------------------------- | |
31 | ||
9abe166a | 32 | class wxControl : public wxControlBase |
c801d85f | 33 | { |
2a4f4a27 | 34 | public: |
8d99be5f | 35 | wxControl(); |
04165bec RR |
36 | wxControl(wxWindow *parent, wxWindowID id, |
37 | const wxPoint& pos = wxDefaultPosition, | |
38 | const wxSize& size = wxDefaultSize, long style = 0, | |
04165bec | 39 | const wxValidator& validator = wxDefaultValidator, |
04165bec RR |
40 | const wxString& name = wxControlNameStr) |
41 | { | |
674ac8b9 | 42 | Create(parent, id, pos, size, style, validator, name); |
04165bec | 43 | } |
8d772832 | 44 | |
04165bec RR |
45 | bool Create(wxWindow *parent, wxWindowID id, |
46 | const wxPoint& pos = wxDefaultPosition, | |
47 | const wxSize& size = wxDefaultSize, long style = 0, | |
04165bec | 48 | const wxValidator& validator = wxDefaultValidator, |
04165bec | 49 | const wxString& name = wxControlNameStr); |
2a4f4a27 | 50 | |
2a4f4a27 | 51 | // this function will filter out '&' characters and will put the accelerator |
8d99be5f VZ |
52 | // char (the one immediately after '&') into m_chAccel (TODO not yet) |
53 | virtual void SetLabel( const wxString &label ); | |
54 | virtual wxString GetLabel() const; | |
55 | ||
9d522606 RD |
56 | virtual wxVisualAttributes GetDefaultAttributes() const; |
57 | ||
2a4f4a27 | 58 | protected: |
f40fdaa3 VS |
59 | virtual void ApplyWidgetStyle(); |
60 | // helper function to ease native widgets wrapping, called by | |
61 | // ApplyWidgetStyle -- override this, not ApplyWidgetStyle | |
62 | virtual void DoApplyWidgetStyle(GtkRcStyle *style); | |
63 | ||
f68586e5 | 64 | virtual wxSize DoGetBestSize() const; |
abdeb9e7 RD |
65 | void PostCreation(const wxSize& size); |
66 | ||
eaafd2f8 VS |
67 | #ifdef __WXGTK20__ |
68 | wxString PrepareLabelMnemonics( const wxString &label ) const; | |
69 | #endif | |
f68586e5 | 70 | |
9d522606 RD |
71 | // These are used by GetDefaultAttributes |
72 | static wxVisualAttributes | |
73 | GetDefaultAttributesFromGTKWidget(GtkWidget* widget, | |
74 | bool useBase = false, | |
75 | int state = -1); | |
76 | static wxVisualAttributes | |
77 | GetDefaultAttributesFromGTKWidget(GtkWidget* (*widget_new)(void), | |
78 | bool useBase = false, | |
79 | int state = -1); | |
80 | static wxVisualAttributes | |
81 | GetDefaultAttributesFromGTKWidget(GtkWidget* (*widget_new)(const gchar*), | |
82 | bool useBase = false, | |
83 | int state = -1); | |
84 | ||
85 | static wxVisualAttributes | |
86 | GetDefaultAttributesFromGTKWidget(GtkWidget* (*widget_new)(GtkAdjustment*), | |
87 | bool useBase = false, | |
88 | int state = -1); | |
89 | ||
90 | // Widgets that use the style->base colour for the BG colour should | |
91 | // override this and return true. | |
92 | virtual bool UseGTKStyleBase() const { return false; } | |
93 | ||
8d99be5f VZ |
94 | wxString m_label; |
95 | char m_chAccel; // enabled to avoid breaking binary compatibility later on | |
8d772832 | 96 | |
738f9e5a RR |
97 | private: |
98 | DECLARE_DYNAMIC_CLASS(wxControl) | |
c801d85f KB |
99 | }; |
100 | ||
101 | #endif // __GTKCONTROLH__ |