]>
git.saurik.com Git - wxWidgets.git/blob - src/common/panelcmn.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/common/panelcmn.cpp
3 // Purpose: wxPanel common code
4 // Author: Julian Smart, Robert Roebling, Vadim Zeitlin
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 // For compilers that support precompilation, includes "wx.h".
21 #include "wx/wxprec.h"
28 #include "wx/object.h"
30 #include "wx/colour.h"
31 #include "wx/settings.h"
34 #include "wx/containr.h"
37 // ----------------------------------------------------------------------------
39 // ----------------------------------------------------------------------------
41 wxDEFINE_FLAGS( wxPanelStyle
)
42 wxBEGIN_FLAGS( wxPanelStyle
)
43 // new style border flags, we put them first to
44 // use them for streaming out
45 wxFLAGS_MEMBER(wxBORDER_SIMPLE
)
46 wxFLAGS_MEMBER(wxBORDER_SUNKEN
)
47 wxFLAGS_MEMBER(wxBORDER_DOUBLE
)
48 wxFLAGS_MEMBER(wxBORDER_RAISED
)
49 wxFLAGS_MEMBER(wxBORDER_STATIC
)
50 wxFLAGS_MEMBER(wxBORDER_NONE
)
52 // old style border flags
53 wxFLAGS_MEMBER(wxSIMPLE_BORDER
)
54 wxFLAGS_MEMBER(wxSUNKEN_BORDER
)
55 wxFLAGS_MEMBER(wxDOUBLE_BORDER
)
56 wxFLAGS_MEMBER(wxRAISED_BORDER
)
57 wxFLAGS_MEMBER(wxSTATIC_BORDER
)
58 wxFLAGS_MEMBER(wxBORDER
)
60 // standard window styles
61 wxFLAGS_MEMBER(wxTAB_TRAVERSAL
)
62 wxFLAGS_MEMBER(wxCLIP_CHILDREN
)
63 wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW
)
64 wxFLAGS_MEMBER(wxWANTS_CHARS
)
65 wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE
)
66 wxFLAGS_MEMBER(wxALWAYS_SHOW_SB
)
67 wxFLAGS_MEMBER(wxVSCROLL
)
68 wxFLAGS_MEMBER(wxHSCROLL
)
69 wxEND_FLAGS( wxPanelStyle
)
71 wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxPanel
, wxWindow
, "wx/panel.h")
73 wxBEGIN_PROPERTIES_TABLE(wxPanel
)
74 wxPROPERTY_FLAGS( WindowStyle
, wxPanelStyle
, long, \
75 SetWindowStyleFlag
, GetWindowStyleFlag
, \
76 wxEMPTY_PARAMETER_VALUE
, 0 /*flags*/, \
77 wxT("Helpstring"), wxT("group")) // style
78 // style wxTAB_TRAVERSAL
79 wxEND_PROPERTIES_TABLE()
81 wxEMPTY_HANDLERS_TABLE(wxPanel
)
83 wxCONSTRUCTOR_6( wxPanel
, wxWindow
*, Parent
, wxWindowID
, Id
, \
84 wxPoint
, Position
, wxSize
, Size
, long, WindowStyle
, \
88 // ----------------------------------------------------------------------------
90 // ----------------------------------------------------------------------------
92 BEGIN_EVENT_TABLE(wxPanelBase
, wxWindow
)
93 WX_EVENT_TABLE_CONTROL_CONTAINER(wxPanelBase
)
96 // ============================================================================
98 // ============================================================================
100 WX_DELEGATE_TO_CONTROL_CONTAINER(wxPanelBase
, wxWindow
)
102 // ----------------------------------------------------------------------------
103 // wxPanelBase creation
104 // ----------------------------------------------------------------------------
106 wxPanelBase::wxPanelBase()
108 WX_INIT_CONTROL_CONTAINER();
111 bool wxPanelBase::Create(wxWindow
*parent
, wxWindowID id
,
115 const wxString
& name
)
117 if ( !wxWindow::Create(parent
, id
, pos
, size
, style
, name
) )
120 // so that non-solid background renders correctly under GTK+:
121 SetThemeEnabled(true);
123 #if defined(__WXWINCE__) && (defined(__POCKETPC__) || defined(__SMARTPHONE__))
124 // Required to get solid control backgrounds under WinCE
125 SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW
));
131 void wxPanelBase::InitDialog()
133 wxInitDialogEvent
event(GetId());
134 event
.SetEventObject(this);
135 GetEventHandler()->ProcessEvent(event
);