Back to index

plt-scheme  4.2.1
MenuBar.h
Go to the documentation of this file.
00001 /*                                                      -*- C++ -*-
00002  *
00003  * Purpose: menu bar class
00004  *
00005  * Authors: Markus Holzem and Julian Smart
00006  *
00007  * Copyright: (C) 2004-2009 PLT Scheme Inc.
00008  * Copyright: (C) 1995, AIAI, University of Edinburgh (Julian)
00009  * Copyright: (C) 1995, GNU (Markus)
00010  *
00011  * This program is free software; you can redistribute it and/or modify
00012  * it under the terms of the GNU General Public License as published by
00013  * the Free Software Foundation; either version 2 of the License, or
00014  * (at your option) any later version.
00015  *
00016  * This program is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  * GNU General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU General Public License
00022  * along with this program; if not, write to the Free Software
00023  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00024  * 02110-1301 USA.
00025  */
00026 
00027 #ifndef MenuBar_h
00028 #define MenuBar_h
00029 
00030 #ifdef __GNUG__
00031 #pragma interface
00032 #endif
00033 
00034 typedef void *wxMenuItem;
00035 
00036 class wxPanel;
00037 class wxMenu;
00038 
00039 class wxMenuBar : public wxItem {
00040 public:
00041     wxMenuBar(void);
00042     ~wxMenuBar(void);
00043 
00044     Bool Create(wxPanel *panel);
00045     void Destroy(void);
00046 
00047     int Number(void);
00048 
00049     // add menu to menubar
00050     void  Append(wxMenu *menu, char *title);
00051     Bool  Delete(wxMenu *menu, int pos = 0);
00052     // modify items
00053     void  Check(long id, Bool flag);
00054     Bool  Checked(long id);
00055     void  Enable(long id, Bool flag);
00056     void  EnableTop(int pos, Bool flag);
00057     char  *GetHelpString(long id);
00058     char  *GetLabel(long id);
00059     char  *GetLabelTop(int pos);
00060     void  SetHelpString(long id, char *help);
00061     void  SetLabel(long id, char *label);
00062     void  SetLabelTop(int pos, char *label);
00063     // search for item by label
00064     int   FindMenuItem(char *menu, char *label);
00065     void Stop();
00066     int InProgress();
00067     void SelectAMenu(wxMenu *m = NULL);
00068 private:
00069     // search for internal data by id
00070     wxMenuItem  *FindItemForId(long id, wxMenu **menu=NULL);
00071     // callback functions
00072 #   ifdef Have_Xt_Types
00073     static void SelectEventCallback(Widget, XtPointer, XtPointer);
00074     static void CommandEventCallback(Widget, XtPointer, XtPointer);
00075 #   endif
00076     // internal representation
00077     wxMenuItem       *top;         // first menu item
00078     wxMenuItem       *last;        // last menu item for wxMenu::Append
00079     wxMenuItem  *help;             // help menu pushed right
00080     wxMenuItem  *topdummy;
00081 };
00082 
00083 #endif // MenuBar_h