no message
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4015 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
WXDLLEXPORT_DATA(extern const char*) wxChoiceNameStr;
|
WXDLLEXPORT_DATA(extern const char*) wxChoiceNameStr;
|
||||||
|
|
||||||
// Choice item
|
// Choice item
|
||||||
class WXDLLEXPORT wxChoice: public wxControl
|
class WXDLLEXPORT wxChoice: public wxChoiceBase
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxChoice)
|
DECLARE_DYNAMIC_CLASS(wxChoice)
|
||||||
|
|
||||||
|
@@ -1,21 +1,17 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: region.h
|
// Name: region.h
|
||||||
// Purpose: wxRegion class
|
// Purpose: wxRegion class
|
||||||
// Author: AUTHOR
|
// Author: David Webster
|
||||||
// Modified by:
|
// Modified by:
|
||||||
// Created: ??/??/98
|
// Created: 10/15/99
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) AUTHOR
|
// Copyright: (c) David Webster
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifndef _WX_REGION_H_
|
#ifndef _WX_REGION_H_
|
||||||
#define _WX_REGION_H_
|
#define _WX_REGION_H_
|
||||||
|
|
||||||
#ifdef __GNUG__
|
|
||||||
#pragma interface "region.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "wx/list.h"
|
#include "wx/list.h"
|
||||||
#include "wx/gdiobj.h"
|
#include "wx/gdiobj.h"
|
||||||
#include "wx/gdicmn.h"
|
#include "wx/gdicmn.h"
|
||||||
@@ -43,6 +39,8 @@ public:
|
|||||||
wxRegion(long x, long y, long w, long h);
|
wxRegion(long x, long y, long w, long h);
|
||||||
wxRegion(const wxPoint& topLeft, const wxPoint& bottomRight);
|
wxRegion(const wxPoint& topLeft, const wxPoint& bottomRight);
|
||||||
wxRegion(const wxRect& rect);
|
wxRegion(const wxRect& rect);
|
||||||
|
wxRegion(WXHRGN hRegion); // Hangs on to this region
|
||||||
|
|
||||||
wxRegion();
|
wxRegion();
|
||||||
~wxRegion();
|
~wxRegion();
|
||||||
|
|
||||||
@@ -100,6 +98,9 @@ public:
|
|||||||
bool Combine(long x, long y, long width, long height, wxRegionOp op);
|
bool Combine(long x, long y, long width, long height, wxRegionOp op);
|
||||||
bool Combine(const wxRegion& region, wxRegionOp op);
|
bool Combine(const wxRegion& region, wxRegionOp op);
|
||||||
bool Combine(const wxRect& rect, wxRegionOp op);
|
bool Combine(const wxRect& rect, wxRegionOp op);
|
||||||
|
|
||||||
|
// Get internal region handle
|
||||||
|
WXHRGN GetHRGN() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
class WXDLLEXPORT wxRegionIterator : public wxObject {
|
class WXDLLEXPORT wxRegionIterator : public wxObject {
|
||||||
|
@@ -1,21 +1,17 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: scrollbar.h
|
// Name: scrollbar.h
|
||||||
// Purpose: wxScrollBar class
|
// Purpose: wxScrollBar class
|
||||||
// Author: AUTHOR
|
// Author: David Webster
|
||||||
// Modified by:
|
// Modified by:
|
||||||
// Created: ??/??/98
|
// Created: 10/15/99
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) AUTHOR
|
// Copyright: (c) David Webster
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifndef _WX_SCROLBAR_H_
|
#ifndef _WX_SCROLBAR_H_
|
||||||
#define _WX_SCROLBAR_H_
|
#define _WX_SCROLBAR_H_
|
||||||
|
|
||||||
#ifdef __GNUG__
|
|
||||||
#pragma interface "scrolbar.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "wx/control.h"
|
#include "wx/control.h"
|
||||||
|
|
||||||
WXDLLEXPORT_DATA(extern const char*) wxScrollBarNameStr;
|
WXDLLEXPORT_DATA(extern const char*) wxScrollBarNameStr;
|
||||||
@@ -54,8 +50,32 @@ public:
|
|||||||
virtual void SetScrollbar(int position, int thumbSize, int range, int pageSize,
|
virtual void SetScrollbar(int position, int thumbSize, int range, int pageSize,
|
||||||
bool refresh = TRUE);
|
bool refresh = TRUE);
|
||||||
|
|
||||||
|
#if WXWIN_COMPATIBILITY
|
||||||
|
// Backward compatibility
|
||||||
|
int GetValue() const { return GetThumbPosition(); }
|
||||||
|
void SetValue(int viewStart) { SetThumbPosition(viewStart); }
|
||||||
|
void GetValues(int *viewStart, int *viewLength, int *objectLength,
|
||||||
|
int *pageLength) const ;
|
||||||
|
int GetViewLength() const { return m_viewSize; }
|
||||||
|
int GetObjectLength() const { return m_objectSize; }
|
||||||
|
|
||||||
|
void SetPageSize(int pageLength);
|
||||||
|
void SetObjectLength(int objectLength);
|
||||||
|
void SetViewLength(int viewLength);
|
||||||
|
#endif
|
||||||
|
|
||||||
void Command(wxCommandEvent& event);
|
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);
|
||||||
|
|
||||||
|
#if WXWIN_COMPATIBILITY
|
||||||
|
// Backward compatibility: generate an old-style scroll command
|
||||||
|
void OnScroll(wxScrollEvent& event);
|
||||||
|
#endif // WXWIN_COMPATIBILITY
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int m_pageSize;
|
int m_pageSize;
|
||||||
int m_viewSize;
|
int m_viewSize;
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: settings.h
|
// Name: settings.h
|
||||||
// Purpose: wxSystemSettings class
|
// Purpose: wxSystemSettings class
|
||||||
// Author: AUTHOR
|
// Author: David Webster
|
||||||
// Modified by:
|
// Modified by:
|
||||||
// Created: ??/??/98
|
// Created: 10/15/98
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) AUTHOR
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
@@ -12,13 +12,7 @@
|
|||||||
#ifndef _WX_SETTINGS_H_
|
#ifndef _WX_SETTINGS_H_
|
||||||
#define _WX_SETTINGS_H_
|
#define _WX_SETTINGS_H_
|
||||||
|
|
||||||
#ifdef __GNUG__
|
|
||||||
#pragma interface "settings.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "wx/setup.h"
|
#include "wx/setup.h"
|
||||||
#include "wx/defs.h"
|
|
||||||
#include "wx/object.h"
|
|
||||||
#include "wx/colour.h"
|
#include "wx/colour.h"
|
||||||
#include "wx/font.h"
|
#include "wx/font.h"
|
||||||
|
|
||||||
|
@@ -1,21 +1,17 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: slider.h
|
// Name: slider.h
|
||||||
// Purpose: wxSlider class
|
// Purpose: wxSlider class
|
||||||
// Author: AUTHOR
|
// Author: David Webster
|
||||||
// Modified by:
|
// Modified by:
|
||||||
// Created: ??/??/98
|
// Created: 10/15/99
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) AUTHOR
|
// Copyright: (c) David Webster
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifndef _WX_SLIDER_H_
|
#ifndef _WX_SLIDER_H_
|
||||||
#define _WX_SLIDER_H_
|
#define _WX_SLIDER_H_
|
||||||
|
|
||||||
#ifdef __GNUG__
|
|
||||||
#pragma interface "slider.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "wx/control.h"
|
#include "wx/control.h"
|
||||||
|
|
||||||
WXDLLEXPORT_DATA(extern const char*) wxSliderNameStr;
|
WXDLLEXPORT_DATA(extern const char*) wxSliderNameStr;
|
||||||
@@ -51,9 +47,10 @@ public:
|
|||||||
|
|
||||||
virtual int GetValue() const ;
|
virtual int GetValue() const ;
|
||||||
virtual void SetValue(int);
|
virtual void SetValue(int);
|
||||||
|
|
||||||
void GetSize(int *x, int *y) const ;
|
void GetSize(int *x, int *y) const ;
|
||||||
void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
|
||||||
void GetPosition(int *x, int *y) const ;
|
void GetPosition(int *x, int *y) const ;
|
||||||
|
|
||||||
bool Show(bool show);
|
bool Show(bool show);
|
||||||
|
|
||||||
void SetRange(int minValue, int maxValue);
|
void SetRange(int minValue, int maxValue);
|
||||||
@@ -61,6 +58,10 @@ public:
|
|||||||
inline int GetMin() const { return m_rangeMin; }
|
inline int GetMin() const { return m_rangeMin; }
|
||||||
inline int GetMax() const { return m_rangeMax; }
|
inline int GetMax() const { return m_rangeMax; }
|
||||||
|
|
||||||
|
void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// For trackbars only
|
// For trackbars only
|
||||||
void SetTickFreq(int n, int pos);
|
void SetTickFreq(int n, int pos);
|
||||||
inline int GetTickFreq() const { return m_tickFreq; }
|
inline int GetTickFreq() const { return m_tickFreq; }
|
||||||
@@ -77,14 +78,31 @@ public:
|
|||||||
int GetThumbLength() const ;
|
int GetThumbLength() const ;
|
||||||
void SetTick(int tickPos) ;
|
void SetTick(int tickPos) ;
|
||||||
|
|
||||||
|
// 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);
|
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:
|
protected:
|
||||||
|
WXHWND m_staticMin;
|
||||||
|
WXHWND m_staticMax;
|
||||||
|
WXHWND m_staticValue;
|
||||||
int m_rangeMin;
|
int m_rangeMin;
|
||||||
int m_rangeMax;
|
int m_rangeMax;
|
||||||
int m_pageSize;
|
int m_pageSize;
|
||||||
int m_lineSize;
|
int m_lineSize;
|
||||||
int m_tickFreq;
|
int m_tickFreq;
|
||||||
DECLARE_EVENT_TABLE()
|
|
||||||
|
virtual void DoSetSize(int x, int y,
|
||||||
|
int width, int height,
|
||||||
|
int sizeFlags = wxSIZE_AUTO);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -1,87 +1,72 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: spinbutt.h
|
// Name: spinbutt.h
|
||||||
// Purpose: wxSpinButton class
|
// Purpose: wxSpinButton class
|
||||||
// Author: AUTHOR
|
// Author: David Webster
|
||||||
// Modified by:
|
// Modified by:
|
||||||
// Created: ??/??/98
|
// Created: 10/15/99
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) AUTHOR
|
// Copyright: (c) David Webster
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifndef _WX_SPINBUTT_H_
|
#ifndef _WX_SPINBUTT_H_
|
||||||
#define _WX_SPINBUTT_H_
|
#define _WX_SPINBUTT_H_
|
||||||
|
|
||||||
#ifdef __GNUG__
|
|
||||||
#pragma interface "spinbutt.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "wx/control.h"
|
#include "wx/control.h"
|
||||||
#include "wx/event.h"
|
#include "wx/event.h"
|
||||||
|
|
||||||
/*
|
|
||||||
The wxSpinButton is like a small scrollbar than is often placed next
|
|
||||||
to a text control.
|
|
||||||
|
|
||||||
wxSP_HORIZONTAL: horizontal spin button
|
|
||||||
wxSP_VERTICAL: vertical spin button (the default)
|
|
||||||
wxSP_ARROW_KEYS: arrow keys increment/decrement value
|
|
||||||
wxSP_WRAP: value wraps at either end
|
|
||||||
*/
|
|
||||||
|
|
||||||
class WXDLLEXPORT wxSpinButton: public wxControl
|
class WXDLLEXPORT wxSpinButton: public wxControl
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxSpinButton)
|
public:
|
||||||
public:
|
// Construction
|
||||||
/*
|
wxSpinButton() { }
|
||||||
* Public interface
|
|
||||||
*/
|
|
||||||
|
|
||||||
wxSpinButton();
|
inline wxSpinButton( wxWindow *parent
|
||||||
|
,wxWindowID id = -1
|
||||||
inline wxSpinButton(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
,const wxPoint& pos = wxDefaultPosition
|
||||||
long style = wxSP_VERTICAL, const wxString& name = "wxSpinButton")
|
,const wxSize& size = wxDefaultSize
|
||||||
|
,long style = wxSP_VERTICAL
|
||||||
|
,const wxString& name = "wxSpinButton"
|
||||||
|
)
|
||||||
{
|
{
|
||||||
Create(parent, id, pos, size, style, name);
|
Create(parent, id, pos, size, style, name);
|
||||||
}
|
}
|
||||||
~wxSpinButton();
|
|
||||||
|
|
||||||
bool Create(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
virtual ~wxSpinButton();
|
||||||
long style = wxSP_VERTICAL, const wxString& name = "wxSpinButton");
|
|
||||||
|
|
||||||
|
bool Create( wxWindow *parent
|
||||||
|
,wxWindowID id = -1
|
||||||
|
,const wxPoint& pos = wxDefaultPosition
|
||||||
|
,const wxSize& size = wxDefaultSize
|
||||||
|
,long style = wxSP_VERTICAL
|
||||||
|
,const wxString& name = "wxSpinButton"
|
||||||
|
);
|
||||||
|
|
||||||
// Attributes
|
// Accessors
|
||||||
////////////////////////////////////////////////////////////////////////////
|
virtual int GetValue() const ;
|
||||||
|
virtual void SetValue(int val) ;
|
||||||
|
virtual void SetRange( int minVal
|
||||||
|
,int maxVal
|
||||||
|
);
|
||||||
|
|
||||||
int GetValue() const ;
|
// Implementation
|
||||||
void SetValue(int val) ;
|
virtual bool OS2Command( WXUINT param
|
||||||
void SetRange(int minVal, int maxVal) ;
|
,WXWORD id
|
||||||
inline int GetMin() const { return m_min; }
|
);
|
||||||
inline int GetMax() const { return m_max; }
|
virtual bool OS2OnNotify( int idCtrl
|
||||||
|
,WXLPARAM lParam
|
||||||
// Operations
|
,WXLPARAM* result
|
||||||
////////////////////////////////////////////////////////////////////////////
|
);
|
||||||
|
virtual bool OS2OnScroll( int orientation
|
||||||
void Command(wxCommandEvent& event) { ProcessCommand(event); };
|
,WXWORD wParam
|
||||||
|
,WXWORD pos
|
||||||
|
,WXHWND control
|
||||||
|
);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int m_min;
|
virtual wxSize DoGetBestSize();
|
||||||
int m_max;
|
private:
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxSpinButton)
|
||||||
};
|
};
|
||||||
|
|
||||||
// Spin events
|
|
||||||
|
|
||||||
#define EVT_SPIN_UP(id, func) { wxEVT_SCROLL_LINEUP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func }
|
|
||||||
#define EVT_SPIN_DOWN(id, func) { wxEVT_SCROLL_LINEDOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func }
|
|
||||||
|
|
||||||
#define EVT_SPIN(id, func) \
|
|
||||||
{ wxEVT_SCROLL_TOP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },\
|
|
||||||
{ wxEVT_SCROLL_BOTTOM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },\
|
|
||||||
{ wxEVT_SCROLL_LINEUP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },\
|
|
||||||
{ wxEVT_SCROLL_LINEDOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },\
|
|
||||||
{ wxEVT_SCROLL_PAGEUP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },\
|
|
||||||
{ wxEVT_SCROLL_PAGEDOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },\
|
|
||||||
{ wxEVT_SCROLL_THUMBTRACK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
// _WX_SPINBUTT_H_
|
// _WX_SPINBUTT_H_
|
||||||
|
57
include/wx/os2/spinctrl.h
Normal file
57
include/wx/os2/spinctrl.h
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: msw/spinctrl.h
|
||||||
|
// Purpose: wxSpinCtrl class declaration for Win32
|
||||||
|
// Author: David Webster
|
||||||
|
// Modified by:
|
||||||
|
// Created: 10/15/99
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) David Webster
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_MSW_SPINCTRL_H_
|
||||||
|
#define _WX_MSW_SPINCTRL_H_
|
||||||
|
|
||||||
|
#include "wx/spinbutt.h" // the base class
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// Under Win32 and OS2 PM, wxSpinCtrl is a wxSpinButton with a buddy
|
||||||
|
// text window whose contents is automatically updated when the spin
|
||||||
|
// control is clicked.
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class WXDLLEXPORT wxSpinCtrl : public wxSpinButton
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxSpinCtrl() { }
|
||||||
|
|
||||||
|
wxSpinCtrl(wxWindow *parent,
|
||||||
|
wxWindowID id = -1,
|
||||||
|
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"))
|
||||||
|
{
|
||||||
|
Create(parent, id, pos, size, style, min, max, initial, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent,
|
||||||
|
wxWindowID id = -1,
|
||||||
|
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"));
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void DoMoveWindow(int x, int y, int width, int height);
|
||||||
|
|
||||||
|
WXHWND m_hwndBuddy;
|
||||||
|
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxSpinCtrl)
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // _WX_MSW_SPINCTRL_H_
|
||||||
|
|
||||||
|
|
@@ -43,21 +43,35 @@ class WXDLLEXPORT wxStaticBitmap: public wxControl
|
|||||||
long style = 0,
|
long style = 0,
|
||||||
const wxString& name = wxStaticBitmapNameStr);
|
const wxString& name = wxStaticBitmapNameStr);
|
||||||
|
|
||||||
|
virtual void SetIcon(const wxIcon& icon) { SetBitmap(icon); }
|
||||||
virtual void SetBitmap(const wxBitmap& bitmap);
|
virtual void SetBitmap(const wxBitmap& bitmap);
|
||||||
|
|
||||||
virtual void Command(wxCommandEvent& WXUNUSED(event)) {};
|
// assert failure is provoked by an attempt to get an icon from bitmap or
|
||||||
virtual void ProcessCommand(wxCommandEvent& WXUNUSED(event)) {};
|
// vice versa
|
||||||
|
const wxIcon& GetIcon() const
|
||||||
void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
{ wxASSERT( m_isIcon ); return *m_image.icon; }
|
||||||
|
const wxBitmap& GetBitmap() const
|
||||||
inline wxBitmap& GetBitmap() const { return (wxBitmap&) m_messageBitmap; }
|
{ wxASSERT( !m_isIcon ); return *m_image.bitmap; }
|
||||||
|
|
||||||
// overriden base class virtuals
|
// overriden base class virtuals
|
||||||
virtual bool AcceptsFocus() const { return FALSE; }
|
virtual bool AcceptsFocus() const { return FALSE; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
wxBitmap m_messageBitmap;
|
void Init() { m_isIcon = TRUE; m_image.icon = NULL; }
|
||||||
|
void Free();
|
||||||
|
|
||||||
|
// TRUE if icon/bitmap is valid
|
||||||
|
bool ImageIsOk() const;
|
||||||
|
|
||||||
|
// we can have either an icon or a bitmap
|
||||||
|
bool m_isIcon;
|
||||||
|
union
|
||||||
|
{
|
||||||
|
wxIcon *icon;
|
||||||
|
wxBitmap *bitmap;
|
||||||
|
} m_image;
|
||||||
|
|
||||||
|
virtual wxSize DoGetBestSize();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -1,21 +1,17 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: statbox.h
|
// Name: statbox.h
|
||||||
// Purpose: wxStaticBox class
|
// Purpose: wxStaticBox class
|
||||||
// Author: AUTHOR
|
// Author: David Webster
|
||||||
// Modified by:
|
// Modified by:
|
||||||
// Created: ??/??/98
|
// Created: 10/15/99
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) AUTHOR
|
// Copyright: (c) David Webster
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifndef _WX_STATBOX_H_
|
#ifndef _WX_STATBOX_H_
|
||||||
#define _WX_STATBOX_H_
|
#define _WX_STATBOX_H_
|
||||||
|
|
||||||
#ifdef __GNUG__
|
|
||||||
#pragma interface "statbox.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "wx/control.h"
|
#include "wx/control.h"
|
||||||
|
|
||||||
WXDLLEXPORT_DATA(extern const char*) wxStaticBoxNameStr;
|
WXDLLEXPORT_DATA(extern const char*) wxStaticBoxNameStr;
|
||||||
@@ -27,31 +23,47 @@ class WXDLLEXPORT wxStaticBox: public wxControl
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
inline wxStaticBox() {}
|
inline wxStaticBox() {}
|
||||||
inline wxStaticBox(wxWindow *parent, wxWindowID id,
|
inline wxStaticBox( wxWindow* parent
|
||||||
const wxString& label,
|
,wxWindowID id
|
||||||
const wxPoint& pos = wxDefaultPosition,
|
,const wxString& label
|
||||||
const wxSize& size = wxDefaultSize,
|
,const wxPoint& pos = wxDefaultPosition
|
||||||
long style = 0,
|
,const wxSize& size = wxDefaultSize
|
||||||
const wxString& name = wxStaticBoxNameStr)
|
,long style = 0
|
||||||
|
,const wxString& name = wxStaticBoxNameStr
|
||||||
|
)
|
||||||
{
|
{
|
||||||
Create(parent, id, label, pos, size, style, name);
|
Create(parent, id, label, pos, size, style, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Create(wxWindow *parent, wxWindowID id,
|
bool Create( wxWindow* parent
|
||||||
const wxString& label,
|
,wxWindowID id
|
||||||
const wxPoint& pos = wxDefaultPosition,
|
,const wxString& label
|
||||||
const wxSize& size = wxDefaultSize,
|
,const wxPoint& pos = wxDefaultPosition
|
||||||
long style = 0,
|
,const wxSize& size = wxDefaultSize
|
||||||
const wxString& name = wxStaticBoxNameStr);
|
,long style = 0
|
||||||
|
,const wxString& name = wxStaticBoxNameStr
|
||||||
|
);
|
||||||
|
|
||||||
virtual void Command(wxCommandEvent& WXUNUSED(event)) {};
|
// implementation from now on
|
||||||
virtual void ProcessCommand(wxCommandEvent& WXUNUSED(event)) {};
|
// --------------------------
|
||||||
|
|
||||||
void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
void OnEraseBackground(wxEraseEvent& event);
|
||||||
void SetLabel(const wxString& label);
|
|
||||||
|
|
||||||
DECLARE_EVENT_TABLE()
|
virtual MRESULT OS2WindowProc(HWND hwnd, 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; }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual wxSize DoGetBestSize();
|
||||||
|
|
||||||
|
private:
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
// _WX_STATBOX_H_
|
// _WX_STATBOX_H_
|
||||||
|
|
||||||
|
@@ -343,6 +343,14 @@ OS2OBJS = \
|
|||||||
..\os2\$D\print.obj \
|
..\os2\$D\print.obj \
|
||||||
..\os2\$D\radiobox.obj \
|
..\os2\$D\radiobox.obj \
|
||||||
..\os2\$D\radiobut.obj \
|
..\os2\$D\radiobut.obj \
|
||||||
|
..\os2\$D\region.obj \
|
||||||
|
..\os2\$D\scrolbar.obj \
|
||||||
|
..\os2\$D\settings.obj \
|
||||||
|
..\os2\$D\slider.obj \
|
||||||
|
..\os2\$D\spinbutt.obj \
|
||||||
|
..\os2\$D\spinctrl.obj \
|
||||||
|
..\os2\$D\statbmp.obj \
|
||||||
|
..\os2\$D\statbox.obj \
|
||||||
..\os2\$D\window.obj
|
..\os2\$D\window.obj
|
||||||
|
|
||||||
OS2LIBOBJS1 = \
|
OS2LIBOBJS1 = \
|
||||||
@@ -401,6 +409,14 @@ OS2LIBOBJS2 = \
|
|||||||
print.obj \
|
print.obj \
|
||||||
radiobox.obj \
|
radiobox.obj \
|
||||||
radiobut.obj \
|
radiobut.obj \
|
||||||
|
region.obj \
|
||||||
|
scrolbar.obj \
|
||||||
|
settings.obj \
|
||||||
|
slider.obj \
|
||||||
|
spinbutt.obj \
|
||||||
|
spinctrl.obj \
|
||||||
|
statbmp.obj \
|
||||||
|
statbox.obj \
|
||||||
window.obj
|
window.obj
|
||||||
|
|
||||||
HTMLOBJS = \
|
HTMLOBJS = \
|
||||||
@@ -603,6 +619,14 @@ $(OS2LIBOBJS2):
|
|||||||
copy ..\os2\$D\print.obj
|
copy ..\os2\$D\print.obj
|
||||||
copy ..\os2\$D\radiobox.obj
|
copy ..\os2\$D\radiobox.obj
|
||||||
copy ..\os2\$D\radiobut.obj
|
copy ..\os2\$D\radiobut.obj
|
||||||
|
copy ..\os2\$D\region.obj
|
||||||
|
copy ..\os2\$D\scrolbar.obj
|
||||||
|
copy ..\os2\$D\settings.obj
|
||||||
|
copy ..\os2\$D\slider.obj
|
||||||
|
copy ..\os2\$D\spinbutt.obj
|
||||||
|
copy ..\os2\$D\spinctrl.obj
|
||||||
|
copy ..\os2\$D\statbmp.obj
|
||||||
|
copy ..\os2\$D\statbox.obj
|
||||||
copy ..\os2\$D\window.obj
|
copy ..\os2\$D\window.obj
|
||||||
|
|
||||||
# wxWindows library as DLL
|
# wxWindows library as DLL
|
||||||
|
@@ -1,20 +1,23 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// File: region.cpp
|
// File: region.cpp
|
||||||
// Purpose: Region class
|
// Purpose: Region class
|
||||||
// Author: Markus Holzem/Julian Smart/AUTHOR
|
// Author: David Webster
|
||||||
// Created: Fri Oct 24 10:46:34 MET 1997
|
// Modified by:
|
||||||
|
// Created: 10/15/99
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) 1997 Markus Holzem/Julian Smart/AUTHOR
|
// Copyright: (c) Davdi Webster
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifdef __GNUG__
|
// For compilers that support precompilation, includes "wx.h".
|
||||||
#pragma implementation "region.h"
|
#include "wx/wxprec.h"
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "wx/region.h"
|
#include "wx/os2/region.h"
|
||||||
#include "wx/gdicmn.h"
|
#include "wx/gdicmn.h"
|
||||||
|
|
||||||
|
#include "wx/window.h"
|
||||||
|
#include "wx/os2/private.h"
|
||||||
|
|
||||||
#if !USE_SHARED_LIBRARY
|
#if !USE_SHARED_LIBRARY
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxRegion, wxGDIObject)
|
IMPLEMENT_DYNAMIC_CLASS(wxRegion, wxGDIObject)
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxRegionIterator, wxObject)
|
IMPLEMENT_DYNAMIC_CLASS(wxRegionIterator, wxObject)
|
||||||
@@ -28,6 +31,7 @@ class WXDLLEXPORT wxRegionRefData : public wxGDIRefData {
|
|||||||
public:
|
public:
|
||||||
wxRegionRefData()
|
wxRegionRefData()
|
||||||
{
|
{
|
||||||
|
m_region = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxRegionRefData(const wxRegionRefData& data)
|
wxRegionRefData(const wxRegionRefData& data)
|
||||||
@@ -38,6 +42,7 @@ public:
|
|||||||
~wxRegionRefData()
|
~wxRegionRefData()
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -55,6 +60,12 @@ wxRegion::wxRegion()
|
|||||||
// TODO create empty region
|
// TODO create empty region
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxRegion::wxRegion(WXHRGN hRegion)
|
||||||
|
{
|
||||||
|
m_refData = new wxRegionRefData;
|
||||||
|
M_REGION = (HRGN) hRegion;
|
||||||
|
}
|
||||||
|
|
||||||
wxRegion::wxRegion(long x, long y, long w, long h)
|
wxRegion::wxRegion(long x, long y, long w, long h)
|
||||||
{
|
{
|
||||||
m_refData = new wxRegionRefData;
|
m_refData = new wxRegionRefData;
|
||||||
@@ -262,6 +273,14 @@ wxRegionContain wxRegion::Contains(const wxRect& rect) const
|
|||||||
return Contains(x, y, w, h);
|
return Contains(x, y, w, h);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get internal region handle
|
||||||
|
WXHRGN wxRegion::GetHRGN() const
|
||||||
|
{
|
||||||
|
if (!m_refData)
|
||||||
|
return (WXHRGN) 0;
|
||||||
|
return (WXHRGN) M_REGION;
|
||||||
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
// //
|
// //
|
||||||
// wxRegionIterator //
|
// wxRegionIterator //
|
||||||
|
@@ -1,23 +1,34 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: scrolbar.cpp
|
// Name: scrolbar.cpp
|
||||||
// Purpose: wxScrollBar
|
// Purpose: wxScrollBar
|
||||||
// Author: AUTHOR
|
// Author: David Webster
|
||||||
// Modified by:
|
// Modified by:
|
||||||
// Created: ??/??/98
|
// Created: 10/15/99
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) AUTHOR
|
// Copyright: (c) David Webster
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifdef __GNUG__
|
// For compilers that support precompilation, includes "wx.h".
|
||||||
#pragma implementation "scrolbar.h"
|
#include "wx/wxprec.h"
|
||||||
|
|
||||||
|
#ifndef WX_PRECOMP
|
||||||
|
#include "wx/defs.h"
|
||||||
|
#include "wx/utils.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/scrolbar.h"
|
#include "wx/scrolbar.h"
|
||||||
|
#include "wx/os2/private.h"
|
||||||
|
|
||||||
#if !USE_SHARED_LIBRARY
|
#if !USE_SHARED_LIBRARY
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxScrollBar, wxControl)
|
IMPLEMENT_DYNAMIC_CLASS(wxScrollBar, wxControl)
|
||||||
|
|
||||||
|
BEGIN_EVENT_TABLE(wxScrollBar, wxControl)
|
||||||
|
#if WXWIN_COMPATIBILITY
|
||||||
|
EVT_SCROLL(wxScrollBar::OnScroll)
|
||||||
|
#endif
|
||||||
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Scrollbar
|
// Scrollbar
|
||||||
@@ -33,6 +44,8 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id,
|
|||||||
SetName(name);
|
SetName(name);
|
||||||
SetValidator(validator);
|
SetValidator(validator);
|
||||||
|
|
||||||
|
SetBackgroundColour(parent->GetBackgroundColour()) ;
|
||||||
|
SetForegroundColour(parent->GetForegroundColour()) ;
|
||||||
m_windowStyle = style;
|
m_windowStyle = style;
|
||||||
|
|
||||||
if ( id == -1 )
|
if ( id == -1 )
|
||||||
@@ -40,7 +53,41 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id,
|
|||||||
else
|
else
|
||||||
m_windowId = id;
|
m_windowId = id;
|
||||||
|
|
||||||
|
int x = pos.x;
|
||||||
|
int y = pos.y;
|
||||||
|
int width = size.x;
|
||||||
|
int height = size.y;
|
||||||
|
|
||||||
|
if (width == -1)
|
||||||
|
{
|
||||||
|
if (style & wxHORIZONTAL)
|
||||||
|
width = 140;
|
||||||
|
else
|
||||||
|
width = 14;
|
||||||
|
}
|
||||||
|
if (height == -1)
|
||||||
|
{
|
||||||
|
if (style & wxVERTICAL)
|
||||||
|
height = 140;
|
||||||
|
else
|
||||||
|
height = 14;
|
||||||
|
}
|
||||||
|
|
||||||
// TODO create scrollbar
|
// TODO create scrollbar
|
||||||
|
|
||||||
|
m_pageSize = 1;
|
||||||
|
m_viewSize = 1;
|
||||||
|
m_objectSize = 1;
|
||||||
|
|
||||||
|
SetFont(parent->GetFont());
|
||||||
|
|
||||||
|
m_hWnd = 0; // TODO: (WXHWND)scroll_bar;
|
||||||
|
|
||||||
|
// Subclass again for purposes of dialog editing mode
|
||||||
|
SubclassWin((WXHWND) scroll_bar);
|
||||||
|
|
||||||
|
SetSize(x, y, width, height);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,6 +95,91 @@ wxScrollBar::~wxScrollBar()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool wxScrollBar::OS2OnScroll(int WXUNUSED(orientation), WXWORD wParam,
|
||||||
|
WXWORD pos, WXHWND control)
|
||||||
|
{
|
||||||
|
// TODO:
|
||||||
|
/*
|
||||||
|
int position = ::GetScrollPos((HWND) control, SB_CTL);
|
||||||
|
int minPos, maxPos;
|
||||||
|
::GetScrollRange((HWND) control, SB_CTL, &minPos, &maxPos);
|
||||||
|
|
||||||
|
#if defined(__WIN95__)
|
||||||
|
// A page size greater than one has the effect of reducing the effective
|
||||||
|
// range, therefore the range has already been boosted artificially - so
|
||||||
|
// reduce it again.
|
||||||
|
if ( m_pageSize > 1 )
|
||||||
|
maxPos -= (m_pageSize - 1);
|
||||||
|
#endif // __WIN95__
|
||||||
|
|
||||||
|
wxEventType scrollEvent = wxEVT_NULL;
|
||||||
|
|
||||||
|
int nScrollInc;
|
||||||
|
switch ( wParam )
|
||||||
|
{
|
||||||
|
case SB_TOP:
|
||||||
|
nScrollInc = maxPos - position;
|
||||||
|
scrollEvent = wxEVT_SCROLL_TOP;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SB_BOTTOM:
|
||||||
|
nScrollInc = - position;
|
||||||
|
scrollEvent = wxEVT_SCROLL_BOTTOM;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SB_LINEUP:
|
||||||
|
nScrollInc = -1;
|
||||||
|
scrollEvent = wxEVT_SCROLL_LINEUP;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SB_LINEDOWN:
|
||||||
|
nScrollInc = 1;
|
||||||
|
scrollEvent = wxEVT_SCROLL_LINEDOWN;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SB_PAGEUP:
|
||||||
|
nScrollInc = -GetPageSize();
|
||||||
|
scrollEvent = wxEVT_SCROLL_PAGEUP;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SB_PAGEDOWN:
|
||||||
|
nScrollInc = GetPageSize();
|
||||||
|
scrollEvent = wxEVT_SCROLL_PAGEDOWN;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SB_THUMBTRACK:
|
||||||
|
case SB_THUMBPOSITION:
|
||||||
|
nScrollInc = pos - position;
|
||||||
|
scrollEvent = wxEVT_SCROLL_THUMBTRACK;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
nScrollInc = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( nScrollInc == 0 )
|
||||||
|
{
|
||||||
|
// no event to process, so don't process it
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
int new_pos = position + nScrollInc;
|
||||||
|
|
||||||
|
if (new_pos < 0)
|
||||||
|
new_pos = 0;
|
||||||
|
if (new_pos > maxPos)
|
||||||
|
new_pos = maxPos;
|
||||||
|
|
||||||
|
SetThumbPosition(new_pos);
|
||||||
|
wxScrollEvent event(scrollEvent, m_windowId);
|
||||||
|
event.SetPosition(new_pos);
|
||||||
|
event.SetEventObject( this );
|
||||||
|
|
||||||
|
return GetEventHandler()->ProcessEvent(event);
|
||||||
|
*/
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
void wxScrollBar::SetThumbPosition(int viewStart)
|
void wxScrollBar::SetThumbPosition(int viewStart)
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
@@ -69,6 +201,48 @@ void wxScrollBar::SetScrollbar(int position, int thumbSize, int range, int pageS
|
|||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if WXWIN_COMPATIBILITY
|
||||||
|
void wxScrollBar::SetPageSize(int pageLength)
|
||||||
|
{
|
||||||
|
m_pageSize = pageLength;
|
||||||
|
|
||||||
|
// TODO:
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxScrollBar::SetObjectLength(int objectLength)
|
||||||
|
{
|
||||||
|
m_objectSize = objectLength;
|
||||||
|
|
||||||
|
// The range (number of scroll steps) is the
|
||||||
|
// object length minus the view size.
|
||||||
|
int range = wxMax((objectLength - m_viewSize), 0) ;
|
||||||
|
|
||||||
|
// TODO:
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxScrollBar::SetViewLength(int viewLength)
|
||||||
|
{
|
||||||
|
m_viewSize = viewLength;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxScrollBar::GetValues(int *viewStart, int *viewLength, int *objectLength,
|
||||||
|
int *pageLength) const
|
||||||
|
{
|
||||||
|
// TODO:
|
||||||
|
/*
|
||||||
|
*viewStart = ::GetScrollPos((HWND)m_hWnd, SB_CTL);
|
||||||
|
*viewLength = m_viewSize;
|
||||||
|
*objectLength = m_objectSize;
|
||||||
|
*pageLength = m_pageSize;
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
WXHBRUSH wxScrollBar::OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
|
||||||
|
WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
void wxScrollBar::Command(wxCommandEvent& event)
|
void wxScrollBar::Command(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
@@ -76,3 +250,20 @@ void wxScrollBar::Command(wxCommandEvent& event)
|
|||||||
ProcessCommand(event);
|
ProcessCommand(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if WXWIN_COMPATIBILITY
|
||||||
|
// Backward compatibility
|
||||||
|
void wxScrollBar::OnScroll(wxScrollEvent& event)
|
||||||
|
{
|
||||||
|
// TODO:
|
||||||
|
/*
|
||||||
|
wxEventType oldEvent = event.GetEventType();
|
||||||
|
event.SetEventType( wxEVT_COMMAND_SCROLLBAR_UPDATED );
|
||||||
|
if ( !GetEventHandler()->ProcessEvent(event) )
|
||||||
|
{
|
||||||
|
event.SetEventType( oldEvent );
|
||||||
|
if (!GetParent()->GetEventHandler()->ProcessEvent(event))
|
||||||
|
event.Skip();
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
@@ -1,20 +1,35 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: settings.cpp
|
// Name: settings.cpp
|
||||||
// Purpose: wxSettings
|
// Purpose: wxSettings
|
||||||
// Author: AUTHOR
|
// Author: David Webster
|
||||||
// Modified by:
|
// Modified by:
|
||||||
// Created: ??/??/98
|
// Created: 10/15/99
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) AUTHOR
|
// Copyright: (c) David Webster
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifdef __GNUG__
|
// For compilers that support precompilation, includes "wx.h".
|
||||||
#pragma implementation "settings.h"
|
#include "wx/wxprec.h"
|
||||||
|
|
||||||
|
#ifndef WX_PRECOMP
|
||||||
|
#include <stdio.h>
|
||||||
|
#include "wx/defs.h"
|
||||||
|
#include "wx/pen.h"
|
||||||
|
#include "wx/brush.h"
|
||||||
|
#include "wx/gdicmn.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/settings.h"
|
#include "wx/settings.h"
|
||||||
|
#include "wx/window.h"
|
||||||
|
#include "wx/os2/private.h"
|
||||||
|
|
||||||
|
// TODO: see ::SystemParametersInfo for all sorts of Windows settings.
|
||||||
|
// Different args are required depending on the id. How does this differ
|
||||||
|
// from GetSystemMetric, and should it? Perhaps call it GetSystemParameter
|
||||||
|
// and pass an optional void* arg to get further info.
|
||||||
|
// Should also have SetSystemParameter.
|
||||||
|
// Also implement WM_WININICHANGE (NT) / WM_SETTINGCHANGE (Win95)
|
||||||
wxColour wxSystemSettings::GetSystemColour(int index)
|
wxColour wxSystemSettings::GetSystemColour(int index)
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
|
@@ -1,32 +1,39 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: slider.cpp
|
// Name: slider.cpp
|
||||||
// Purpose: wxSlider
|
// Purpose: wxSlider
|
||||||
// Author: AUTHOR
|
// Author: David Webster
|
||||||
// Modified by:
|
// Modified by:
|
||||||
// Created: ??/??/98
|
// Created: 10/15/99
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) AUTHOR
|
// Copyright: (c) David Webster
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifdef __GNUG__
|
// For compilers that support precompilation, includes "wx.h".
|
||||||
#pragma implementation "slider.h"
|
#include "wx/wxprec.h"
|
||||||
|
|
||||||
|
#ifdef __BORLANDC__
|
||||||
|
#pragma hdrstop
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WX_PRECOMP
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <wx/utils.h>
|
||||||
|
#include <wx/brush.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/slider.h"
|
#include "wx/slider.h"
|
||||||
|
#include "wx/os2/private.h"
|
||||||
|
|
||||||
#if !USE_SHARED_LIBRARY
|
#if !USE_SHARED_LIBRARY
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxSlider, wxControl)
|
IMPLEMENT_DYNAMIC_CLASS(wxSlider, wxControl)
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxSlider, wxControl)
|
|
||||||
END_EVENT_TABLE()
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Slider
|
// Slider
|
||||||
wxSlider::wxSlider()
|
wxSlider::wxSlider()
|
||||||
{
|
{
|
||||||
|
m_staticValue = 0;
|
||||||
|
m_staticMin = 0;
|
||||||
|
m_staticMax = 0;
|
||||||
m_pageSize = 1;
|
m_pageSize = 1;
|
||||||
m_lineSize = 1;
|
m_lineSize = 1;
|
||||||
m_rangeMax = 0;
|
m_rangeMax = 0;
|
||||||
@@ -65,8 +72,90 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool wxSlider::OS2OnScroll(int WXUNUSED(orientation), WXWORD wParam,
|
||||||
|
WXWORD pos, WXHWND control)
|
||||||
|
{
|
||||||
|
int position = 0; // Dummy - not used in this mode
|
||||||
|
|
||||||
|
int nScrollInc;
|
||||||
|
wxEventType scrollEvent = wxEVT_NULL;
|
||||||
|
// TODO:
|
||||||
|
/*
|
||||||
|
switch ( wParam )
|
||||||
|
{
|
||||||
|
case SB_TOP:
|
||||||
|
nScrollInc = m_rangeMax - position;
|
||||||
|
scrollEvent = wxEVT_SCROLL_TOP;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SB_BOTTOM:
|
||||||
|
nScrollInc = - position;
|
||||||
|
scrollEvent = wxEVT_SCROLL_BOTTOM;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SB_LINEUP:
|
||||||
|
nScrollInc = - GetLineSize();
|
||||||
|
scrollEvent = wxEVT_SCROLL_LINEUP;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SB_LINEDOWN:
|
||||||
|
nScrollInc = GetLineSize();
|
||||||
|
scrollEvent = wxEVT_SCROLL_LINEDOWN;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SB_PAGEUP:
|
||||||
|
nScrollInc = -GetPageSize();
|
||||||
|
scrollEvent = wxEVT_SCROLL_PAGEUP;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SB_PAGEDOWN:
|
||||||
|
nScrollInc = GetPageSize();
|
||||||
|
scrollEvent = wxEVT_SCROLL_PAGEDOWN;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SB_THUMBTRACK:
|
||||||
|
case SB_THUMBPOSITION:
|
||||||
|
#ifdef __WIN32__
|
||||||
|
nScrollInc = (signed short)pos - position;
|
||||||
|
#else // Win16
|
||||||
|
nScrollInc = pos - position;
|
||||||
|
#endif // Win32/16
|
||||||
|
scrollEvent = wxEVT_SCROLL_THUMBTRACK;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
nScrollInc = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( nScrollInc == 0 )
|
||||||
|
{
|
||||||
|
// no event...
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
int newPos = (int)::SendMessage((HWND) control, TBM_GETPOS, 0, 0);
|
||||||
|
if ( (newPos < GetMin()) || (newPos > GetMax()) )
|
||||||
|
{
|
||||||
|
// out of range - but we did process it
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
SetValue(newPos);
|
||||||
|
|
||||||
|
wxScrollEvent event(scrollEvent, m_windowId);
|
||||||
|
event.SetPosition(newPos);
|
||||||
|
event.SetEventObject( this );
|
||||||
|
GetEventHandler()->ProcessEvent(event);
|
||||||
|
|
||||||
|
wxCommandEvent cevent( wxEVT_COMMAND_SLIDER_UPDATED, GetId() );
|
||||||
|
cevent.SetEventObject( this );
|
||||||
|
|
||||||
|
return GetEventHandler()->ProcessEvent( cevent );
|
||||||
|
}
|
||||||
|
|
||||||
wxSlider::~wxSlider()
|
wxSlider::~wxSlider()
|
||||||
{
|
{
|
||||||
|
// TODO:
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxSlider::GetValue() const
|
int wxSlider::GetValue() const
|
||||||
@@ -90,9 +179,167 @@ void wxSlider::GetPosition(int *x, int *y) const
|
|||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxSlider::SetSize(int x, int y, int width, int height, int sizeFlags)
|
// TODO one day, make sense of all this horros and replace it with a readable
|
||||||
|
// DoGetBestSize()
|
||||||
|
void wxSlider::DoSetSize(int x, int y, int width, int height, int sizeFlags)
|
||||||
{
|
{
|
||||||
// TODO
|
int x1 = x;
|
||||||
|
int y1 = y;
|
||||||
|
int w1 = width;
|
||||||
|
int h1 = height;
|
||||||
|
|
||||||
|
int currentX, currentY;
|
||||||
|
GetPosition(¤tX, ¤tY);
|
||||||
|
if (x == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
|
||||||
|
x1 = currentX;
|
||||||
|
if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
|
||||||
|
y1 = currentY;
|
||||||
|
|
||||||
|
// TODO:
|
||||||
|
/*
|
||||||
|
|
||||||
|
AdjustForParentClientOrigin(x1, y1, sizeFlags);
|
||||||
|
|
||||||
|
wxChar buf[300];
|
||||||
|
|
||||||
|
int x_offset = x;
|
||||||
|
int y_offset = y;
|
||||||
|
|
||||||
|
int cx; // slider,min,max sizes
|
||||||
|
int cy;
|
||||||
|
int cyf;
|
||||||
|
|
||||||
|
wxGetCharSize(GetHWND(), &cx, &cy, & this->GetFont());
|
||||||
|
|
||||||
|
if ((m_windowStyle & wxSL_VERTICAL) != wxSL_VERTICAL)
|
||||||
|
{
|
||||||
|
if ( m_windowStyle & wxSL_LABELS )
|
||||||
|
{
|
||||||
|
int min_len = 0;
|
||||||
|
|
||||||
|
GetWindowText((HWND) m_staticMin, buf, 300);
|
||||||
|
GetTextExtent(buf, &min_len, &cyf,NULL,NULL, & this->GetFont());
|
||||||
|
|
||||||
|
int max_len = 0;
|
||||||
|
|
||||||
|
GetWindowText((HWND) m_staticMax, buf, 300);
|
||||||
|
GetTextExtent(buf, &max_len, &cyf,NULL,NULL, & this->GetFont());
|
||||||
|
if (m_staticValue)
|
||||||
|
{
|
||||||
|
int new_width = (int)(wxMax(min_len, max_len));
|
||||||
|
int valueHeight = (int)cyf;
|
||||||
|
#ifdef __WIN32__
|
||||||
|
// For some reason, under Win95, the text edit control has
|
||||||
|
// a lot of space before the first character
|
||||||
|
new_width += 3*cx;
|
||||||
|
#endif
|
||||||
|
// The height needs to be a bit bigger under Win95 if using native
|
||||||
|
// 3D effects.
|
||||||
|
valueHeight = (int) (valueHeight * 1.5) ;
|
||||||
|
MoveWindow((HWND) m_staticValue, x_offset, y_offset, new_width, valueHeight, TRUE);
|
||||||
|
x_offset += new_width + cx;
|
||||||
|
}
|
||||||
|
|
||||||
|
MoveWindow((HWND) m_staticMin, x_offset, y_offset, (int)min_len, cy, TRUE);
|
||||||
|
x_offset += (int)(min_len + cx);
|
||||||
|
|
||||||
|
int slider_length = (int)(w1 - x_offset - max_len - cx);
|
||||||
|
|
||||||
|
int slider_height = h1;
|
||||||
|
if (slider_height < 0 )
|
||||||
|
slider_height = 20;
|
||||||
|
|
||||||
|
// Slider must have a minimum/default length/height
|
||||||
|
if (slider_length < 100)
|
||||||
|
slider_length = 100;
|
||||||
|
|
||||||
|
MoveWindow(GetHwnd(), x_offset, y_offset, slider_length, slider_height, TRUE);
|
||||||
|
x_offset += slider_length + cx;
|
||||||
|
|
||||||
|
MoveWindow((HWND) m_staticMax, x_offset, y_offset, (int)max_len, cy, TRUE);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// No labels
|
||||||
|
// If we're prepared to use the existing size, then...
|
||||||
|
if (width == -1 && height == -1 && ((sizeFlags & wxSIZE_AUTO) != wxSIZE_AUTO))
|
||||||
|
{
|
||||||
|
GetSize(&w1, &h1);
|
||||||
|
}
|
||||||
|
if ( w1 < 0 )
|
||||||
|
w1 = 200;
|
||||||
|
if ( h1 < 0 )
|
||||||
|
h1 = 20;
|
||||||
|
MoveWindow(GetHwnd(), x1, y1, w1, h1, TRUE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( m_windowStyle & wxSL_LABELS )
|
||||||
|
{
|
||||||
|
int min_len;
|
||||||
|
GetWindowText((HWND) m_staticMin, buf, 300);
|
||||||
|
GetTextExtent(buf, &min_len, &cyf,NULL,NULL, & this->GetFont());
|
||||||
|
|
||||||
|
int max_len;
|
||||||
|
GetWindowText((HWND) m_staticMax, buf, 300);
|
||||||
|
GetTextExtent(buf, &max_len, &cyf,NULL,NULL, & this->GetFont());
|
||||||
|
|
||||||
|
if (m_staticValue)
|
||||||
|
{
|
||||||
|
int new_width = (int)(wxMax(min_len, max_len));
|
||||||
|
int valueHeight = (int)cyf;
|
||||||
|
//// Suggested change by George Tasker - remove this block...
|
||||||
|
#ifdef __WIN32__
|
||||||
|
// For some reason, under Win95, the text edit control has
|
||||||
|
// a lot of space before the first character
|
||||||
|
new_width += 3*cx;
|
||||||
|
#endif
|
||||||
|
... and replace with following line:
|
||||||
|
new_width += cx;
|
||||||
|
|
||||||
|
// The height needs to be a bit bigger under Win95 if using native
|
||||||
|
// 3D effects.
|
||||||
|
valueHeight = (int) (valueHeight * 1.5) ;
|
||||||
|
|
||||||
|
MoveWindow((HWND) m_staticValue, x_offset, y_offset, new_width, valueHeight, TRUE);
|
||||||
|
y_offset += valueHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
MoveWindow((HWND) m_staticMin, x_offset, y_offset, (int)min_len, cy, TRUE);
|
||||||
|
y_offset += cy;
|
||||||
|
|
||||||
|
int slider_length = (int)(h1 - y_offset - cy - cy);
|
||||||
|
|
||||||
|
int slider_width = w1;
|
||||||
|
if (slider_width < 0 )
|
||||||
|
slider_width = 20;
|
||||||
|
|
||||||
|
// Slider must have a minimum/default length
|
||||||
|
if (slider_length < 100)
|
||||||
|
slider_length = 100;
|
||||||
|
|
||||||
|
MoveWindow(GetHwnd(), x_offset, y_offset, slider_width, slider_length, TRUE);
|
||||||
|
y_offset += slider_length;
|
||||||
|
|
||||||
|
MoveWindow((HWND) m_staticMax, x_offset, y_offset, (int)max_len, cy, TRUE);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// No labels
|
||||||
|
// If we're prepared to use the existing size, then...
|
||||||
|
if (width == -1 && height == -1 && ((sizeFlags & wxSIZE_AUTO) != wxSIZE_AUTO))
|
||||||
|
{
|
||||||
|
GetSize(&w1, &h1);
|
||||||
|
}
|
||||||
|
if ( w1 < 0 )
|
||||||
|
w1 = 20;
|
||||||
|
if ( h1 < 0 )
|
||||||
|
h1 = 200;
|
||||||
|
MoveWindow(GetHwnd(), x1, y1, w1, h1, TRUE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxSlider::SetRange(int minValue, int maxValue)
|
void wxSlider::SetRange(int minValue, int maxValue)
|
||||||
@@ -103,6 +350,29 @@ void wxSlider::SetRange(int minValue, int maxValue)
|
|||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WXHBRUSH wxSlider::OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
|
||||||
|
WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
|
||||||
|
{
|
||||||
|
// TODO:
|
||||||
|
/*
|
||||||
|
if ( nCtlColor == CTLCOLOR_SCROLLBAR )
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Otherwise, it's a static
|
||||||
|
if (GetParent()->GetTransparentBackground())
|
||||||
|
SetBkMode((HDC) pDC, TRANSPARENT);
|
||||||
|
else
|
||||||
|
SetBkMode((HDC) pDC, OPAQUE);
|
||||||
|
|
||||||
|
::SetBkColor((HDC) pDC, RGB(GetBackgroundColour().Red(), GetBackgroundColour().Green(), GetBackgroundColour().Blue()));
|
||||||
|
::SetTextColor((HDC) pDC, RGB(GetForegroundColour().Red(), GetForegroundColour().Green(), GetForegroundColour().Blue()));
|
||||||
|
|
||||||
|
wxBrush *backgroundBrush = wxTheBrushList->FindOrCreateBrush(GetBackgroundColour(), wxSOLID);
|
||||||
|
return (WXHBRUSH) backgroundBrush->GetResourceHandle();
|
||||||
|
*/
|
||||||
|
return (WXHBRUSH)0;
|
||||||
|
}
|
||||||
|
|
||||||
// For trackbars only
|
// For trackbars only
|
||||||
void wxSlider::SetTickFreq(int n, int pos)
|
void wxSlider::SetTickFreq(int n, int pos)
|
||||||
{
|
{
|
||||||
@@ -176,6 +446,11 @@ void wxSlider::SetTick(int tickPos)
|
|||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool wxSlider::ContainsHWND(WXHWND hWnd) const
|
||||||
|
{
|
||||||
|
return ( hWnd == GetStaticMin() || hWnd == GetStaticMax() || hWnd == GetEditValue() );
|
||||||
|
}
|
||||||
|
|
||||||
void wxSlider::Command (wxCommandEvent & event)
|
void wxSlider::Command (wxCommandEvent & event)
|
||||||
{
|
{
|
||||||
SetValue (event.GetInt());
|
SetValue (event.GetInt());
|
||||||
|
@@ -1,32 +1,49 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: spinbutt.cpp
|
// Name: spinbutt.cpp
|
||||||
// Purpose: wxSpinButton
|
// Purpose: wxSpinButton
|
||||||
// Author: AUTHOR
|
// Author: David Webster
|
||||||
// Modified by:
|
// Modified by:
|
||||||
// Created: ??/??/98
|
// Created: 10/15/99
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) AUTHOR
|
// Copyright: (c) David Webster
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifdef __GNUG__
|
// For compilers that support precompilation, includes "wx.h".
|
||||||
#pragma implementation "spinbutt.h"
|
#include "wx/wxprec.h"
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef WX_PRECOMP
|
||||||
|
#include "wx/wx.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Can't resolve reference to CreateUpDownControl in
|
||||||
|
// TWIN32, but could probably use normal CreateWindow instead.
|
||||||
|
|
||||||
|
|
||||||
#include "wx/spinbutt.h"
|
#include "wx/spinbutt.h"
|
||||||
|
#include "wx/os2/private.h"
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// implementation
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// wxWin macros
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
#if !USE_SHARED_LIBRARY
|
#if !USE_SHARED_LIBRARY
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxSpinButton, wxControl)
|
IMPLEMENT_DYNAMIC_CLASS(wxSpinButton, wxControl)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
wxSpinButton::wxSpinButton()
|
bool wxSpinButton::Create(
|
||||||
{
|
wxWindow* parent
|
||||||
m_min = 0;
|
, wxWindowID id
|
||||||
m_max = 100;
|
, const wxPoint& pos
|
||||||
}
|
, const wxSize& size
|
||||||
|
, long style
|
||||||
bool wxSpinButton::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
|
, const wxString& name
|
||||||
long style, const wxString& name)
|
)
|
||||||
{
|
{
|
||||||
SetName(name);
|
SetName(name);
|
||||||
|
|
||||||
@@ -47,8 +64,33 @@ wxSpinButton::~wxSpinButton()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// size calculation
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
wxSize wxSpinButton::DoGetBestSize()
|
||||||
|
{
|
||||||
|
// TODO:
|
||||||
|
/*
|
||||||
|
if ( (GetWindowStyle() & wxSP_VERTICAL) != 0 )
|
||||||
|
{
|
||||||
|
// vertical control
|
||||||
|
return wxSize(GetSystemMetrics(SM_CXVSCROLL),
|
||||||
|
2*GetSystemMetrics(SM_CYVSCROLL));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// horizontal control
|
||||||
|
return wxSize(2*GetSystemMetrics(SM_CXHSCROLL),
|
||||||
|
GetSystemMetrics(SM_CYHSCROLL));
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
return wxSize(0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
// Attributes
|
// Attributes
|
||||||
////////////////////////////////////////////////////////////////////////////
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
int wxSpinButton::GetValue() const
|
int wxSpinButton::GetValue() const
|
||||||
{
|
{
|
||||||
@@ -63,16 +105,54 @@ void wxSpinButton::SetValue(int val)
|
|||||||
|
|
||||||
void wxSpinButton::SetRange(int minVal, int maxVal)
|
void wxSpinButton::SetRange(int minVal, int maxVal)
|
||||||
{
|
{
|
||||||
m_min = minVal;
|
|
||||||
m_max = maxVal;
|
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
// Spin event
|
bool wxSpinButton::OS2OnScroll(int orientation, WXWORD wParam,
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxSpinEvent, wxScrollEvent)
|
WXWORD pos, WXHWND control)
|
||||||
|
|
||||||
wxSpinEvent::wxSpinEvent(wxEventType commandType, int id):
|
|
||||||
wxScrollEvent(commandType, id)
|
|
||||||
{
|
{
|
||||||
|
wxCHECK_MSG( control, FALSE, wxT("scrolling what?") )
|
||||||
|
// TODO:
|
||||||
|
/*
|
||||||
|
if ( wParam != SB_THUMBPOSITION )
|
||||||
|
{
|
||||||
|
// probable SB_ENDSCROLL - we don't react to it
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxSpinEvent event(wxEVT_SCROLL_THUMBTRACK, m_windowId);
|
||||||
|
event.SetPosition((short)pos); // cast is important for negative values!
|
||||||
|
event.SetEventObject(this);
|
||||||
|
|
||||||
|
return GetEventHandler()->ProcessEvent(event);
|
||||||
|
*/
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxSpinButton::OS2OnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
|
||||||
|
{
|
||||||
|
// TODO:
|
||||||
|
/*
|
||||||
|
LPNM_UPDOWN lpnmud = (LPNM_UPDOWN)lParam;
|
||||||
|
|
||||||
|
wxSpinEvent event(lpnmud->iDelta > 0 ? wxEVT_SCROLL_LINEUP
|
||||||
|
: wxEVT_SCROLL_LINEDOWN,
|
||||||
|
m_windowId);
|
||||||
|
event.SetPosition(lpnmud->iPos + lpnmud->iDelta);
|
||||||
|
event.SetEventObject(this);
|
||||||
|
|
||||||
|
bool processed = GetEventHandler()->ProcessEvent(event);
|
||||||
|
|
||||||
|
*result = event.IsAllowed() ? 0 : 1;
|
||||||
|
|
||||||
|
return processed;
|
||||||
|
*/
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxSpinButton::MSWCommand(WXUINT cmd, WXWORD id)
|
||||||
|
{
|
||||||
|
// No command messages
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
158
src/os2/spinctrl.cpp
Normal file
158
src/os2/spinctrl.cpp
Normal file
@@ -0,0 +1,158 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: msw/spinctrl.cpp
|
||||||
|
// Purpose: wxSpinCtrl class implementation for Win32
|
||||||
|
// Author: David Webster
|
||||||
|
// Modified by:
|
||||||
|
// Created: 10/15/99
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) David Webster
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// declarations
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// headers
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// for compilers that support precompilation, includes "wx.h".
|
||||||
|
#include "wx/wxprec.h"
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef WX_PRECOMP
|
||||||
|
#include "wx/wx.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "wx/spinctrl.h"
|
||||||
|
#include "wx/os2/private.h"
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// macros
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#if !USE_SHARED_LIBRARY
|
||||||
|
IMPLEMENT_DYNAMIC_CLASS(wxSpinCtrl, wxControl)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// constants
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// the margin between the up-down control and its buddy
|
||||||
|
static const int MARGIN_BETWEEN = 5;
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// implementation
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// construction
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
bool wxSpinCtrl::Create(wxWindow *parent,
|
||||||
|
wxWindowID id,
|
||||||
|
const wxPoint& pos,
|
||||||
|
const wxSize& size,
|
||||||
|
long style,
|
||||||
|
int min, int max, int initial,
|
||||||
|
const wxString& name)
|
||||||
|
{
|
||||||
|
// TODO:
|
||||||
|
/*
|
||||||
|
// before using DoGetBestSize(), have to set style to let the base class
|
||||||
|
// know whether this is a horizontal or vertical control (we're always
|
||||||
|
// vertical)
|
||||||
|
SetWindowStyle(style | wxSP_VERTICAL);
|
||||||
|
|
||||||
|
// calculate the sizes: the size given is the toal size for both controls
|
||||||
|
// and we need to fit them both in the given width (height is the same)
|
||||||
|
wxSize sizeText(size), sizeBtn(size);
|
||||||
|
sizeBtn.x = wxSpinButton::DoGetBestSize().x;
|
||||||
|
sizeText.x -= sizeBtn.x + MARGIN_BETWEEN;
|
||||||
|
if ( sizeText.x <= 0 )
|
||||||
|
{
|
||||||
|
wxLogDebug(_T("not enough space for wxSpinCtrl!"));
|
||||||
|
}
|
||||||
|
|
||||||
|
wxPoint posBtn(pos);
|
||||||
|
posBtn.x += sizeText.x + MARGIN_BETWEEN;
|
||||||
|
|
||||||
|
// create the spin button
|
||||||
|
if ( !wxSpinButton::Create(parent, id, posBtn, sizeBtn, style, name) )
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
SetRange(min, max);
|
||||||
|
SetValue(initial);
|
||||||
|
|
||||||
|
// create the text window
|
||||||
|
if ( sizeText.y <= 0 )
|
||||||
|
{
|
||||||
|
// make it the same height as the button then
|
||||||
|
int x, y;
|
||||||
|
wxSpinButton::DoGetSize(&x, &y);
|
||||||
|
|
||||||
|
sizeText.y = y;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_hwndBuddy = (WXHWND)::CreateWindowEx
|
||||||
|
(
|
||||||
|
WS_EX_CLIENTEDGE, // sunken border
|
||||||
|
_T("EDIT"), // window class
|
||||||
|
NULL, // no window title
|
||||||
|
WS_CHILD | WS_VISIBLE | WS_BORDER, // style
|
||||||
|
pos.x, pos.y, // position
|
||||||
|
sizeText.x, sizeText.y, // size
|
||||||
|
GetHwndOf(parent), // parent
|
||||||
|
(HMENU)-1, // control id
|
||||||
|
wxGetInstance(), // app instance
|
||||||
|
NULL // unused client data
|
||||||
|
);
|
||||||
|
|
||||||
|
if ( !m_hwndBuddy )
|
||||||
|
{
|
||||||
|
wxLogLastError("CreateWindow(buddy text window)");
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// should have the same font as the other controls
|
||||||
|
WXHANDLE hFont = GetParent()->GetFont().GetResourceHandle();
|
||||||
|
::SendMessage((HWND)m_hwndBuddy, WM_SETFONT, (WPARAM)hFont, TRUE);
|
||||||
|
|
||||||
|
// associate the text window with the spin button
|
||||||
|
(void)SendMessage(GetHwnd(), UDM_SETBUDDY, (WPARAM)m_hwndBuddy, 0);
|
||||||
|
*/
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// size calculations
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void wxSpinCtrl::DoMoveWindow(int x, int y, int width, int height)
|
||||||
|
{
|
||||||
|
int widthBtn = DoGetBestSize().x;
|
||||||
|
int widthText = width - widthBtn - MARGIN_BETWEEN;
|
||||||
|
if ( widthText <= 0 )
|
||||||
|
{
|
||||||
|
wxLogDebug(_T("not enough space for wxSpinCtrl!"));
|
||||||
|
}
|
||||||
|
// TODO:
|
||||||
|
/*
|
||||||
|
if ( !::MoveWindow((HWND)m_hwndBuddy, x, y, widthText, height, TRUE) )
|
||||||
|
{
|
||||||
|
wxLogLastError("MoveWindow(buddy)");
|
||||||
|
}
|
||||||
|
|
||||||
|
x += widthText + MARGIN_BETWEEN;
|
||||||
|
if ( !::MoveWindow(GetHwnd(), x, y, widthBtn, height, TRUE) )
|
||||||
|
{
|
||||||
|
wxLogLastError("MoveWindow");
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
@@ -1,27 +1,38 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: statbmp.cpp
|
// Name: statbmp.cpp
|
||||||
// Purpose: wxStaticBitmap
|
// Purpose: wxStaticBitmap
|
||||||
// Author: AUTHOR
|
// Author: David Webster
|
||||||
// Modified by:
|
// Modified by:
|
||||||
// Created: ??/??/98
|
// Created: ??/??/98
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) AUTHOR
|
// Copyright: (c) David Webster
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifdef __GNUG__
|
// For compilers that support precompilation, includes "wx.h".
|
||||||
#pragma implementation "statbmp.h"
|
#include "wx/wxprec.h"
|
||||||
|
|
||||||
|
#include "wx/window.h"
|
||||||
|
#include "wx/os2/private.h"
|
||||||
|
|
||||||
|
#ifndef WX_PRECOMP
|
||||||
|
#include "wx/icon.h"
|
||||||
|
#include "wx/statbmp.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/statbmp.h"
|
#include <stdio.h>
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
// macors
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
#if !USE_SHARED_LIBRARY
|
#if !USE_SHARED_LIBRARY
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap, wxControl)
|
IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap, wxControl)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
// ---------------------------------------------------------------------------
|
||||||
* wxStaticBitmap
|
// wxStaticBitmap
|
||||||
*/
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID id,
|
bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID id,
|
||||||
const wxBitmap& bitmap,
|
const wxBitmap& bitmap,
|
||||||
@@ -45,15 +56,49 @@ bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID id,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxStaticBitmap::SetSize(int x, int y, int width, int height, int sizeFlags)
|
bool wxStaticBitmap::ImageIsOk() const
|
||||||
{
|
{
|
||||||
// TODO
|
if ( m_isIcon && m_image.icon )
|
||||||
|
return m_image.icon->Ok();
|
||||||
|
else if ( m_image.bitmap )
|
||||||
|
return m_image.bitmap->Ok();
|
||||||
|
else
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxStaticBitmap::Free()
|
||||||
|
{
|
||||||
|
if ( m_isIcon )
|
||||||
|
delete m_image.icon;
|
||||||
|
else
|
||||||
|
delete m_image.bitmap;
|
||||||
|
|
||||||
|
m_image.icon = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxSize wxStaticBitmap::DoGetBestSize()
|
||||||
|
{
|
||||||
|
// reuse the current size (as wxWindow does) instead of using some
|
||||||
|
// arbitrary default size (as wxControl, our immediate base class, does)
|
||||||
|
return wxWindow::DoGetBestSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxStaticBitmap::SetBitmap(const wxBitmap& bitmap)
|
void wxStaticBitmap::SetBitmap(const wxBitmap& bitmap)
|
||||||
{
|
{
|
||||||
m_messageBitmap = bitmap;
|
Free();
|
||||||
|
|
||||||
|
m_isIcon = bitmap.IsKindOf(CLASSINFO(wxIcon));
|
||||||
|
if ( m_isIcon )
|
||||||
|
m_image.icon = new wxIcon((const wxIcon&)bitmap);
|
||||||
|
else
|
||||||
|
m_image.bitmap = new wxBitmap(bitmap);
|
||||||
|
|
||||||
|
int x, y;
|
||||||
|
int w, h;
|
||||||
|
GetPosition(&x, &y);
|
||||||
|
GetSize(&w, &h);
|
||||||
|
|
||||||
// TODO: redraw bitmap
|
// TODO: redraw bitmap
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,16 +1,23 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: statbox.cpp
|
// Name: statbox.cpp
|
||||||
// Purpose: wxStaticBox
|
// Purpose: wxStaticBox
|
||||||
// Author: AUTHOR
|
// Author: David Webster
|
||||||
// Modified by:
|
// Modified by:
|
||||||
// Created: ??/??/98
|
// Created: ??/??/98
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) AUTHOR
|
// Copyright: (c) David Webster
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifdef __GNUG__
|
// For compilers that support precompilation, includes "wx.h".
|
||||||
#pragma implementation "statbox.h"
|
#include "wx/wxprec.h"
|
||||||
|
|
||||||
|
#include "wx/window.h"
|
||||||
|
#include "wx/os2/private.h"
|
||||||
|
|
||||||
|
#ifndef WX_PRECOMP
|
||||||
|
#include "wx/app.h"
|
||||||
|
#include "wx/dcclient.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/statbox.h"
|
#include "wx/statbox.h"
|
||||||
@@ -25,7 +32,7 @@ END_EVENT_TABLE()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Static box
|
* Group box
|
||||||
*/
|
*/
|
||||||
|
|
||||||
bool wxStaticBox::Create(wxWindow *parent, wxWindowID id,
|
bool wxStaticBox::Create(wxWindow *parent, wxWindowID id,
|
||||||
@@ -39,24 +46,152 @@ bool wxStaticBox::Create(wxWindow *parent, wxWindowID id,
|
|||||||
|
|
||||||
if (parent) parent->AddChild(this);
|
if (parent) parent->AddChild(this);
|
||||||
|
|
||||||
|
SetBackgroundColour(parent->GetBackgroundColour()) ;
|
||||||
|
SetForegroundColour(parent->GetForegroundColour()) ;
|
||||||
|
|
||||||
if ( id == -1 )
|
if ( id == -1 )
|
||||||
m_windowId = (int)NewControlId();
|
m_windowId = (int)NewControlId();
|
||||||
else
|
else
|
||||||
m_windowId = id;
|
m_windowId = id;
|
||||||
|
|
||||||
|
int x = pos.x;
|
||||||
|
int y = pos.y;
|
||||||
|
int width = size.x;
|
||||||
|
int height = size.y;
|
||||||
|
|
||||||
m_windowStyle = style;
|
m_windowStyle = style;
|
||||||
|
|
||||||
// TODO: create static box
|
// TODO:
|
||||||
|
/*
|
||||||
|
long msStyle = BS_GROUPBOX | WS_CHILD | WS_VISIBLE ; // GROUP_FLAGS;
|
||||||
|
|
||||||
|
bool want3D;
|
||||||
|
WXDWORD exStyle = Determine3DEffects(0, &want3D) ;
|
||||||
|
|
||||||
|
HWND wx_button =
|
||||||
|
CreateWindowEx(exStyle, wxT("BUTTON"), (const wxChar *)label, msStyle,
|
||||||
|
0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)m_windowId,
|
||||||
|
wxGetInstance(), NULL);
|
||||||
|
#if wxUSE_CTL3D
|
||||||
|
if (want3D)
|
||||||
|
{
|
||||||
|
Ctl3dSubclassCtl(wx_button);
|
||||||
|
m_useCtl3D = TRUE;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
m_hWnd = (WXHWND)wx_button;
|
||||||
|
|
||||||
|
// Subclass again for purposes of dialog editing mode
|
||||||
|
SubclassWin(GetHWND());
|
||||||
|
|
||||||
|
SetFont(parent->GetFont());
|
||||||
|
|
||||||
|
SetSize(x, y, width, height);
|
||||||
|
ShowWindow(wx_button, SW_SHOW);
|
||||||
|
*/
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxStaticBox::SetLabel(const wxString& label)
|
wxSize wxStaticBox::DoGetBestSize()
|
||||||
{
|
{
|
||||||
// TODO
|
int cx, cy;
|
||||||
|
wxGetCharSize(GetHWND(), &cx, &cy, &GetFont());
|
||||||
|
|
||||||
|
int wBox;
|
||||||
|
GetTextExtent(wxGetWindowText(m_hWnd), &wBox, &cy);
|
||||||
|
|
||||||
|
wBox += 3*cx;
|
||||||
|
int hBox = EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy);
|
||||||
|
|
||||||
|
return wxSize(wBox, hBox);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxStaticBox::SetSize(int x, int y, int width, int height, int sizeFlags)
|
WXHBRUSH wxStaticBox::OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
|
||||||
|
WXUINT message,
|
||||||
|
WXWPARAM wParam,
|
||||||
|
WXLPARAM lParam)
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO:
|
||||||
|
/*
|
||||||
|
if (GetParent()->GetTransparentBackground())
|
||||||
|
SetBkMode((HDC) pDC, TRANSPARENT);
|
||||||
|
else
|
||||||
|
SetBkMode((HDC) pDC, OPAQUE);
|
||||||
|
|
||||||
|
::SetBkColor((HDC) pDC, RGB(GetBackgroundColour().Red(), GetBackgroundColour().Green(), GetBackgroundColour().Blue()));
|
||||||
|
::SetTextColor((HDC) pDC, RGB(GetForegroundColour().Red(), GetForegroundColour().Green(), GetForegroundColour().Blue()));
|
||||||
|
|
||||||
|
wxBrush *backgroundBrush = wxTheBrushList->FindOrCreateBrush(GetBackgroundColour(), wxSOLID);
|
||||||
|
|
||||||
|
// Note that this will be cleaned up in wxApp::OnIdle, if backgroundBrush
|
||||||
|
// has a zero usage count.
|
||||||
|
// backgroundBrush->RealizeResource();
|
||||||
|
return (WXHBRUSH) backgroundBrush->GetResourceHandle();
|
||||||
|
*/
|
||||||
|
return (WXHBRUSH)0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Shouldn't erase the whole window, since the static box must only paint its
|
||||||
|
// outline.
|
||||||
|
void wxStaticBox::OnEraseBackground(wxEraseEvent& event)
|
||||||
|
{
|
||||||
|
// If we don't have this (call Default()), we don't paint the background properly.
|
||||||
|
// If we do have this, we seem to overwrite enclosed controls.
|
||||||
|
// Is it the WS_CLIPCHILDREN style that's causing the problems?
|
||||||
|
// Probably - without this style, the background of the window will show through,
|
||||||
|
// so the control doesn't have to paint it. The window background will always be
|
||||||
|
// painted before all other controls, therefore there are no problems with
|
||||||
|
// controls being hidden by the static box.
|
||||||
|
// So, if we could specify wxCLIP_CHILDREN in window, or not, we could optimise painting better.
|
||||||
|
// We would assume wxCLIP_CHILDREN in a frame and a scrolled window, but not in a panel.
|
||||||
|
// Is this too platform-specific?? What else can we do? Not a lot, since we have to pass
|
||||||
|
// this information from arbitrary wxWindow derivatives, and it depends on what you wish to
|
||||||
|
// do with the windows.
|
||||||
|
// Alternatively, just make sure that wxStaticBox is always at the back! There are probably
|
||||||
|
// few other circumstances where it matters about child clipping. But what about painting onto
|
||||||
|
// to panel, inside a groupbox? Doesn't appear, because the box wipes it out.
|
||||||
|
wxWindow *parent = GetParent();
|
||||||
|
// TODO:
|
||||||
|
/*
|
||||||
|
if ( parent && parent->GetHWND() && (::GetWindowLong((HWND) parent->GetHWND(), GWL_STYLE) & WS_CLIPCHILDREN) )
|
||||||
|
{
|
||||||
|
// TODO: May in fact need to generate a paint event for inside this
|
||||||
|
// control's rectangle, otherwise all controls are going to be clipped -
|
||||||
|
// ugh.
|
||||||
|
HBRUSH hBrush = ::CreateSolidBrush(PALETTERGB(GetBackgroundColour().Red(), GetBackgroundColour().Green(), GetBackgroundColour().Blue()));
|
||||||
|
int mode = ::SetMapMode((HDC) event.GetDC()->GetHDC(), MM_TEXT);
|
||||||
|
|
||||||
|
RECT rect;
|
||||||
|
|
||||||
|
::GetClientRect(GetHwnd(), &rect);
|
||||||
|
::FillRect ((HDC) event.GetDC()->GetHDC(), &rect, hBrush);
|
||||||
|
::DeleteObject(hBrush);
|
||||||
|
::SetMapMode((HDC) event.GetDC()->GetHDC(), mode);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
event.Skip();
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
MRESULT wxStaticBox::OS2WindowProc(HWND hwnd, WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
|
||||||
|
{
|
||||||
|
if ( nMsg == WM_NCHITTEST)
|
||||||
|
{
|
||||||
|
int xPos = LOWORD(lParam); // horizontal position of cursor
|
||||||
|
int yPos = HIWORD(lParam); // vertical position of cursor
|
||||||
|
|
||||||
|
// ScreenToClient(&xPos, &yPos);
|
||||||
|
|
||||||
|
// Make sure you can drag by the top of the groupbox, but let
|
||||||
|
// other (enclosed) controls get mouse events also
|
||||||
|
if (yPos < 10)
|
||||||
|
return (long)HTCLIENT;
|
||||||
|
}
|
||||||
|
|
||||||
|
return wxControl::OS2WindowProc(hwnd, nMsg, wParam, lParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user