X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fgui%2Felements.h;fp=src%2Fgui%2Felements.h;h=1ec92069286b66dae717e593c3a7f945e8c76a34;hb=f8d9fa1865388d1833179e67e223c6f8576c56fe;hp=102b72552b0110057d5bda70d8f9169042db71e8;hpb=6508be6bbdafb33fe7888e6b0ac48b46ef2b7598;p=apple2 diff --git a/src/gui/elements.h b/src/gui/elements.h index 102b725..1ec9206 100644 --- a/src/gui/elements.h +++ b/src/gui/elements.h @@ -3,6 +3,7 @@ #include #include +#include "font10pt.h" enum ObjectType { OTNone = 0, OTCheckBox, OTLineEdit, OTDraggable, OTCount }; @@ -36,14 +37,26 @@ struct LineEdit { struct Draggable { OBJECT_COMMON; + uint8_t * spot; int32_t homex, homey; bool dragging; SDL_Texture * img; SDL_Rect dest; - uint8_t spot; - Draggable(): type(OTDraggable), hovered(false), homex(0), homey(0), dragging(false), img(0), spot(0) { r.x = r.y = r.w = r.h = 0; } - Draggable(int32_t xx, int32_t yy, int32_t w, int32_t h, SDL_Texture * i = 0): type(OTDraggable), hovered(false), homex(xx), homey(yy), dragging(false), img(i), spot(0) { r.x = xx; r.y = yy; r.w = w; r.h = h; } + Draggable(): type(OTDraggable), hovered(false), spot(0), homex(0), homey(0), dragging(false), img(0) { r.x = r.y = r.w = r.h = 0; } + Draggable(int32_t xx, int32_t yy, int32_t w, int32_t h, uint8_t * s = 0, SDL_Texture * i = 0): type(OTDraggable), hovered(false), spot(s), homex(xx), homey(yy), dragging(false), img(i) + { + r.x = xx; + r.y = yy; + r.w = w; + r.h = h; + + if ((s) && (*s != 0)) + { + r.x = 120; + r.y = (7 + *(spot)) * FONT_HEIGHT; + } + } }; #endif // __ELEMENTS_H__