00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00033
00034 #pragma once
00035
00036 #include "../api_gui.h"
00037 #include "../gui_component.h"
00038 #include "../../Core/Signals/callback_v0.h"
00039 #include "../../Display/Render/graphic_context.h"
00040
00041 class CL_Image;
00042 class CL_PushButton_Impl;
00043
00047 class CL_API_GUI CL_PushButton : public CL_GUIComponent
00048 {
00051
00052 public:
00053
00057 CL_PushButton(CL_GUIComponent *parent);
00058
00059 virtual ~CL_PushButton();
00060
00064
00065 public:
00066
00070 bool is_pushed() const;
00071
00075 bool is_toggle() const;
00076
00080 bool is_flat() const;
00081
00085 CL_Image get_icon() const;
00086
00087 enum IconPosition
00088 {
00089 icon_left, icon_top, icon_right, icon_bottom
00090 };
00091
00095 IconPosition get_icon_position() const;
00096
00097 const CL_String &get_text() const;
00098
00102 CL_Size get_preferred_size() const;
00103
00107
00108 public:
00109
00113 void set_pushed(bool enable);
00114
00118 void set_toggle(bool enable);
00119
00123 void set_flat(bool enable);
00124
00128 void set_icon(const CL_Image &icon);
00129
00133 void set_icon_position(IconPosition pos);
00134
00138 void set_text(const CL_StringRef &text);
00139
00143
00144 public:
00145
00149 CL_Callback_v0 &func_clicked();
00150
00154
00155 private:
00156 CL_SharedPtr<CL_PushButton_Impl> impl;
00158 };
00159