00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef FXMESSAGEBOX_H
00025 #define FXMESSAGEBOX_H
00026
00027 #ifndef FXDIALOGBOX_H
00028 #include "FXDialogBox.h"
00029 #endif
00030
00031 namespace FX {
00032
00033
00034
00035 enum {
00036 MBOX_OK = 0x10000000,
00037 MBOX_OK_CANCEL = 0x20000000,
00038 MBOX_YES_NO = 0x30000000,
00039 MBOX_YES_NO_CANCEL = 0x40000000,
00040 MBOX_QUIT_CANCEL = 0x50000000,
00041 MBOX_QUIT_SAVE_CANCEL = 0x60000000,
00042 MBOX_SKIP_SKIPALL_CANCEL =0x70000000
00043 };
00044
00045
00046
00047 enum {
00048 MBOX_CLICKED_YES = 1,
00049 MBOX_CLICKED_NO = 2,
00050 MBOX_CLICKED_OK = 3,
00051 MBOX_CLICKED_CANCEL = 4,
00052 MBOX_CLICKED_QUIT = 5,
00053 MBOX_CLICKED_SAVE = 6,
00054 MBOX_CLICKED_SKIP = 7,
00055 MBOX_CLICKED_SKIPALL = 8
00056 };
00057
00058
00059
00060 class FXAPI FXMessageBox : public FXDialogBox {
00061 FXDECLARE(FXMessageBox)
00062 protected:
00063 FXMessageBox(){}
00064 private:
00065 FXMessageBox(const FXMessageBox&);
00066 FXMessageBox &operator=(const FXMessageBox&);
00067 void initialize(const FXString& text,FXIcon* ic,FXuint whichbuttons);
00068 public:
00069 long onCmdClicked(FXObject*,FXSelector,void*);
00070 long onCmdCancel(FXObject*,FXSelector,void*);
00071 public:
00072 enum{
00073 ID_CLICKED_YES=FXDialogBox::ID_LAST,
00074 ID_CLICKED_NO,
00075 ID_CLICKED_OK,
00076 ID_CLICKED_CANCEL,
00077 ID_CLICKED_QUIT,
00078 ID_CLICKED_SAVE,
00079 ID_CLICKED_SKIP,
00080 ID_CLICKED_SKIPALL,
00081 ID_LAST
00082 };
00083 public:
00084
00085
00086 FXMessageBox(FXWindow* owner,const FXString& caption,const FXString& text,FXIcon* ic=NULL,FXuint opts=0,FXint x=0,FXint y=0);
00087
00088
00089 FXMessageBox(FXApp* app,const FXString& caption,const FXString& text,FXIcon* ic=NULL,FXuint opts=0,FXint x=0,FXint y=0);
00090
00091
00092
00093
00094
00095 static FXuint error(FXWindow* owner,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5) ;
00096
00097
00098
00099
00100 static FXuint error(FXApp* app,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5) ;
00101
00102
00103
00104
00105
00106 static FXuint warning(FXWindow* owner,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5) ;
00107
00108
00109
00110
00111 static FXuint warning(FXApp* app,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5) ;
00112
00113
00114
00115
00116
00117 static FXuint question(FXWindow* owner,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5) ;
00118
00119
00120
00121
00122 static FXuint question(FXApp* app,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5) ;
00123
00124
00125
00126
00127
00128 static FXuint information(FXWindow* owner,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5) ;
00129
00130
00131
00132
00133 static FXuint information(FXApp* app,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5) ;
00134
00135 };
00136
00137 }
00138
00139 #endif