]> git.saurik.com Git - wxWidgets.git/blob - include/wx/xrc/xh_sizer.h
fixed memory leak in the sample and simplified wxCheckListBox creation code
[wxWidgets.git] / include / wx / xrc / xh_sizer.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: xh_sizer.h
3 // Purpose: XML resource handler for wxBoxSizer
4 // Author: Vaclav Slavik
5 // Created: 2000/04/24
6 // RCS-ID: $Id$
7 // Copyright: (c) 2000 Vaclav Slavik
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10
11 #ifndef _WX_XH_SIZER_H_
12 #define _WX_XH_SIZER_H_
13
14 #include "wx/xrc/xmlres.h"
15 #include "wx/sizer.h"
16 #include "wx/gbsizer.h"
17
18
19 class WXDLLEXPORT wxSizer;
20
21 class WXDLLIMPEXP_XRC wxSizerXmlHandler : public wxXmlResourceHandler
22 {
23 DECLARE_DYNAMIC_CLASS(wxSizerXmlHandler)
24 public:
25 wxSizerXmlHandler();
26 virtual wxObject *DoCreateResource();
27 virtual bool CanHandle(wxXmlNode *node);
28
29 private:
30 bool m_isInside;
31 bool m_isGBS;
32
33 wxSizer *m_parentSizer;
34
35 bool IsSizerNode(wxXmlNode *node);
36
37 wxObject* Handle_sizeritem();
38 wxObject* Handle_spacer();
39 wxObject* Handle_sizer();
40 wxSizer* Handle_wxBoxSizer();
41 wxSizer* Handle_wxStaticBoxSizer();
42 wxSizer* Handle_wxGridSizer();
43 wxSizer* Handle_wxFlexGridSizer();
44 wxSizer* Handle_wxGridBagSizer();
45
46 void SetGrowables(wxFlexGridSizer* fsizer, const wxChar* param, bool rows);
47 wxGBPosition GetGBPos(const wxString& param);
48 wxGBSpan GetGBSpan(const wxString& param);
49 wxSizerItem* MakeSizerItem();
50 void SetSizerItemAttributes(wxSizerItem* sitem);
51 void AddSizerItem(wxSizerItem* sitem);
52 };
53
54
55 class WXDLLIMPEXP_XRC wxStdDialogButtonSizerXmlHandler
56 : public wxXmlResourceHandler
57 {
58 public:
59 wxStdDialogButtonSizerXmlHandler();
60 virtual wxObject *DoCreateResource();
61 virtual bool CanHandle(wxXmlNode *node);
62
63 private:
64 bool m_isInside;
65 wxStdDialogButtonSizer *m_parentSizer;
66
67 DECLARE_DYNAMIC_CLASS(wxStdDialogButtonSizerXmlHandler)
68 };
69
70
71 #endif // _WX_XH_SIZER_H_