#if ! defined ( LIBOCELLI_BUTTON )
#define LIBOCELLI_BUTTON
//----------------------------------------------------------------------------
///
/// \file   widget.hpp
///
/// \brief  class for graphical widgets
///
/// \date   20220619
/// \author Maximilian Seesslen <mes@seesslen.net>
///
//----------------------------------------------------------------------------


//---Documentation------------------------------------------------------------


//---Includes -----------------------------------------------------------------


//---General--------------------------

//--- Own ----------------------------

#include <ocelli/widget.hpp>
#include <ocelli/icon.hpp>
#include <biwak/touch.h>

//---Declaration---------------------------------------------------------------


class OButton: public OWidget
{
   public:
      enum class EButtonStyle: int
      {
         bar,
         flat,
         flatSmallBorder,
      };

   protected:
      struct SStyles
      {
         const TRgb topColor;
         const TRgb bottomColor;
         const bool horizontalSeperator;
         const bool indicatorCircle;
         const int rectBorder;
      };
      static const SStyles styles[];

   private:
      const OIcon*  m_icon=nullptr;
      const char* m_text;

   protected:
      EButtonStyle m_style;

   public:
      constexpr OButton(int x1, int y1, int x2, int y2, const char* const text, EButtonStyle style = EButtonStyle::bar )
         :OWidget(x1, y1, x2, y2)
         ,m_text(text)
         ,m_style(style)
      {
      }
      constexpr OButton( const OPoint p1, const OPoint p2, const char* const text, EButtonStyle style = EButtonStyle::bar)
         :OWidget(p1, p2)
         ,m_text(text)
         ,m_style(style)
      {
      }
      virtual void draw() override;
      virtual void update( const Ocelli::SEvent &event ) override;
      void setText(const char* text)
      {
         m_text=text;
      }
      void setIcon(const OIcon *icon)
      {
         m_icon=icon;
      }
};


//---fin-----------------------------------------------------------------------
#endif // ? ! LIBOCELLI_BUTTON
