00001
00002
00003
00004
00005
00006
00007
00008
00009
00011
00012 #ifndef _WX_OPTIONEDITOR_H_
00013 #define _WX_OPTIONEDITOR_H_
00014
00015
00016 #include "wx/window.h"
00017 #include "wx/bitmap.h"
00018 #include "wx/dcclient.h"
00019 #include <wx/scrolwin.h>
00020
00021 #include "wx/propgrid/propgrid.h"
00022 #include "wxp/package.h"
00023 class wxConfigBase;
00024
00025
00026
00027
00028
00029
00030 class wxOptionEditorCtrl : public wxPropertyGrid
00031 {
00032 DECLARE_DYNAMIC_CLASS( wxOptionEditorCtrl )
00033 DECLARE_EVENT_TABLE()
00034
00035 public:
00036 wxOptionEditorCtrl() {}
00037
00038 wxOptionEditorCtrl(wxWindow* parent, wxWindowID id,
00039 const wxPoint& pos = wxDefaultPosition,
00040 const wxSize& size = wxDefaultSize,
00041 long style = 0,
00042 const wxString& name = wxT("wxOptionEditorCtrl"))
00043 { Create(parent, id, pos, size, style, name); }
00044
00045 bool Create(wxWindow* parent, wxWindowID id,
00046 const wxPoint& pos = wxDefaultPosition,
00047 const wxSize& size = wxDefaultSize,
00048 long style = 0,
00049 const wxString& name = wxT("wxOptionEditorCtrl"));
00050
00051
00052 public:
00053
00056 bool Load(wxConfigBase *, const wxString &path);
00057
00060 void Save(wxConfigBase *, const wxString &path) const;
00061
00067 bool SetOptions(const wxPackageCommandOptionArray &opt)
00068 { m_arr = opt; m_arr.SetDirty(false); return true; }
00069
00070
00071
00072 void SetBuildSystemType(wxPackageBuildSystemType type)
00073 { m_buildsys = type; }
00074 void SetStages(long stages)
00075 { m_stages = stages; }
00076 void SetCompilerFormats(long formats)
00077 { m_formats = formats; }
00078
00082 wxPackageCommandOptionArray &GetOptions()
00083 { return m_arr; }
00084
00087 bool IsDirty() const
00088 { return m_arr.IsDirty(); }
00089
00090 bool TransferDataFromWindow();
00091 bool TransferDataToWindow();
00092
00093 public:
00094
00095 void OnOptionChanged(wxPropertyGridEvent &ev);
00096
00097 protected:
00098 wxPackageCommandOptionArray m_arr;
00099
00100
00101 wxPackageBuildSystemType m_buildsys;
00102 long m_stages;
00103 long m_formats;
00104 };
00105
00106
00107
00108
00109
00110
00111 BEGIN_DECLARE_EVENT_TYPES()
00112
00113 DECLARE_EVENT_TYPE(wxEVT_COMMAND_OPTIONS_CHANGED, 3000000)
00114 END_DECLARE_EVENT_TYPES()
00115
00116 #define EVT_OPTIONS_CHANGED(id, fn) \
00117 wx__DECLARE_EVT1(wxEVT_COMMAND_OPTIONS_CHANGED, id, wxCommandEventHandler(fn))
00118
00119
00120 #endif
00121
00122