Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FXMessageBox.h
1 /********************************************************************************
2 * *
3 * M e s s a g e B o x e s *
4 * *
5 *********************************************************************************
6 * Copyright (C) 1997,2024 by Jeroen van der Zijp. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU Lesser General Public License as published by *
10 * the Free Software Foundation; either version 3 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * This library is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public License *
19 * along with this program. If not, see <http://www.gnu.org/licenses/> *
20 ********************************************************************************/
21 #ifndef FXMESSAGEBOX_H
22 #define FXMESSAGEBOX_H
23 
24 #ifndef FXDIALOGBOX_H
25 #include "FXDialogBox.h"
26 #endif
27 
28 namespace FX {
29 
30 
31 // Message box buttons
32 enum {
33  MBOX_OK = 0x10000000,
34  MBOX_OK_CANCEL = 0x20000000,
35  MBOX_YES_NO = 0x30000000,
36  MBOX_YES_NO_CANCEL = 0x40000000,
37  MBOX_QUIT_CANCEL = 0x50000000,
38  MBOX_QUIT_SAVE_CANCEL = 0x60000000,
39  MBOX_SKIP_SKIPALL_CANCEL = 0x70000000,
40  MBOX_SAVE_CANCEL_DONTSAVE = 0x80000000,
41  MBOX_YES_YESALL_NO_NOALL_CANCEL = 0xA0000000
42  };
43 
44 
45 // Return values
46 enum {
47  MBOX_CLICKED_YES = 1,
48  MBOX_CLICKED_NO = 2,
49  MBOX_CLICKED_OK = 3,
50  MBOX_CLICKED_CANCEL = 4,
51  MBOX_CLICKED_QUIT = 5,
52  MBOX_CLICKED_SAVE = 6,
53  MBOX_CLICKED_SKIP = 7,
54  MBOX_CLICKED_SKIPALL = 8,
55  MBOX_CLICKED_YESALL = 9,
56  MBOX_CLICKED_NOALL = 10
57  };
58 
59 
69 class FXAPI FXMessageBox : public FXDialogBox {
70  FXDECLARE(FXMessageBox)
71 protected:
72  FXMessageBox(){}
73 private:
74  FXMessageBox(const FXMessageBox&);
75  FXMessageBox &operator=(const FXMessageBox&);
76  void initialize(const FXString& text,FXIcon* ic,FXuint whichbuttons);
77 public:
78  long onCmdClicked(FXObject*,FXSelector,void*);
79  long onCmdCancel(FXObject*,FXSelector,void*);
80 public:
81  enum{
82  ID_CLICKED_YES=FXDialogBox::ID_LAST,
83  ID_CLICKED_NO,
84  ID_CLICKED_OK,
85  ID_CLICKED_CANCEL,
86  ID_CLICKED_QUIT,
87  ID_CLICKED_SAVE,
88  ID_CLICKED_SKIP,
89  ID_CLICKED_SKIPALL,
90  ID_CLICKED_YESALL,
91  ID_CLICKED_NOALL,
92  ID_LAST
93  };
94 public:
95 
97  FXMessageBox(FXWindow* owner,const FXString& caption,const FXString& text,FXIcon* ic=nullptr,FXuint opts=0,FXint x=0,FXint y=0);
98 
100  FXMessageBox(FXApp* app,const FXString& caption,const FXString& text,FXIcon* ic=nullptr,FXuint opts=0,FXint x=0,FXint y=0);
101 
106  static FXuint error(FXWindow* owner,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5) ;
107 
111  static FXuint error(FXApp* app,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5) ;
112 
117  static FXuint warning(FXWindow* owner,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5) ;
118 
122  static FXuint warning(FXApp* app,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5) ;
123 
128  static FXuint question(FXWindow* owner,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5) ;
129 
133  static FXuint question(FXApp* app,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5) ;
134 
139  static FXuint information(FXWindow* owner,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5) ;
140 
144  static FXuint information(FXApp* app,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5) ;
145 
146  };
147 
148 }
149 
150 #endif
DialogBox window.
Definition: FXDialogBox.h:37
Window is the base class for all widgets in FOX.
Definition: FXWindow.h:130
The Application object is the central point of a FOX user-interface.
Definition: FXApp.h:134
Definition: FX4Splitter.h:28
An Icon is an image with two additional server-side resources: a shape bitmap, which is used to mask ...
Definition: FXIcon.h:42
Object is the base class for all objects in FOX; in order to receive messages from the user interface...
Definition: FXObject.h:138
A Message Box is a convenience class which provides a dialog for very simple common yes/no type inter...
Definition: FXMessageBox.h:69
Closes the dialog, accept the entry.
Definition: FXDialogBox.h:51
FXString provides essential string manipulation capabilities in FOX.
Definition: FXString.h:42

Copyright © 1997-2022 Jeroen van der Zijp