cmdeditdlg.h

00001 
00002 // Name:        cmdeditdlg.h
00003 // Purpose:     wxPackageCommandEditDlg definition
00004 // Author:      Francesco Montorsi
00005 // Modified by:
00006 // Created:     Sat 12 Aug 2006 16:34:58 CEST
00007 // RCS-ID:      $Id: cmdeditdlg.h,v 1.2 2007/01/01 20:06:19 frm Exp $
00008 // Copyright:   (c) 2006 Francesco Montorsi
00009 // Licence:     wxWidgets license
00011 
00012 #ifndef _CMDEDITDLG_H_
00013 #define _CMDEDITDLG_H_
00014 
00015 
00020 #include "wx/notebook.h"
00021 #include "wxp/packagecmd.h"
00022 #include "guicmn/condeditpanel.h"
00023 
00028 
00029 class wxNotebook;
00031 
00036 
00037 #define ID_DIALOG 10011
00038 #define SYMBOL_WXPACKAGECOMMANDEDITDLG_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX
00039 #define SYMBOL_WXPACKAGECOMMANDEDITDLG_TITLE _("Build system command")
00040 #define SYMBOL_WXPACKAGECOMMANDEDITDLG_IDNAME ID_DIALOG
00041 #define SYMBOL_WXPACKAGECOMMANDEDITDLG_SIZE wxSize(400, 300)
00042 #define SYMBOL_WXPACKAGECOMMANDEDITDLG_POSITION wxDefaultPosition
00043 #define ID_CMDEDIT_CMD 10000
00044 #define ID_CMDEDIT_WORKDIR 10001
00046 
00047 
00048 
00049 // ----------------------------------------------------------------------------
00050 // wxPackageCommandEditDlg
00051 // ----------------------------------------------------------------------------
00052 
00053 class wxPackageCommandEditDlg: public wxDialog
00054 {
00055     DECLARE_DYNAMIC_CLASS( wxPackageCommandEditDlg )
00056     DECLARE_EVENT_TABLE()
00057 
00058 public:
00060     wxPackageCommandEditDlg( );
00061     wxPackageCommandEditDlg( wxWindow* parent, wxWindowID id = SYMBOL_WXPACKAGECOMMANDEDITDLG_IDNAME, const wxString& caption = SYMBOL_WXPACKAGECOMMANDEDITDLG_TITLE, const wxPoint& pos = SYMBOL_WXPACKAGECOMMANDEDITDLG_POSITION, const wxSize& size = SYMBOL_WXPACKAGECOMMANDEDITDLG_SIZE, long style = SYMBOL_WXPACKAGECOMMANDEDITDLG_STYLE );
00062 
00064     bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WXPACKAGECOMMANDEDITDLG_IDNAME, const wxString& caption = SYMBOL_WXPACKAGECOMMANDEDITDLG_TITLE, const wxPoint& pos = SYMBOL_WXPACKAGECOMMANDEDITDLG_POSITION, const wxSize& size = SYMBOL_WXPACKAGECOMMANDEDITDLG_SIZE, long style = SYMBOL_WXPACKAGECOMMANDEDITDLG_STYLE );
00065 
00067     void CreateControls();
00068 
00070     static bool ShowToolTips();
00071 
00072 public:     // event handlers
00073 
00074     void OnOK(wxCommandEvent &ev);
00075 
00076 public:     // public API
00077 
00078     // NB: the stage is important as the cmd.GetCondition().GetStages() value
00079     //     cannot be used as it could comprise other stages (which is important
00080     //     to preserve to allow wxCommandSet to recognize commands from
00081     //     the wxPackageInfo' arrays)
00082     void SetCommand(const wxPackageCommand &cmd, wxPackageBuildSystemStage stage)
00083     {
00084         m_pCmd->SetValue(cmd.GetCommand());
00085         m_pWorkDir->SetValue(cmd.GetWorkingPath());
00086         m_pConditionPanel->SetCondition(cmd.GetCondition());
00087 
00088         m_pLabel->SetLabel(
00089             wxString::Format(wxT("This dialog allows you to edit the command for the %s stage.\nSince the command syntax is usually platform-dependent and also\nbuildsystem-dependent, you probably need to use the 'Condition' panel\nto restrict its validity."),
00090             wxPackageBuildSystemStage2String(stage).MakeUpper().c_str()));
00091     }
00092 
00093     wxPackageCommand GetCommand() const
00094     {
00095         wxPackageCommand ret(m_pCmd->GetValue(),
00096                              m_pWorkDir->GetValue(),
00097                              m_pConditionPanel->GetCondition());
00098         wxASSERT(ret.IsOk());
00099         return ret;
00100     }
00101 
00102 protected:      // controls
00103 
00105     wxNotebook* m_pNotebook;
00106     wxStaticText* m_pLabel;
00107     wxTextCtrl* m_pCmd;
00108     wxTextCtrl* m_pWorkDir;
00110 
00111     wxPackageConditionPanel *m_pConditionPanel;
00112 };
00113 
00114 #endif
00115 // _CMDEDITDLG_H_

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