1998-05-20 10:12:05 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: scrollbar.h
|
|
|
|
// Purpose: wxScrollBar class
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
|
|
|
// RCS-ID: $Id$
|
1998-08-07 19:52:45 -04:00
|
|
|
// Copyright: (c) Julian Smart
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 10:12:05 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-07 19:52:45 -04:00
|
|
|
#ifndef _WX_SCROLBAR_H_
|
|
|
|
#define _WX_SCROLBAR_H_
|
1998-05-20 10:12:05 -04:00
|
|
|
|
|
|
|
// Scrollbar item
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxScrollBar: public wxScrollBarBase
|
1998-05-20 10:12:05 -04:00
|
|
|
{
|
|
|
|
public:
|
1999-05-13 17:21:04 -04:00
|
|
|
wxScrollBar() { m_pageSize = 0; m_viewSize = 0; m_objectSize = 0; }
|
2006-09-05 16:47:48 -04:00
|
|
|
virtual ~wxScrollBar();
|
1999-05-13 17:21:04 -04:00
|
|
|
|
|
|
|
wxScrollBar(wxWindow *parent, wxWindowID id,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxSB_HORIZONTAL,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxScrollBarNameStr)
|
|
|
|
{
|
|
|
|
Create(parent, id, pos, size, style, validator, name);
|
|
|
|
}
|
|
|
|
bool Create(wxWindow *parent, wxWindowID id,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxSB_HORIZONTAL,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxScrollBarNameStr);
|
|
|
|
|
|
|
|
int GetThumbPosition() const ;
|
|
|
|
int GetThumbSize() const { return m_pageSize; }
|
|
|
|
int GetPageSize() const { return m_viewSize; }
|
|
|
|
int GetRange() const { return m_objectSize; }
|
|
|
|
|
|
|
|
virtual void SetThumbPosition(int viewStart);
|
|
|
|
virtual void SetScrollbar(int position, int thumbSize, int range, int pageSize,
|
2004-09-03 21:53:42 -04:00
|
|
|
bool refresh = true);
|
1998-05-20 10:12:05 -04:00
|
|
|
|
2003-08-19 12:48:06 -04:00
|
|
|
// needed for RTTI
|
|
|
|
void SetThumbSize( int s ) { SetScrollbar( GetThumbPosition() , s , GetRange() , GetPageSize() , true ) ; }
|
|
|
|
void SetPageSize( int s ) { SetScrollbar( GetThumbPosition() , GetThumbSize() , GetRange() , s , true ) ; }
|
|
|
|
void SetRange( int s ) { SetScrollbar( GetThumbPosition() , GetThumbSize() , s , GetPageSize() , true ) ; }
|
|
|
|
|
1999-05-13 17:21:04 -04:00
|
|
|
void Command(wxCommandEvent& event);
|
|
|
|
virtual bool MSWOnScroll(int orientation, WXWORD wParam,
|
|
|
|
WXWORD pos, WXHWND control);
|
1998-05-20 10:12:05 -04:00
|
|
|
|
2005-05-31 10:52:23 -04:00
|
|
|
// override wxControl version to not use solid background here
|
|
|
|
virtual WXHBRUSH MSWControlColor(WXHDC pDC, WXHWND hWnd);
|
2004-04-09 11:16:46 -04:00
|
|
|
|
2006-02-08 16:47:09 -05:00
|
|
|
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
|
|
|
|
|
2007-08-07 15:22:43 -04:00
|
|
|
// returns true if the platform should explicitly apply a theme border
|
|
|
|
virtual bool CanApplyThemeBorder() const { return false; }
|
|
|
|
|
2005-05-31 10:52:23 -04:00
|
|
|
protected:
|
|
|
|
virtual wxSize DoGetBestSize() const;
|
2004-04-09 11:16:46 -04:00
|
|
|
|
1998-05-20 10:12:05 -04:00
|
|
|
int m_pageSize;
|
|
|
|
int m_viewSize;
|
|
|
|
int m_objectSize;
|
|
|
|
|
2003-07-21 20:24:07 -04:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxScrollBar)
|
1998-05-20 10:12:05 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
1998-08-07 19:52:45 -04:00
|
|
|
// _WX_SCROLBAR_H_
|