Pioneer
GuiImageButton.h
Go to the documentation of this file.
1 // Copyright © 2008-2021 Pioneer Developers. See AUTHORS.txt for details
2 // Licensed under the terms of the GPL v3. See licenses/GPL-3.txt
3 
4 #ifndef _GUIIMAGEBUTTON_H
5 #define _GUIIMAGEBUTTON_H
6 
7 #include "GuiButton.h"
8 #include "GuiWidget.h"
9 #include "gui/GuiImage.h"
10 
11 #include <string>
12 
13 namespace Gui {
14  class ImageButton : public Button {
15  public:
16  ImageButton(const char *img_normal);
17  ImageButton(const char *img_normal, const char *img_pressed);
18  virtual void Draw();
19  virtual ~ImageButton();
20  virtual void GetSizeRequested(float size[2]);
21  void SetRenderDimensions(const float wide, const float high);
22 
23  private:
24  void LoadImages(const char *img_normal, const char *img_pressed);
25  Image *m_imgNormal;
26  Image *m_imgPressed;
27  };
28 } // namespace Gui
29 
30 #endif /* _GUIIMAGEBUTTON_H */
Definition: GuiButton.h:13
Definition: GuiImageButton.h:14
virtual void GetSizeRequested(float size[2])
Definition: GuiImageButton.cpp:41
virtual void Draw()
Definition: GuiImageButton.cpp:46
void SetRenderDimensions(const float wide, const float high)
Definition: GuiImageButton.cpp:64
virtual ~ImageButton()
Definition: GuiImageButton.cpp:22
ImageButton(const char *img_normal)
Definition: GuiImageButton.cpp:10
Definition: GuiImage.h:12
Definition: Gui.cpp:10