Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 129 lines (109 sloc) 5.518 kb
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
1 /***********************************************************************
2 * FXRuby -- the Ruby language bindings for the FOX GUI toolkit.
b8219ec @lylejohnson Updated copyright notice for all SWIG interface files
lylejohnson authored
3 * Copyright (c) 2001-2009 by Lyle Johnson. All Rights Reserved.
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * For further information please contact the author by e-mail
a934547 @lylejohnson Replaced e-mail address "lyle@users.sourceforge.net" with
lylejohnson authored
20 * at "lyle@lylejohnson.name".
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
21 ***********************************************************************/
22
23 // Message box buttons
24 enum {
25 MBOX_OK = 0x10000000, /// Message box has a only an OK button
26 MBOX_OK_CANCEL = 0x20000000, /// Message box has OK and CANCEL buttons
27 MBOX_YES_NO = 0x30000000, /// Message box has YES and NO buttons
28 MBOX_YES_NO_CANCEL = 0x40000000, /// Message box has YES, NO, and CANCEL buttons
29 MBOX_QUIT_CANCEL = 0x50000000, /// Message box has QUIT and CANCEL buttons
30 MBOX_QUIT_SAVE_CANCEL = 0x60000000, /// Message box has QUIT, SAVE, and CANCEL buttons
b6b1acb @lylejohnson checked in changes from the RB-1.6 branch (through r2945)
lylejohnson authored
31 MBOX_SKIP_SKIPALL_CANCEL = 0x70000000 /// Message box has SKIP, SKIP ALL, and CANCEL buttons
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
32 };
33
b6b1acb @lylejohnson checked in changes from the RB-1.6 branch (through r2945)
lylejohnson authored
34 /* SWIG doesn't wrap this value correctly without a hint */
35 %constant FXuint MBOX_SAVE_CANCEL_DONTSAVE = 0x80000000; // Message box has DON'T SAVE,CANCEL and SAVE buttons
36
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
37
38 // Return values
39 enum {
40 MBOX_CLICKED_YES = 1, /// The YES button was clicked
41 MBOX_CLICKED_NO = 2, /// The NO button was clicked
42 MBOX_CLICKED_OK = 3, /// The OK button was clicked
43 MBOX_CLICKED_CANCEL = 4, /// The CANCEL button was clicked
44 MBOX_CLICKED_QUIT = 5, /// The QUIT button was clicked
45 MBOX_CLICKED_SAVE = 6, /// The SAVE button was clicked
46 MBOX_CLICKED_SKIP = 7, /// The SKIP button was clicked
47 MBOX_CLICKED_SKIPALL = 8 /// The SKIP ALL button was clicked
48 };
49
b6b1acb @lylejohnson checked in changes from the RB-1.6 branch (through r2945)
lylejohnson authored
50 /* FOX doesn't define this constant, but we do for consistency */
51 %constant MBOX_CLICKED_DONTSAVE = MBOX_CLICKED_NO;
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
52
53 /**
54 * A Message Box is a convenience class which provides a dialog for
55 * very simple common yes/no type interactions with the user.
56 * The message box has an optional icon, a title string, and the question
57 * which is presented to the user. It also has up to three buttons which
58 * furnish standard responses to the question.
59 * Message boxes are usually ran modally: the question must be answered
60 * before the program may continue.
61 */
62 class FXMessageBox : public FXDialogBox {
63 protected:
64 FXMessageBox(){}
65 public:
66 long onCmdClicked(FXObject*,FXSelector,void* PTR_IGNORE);
67 long onCmdCancel(FXObject*,FXSelector,void* PTR_IGNORE);
68 public:
69 enum{
70 ID_CLICKED_YES=FXDialogBox::ID_LAST,
71 ID_CLICKED_NO,
72 ID_CLICKED_OK,
73 ID_CLICKED_CANCEL,
74 ID_CLICKED_QUIT,
75 ID_CLICKED_SAVE,
76 ID_CLICKED_SKIP,
77 ID_CLICKED_SKIPALL,
78 ID_LAST
79 };
80 public:
81 %extend {
82 /// Construct message box with given caption, icon, and message text
83 FXMessageBox(FXWindow* owner,const FXString& caption,const FXString& text,FXIcon* ic=NULL,FXuint opts=0,FXint x=0,FXint y=0){
84 return new FXRbMessageBox(owner,caption,text,ic,opts,x,y);
85 }
bea4cad @larskanis Strip all whitespaces on line endings
authored
86
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
87 /// Construct free floating message box with given caption, icon, and message text
88 FXMessageBox(FXApp* app,const FXString& caption,const FXString& text,FXIcon* ic=NULL,FXuint opts=0,FXint x=0,FXint y=0){
89 return new FXRbMessageBox(app,caption,text,ic,opts,x,y);
90 }
91 }
92
93 /// Show a modal error message
94 static FXuint error(FXWindow* owner,FXuint opts,const char* caption,const char* message);
95
96 // Show modal error message, in free floating window.
97 static FXuint error(FXApp* app,FXuint opts,const char* caption,const char* message);
98
99 /// Show a modal warning message
100 static FXuint warning(FXWindow* owner,FXuint opts,const char* caption,const char* message);
101
102 /// Show a modal warning message, in a free-floating window
103 static FXuint warning(FXApp* app,FXuint opts,const char* caption,const char* message);
104
105 /// Show a modal question dialog
106 static FXuint question(FXWindow* owner,FXuint opts,const char* caption,const char* message);
107
108 /// Show a modal question dialog, in a free-floating window
109 static FXuint question(FXApp* app,FXuint opts,const char* caption,const char* message);
110
111 /// Show a modal information dialog
112 static FXuint information(FXWindow* owner,FXuint opts,const char* caption,const char* message);
113
114 /// Show a modal information dialog, in a free-floating window
115 static FXuint information(FXApp* app,FXuint opts,const char* caption,const char* message);
116
117 // Destructor
118 virtual ~FXMessageBox();
119 };
120
121
122 DECLARE_FXOBJECT_VIRTUALS(FXMessageBox)
123 DECLARE_FXID_VIRTUALS(FXMessageBox)
124 DECLARE_FXDRAWABLE_VIRTUALS(FXMessageBox)
125 DECLARE_FXWINDOW_VIRTUALS(FXMessageBox)
126 DECLARE_FXTOPWINDOW_VIRTUALS(FXMessageBox)
127 DECLARE_FXDIALOGBOX_VIRTUALS(FXMessageBox)
128
Something went wrong with that request. Please try again.