2005-03-16 11:18:31 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2011-03-19 20:14:35 -04:00
|
|
|
// Name: wx/scrolbar.h
|
2005-03-16 11:18:31 -05:00
|
|
|
// Purpose: wxScrollBar base header
|
2005-05-04 14:57:50 -04:00
|
|
|
// Author: Julian Smart
|
2005-03-16 11:18:31 -05:00
|
|
|
// Modified by:
|
|
|
|
// Created:
|
2005-05-04 14:57:50 -04:00
|
|
|
// Copyright: (c) Julian Smart
|
2005-03-16 11:18:31 -05:00
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-14 20:23:28 -04:00
|
|
|
#ifndef _WX_SCROLBAR_H_BASE_
|
|
|
|
#define _WX_SCROLBAR_H_BASE_
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2005-03-16 11:18:31 -05:00
|
|
|
#include "wx/defs.h"
|
|
|
|
|
2001-06-26 16:59:19 -04:00
|
|
|
#if wxUSE_SCROLLBAR
|
|
|
|
|
|
|
|
#include "wx/control.h"
|
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
extern WXDLLIMPEXP_DATA_CORE(const char) wxScrollBarNameStr[];
|
2001-06-26 16:59:19 -04:00
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxScrollBar: a scroll bar control
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxScrollBarBase : public wxControl
|
2001-06-26 16:59:19 -04:00
|
|
|
{
|
|
|
|
public:
|
2003-07-21 20:24:07 -04:00
|
|
|
wxScrollBarBase() { }
|
|
|
|
|
2011-01-16 09:09:07 -05:00
|
|
|
/*
|
|
|
|
Derived classes should provide the following method and ctor with the
|
|
|
|
same parameters:
|
|
|
|
|
2001-06-26 16:59:19 -04: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 09:09:07 -05:00
|
|
|
*/
|
2001-06-26 16:59:19 -04: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,
|
2004-09-22 10:38:52 -04:00
|
|
|
bool refresh = true) = 0;
|
2003-07-21 20:24:07 -04:00
|
|
|
|
2007-11-03 18:14:29 -04:00
|
|
|
// implementation-only
|
|
|
|
bool IsNeeded() const { return GetRange() > GetThumbSize(); }
|
|
|
|
|
2003-07-21 20:24:07 -04:00
|
|
|
private:
|
2009-02-08 06:45:59 -05:00
|
|
|
wxDECLARE_NO_COPY_CLASS(wxScrollBarBase);
|
2001-06-26 16:59:19 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#if defined(__WXUNIVERSAL__)
|
|
|
|
#include "wx/univ/scrolbar.h"
|
|
|
|
#elif defined(__WXMSW__)
|
|
|
|
#include "wx/msw/scrolbar.h"
|
1998-07-10 10:15:17 -04:00
|
|
|
#elif defined(__WXMOTIF__)
|
2001-06-26 16:59:19 -04:00
|
|
|
#include "wx/motif/scrolbar.h"
|
2006-01-22 22:27:34 -05:00
|
|
|
#elif defined(__WXGTK20__)
|
2001-06-26 16:59:19 -04:00
|
|
|
#include "wx/gtk/scrolbar.h"
|
2006-01-22 22:27:34 -05:00
|
|
|
#elif defined(__WXGTK__)
|
|
|
|
#include "wx/gtk1/scrolbar.h"
|
1998-08-14 20:23:28 -04:00
|
|
|
#elif defined(__WXMAC__)
|
2008-06-11 15:17:41 -04:00
|
|
|
#include "wx/osx/scrolbar.h"
|
2004-06-23 11:26:44 -04:00
|
|
|
#elif defined(__WXCOCOA__)
|
|
|
|
#include "wx/cocoa/scrolbar.h"
|
1999-07-27 23:38:12 -04:00
|
|
|
#elif defined(__WXPM__)
|
2001-06-26 16:59:19 -04:00
|
|
|
#include "wx/os2/scrolbar.h"
|
1998-05-20 10:01:55 -04:00
|
|
|
#endif
|
|
|
|
|
2001-06-26 16:59:19 -04:00
|
|
|
#endif // wxUSE_SCROLLBAR
|
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
#endif
|
1998-08-14 20:23:28 -04:00
|
|
|
// _WX_SCROLBAR_H_BASE_
|