Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

OptKeyBindings.h

00001 
00002 // MathGUI = a WYSIWYG equation editor + a powerful math engine      //
00003 // Copyright (C) 2003 by Francesco Montorsi                          //
00004 //                                                                   //
00005 // This library is free software; you can redistribute it and/or     //
00006 // modify it under the terms of the GNU Lesser General Public        //
00007 // License as published by the Free Software Foundation; either      //
00008 // version 2.1 of the License, or (at your option) any later         //
00009 // version.                                                          //
00010 //                                                                   //
00011 // This library is distributed in the hope that it will be useful,   //
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of    //
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the      //
00014 // GNU Lesser General Public License for more details.               //
00015 //                                                                   //
00016 // You should have received a copy of the GNU Lesser General Public  //
00017 // License along with this program; if not, write to the Free        //
00018 // Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,   //
00019 // MA 02111-1307, USA.                                               //
00020 //                                                                   //
00021 // For any comment, suggestion or feature request, please contact    //
00022 // the administrator of the project at frm@users.sourceforge.net     //
00023 //                                                                   //
00025 // \file  OptKeyBindings.h
00026 // \brief Defines the mgOptKeyBindingsPanel class.
00027 //
00028 // See OptKeyBindings.cpp for more info.
00030 
00031 
00032 
00033 
00034 #ifndef OPTKEYBINDINGS_H
00035 #define OPTKEYBINDINGS_H
00036 
00037 
00038 #if defined(__GNUG__) && !defined(__APPLE__)
00039 #pragma interface "OptKeyBindings.h"
00040 #endif
00041 
00042 // For compilers that support precompilation, includes "wx/wx.h".
00043 /*#include "wx/wxprec.h"
00044 
00045 #ifdef __BORLANDC__
00046 #pragma hdrstop
00047 #endif
00048 
00049 // for all others, include the necessary headers
00050 #ifndef WX_PRECOMP
00051 #include "wx/wx.h"
00052 #endif
00053 
00054 */
00055 
00056 // includes
00057 #include "mg/OptBasePanel.h"
00058 #include <wx/keybinder.h>  // our base class (a wxWidgets extension)
00059 
00060 
00061 
00062 
00063 
00093 class mgOptKeyBindingsPanel : public mgOptBasePanel
00094 {
00095 protected:        // member variables
00096 
00099    static wxKeyProfile *m_pBinder;
00100 
00102    wxKeyConfigPanel *m_pKeyConfig;
00103 
00105    wxFrame *m_pFrame;
00106 
00107 protected:
00108 
00109    virtual mgOptDlg::mgOptChangedType
00110       CommitChanges( wxConfig* config );
00111    virtual void Setup( const wxString &itemLabel );
00112 
00113 public:
00114    mgOptKeyBindingsPanel();
00115    virtual ~mgOptKeyBindingsPanel() {}
00116 
00117 
00121    static void Setup() {
00122       SetBinder(new wxKeyProfile());
00123    }
00124 
00126    static void Cleanup() {
00127       mgSAFE_DELETE(m_pBinder);
00128    }
00129 
00133    static void SetBinder(wxKeyProfile *p) {
00134       mgSAFE_DELETE(m_pBinder);
00135       m_pBinder = p;
00136    }
00137 
00141    static wxKeyProfile *GetBinder() {
00142       wxASSERT_MSG(m_pBinder, wxT("Before using GetBinder(), use Setup()"));
00143       return m_pBinder;
00144    }
00145 
00146 
00147    static wxMenuBar *m_pMenuBar;
00148 
00149    static void ImportMenuBarCmd(wxMenuBar *p) {
00150       m_pMenuBar = p;
00151       GetBinder()->ImportMenuBarCmd(p);
00152    }
00153 
00154 
00156    virtual bool Show(bool show = TRUE);
00157 
00158       
00159 private:
00160    DECLARE_DYNAMIC_CLASS( mgOptKeyBindingsPanel )
00161    DECLARE_EVENT_TABLE()
00162 };
00163 
00164 #endif          // not defined OPTKEYBINDINGS_H
00165 
00166 


Documentation generated with Doxygen on Sun Feb 6 17:19:26 2005
Visit MathStudio home page for more info

[ Top ]