My Project
D:/source/c++/Programme/sally/sally/sallyAPI/Scrollbar.h
Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 #pragma once
00029 #include "Define.h"
00030 #include "Control.h"
00031 
00032 namespace SallyAPI
00033 {
00034         namespace GUI
00035         {
00041 
00042                 enum SCROLLBAR_ALIGNMENT {SCROLLBAR_ALIGNMENT_VERTICAL }; //, SCROLLBAR_ALIGNMENT_HORIZONTAL};
00043 
00052 
00053                 class DLL_API_SALLY CScrollbar :
00054                         public SallyAPI::GUI::CControl
00055                 {
00056                 private:
00057                         int                                             m_iMouseDownKnobOffSet;
00058 
00059                         SCROLLBAR_ALIGNMENT             m_eScrollbarAlignment;
00060                         int                                             m_iPosition;
00061                         int                                             m_iPositionMax;
00062                         int                                             m_iKnobHeight;
00063                         int                                             m_iKnobPosition;
00064                         int                                             m_iBarHeight;
00065                         bool                                    m_bShowScrollbarIfNotScrollable;
00066 
00067                         void                    DrawHorizontal();
00068                         void                    DrawVertical();
00069 
00070                         virtual void    RenderControl();
00071                         virtual bool    ProcessMouseDown(int x, int y);
00072                         virtual bool    ProcessMouseUp(int x, int y);
00073                         virtual bool    ProcessMouseMove(int x, int y);
00074                 public:
00075                         CScrollbar(SallyAPI::GUI::CGUIBaseObject* parent, int x, int y, int width, int height, SCROLLBAR_ALIGNMENT scrollbarAlignment, int controlId = 0);
00076                         virtual ~CScrollbar();
00077 
00078                         void            ShowScrollbarIfNotScrollable(bool value);
00079                         bool            IsScrollbarVisibleIfNotScrollbable();
00080 
00081                         void            SetMaxPosition(int position);
00082                         void            SetPosition(int position);
00083                         int                     GetMaxPosition();
00084                         int                     GetPosition();
00085 
00086                         virtual void SendMessageToParent(CGUIBaseObject* reporter, int reporterId, int messageId, SallyAPI::GUI::SendMessage::CParameterBase* messageParameter = NULL);
00087                         virtual void SendMessageToChilds(CGUIBaseObject* reporter, int reporterId, int messageId, SallyAPI::GUI::SendMessage::CParameterBase* messageParameter = NULL);
00088                         virtual bool CheckProcessMouseDown(int x, int y);
00089                 };
00090         }
00091 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines