/// ****************************************************************************
/// @file   
/// @author Dr.Neeton
/// @date   200X/X/X - 2016/11/15
/// 
/// @brief  Win32 スクロールバークラス
/// 
/// ****************************************************************************

#pragma once

#include "CPL_WIN_Component.h"


namespace CPL {
namespace WIN {


// _____________________________________________________________________________
/// @brief スクロールバークラス
///
// *****************************************************************************
class ScrollBar
  : public Component
{
public:
  friend class Window;

  ScrollBar
  ( _in<HWND     > in_hdl_win_parent
  , _in<td_Coord2> in_pos    = td_Coord2(0,0)
  , _in<td_Coord2> in_size   = td_Coord2(0,0)
  , _in<int      > in_flag_h = true
  , _in<int      > in_ID     = -1
  );
  virtual ~ScrollBar(){}

private:
  SCROLLINFO m_scroll_info;
  bool       m_flag_auto;

  CPL_WIN_COMPONENT_GET_CLASS_NAME( "SCROLLBAR" );

public:
  virtual void  SetPos( _in<int> in_pos_value );
  virtual void  SetMin( _in<int> in_value_of_minimum );
  virtual void  SetMax( _in<int> in_value_of_maximum );
  virtual void  SetParameter
                  ( _in<int> in_pos_value
                  , _in<int> in_value_of_minimum
                  , _in<int> in_value_of_maximum
                  , _in<int> in_page_size = 1
                  );
  virtual void  SetPage( _in<int> in_page_size );
  virtual void  SetAutoMode( _in<bool> in_flag_auto ){ m_flag_auto = in_flag_auto; }
  virtual void  AddPos( _in<int> in_add_value );
  virtual int   GetPos()  const { return m_scroll_info.nPos; }
  virtual int   GetMin()  const { return m_scroll_info.nMin; }
  virtual int   GetMax()  const { return m_scroll_info.nMax; }
  virtual int   GetPage() const { return m_scroll_info.nPage; }
  virtual bool  GetAuto() const { return m_flag_auto; }
};


} // namespace WIN
} // namespace CPL
