00001
00002
00003
00004
00005
00006
00007
00008
00009
00011
00012 #ifndef _WX_OPTIONLIST_H_
00013 #define _WX_OPTIONLIST_H_
00014
00015 #include "wx/treelistctrl.h"
00016 #include "wxp/package.h"
00017 class wxConfigBase;
00018
00019
00020
00021
00022
00023
00024 class wxOptionListCtrl : public wxTreeListCtrl
00025 {
00026 DECLARE_DYNAMIC_CLASS( wxOptionListCtrl )
00027 DECLARE_EVENT_TABLE()
00028
00029 public:
00030 wxOptionListCtrl() {}
00031
00032 wxOptionListCtrl(wxWindow* parent, wxWindowID id,
00033 const wxPoint& pos = wxDefaultPosition,
00034 const wxSize& size = wxDefaultSize,
00035 long style = 0,
00036 const wxString& name = wxT("wxOptionListCtrl"))
00037 { Create(parent, id, pos, size, style, name); }
00038
00039 bool Create(wxWindow* parent, wxWindowID id,
00040 const wxPoint& pos = wxDefaultPosition,
00041 const wxSize& size = wxDefaultSize,
00042 long style = 0,
00043 const wxString& name = wxT("wxOptionListCtrl"));
00044
00045
00046 public:
00047
00050 bool Load(wxConfigBase *, const wxString &path);
00051
00054 void Save(wxConfigBase *, const wxString &path) const;
00055
00060 bool SetOptions(const wxPackageCommandOptionArray &opt)
00061 { m_arr = opt; m_arr.SetDirty(false); return TransferDataToWindow(); }
00062
00063 void SetBuildSystemType(wxPackageBuildSystemType type)
00064 { m_buildsys = type; TransferDataToWindow(); }
00065 void SetStages(long stages)
00066 { m_stages = stages; TransferDataToWindow(); }
00067 void SetCompilerFormats(long formats)
00068 { m_formats = formats; TransferDataToWindow(); }
00069
00073 wxPackageCommandOptionArray &GetOptions()
00074 { return m_arr; }
00075
00078 bool IsDirty() const
00079 { return m_arr.IsDirty(); }
00080
00081 bool TransferDataFromWindow();
00082 bool TransferDataToWindow();
00083
00084
00085
00086
00087 void DeleteSelected();
00088 wxString GetSelectedOptName() const;
00089
00090
00091 public:
00092
00093 void OnItemActivated(wxTreeEvent &ev);
00094
00095 protected:
00096 wxPackageCommandOptionArray m_arr;
00097
00098
00099 wxPackageBuildSystemType m_buildsys;
00100 long m_stages;
00101 long m_formats;
00102 };
00103
00104
00105
00106
00107
00108
00109 BEGIN_DECLARE_EVENT_TYPES()
00110
00111 DECLARE_EVENT_TYPE(wxEVT_COMMAND_OPTION_DCLICK, 31230000)
00112 END_DECLARE_EVENT_TYPES()
00113
00114 #define EVT_OPTION_DCLICK(id, fn) \
00115 wx__DECLARE_EVT1(wxEVT_COMMAND_OPTION_DCLICK, id, wxCommandEventHandler(fn))
00116
00117
00118 #endif
00119
00120