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

  1. /*
  2.  * File:     wx_dialg.h
  3.  * Purpose:  wxDialogBox and common dialog declarations
  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_dialgh
  30. #define wx_dialgh
  31.  
  32. #include "common.h"
  33. #include "wx_item.h"
  34.  
  35. #ifdef wx_xview
  36. #include <xview/frame.h>
  37. #endif
  38.  
  39. // Dialog boxes
  40. class wxDialogBox: public wxPanel
  41. {
  42.  public:
  43. #ifdef wx_motif
  44.   Widget dialogShell;
  45.   Bool modal_showing;
  46.   void PostDestroyChildren(void);
  47. #endif
  48. #ifdef wx_xview
  49.   Frame frame;
  50. #endif
  51. #ifdef wx_msw
  52.   Bool modal_showing;
  53. #endif
  54.   Bool modal;
  55.  
  56.   wxDialogBox(wxFrame *frame, char *title, Bool modal = FALSE,
  57.               int x = -1, int y = -1,
  58.               int width = -1, int height = -1);
  59.   ~wxDialogBox();
  60.  
  61.   void SetSize(int x, int y, int width, int height);
  62.   void SetClientSize(int width, int height);
  63.   void GetPosition(int *x, int *y);
  64.   virtual void Show(Bool show);
  65.   virtual void Iconize(Bool iconize);
  66.   virtual Bool Iconized(void);
  67.   void Fit(void);
  68.   void Centre(int direction = wxBOTH);
  69. };
  70.  
  71. // Handy dialog functions
  72. char *wxGetTextFromUser(char *message, char *caption = "Input text",
  73.                         char *default_value = "", wxFrame *parent = NULL,
  74.                         int x = -1, int y = -1);
  75.  
  76. char *wxGetSingleChoice(char *message, char *caption,
  77.                         int n, char *choices[], wxFrame *parent = NULL,
  78.                         int x = -1, int y = -1);
  79.  
  80. // Same as above but gets position in list of strings, instead of string,
  81. // or -1 if no selection
  82. int wxGetSingleChoiceIndex(char *message, char *caption,
  83.                            int n, char *choices[], wxFrame *parent = NULL,
  84.                            int x = -1, int y = -1);
  85.  
  86. // Return client data instead
  87. char *wxGetSingleChoiceData(char *message, char *caption,
  88.                             int n, char *choices[], char *client_data[],
  89.                             wxFrame *parent = NULL, int x = -1, int y = -1);
  90.  
  91. // type is an 'or' (|) of wxOK, wxCANCEL, wxYES_NO
  92. // Returns wxYES/NO/OK/CANCEL
  93. int wxMessageBox(char *message, char *caption = "Message", int type = wxOK,
  94.   wxFrame *parent = NULL, int x = -1, int y = -1);
  95.  
  96. #define wxOPEN 1
  97. #define wxSAVE 2
  98. #define wxOVERWRITE_PROMPT 4
  99. #define wxHIDE_READONLY 8
  100.  
  101. // File selector
  102. char *wxFileSelector(char *message = "Select a file", char *default_path = NULL,
  103.                      char *default_filename = NULL, char *default_extension = NULL,
  104.                      char *wildcard = "*.*", int flags = 0,
  105.   wxFrame *parent = NULL, int x = -1, int y = -1);
  106.  
  107. #endif // wx_dialgh
  108.