opteditdlg.h

00001 
00002 // Name:        opteditdlg.h
00003 // Purpose:     wxPackageOptionEditDlg definition
00004 // Author:      Francesco Montorsi
00005 // Modified by:
00006 // Created:     Thu 10 Aug 2006 19:08:43 CEST
00007 // RCS-ID:      $Id: opteditdlg.h,v 1.2 2007/01/01 20:06:20 frm Exp $
00008 // Copyright:   (c) 2006 Francesco Montorsi
00009 // Licence:     wxWidgets license
00011 
00012 #ifndef _OPTEDITDLG_H_
00013 #define _OPTEDITDLG_H_
00014 
00015 
00020 #include "wx/notebook.h"
00021 #include "wxp/packageopt.h"
00022 #include "guicmn/condeditpanel.h"
00023 
00028 class wxNotebook;
00029 
00034 
00035 #define SYMBOL_WXPACKAGEOPTIONEDITDLG_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX
00036 #define SYMBOL_WXPACKAGEOPTIONEDITDLG_TITLE _("Build system option")
00037 #define SYMBOL_WXPACKAGEOPTIONEDITDLG_IDNAME wxID_ANY
00038 #define SYMBOL_WXPACKAGEOPTIONEDITDLG_SIZE wxSize(400, 300)
00039 #define SYMBOL_WXPACKAGEOPTIONEDITDLG_POSITION wxDefaultPosition
00040 #define ID_OPTEDIT_NAME 10002
00041 #define ID_OPTEDIT_CATEGORY 10003
00042 #define ID_OPTEDIT_VALUES 10004
00043 #define ID_OPTEDIT_DEFVALUE 10005
00044 #define ID_OPTEDIT_GROUP 10006
00045 #define ID_OPTEDIT_DESCRIPTION 10016
00047 
00048 
00049 // ----------------------------------------------------------------------------
00050 // wxPackageOptionEditDlg
00051 // ----------------------------------------------------------------------------
00052 
00053 class wxPackageOptionEditDlg: public wxDialog
00054 {
00055     DECLARE_DYNAMIC_CLASS( wxPackageOptionEditDlg )
00056     DECLARE_EVENT_TABLE()
00057 
00058 public:
00060     wxPackageOptionEditDlg( );
00061     wxPackageOptionEditDlg( wxWindow* parent, wxWindowID id = SYMBOL_WXPACKAGEOPTIONEDITDLG_IDNAME, const wxString& caption = SYMBOL_WXPACKAGEOPTIONEDITDLG_TITLE, const wxPoint& pos = SYMBOL_WXPACKAGEOPTIONEDITDLG_POSITION, const wxSize& size = SYMBOL_WXPACKAGEOPTIONEDITDLG_SIZE, long style = SYMBOL_WXPACKAGEOPTIONEDITDLG_STYLE );
00062 
00064     bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WXPACKAGEOPTIONEDITDLG_IDNAME, const wxString& caption = SYMBOL_WXPACKAGEOPTIONEDITDLG_TITLE, const wxPoint& pos = SYMBOL_WXPACKAGEOPTIONEDITDLG_POSITION, const wxSize& size = SYMBOL_WXPACKAGEOPTIONEDITDLG_SIZE, long style = SYMBOL_WXPACKAGEOPTIONEDITDLG_STYLE );
00065 
00067     void CreateControls();
00068 
00070     static bool ShowToolTips();
00071 
00072 public:     // event handlers
00073 
00074     void OnOK(wxCommandEvent &);
00075     void OnCategory(wxCommandEvent &ev);
00076 
00077 public:     // public API
00078 
00079     void SetOption(const wxPackageCommandOption &opt)
00080     {
00081         m_pName->SetValue(opt.GetName());
00082         m_pCategory->Select(opt.GetCategory());
00083         m_pAllowedValues->SetValue(opt.GetAllowedValues());
00084         m_pDefValue->SetValue(opt.GetDefaultValue());
00085         m_pGroup->SetValue(opt.GetGroup());
00086         m_pDescription->SetValue(opt.GetDescription());
00087 
00088         m_pConditionPanel->SetCondition(opt.GetCondition());
00089     }
00090 
00091     wxPackageCommandOption GetOption() const
00092     {
00093         wxPackageCommandOption ret(m_pName->GetValue(),
00094                                    m_pAllowedValues->GetValue(),
00095                                    m_pDefValue->GetValue(),
00096                                    m_pDefValue->GetValue(),
00097                                    wxEmptyString,
00098                                    m_pDescription->GetValue(),
00099                                    m_pGroup->GetValue(),
00100                                    (wxPackageCommandOptionCategory)m_pCategory->GetSelection(),
00101                                    m_pConditionPanel->GetCondition());
00102         wxASSERT(ret.IsOk());
00103         return ret;
00104     }
00105 
00106 protected:      // controls
00107 
00109     wxNotebook* m_pNotebook;
00110     wxTextCtrl* m_pName;
00111     wxChoice* m_pCategory;
00112     wxTextCtrl* m_pAllowedValues;
00113     wxTextCtrl* m_pDefValue;
00114     wxComboBox* m_pGroup;
00115     wxTextCtrl* m_pDescription;
00117 
00118     wxPackageConditionPanel *m_pConditionPanel;
00119 };
00120 
00121 #endif
00122     // _OPTEDITDLG_H_

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