1998-06-28 07:34:42 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: slidrmsw.h
|
|
|
|
// Purpose: wxSliderMSW class
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
|
|
|
// RCS-ID: $Id$
|
1998-08-07 19:52:45 -04:00
|
|
|
// Copyright: (c) Julian Smart
|
|
|
|
// Licence: wxWindows licence
|
1998-06-28 07:34:42 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _SLIDRMSW_H_
|
|
|
|
#define _SLIDRMSW_H_
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface "slidrmsw.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "wx/control.h"
|
|
|
|
|
|
|
|
WXDLLEXPORT_DATA(extern const char*) wxSliderNameStr;
|
|
|
|
|
|
|
|
// Slider
|
|
|
|
class WXDLLEXPORT wxSliderMSW: public wxControl
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxSliderMSW)
|
|
|
|
|
|
|
|
public:
|
|
|
|
wxSliderMSW(void);
|
|
|
|
|
1998-07-04 11:17:59 -04:00
|
|
|
inline wxSliderMSW(wxWindow *parent, wxWindowID id,
|
|
|
|
int value, int minValue, int maxValue,
|
1998-06-28 07:34:42 -04:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
1998-07-04 11:17:59 -04:00
|
|
|
long style = wxSL_HORIZONTAL,
|
1998-06-28 07:34:42 -04:00
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxSliderNameStr)
|
|
|
|
{
|
|
|
|
Create(parent, id, value, minValue, maxValue, pos, size, style, validator, name);
|
|
|
|
}
|
|
|
|
|
|
|
|
~wxSliderMSW(void);
|
|
|
|
|
1998-07-04 11:17:59 -04:00
|
|
|
bool Create(wxWindow *parent, wxWindowID id,
|
|
|
|
int value, int minValue, int maxValue,
|
1998-06-28 07:34:42 -04:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
1998-07-04 11:17:59 -04:00
|
|
|
long style = wxSL_HORIZONTAL,
|
1998-06-28 07:34:42 -04:00
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxSliderNameStr);
|
|
|
|
|
|
|
|
virtual int GetValue(void) const ;
|
1998-07-04 11:17:59 -04:00
|
|
|
virtual void SetValue(int);
|
1998-11-28 08:38:40 -05:00
|
|
|
|
1998-06-28 07:34:42 -04:00
|
|
|
void GetSize(int *x, int *y) const ;
|
1998-11-28 08:38:40 -05:00
|
|
|
wxSize GetSize() const { return wxWindow::GetSize(); }
|
|
|
|
|
1998-07-04 11:17:59 -04:00
|
|
|
void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
1998-11-28 08:38:40 -05:00
|
|
|
void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO)
|
|
|
|
{ wxWindow::SetSize(rect, sizeFlags); }
|
|
|
|
void SetSize(const wxSize& size) { wxWindow::SetSize(size); }
|
|
|
|
|
1998-06-28 07:34:42 -04:00
|
|
|
void GetPosition(int *x, int *y) const ;
|
1998-11-28 08:38:40 -05:00
|
|
|
wxPoint GetPosition() const { return wxWindow::GetPosition(); }
|
|
|
|
|
1998-07-04 11:17:59 -04:00
|
|
|
bool Show(bool show);
|
1998-06-28 07:34:42 -04:00
|
|
|
|
1998-07-04 11:17:59 -04:00
|
|
|
void SetRange(int minValue, int maxValue);
|
1998-06-28 07:34:42 -04:00
|
|
|
|
|
|
|
inline int GetMin(void) const { return m_rangeMin; }
|
|
|
|
inline int GetMax(void) const { return m_rangeMax; }
|
|
|
|
|
|
|
|
// For trackbars only
|
1998-07-04 11:17:59 -04:00
|
|
|
void SetTickFreq(int n, int pos);
|
1998-06-28 07:34:42 -04:00
|
|
|
inline int GetTickFreq(void) const { return m_tickFreq; }
|
1998-07-04 11:17:59 -04:00
|
|
|
void SetPageSize(int pageSize);
|
1998-06-28 07:34:42 -04:00
|
|
|
int GetPageSize(void) const ;
|
|
|
|
void ClearSel(void) ;
|
|
|
|
void ClearTicks(void) ;
|
1998-07-04 11:17:59 -04:00
|
|
|
void SetLineSize(int lineSize);
|
1998-06-28 07:34:42 -04:00
|
|
|
int GetLineSize(void) const ;
|
|
|
|
int GetSelEnd(void) const ;
|
|
|
|
int GetSelStart(void) const ;
|
1998-07-04 11:17:59 -04:00
|
|
|
void SetSelection(int minPos, int maxPos);
|
|
|
|
void SetThumbLength(int len) ;
|
1998-06-28 07:34:42 -04:00
|
|
|
int GetThumbLength(void) const ;
|
1998-07-04 11:17:59 -04:00
|
|
|
void SetTick(int tickPos) ;
|
1998-06-28 07:34:42 -04:00
|
|
|
|
|
|
|
// IMPLEMENTATION
|
|
|
|
inline WXHWND GetStaticMin() const { return m_staticMin; }
|
|
|
|
inline WXHWND GetStaticMax() const { return m_staticMax; }
|
|
|
|
inline WXHWND GetEditValue() const { return m_staticValue; }
|
|
|
|
virtual bool ContainsHWND(WXHWND hWnd) const;
|
|
|
|
|
|
|
|
void Command(wxCommandEvent& event);
|
1998-07-04 11:17:59 -04:00
|
|
|
virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
|
1998-06-28 07:34:42 -04:00
|
|
|
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
1998-07-04 11:17:59 -04:00
|
|
|
void MSWOnVScroll(WXWORD wParam, WXWORD pos, WXHWND control);
|
|
|
|
void MSWOnHScroll(WXWORD wParam, WXWORD pos, WXHWND control);
|
1998-06-28 07:34:42 -04:00
|
|
|
|
|
|
|
protected:
|
|
|
|
WXHWND m_staticMin;
|
|
|
|
WXHWND m_staticMax;
|
|
|
|
WXHWND m_staticValue;
|
|
|
|
int m_rangeMin;
|
|
|
|
int m_rangeMax;
|
|
|
|
int m_pageSize;
|
|
|
|
int m_lineSize;
|
|
|
|
int m_tickFreq;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
// _SLIDRMSW_H_
|