2009-01-17 05:43:43 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2011-03-19 20:14:35 -04:00
|
|
|
// Name: wx/osx/scrolbar.h
|
2009-01-17 05:43:43 -05:00
|
|
|
// Purpose: wxScrollBar class
|
|
|
|
// Author: Stefan Csomor
|
|
|
|
// Modified by:
|
|
|
|
// Created: 1998-01-01
|
|
|
|
// Copyright: (c) Stefan Csomor
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_SCROLBAR_H_
|
|
|
|
#define _WX_SCROLBAR_H_
|
|
|
|
|
|
|
|
// Scrollbar item
|
|
|
|
class WXDLLIMPEXP_CORE wxScrollBar : public wxScrollBarBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxScrollBar() { m_pageSize = 0; m_viewSize = 0; m_objectSize = 0; }
|
|
|
|
virtual ~wxScrollBar();
|
|
|
|
|
|
|
|
wxScrollBar(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxSB_HORIZONTAL,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
2019-10-22 06:34:29 -04:00
|
|
|
const wxString& name = wxASCII_STR(wxScrollBarNameStr))
|
2009-01-17 05:43:43 -05:00
|
|
|
{
|
|
|
|
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,
|
2019-10-22 06:34:29 -04:00
|
|
|
const wxString& name = wxASCII_STR(wxScrollBarNameStr));
|
2009-01-17 05:43:43 -05:00
|
|
|
|
2015-11-22 04:14:29 -05:00
|
|
|
virtual int GetThumbPosition() const wxOVERRIDE;
|
|
|
|
virtual int GetThumbSize() const wxOVERRIDE { return m_viewSize; }
|
|
|
|
virtual int GetPageSize() const wxOVERRIDE { return m_pageSize; }
|
|
|
|
virtual int GetRange() const wxOVERRIDE { return m_objectSize; }
|
2009-01-17 05:43:43 -05:00
|
|
|
|
2015-11-22 04:14:29 -05:00
|
|
|
virtual void SetThumbPosition(int viewStart) wxOVERRIDE;
|
2009-01-17 05:43:43 -05:00
|
|
|
virtual void SetScrollbar(int position, int thumbSize, int range,
|
2015-11-22 04:14:29 -05:00
|
|
|
int pageSize, bool refresh = true) wxOVERRIDE;
|
2009-01-17 05:43:43 -05:00
|
|
|
|
2011-01-04 03:25:19 -05: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 ) ; }
|
|
|
|
|
|
|
|
// implementation only from now on
|
2015-11-22 04:14:29 -05:00
|
|
|
void Command(wxCommandEvent& event) wxOVERRIDE;
|
|
|
|
virtual void TriggerScrollEvent( wxEventType scrollEvent ) wxOVERRIDE;
|
|
|
|
virtual bool OSXHandleClicked( double timestampsec ) wxOVERRIDE;
|
2009-01-17 05:43:43 -05:00
|
|
|
protected:
|
2015-11-22 04:14:29 -05:00
|
|
|
virtual wxSize DoGetBestSize() const wxOVERRIDE;
|
2009-01-17 05:43:43 -05:00
|
|
|
|
|
|
|
int m_pageSize;
|
|
|
|
int m_viewSize;
|
|
|
|
int m_objectSize;
|
|
|
|
|
2015-04-23 07:49:01 -04:00
|
|
|
wxDECLARE_DYNAMIC_CLASS(wxScrollBar);
|
|
|
|
wxDECLARE_EVENT_TABLE();
|
2009-01-17 05:43:43 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _WX_SCROLBAR_H_
|