]> git.saurik.com Git - wxWidgets.git/blob - contrib/utils/wxrcedit/propedit.h
added patch for theme savvy checkbox metrics
[wxWidgets.git] / contrib / utils / wxrcedit / propedit.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 "propedit.h"
12 #endif
13
14 #ifndef _PROPEDIT_H_
15 #define _PROPEDIT_H_
16
17 #include "wx/panel.h"
18 #include "wx/treectrl.h"
19 #include "nodesdb.h"
20 #include "propframe.h"
21
22 class WXDLLEXPORT wxXmlNode;
23 class WXDLLEXPORT wxTreeCtrl;
24 class WXDLLEXPORT wxTextCtrl;
25
26
27
28 class PropEditCtrl : public wxPanel
29 {
30 public:
31 PropEditCtrl(PropertiesFrame *propFrame)
32 : wxPanel(propFrame->m_valueWindow, -1),
33 m_PropFrame(propFrame), m_Created(FALSE), m_TreeCtrl(propFrame->m_tree)
34 {Show(FALSE);}
35
36 virtual void BeginEdit(const wxRect& rect, wxTreeItemId ti);
37 virtual void EndEdit();
38
39 virtual wxTreeItemId CreateTreeEntry(wxTreeItemId parent, const PropertyInfo& pinfo);
40 virtual wxWindow* CreateEditCtrl() = 0;
41
42 virtual bool IsPresent(const PropertyInfo& pinfo);
43
44 virtual void Clear();
45 virtual void ReadValue() = 0;
46 virtual void WriteValue() = 0;
47 virtual wxString GetValueAsText(wxTreeItemId ti);
48 virtual wxString GetPropName(const PropertyInfo& pinfo)
49 { return pinfo.Name.AfterLast(_T('/')); }
50
51 virtual bool HasDetails() { return FALSE; }
52 virtual void OnDetails() {}
53 virtual bool HasClearButton() { return TRUE; }
54
55 void OnButtonDetails(wxCommandEvent& event);
56 void OnButtonClear(wxCommandEvent& event);
57
58 protected:
59 wxXmlNode *GetNode() { return m_PropFrame->m_Node; }
60 bool CanSave() { return m_CanSave; }
61
62 PropertiesFrame *m_PropFrame;
63 bool m_Created;
64 wxTreeCtrl *m_TreeCtrl;
65 wxTreeItemId m_TreeItem;
66 wxWindow *m_TheCtrl;
67 PropertyInfo *m_PropInfo;
68
69 bool m_CanSave;
70
71 DECLARE_EVENT_TABLE()
72 };
73
74
75
76 class PETreeData : public wxTreeItemData
77 {
78 public:
79 PETreeData(PropEditCtrl *p, const PropertyInfo& pi) :
80 wxTreeItemData(),
81 EditCtrl(p), PropInfo(pi) {}
82 PropEditCtrl *EditCtrl;
83 PropertyInfo PropInfo;
84 };
85
86
87 #endif