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:
@@ -18,52 +18,68 @@ WXDLLEXPORT_DATA(extern const char*) wxGaugeNameStr;
|
||||
|
||||
class WXDLLEXPORT wxGauge: public wxControl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxGauge)
|
||||
public:
|
||||
inline wxGauge() { m_rangeMax = 0; m_gaugePos = 0; }
|
||||
public:
|
||||
inline wxGauge() { m_nRangeMax = 0; m_nGaugePos = 0; }
|
||||
|
||||
inline wxGauge(wxWindow *parent, wxWindowID id,
|
||||
int range,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxGA_HORIZONTAL,
|
||||
inline wxGauge( wxWindow* pParent
|
||||
,wxWindowID vId
|
||||
,int nRange
|
||||
,const wxPoint& rPos = wxDefaultPosition
|
||||
,const wxSize& rSize = wxDefaultSize
|
||||
,long lStyle = wxGA_HORIZONTAL
|
||||
#if wxUSE_VALIDATORS
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
,const wxValidator& rValidator = wxDefaultValidator
|
||||
#endif
|
||||
const wxString& name = wxGaugeNameStr)
|
||||
{
|
||||
Create(parent, id, range, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
int range,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxGA_HORIZONTAL,
|
||||
,const wxString& rsName = wxGaugeNameStr
|
||||
)
|
||||
{
|
||||
Create( pParent
|
||||
,vId
|
||||
,nRange
|
||||
,rPos
|
||||
,rSize
|
||||
,lStyle
|
||||
#if wxUSE_VALIDATORS
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
,rValidator
|
||||
#endif
|
||||
const wxString& name = wxGaugeNameStr);
|
||||
|
||||
void SetShadowWidth(int w);
|
||||
void SetBezelFace(int w);
|
||||
void SetRange(int r);
|
||||
void SetValue(int pos);
|
||||
|
||||
int GetShadowWidth() const ;
|
||||
int GetBezelFace() const ;
|
||||
int GetRange() const ;
|
||||
int GetValue() const ;
|
||||
|
||||
bool SetForegroundColour(const wxColour& col);
|
||||
bool SetBackgroundColour(const wxColour& col);
|
||||
|
||||
virtual void Command(wxCommandEvent& WXUNUSED(event)) {} ;
|
||||
|
||||
protected:
|
||||
int m_rangeMax;
|
||||
int m_gaugePos;
|
||||
};
|
||||
,rsName
|
||||
);
|
||||
}
|
||||
|
||||
bool Create( wxWindow* pParent
|
||||
,wxWindowID vId
|
||||
,int nRange
|
||||
,const wxPoint& rPos = wxDefaultPosition
|
||||
,const wxSize& rSize = wxDefaultSize
|
||||
,long lStyle = wxGA_HORIZONTAL
|
||||
#if wxUSE_VALIDATORS
|
||||
,const wxValidator& rValidator = wxDefaultValidator
|
||||
#endif
|
||||
// _WX_GAUGE_H_
|
||||
,const wxString& rsName = wxGaugeNameStr
|
||||
);
|
||||
|
||||
int GetShadowWidth(void) const;
|
||||
int GetBezelFace(void) const;
|
||||
int GetRange(void) const;
|
||||
int GetValue(void) const;
|
||||
|
||||
bool SetBackgroundColour(const wxColour& rColour);
|
||||
void SetBezelFace(int nWidth);
|
||||
bool SetForegroundColour(const wxColour& rColour);
|
||||
void SetRange(int nRange);
|
||||
void SetShadowWidth(int nWidth);
|
||||
void SetValue(int nPos);
|
||||
|
||||
inline virtual bool AcceptsFocus(void) const { return FALSE; }
|
||||
inline virtual void Command(wxCommandEvent& WXUNUSED(rEvent)) {};
|
||||
|
||||
protected:
|
||||
int m_nRangeMax;
|
||||
int m_nGaugePos;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxGauge)
|
||||
}; // end of CLASS wxGauge
|
||||
|
||||
#endif // _WX_GAUGE_H_
|
||||
|
||||
|
@@ -232,6 +232,10 @@ inline bool wxStyleHasBorder(long style)
|
||||
wxSUNKEN_BORDER | wxDOUBLE_BORDER)) != 0;
|
||||
}
|
||||
|
||||
WXDLLEXPORT extern void wxOS2SetFont( HWND hWnd
|
||||
,const wxFont& rFont
|
||||
);
|
||||
|
||||
|
||||
#endif
|
||||
// _WX_PRIVATE_H_
|
||||
|
@@ -19,105 +19,168 @@ class WXDLLEXPORT wxBitmap ;
|
||||
|
||||
class WXDLLEXPORT wxRadioBox: public wxControl, public wxRadioBoxBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxRadioBox)
|
||||
public:
|
||||
wxRadioBox();
|
||||
wxRadioBox();
|
||||
|
||||
inline wxRadioBox(wxWindow *parent, wxWindowID id, const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
int n = 0, const wxString choices[] = NULL,
|
||||
int majorDim = 0, long style = wxRA_HORIZONTAL,
|
||||
inline wxRadioBox( wxWindow* pParent
|
||||
,wxWindowID vId
|
||||
,const wxString& rsTitle
|
||||
,const wxPoint& rPos = wxDefaultPosition
|
||||
,const wxSize& rSize = wxDefaultSize
|
||||
,int nNum = 0
|
||||
,const wxString asChoices[] = NULL
|
||||
,int nMajorDim = 0
|
||||
,long lStyle = wxRA_HORIZONTAL
|
||||
#if wxUSE_VALIDATORS
|
||||
const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr)
|
||||
,const wxValidator& rVal = wxDefaultValidator
|
||||
#endif
|
||||
{
|
||||
Create(parent, id, title, pos, size, n, choices, majorDim, style, val, name);
|
||||
}
|
||||
|
||||
~wxRadioBox();
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id, const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
int n = 0, const wxString choices[] = NULL,
|
||||
int majorDim = 0, long style = wxRA_HORIZONTAL,
|
||||
,const wxString& rsName = wxRadioBoxNameStr
|
||||
)
|
||||
{
|
||||
Create( pParent
|
||||
,vId
|
||||
,rsTitle
|
||||
,rPos
|
||||
,rSize
|
||||
,nNum
|
||||
,asChoices
|
||||
,nMajorDim
|
||||
,lStyle
|
||||
#if wxUSE_VALIDATORS
|
||||
const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr);
|
||||
,rVal
|
||||
#endif
|
||||
,rsName
|
||||
);
|
||||
}
|
||||
|
||||
virtual bool OS2Command(WXUINT param, WXWORD id);
|
||||
virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
|
||||
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||
~wxRadioBox();
|
||||
|
||||
int FindString(const wxString& s) const;
|
||||
void SetSelection(int N);
|
||||
int GetSelection() const;
|
||||
virtual int GetCount() const;
|
||||
wxString GetString(int N) const;
|
||||
virtual void SetString(int n, const wxString& label);
|
||||
virtual int GetColumnCount() const;
|
||||
virtual int GetRowCount() const;
|
||||
bool Create( wxWindow* pParent
|
||||
,wxWindowID vId
|
||||
,const wxString& rsTitle
|
||||
,const wxPoint& rPos = wxDefaultPosition
|
||||
,const wxSize& rSize = wxDefaultSize
|
||||
,int nNum = 0
|
||||
,const wxString asChoices[] = NULL
|
||||
,int nMajorDim = 0
|
||||
,long lStyle = wxRA_HORIZONTAL
|
||||
#if wxUSE_VALIDATORS
|
||||
,const wxValidator& rVal = wxDefaultValidator
|
||||
#endif
|
||||
,const wxString& rsName = wxRadioBoxNameStr
|
||||
);
|
||||
|
||||
void GetSize(int *x, int *y) const;
|
||||
void GetPosition(int *x, int *y) const;
|
||||
void Command(wxCommandEvent& rEvent);
|
||||
bool ContainsHWND(WXHWND hWnd) const;
|
||||
bool Enable(bool bEnable);
|
||||
void Enable( int nItem
|
||||
,bool bEnable
|
||||
);
|
||||
int FindString(const wxString& sStr) const;
|
||||
|
||||
void SetLabel(int item, const wxString& label);
|
||||
void SetLabel(int item, wxBitmap *bitmap);
|
||||
wxString GetLabel(int item) const;
|
||||
bool Show(bool show);
|
||||
void SetFocus();
|
||||
bool Enable(bool enable);
|
||||
void Enable(int item, bool enable);
|
||||
void Show(int item, bool show) ;
|
||||
inline void SetLabelFont(const wxFont& WXUNUSED(font)) {};
|
||||
inline void SetButtonFont(const wxFont& font) { SetFont(font); }
|
||||
virtual WXHBRUSH OnCtlColor( WXHDC hDC
|
||||
,WXHWND hWnd
|
||||
,WXUINT uCtlColor
|
||||
,WXUINT uMessage
|
||||
,WXWPARAM wParam
|
||||
,WXLPARAM lParam
|
||||
);
|
||||
virtual bool OS2Command( WXUINT uParam
|
||||
,WXWORD wId
|
||||
);
|
||||
void SendNotificationEvent(void);
|
||||
void Show( int nItem
|
||||
,bool bShow = TRUE
|
||||
) ;
|
||||
bool Show(bool bShow);
|
||||
MRESULT WindowProc( WXUINT uMsg
|
||||
,WXWPARAM wParam
|
||||
,WXLPARAM lParam
|
||||
);
|
||||
|
||||
virtual wxString GetStringSelection() const;
|
||||
virtual bool SetStringSelection(const wxString& s);
|
||||
inline virtual int Number() const { return m_noItems; } ;
|
||||
void Command(wxCommandEvent& event);
|
||||
|
||||
inline int GetNumberOfRowsOrCols() const { return m_noRowsOrCols; }
|
||||
inline void SetNumberOfRowsOrCols(int n) { m_noRowsOrCols = n; }
|
||||
|
||||
// implementation only from now on
|
||||
// -------------------------------
|
||||
|
||||
WXHWND *GetRadioButtons() const { return m_radioButtons; }
|
||||
bool ContainsHWND(WXHWND hWnd) const;
|
||||
void SendNotificationEvent();
|
||||
virtual int GetColumnCount(void) const;
|
||||
virtual int GetCount(void) const;
|
||||
inline int GetNumberOfRowsOrCols(void) const { return m_nNoRowsOrCols; }
|
||||
int GetNumHor(void) const;
|
||||
int GetNumVer(void) const;
|
||||
void GetPosition( int* pnX
|
||||
,int* pnY
|
||||
) const;
|
||||
inline WXHWND* GetRadioButtons(void) const { return m_ahRadioButtons; }
|
||||
virtual int GetRowCount(void) const;
|
||||
int GetSelection(void) const;
|
||||
void GetSize( int* pnX
|
||||
,int* pnY
|
||||
) const;
|
||||
void GetSizeFlags(void) const;
|
||||
void AdjustButtons( int nX
|
||||
,int nY
|
||||
,int nWidth
|
||||
,int nHeight
|
||||
,int lSizeFlags
|
||||
);
|
||||
wxString GetString(int nIndex) const;
|
||||
virtual wxString GetStringSelection(void) const;
|
||||
|
||||
// get the number of buttons per column/row
|
||||
int GetNumVer() const;
|
||||
int GetNumHor() const;
|
||||
inline void SetButtonFont(const wxFont& rFont) { SetFont(rFont); }
|
||||
void SetFocus(void);
|
||||
virtual bool SetFont(const wxFont& rFont);
|
||||
inline void SetLabelFont(const wxFont& WXUNUSED(font)) {};
|
||||
inline void SetNumberOfRowsOrCols(int nNum) { m_nNoRowsOrCols = nNum; }
|
||||
void SetSelection(int nIndex);
|
||||
virtual void SetString( int nNum
|
||||
,const wxString& rsLabel
|
||||
);
|
||||
virtual bool SetStringSelection(const wxString& rsStr);
|
||||
|
||||
void SetLabel( int nItem
|
||||
,const wxString& rsLabel
|
||||
);
|
||||
void SetLabel( int item
|
||||
,wxBitmap* pBitmap
|
||||
);
|
||||
wxString GetLabel(int nItem) const;
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
wxRadioBox(wxWindow *parent, wxFunction func, const char *title,
|
||||
int x = -1, int y = -1, int width = -1, int height = -1,
|
||||
int n = 0, char **choices = NULL,
|
||||
int majorDim = 0, long style = wxRA_HORIZONTAL, const char *name = wxRadioBoxNameStr);
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
|
||||
protected:
|
||||
void SubclassRadioButton(WXHWND hWndBtn);
|
||||
void AdjustButtons( int nX
|
||||
,int nY
|
||||
,int nWidth
|
||||
,int nHeight
|
||||
,long lSizeFlags
|
||||
);
|
||||
virtual wxSize DoGetBestSize(void) const;
|
||||
virtual void DoSetSize( int nX
|
||||
,int nY
|
||||
,int nWidth
|
||||
,int nHeight
|
||||
,int nSizeFlags = wxSIZE_AUTO
|
||||
);
|
||||
wxSize GetMaxButtonSize(void) const;
|
||||
wxSize GetTotalButtonSize(const wxSize& rSizeBtn) const;
|
||||
void SubclassRadioButton(WXHWND hWndBtn);
|
||||
|
||||
WXHWND * m_radioButtons;
|
||||
int m_majorDim ;
|
||||
int * m_radioWidth; // for bitmaps
|
||||
int * m_radioHeight;
|
||||
|
||||
int m_noItems;
|
||||
int m_noRowsOrCols;
|
||||
int m_selectedButton;
|
||||
WXHWND* m_ahRadioButtons;
|
||||
int m_nMajorDim ;
|
||||
int* m_pnRadioWidth; // for bitmaps
|
||||
int* m_pnRadioHeight;
|
||||
int m_nNoItems;
|
||||
int m_nNoRowsOrCols;
|
||||
int m_nSelectedButton;
|
||||
int m_nSizeFlags;
|
||||
|
||||
virtual void DoSetSize(int x, int y,
|
||||
int width, int height,
|
||||
int sizeFlags = wxSIZE_AUTO);
|
||||
private:
|
||||
virtual void SetLabel(const wxString& label)
|
||||
{ wxWindowBase::SetLabel(label); }
|
||||
wxString GetLabel() const
|
||||
{ return(wxWindowBase::GetLabel()); }
|
||||
};
|
||||
inline wxString GetLabel() const
|
||||
{ return wxWindowBase::GetLabel(); }
|
||||
inline void SetLabel(const wxString& rsLabel)
|
||||
{ wxWindowBase::SetLabel(rsLabel); }
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxRadioBox)
|
||||
}; // end of wxRadioBox
|
||||
|
||||
#endif
|
||||
// _WX_RADIOBOX_H_
|
||||
|
@@ -18,38 +18,55 @@ WXDLLEXPORT_DATA(extern const char*) wxRadioButtonNameStr;
|
||||
|
||||
class WXDLLEXPORT wxRadioButton: public wxControl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxRadioButton)
|
||||
protected:
|
||||
public:
|
||||
inline wxRadioButton() {}
|
||||
inline wxRadioButton(wxWindow *parent, wxWindowID id,
|
||||
const wxString& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, long style = 0,
|
||||
public:
|
||||
inline wxRadioButton() {}
|
||||
inline wxRadioButton( wxWindow* pParent
|
||||
,wxWindowID vId
|
||||
,const wxString& rsLabel
|
||||
,const wxPoint& rPos = wxDefaultPosition
|
||||
,const wxSize& rSize = wxDefaultSize
|
||||
,long lStyle = 0
|
||||
#if wxUSE_VALIDATORS
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
,const wxValidator& rValidator = wxDefaultValidator
|
||||
#endif
|
||||
const wxString& name = wxRadioButtonNameStr)
|
||||
{
|
||||
Create(parent, id, label, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
const wxString& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, long style = 0,
|
||||
,const wxString& rsName = wxRadioButtonNameStr
|
||||
)
|
||||
{
|
||||
Create( pParent
|
||||
,vId
|
||||
,rsLabel
|
||||
,rPos
|
||||
,rSize
|
||||
,lStyle
|
||||
#if wxUSE_VALIDATORS
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
,rValidator
|
||||
#endif
|
||||
const wxString& name = wxRadioButtonNameStr);
|
||||
,rsName
|
||||
);
|
||||
}
|
||||
|
||||
virtual void SetLabel(const wxString& label);
|
||||
virtual void SetValue(bool val);
|
||||
virtual bool GetValue() const ;
|
||||
bool Create( wxWindow* pParent
|
||||
,wxWindowID vId
|
||||
,const wxString& rsLabel
|
||||
,const wxPoint& rPos = wxDefaultPosition
|
||||
,const wxSize& rSize = wxDefaultSize
|
||||
,long lStyle = 0
|
||||
#if wxUSE_VALIDATORS
|
||||
,const wxValidator& rValidator = wxDefaultValidator
|
||||
#endif
|
||||
,const wxString& rsName = wxRadioButtonNameStr
|
||||
);
|
||||
virtual void SetLabel(const wxString& rsLabel);
|
||||
virtual void SetValue(bool bVal);
|
||||
virtual bool GetValue(void) const ;
|
||||
|
||||
bool OS2Command(WXUINT param, WXWORD id);
|
||||
void Command(wxCommandEvent& event);
|
||||
};
|
||||
bool OS2Command( WXUINT wParam
|
||||
,WXWORD wId
|
||||
);
|
||||
void Command(wxCommandEvent& rEvent);
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxRadioButton)
|
||||
}; // end of wxRadioButton
|
||||
|
||||
#endif
|
||||
// _WX_RADIOBUT_H_
|
||||
|
@@ -376,5 +376,8 @@
|
||||
#define NO_TEXT_WINDOW_STREAM 1 // defined in textctrl.h for DLL builds
|
||||
#endif
|
||||
|
||||
#define wxUSE_UNICODE 0
|
||||
#define wxUSE_UNICODE_MSLU 0
|
||||
|
||||
#endif
|
||||
// _WX_SETUP_H_
|
||||
|
@@ -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_
|
||||
|
@@ -15,58 +15,66 @@
|
||||
#include "wx/control.h"
|
||||
#include "wx/event.h"
|
||||
|
||||
extern MRESULT EXPENTRY wxSpinCtrlWndProc(
|
||||
HWND hWnd
|
||||
, UINT uMessage
|
||||
, MPARAM wParam
|
||||
, MPARAM lParam
|
||||
);
|
||||
|
||||
class WXDLLEXPORT wxSpinButton: public wxSpinButtonBase
|
||||
{
|
||||
public:
|
||||
// Construction
|
||||
wxSpinButton() { }
|
||||
|
||||
inline wxSpinButton( wxWindow *parent
|
||||
,wxWindowID id = -1
|
||||
,const wxPoint& pos = wxDefaultPosition
|
||||
,const wxSize& size = wxDefaultSize
|
||||
,long style = wxSP_VERTICAL
|
||||
,const wxString& name = "wxSpinButton"
|
||||
inline wxSpinButton( wxWindow* pParent
|
||||
,wxWindowID vId = -1
|
||||
,const wxPoint& rPos = wxDefaultPosition
|
||||
,const wxSize& rSize = wxDefaultSize
|
||||
,long lStyle = wxSP_VERTICAL
|
||||
,const wxString& rsName = "wxSpinButton"
|
||||
)
|
||||
{
|
||||
Create(parent, id, pos, size, style, name);
|
||||
Create(pParent, vId, rPos, rSize, lStyle, rsName);
|
||||
}
|
||||
|
||||
virtual ~wxSpinButton();
|
||||
|
||||
bool Create( wxWindow *parent
|
||||
,wxWindowID id = -1
|
||||
,const wxPoint& pos = wxDefaultPosition
|
||||
,const wxSize& size = wxDefaultSize
|
||||
,long style = wxSP_VERTICAL
|
||||
,const wxString& name = "wxSpinButton"
|
||||
|
||||
bool Create( wxWindow* pParent
|
||||
,wxWindowID vId = -1
|
||||
,const wxPoint& rPos = wxDefaultPosition
|
||||
,const wxSize& rSize = wxDefaultSize
|
||||
,long lStyle = wxSP_VERTICAL
|
||||
,const wxString& rsName = "wxSpinButton"
|
||||
);
|
||||
|
||||
// Accessors
|
||||
virtual int GetValue() const ;
|
||||
virtual void SetValue(int val) ;
|
||||
virtual void SetRange( int minVal
|
||||
,int maxVal
|
||||
);
|
||||
inline virtual int GetMax(void) const { return m_max; }
|
||||
inline virtual int GetMin(void) const { return m_min; }
|
||||
virtual int GetValue(void) const;
|
||||
inline bool IsVertical(void) const {return ((m_windowStyle & wxSP_VERTICAL) != 0); }
|
||||
virtual void SetValue(int nVal);
|
||||
virtual void SetRange( int nMinVal
|
||||
,int nMaxVal
|
||||
);
|
||||
|
||||
//
|
||||
// Implementation
|
||||
virtual bool OS2Command( WXUINT param
|
||||
,WXWORD id
|
||||
//
|
||||
virtual bool OS2Command( WXUINT wParam
|
||||
,WXWORD wId
|
||||
);
|
||||
virtual bool OS2OnNotify( int idCtrl
|
||||
,WXLPARAM lParam
|
||||
,WXLPARAM* result
|
||||
);
|
||||
virtual bool OS2OnScroll( int orientation
|
||||
virtual bool OS2OnScroll( int nOrientation
|
||||
,WXWORD wParam
|
||||
,WXWORD pos
|
||||
,WXHWND control
|
||||
,WXWORD wPos
|
||||
,WXHWND hControl
|
||||
);
|
||||
|
||||
inline virtual bool AcceptsFocus(void) const { return FALSE; }
|
||||
protected:
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxSpinButton)
|
||||
};
|
||||
#endif
|
||||
// _WX_SPINBUTT_H_
|
||||
}; // end of CLASS wxSpinButton
|
||||
|
||||
#endif // _WX_SPINBUTT_H_
|
||||
|
@@ -13,6 +13,9 @@
|
||||
#define _WX_MSW_SPINCTRL_H_
|
||||
|
||||
#include "wx/spinbutt.h" // the base class
|
||||
#include "wx/dynarray.h"
|
||||
class WXDLLEXPORT wxSpinCtrl;
|
||||
WX_DEFINE_EXPORTED_ARRAY(wxSpinCtrl *, wxArraySpins);
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Under Win32 and OS2 PM, wxSpinCtrl is a wxSpinButton with a buddy
|
||||
@@ -24,55 +27,99 @@ class WXDLLEXPORT wxSpinCtrl : public wxSpinButton
|
||||
{
|
||||
public:
|
||||
wxSpinCtrl() { }
|
||||
|
||||
wxSpinCtrl(wxWindow *parent,
|
||||
wxWindowID id = -1,
|
||||
const wxString& value = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxSP_ARROW_KEYS,
|
||||
int min = 0, int max = 100, int initial = 0,
|
||||
const wxString& name = _T("wxSpinCtrl"))
|
||||
wxSpinCtrl( wxWindow* pParent
|
||||
,wxWindowID vId = -1
|
||||
,const wxString& rsValue = wxEmptyString
|
||||
,const wxPoint& rPos = wxDefaultPosition
|
||||
,const wxSize& rSize = wxDefaultSize
|
||||
,long lStyle = wxSP_ARROW_KEYS
|
||||
,int nMin = 0
|
||||
,int nMax = 100
|
||||
,int nInitial = 0
|
||||
,const wxString& rsName = _T("wxSpinCtrl")
|
||||
)
|
||||
{
|
||||
Create(parent, id, value, pos, size, style, min, max, initial, name);
|
||||
Create(pParent, vId, rsValue, rPos, rSize, lStyle, nMin, nMax, nInitial, rsName);
|
||||
}
|
||||
virtual ~wxSpinCtrl();
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id = -1,
|
||||
const wxString& value = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxSP_ARROW_KEYS,
|
||||
int min = 0, int max = 100, int initial = 0,
|
||||
const wxString& name = _T("wxSpinCtrl"));
|
||||
bool Create(wxWindow* pParent
|
||||
,wxWindowID vId = -1
|
||||
,const wxString& rsValue = wxEmptyString
|
||||
,const wxPoint& rPos = wxDefaultPosition
|
||||
,const wxSize& rSize = wxDefaultSize
|
||||
,long lStyle = wxSP_ARROW_KEYS
|
||||
,int nMin = 0
|
||||
,int nMax = 100
|
||||
,int nInitial = 0
|
||||
,const wxString& rsName = _T("wxSpinCtrl")
|
||||
);
|
||||
|
||||
// a wxTextCtrl-like method (but we can't have GetValue returning wxString
|
||||
//
|
||||
// A wxTextCtrl-like method (but we can't have GetValue returning wxString
|
||||
// because the base class already has one returning int!)
|
||||
void SetValue(const wxString& text);
|
||||
//
|
||||
void SetValue(const wxString& rsText);
|
||||
|
||||
//
|
||||
// implementation only from now on
|
||||
// -------------------------------
|
||||
//
|
||||
virtual bool Enable(bool bEnable = TRUE);
|
||||
|
||||
virtual void SetValue(int val) { wxSpinButton::SetValue(val); }
|
||||
virtual int GetValue() const;
|
||||
virtual bool SetFont(const wxFont &font);
|
||||
virtual int GetValue(void) const;
|
||||
|
||||
virtual bool SetFont(const wxFont &rFont);
|
||||
virtual void SetFocus(void);
|
||||
inline virtual void SetValue(int nVal) { wxSpinButton::SetValue(nVal); }
|
||||
|
||||
virtual bool Show(bool bShow = TRUE);
|
||||
|
||||
//
|
||||
// wxSpinButton doesn't accept focus, but we do
|
||||
//
|
||||
inline virtual bool AcceptsFocus(void) const { return FALSE; }
|
||||
|
||||
//
|
||||
// Return the spinctrl object whose buddy is the given window or NULL
|
||||
// Doesn't really do much under OS/2
|
||||
//
|
||||
static wxSpinCtrl* GetSpinForTextCtrl(WXHWND hWndBuddy);
|
||||
|
||||
//
|
||||
// Process a WM_COMMAND generated by the buddy text control
|
||||
//
|
||||
bool ProcessTextCommand( WXWORD wCmd
|
||||
,WXWORD wId
|
||||
);
|
||||
|
||||
virtual bool Enable(bool enable = TRUE);
|
||||
virtual bool Show(bool show = TRUE);
|
||||
protected:
|
||||
void DoMoveWindow(int x, int y, int width, int height);
|
||||
virtual void DoGetPosition( int* nlX
|
||||
,int* nlY
|
||||
) const;
|
||||
void DoMoveWindow( int nX
|
||||
,int nY
|
||||
,int nWidth
|
||||
,int nHeight
|
||||
);
|
||||
virtual wxSize DoGetBestSize(void) const;
|
||||
virtual void DoGetSize( int* pnWidth
|
||||
,int* pnHeight
|
||||
) const;
|
||||
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
//
|
||||
// The handler for wxSpinButton events
|
||||
//
|
||||
void OnSpinChange(wxSpinEvent& rEvent);
|
||||
void OnChar(wxKeyEvent& rEvent);
|
||||
|
||||
// the handler for wxSpinButton events
|
||||
void OnSpinChange(wxSpinEvent& event);
|
||||
|
||||
WXHWND m_hwndBuddy;
|
||||
WXHWND m_hWndBuddy;
|
||||
static wxArraySpins m_svAllSpins;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxSpinCtrl)
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
}; // end of CLASS wxSpinCtrl
|
||||
|
||||
#endif // _WX_MSW_SPINCTRL_H_
|
||||
|
||||
|
@@ -60,6 +60,10 @@ class WXDLLEXPORT wxStaticBitmap : public wxStaticBitmapBase
|
||||
|
||||
// overriden base class virtuals
|
||||
virtual bool AcceptsFocus() const { return FALSE; }
|
||||
virtual MRESULT OS2WindowProc( WXUINT uMsg
|
||||
,WXWPARAM wParam
|
||||
,WXLPARAM lParam
|
||||
);
|
||||
|
||||
protected:
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
@@ -77,7 +81,7 @@ protected:
|
||||
wxGDIImage* m_pImage;
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxStaticBitmap)
|
||||
};
|
||||
}; // end of wxStaticBitmap
|
||||
|
||||
#endif
|
||||
// _WX_STATBMP_H_
|
||||
|
@@ -19,50 +19,49 @@ WXDLLEXPORT_DATA(extern const char*) wxStaticBoxNameStr;
|
||||
// Group box
|
||||
class WXDLLEXPORT wxStaticBox : public wxStaticBoxBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxStaticBox)
|
||||
|
||||
public:
|
||||
public:
|
||||
inline wxStaticBox() {}
|
||||
inline wxStaticBox( wxWindow* parent
|
||||
,wxWindowID id
|
||||
,const wxString& label
|
||||
,const wxPoint& pos = wxDefaultPosition
|
||||
,const wxSize& size = wxDefaultSize
|
||||
,long style = 0
|
||||
,const wxString& name = wxStaticBoxNameStr
|
||||
inline wxStaticBox( wxWindow* pParent
|
||||
,wxWindowID vId
|
||||
,const wxString& rsLabel
|
||||
,const wxPoint& rPos = wxDefaultPosition
|
||||
,const wxSize& rSize = wxDefaultSize
|
||||
,long lStyle = 0
|
||||
,const wxString& rsName = wxStaticBoxNameStr
|
||||
)
|
||||
{
|
||||
Create(parent, id, label, pos, size, style, name);
|
||||
Create(pParent, vId, rsLabel, rPos, rSize, lStyle, rsName);
|
||||
}
|
||||
|
||||
bool Create( wxWindow* parent
|
||||
,wxWindowID id
|
||||
,const wxString& label
|
||||
,const wxPoint& pos = wxDefaultPosition
|
||||
,const wxSize& size = wxDefaultSize
|
||||
,long style = 0
|
||||
,const wxString& name = wxStaticBoxNameStr
|
||||
);
|
||||
bool Create( wxWindow* pParent
|
||||
,wxWindowID vId
|
||||
,const wxString& rsLabel
|
||||
,const wxPoint& rPos = wxDefaultPosition
|
||||
,const wxSize& rSize = wxDefaultSize
|
||||
,long lStyle = 0
|
||||
,const wxString& rsName = wxStaticBoxNameStr
|
||||
);
|
||||
|
||||
//
|
||||
// implementation from now on
|
||||
// --------------------------
|
||||
//
|
||||
virtual MRESULT OS2WindowProc( WXUINT uMsg
|
||||
,WXWPARAM wParam
|
||||
,WXLPARAM lParam
|
||||
);
|
||||
|
||||
void OnEraseBackground(wxEraseEvent& event);
|
||||
|
||||
virtual MRESULT OS2WindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
|
||||
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
//
|
||||
// overriden base class virtuals
|
||||
virtual bool AcceptsFocus() const { return FALSE; }
|
||||
//
|
||||
inline virtual bool AcceptsFocus(void) const { return FALSE; }
|
||||
|
||||
protected:
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
virtual wxSize DoGetBestSize(void) const;
|
||||
|
||||
private:
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
DECLARE_DYNAMIC_CLASS(wxStaticBox)
|
||||
}; // end of CLASS wxStaticBox
|
||||
|
||||
#endif
|
||||
// _WX_STATBOX_H_
|
||||
|
@@ -21,29 +21,62 @@
|
||||
|
||||
class WXDLLEXPORT wxStaticLine : public wxStaticLineBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxStaticLine)
|
||||
|
||||
public:
|
||||
// constructors and pseudo-constructors
|
||||
wxStaticLine() { }
|
||||
|
||||
wxStaticLine( wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint &pos = wxDefaultPosition,
|
||||
const wxSize &size = wxDefaultSize,
|
||||
long style = wxLI_HORIZONTAL,
|
||||
const wxString &name = wxStaticTextNameStr )
|
||||
wxStaticLine( wxWindow* pParent
|
||||
,wxWindowID vId
|
||||
,const wxPoint& rPos = wxDefaultPosition
|
||||
,const wxSize& rSize = wxDefaultSize
|
||||
,long lStyle = wxLI_HORIZONTAL
|
||||
,const wxString& rsName = wxStaticTextNameStr
|
||||
)
|
||||
{
|
||||
Create(parent, id, pos, size, style, name);
|
||||
Create(pParent, vId, rPos, rSize, lStyle, rsName);
|
||||
}
|
||||
|
||||
bool Create( wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint &pos = wxDefaultPosition,
|
||||
const wxSize &size = wxDefaultSize,
|
||||
long style = wxLI_HORIZONTAL,
|
||||
const wxString &name = wxStaticTextNameStr );
|
||||
};
|
||||
bool Create( wxWindow* pParent
|
||||
,wxWindowID vId
|
||||
,const wxPoint& rPos = wxDefaultPosition
|
||||
,const wxSize& rSize = wxDefaultSize
|
||||
,long lStyle = wxLI_HORIZONTAL
|
||||
,const wxString& rsName = wxStaticTextNameStr
|
||||
);
|
||||
|
||||
inline bool IsVertical(void) const { return((GetWindowStyleFlag() & wxLI_VERTICAL) != 0); }
|
||||
inline static int GetDefaultSize(void) { return 2; }
|
||||
|
||||
//
|
||||
// Overriden base class virtuals
|
||||
//
|
||||
inline virtual bool AcceptsFocus(void) const {return FALSE;}
|
||||
|
||||
protected:
|
||||
inline wxSize AdjustSize(const wxSize& rSize) const
|
||||
{
|
||||
wxSize vSizeReal( rSize.x
|
||||
,rSize.y
|
||||
);
|
||||
|
||||
if (IsVertical())
|
||||
{
|
||||
if (rSize.x == -1 )
|
||||
vSizeReal.x = GetDefaultSize();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (rSize.y == -1)
|
||||
vSizeReal.y = GetDefaultSize();
|
||||
}
|
||||
return vSizeReal;
|
||||
}
|
||||
|
||||
inline wxSize DoGetBestSize(void) const { return (AdjustSize(wxDefaultSize)); }
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxStaticLine)
|
||||
}; // end of CLASS wxStaticLine
|
||||
|
||||
#endif // _WX_OS2_STATLINE_H_
|
||||
|
||||
|
@@ -22,11 +22,8 @@ WXDLLEXPORT_DATA(extern const char*) wxStaticTextNameStr;
|
||||
|
||||
class WXDLLEXPORT wxStaticText : public wxControl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxStaticText)
|
||||
|
||||
public:
|
||||
public:
|
||||
inline wxStaticText() { }
|
||||
|
||||
inline wxStaticText( wxWindow* pParent
|
||||
,wxWindowID vId
|
||||
,const wxString& rsLabel
|
||||
@@ -69,6 +66,9 @@ class WXDLLEXPORT wxStaticText : public wxControl
|
||||
|
||||
protected:
|
||||
virtual wxSize DoGetBestSize(void) const;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxStaticText)
|
||||
}; // end of CLASS wxStaticText
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user