core/vgui/impl/mfc/vgui_mfc_window.h
Go to the documentation of this file.
00001 // This is core/vgui/impl/mfc/vgui_mfc_window.h
00002 #ifndef vgui_mfc_window_h_
00003 #define vgui_mfc_window_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007 //:
00008 // \file
00009 // \brief   The mfc implementation of vgui_window
00010 // \author  Marko Bacic, Oxford RRG
00011 // \date    24-JUL-2000
00012 //
00013 //  Contains class vgui_mfc_window
00014 //
00015 // \verbatim
00016 //  Modifications
00017 //   24-JUL-2000  Marko Bacic, Oxford RRG - Initial version.
00018 //   17-AUG-2000  Marko Bacic, Oxford RRG - Now windows can have specified size
00019 //   23-AUG-2000  Marko Bacic, Oxford RRG - Added support for scrollbars
00020 //   20-JUL-2001  K.Y.McGaul  Added init_window function carry out common
00021 //                            functionality from all constructors.
00022 //   23-DEC-2002  J.L. Mundy added scrollbar positioning methods
00023 // \endverbatim
00024 
00025 class vgui_mfc_adaptor;
00026 class vgui_mfc_statusbar;
00027 
00028 #include <vgui/vgui_menu.h>
00029 #include <vgui/vgui_window.h>
00030 #include <afxwin.h>
00031 
00032 //: The MFC implementation of vgui_window.
00033 //  Based on vgui_glut_win.
00034 class vgui_mfc_window : public vgui_window
00035 {
00036  public:
00037   //: Initialise window - common functionality called by all constructors.
00038   void init_window(char const *title, vgui_menu const &menubar,
00039                    bool has_menu, unsigned width, unsigned height, int posx, int posy);
00040 
00041   //: Constructor for window without menubar.
00042   vgui_mfc_window(char const *title, unsigned w, unsigned h,
00043                   int posx =-1, int posy=-1);
00044 
00045   //: Constructor for window with menubar.
00046   vgui_mfc_window(unsigned w,unsigned h,vgui_menu const &menubar,
00047                   char const *title);
00048 
00049   //: Destructor - delete this vgui_mfc_window.
00050   ~vgui_mfc_window();
00051 
00052   void set_menubar(vgui_menu const &m);
00053 
00054   //: Return the vgui_mfc_adaptor associated with this window.
00055   vgui_adaptor *get_adaptor();
00056 
00057   //: Return the vgui_mfc_adaptor associated with this window.
00058   vgui_statusbar *get_statusbar();
00059 
00060   //
00061   void show();
00062   void hide();
00063   void iconify();
00064   //: Enable horizontal scrollbar on window.
00065   void enable_hscrollbar(bool);
00066   //: Enable vertical scrollbar on window.
00067   void enable_vscrollbar(bool);
00068   void reshape(unsigned, unsigned);
00069   void reposition(int,int);
00070   void set_title(vcl_string const &);
00071 
00072   //: Set the position of the horizontal scrollbar, returns old position
00073   virtual int set_hscrollbar(int pos);
00074 
00075   //: Set the position of the vertical scrollbar, returns old position
00076   virtual int set_vscrollbar(int pos);
00077 
00078   POSITION pos1, pos2, pos3;
00079 
00080  private:
00081   vgui_menu          menubar;
00082 
00083   vgui_mfc_adaptor   *mfcwin;
00084   vgui_mfc_statusbar *statusbar;
00085 };
00086 
00087 #endif // vgui_mfc_window_h_