]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/mac/classic/control.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxControl class
4 // Author: Stefan Csomor
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_CONTROL_H_
13 #define _WX_CONTROL_H_
15 WXDLLEXPORT_DATA(extern const wxChar
) wxControlNameStr
[];
18 class WXDLLEXPORT wxControl
: public wxControlBase
20 DECLARE_ABSTRACT_CLASS(wxControl
)
24 wxControl(wxWindow
*parent
, wxWindowID id
,
25 const wxPoint
& pos
= wxDefaultPosition
,
26 const wxSize
& size
= wxDefaultSize
, long style
= 0,
27 const wxValidator
& validator
= wxDefaultValidator
,
28 const wxString
& name
= wxControlNameStr
)
30 Create(parent
, id
, pos
, size
, style
, validator
, name
);
33 bool Create(wxWindow
*parent
, wxWindowID id
,
34 const wxPoint
& pos
= wxDefaultPosition
,
35 const wxSize
& size
= wxDefaultSize
, long style
= 0,
36 const wxValidator
& validator
= wxDefaultValidator
,
37 const wxString
& name
= wxControlNameStr
);
41 virtual void Command(wxCommandEvent
& event
) { ProcessCommand(event
); }
43 // implementation from now on
44 // --------------------------
46 // Calls the callback and appropriate event handlers
47 bool ProcessCommand(wxCommandEvent
& event
);
48 virtual void SetLabel(const wxString
& title
) ;
50 wxList
& GetSubcontrols() { return m_subControls
; }
52 void OnEraseBackground(wxEraseEvent
& event
);
54 virtual bool Enable(bool enable
= TRUE
) ;
55 virtual bool Show(bool show
= TRUE
) ;
56 virtual void DoSetWindowVariant( wxWindowVariant variant
) ;
58 virtual void MacRedrawControl () ;
59 virtual void MacHandleControlClick( WXWidget control
, wxInt16 controlpart
, bool mouseStillDown
) ;
60 virtual void MacPreControlCreate( wxWindow
*parent
, wxWindowID id
, wxString label
,
62 const wxSize
& size
, long style
,
63 const wxValidator
& validator
,
64 const wxString
& name
,
66 unsigned char* maclabel
) ;
67 virtual void MacPostControlCreate() ;
68 virtual void MacAdjustControlRect() ;
69 virtual WXWidget
MacGetContainerForEmbedding() ;
70 virtual void MacSuperChangedPosition() ;
71 virtual void MacSuperEnabled( bool enabled
) ;
72 virtual void MacSuperShown( bool show
) ;
73 virtual bool MacCanFocus() const ;
74 virtual void MacUpdateDimensions() ;
75 void* MacGetControlAction() { return m_macControlAction
; }
77 virtual void DoSetSize(int x
, int y
,int width
, int height
,int sizeFlags
= wxSIZE_AUTO
) ;
78 void OnKeyDown( wxKeyEvent
&event
) ;
79 void OnMouseEvent( wxMouseEvent
&event
) ;
80 void OnPaint(wxPaintEvent
& event
) ;
81 virtual void Refresh(bool eraseBack
= TRUE
, const wxRect
*rect
= NULL
) ;
82 WXWidget
GetMacControl() { return m_macControl
;}
85 // For controls like radiobuttons which are really composite
86 WXWidget m_macControl
;
87 void* m_macControlAction
;
88 bool m_macControlIsShown
;
90 int m_macHorizontalBorder
;
91 int m_macVerticalBorder
;
93 virtual wxSize
DoGetBestSize() const;
100 wxControl
*wxFindControlFromMacControl(WXWidget inControl
) ;
101 void wxAssociateControlWithMacControl(WXWidget inControl
, wxControl
*control
) ;
102 void wxRemoveMacControlAssociation(wxControl
*control
) ;