2005-03-16 16:18:31 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2011-03-20 00:14:35 +00:00
|
|
|
// Name: wx/scrolbar.h
|
2005-03-16 16:18:31 +00:00
|
|
|
// Purpose: wxScrollBar base header
|
2005-05-04 18:57:50 +00:00
|
|
|
// Author: Julian Smart
|
2005-03-16 16:18:31 +00:00
|
|
|
// Modified by:
|
|
|
|
// Created:
|
2005-05-04 18:57:50 +00:00
|
|
|
// Copyright: (c) Julian Smart
|
2005-03-16 16:18:31 +00:00
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-15 00:23:28 +00:00
|
|
|
#ifndef _WX_SCROLBAR_H_BASE_
|
|
|
|
#define _WX_SCROLBAR_H_BASE_
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2005-03-16 16:18:31 +00:00
|
|
|
#include "wx/defs.h"
|
|
|
|
|
2001-06-26 20:59:19 +00:00
|
|
|
#if wxUSE_SCROLLBAR
|
|
|
|
|
|
|
|
#include "wx/control.h"
|
|
|
|
|
2008-03-26 15:06:00 +00:00
|
|
|
extern WXDLLIMPEXP_DATA_CORE(const char) wxScrollBarNameStr[];
|
2001-06-26 20:59:19 +00:00
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxScrollBar: a scroll bar control
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2008-03-26 15:06:00 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxScrollBarBase : public wxControl
|
2001-06-26 20:59:19 +00:00
|
|
|
{
|
|
|
|
public:
|
2003-07-22 00:24:07 +00:00
|
|
|
wxScrollBarBase() { }
|
|
|
|
|
2011-01-16 14:09:07 +00:00
|
|
|
/*
|
|
|
|
Derived classes should provide the following method and ctor with the
|
|
|
|
same parameters:
|
|
|
|
|
2001-06-26 20:59:19 +00:00
|
|
|
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);
|
2011-01-16 14:09:07 +00:00
|
|
|
*/
|
2001-06-26 20:59:19 +00:00
|
|
|
|
|
|
|
// accessors
|
|
|
|
virtual int GetThumbPosition() const = 0;
|
|
|
|
virtual int GetThumbSize() const = 0;
|
|
|
|
virtual int GetPageSize() const = 0;
|
|
|
|
virtual int GetRange() const = 0;
|
|
|
|
|
|
|
|
bool IsVertical() const { return (m_windowStyle & wxVERTICAL) != 0; }
|
|
|
|
|
|
|
|
// operations
|
|
|
|
virtual void SetThumbPosition(int viewStart) = 0;
|
|
|
|
virtual void SetScrollbar(int position, int thumbSize,
|
|
|
|
int range, int pageSize,
|
2016-09-25 20:21:28 +00:00
|
|
|
bool refresh = true) wxOVERRIDE = 0;
|
2003-07-22 00:24:07 +00:00
|
|
|
|
2007-11-03 22:14:29 +00:00
|
|
|
// implementation-only
|
|
|
|
bool IsNeeded() const { return GetRange() > GetThumbSize(); }
|
|
|
|
|
2003-07-22 00:24:07 +00:00
|
|
|
private:
|
2009-02-08 11:45:59 +00:00
|
|
|
wxDECLARE_NO_COPY_CLASS(wxScrollBarBase);
|
2001-06-26 20:59:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#if defined(__WXUNIVERSAL__)
|
|
|
|
#include "wx/univ/scrolbar.h"
|
|
|
|
#elif defined(__WXMSW__)
|
|
|
|
#include "wx/msw/scrolbar.h"
|
1998-07-10 14:15:17 +00:00
|
|
|
#elif defined(__WXMOTIF__)
|
2001-06-26 20:59:19 +00:00
|
|
|
#include "wx/motif/scrolbar.h"
|
2006-01-23 03:27:34 +00:00
|
|
|
#elif defined(__WXGTK20__)
|
2001-06-26 20:59:19 +00:00
|
|
|
#include "wx/gtk/scrolbar.h"
|
2006-01-23 03:27:34 +00:00
|
|
|
#elif defined(__WXGTK__)
|
|
|
|
#include "wx/gtk1/scrolbar.h"
|
1998-08-15 00:23:28 +00:00
|
|
|
#elif defined(__WXMAC__)
|
2008-06-11 19:17:41 +00:00
|
|
|
#include "wx/osx/scrolbar.h"
|
2014-08-24 01:50:11 +00:00
|
|
|
#elif defined(__WXQT__)
|
|
|
|
#include "wx/qt/scrolbar.h"
|
1998-05-20 14:01:55 +00:00
|
|
|
#endif
|
|
|
|
|
2001-06-26 20:59:19 +00:00
|
|
|
#endif // wxUSE_SCROLLBAR
|
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
#endif
|
1998-08-15 00:23:28 +00:00
|
|
|
// _WX_SCROLBAR_H_BASE_
|