home *** CD-ROM | disk | FTP | other *** search
/ Borland Programmer's Resource / Borland_Programmers_Resource_CD_1995.iso / code / wxwin140 / include / wx_frame.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-19  |  3.3 KB  |  133 lines

  1. /*
  2.  * File:     wx_frame.h
  3.  * Purpose:  wxFrame declaration
  4.  *
  5.  *                       wxWindows 1.40
  6.  * Copyright (c) 1993 Artificial Intelligence Applications Institute,
  7.  *                   The University of Edinburgh
  8.  *
  9.  *                     Author: Julian Smart
  10.  *                       Date: 18-4-93
  11.  *
  12.  * Permission to use, copy, modify, and distribute this software and its
  13.  * documentation for any purpose is hereby granted without fee, provided
  14.  * that the above copyright notice, author statement and this permission
  15.  * notice appear in all copies of this software and related documentation.
  16.  *
  17.  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, EXPRESS,
  18.  * IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
  19.  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  20.  *
  21.  * IN NO EVENT SHALL THE ARTIFICIAL INTELLIGENCE APPLICATIONS INSTITUTE OR THE
  22.  * UNIVERSITY OF EDINBURGH BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR
  23.  * CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER RESULTING FROM
  24.  * LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF THE POSSIBILITY OF
  25.  * DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH
  26.  * THE USE OR PERFORMANCE OF THIS SOFTWARE.
  27.  */
  28.  
  29. #ifndef wx_frameh
  30. #define wx_frameh
  31.  
  32. #include "common.h"
  33.  
  34. #ifdef wx_xview
  35. #include <xview/frame.h>
  36. #endif
  37.  
  38. #ifdef wx_motif
  39. #include <Xm/Xm.h>
  40. #endif
  41.  
  42. #include "wx_win.h"
  43.  
  44. class wxPanel;
  45. class wxMenuBar;
  46.  
  47. #define wxSDI        1
  48. #define wxMDI_PARENT 2
  49. #define wxMDI_CHILD  3
  50.  
  51. class wxStatusWnd;
  52. class wxFrame: public wxWindow
  53. {
  54.  public:
  55.   Bool modal_showing;
  56.   wxMenuBar *wx_menu_bar;
  57.   wxIcon *icon;
  58.   Bool status_line_exists;
  59.   int frame_type;  // SDI, MDI parent/child
  60. #ifdef wx_motif
  61.   Widget frameShell;
  62.   Widget frameWidget;
  63.   Widget workArea;
  64.   Widget menuBarWidget;
  65.   Widget statusLineWidget;
  66.   Widget statusTextWidget;
  67.   Widget GetMenuBarWidget(void);
  68.   void PreResize(void);
  69. #endif
  70. #ifdef wx_xview
  71.   wxPanel *menu_bar_panel;
  72.   int y_offset;
  73. #endif
  74. #ifdef wx_msw
  75.   wxStatusWnd *status_window;
  76.   Bool wx_iconized;
  77. #endif
  78.  
  79.   wxFrame(wxFrame *parent, char *title,
  80.           int x=-1, int y=-1, int width=-1, int height=-1,
  81.           int type = wxSDI);
  82.  
  83.   ~wxFrame(void);
  84.  
  85.   // Override, e.g. to resize subwindows
  86.   void OnSize(int x, int y);
  87.   // The default thing is to set the focus for the first child window.
  88.   // Override for your own behaviour.
  89.   void OnActivate(Bool flag);
  90.  
  91.   void SetClientSize(int width, int height);
  92.   void GetClientSize(int *width, int *height);
  93.  
  94.   void GetSize(int *width, int *height);
  95.   void GetPosition(int *x, int *y);
  96.   void SetSize(int x, int y, int width, int height);
  97.   void Show(Bool show);
  98.  
  99.   // Set menu bar
  100.   void SetMenuBar(wxMenuBar *menu_bar);
  101.   wxMenuBar *GetMenuBar(void);
  102.  
  103.   // Set title
  104.   void SetTitle(char *title);
  105.  
  106.   // Set icon
  107.   void SetIcon(wxIcon *icon);
  108.  
  109.   // Create status line
  110.   void CreateStatusLine(void);
  111.  
  112.   // Set status line text
  113.   void SetStatusText(char *text);
  114.   Bool StatusLineExists(void);
  115.  
  116.   // Fit frame around subwindows
  117.   void Fit(void);
  118.  
  119.   // Centre window on screen (you can also use Center)
  120.   void Centre(int direction = wxBOTH);
  121.  
  122.   // Iconize
  123.   virtual void Iconize(Bool iconize);
  124.   virtual Bool Iconized(void);
  125.  
  126. #ifdef wx_msw
  127.   void PositionStatusWindow(void);
  128.   HMENU GetWinMenu(void);
  129. #endif
  130.   virtual void LoadAccelerators(char *table);
  131. };
  132. #endif // wx_frameh
  133.