Back to index

plt-scheme  4.2.1
RadioBox.h
Go to the documentation of this file.
00001 /*                                                      -*- C++ -*-
00002  *
00003  * Purpose: radio box panel item
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 RadioBox_h
00028 #define RadioBox_h
00029 
00030 #ifdef __GNUG__
00031 #pragma interface
00032 #endif
00033 
00034 class wxBitmap;
00035 class wxPanel;
00036 
00037 class wxRadioBox : public wxItem {
00038 public:
00039     wxRadioBox(wxPanel *panel, wxFunction func, char *label,
00040               int x = -1, int y = -1, int width = -1, int height = -1,
00041               int n = 0, char **choices = NULL,
00042               int num_rows=0, long style = 0, 
00043               wxFont *_font = NULL, char *name = "radioBox");
00044     wxRadioBox(wxPanel *panel, wxFunction func, char *label,
00045               int x = -1, int y = -1, int width = -1, int height = -1,
00046               int n = 0, wxBitmap **choices = NULL,
00047               int num_rows=0, long style = 0, 
00048               wxFont *_font = NULL, char *name = "radioBox");
00049     ~wxRadioBox(void);
00050 
00051     Bool Create(wxPanel *panel, wxFunction func, char *label,
00052               int x = -1, int y = -1, int width = -1, int height = -1,
00053               int n = 0, char **choices = NULL,
00054               int num_rows=0, long style = 0, char *name = "radioBox");
00055     Bool Create(wxPanel *panel, wxFunction func, char *label,
00056               int x = -1, int y = -1, int width = -1, int height = -1,
00057               int n = 0, wxBitmap **choices = NULL,
00058               int nom_rows=0, long style = 0, char *name = "radioBox");
00059 
00060     void  Enable(int item, Bool enable);
00061     void  ChangeToGray(Bool enable);
00062 
00063     int   FindString(char *s);
00064     char  *GetLabel(int item);
00065     int   GetSelection(void);
00066     char  *GetStringSelection(void);
00067     int   Number()                        { return num_toggles; }
00068     void  SetLabel(int item, char *label);
00069     void  SetLabel(int item, wxBitmap *bitmap);
00070     void  SetSelection(int n);
00071     void  SetStringSelection(char *s);
00072     Bool  Show(int item, Bool show);
00073     char  *GetString(int which);
00074     // root methods to parent class
00075     virtual void  Enable(Bool enable)     { wxItem::Enable(enable); }
00076     virtual char  *GetLabel(void)  { return wxItem::GetLabel(); }
00077     virtual void  SetLabel(char *label)   { wxItem::SetLabel(label); }
00078     virtual Bool  Show(Bool show)  { return wxItem::Show(show); }
00079     void Command(wxCommandEvent *event);
00080     void SetSelectedButtonFocus();
00081 
00082     int ButtonFocus(int which);
00083 
00084 private:
00085 #   ifdef Have_Xt_Types
00086     static void EventCallback(Widget w, XtPointer clientData, XtPointer ptr);
00087 #   endif
00088 
00089     void* toggles; // of type Widget*
00090     Bool* enabled;
00091     wxBitmap **bm_labels, **bm_label_masks;
00092     int   num_toggles;
00093 };
00094 
00095 #endif // RadioBox_h