00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #if !defined(FXHANDEDMSGBOX_H) && !defined(FX_DISABLEGUI)
00023 #define FXHANDEDMSGBOX_H
00024
00025 #include "FXHandedInterface.h"
00026
00027 namespace FX {
00028
00033
00034 enum FXHandedMsgBoxFlags
00035 {
00036 HANDEDMSGBOX_BOTTOMWELL = HANDEDINTERFACE_BOTTOMWELL,
00037 HANDEDMSGBOX_SIDEWELL = HANDEDINTERFACE_SIDEWELL,
00038 HANDEDMSGBOX_OKBUTTON = HANDEDINTERFACE_OKBUTTON,
00039 HANDEDMSGBOX_DEFOKBUTTON = HANDEDINTERFACE_DEFOKBUTTON,
00040 HANDEDMSGBOX_CANCELBUTTON = HANDEDINTERFACE_CANCELBUTTON,
00041 HANDEDMSGBOX_OKCANCELBUTTONS= HANDEDINTERFACE_OKCANCELBUTTONS,
00042 HANDEDMSGBOX_DEFCANCELBUTTON= HANDEDINTERFACE_DEFCANCELBUTTON,
00043 HANDEDMSGBOX_DEFCANCEL = HANDEDINTERFACE_DEFCANCEL,
00044 HANDEDMSGBOX_USEYESNO = HANDEDINTERFACE_USEYESNO,
00045 HANDEDMSGBOX_RETRYBUTTON = 0x40000000
00046 };
00047
00056 struct FXHandedMsgBoxPrivate;
00057 class FXAPI FXHandedMsgBox : public FXHandedDialog
00058 {
00059 FXDECLARE(FXHandedMsgBox)
00060 FXHandedMsgBoxPrivate *p;
00061 FXHandedMsgBox(const FXHandedMsgBox &);
00062 FXHandedMsgBox &operator=(const FXHandedMsgBox &);
00063 void init(const FXString &text, const FXIcon *icon);
00064 protected:
00065 FXHandedMsgBox() : p(0) {}
00066 public:
00067 long onCmdClicked(FXObject*,FXSelector,void*);
00068 enum
00069 {
00070 ID_RETRY=FXHandedDialog::ID_LAST,
00071 ID_LAST
00072 };
00073 public:
00075 FXHandedMsgBox(FXApp *a, const FXString &caption, const FXString &text, const FXIcon *icon=informationalIcon(), FXuint opts=DECOR_ALL|HANDEDMSGBOX_DEFOKBUTTON,FXint x=0,FXint y=0,FXint w=200,FXint h=150,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD,FXint hs=DEFAULT_SPACING,FXint vs=DEFAULT_SPACING);
00077 FXHandedMsgBox(FXWindow *owner, const FXString &caption, const FXString &text, const FXIcon *icon=informationalIcon(), FXuint opts=DECOR_ALL|HANDEDMSGBOX_DEFOKBUTTON,FXint x=0,FXint y=0,FXint w=200,FXint h=150,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD,FXint hs=DEFAULT_SPACING,FXint vs=DEFAULT_SPACING);
00078 ~FXHandedMsgBox();
00080 FXString text() const;
00082 void setText(const FXString &text);
00087 virtual FXuint execute(FXuint placement=PLACEMENT_CURSOR);
00088
00090 static FXuint fatalerror(FXApp *a, const FXString &caption, const FXString &text, FXuint opts=DECOR_ALL|HANDEDMSGBOX_DEFOKBUTTON,FXint x=0,FXint y=0,FXint w=200,FXint h=150,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD,FXint hs=DEFAULT_SPACING,FXint vs=DEFAULT_SPACING)
00091 {
00092 return FXHandedMsgBox(a, caption, text, fatalErrorIcon(), opts, x,y,w,h, pl,pr,pt,pb, hs,vs).execute();
00093 }
00095 static FXuint fatalerror(FXWindow *window, const FXString &caption, const FXString &text, FXuint opts=DECOR_ALL|HANDEDMSGBOX_DEFOKBUTTON,FXint x=0,FXint y=0,FXint w=200,FXint h=150,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD,FXint hs=DEFAULT_SPACING,FXint vs=DEFAULT_SPACING)
00096 {
00097 return FXHandedMsgBox(window, caption, text, fatalErrorIcon(), opts, x,y,w,h, pl,pr,pt,pb, hs,vs).execute();
00098 }
00100 static FXuint error(FXApp *a, const FXString &caption, const FXString &text, FXuint opts=DECOR_ALL|HANDEDMSGBOX_DEFOKBUTTON,FXint x=0,FXint y=0,FXint w=200,FXint h=150,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD,FXint hs=DEFAULT_SPACING,FXint vs=DEFAULT_SPACING)
00101 {
00102 return FXHandedMsgBox(a, caption, text, errorIcon(), opts, x,y,w,h, pl,pr,pt,pb, hs,vs).execute();
00103 }
00105 static FXuint error(FXWindow *window, const FXString &caption, const FXString &text, FXuint opts=DECOR_ALL|HANDEDMSGBOX_DEFOKBUTTON,FXint x=0,FXint y=0,FXint w=200,FXint h=150,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD,FXint hs=DEFAULT_SPACING,FXint vs=DEFAULT_SPACING)
00106 {
00107 return FXHandedMsgBox(window, caption, text, errorIcon(), opts, x,y,w,h, pl,pr,pt,pb, hs,vs).execute();
00108 }
00110 static FXuint question(FXApp *a, const FXString &caption, const FXString &text, FXuint opts=DECOR_ALL|HANDEDMSGBOX_DEFOKBUTTON|HANDEDMSGBOX_OKCANCELBUTTONS|HANDEDMSGBOX_USEYESNO,FXint x=0,FXint y=0,FXint w=200,FXint h=150,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD,FXint hs=DEFAULT_SPACING,FXint vs=DEFAULT_SPACING)
00111 {
00112 return FXHandedMsgBox(a, caption, text, questionIcon(), opts, x,y,w,h, pl,pr,pt,pb, hs,vs).execute();
00113 }
00115 static FXuint question(FXWindow *window, const FXString &caption, const FXString &text, FXuint opts=DECOR_ALL|HANDEDMSGBOX_DEFOKBUTTON|HANDEDMSGBOX_OKCANCELBUTTONS|HANDEDMSGBOX_USEYESNO,FXint x=0,FXint y=0,FXint w=200,FXint h=150,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD,FXint hs=DEFAULT_SPACING,FXint vs=DEFAULT_SPACING)
00116 {
00117 return FXHandedMsgBox(window, caption, text, questionIcon(), opts, x,y,w,h, pl,pr,pt,pb, hs,vs).execute();
00118 }
00120 static FXuint informational(FXApp *a, const FXString &caption, const FXString &text, FXuint opts=DECOR_ALL|HANDEDMSGBOX_DEFOKBUTTON,FXint x=0,FXint y=0,FXint w=200,FXint h=150,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD,FXint hs=DEFAULT_SPACING,FXint vs=DEFAULT_SPACING)
00121 {
00122 return FXHandedMsgBox(a, caption, text, informationalIcon(), opts, x,y,w,h, pl,pr,pt,pb, hs,vs).execute();
00123 }
00125 static FXuint informational(FXWindow *window, const FXString &caption, const FXString &text, FXuint opts=DECOR_ALL|HANDEDMSGBOX_DEFOKBUTTON,FXint x=0,FXint y=0,FXint w=200,FXint h=150,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD,FXint hs=DEFAULT_SPACING,FXint vs=DEFAULT_SPACING)
00126 {
00127 return FXHandedMsgBox(window, caption, text, informationalIcon(), opts, x,y,w,h, pl,pr,pt,pb, hs,vs).execute();
00128 }
00129
00131 static const FXIcon *fatalErrorIcon();
00133 static const FXIcon *errorIcon();
00135 static const FXIcon *questionIcon();
00137 static const FXIcon *informationalIcon();
00138 };
00139
00140 }
00141
00142 #endif