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 // // 00031 00032 00033 00034 // optimization for GCC compiler 00035 #if defined(__GNUG__) && !defined(__APPLE__) 00036 #pragma implementation "OptTreeCtrl.h" 00037 #endif 00038 00039 // includes 00040 #include "mg/mgprec.h" 00041 00042 #ifndef mgPRECOMP 00043 #include <mg/OptTreeCtrl.h> 00044 #include <mg/OptDlg.h> 00045 #endif 00046 00047 00048 00049 00050 00051 // -------------------------------------------- 00052 // mcOPTTREECTRLITEMDATA 00053 // -------------------------------------------- 00054 00055 mgOptTreeCtrlItemData::mgOptTreeCtrlItemData( IdOptionsPanel id, 00056 const wxString *className ) 00057 : wxTreeItemData() 00058 { 00059 m_panel = 0; 00060 // m_className = ""; // the member is already initialized to the empty string 00061 m_classID = id; 00062 } 00063 00064 mgOptTreeCtrlItemData::~mgOptTreeCtrlItemData() 00065 { 00066 } 00067 00068 00069 00070 00071 // -------------------------------------------- 00072 // mcOPTIONSTREECTRL 00073 // -------------------------------------------- 00074 00075 IMPLEMENT_CLASS(mgOptionsTreeCtrl, wxTreeCtrl ) 00076 BEGIN_EVENT_TABLE( mgOptionsTreeCtrl, wxTreeCtrl ) 00077 END_EVENT_TABLE() 00078 00079 mgOptionsTreeCtrl::mgOptionsTreeCtrl( wxWindow* parent ) 00080 : wxTreeCtrl( parent, OPTIONSDLG_TREELIST, 00081 wxDefaultPosition, wxDefaultSize, 00082 wxTR_HAS_BUTTONS | wxTR_HIDE_ROOT ) 00083 { 00084 // appends items in the tree list control 00085 // to append an item use the AppendItem() function with this parameters: 00086 // 00087 // 1. the itemID of the parent node (use idRoot) for top-level nodes 00088 // 2. the label of the item 00089 // 3. and 4. use -1 00090 // 5. a new'ed mgOptTreeCtrlItemData object construct with the enum as 00091 // parameter. The enum is a constant which identifies the specialized 00092 // mgOptBasePanel-derived class for the option's panel to be 00093 // displayed 00094 00095 wxTreeItemId idRoot = AddRoot( wxT("Options") ); // the root node will be invisible 00096 00097 wxTreeItemId id; 00098 id = AppendItem( idRoot, wxT("General"), -1, -1, 00099 new mgOptTreeCtrlItemData( Id_mgOptGeneralPanel ) ); 00100 00101 id = AppendItem( idRoot, wxT("Key bindings"), -1, -1, 00102 new mgOptTreeCtrlItemData( Id_mgOptKeyBindingsPanel ) ); 00103 00104 id = AppendItem( idRoot, wxT("Fonts"), -1, -1, 00105 new mgOptTreeCtrlItemData( Id_mgOptFontSettingsPanel ) ); 00106 00107 /*id = AppendItem( idRoot, wxT("Colours"), -1, -1, 00108 new mgOptTreeCtrlItemData( Id_mgOptBasePanel ) );*/ 00109 } 00110 00111 mgOptionsTreeCtrl::~mgOptionsTreeCtrl() 00112 { 00113 } 00114
[ Top ] |