//----------------------------------------------------------------------------
///
/// \brief   CANDis screen showing can messages
///
///          Static table
///
/// \date   20220903
/// \author Maximilian Seesslen <mes@seesslen.net>
///
//----------------------------------------------------------------------------


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


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

/*
#include <candis.h>
#include <ocelli/screen.hpp>
#include <biwak/gdisplay.h>
#include <ocelli/clock.hpp>
#include <ocelli/button.hpp>
#include <list>
#include <theme.hpp>
*/
#include <lepto/lepto.h>
#include <lepto/log.h>
#include <screen_mainmenu.h>


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


constexpr const SApp CScreenMainMenu::items[]
{
   { EScreen::minutnik,    &iconRef_hourglass48_flash},
   { EScreen::busstop,     &iconRef_busstop48_flash},
   { EScreen::illumination,&iconRef_lightbulb48_flash},
   { EScreen::thermometer, &iconRef_thermometer48_flash},
   { EScreen::settings,    &iconRef_wrench48_flash},
   { EScreen::chart,       &iconRef_chart48_flash},
   { EScreen::wine,        &iconRef_wine48_flash},
   { EScreen::info,        &iconRef_info48_flash},
   { EScreen::plant,       &iconRef_plant48_flash},
};

CScreenMainMenu::CScreenMainMenu( )
{
   for(int i1=0; i1< arraySize(items); i1++)
   {
      addWidget( m_pButtonApp[i1] =
                     new CButtonApp( leftTop( i1 % 3, i1 / 3), rightBottom()
                                  , "APP", items[i1].screen) );
      m_pButtonApp[i1]->signalSetApp.connect(this, &CScreenMainMenu::slotSetApp);

      if(items[i1].icon->find())
      {
         lDebug("Found Icon");
         m_pButtonApp[i1]->setIcon( items[i1].icon );
      }
      else
      {
         lWarning("Could not find Icon");
      }
   }

}


//---fin----------------------------------------------------------------------
