Back to index

plt-scheme  4.2.1
Frame.h
Go to the documentation of this file.
00001 /*                                                      -*- C++ -*-
00002  *
00003  * Purpose: base class for all frames
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 Frame_h
00028 #define Frame_h
00029 
00030 #ifdef __GNUG__
00031 #pragma interface
00032 #endif
00033 
00034 class wxBitmap;
00035 class wxMenuBar;
00036 class wxMessage;
00037 class wxToolBar;
00038 
00039 class wxFrame : public wxPanel {
00040 public:
00041     wxFrame(void);
00042     wxFrame(wxFrame *parent, char *title, int x=-1, int y=-1,
00043            int width=-1, int height=-1, int style=wxDEFAULT_FRAME,
00044            char *name="frame");
00045     ~wxFrame(void);
00046     // frame creation
00047     Bool  Create(wxFrame *parent, char *title, int x=-1, int y=-1,
00048                int width=-1, int height=-1, int style=wxDEFAULT_FRAME,
00049                char *name="frame");
00050     // leave place for menubar and statusline
00051     virtual void  Fit(void);
00052     virtual void  Layout(void);
00053     virtual void  GetClientSize(int *width, int *height);
00054     virtual void  SetClientSize(int width, int height);
00055     virtual void  SetSize(int width, int height)
00056               { Configure(-1, -1, width, height, 0); }
00057     virtual void  SetSize(int x, int y, int width, int height,
00058                        int flags=wxSIZE_AUTO)
00059               { Configure(x, y, width, height, flags); }
00060     // status line
00061     void  CreateStatusLine(int number=1, char *name = "status_line");
00062     void  SetStatusText(char *text, int number=0);
00063     Bool  StatusLineExists(void);
00064     // change and query state of frame
00065     void  Iconize(Bool iconize);
00066     Bool  Iconized(void);
00067     void  Maximize(Bool maximize);
00068     Bool  IsMaximized();
00069     // associated GDI objects
00070     wxMenuBar *GetMenuBar(void);
00071     void      SetIcon(wxBitmap *icon, wxBitmap *bg = NULL, int kind = 0);
00072     void      SetMenuBar(wxMenuBar *menubar);
00073     // miscellaneous
00074     void  Command(int id);
00075     void  LoadAccelerators(char *WXUNUSED(resource)) {}
00076     Bool  Show(Bool show);
00077     // virtual event functions
00078     virtual void  OnMenuSelect(long id);
00079     virtual void  OnMenuClick();
00080 
00081     virtual void OnMDIActivate(Bool flag);
00082     virtual void OnToolbarButton();
00083     void SetFrameModified(Bool mod);
00084 
00085     virtual char  *GetTitle(void);
00086     virtual void  SetTitle(char *title);
00087 
00088     virtual void  GetPosition(int *x, int *y);
00089     virtual void  GetSize(int *width, int *height);
00090 
00091     void EnforceSize(int minw, int minh, int maxw, int maxh, int incw=1, int inch=1);
00092 
00093     void *context;
00094 
00095 protected:
00096     wxMenuBar  *menubar;
00097     wxMessage  **status;
00098     int        num_status;
00099     wxBitmap   *frame_icon;
00100     wxBitmap   *frame_mask;
00101     Bool       show_as_mod;
00102     long       last_shown_time;
00103 };
00104 
00105 #endif // Frame_h