2004-10-19 13:40:30 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2005-03-08 10:44:38 +00:00
|
|
|
// Name: wx/palmos/slider.h
|
2004-10-19 13:40:30 +00:00
|
|
|
// Purpose: wxSlider class
|
2005-01-18 21:14:27 +00:00
|
|
|
// Author: William Osborne - minimal working wxPalmOS port
|
2005-01-25 06:55:10 +00:00
|
|
|
// Modified by: Wlodzimierz ABX Skiba - native implementation
|
2004-10-19 13:40:30 +00:00
|
|
|
// Created: 10/13/04
|
2005-01-18 21:14:27 +00:00
|
|
|
// RCS-ID: $Id$
|
2005-01-25 06:55:10 +00:00
|
|
|
// Copyright: (c) William Osborne, Wlodzimierz Skiba
|
2004-10-19 13:40:30 +00:00
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2005-03-08 10:44:38 +00:00
|
|
|
#ifndef _SLIDERPALM_H_
|
|
|
|
#define _SLIDERPALM_H_
|
2004-10-19 13:40:30 +00:00
|
|
|
|
|
|
|
// Slider
|
|
|
|
class WXDLLEXPORT wxSlider : public wxSliderBase
|
|
|
|
{
|
|
|
|
public:
|
2005-02-07 15:20:01 +00:00
|
|
|
wxSlider()
|
|
|
|
{
|
|
|
|
Init();
|
|
|
|
}
|
2004-10-19 13:40:30 +00: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 15:20:01 +00:00
|
|
|
Init();
|
2004-10-19 13:40:30 +00:00
|
|
|
Create(parent, id, value, minValue, maxValue, pos, size, style, validator, name);
|
|
|
|
}
|
|
|
|
|
2006-09-05 20:47:48 +00:00
|
|
|
virtual ~wxSlider();
|
2004-10-19 13:40:30 +00: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 06:55:10 +00:00
|
|
|
int GetMin() const;
|
|
|
|
int GetMax() const;
|
2004-10-19 13:40:30 +00:00
|
|
|
|
|
|
|
// For trackbars only
|
|
|
|
void SetTickFreq(int n, int pos);
|
2005-02-07 15:20:01 +00:00
|
|
|
int GetTickFreq() const;
|
2004-10-19 13:40:30 +00: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 06:55:10 +00:00
|
|
|
// implementation
|
2004-10-19 13:40:30 +00:00
|
|
|
void Command(wxCommandEvent& event);
|
|
|
|
|
2005-02-01 09:58:58 +00:00
|
|
|
// send a notification event, return true if processed
|
|
|
|
bool SendUpdatedEvent();
|
2005-07-01 19:36:58 +00:00
|
|
|
bool SendScrollEvent(WXEVENTPTR event);
|
2005-02-01 09:58:58 +00:00
|
|
|
|
2004-10-19 13:40:30 +00:00
|
|
|
protected:
|
2005-02-07 15:20:01 +00:00
|
|
|
|
2004-10-19 13:40:30 +00:00
|
|
|
virtual wxSize DoGetBestSize() const;
|
2005-01-18 21:14:27 +00:00
|
|
|
|
2005-02-07 15:20:01 +00:00
|
|
|
private:
|
|
|
|
|
|
|
|
void Init();
|
2005-02-14 10:49:02 +00:00
|
|
|
|
2005-02-08 09:38:08 +00: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 15:20:01 +00:00
|
|
|
|
2004-10-19 13:40:30 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxSlider)
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
2005-03-08 10:44:38 +00:00
|
|
|
// _SLIDERPALM_H_
|