summaryrefslogtreecommitdiff
path: root/widgetbutton.h
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2006-08-04 01:04:15 +0000
committerMatt Turner <mattst88@gmail.com>2006-08-04 01:04:15 +0000
commitdfa4a46bb0e6c6df9d07039fda5ef7f4309915b2 (patch)
treeac8b4cc67ff64703b4298f077e87bb4eb4334410 /widgetbutton.h
parent3582a80243bdd92619e737111ada5b5bf2667cd7 (diff)
git-svn-id: svn://mattst88.com/svn/skygipp/trunk@2 a71248a0-261a-0410-b604-901f7c0bd773
Diffstat (limited to 'widgetbutton.h')
-rw-r--r--widgetbutton.h125
1 files changed, 125 insertions, 0 deletions
diff --git a/widgetbutton.h b/widgetbutton.h
new file mode 100644
index 0000000..259c266
--- /dev/null
+++ b/widgetbutton.h
@@ -0,0 +1,125 @@
+#ifndef WIDGETBUTTON_H
+#define WIDGETBUTTON_H
+
+#include <skygi/skygi.h>
+
+#include "widget.h"
+
+//! A Button class
+
+class CButton: public CWidget {
+ public:
+ /*! Constructor */
+ CButton();
+
+ /*!
+ Create Button
+
+ \param parent HANDLE of the parent window on which to draw
+ \param name Name of the Button
+ \param x Top left x coordinate
+ \param y Top left y coordinate
+ \param w Form width
+ \param h Form height
+ \param style Style flags\n
+ WGF_NO_BORDER: Button has no border\n
+ WGF_BORDER_ON_MOUSE_OVER: Buttons has border on mouseover
+ \param ID ID sent to parent when Button is pressed (MSG_COMMAND)
+
+ \return Success: S_OK\n
+ Failure: E_HANDLE
+ */
+ HRESULT Create(HANDLE parent, char * name, int x, int y, int w, int h, int style, unsigned int ID);
+
+ /*!
+ Enable Button
+ */
+ HRESULT Enable();
+
+ /*!
+ Disable Button
+ */
+ HRESULT Disable();
+
+ HRESULT OwnerDraw(char bOwnerDraw, void * pCookie);
+
+ /*!
+ Change Text on Button
+
+ \param text New text to display
+ */
+ HRESULT SetText(char * text);
+
+ /*!
+ Get Text on Button
+
+ \return Text
+ */
+ char * GetText();
+
+ /*!
+ Set background bitmap
+
+ \param dib Bitmap to draw
+ */
+ HRESULT SetBackground(DIB * dib);
+
+ /*!
+ Get background bitmap
+
+ \return Pointer to background bitmap
+ */
+ DIB * GetBackground();
+
+ HRESULT SetBackgroundBlit(int bPressed, sBlit * pBlit);
+ sBlit * GetBackgroundBlit();
+
+ /*!
+ Set foreground bitmap
+
+ \param dib Bitmap to draw
+ */
+ HRESULT SetForeground(DIB * dib);
+
+ /*!
+ Get foreground bitmap
+
+ \return Pointer to foreground bitmap
+ */
+ DIB * GetForeground();
+
+
+ HRESULT SetIcon(s_gi_icon * icon);
+ s_gi_icon * GetIcon();
+
+ /*!
+ Set bitmap to be drawn when Button is clicked
+
+ \param dib Bitmap to draw when Button is clicked
+ */
+ HRESULT SetPressedDIB(DIB * dib);
+
+ /*!
+ Get bitmap to be drawn when Button is clicked
+
+ \return Pointer to bitmap
+ */
+ DIB * GetPressedDIB();
+
+
+ HRESULT SetStyle(unsigned int flags);
+ HRESULT SetTextColor(COLOR color);
+ COLOR GetTextColor();
+ HRESULT UseParentBackground(char use);
+ friend class CTooltip;
+ protected:
+ char Text[64];
+ s_gi_icon * Icon;
+ DIB * Foreground;
+ DIB * Background;
+ sBlit * BackgroundBlit;
+ DIB * PressedDIB;
+ COLOR TextColor;
+};
+
+#endif