OS/2 common controls code

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13065 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Webster
2001-12-17 22:56:41 +00:00
parent 4c53d9ece2
commit 3c299c3ab6
24 changed files with 3714 additions and 3149 deletions

View File

@@ -19,95 +19,135 @@ WXDLLEXPORT_DATA(extern const char*) wxSliderNameStr;
// Slider
class WXDLLEXPORT wxSlider: public wxSliderBase
{
DECLARE_DYNAMIC_CLASS(wxSlider)
public:
wxSlider();
inline wxSlider(wxWindow *parent, wxWindowID id,
int value, int minValue, int maxValue,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxSL_HORIZONTAL,
inline wxSlider( wxWindow* pParent
,wxWindowID vId
,int nValue
,int nMinValue
,int nMaxValue
,const wxPoint& rPos = wxDefaultPosition
,const wxSize& rSize = wxDefaultSize
,long lStyle = wxSL_HORIZONTAL
#if wxUSE_VALIDATORS
const wxValidator& validator = wxDefaultValidator,
,const wxValidator& rValidator = wxDefaultValidator
#endif
const wxString& name = wxSliderNameStr)
{
Create(parent, id, value, minValue, maxValue, pos, size, style, validator, name);
}
~wxSlider();
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 wxString& rsName = wxSliderNameStr
)
{
Create( pParent
,vId
,nValue
,nMinValue
,nMaxValue
,rPos
,rSize
,lStyle
#if wxUSE_VALIDATORS
const wxValidator& validator = wxDefaultValidator,
,rValidator
#endif
const wxString& name = wxSliderNameStr);
,rsName
);
}
~wxSlider();
virtual int GetValue() const ;
virtual void SetValue(int);
bool Create( wxWindow* pParent
,wxWindowID vId
,int nValue
,int nMinValue
,int nMaxValue
,const wxPoint& rPos = wxDefaultPosition
,const wxSize& rSize = wxDefaultSize
,long lStyle = wxSL_HORIZONTAL
#if wxUSE_VALIDATORS
,const wxValidator& rValidator = wxDefaultValidator
#endif
,const wxString& rsName = wxSliderNameStr
);
void GetSize(int *x, int *y) const ;
void GetPosition(int *x, int *y) const ;
virtual int GetValue(void) const ;
virtual void SetValue(int);
bool Show(bool show);
void GetSize( int* pnX
,int* pnY
) const;
void GetPosition( int* pnX
,int* pnY
) const ;
bool Show(bool bShow);
void SetRange( int nMinValue
,int nMaxValue
);
void SetRange(int minValue, int maxValue);
inline int GetMin(void) const { return m_nRangeMin; }
inline int GetMax(void) const { return m_nRangeMax; }
inline int GetMin() const { return m_rangeMin; }
inline int GetMax() const { return m_rangeMax; }
//
// For trackbars only
//
void ClearSel(void);
void ClearTicks(void);
void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
int GetLineSize(void) const;
int GetPageSize(void) const ;
int GetSelEnd(void) const;
int GetSelStart(void) const;
inline int GetTickFreq(void) const { return m_nTickFreq; }
int GetThumbLength(void) const ;
void SetLineSize(int nLineSize);
void SetPageSize(int nPageSize);
void SetSelection( int nMinPos
,int nMaxPos
);
void SetThumbLength(int nLen) ;
void SetTick(int ntickPos) ;
void SetTickFreq( int n
,int nPos
);
//
// IMPLEMENTATION
//
inline WXHWND GetStaticMin(void) const { return m_hStaticMin; }
inline WXHWND GetStaticMax(void) const { return m_hStaticMax; }
inline WXHWND GetEditValue(void) const { return m_hStaticValue; }
virtual bool ContainsHWND(WXHWND hWnd) const;
void Command(wxCommandEvent& rEvent);
virtual WXHBRUSH OnCtlColor( WXHDC hDC
,WXHWND hWnd
,WXUINT uCtlColor
,WXUINT uMessage
,WXWPARAM wParam
,WXLPARAM lParam
);
virtual bool OS2OnScroll( int nOrientation
,WXWORD wParam
,WXWORD wPos
,WXHWND hControl
);
// For trackbars only
void SetTickFreq(int n, int pos);
inline int GetTickFreq() const { return m_tickFreq; }
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) ;
protected:
WXHWND m_hStaticMin;
WXHWND m_hStaticMax;
WXHWND m_hStaticValue;
int m_nRangeMin;
int m_nRangeMax;
int m_nPageSize;
int m_nLineSize;
int m_nTickFreq;
double m_dPixelToRange;
int m_nThumbLength;
// IMPLEMENTATION
WXHWND GetStaticMin() const { return m_staticMin; }
WXHWND GetStaticMax() const { return m_staticMax; }
WXHWND GetEditValue() const { return m_staticValue; }
virtual bool ContainsHWND(WXHWND hWnd) const;
void Command(wxCommandEvent& event);
virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
virtual bool OS2OnScroll(int orientation, WXWORD wParam,
WXWORD pos, WXHWND control);
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;
virtual void DoSetSize(int x, int y,
int width, int height,
int sizeFlags = wxSIZE_AUTO);
};
virtual void DoSetSize( int nX
,int nY
,int nWidth
,int nHeight
,int nSizeFlags = wxSIZE_AUTO
);
private:
DECLARE_DYNAMIC_CLASS(wxSlider)
}; // end of CLASS wxSlider
#endif
// _WX_SLIDER_H_