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

/home/jeroen/FOX/fox/fox-1.7.33/include/FXMessageBox.h
00001 /********************************************************************************
00002 *                                                                               *
00003 *                         M e s s a g e   B o x e s                             *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 1997,2012 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or modify          *
00009 * it under the terms of the GNU Lesser General Public License as published by   *
00010 * the Free Software Foundation; either version 3 of the License, or             *
00011 * (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                 *
00016 * GNU Lesser General Public License for more details.                           *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public License      *
00019 * along with this program.  If not, see <http://www.gnu.org/licenses/>          *
00020 ********************************************************************************/
00021 #ifndef FXMESSAGEBOX_H
00022 #define FXMESSAGEBOX_H
00023 
00024 #ifndef FXDIALOGBOX_H
00025 #include "FXDialogBox.h"
00026 #endif
00027 
00028 namespace FX {
00029 
00030 
00031 // Message box buttons
00032 enum {
00033   MBOX_OK                         = 0x10000000, 
00034   MBOX_OK_CANCEL                  = 0x20000000, 
00035   MBOX_YES_NO                     = 0x30000000, 
00036   MBOX_YES_NO_CANCEL              = 0x40000000, 
00037   MBOX_QUIT_CANCEL                = 0x50000000, 
00038   MBOX_QUIT_SAVE_CANCEL           = 0x60000000, 
00039   MBOX_SKIP_SKIPALL_CANCEL        = 0x70000000, 
00040   MBOX_SAVE_CANCEL_DONTSAVE       = 0x80000000, 
00041   MBOX_YES_YESALL_NO_NOALL_CANCEL = 0xA0000000  
00042   };
00043 
00044 
00045 // Return values
00046 enum {
00047   MBOX_CLICKED_YES      = 1,            
00048   MBOX_CLICKED_NO       = 2,            
00049   MBOX_CLICKED_OK       = 3,            
00050   MBOX_CLICKED_CANCEL   = 4,            
00051   MBOX_CLICKED_QUIT     = 5,            
00052   MBOX_CLICKED_SAVE     = 6,            
00053   MBOX_CLICKED_SKIP     = 7,            
00054   MBOX_CLICKED_SKIPALL  = 8,            
00055   MBOX_CLICKED_YESALL   = 9,            
00056   MBOX_CLICKED_NOALL    = 10            
00057   };
00058 
00059 
00069 class FXAPI FXMessageBox : public FXDialogBox {
00070   FXDECLARE(FXMessageBox)
00071 protected:
00072   FXMessageBox(){}
00073 private:
00074   FXMessageBox(const FXMessageBox&);
00075   FXMessageBox &operator=(const FXMessageBox&);
00076   void initialize(const FXString& text,FXIcon* ic,FXuint whichbuttons);
00077 public:
00078   long onCmdClicked(FXObject*,FXSelector,void*);
00079   long onCmdCancel(FXObject*,FXSelector,void*);
00080 public:
00081   enum{
00082     ID_CLICKED_YES=FXDialogBox::ID_LAST,
00083     ID_CLICKED_NO,
00084     ID_CLICKED_OK,
00085     ID_CLICKED_CANCEL,
00086     ID_CLICKED_QUIT,
00087     ID_CLICKED_SAVE,
00088     ID_CLICKED_SKIP,
00089     ID_CLICKED_SKIPALL,
00090     ID_CLICKED_YESALL,
00091     ID_CLICKED_NOALL,
00092     ID_LAST
00093     };
00094 public:
00095 
00097   FXMessageBox(FXWindow* owner,const FXString& caption,const FXString& text,FXIcon* ic=NULL,FXuint opts=0,FXint x=0,FXint y=0);
00098 
00100   FXMessageBox(FXApp* app,const FXString& caption,const FXString& text,FXIcon* ic=NULL,FXuint opts=0,FXint x=0,FXint y=0);
00101 
00106   static FXuint error(FXWindow* owner,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5) ;
00107 
00111   static FXuint error(FXApp* app,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5) ;
00112 
00117   static FXuint warning(FXWindow* owner,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5) ;
00118 
00122   static FXuint warning(FXApp* app,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5) ;
00123 
00128   static FXuint question(FXWindow* owner,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5) ;
00129 
00133   static FXuint question(FXApp* app,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5) ;
00134 
00139   static FXuint information(FXWindow* owner,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5) ;
00140 
00144   static FXuint information(FXApp* app,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5) ;
00145 
00146   };
00147 
00148 }
00149 
00150 #endif

Copyright © 1997-2011 Jeroen van der Zijp