2004-10-19 09:40:30 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2005-03-08 05:44:38 -05:00
|
|
|
// Name: wx/palmos/slider.h
|
2004-10-19 09:40:30 -04:00
|
|
|
// Purpose: wxSlider class
|
2005-01-18 16:14:27 -05:00
|
|
|
// Author: William Osborne - minimal working wxPalmOS port
|
2005-01-25 01:55:10 -05:00
|
|
|
// Modified by: Wlodzimierz ABX Skiba - native implementation
|
2004-10-19 09:40:30 -04:00
|
|
|
// Created: 10/13/04
|
2005-01-18 16:14:27 -05:00
|
|
|
// RCS-ID: $Id$
|
2005-01-25 01:55:10 -05:00
|
|
|
// Copyright: (c) William Osborne, Wlodzimierz Skiba
|
2004-10-19 09:40:30 -04:00
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2005-03-08 05:44:38 -05:00
|
|
|
#ifndef _SLIDERPALM_H_
|
|
|
|
#define _SLIDERPALM_H_
|
2004-10-19 09:40:30 -04:00
|
|
|
|
|
|
|
// Slider
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxSlider : public wxSliderBase
|
2004-10-19 09:40:30 -04:00
|
|
|
{
|
|
|
|
public:
|
2005-02-07 10:20:01 -05:00
|
|
|
wxSlider()
|
|
|
|
{
|
|
|
|
Init();
|
|
|
|
}
|
2004-10-19 09:40:30 -04:00
|
|
|
|
|
|
|
wxSlider(wxWindow *parent, wxWindowID id,
|
|
|
|
int value, int minValue, int maxValue,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxSL_HORIZONTAL,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxSliderNameStr)
|
|
|
|
{
|
2005-02-07 10:20:01 -05:00
|
|
|
Init();
|
2004-10-19 09:40:30 -04:00
|
|
|
Create(parent, id, value, minValue, maxValue, pos, size, style, validator, name);
|
|
|
|
}
|
|
|
|
|
2006-09-05 16:47:48 -04:00
|
|
|
virtual ~wxSlider();
|
2004-10-19 09:40:30 -04:00
|
|
|
|
|
|
|
bool Create(wxWindow *parent, wxWindowID id,
|
|
|
|
int value, int minValue, int maxValue,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxSL_HORIZONTAL,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxSliderNameStr);
|
|
|
|
|
|
|
|
virtual int GetValue() const;
|
|
|
|
virtual void SetValue(int);
|
|
|
|
|
|
|
|
void SetRange(int minValue, int maxValue);
|
|
|
|
|
2005-01-25 01:55:10 -05:00
|
|
|
int GetMin() const;
|
|
|
|
int GetMax() const;
|
2004-10-19 09:40:30 -04:00
|
|
|
|
|
|
|
// For trackbars only
|
|
|
|
void SetTickFreq(int n, int pos);
|
2005-02-07 10:20:01 -05:00
|
|
|
int GetTickFreq() const;
|
2004-10-19 09:40:30 -04:00
|
|
|
void SetPageSize(int pageSize);
|
|
|
|
int GetPageSize() const;
|
|
|
|
void ClearSel();
|
|
|
|
void ClearTicks();
|
|
|
|
void SetLineSize(int lineSize);
|
|
|
|
int GetLineSize() const;
|
|
|
|
int GetSelEnd() const;
|
|
|
|
int GetSelStart() const;
|
|
|
|
void SetSelection(int minPos, int maxPos);
|
|
|
|
void SetThumbLength(int len);
|
|
|
|
int GetThumbLength() const;
|
|
|
|
void SetTick(int tickPos);
|
|
|
|
|
2005-01-25 01:55:10 -05:00
|
|
|
// implementation
|
2004-10-19 09:40:30 -04:00
|
|
|
void Command(wxCommandEvent& event);
|
|
|
|
|
2005-02-01 04:58:58 -05:00
|
|
|
// send a notification event, return true if processed
|
|
|
|
bool SendUpdatedEvent();
|
2005-07-01 15:36:58 -04:00
|
|
|
bool SendScrollEvent(WXEVENTPTR event);
|
2005-02-01 04:58:58 -05:00
|
|
|
|
2004-10-19 09:40:30 -04:00
|
|
|
protected:
|
2005-02-07 10:20:01 -05:00
|
|
|
|
2004-10-19 09:40:30 -04:00
|
|
|
virtual wxSize DoGetBestSize() const;
|
2005-01-18 16:14:27 -05:00
|
|
|
|
2005-02-07 10:20:01 -05:00
|
|
|
private:
|
|
|
|
|
|
|
|
void Init();
|
2005-02-14 05:49:02 -05:00
|
|
|
|
2005-02-08 04:38:08 -05:00
|
|
|
int m_oldPos; // needed for tracing thumb position during scrolling
|
|
|
|
int m_oldValue; // needed for comparing thumb position before and after scrolling
|
|
|
|
int m_lineSize; // imitate line size
|
2005-02-07 10:20:01 -05:00
|
|
|
|
2004-10-19 09:40:30 -04:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxSlider)
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
2005-03-08 05:44:38 -05:00
|
|
|
// _SLIDERPALM_H_
|