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 // // 00030 00031 00032 00033 // optimization for GCC compiler 00034 #if defined(__GNUG__) && !defined(__APPLE__) 00035 #pragma implementation "OptKeyBindings.h" 00036 #endif 00037 00038 // includes 00039 #include "mg/mgprec.h" 00040 00041 #ifndef mgPRECOMP 00042 #include <mc/MathCore.h> 00043 #include "mg/OptKeyBindings.h" 00044 #endif 00045 00046 00047 00048 00049 // event table for mgOptKeyBindingsPanel 00050 IMPLEMENT_DYNAMIC_CLASS(mgOptKeyBindingsPanel, mgOptBasePanel ) 00051 BEGIN_EVENT_TABLE( mgOptKeyBindingsPanel, mgOptBasePanel ) 00052 END_EVENT_TABLE() 00053 00054 00055 // init the STATIC variables 00056 wxKeyProfile *mgOptKeyBindingsPanel::m_pBinder = NULL; 00057 wxMenuBar *mgOptKeyBindingsPanel::m_pMenuBar = NULL; 00058 00059 00060 00061 // -------------------------------------------- 00062 // mgOPTKEYBINDINGSPANEL 00063 // -------------------------------------------- 00064 00065 mgOptKeyBindingsPanel::mgOptKeyBindingsPanel() 00066 { 00067 // this will be created later... 00068 m_pKeyConfig = NULL; 00069 } 00070 00071 void mgOptKeyBindingsPanel::Setup(const wxString &itemLabel) 00072 { 00073 // create the config panel: it will make a copy of our key binder; thus, 00074 // modifies after this call won't be reflected in the config panel... 00075 m_pKeyConfig = new wxKeyConfigPanel(this, m_pBinder, wxKEYBINDER_USE_LISTBOX); 00076 m_pKeyConfig->ImportMenuBarCmd(m_pMenuBar); 00077 00078 // add some description 00079 wxStaticBox *box = new wxStaticBox(this, -1, wxT("Key bindings")); 00080 wxStaticBoxSizer *main = new wxStaticBoxSizer(box, wxVERTICAL); 00081 main->Add(new wxStaticText(this, -1, 00082 wxT("Through this panel, you can modify the shortcuts bind with each menu command.")), 00083 0, wxGROW | wxALL, 5); 00084 00085 // just set the wxKeyConfigPanel as the content of this panel... 00086 main->Add(m_pKeyConfig, 1, wxGROW); 00087 00088 // set the sizer as the main sizer for the dialog 00089 SetSizer(main); 00090 main->SetSizeHints(this); 00091 } 00092 00093 mgOptDlg::mgOptChangedType 00094 mgOptKeyBindingsPanel::CommitChanges( wxConfig* config ) 00095 { 00096 mgLogDebug( wxT("mgOptKeyBindingsPanel::CommitChanges()\n") ); 00097 m_pKeyConfig->ApplyChanges(); 00098 return mgOptDlg::OptChanged_None; 00099 } 00100 00101 bool mgOptKeyBindingsPanel::Show(bool show) 00102 { 00103 #ifdef __WXGTK__ 00104 // on GTK 00105 00106 #endif 00107 00108 return wxPanel::Show(show); 00109 } 00110 00111 00112 00113
[ Top ] |