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
|
|
|
|
2003-08-09 08:38:21 -04:00
|
|
|
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
1998-05-20 10:12:05 -04:00
|
|
|
#pragma interface "scrolbar.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// Scrollbar item
|
2001-06-26 16:59:19 -04:00
|
|
|
class WXDLLEXPORT 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; }
|
|
|
|
~wxScrollBar();
|
|
|
|
|
|
|
|
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 WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
|
|
|
|
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
|
|
|
virtual bool MSWOnScroll(int orientation, WXWORD wParam,
|
|
|
|
WXWORD pos, WXHWND control);
|
1998-05-20 10:12:05 -04:00
|
|
|
|
|
|
|
protected:
|
2004-04-09 11:16:46 -04:00
|
|
|
|
|
|
|
wxSize DoGetBestSize() const;
|
|
|
|
|
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_
|