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

SymbolDlg.h

Go to the documentation of this file.
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 #ifndef SYMBOLDLG_H
00034 #define SYMBOLDLG_H
00035 
00036 // this dialog uses wxListCtrls & mcSymbolArrays
00037 #include <wx/notebook.h>
00038 #include <wx/listctrl.h>
00039 #include "mc/Symbol.h"
00040 #include "mg/PaletteDlg.h"
00041 #ifdef mgUSE_PALETTEFRM
00042    #include <wx/palettefrm.h>    // wxWidgets' extension
00043 #endif
00044 
00045 
00046 // optimization for GCC compiler
00047 #ifdef __GNUG__
00048 #pragma interface "SymbolDlg.h"
00049 #endif
00050 
00051 
00052 // IDs used in this dialog
00053 #define IDC_SYMBOLDLG_LIST             mgSYMBOLDLG_BASEID+1
00054 #define IDC_SYMBOLDLG_DELETE           mgSYMBOLDLG_BASEID+3
00055 
00056 #define IDC_SYMLISTPAGE_LISTCTRL       mgSYMBOLDLG_BASEID+4
00057 
00058 #define SYMPROP_BASEID                 mgSYMBOLDLG_BASEID+5
00059 
00060 // forward declarations
00061 class mgSymPropPanel;
00062 
00063 
00070 class mgSymListPage : public wxPanel
00071 {
00072 protected:     // member variables
00073 
00074    mgSymPropPanel *m_pPropPanel;
00075    mcSymbolArray *m_pArray;
00076 
00077    wxListCtrl *m_pList;
00078    //wxWindow *m_pList;
00079 
00080 
00081 protected:     // functions
00082 
00083    virtual void BuildCtrls();
00084    virtual void BuildAll();
00085 
00086 
00087    // event handlers
00088    void OnSelectionChanged(wxListEvent &);
00089 
00090 public:
00091 
00092    mgSymListPage(wxWindow *parent,
00093       mgSymPropPanel *prop,
00094       mcSymbolArray *arr,
00095       wxWindowID id = -1, 
00096       const wxString &title = wxT("Symbols"),
00097       const wxPoint& pos = wxDefaultPosition,
00098       const wxSize& size = wxDefaultSize,
00099       long style = 0);
00100 
00101    virtual ~mgSymListPage() {}
00102 
00103    mgSymPropPanel *GetLinkedPropPanel() {
00104       return m_pPropPanel;
00105    }
00106 
00107 private:
00108    DECLARE_CLASS(mgSymListPage)
00109    DECLARE_EVENT_TABLE()
00110 };
00111 
00112 
00113 
00114 
00117 class mgSymbolPanel : public wxPanel, public mgMathBoxWndUser
00118 {
00119 protected:     // member variables
00120 
00123    wxNotebook *m_pList;
00124 
00126    //wxListCtrl *m_pList;
00127    wxStaticBoxSizer *m_pPropertySizer;
00128 
00130    wxTextCtrl *m_pText;
00131 
00133    mcSymbolArray *m_pArray;
00134 
00135 
00136 protected:     // functions
00137 
00138    void BuildAll();
00139    void BuildCtrls();
00140 
00141    int GetBaseID() const      { return mgSYMBOLDLG_BASEID; }
00142 
00143    // event handlers
00144    void OnDeleteSymbol( wxCommandEvent &event );
00145    void OnPageChanged(wxNotebookEvent &ev);
00146 
00147 
00148    int GetDefaultWidth() { return 100; }
00149    int GetDefaultHeight() { return 100;}
00150 
00151    wxString GetButtonLabel(int n) { return wxT(""); }
00152    wxString GetButtonTooltip(int n) { return wxT(""); }
00153 
00154 
00155    int GetColCount() const     { return 1; }
00156    int GetRowCount() const     { return 1; }
00157 
00158 
00159 public:
00160    // constructors and destructors
00161    mgSymbolPanel(
00162       wxWindow *parent,
00163       mgMathWnd *mathwnd,
00164       mgMathBox *mathbox,
00165       mcSymbolArray *,
00166       wxWindowID id = -1, 
00167       const wxString &title = wxT("Symbols"),
00168       const wxPoint& pos = wxDefaultPosition,
00169       const wxSize& size = wxDefaultSize,
00170       long style = wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER);
00171    virtual ~mgSymbolPanel();
00172    
00173 
00174 
00175    void Sync();
00176    void AddDefaultLists();
00177 
00178 
00179 private:
00180    // used by wxWindow framework
00181    DECLARE_CLASS(mgSymbolPanel)
00182    DECLARE_EVENT_TABLE()
00183 };
00184 
00185 
00187 class mgSymbolPalette : public wxPaletteFrame
00188 {
00189 public:
00190 
00191 #ifndef mgUSE_PALETTEFRM
00192    wxPanel *m_pPanel;
00193 
00194    // a fake function
00195    void SetSizeHintsUsingClientHints() {}
00196 #endif
00197 
00198 public:
00199 
00200    mgSymbolPalette(
00201       wxMainFrame *parent,
00202       wxWindow *client,
00203       mgMathWnd *mathwnd,
00204       mgMathBox *mathbox,
00205       mcSymbolArray *arr,
00206       wxWindowID id = -1,
00207       const wxString &title = wxT("Symbols"),
00208       const wxPoint &pos = wxDefaultPosition,
00209       const wxSize &size = wxDefaultSize,
00210       long style = wxPALETTEFRM_DEFAULT_STYLE,
00211       const wxString &name = wxT("mgSymbolPalette"));
00212 
00213    virtual ~mgSymbolPalette() {}
00214 
00215 
00217    mgSymbolPanel *GetPanel();
00218 
00219 };
00220 
00221 
00222 #endif      // SYMBOLDLG_H
00223 


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

[ Top ]