]>
git.saurik.com Git - wxWidgets.git/blob - contrib/utils/wxrcedit/propedit.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Purpose: XML resources editor
3 // Author: Vaclav Slavik
6 // Copyright: (c) 2000 Vaclav Slavik
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
11 #pragma interface "propedit.h"
18 #include "wx/treectrl.h"
20 #include "propframe.h"
22 class WXDLLEXPORT wxXmlNode
;
23 class WXDLLEXPORT wxTreeCtrl
;
24 class WXDLLEXPORT wxTextCtrl
;
28 class PropEditCtrl
: public wxPanel
31 PropEditCtrl(PropertiesFrame
*propFrame
)
32 : wxPanel(propFrame
->m_valueWindow
, -1),
33 m_PropFrame(propFrame
), m_Created(FALSE
), m_TreeCtrl(propFrame
->m_tree
)
36 virtual void BeginEdit(const wxRect
& rect
, wxTreeItemId ti
);
37 virtual void EndEdit();
39 virtual wxTreeItemId
CreateTreeEntry(wxTreeItemId parent
, const PropertyInfo
& pinfo
);
40 virtual wxWindow
* CreateEditCtrl() = 0;
42 virtual bool IsPresent(const PropertyInfo
& pinfo
);
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('/')); }
51 virtual bool HasDetails() { return FALSE
; }
52 virtual void OnDetails() {}
53 virtual bool HasClearButton() { return TRUE
; }
55 void OnButtonDetails(wxCommandEvent
& event
);
56 void OnButtonClear(wxCommandEvent
& event
);
59 wxXmlNode
*GetNode() { return m_PropFrame
->m_Node
; }
60 bool CanSave() { return m_CanSave
; }
62 PropertiesFrame
*m_PropFrame
;
64 wxTreeCtrl
*m_TreeCtrl
;
65 wxTreeItemId m_TreeItem
;
67 PropertyInfo
*m_PropInfo
;
76 class PETreeData
: public wxTreeItemData
79 PETreeData(PropEditCtrl
*p
, const PropertyInfo
& pi
) :
81 EditCtrl(p
), PropInfo(pi
) {}
82 PropEditCtrl
*EditCtrl
;
83 PropertyInfo PropInfo
;