compilerpanel.h

00001 
00002 // Name:        compilerpanel.h
00003 // Purpose:     wxCompilerSettingsPanel definition
00004 // Author:      Francesco Montorsi
00005 // Modified by: 
00006 // Created:     08/07/2006 14:41:18
00007 // RCS-ID:      $Id: compilerpanel.h,v 1.4 2007/02/01 20:28:14 frm Exp $
00008 // Copyright:   (c) 2006 Francesco Montorsi
00009 // Licence:     wxWidgets license
00011 
00012 #ifndef _PMCOMPILERSETTINGS_H_
00013 #define _PMCOMPILERSETTINGS_H_
00014 
00015 
00020 #include "wxp/compiler.h"
00021 #include "wxp/package.h"
00022 
00023 
00028 class wxOptionEditorCtrl;
00029 class wxConfigBase;
00030 class wxPackage;
00031 
00032 
00037 
00038 #define ID_COMPILERSETTINGS_DEFAULTCOMPILER 10036
00039 #define ID_COMPILERSETTINGS_NOTES 10059
00040 #define ID_COMPILERSETTINGS_PATHS 10000
00041 #define ID_COMPILERSETTINGS_ADDPATH 10035
00042 #define ID_COMPILERSETTINGS_EDITPATH 10058
00043 #define ID_COMPILERSETTINGS_OPENPATH 10233
00044 #define ID_COMPILERSETTINGS_DELETEPATH 10037
00045 #define ID_COMPILERSETTINGS_AUTODETECT 10001
00046 #define SYMBOL_WXCOMPILERSETTINGSPANEL_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX
00047 #define SYMBOL_WXCOMPILERSETTINGSPANEL_TITLE _("Dialog")
00048 #define SYMBOL_WXCOMPILERSETTINGSPANEL_IDNAME wxID_ANY
00049 #define SYMBOL_WXCOMPILERSETTINGSPANEL_SIZE wxSize(400, 300)
00050 #define SYMBOL_WXCOMPILERSETTINGSPANEL_POSITION wxDefaultPosition
00052 
00053 
00054 
00055 // ----------------------------------------------------------------------------
00056 // wxCompilerSettingsPanel
00057 // ----------------------------------------------------------------------------
00058 
00059 class wxCompilerSettingsPanel: public wxPanel
00060 {    
00061     DECLARE_DYNAMIC_CLASS( wxCompilerSettingsPanel )
00062     DECLARE_EVENT_TABLE()
00063 
00064 public:
00066     wxCompilerSettingsPanel( );
00067     wxCompilerSettingsPanel( wxWindow* parent, 
00068                              wxWindowID id = SYMBOL_WXCOMPILERSETTINGSPANEL_IDNAME, 
00069                              const wxPoint& pos = SYMBOL_WXCOMPILERSETTINGSPANEL_POSITION, 
00070                              const wxSize& size = SYMBOL_WXCOMPILERSETTINGSPANEL_SIZE, 
00071                              long style = SYMBOL_WXCOMPILERSETTINGSPANEL_STYLE );
00072 
00074     bool Create( wxWindow* parent, 
00075                  wxWindowID id = SYMBOL_WXCOMPILERSETTINGSPANEL_IDNAME, 
00076                  const wxPoint& pos = SYMBOL_WXCOMPILERSETTINGSPANEL_POSITION, 
00077                  const wxSize& size = SYMBOL_WXCOMPILERSETTINGSPANEL_SIZE, 
00078                  long style = SYMBOL_WXCOMPILERSETTINGSPANEL_STYLE );
00079 
00081     void CreateControls();
00082 
00083     bool ShowToolTips();
00084 
00085 public:     // event handlers
00086 
00087     void OnCompilerChanged(wxCommandEvent &);
00088     void OnAutodetect(wxCommandEvent &);
00089 
00090     void OnAddNewPath(wxCommandEvent &ev);
00091     void OnRemovePath(wxCommandEvent &ev);
00092     void OnEditPath(wxCommandEvent &);
00093     void OnOpenPath(wxCommandEvent &);
00094 
00095     void OnUpdateUI(wxUpdateUIEvent &);
00096 
00097 public:     // public API
00098       /*
00099     bool Load(wxConfigBase *, const wxString &path);
00100     void Save(wxConfigBase *, const wxString &path) const;
00101 */
00102     void UpdatePathList();
00103     void UpdatePackageCompiler();
00104     void UpdateCompilerSettingsPaths();
00105     void UpdateNotes();
00106 
00107     wxPackage &GetPackage()
00108         { return m_pkg; }
00109 
00110     wxPackageCompilerFormat GetSelCompilerFormat() const;
00111 
00112 public:     // one of these two function MUST be called after creation !!
00113 
00114     void InitAsGlobal();
00115     void SetPackage(const wxPackage &);
00116 
00117 public:     // misc
00118 
00120     static void InteractiveAutodetectPathsFor(wxPackageCompilerFormat f);
00121 
00122 protected:      // autodetect helpers
00123 
00124     static bool AutodetectMSVC();
00125     static bool AutodetectBCC();
00126     static bool AutodetectMinGW();
00127     static bool AutodetectWatcom();
00128 
00129 protected:      // internal utils
00130 
00131     wxString GetCompilerUserFriendlyName(wxPackageCompilerFormat f);
00132 
00133 protected:      // controls
00134 
00135     wxChoice *m_pCompilerChoice;
00136     wxListBox *m_pPathList;
00137     wxTextCtrl *m_pNotes;
00138 
00139 protected:
00140 
00141     wxPackage m_pkg;
00142 };
00143 
00144 
00145 #endif
00146     // _PMCOMPILERSETTINGS_H_

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