]>
Commit | Line | Data |
---|---|---|
12d9e308 VS |
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 | ||
ab7ce33c | 10 | #if defined(__GNUG__) && !defined(__APPLE__) |
12d9e308 VS |
11 | #pragma interface "propedit.h" |
12 | #endif | |
13 | ||
14 | #ifndef _PROPEDIT_H_ | |
15 | #define _PROPEDIT_H_ | |
16 | ||
17 | #include "wx/panel.h" | |
af908359 | 18 | #include "wx/treectrl.h" |
12d9e308 VS |
19 | #include "nodesdb.h" |
20 | #include "propframe.h" | |
21 | ||
22 | class WXDLLEXPORT wxXmlNode; | |
af908359 | 23 | class WXDLLEXPORT wxTreeCtrl; |
12d9e308 VS |
24 | class WXDLLEXPORT wxTextCtrl; |
25 | ||
26 | ||
27 | ||
28 | class PropEditCtrl : public wxPanel | |
29 | { | |
30 | public: | |
31 | PropEditCtrl(PropertiesFrame *propFrame) | |
f80ea77b WS |
32 | : wxPanel(propFrame->m_valueWindow, wxID_ANY), |
33 | m_PropFrame(propFrame), m_Created(false), m_TreeCtrl(propFrame->m_tree) | |
34 | {Show(false);} | |
35 | ||
12d9e308 VS |
36 | virtual void BeginEdit(const wxRect& rect, wxTreeItemId ti); |
37 | virtual void EndEdit(); | |
f80ea77b | 38 | |
12d9e308 VS |
39 | virtual wxTreeItemId CreateTreeEntry(wxTreeItemId parent, const PropertyInfo& pinfo); |
40 | virtual wxWindow* CreateEditCtrl() = 0; | |
f80ea77b | 41 | |
12d9e308 | 42 | virtual bool IsPresent(const PropertyInfo& pinfo); |
f80ea77b | 43 | |
12d9e308 VS |
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('/')); } | |
f80ea77b WS |
50 | |
51 | virtual bool HasDetails() { return false; } | |
12d9e308 | 52 | virtual void OnDetails() {} |
f80ea77b WS |
53 | virtual bool HasClearButton() { return true; } |
54 | ||
12d9e308 VS |
55 | void OnButtonDetails(wxCommandEvent& event); |
56 | void OnButtonClear(wxCommandEvent& event); | |
f80ea77b | 57 | |
12d9e308 VS |
58 | protected: |
59 | wxXmlNode *GetNode() { return m_PropFrame->m_Node; } | |
60 | bool CanSave() { return m_CanSave; } | |
f80ea77b | 61 | |
12d9e308 VS |
62 | PropertiesFrame *m_PropFrame; |
63 | bool m_Created; | |
af908359 | 64 | wxTreeCtrl *m_TreeCtrl; |
12d9e308 VS |
65 | wxTreeItemId m_TreeItem; |
66 | wxWindow *m_TheCtrl; | |
67 | PropertyInfo *m_PropInfo; | |
f80ea77b | 68 | |
12d9e308 | 69 | bool m_CanSave; |
f80ea77b | 70 | |
12d9e308 VS |
71 | DECLARE_EVENT_TABLE() |
72 | }; | |
73 | ||
74 | ||
75 | ||
76 | class PETreeData : public wxTreeItemData | |
77 | { | |
78 | public: | |
f80ea77b | 79 | PETreeData(PropEditCtrl *p, const PropertyInfo& pi) : |
12d9e308 VS |
80 | wxTreeItemData(), |
81 | EditCtrl(p), PropInfo(pi) {} | |
82 | PropEditCtrl *EditCtrl; | |
83 | PropertyInfo PropInfo; | |
84 | }; | |
85 | ||
86 | ||
87 | #endif |