#ifndef LIBOCELLI_SCREEN_ALARM_HPP
#define LIBOCELLI_SCREEN_ALARM_HPP
//----------------------------------------------------------------------------
///
/// \brief   Navigation screen
///
///
///
/// \date   20220905
/// \author Maximilian Seesslen <mes@seesslen.net>
///
//----------------------------------------------------------------------------


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


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

#include <ocelli/screen.hpp>
#include <ocelli/button.hpp>
#include <biwak/gdisplay.h>


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


class OScreenAlarm: public OScreen
{
   private:
      OButton m_buttonOk;
      const char* m_text1;
      const char* m_text2;

   public:
      OScreenAlarm( )
         :m_buttonOk( OPoint( 120-30, 320-60-60-30), OPoint(60,60, sizes),"OK", OButton::EButtonStyle::flat)
         ,m_text1("NO TEXT")
         ,m_text2("NO TEXT")
      {
         addWidget( &m_buttonOk );
         m_buttonOk.eventSignal.connect(this, &OScreenAlarm::slotPressed);
      }
      virtual void draw() override
      {
         OWidget::display().setFg( black );
         OWidget::display().setBg( red );
         OWidget::display().setFont( getFont16() );
         OWidget::display().drawBar(0,0,239,319, red, blue);
         OWidget::display().setDrawBackground( false );
         OWidget::display().drawText(120,160-16-8 -64, m_text1, eTextFlagsHCenter | eTextFlagsVCenter);
         OWidget::display().drawText(120,160 -64, m_text2, eTextFlagsHCenter | eTextFlagsVCenter);
         OWidget::display().setFg( red );
         OScreen::draw();
      }
      void eventLoop()
      {
      }
      void slotPressed(const Ocelli::SEvent& event)
      {
         OApp::instance()->setPreviousScreen();
      }
      void setTexts(const char *text1, const char *text2)
      {
         m_text1=text1;
         m_text2=text2;
      }
      OButton &buttonOk()
      {
         return(m_buttonOk);
      }
};


//---fin----------------------------------------------------------------------
#endif // ? ! LIBOCELLI_SCREEN_ALARM_HPP
