]>
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
7 // Copyright: (c) Julian Smart
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 // ============================================================================
13 // ============================================================================
15 // ----------------------------------------------------------------------------
17 // ----------------------------------------------------------------------------
19 // For compilers that support precompilation, includes "wx.h".
20 #include "wx/wxprec.h"
27 #include "wx/object.h"
29 #include "wx/colour.h"
30 #include "wx/settings.h"
33 #include "wx/containr.h"
36 // ----------------------------------------------------------------------------
38 // ----------------------------------------------------------------------------
40 wxDEFINE_FLAGS( wxPanelStyle
)
41 wxBEGIN_FLAGS( wxPanelStyle
)
42 // new style border flags, we put them first to
43 // use them for streaming out
44 wxFLAGS_MEMBER(wxBORDER_SIMPLE
)
45 wxFLAGS_MEMBER(wxBORDER_SUNKEN
)
46 wxFLAGS_MEMBER(wxBORDER_DOUBLE
)
47 wxFLAGS_MEMBER(wxBORDER_RAISED
)
48 wxFLAGS_MEMBER(wxBORDER_STATIC
)
49 wxFLAGS_MEMBER(wxBORDER_NONE
)
51 // old style border flags
52 wxFLAGS_MEMBER(wxSIMPLE_BORDER
)
53 wxFLAGS_MEMBER(wxSUNKEN_BORDER
)
54 wxFLAGS_MEMBER(wxDOUBLE_BORDER
)
55 wxFLAGS_MEMBER(wxRAISED_BORDER
)
56 wxFLAGS_MEMBER(wxSTATIC_BORDER
)
57 wxFLAGS_MEMBER(wxBORDER
)
59 // standard window styles
60 wxFLAGS_MEMBER(wxTAB_TRAVERSAL
)
61 wxFLAGS_MEMBER(wxCLIP_CHILDREN
)
62 wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW
)
63 wxFLAGS_MEMBER(wxWANTS_CHARS
)
64 wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE
)
65 wxFLAGS_MEMBER(wxALWAYS_SHOW_SB
)
66 wxFLAGS_MEMBER(wxVSCROLL
)
67 wxFLAGS_MEMBER(wxHSCROLL
)
68 wxEND_FLAGS( wxPanelStyle
)
70 wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxPanel
, wxWindow
, "wx/panel.h")
72 wxBEGIN_PROPERTIES_TABLE(wxPanel
)
73 wxPROPERTY_FLAGS( WindowStyle
, wxPanelStyle
, long, \
74 SetWindowStyleFlag
, GetWindowStyleFlag
, \
75 wxEMPTY_PARAMETER_VALUE
, 0 /*flags*/, \
76 wxT("Helpstring"), wxT("group")) // style
77 // style wxTAB_TRAVERSAL
78 wxEND_PROPERTIES_TABLE()
80 wxEMPTY_HANDLERS_TABLE(wxPanel
)
82 wxCONSTRUCTOR_6( wxPanel
, wxWindow
*, Parent
, wxWindowID
, Id
, \
83 wxPoint
, Position
, wxSize
, Size
, long, WindowStyle
, \
87 // ============================================================================
89 // ============================================================================
91 // ----------------------------------------------------------------------------
92 // wxPanelBase creation
93 // ----------------------------------------------------------------------------
95 bool wxPanelBase::Create(wxWindow
*parent
, wxWindowID id
,
101 if ( !wxWindow::Create(parent
, id
, pos
, size
, style
, name
) )
104 // so that non-solid background renders correctly under GTK+:
105 SetThemeEnabled(true);
107 #if defined(__WXWINCE__) && (defined(__POCKETPC__) || defined(__SMARTPHONE__))
108 // Required to get solid control backgrounds under WinCE
109 SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW
));
115 void wxPanelBase::InitDialog()
117 wxInitDialogEvent
event(GetId());
118 event
.SetEventObject(this);
119 GetEventHandler()->ProcessEvent(event
);