Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members
|
00001 /******************************************************************************** 00002 * * 00003 * M e s s a g e B o x e s * 00004 * * 00005 ********************************************************************************* 00006 * Copyright (C) 1997,2004 by Jeroen van der Zijp. All Rights Reserved. * 00007 ********************************************************************************* 00008 * This library is free software; you can redistribute it and/or * 00009 * modify it under the terms of the GNU Lesser General Public * 00010 * License as published by the Free Software Foundation; either * 00011 * version 2.1 of the License, or (at your option) any later version. * 00012 * * 00013 * This library is distributed in the hope that it will be useful, * 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00016 * Lesser General Public License for more details. * 00017 * * 00018 * You should have received a copy of the GNU Lesser General Public * 00019 * License along with this library; if not, write to the Free Software * 00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * 00021 ********************************************************************************* 00022 * $Id: FXMessageBox.h,v 1.23 2004/02/08 17:17:34 fox Exp $ * 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 // Message box buttons 00035 enum { 00036 MBOX_OK = 0x10000000, /// Message box has a only an OK button 00037 MBOX_OK_CANCEL = 0x20000000, /// Message box has OK and CANCEL buttons 00038 MBOX_YES_NO = 0x30000000, /// Message box has YES and NO buttons 00039 MBOX_YES_NO_CANCEL = 0x40000000, /// Message box has YES, NO, and CANCEL buttons 00040 MBOX_QUIT_CANCEL = 0x50000000, /// Message box has QUIT and CANCEL buttons 00041 MBOX_QUIT_SAVE_CANCEL = 0x60000000, /// Message box has QUIT, SAVE, and CANCEL buttons 00042 MBOX_SKIP_SKIPALL_CANCEL =0x70000000 /// Message box has SKIP, SKIP ALL, and CANCEL buttons 00043 }; 00044 00045 00046 // Return values 00047 enum { 00048 MBOX_CLICKED_YES = 1, /// The YES button was clicked 00049 MBOX_CLICKED_NO = 2, /// The NO button was clicked 00050 MBOX_CLICKED_OK = 3, /// The OK button was clicked 00051 MBOX_CLICKED_CANCEL = 4, /// The CANCEL button was clicked 00052 MBOX_CLICKED_QUIT = 5, /// The QUIT button was clicked 00053 MBOX_CLICKED_SAVE = 6, /// The SAVE button was clicked 00054 MBOX_CLICKED_SKIP = 7, /// The SKIP button was clicked 00055 MBOX_CLICKED_SKIPALL = 8 /// The SKIP ALL button was clicked 00056 }; 00057 00058 00059 /// Message box 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 /// Construct message box with given caption, icon, and message text 00086 FXMessageBox(FXWindow* owner,const FXString& caption,const FXString& text,FXIcon* ic=NULL,FXuint opts=0,FXint x=0,FXint y=0); 00087 00088 /// Construct free floating message box with given caption, icon, and message text 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 * Show a modal error message. 00093 * The text message may contain printf-tyle formatting commands. 00094 */ 00095 static FXuint error(FXWindow* owner,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5) ; 00096 00097 /** 00098 * Show modal error message, in free floating window. 00099 */ 00100 static FXuint error(FXApp* app,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5) ; 00101 00102 /** 00103 * Show a modal warning message 00104 * The text message may contain printf-tyle formatting commands. 00105 */ 00106 static FXuint warning(FXWindow* owner,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5) ; 00107 00108 /** 00109 * Show modal warning message, in free floating window. 00110 */ 00111 static FXuint warning(FXApp* app,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5) ; 00112 00113 /** 00114 * Show a modal question dialog 00115 * The text message may contain printf-tyle formatting commands. 00116 */ 00117 static FXuint question(FXWindow* owner,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5) ; 00118 00119 /** 00120 * Show modal question message, in free floating window. 00121 */ 00122 static FXuint question(FXApp* app,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5) ; 00123 00124 /** 00125 * Show a modal information dialog 00126 * The text message may contain printf-tyle formatting commands. 00127 */ 00128 static FXuint information(FXWindow* owner,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5) ; 00129 00130 /** 00131 * Show modal information message, in free floating window. 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
Copyright © 1997-2004 Jeroen van der Zijp |