optlistctrl.h

00001 
00002 // Name:        optlistctrl.h
00003 // Purpose:     wxOptionListCtrl definition
00004 // Author:      Francesco Montorsi
00005 // Modified by:
00006 // Created:     10/7/2006
00007 // RCS-ID:      $Id: optlistctrl.h,v 1.1.1.1 2006/12/12 09:41:04 frm Exp $
00008 // Copyright:   (c) Francesco Montorsi
00009 // Licence:     wxWindows licence
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 // wxOptionListCtrl - a control to show package options
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:     // wxOptionListCtrl-specific API
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     // functions which work on selected item:
00086 
00087     void DeleteSelected();
00088     wxString GetSelectedOptName() const;
00089 
00090 
00091 public:     // event handlers
00092 
00093     void OnItemActivated(wxTreeEvent &ev);
00094 
00095 protected:
00096     wxPackageCommandOptionArray m_arr;
00097 
00098     // filters of the m_arr options above:
00099     wxPackageBuildSystemType m_buildsys;
00100     long m_stages;
00101     long m_formats;
00102 };
00103 
00104 
00105 // ----------------------------------------------------------------------------
00106 // wxEVT_COMMAND_OPTION_DCLICK
00107 // ----------------------------------------------------------------------------
00108 
00109 BEGIN_DECLARE_EVENT_TYPES()
00110     //DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP, wxEVT_COMMAND_FILTER_PACKAGES, 1000000)
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     // _WX_OPTIONLIST_H_
00120 

Generated on Thu Feb 1 22:14:31 2007 for wxWidgets Package Manager by  doxygen 1.5.1-p1