00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #if !defined(FXPRIMARYBUTTON_H) && !defined(FX_DISABLEGUI)
00023 #define FXPRIMARYBUTTON_H
00024
00025 #include "FXButton.h"
00026 #include "FXPacker.h"
00027 #include <qptrvector.h>
00028
00029 namespace FX {
00030
00035 #ifdef _MSC_VER
00036 #pragma warning(push)
00037 #pragma warning(disable: 4251)
00038 #endif
00039
00052 class FXAPI FXApplyResetList
00053 {
00054 QPtrVector<FXWindow> mywidgets;
00055 protected:
00056 FXApplyResetList() { }
00057 public:
00059 long onApply(FXObject*,FXSelector,void*);
00061 long onReset(FXObject*,FXSelector,void*);
00062
00064 template<typename type> type *addApplyReset(type *widget)
00065 {
00066 mywidgets.append(widget);
00067 return widget;
00068 }
00070 void removeApplyReset(FXWindow *widget) { mywidgets.removeRef(widget); }
00072 void clearApplyReset() { mywidgets.clear(); }
00073 };
00074 #ifdef _MSC_VER
00075 #pragma warning(pop)
00076 #endif
00077
00079 enum
00080 {
00081 PBUTTON_POSITIVE = 0x20000000,
00082 PBUTTON_NEGATIVE = 0x40000000,
00083 PBUTTON_NOAUTOLAYOUT = 0x80000000,
00084 PBUTTON_NORMAL=BUTTON_NORMAL|LAYOUT_BOTTOM,
00086 PBUTTON_OK = PBUTTON_NORMAL|PBUTTON_POSITIVE,
00088 PBUTTON_CANCEL = PBUTTON_NORMAL|PBUTTON_NEGATIVE,
00090 PBUTTON_DEFOK = BUTTON_INITIAL|BUTTON_DEFAULT|PBUTTON_OK,
00092 PBUTTON_DEFCANCEL= BUTTON_INITIAL|BUTTON_DEFAULT|PBUTTON_CANCEL
00093 };
00094
00095
00139 class FXAPI FXPrimaryButton : public FXButton
00140 {
00141 FXDECLARE(FXPrimaryButton)
00142 FXColor surcol;
00143 FXint surwidth;
00144 FXPrimaryButton(const FXPrimaryButton &);
00145 FXPrimaryButton &operator=(const FXPrimaryButton &);
00146 protected:
00147 FXPrimaryButton() {}
00148 public:
00150 FXPrimaryButton(FXComposite *parent,const FXString &text,FXIcon *icon=NULL,
00151 FXObject *tgt=NULL,FXSelector sel=0,FXuint opts=PBUTTON_NORMAL,
00152 FXint x=0,FXint y=0,FXint w=0,FXint h=0,
00153 FXint pl=DEFAULT_PAD*4,FXint pr=DEFAULT_PAD*4,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD,
00154 #ifdef BUILDING_TCOMMON
00155 FXint sr=FXMAX(2, DEFAULT_SPACING));
00156 #else
00157 FXint sr=0);
00158 #endif
00159 public:
00160 long onPaint(FXObject*,FXSelector,void*);
00161 long onMiddleBtnRelease(FXObject*,FXSelector,void*);
00162 public:
00164 FXColor surroundColour() const throw();
00166 void setSurroundColour(FXColor c) throw();
00167
00168 virtual void save(FXStream &store) const;
00169 virtual void load(FXStream &store);
00170 };
00171
00172 }
00173
00174 #endif