diff options
author | pixel <pixel> | 2006-01-31 17:02:39 +0000 |
---|---|---|
committer | pixel <pixel> | 2006-01-31 17:02:39 +0000 |
commit | 97b4a5904a989e216b1fbb4d0a55b7340bd7f88a (patch) | |
tree | 2a40bfc8ae9f4fce9bf9a30bfc7fef7a6bb1f074 /include | |
parent | edd5fe68be2a2a9e23a87f65f6a89807c34b7c3f (diff) |
Way too much changes - all over.
Diffstat (limited to 'include')
-rw-r--r-- | include/mcolor.h | 3 | ||||
-rw-r--r-- | include/texture.h | 3 | ||||
-rw-r--r-- | include/widgets.h | 24 |
3 files changed, 24 insertions, 6 deletions
diff --git a/include/mcolor.h b/include/mcolor.h index b383fee..9592bbe 100644 --- a/include/mcolor.h +++ b/include/mcolor.h @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: mcolor.h,v 1.9 2004-11-27 21:48:01 pixel Exp $ */ +/* $Id: mcolor.h,v 1.10 2006-01-31 17:02:39 pixel Exp $ */ #ifndef __MCOLOR_H__ #define __MCOLOR_H__ @@ -37,6 +37,7 @@ namespace mogltk { void Norm(); Uint32 toSDL(SDL_PixelFormat * = 0); void fromSDL(Uint32, SDL_PixelFormat * = 0); + void fromHSV(double H, double S, double V); // H in degrees static Color Min; static Color Max; Color c; diff --git a/include/texture.h b/include/texture.h index 3143b02..879adce 100644 --- a/include/texture.h +++ b/include/texture.h @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: texture.h,v 1.9 2004-11-27 21:48:01 pixel Exp $ */ +/* $Id: texture.h,v 1.10 2006-01-31 17:02:39 pixel Exp $ */ #ifndef __TEXTURE_H__ #define __TEXTURE_H__ @@ -34,6 +34,7 @@ namespace mogltk { texture(int, int, bool = false) throw (GeneralException); texture(Handle *, bool = false) throw (GeneralException); texture(int, int, int, int); + texture(SDL_Surface *, bool = false) throw (GeneralException); virtual ~texture(); SDL_Surface * GetSurface(); Uint32 * GetPixels(); diff --git a/include/widgets.h b/include/widgets.h index 66a6191..109f623 100644 --- a/include/widgets.h +++ b/include/widgets.h @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: widgets.h,v 1.13 2005-12-02 16:21:59 pixel Exp $ */ +/* $Id: widgets.h,v 1.14 2006-01-31 17:02:39 pixel Exp $ */ #ifndef __WIDGETS_H__ #define __WIDGETS_H__ @@ -222,7 +222,7 @@ namespace mogltk { */ class MsgBox : public SmartBox { public: - MsgBox(shape *, widget * father, const String & caption, const String & text, mogltk::font * = mogltk::SystemFont); + MsgBox(action *, shape *, widget * father, const String & caption, const String & text, mogltk::font * = mogltk::SystemFont); virtual ~MsgBox(); private: mogltk::font * msgbox_font; @@ -370,12 +370,28 @@ namespace mogltk { InputDialog(action *, shape *, widget * father, const String & caption, const String & text, mogltk::font * = mogltk::SystemFont); virtual ~InputDialog(); String GetText(); - void do_action(); private: InputText * it; - action * a; mogltk::font * InputDialog_font; }; + + /*! + The ActionAndDelete provides a mechanism for a widget to run an action then self-destruct. + Used for example by the MsgBox and InputDialog. + */ + class ActionAndDelete : public mogltk::widgets::action { + public: + ActionAndDelete(mogltk::widget * _parent, mogltk::widgets::action * _a) : parent(_parent), a(_a) { } + virtual void do_action(mogltk::widget *) { + if (a) + a->do_action(parent); + delete parent; + delete this; + } + private: + mogltk::widget * parent; + mogltk::widgets::action * a; + }; }; }; |