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

  1. /*
  2.  * File:     wx_panel.h
  3.  * Purpose:  wxPanel subwindow, for panel items (widgets/controls)
  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_panelh
  30. #define wx_panelh
  31.  
  32. #include "common.h"
  33. #include "wx_win.h"
  34.  
  35. #ifdef wx_motif
  36. #include <Xm/Xm.h>
  37. #endif
  38.  
  39. #ifdef wx_motif
  40. #define PANEL_HSPACING  8
  41. #define PANEL_VSPACING  8
  42. #endif
  43.  
  44. #ifdef wx_msw
  45. #define PANEL_LEFT_MARGIN 4
  46. #define PANEL_TOP_MARGIN  4
  47. #define PANEL_HSPACING  8
  48. #define PANEL_VSPACING  8
  49. #endif
  50.  
  51. class wxItem;
  52. class wxFrame;
  53. class wxPanel: public wxWindow
  54. {
  55.  public:
  56. #ifdef wx_motif
  57.   int hSpacing;
  58.   int vSpacing;
  59.   Widget borderWidget;
  60.   Widget panelWidget;
  61.   Widget lastWidget;
  62.   Widget firstRowWidget;
  63. #endif
  64. #ifdef wx_msw
  65.   int cursor_x;
  66.   int cursor_y;
  67.   int max_width;
  68.   int max_height;
  69.   int max_line_height;
  70.   int hspacing;
  71.   int vspacing;
  72. #endif
  73.  
  74.   Bool new_line;
  75.   int label_position;
  76.  
  77.   wxPanel(wxFrame *frame,
  78.           int x=-1, int y=-1, int width=-1, int height=-1, int style=0);
  79.   ~wxPanel(void);
  80.   void SetSize(int x, int y, int width, int height);
  81.   void SetClientSize(int w, int h);
  82.   void GetPosition(int *x, int *y);
  83.  
  84.   // Set current label position, i.e. will label be on top or to the left
  85.   // Doesn't do anything right now.
  86.   void SetLabelPosition(int pos);  // wxHORIZONTAL or wxVERTICAL
  87.  
  88.   // Start a new line
  89.   void NewLine(void);
  90.   // Tab specified number of pixels
  91.   void Tab(int pixels);
  92.  
  93.   void GetCursor(int *x, int *y);
  94.  
  95.   // Set/get horizontal spacing
  96.   void SetHorizontalSpacing(int sp);
  97.   int GetHorizontalSpacing(void);
  98.  
  99.   // Set/get vertical spacing
  100.   void SetVerticalSpacing(int sp);
  101.   int GetVerticalSpacing(void);
  102.  
  103.   // Fits the panel around the items
  104.   void Fit(void);
  105.  
  106.   // Update next cursor position
  107.   void AdvanceCursor(wxWindow *item);
  108.  
  109.   // If x or y are not specified (i.e. < 0), supply
  110.   // values based on left to right, top to bottom layout.
  111.   // Internal use only.
  112.   void GetValidPosition(int *x, int *y);
  113. };
  114.  
  115. #endif // wx_panelh
  116.