]> git.saurik.com Git - wxWidgets.git/blob - contrib/utils/wxrcedit/prophnd.h
added binz handler
[wxWidgets.git] / contrib / utils / wxrcedit / prophnd.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Purpose: XML resources editor
3 // Author: Vaclav Slavik
4 // Created: 2000/05/05
5 // RCS-ID: $Id$
6 // Copyright: (c) 2000 Vaclav Slavik
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9
10 #ifdef __GNUG__
11 #pragma interface "prophnd.h"
12 #endif
13
14 #ifndef _PROPHND_H_
15 #define _PROPHND_H_
16
17
18 class WXDLLEXPORT wxXmlNode;
19 class WXDLLEXPORT wxList;
20 class WXDLLEXPORT wxListCtrl;
21 class WXDLLEXPORT wxPanel;
22 class WXDLLEXPORT wxWindow;
23
24 #include "wx/xml/xml.h"
25 #include "wx/dynarray.h"
26
27 enum PropertyType
28 {
29 PROP_TEXT = 0,
30 PROP_FLAGS = 1,
31 PROP_COLOR = 2,
32 PROP_BOOL = 3,
33 PROP_INTEGER = 4,
34 PROP_COORD = 5,
35 PROP_NOT_IMPLEMENTED = 6,
36 };
37 #define PROP_TYPES_CNT 7
38
39 class PropertyInfo
40 {
41 public:
42 PropertyType Type;
43 wxString Name;
44 wxString MoreInfo;
45 };
46
47 WX_DECLARE_OBJARRAY(PropertyInfo, PropertyInfoArray);
48
49
50 class PropertyHandler;
51
52 class PropsListInfo : public wxObject
53 {
54 public:
55 PropsListInfo(int index, PropertyHandler *hnd, wxXmlNode *node,
56 PropertyInfo *pi, wxListCtrl *listctrl) :
57 m_Index(index), m_Handler(hnd), m_Node(node),
58 m_PropInfo(pi), m_ListCtrl(listctrl) {}
59 virtual ~PropsListInfo() {}
60
61 int m_Index;
62 PropertyHandler *m_Handler;
63 wxXmlNode *m_Node;
64 PropertyInfo *m_PropInfo;
65 wxListCtrl *m_ListCtrl;
66 };
67
68
69
70
71 class PropertyHandler
72 {
73 public:
74 PropertyHandler() {}
75
76 int CreateListItem(wxListCtrl *listctrl, wxXmlNode *node, PropertyInfo *pi);
77
78 virtual wxString GetBriefValue(wxXmlNode *node, PropertyInfo *pi);
79 virtual wxPanel *CreateEditPanel(wxWindow *parent, PropsListInfo *pli) = 0;
80 };
81
82
83
84 class TextPropertyHandler : public PropertyHandler
85 {
86 public:
87 TextPropertyHandler() {}
88 virtual wxPanel *CreateEditPanel(wxWindow *parent, PropsListInfo *pli);
89 };
90
91
92 class CoordPropertyHandler : public PropertyHandler
93 {
94 public:
95 CoordPropertyHandler() {}
96 virtual wxPanel *CreateEditPanel(wxWindow *parent, PropsListInfo *pli);
97 };
98
99
100 class BoolPropertyHandler : public PropertyHandler
101 {
102 public:
103 BoolPropertyHandler() {}
104 virtual wxString GetBriefValue(wxXmlNode *node, PropertyInfo *pi);
105 virtual wxPanel *CreateEditPanel(wxWindow *parent, PropsListInfo *pli);
106 };
107
108
109 class FlagsPropertyHandler : public PropertyHandler
110 {
111 public:
112 FlagsPropertyHandler() {}
113 virtual wxPanel *CreateEditPanel(wxWindow *parent, PropsListInfo *pli);
114 };
115
116
117
118 class NotImplPropertyHandler : public PropertyHandler
119 {
120 public:
121 NotImplPropertyHandler() {}
122 virtual wxPanel *CreateEditPanel(wxWindow *parent, PropsListInfo *pli);
123 };
124
125
126 #endif