FXMessageBox.h

Go to the documentation of this file.
00001 /********************************************************************************
00002 *                                                                               *
00003 *                         M e s s a g e   B o x e s                             *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 1997,2006 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.28 2006/01/22 17:58:06 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, 
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   MBOX_SAVE_CANCEL_DONTSAVE = 0x80000000  
00044   };
00045 
00046 
00047 // Return values
00048 enum {
00049   MBOX_CLICKED_YES      = 1,            
00050   MBOX_CLICKED_NO       = 2,            
00051   MBOX_CLICKED_OK       = 3,            
00052   MBOX_CLICKED_CANCEL   = 4,            
00053   MBOX_CLICKED_QUIT     = 5,            
00054   MBOX_CLICKED_SAVE     = 6,            
00055   MBOX_CLICKED_SKIP     = 7,            
00056   MBOX_CLICKED_SKIPALL  = 8             
00057   };
00058 
00059 
00071 class FXAPI FXMessageBox : public FXDialogBox {
00072   FXDECLARE(FXMessageBox)
00073 protected:
00074   FXMessageBox(){}
00075 private:
00076   FXMessageBox(const FXMessageBox&);
00077   FXMessageBox &operator=(const FXMessageBox&);
00078   void initialize(const FXString& text,FXIcon* ic,FXuint whichbuttons);
00079 public:
00080   long onCmdClicked(FXObject*,FXSelector,void*);
00081   long onCmdCancel(FXObject*,FXSelector,void*);
00082 public:
00083   enum{
00084     ID_CLICKED_YES=FXDialogBox::ID_LAST,
00085     ID_CLICKED_NO,
00086     ID_CLICKED_OK,
00087     ID_CLICKED_CANCEL,
00088     ID_CLICKED_QUIT,
00089     ID_CLICKED_SAVE,
00090     ID_CLICKED_SKIP,
00091     ID_CLICKED_SKIPALL,
00092     ID_LAST
00093     };
00094 public:
00095 
00097   FXDEPRECATEDEXT FXMessageBox(FXWindow* owner,const FXString& caption,const FXString& text,FXIcon* ic=NULL,FXuint opts=0,FXint x=0,FXint y=0);
00098 
00100   FXDEPRECATEDEXT FXMessageBox(FXApp* app,const FXString& caption,const FXString& text,FXIcon* ic=NULL,FXuint opts=0,FXint x=0,FXint y=0);
00101 
00106   static FXDEPRECATEDEXT FXuint error(FXWindow* owner,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5);
00107 
00111   static FXDEPRECATEDEXT FXuint error(FXApp* app,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5);
00112 
00117   static FXDEPRECATEDEXT FXuint warning(FXWindow* owner,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5);
00118 
00122   static FXDEPRECATEDEXT FXuint warning(FXApp* app,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5);
00123 
00128   static FXDEPRECATEDEXT FXuint question(FXWindow* owner,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5);
00129 
00133   static FXDEPRECATEDEXT FXuint question(FXApp* app,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5);
00134 
00139   static FXDEPRECATEDEXT FXuint information(FXWindow* owner,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5);
00140 
00144   static FXDEPRECATEDEXT FXuint information(FXApp* app,FXuint opts,const char* caption,const char* message,...) FX_PRINTF(4,5);
00145 
00146   };
00147 
00148 }
00149 
00150 #endif

(C) 2002-2009 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Nov 20 18:31:23 2009 for TnFOX by doxygen v1.4.7