*** empty log message ***
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3235 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -178,6 +178,8 @@ private:
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#include "wx/msw/caret.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/caret.h"
|
||||
#else
|
||||
#include "wx/generic/caret.h"
|
||||
#endif // platform
|
||||
|
@@ -104,6 +104,11 @@ private:
|
||||
|
||||
// the type of the client data for the items
|
||||
wxClientDataType m_clientDataItemsType;
|
||||
// the above pure virtuals hide these virtuals in wxWindowBase
|
||||
virtual void DoSetClientData(void* clientData ) { wxWindowBase::DoSetClientData(clientData); };
|
||||
virtual void* DoGetClientData() const { return(wxWindowBase::DoGetClientData()); };
|
||||
virtual void DoSetClientObject( wxClientData* clientData ) { wxWindowBase::DoSetClientObject(clientData); };
|
||||
virtual wxClientData* DoGetClientObject() const { return(wxWindowBase::DoGetClientObject()); };
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@@ -23,7 +23,7 @@
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/dnd.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/dnd.h"
|
||||
#include "wx/os2/dataobj.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/dnd.h"
|
||||
#endif
|
||||
|
@@ -1420,6 +1420,27 @@ typedef void * WXDRAWITEMSTRUCT;
|
||||
typedef void * WXMEASUREITEMSTRUCT;
|
||||
typedef void * WXLPCREATESTRUCT;
|
||||
|
||||
#if defined(__WXPM__)
|
||||
typedef unsigned long WXMPARAM;
|
||||
typedef unsigned long WXMSGID;
|
||||
typedef void* WXRESULT;
|
||||
typedef int (*WXFARPROC)();
|
||||
// some windows handles not defined by PM
|
||||
typedef unsigned long HANDLE;
|
||||
typedef unsigned long HICON;
|
||||
typedef unsigned long HFONT;
|
||||
typedef unsigned long HMENU;
|
||||
typedef unsigned long HPEN;
|
||||
typedef unsigned long HBRUSH;
|
||||
typedef unsigned long HPALETTE;
|
||||
typedef unsigned long HCURSOR;
|
||||
typedef unsigned long HINSTANCE;
|
||||
typedef unsigned long HIMAGELIST;
|
||||
typedef unsigned long HGLOBAL;
|
||||
typedef unsigned long DWORD;
|
||||
typedef unsigned short WORD;
|
||||
#endif
|
||||
|
||||
#if defined(__GNUWIN32__) || defined(__WXWINE__)
|
||||
typedef int (*WXFARPROC)();
|
||||
#elif defined(__WIN32__)
|
||||
|
@@ -96,6 +96,11 @@ public:
|
||||
virtual wxInputStream& LoadObject(wxInputStream& stream);
|
||||
#endif
|
||||
|
||||
#if wxUSE_SERIAL
|
||||
// need this to keep from hiding the virtual from wxObject
|
||||
virtual void LoadObject(wxObjectInputStream& stream) { wxObject::LoadObject(stream); };
|
||||
#endif
|
||||
|
||||
// Called by wxWindows
|
||||
virtual bool OnSaveDocument(const wxString& filename);
|
||||
virtual bool OnOpenDocument(const wxString& filename);
|
||||
|
@@ -174,7 +174,10 @@ class WXDLLEXPORT name : public wxBaseArray \
|
||||
{ \
|
||||
public: \
|
||||
name() \
|
||||
{ wxASSERT( sizeof(T) <= sizeof(long) ); } \
|
||||
{ size_t type = sizeof(T); \
|
||||
size_t sizelong = sizeof(long); \
|
||||
wxASSERT( type <= sizelong ); \
|
||||
} \
|
||||
\
|
||||
name& operator=(const name& src) \
|
||||
{ wxBaseArray* temp = (wxBaseArray*) this; \
|
||||
@@ -232,7 +235,11 @@ class WXDLLEXPORT name : public wxBaseArray \
|
||||
{ \
|
||||
public: \
|
||||
name(SCMPFUNC##T fn) \
|
||||
{ wxASSERT( sizeof(T) <= sizeof(long) ); m_fnCompare = fn; } \
|
||||
{ size_t type = sizeof(T); \
|
||||
size_t sizelong = sizeof(long); \
|
||||
wxASSERT( type <= sizelong ); \
|
||||
m_fnCompare = fn; \
|
||||
} \
|
||||
\
|
||||
name& operator=(const name& src) \
|
||||
{ wxBaseArray* temp = (wxBaseArray*) this; \
|
||||
|
@@ -96,7 +96,7 @@ void process_command(char *);
|
||||
void syntax_error(char *);
|
||||
}
|
||||
#else
|
||||
#if __BORLANDC__
|
||||
#if defined(__BORLANDC__) || defined(__VISAGECPP__)
|
||||
char *proio_cons(char *, char *);
|
||||
char * wxmake_integer(char *);
|
||||
char * wxmake_word(char *);
|
||||
@@ -107,6 +107,7 @@ char * wxmake_exp2(char *, char *, char*);
|
||||
void add_expr(char *);
|
||||
void process_command(char *);
|
||||
void syntax_error(char *);
|
||||
int lex_input(void);
|
||||
#else
|
||||
char *proio_cons();
|
||||
char * wxmake_integer();
|
||||
|
@@ -117,6 +117,8 @@ class WXDLLEXPORT wxXLPHelpController: public wxHelpControllerBase
|
||||
bool helpRunning;
|
||||
wxXLPHelpConnection* helpConnection;
|
||||
wxXLPHelpClient helpClient;
|
||||
private:
|
||||
virtual bool Initialize(const wxString& file) { return(wxHelpControllerBase::Initialize(file)); };
|
||||
};
|
||||
|
||||
#endif // wxUSE_HELP
|
||||
|
@@ -1,7 +1,11 @@
|
||||
#ifndef _WX_HELPWIN_H_BASE_
|
||||
#define _WX_HELPWIN_H_BASE_
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#include "wx/msw/helpwin.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/helpwin.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// _WX_HELPWIN_H_BASE_
|
||||
|
@@ -29,6 +29,12 @@
|
||||
#pragma interface "list.h"
|
||||
#endif
|
||||
|
||||
#ifdef __WXPM__
|
||||
#define LINKAGEMODE _Optlink
|
||||
#else
|
||||
#define LINKAGEMODE
|
||||
#endif
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// headers
|
||||
// -----------------------------------------------------------------------------
|
||||
@@ -65,10 +71,10 @@ enum wxKeyType
|
||||
// type of compare function for list sort operation (as in 'qsort'): it should
|
||||
// return a negative value, 0 or positive value if the first element is less
|
||||
// than, equal or greater than the second
|
||||
typedef int (*wxSortCompareFunction)(const void *elem1, const void *elem2);
|
||||
typedef int (* LINKAGEMODE wxSortCompareFunction)(const void *elem1, const void *elem2);
|
||||
|
||||
//
|
||||
typedef int (*wxListIterateFunction)(void *current);
|
||||
typedef int (* LINKAGEMODE wxListIterateFunction)(void *current);
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// key stuff: a list may be optionally keyed on integer or string key
|
||||
|
@@ -78,9 +78,8 @@ class WXDLLEXPORT wxBitmapButton: public wxButton
|
||||
int m_marginX;
|
||||
int m_marginY;
|
||||
private:
|
||||
// Supress VisualAge's hidden functin warning
|
||||
void SetLabel(const wxString& label)
|
||||
{ wxButton::SetLabel(label); }
|
||||
virtual void SetLabel(const wxString& string)
|
||||
{ wxButton::SetLabel(string); };
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -44,12 +44,9 @@ class WXDLLEXPORT wxButton: public wxControl
|
||||
|
||||
virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
||||
virtual void SetDefault();
|
||||
static wxSize GetDefaultSize();
|
||||
virtual void SetLabel(const wxString& label);
|
||||
virtual wxString GetLabel() const ;
|
||||
virtual void Command(wxCommandEvent& event);
|
||||
private:
|
||||
void SetSize(int width, int height) {wxWindow::SetSize(width, height);}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -47,8 +47,6 @@ class WXDLLEXPORT wxCheckBox: public wxControl
|
||||
virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
||||
virtual void SetLabel(const wxString& label);
|
||||
virtual void Command(wxCommandEvent& event);
|
||||
private:
|
||||
void SetSize(int width, int height) {wxWindow::SetSize(width, height);}
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxBitmapCheckBox: public wxCheckBox
|
||||
@@ -79,8 +77,8 @@ class WXDLLEXPORT wxBitmapCheckBox: public wxCheckBox
|
||||
virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
||||
virtual void SetLabel(const wxBitmap& bitmap);
|
||||
private:
|
||||
void SetSize(int width, int height) {wxWindow::SetSize(width, height);}
|
||||
void SetLabel(const wxString& label) {wxCheckBox::SetLabel(label);}
|
||||
virtual void SetLabel(const wxString& string)
|
||||
{ wxCheckBox::SetLabel(string); };
|
||||
};
|
||||
#endif
|
||||
// _WX_CHECKBOX_H_
|
||||
|
@@ -66,9 +66,6 @@ class WXDLLEXPORT wxChoice: public wxControl
|
||||
|
||||
protected:
|
||||
int m_noStrings;
|
||||
|
||||
private:
|
||||
void SetSize(int width, int height) {wxWindow::SetSize(width, height);}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -1,11 +1,11 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dc.h
|
||||
// Purpose: wxDC class
|
||||
// Author: Julian Smart
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -16,155 +16,358 @@
|
||||
#pragma interface "dc.h"
|
||||
#endif
|
||||
|
||||
class WXDLLEXPORT wxDC : public wxDCBase
|
||||
#include "wx/pen.h"
|
||||
#include "wx/brush.h"
|
||||
#include "wx/icon.h"
|
||||
#include "wx/font.h"
|
||||
#include "wx/gdicmn.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// constants
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#ifndef MM_TEXT
|
||||
#define MM_TEXT 0
|
||||
#define MM_ISOTROPIC 1
|
||||
#define MM_ANISOTROPIC 2
|
||||
#define MM_LOMETRIC 3
|
||||
#define MM_HIMETRIC 4
|
||||
#define MM_TWIPS 5
|
||||
#define MM_POINTS 6
|
||||
#define MM_METRIC 7
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// global variables
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
extern int wxPageNumber;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxDC
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxDC: public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxDC)
|
||||
DECLARE_ABSTRACT_CLASS(wxDC)
|
||||
|
||||
public:
|
||||
wxDC();
|
||||
~wxDC();
|
||||
|
||||
// implement base class pure virtuals
|
||||
// ----------------------------------
|
||||
wxDC(void);
|
||||
~wxDC(void);
|
||||
|
||||
virtual void Clear();
|
||||
void BeginDrawing(void) {};
|
||||
void EndDrawing(void) {};
|
||||
|
||||
virtual bool StartDoc(const wxString& message);
|
||||
virtual void EndDoc();
|
||||
virtual bool Ok(void) const { return m_ok; };
|
||||
|
||||
virtual void StartPage();
|
||||
virtual void EndPage();
|
||||
|
||||
virtual void SetFont(const wxFont& font);
|
||||
virtual void SetPen(const wxPen& pen);
|
||||
virtual void SetBrush(const wxBrush& brush);
|
||||
virtual void SetBackground(const wxBrush& brush);
|
||||
virtual void SetBackgroundMode(int mode);
|
||||
virtual void SetPalette(const wxPalette& palette);
|
||||
|
||||
virtual void DestroyClippingRegion();
|
||||
|
||||
virtual long GetCharHeight() const;
|
||||
virtual long GetCharWidth() const;
|
||||
virtual void GetTextExtent(const wxString& string,
|
||||
long *x, long *y,
|
||||
long *descent = NULL,
|
||||
long *externalLeading = NULL,
|
||||
wxFont *theFont = NULL) const;
|
||||
|
||||
virtual bool CanDrawBitmap() const;
|
||||
virtual bool CanGetTextExtent() const;
|
||||
virtual int GetDepth() const;
|
||||
virtual wxSize GetPPI() const;
|
||||
|
||||
virtual void SetMapMode(int mode);
|
||||
virtual void SetUserScale(double x, double y);
|
||||
virtual void SetSystemScale(double x, double y);
|
||||
virtual void SetLogicalScale(double x, double y);
|
||||
virtual void SetLogicalOrigin(long x, long y);
|
||||
virtual void SetDeviceOrigin(long x, long y);
|
||||
virtual void SetAxisOrientation(bool xLeftRight, bool yBottomUp);
|
||||
virtual void SetLogicalFunction(int function);
|
||||
|
||||
// implementation from now on
|
||||
// --------------------------
|
||||
|
||||
virtual void SetRop(WXHDC cdc);
|
||||
virtual void DoClipping(WXHDC cdc);
|
||||
virtual void SelectOldObjects(WXHDC dc);
|
||||
|
||||
wxWindow *GetWindow() const { return m_canvas; }
|
||||
void SetWindow(wxWindow *win) { m_canvas = win; }
|
||||
|
||||
WXHDC GetHDC() const { return m_hDC; }
|
||||
void SetHDC(WXHDC dc, bool bOwnsDC = FALSE)
|
||||
virtual void FloodFill( long x1, long y1, const wxColour& col, int style=wxFLOOD_SURFACE ) = 0;
|
||||
inline void FloodFill(const wxPoint& pt, const wxColour& col, int style=wxFLOOD_SURFACE)
|
||||
{
|
||||
m_hDC = dc;
|
||||
m_bOwnsDC = bOwnsDC;
|
||||
FloodFill(pt.x, pt.y, col, style);
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void DoFloodFill(long x, long y, const wxColour& col,
|
||||
int style = wxFLOOD_SURFACE);
|
||||
|
||||
virtual bool DoGetPixel(long x, long y, wxColour *col) const;
|
||||
|
||||
virtual void DoDrawPoint(long x, long y);
|
||||
virtual void DoDrawLine(long x1, long y1, long x2, long y2);
|
||||
|
||||
virtual void DoDrawArc(long x1, long y1,
|
||||
long x2, long y2,
|
||||
long xc, long yc);
|
||||
virtual void DoDrawEllipticArc(long x, long y, long w, long h,
|
||||
double sa, double ea);
|
||||
|
||||
virtual void DoDrawRectangle(long x, long y, long width, long height);
|
||||
virtual void DoDrawRoundedRectangle(long x, long y,
|
||||
long width, long height,
|
||||
double radius);
|
||||
virtual void DoDrawEllipse(long x, long y, long width, long height);
|
||||
|
||||
virtual void DoCrossHair(long x, long y);
|
||||
|
||||
virtual void DoDrawIcon(const wxIcon& icon, long x, long y);
|
||||
virtual void DoDrawBitmap(const wxBitmap &bmp, long x, long y,
|
||||
bool useMask = FALSE);
|
||||
|
||||
virtual void DoDrawText(const wxString& text, long x, long y);
|
||||
|
||||
virtual bool DoBlit(long xdest, long ydest, long width, long height,
|
||||
wxDC *source, long xsrc, long ysrc,
|
||||
int rop = wxCOPY, bool useMask = FALSE);
|
||||
|
||||
// this is gnarly - we can't even call this function DoSetClippingRegion()
|
||||
// because of virtual function hiding
|
||||
virtual void DoSetClippingRegionAsRegion(const wxRegion& region);
|
||||
virtual void DoSetClippingRegion(long x, long y,
|
||||
long width, long height);
|
||||
virtual void DoGetClippingRegion(long *x, long *y,
|
||||
long *width, long *height)
|
||||
virtual bool GetPixel( long x1, long y1, wxColour *col ) const = 0;
|
||||
inline bool GetPixel(const wxPoint& pt, wxColour *col) const
|
||||
{
|
||||
GetClippingBox(x, y, width, height);
|
||||
return GetPixel(pt.x, pt.y, col);
|
||||
}
|
||||
|
||||
virtual void DoGetSize(int *width, int *height) const;
|
||||
virtual void DoGetSizeMM(int* width, int* height) const;
|
||||
virtual void DrawLine( long x1, long y1, long x2, long y2 ) = 0;
|
||||
inline void DrawLine(const wxPoint& pt1, const wxPoint& pt2)
|
||||
{
|
||||
DrawLine(pt1.x, pt1.y, pt2.x, pt2.y);
|
||||
}
|
||||
|
||||
virtual void DoDrawLines(int n, wxPoint points[],
|
||||
long xoffset, long yoffset);
|
||||
virtual void DoDrawPolygon(int n, wxPoint points[],
|
||||
long xoffset, long yoffset,
|
||||
virtual void CrossHair( long x, long y ) = 0;
|
||||
inline void CrossHair(const wxPoint& pt)
|
||||
{
|
||||
CrossHair(pt.x, pt.y);
|
||||
}
|
||||
|
||||
virtual void DrawArc( long x1, long y1, long x2, long y2, long xc, long yc ) = 0;
|
||||
inline void DrawArc(const wxPoint& pt1, const wxPoint& pt2, const wxPoint& centre)
|
||||
{
|
||||
DrawArc(pt1.x, pt1.y, pt2.x, pt2.y, centre.x, centre.y);
|
||||
}
|
||||
|
||||
virtual void DrawEllipticArc( long x, long y, long width, long height, double sa, double ea ) = 0;
|
||||
virtual void DrawEllipticArc (const wxPoint& pt, const wxSize& sz, double sa, double ea)
|
||||
{
|
||||
DrawEllipticArc(pt.x, pt.y, sz.x, sz.y, sa, ea);
|
||||
}
|
||||
|
||||
virtual void DrawPoint( long x, long y ) = 0;
|
||||
virtual void DrawPoint( wxPoint& point );
|
||||
|
||||
virtual void DrawLines( int n, wxPoint points[], long xoffset = 0, long yoffset = 0 ) = 0;
|
||||
virtual void DrawLines( wxList *points, long xoffset = 0, long yoffset = 0 );
|
||||
virtual void DrawPolygon( int n, wxPoint points[], long xoffset = 0, long yoffset = 0,
|
||||
int fillStyle=wxODDEVEN_RULE ) = 0;
|
||||
virtual void DrawPolygon( wxList *lines, long xoffset = 0, long yoffset = 0,
|
||||
int fillStyle=wxODDEVEN_RULE );
|
||||
|
||||
#if wxUSE_SPLINES
|
||||
virtual void DoDrawSpline(wxList *points);
|
||||
#endif // wxUSE_SPLINES
|
||||
virtual void DrawRectangle( long x, long y, long width, long height ) = 0;
|
||||
inline void DrawRectangle(const wxPoint& pt, const wxSize& sz)
|
||||
{
|
||||
DrawRectangle(pt.x, pt.y, sz.x, sz.y);
|
||||
}
|
||||
inline void DrawRectangle(const wxRect& rect)
|
||||
{
|
||||
DrawRectangle(rect.x, rect.y, rect.width, rect.height);
|
||||
}
|
||||
virtual void DrawRoundedRectangle( long x, long y, long width, long height, double radius = 20.0 ) = 0;
|
||||
inline void DrawRoundedRectangle(const wxPoint& pt, const wxSize& sz, double radius = 20.0)
|
||||
{
|
||||
DrawRoundedRectangle(pt.x, pt.y, sz.x, sz.y, radius);
|
||||
}
|
||||
inline void DrawRoundedRectangle(const wxRect& rect, double radius = 20.0)
|
||||
{
|
||||
DrawRoundedRectangle(rect.x, rect.y, rect.width, rect.height, radius);
|
||||
}
|
||||
|
||||
// MSW-specific member variables
|
||||
int m_windowExtX;
|
||||
int m_windowExtY;
|
||||
virtual void DrawEllipse( long x, long y, long width, long height ) = 0;
|
||||
inline void DrawEllipse(const wxPoint& pt, const wxSize& sz)
|
||||
{
|
||||
DrawEllipse(pt.x, pt.y, sz.x, sz.y);
|
||||
}
|
||||
inline void DrawEllipse(const wxRect& rect)
|
||||
{
|
||||
DrawEllipse(rect.x, rect.y, rect.width, rect.height);
|
||||
}
|
||||
|
||||
// the window associated with this DC (may be NULL)
|
||||
wxWindow *m_canvas;
|
||||
virtual void DrawSpline( long x1, long y1, long x2, long y2, long x3, long y3 );
|
||||
virtual void DrawSpline( wxList *points ) = 0;
|
||||
virtual void DrawSpline( int n, wxPoint points[] );
|
||||
|
||||
wxBitmap m_selectedBitmap;
|
||||
virtual bool CanDrawBitmap(void) const = 0;
|
||||
|
||||
// TRUE => DeleteDC() in dtor, FALSE => only ReleaseDC() it
|
||||
bool m_bOwnsDC:1;
|
||||
virtual void DrawIcon( const wxIcon &icon, long x, long y, bool useMask=FALSE );
|
||||
inline void DrawIcon(const wxIcon& icon, const wxPoint& pt)
|
||||
{
|
||||
DrawIcon(icon, pt.x, pt.y);
|
||||
}
|
||||
|
||||
// our HDC and its usage count: we only free it when the usage count drops
|
||||
// to 0
|
||||
WXHDC m_hDC;
|
||||
int m_hDCCount;
|
||||
// TODO DrawBitmap is not always the same as DrawIcon, especially if bitmaps and
|
||||
// icons are implemented differently.
|
||||
void DrawBitmap( const wxBitmap &bmp, long x, long y, bool useMask=FALSE )
|
||||
{ DrawIcon( *((wxIcon*)(&bmp)), x, y, useMask ); }
|
||||
|
||||
// Store all old GDI objects when do a SelectObject, so we can select them
|
||||
// back in (this unselecting user's objects) so we can safely delete the
|
||||
// DC.
|
||||
WXHBITMAP m_oldBitmap;
|
||||
WXHPEN m_oldPen;
|
||||
WXHBRUSH m_oldBrush;
|
||||
WXHFONT m_oldFont;
|
||||
WXHPALETTE m_oldPalette;
|
||||
virtual bool Blit( long xdest, long ydest, long width, long height,
|
||||
wxDC *source, long xsrc, long ysrc, int logical_func = wxCOPY, bool useMask=FALSE ) = 0;
|
||||
inline bool Blit(const wxPoint& destPt, const wxSize& sz,
|
||||
wxDC *source, const wxPoint& srcPt, int rop = wxCOPY, bool useMask = FALSE)
|
||||
{
|
||||
return Blit(destPt.x, destPt.y, sz.x, sz.y, source, srcPt.x, srcPt.y, rop, useMask);
|
||||
}
|
||||
|
||||
virtual void DrawText( const wxString &text, long x, long y, bool use16 = FALSE ) = 0;
|
||||
inline void DrawText(const wxString& text, const wxPoint& pt, bool use16bit = FALSE)
|
||||
{
|
||||
DrawText(text, pt.x, pt.y, use16bit);
|
||||
}
|
||||
|
||||
virtual bool CanGetTextExtent(void) const = 0;
|
||||
virtual void GetTextExtent( const wxString &string, long *width, long *height,
|
||||
long *descent = NULL, long *externalLeading = NULL,
|
||||
wxFont *theFont = NULL, bool use16 = FALSE ) = 0;
|
||||
virtual long GetCharWidth(void) = 0;
|
||||
virtual long GetCharHeight(void) = 0;
|
||||
|
||||
virtual void Clear(void) = 0;
|
||||
|
||||
virtual void SetFont( const wxFont &font ) = 0;
|
||||
virtual wxFont& GetFont(void) const { return (wxFont&) m_font; };
|
||||
|
||||
virtual void SetPen( const wxPen &pen ) = 0;
|
||||
virtual wxPen& GetPen(void) const { return (wxPen&) m_pen; };
|
||||
|
||||
virtual void SetBrush( const wxBrush &brush ) = 0;
|
||||
virtual wxBrush& GetBrush(void) const { return (wxBrush&) m_brush; };
|
||||
|
||||
virtual void SetBackground( const wxBrush &brush ) = 0;
|
||||
virtual wxBrush& GetBackground(void) const { return (wxBrush&) m_backgroundBrush; };
|
||||
|
||||
virtual void SetLogicalFunction( int function ) = 0;
|
||||
virtual int GetLogicalFunction(void) const { return m_logicalFunction; };
|
||||
|
||||
virtual void SetTextForeground( const wxColour &col );
|
||||
virtual void SetTextBackground( const wxColour &col );
|
||||
virtual wxColour& GetTextBackground(void) const { return (wxColour&)m_textBackgroundColour; };
|
||||
virtual wxColour& GetTextForeground(void) const { return (wxColour&)m_textForegroundColour; };
|
||||
|
||||
virtual void SetBackgroundMode( int mode ) = 0;
|
||||
virtual int GetBackgroundMode(void) const { return m_backgroundMode; };
|
||||
|
||||
virtual void SetPalette( const wxPalette& palette ) = 0;
|
||||
void SetColourMap( const wxPalette& palette ) { SetPalette(palette); };
|
||||
|
||||
// the first two must be overridden and called
|
||||
virtual void SetClippingRegion( long x, long y, long width, long height );
|
||||
virtual void DestroyClippingRegion(void);
|
||||
virtual void GetClippingBox( long *x, long *y, long *width, long *height ) const;
|
||||
|
||||
virtual inline long MinX(void) const { return m_minX; }
|
||||
virtual inline long MaxX(void) const { return m_maxX; }
|
||||
virtual inline long MinY(void) const { return m_minY; }
|
||||
virtual inline long MaxY(void) const { return m_maxY; }
|
||||
|
||||
virtual void GetSize( int* width, int* height ) const;
|
||||
inline wxSize GetSize(void) const { int w, h; GetSize(&w, &h); return wxSize(w, h); }
|
||||
virtual void GetSizeMM( long* width, long* height ) const;
|
||||
|
||||
virtual bool StartDoc( const wxString& WXUNUSED(message) ) { return TRUE; };
|
||||
virtual void EndDoc(void) {};
|
||||
virtual void StartPage(void) {};
|
||||
virtual void EndPage(void) {};
|
||||
|
||||
virtual void SetMapMode( int mode );
|
||||
virtual int GetMapMode(void) const { return m_mappingMode; };
|
||||
|
||||
virtual void SetUserScale( double x, double y );
|
||||
virtual void GetUserScale( double *x, double *y );
|
||||
virtual void SetLogicalScale( double x, double y );
|
||||
virtual void GetLogicalScale( double *x, double *y );
|
||||
|
||||
virtual void SetLogicalOrigin( long x, long y );
|
||||
virtual void GetLogicalOrigin( long *x, long *y );
|
||||
virtual void SetDeviceOrigin( long x, long y );
|
||||
virtual void GetDeviceOrigin( long *x, long *y );
|
||||
virtual void SetInternalDeviceOrigin( long x, long y );
|
||||
virtual void GetInternalDeviceOrigin( long *x, long *y );
|
||||
|
||||
virtual void SetAxisOrientation( bool xLeftRight, bool yBottomUp );
|
||||
|
||||
virtual void SetOptimization( bool WXUNUSED(optimize) ) {};
|
||||
virtual bool GetOptimization(void) { return m_optimize; };
|
||||
|
||||
virtual long DeviceToLogicalX(long x) const;
|
||||
virtual long DeviceToLogicalY(long y) const;
|
||||
virtual long DeviceToLogicalXRel(long x) const;
|
||||
virtual long DeviceToLogicalYRel(long y) const;
|
||||
virtual long LogicalToDeviceX(long x) const;
|
||||
virtual long LogicalToDeviceY(long y) const;
|
||||
virtual long LogicalToDeviceXRel(long x) const;
|
||||
virtual long LogicalToDeviceYRel(long y) const;
|
||||
|
||||
public:
|
||||
|
||||
void CalcBoundingBox( long x, long y );
|
||||
void ComputeScaleAndOrigin(void);
|
||||
|
||||
long XDEV2LOG(long x) const
|
||||
{
|
||||
long new_x = x - m_deviceOriginX;
|
||||
if (new_x > 0)
|
||||
return (long)((double)(new_x) / m_scaleX + 0.5) * m_signX + m_logicalOriginX;
|
||||
else
|
||||
return (long)((double)(new_x) / m_scaleX - 0.5) * m_signX + m_logicalOriginX;
|
||||
}
|
||||
long XDEV2LOGREL(long x) const
|
||||
{
|
||||
if (x > 0)
|
||||
return (long)((double)(x) / m_scaleX + 0.5);
|
||||
else
|
||||
return (long)((double)(x) / m_scaleX - 0.5);
|
||||
}
|
||||
long YDEV2LOG(long y) const
|
||||
{
|
||||
long new_y = y - m_deviceOriginY;
|
||||
if (new_y > 0)
|
||||
return (long)((double)(new_y) / m_scaleY + 0.5) * m_signY + m_logicalOriginY;
|
||||
else
|
||||
return (long)((double)(new_y) / m_scaleY - 0.5) * m_signY + m_logicalOriginY;
|
||||
}
|
||||
long YDEV2LOGREL(long y) const
|
||||
{
|
||||
if (y > 0)
|
||||
return (long)((double)(y) / m_scaleY + 0.5);
|
||||
else
|
||||
return (long)((double)(y) / m_scaleY - 0.5);
|
||||
}
|
||||
long XLOG2DEV(long x) const
|
||||
{
|
||||
long new_x = x - m_logicalOriginX;
|
||||
if (new_x > 0)
|
||||
return (long)((double)(new_x) * m_scaleX + 0.5) * m_signX + m_deviceOriginX;
|
||||
else
|
||||
return (long)((double)(new_x) * m_scaleX - 0.5) * m_signX + m_deviceOriginX;
|
||||
}
|
||||
long XLOG2DEVREL(long x) const
|
||||
{
|
||||
if (x > 0)
|
||||
return (long)((double)(x) * m_scaleX + 0.5);
|
||||
else
|
||||
return (long)((double)(x) * m_scaleX - 0.5);
|
||||
}
|
||||
long YLOG2DEV(long y) const
|
||||
{
|
||||
long new_y = y - m_logicalOriginY;
|
||||
if (new_y > 0)
|
||||
return (long)((double)(new_y) * m_scaleY + 0.5) * m_signY + m_deviceOriginY;
|
||||
else
|
||||
return (long)((double)(new_y) * m_scaleY - 0.5) * m_signY + m_deviceOriginY;
|
||||
}
|
||||
long YLOG2DEVREL(long y) const
|
||||
{
|
||||
if (y > 0)
|
||||
return (long)((double)(y) * m_scaleY + 0.5);
|
||||
else
|
||||
return (long)((double)(y) * m_scaleY - 0.5);
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
bool m_ok;
|
||||
bool m_colour;
|
||||
|
||||
// not sure, what these mean
|
||||
bool m_clipping; // Is clipping on right now ?
|
||||
bool m_isInteractive; // Is GetPixel possible ?
|
||||
bool m_autoSetting; // wxMSW only ?
|
||||
bool m_dontDelete; // wxMSW only ?
|
||||
bool m_optimize; // wxMSW only ?
|
||||
wxString m_filename; // Not sure where this belongs.
|
||||
|
||||
wxPen m_pen;
|
||||
wxBrush m_brush;
|
||||
wxBrush m_backgroundBrush;
|
||||
wxColour m_textForegroundColour;
|
||||
wxColour m_textBackgroundColour;
|
||||
wxFont m_font;
|
||||
|
||||
int m_logicalFunction;
|
||||
int m_backgroundMode;
|
||||
int m_textAlignment; // gone in wxWin 2.0 ?
|
||||
|
||||
int m_mappingMode;
|
||||
|
||||
// not sure what for, but what is a mm on a screen you don't know the size of?
|
||||
double m_mm_to_pix_x,m_mm_to_pix_y;
|
||||
|
||||
long m_internalDeviceOriginX,m_internalDeviceOriginY; // If un-scrolled is non-zero or
|
||||
// d.o. changes with scrolling.
|
||||
// Set using SetInternalDeviceOrigin().
|
||||
|
||||
long m_externalDeviceOriginX,m_externalDeviceOriginY; // To be set by external classes
|
||||
// such as wxScrolledWindow
|
||||
// using SetDeviceOrigin()
|
||||
|
||||
long m_deviceOriginX,m_deviceOriginY; // Sum of the two above.
|
||||
|
||||
long m_logicalOriginX,m_logicalOriginY; // User defined.
|
||||
|
||||
double m_scaleX,m_scaleY;
|
||||
double m_logicalScaleX,m_logicalScaleY;
|
||||
double m_userScaleX,m_userScaleY;
|
||||
long m_signX,m_signY;
|
||||
|
||||
bool m_needComputeScaleX,m_needComputeScaleY; // not yet used
|
||||
|
||||
float m_scaleFactor; // wxPSDC wants to have this. Will disappear.
|
||||
|
||||
long m_clipX1,m_clipY1,m_clipX2,m_clipY2;
|
||||
long m_minX,m_maxX,m_minY,m_maxY;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -90,22 +90,15 @@ class WXDLLEXPORT wxWindowDC: public wxDC
|
||||
|
||||
virtual void DrawSpline( wxList *points );
|
||||
private:
|
||||
// VisualAge function hiding warning supression
|
||||
void DrawEllipticArc (const wxPoint& pt, const wxSize& sz, double sa, double ea)
|
||||
{ wxDC::DrawEllipticArc(pt, sz, sa, ea); }
|
||||
void DrawPoint( wxPoint& point )
|
||||
{ wxDC::DrawPoint(point); }
|
||||
void DrawSpline( long x1, long y1, long x2, long y2, long x3, long y3 )
|
||||
{ DrawSpline(x1, y1, x2, y2, x3, y3); }
|
||||
void DrawEllipticArc(const wxPoint& pt, const wxSize& sz,
|
||||
double sa, double ea)
|
||||
{ wxDC::DrawEllipticArc(pt, sz, sa, ea); };
|
||||
void DrawPoint(wxPoint& pt)
|
||||
{ wxDC:DrawPoint(pt); };
|
||||
void DrawSpline(int n, wxPoint points[])
|
||||
{ DrawSpline(n, points); }
|
||||
void GetTextExtent( const wxString &string, long *width, long *height,
|
||||
long *descent = NULL, long *externalLeading = NULL,
|
||||
wxFont *theFont = NULL ) const
|
||||
{ GetTextExtent( string, width, height, descent, externalLeading, theFont); };
|
||||
// these next two are ridiculous! the only difference is the const
|
||||
long GetCharWidth(void) const {return(GetCharWidth());};
|
||||
long GetCharHeight(void) const {return(GetCharHeight());};
|
||||
{ wxDC::DrawSpline(n, points); };
|
||||
void DrawSpline(long x1, long y1, long x2, long y2, long x3, long y3)
|
||||
{ wxDC::DrawSpline(x1, y1, x2, y2, x3, y3); };
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@@ -1,12 +1,12 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dialog.h
|
||||
// Purpose: wxDialog class
|
||||
// Author: Julian Smart
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_DIALOG_H_
|
||||
@@ -18,84 +18,84 @@
|
||||
|
||||
#include "wx/panel.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxDialogNameStr;
|
||||
WXDLLEXPORT_DATA(extern const char*) wxDialogNameStr;
|
||||
|
||||
// Dialog boxes
|
||||
class WXDLLEXPORT wxDialog: public wxDialogBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxDialog)
|
||||
|
||||
public:
|
||||
|
||||
wxDialog();
|
||||
|
||||
// Constructor with a modal flag, but no window id - the old convention
|
||||
wxDialog(wxWindow *parent,
|
||||
const wxString& title, bool modal,
|
||||
int x = -1, int y= -1, int width = 500, int height = 500,
|
||||
long style = wxDEFAULT_DIALOG_STYLE,
|
||||
const wxString& name = wxDialogNameStr)
|
||||
inline wxDialog( wxWindow* parent
|
||||
,const wxString& title
|
||||
,bool modal
|
||||
,int x = -1
|
||||
,int y = -1
|
||||
,int width = 500
|
||||
,int height = 500
|
||||
,long style = wxDEFAULT_DIALOG_STYLE
|
||||
,const wxString& name = wxDialogNameStr
|
||||
)
|
||||
{
|
||||
long modalStyle = modal ? wxDIALOG_MODAL : wxDIALOG_MODELESS ;
|
||||
Create(parent, -1, title, wxPoint(x, y), wxSize(width, height),
|
||||
style | modalStyle, name);
|
||||
Create(parent, -1, title, wxPoint(x, y), wxSize(width, height), style|modalStyle, name);
|
||||
}
|
||||
|
||||
// Constructor with no modal flag - the new convention.
|
||||
wxDialog(wxWindow *parent, wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_DIALOG_STYLE,
|
||||
const wxString& name = wxDialogNameStr)
|
||||
inline wxDialog( wxWindow* parent
|
||||
,wxWindowID id
|
||||
,const wxString& title
|
||||
,const wxPoint& pos = wxDefaultPosition
|
||||
,const wxSize& size = wxDefaultSize
|
||||
,long style = wxDEFAULT_DIALOG_STYLE
|
||||
,const wxString& name = wxDialogNameStr
|
||||
)
|
||||
{
|
||||
Create(parent, id, title, pos, size, style, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_DIALOG_STYLE,
|
||||
const wxString& name = wxDialogNameStr);
|
||||
bool Create( wxWindow* parent
|
||||
,wxWindowID id
|
||||
,const wxString& title
|
||||
, // bool modal = FALSE, // TODO make this a window style?
|
||||
const wxPoint& pos = wxDefaultPosition
|
||||
,const wxSize& size = wxDefaultSize
|
||||
,long style = wxDEFAULT_DIALOG_STYLE
|
||||
,const wxString& name = wxDialogNameStr
|
||||
);
|
||||
|
||||
~wxDialog();
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Virtuals
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
virtual bool Destroy();
|
||||
virtual bool IsIconized() const;
|
||||
virtual void Centre(int direction = wxBOTH);
|
||||
virtual bool IsModal() const { return ((GetWindowStyleFlag() & wxDIALOG_MODAL) == wxDIALOG_MODAL); }
|
||||
|
||||
virtual void DoSetClientSize(int width, int height);
|
||||
|
||||
virtual void GetPosition(int *x, int *y) const;
|
||||
virtual int ShowModal();
|
||||
virtual void EndModal(int retCode);
|
||||
|
||||
void SetClientSize(int width, int height);
|
||||
void GetPosition(int *x, int *y) const;
|
||||
bool Show(bool show);
|
||||
bool IsShown() const;
|
||||
void Iconize(bool iconize);
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
bool Iconized() const { return IsIconized(); };
|
||||
#endif
|
||||
|
||||
virtual bool IsIconized() const;
|
||||
void Fit();
|
||||
|
||||
void SetTitle(const wxString& title);
|
||||
wxString GetTitle() const ;
|
||||
|
||||
void OnSize(wxSizeEvent& event);
|
||||
bool OnClose();
|
||||
void OnCharHook(wxKeyEvent& event);
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
void OnCloseWindow(wxCloseEvent& event);
|
||||
|
||||
void SetModal(bool flag);
|
||||
|
||||
virtual void Centre(int direction = wxBOTH);
|
||||
virtual bool IsModal() const
|
||||
{ return ((GetWindowStyleFlag() & wxDIALOG_MODAL) == wxDIALOG_MODAL); }
|
||||
|
||||
// For now, same as Show(TRUE) but returns return code
|
||||
virtual int ShowModal();
|
||||
virtual void EndModal(int retCode);
|
||||
|
||||
// Standard buttons
|
||||
void OnOK(wxCommandEvent& event);
|
||||
void OnApply(wxCommandEvent& event);
|
||||
@@ -104,32 +104,6 @@ public:
|
||||
// Responds to colour changes
|
||||
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
||||
|
||||
// implementation
|
||||
// --------------
|
||||
|
||||
long MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
|
||||
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
bool IsModalShowing() const { return m_modalShowing; }
|
||||
|
||||
// tooltip management
|
||||
#if wxUSE_TOOLTIPS
|
||||
WXHWND GetToolTipCtrl() const { return m_hwndToolTip; }
|
||||
void SetToolTipCtrl(WXHWND hwndTT) { m_hwndToolTip = hwndTT; }
|
||||
#endif // tooltips
|
||||
|
||||
protected:
|
||||
bool m_modalShowing;
|
||||
WXHWND m_hwndOldFocus; // the window which had focus before we were shown
|
||||
|
||||
private:
|
||||
#if wxUSE_TOOLTIPS
|
||||
WXHWND m_hwndToolTip;
|
||||
#endif // tooltips
|
||||
|
||||
private:
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
|
@@ -72,6 +72,53 @@ private:
|
||||
wxDataFormatId m_type;
|
||||
wxString m_id;
|
||||
};
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// wxDataBroker (internal)
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
class wxDataBroker : public wxObject
|
||||
{
|
||||
DECLARE_CLASS( wxDataBroker )
|
||||
|
||||
public:
|
||||
|
||||
/* constructor */
|
||||
wxDataBroker();
|
||||
|
||||
/* add data object */
|
||||
void Add( wxDataObject *dataObject, bool preferred = FALSE );
|
||||
|
||||
private:
|
||||
|
||||
/* OLE implementation, the methods don't need to be overridden */
|
||||
|
||||
/* get number of supported formats */
|
||||
virtual size_t GetFormatCount() const;
|
||||
|
||||
/* return nth supported format */
|
||||
virtual wxDataFormat &GetNthFormat( size_t nth ) const;
|
||||
|
||||
/* return preferrd/best supported format */
|
||||
virtual wxDataFormatId GetPreferredFormat() const;
|
||||
|
||||
/* search through m_dataObjects, return TRUE if found */
|
||||
virtual bool IsSupportedFormat( wxDataFormat &format ) const;
|
||||
|
||||
/* search through m_dataObjects and call child's GetSize() */
|
||||
virtual size_t GetSize( wxDataFormat& format ) const;
|
||||
|
||||
/* search through m_dataObjects and call child's WriteData(dest) */
|
||||
virtual void WriteData( wxDataFormat& format, void *dest ) const;
|
||||
|
||||
/* implementation */
|
||||
|
||||
public:
|
||||
|
||||
wxList m_dataObjects;
|
||||
size_t m_preferred;
|
||||
};
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// wxDataObject
|
||||
//-------------------------------------------------------------------------
|
||||
|
@@ -1,12 +1,12 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: frame.h
|
||||
// Purpose: wxFrame class
|
||||
// Author: Julian Smart
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_FRAME_H_
|
||||
@@ -18,23 +18,22 @@
|
||||
|
||||
#include "wx/window.h"
|
||||
#include "wx/toolbar.h"
|
||||
#include "wx/msw/accel.h"
|
||||
#include "wx/accel.h"
|
||||
#include "wx/icon.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxFrameNameStr;
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxToolBarNameStr;
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxStatusLineNameStr;
|
||||
WXDLLEXPORT_DATA(extern const char*) wxFrameNameStr;
|
||||
WXDLLEXPORT_DATA(extern const char*) wxToolBarNameStr;
|
||||
|
||||
class WXDLLEXPORT wxMenuBar;
|
||||
class WXDLLEXPORT wxStatusBar;
|
||||
|
||||
class WXDLLEXPORT wxFrame : public wxWindow
|
||||
{
|
||||
class WXDLLEXPORT wxFrame: public wxWindow {
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxFrame)
|
||||
|
||||
public:
|
||||
wxFrame();
|
||||
wxFrame(wxWindow *parent,
|
||||
inline wxFrame(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
@@ -56,9 +55,14 @@ public:
|
||||
const wxString& name = wxFrameNameStr);
|
||||
|
||||
virtual bool Destroy();
|
||||
void SetClientSize(int width, int height);
|
||||
void GetClientSize(int *width, int *height) const;
|
||||
|
||||
virtual void ClientToScreen(int *x, int *y) const;
|
||||
virtual void ScreenToClient(int *x, int *y) const;
|
||||
void GetSize(int *width, int *height) const ;
|
||||
void GetPosition(int *x, int *y) const ;
|
||||
void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
||||
void ClientToScreen(int *x, int *y) const;
|
||||
void ScreenToClient(int *x, int *y) const;
|
||||
|
||||
void OnSize(wxSizeEvent& event);
|
||||
void OnMenuHighlight(wxMenuEvent& event);
|
||||
@@ -72,48 +76,35 @@ public:
|
||||
void SetMenuBar(wxMenuBar *menu_bar);
|
||||
virtual wxMenuBar *GetMenuBar() const ;
|
||||
|
||||
// Set title
|
||||
void SetTitle(const wxString& title);
|
||||
wxString GetTitle() const ;
|
||||
|
||||
void Centre(int direction = wxBOTH);
|
||||
|
||||
// Call this to simulate a menu command
|
||||
bool Command(int id) { return ProcessCommand(id); }
|
||||
|
||||
// process menu command: returns TRUE if processed
|
||||
bool ProcessCommand(int id);
|
||||
|
||||
// make the window modal (all other windows unresponsive)
|
||||
virtual void MakeModal(bool modal = TRUE);
|
||||
virtual void Command(int id);
|
||||
virtual void ProcessCommand(int id);
|
||||
|
||||
// Set icon
|
||||
virtual void SetIcon(const wxIcon& icon);
|
||||
|
||||
// Toolbar
|
||||
#if wxUSE_TOOLBAR
|
||||
virtual wxToolBar* CreateToolBar(long style = wxNO_BORDER | wxTB_HORIZONTAL | wxTB_FLAT,
|
||||
wxWindowID id = -1,
|
||||
const wxString& name = wxToolBarNameStr);
|
||||
|
||||
virtual wxToolBar *OnCreateToolBar(long style, wxWindowID id, const wxString& name);
|
||||
|
||||
virtual void SetToolBar(wxToolBar *toolbar) { m_frameToolBar = toolbar; }
|
||||
virtual wxToolBar *GetToolBar() const { return m_frameToolBar; }
|
||||
|
||||
virtual void PositionToolBar();
|
||||
#endif // wxUSE_TOOLBAR
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
// Status bar
|
||||
virtual wxStatusBar* CreateStatusBar(int number = 1,
|
||||
long style = wxST_SIZEGRIP,
|
||||
wxWindowID id = 0,
|
||||
const wxString& name = wxStatusLineNameStr);
|
||||
|
||||
wxStatusBar *GetStatusBar() const { return m_frameStatusBar; }
|
||||
void SetStatusBar(wxStatusBar *statusBar) { m_frameStatusBar = statusBar; }
|
||||
|
||||
// Create status line
|
||||
virtual wxStatusBar* CreateStatusBar(int number=1, long style = wxST_SIZEGRIP, wxWindowID id = 0,
|
||||
const wxString& name = "statusBar");
|
||||
inline wxStatusBar *GetStatusBar() const { return m_frameStatusBar; }
|
||||
virtual void PositionStatusBar();
|
||||
virtual wxStatusBar *OnCreateStatusBar(int number,
|
||||
long style,
|
||||
wxWindowID id,
|
||||
virtual wxStatusBar *OnCreateStatusBar(int number, long style, wxWindowID id,
|
||||
const wxString& name);
|
||||
|
||||
// Create toolbar
|
||||
virtual wxToolBar* CreateToolBar(long style = wxNO_BORDER|wxTB_HORIZONTAL, wxWindowID id = -1, const wxString& name = wxToolBarNameStr);
|
||||
virtual wxToolBar *OnCreateToolBar(long style, wxWindowID id, const wxString& name);
|
||||
// If made known to the frame, the frame will manage it automatically.
|
||||
virtual inline void SetToolBar(wxToolBar *toolbar) { m_frameToolBar = toolbar; }
|
||||
virtual inline wxToolBar *GetToolBar() const { return m_frameToolBar; }
|
||||
virtual void PositionToolBar();
|
||||
|
||||
// Set status line text
|
||||
virtual void SetStatusText(const wxString& text, int number = 0);
|
||||
|
||||
@@ -124,21 +115,22 @@ public:
|
||||
// TODO: should this go into a wxFrameworkSettings class perhaps?
|
||||
static void UseNativeStatusBar(bool useNative) { m_useNativeStatusBar = useNative; };
|
||||
static bool UsesNativeStatusBar() { return m_useNativeStatusBar; };
|
||||
#endif // wxUSE_STATUSBAR
|
||||
|
||||
// Fit frame around subwindows
|
||||
virtual void Fit();
|
||||
|
||||
// Iconize
|
||||
virtual void Iconize(bool iconize);
|
||||
|
||||
virtual bool IsIconized() const ;
|
||||
|
||||
// Is it maximized?
|
||||
virtual bool IsMaximized() const;
|
||||
|
||||
// Compatibility
|
||||
bool Iconized() const { return IsIconized(); }
|
||||
inline bool Iconized() const { return IsIconized(); }
|
||||
|
||||
// Is the frame maximized?
|
||||
virtual bool IsMaximized(void) const ;
|
||||
|
||||
virtual void Maximize(bool maximize);
|
||||
// virtual bool LoadAccelerators(const wxString& table);
|
||||
|
||||
// Responds to colour changes
|
||||
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
||||
@@ -147,72 +139,16 @@ public:
|
||||
void DoMenuUpdates();
|
||||
void DoMenuUpdates(wxMenu* menu, wxWindow* focusWin);
|
||||
|
||||
WXHMENU GetWinMenu() const { return m_hMenu; }
|
||||
|
||||
// Returns the origin of client area (may be different from (0,0) if the
|
||||
// frame has a toolbar)
|
||||
// Checks if there is a toolbar, and returns the first free client position
|
||||
virtual wxPoint GetClientAreaOrigin() const;
|
||||
|
||||
// Implementation only from here
|
||||
// event handlers
|
||||
bool HandlePaint();
|
||||
bool HandleSize(int x, int y, WXUINT flag);
|
||||
bool HandleCommand(WXWORD id, WXWORD cmd, WXHWND control);
|
||||
bool HandleMenuSelect(WXWORD nItem, WXWORD nFlags, WXHMENU hMenu);
|
||||
|
||||
bool MSWCreate(int id, wxWindow *parent, const wxChar *wclass,
|
||||
wxWindow *wx_win, const wxChar *title,
|
||||
int x, int y, int width, int height, long style);
|
||||
|
||||
// tooltip management
|
||||
#if wxUSE_TOOLTIPS
|
||||
WXHWND GetToolTipCtrl() const { return m_hwndToolTip; }
|
||||
void SetToolTipCtrl(WXHWND hwndTT) { m_hwndToolTip = hwndTT; }
|
||||
#endif // tooltips
|
||||
|
||||
protected:
|
||||
// override base class virtuals
|
||||
virtual void DoGetClientSize(int *width, int *height) const;
|
||||
virtual void DoGetSize(int *width, int *height) const;
|
||||
virtual void DoGetPosition(int *x, int *y) const;
|
||||
|
||||
virtual void DoSetSize(int x, int y,
|
||||
int width, int height,
|
||||
int sizeFlags = wxSIZE_AUTO);
|
||||
virtual void DoSetClientSize(int width, int height);
|
||||
|
||||
// a plug in for MDI frame classes which need to do something special when
|
||||
// the menubar is set
|
||||
virtual void InternalSetMenuBar();
|
||||
|
||||
// propagate our state change to all child frames
|
||||
void IconizeChildFrames(bool bIconize);
|
||||
|
||||
// we add menu bar accel processing
|
||||
bool MSWTranslateMessage(WXMSG* pMsg);
|
||||
|
||||
// window proc for the frames
|
||||
long MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
wxMenuBar * m_frameMenuBar;
|
||||
wxStatusBar * m_frameStatusBar;
|
||||
wxIcon m_icon;
|
||||
bool m_iconized;
|
||||
WXHICON m_defaultIcon;
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
wxStatusBar * m_frameStatusBar;
|
||||
|
||||
static bool m_useNativeStatusBar;
|
||||
#endif // wxUSE_STATUSBAR
|
||||
|
||||
#if wxUSE_TOOLBAR
|
||||
wxToolBar * m_frameToolBar ;
|
||||
#endif // wxUSE_TOOLBAR
|
||||
|
||||
private:
|
||||
#if wxUSE_TOOLTIPS
|
||||
WXHWND m_hwndToolTip;
|
||||
#endif // tooltips
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
@@ -63,8 +63,6 @@ class WXDLLEXPORT wxGauge: public wxControl
|
||||
protected:
|
||||
int m_rangeMax;
|
||||
int m_gaugePos;
|
||||
private:
|
||||
void SetSize(int width, int height) {wxWindow::SetSize(width, height);}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -49,8 +49,6 @@ public:
|
||||
wxIcon(const char bits[], int width, int height);
|
||||
wxIcon(const wxString& name, long flags = wxBITMAP_TYPE_ICO_RESOURCE,
|
||||
int desiredWidth = -1, int desiredHeight = -1);
|
||||
wxIcon( char **bits, int width=-1, int height=-1 );
|
||||
|
||||
~wxIcon();
|
||||
|
||||
bool LoadFile(const wxString& name, long flags = wxBITMAP_TYPE_ICO_RESOURCE,
|
||||
@@ -68,9 +66,11 @@ public:
|
||||
/* TODO */
|
||||
virtual bool Ok() const { return (m_refData != NULL) ; }
|
||||
private:
|
||||
// supress VisAge hiding warning
|
||||
bool LoadFile(const wxString& name, long type = wxBITMAP_TYPE_BMP_RESOURCE)
|
||||
{ return(wxBitmap::LoadFile(name, type)); }
|
||||
// supress virtual function hiding warning
|
||||
virtual bool LoadFile( const wxString& name
|
||||
,long type = wxBITMAP_TYPE_BMP_RESOURCE
|
||||
)
|
||||
{ return(wxBitmap::LoadFile(name, type)); };
|
||||
};
|
||||
|
||||
/* Example handlers. TODO: write your own handlers for relevant types.
|
||||
|
@@ -1,11 +1,11 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: listbox.h
|
||||
// Purpose: wxListBox class
|
||||
// Author: Julian Smart
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -18,31 +18,21 @@
|
||||
|
||||
#include "wx/control.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxListBoxNameStr;
|
||||
|
||||
#if wxUSE_OWNER_DRAWN
|
||||
class WXDLLEXPORT wxOwnerDrawn;
|
||||
|
||||
// define the array of list box items
|
||||
#include <wx/dynarray.h>
|
||||
|
||||
WX_DEFINE_ARRAY(wxOwnerDrawn *, wxListBoxItemsArray);
|
||||
|
||||
#endif
|
||||
WXDLLEXPORT_DATA(extern const char*) wxListBoxNameStr;
|
||||
|
||||
// forward decl for GetSelections()
|
||||
class wxArrayInt;
|
||||
class WXDLLEXPORT wxArrayInt;
|
||||
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxEmptyString;
|
||||
WXDLLEXPORT_DATA(extern const char*) wxEmptyString;
|
||||
|
||||
// List box item
|
||||
class WXDLLEXPORT wxListBox: public wxControl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxListBox)
|
||||
|
||||
public:
|
||||
|
||||
wxListBox();
|
||||
wxListBox(wxWindow *parent, wxWindowID id,
|
||||
inline wxListBox(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
int n = 0, const wxString choices[] = NULL,
|
||||
@@ -63,25 +53,9 @@ public:
|
||||
|
||||
~wxListBox();
|
||||
|
||||
bool MSWCommand(WXUINT param, WXWORD id);
|
||||
|
||||
#if wxUSE_OWNER_DRAWN
|
||||
bool MSWOnMeasure(WXMEASUREITEMSTRUCT *item);
|
||||
bool MSWOnDraw(WXDRAWITEMSTRUCT *item);
|
||||
|
||||
// plug-in for derived classes
|
||||
virtual wxOwnerDrawn *CreateItem(size_t n);
|
||||
|
||||
// allows to get the item and use SetXXX functions to set it's appearance
|
||||
wxOwnerDrawn *GetItem(size_t n) const { return m_aItems[n]; }
|
||||
|
||||
// get the index of the given item
|
||||
int GetItemIndex(wxOwnerDrawn *item) const { return m_aItems.Index(item); }
|
||||
#endif // wxUSE_OWNER_DRAWN
|
||||
|
||||
virtual void Append(const wxString& item);
|
||||
virtual void Append(const wxString& item, void *clientData);
|
||||
virtual void Set(int n, const wxString* choices, void **clientData = NULL);
|
||||
virtual void Append(const wxString& item, char *clientData);
|
||||
virtual void Set(int n, const wxString* choices, char **clientData = NULL);
|
||||
virtual int FindString(const wxString& s) const ;
|
||||
virtual void Clear();
|
||||
virtual void SetSelection(int n, bool select = TRUE);
|
||||
@@ -91,14 +65,15 @@ public:
|
||||
// For single choice list item only
|
||||
virtual int GetSelection() const ;
|
||||
virtual void Delete(int n);
|
||||
virtual void *GetClientData(int n) const ;
|
||||
virtual void SetClientData(int n, void *clientData);
|
||||
virtual char *GetClientData(int n) const ;
|
||||
virtual void SetClientData(int n, char *clientData);
|
||||
virtual void SetString(int n, const wxString& s);
|
||||
|
||||
// For single or multiple choice list item
|
||||
virtual int GetSelections(wxArrayInt& aSelections) const;
|
||||
virtual bool Selected(int n) const ;
|
||||
virtual wxString GetString(int n) const ;
|
||||
virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
||||
|
||||
// Set the specified item at the first visible item
|
||||
// or scroll to max range.
|
||||
@@ -113,36 +88,9 @@ public:
|
||||
|
||||
void Command(wxCommandEvent& event);
|
||||
|
||||
// Windows-specific code to set the horizontal extent of
|
||||
// the listbox, if necessary. If s is non-NULL, it's
|
||||
// used to calculate the horizontal extent.
|
||||
// Otherwise, all strings are used.
|
||||
virtual void SetHorizontalExtent(const wxString& s = wxEmptyString);
|
||||
|
||||
virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
|
||||
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||
virtual void SetupColours();
|
||||
|
||||
protected:
|
||||
int m_noItems;
|
||||
int m_selected;
|
||||
|
||||
#if wxUSE_OWNER_DRAWN
|
||||
// control items
|
||||
wxListBoxItemsArray m_aItems;
|
||||
#endif
|
||||
private:
|
||||
// Virtual function hiding warning
|
||||
virtual wxControl *CreateItem(const wxItemResource* childResource,
|
||||
const wxItemResource* parentResource,
|
||||
const wxResourceTable *table = (const wxResourceTable *) NULL)
|
||||
{ return(wxWindowBase::CreateItem(childResource, parentResource, table)); }
|
||||
virtual void *GetClientData() const
|
||||
{return (wxWindowBase::GetClientData()); }
|
||||
virtual void SetClientData( void *data )
|
||||
{ wxWindowBase::SetClientData(data); }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -128,8 +128,8 @@ public:
|
||||
virtual void Restore();
|
||||
virtual void Activate();
|
||||
private:
|
||||
// Supress VA's hidden function warning
|
||||
void Maximize(bool maximize) {wxFrame::Maximize(maximize);}
|
||||
// supress virtual function hiding warning
|
||||
virtual void Maximize(bool maximize) { wxFrame::Maximize(maximize); };
|
||||
};
|
||||
|
||||
/* The client window is a child of the parent MDI frame, and itself
|
||||
|
@@ -1,13 +1,11 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: printdlg.h
|
||||
// Purpose: wxPrintDialog, wxPageSetupDialog classes.
|
||||
// Use generic, PostScript version if no
|
||||
// platform-specific implementation.
|
||||
// Author: AUTHOR
|
||||
// Purpose: wxPrintDialog, wxPageSetupDialog classes
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -18,15 +16,17 @@
|
||||
#pragma interface "printdlg.h"
|
||||
#endif
|
||||
|
||||
#if wxUSE_PRINTING_ARCHITECTURE
|
||||
|
||||
#include "wx/dialog.h"
|
||||
#include "wx/cmndata.h"
|
||||
|
||||
/*
|
||||
* wxPrinterDialog
|
||||
* The common dialog for printing.
|
||||
*/
|
||||
|
||||
class WXDLLEXPORT wxDC;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// wxPrinterDialog: the common dialog for printing.
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxPrintDialog : public wxDialog
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxPrintDialog)
|
||||
@@ -35,13 +35,13 @@ class WXDLLEXPORT wxPrintDialog: public wxDialog
|
||||
wxPrintDialog();
|
||||
wxPrintDialog(wxWindow *parent, wxPrintDialogData* data = NULL);
|
||||
wxPrintDialog(wxWindow *parent, wxPrintData* data);
|
||||
~wxPrintDialog();
|
||||
virtual ~wxPrintDialog();
|
||||
|
||||
bool Create(wxWindow *parent, wxPrintData* data = NULL);
|
||||
bool Create(wxWindow *parent, wxPrintDialogData* data = NULL);
|
||||
virtual int ShowModal();
|
||||
|
||||
wxPrintDialogData& GetPrintDialogData() { return m_printDialogData; }
|
||||
inline wxPrintData& GetPrintData() { return m_printDialogData.GetPrintData(); }
|
||||
wxPrintData& GetPrintData() { return m_printDialogData.GetPrintData(); }
|
||||
virtual wxDC *GetPrintDC();
|
||||
|
||||
private:
|
||||
@@ -58,17 +58,19 @@ class WXDLLEXPORT wxPageSetupDialog: public wxDialog
|
||||
public:
|
||||
wxPageSetupDialog();
|
||||
wxPageSetupDialog(wxWindow *parent, wxPageSetupData *data = NULL);
|
||||
~wxPageSetupDialog();
|
||||
virtual ~wxPageSetupDialog();
|
||||
|
||||
bool Create(wxWindow *parent, wxPageSetupData *data = NULL);
|
||||
virtual int ShowModal();
|
||||
|
||||
inline wxPageSetupData& GetPageSetupData() { return m_pageSetupData; }
|
||||
wxPageSetupData& GetPageSetupData() { return m_pageSetupData; }
|
||||
|
||||
private:
|
||||
wxPageSetupData m_pageSetupData;
|
||||
wxWindow* m_dialogParent;
|
||||
};
|
||||
|
||||
#endif // wxUSE_PRINTING_ARCHITECTURE
|
||||
|
||||
#endif
|
||||
// _WX_PRINTDLG_H_
|
||||
|
@@ -1,11 +1,11 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: radiobox.h
|
||||
// Purpose: wxRadioBox class
|
||||
// Author: Julian Smart
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
#include "wx/control.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxRadioBoxNameStr;
|
||||
WXDLLEXPORT_DATA(extern const char*) wxRadioBoxNameStr;
|
||||
|
||||
// List box item
|
||||
class WXDLLEXPORT wxBitmap ;
|
||||
@@ -26,18 +26,10 @@ class WXDLLEXPORT wxBitmap;
|
||||
class WXDLLEXPORT wxRadioBox: public wxControl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxRadioBox)
|
||||
|
||||
public:
|
||||
wxRadioBox();
|
||||
|
||||
#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
|
||||
|
||||
wxRadioBox(wxWindow *parent, wxWindowID id, const wxString& title,
|
||||
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,
|
||||
@@ -54,70 +46,42 @@ public:
|
||||
int majorDim = 0, long style = wxRA_HORIZONTAL,
|
||||
const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr);
|
||||
|
||||
virtual bool MSWCommand(WXUINT param, WXWORD id);
|
||||
virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
|
||||
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
int FindString(const wxString& s) const;
|
||||
void SetSelection(int N);
|
||||
int GetSelection() const;
|
||||
wxString GetString(int N) const;
|
||||
|
||||
void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
||||
void GetSize(int *x, int *y) const;
|
||||
void GetPosition(int *x, int *y) const;
|
||||
|
||||
wxString GetLabel() const;
|
||||
void SetLabel(const wxString& label);
|
||||
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) ;
|
||||
void SetLabelFont(const wxFont& WXUNUSED(font)) {};
|
||||
void SetButtonFont(const wxFont& font) { SetFont(font); }
|
||||
inline void SetLabelFont(const wxFont& WXUNUSED(font)) {};
|
||||
inline void SetButtonFont(const wxFont& font) { SetFont(font); }
|
||||
|
||||
virtual wxString GetStringSelection() const;
|
||||
virtual bool SetStringSelection(const wxString& s);
|
||||
virtual int Number() const { return m_noItems; };
|
||||
inline virtual int Number() const { return m_noItems; } ;
|
||||
void Command(wxCommandEvent& event);
|
||||
|
||||
int GetNumberOfRowsOrCols() const { return m_noRowsOrCols; }
|
||||
void SetNumberOfRowsOrCols(int n) { m_noRowsOrCols = n; }
|
||||
|
||||
// Implementation
|
||||
WXHWND *GetRadioButtons() const { return m_radioButtons; }
|
||||
bool ContainsHWND(WXHWND hWnd) const;
|
||||
void SendNotificationEvent();
|
||||
|
||||
long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
// get the number of buttons per column/row
|
||||
inline int GetNumVer() const;
|
||||
inline int GetNumHor() const;
|
||||
inline int GetNumberOfRowsOrCols() const { return m_noRowsOrCols; }
|
||||
inline void SetNumberOfRowsOrCols(int n) { m_noRowsOrCols = n; }
|
||||
|
||||
protected:
|
||||
void SubclassRadioButton(WXHWND hWndBtn);
|
||||
|
||||
/* TODO: implementation
|
||||
WXHWND * m_radioButtons;
|
||||
*/
|
||||
int m_majorDim ;
|
||||
int * m_radioWidth; // for bitmaps
|
||||
int * m_radioHeight;
|
||||
|
||||
int m_noItems;
|
||||
int m_noRowsOrCols;
|
||||
int m_selectedButton;
|
||||
|
||||
virtual void DoSetSize(int x, int y,
|
||||
int width, int height,
|
||||
int sizeFlags = wxSIZE_AUTO);
|
||||
private:
|
||||
// Virtual function hiding warning
|
||||
virtual wxString GetLabel() const
|
||||
{ return(wxControl::GetLabel()); }
|
||||
virtual void SetLabel(const wxString& label)
|
||||
{ wxControl::SetLabel(label); }
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -85,8 +85,6 @@ public:
|
||||
int m_lineSize;
|
||||
int m_tickFreq;
|
||||
DECLARE_EVENT_TABLE()
|
||||
private:
|
||||
void SetSize(int width, int height) {wxWindow::SetSize(width, height);}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -69,16 +69,6 @@ protected:
|
||||
int m_max;
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxSpinEvent: public wxScrollEvent
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxSpinEvent)
|
||||
|
||||
public:
|
||||
wxSpinEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
|
||||
};
|
||||
|
||||
typedef void (wxEvtHandler::*wxSpinEventFunction)(wxSpinEvent&);
|
||||
|
||||
// Spin events
|
||||
|
||||
#define EVT_SPIN_UP(id, func) { wxEVT_SCROLL_LINEUP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func }
|
||||
|
@@ -57,8 +57,7 @@ class WXDLLEXPORT wxStaticBitmap: public wxControl
|
||||
|
||||
protected:
|
||||
wxBitmap m_messageBitmap;
|
||||
private:
|
||||
void SetSize(int width, int height) {wxWindow::SetSize(width, height);}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -51,8 +51,6 @@ class WXDLLEXPORT wxStaticBox: public wxControl
|
||||
void SetLabel(const wxString& label);
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
private:
|
||||
void SetSize(int width, int height) {wxWindow::SetSize(width, height);}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -50,8 +50,6 @@ class WXDLLEXPORT wxStaticText: public wxControl
|
||||
// operations
|
||||
virtual void Command(wxCommandEvent& WXUNUSED(event)) {};
|
||||
virtual void ProcessCommand(wxCommandEvent& WXUNUSED(event)) {};
|
||||
private:
|
||||
void SetSize(int width, int height) {wxWindow::SetSize(width, height);}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -161,8 +161,6 @@ protected:
|
||||
wxString m_fileName;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
private:
|
||||
void SetSize(int width, int height) {wxWindow::SetSize(width, height);}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -1,67 +1,65 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: window.h
|
||||
// Purpose: wxWindow class
|
||||
// Author: Julian Smart
|
||||
// Author: David Webster
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_WINDOW_H_
|
||||
#define _WX_WINDOW_H_
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// headers
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "window.h"
|
||||
#endif
|
||||
|
||||
// #include "wx/msw/winundef.h"
|
||||
#define INCL_DOS
|
||||
#define INCL_PM
|
||||
#include <os2.h>
|
||||
|
||||
// VZ: apparently some version of Windows send extra mouse move messages after
|
||||
// a mouse click. My tests under NT 4.0 and 95 didn't show it so I'm
|
||||
// tempted to think that it was just an effect of a poor mouse and so the
|
||||
// code to work around this is currently disabled - just define this as 1
|
||||
// to reenable it
|
||||
#define wxUSE_MOUSEEVENT_HACK 0
|
||||
#define wxKEY_SHIFT 1
|
||||
#define wxKEY_CTRL 2
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// forward declarations
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxWindow;
|
||||
class WXDLLEXPORT wxButton;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// constants
|
||||
// ---------------------------------------------------------------------------
|
||||
#if wxUSE_DRAG_AND_DROP
|
||||
class WXDLLEXPORT wxDropTarget;
|
||||
#endif
|
||||
|
||||
// FIXME does anybody use those? they're unused by wxWindows...
|
||||
enum
|
||||
{
|
||||
wxKEY_SHIFT = 1,
|
||||
wxKEY_CTRL = 2
|
||||
};
|
||||
#if wxUSE_WX_RESOURCES
|
||||
class WXDLLEXPORT wxResourceTable;
|
||||
class WXDLLEXPORT wxItemResource;
|
||||
#endif
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxPanelNameStr;
|
||||
|
||||
WXDLLEXPORT_DATA(extern const wxSize) wxDefaultSize;
|
||||
WXDLLEXPORT_DATA(extern const wxPoint) wxDefaultPosition;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// wxWindow declaration for MSW
|
||||
// ---------------------------------------------------------------------------
|
||||
class WXDLLEXPORT wxWindow: public wxWindowBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxWindow);
|
||||
DECLARE_ABSTRACT_CLASS(wxWindow)
|
||||
|
||||
friend class wxDC;
|
||||
friend class wxPaintDC;
|
||||
|
||||
public:
|
||||
wxWindow() { Init(); }
|
||||
|
||||
wxWindow(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxPanelNameStr)
|
||||
wxWindow() { Init(); };
|
||||
inline wxWindow( wxWindow* parent
|
||||
,wxWindowID id
|
||||
,const wxPoint& pos = wxDefaultPosition
|
||||
,const wxSize& size = wxDefaultSize
|
||||
,long style = 0
|
||||
,const wxString& name = wxPanelNameStr
|
||||
)
|
||||
{
|
||||
Init();
|
||||
Create(parent, id, pos, size, style, name);
|
||||
@@ -69,121 +67,160 @@ public:
|
||||
|
||||
virtual ~wxWindow();
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxPanelNameStr);
|
||||
bool Create( wxWindow* parent
|
||||
,wxWindowID id
|
||||
,const wxPoint& pos = wxDefaultPosition
|
||||
,const wxSize& size = wxDefaultSize
|
||||
,long style = 0
|
||||
,const wxString& name = wxPanelNameStr
|
||||
);
|
||||
|
||||
// implement base class pure virtuals
|
||||
virtual void SetTitle( const wxString& title);
|
||||
virtual wxString GetTitle() const;
|
||||
// ---------------------------------------------------------------------------
|
||||
// wxWindowBase pure virtual implementations
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
// Z order
|
||||
virtual void Raise();
|
||||
virtual void Lower();
|
||||
|
||||
virtual bool Show( bool show = TRUE );
|
||||
virtual bool Enable( bool enable = TRUE );
|
||||
|
||||
// Set the focus to this window
|
||||
virtual void SetFocus();
|
||||
|
||||
virtual bool Reparent( wxWindow *newParent );
|
||||
|
||||
virtual void WarpPointer(int x, int y);
|
||||
// Warp the pointer the given position
|
||||
virtual void WarpPointer(int x_pos, int y_pos) ;
|
||||
// Capture/release mouse
|
||||
virtual void CaptureMouse();
|
||||
virtual void ReleaseMouse();
|
||||
|
||||
virtual void Refresh( bool eraseBackground = TRUE,
|
||||
const wxRect *rect = (const wxRect *) NULL );
|
||||
// Send the window a refresh event
|
||||
virtual void Refresh(bool eraseBack = TRUE, const wxRect *rect = NULL);
|
||||
// Clear the window
|
||||
virtual void Clear();
|
||||
|
||||
virtual bool SetCursor( const wxCursor &cursor );
|
||||
virtual bool SetFont( const wxFont &font );
|
||||
|
||||
// Set window's font
|
||||
virtual bool SetFont(const wxFont& f);
|
||||
// Get character size
|
||||
virtual int GetCharHeight() const;
|
||||
virtual int GetCharWidth() const;
|
||||
virtual void GetTextExtent(const wxString& string,
|
||||
int *x, int *y,
|
||||
int *descent = (int *) NULL,
|
||||
int *externalLeading = (int *) NULL,
|
||||
const wxFont *theFont = (const wxFont *) NULL)
|
||||
const;
|
||||
virtual void GetTextExtent( const wxString& string
|
||||
,int* x
|
||||
,int* y
|
||||
,int* descent = NULL
|
||||
,int* externalLeading = NULL
|
||||
,const wxFont* theFont = NULL
|
||||
) const;
|
||||
|
||||
virtual bool PopupMenu( wxMenu *menu, int x, int y );
|
||||
// Configure the window's scrollbar
|
||||
virtual void SetScrollbar( int orient
|
||||
,int pos
|
||||
,int thumbVisible
|
||||
,int range
|
||||
,bool refresh = TRUE
|
||||
);
|
||||
virtual void SetScrollPos( int orient
|
||||
,int pos
|
||||
,bool refresh = TRUE
|
||||
);
|
||||
virtual int GetScrollPos(int orient) const;
|
||||
virtual int GetScrollRange(int orient) const;
|
||||
virtual int GetScrollThumb(int orient) const;
|
||||
virtual void ScrollWindow( int dx
|
||||
,int dy
|
||||
,const wxRect* rect = NULL
|
||||
);
|
||||
#if wxUSE_DRAG_AND_DROP
|
||||
void SetDropTarget(wxDropTarget *pDropTarget);
|
||||
#endif
|
||||
// coordinates translation
|
||||
virtual void DoClientToScreen( int *x, int *y ) const;
|
||||
virtual void DoScreenToClient( int *x, int *y ) const;
|
||||
|
||||
// retrieve the position/size of the window
|
||||
virtual void DoGetPosition( int *x, int *y ) const;
|
||||
virtual void DoGetSize( int *width, int *height ) const;
|
||||
virtual void DoGetClientSize( int *width, int *height ) const;
|
||||
|
||||
// this is the virtual function to be overriden in any derived class which
|
||||
// wants to change how SetSize() or Move() works - it is called by all
|
||||
// versions of these functions in the base class
|
||||
virtual void DoSetSize(int x, int y,
|
||||
int width, int height,
|
||||
int sizeFlags = wxSIZE_AUTO);
|
||||
|
||||
// same as DoSetSize() for the client size
|
||||
virtual void DoSetClientSize(int width, int height);
|
||||
virtual bool DoPopupMenu( wxMenu *menu, int x, int y );
|
||||
|
||||
virtual void SetScrollbar( int orient, int pos, int thumbVisible,
|
||||
int range, bool refresh = TRUE );
|
||||
virtual void SetScrollPos( int orient, int pos, bool refresh = TRUE );
|
||||
virtual int GetScrollPos( int orient ) const;
|
||||
virtual int GetScrollThumb( int orient ) const;
|
||||
virtual int GetScrollRange( int orient ) const;
|
||||
virtual void ScrollWindow( int dx, int dy,
|
||||
const wxRect* rect = (wxRect *) NULL );
|
||||
// ---------------------------------------------------------------------------
|
||||
// wxWindowBase virtual implementations that need to be overriden
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_DRAG_AND_DROP
|
||||
virtual void SetDropTarget( wxDropTarget *dropTarget );
|
||||
#endif // wxUSE_DRAG_AND_DROP
|
||||
// Fit the window around the items
|
||||
virtual void Fit();
|
||||
// Show or hide the window
|
||||
virtual bool Show(bool show); // check if base implementation is OK
|
||||
// Enable or disable the window
|
||||
virtual bool Enable(bool enable); // check if base implementation is OK
|
||||
// Set the cursor
|
||||
virtual bool SetCursor(const wxCursor& cursor); // check if base implementation is OK
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// additional functions
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
// Dialog support: override these and call
|
||||
// base class members to add functionality
|
||||
// that can't be done using validators.
|
||||
|
||||
// Validate controls. If returns FALSE,
|
||||
// validation failed: don't quit
|
||||
virtual bool Validate();
|
||||
|
||||
// Return code for dialogs
|
||||
inline void SetReturnCode(int retCode);
|
||||
inline int GetReturnCode();
|
||||
|
||||
|
||||
// Get the window with the focus
|
||||
static wxWindow *FindFocus();
|
||||
|
||||
// Accept files for dragging
|
||||
virtual void DragAcceptFiles(bool accept);
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
// Set/get scroll attributes
|
||||
virtual void SetScrollRange(int orient, int range, bool refresh = TRUE);
|
||||
virtual void SetScrollPage(int orient, int page, bool refresh = TRUE);
|
||||
virtual int OldGetScrollRange(int orient) const;
|
||||
virtual int GetScrollPage(int orient) const;
|
||||
// Most windows have the concept of a label; for frames, this is the
|
||||
// title; for items, this is the label or button text.
|
||||
inline virtual wxString GetLabel() const { return GetTitle(); }
|
||||
|
||||
|
||||
// Caret manipulation
|
||||
virtual void CreateCaret(int w, int h);
|
||||
virtual void CreateCaret(const wxBitmap *bitmap);
|
||||
virtual void DestroyCaret();
|
||||
virtual void ShowCaret(bool show);
|
||||
virtual void SetCaretPos(int x, int y);
|
||||
virtual void GetCaretPos(int *x, int *y) const;
|
||||
|
||||
|
||||
// event handlers
|
||||
// Handle a control command
|
||||
virtual void OnCommand(wxWindow& win, wxCommandEvent& event);
|
||||
|
||||
// Override to define new behaviour for default action (e.g. double
|
||||
// clicking on a listbox)
|
||||
virtual void OnDefaultAction(wxControl * WXUNUSED(initiatingItem)) { }
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
// Get the default button, if there is one
|
||||
inline virtual wxButton *GetDefaultItem() const;
|
||||
inline virtual void SetDefaultItem(wxButton *but);
|
||||
|
||||
#if wxUSE_CARET && WXWIN_COMPATIBILITY
|
||||
// caret manipulation (old MSW only functions, see wxCaret class for the
|
||||
// new API)
|
||||
void CreateCaret(int w, int h);
|
||||
void CreateCaret(const wxBitmap *bitmap);
|
||||
void DestroyCaret();
|
||||
void ShowCaret(bool show);
|
||||
void SetCaretPos(int x, int y);
|
||||
void GetCaretPos(int *x, int *y) const;
|
||||
#endif // wxUSE_CARET
|
||||
// Override to define new behaviour for default action (e.g. double clicking
|
||||
// on a listbox)
|
||||
virtual void OnDefaultAction(wxControl *initiatingItem);
|
||||
|
||||
// Native resource loading (implemented in src/msw/nativdlg.cpp)
|
||||
// FIXME: should they really be all virtual?
|
||||
virtual bool LoadNativeDialog(wxWindow* parent, wxWindowID& id);
|
||||
virtual bool LoadNativeDialog(wxWindow* parent, const wxString& name);
|
||||
wxWindow* GetWindowChild1(wxWindowID id);
|
||||
wxWindow* GetWindowChild(wxWindowID id);
|
||||
|
||||
// implementation from now on
|
||||
// --------------------------
|
||||
|
||||
// simple accessors
|
||||
// ----------------
|
||||
|
||||
WXHWND GetHWND() const { return m_hWnd; }
|
||||
void SetHWND(WXHWND hWnd) { m_hWnd = hWnd; }
|
||||
virtual WXWidget GetHandle() const { return GetHWND(); }
|
||||
|
||||
bool GetUseCtl3D() const { return m_useCtl3D; }
|
||||
bool GetTransparentBackground() const { return m_backgroundTransparent; }
|
||||
void SetTransparent(bool t = TRUE) { m_backgroundTransparent = t; }
|
||||
|
||||
// event handlers
|
||||
// --------------
|
||||
void OnEraseBackground(wxEraseEvent& event);
|
||||
void OnChar(wxKeyEvent& event);
|
||||
void OnKeyDown(wxKeyEvent& event);
|
||||
void OnKeyUp(wxKeyEvent& event);
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
void OnIdle(wxIdleEvent& event);
|
||||
|
||||
|
||||
public:
|
||||
// ---------------------------------------------------------------------------
|
||||
// IMPLEMENTATION
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
// For implementation purposes - sometimes decorations make the client area
|
||||
// smaller
|
||||
virtual wxPoint GetClientAreaOrigin() const;
|
||||
@@ -192,245 +229,52 @@ public:
|
||||
// a toolbar that it manages itself).
|
||||
virtual void AdjustForParentClientOrigin(int& x, int& y, int sizeFlags);
|
||||
|
||||
// Windows subclassing
|
||||
void SubclassWin(WXHWND hWnd);
|
||||
void UnsubclassWin();
|
||||
// Executes the default message
|
||||
virtual long Default();
|
||||
|
||||
WXFARPROC MSWGetOldWndProc() const { return m_oldWndProc; }
|
||||
void MSWSetOldWndProc(WXFARPROC proc) { m_oldWndProc = proc; }
|
||||
|
||||
wxWindow *FindItem(int id) const;
|
||||
wxWindow *FindItemByHWND(WXHWND hWnd, bool controlOnly = FALSE) const;
|
||||
|
||||
// Make a Windows extended style from the given wxWindows window style
|
||||
virtual WXDWORD MakeExtendedStyle(long style, bool eliminateBorders = TRUE);
|
||||
/* TODO: you may need something like this
|
||||
// Determine whether 3D effects are wanted
|
||||
virtual WXDWORD Determine3DEffects(WXDWORD defaultBorderStyle, bool *want3D);
|
||||
*/
|
||||
|
||||
// MSW only: TRUE if this control is part of the main control
|
||||
virtual bool ContainsHWND(WXHWND WXUNUSED(hWnd)) const { return FALSE; };
|
||||
// Constraint implementation
|
||||
void UnsetConstraints(wxLayoutConstraints *c);
|
||||
// Back-pointer to other windows we're involved with, so if we delete
|
||||
// this window, we must delete any constraints we're involved with.
|
||||
|
||||
// returns TRUE if the window has been created
|
||||
bool MSWCreate(int id,
|
||||
wxWindow *parent,
|
||||
const wxChar *wclass,
|
||||
wxWindow *wx_win,
|
||||
const wxChar *title,
|
||||
int x, int y, int width, int height,
|
||||
WXDWORD style,
|
||||
const wxChar *dialog_template = NULL,
|
||||
WXDWORD exendedStyle = 0);
|
||||
virtual bool MSWCommand(WXUINT param, WXWORD id);
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
wxObject *GetChild(int number) const ;
|
||||
virtual void MSWDeviceToLogical(float *x, float *y) const;
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
|
||||
// Create an appropriate wxWindow from a HWND
|
||||
virtual wxWindow* CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd);
|
||||
|
||||
// Make sure the window style reflects the HWND style (roughly)
|
||||
virtual void AdoptAttributesFromHWND();
|
||||
|
||||
// Setup background and foreground colours correctly
|
||||
virtual void SetupColours();
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// helpers for message handlers: these perform the same function as the
|
||||
// message crackers from <windowsx.h> - they unpack WPARAM and LPARAM into
|
||||
// the correct parameters
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
void UnpackCommand(WXWPARAM wParam, WXLPARAM lParam,
|
||||
WXWORD *id, WXHWND *hwnd, WXWORD *cmd);
|
||||
void UnpackActivate(WXWPARAM wParam, WXLPARAM lParam,
|
||||
WXWORD *state, WXWORD *minimized, WXHWND *hwnd);
|
||||
void UnpackScroll(WXWPARAM wParam, WXLPARAM lParam,
|
||||
WXWORD *code, WXWORD *pos, WXHWND *hwnd);
|
||||
void UnpackCtlColor(WXWPARAM wParam, WXLPARAM lParam,
|
||||
WXWORD *nCtlColor, WXHDC *hdc, WXHWND *hwnd);
|
||||
void UnpackMenuSelect(WXWPARAM wParam, WXLPARAM lParam,
|
||||
WXWORD *item, WXWORD *flags, WXHMENU *hmenu);
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// internal handlers for MSW messages: all handlers return a boolen value:
|
||||
// TRUE means that the handler processed the event and FALSE that it didn't
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
// there are several cases where we have virtual functions for Windows
|
||||
// message processing: this is because these messages often require to be
|
||||
// processed in a different manner in the derived classes. For all other
|
||||
// messages, however, we do *not* have corresponding MSWOnXXX() function
|
||||
// and if the derived class wants to process them, it should override
|
||||
// MSWWindowProc() directly.
|
||||
|
||||
// scroll event (both horizontal and vertical)
|
||||
virtual bool MSWOnScroll(int orientation, WXWORD nSBCode,
|
||||
WXWORD pos, WXHWND control);
|
||||
|
||||
// child control notifications
|
||||
#ifdef __WIN95__
|
||||
virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
|
||||
#endif // __WIN95__
|
||||
|
||||
// owner-drawn controls need to process these messages
|
||||
virtual bool MSWOnDrawItem(int id, WXDRAWITEMSTRUCT *item);
|
||||
virtual bool MSWOnMeasureItem(int id, WXMEASUREITEMSTRUCT *item);
|
||||
|
||||
// the rest are not virtual
|
||||
bool HandleCreate(WXLPCREATESTRUCT cs, bool *mayCreate);
|
||||
bool HandleInitDialog(WXHWND hWndFocus);
|
||||
bool HandleDestroy();
|
||||
|
||||
bool HandlePaint();
|
||||
bool HandleEraseBkgnd(WXHDC pDC);
|
||||
|
||||
bool HandleMinimize();
|
||||
bool HandleMaximize();
|
||||
bool HandleSize(int x, int y, WXUINT flag);
|
||||
bool HandleGetMinMaxInfo(void *mmInfo);
|
||||
|
||||
bool HandleShow(bool show, int status);
|
||||
bool HandleActivate(int flag, bool minimized, WXHWND activate);
|
||||
|
||||
bool HandleCommand(WXWORD id, WXWORD cmd, WXHWND control);
|
||||
bool HandleSysCommand(WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
bool HandleCtlColor(WXHBRUSH *hBrush,
|
||||
WXHDC hdc,
|
||||
WXHWND hWnd,
|
||||
WXUINT nCtlColor,
|
||||
WXUINT message,
|
||||
WXWPARAM wParam,
|
||||
WXLPARAM lParam);
|
||||
|
||||
bool HandlePaletteChanged(WXHWND hWndPalChange);
|
||||
bool HandleQueryNewPalette();
|
||||
bool HandleSysColorChange();
|
||||
|
||||
bool HandleQueryEndSession(long logOff, bool *mayEnd);
|
||||
bool HandleEndSession(bool endSession, long logOff);
|
||||
|
||||
bool HandleSetFocus(WXHWND wnd);
|
||||
bool HandleKillFocus(WXHWND wnd);
|
||||
|
||||
bool HandleDropFiles(WXWPARAM wParam);
|
||||
|
||||
bool HandleMouseEvent(WXUINT msg, int x, int y, WXUINT flags);
|
||||
bool HandleMouseMove(int x, int y, WXUINT flags);
|
||||
|
||||
bool HandleChar(WXWORD wParam, WXLPARAM lParam, bool isASCII = FALSE);
|
||||
bool HandleKeyDown(WXWORD wParam, WXLPARAM lParam);
|
||||
bool HandleKeyUp(WXWORD wParam, WXLPARAM lParam);
|
||||
|
||||
bool HandleQueryDragIcon(WXHICON *hIcon);
|
||||
|
||||
bool HandleSetCursor(WXHWND hWnd, short nHitTest, int mouseMsg);
|
||||
|
||||
// Window procedure
|
||||
virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
// Calls an appropriate default window procedure
|
||||
virtual long MSWDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||
virtual bool MSWProcessMessage(WXMSG* pMsg);
|
||||
virtual bool MSWTranslateMessage(WXMSG* pMsg);
|
||||
virtual void MSWDestroyWindow();
|
||||
|
||||
// Detach "Window" menu from menu bar so it doesn't get deleted
|
||||
void MSWDetachWindowMenu();
|
||||
|
||||
// this function should return the brush to paint the window background
|
||||
// with or 0 for the default brush
|
||||
virtual WXHBRUSH OnCtlColor(WXHDC hDC,
|
||||
WXHWND hWnd,
|
||||
WXUINT nCtlColor,
|
||||
WXUINT message,
|
||||
WXWPARAM wParam,
|
||||
WXLPARAM lParam);
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
void SetShowing(bool show) { (void)Show(show); }
|
||||
bool IsUserEnabled() const { return IsEnabled(); }
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
|
||||
// Responds to colour changes: passes event on to children.
|
||||
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
||||
|
||||
// initialize various fields of wxMouseEvent (common part of MSWOnMouseXXX)
|
||||
void InitMouseEvent(wxMouseEvent& event, int x, int y, WXUINT flags);
|
||||
// Transfers data to any child controls
|
||||
void OnInitDialog(wxInitDialogEvent& event);
|
||||
|
||||
protected:
|
||||
// the window handle
|
||||
WXHWND m_hWnd;
|
||||
|
||||
// the old window proc (we subclass all windows)
|
||||
WXFARPROC m_oldWndProc;
|
||||
// Caret data
|
||||
int m_caretWidth;
|
||||
int m_caretHeight;
|
||||
bool m_caretEnabled;
|
||||
bool m_caretShown;
|
||||
|
||||
// additional (MSW specific) flags
|
||||
bool m_useCtl3D:1; // Using CTL3D for this control
|
||||
bool m_backgroundTransparent:1;
|
||||
bool m_mouseInWindow:1;
|
||||
bool m_doubleClickAllowed:1;
|
||||
bool m_winCaptured:1;
|
||||
wxButton * m_defaultItem;
|
||||
|
||||
// the size of one page for scrolling
|
||||
int m_xThumbSize;
|
||||
int m_yThumbSize;
|
||||
public:
|
||||
int m_returnCode;
|
||||
|
||||
#if wxUSE_MOUSEEVENT_HACK
|
||||
// the coordinates of the last mouse event and the type of it
|
||||
long m_lastMouseX,
|
||||
m_lastMouseY;
|
||||
int m_lastMouseEvent;
|
||||
#endif // wxUSE_MOUSEEVENT_HACK
|
||||
|
||||
WXHMENU m_hMenu; // Menu, if any
|
||||
|
||||
// the return value of WM_GETDLGCODE handler
|
||||
long m_lDlgCode;
|
||||
|
||||
// implement the base class pure virtuals
|
||||
virtual void DoClientToScreen( int *x, int *y ) const;
|
||||
virtual void DoScreenToClient( int *x, int *y ) const;
|
||||
virtual void DoGetPosition( int *x, int *y ) const;
|
||||
virtual void DoGetSize( int *width, int *height ) const;
|
||||
virtual void DoGetClientSize( int *width, int *height ) const;
|
||||
virtual void DoSetSize(int x, int y,
|
||||
int width, int height,
|
||||
int sizeFlags = wxSIZE_AUTO);
|
||||
virtual void DoSetClientSize(int width, int height);
|
||||
|
||||
// get the size which best suits the window: e.g., for a static text it
|
||||
// will be the width and height of the text
|
||||
virtual wxSize DoGetBestSize();
|
||||
|
||||
#if wxUSE_TOOLTIPS
|
||||
virtual void DoSetToolTip( wxToolTip *tip );
|
||||
#endif // wxUSE_TOOLTIPS
|
||||
|
||||
private:
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
||||
// the (non-virtual) handlers for the events
|
||||
bool HandleMove(int x, int y);
|
||||
bool HandleJoystickEvent(WXUINT msg, int x, int y, WXUINT flags);
|
||||
|
||||
DECLARE_NO_COPY_CLASS(wxWindow);
|
||||
DECLARE_EVENT_TABLE()
|
||||
// Supress virtual function hiding warning
|
||||
virtual bool Reparent( wxWindowBase *newParent )
|
||||
{return(wxWindowBase::Reparent(newParent));}
|
||||
private:
|
||||
void Init();
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// global functions
|
||||
// ---------------------------------------------------------------------------
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
//// INLINES
|
||||
|
||||
// kbd code translation
|
||||
WXDLLEXPORT int wxCharCodeMSWToWX(int keySym);
|
||||
WXDLLEXPORT int wxCharCodeWXToMSW(int id, bool *IsVirtual);
|
||||
inline wxButton *wxWindow::GetDefaultItem() const { return m_defaultItem; }
|
||||
inline void wxWindow::SetDefaultItem(wxButton *but) { m_defaultItem = but; }
|
||||
inline void wxWindow::SetReturnCode(int retCode) { m_returnCode = retCode; }
|
||||
inline int wxWindow::GetReturnCode() { return m_returnCode; }
|
||||
|
||||
// Get the active window.
|
||||
wxWindow* WXDLLEXPORT wxGetActiveWindow();
|
||||
|
||||
#endif
|
||||
// _WX_WINDOW_H_
|
||||
|
@@ -186,6 +186,9 @@ public:
|
||||
wxButton* m_windowHelpButton;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
private:
|
||||
virtual void ShowView(wxPropertySheet *propertySheet, wxWindow *window)
|
||||
{ wxPropertyView::ShowView(propertySheet, window); };
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxPropertyTextEdit: public wxTextCtrl
|
||||
|
@@ -94,6 +94,9 @@ public:
|
||||
|
||||
// To enable the compressor
|
||||
void Compress(bool on);
|
||||
private:
|
||||
// to prevent virtual function hiding warnings
|
||||
virtual bool Execute(const wxString& str) { return(wxConnectionBase::Execute(str)); };
|
||||
};
|
||||
|
||||
class wxTCPServer: public wxServerBase
|
||||
|
@@ -29,7 +29,7 @@ class WXDLLEXPORT wxSocketOutputStream : public wxOutputStream
|
||||
|
||||
off_t SeekO( off_t WXUNUSED(pos), wxSeekMode WXUNUSED(mode) )
|
||||
{ return -1; }
|
||||
off_t TellO()
|
||||
off_t TellO() const
|
||||
{ return -1; }
|
||||
|
||||
protected:
|
||||
@@ -46,7 +46,7 @@ class WXDLLEXPORT wxSocketInputStream : public wxInputStream
|
||||
|
||||
off_t SeekI( off_t WXUNUSED(pos), wxSeekMode WXUNUSED(mode) )
|
||||
{ return -1; }
|
||||
off_t TellI()
|
||||
off_t TellI() const
|
||||
{ return -1; }
|
||||
|
||||
protected:
|
||||
|
@@ -646,7 +646,7 @@ public:
|
||||
// get the haqndle of the window for the underlying window system: this
|
||||
// is only used for wxWin itself or for user code which wants to call
|
||||
// platform-specific APIs
|
||||
virtual WXWidget GetHandle() const = 0;
|
||||
virtual WXWidget GetHandle() const;
|
||||
|
||||
protected:
|
||||
// the window id - a number which uniquely identifies a window among
|
||||
|
Reference in New Issue
Block a user