*** empty log message ***
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3190 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
c2ff79b17b
commit
0e320a79f1
80
include/wx/os2/accel.h
Normal file
80
include/wx/os2/accel.h
Normal file
@ -0,0 +1,80 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: accel.h
|
||||
// Purpose: wxAcceleratorTable class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_ACCEL_H_
|
||||
#define _WX_ACCEL_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "accel.h"
|
||||
#endif
|
||||
|
||||
#include "wx/object.h"
|
||||
#include "wx/string.h"
|
||||
|
||||
class WXDLLEXPORT wxAcceleratorTable;
|
||||
|
||||
// Hold Ctrl key down
|
||||
#define wxACCEL_ALT 0x01
|
||||
|
||||
// Hold Ctrl key down
|
||||
#define wxACCEL_CTRL 0x02
|
||||
|
||||
// Hold Shift key down
|
||||
#define wxACCEL_SHIFT 0x04
|
||||
|
||||
// Hold no key down
|
||||
#define wxACCEL_NORMAL 0x00
|
||||
|
||||
class WXDLLEXPORT wxAcceleratorEntry
|
||||
{
|
||||
public:
|
||||
wxAcceleratorEntry(int flags = 0, int keyCode = 0, int cmd = 0)
|
||||
{
|
||||
m_flags = flags; m_keyCode = keyCode; m_command = cmd;
|
||||
}
|
||||
|
||||
inline void Set(int flags, int keyCode, int cmd)
|
||||
{ m_flags = flags; m_keyCode = keyCode; m_command = cmd; }
|
||||
|
||||
inline int GetFlags() const { return m_flags; }
|
||||
inline int GetKeyCode() const { return m_keyCode; }
|
||||
inline int GetCommand() const { return m_command; }
|
||||
|
||||
int m_flags;
|
||||
int m_keyCode; // ASCII or virtual keycode
|
||||
int m_command; // Command id to generate
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxAcceleratorTable: public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxAcceleratorTable)
|
||||
public:
|
||||
wxAcceleratorTable();
|
||||
wxAcceleratorTable(const wxString& resource); // Load from .rc resource
|
||||
wxAcceleratorTable(int n, wxAcceleratorEntry entries[]); // Load from array
|
||||
|
||||
// Copy constructors
|
||||
inline wxAcceleratorTable(const wxAcceleratorTable& accel) { Ref(accel); }
|
||||
inline wxAcceleratorTable(const wxAcceleratorTable* accel) { if (accel) Ref(*accel); }
|
||||
|
||||
~wxAcceleratorTable();
|
||||
|
||||
inline wxAcceleratorTable& operator = (const wxAcceleratorTable& accel) { if (*this == accel) return (*this); Ref(accel); return *this; }
|
||||
inline bool operator == (const wxAcceleratorTable& accel) { return m_refData == accel.m_refData; }
|
||||
inline bool operator != (const wxAcceleratorTable& accel) { return m_refData != accel.m_refData; }
|
||||
|
||||
bool Ok() const;
|
||||
};
|
||||
|
||||
WXDLLEXPORT_DATA(extern wxAcceleratorTable) wxNullAcceleratorTable;
|
||||
|
||||
#endif
|
||||
// _WX_ACCEL_H_
|
156
include/wx/os2/app.h
Normal file
156
include/wx/os2/app.h
Normal file
@ -0,0 +1,156 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: app.h
|
||||
// Purpose: wxApp class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_APP_H_
|
||||
#define _WX_APP_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "app.h"
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/object.h"
|
||||
#include "wx/gdicmn.h"
|
||||
#include "wx/event.h"
|
||||
|
||||
class WXDLLEXPORT wxFrame;
|
||||
class WXDLLEXPORT wxWindow;
|
||||
class WXDLLEXPORT wxApp ;
|
||||
class WXDLLEXPORT wxKeyEvent;
|
||||
class WXDLLEXPORT wxLog;
|
||||
|
||||
#define wxPRINT_WINDOWS 1
|
||||
#define wxPRINT_POSTSCRIPT 2
|
||||
|
||||
WXDLLEXPORT_DATA(extern wxApp*) wxTheApp;
|
||||
|
||||
// Force an exit from main loop
|
||||
void WXDLLEXPORT wxExit();
|
||||
|
||||
// Yield to other apps/messages
|
||||
bool WXDLLEXPORT wxYield();
|
||||
|
||||
// Represents the application. Derive OnInit and declare
|
||||
// a new App object to start application
|
||||
class WXDLLEXPORT wxApp: public wxEvtHandler
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxApp)
|
||||
wxApp();
|
||||
inline ~wxApp() {}
|
||||
|
||||
static void SetInitializerFunction(wxAppInitializerFunction fn) { m_appInitFn = fn; }
|
||||
static wxAppInitializerFunction GetInitializerFunction() { return m_appInitFn; }
|
||||
|
||||
virtual int MainLoop();
|
||||
void ExitMainLoop();
|
||||
bool Initialized();
|
||||
virtual bool Pending() ;
|
||||
virtual void Dispatch() ;
|
||||
|
||||
void OnIdle(wxIdleEvent& event);
|
||||
|
||||
// Generic
|
||||
virtual bool OnInit() { return FALSE; };
|
||||
|
||||
// No specific tasks to do here.
|
||||
virtual bool OnInitGui() { return TRUE; }
|
||||
|
||||
// Called to set off the main loop
|
||||
virtual int OnRun() { return MainLoop(); };
|
||||
virtual int OnExit() { return 0; }
|
||||
|
||||
/** Returns the standard icons for the msg dialogs, implemented in
|
||||
src/generic/msgdlgg.cpp and src/gtk/app.cpp. */
|
||||
virtual wxIcon GetStdIcon(int which) const;
|
||||
|
||||
inline void SetPrintMode(int mode) { m_printMode = mode; }
|
||||
inline int GetPrintMode() const { return m_printMode; }
|
||||
|
||||
inline void SetExitOnFrameDelete(bool flag) { m_exitOnFrameDelete = flag; }
|
||||
inline bool GetExitOnFrameDelete() const { return m_exitOnFrameDelete; }
|
||||
|
||||
inline wxString GetAppName() const {
|
||||
if (m_appName != "")
|
||||
return m_appName;
|
||||
else return m_className;
|
||||
}
|
||||
|
||||
inline void SetAppName(const wxString& name) { m_appName = name; };
|
||||
inline wxString GetClassName() const { return m_className; }
|
||||
inline void SetClassName(const wxString& name) { m_className = name; }
|
||||
|
||||
void SetVendorName(const wxString& vendorName) { m_vendorName = vendorName; }
|
||||
const wxString& GetVendorName() const { return m_vendorName; }
|
||||
|
||||
wxWindow *GetTopWindow() const ;
|
||||
inline void SetTopWindow(wxWindow *win) { m_topWindow = win; }
|
||||
|
||||
inline void SetWantDebugOutput(bool flag) { m_wantDebugOutput = flag; }
|
||||
inline bool GetWantDebugOutput() { return m_wantDebugOutput; }
|
||||
|
||||
// Send idle event to all top-level windows.
|
||||
// Returns TRUE if more idle time is requested.
|
||||
bool SendIdleEvents();
|
||||
|
||||
// Send idle event to window and all subwindows
|
||||
// Returns TRUE if more idle time is requested.
|
||||
bool SendIdleEvents(wxWindow* win);
|
||||
|
||||
// Windows only, but for compatibility...
|
||||
inline void SetAuto3D(bool flag) { m_auto3D = flag; }
|
||||
inline bool GetAuto3D() const { return m_auto3D; }
|
||||
|
||||
// Creates a log object
|
||||
virtual wxLog* CreateLogTarget();
|
||||
|
||||
public:
|
||||
// Will always be set to the appropriate, main-style values.
|
||||
int argc;
|
||||
char ** argv;
|
||||
|
||||
protected:
|
||||
bool m_wantDebugOutput ;
|
||||
wxString m_className;
|
||||
wxString m_appName,
|
||||
m_vendorName;
|
||||
wxWindow * m_topWindow;
|
||||
bool m_exitOnFrameDelete;
|
||||
bool m_showOnInit;
|
||||
int m_printMode; // wxPRINT_WINDOWS, wxPRINT_POSTSCRIPT
|
||||
bool m_auto3D ; // Always use 3D controls, except
|
||||
// where overriden
|
||||
static wxAppInitializerFunction m_appInitFn;
|
||||
|
||||
public:
|
||||
|
||||
// Implementation
|
||||
static bool Initialize();
|
||||
static void CleanUp();
|
||||
|
||||
void DeletePendingObjects();
|
||||
bool ProcessIdle();
|
||||
|
||||
public:
|
||||
static long sm_lastMessageTime;
|
||||
int m_nCmdShow;
|
||||
|
||||
protected:
|
||||
bool m_keepGoing ;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
// TODO: add platform-specific arguments
|
||||
int WXDLLEXPORT wxEntry( int argc, char *argv[] );
|
||||
|
||||
#endif
|
||||
// _WX_APP_H_
|
||||
|
197
include/wx/os2/bitmap.h
Normal file
197
include/wx/os2/bitmap.h
Normal file
@ -0,0 +1,197 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: bitmap.h
|
||||
// Purpose: wxBitmap class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_BITMAP_H_
|
||||
#define _WX_BITMAP_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "bitmap.h"
|
||||
#endif
|
||||
|
||||
#include "wx/gdiobj.h"
|
||||
#include "wx/gdicmn.h"
|
||||
#include "wx/palette.h"
|
||||
|
||||
// Bitmap
|
||||
class WXDLLEXPORT wxDC;
|
||||
class WXDLLEXPORT wxControl;
|
||||
class WXDLLEXPORT wxBitmap;
|
||||
class WXDLLEXPORT wxBitmapHandler;
|
||||
class WXDLLEXPORT wxIcon;
|
||||
class WXDLLEXPORT wxCursor;
|
||||
|
||||
// A mask is a mono bitmap used for drawing bitmaps
|
||||
// transparently.
|
||||
class WXDLLEXPORT wxMask: public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxMask)
|
||||
|
||||
public:
|
||||
wxMask();
|
||||
|
||||
// Construct a mask from a bitmap and a colour indicating
|
||||
// the transparent area
|
||||
wxMask(const wxBitmap& bitmap, const wxColour& colour);
|
||||
|
||||
// Construct a mask from a bitmap and a palette index indicating
|
||||
// the transparent area
|
||||
wxMask(const wxBitmap& bitmap, int paletteIndex);
|
||||
|
||||
// Construct a mask from a mono bitmap (copies the bitmap).
|
||||
wxMask(const wxBitmap& bitmap);
|
||||
|
||||
~wxMask();
|
||||
|
||||
bool Create(const wxBitmap& bitmap, const wxColour& colour);
|
||||
bool Create(const wxBitmap& bitmap, int paletteIndex);
|
||||
bool Create(const wxBitmap& bitmap);
|
||||
|
||||
/* TODO: platform-specific data access
|
||||
// Implementation
|
||||
inline WXHBITMAP GetMaskBitmap() const { return m_maskBitmap; }
|
||||
inline void SetMaskBitmap(WXHBITMAP bmp) { m_maskBitmap = bmp; }
|
||||
protected:
|
||||
WXHBITMAP m_maskBitmap;
|
||||
*/
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxBitmapRefData: public wxGDIRefData
|
||||
{
|
||||
friend class WXDLLEXPORT wxBitmap;
|
||||
friend class WXDLLEXPORT wxIcon;
|
||||
friend class WXDLLEXPORT wxCursor;
|
||||
public:
|
||||
wxBitmapRefData();
|
||||
~wxBitmapRefData();
|
||||
|
||||
public:
|
||||
int m_width;
|
||||
int m_height;
|
||||
int m_depth;
|
||||
bool m_ok;
|
||||
int m_numColors;
|
||||
wxPalette m_bitmapPalette;
|
||||
int m_quality;
|
||||
|
||||
/* WXHBITMAP m_hBitmap; TODO: platform-specific handle */
|
||||
wxMask * m_bitmapMask; // Optional mask
|
||||
};
|
||||
|
||||
#define M_BITMAPDATA ((wxBitmapRefData *)m_refData)
|
||||
|
||||
class WXDLLEXPORT wxBitmapHandler: public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxBitmapHandler)
|
||||
public:
|
||||
wxBitmapHandler() { m_name = ""; m_extension = ""; m_type = 0; };
|
||||
|
||||
virtual bool Create(wxBitmap *bitmap, void *data, long flags, int width, int height, int depth = 1);
|
||||
virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
|
||||
int desiredWidth, int desiredHeight);
|
||||
virtual bool SaveFile(wxBitmap *bitmap, const wxString& name, int type, const wxPalette *palette = NULL);
|
||||
|
||||
inline void SetName(const wxString& name) { m_name = name; }
|
||||
inline void SetExtension(const wxString& ext) { m_extension = ext; }
|
||||
inline void SetType(long type) { m_type = type; }
|
||||
inline wxString GetName() const { return m_name; }
|
||||
inline wxString GetExtension() const { return m_extension; }
|
||||
inline long GetType() const { return m_type; }
|
||||
protected:
|
||||
wxString m_name;
|
||||
wxString m_extension;
|
||||
long m_type;
|
||||
};
|
||||
|
||||
#define M_BITMAPHANDLERDATA ((wxBitmapRefData *)bitmap->GetRefData())
|
||||
|
||||
class WXDLLEXPORT wxBitmap: public wxGDIObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxBitmap)
|
||||
|
||||
friend class WXDLLEXPORT wxBitmapHandler;
|
||||
|
||||
public:
|
||||
wxBitmap(); // Platform-specific
|
||||
|
||||
// Copy constructors
|
||||
inline wxBitmap(const wxBitmap& bitmap)
|
||||
{ Ref(bitmap); if ( wxTheBitmapList ) wxTheBitmapList->AddBitmap(this); }
|
||||
|
||||
// Initialize with raw data.
|
||||
wxBitmap(const char bits[], int width, int height, int depth = 1);
|
||||
|
||||
/* TODO: maybe implement XPM reading
|
||||
// Initialize with XPM data
|
||||
wxBitmap(const char **data);
|
||||
*/
|
||||
|
||||
// Load a file or resource
|
||||
// TODO: make default type whatever's appropriate for the platform.
|
||||
wxBitmap(const wxString& name, long type = wxBITMAP_TYPE_BMP_RESOURCE);
|
||||
|
||||
// Constructor for generalised creation from data
|
||||
wxBitmap(void *data, long type, int width, int height, int depth = 1);
|
||||
|
||||
// If depth is omitted, will create a bitmap compatible with the display
|
||||
wxBitmap(int width, int height, int depth = -1);
|
||||
~wxBitmap();
|
||||
|
||||
virtual bool Create(int width, int height, int depth = -1);
|
||||
virtual bool Create(void *data, long type, int width, int height, int depth = 1);
|
||||
virtual bool LoadFile(const wxString& name, long type = wxBITMAP_TYPE_BMP_RESOURCE);
|
||||
virtual bool SaveFile(const wxString& name, int type, const wxPalette *cmap = NULL);
|
||||
|
||||
inline bool Ok() const { return (M_BITMAPDATA && M_BITMAPDATA->m_ok); }
|
||||
inline int GetWidth() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_width : 0); }
|
||||
inline int GetHeight() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_height : 0); }
|
||||
inline int GetDepth() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_depth : 0); }
|
||||
inline int GetQuality() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_quality : 0); }
|
||||
void SetWidth(int w);
|
||||
void SetHeight(int h);
|
||||
void SetDepth(int d);
|
||||
void SetQuality(int q);
|
||||
void SetOk(bool isOk);
|
||||
|
||||
inline wxPalette* GetPalette() const { return (M_BITMAPDATA ? (& M_BITMAPDATA->m_bitmapPalette) : (wxPalette*) NULL); }
|
||||
void SetPalette(const wxPalette& palette);
|
||||
|
||||
inline wxMask *GetMask() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_bitmapMask : (wxMask*) NULL); }
|
||||
void SetMask(wxMask *mask) ;
|
||||
|
||||
inline wxBitmap& operator = (const wxBitmap& bitmap) { if (*this == bitmap) return (*this); Ref(bitmap); return *this; }
|
||||
inline bool operator == (const wxBitmap& bitmap) { return m_refData == bitmap.m_refData; }
|
||||
inline bool operator != (const wxBitmap& bitmap) { return m_refData != bitmap.m_refData; }
|
||||
|
||||
// Format handling
|
||||
static inline wxList& GetHandlers() { return sm_handlers; }
|
||||
static void AddHandler(wxBitmapHandler *handler);
|
||||
static void InsertHandler(wxBitmapHandler *handler);
|
||||
static bool RemoveHandler(const wxString& name);
|
||||
static wxBitmapHandler *FindHandler(const wxString& name);
|
||||
static wxBitmapHandler *FindHandler(const wxString& extension, long bitmapType);
|
||||
static wxBitmapHandler *FindHandler(long bitmapType);
|
||||
|
||||
static void InitStandardHandlers();
|
||||
static void CleanUpHandlers();
|
||||
protected:
|
||||
static wxList sm_handlers;
|
||||
|
||||
/*
|
||||
// TODO: Implementation
|
||||
public:
|
||||
void SetHBITMAP(WXHBITMAP bmp);
|
||||
inline WXHBITMAP GetHBITMAP() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_hBitmap : 0); }
|
||||
bool FreeResource(bool force = FALSE);
|
||||
*/
|
||||
|
||||
};
|
||||
#endif
|
||||
// _WX_BITMAP_H_
|
87
include/wx/os2/bmpbuttn.h
Normal file
87
include/wx/os2/bmpbuttn.h
Normal file
@ -0,0 +1,87 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: bmpbuttn.h
|
||||
// Purpose: wxBitmapButton class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_BMPBUTTN_H_
|
||||
#define _WX_BMPBUTTN_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "bmpbuttn.h"
|
||||
#endif
|
||||
|
||||
#include "wx/button.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxButtonNameStr;
|
||||
|
||||
#define wxDEFAULT_BUTTON_MARGIN 4
|
||||
|
||||
class WXDLLEXPORT wxBitmapButton: public wxButton
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxBitmapButton)
|
||||
public:
|
||||
inline wxBitmapButton() { m_marginX = wxDEFAULT_BUTTON_MARGIN; m_marginY = wxDEFAULT_BUTTON_MARGIN; }
|
||||
inline wxBitmapButton(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxButtonNameStr)
|
||||
{
|
||||
Create(parent, id, bitmap, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxButtonNameStr);
|
||||
|
||||
virtual void SetLabel(const wxBitmap& bitmap)
|
||||
{
|
||||
SetBitmapLabel(bitmap);
|
||||
}
|
||||
|
||||
virtual void SetBitmapLabel(const wxBitmap& bitmap);
|
||||
|
||||
inline wxBitmap& GetBitmapLabel() const { return (wxBitmap&) m_buttonBitmap; }
|
||||
inline wxBitmap& GetBitmapSelected() const { return (wxBitmap&) m_buttonBitmapSelected; }
|
||||
inline wxBitmap& GetBitmapFocus() const { return (wxBitmap&) m_buttonBitmapFocus; }
|
||||
inline wxBitmap& GetBitmapDisabled() const { return (wxBitmap&) m_buttonBitmapDisabled; }
|
||||
|
||||
inline void SetBitmapSelected(const wxBitmap& sel) { m_buttonBitmapSelected = sel; };
|
||||
inline void SetBitmapFocus(const wxBitmap& focus) { m_buttonBitmapFocus = focus; };
|
||||
inline void SetBitmapDisabled(const wxBitmap& disabled) { m_buttonBitmapDisabled = disabled; };
|
||||
|
||||
inline void SetMargins(int x, int y) { m_marginX = x; m_marginY = y; }
|
||||
inline int GetMarginX() { return m_marginX; }
|
||||
inline int GetMarginY() { return m_marginY; }
|
||||
|
||||
/*
|
||||
// TODO: Implementation
|
||||
virtual bool MSWOnDraw(WXDRAWITEMSTRUCT *item);
|
||||
virtual void DrawFace( WXHDC dc, int left, int top, int right, int bottom, bool sel );
|
||||
virtual void DrawButtonFocus( WXHDC dc, int left, int top, int right, int bottom, bool sel );
|
||||
virtual void DrawButtonDisable( WXHDC dc, int left, int top, int right, int bottom, bool with_marg );
|
||||
*/
|
||||
|
||||
protected:
|
||||
wxBitmap m_buttonBitmap;
|
||||
wxBitmap m_buttonBitmapSelected;
|
||||
wxBitmap m_buttonBitmapFocus;
|
||||
wxBitmap m_buttonBitmapDisabled;
|
||||
int m_marginX;
|
||||
int m_marginY;
|
||||
private:
|
||||
// Supress VisualAge's hidden functin warning
|
||||
void SetLabel(const wxString& label)
|
||||
{ wxButton::SetLabel(label); }
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_BMPBUTTN_H_
|
83
include/wx/os2/brush.h
Normal file
83
include/wx/os2/brush.h
Normal file
@ -0,0 +1,83 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: brush.h
|
||||
// Purpose: wxBrush class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_BRUSH_H_
|
||||
#define _WX_BRUSH_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "brush.h"
|
||||
#endif
|
||||
|
||||
#include "wx/gdicmn.h"
|
||||
#include "wx/gdiobj.h"
|
||||
#include "wx/bitmap.h"
|
||||
|
||||
class WXDLLEXPORT wxBrush;
|
||||
|
||||
class WXDLLEXPORT wxBrushRefData: public wxGDIRefData
|
||||
{
|
||||
friend class WXDLLEXPORT wxBrush;
|
||||
public:
|
||||
wxBrushRefData();
|
||||
wxBrushRefData(const wxBrushRefData& data);
|
||||
~wxBrushRefData();
|
||||
|
||||
protected:
|
||||
int m_style;
|
||||
wxBitmap m_stipple ;
|
||||
wxColour m_colour;
|
||||
|
||||
/* TODO: implementation
|
||||
WXHBRUSH m_hBrush;
|
||||
*/
|
||||
};
|
||||
|
||||
#define M_BRUSHDATA ((wxBrushRefData *)m_refData)
|
||||
|
||||
// Brush
|
||||
class WXDLLEXPORT wxBrush: public wxGDIObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxBrush)
|
||||
|
||||
public:
|
||||
wxBrush();
|
||||
wxBrush(const wxColour& col, int style);
|
||||
wxBrush(const wxBitmap& stipple);
|
||||
inline wxBrush(const wxBrush& brush) { Ref(brush); }
|
||||
~wxBrush();
|
||||
|
||||
virtual void SetColour(const wxColour& col) ;
|
||||
virtual void SetColour(unsigned char r, unsigned char g, unsigned char b) ;
|
||||
virtual void SetStyle(int style) ;
|
||||
virtual void SetStipple(const wxBitmap& stipple) ;
|
||||
|
||||
inline wxBrush& operator = (const wxBrush& brush) { if (*this == brush) return (*this); Ref(brush); return *this; }
|
||||
inline bool operator == (const wxBrush& brush) { return m_refData == brush.m_refData; }
|
||||
inline bool operator != (const wxBrush& brush) { return m_refData != brush.m_refData; }
|
||||
|
||||
inline wxColour& GetColour() const { return (M_BRUSHDATA ? M_BRUSHDATA->m_colour : wxNullColour); };
|
||||
inline int GetStyle() const { return (M_BRUSHDATA ? M_BRUSHDATA->m_style : 0); };
|
||||
inline wxBitmap *GetStipple() const { return (M_BRUSHDATA ? & M_BRUSHDATA->m_stipple : 0); };
|
||||
|
||||
virtual bool Ok() const { return (m_refData != NULL) ; }
|
||||
|
||||
// Implementation
|
||||
|
||||
// Useful helper: create the brush resource
|
||||
bool RealizeResource();
|
||||
|
||||
// When setting properties, we must make sure we're not changing
|
||||
// another object
|
||||
void Unshare();
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_BRUSH_H_
|
56
include/wx/os2/button.h
Normal file
56
include/wx/os2/button.h
Normal file
@ -0,0 +1,56 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: button.h
|
||||
// Purpose: wxButton class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_BUTTON_H_
|
||||
#define _WX_BUTTON_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "button.h"
|
||||
#endif
|
||||
|
||||
#include "wx/control.h"
|
||||
#include "wx/gdicmn.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxButtonNameStr;
|
||||
|
||||
// Pushbutton
|
||||
class WXDLLEXPORT wxButton: public wxControl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxButton)
|
||||
public:
|
||||
inline wxButton() {}
|
||||
inline wxButton(wxWindow *parent, wxWindowID id, const wxString& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxButtonNameStr)
|
||||
{
|
||||
Create(parent, id, label, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id, const wxString& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxButtonNameStr);
|
||||
|
||||
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
|
||||
// _WX_BUTTON_H_
|
86
include/wx/os2/checkbox.h
Normal file
86
include/wx/os2/checkbox.h
Normal file
@ -0,0 +1,86 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: checkbox.h
|
||||
// Purpose: wxCheckBox class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_CHECKBOX_H_
|
||||
#define _WX_CHECKBOX_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "checkbox.h"
|
||||
#endif
|
||||
|
||||
#include "wx/control.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxCheckBoxNameStr;
|
||||
|
||||
// Checkbox item (single checkbox)
|
||||
class WXDLLEXPORT wxBitmap;
|
||||
class WXDLLEXPORT wxCheckBox: public wxControl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxCheckBox)
|
||||
|
||||
public:
|
||||
inline wxCheckBox() { }
|
||||
inline wxCheckBox(wxWindow *parent, wxWindowID id, const wxString& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxCheckBoxNameStr)
|
||||
{
|
||||
Create(parent, id, label, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id, const wxString& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxCheckBoxNameStr);
|
||||
virtual void SetValue(bool);
|
||||
virtual bool GetValue() const ;
|
||||
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
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxBitmapCheckBox)
|
||||
|
||||
public:
|
||||
int checkWidth ;
|
||||
int checkHeight ;
|
||||
|
||||
inline wxBitmapCheckBox() { checkWidth = -1; checkHeight = -1; }
|
||||
inline wxBitmapCheckBox(wxWindow *parent, wxWindowID id, const wxBitmap *label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxCheckBoxNameStr)
|
||||
{
|
||||
Create(parent, id, label, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id, const wxBitmap *bitmap,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxCheckBoxNameStr);
|
||||
virtual void SetValue(bool);
|
||||
virtual bool GetValue() const ;
|
||||
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);}
|
||||
};
|
||||
#endif
|
||||
// _WX_CHECKBOX_H_
|
47
include/wx/os2/checklst.h
Normal file
47
include/wx/os2/checklst.h
Normal file
@ -0,0 +1,47 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: checklst.h
|
||||
// Purpose: wxCheckListBox class - a listbox with checkable items
|
||||
// Note: this is an optional class.
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_CHECKLST_H_
|
||||
#define _WX_CHECKLST_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "checklst.h"
|
||||
#endif
|
||||
|
||||
#include "wx/listbox.h"
|
||||
|
||||
typedef unsigned int size_t;
|
||||
|
||||
class wxCheckListBox : public wxListBox
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxCheckListBox)
|
||||
public:
|
||||
// ctors
|
||||
wxCheckListBox();
|
||||
wxCheckListBox(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
int nStrings = 0,
|
||||
const wxString choices[] = NULL,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxListBoxNameStr);
|
||||
|
||||
// items may be checked
|
||||
bool IsChecked(size_t uiIndex) const;
|
||||
void Check(size_t uiIndex, bool bCheck = TRUE);
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_CHECKLST_H_
|
75
include/wx/os2/choice.h
Normal file
75
include/wx/os2/choice.h
Normal file
@ -0,0 +1,75 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: choice.h
|
||||
// Purpose: wxChoice class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_CHOICE_H_
|
||||
#define _WX_CHOICE_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "choice.h"
|
||||
#endif
|
||||
|
||||
#include "wx/control.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxChoiceNameStr;
|
||||
|
||||
// Choice item
|
||||
class WXDLLEXPORT wxChoice: public wxControl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxChoice)
|
||||
|
||||
public:
|
||||
inline wxChoice() { m_noStrings = 0; }
|
||||
|
||||
inline wxChoice(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
int n = 0, const wxString choices[] = NULL,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxChoiceNameStr)
|
||||
{
|
||||
Create(parent, id, pos, size, n, choices, style, validator, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
int n = 0, const wxString choices[] = NULL,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxChoiceNameStr);
|
||||
|
||||
virtual void Append(const wxString& item);
|
||||
virtual void Delete(int n);
|
||||
virtual void Clear();
|
||||
virtual int GetSelection() const ;
|
||||
virtual void SetSelection(int n);
|
||||
virtual int FindString(const wxString& s) const;
|
||||
virtual wxString GetString(int n) const ;
|
||||
virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
||||
virtual wxString GetStringSelection() const ;
|
||||
virtual bool SetStringSelection(const wxString& sel);
|
||||
|
||||
virtual inline int Number() const { return m_noStrings; }
|
||||
virtual void Command(wxCommandEvent& event);
|
||||
|
||||
virtual inline void SetColumns(int WXUNUSED(n) = 1 ) { /* No effect */ } ;
|
||||
virtual inline int GetColumns() const { return 1 ; };
|
||||
|
||||
protected:
|
||||
int m_noStrings;
|
||||
|
||||
private:
|
||||
void SetSize(int width, int height) {wxWindow::SetSize(width, height);}
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_CHOICE_H_
|
104
include/wx/os2/clipbrd.h
Normal file
104
include/wx/os2/clipbrd.h
Normal file
@ -0,0 +1,104 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: clipbrd.h
|
||||
// Purpose: Clipboard functionality.
|
||||
// Note: this functionality is under review, and
|
||||
// is derived from wxWindows 1.xx code. Please contact
|
||||
// the wxWindows developers for further information.
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_CLIPBRD_H_
|
||||
#define _WX_CLIPBRD_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "clipbrd.h"
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/setup.h"
|
||||
|
||||
#include "wx/list.h"
|
||||
|
||||
bool WXDLLEXPORT wxOpenClipboard();
|
||||
bool WXDLLEXPORT wxClipboardOpen();
|
||||
bool WXDLLEXPORT wxCloseClipboard();
|
||||
bool WXDLLEXPORT wxEmptyClipboard();
|
||||
bool WXDLLEXPORT wxIsClipboardFormatAvailable(int dataFormat);
|
||||
bool WXDLLEXPORT wxSetClipboardData(int dataFormat, wxObject *obj, int width = 0, int height = 0);
|
||||
wxObject* WXDLLEXPORT wxGetClipboardData(int dataFormat, long *len = NULL);
|
||||
int WXDLLEXPORT wxEnumClipboardFormats(int dataFormat);
|
||||
int WXDLLEXPORT wxRegisterClipboardFormat(char *formatName);
|
||||
bool WXDLLEXPORT wxGetClipboardFormatName(int dataFormat, char *formatName, int maxCount);
|
||||
|
||||
/* A clipboard client holds data belonging to the clipboard.
|
||||
For plain text, a client is not necessary. */
|
||||
class WXDLLEXPORT wxClipboardClient : public wxObject
|
||||
{
|
||||
DECLARE_ABSTRACT_CLASS(wxClipboardClient)
|
||||
|
||||
public:
|
||||
/* This list should be filled in with strings indicating the formats
|
||||
this client can provide. Almost all clients will provide "TEXT".
|
||||
Format names should be 4 characters long, so things will work
|
||||
out on the Macintosh */
|
||||
wxStringList formats;
|
||||
|
||||
/* This method is called when the client is losing the selection. */
|
||||
virtual void BeingReplaced() = 0;
|
||||
|
||||
/* This method is called when someone wants the data this client is
|
||||
supplying to the clipboard. "format" is a string indicating the
|
||||
format of the data - one of the strings from the "formats"
|
||||
list. "*size" should be filled with the size of the resulting
|
||||
data. In the case of text, "*size" does not count the
|
||||
NULL terminator. */
|
||||
virtual char *GetData(char *format, long *size) = 0;
|
||||
};
|
||||
|
||||
/* ONE instance of this class: */
|
||||
class WXDLLEXPORT wxClipboard : public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxClipboard)
|
||||
|
||||
public:
|
||||
wxClipboardClient *clipOwner;
|
||||
char *cbString, *sentString, *receivedString;
|
||||
void *receivedTargets;
|
||||
long receivedLength;
|
||||
|
||||
wxClipboard();
|
||||
~wxClipboard();
|
||||
|
||||
/* Set the clipboard data owner. "time" comes from the event record. */
|
||||
void SetClipboardClient(wxClipboardClient *, long time);
|
||||
|
||||
/* Set the clipboard string; does not require a client. */
|
||||
void SetClipboardString(char *, long time);
|
||||
|
||||
/* Get data from the clipboard in the format "TEXT". */
|
||||
char *GetClipboardString(long time);
|
||||
|
||||
/* Get data from the clipboard */
|
||||
char *GetClipboardData(char *format, long *length, long time);
|
||||
|
||||
/* Get the clipboard client directly. Will be NULL if clipboard data
|
||||
is a string, or if some other application owns the clipboard.
|
||||
This can be useful for shortcutting data translation, if the
|
||||
clipboard user can check for a specific client. (This is used
|
||||
by the wxMediaEdit class.) */
|
||||
wxClipboardClient *GetClipboardClient();
|
||||
};
|
||||
|
||||
/* Initialize wxTheClipboard. Can be called repeatedly */
|
||||
void WXDLLEXPORT wxInitClipboard();
|
||||
|
||||
/* The clipboard */
|
||||
WXDLLEXPORT_DATA(extern wxClipboard*) wxTheClipboard;
|
||||
|
||||
#endif
|
||||
// _WX_CLIPBRD_H_
|
46
include/wx/os2/colordlg.h
Normal file
46
include/wx/os2/colordlg.h
Normal file
@ -0,0 +1,46 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: colordlg.h
|
||||
// Purpose: wxColourDialog class. Use generic version if no
|
||||
// platform-specific implementation.
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_COLORDLG_H_
|
||||
#define _WX_COLORDLG_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "colordlg.h"
|
||||
#endif
|
||||
|
||||
#include "wx/setup.h"
|
||||
#include "wx/dialog.h"
|
||||
#include "wx/cmndata.h"
|
||||
|
||||
/*
|
||||
* Platform-specific colour dialog implementation
|
||||
*/
|
||||
|
||||
class WXDLLEXPORT wxColourDialog: public wxDialog
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxColourDialog)
|
||||
public:
|
||||
wxColourDialog();
|
||||
wxColourDialog(wxWindow *parent, wxColourData *data = NULL);
|
||||
|
||||
bool Create(wxWindow *parent, wxColourData *data = NULL);
|
||||
|
||||
int ShowModal();
|
||||
wxColourData& GetColourData() { return m_colourData; }
|
||||
|
||||
protected:
|
||||
wxColourData m_colourData;
|
||||
wxWindow* m_dialogParent;
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_COLORDLG_H_
|
97
include/wx/os2/colour.h
Normal file
97
include/wx/os2/colour.h
Normal file
@ -0,0 +1,97 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: colour.h
|
||||
// Purpose: wxColour class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_COLOUR_H_
|
||||
#define _WX_COLOUR_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "colour.h"
|
||||
#endif
|
||||
|
||||
#include "wx/object.h"
|
||||
#include "wx/string.h"
|
||||
|
||||
// Colour
|
||||
class WXDLLEXPORT wxColour: public wxObject
|
||||
{
|
||||
public:
|
||||
// ctors
|
||||
// default
|
||||
wxColour();
|
||||
// from RGB
|
||||
wxColour( unsigned char red, unsigned char green, unsigned char blue );
|
||||
// implicit conversion from the colour name
|
||||
wxColour( const wxString &colourName ) { InitFromName(colourName); }
|
||||
wxColour( const char *colourName ) { InitFromName(colourName); }
|
||||
|
||||
// copy ctors and assignment operators
|
||||
wxColour( const wxColour& col );
|
||||
wxColour( const wxColour* col );
|
||||
wxColour& operator = ( const wxColour& col );
|
||||
|
||||
// dtor
|
||||
~wxColour();
|
||||
|
||||
// Set() functions
|
||||
void Set( unsigned char red, unsigned char green, unsigned char blue );
|
||||
void Set( unsigned long colRGB )
|
||||
{
|
||||
// we don't need to know sizeof(long) here because we assume that the three
|
||||
// least significant bytes contain the R, G and B values
|
||||
Set((unsigned char)colRGB,
|
||||
(unsigned char)(colRGB >> 8),
|
||||
(unsigned char)(colRGB >> 16));
|
||||
}
|
||||
|
||||
// accessors
|
||||
bool Ok() const {return m_isInit; }
|
||||
|
||||
// Let's remove this inelegant function
|
||||
#if WXWIN_COMPATIBILITY
|
||||
void Get(unsigned char *r, unsigned char *g, unsigned char *b) const;
|
||||
#endif
|
||||
|
||||
unsigned char Red() const { return m_red; }
|
||||
unsigned char Green() const { return m_green; }
|
||||
unsigned char Blue() const { return m_blue; }
|
||||
|
||||
// comparison
|
||||
bool operator == (const wxColour& colour) const
|
||||
{
|
||||
return (m_red == colour.m_red &&
|
||||
m_green == colour.m_green &&
|
||||
m_blue == colour.m_blue);
|
||||
}
|
||||
bool operator != (const wxColour& colour) const { return !(*this == colour); }
|
||||
|
||||
void InitFromName(const wxString& col);
|
||||
|
||||
/* TODO
|
||||
WXCOLORREF GetPixel() const { return m_pixel; };
|
||||
*/
|
||||
|
||||
private:
|
||||
bool m_isInit;
|
||||
unsigned char m_red;
|
||||
unsigned char m_blue;
|
||||
unsigned char m_green;
|
||||
|
||||
public:
|
||||
/* TODO: implementation
|
||||
WXCOLORREF m_pixel ;
|
||||
*/
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxColour)
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_COLOUR_H_
|
84
include/wx/os2/combobox.h
Normal file
84
include/wx/os2/combobox.h
Normal file
@ -0,0 +1,84 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: combobox.h
|
||||
// Purpose: wxComboBox class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_COMBOBOX_H_
|
||||
#define _WX_COMBOBOX_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "combobox.h"
|
||||
#endif
|
||||
|
||||
#include "wx/choice.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxComboBoxNameStr;
|
||||
WXDLLEXPORT_DATA(extern const char*) wxEmptyString;
|
||||
|
||||
// Combobox item
|
||||
class WXDLLEXPORT wxComboBox: public wxChoice
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxComboBox)
|
||||
|
||||
public:
|
||||
inline wxComboBox() {}
|
||||
|
||||
inline wxComboBox(wxWindow *parent, wxWindowID id,
|
||||
const wxString& value = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
int n = 0, const wxString choices[] = NULL,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxComboBoxNameStr)
|
||||
{
|
||||
Create(parent, id, value, pos, size, n, choices, style, validator, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
const wxString& value = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
int n = 0, const wxString choices[] = NULL,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxComboBoxNameStr);
|
||||
|
||||
// List functions
|
||||
virtual void Append(const wxString& item);
|
||||
virtual void Delete(int n);
|
||||
virtual void Clear();
|
||||
virtual int GetSelection() const ;
|
||||
virtual void SetSelection(int n);
|
||||
virtual int FindString(const wxString& s) const;
|
||||
virtual wxString GetString(int n) const ;
|
||||
virtual wxString GetStringSelection() const ;
|
||||
virtual bool SetStringSelection(const wxString& sel);
|
||||
virtual inline int Number() const { return m_noStrings; }
|
||||
|
||||
// Text field functions
|
||||
virtual wxString GetValue() const ;
|
||||
virtual void SetValue(const wxString& value);
|
||||
|
||||
// Clipboard operations
|
||||
virtual void Copy();
|
||||
virtual void Cut();
|
||||
virtual void Paste();
|
||||
virtual void SetInsertionPoint(long pos);
|
||||
virtual void SetInsertionPointEnd();
|
||||
virtual long GetInsertionPoint() const ;
|
||||
virtual long GetLastPosition() const ;
|
||||
virtual void Replace(long from, long to, const wxString& value);
|
||||
virtual void Remove(long from, long to);
|
||||
virtual void SetSelection(long from, long to);
|
||||
virtual void SetEditable(bool editable);
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_COMBOBOX_H_
|
50
include/wx/os2/control.h
Normal file
50
include/wx/os2/control.h
Normal file
@ -0,0 +1,50 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: control.h
|
||||
// Purpose: wxControl class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_CONTROL_H_
|
||||
#define _WX_CONTROL_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "control.h"
|
||||
#endif
|
||||
|
||||
#include "wx/window.h"
|
||||
#include "wx/list.h"
|
||||
#include "wx/validate.h"
|
||||
|
||||
// General item class
|
||||
class WXDLLEXPORT wxControl: public wxWindow
|
||||
{
|
||||
DECLARE_ABSTRACT_CLASS(wxControl)
|
||||
public:
|
||||
wxControl();
|
||||
~wxControl();
|
||||
|
||||
virtual void Command(wxCommandEvent& WXUNUSED(event)) {}; // Simulates an event
|
||||
virtual void ProcessCommand(wxCommandEvent& event); // Calls the callback and
|
||||
// appropriate event handlers
|
||||
virtual void SetLabel(const wxString& label);
|
||||
virtual wxString GetLabel() const ;
|
||||
|
||||
// Places item in centre of panel - so can't be used BEFORE panel->Fit()
|
||||
void Centre(int direction = wxHORIZONTAL);
|
||||
inline void Callback(const wxFunction function) { m_callback = function; }; // Adds callback
|
||||
|
||||
inline wxFunction GetCallback() { return m_callback; }
|
||||
|
||||
protected:
|
||||
wxFunction m_callback; // Callback associated with the window
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_CONTROL_H_
|
75
include/wx/os2/cursor.h
Normal file
75
include/wx/os2/cursor.h
Normal file
@ -0,0 +1,75 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: cursor.h
|
||||
// Purpose: wxCursor class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_CURSOR_H_
|
||||
#define _WX_CURSOR_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "cursor.h"
|
||||
#endif
|
||||
|
||||
#include "wx/bitmap.h"
|
||||
|
||||
class WXDLLEXPORT wxCursorRefData: public wxBitmapRefData
|
||||
{
|
||||
friend class WXDLLEXPORT wxBitmap;
|
||||
friend class WXDLLEXPORT wxCursor;
|
||||
public:
|
||||
wxCursorRefData();
|
||||
~wxCursorRefData();
|
||||
|
||||
protected:
|
||||
/* TODO: implementation
|
||||
WXHCURSOR m_hCursor;
|
||||
*/
|
||||
};
|
||||
|
||||
#define M_CURSORDATA ((wxCursorRefData *)m_refData)
|
||||
#define M_CURSORHANDLERDATA ((wxCursorRefData *)bitmap->m_refData)
|
||||
|
||||
// Cursor
|
||||
class WXDLLEXPORT wxCursor: public wxBitmap
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxCursor)
|
||||
|
||||
public:
|
||||
wxCursor();
|
||||
|
||||
// Copy constructors
|
||||
inline wxCursor(const wxCursor& cursor) { Ref(cursor); }
|
||||
|
||||
wxCursor(const char bits[], int width, int height, int hotSpotX = -1, int hotSpotY = -1,
|
||||
const char maskBits[] = NULL);
|
||||
|
||||
/* TODO: make default type suit platform */
|
||||
wxCursor(const wxString& name, long flags = wxBITMAP_TYPE_CUR_RESOURCE,
|
||||
int hotSpotX = 0, int hotSpotY = 0);
|
||||
|
||||
wxCursor(int cursor_type);
|
||||
~wxCursor();
|
||||
|
||||
// TODO: also verify the internal cursor handle
|
||||
virtual bool Ok() const { return (m_refData != NULL) ; }
|
||||
|
||||
inline wxCursor& operator = (const wxCursor& cursor) { if (*this == cursor) return (*this); Ref(cursor); return *this; }
|
||||
inline bool operator == (const wxCursor& cursor) { return m_refData == cursor.m_refData; }
|
||||
inline bool operator != (const wxCursor& cursor) { return m_refData != cursor.m_refData; }
|
||||
|
||||
/* TODO: implementation
|
||||
void SetHCURSOR(WXHCURSOR cursor);
|
||||
inline WXHCURSOR GetHCURSOR() const { return (M_CURSORDATA ? M_CURSORDATA->m_hCursor : 0); }
|
||||
*/
|
||||
};
|
||||
|
||||
extern WXDLLEXPORT void wxSetCursor(const wxCursor& cursor);
|
||||
|
||||
#endif
|
||||
// _WX_CURSOR_H_
|
171
include/wx/os2/dc.h
Normal file
171
include/wx/os2/dc.h
Normal file
@ -0,0 +1,171 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dc.h
|
||||
// Purpose: wxDC class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_DC_H_
|
||||
#define _WX_DC_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "dc.h"
|
||||
#endif
|
||||
|
||||
class WXDLLEXPORT wxDC : public wxDCBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxDC)
|
||||
|
||||
public:
|
||||
wxDC();
|
||||
~wxDC();
|
||||
|
||||
// implement base class pure virtuals
|
||||
// ----------------------------------
|
||||
|
||||
virtual void Clear();
|
||||
|
||||
virtual bool StartDoc(const wxString& message);
|
||||
virtual void EndDoc();
|
||||
|
||||
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)
|
||||
{
|
||||
m_hDC = dc;
|
||||
m_bOwnsDC = bOwnsDC;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
GetClippingBox(x, y, width, height);
|
||||
}
|
||||
|
||||
virtual void DoGetSize(int *width, int *height) const;
|
||||
virtual void DoGetSizeMM(int* width, int* height) const;
|
||||
|
||||
virtual void DoDrawLines(int n, wxPoint points[],
|
||||
long xoffset, long yoffset);
|
||||
virtual void DoDrawPolygon(int n, wxPoint points[],
|
||||
long xoffset, long yoffset,
|
||||
int fillStyle = wxODDEVEN_RULE);
|
||||
|
||||
#if wxUSE_SPLINES
|
||||
virtual void DoDrawSpline(wxList *points);
|
||||
#endif // wxUSE_SPLINES
|
||||
|
||||
// MSW-specific member variables
|
||||
int m_windowExtX;
|
||||
int m_windowExtY;
|
||||
|
||||
// the window associated with this DC (may be NULL)
|
||||
wxWindow *m_canvas;
|
||||
|
||||
wxBitmap m_selectedBitmap;
|
||||
|
||||
// TRUE => DeleteDC() in dtor, FALSE => only ReleaseDC() it
|
||||
bool m_bOwnsDC:1;
|
||||
|
||||
// our HDC and its usage count: we only free it when the usage count drops
|
||||
// to 0
|
||||
WXHDC m_hDC;
|
||||
int m_hDCCount;
|
||||
|
||||
// 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;
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_DC_H_
|
142
include/wx/os2/dcclient.h
Normal file
142
include/wx/os2/dcclient.h
Normal file
@ -0,0 +1,142 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dcclient.h
|
||||
// Purpose: wxClientDC, wxPaintDC and wxWindowDC classes
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_DCCLIENT_H_
|
||||
#define _WX_DCCLIENT_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "dcclient.h"
|
||||
#endif
|
||||
|
||||
#include "wx/dc.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxPaintDC;
|
||||
class WXDLLEXPORT wxWindow;
|
||||
|
||||
// Under Windows, wxClientDC, wxPaintDC and wxWindowDC are implemented differently.
|
||||
// On many platforms, however, they will be the same.
|
||||
|
||||
class WXDLLEXPORT wxWindowDC: public wxDC
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxWindowDC)
|
||||
|
||||
public:
|
||||
|
||||
wxWindowDC(void);
|
||||
wxWindowDC( wxWindow *win );
|
||||
|
||||
~wxWindowDC(void);
|
||||
|
||||
virtual void FloodFill( long x1, long y1, const wxColour& col, int style=wxFLOOD_SURFACE );
|
||||
virtual bool GetPixel( long x1, long y1, wxColour *col ) const;
|
||||
|
||||
virtual void DrawLine( long x1, long y1, long x2, long y2 );
|
||||
virtual void CrossHair( long x, long y );
|
||||
virtual void DrawArc( long x1, long y1, long x2, long y2, long xc, long yc );
|
||||
virtual void DrawEllipticArc( long x, long y, long width, long height, double sa, double ea );
|
||||
virtual void DrawPoint( long x, long y );
|
||||
|
||||
virtual void DrawLines( int n, wxPoint points[], long xoffset = 0, long yoffset = 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 );
|
||||
virtual void DrawPolygon( wxList *lines, long xoffset = 0, long yoffset = 0,
|
||||
int fillStyle=wxODDEVEN_RULE );
|
||||
|
||||
virtual void DrawRectangle( long x, long y, long width, long height );
|
||||
virtual void DrawRoundedRectangle( long x, long y, long width, long height, double radius = 20.0 );
|
||||
virtual void DrawEllipse( long x, long y, long width, long height );
|
||||
|
||||
virtual bool CanDrawBitmap(void) const;
|
||||
virtual void DrawIcon( const wxIcon &icon, long x, long y, bool useMask=FALSE );
|
||||
virtual bool Blit( long xdest, long ydest, long width, long height,
|
||||
wxDC *source, long xsrc, long ysrc, int logical_func = wxCOPY, bool useMask=FALSE );
|
||||
|
||||
virtual void DrawText( const wxString &text, long x, long y, bool use16 = FALSE );
|
||||
virtual bool CanGetTextExtent(void) const;
|
||||
virtual void GetTextExtent( const wxString &string, long *width, long *height,
|
||||
long *descent = NULL, long *externalLeading = NULL,
|
||||
wxFont *theFont = NULL, bool use16 = FALSE );
|
||||
virtual long GetCharWidth(void);
|
||||
virtual long GetCharHeight(void);
|
||||
|
||||
virtual void Clear(void);
|
||||
|
||||
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 SetLogicalFunction( int function );
|
||||
virtual void SetTextForeground( const wxColour &col );
|
||||
virtual void SetTextBackground( const wxColour &col );
|
||||
virtual void SetBackgroundMode( int mode );
|
||||
virtual void SetPalette( const wxPalette& palette );
|
||||
|
||||
virtual void SetClippingRegion( long x, long y, long width, long height );
|
||||
virtual void SetClippingRegion( const wxRegion& region ) ;
|
||||
virtual void DestroyClippingRegion(void);
|
||||
|
||||
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 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());};
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxPaintDC
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxPaintDC: public wxWindowDC
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxPaintDC)
|
||||
|
||||
public:
|
||||
|
||||
wxPaintDC(void):wxWindowDC() {};
|
||||
wxPaintDC( wxWindow *win ): wxWindowDC(win) {};
|
||||
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxClientDC
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxClientDC: public wxWindowDC
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxClientDC)
|
||||
|
||||
public:
|
||||
|
||||
wxClientDC(void):wxWindowDC() {};
|
||||
wxClientDC( wxWindow *win ): wxWindowDC(win) {};
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_DCCLIENT_H_
|
38
include/wx/os2/dcmemory.h
Normal file
38
include/wx/os2/dcmemory.h
Normal file
@ -0,0 +1,38 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dcmemory.h
|
||||
// Purpose: wxMemoryDC class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_DCMEMORY_H_
|
||||
#define _WX_DCMEMORY_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "dcmemory.h"
|
||||
#endif
|
||||
|
||||
#include "wx/dcclient.h"
|
||||
|
||||
class WXDLLEXPORT wxMemoryDC: public wxPaintDC
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxMemoryDC)
|
||||
|
||||
public:
|
||||
wxMemoryDC(void);
|
||||
wxMemoryDC( wxDC *dc ); // Create compatible DC
|
||||
~wxMemoryDC(void);
|
||||
virtual void SelectObject( const wxBitmap& bitmap );
|
||||
void GetSize( int *width, int *height ) const;
|
||||
|
||||
private:
|
||||
friend wxPaintDC;
|
||||
wxBitmap m_selected;
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_DCMEMORY_H_
|
34
include/wx/os2/dcprint.h
Normal file
34
include/wx/os2/dcprint.h
Normal file
@ -0,0 +1,34 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dcprint.h
|
||||
// Purpose: wxPrinterDC class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_DCPRINT_H_
|
||||
#define _WX_DCPRINT_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "dcprint.h"
|
||||
#endif
|
||||
|
||||
#include "wx/dc.h"
|
||||
|
||||
class WXDLLEXPORT wxPrinterDC: public wxDC
|
||||
{
|
||||
public:
|
||||
DECLARE_CLASS(wxPrinterDC)
|
||||
|
||||
// Create a printer DC
|
||||
wxPrinterDC(const wxString& driver, const wxString& device, const wxString& output, bool interactive = TRUE, int orientation = wxPORTRAIT);
|
||||
|
||||
~wxPrinterDC();
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_DCPRINT_H_
|
||||
|
39
include/wx/os2/dcscreen.h
Normal file
39
include/wx/os2/dcscreen.h
Normal file
@ -0,0 +1,39 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dcscreen.h
|
||||
// Purpose: wxScreenDC class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_DCSCREEN_H_
|
||||
#define _WX_DCSCREEN_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "dcscreen.h"
|
||||
#endif
|
||||
|
||||
#include "wx/dcclient.h"
|
||||
|
||||
class WXDLLEXPORT wxScreenDC: public wxWindowDC
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxScreenDC)
|
||||
|
||||
public:
|
||||
// Create a DC representing the whole screen
|
||||
wxScreenDC();
|
||||
~wxScreenDC();
|
||||
|
||||
// Compatibility with X's requirements for
|
||||
// drawing on top of all windows
|
||||
static bool StartDrawingOnTop(wxWindow* WXUNUSED(window)) { return TRUE; }
|
||||
static bool StartDrawingOnTop(wxRect* WXUNUSED(rect) = NULL) { return TRUE; }
|
||||
static bool EndDrawingOnTop() { return TRUE; }
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_DCSCREEN_H_
|
||||
|
137
include/wx/os2/dialog.h
Normal file
137
include/wx/os2/dialog.h
Normal file
@ -0,0 +1,137 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dialog.h
|
||||
// Purpose: wxDialog class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_DIALOG_H_
|
||||
#define _WX_DIALOG_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "dialog.h"
|
||||
#endif
|
||||
|
||||
#include "wx/panel.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) 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)
|
||||
{
|
||||
long modalStyle = modal ? wxDIALOG_MODAL : wxDIALOG_MODELESS ;
|
||||
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)
|
||||
{
|
||||
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);
|
||||
|
||||
~wxDialog();
|
||||
|
||||
virtual bool Destroy();
|
||||
|
||||
virtual void DoSetClientSize(int width, int height);
|
||||
|
||||
virtual 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);
|
||||
void OnCancel(wxCommandEvent& event);
|
||||
|
||||
// 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()
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_DIALOG_H_
|
49
include/wx/os2/dirdlg.h
Normal file
49
include/wx/os2/dirdlg.h
Normal file
@ -0,0 +1,49 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dirdlg.h
|
||||
// Purpose: wxDirDialog class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_DIRDLG_H_
|
||||
#define _WX_DIRDLG_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "dirdlg.h"
|
||||
#endif
|
||||
|
||||
#include "wx/dialog.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxFileSelectorPromptStr;
|
||||
|
||||
class WXDLLEXPORT wxDirDialog: public wxDialog
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxDirDialog)
|
||||
public:
|
||||
wxDirDialog(wxWindow *parent, const wxString& message = wxFileSelectorPromptStr,
|
||||
const wxString& defaultPath = "",
|
||||
long style = 0, const wxPoint& pos = wxDefaultPosition);
|
||||
|
||||
inline void SetMessage(const wxString& message) { m_message = message; }
|
||||
inline void SetPath(const wxString& path) { m_path = path; }
|
||||
inline void SetStyle(long style) { m_dialogStyle = style; }
|
||||
|
||||
inline wxString GetMessage() const { return m_message; }
|
||||
inline wxString GetPath() const { return m_path; }
|
||||
inline long GetStyle() const { return m_dialogStyle; }
|
||||
|
||||
int ShowModal();
|
||||
|
||||
protected:
|
||||
wxString m_message;
|
||||
long m_dialogStyle;
|
||||
wxWindow * m_parent;
|
||||
wxString m_path;
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_DIRDLG_H_
|
275
include/wx/os2/dnd.h
Normal file
275
include/wx/os2/dnd.h
Normal file
@ -0,0 +1,275 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dnd.h
|
||||
// Purpose: Declaration of the wxDropTarget, wxDropSource class etc.
|
||||
// Author: AUTHOR
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 1998 AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_DND_H_
|
||||
#define _WX_DND_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "dnd.h"
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/object.h"
|
||||
#include "wx/string.h"
|
||||
#include "wx/cursor.h"
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// classes
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxWindow;
|
||||
|
||||
class WXDLLEXPORT wxDataObject;
|
||||
class WXDLLEXPORT wxTextDataObject;
|
||||
class WXDLLEXPORT wxFileDataObject;
|
||||
|
||||
class WXDLLEXPORT wxDropTarget;
|
||||
class WXDLLEXPORT wxTextDropTarget;
|
||||
class WXDLLEXPORT wxFileDropTarget;
|
||||
|
||||
class WXDLLEXPORT wxDropSource;
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// wxDataFormat (internal)
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
class wxDataFormat : public wxObject
|
||||
{
|
||||
DECLARE_CLASS( wxDataFormat )
|
||||
|
||||
public:
|
||||
wxDataFormat();
|
||||
wxDataFormat( wxDataFormatId type );
|
||||
wxDataFormat( const wxString &id );
|
||||
wxDataFormat( const wxChar *id );
|
||||
wxDataFormat( const wxDataFormat &format );
|
||||
|
||||
void SetType( wxDataFormatId type );
|
||||
wxDataFormatId GetType() const;
|
||||
|
||||
/* the string Id identifies the format of clipboard or DnD data. a word
|
||||
* processor would e.g. add a wxTextDataObject and a wxPrivateDataObject
|
||||
* to the clipboard - the latter with the Id "application/wxword", an
|
||||
* image manipulation program would put a wxBitmapDataObject and a
|
||||
* wxPrivateDataObject to the clipboard - the latter with "image/png". */
|
||||
|
||||
wxString GetId() const;
|
||||
void SetId( const wxChar *id );
|
||||
|
||||
// implicit conversion to wxDataFormatId
|
||||
operator wxDataFormatId() const { return m_type; }
|
||||
|
||||
bool operator==(wxDataFormatId type) const { return m_type == type; }
|
||||
bool operator!=(wxDataFormatId type) const { return m_type != type; }
|
||||
|
||||
private:
|
||||
wxDataFormatId m_type;
|
||||
wxString m_id;
|
||||
};
|
||||
//-------------------------------------------------------------------------
|
||||
// wxDataObject
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxDataObject: public wxObject
|
||||
{
|
||||
public:
|
||||
// all data formats (values are the same as in windows.h, do not change!)
|
||||
enum StdFormat
|
||||
{
|
||||
Invalid,
|
||||
Text,
|
||||
Bitmap,
|
||||
MetafilePict,
|
||||
Sylk,
|
||||
Dif,
|
||||
Tiff,
|
||||
OemText,
|
||||
Dib,
|
||||
Palette,
|
||||
Pendata,
|
||||
Riff,
|
||||
Wave,
|
||||
UnicodeText,
|
||||
EnhMetafile,
|
||||
Hdrop,
|
||||
Locale,
|
||||
Max
|
||||
};
|
||||
|
||||
// function to return symbolic name of clipboard format (debug messages)
|
||||
static const char *GetFormatName(wxDataFormat format);
|
||||
|
||||
// ctor & dtor
|
||||
wxDataObject() {};
|
||||
~wxDataObject() {};
|
||||
|
||||
// pure virtuals to override
|
||||
// get the best suited format for our data
|
||||
virtual wxDataFormat GetPreferredFormat() const = 0;
|
||||
// decide if we support this format (should be one of values of
|
||||
// StdFormat enumerations or a user-defined format)
|
||||
virtual bool IsSupportedFormat(wxDataFormat format) const = 0;
|
||||
// get the (total) size of data
|
||||
virtual size_t GetDataSize() const = 0;
|
||||
// copy raw data to provided pointer
|
||||
virtual void GetDataHere(void *pBuf) const = 0;
|
||||
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxTextDataObject is a specialization of wxDataObject for text data
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxTextDataObject : public wxDataObject
|
||||
{
|
||||
public:
|
||||
// ctors
|
||||
wxTextDataObject() { }
|
||||
wxTextDataObject(const wxString& strText) : m_strText(strText) { }
|
||||
void Init(const wxString& strText) { m_strText = strText; }
|
||||
|
||||
// implement base class pure virtuals
|
||||
virtual wxDataFormat GetPreferredFormat() const
|
||||
{ return wxDF_TEXT; }
|
||||
virtual bool IsSupportedFormat(wxDataFormat format) const
|
||||
{ return format == wxDF_TEXT; }
|
||||
virtual size_t GetDataSize() const
|
||||
{ return m_strText.Len() + 1; } // +1 for trailing '\0'of course
|
||||
virtual void GetDataHere(void *pBuf) const
|
||||
{ memcpy(pBuf, m_strText.c_str(), GetDataSize()); }
|
||||
|
||||
private:
|
||||
wxString m_strText;
|
||||
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxFileDataObject is a specialization of wxDataObject for file names
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxFileDataObject : public wxDataObject
|
||||
{
|
||||
public:
|
||||
|
||||
wxFileDataObject(void) { }
|
||||
void AddFile( const wxString &file )
|
||||
{ m_files += file; m_files += ";"; }
|
||||
|
||||
// implement base class pure virtuals
|
||||
virtual wxDataFormat GetPreferredFormat() const
|
||||
{ return wxDF_FILENAME; }
|
||||
virtual bool IsSupportedFormat(wxDataFormat format) const
|
||||
{ return format == wxDF_FILENAME; }
|
||||
virtual size_t GetDataSize() const
|
||||
{ return m_files.Len() + 1; } // +1 for trailing '\0'of course
|
||||
virtual void GetDataHere(void *pBuf) const
|
||||
{ memcpy(pBuf, m_files.c_str(), GetDataSize()); }
|
||||
|
||||
private:
|
||||
wxString m_files;
|
||||
|
||||
};
|
||||
//-------------------------------------------------------------------------
|
||||
// wxDropTarget
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxDropTarget: public wxObject
|
||||
{
|
||||
public:
|
||||
|
||||
wxDropTarget();
|
||||
~wxDropTarget();
|
||||
|
||||
virtual void OnEnter() { }
|
||||
virtual void OnLeave() { }
|
||||
virtual bool OnDrop( long x, long y, const void *pData ) = 0;
|
||||
|
||||
// protected:
|
||||
|
||||
friend wxWindow;
|
||||
|
||||
// Override these to indicate what kind of data you support:
|
||||
|
||||
virtual size_t GetFormatCount() const = 0;
|
||||
virtual wxDataFormat GetFormat(size_t n) const = 0;
|
||||
};
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// wxTextDropTarget
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxTextDropTarget: public wxDropTarget
|
||||
{
|
||||
public:
|
||||
|
||||
wxTextDropTarget() {};
|
||||
virtual bool OnDrop( long x, long y, const void *pData );
|
||||
virtual bool OnDropText( long x, long y, const char *psz );
|
||||
|
||||
protected:
|
||||
|
||||
virtual size_t GetFormatCount() const;
|
||||
virtual wxDataFormat GetFormat(size_t n) const;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// A drop target which accepts files (dragged from File Manager or Explorer)
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxFileDropTarget: public wxDropTarget
|
||||
{
|
||||
public:
|
||||
|
||||
wxFileDropTarget() {};
|
||||
|
||||
virtual bool OnDrop(long x, long y, const void *pData);
|
||||
virtual bool OnDropFiles( long x, long y,
|
||||
size_t nFiles, const char * const aszFiles[]);
|
||||
|
||||
protected:
|
||||
|
||||
virtual size_t GetFormatCount() const;
|
||||
virtual wxDataFormat GetFormat(size_t n) const;
|
||||
};
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// wxDropSource
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
enum wxDragResult
|
||||
{
|
||||
wxDragError, // error prevented the d&d operation from completing
|
||||
wxDragNone, // drag target didn't accept the data
|
||||
wxDragCopy, // the data was successfully copied
|
||||
wxDragMove, // the data was successfully moved
|
||||
wxDragCancel // the operation was cancelled by user (not an error)
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxDropSource: public wxObject
|
||||
{
|
||||
public:
|
||||
|
||||
wxDropSource( wxWindow *win );
|
||||
wxDropSource( wxDataObject &data, wxWindow *win );
|
||||
|
||||
~wxDropSource(void);
|
||||
|
||||
void SetData( wxDataObject &data );
|
||||
wxDragResult DoDragDrop( bool bAllowMove = FALSE );
|
||||
|
||||
virtual bool GiveFeedback( wxDragResult WXUNUSED(effect), bool WXUNUSED(bScrolling) ) { return TRUE; };
|
||||
|
||||
protected:
|
||||
|
||||
wxDataObject *m_data;
|
||||
};
|
||||
|
||||
#endif
|
||||
//_WX_DND_H_
|
||||
|
89
include/wx/os2/filedlg.h
Normal file
89
include/wx/os2/filedlg.h
Normal file
@ -0,0 +1,89 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: filedlg.h
|
||||
// Purpose: wxFileDialog class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_FILEDLG_H_
|
||||
#define _WX_FILEDLG_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "filedlg.h"
|
||||
#endif
|
||||
|
||||
#include "wx/dialog.h"
|
||||
|
||||
/*
|
||||
* File selector
|
||||
*/
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxFileSelectorPromptStr;
|
||||
WXDLLEXPORT_DATA(extern const char*) wxFileSelectorDefaultWildcardStr;
|
||||
|
||||
class WXDLLEXPORT wxFileDialog: public wxDialog
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxFileDialog)
|
||||
protected:
|
||||
wxString m_message;
|
||||
long m_dialogStyle;
|
||||
wxWindow * m_parent;
|
||||
wxString m_dir;
|
||||
wxString m_path; // Full path
|
||||
wxString m_fileName;
|
||||
wxString m_wildCard;
|
||||
int m_filterIndex;
|
||||
public:
|
||||
wxFileDialog(wxWindow *parent, const wxString& message = wxFileSelectorPromptStr,
|
||||
const wxString& defaultDir = "", const wxString& defaultFile = "", const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
|
||||
long style = 0, const wxPoint& pos = wxDefaultPosition);
|
||||
|
||||
inline void SetMessage(const wxString& message) { m_message = message; }
|
||||
inline void SetPath(const wxString& path) { m_path = path; }
|
||||
inline void SetDirectory(const wxString& dir) { m_dir = dir; }
|
||||
inline void SetFilename(const wxString& name) { m_fileName = name; }
|
||||
inline void SetWildcard(const wxString& wildCard) { m_wildCard = wildCard; }
|
||||
inline void SetStyle(long style) { m_dialogStyle = style; }
|
||||
inline void SetFilterIndex(int filterIndex) { m_filterIndex = filterIndex; }
|
||||
|
||||
inline wxString GetMessage() const { return m_message; }
|
||||
inline wxString GetPath() const { return m_path; }
|
||||
inline wxString GetDirectory() const { return m_dir; }
|
||||
inline wxString GetFilename() const { return m_fileName; }
|
||||
inline wxString GetWildcard() const { return m_wildCard; }
|
||||
inline long GetStyle() const { return m_dialogStyle; }
|
||||
inline int GetFilterIndex() const { return m_filterIndex ; }
|
||||
|
||||
int ShowModal();
|
||||
};
|
||||
|
||||
#define wxOPEN 0x0001
|
||||
#define wxSAVE 0x0002
|
||||
#define wxOVERWRITE_PROMPT 0x0004
|
||||
#define wxHIDE_READONLY 0x0008
|
||||
#define wxFILE_MUST_EXIST 0x0010
|
||||
|
||||
// File selector - backward compatibility
|
||||
WXDLLEXPORT wxString wxFileSelector(const char *message = wxFileSelectorPromptStr, const char *default_path = NULL,
|
||||
const char *default_filename = NULL, const char *default_extension = NULL,
|
||||
const char *wildcard = wxFileSelectorDefaultWildcardStr, int flags = 0,
|
||||
wxWindow *parent = NULL, int x = -1, int y = -1);
|
||||
|
||||
// An extended version of wxFileSelector
|
||||
WXDLLEXPORT wxString wxFileSelectorEx(const char *message = wxFileSelectorPromptStr, const char *default_path = NULL,
|
||||
const char *default_filename = NULL, int *indexDefaultExtension = NULL,
|
||||
const char *wildcard = wxFileSelectorDefaultWildcardStr, int flags = 0,
|
||||
wxWindow *parent = NULL, int x = -1, int y = -1);
|
||||
|
||||
// Generic file load dialog
|
||||
WXDLLEXPORT wxString wxLoadFileSelector(const char *what, const char *extension, const char *default_name = NULL, wxWindow *parent = NULL);
|
||||
|
||||
// Generic file save dialog
|
||||
WXDLLEXPORT wxString wxSaveFileSelector(const char *what, const char *extension, const char *default_name = NULL, wxWindow *parent = NULL);
|
||||
|
||||
#endif
|
||||
// _WX_FILEDLG_H_
|
89
include/wx/os2/font.h
Normal file
89
include/wx/os2/font.h
Normal file
@ -0,0 +1,89 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: font.h
|
||||
// Purpose: wxFont class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_FONT_H_
|
||||
#define _WX_FONT_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "font.h"
|
||||
#endif
|
||||
|
||||
#include "wx/gdiobj.h"
|
||||
|
||||
class WXDLLEXPORT wxFont;
|
||||
|
||||
class WXDLLEXPORT wxFontRefData: public wxGDIRefData
|
||||
{
|
||||
friend class WXDLLEXPORT wxFont;
|
||||
public:
|
||||
wxFontRefData();
|
||||
wxFontRefData(const wxFontRefData& data);
|
||||
~wxFontRefData();
|
||||
protected:
|
||||
int m_pointSize;
|
||||
int m_family;
|
||||
int m_style;
|
||||
int m_weight;
|
||||
bool m_underlined;
|
||||
wxString m_faceName;
|
||||
/* TODO: implementation
|
||||
WXHFONT m_hFont;
|
||||
*/
|
||||
};
|
||||
|
||||
#define M_FONTDATA ((wxFontRefData *)m_refData)
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxEmptyString;
|
||||
|
||||
// Font
|
||||
class WXDLLEXPORT wxFont: public wxGDIObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxFont)
|
||||
public:
|
||||
wxFont();
|
||||
wxFont(int pointSize, int family, int style, int weight, bool underlined = FALSE, const wxString& faceName = wxEmptyString);
|
||||
inline wxFont(const wxFont& font) { Ref(font); }
|
||||
|
||||
~wxFont();
|
||||
|
||||
bool Create(int pointSize, int family, int style, int weight, bool underlined = FALSE, const wxString& faceName = wxEmptyString);
|
||||
|
||||
virtual bool Ok() const { return (m_refData != NULL) ; }
|
||||
|
||||
inline int GetPointSize() const { return M_FONTDATA->m_pointSize; }
|
||||
inline int GetFamily() const { return M_FONTDATA->m_family; }
|
||||
inline int GetStyle() const { return M_FONTDATA->m_style; }
|
||||
inline int GetWeight() const { return M_FONTDATA->m_weight; }
|
||||
wxString GetFamilyString() const ;
|
||||
wxString GetFaceName() const ;
|
||||
wxString GetStyleString() const ;
|
||||
wxString GetWeightString() const ;
|
||||
inline bool GetUnderlined() const { return M_FONTDATA->m_underlined; }
|
||||
|
||||
void SetPointSize(int pointSize);
|
||||
void SetFamily(int family);
|
||||
void SetStyle(int style);
|
||||
void SetWeight(int weight);
|
||||
void SetFaceName(const wxString& faceName);
|
||||
void SetUnderlined(bool underlined);
|
||||
|
||||
inline wxFont& operator = (const wxFont& font) { if (*this == font) return (*this); Ref(font); return *this; }
|
||||
inline bool operator == (const wxFont& font) { return m_refData == font.m_refData; }
|
||||
inline bool operator != (const wxFont& font) { return m_refData != font.m_refData; }
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
bool RealizeResource();
|
||||
void Unshare();
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_FONT_H_
|
46
include/wx/os2/fontdlg.h
Normal file
46
include/wx/os2/fontdlg.h
Normal file
@ -0,0 +1,46 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: fontdlg.h
|
||||
// Purpose: wxFontDialog class. Use generic version if no
|
||||
// platform-specific implementation.
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_FONTDLG_H_
|
||||
#define _WX_FONTDLG_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "fontdlg.h"
|
||||
#endif
|
||||
|
||||
#include "wx/dialog.h"
|
||||
#include "wx/cmndata.h"
|
||||
|
||||
/*
|
||||
* Font dialog
|
||||
*/
|
||||
|
||||
class WXDLLEXPORT wxFontDialog: public wxDialog
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxFontDialog)
|
||||
public:
|
||||
wxFontDialog();
|
||||
wxFontDialog(wxWindow *parent, wxFontData *data = NULL);
|
||||
|
||||
bool Create(wxWindow *parent, wxFontData *data = NULL);
|
||||
|
||||
int ShowModal();
|
||||
wxFontData& GetFontData() { return m_fontData; }
|
||||
|
||||
protected:
|
||||
wxWindow* m_dialogParent;
|
||||
wxFontData m_fontData;
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_FONTDLG_H_
|
||||
|
221
include/wx/os2/frame.h
Normal file
221
include/wx/os2/frame.h
Normal file
@ -0,0 +1,221 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: frame.h
|
||||
// Purpose: wxFrame class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_FRAME_H_
|
||||
#define _WX_FRAME_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "frame.h"
|
||||
#endif
|
||||
|
||||
#include "wx/window.h"
|
||||
#include "wx/toolbar.h"
|
||||
#include "wx/msw/accel.h"
|
||||
#include "wx/icon.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxFrameNameStr;
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxToolBarNameStr;
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxStatusLineNameStr;
|
||||
|
||||
class WXDLLEXPORT wxMenuBar;
|
||||
class WXDLLEXPORT wxStatusBar;
|
||||
|
||||
class WXDLLEXPORT wxFrame : public wxWindow
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxFrame)
|
||||
|
||||
public:
|
||||
wxFrame();
|
||||
wxFrame(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxFrameNameStr)
|
||||
{
|
||||
Create(parent, id, title, pos, size, style, name);
|
||||
}
|
||||
|
||||
~wxFrame();
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxFrameNameStr);
|
||||
|
||||
virtual bool Destroy();
|
||||
|
||||
virtual void ClientToScreen(int *x, int *y) const;
|
||||
virtual void ScreenToClient(int *x, int *y) const;
|
||||
|
||||
void OnSize(wxSizeEvent& event);
|
||||
void OnMenuHighlight(wxMenuEvent& event);
|
||||
void OnActivate(wxActivateEvent& event);
|
||||
void OnIdle(wxIdleEvent& event);
|
||||
void OnCloseWindow(wxCloseEvent& event);
|
||||
|
||||
bool Show(bool show);
|
||||
|
||||
// Set menu bar
|
||||
void SetMenuBar(wxMenuBar *menu_bar);
|
||||
virtual wxMenuBar *GetMenuBar() const;
|
||||
|
||||
// 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);
|
||||
|
||||
// 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; }
|
||||
|
||||
virtual void PositionStatusBar();
|
||||
virtual wxStatusBar *OnCreateStatusBar(int number,
|
||||
long style,
|
||||
wxWindowID id,
|
||||
const wxString& name);
|
||||
|
||||
// Set status line text
|
||||
virtual void SetStatusText(const wxString& text, int number = 0);
|
||||
|
||||
// Set status line widths
|
||||
virtual void SetStatusWidths(int n, const int widths_field[]);
|
||||
|
||||
// Hint to tell framework which status bar to use
|
||||
// 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
|
||||
|
||||
// Iconize
|
||||
virtual void Iconize(bool iconize);
|
||||
|
||||
virtual bool IsIconized() const;
|
||||
|
||||
// Is it maximized?
|
||||
virtual bool IsMaximized() const;
|
||||
|
||||
// Compatibility
|
||||
bool Iconized() const { return IsIconized(); }
|
||||
|
||||
virtual void Maximize(bool maximize);
|
||||
// virtual bool LoadAccelerators(const wxString& table);
|
||||
|
||||
// Responds to colour changes
|
||||
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
||||
|
||||
// Query app for menu item updates (called from OnIdle)
|
||||
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)
|
||||
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;
|
||||
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()
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_FRAME_H_
|
71
include/wx/os2/gauge.h
Normal file
71
include/wx/os2/gauge.h
Normal file
@ -0,0 +1,71 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: gauge.h
|
||||
// Purpose: wxGauge class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GAUGE_H_
|
||||
#define _WX_GAUGE_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "gauge.h"
|
||||
#endif
|
||||
|
||||
#include "wx/control.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxGaugeNameStr;
|
||||
|
||||
// Group box
|
||||
class WXDLLEXPORT wxGauge: public wxControl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxGauge)
|
||||
public:
|
||||
inline wxGauge() { m_rangeMax = 0; m_gaugePos = 0; }
|
||||
|
||||
inline wxGauge(wxWindow *parent, wxWindowID id,
|
||||
int range,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxGA_HORIZONTAL,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxGaugeNameStr)
|
||||
{
|
||||
Create(parent, id, range, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
int range,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxGA_HORIZONTAL,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxGaugeNameStr);
|
||||
|
||||
void SetShadowWidth(int w);
|
||||
void SetBezelFace(int w);
|
||||
void SetRange(int r);
|
||||
void SetValue(int pos);
|
||||
|
||||
int GetShadowWidth() const ;
|
||||
int GetBezelFace() const ;
|
||||
int GetRange() const ;
|
||||
int GetValue() const ;
|
||||
|
||||
void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
||||
|
||||
virtual void Command(wxCommandEvent& WXUNUSED(event)) {} ;
|
||||
|
||||
protected:
|
||||
int m_rangeMax;
|
||||
int m_gaugePos;
|
||||
private:
|
||||
void SetSize(int width, int height) {wxWindow::SetSize(width, height);}
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_GAUGE_H_
|
48
include/wx/os2/gdiobj.h
Normal file
48
include/wx/os2/gdiobj.h
Normal file
@ -0,0 +1,48 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: gdiobj.h
|
||||
// Purpose: wxGDIObject class: base class for other GDI classes
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GDIOBJ_H_
|
||||
#define _WX_GDIOBJ_H_
|
||||
|
||||
#include "wx/object.h"
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "gdiobj.h"
|
||||
#endif
|
||||
|
||||
class WXDLLEXPORT wxGDIRefData: public wxObjectRefData {
|
||||
public:
|
||||
inline wxGDIRefData()
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
#define M_GDIDATA ((wxGDIRefData *)m_refData)
|
||||
|
||||
class WXDLLEXPORT wxGDIObject: public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxGDIObject)
|
||||
public:
|
||||
inline wxGDIObject() { m_visible = FALSE; };
|
||||
inline ~wxGDIObject() {};
|
||||
|
||||
inline bool IsNull() const { return (m_refData == 0); }
|
||||
|
||||
virtual bool GetVisible() { return m_visible; }
|
||||
virtual void SetVisible(bool v) { m_visible = v; }
|
||||
|
||||
protected:
|
||||
bool m_visible; // Can a pointer to this object be safely taken?
|
||||
// - only if created within FindOrCreate...
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_GDIOBJ_H_
|
52
include/wx/os2/helpxxxx.h
Normal file
52
include/wx/os2/helpxxxx.h
Normal file
@ -0,0 +1,52 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: helpxxxx.h
|
||||
// Purpose: Help system: native implementation for your system. Replace
|
||||
// XXXX with suitable name.
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_HELPXXXX_H_
|
||||
#define _WX_HELPXXXX_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "helpxxxx.h"
|
||||
#endif
|
||||
|
||||
#include "wx/wx.h"
|
||||
|
||||
#include "wx/helpbase.h"
|
||||
|
||||
class WXDLLEXPORT wxXXXXHelpController: public wxHelpControllerBase
|
||||
{
|
||||
DECLARE_CLASS(wxXXXXHelpController)
|
||||
|
||||
public:
|
||||
wxXXXXHelpController();
|
||||
~wxXXXXHelpController();
|
||||
|
||||
// Must call this to set the filename and server name
|
||||
virtual bool Initialize(const wxString& file);
|
||||
|
||||
// If file is "", reloads file given in Initialize
|
||||
virtual bool LoadFile(const wxString& file = "");
|
||||
virtual bool DisplayContents();
|
||||
virtual bool DisplaySection(int sectionNo);
|
||||
virtual bool DisplayBlock(long blockNo);
|
||||
virtual bool KeywordSearch(const wxString& k);
|
||||
|
||||
virtual bool Quit();
|
||||
virtual void OnQuit();
|
||||
|
||||
inline wxString GetHelpFile() const { return m_helpFile; }
|
||||
|
||||
protected:
|
||||
wxString m_helpFile;
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_HELPXXXX_H_
|
112
include/wx/os2/icon.h
Normal file
112
include/wx/os2/icon.h
Normal file
@ -0,0 +1,112 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: icon.h
|
||||
// Purpose: wxIcon class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_ICON_H_
|
||||
#define _WX_ICON_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "icon.h"
|
||||
#endif
|
||||
|
||||
#include "wx/bitmap.h"
|
||||
|
||||
class WXDLLEXPORT wxIconRefData: public wxBitmapRefData
|
||||
{
|
||||
friend class WXDLLEXPORT wxBitmap;
|
||||
friend class WXDLLEXPORT wxIcon;
|
||||
public:
|
||||
wxIconRefData();
|
||||
~wxIconRefData();
|
||||
|
||||
public:
|
||||
/* TODO: whatever your actual icon handle is
|
||||
WXHICON m_hIcon;
|
||||
*/
|
||||
};
|
||||
|
||||
#define M_ICONDATA ((wxIconRefData *)m_refData)
|
||||
#define M_ICONHANDLERDATA ((wxIconRefData *)bitmap->GetRefData())
|
||||
|
||||
// Icon
|
||||
class WXDLLEXPORT wxIcon: public wxBitmap
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxIcon)
|
||||
|
||||
public:
|
||||
wxIcon();
|
||||
|
||||
// Copy constructors
|
||||
inline wxIcon(const wxIcon& icon) { Ref(icon); }
|
||||
|
||||
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,
|
||||
int desiredWidth = -1, int desiredHeight = -1);
|
||||
|
||||
inline wxIcon& operator = (const wxIcon& icon) { if (*this == icon) return (*this); Ref(icon); return *this; }
|
||||
inline bool operator == (const wxIcon& icon) { return m_refData == icon.m_refData; }
|
||||
inline bool operator != (const wxIcon& icon) { return m_refData != icon.m_refData; }
|
||||
|
||||
/* TODO: implementation
|
||||
void SetHICON(WXHICON ico);
|
||||
inline WXHICON GetHICON() const { return (M_ICONDATA ? M_ICONDATA->m_hIcon : 0); }
|
||||
*/
|
||||
|
||||
/* 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)); }
|
||||
};
|
||||
|
||||
/* Example handlers. TODO: write your own handlers for relevant types.
|
||||
|
||||
class WXDLLEXPORT wxICOFileHandler: public wxBitmapHandler
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxICOFileHandler)
|
||||
public:
|
||||
inline wxICOFileHandler()
|
||||
{
|
||||
m_name = "ICO icon file";
|
||||
m_extension = "ico";
|
||||
m_type = wxBITMAP_TYPE_ICO;
|
||||
};
|
||||
|
||||
virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
|
||||
int desiredWidth = -1, int desiredHeight = -1);
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxICOResourceHandler: public wxBitmapHandler
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxICOResourceHandler)
|
||||
public:
|
||||
inline wxICOResourceHandler()
|
||||
{
|
||||
m_name = "ICO resource";
|
||||
m_extension = "ico";
|
||||
m_type = wxBITMAP_TYPE_ICO_RESOURCE;
|
||||
};
|
||||
|
||||
virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
|
||||
int desiredWidth = -1, int desiredHeight = -1);
|
||||
|
||||
};
|
||||
|
||||
*/
|
||||
|
||||
#endif
|
||||
// _WX_ICON_H_
|
145
include/wx/os2/imaglist.h
Normal file
145
include/wx/os2/imaglist.h
Normal file
@ -0,0 +1,145 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: imaglist.h
|
||||
// Purpose: wxImageList class. Note: if your GUI doesn't have
|
||||
// an image list equivalent, you can use the generic class
|
||||
// in src/generic.
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_IMAGLIST_H_
|
||||
#define _WX_IMAGLIST_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "imaglist.h"
|
||||
#endif
|
||||
|
||||
#include "wx/bitmap.h"
|
||||
|
||||
/*
|
||||
* wxImageList is used for wxListCtrl, wxTreeCtrl. These controls refer to
|
||||
* images for their items by an index into an image list.
|
||||
* A wxImageList is capable of creating images with optional masks from
|
||||
* a variety of sources - a single bitmap plus a colour to indicate the mask,
|
||||
* two bitmaps, or an icon.
|
||||
*
|
||||
*/
|
||||
|
||||
// Flags for Draw
|
||||
#define wxIMAGELIST_DRAW_NORMAL 0x0001
|
||||
#define wxIMAGELIST_DRAW_TRANSPARENT 0x0002
|
||||
#define wxIMAGELIST_DRAW_SELECTED 0x0004
|
||||
#define wxIMAGELIST_DRAW_FOCUSED 0x0008
|
||||
|
||||
// Flag values for Set/GetImageList
|
||||
enum {
|
||||
wxIMAGE_LIST_NORMAL, // Normal icons
|
||||
wxIMAGE_LIST_SMALL, // Small icons
|
||||
wxIMAGE_LIST_STATE // State icons: unimplemented (see WIN32 documentation)
|
||||
};
|
||||
|
||||
// Eventually we'll make this a reference-counted wxGDIObject. For
|
||||
// now, the app must take care of ownership issues. That is, the
|
||||
// image lists must be explicitly deleted after the control(s) that uses them
|
||||
// is (are) deleted, or when the app exits.
|
||||
class WXDLLEXPORT wxImageList: public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxImageList)
|
||||
public:
|
||||
/*
|
||||
* Public interface
|
||||
*/
|
||||
|
||||
wxImageList();
|
||||
|
||||
// Creates an image list.
|
||||
// Specify the width and height of the images in the list,
|
||||
// whether there are masks associated with them (e.g. if creating images
|
||||
// from icons), and the initial size of the list.
|
||||
inline wxImageList(int width, int height, bool mask = TRUE, int initialCount = 1)
|
||||
{
|
||||
Create(width, height, mask, initialCount);
|
||||
}
|
||||
~wxImageList();
|
||||
|
||||
|
||||
// Attributes
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Returns the number of images in the image list.
|
||||
int GetImageCount() const;
|
||||
|
||||
// Operations
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Creates an image list
|
||||
// width, height specify the size of the images in the list (all the same).
|
||||
// mask specifies whether the images have masks or not.
|
||||
// initialNumber is the initial number of images to reserve.
|
||||
bool Create(int width, int height, bool mask = TRUE, int initialNumber = 1);
|
||||
|
||||
// Adds a bitmap, and optionally a mask bitmap.
|
||||
// Note that wxImageList creates *new* bitmaps, so you may delete
|
||||
// 'bitmap' and 'mask' after calling Add.
|
||||
int Add(const wxBitmap& bitmap, const wxBitmap& mask = wxNullBitmap);
|
||||
|
||||
// Adds a bitmap, using the specified colour to create the mask bitmap
|
||||
// Note that wxImageList creates *new* bitmaps, so you may delete
|
||||
// 'bitmap' after calling Add.
|
||||
int Add(const wxBitmap& bitmap, const wxColour& maskColour);
|
||||
|
||||
// Adds a bitmap and mask from an icon.
|
||||
int Add(const wxIcon& icon);
|
||||
|
||||
// Replaces a bitmap, optionally passing a mask bitmap.
|
||||
// Note that wxImageList creates new bitmaps, so you may delete
|
||||
// 'bitmap' and 'mask' after calling Replace.
|
||||
bool Replace(int index, const wxBitmap& bitmap, const wxBitmap& mask = wxNullBitmap);
|
||||
|
||||
/* Not supported by Win95
|
||||
// Replacing a bitmap, using the specified colour to create the mask bitmap
|
||||
// Note that wxImageList creates new bitmaps, so you may delete
|
||||
// 'bitmap'.
|
||||
bool Replace(int index, const wxBitmap& bitmap, const wxColour& maskColour);
|
||||
*/
|
||||
|
||||
// Replaces a bitmap and mask from an icon.
|
||||
// You can delete 'icon' after calling Replace.
|
||||
bool Replace(int index, const wxIcon& icon);
|
||||
|
||||
// Removes the image at the given index.
|
||||
bool Remove(int index);
|
||||
|
||||
// Remove all images
|
||||
bool RemoveAll();
|
||||
|
||||
// Draws the given image on a dc at the specified position.
|
||||
// If 'solidBackground' is TRUE, Draw sets the image list background
|
||||
// colour to the background colour of the wxDC, to speed up
|
||||
// drawing by eliminating masked drawing where possible.
|
||||
bool Draw(int index, wxDC& dc, int x, int y,
|
||||
int flags = wxIMAGELIST_DRAW_NORMAL, bool solidBackground = FALSE);
|
||||
|
||||
/* TODO (optional?)
|
||||
wxIcon *MakeIcon(int index);
|
||||
*/
|
||||
|
||||
/* TODO
|
||||
// Implementation
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Returns the native image list handle
|
||||
inline WXHIMAGELIST GetHIMAGELIST() const { return m_hImageList; }
|
||||
|
||||
protected:
|
||||
WXHIMAGELIST m_hImageList;
|
||||
*/
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_IMAGLIST_H_
|
93
include/wx/os2/joystick.h
Normal file
93
include/wx/os2/joystick.h
Normal file
@ -0,0 +1,93 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: joystick.h
|
||||
// Purpose: wxJoystick class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_JOYSTICK_H_
|
||||
#define _WX_JOYSTICK_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "joystick.h"
|
||||
#endif
|
||||
|
||||
#include "wx/event.h"
|
||||
|
||||
class WXDLLEXPORT wxJoystick: public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxJoystick)
|
||||
public:
|
||||
/*
|
||||
* Public interface
|
||||
*/
|
||||
|
||||
wxJoystick(int joystick = wxJOYSTICK1) { m_joystick = joystick; };
|
||||
|
||||
// Attributes
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
wxPoint GetPosition() const;
|
||||
int GetZPosition() const;
|
||||
int GetButtonState() const;
|
||||
int GetPOVPosition() const;
|
||||
int GetPOVCTSPosition() const;
|
||||
int GetRudderPosition() const;
|
||||
int GetUPosition() const;
|
||||
int GetVPosition() const;
|
||||
int GetMovementThreshold() const;
|
||||
void SetMovementThreshold(int threshold) ;
|
||||
|
||||
// Capabilities
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
bool IsOk() const; // Checks that the joystick is functioning
|
||||
int GetNumberJoysticks() const ;
|
||||
int GetManufacturerId() const ;
|
||||
int GetProductId() const ;
|
||||
wxString GetProductName() const ;
|
||||
int GetXMin() const;
|
||||
int GetYMin() const;
|
||||
int GetZMin() const;
|
||||
int GetXMax() const;
|
||||
int GetYMax() const;
|
||||
int GetZMax() const;
|
||||
int GetNumberButtons() const;
|
||||
int GetNumberAxes() const;
|
||||
int GetMaxButtons() const;
|
||||
int GetMaxAxes() const;
|
||||
int GetPollingMin() const;
|
||||
int GetPollingMax() const;
|
||||
int GetRudderMin() const;
|
||||
int GetRudderMax() const;
|
||||
int GetUMin() const;
|
||||
int GetUMax() const;
|
||||
int GetVMin() const;
|
||||
int GetVMax() const;
|
||||
|
||||
bool HasRudder() const;
|
||||
bool HasZ() const;
|
||||
bool HasU() const;
|
||||
bool HasV() const;
|
||||
bool HasPOV() const;
|
||||
bool HasPOV4Dir() const;
|
||||
bool HasPOVCTS() const;
|
||||
|
||||
// Operations
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// pollingFreq = 0 means that movement events are sent when above the threshold.
|
||||
// If pollingFreq > 0, events are received every this many milliseconds.
|
||||
bool SetCapture(wxWindow* win, int pollingFreq = 0);
|
||||
bool ReleaseCapture();
|
||||
|
||||
protected:
|
||||
int m_joystick;
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_JOYSTICK_H_
|
149
include/wx/os2/listbox.h
Normal file
149
include/wx/os2/listbox.h
Normal file
@ -0,0 +1,149 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: listbox.h
|
||||
// Purpose: wxListBox class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_LISTBOX_H_
|
||||
#define _WX_LISTBOX_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "listbox.h"
|
||||
#endif
|
||||
|
||||
#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
|
||||
|
||||
// forward decl for GetSelections()
|
||||
class wxArrayInt;
|
||||
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxEmptyString;
|
||||
|
||||
// List box item
|
||||
class WXDLLEXPORT wxListBox : public wxControl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxListBox)
|
||||
|
||||
public:
|
||||
wxListBox();
|
||||
wxListBox(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
int n = 0, const wxString choices[] = NULL,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxListBoxNameStr)
|
||||
{
|
||||
Create(parent, id, pos, size, n, choices, style, validator, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
int n = 0, const wxString choices[] = NULL,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxListBoxNameStr);
|
||||
|
||||
~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 int FindString(const wxString& s) const ;
|
||||
virtual void Clear();
|
||||
virtual void SetSelection(int n, bool select = TRUE);
|
||||
|
||||
virtual void Deselect(int n);
|
||||
|
||||
// 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 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 ;
|
||||
|
||||
// Set the specified item at the first visible item
|
||||
// or scroll to max range.
|
||||
virtual void SetFirstItem(int n) ;
|
||||
virtual void SetFirstItem(const wxString& s) ;
|
||||
|
||||
virtual void InsertItems(int nItems, const wxString items[], int pos);
|
||||
|
||||
virtual wxString GetStringSelection() const ;
|
||||
virtual bool SetStringSelection(const wxString& s, bool flag = TRUE);
|
||||
virtual int Number() const ;
|
||||
|
||||
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
|
||||
// _WX_LISTBOX_H_
|
451
include/wx/os2/listctrl.h
Normal file
451
include/wx/os2/listctrl.h
Normal file
@ -0,0 +1,451 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: listctrl.h
|
||||
// Purpose: wxListCtrl class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_LISTCTRL_H_
|
||||
#define _WX_LISTCTRL_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "listctrl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/control.h"
|
||||
#include "wx/event.h"
|
||||
#include "wx/imaglist.h"
|
||||
|
||||
/*
|
||||
The wxListCtrl can show lists of items in four different modes:
|
||||
wxLC_LIST: multicolumn list view, with optional small icons (icons could be
|
||||
optional for some platforms). Columns are computed automatically,
|
||||
i.e. you don't set columns as in wxLC_REPORT. In other words,
|
||||
the list wraps, unlike a wxListBox.
|
||||
wxLC_REPORT: single or multicolumn report view (with optional header)
|
||||
wxLC_ICON: large icon view, with optional labels
|
||||
wxLC_SMALL_ICON: small icon view, with optional labels
|
||||
|
||||
You can change the style dynamically, either with SetSingleStyle or
|
||||
SetWindowStyleFlag.
|
||||
|
||||
Further window styles:
|
||||
|
||||
wxLC_ALIGN_TOP icons align to the top (default)
|
||||
wxLC_ALIGN_LEFT icons align to the left
|
||||
wxLC_AUTOARRANGE icons arrange themselves
|
||||
wxLC_USER_TEXT the app provides label text on demand, except for column headers
|
||||
wxLC_EDIT_LABELS labels are editable: app will be notified.
|
||||
wxLC_NO_HEADER no header in report mode
|
||||
wxLC_NO_SORT_HEADER can't click on header
|
||||
wxLC_SINGLE_SEL single selection
|
||||
wxLC_SORT_ASCENDING sort ascending (must still supply a comparison callback in SortItems)
|
||||
wxLC_SORT_DESCENDING sort descending (ditto)
|
||||
|
||||
Items are referred to by their index (position in the list starting from zero).
|
||||
|
||||
Label text is supplied via insertion/setting functions and is stored by the
|
||||
control, unless the wxLC_USER_TEXT style has been specified, in which case
|
||||
the app will be notified when text is required (see sample).
|
||||
|
||||
Images are dealt with by (optionally) associating 3 image lists with the control.
|
||||
Zero-based indexes into these image lists indicate which image is to be used for
|
||||
which item. Each image in an image list can contain a mask, and can be made out
|
||||
of either a bitmap, two bitmaps or an icon. See ImagList.h for more details.
|
||||
|
||||
Notifications are passed via the wxWindows 2.0 event system.
|
||||
|
||||
See the sample wxListCtrl app for API usage.
|
||||
|
||||
*/
|
||||
|
||||
// Mask flags to tell app/GUI what fields of wxListItem are valid
|
||||
#define wxLIST_MASK_STATE 0x0001
|
||||
#define wxLIST_MASK_TEXT 0x0002
|
||||
#define wxLIST_MASK_IMAGE 0x0004
|
||||
#define wxLIST_MASK_DATA 0x0008
|
||||
#define wxLIST_SET_ITEM 0x0010
|
||||
#define wxLIST_MASK_WIDTH 0x0020
|
||||
#define wxLIST_MASK_FORMAT 0x0040
|
||||
|
||||
// State flags for indicating the state of an item
|
||||
#define wxLIST_STATE_DONTCARE 0x0000
|
||||
#define wxLIST_STATE_DROPHILITED 0x0001
|
||||
#define wxLIST_STATE_FOCUSED 0x0002
|
||||
#define wxLIST_STATE_SELECTED 0x0004
|
||||
#define wxLIST_STATE_CUT 0x0008
|
||||
|
||||
// Hit test flags, used in HitTest
|
||||
#define wxLIST_HITTEST_ABOVE 0x0001 // Above the client area.
|
||||
#define wxLIST_HITTEST_BELOW 0x0002 // Below the client area.
|
||||
#define wxLIST_HITTEST_NOWHERE 0x0004 // In the client area but below the last item.
|
||||
#define wxLIST_HITTEST_ONITEMICON 0x0020 // On the bitmap associated with an item.
|
||||
#define wxLIST_HITTEST_ONITEMLABEL 0x0080 // On the label (string) associated with an item.
|
||||
#define wxLIST_HITTEST_ONITEMRIGHT 0x0100 // In the area to the right of an item.
|
||||
#define wxLIST_HITTEST_ONITEMSTATEICON 0x0200 // On the state icon for a tree view item that is in a user-defined state.
|
||||
#define wxLIST_HITTEST_TOLEFT 0x0400 // To the left of the client area.
|
||||
#define wxLIST_HITTEST_TORIGHT 0x0800 // To the right of the client area.
|
||||
|
||||
#define wxLIST_HITTEST_ONITEM (wxLIST_HITTEST_ONITEMICON | wxLIST_HITTEST_ONITEMLABEL wxLIST_HITTEST_ONITEMSTATEICON)
|
||||
|
||||
// Flags for GetNextItem
|
||||
enum {
|
||||
wxLIST_NEXT_ABOVE, // Searches for an item above the specified item
|
||||
wxLIST_NEXT_ALL, // Searches for subsequent item by index
|
||||
wxLIST_NEXT_BELOW, // Searches for an item below the specified item
|
||||
wxLIST_NEXT_LEFT, // Searches for an item to the left of the specified item
|
||||
wxLIST_NEXT_RIGHT, // Searches for an item to the right of the specified item
|
||||
};
|
||||
|
||||
// Alignment flags for Arrange
|
||||
enum {
|
||||
wxLIST_ALIGN_DEFAULT,
|
||||
wxLIST_ALIGN_LEFT,
|
||||
wxLIST_ALIGN_TOP,
|
||||
wxLIST_ALIGN_SNAP_TO_GRID
|
||||
};
|
||||
|
||||
// Column format
|
||||
enum {
|
||||
wxLIST_FORMAT_LEFT,
|
||||
wxLIST_FORMAT_RIGHT,
|
||||
wxLIST_FORMAT_CENTRE,
|
||||
wxLIST_FORMAT_CENTER = wxLIST_FORMAT_CENTRE
|
||||
};
|
||||
|
||||
// Autosize values for SetColumnWidth
|
||||
enum {
|
||||
wxLIST_AUTOSIZE = -1,
|
||||
wxLIST_AUTOSIZE_USEHEADER = -2
|
||||
};
|
||||
|
||||
// Flag values for GetItemRect
|
||||
enum {
|
||||
wxLIST_RECT_BOUNDS,
|
||||
wxLIST_RECT_ICON,
|
||||
wxLIST_RECT_LABEL
|
||||
};
|
||||
|
||||
// Flag values for FindItem
|
||||
enum {
|
||||
wxLIST_FIND_UP,
|
||||
wxLIST_FIND_DOWN,
|
||||
wxLIST_FIND_LEFT,
|
||||
wxLIST_FIND_RIGHT
|
||||
};
|
||||
|
||||
// wxListItem: data representing an item, or report field.
|
||||
// It also doubles up to represent entire column information
|
||||
// when inserting or setting a column.
|
||||
class WXDLLEXPORT wxListItem: public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxListItem)
|
||||
public:
|
||||
long m_mask; // Indicates what fields are valid
|
||||
long m_itemId; // The zero-based item position
|
||||
int m_col; // Zero-based column, if in report mode
|
||||
long m_state; // The state of the item
|
||||
long m_stateMask; // Which flags of m_state are valid (uses same flags)
|
||||
wxString m_text; // The label/header text
|
||||
int m_image; // The zero-based index into an image list
|
||||
long m_data; // App-defined data
|
||||
|
||||
// For columns only
|
||||
int m_format; // left, right, centre
|
||||
int m_width; // width of column
|
||||
|
||||
wxListItem();
|
||||
};
|
||||
|
||||
// type of compare function for wxListCtrl sort operation
|
||||
typedef int (*wxListCtrlCompare)(long item1, long item2, long sortData);
|
||||
|
||||
class WXDLLEXPORT wxListCtrl: public wxControl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxListCtrl)
|
||||
public:
|
||||
/*
|
||||
* Public interface
|
||||
*/
|
||||
|
||||
wxListCtrl();
|
||||
|
||||
inline wxListCtrl(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
long style = wxLC_ICON, const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = "listCtrl")
|
||||
{
|
||||
Create(parent, id, pos, size, style, validator, name);
|
||||
}
|
||||
~wxListCtrl();
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
long style = wxLC_ICON, const wxValidator& validator = wxDefaultValidator, const wxString& name = "wxListCtrl");
|
||||
|
||||
|
||||
// Attributes
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Gets information about this column
|
||||
bool GetColumn(int col, wxListItem& item) const;
|
||||
|
||||
// Sets information about this column
|
||||
bool SetColumn(int col, wxListItem& item) ;
|
||||
|
||||
// Gets the column width
|
||||
int GetColumnWidth(int col) const;
|
||||
|
||||
// Sets the column width
|
||||
bool SetColumnWidth(int col, int width) ;
|
||||
|
||||
// Gets the number of items that can fit vertically in the
|
||||
// visible area of the list control (list or report view)
|
||||
// or the total number of items in the list control (icon
|
||||
// or small icon view)
|
||||
int GetCountPerPage() const;
|
||||
|
||||
// Gets the edit control for editing labels.
|
||||
wxTextCtrl* GetEditControl() const;
|
||||
|
||||
// Gets information about the item
|
||||
bool GetItem(wxListItem& info) const ;
|
||||
|
||||
// Sets information about the item
|
||||
bool SetItem(wxListItem& info) ;
|
||||
|
||||
// Sets a string field at a particular column
|
||||
long SetItem(long index, int col, const wxString& label, int imageId = -1);
|
||||
|
||||
// Gets the item state
|
||||
int GetItemState(long item, long stateMask) const ;
|
||||
|
||||
// Sets the item state
|
||||
bool SetItemState(long item, long state, long stateMask) ;
|
||||
|
||||
// Sets the item image
|
||||
bool SetItemImage(long item, int image, int selImage) ;
|
||||
|
||||
// Gets the item text
|
||||
wxString GetItemText(long item) const ;
|
||||
|
||||
// Sets the item text
|
||||
void SetItemText(long item, const wxString& str) ;
|
||||
|
||||
// Gets the item data
|
||||
long GetItemData(long item) const ;
|
||||
|
||||
// Sets the item data
|
||||
bool SetItemData(long item, long data) ;
|
||||
|
||||
// Gets the item rectangle
|
||||
bool GetItemRect(long item, wxRect& rect, int code = wxLIST_RECT_BOUNDS) const ;
|
||||
|
||||
// Gets the item position
|
||||
bool GetItemPosition(long item, wxPoint& pos) const ;
|
||||
|
||||
// Sets the item position
|
||||
bool SetItemPosition(long item, const wxPoint& pos) ;
|
||||
|
||||
// Gets the number of items in the list control
|
||||
int GetItemCount() const;
|
||||
|
||||
// Gets the number of columns in the list control
|
||||
int GetColumnCount() const;
|
||||
|
||||
// Retrieves the spacing between icons in pixels.
|
||||
// If small is TRUE, gets the spacing for the small icon
|
||||
// view, otherwise the large icon view.
|
||||
int GetItemSpacing(bool isSmall) const;
|
||||
|
||||
// Gets the number of selected items in the list control
|
||||
int GetSelectedItemCount() const;
|
||||
|
||||
// Gets the text colour of the listview
|
||||
wxColour GetTextColour() const;
|
||||
|
||||
// Sets the text colour of the listview
|
||||
void SetTextColour(const wxColour& col);
|
||||
|
||||
// Gets the index of the topmost visible item when in
|
||||
// list or report view
|
||||
long GetTopItem() const ;
|
||||
|
||||
// Add or remove a single window style
|
||||
void SetSingleStyle(long style, bool add = TRUE) ;
|
||||
|
||||
// Set the whole window style
|
||||
void SetWindowStyleFlag(long style) ;
|
||||
|
||||
// Searches for an item, starting from 'item'.
|
||||
// item can be -1 to find the first item that matches the
|
||||
// specified flags.
|
||||
// Returns the item or -1 if unsuccessful.
|
||||
long GetNextItem(long item, int geometry = wxLIST_NEXT_ALL, int state = wxLIST_STATE_DONTCARE) const ;
|
||||
|
||||
// Implementation: converts wxWindows style to MSW style.
|
||||
// Can be a single style flag or a bit list.
|
||||
// oldStyle is 'normalised' so that it doesn't contain
|
||||
// conflicting styles.
|
||||
long ConvertToMSWStyle(long& oldStyle, long style) const;
|
||||
|
||||
// Gets one of the three image lists
|
||||
wxImageList *GetImageList(int which) const ;
|
||||
|
||||
// Sets the image list
|
||||
// N.B. There's a quirk in the Win95 list view implementation.
|
||||
// If in wxLC_LIST mode, it'll *still* display images by the labels if
|
||||
// there's a small-icon image list set for the control - even though you
|
||||
// haven't specified wxLIST_MASK_IMAGE when inserting.
|
||||
// So you have to set a NULL small-icon image list to be sure that
|
||||
// the wxLC_LIST mode works without icons. Of course, you may want icons...
|
||||
void SetImageList(wxImageList *imageList, int which) ;
|
||||
|
||||
// Operations
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Arranges the items
|
||||
bool Arrange(int flag = wxLIST_ALIGN_DEFAULT);
|
||||
|
||||
// Deletes an item
|
||||
bool DeleteItem(long item);
|
||||
|
||||
// Deletes all items
|
||||
bool DeleteAllItems() ;
|
||||
|
||||
// Deletes a column
|
||||
bool DeleteColumn(int col);
|
||||
|
||||
// Deletes all columns
|
||||
bool DeleteAllColumns();
|
||||
|
||||
// Clears items, and columns if there are any.
|
||||
void ClearAll();
|
||||
|
||||
// Edit the label
|
||||
wxTextCtrl* EditLabel(long item, wxClassInfo* textControlClass = CLASSINFO(wxTextCtrl));
|
||||
|
||||
// End label editing, optionally cancelling the edit
|
||||
bool EndEditLabel(bool cancel);
|
||||
|
||||
// Ensures this item is visible
|
||||
bool EnsureVisible(long item) ;
|
||||
|
||||
// Find an item whose label matches this string, starting from the item after 'start'
|
||||
// or the beginning if 'start' is -1.
|
||||
long FindItem(long start, const wxString& str, bool partial = FALSE);
|
||||
|
||||
// Find an item whose data matches this data, starting from the item after 'start'
|
||||
// or the beginning if 'start' is -1.
|
||||
long FindItem(long start, long data);
|
||||
|
||||
// Find an item nearest this position in the specified direction, starting from
|
||||
// the item after 'start' or the beginning if 'start' is -1.
|
||||
long FindItem(long start, const wxPoint& pt, int direction);
|
||||
|
||||
// Determines which item (if any) is at the specified point,
|
||||
// giving details in 'flags' (see wxLIST_HITTEST_... flags above)
|
||||
long HitTest(const wxPoint& point, int& flags);
|
||||
|
||||
// Inserts an item, returning the index of the new item if successful,
|
||||
// -1 otherwise.
|
||||
// TOD: Should also have some further convenience functions
|
||||
// which don't require setting a wxListItem object
|
||||
long InsertItem(wxListItem& info);
|
||||
|
||||
// Insert a string item
|
||||
long InsertItem(long index, const wxString& label);
|
||||
|
||||
// Insert an image item
|
||||
long InsertItem(long index, int imageIndex);
|
||||
|
||||
// Insert an image/string item
|
||||
long InsertItem(long index, const wxString& label, int imageIndex);
|
||||
|
||||
// For list view mode (only), inserts a column.
|
||||
long InsertColumn(long col, wxListItem& info);
|
||||
|
||||
long InsertColumn(long col, const wxString& heading, int format = wxLIST_FORMAT_LEFT,
|
||||
int width = -1);
|
||||
|
||||
// Scrolls the list control. If in icon, small icon or report view mode,
|
||||
// x specifies the number of pixels to scroll. If in list view mode, x
|
||||
// specifies the number of columns to scroll.
|
||||
// If in icon, small icon or list view mode, y specifies the number of pixels
|
||||
// to scroll. If in report view mode, y specifies the number of lines to scroll.
|
||||
bool ScrollList(int dx, int dy);
|
||||
|
||||
// Sort items.
|
||||
|
||||
// fn is a function which takes 3 long arguments: item1, item2, data.
|
||||
// item1 is the long data associated with a first item (NOT the index).
|
||||
// item2 is the long data associated with a second item (NOT the index).
|
||||
// data is the same value as passed to SortItems.
|
||||
// The return value is a negative number if the first item should precede the second
|
||||
// item, a positive number of the second item should precede the first,
|
||||
// or zero if the two items are equivalent.
|
||||
|
||||
// data is arbitrary data to be passed to the sort function.
|
||||
bool SortItems(wxListCtrlCompare fn, long data);
|
||||
|
||||
/* Why should we need this function? Leave for now.
|
||||
* We might need it because item data may have changed,
|
||||
* but the display needs refreshing (in string callback mode)
|
||||
// Updates an item. If the list control has the wxLI_AUTO_ARRANGE style,
|
||||
// the items will be rearranged.
|
||||
bool Update(long item);
|
||||
*/
|
||||
|
||||
void Command(wxCommandEvent& event) { ProcessCommand(event); };
|
||||
|
||||
protected:
|
||||
wxTextCtrl* m_textCtrl; // The control used for editing a label
|
||||
wxImageList * m_imageListNormal; // The image list for normal icons
|
||||
wxImageList * m_imageListSmall; // The image list for small icons
|
||||
wxImageList * m_imageListState; // The image list state icons (not implemented yet)
|
||||
|
||||
long m_baseStyle; // Basic Windows style flags, for recreation purposes
|
||||
wxStringList m_stringPool; // Pool of 3 strings to satisfy Windows callback
|
||||
// requirements
|
||||
int m_colCount; // Windows doesn't have GetColumnCount so must
|
||||
// keep track of inserted/deleted columns
|
||||
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxListEvent: public wxCommandEvent
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxListEvent)
|
||||
|
||||
public:
|
||||
wxListEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
|
||||
|
||||
int m_code;
|
||||
long m_itemIndex;
|
||||
long m_oldItemIndex;
|
||||
int m_col;
|
||||
bool m_cancelled;
|
||||
wxPoint m_pointDrag;
|
||||
|
||||
wxListItem m_item;
|
||||
};
|
||||
|
||||
typedef void (wxEvtHandler::*wxListEventFunction)(wxListEvent&);
|
||||
|
||||
#define EVT_LIST_BEGIN_DRAG(id, fn) { wxEVT_COMMAND_LIST_BEGIN_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL },
|
||||
#define EVT_LIST_BEGIN_RDRAG(id, fn) { wxEVT_COMMAND_LIST_BEGIN_RDRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL },
|
||||
#define EVT_LIST_BEGIN_LABEL_EDIT(id, fn) { wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL },
|
||||
#define EVT_LIST_END_LABEL_EDIT(id, fn) { wxEVT_COMMAND_LIST_END_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL },
|
||||
#define EVT_LIST_DELETE_ITEM(id, fn) { wxEVT_COMMAND_LIST_DELETE_ITEM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL },
|
||||
#define EVT_LIST_DELETE_ALL_ITEMS(id, fn) { wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL },
|
||||
#define EVT_LIST_GET_INFO(id, fn) { wxEVT_COMMAND_LIST_GET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL },
|
||||
#define EVT_LIST_SET_INFO(id, fn) { wxEVT_COMMAND_LIST_SET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL },
|
||||
#define EVT_LIST_ITEM_SELECTED(id, fn) { wxEVT_COMMAND_LIST_ITEM_SELECTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL },
|
||||
#define EVT_LIST_ITEM_DESELECTED(id, fn) { wxEVT_COMMAND_LIST_ITEM_DESELECTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL },
|
||||
#define EVT_LIST_KEY_DOWN(id, fn) { wxEVT_COMMAND_LIST_KEY_DOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL },
|
||||
#define EVT_LIST_INSERT_ITEM(id, fn) { wxEVT_COMMAND_LIST_INSERT_ITEM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL },
|
||||
#define EVT_LIST_COL_CLICK(id, fn) { wxEVT_COMMAND_LIST_COL_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL },
|
||||
|
||||
#endif
|
||||
// _WX_LISTCTRL_H_
|
167
include/wx/os2/mdi.h
Normal file
167
include/wx/os2/mdi.h
Normal file
@ -0,0 +1,167 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: mdi.h
|
||||
// Purpose: MDI (Multiple Document Interface) classes.
|
||||
// This doesn't have to be implemented just like Windows,
|
||||
// it could be a tabbed design as in wxGTK.
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_MDI_H_
|
||||
#define _WX_MDI_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "mdi.h"
|
||||
#endif
|
||||
|
||||
#include "wx/frame.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxFrameNameStr;
|
||||
WXDLLEXPORT_DATA(extern const char*) wxStatusLineNameStr;
|
||||
|
||||
class WXDLLEXPORT wxMDIClientWindow;
|
||||
class WXDLLEXPORT wxMDIChildFrame;
|
||||
|
||||
class WXDLLEXPORT wxMDIParentFrame: public wxFrame
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxMDIParentFrame)
|
||||
|
||||
friend class WXDLLEXPORT wxMDIChildFrame;
|
||||
public:
|
||||
|
||||
wxMDIParentFrame();
|
||||
inline wxMDIParentFrame(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, // Scrolling refers to client window
|
||||
const wxString& name = wxFrameNameStr)
|
||||
{
|
||||
Create(parent, id, title, pos, size, style, name);
|
||||
}
|
||||
|
||||
~wxMDIParentFrame();
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
|
||||
const wxString& name = wxFrameNameStr);
|
||||
|
||||
void OnSize(wxSizeEvent& event);
|
||||
void OnActivate(wxActivateEvent& event);
|
||||
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
||||
|
||||
void SetMenuBar(wxMenuBar *menu_bar);
|
||||
|
||||
// Gets the size available for subwindows after menu size, toolbar size
|
||||
// and status bar size have been subtracted. If you want to manage your own
|
||||
// toolbar(s), don't call SetToolBar.
|
||||
void GetClientSize(int *width, int *height) const;
|
||||
|
||||
// Get the active MDI child window (Windows only)
|
||||
wxMDIChildFrame *GetActiveChild() const ;
|
||||
|
||||
// Get the client window
|
||||
inline wxMDIClientWindow *GetClientWindow() const { return m_clientWindow; };
|
||||
|
||||
// Create the client window class (don't Create the window,
|
||||
// just return a new class)
|
||||
virtual wxMDIClientWindow *OnCreateClient() ;
|
||||
|
||||
// MDI operations
|
||||
virtual void Cascade();
|
||||
virtual void Tile();
|
||||
virtual void ArrangeIcons();
|
||||
virtual void ActivateNext();
|
||||
virtual void ActivatePrevious();
|
||||
|
||||
protected:
|
||||
|
||||
// TODO maybe have this member
|
||||
wxMDIClientWindow *m_clientWindow;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxMDIChildFrame: public wxFrame
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxMDIChildFrame)
|
||||
public:
|
||||
|
||||
wxMDIChildFrame();
|
||||
inline wxMDIChildFrame(wxMDIParentFrame *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxFrameNameStr)
|
||||
{
|
||||
Create(parent, id, title, pos, size, style, name);
|
||||
}
|
||||
|
||||
~wxMDIChildFrame();
|
||||
|
||||
bool Create(wxMDIParentFrame *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxFrameNameStr);
|
||||
|
||||
// Set menu bar
|
||||
void SetMenuBar(wxMenuBar *menu_bar);
|
||||
void SetClientSize(int width, int height);
|
||||
void GetPosition(int *x, int *y) const ;
|
||||
|
||||
// MDI operations
|
||||
virtual void Maximize();
|
||||
virtual void Restore();
|
||||
virtual void Activate();
|
||||
private:
|
||||
// Supress VA's hidden function warning
|
||||
void Maximize(bool maximize) {wxFrame::Maximize(maximize);}
|
||||
};
|
||||
|
||||
/* The client window is a child of the parent MDI frame, and itself
|
||||
* contains the child MDI frames.
|
||||
* However, you create the MDI children as children of the MDI parent:
|
||||
* only in the implementation does the client window become the parent
|
||||
* of the children. Phew! So the children are sort of 'adopted'...
|
||||
*/
|
||||
|
||||
class WXDLLEXPORT wxMDIClientWindow: public wxWindow
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxMDIClientWindow)
|
||||
public:
|
||||
|
||||
wxMDIClientWindow() ;
|
||||
inline wxMDIClientWindow(wxMDIParentFrame *parent, long style = 0)
|
||||
{
|
||||
CreateClient(parent, style);
|
||||
}
|
||||
|
||||
~wxMDIClientWindow();
|
||||
|
||||
// Note: this is virtual, to allow overridden behaviour.
|
||||
virtual bool CreateClient(wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL);
|
||||
|
||||
// Explicitly call default scroll behaviour
|
||||
void OnScroll(wxScrollEvent& event);
|
||||
|
||||
protected:
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_MDI_H_
|
172
include/wx/os2/menu.h
Normal file
172
include/wx/os2/menu.h
Normal file
@ -0,0 +1,172 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: menu.h
|
||||
// Purpose: wxMenu, wxMenuBar classes
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_MENU_H_
|
||||
#define _WX_MENU_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "menu.h"
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/event.h"
|
||||
|
||||
class WXDLLEXPORT wxMenuItem;
|
||||
class WXDLLEXPORT wxMenuBar;
|
||||
class WXDLLEXPORT wxMenu;
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxEmptyString;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Menu
|
||||
// ----------------------------------------------------------------------------
|
||||
class WXDLLEXPORT wxMenu: public wxEvtHandler
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxMenu)
|
||||
|
||||
public:
|
||||
// ctor & dtor
|
||||
wxMenu(const wxString& title = wxEmptyString, const wxFunction func = NULL);
|
||||
~wxMenu();
|
||||
|
||||
// construct menu
|
||||
// append items to the menu
|
||||
// separator line
|
||||
void AppendSeparator();
|
||||
// normal item
|
||||
void Append(int id, const wxString& Label, const wxString& helpString = wxEmptyString,
|
||||
bool checkable = FALSE);
|
||||
// a submenu
|
||||
void Append(int id, const wxString& Label, wxMenu *SubMenu,
|
||||
const wxString& helpString = wxEmptyString);
|
||||
// the most generic form (create wxMenuItem first and use it's functions)
|
||||
void Append(wxMenuItem *pItem);
|
||||
// insert a break in the menu
|
||||
void Break();
|
||||
// delete an item
|
||||
void Delete(int id);
|
||||
|
||||
// menu item control
|
||||
void Enable(int id, bool Flag);
|
||||
bool Enabled(int id) const;
|
||||
inline bool IsEnabled(int id) const { return Enabled(id); };
|
||||
void Check(int id, bool Flag);
|
||||
bool Checked(int id) const;
|
||||
inline bool IsChecked(int id) const { return IsChecked(id); };
|
||||
|
||||
// Client data
|
||||
inline void SetClientData(void* clientData) { m_clientData = clientData; }
|
||||
inline void* GetClientData() const { return m_clientData; }
|
||||
|
||||
void SetInvokingWindow(wxWindow *pWin) { m_pInvokingWindow = pWin; }
|
||||
wxWindow *GetInvokingWindow() const { return m_pInvokingWindow; }
|
||||
|
||||
// item properties
|
||||
// title
|
||||
void SetTitle(const wxString& label);
|
||||
const wxString GetTitle() const;
|
||||
// label
|
||||
void SetLabel(int id, const wxString& label);
|
||||
wxString GetLabel(int id) const;
|
||||
// help string
|
||||
virtual void SetHelpString(int id, const wxString& helpString);
|
||||
virtual wxString GetHelpString(int id) const ;
|
||||
|
||||
// find item
|
||||
// Finds the item id matching the given string, -1 if not found.
|
||||
virtual int FindItem(const wxString& itemString) const ;
|
||||
// Find wxMenuItem by ID, and item's menu too if itemMenu is !NULL.
|
||||
wxMenuItem *FindItemForId(int itemId, wxMenu **itemMenu = NULL) const;
|
||||
|
||||
void ProcessCommand(wxCommandEvent& event);
|
||||
inline void Callback(const wxFunction func) { m_callback = func; }
|
||||
|
||||
// Updates the UI for a menu and all submenus recursively.
|
||||
// source is the object that has the update event handlers
|
||||
// defined for it. If NULL, the menu or associated window
|
||||
// will be used.
|
||||
void UpdateUI(wxEvtHandler* source = (wxEvtHandler*) NULL);
|
||||
|
||||
virtual void SetParent(wxEvtHandler *parent) { m_parent = parent; }
|
||||
inline void SetEventHandler(wxEvtHandler *handler) { m_eventHandler = handler; }
|
||||
inline wxEvtHandler *GetEventHandler() { return m_eventHandler; }
|
||||
|
||||
inline wxList& GetItems() const { return (wxList&) m_menuItems; }
|
||||
|
||||
public:
|
||||
wxFunction m_callback;
|
||||
|
||||
int m_noItems;
|
||||
wxString m_title;
|
||||
wxMenuBar * m_menuBar;
|
||||
wxList m_menuItems;
|
||||
wxEvtHandler * m_parent;
|
||||
wxEvtHandler * m_eventHandler;
|
||||
void* m_clientData;
|
||||
wxWindow* m_pInvokingWindow;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Menu Bar (a la Windows)
|
||||
// ----------------------------------------------------------------------------
|
||||
class WXDLLEXPORT wxFrame;
|
||||
class WXDLLEXPORT wxMenuBar: public wxEvtHandler
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxMenuBar)
|
||||
|
||||
wxMenuBar();
|
||||
wxMenuBar(int n, wxMenu *menus[], const wxString titles[]);
|
||||
~wxMenuBar();
|
||||
|
||||
void Append(wxMenu *menu, const wxString& title);
|
||||
// Must only be used AFTER menu has been attached to frame,
|
||||
// otherwise use individual menus to enable/disable items
|
||||
void Enable(int Id, bool Flag);
|
||||
bool Enabled(int Id) const ;
|
||||
inline bool IsEnabled(int Id) const { return Enabled(Id); };
|
||||
void EnableTop(int pos, bool Flag);
|
||||
void Check(int id, bool Flag);
|
||||
bool Checked(int id) const ;
|
||||
inline bool IsChecked(int Id) const { return Checked(Id); };
|
||||
void SetLabel(int id, const wxString& label) ;
|
||||
wxString GetLabel(int id) const ;
|
||||
void SetLabelTop(int pos, const wxString& label) ;
|
||||
wxString GetLabelTop(int pos) const ;
|
||||
virtual void Delete(wxMenu *menu, int index = 0); /* Menu not destroyed */
|
||||
virtual bool OnAppend(wxMenu *menu, const char *title);
|
||||
virtual bool OnDelete(wxMenu *menu, int index);
|
||||
|
||||
virtual void SetHelpString(int Id, const wxString& helpString);
|
||||
virtual wxString GetHelpString(int Id) const ;
|
||||
|
||||
virtual int FindMenuItem(const wxString& menuString, const wxString& itemString) const ;
|
||||
|
||||
// Find wxMenuItem for item ID, and return item's
|
||||
// menu too if itemMenu is non-NULL.
|
||||
wxMenuItem *FindItemForId(int itemId, wxMenu **menuForItem = NULL) const ;
|
||||
|
||||
inline void SetEventHandler(wxEvtHandler *handler) { m_eventHandler = handler; }
|
||||
inline wxEvtHandler *GetEventHandler() { return m_eventHandler; }
|
||||
|
||||
inline int GetMenuCount() const { return m_menuCount; }
|
||||
inline wxMenu* GetMenu(int i) const { return m_menus[i]; }
|
||||
|
||||
public:
|
||||
wxEvtHandler * m_eventHandler;
|
||||
int m_menuCount;
|
||||
wxMenu ** m_menus;
|
||||
wxString * m_titles;
|
||||
wxFrame * m_menuBarFrame;
|
||||
/* TODO: data that represents the actual menubar when created.
|
||||
*/
|
||||
};
|
||||
|
||||
#endif // _WX_MENU_H_
|
95
include/wx/os2/menuitem.h
Normal file
95
include/wx/os2/menuitem.h
Normal file
@ -0,0 +1,95 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: menuitem.h
|
||||
// Purpose: wxMenuItem class
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 11.11.97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
||||
// Licence: wxWindows license
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _MENUITEM_H
|
||||
#define _MENUITEM_H
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "menuitem.h"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#include "wx/setup.h"
|
||||
|
||||
// an exception to the general rule that a normal header doesn't include other
|
||||
// headers - only because ownerdrw.h is not always included and I don't want
|
||||
// to write #ifdef's everywhere...
|
||||
#if wxUSE_OWNER_DRAWN
|
||||
#include "wx/ownerdrw.h"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// constants
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// id for a separator line in the menu (invalid for normal item)
|
||||
#define ID_SEPARATOR (-1)
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxMenuItem: an item in the menu, optionally implements owner-drawn behaviour
|
||||
// ----------------------------------------------------------------------------
|
||||
class WXDLLEXPORT wxMenuItem: public wxObject
|
||||
#if wxUSE_OWNER_DRAWN
|
||||
, public wxOwnerDrawn
|
||||
#endif
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxMenuItem)
|
||||
|
||||
public:
|
||||
// ctor & dtor
|
||||
wxMenuItem(wxMenu *pParentMenu = NULL, int id = ID_SEPARATOR,
|
||||
const wxString& strName = "", const wxString& wxHelp = "",
|
||||
bool bCheckable = FALSE, wxMenu *pSubMenu = NULL);
|
||||
virtual ~wxMenuItem();
|
||||
|
||||
// accessors (some more are inherited from wxOwnerDrawn or are below)
|
||||
bool IsSeparator() const { return m_idItem == ID_SEPARATOR; }
|
||||
bool IsEnabled() const { return m_bEnabled; }
|
||||
bool IsChecked() const { return m_bChecked; }
|
||||
|
||||
int GetId() const { return m_idItem; }
|
||||
const wxString& GetHelp() const { return m_strHelp; }
|
||||
wxMenu *GetSubMenu() const { return m_pSubMenu; }
|
||||
|
||||
// operations
|
||||
void SetName(const wxString& strName) { m_strName = strName; }
|
||||
void SetHelp(const wxString& strHelp) { m_strHelp = strHelp; }
|
||||
|
||||
void Enable(bool bDoEnable = TRUE);
|
||||
void Check(bool bDoCheck = TRUE);
|
||||
|
||||
void DeleteSubMenu();
|
||||
|
||||
private:
|
||||
int m_idItem; // numeric id of the item
|
||||
wxString m_strHelp; // associated help string
|
||||
wxMenu *m_pSubMenu, // may be NULL
|
||||
*m_pParentMenu; // menu this item is contained in
|
||||
bool m_bEnabled, // enabled or greyed?
|
||||
m_bChecked; // checked? (only if checkable)
|
||||
|
||||
#if wxUSE_OWNER_DRAWN
|
||||
// wxOwnerDrawn base class already has these variables - nothing to do
|
||||
|
||||
#else //!owner drawn
|
||||
bool m_bCheckable; // can be checked?
|
||||
wxString m_strName; // name or label of the item
|
||||
|
||||
public:
|
||||
const wxString& GetName() const { return m_strName; }
|
||||
bool IsCheckable() const { return m_bCheckable; }
|
||||
#endif //owner drawn
|
||||
};
|
||||
|
||||
#endif //_MENUITEM_H
|
101
include/wx/os2/metafile.h
Normal file
101
include/wx/os2/metafile.h
Normal file
@ -0,0 +1,101 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: metafile.h
|
||||
// Purpose: wxMetaFile, wxMetaFileDC classes.
|
||||
// This probably should be restricted to Windows platforms,
|
||||
// but if there is an equivalent on your platform, great.
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
#ifndef _WX_METAFIILE_H_
|
||||
#define _WX_METAFIILE_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "metafile.h"
|
||||
#endif
|
||||
|
||||
#include "wx/setup.h"
|
||||
|
||||
/*
|
||||
* Metafile and metafile device context classes - work in Windows 3.1 only
|
||||
*
|
||||
*/
|
||||
|
||||
class WXDLLEXPORT wxDC;
|
||||
class WXDLLEXPORT wxMetaFile: public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxMetaFile)
|
||||
public:
|
||||
wxMetaFile(const wxString& file = "");
|
||||
~wxMetaFile();
|
||||
|
||||
// After this is called, the metafile cannot be used for anything
|
||||
// since it is now owned by the clipboard.
|
||||
virtual bool SetClipboard(int width = 0, int height = 0);
|
||||
|
||||
virtual bool Play(wxDC *dc);
|
||||
// TODO
|
||||
inline bool Ok() { return FALSE; };
|
||||
|
||||
/* TODO: Implementation
|
||||
inline WXHANDLE GetHMETAFILE() { return m_metaFile; }
|
||||
inline void SetHMETAFILE(WXHANDLE mf) { m_metaFile = mf; }
|
||||
|
||||
protected:
|
||||
WXHANDLE m_metaFile;
|
||||
*/
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxMetaFileDC: public wxDC
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxMetaFileDC)
|
||||
|
||||
public:
|
||||
// Don't supply origin and extent
|
||||
// Supply them to wxMakeMetaFilePlaceable instead.
|
||||
wxMetaFileDC(const wxString& file = "");
|
||||
|
||||
// Supply origin and extent (recommended).
|
||||
// Then don't need to supply them to wxMakeMetaFilePlaceable.
|
||||
wxMetaFileDC(const wxString& file, int xext, int yext, int xorg, int yorg);
|
||||
|
||||
~wxMetaFileDC();
|
||||
|
||||
// Should be called at end of drawing
|
||||
virtual wxMetaFile *Close();
|
||||
virtual void SetMapMode(int mode);
|
||||
virtual void GetTextExtent(const wxString& string, float *x, float *y,
|
||||
float *descent = NULL, float *externalLeading = NULL,
|
||||
wxFont *theFont = NULL, bool use16bit = FALSE);
|
||||
|
||||
// Implementation
|
||||
inline wxMetaFile *GetMetaFile() { return m_metaFile; }
|
||||
inline void SetMetaFile(wxMetaFile *mf) { m_metaFile = mf; }
|
||||
inline int GetWindowsMappingMode() { return m_windowsMappingMode; }
|
||||
inline void SetWindowsMappingMode(int mm) { m_windowsMappingMode = mm; }
|
||||
|
||||
protected:
|
||||
int m_windowsMappingMode;
|
||||
wxMetaFile *m_metaFile;
|
||||
};
|
||||
|
||||
/*
|
||||
* Pass filename of existing non-placeable metafile, and bounding box.
|
||||
* Adds a placeable metafile header, sets the mapping mode to anisotropic,
|
||||
* and sets the window origin and extent to mimic the wxMM_TEXT mapping mode.
|
||||
*
|
||||
*/
|
||||
|
||||
// No origin or extent
|
||||
bool WXDLLEXPORT wxMakeMetaFilePlaceable(const wxString& filename, float scale = 1.0);
|
||||
|
||||
// Optional origin and extent
|
||||
bool WXDLLEXPORT wxMakeMetaFilePlaceable(const wxString& filename, int x1, int y1, int x2, int y2, float scale = 1.0, bool useOriginAndExtent = TRUE);
|
||||
|
||||
#endif
|
||||
// _WX_METAFIILE_H_
|
46
include/wx/os2/minifram.h
Normal file
46
include/wx/os2/minifram.h
Normal file
@ -0,0 +1,46 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: minifram.h
|
||||
// Purpose: wxMiniFrame class. A small frame for e.g. floating toolbars.
|
||||
// If there is no equivalent on your platform, just make it a
|
||||
// normal frame.
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_MINIFRAM_H_
|
||||
#define _WX_MINIFRAM_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "minifram.h"
|
||||
#endif
|
||||
|
||||
#include "wx/frame.h"
|
||||
|
||||
class WXDLLEXPORT wxMiniFrame: public wxFrame {
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxMiniFrame)
|
||||
|
||||
public:
|
||||
inline wxMiniFrame() {}
|
||||
inline wxMiniFrame(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE|wxTINY_CAPTION_HORIZ,
|
||||
const wxString& name = wxFrameNameStr)
|
||||
{
|
||||
// Use wxFrame constructor in absence of more specific code.
|
||||
Create(parent, id, title, pos, size, style, name);
|
||||
}
|
||||
|
||||
~wxMiniFrame() {}
|
||||
protected:
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_MINIFRAM_H_
|
50
include/wx/os2/msgdlg.h
Normal file
50
include/wx/os2/msgdlg.h
Normal file
@ -0,0 +1,50 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: msgdlg.h
|
||||
// Purpose: wxMessageDialog class. Use generic version if no
|
||||
// platform-specific implementation.
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_MSGBOXDLG_H_
|
||||
#define _WX_MSGBOXDLG_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "msgdlg.h"
|
||||
#endif
|
||||
|
||||
#include "wx/setup.h"
|
||||
#include "wx/dialog.h"
|
||||
|
||||
/*
|
||||
* Message box dialog
|
||||
*/
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxMessageBoxCaptionStr;
|
||||
|
||||
class WXDLLEXPORT wxMessageDialog: public wxDialog
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxMessageDialog)
|
||||
protected:
|
||||
wxString m_caption;
|
||||
wxString m_message;
|
||||
long m_dialogStyle;
|
||||
wxWindow * m_parent;
|
||||
public:
|
||||
wxMessageDialog(wxWindow *parent, const wxString& message, const wxString& caption = wxMessageBoxCaptionStr,
|
||||
long style = wxOK|wxCENTRE, const wxPoint& pos = wxDefaultPosition);
|
||||
|
||||
int ShowModal();
|
||||
};
|
||||
|
||||
|
||||
int WXDLLEXPORT wxMessageBox(const wxString& message, const wxString& caption = wxMessageBoxCaptionStr,
|
||||
long style = wxOK|wxCENTRE,
|
||||
wxWindow *parent = NULL, int x = -1, int y = -1);
|
||||
|
||||
#endif
|
||||
// _WX_MSGBOXDLG_H_
|
209
include/wx/os2/notebook.h
Normal file
209
include/wx/os2/notebook.h
Normal file
@ -0,0 +1,209 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: notebook.h
|
||||
// Purpose: MSW/GTK compatible notebook (a.k.a. property sheet)
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_NOTEBOOK_H_
|
||||
#define _WX_NOTEBOOK_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "notebook.h"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
#include "wx/dynarray.h"
|
||||
#include "wx/event.h"
|
||||
#include "wx/control.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// types
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// fwd declarations
|
||||
class WXDLLEXPORT wxImageList;
|
||||
class WXDLLEXPORT wxWindow;
|
||||
|
||||
// array of notebook pages
|
||||
typedef wxWindow wxNotebookPage; // so far, any window can be a page
|
||||
WX_DEFINE_ARRAY(wxNotebookPage *, wxArrayPages);
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// notebook events
|
||||
// ----------------------------------------------------------------------------
|
||||
class WXDLLEXPORT wxNotebookEvent : public wxCommandEvent
|
||||
{
|
||||
public:
|
||||
wxNotebookEvent(wxEventType commandType = wxEVT_NULL, int id = 0,
|
||||
int nSel = -1, int nOldSel = -1)
|
||||
: wxCommandEvent(commandType, id) { m_nSel = nSel; m_nOldSel = nOldSel; }
|
||||
|
||||
// accessors
|
||||
int GetSelection() const { return m_nSel; }
|
||||
int GetOldSelection() const { return m_nOldSel; }
|
||||
|
||||
private:
|
||||
int m_nSel, // currently selected page
|
||||
m_nOldSel; // previously selected page
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxNotebookEvent)
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxNotebook
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// @@@ this class should really derive from wxTabCtrl, but the interface is not
|
||||
// exactly the same, so I can't do it right now and instead we reimplement
|
||||
// part of wxTabCtrl here
|
||||
class wxNotebook : public wxControl
|
||||
{
|
||||
public:
|
||||
// ctors
|
||||
// -----
|
||||
// default for dynamic class
|
||||
wxNotebook();
|
||||
// the same arguments as for wxControl (@@@ any special styles?)
|
||||
wxNotebook(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = "notebook");
|
||||
// Create() function
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = "notebook");
|
||||
// dtor
|
||||
~wxNotebook();
|
||||
|
||||
// accessors
|
||||
// ---------
|
||||
// get number of pages in the dialog
|
||||
int GetPageCount() const;
|
||||
|
||||
// set the currently selected page, return the index of the previously
|
||||
// selected one (or -1 on error)
|
||||
// NB: this function will _not_ generate wxEVT_NOTEBOOK_PAGE_xxx events
|
||||
int SetSelection(int nPage);
|
||||
// cycle thru the tabs
|
||||
void AdvanceSelection(bool bForward = TRUE);
|
||||
// get the currently selected page
|
||||
int GetSelection() const { return m_nSelection; }
|
||||
|
||||
// set/get the title of a page
|
||||
bool SetPageText(int nPage, const wxString& strText);
|
||||
wxString GetPageText(int nPage) const;
|
||||
|
||||
// image list stuff: each page may have an image associated with it. All
|
||||
// the images belong to an image list, so you have to
|
||||
// 1) create an image list
|
||||
// 2) associate it with the notebook
|
||||
// 3) set for each page it's image
|
||||
// associate image list with a control
|
||||
void SetImageList(wxImageList* imageList);
|
||||
// get pointer (may be NULL) to the associated image list
|
||||
wxImageList* GetImageList() const { return m_pImageList; }
|
||||
|
||||
// sets/returns item's image index in the current image list
|
||||
int GetPageImage(int nPage) const;
|
||||
bool SetPageImage(int nPage, int nImage);
|
||||
|
||||
// currently it's always 1 because wxGTK doesn't support multi-row
|
||||
// tab controls
|
||||
int GetRowCount() const;
|
||||
|
||||
// control the appearance of the notebook pages
|
||||
// set the size (the same for all pages)
|
||||
void SetPageSize(const wxSize& size);
|
||||
// set the padding between tabs (in pixels)
|
||||
void SetPadding(const wxSize& padding);
|
||||
|
||||
// Sets the size of the tabs (assumes all tabs are the same size)
|
||||
void SetTabSize(const wxSize& sz);
|
||||
|
||||
// operations
|
||||
// ----------
|
||||
// remove one page from the notebook
|
||||
bool DeletePage(int nPage);
|
||||
// remove one page from the notebook, without deleting
|
||||
bool RemovePage(int nPage);
|
||||
// remove all pages
|
||||
bool DeleteAllPages();
|
||||
// adds a new page to the notebook (it will be deleted ny the notebook,
|
||||
// don't delete it yourself). If bSelect, this page becomes active.
|
||||
bool AddPage(wxNotebookPage *pPage,
|
||||
const wxString& strText,
|
||||
bool bSelect = FALSE,
|
||||
int imageId = -1);
|
||||
// the same as AddPage(), but adds it at the specified position
|
||||
bool InsertPage(int nPage,
|
||||
wxNotebookPage *pPage,
|
||||
const wxString& strText,
|
||||
bool bSelect = FALSE,
|
||||
int imageId = -1);
|
||||
// get the panel which represents the given page
|
||||
wxNotebookPage *GetPage(int nPage) { return m_aPages[nPage]; }
|
||||
|
||||
// callbacks
|
||||
// ---------
|
||||
void OnSize(wxSizeEvent& event);
|
||||
void OnSelChange(wxNotebookEvent& event);
|
||||
void OnSetFocus(wxFocusEvent& event);
|
||||
void OnNavigationKey(wxNavigationKeyEvent& event);
|
||||
|
||||
// base class virtuals
|
||||
// -------------------
|
||||
virtual void Command(wxCommandEvent& event);
|
||||
virtual void SetConstraintSizes(bool recurse = TRUE);
|
||||
virtual bool DoPhase(int nPhase);
|
||||
|
||||
protected:
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
||||
// helper functions
|
||||
void ChangePage(int nOldSel, int nSel); // change pages
|
||||
|
||||
wxImageList *m_pImageList; // we can have an associated image list
|
||||
wxArrayPages m_aPages; // array of pages
|
||||
|
||||
int m_nSelection; // the current selection (-1 if none)
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxNotebook)
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// event macros
|
||||
// ----------------------------------------------------------------------------
|
||||
typedef void (wxEvtHandler::*wxNotebookEventFunction)(wxNotebookEvent&);
|
||||
|
||||
#define EVT_NOTEBOOK_PAGE_CHANGED(id, fn) \
|
||||
{ \
|
||||
wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, \
|
||||
id, \
|
||||
-1, \
|
||||
(wxObjectEventFunction)(wxEventFunction)(wxNotebookEventFunction) &fn, \
|
||||
NULL \
|
||||
},
|
||||
|
||||
#define EVT_NOTEBOOK_PAGE_CHANGING(id, fn) \
|
||||
{ \
|
||||
wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, \ \
|
||||
id, \
|
||||
-1, \
|
||||
(wxObjectEventFunction)(wxEventFunction)(wxNotebookEventFunction) &fn, \
|
||||
NULL \
|
||||
},
|
||||
|
||||
#endif // _WX_NOTEBOOK_H_
|
64
include/wx/os2/palette.h
Normal file
64
include/wx/os2/palette.h
Normal file
@ -0,0 +1,64 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: palette.h
|
||||
// Purpose: wxPalette class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_PALETTE_H_
|
||||
#define _WX_PALETTE_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "palette.h"
|
||||
#endif
|
||||
|
||||
#include "wx/gdiobj.h"
|
||||
|
||||
class WXDLLEXPORT wxPalette;
|
||||
|
||||
class WXDLLEXPORT wxPaletteRefData: public wxGDIRefData
|
||||
{
|
||||
friend class WXDLLEXPORT wxPalette;
|
||||
public:
|
||||
wxPaletteRefData();
|
||||
~wxPaletteRefData();
|
||||
/* TODO: implementation
|
||||
protected:
|
||||
WXHPALETTE m_hPalette;
|
||||
*/
|
||||
};
|
||||
|
||||
#define M_PALETTEDATA ((wxPaletteRefData *)m_refData)
|
||||
|
||||
class WXDLLEXPORT wxPalette: public wxGDIObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxPalette)
|
||||
|
||||
public:
|
||||
wxPalette();
|
||||
inline wxPalette(const wxPalette& palette) { Ref(palette); }
|
||||
|
||||
wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
|
||||
~wxPalette();
|
||||
bool Create(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
|
||||
int GetPixel(const unsigned char red, const unsigned char green, const unsigned char blue) const;
|
||||
bool GetRGB(int pixel, unsigned char *red, unsigned char *green, unsigned char *blue) const;
|
||||
|
||||
virtual bool Ok() const { return (m_refData != NULL) ; }
|
||||
|
||||
inline wxPalette& operator = (const wxPalette& palette) { if (*this == palette) return (*this); Ref(palette); return *this; }
|
||||
inline bool operator == (const wxPalette& palette) { return m_refData == palette.m_refData; }
|
||||
inline bool operator != (const wxPalette& palette) { return m_refData != palette.m_refData; }
|
||||
|
||||
/* TODO: implementation
|
||||
inline WXHPALETTE GetHPALETTE() const { return (M_PALETTEDATA ? M_PALETTEDATA->m_hPalette : 0); }
|
||||
void SetHPALETTE(WXHPALETTE pal);
|
||||
*/
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_PALETTE_H_
|
101
include/wx/os2/pen.h
Normal file
101
include/wx/os2/pen.h
Normal file
@ -0,0 +1,101 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: pen.h
|
||||
// Purpose: wxPen class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_PEN_H_
|
||||
#define _WX_PEN_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "pen.h"
|
||||
#endif
|
||||
|
||||
#include "wx/gdiobj.h"
|
||||
#include "wx/colour.h"
|
||||
#include "wx/bitmap.h"
|
||||
|
||||
typedef long wxDash ;
|
||||
|
||||
class WXDLLEXPORT wxPen;
|
||||
|
||||
class WXDLLEXPORT wxPenRefData: public wxGDIRefData
|
||||
{
|
||||
friend class WXDLLEXPORT wxPen;
|
||||
public:
|
||||
wxPenRefData();
|
||||
wxPenRefData(const wxPenRefData& data);
|
||||
~wxPenRefData();
|
||||
|
||||
protected:
|
||||
int m_width;
|
||||
int m_style;
|
||||
int m_join ;
|
||||
int m_cap ;
|
||||
wxBitmap m_stipple ;
|
||||
int m_nbDash ;
|
||||
wxDash * m_dash ;
|
||||
wxColour m_colour;
|
||||
/* TODO: implementation
|
||||
WXHPEN m_hPen;
|
||||
*/
|
||||
};
|
||||
|
||||
#define M_PENDATA ((wxPenRefData *)m_refData)
|
||||
|
||||
// Pen
|
||||
class WXDLLEXPORT wxPen: public wxGDIObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxPen)
|
||||
public:
|
||||
wxPen();
|
||||
wxPen(const wxColour& col, int width, int style);
|
||||
wxPen(const wxBitmap& stipple, int width);
|
||||
inline wxPen(const wxPen& pen) { Ref(pen); }
|
||||
~wxPen();
|
||||
|
||||
inline wxPen& operator = (const wxPen& pen) { if (*this == pen) return (*this); Ref(pen); return *this; }
|
||||
inline bool operator == (const wxPen& pen) { return m_refData == pen.m_refData; }
|
||||
inline bool operator != (const wxPen& pen) { return m_refData != pen.m_refData; }
|
||||
|
||||
virtual bool Ok() const { return (m_refData != NULL) ; }
|
||||
|
||||
// Override in order to recreate the pen
|
||||
void SetColour(const wxColour& col) ;
|
||||
void SetColour(unsigned char r, unsigned char g, unsigned char b) ;
|
||||
|
||||
void SetWidth(int width) ;
|
||||
void SetStyle(int style) ;
|
||||
void SetStipple(const wxBitmap& stipple) ;
|
||||
void SetDashes(int nb_dashes, const wxDash *dash) ;
|
||||
void SetJoin(int join) ;
|
||||
void SetCap(int cap) ;
|
||||
|
||||
inline wxColour& GetColour() const { return (M_PENDATA ? M_PENDATA->m_colour : wxNullColour); };
|
||||
inline int GetWidth() const { return (M_PENDATA ? M_PENDATA->m_width : 0); };
|
||||
inline int GetStyle() const { return (M_PENDATA ? M_PENDATA->m_style : 0); };
|
||||
inline int GetJoin() const { return (M_PENDATA ? M_PENDATA->m_join : 0); };
|
||||
inline int GetCap() const { return (M_PENDATA ? M_PENDATA->m_cap : 0); };
|
||||
inline int GetDashes(wxDash **ptr) const {
|
||||
*ptr = (M_PENDATA ? M_PENDATA->m_dash : (wxDash*) NULL); return (M_PENDATA ? M_PENDATA->m_nbDash : 0);
|
||||
}
|
||||
|
||||
inline wxBitmap *GetStipple() const { return (M_PENDATA ? (& M_PENDATA->m_stipple) : (wxBitmap*) NULL); };
|
||||
|
||||
// Implementation
|
||||
|
||||
// Useful helper: create the brush resource
|
||||
bool RealizeResource();
|
||||
|
||||
// When setting properties, we must make sure we're not changing
|
||||
// another object
|
||||
void Unshare();
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_PEN_H_
|
56
include/wx/os2/print.h
Normal file
56
include/wx/os2/print.h
Normal file
@ -0,0 +1,56 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: print.h
|
||||
// Purpose: wxPrinter, wxPrintPreview classes
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_PRINT_H_
|
||||
#define _WX_PRINT_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "print.h"
|
||||
#endif
|
||||
|
||||
#include "wx/prntbase.h"
|
||||
|
||||
/*
|
||||
* Represents the printer: manages printing a wxPrintout object
|
||||
*/
|
||||
|
||||
class WXDLLEXPORT wxPrinter: public wxPrinterBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxPrinter)
|
||||
|
||||
public:
|
||||
wxPrinter(wxPrintData *data = NULL);
|
||||
~wxPrinter();
|
||||
|
||||
virtual bool Print(wxWindow *parent, wxPrintout *printout, bool prompt = TRUE);
|
||||
virtual bool PrintDialog(wxWindow *parent);
|
||||
virtual bool Setup(wxWindow *parent);
|
||||
};
|
||||
|
||||
/*
|
||||
* wxPrintPreview
|
||||
* Programmer creates an object of this class to preview a wxPrintout.
|
||||
*/
|
||||
|
||||
class WXDLLEXPORT wxPrintPreview: public wxPrintPreviewBase
|
||||
{
|
||||
DECLARE_CLASS(wxPrintPreview)
|
||||
|
||||
public:
|
||||
wxPrintPreview(wxPrintout *printout, wxPrintout *printoutForPrinting = NULL, wxPrintData *data = NULL);
|
||||
~wxPrintPreview();
|
||||
|
||||
virtual bool Print(bool interactive);
|
||||
virtual void DetermineScaling();
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_PRINT_H_
|
74
include/wx/os2/printdlg.h
Normal file
74
include/wx/os2/printdlg.h
Normal file
@ -0,0 +1,74 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: printdlg.h
|
||||
// Purpose: wxPrintDialog, wxPageSetupDialog classes.
|
||||
// Use generic, PostScript version if no
|
||||
// platform-specific implementation.
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_PRINTDLG_H_
|
||||
#define _WX_PRINTDLG_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "printdlg.h"
|
||||
#endif
|
||||
|
||||
#include "wx/dialog.h"
|
||||
#include "wx/cmndata.h"
|
||||
|
||||
/*
|
||||
* wxPrinterDialog
|
||||
* The common dialog for printing.
|
||||
*/
|
||||
|
||||
class WXDLLEXPORT wxDC;
|
||||
class WXDLLEXPORT wxPrintDialog: public wxDialog
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxPrintDialog)
|
||||
|
||||
public:
|
||||
wxPrintDialog();
|
||||
wxPrintDialog(wxWindow *parent, wxPrintDialogData* data = NULL);
|
||||
wxPrintDialog(wxWindow *parent, wxPrintData* data);
|
||||
~wxPrintDialog();
|
||||
|
||||
bool Create(wxWindow *parent, wxPrintData* data = NULL);
|
||||
virtual int ShowModal();
|
||||
|
||||
wxPrintDialogData& GetPrintDialogData() { return m_printDialogData; }
|
||||
inline wxPrintData& GetPrintData() { return m_printDialogData.GetPrintData(); }
|
||||
virtual wxDC *GetPrintDC();
|
||||
|
||||
private:
|
||||
wxPrintDialogData m_printDialogData;
|
||||
wxDC* m_printerDC;
|
||||
bool m_destroyDC;
|
||||
wxWindow* m_dialogParent;
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxPageSetupDialog: public wxDialog
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxPageSetupDialog)
|
||||
|
||||
public:
|
||||
wxPageSetupDialog();
|
||||
wxPageSetupDialog(wxWindow *parent, wxPageSetupData *data = NULL);
|
||||
~wxPageSetupDialog();
|
||||
|
||||
bool Create(wxWindow *parent, wxPageSetupData *data = NULL);
|
||||
virtual int ShowModal();
|
||||
|
||||
inline wxPageSetupData& GetPageSetupData() { return m_pageSetupData; }
|
||||
|
||||
private:
|
||||
wxPageSetupData m_pageSetupData;
|
||||
wxWindow* m_dialogParent;
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_PRINTDLG_H_
|
21
include/wx/os2/private.h
Normal file
21
include/wx/os2/private.h
Normal file
@ -0,0 +1,21 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: private.h
|
||||
// Purpose: Private declarations
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_PRIVATE_H_
|
||||
#define _WX_PRIVATE_H_
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
/* TODO: put any private declarations here.
|
||||
*/
|
||||
|
||||
#endif
|
||||
// _WX_PRIVATE_H_
|
124
include/wx/os2/radiobox.h
Normal file
124
include/wx/os2/radiobox.h
Normal file
@ -0,0 +1,124 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: radiobox.h
|
||||
// Purpose: wxRadioBox class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_RADIOBOX_H_
|
||||
#define _WX_RADIOBOX_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "radiobox.h"
|
||||
#endif
|
||||
|
||||
#include "wx/control.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxRadioBoxNameStr;
|
||||
|
||||
// List box item
|
||||
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,
|
||||
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
int n = 0, const wxString choices[] = NULL,
|
||||
int majorDim = 0, long style = wxRA_HORIZONTAL,
|
||||
const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr)
|
||||
{
|
||||
Create(parent, id, title, pos, size, n, choices, majorDim, style, val, name);
|
||||
}
|
||||
|
||||
~wxRadioBox();
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id, const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
int n = 0, const wxString choices[] = NULL,
|
||||
int majorDim = 0, long style = wxRA_HORIZONTAL,
|
||||
const 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 GetSize(int *x, int *y) const;
|
||||
void GetPosition(int *x, int *y) const;
|
||||
|
||||
void SetLabel(int item, const wxString& label);
|
||||
void SetLabel(int item, wxBitmap *bitmap);
|
||||
wxString GetLabel(int item) const;
|
||||
bool Show(bool show);
|
||||
void SetFocus();
|
||||
bool Enable(bool enable);
|
||||
void Enable(int item, bool enable);
|
||||
void Show(int item, bool show);
|
||||
void SetLabelFont(const wxFont& WXUNUSED(font)) {};
|
||||
void SetButtonFont(const wxFont& font) { SetFont(font); }
|
||||
|
||||
virtual wxString GetStringSelection() const;
|
||||
virtual bool SetStringSelection(const wxString& s);
|
||||
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;
|
||||
|
||||
protected:
|
||||
void SubclassRadioButton(WXHWND hWndBtn);
|
||||
|
||||
WXHWND * m_radioButtons;
|
||||
int m_majorDim;
|
||||
int * m_radioWidth; // for bitmaps
|
||||
int * m_radioHeight;
|
||||
|
||||
int m_noItems;
|
||||
int m_noRowsOrCols;
|
||||
int m_selectedButton;
|
||||
|
||||
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
|
||||
// _WX_RADIOBOX_H_
|
90
include/wx/os2/radiobut.h
Normal file
90
include/wx/os2/radiobut.h
Normal file
@ -0,0 +1,90 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: radiobut.h
|
||||
// Purpose: wxRadioButton class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_RADIOBUT_H_
|
||||
#define _WX_RADIOBUT_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "radiobut.h"
|
||||
#endif
|
||||
|
||||
#include "wx/control.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxRadioButtonNameStr;
|
||||
|
||||
class WXDLLEXPORT wxRadioButton: public wxControl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxRadioButton)
|
||||
protected:
|
||||
public:
|
||||
inline wxRadioButton() {}
|
||||
inline wxRadioButton(wxWindow *parent, wxWindowID id,
|
||||
const wxString& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxRadioButtonNameStr)
|
||||
{
|
||||
Create(parent, id, label, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
const wxString& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxRadioButtonNameStr);
|
||||
|
||||
virtual void SetLabel(const wxString& label);
|
||||
virtual void SetValue(bool val);
|
||||
virtual bool GetValue() const ;
|
||||
|
||||
void Command(wxCommandEvent& event);
|
||||
};
|
||||
|
||||
// Not implemented
|
||||
#if 0
|
||||
class WXDLLEXPORT wxBitmap ;
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxBitmapRadioButtonNameStr;
|
||||
|
||||
class WXDLLEXPORT wxBitmapRadioButton: public wxRadioButton
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxBitmapRadioButton)
|
||||
protected:
|
||||
wxBitmap *theButtonBitmap;
|
||||
public:
|
||||
inline wxBitmapRadioButton() { theButtonBitmap = NULL; }
|
||||
inline wxBitmapRadioButton(wxWindow *parent, wxWindowID id,
|
||||
const wxBitmap *label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxBitmapRadioButtonNameStr)
|
||||
{
|
||||
Create(parent, id, label, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
const wxBitmap *label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxBitmapRadioButtonNameStr);
|
||||
|
||||
virtual void SetLabel(const wxBitmap *label);
|
||||
virtual void SetValue(bool val) ;
|
||||
virtual bool GetValue() const ;
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// _WX_RADIOBUT_H_
|
137
include/wx/os2/region.h
Normal file
137
include/wx/os2/region.h
Normal file
@ -0,0 +1,137 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: region.h
|
||||
// Purpose: wxRegion class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_REGION_H_
|
||||
#define _WX_REGION_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "region.h"
|
||||
#endif
|
||||
|
||||
#include "wx/list.h"
|
||||
#include "wx/gdiobj.h"
|
||||
#include "wx/gdicmn.h"
|
||||
|
||||
class WXDLLEXPORT wxRect;
|
||||
class WXDLLEXPORT wxPoint;
|
||||
|
||||
enum wxRegionContain {
|
||||
wxOutRegion = 0, wxPartRegion = 1, wxInRegion = 2
|
||||
};
|
||||
|
||||
// So far, for internal use only
|
||||
enum wxRegionOp {
|
||||
wxRGN_AND, // Creates the intersection of the two combined regions.
|
||||
wxRGN_COPY, // Creates a copy of the region identified by hrgnSrc1.
|
||||
wxRGN_DIFF, // Combines the parts of hrgnSrc1 that are not part of hrgnSrc2.
|
||||
wxRGN_OR, // Creates the union of two combined regions.
|
||||
wxRGN_XOR // Creates the union of two combined regions except for any overlapping areas.
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxRegion : public wxGDIObject {
|
||||
DECLARE_DYNAMIC_CLASS(wxRegion);
|
||||
friend class WXDLLEXPORT wxRegionIterator;
|
||||
public:
|
||||
wxRegion(long x, long y, long w, long h);
|
||||
wxRegion(const wxPoint& topLeft, const wxPoint& bottomRight);
|
||||
wxRegion(const wxRect& rect);
|
||||
wxRegion();
|
||||
~wxRegion();
|
||||
|
||||
//# Copying
|
||||
inline wxRegion(const wxRegion& r)
|
||||
{ Ref(r); }
|
||||
inline wxRegion& operator = (const wxRegion& r)
|
||||
{ Ref(r); return (*this); }
|
||||
|
||||
//# Modify region
|
||||
// Clear current region
|
||||
void Clear();
|
||||
|
||||
// Union rectangle or region with this.
|
||||
inline bool Union(long x, long y, long width, long height) { return Combine(x, y, width, height, wxRGN_OR); }
|
||||
inline bool Union(const wxRect& rect) { return Combine(rect, wxRGN_OR); }
|
||||
inline bool Union(const wxRegion& region) { return Combine(region, wxRGN_OR); }
|
||||
|
||||
// Intersect rectangle or region with this.
|
||||
inline bool Intersect(long x, long y, long width, long height) { return Combine(x, y, width, height, wxRGN_AND); }
|
||||
inline bool Intersect(const wxRect& rect) { return Combine(rect, wxRGN_AND); }
|
||||
inline bool Intersect(const wxRegion& region) { return Combine(region, wxRGN_AND); }
|
||||
|
||||
// Subtract rectangle or region from this:
|
||||
// Combines the parts of 'this' that are not part of the second region.
|
||||
inline bool Subtract(long x, long y, long width, long height) { return Combine(x, y, width, height, wxRGN_DIFF); }
|
||||
inline bool Subtract(const wxRect& rect) { return Combine(rect, wxRGN_DIFF); }
|
||||
inline bool Subtract(const wxRegion& region) { return Combine(region, wxRGN_DIFF); }
|
||||
|
||||
// XOR: the union of two combined regions except for any overlapping areas.
|
||||
inline bool Xor(long x, long y, long width, long height) { return Combine(x, y, width, height, wxRGN_XOR); }
|
||||
inline bool Xor(const wxRect& rect) { return Combine(rect, wxRGN_XOR); }
|
||||
inline bool Xor(const wxRegion& region) { return Combine(region, wxRGN_XOR); }
|
||||
|
||||
//# Information on region
|
||||
// Outer bounds of region
|
||||
void GetBox(long& x, long& y, long&w, long &h) const;
|
||||
wxRect GetBox() const ;
|
||||
|
||||
// Is region empty?
|
||||
bool Empty() const;
|
||||
inline bool IsEmpty() const { return Empty(); }
|
||||
|
||||
//# Tests
|
||||
// Does the region contain the point (x,y)?
|
||||
wxRegionContain Contains(long x, long y) const;
|
||||
// Does the region contain the point pt?
|
||||
wxRegionContain Contains(const wxPoint& pt) const;
|
||||
// Does the region contain the rectangle (x, y, w, h)?
|
||||
wxRegionContain Contains(long x, long y, long w, long h) const;
|
||||
// Does the region contain the rectangle rect?
|
||||
wxRegionContain Contains(const wxRect& rect) const;
|
||||
|
||||
// Internal
|
||||
bool Combine(long x, long y, long width, long height, wxRegionOp op);
|
||||
bool Combine(const wxRegion& region, wxRegionOp op);
|
||||
bool Combine(const wxRect& rect, wxRegionOp op);
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxRegionIterator : public wxObject {
|
||||
DECLARE_DYNAMIC_CLASS(wxRegionIterator);
|
||||
public:
|
||||
wxRegionIterator();
|
||||
wxRegionIterator(const wxRegion& region);
|
||||
~wxRegionIterator();
|
||||
|
||||
void Reset() { m_current = 0; }
|
||||
void Reset(const wxRegion& region);
|
||||
|
||||
operator bool () const { return m_current < m_numRects; }
|
||||
bool HaveRects() const { return m_current < m_numRects; }
|
||||
|
||||
void operator ++ ();
|
||||
void operator ++ (int);
|
||||
|
||||
long GetX() const;
|
||||
long GetY() const;
|
||||
long GetW() const;
|
||||
long GetWidth() const { return GetW(); }
|
||||
long GetH() const;
|
||||
long GetHeight() const { return GetH(); }
|
||||
wxRect GetRect() const { return wxRect(GetX(), GetY(), GetWidth(), GetHeight()); }
|
||||
|
||||
private:
|
||||
long m_current;
|
||||
long m_numRects;
|
||||
wxRegion m_region;
|
||||
wxRect* m_rects;
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_REGION_H_
|
68
include/wx/os2/scrolbar.h
Normal file
68
include/wx/os2/scrolbar.h
Normal file
@ -0,0 +1,68 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: scrollbar.h
|
||||
// Purpose: wxScrollBar class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_SCROLBAR_H_
|
||||
#define _WX_SCROLBAR_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "scrolbar.h"
|
||||
#endif
|
||||
|
||||
#include "wx/control.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxScrollBarNameStr;
|
||||
|
||||
// Scrollbar item
|
||||
class WXDLLEXPORT wxScrollBar: public wxControl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxScrollBar)
|
||||
|
||||
public:
|
||||
inline wxScrollBar() { m_pageSize = 0; m_viewSize = 0; m_objectSize = 0; }
|
||||
~wxScrollBar();
|
||||
|
||||
inline wxScrollBar(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxSB_HORIZONTAL,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxScrollBarNameStr)
|
||||
{
|
||||
Create(parent, id, pos, size, style, validator, name);
|
||||
}
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxSB_HORIZONTAL,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxScrollBarNameStr);
|
||||
|
||||
int GetThumbPosition() const ;
|
||||
inline int GetThumbSize() const { return m_pageSize; }
|
||||
inline int GetPageSize() const { return m_viewSize; }
|
||||
inline int GetRange() const { return m_objectSize; }
|
||||
|
||||
virtual void SetThumbPosition(int viewStart);
|
||||
virtual void SetScrollbar(int position, int thumbSize, int range, int pageSize,
|
||||
bool refresh = TRUE);
|
||||
|
||||
void Command(wxCommandEvent& event);
|
||||
|
||||
protected:
|
||||
int m_pageSize;
|
||||
int m_viewSize;
|
||||
int m_objectSize;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_SCROLBAR_H_
|
133
include/wx/os2/settings.h
Normal file
133
include/wx/os2/settings.h
Normal file
@ -0,0 +1,133 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: settings.h
|
||||
// Purpose: wxSystemSettings class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_SETTINGS_H_
|
||||
#define _WX_SETTINGS_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "settings.h"
|
||||
#endif
|
||||
|
||||
#include "wx/setup.h"
|
||||
#include "wx/defs.h"
|
||||
#include "wx/object.h"
|
||||
#include "wx/colour.h"
|
||||
#include "wx/font.h"
|
||||
|
||||
#define wxSYS_WHITE_BRUSH 0
|
||||
#define wxSYS_LTGRAY_BRUSH 1
|
||||
#define wxSYS_GRAY_BRUSH 2
|
||||
#define wxSYS_DKGRAY_BRUSH 3
|
||||
#define wxSYS_BLACK_BRUSH 4
|
||||
#define wxSYS_NULL_BRUSH 5
|
||||
#define wxSYS_HOLLOW_BRUSH wxSYS_NULL_BRUSH
|
||||
#define wxSYS_WHITE_PEN 6
|
||||
#define wxSYS_BLACK_PEN 7
|
||||
#define wxSYS_NULL_PEN 8
|
||||
#define wxSYS_OEM_FIXED_FONT 10
|
||||
#define wxSYS_ANSI_FIXED_FONT 11
|
||||
#define wxSYS_ANSI_VAR_FONT 12
|
||||
#define wxSYS_SYSTEM_FONT 13
|
||||
#define wxSYS_DEVICE_DEFAULT_FONT 14
|
||||
#define wxSYS_DEFAULT_PALETTE 15
|
||||
#define wxSYS_SYSTEM_FIXED_FONT 16 // Obsolete
|
||||
#define wxSYS_DEFAULT_GUI_FONT 17
|
||||
|
||||
#define wxSYS_COLOUR_SCROLLBAR 0
|
||||
#define wxSYS_COLOUR_BACKGROUND 1
|
||||
#define wxSYS_COLOUR_ACTIVECAPTION 2
|
||||
#define wxSYS_COLOUR_INACTIVECAPTION 3
|
||||
#define wxSYS_COLOUR_MENU 4
|
||||
#define wxSYS_COLOUR_WINDOW 5
|
||||
#define wxSYS_COLOUR_WINDOWFRAME 6
|
||||
#define wxSYS_COLOUR_MENUTEXT 7
|
||||
#define wxSYS_COLOUR_WINDOWTEXT 8
|
||||
#define wxSYS_COLOUR_CAPTIONTEXT 9
|
||||
#define wxSYS_COLOUR_ACTIVEBORDER 10
|
||||
#define wxSYS_COLOUR_INACTIVEBORDER 11
|
||||
#define wxSYS_COLOUR_APPWORKSPACE 12
|
||||
#define wxSYS_COLOUR_HIGHLIGHT 13
|
||||
#define wxSYS_COLOUR_HIGHLIGHTTEXT 14
|
||||
#define wxSYS_COLOUR_BTNFACE 15
|
||||
#define wxSYS_COLOUR_BTNSHADOW 16
|
||||
#define wxSYS_COLOUR_GRAYTEXT 17
|
||||
#define wxSYS_COLOUR_BTNTEXT 18
|
||||
#define wxSYS_COLOUR_INACTIVECAPTIONTEXT 19
|
||||
#define wxSYS_COLOUR_BTNHIGHLIGHT 20
|
||||
|
||||
#define wxSYS_COLOUR_3DDKSHADOW 21
|
||||
#define wxSYS_COLOUR_3DLIGHT 22
|
||||
#define wxSYS_COLOUR_INFOTEXT 23
|
||||
#define wxSYS_COLOUR_INFOBK 24
|
||||
|
||||
#define wxSYS_COLOUR_DESKTOP wxSYS_COLOUR_BACKGROUND
|
||||
#define wxSYS_COLOUR_3DFACE wxSYS_COLOUR_BTNFACE
|
||||
#define wxSYS_COLOUR_3DSHADOW wxSYS_COLOUR_BTNSHADOW
|
||||
#define wxSYS_COLOUR_3DHIGHLIGHT wxSYS_COLOUR_BTNHIGHLIGHT
|
||||
#define wxSYS_COLOUR_3DHILIGHT wxSYS_COLOUR_BTNHIGHLIGHT
|
||||
#define wxSYS_COLOUR_BTNHILIGHT wxSYS_COLOUR_BTNHIGHLIGHT
|
||||
|
||||
// Metrics
|
||||
#define wxSYS_MOUSE_BUTTONS 1
|
||||
#define wxSYS_BORDER_X 2
|
||||
#define wxSYS_BORDER_Y 3
|
||||
#define wxSYS_CURSOR_X 4
|
||||
#define wxSYS_CURSOR_Y 5
|
||||
#define wxSYS_DCLICK_X 6
|
||||
#define wxSYS_DCLICK_Y 7
|
||||
#define wxSYS_DRAG_X 8
|
||||
#define wxSYS_DRAG_Y 9
|
||||
#define wxSYS_EDGE_X 10
|
||||
#define wxSYS_EDGE_Y 11
|
||||
#define wxSYS_HSCROLL_ARROW_X 12
|
||||
#define wxSYS_HSCROLL_ARROW_Y 13
|
||||
#define wxSYS_HTHUMB_X 14
|
||||
#define wxSYS_ICON_X 15
|
||||
#define wxSYS_ICON_Y 16
|
||||
#define wxSYS_ICONSPACING_X 17
|
||||
#define wxSYS_ICONSPACING_Y 18
|
||||
#define wxSYS_WINDOWMIN_X 19
|
||||
#define wxSYS_WINDOWMIN_Y 20
|
||||
#define wxSYS_SCREEN_X 21
|
||||
#define wxSYS_SCREEN_Y 22
|
||||
#define wxSYS_FRAMESIZE_X 23
|
||||
#define wxSYS_FRAMESIZE_Y 24
|
||||
#define wxSYS_SMALLICON_X 25
|
||||
#define wxSYS_SMALLICON_Y 26
|
||||
#define wxSYS_HSCROLL_Y 27
|
||||
#define wxSYS_VSCROLL_X 28
|
||||
#define wxSYS_VSCROLL_ARROW_X 29
|
||||
#define wxSYS_VSCROLL_ARROW_Y 30
|
||||
#define wxSYS_VTHUMB_Y 31
|
||||
#define wxSYS_CAPTION_Y 32
|
||||
#define wxSYS_MENU_Y 33
|
||||
#define wxSYS_NETWORK_PRESENT 34
|
||||
#define wxSYS_PENWINDOWS_PRESENT 35
|
||||
#define wxSYS_SHOW_SOUNDS 36
|
||||
#define wxSYS_SWAP_BUTTONS 37
|
||||
|
||||
class WXDLLEXPORT wxSystemSettings: public wxObject
|
||||
{
|
||||
public:
|
||||
inline wxSystemSettings() {}
|
||||
|
||||
// Get a system colour
|
||||
static wxColour GetSystemColour(int index);
|
||||
|
||||
// Get a system font
|
||||
static wxFont GetSystemFont(int index);
|
||||
|
||||
// Get a system metric, e.g. scrollbar size
|
||||
static int GetSystemMetric(int index);
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_SETTINGS_H_
|
261
include/wx/os2/setup.h
Normal file
261
include/wx/os2/setup.h
Normal file
@ -0,0 +1,261 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: setup.h
|
||||
// Purpose: Configuration for the library
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_SETUP_H_
|
||||
#define _WX_SETUP_H_
|
||||
|
||||
/*
|
||||
* General features
|
||||
*
|
||||
*/
|
||||
|
||||
#define wxUSE_CONFIG 1
|
||||
// Use wxConfig, with CreateConfig in wxApp
|
||||
|
||||
#define WXWIN_COMPATIBILITY 0
|
||||
// Compatibility with 1.68 API.
|
||||
// Level 0: no backward compatibility, all new features
|
||||
// Level 1: Some compatibility. In fact
|
||||
// the compatibility code is now very minimal so there
|
||||
// is little advantage to setting it to 1.
|
||||
|
||||
#define wxUSE_POSTSCRIPT 1
|
||||
// 0 for no PostScript device context
|
||||
#define wxUSE_AFM_FOR_POSTSCRIPT 1
|
||||
// 1 to use font metric files in GetTextExtent
|
||||
#define wxUSE_METAFILE 1
|
||||
// 0 for no Metafile and metafile device context
|
||||
#define wxUSE_IPC 1
|
||||
// 0 for no interprocess comms
|
||||
// Note: wxHELP uses IPC under X so these are interdependent!
|
||||
#define wxUSE_HELP 1
|
||||
// 0 for no help facility
|
||||
#define wxUSE_RESOURCES 1
|
||||
// 0 for no wxGetResource/wxWriteResource
|
||||
#define wxUSE_CONSTRAINTS 1
|
||||
// 0 for no window layout constraint system
|
||||
|
||||
#define wxUSE_TIMEDATE 1
|
||||
// 0 for no wxTime/wxDate classes
|
||||
|
||||
#define wxUSE_CLIPBOARD 1
|
||||
// 0 for no clipboard functions
|
||||
|
||||
#define wxUSE_SPLINES 1
|
||||
// 0 for no splines
|
||||
|
||||
#define wxUSE_DRAG_AND_DROP 1
|
||||
// 0 for no drag and drop
|
||||
|
||||
#define wxUSE_TOOLBAR 1
|
||||
// Define 1 to use toolbar classes
|
||||
#define wxUSE_BUTTONBAR 1
|
||||
// Define 1 to use buttonbar classes (enhanced toolbar
|
||||
// for MS Windows)
|
||||
#define wxUSE_GAUGE 1
|
||||
// Define 1 to use Microsoft's gauge (Windows)
|
||||
// or Bull's gauge (Motif) library (both in contrib).
|
||||
#define wxUSE_COMBOBOX 1
|
||||
// Define 1 to use COMBOXBOX control (Windows)
|
||||
// or FWW's ComboBox widget (Motif).
|
||||
#define wxUSE_CHOICE 1
|
||||
// Define 1 to use CHOICE
|
||||
|
||||
#define wxUSE_RADIOBUTTON 1
|
||||
// Define 1 to use radio button control
|
||||
#define wxUSE_RADIOBTN 1
|
||||
// Unfortunately someone introduced this one, too
|
||||
|
||||
#define wxUSE_SCROLLBAR 1
|
||||
// Define 1 to compile contributed wxScrollBar class
|
||||
|
||||
#define wxUSE_CHECKBOX 1
|
||||
// Define 1 to compile checkbox
|
||||
|
||||
#define wxUSE_LISTBOX 1
|
||||
// Define 1 to compile listbox
|
||||
|
||||
#define wxUSE_SPINBTN 1
|
||||
// Define 1 to compile spin button
|
||||
|
||||
// use wxStaticLine class (separator line in the dialog)?
|
||||
#define wxUSE_STATLINE 1
|
||||
|
||||
#define wxUSE_CHECKLISTBOX 1
|
||||
// Define 1 to compile check listbox
|
||||
|
||||
#define wxUSE_CHOICE 1
|
||||
// Define 1 to compile choice
|
||||
|
||||
#define wxUSE_CARET 1
|
||||
// Define 1 to use wxCaret class
|
||||
#define wxUSE_XPM_IN_MSW 1
|
||||
// Define 1 to support the XPM package in wxBitmap.
|
||||
#define wxUSE_WX_RESOURCES 1
|
||||
// Use .wxr resource mechanism (requires PrologIO library)
|
||||
|
||||
// support for startup tips (wxShowTip &c)
|
||||
#define wxUSE_STARTUP_TIPS 1
|
||||
|
||||
#define wxUSE_DOC_VIEW_ARCHITECTURE 1
|
||||
// Set to 0 to disable document/view architecture
|
||||
#define wxUSE_MDI_ARCHITECTURE 1
|
||||
// Set to 0 to disable MDI document/view architecture
|
||||
#define wxUSE_PRINTING_ARCHITECTURE 1
|
||||
// Set to 0 to disable print/preview architecture code
|
||||
#define wxUSE_DYNAMIC_CLASSES 1
|
||||
// If 1, enables provision of run-time type information.
|
||||
// NOW MANDATORY: don't change.
|
||||
#define wxUSE_MEMORY_TRACING 1
|
||||
// If 1, enables debugging versions of wxObject::new and
|
||||
// wxObject::delete *IF* __WXDEBUG__ is also defined.
|
||||
// WARNING: this code may not work with all architectures, especially
|
||||
// if alignment is an issue.
|
||||
#define wxUSE_DEBUG_CONTEXT 1
|
||||
// If 1, enables wxDebugContext, for
|
||||
// writing error messages to file, etc.
|
||||
// If __WXDEBUG__ is not defined, will still use
|
||||
// normal memory operators.
|
||||
// It's recommended to set this to 1,
|
||||
// since you may well need to output
|
||||
// an error log in a production
|
||||
// version (or non-debugging beta)
|
||||
#define wxUSE_GLOBAL_MEMORY_OPERATORS 1
|
||||
// In debug mode, cause new and delete to be redefined globally.
|
||||
// If this causes problems (e.g. link errors), set this to 0.
|
||||
|
||||
#define wxUSE_DEBUG_NEW_ALWAYS 1
|
||||
// In debug mode, causes new to be defined to
|
||||
// be WXDEBUG_NEW (see object.h).
|
||||
// If this causes problems (e.g. link errors), set this to 0.
|
||||
// You may need to set this to 0 if using templates (at least
|
||||
// for VC++).
|
||||
|
||||
#define REMOVE_UNUSED_ARG 1
|
||||
// Set this to 0 if your compiler can't cope
|
||||
// with omission of prototype parameters.
|
||||
|
||||
#define wxUSE_ODBC 0
|
||||
// Define 1 to use ODBC classes
|
||||
|
||||
#define wxUSE_IOSTREAMH 1
|
||||
// VC++ 4.2 and above allows <iostream> and <iostream.h>
|
||||
// but you can't mix them. Set to 1 for <iostream.h>,
|
||||
// 0 for <iostream>
|
||||
|
||||
#define wxUSE_STREAMS 1
|
||||
// If enabled (1), compiles wxWindows streams classes
|
||||
|
||||
#define wxUSE_STD_IOSTREAM 1
|
||||
// Use standard C++ streams if 1. If 0, use wxWin
|
||||
// streams implementation.
|
||||
|
||||
#define wxUSE_WXCONFIG 1
|
||||
// if enabled, compiles built-in OS independent wxConfig
|
||||
// class and it's file (any platform) and registry (Win)
|
||||
// based implementations
|
||||
#define wxUSE_THREADS 1
|
||||
// support for multithreaded applications: if
|
||||
// 1, compile in thread classes (thread.h)
|
||||
// and make the library thread safe
|
||||
#define wxUSE_ZLIB 1
|
||||
// Use zlib for compression in streams and PNG code
|
||||
#define wxUSE_LIBPNG 1
|
||||
// Use PNG bitmap code
|
||||
#define wxUSE_LIBJPEG 1
|
||||
// Use JPEG bitmap code
|
||||
#define wxUSE_SERIAL 1
|
||||
// Use serialization (requires utils/serialize)
|
||||
#define wxUSE_DYNLIB_CLASS 1
|
||||
// Compile in wxLibrary class for run-time
|
||||
// DLL loading and function calling
|
||||
#define wxUSE_TOOLTIPS 1
|
||||
// Define to use wxToolTip class and
|
||||
// wxWindow::SetToolTip() method
|
||||
#define wxUSE_SOCKETS 1
|
||||
// Set to 1 to use socket classes
|
||||
#define wxUSE_HTML 1
|
||||
// Set to 1 to use wxHTML sub-library
|
||||
#define wxUSE_FS_ZIP 1
|
||||
#define wxUSE_FS_INET 1 // Set to 1 to enable virtual file systems
|
||||
|
||||
#define wxUSE_BUSYINFO 1
|
||||
// wxBusyInfo displays window with message
|
||||
// when app is busy. Works in same way as
|
||||
// wxBusyCursor
|
||||
#define wxUSE_ZIPSTREAM 1
|
||||
// input stream for reading from zip archives
|
||||
|
||||
/*
|
||||
* Finer detail
|
||||
*
|
||||
*/
|
||||
|
||||
#define wxUSE_APPLE_IEEE 1
|
||||
// if enabled, the float codec written by Apple
|
||||
// will be used to write, in a portable way,
|
||||
// float on the disk
|
||||
|
||||
// use wxFile class - required by i18n code, wxConfig and others - recommended
|
||||
#define wxUSE_FILE 1
|
||||
|
||||
// use wxTextFile class: requires wxFile, required by wxConfig
|
||||
#define wxUSE_TEXTFILE 1
|
||||
|
||||
// i18n support: _() macro, wxLocale class. Requires wxFile
|
||||
#define wxUSE_INTL 1
|
||||
|
||||
// wxLogXXX functions - highly recommended
|
||||
#define wxUSE_LOG 1
|
||||
|
||||
// wxValidator class
|
||||
#define wxUSE_VALIDATORS 1
|
||||
|
||||
// wxAcceleratorTable/Entry classes and support for them in wxMenu(Bar)
|
||||
#define wxUSE_ACCEL 1
|
||||
|
||||
// wxSashWindow class
|
||||
#define wxUSE_SASH 1
|
||||
|
||||
// text entry dialog and wxGetTextFromUser function
|
||||
#define wxUSE_TEXTDLG 1
|
||||
|
||||
// wxToolBar class
|
||||
#define wxUSE_TOOLBAR 1
|
||||
|
||||
// wxStatusBar class
|
||||
#define wxUSE_STATUSBAR 1
|
||||
|
||||
// progress dialog class for lengthy operations
|
||||
#define wxUSE_PROGRESSDLG 1
|
||||
|
||||
// wxDirDlg class for getting a directory name from user
|
||||
#define wxUSE_DIRDLG 1
|
||||
|
||||
#define wxUSE_OWNER_DRAWN 1
|
||||
// Owner-drawn menus and listboxes
|
||||
|
||||
/*
|
||||
* Any platform
|
||||
*
|
||||
*/
|
||||
|
||||
#define wxUSE_TYPEDEFS 0
|
||||
// Use typedefs not classes for wxPoint
|
||||
// and others, to reduce overhead and avoid
|
||||
// MS C7 memory bug. Bounds checker
|
||||
// complains about deallocating
|
||||
// arrays of wxPoints if wxPoint is a class.
|
||||
|
||||
#define wxUSE_DRAG_AND_DROP 1
|
||||
|
||||
#endif
|
||||
// _WX_SETUP_H_
|
261
include/wx/os2/setup0.h
Normal file
261
include/wx/os2/setup0.h
Normal file
@ -0,0 +1,261 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: setup.h
|
||||
// Purpose: Configuration for the library
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_SETUP_H_
|
||||
#define _WX_SETUP_H_
|
||||
|
||||
/*
|
||||
* General features
|
||||
*
|
||||
*/
|
||||
|
||||
#define wxUSE_CONFIG 1
|
||||
// Use wxConfig, with CreateConfig in wxApp
|
||||
|
||||
#define WXWIN_COMPATIBILITY 0
|
||||
// Compatibility with 1.68 API.
|
||||
// Level 0: no backward compatibility, all new features
|
||||
// Level 1: Some compatibility. In fact
|
||||
// the compatibility code is now very minimal so there
|
||||
// is little advantage to setting it to 1.
|
||||
|
||||
#define wxUSE_POSTSCRIPT 1
|
||||
// 0 for no PostScript device context
|
||||
#define wxUSE_AFM_FOR_POSTSCRIPT 1
|
||||
// 1 to use font metric files in GetTextExtent
|
||||
#define wxUSE_METAFILE 1
|
||||
// 0 for no Metafile and metafile device context
|
||||
#define wxUSE_IPC 1
|
||||
// 0 for no interprocess comms
|
||||
// Note: wxHELP uses IPC under X so these are interdependent!
|
||||
#define wxUSE_HELP 1
|
||||
// 0 for no help facility
|
||||
#define wxUSE_RESOURCES 1
|
||||
// 0 for no wxGetResource/wxWriteResource
|
||||
#define wxUSE_CONSTRAINTS 1
|
||||
// 0 for no window layout constraint system
|
||||
|
||||
#define wxUSE_TIMEDATE 1
|
||||
// 0 for no wxTime/wxDate classes
|
||||
|
||||
#define wxUSE_CLIPBOARD 1
|
||||
// 0 for no clipboard functions
|
||||
|
||||
#define wxUSE_SPLINES 1
|
||||
// 0 for no splines
|
||||
|
||||
#define wxUSE_DRAG_AND_DROP 1
|
||||
// 0 for no drag and drop
|
||||
|
||||
#define wxUSE_TOOLBAR 1
|
||||
// Define 1 to use toolbar classes
|
||||
#define wxUSE_BUTTONBAR 1
|
||||
// Define 1 to use buttonbar classes (enhanced toolbar
|
||||
// for MS Windows)
|
||||
#define wxUSE_GAUGE 1
|
||||
// Define 1 to use Microsoft's gauge (Windows)
|
||||
// or Bull's gauge (Motif) library (both in contrib).
|
||||
#define wxUSE_COMBOBOX 1
|
||||
// Define 1 to use COMBOXBOX control (Windows)
|
||||
// or FWW's ComboBox widget (Motif).
|
||||
#define wxUSE_CHOICE 1
|
||||
// Define 1 to use CHOICE
|
||||
|
||||
#define wxUSE_RADIOBUTTON 1
|
||||
// Define 1 to use radio button control
|
||||
#define wxUSE_RADIOBTN 1
|
||||
// Unfortunately someone introduced this one, too
|
||||
|
||||
#define wxUSE_SCROLLBAR 1
|
||||
// Define 1 to compile contributed wxScrollBar class
|
||||
|
||||
#define wxUSE_CHECKBOX 1
|
||||
// Define 1 to compile checkbox
|
||||
|
||||
#define wxUSE_LISTBOX 1
|
||||
// Define 1 to compile listbox
|
||||
|
||||
#define wxUSE_SPINBTN 1
|
||||
// Define 1 to compile spin button
|
||||
|
||||
// use wxStaticLine class (separator line in the dialog)?
|
||||
#define wxUSE_STATLINE 1
|
||||
|
||||
#define wxUSE_CHECKLISTBOX 1
|
||||
// Define 1 to compile check listbox
|
||||
|
||||
#define wxUSE_CHOICE 1
|
||||
// Define 1 to compile choice
|
||||
|
||||
#define wxUSE_CARET 1
|
||||
// Define 1 to use wxCaret class
|
||||
#define wxUSE_XPM_IN_MSW 1
|
||||
// Define 1 to support the XPM package in wxBitmap.
|
||||
#define wxUSE_WX_RESOURCES 1
|
||||
// Use .wxr resource mechanism (requires PrologIO library)
|
||||
|
||||
// support for startup tips (wxShowTip &c)
|
||||
#define wxUSE_STARTUP_TIPS 1
|
||||
|
||||
#define wxUSE_DOC_VIEW_ARCHITECTURE 1
|
||||
// Set to 0 to disable document/view architecture
|
||||
#define wxUSE_MDI_ARCHITECTURE 1
|
||||
// Set to 0 to disable MDI document/view architecture
|
||||
#define wxUSE_PRINTING_ARCHITECTURE 1
|
||||
// Set to 0 to disable print/preview architecture code
|
||||
#define wxUSE_DYNAMIC_CLASSES 1
|
||||
// If 1, enables provision of run-time type information.
|
||||
// NOW MANDATORY: don't change.
|
||||
#define wxUSE_MEMORY_TRACING 1
|
||||
// If 1, enables debugging versions of wxObject::new and
|
||||
// wxObject::delete *IF* __WXDEBUG__ is also defined.
|
||||
// WARNING: this code may not work with all architectures, especially
|
||||
// if alignment is an issue.
|
||||
#define wxUSE_DEBUG_CONTEXT 1
|
||||
// If 1, enables wxDebugContext, for
|
||||
// writing error messages to file, etc.
|
||||
// If __WXDEBUG__ is not defined, will still use
|
||||
// normal memory operators.
|
||||
// It's recommended to set this to 1,
|
||||
// since you may well need to output
|
||||
// an error log in a production
|
||||
// version (or non-debugging beta)
|
||||
#define wxUSE_GLOBAL_MEMORY_OPERATORS 1
|
||||
// In debug mode, cause new and delete to be redefined globally.
|
||||
// If this causes problems (e.g. link errors), set this to 0.
|
||||
|
||||
#define wxUSE_DEBUG_NEW_ALWAYS 1
|
||||
// In debug mode, causes new to be defined to
|
||||
// be WXDEBUG_NEW (see object.h).
|
||||
// If this causes problems (e.g. link errors), set this to 0.
|
||||
// You may need to set this to 0 if using templates (at least
|
||||
// for VC++).
|
||||
|
||||
#define REMOVE_UNUSED_ARG 1
|
||||
// Set this to 0 if your compiler can't cope
|
||||
// with omission of prototype parameters.
|
||||
|
||||
#define wxUSE_ODBC 0
|
||||
// Define 1 to use ODBC classes
|
||||
|
||||
#define wxUSE_IOSTREAMH 1
|
||||
// VC++ 4.2 and above allows <iostream> and <iostream.h>
|
||||
// but you can't mix them. Set to 1 for <iostream.h>,
|
||||
// 0 for <iostream>
|
||||
|
||||
#define wxUSE_STREAMS 1
|
||||
// If enabled (1), compiles wxWindows streams classes
|
||||
|
||||
#define wxUSE_STD_IOSTREAM 1
|
||||
// Use standard C++ streams if 1. If 0, use wxWin
|
||||
// streams implementation.
|
||||
|
||||
#define wxUSE_WXCONFIG 1
|
||||
// if enabled, compiles built-in OS independent wxConfig
|
||||
// class and it's file (any platform) and registry (Win)
|
||||
// based implementations
|
||||
#define wxUSE_THREADS 1
|
||||
// support for multithreaded applications: if
|
||||
// 1, compile in thread classes (thread.h)
|
||||
// and make the library thread safe
|
||||
#define wxUSE_ZLIB 1
|
||||
// Use zlib for compression in streams and PNG code
|
||||
#define wxUSE_LIBPNG 1
|
||||
// Use PNG bitmap code
|
||||
#define wxUSE_LIBJPEG 1
|
||||
// Use JPEG bitmap code
|
||||
#define wxUSE_SERIAL 1
|
||||
// Use serialization (requires utils/serialize)
|
||||
#define wxUSE_DYNLIB_CLASS 1
|
||||
// Compile in wxLibrary class for run-time
|
||||
// DLL loading and function calling
|
||||
#define wxUSE_TOOLTIPS 1
|
||||
// Define to use wxToolTip class and
|
||||
// wxWindow::SetToolTip() method
|
||||
#define wxUSE_SOCKETS 1
|
||||
// Set to 1 to use socket classes
|
||||
#define wxUSE_HTML 1
|
||||
// Set to 1 to use wxHTML sub-library
|
||||
#define wxUSE_FS_ZIP 1
|
||||
#define wxUSE_FS_INET 1 // Set to 1 to enable virtual file systems
|
||||
|
||||
#define wxUSE_BUSYINFO 1
|
||||
// wxBusyInfo displays window with message
|
||||
// when app is busy. Works in same way as
|
||||
// wxBusyCursor
|
||||
#define wxUSE_ZIPSTREAM 1
|
||||
// input stream for reading from zip archives
|
||||
|
||||
/*
|
||||
* Finer detail
|
||||
*
|
||||
*/
|
||||
|
||||
#define wxUSE_APPLE_IEEE 1
|
||||
// if enabled, the float codec written by Apple
|
||||
// will be used to write, in a portable way,
|
||||
// float on the disk
|
||||
|
||||
// use wxFile class - required by i18n code, wxConfig and others - recommended
|
||||
#define wxUSE_FILE 1
|
||||
|
||||
// use wxTextFile class: requires wxFile, required by wxConfig
|
||||
#define wxUSE_TEXTFILE 1
|
||||
|
||||
// i18n support: _() macro, wxLocale class. Requires wxFile
|
||||
#define wxUSE_INTL 1
|
||||
|
||||
// wxLogXXX functions - highly recommended
|
||||
#define wxUSE_LOG 1
|
||||
|
||||
// wxValidator class
|
||||
#define wxUSE_VALIDATORS 1
|
||||
|
||||
// wxAcceleratorTable/Entry classes and support for them in wxMenu(Bar)
|
||||
#define wxUSE_ACCEL 1
|
||||
|
||||
// wxSashWindow class
|
||||
#define wxUSE_SASH 1
|
||||
|
||||
// text entry dialog and wxGetTextFromUser function
|
||||
#define wxUSE_TEXTDLG 1
|
||||
|
||||
// wxToolBar class
|
||||
#define wxUSE_TOOLBAR 1
|
||||
|
||||
// wxStatusBar class
|
||||
#define wxUSE_STATUSBAR 1
|
||||
|
||||
// progress dialog class for lengthy operations
|
||||
#define wxUSE_PROGRESSDLG 1
|
||||
|
||||
// wxDirDlg class for getting a directory name from user
|
||||
#define wxUSE_DIRDLG 1
|
||||
|
||||
#define wxUSE_OWNER_DRAWN 1
|
||||
// Owner-drawn menus and listboxes
|
||||
|
||||
/*
|
||||
* Any platform
|
||||
*
|
||||
*/
|
||||
|
||||
#define wxUSE_TYPEDEFS 0
|
||||
// Use typedefs not classes for wxPoint
|
||||
// and others, to reduce overhead and avoid
|
||||
// MS C7 memory bug. Bounds checker
|
||||
// complains about deallocating
|
||||
// arrays of wxPoints if wxPoint is a class.
|
||||
|
||||
#define wxUSE_DRAG_AND_DROP 1
|
||||
|
||||
#endif
|
||||
// _WX_SETUP_H_
|
93
include/wx/os2/slider.h
Normal file
93
include/wx/os2/slider.h
Normal file
@ -0,0 +1,93 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: slider.h
|
||||
// Purpose: wxSlider class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_SLIDER_H_
|
||||
#define _WX_SLIDER_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "slider.h"
|
||||
#endif
|
||||
|
||||
#include "wx/control.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxSliderNameStr;
|
||||
|
||||
// Slider
|
||||
class WXDLLEXPORT wxSlider: public wxControl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxSlider)
|
||||
|
||||
public:
|
||||
wxSlider();
|
||||
|
||||
inline wxSlider(wxWindow *parent, wxWindowID id,
|
||||
int value, int minValue, int maxValue,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxSL_HORIZONTAL,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxSliderNameStr)
|
||||
{
|
||||
Create(parent, id, value, minValue, maxValue, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
~wxSlider();
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
int value, int minValue, int maxValue,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxSL_HORIZONTAL,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxSliderNameStr);
|
||||
|
||||
virtual int GetValue() const ;
|
||||
virtual void SetValue(int);
|
||||
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 ;
|
||||
bool Show(bool show);
|
||||
|
||||
void SetRange(int minValue, int maxValue);
|
||||
|
||||
inline int GetMin() const { return m_rangeMin; }
|
||||
inline int GetMax() const { return m_rangeMax; }
|
||||
|
||||
// For trackbars only
|
||||
void SetTickFreq(int n, int pos);
|
||||
inline int GetTickFreq() const { return m_tickFreq; }
|
||||
void SetPageSize(int pageSize);
|
||||
int GetPageSize() const ;
|
||||
void ClearSel() ;
|
||||
void ClearTicks() ;
|
||||
void SetLineSize(int lineSize);
|
||||
int GetLineSize() const ;
|
||||
int GetSelEnd() const ;
|
||||
int GetSelStart() const ;
|
||||
void SetSelection(int minPos, int maxPos);
|
||||
void SetThumbLength(int len) ;
|
||||
int GetThumbLength() const ;
|
||||
void SetTick(int tickPos) ;
|
||||
|
||||
void Command(wxCommandEvent& event);
|
||||
protected:
|
||||
int m_rangeMin;
|
||||
int m_rangeMax;
|
||||
int m_pageSize;
|
||||
int m_lineSize;
|
||||
int m_tickFreq;
|
||||
DECLARE_EVENT_TABLE()
|
||||
private:
|
||||
void SetSize(int width, int height) {wxWindow::SetSize(width, height);}
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_SLIDER_H_
|
97
include/wx/os2/spinbutt.h
Normal file
97
include/wx/os2/spinbutt.h
Normal file
@ -0,0 +1,97 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: spinbutt.h
|
||||
// Purpose: wxSpinButton class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_SPINBUTT_H_
|
||||
#define _WX_SPINBUTT_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "spinbutt.h"
|
||||
#endif
|
||||
|
||||
#include "wx/control.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
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxSpinButton)
|
||||
public:
|
||||
/*
|
||||
* Public interface
|
||||
*/
|
||||
|
||||
wxSpinButton();
|
||||
|
||||
inline wxSpinButton(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
long style = wxSP_VERTICAL, const wxString& name = "wxSpinButton")
|
||||
{
|
||||
Create(parent, id, pos, size, style, 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
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
int GetValue() const ;
|
||||
void SetValue(int val) ;
|
||||
void SetRange(int minVal, int maxVal) ;
|
||||
inline int GetMin() const { return m_min; }
|
||||
inline int GetMax() const { return m_max; }
|
||||
|
||||
// Operations
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void Command(wxCommandEvent& event) { ProcessCommand(event); };
|
||||
|
||||
protected:
|
||||
int m_min;
|
||||
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 }
|
||||
#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
|
||||
// _WX_SPINBUTT_H_
|
65
include/wx/os2/statbmp.h
Normal file
65
include/wx/os2/statbmp.h
Normal file
@ -0,0 +1,65 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: statbmp.h
|
||||
// Purpose: wxStaticBitmap class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_STATBMP_H_
|
||||
#define _WX_STATBMP_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "statbmp.h"
|
||||
#endif
|
||||
|
||||
#include "wx/control.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxStaticBitmapNameStr;
|
||||
|
||||
class WXDLLEXPORT wxStaticBitmap: public wxControl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxStaticBitmap)
|
||||
public:
|
||||
inline wxStaticBitmap() { }
|
||||
|
||||
inline wxStaticBitmap(wxWindow *parent, wxWindowID id,
|
||||
const wxBitmap& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxStaticBitmapNameStr)
|
||||
{
|
||||
Create(parent, id, label, pos, size, style, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
const wxBitmap& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxStaticBitmapNameStr);
|
||||
|
||||
virtual void SetBitmap(const wxBitmap& bitmap);
|
||||
|
||||
virtual void Command(wxCommandEvent& WXUNUSED(event)) {};
|
||||
virtual void ProcessCommand(wxCommandEvent& WXUNUSED(event)) {};
|
||||
|
||||
void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
||||
|
||||
inline wxBitmap& GetBitmap() const { return (wxBitmap&) m_messageBitmap; }
|
||||
|
||||
// overriden base class virtuals
|
||||
virtual bool AcceptsFocus() const { return FALSE; }
|
||||
|
||||
protected:
|
||||
wxBitmap m_messageBitmap;
|
||||
private:
|
||||
void SetSize(int width, int height) {wxWindow::SetSize(width, height);}
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_STATBMP_H_
|
59
include/wx/os2/statbox.h
Normal file
59
include/wx/os2/statbox.h
Normal file
@ -0,0 +1,59 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: statbox.h
|
||||
// Purpose: wxStaticBox class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_STATBOX_H_
|
||||
#define _WX_STATBOX_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "statbox.h"
|
||||
#endif
|
||||
|
||||
#include "wx/control.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxStaticBoxNameStr;
|
||||
|
||||
// Group box
|
||||
class WXDLLEXPORT wxStaticBox: public wxControl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxStaticBox)
|
||||
|
||||
public:
|
||||
inline wxStaticBox() {}
|
||||
inline wxStaticBox(wxWindow *parent, wxWindowID id,
|
||||
const wxString& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxStaticBoxNameStr)
|
||||
{
|
||||
Create(parent, id, label, pos, size, style, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
const wxString& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxStaticBoxNameStr);
|
||||
|
||||
virtual void Command(wxCommandEvent& WXUNUSED(event)) {};
|
||||
virtual void ProcessCommand(wxCommandEvent& WXUNUSED(event)) {};
|
||||
|
||||
void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
||||
void SetLabel(const wxString& label);
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
private:
|
||||
void SetSize(int width, int height) {wxWindow::SetSize(width, height);}
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_STATBOX_H_
|
50
include/wx/os2/statline.h
Normal file
50
include/wx/os2/statline.h
Normal file
@ -0,0 +1,50 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: msw/statline.h
|
||||
// Purpose: MSW version of wxStaticLine class
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 28.06.99
|
||||
// Version: $Id$
|
||||
// Copyright: (c) 1998 Vadim Zeitlin
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_MSW_STATLINE_H_
|
||||
#define _WX_MSW_STATLINE_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxStaticLine
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxStaticLine : public wxStaticLineBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxStaticLine)
|
||||
|
||||
public:
|
||||
// constructors and pseudo-constructors
|
||||
wxStaticLine() { }
|
||||
|
||||
wxStaticLine( wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint &pos = wxDefaultPosition,
|
||||
const wxSize &size = wxDefaultSize,
|
||||
long style = wxLI_HORIZONTAL,
|
||||
const wxString &name = wxStaticTextNameStr )
|
||||
{
|
||||
Create(parent, id, pos, size, style, name);
|
||||
}
|
||||
|
||||
bool Create( wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint &pos = wxDefaultPosition,
|
||||
const wxSize &size = wxDefaultSize,
|
||||
long style = wxLI_HORIZONTAL,
|
||||
const wxString &name = wxStaticTextNameStr );
|
||||
};
|
||||
|
||||
#endif // _WX_MSW_STATLINE_H_
|
||||
|
||||
|
58
include/wx/os2/stattext.h
Normal file
58
include/wx/os2/stattext.h
Normal file
@ -0,0 +1,58 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: stattext.h
|
||||
// Purpose: wxStaticText class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_STATTEXT_H_
|
||||
#define _WX_STATTEXT_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "stattext.h"
|
||||
#endif
|
||||
|
||||
#include "wx/control.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxStaticTextNameStr;
|
||||
|
||||
class WXDLLEXPORT wxStaticText: public wxControl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxStaticText)
|
||||
public:
|
||||
inline wxStaticText() { }
|
||||
|
||||
inline wxStaticText(wxWindow *parent, wxWindowID id,
|
||||
const wxString& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxStaticTextNameStr)
|
||||
{
|
||||
Create(parent, id, label, pos, size, style, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
const wxString& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxStaticTextNameStr);
|
||||
|
||||
// accessors
|
||||
void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
||||
void SetLabel(const wxString&);
|
||||
|
||||
// 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
|
||||
// _WX_STATTEXT_H_
|
54
include/wx/os2/statusbr.h
Normal file
54
include/wx/os2/statusbr.h
Normal file
@ -0,0 +1,54 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: statusbr.h
|
||||
// Purpose: native implementation of wxStatusBar. Optional; can use generic
|
||||
// version instead.
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_STATBAR_H_
|
||||
#define _WX_STATBAR_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "statbar.h"
|
||||
#endif
|
||||
|
||||
#include "wx/generic/statusbr.h"
|
||||
|
||||
class WXDLLEXPORT wxStatusBarXX : public wxStatusBar
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxStatusBarXX);
|
||||
|
||||
public:
|
||||
// ctors
|
||||
wxStatusBarXX();
|
||||
wxStatusBarXX(wxWindow *parent, wxWindowID id = -1, long style = wxST_SIZEGRIP);
|
||||
|
||||
// create status line
|
||||
bool Create(wxWindow *parent, wxWindowID id = -1, long style = wxST_SIZEGRIP);
|
||||
|
||||
// a status line can have several (<256) fields numbered from 0
|
||||
virtual void SetFieldsCount(int number = 1, const int widths[] = NULL);
|
||||
|
||||
// each field of status line has its own text
|
||||
virtual void SetStatusText(const wxString& text, int number = 0);
|
||||
virtual wxString GetStatusText(int number = 0) const;
|
||||
|
||||
// set status line fields' widths
|
||||
virtual void SetStatusWidths(int n, const int widths_field[]);
|
||||
|
||||
void OnSize(wxSizeEvent& event);
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
protected:
|
||||
void CopyFieldsWidth(const int widths[]);
|
||||
void SetFieldsWidth();
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_STATBAR_H_
|
138
include/wx/os2/tabctrl.h
Normal file
138
include/wx/os2/tabctrl.h
Normal file
@ -0,0 +1,138 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: tabctrl.h
|
||||
// Purpose: wxTabCtrl class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_TABCTRL_H_
|
||||
#define _WX_TABCTRL_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "tabctrl.h"
|
||||
#endif
|
||||
|
||||
class wxImageList;
|
||||
|
||||
/*
|
||||
* Flags returned by HitTest
|
||||
*/
|
||||
|
||||
#define wxTAB_HITTEST_NOWHERE 1
|
||||
#define wxTAB_HITTEST_ONICON 2
|
||||
#define wxTAB_HITTEST_ONLABEL 4
|
||||
#define wxTAB_HITTEST_ONITEM 6
|
||||
|
||||
class WXDLLEXPORT wxTabCtrl: public wxControl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxTabCtrl)
|
||||
public:
|
||||
/*
|
||||
* Public interface
|
||||
*/
|
||||
|
||||
wxTabCtrl();
|
||||
|
||||
inline wxTabCtrl(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
long style = 0, const wxString& name = "tabCtrl")
|
||||
{
|
||||
Create(parent, id, pos, size, style, name);
|
||||
}
|
||||
~wxTabCtrl();
|
||||
|
||||
// Accessors
|
||||
|
||||
// Get the selection
|
||||
int GetSelection() const;
|
||||
|
||||
// Get the tab with the current keyboard focus
|
||||
int GetCurFocus() const;
|
||||
|
||||
// Get the associated image list
|
||||
wxImageList* GetImageList() const;
|
||||
|
||||
// Get the number of items
|
||||
int GetItemCount() const;
|
||||
|
||||
// Get the rect corresponding to the tab
|
||||
bool GetItemRect(int item, wxRect& rect) const;
|
||||
|
||||
// Get the number of rows
|
||||
int GetRowCount() const;
|
||||
|
||||
// Get the item text
|
||||
wxString GetItemText(int item) const ;
|
||||
|
||||
// Get the item image
|
||||
int GetItemImage(int item) const;
|
||||
|
||||
// Get the item data
|
||||
void* GetItemData(int item) const;
|
||||
|
||||
// Set the selection
|
||||
int SetSelection(int item);
|
||||
|
||||
// Set the image list
|
||||
void SetImageList(wxImageList* imageList);
|
||||
|
||||
// Set the text for an item
|
||||
bool SetItemText(int item, const wxString& text);
|
||||
|
||||
// Set the image for an item
|
||||
bool SetItemImage(int item, int image);
|
||||
|
||||
// Set the data for an item
|
||||
bool SetItemData(int item, void* data);
|
||||
|
||||
// Set the size for a fixed-width tab control
|
||||
void SetItemSize(const wxSize& size);
|
||||
|
||||
// Set the padding between tabs
|
||||
void SetPadding(const wxSize& padding);
|
||||
|
||||
// Operations
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
long style = 0, const wxString& name = "tabCtrl");
|
||||
|
||||
// Delete all items
|
||||
bool DeleteAllItems();
|
||||
|
||||
// Delete an item
|
||||
bool DeleteItem(int item);
|
||||
|
||||
// Hit test
|
||||
int HitTest(const wxPoint& pt, long& flags);
|
||||
|
||||
// Insert an item
|
||||
bool InsertItem(int item, const wxString& text, int imageId = -1, void* data = NULL);
|
||||
|
||||
void Command(wxCommandEvent& event);
|
||||
|
||||
protected:
|
||||
wxImageList* m_imageList;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxTabEvent: public wxCommandEvent
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxTabEvent)
|
||||
|
||||
public:
|
||||
wxTabEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
|
||||
};
|
||||
|
||||
typedef void (wxEvtHandler::*wxTabEventFunction)(wxTabEvent&);
|
||||
|
||||
#define EVT_TAB_SEL_CHANGED(id, fn) { wxEVT_COMMAND_TAB_SEL_CHANGED, \
|
||||
id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTabEventFunction) & fn, NULL },
|
||||
#define EVT_TAB_SEL_CHANGING(id, fn) { wxEVT_COMMAND_TAB_SEL_CHANGING, \
|
||||
id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTabEventFunction) & fn, NULL },
|
||||
|
||||
#endif
|
||||
// _WX_TABCTRL_H_
|
49
include/wx/os2/taskbar.h
Normal file
49
include/wx/os2/taskbar.h
Normal file
@ -0,0 +1,49 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// File: taskbar.h
|
||||
// Purpose: Defines wxTaskBarIcon class for manipulating icons on the
|
||||
// task bar. Optional.
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c)
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_TASKBAR_H_
|
||||
#define _WX_TASKBAR_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "taskbar.h"
|
||||
#endif
|
||||
|
||||
#include <wx/list.h>
|
||||
#include <wx/icon.h>
|
||||
|
||||
class wxTaskBarIcon: public wxObject
|
||||
{
|
||||
public:
|
||||
wxTaskBarIcon();
|
||||
virtual ~wxTaskBarIcon();
|
||||
|
||||
// Accessors
|
||||
|
||||
// Operations
|
||||
bool SetIcon(const wxIcon& icon, const wxString& tooltip = "");
|
||||
bool RemoveIcon();
|
||||
|
||||
// Overridables
|
||||
virtual void OnMouseMove();
|
||||
virtual void OnLButtonDown();
|
||||
virtual void OnLButtonUp();
|
||||
virtual void OnRButtonDown();
|
||||
virtual void OnRButtonUp();
|
||||
virtual void OnLButtonDClick();
|
||||
virtual void OnRButtonDClick();
|
||||
|
||||
// Data members
|
||||
protected:
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_TASKBAR_H_
|
169
include/wx/os2/textctrl.h
Normal file
169
include/wx/os2/textctrl.h
Normal file
@ -0,0 +1,169 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: textctrl.h
|
||||
// Purpose: wxTextCtrl class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_TEXTCTRL_H_
|
||||
#define _WX_TEXTCTRL_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "textctrl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/control.h"
|
||||
|
||||
#if wxUSE_IOSTREAMH
|
||||
#include <iostream.h>
|
||||
#else
|
||||
#include <iostream>
|
||||
#endif
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxTextCtrlNameStr;
|
||||
WXDLLEXPORT_DATA(extern const char*) wxEmptyString;
|
||||
|
||||
// Single-line text item
|
||||
class WXDLLEXPORT wxTextCtrl: public wxControl
|
||||
|
||||
// TODO Some platforms/compilers don't like inheritance from streambuf.
|
||||
|
||||
#if (defined(__BORLANDC__) && !defined(__WIN32__)) || defined(__MWERKS__)
|
||||
#define NO_TEXT_WINDOW_STREAM
|
||||
#endif
|
||||
|
||||
#ifndef NO_TEXT_WINDOW_STREAM
|
||||
, public streambuf
|
||||
#endif
|
||||
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxTextCtrl)
|
||||
|
||||
public:
|
||||
// creation
|
||||
// --------
|
||||
wxTextCtrl();
|
||||
inline wxTextCtrl(wxWindow *parent, wxWindowID id,
|
||||
const wxString& value = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxTextCtrlNameStr)
|
||||
#ifndef NO_TEXT_WINDOW_STREAM
|
||||
:streambuf()
|
||||
#endif
|
||||
{
|
||||
Create(parent, id, value, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
const wxString& value = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxTextCtrlNameStr);
|
||||
|
||||
// accessors
|
||||
// ---------
|
||||
virtual wxString GetValue() const ;
|
||||
virtual void SetValue(const wxString& value);
|
||||
|
||||
virtual int GetLineLength(long lineNo) const;
|
||||
virtual wxString GetLineText(long lineNo) const;
|
||||
virtual int GetNumberOfLines() const;
|
||||
|
||||
// operations
|
||||
// ----------
|
||||
virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
||||
|
||||
// Clipboard operations
|
||||
virtual void Copy();
|
||||
virtual void Cut();
|
||||
virtual void Paste();
|
||||
|
||||
virtual bool CanCopy() const;
|
||||
virtual bool CanCut() const;
|
||||
virtual bool CanPaste() const;
|
||||
|
||||
// Undo/redo
|
||||
virtual void Undo();
|
||||
virtual void Redo();
|
||||
|
||||
virtual bool CanUndo() const;
|
||||
virtual bool CanRedo() const;
|
||||
|
||||
virtual void SetInsertionPoint(long pos);
|
||||
virtual void SetInsertionPointEnd();
|
||||
virtual long GetInsertionPoint() const ;
|
||||
virtual long GetLastPosition() const ;
|
||||
virtual void Replace(long from, long to, const wxString& value);
|
||||
virtual void Remove(long from, long to);
|
||||
virtual void SetSelection(long from, long to);
|
||||
virtual void SetEditable(bool editable);
|
||||
|
||||
// If the return values from and to are the same, there is no
|
||||
// selection.
|
||||
virtual void GetSelection(long* from, long* to) const;
|
||||
virtual bool IsEditable() const ;
|
||||
|
||||
// streambuf implementation
|
||||
#ifndef NO_TEXT_WINDOW_STREAM
|
||||
int overflow(int i);
|
||||
int sync();
|
||||
int underflow();
|
||||
#endif
|
||||
|
||||
wxTextCtrl& operator<<(const wxString& s);
|
||||
wxTextCtrl& operator<<(int i);
|
||||
wxTextCtrl& operator<<(long i);
|
||||
wxTextCtrl& operator<<(float f);
|
||||
wxTextCtrl& operator<<(double d);
|
||||
wxTextCtrl& operator<<(const char c);
|
||||
|
||||
virtual bool LoadFile(const wxString& file);
|
||||
virtual bool SaveFile(const wxString& file);
|
||||
virtual void WriteText(const wxString& text);
|
||||
virtual void AppendText(const wxString& text);
|
||||
virtual void DiscardEdits();
|
||||
virtual bool IsModified() const;
|
||||
|
||||
virtual long XYToPosition(long x, long y) const ;
|
||||
virtual void PositionToXY(long pos, long *x, long *y) const ;
|
||||
virtual void ShowPosition(long pos);
|
||||
virtual void Clear();
|
||||
|
||||
// callbacks
|
||||
// ---------
|
||||
void OnDropFiles(wxDropFilesEvent& event);
|
||||
// void OnChar(wxKeyEvent& event); // Process 'enter' if required
|
||||
// void OnEraseBackground(wxEraseEvent& event);
|
||||
void OnCut(wxCommandEvent& event);
|
||||
void OnCopy(wxCommandEvent& event);
|
||||
void OnPaste(wxCommandEvent& event);
|
||||
void OnUndo(wxCommandEvent& event);
|
||||
void OnRedo(wxCommandEvent& event);
|
||||
|
||||
void OnUpdateCut(wxUpdateUIEvent& event);
|
||||
void OnUpdateCopy(wxUpdateUIEvent& event);
|
||||
void OnUpdatePaste(wxUpdateUIEvent& event);
|
||||
void OnUpdateUndo(wxUpdateUIEvent& event);
|
||||
void OnUpdateRedo(wxUpdateUIEvent& event);
|
||||
|
||||
// Implementation
|
||||
// --------------
|
||||
virtual void Command(wxCommandEvent& event);
|
||||
|
||||
protected:
|
||||
wxString m_fileName;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
private:
|
||||
void SetSize(int width, int height) {wxWindow::SetSize(width, height);}
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_TEXTCTRL_H_
|
64
include/wx/os2/timer.h
Normal file
64
include/wx/os2/timer.h
Normal file
@ -0,0 +1,64 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: timer.h
|
||||
// Purpose: wxTimer class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_TIMER_H_
|
||||
#define _WX_TIMER_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "timer.h"
|
||||
#endif
|
||||
|
||||
#include "wx/object.h"
|
||||
|
||||
class WXDLLEXPORT wxTimer: public wxObject
|
||||
{
|
||||
public:
|
||||
wxTimer();
|
||||
~wxTimer();
|
||||
|
||||
virtual bool Start(int milliseconds = -1,
|
||||
bool one_shot = FALSE); // Start timer
|
||||
virtual void Stop(); // Stop timer
|
||||
|
||||
virtual void Notify() = 0; // Override this member
|
||||
|
||||
// Returns the current interval time (0 if stop)
|
||||
int Interval() const { return m_milli; };
|
||||
bool OneShot() const { return m_oneShot; }
|
||||
|
||||
protected:
|
||||
bool m_oneShot ;
|
||||
int m_milli ;
|
||||
int m_lastMilli ;
|
||||
|
||||
long m_id;
|
||||
|
||||
private:
|
||||
DECLARE_ABSTRACT_CLASS(wxTimer)
|
||||
};
|
||||
|
||||
/* Note: these are implemented in common/timercmn.cpp, so need to implement them separately.
|
||||
* But you may need to modify timercmn.cpp.
|
||||
*/
|
||||
|
||||
// Timer functions (milliseconds)
|
||||
void WXDLLEXPORT wxStartTimer();
|
||||
// Gets time since last wxStartTimer or wxGetElapsedTime
|
||||
long WXDLLEXPORT wxGetElapsedTime(bool resetTimer = TRUE);
|
||||
|
||||
// EXPERIMENTAL: comment this out if it doesn't compile.
|
||||
bool WXDLLEXPORT wxGetLocalTime(long *timeZone, int *dstObserved);
|
||||
|
||||
// Get number of seconds since 00:00:00 GMT, Jan 1st 1970.
|
||||
long WXDLLEXPORT wxGetCurrentTime();
|
||||
|
||||
#endif
|
||||
// _WX_TIMER_H_
|
77
include/wx/os2/toolbar.h
Normal file
77
include/wx/os2/toolbar.h
Normal file
@ -0,0 +1,77 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: toolbar.h
|
||||
// Purpose: wxToolBar class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_TOOLBAR_H_
|
||||
#define _WX_TOOLBAR_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "toolbar.h"
|
||||
#endif
|
||||
|
||||
#include "wx/tbarbase.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxToolBarNameStr;
|
||||
|
||||
class WXDLLEXPORT wxToolBar: public wxToolBarBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxToolBar)
|
||||
public:
|
||||
/*
|
||||
* Public interface
|
||||
*/
|
||||
|
||||
wxToolBar();
|
||||
|
||||
inline wxToolBar(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
long style = wxNO_BORDER|wxTB_HORIZONTAL,
|
||||
const wxString& name = wxToolBarNameStr)
|
||||
{
|
||||
Create(parent, id, pos, size, style, name);
|
||||
}
|
||||
~wxToolBar();
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
long style = wxNO_BORDER|wxTB_HORIZONTAL,
|
||||
const wxString& name = wxToolBarNameStr);
|
||||
|
||||
// If pushedBitmap is NULL, a reversed version of bitmap is
|
||||
// created and used as the pushed/toggled image.
|
||||
// If toggle is TRUE, the button toggles between the two states.
|
||||
wxToolBarTool *AddTool(int toolIndex, const wxBitmap& bitmap, const wxBitmap& pushedBitmap = wxNullBitmap,
|
||||
bool toggle = FALSE, long xPos = -1, long yPos = -1, wxObject *clientData = NULL,
|
||||
const wxString& helpString1 = "", const wxString& helpString2 = "");
|
||||
|
||||
// Set default bitmap size
|
||||
void SetToolBitmapSize(const wxSize& size);
|
||||
void EnableTool(int toolIndex, bool enable); // additional drawing on enabling
|
||||
void ToggleTool(int toolIndex, bool toggle); // toggle is TRUE if toggled on
|
||||
void ClearTools();
|
||||
|
||||
// The button size is bigger than the bitmap size
|
||||
wxSize GetToolSize() const;
|
||||
|
||||
wxSize GetMaxSize() const;
|
||||
|
||||
// Add all the buttons
|
||||
virtual bool CreateTools();
|
||||
virtual bool Layout() {return TRUE;}
|
||||
|
||||
// The post-tool-addition call. TODO: do here whatever's
|
||||
// necessary for completing the toolbar construction.
|
||||
bool Realize() { return CreateTools(); };
|
||||
|
||||
protected:
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_TOOLBAR_H_
|
48
include/wx/os2/tooltip.h
Normal file
48
include/wx/os2/tooltip.h
Normal file
@ -0,0 +1,48 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: msw/tooltip.h
|
||||
// Purpose: wxToolTip class - tooltip control
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 31.01.99
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 1999 Robert Roebling, Vadim Zeitlin
|
||||
// Licence: wxWindows license
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class wxToolTip : public wxObject
|
||||
{
|
||||
public:
|
||||
// ctor & dtor
|
||||
wxToolTip(const wxString &tip);
|
||||
virtual ~wxToolTip();
|
||||
|
||||
// accessors
|
||||
// tip text
|
||||
void SetTip(const wxString& tip);
|
||||
const wxString& GetTip() const { return m_text; }
|
||||
|
||||
// the window we're associated with
|
||||
void SetWindow(wxWindow *win);
|
||||
wxWindow *GetWindow() const { return m_window; }
|
||||
|
||||
// controlling tooltip behaviour: globally change tooltip parameters
|
||||
// enable or disable the tooltips globally
|
||||
static void Enable(bool flag);
|
||||
// set the delay after which the tooltip appears
|
||||
static void SetDelay(long milliseconds);
|
||||
|
||||
// implementation
|
||||
void RelayEvent(WXMSG *msg);
|
||||
|
||||
private:
|
||||
// create the tooltip ctrl for our parent frame if it doesn't exist yet
|
||||
// and return its window handle
|
||||
WXHWND GetToolTipCtrl();
|
||||
|
||||
// remove this tooltip from the tooltip control
|
||||
void Remove();
|
||||
|
||||
wxString m_text; // tooltip text
|
||||
wxWindow *m_window; // window we're associated with
|
||||
};
|
||||
|
295
include/wx/os2/treectrl.h
Normal file
295
include/wx/os2/treectrl.h
Normal file
@ -0,0 +1,295 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: treectrl.h
|
||||
// Purpose: wxTreeCtrl class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_TREECTRL_H_
|
||||
#define _WX_TREECTRL_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "treectrl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/control.h"
|
||||
#include "wx/event.h"
|
||||
#include "wx/imaglist.h"
|
||||
|
||||
#define wxTREE_MASK_HANDLE 0x0001
|
||||
#define wxTREE_MASK_STATE 0x0002
|
||||
#define wxTREE_MASK_TEXT 0x0004
|
||||
#define wxTREE_MASK_IMAGE 0x0008
|
||||
#define wxTREE_MASK_SELECTED_IMAGE 0x0010
|
||||
#define wxTREE_MASK_CHILDREN 0x0020
|
||||
#define wxTREE_MASK_DATA 0x0040
|
||||
|
||||
#define wxTREE_STATE_BOLD 0x0001
|
||||
#define wxTREE_STATE_DROPHILITED 0x0002
|
||||
#define wxTREE_STATE_EXPANDED 0x0004
|
||||
#define wxTREE_STATE_EXPANDEDONCE 0x0008
|
||||
#define wxTREE_STATE_FOCUSED 0x0010
|
||||
#define wxTREE_STATE_SELECTED 0x0020
|
||||
#define wxTREE_STATE_CUT 0x0040
|
||||
|
||||
#define wxTREE_HITTEST_ABOVE 0x0001 // Above the client area.
|
||||
#define wxTREE_HITTEST_BELOW 0x0002 // Below the client area.
|
||||
#define wxTREE_HITTEST_NOWHERE 0x0004 // In the client area but below the last item.
|
||||
#define wxTREE_HITTEST_ONITEMBUTTON 0x0010 // On the button associated with an item.
|
||||
#define wxTREE_HITTEST_ONITEMICON 0x0020 // On the bitmap associated with an item.
|
||||
#define wxTREE_HITTEST_ONITEMINDENT 0x0040 // In the indentation associated with an item.
|
||||
#define wxTREE_HITTEST_ONITEMLABEL 0x0080 // On the label (string) associated with an item.
|
||||
#define wxTREE_HITTEST_ONITEMRIGHT 0x0100 // In the area to the right of an item.
|
||||
#define wxTREE_HITTEST_ONITEMSTATEICON 0x0200 // On the state icon for a tree view item that is in a user-defined state.
|
||||
#define wxTREE_HITTEST_TOLEFT 0x0400 // To the right of the client area.
|
||||
#define wxTREE_HITTEST_TORIGHT 0x0800 // To the left of the client area.
|
||||
|
||||
#define wxTREE_HITTEST_ONITEM (wxTREE_HITTEST_ONITEMICON | wxTREE_HITTEST_ONITEMLABEL | wxTREE_HITTEST_ONITEMSTATEICON)
|
||||
|
||||
// Flags for GetNextItem
|
||||
enum {
|
||||
wxTREE_NEXT_CARET, // Retrieves the currently selected item.
|
||||
wxTREE_NEXT_CHILD, // Retrieves the first child item. The hItem parameter must be NULL.
|
||||
wxTREE_NEXT_DROPHILITE, // Retrieves the item that is the target of a drag-and-drop operation.
|
||||
wxTREE_NEXT_FIRSTVISIBLE, // Retrieves the first visible item.
|
||||
wxTREE_NEXT_NEXT, // Retrieves the next sibling item.
|
||||
wxTREE_NEXT_NEXTVISIBLE, // Retrieves the next visible item that follows the specified item.
|
||||
wxTREE_NEXT_PARENT, // Retrieves the parent of the specified item.
|
||||
wxTREE_NEXT_PREVIOUS, // Retrieves the previous sibling item.
|
||||
wxTREE_NEXT_PREVIOUSVISIBLE, // Retrieves the first visible item that precedes the specified item.
|
||||
wxTREE_NEXT_ROOT // Retrieves the first child item of the root item of which the specified item is a part.
|
||||
};
|
||||
|
||||
// Flags for ExpandItem
|
||||
enum {
|
||||
wxTREE_EXPAND_EXPAND,
|
||||
wxTREE_EXPAND_COLLAPSE,
|
||||
wxTREE_EXPAND_COLLAPSE_RESET,
|
||||
wxTREE_EXPAND_TOGGLE
|
||||
};
|
||||
|
||||
// Flags for InsertItem
|
||||
enum {
|
||||
wxTREE_INSERT_LAST = -1,
|
||||
wxTREE_INSERT_FIRST = -2,
|
||||
wxTREE_INSERT_SORT = -3
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxTreeItem: public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxTreeItem)
|
||||
public:
|
||||
long m_mask;
|
||||
long m_itemId;
|
||||
long m_state;
|
||||
long m_stateMask;
|
||||
wxString m_text;
|
||||
int m_image;
|
||||
int m_selectedImage;
|
||||
int m_children;
|
||||
long m_data;
|
||||
|
||||
wxTreeItem();
|
||||
|
||||
// Accessors
|
||||
inline long GetMask() const { return m_mask; }
|
||||
inline long GetItemId() const { return m_itemId; }
|
||||
inline long GetState() const { return m_state; }
|
||||
inline long GetStateMask() const { return m_stateMask; }
|
||||
inline wxString GetText() const { return m_text; }
|
||||
inline int GetImage() const { return m_image; }
|
||||
inline int GetSelectedImage() const { return m_selectedImage; }
|
||||
inline int GetChildren() const { return m_children; }
|
||||
inline long GetData() const { return m_data; }
|
||||
|
||||
inline void SetMask(long mask) { m_mask = mask; }
|
||||
inline void SetItemId(long id) { m_itemId = m_itemId = id; }
|
||||
inline void SetState(long state) { m_state = state; }
|
||||
inline void SetStateMask(long stateMask) { m_stateMask = stateMask; }
|
||||
inline void GetText(const wxString& text) { m_text = text; }
|
||||
inline void SetImage(int image) { m_image = image; }
|
||||
inline void GetSelectedImage(int selImage) { m_selectedImage = selImage; }
|
||||
inline void SetChildren(int children) { m_children = children; }
|
||||
inline void SetData(long data) { m_data = data; }
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxTreeCtrl: public wxControl
|
||||
{
|
||||
public:
|
||||
/*
|
||||
* Public interface
|
||||
*/
|
||||
|
||||
// creation
|
||||
// --------
|
||||
wxTreeCtrl();
|
||||
|
||||
inline wxTreeCtrl(wxWindow *parent, wxWindowID id = -1,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxTR_HAS_BUTTONS|wxTR_LINES_AT_ROOT,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = "wxTreeCtrl")
|
||||
{
|
||||
Create(parent, id, pos, size, style, validator, name);
|
||||
}
|
||||
~wxTreeCtrl();
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id = -1,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxTR_HAS_BUTTONS|wxTR_LINES_AT_ROOT,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = "wxTreeCtrl");
|
||||
|
||||
// accessors
|
||||
// ---------
|
||||
//
|
||||
int GetCount() const;
|
||||
|
||||
// indent
|
||||
int GetIndent() const;
|
||||
void SetIndent(int indent);
|
||||
// image list
|
||||
wxImageList *GetImageList(int which = wxIMAGE_LIST_NORMAL) const;
|
||||
void SetImageList(wxImageList *imageList, int which = wxIMAGE_LIST_NORMAL);
|
||||
|
||||
// navigation inside the tree
|
||||
long GetNextItem(long item, int code) const;
|
||||
bool ItemHasChildren(long item) const;
|
||||
long GetChild(long item) const;
|
||||
long GetParent(long item) const;
|
||||
long GetFirstVisibleItem() const;
|
||||
long GetNextVisibleItem(long item) const;
|
||||
long GetSelection() const;
|
||||
long GetRootItem() const;
|
||||
|
||||
// generic function for (g|s)etting item attributes
|
||||
bool GetItem(wxTreeItem& info) const;
|
||||
bool SetItem(wxTreeItem& info);
|
||||
// item state
|
||||
int GetItemState(long item, long stateMask) const;
|
||||
bool SetItemState(long item, long state, long stateMask);
|
||||
// item image
|
||||
bool SetItemImage(long item, int image, int selImage);
|
||||
// item text
|
||||
wxString GetItemText(long item) const;
|
||||
void SetItemText(long item, const wxString& str);
|
||||
// custom data associated with the item
|
||||
long GetItemData(long item) const;
|
||||
bool SetItemData(long item, long data);
|
||||
// convenience function
|
||||
bool IsItemExpanded(long item)
|
||||
{
|
||||
return (GetItemState(item, wxTREE_STATE_EXPANDED) &
|
||||
wxTREE_STATE_EXPANDED) != 0;
|
||||
}
|
||||
|
||||
// bounding rect
|
||||
bool GetItemRect(long item, wxRect& rect, bool textOnly = FALSE) const;
|
||||
//
|
||||
wxTextCtrl* GetEditControl() const;
|
||||
|
||||
// operations
|
||||
// ----------
|
||||
// adding/deleting items
|
||||
bool DeleteItem(long item);
|
||||
long InsertItem(long parent, wxTreeItem& info,
|
||||
long insertAfter = wxTREE_INSERT_LAST);
|
||||
// If image > -1 and selImage == -1, the same image is used for
|
||||
// both selected and unselected items.
|
||||
long InsertItem(long parent, const wxString& label,
|
||||
int image = -1, int selImage = -1,
|
||||
long insertAfter = wxTREE_INSERT_LAST);
|
||||
|
||||
// changing item state
|
||||
bool ExpandItem(long item) { return ExpandItem(item, wxTREE_EXPAND_EXPAND); }
|
||||
bool CollapseItem(long item) { return ExpandItem(item, wxTREE_EXPAND_COLLAPSE); }
|
||||
bool ToggleItem(long item) { return ExpandItem(item, wxTREE_EXPAND_TOGGLE); }
|
||||
// common interface for {Expand|Collapse|Toggle}Item
|
||||
bool ExpandItem(long item, int action);
|
||||
|
||||
//
|
||||
bool SelectItem(long item);
|
||||
bool ScrollTo(long item);
|
||||
bool DeleteAllItems();
|
||||
|
||||
// Edit the label (tree must have the focus)
|
||||
wxTextCtrl* EditLabel(long item, wxClassInfo* textControlClass = CLASSINFO(wxTextCtrl));
|
||||
|
||||
// End label editing, optionally cancelling the edit
|
||||
bool EndEditLabel(bool cancel);
|
||||
|
||||
long HitTest(const wxPoint& point, int& flags);
|
||||
// wxImageList *CreateDragImage(long item);
|
||||
bool SortChildren(long item);
|
||||
bool EnsureVisible(long item);
|
||||
|
||||
void Command(wxCommandEvent& event) { ProcessCommand(event); };
|
||||
|
||||
protected:
|
||||
wxTextCtrl* m_textCtrl;
|
||||
wxImageList* m_imageListNormal;
|
||||
wxImageList* m_imageListState;
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxTreeCtrl)
|
||||
};
|
||||
|
||||
/*
|
||||
wxEVT_COMMAND_TREE_BEGIN_DRAG,
|
||||
wxEVT_COMMAND_TREE_BEGIN_RDRAG,
|
||||
wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT,
|
||||
wxEVT_COMMAND_TREE_END_LABEL_EDIT,
|
||||
wxEVT_COMMAND_TREE_DELETE_ITEM,
|
||||
wxEVT_COMMAND_TREE_GET_INFO,
|
||||
wxEVT_COMMAND_TREE_SET_INFO,
|
||||
wxEVT_COMMAND_TREE_ITEM_EXPANDED,
|
||||
wxEVT_COMMAND_TREE_ITEM_EXPANDING,
|
||||
wxEVT_COMMAND_TREE_ITEM_COLLAPSED,
|
||||
wxEVT_COMMAND_TREE_ITEM_COLLAPSING,
|
||||
wxEVT_COMMAND_TREE_SEL_CHANGED,
|
||||
wxEVT_COMMAND_TREE_SEL_CHANGING,
|
||||
wxEVT_COMMAND_TREE_KEY_DOWN
|
||||
*/
|
||||
|
||||
class WXDLLEXPORT wxTreeEvent: public wxCommandEvent
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxTreeEvent)
|
||||
|
||||
public:
|
||||
wxTreeEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
|
||||
|
||||
int m_code;
|
||||
wxTreeItem m_item;
|
||||
long m_oldItem;
|
||||
wxPoint m_pointDrag;
|
||||
|
||||
inline long GetOldItem() const { return m_oldItem; }
|
||||
inline wxTreeItem& GetItem() const { return (wxTreeItem&) m_item; }
|
||||
inline wxPoint GetPoint() const { return m_pointDrag; }
|
||||
inline int GetCode() const { return m_code; }
|
||||
};
|
||||
|
||||
typedef void (wxEvtHandler::*wxTreeEventFunction)(wxTreeEvent&);
|
||||
|
||||
#define EVT_TREE_BEGIN_DRAG(id, fn) { wxEVT_COMMAND_TREE_BEGIN_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
|
||||
#define EVT_TREE_BEGIN_RDRAG(id, fn) { wxEVT_COMMAND_TREE_BEGIN_RDRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
|
||||
#define EVT_TREE_BEGIN_LABEL_EDIT(id, fn) { wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
|
||||
#define EVT_TREE_END_LABEL_EDIT(id, fn) { wxEVT_COMMAND_TREE_END_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
|
||||
#define EVT_TREE_DELETE_ITEM(id, fn) { wxEVT_COMMAND_TREE_DELETE_ITEM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
|
||||
#define EVT_TREE_GET_INFO(id, fn) { wxEVT_COMMAND_TREE_GET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
|
||||
#define EVT_TREE_SET_INFO(id, fn) { wxEVT_COMMAND_TREE_SET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
|
||||
#define EVT_TREE_ITEM_EXPANDED(id, fn) { wxEVT_COMMAND_TREE_ITEM_EXPANDED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
|
||||
#define EVT_TREE_ITEM_EXPANDING(id, fn) { wxEVT_COMMAND_TREE_ITEM_EXPANDING, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
|
||||
#define EVT_TREE_ITEM_COLLAPSED(id, fn) { wxEVT_COMMAND_TREE_ITEM_COLLAPSED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
|
||||
#define EVT_TREE_ITEM_COLLAPSING(id, fn) { wxEVT_COMMAND_TREE_ITEM_COLLAPSING, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
|
||||
#define EVT_TREE_SEL_CHANGED(id, fn) { wxEVT_COMMAND_TREE_SEL_CHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
|
||||
#define EVT_TREE_SEL_CHANGING(id, fn) { wxEVT_COMMAND_TREE_SEL_CHANGING, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
|
||||
#define EVT_TREE_KEY_DOWN(id, fn) { wxEVT_COMMAND_TREE_KEY_DOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
|
||||
|
||||
#endif
|
||||
// _WX_TREECTRL_H_
|
44
include/wx/os2/wave.h
Normal file
44
include/wx/os2/wave.h
Normal file
@ -0,0 +1,44 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wave.h
|
||||
// Purpose: wxWave class (loads and plays short Windows .wav files).
|
||||
// Optional on non-Windows platforms.
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_WAVE_H_
|
||||
#define _WX_WAVE_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "wave.h"
|
||||
#endif
|
||||
|
||||
#include "wx/object.h"
|
||||
|
||||
class wxWave : public wxObject
|
||||
{
|
||||
public:
|
||||
wxWave();
|
||||
wxWave(const wxString& fileName, bool isResource = FALSE);
|
||||
~wxWave();
|
||||
|
||||
public:
|
||||
bool Create(const wxString& fileName, bool isResource = FALSE);
|
||||
bool IsOk() const { return (m_waveData ? TRUE : FALSE); };
|
||||
bool Play(bool async = TRUE, bool looped = FALSE) const;
|
||||
|
||||
protected:
|
||||
bool Free();
|
||||
|
||||
private:
|
||||
char* m_waveData;
|
||||
int m_waveLength;
|
||||
bool m_isResource;
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_WAVE_H_
|
436
include/wx/os2/window.h
Normal file
436
include/wx/os2/window.h
Normal file
@ -0,0 +1,436 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: window.h
|
||||
// Purpose: wxWindow class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_WINDOW_H_
|
||||
#define _WX_WINDOW_H_
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// headers
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "window.h"
|
||||
#endif
|
||||
|
||||
// #include "wx/msw/winundef.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
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// forward declarations
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxButton;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// constants
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
// FIXME does anybody use those? they're unused by wxWindows...
|
||||
enum
|
||||
{
|
||||
wxKEY_SHIFT = 1,
|
||||
wxKEY_CTRL = 2
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// wxWindow declaration for MSW
|
||||
// ---------------------------------------------------------------------------
|
||||
class WXDLLEXPORT wxWindow : public wxWindowBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxWindow);
|
||||
|
||||
public:
|
||||
wxWindow() { Init(); }
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
virtual ~wxWindow();
|
||||
|
||||
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;
|
||||
|
||||
virtual void Raise();
|
||||
virtual void Lower();
|
||||
|
||||
virtual bool Show( bool show = TRUE );
|
||||
virtual bool Enable( bool enable = TRUE );
|
||||
|
||||
virtual void SetFocus();
|
||||
|
||||
virtual bool Reparent( wxWindow *newParent );
|
||||
|
||||
virtual void WarpPointer(int x, int y);
|
||||
virtual void CaptureMouse();
|
||||
virtual void ReleaseMouse();
|
||||
|
||||
virtual void Refresh( bool eraseBackground = TRUE,
|
||||
const wxRect *rect = (const wxRect *) NULL );
|
||||
virtual void Clear();
|
||||
|
||||
virtual bool SetCursor( const wxCursor &cursor );
|
||||
virtual bool SetFont( const wxFont &font );
|
||||
|
||||
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 bool PopupMenu( wxMenu *menu, int x, int y );
|
||||
|
||||
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 );
|
||||
|
||||
#if wxUSE_DRAG_AND_DROP
|
||||
virtual void SetDropTarget( wxDropTarget *dropTarget );
|
||||
#endif // wxUSE_DRAG_AND_DROP
|
||||
|
||||
// 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;
|
||||
|
||||
// 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
|
||||
|
||||
#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
|
||||
|
||||
// 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 OnIdle(wxIdleEvent& event);
|
||||
|
||||
public:
|
||||
// For implementation purposes - sometimes decorations make the client area
|
||||
// smaller
|
||||
virtual wxPoint GetClientAreaOrigin() const;
|
||||
|
||||
// Makes an adjustment to the window position (for example, a frame that has
|
||||
// a toolbar that it manages itself).
|
||||
virtual void AdjustForParentClientOrigin(int& x, int& y, int sizeFlags);
|
||||
|
||||
// Windows subclassing
|
||||
void SubclassWin(WXHWND hWnd);
|
||||
void UnsubclassWin();
|
||||
|
||||
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);
|
||||
// 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; };
|
||||
|
||||
// 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);
|
||||
|
||||
protected:
|
||||
// the window handle
|
||||
WXHWND m_hWnd;
|
||||
|
||||
// the old window proc (we subclass all windows)
|
||||
WXFARPROC m_oldWndProc;
|
||||
|
||||
// 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;
|
||||
|
||||
// the size of one page for scrolling
|
||||
int m_xThumbSize;
|
||||
int m_yThumbSize;
|
||||
|
||||
#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));}
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// global functions
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
// kbd code translation
|
||||
WXDLLEXPORT int wxCharCodeMSWToWX(int keySym);
|
||||
WXDLLEXPORT int wxCharCodeWXToMSW(int id, bool *IsVirtual);
|
||||
|
||||
#endif
|
||||
// _WX_WINDOW_H_
|
35
src/makefile.va
Normal file
35
src/makefile.va
Normal file
@ -0,0 +1,35 @@
|
||||
#
|
||||
# File: makefile.va
|
||||
# Author: David Webster
|
||||
# Created: 1999
|
||||
# Updated:
|
||||
# Copyright: (c) 1999, David Webster
|
||||
#
|
||||
# "%W% %G%"
|
||||
#
|
||||
# Makefile : Builds wxWindows library wx.lib for VisualAge C++ V3.0 for OS/2
|
||||
# Arguments:
|
||||
#
|
||||
# FINAL=1 argument to nmake to build version with no debugging info.
|
||||
# dll builds a library (wxdll.lib) suitable for creating DLLs
|
||||
# * Note that the dll target is experimental - see docs/dll.txt.
|
||||
#
|
||||
!include <makeva.env>
|
||||
|
||||
THISDIR=$(WXWIN)\src
|
||||
|
||||
all:
|
||||
cd os2
|
||||
nmake -f makefile.va
|
||||
cd $(THISDIR)
|
||||
|
||||
clean:
|
||||
cd os2
|
||||
nmake -f makefile.va clean
|
||||
cd $(THISDIR)
|
||||
|
||||
cleanall:
|
||||
cd os2
|
||||
nmake -f makefile.va cleanall
|
||||
cd $(THISDIR)
|
||||
|
174
src/makeva.env
Normal file
174
src/makeva.env
Normal file
@ -0,0 +1,174 @@
|
||||
#
|
||||
# File: Makeva.env
|
||||
# Author: Ulrich Leodolter
|
||||
# Created: Wed May 17 08:36:42 1995
|
||||
# Updated:
|
||||
#
|
||||
# VisualAge C++ V3.0 makefile include file
|
||||
#
|
||||
|
||||
# Suffixes
|
||||
OBJSUFF=obj
|
||||
SRCSUFF=cpp
|
||||
|
||||
OS2FLAGS=/c /W3 /D__VISAGECPP__ /Ss /Q /N100
|
||||
OS2LINKFLAGS=/BASE:0x00010000 /PMTYPE:PM /NOE /NOD /ALIGN:16
|
||||
OS2LIBS=CPPOM30.lib CPPOOC3.LIB OS2386.LIB
|
||||
|
||||
# Change this to your WXWIN directory
|
||||
WXDIR=i:\dev\Wx2\wxwindows
|
||||
|
||||
WXSRC=$(WXDIR)\src\os2
|
||||
WXINC=$(WXDIR)\include
|
||||
WXBASESRC=$(WXDIR)\src\common
|
||||
EXTRAINC=$(WXDIR)\src\png
|
||||
|
||||
#####################################################################
|
||||
# These are the possible DLL/non-DLL usages:
|
||||
#
|
||||
# Type _DLL/_WINDLL WXUSINGDLL WXMAKINGDLL Library
|
||||
#--------------------------------------------------------------------
|
||||
# Normal application - - - wx.lib
|
||||
#
|
||||
# wxWin as DLL Defined - Defined wx200.lib
|
||||
#
|
||||
# App using wxWin DLL - Defined - wx200.lib
|
||||
#
|
||||
# App built as one DLL Defined - - wx.lib
|
||||
#
|
||||
######################################################################
|
||||
#
|
||||
# Compiling your app:
|
||||
#--------------------
|
||||
# when compiling an app to use the DLL version of wxWindows
|
||||
# (but not to be a DLL itself), set WXUSINGDLL to 1 in your
|
||||
# makefile just before including ntwxwin.mak.
|
||||
# To compile wxWin _and_ app itself as a DLL, set DLL to 1
|
||||
# in ntwxwin.mak, and do not set WXUSINGDLL.
|
||||
#
|
||||
# Compiling wxWindows:
|
||||
#---------------------
|
||||
# Use the dll target to compile wxWindows as DLL; then make 'pch'
|
||||
# to generate a precompiled header for your apps to use. BUG: must compile without
|
||||
# wxExpr (USE_WX_RESOURCES = 0) for this to link properly. Don't know why yet.
|
||||
# Use the dllapp target to compile wxWindows for making a DLL app (not implemented yet)
|
||||
|
||||
#DLL=0
|
||||
|
||||
!if "$(WXUSINGDLL)" == "1"
|
||||
EXTRADLLFLAGS=/DWXUSINGDLL=1
|
||||
EXTRALNKFLAGS=/EXEC
|
||||
!endif
|
||||
|
||||
!if "$(WXMAKINGDLL)" == "1"
|
||||
EXTRADLLFLAGS=/DWXMAKINGDLL=1 /Ge- /D__OS2DLL__
|
||||
EXTRALNKFLAGS=/DLL
|
||||
!endif
|
||||
|
||||
!if "$(WXMAKINGDLL)" == "0" && "$(DLL)" == "1"
|
||||
EXTRADLLFLAGS=
|
||||
EXTRALNKFLAGS=/EXEC
|
||||
!endif
|
||||
|
||||
!ifndef FINAL
|
||||
FINAL=0
|
||||
DEBUG=1
|
||||
!endif
|
||||
|
||||
!ifndef DLL
|
||||
DLL=0
|
||||
!endif
|
||||
|
||||
# This sets 'D' to a suitable directory name
|
||||
# for this kind of build, and WXLIBNAME to one of wx (static release), wx_d (static debug),
|
||||
# wx200 (DLL release), wx200_d (DLL debug)
|
||||
|
||||
!if "$(WXMAKINGDLL)" == "1" || "$(WXUSINGDLL)" == "1"
|
||||
WXLIBNAME=wx200
|
||||
!else
|
||||
WXLIBNAME=wx
|
||||
!endif
|
||||
|
||||
!if "$(NEW_WXLIBNAME)" != ""
|
||||
WXLIBNAME=$(NEW_WXLIBNAME)
|
||||
!endif
|
||||
|
||||
!if "$(FINAL)" == "1"
|
||||
D=Release
|
||||
!else
|
||||
D=Debug
|
||||
!endif
|
||||
|
||||
WXLIB=$(WXDIR)\lib\$(WXLIBNAME).lib
|
||||
|
||||
!if "$(WXMAKINGDLL)" == "1" || "$(WXUSINGDLL)" == "1"
|
||||
D=$(D)DLL
|
||||
!endif
|
||||
|
||||
|
||||
INC=-I$(WXINC) -I$(WXDIR)/src/jpeg -I$(WXDIR)/src/zlib -I$(EXTRAINC)
|
||||
LIBS = $(EXTRALIBS) $(WXLIB) $(WINLIBS) $(WXDIR)\lib\jpeg.lib
|
||||
|
||||
MAKEPRECOMP=/FiWX/WXPREC.H
|
||||
OPTIONS=
|
||||
|
||||
!if "$(FINAL)" == "0"
|
||||
OPT =
|
||||
DEBUG_FLAGS= /Ti /D__WXDEBUG__ #/Fb
|
||||
LINK_DEBUG_FLAGS=/DEBUG
|
||||
CRTFLAG=/Gm /Gd
|
||||
!else
|
||||
# /O1 - smallest code
|
||||
# /O2 - fastest code
|
||||
OPT = /O+ /Oc /G5
|
||||
DEBUG_FLAGS=
|
||||
LINK_DEBUG_FLAGS=/RELEASE
|
||||
CRTFLAG=/Gm /Gd
|
||||
!endif
|
||||
|
||||
!if "$(DLL)" == "0"
|
||||
|
||||
!if "$(NOPCH)" == "1"
|
||||
PCH=
|
||||
PRECOMP=
|
||||
MAKEPRECOMP=
|
||||
!else
|
||||
PCH=$(WXLIBNAME).pch
|
||||
PRECOMP=/Si$(PCH)
|
||||
MAKEPRECOMP=/Fi$(PCH)
|
||||
!endif
|
||||
|
||||
CPPFLAGS=$(OS2FLAGS) $(DEBUG_FLAGS) $(PRECOMP) $(EXTRAFLAGS) /D__WXPM__ $(INC) $(OPT) $(EXTRADLLFLAGS) $(CRTFLAG) $(OVERRIDEFLAGS)
|
||||
# If you don't include wxprec.h, use CPPFLAGS2
|
||||
CPPFLAGS2=$(OS2FLAGS) $(DEBUG_FLAGS) /D__WXPM__ $(INC) $(EXTRAFLAGS) $(OPT) $(EXTRADLLFLAGS) $(CRTFLAG) $(OVERRIDEFLAGS)
|
||||
LINKFLAGS=$(LINK_DEBUG_FLAGS) $(OS2LINKFLAGS) $(EXTRALNKFLAGS)
|
||||
DUMMY=dummy
|
||||
|
||||
!else
|
||||
|
||||
!if "$(WXMAKINGDLL)" == "1"
|
||||
PCH=$(WXLIBNAME).pch
|
||||
DUMMY=dummydll
|
||||
!else
|
||||
PCH=$(WXLIBNAME).pch
|
||||
DUMMY=dummy
|
||||
!endif
|
||||
|
||||
PRECOMP=/SiWX/WXPREC.H
|
||||
CPPFLAGS=$(OS2FLAGS) $(DEBUG_FLAGS) $(PRECOMP) $(EXTRAFLAGS) /D__WXPM__ $(INC) $(OPT) $(CRTFLAG) $(EXTRADLLFLAGS)
|
||||
CPPFLAGS2=$(OS2FLAGS) $(DEBUG_FLAGS) /D__WXPM__ $(INC) $(EXTRAFLAGS) $(OPT) $(CRTFLAG) $(EXTRADLLFLAGS)
|
||||
LINKFLAGS=$(LINK_DEBUG_FLAGS) $(OS2LINKFLAGS) $(EXTRALNKFLAGS)
|
||||
!endif
|
||||
|
||||
DUMMYOBJ=$(WXDIR)\src\os2\$D\$(DUMMY).obj
|
||||
|
||||
.c.obj:
|
||||
icc @<<
|
||||
$(CPPFLAGS2) /Fo$@ /c $<
|
||||
<<
|
||||
|
||||
.cpp.obj:
|
||||
icc @<<
|
||||
$(CPPFLAGS2) /Fo$@ /c $<
|
||||
<<
|
||||
|
93
src/os2/accel.cpp
Normal file
93
src/os2/accel.cpp
Normal file
@ -0,0 +1,93 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: accel.cpp
|
||||
// Purpose: wxAcceleratorTable
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "accel.h"
|
||||
#endif
|
||||
|
||||
#include "wx/setup.h"
|
||||
#include "wx/accel.h"
|
||||
#include "wx/string.h"
|
||||
|
||||
#if !USE_SHARED_LIBRARIES
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxAcceleratorTable, wxObject)
|
||||
#endif
|
||||
|
||||
class WXDLLEXPORT wxAcceleratorRefData: public wxObjectRefData
|
||||
{
|
||||
friend class WXDLLEXPORT wxAcceleratorTable;
|
||||
public:
|
||||
wxAcceleratorRefData();
|
||||
~wxAcceleratorRefData();
|
||||
|
||||
/* TODO: implementation
|
||||
inline HACCEL GetHACCEL() const { return m_hAccel; }
|
||||
protected:
|
||||
HACCEL m_hAccel;
|
||||
*/
|
||||
};
|
||||
|
||||
#define M_ACCELDATA ((wxAcceleratorRefData *)m_refData)
|
||||
|
||||
wxAcceleratorRefData::wxAcceleratorRefData()
|
||||
{
|
||||
// TODO
|
||||
/*
|
||||
HACCEL m_hAccel;
|
||||
*/
|
||||
}
|
||||
|
||||
wxAcceleratorRefData::~wxAcceleratorRefData()
|
||||
{
|
||||
/*
|
||||
if (m_hAccel)
|
||||
{
|
||||
DestroyAcceleratorTable((HACCEL) m_hAccel);
|
||||
}
|
||||
m_hAccel = 0 ;
|
||||
*/
|
||||
}
|
||||
|
||||
wxAcceleratorTable::wxAcceleratorTable()
|
||||
{
|
||||
m_refData = NULL;
|
||||
}
|
||||
|
||||
wxAcceleratorTable::~wxAcceleratorTable()
|
||||
{
|
||||
}
|
||||
|
||||
// Load from .rc resource
|
||||
wxAcceleratorTable::wxAcceleratorTable(const wxString& resource)
|
||||
{
|
||||
m_refData = new wxAcceleratorRefData;
|
||||
|
||||
/* TODO: load acelerator from resource, if appropriate for your platform
|
||||
M_ACCELDATA->m_hAccel = hAccel;
|
||||
M_ACCELDATA->m_ok = (hAccel != 0);
|
||||
*/
|
||||
}
|
||||
|
||||
// Create from an array
|
||||
wxAcceleratorTable::wxAcceleratorTable(int n, wxAcceleratorEntry entries[])
|
||||
{
|
||||
m_refData = new wxAcceleratorRefData;
|
||||
|
||||
/* TODO: create table from entries
|
||||
*/
|
||||
}
|
||||
|
||||
bool wxAcceleratorTable::Ok() const
|
||||
{
|
||||
// TODO
|
||||
return FALSE;
|
||||
}
|
||||
|
391
src/os2/app.cpp
Normal file
391
src/os2/app.cpp
Normal file
@ -0,0 +1,391 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: app.cpp
|
||||
// Purpose: wxApp
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "app.h"
|
||||
#endif
|
||||
|
||||
#include "wx/frame.h"
|
||||
#include "wx/app.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/gdicmn.h"
|
||||
#include "wx/pen.h"
|
||||
#include "wx/brush.h"
|
||||
#include "wx/cursor.h"
|
||||
#include "wx/icon.h"
|
||||
#include "wx/palette.h"
|
||||
#include "wx/dc.h"
|
||||
#include "wx/dialog.h"
|
||||
#include "wx/msgdlg.h"
|
||||
#include "wx/log.h"
|
||||
#include "wx/module.h"
|
||||
#include "wx/memory.h"
|
||||
|
||||
#if wxUSE_WX_RESOURCES
|
||||
#include "wx/resource.h"
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
|
||||
extern char *wxBuffer;
|
||||
extern wxList wxPendingDelete;
|
||||
|
||||
wxApp *wxTheApp = NULL;
|
||||
|
||||
#if !USE_SHARED_LIBRARY
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxApp, wxEvtHandler)
|
||||
BEGIN_EVENT_TABLE(wxApp, wxEvtHandler)
|
||||
EVT_IDLE(wxApp::OnIdle)
|
||||
END_EVENT_TABLE()
|
||||
#endif
|
||||
|
||||
long wxApp::sm_lastMessageTime = 0;
|
||||
|
||||
bool wxApp::Initialize()
|
||||
{
|
||||
#ifdef __WXMSW__
|
||||
wxBuffer = new char[1500];
|
||||
#else
|
||||
wxBuffer = new char[BUFSIZ + 512];
|
||||
#endif
|
||||
|
||||
/* No longer used
|
||||
#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
|
||||
|
||||
streambuf* sBuf = new wxDebugStreamBuf;
|
||||
ostream* oStr = new ostream(sBuf) ;
|
||||
wxDebugContext::SetStream(oStr, sBuf);
|
||||
#endif
|
||||
*/
|
||||
|
||||
wxClassInfo::InitializeClasses();
|
||||
|
||||
wxTheColourDatabase = new wxColourDatabase(wxKEY_STRING);
|
||||
wxTheColourDatabase->Initialize();
|
||||
|
||||
wxInitializeStockLists();
|
||||
wxInitializeStockObjects();
|
||||
|
||||
#if wxUSE_WX_RESOURCES
|
||||
wxInitializeResourceSystem();
|
||||
#endif
|
||||
|
||||
wxBitmap::InitStandardHandlers();
|
||||
|
||||
wxModule::RegisterModules();
|
||||
wxASSERT( wxModule::InitializeModules() == TRUE );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void wxApp::CleanUp()
|
||||
{
|
||||
wxModule::CleanUpModules();
|
||||
|
||||
#if wxUSE_WX_RESOURCES
|
||||
wxCleanUpResourceSystem();
|
||||
#endif
|
||||
|
||||
wxDeleteStockObjects() ;
|
||||
|
||||
// Destroy all GDI lists, etc.
|
||||
|
||||
delete wxTheBrushList;
|
||||
wxTheBrushList = NULL;
|
||||
|
||||
delete wxThePenList;
|
||||
wxThePenList = NULL;
|
||||
|
||||
delete wxTheFontList;
|
||||
wxTheFontList = NULL;
|
||||
|
||||
delete wxTheBitmapList;
|
||||
wxTheBitmapList = NULL;
|
||||
|
||||
delete wxTheColourDatabase;
|
||||
wxTheColourDatabase = NULL;
|
||||
|
||||
wxBitmap::CleanUpHandlers();
|
||||
|
||||
delete[] wxBuffer;
|
||||
wxBuffer = NULL;
|
||||
|
||||
wxClassInfo::CleanUpClasses();
|
||||
|
||||
delete wxTheApp;
|
||||
wxTheApp = NULL;
|
||||
|
||||
#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
|
||||
// At this point we want to check if there are any memory
|
||||
// blocks that aren't part of the wxDebugContext itself,
|
||||
// as a special case. Then when dumping we need to ignore
|
||||
// wxDebugContext, too.
|
||||
if (wxDebugContext::CountObjectsLeft() > 0)
|
||||
{
|
||||
wxTrace("There were memory leaks.\n");
|
||||
wxDebugContext::Dump();
|
||||
wxDebugContext::PrintStatistics();
|
||||
}
|
||||
// wxDebugContext::SetStream(NULL, NULL);
|
||||
#endif
|
||||
|
||||
// do it as the very last thing because everything else can log messages
|
||||
wxLog::DontCreateOnDemand();
|
||||
// do it as the very last thing because everything else can log messages
|
||||
delete wxLog::SetActiveTarget(NULL);
|
||||
}
|
||||
|
||||
int wxEntry( int argc, char *argv[] )
|
||||
{
|
||||
if (!wxApp::Initialize())
|
||||
return FALSE;
|
||||
if (!wxTheApp)
|
||||
{
|
||||
if (!wxApp::GetInitializerFunction())
|
||||
{
|
||||
printf( "wxWindows error: No initializer - use IMPLEMENT_APP macro.\n" );
|
||||
return 0;
|
||||
};
|
||||
|
||||
wxTheApp = (wxApp*) (* wxApp::GetInitializerFunction()) ();
|
||||
};
|
||||
|
||||
if (!wxTheApp)
|
||||
{
|
||||
printf( "wxWindows error: wxTheApp == NULL\n" );
|
||||
return 0;
|
||||
};
|
||||
|
||||
wxTheApp->argc = argc;
|
||||
wxTheApp->argv = argv;
|
||||
|
||||
// GUI-specific initialization, such as creating an app context.
|
||||
wxTheApp->OnInitGui();
|
||||
|
||||
// Here frames insert themselves automatically
|
||||
// into wxTopLevelWindows by getting created
|
||||
// in OnInit().
|
||||
|
||||
if (!wxTheApp->OnInit()) return 0;
|
||||
|
||||
int retValue = 0;
|
||||
|
||||
if (wxTheApp->Initialized()) retValue = wxTheApp->OnRun();
|
||||
|
||||
if (wxTheApp->GetTopWindow())
|
||||
{
|
||||
delete wxTheApp->GetTopWindow();
|
||||
wxTheApp->SetTopWindow(NULL);
|
||||
}
|
||||
|
||||
wxTheApp->DeletePendingObjects();
|
||||
|
||||
wxTheApp->OnExit();
|
||||
|
||||
wxApp::CleanUp();
|
||||
|
||||
return retValue;
|
||||
};
|
||||
|
||||
// Static member initialization
|
||||
wxAppInitializerFunction wxApp::m_appInitFn = (wxAppInitializerFunction) NULL;
|
||||
|
||||
wxApp::wxApp()
|
||||
{
|
||||
m_topWindow = NULL;
|
||||
wxTheApp = this;
|
||||
m_className = "";
|
||||
m_wantDebugOutput = TRUE ;
|
||||
m_appName = "";
|
||||
argc = 0;
|
||||
argv = NULL;
|
||||
#ifdef __WXMSW__
|
||||
m_printMode = wxPRINT_WINDOWS;
|
||||
#else
|
||||
m_printMode = wxPRINT_POSTSCRIPT;
|
||||
#endif
|
||||
m_exitOnFrameDelete = TRUE;
|
||||
m_auto3D = TRUE;
|
||||
}
|
||||
|
||||
bool wxApp::Initialized()
|
||||
{
|
||||
if (GetTopWindow())
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
int wxApp::MainLoop()
|
||||
{
|
||||
m_keepGoing = TRUE;
|
||||
|
||||
/* TODO: implement your main loop here, calling ProcessIdle in idle time.
|
||||
while (m_keepGoing)
|
||||
{
|
||||
while (!::PeekMessage(&s_currentMsg, 0, 0, 0, PM_NOREMOVE) &&
|
||||
ProcessIdle()) {}
|
||||
if (!DoMessage())
|
||||
m_keepGoing = FALSE;
|
||||
}
|
||||
*/
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Returns TRUE if more time is needed.
|
||||
bool wxApp::ProcessIdle()
|
||||
{
|
||||
wxIdleEvent event;
|
||||
event.SetEventObject(this);
|
||||
ProcessEvent(event);
|
||||
|
||||
return event.MoreRequested();
|
||||
}
|
||||
|
||||
void wxApp::ExitMainLoop()
|
||||
{
|
||||
m_keepGoing = FALSE;
|
||||
}
|
||||
|
||||
// Is a message/event pending?
|
||||
bool wxApp::Pending()
|
||||
{
|
||||
/* TODO.
|
||||
*/
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Dispatch a message.
|
||||
void wxApp::Dispatch()
|
||||
{
|
||||
/* TODO.
|
||||
*/
|
||||
}
|
||||
|
||||
void wxApp::OnIdle(wxIdleEvent& event)
|
||||
{
|
||||
static bool inOnIdle = FALSE;
|
||||
|
||||
// Avoid recursion (via ProcessEvent default case)
|
||||
if (inOnIdle)
|
||||
return;
|
||||
|
||||
inOnIdle = TRUE;
|
||||
|
||||
// 'Garbage' collection of windows deleted with Close().
|
||||
DeletePendingObjects();
|
||||
|
||||
// flush the logged messages if any
|
||||
wxLog *pLog = wxLog::GetActiveTarget();
|
||||
if ( pLog != NULL && pLog->HasPendingMessages() )
|
||||
pLog->Flush();
|
||||
|
||||
// Send OnIdle events to all windows
|
||||
bool needMore = SendIdleEvents();
|
||||
|
||||
if (needMore)
|
||||
event.RequestMore(TRUE);
|
||||
|
||||
inOnIdle = FALSE;
|
||||
}
|
||||
|
||||
// Send idle event to all top-level windows
|
||||
bool wxApp::SendIdleEvents()
|
||||
{
|
||||
bool needMore = FALSE;
|
||||
wxNode* node = wxTopLevelWindows.First();
|
||||
while (node)
|
||||
{
|
||||
wxWindow* win = (wxWindow*) node->Data();
|
||||
if (SendIdleEvents(win))
|
||||
needMore = TRUE;
|
||||
|
||||
node = node->Next();
|
||||
}
|
||||
return needMore;
|
||||
}
|
||||
|
||||
// Send idle event to window and all subwindows
|
||||
bool wxApp::SendIdleEvents(wxWindow* win)
|
||||
{
|
||||
bool needMore = FALSE;
|
||||
|
||||
wxIdleEvent event;
|
||||
event.SetEventObject(win);
|
||||
win->ProcessEvent(event);
|
||||
|
||||
if (event.MoreRequested())
|
||||
needMore = TRUE;
|
||||
|
||||
wxNode* node = win->GetChildren().First();
|
||||
while (node)
|
||||
{
|
||||
wxWindow* win = (wxWindow*) node->Data();
|
||||
if (SendIdleEvents(win))
|
||||
needMore = TRUE;
|
||||
|
||||
node = node->Next();
|
||||
}
|
||||
return needMore ;
|
||||
}
|
||||
|
||||
void wxApp::DeletePendingObjects()
|
||||
{
|
||||
wxNode *node = wxPendingDelete.First();
|
||||
while (node)
|
||||
{
|
||||
wxObject *obj = (wxObject *)node->Data();
|
||||
|
||||
delete obj;
|
||||
|
||||
if (wxPendingDelete.Member(obj))
|
||||
delete node;
|
||||
|
||||
// Deleting one object may have deleted other pending
|
||||
// objects, so start from beginning of list again.
|
||||
node = wxPendingDelete.First();
|
||||
}
|
||||
}
|
||||
|
||||
wxLog* wxApp::CreateLogTarget()
|
||||
{
|
||||
return new wxLogGui;
|
||||
}
|
||||
|
||||
wxWindow* wxApp::GetTopWindow() const
|
||||
{
|
||||
if (m_topWindow)
|
||||
return m_topWindow;
|
||||
else if (wxTopLevelWindows.Number() > 0)
|
||||
return (wxWindow*) wxTopLevelWindows.First()->Data();
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void wxExit()
|
||||
{
|
||||
wxApp::CleanUp();
|
||||
/*
|
||||
* TODO: Exit in some platform-specific way. Not recommended that the app calls this:
|
||||
* only for emergencies.
|
||||
*/
|
||||
}
|
||||
|
||||
// Yield to other processes
|
||||
bool wxYield()
|
||||
{
|
||||
/*
|
||||
* TODO
|
||||
*/
|
||||
return TRUE;
|
||||
}
|
||||
|
430
src/os2/bitmap.cpp
Normal file
430
src/os2/bitmap.cpp
Normal file
@ -0,0 +1,430 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: bitmap.cpp
|
||||
// Purpose: wxBitmap
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "bitmap.h"
|
||||
#endif
|
||||
|
||||
#include "wx/setup.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/palette.h"
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/icon.h"
|
||||
#include "wx/log.h"
|
||||
|
||||
#if !USE_SHARED_LIBRARIES
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxBitmap, wxGDIObject)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxMask, wxObject)
|
||||
#endif
|
||||
|
||||
wxBitmapRefData::wxBitmapRefData()
|
||||
{
|
||||
m_ok = FALSE;
|
||||
m_width = 0;
|
||||
m_height = 0;
|
||||
m_depth = 0;
|
||||
m_quality = 0;
|
||||
m_numColors = 0;
|
||||
m_bitmapMask = NULL;
|
||||
}
|
||||
|
||||
wxBitmapRefData::~wxBitmapRefData()
|
||||
{
|
||||
/*
|
||||
* TODO: delete the bitmap data here.
|
||||
*/
|
||||
|
||||
if (m_bitmapMask)
|
||||
delete m_bitmapMask;
|
||||
m_bitmapMask = NULL;
|
||||
}
|
||||
|
||||
wxList wxBitmap::sm_handlers;
|
||||
|
||||
wxBitmap::wxBitmap()
|
||||
{
|
||||
m_refData = NULL;
|
||||
|
||||
if ( wxTheBitmapList )
|
||||
wxTheBitmapList->AddBitmap(this);
|
||||
}
|
||||
|
||||
wxBitmap::~wxBitmap()
|
||||
{
|
||||
if (wxTheBitmapList)
|
||||
wxTheBitmapList->DeleteObject(this);
|
||||
}
|
||||
|
||||
wxBitmap::wxBitmap(const char bits[], int the_width, int the_height, int no_bits)
|
||||
{
|
||||
m_refData = new wxBitmapRefData;
|
||||
|
||||
M_BITMAPDATA->m_width = the_width ;
|
||||
M_BITMAPDATA->m_height = the_height ;
|
||||
M_BITMAPDATA->m_depth = no_bits ;
|
||||
M_BITMAPDATA->m_numColors = 0;
|
||||
|
||||
/* TODO: create the bitmap from data */
|
||||
|
||||
if ( wxTheBitmapList )
|
||||
wxTheBitmapList->AddBitmap(this);
|
||||
}
|
||||
|
||||
wxBitmap::wxBitmap(int w, int h, int d)
|
||||
{
|
||||
(void)Create(w, h, d);
|
||||
|
||||
if ( wxTheBitmapList )
|
||||
wxTheBitmapList->AddBitmap(this);
|
||||
}
|
||||
|
||||
wxBitmap::wxBitmap(void *data, long type, int width, int height, int depth)
|
||||
{
|
||||
(void) Create(data, type, width, height, depth);
|
||||
|
||||
if ( wxTheBitmapList )
|
||||
wxTheBitmapList->AddBitmap(this);
|
||||
}
|
||||
|
||||
wxBitmap::wxBitmap(const wxString& filename, long type)
|
||||
{
|
||||
LoadFile(filename, (int)type);
|
||||
|
||||
if ( wxTheBitmapList )
|
||||
wxTheBitmapList->AddBitmap(this);
|
||||
}
|
||||
|
||||
/* TODO: maybe allow creation from XPM
|
||||
// Create from data
|
||||
wxBitmap::wxBitmap(const char **data)
|
||||
{
|
||||
(void) Create((void *)data, wxBITMAP_TYPE_XPM_DATA, 0, 0, 0);
|
||||
}
|
||||
*/
|
||||
|
||||
bool wxBitmap::Create(int w, int h, int d)
|
||||
{
|
||||
UnRef();
|
||||
|
||||
m_refData = new wxBitmapRefData;
|
||||
|
||||
M_BITMAPDATA->m_width = w;
|
||||
M_BITMAPDATA->m_height = h;
|
||||
M_BITMAPDATA->m_depth = d;
|
||||
|
||||
/* TODO: create new bitmap */
|
||||
|
||||
return M_BITMAPDATA->m_ok;
|
||||
}
|
||||
|
||||
bool wxBitmap::LoadFile(const wxString& filename, long type)
|
||||
{
|
||||
UnRef();
|
||||
|
||||
m_refData = new wxBitmapRefData;
|
||||
|
||||
wxBitmapHandler *handler = FindHandler(type);
|
||||
|
||||
if ( handler == NULL ) {
|
||||
wxLogWarning("no bitmap handler for type %d defined.", type);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return handler->LoadFile(this, filename, type, -1, -1);
|
||||
}
|
||||
|
||||
bool wxBitmap::Create(void *data, long type, int width, int height, int depth)
|
||||
{
|
||||
UnRef();
|
||||
|
||||
m_refData = new wxBitmapRefData;
|
||||
|
||||
wxBitmapHandler *handler = FindHandler(type);
|
||||
|
||||
if ( handler == NULL ) {
|
||||
wxLogWarning("no bitmap handler for type %d defined.", type);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return handler->Create(this, data, type, width, height, depth);
|
||||
}
|
||||
|
||||
bool wxBitmap::SaveFile(const wxString& filename, int type, const wxPalette *palette)
|
||||
{
|
||||
wxBitmapHandler *handler = FindHandler(type);
|
||||
|
||||
if ( handler == NULL ) {
|
||||
wxLogWarning("no bitmap handler for type %d defined.", type);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return handler->SaveFile(this, filename, type, palette);
|
||||
}
|
||||
|
||||
void wxBitmap::SetWidth(int w)
|
||||
{
|
||||
if (!M_BITMAPDATA)
|
||||
m_refData = new wxBitmapRefData;
|
||||
|
||||
M_BITMAPDATA->m_width = w;
|
||||
}
|
||||
|
||||
void wxBitmap::SetHeight(int h)
|
||||
{
|
||||
if (!M_BITMAPDATA)
|
||||
m_refData = new wxBitmapRefData;
|
||||
|
||||
M_BITMAPDATA->m_height = h;
|
||||
}
|
||||
|
||||
void wxBitmap::SetDepth(int d)
|
||||
{
|
||||
if (!M_BITMAPDATA)
|
||||
m_refData = new wxBitmapRefData;
|
||||
|
||||
M_BITMAPDATA->m_depth = d;
|
||||
}
|
||||
|
||||
void wxBitmap::SetQuality(int q)
|
||||
{
|
||||
if (!M_BITMAPDATA)
|
||||
m_refData = new wxBitmapRefData;
|
||||
|
||||
M_BITMAPDATA->m_quality = q;
|
||||
}
|
||||
|
||||
void wxBitmap::SetOk(bool isOk)
|
||||
{
|
||||
if (!M_BITMAPDATA)
|
||||
m_refData = new wxBitmapRefData;
|
||||
|
||||
M_BITMAPDATA->m_ok = isOk;
|
||||
}
|
||||
|
||||
void wxBitmap::SetPalette(const wxPalette& palette)
|
||||
{
|
||||
if (!M_BITMAPDATA)
|
||||
m_refData = new wxBitmapRefData;
|
||||
|
||||
M_BITMAPDATA->m_bitmapPalette = palette ;
|
||||
}
|
||||
|
||||
void wxBitmap::SetMask(wxMask *mask)
|
||||
{
|
||||
if (!M_BITMAPDATA)
|
||||
m_refData = new wxBitmapRefData;
|
||||
|
||||
M_BITMAPDATA->m_bitmapMask = mask ;
|
||||
}
|
||||
|
||||
void wxBitmap::AddHandler(wxBitmapHandler *handler)
|
||||
{
|
||||
sm_handlers.Append(handler);
|
||||
}
|
||||
|
||||
void wxBitmap::InsertHandler(wxBitmapHandler *handler)
|
||||
{
|
||||
sm_handlers.Insert(handler);
|
||||
}
|
||||
|
||||
bool wxBitmap::RemoveHandler(const wxString& name)
|
||||
{
|
||||
wxBitmapHandler *handler = FindHandler(name);
|
||||
if ( handler )
|
||||
{
|
||||
sm_handlers.DeleteObject(handler);
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
wxBitmapHandler *wxBitmap::FindHandler(const wxString& name)
|
||||
{
|
||||
wxNode *node = sm_handlers.First();
|
||||
while ( node )
|
||||
{
|
||||
wxBitmapHandler *handler = (wxBitmapHandler *)node->Data();
|
||||
if ( handler->GetName() == name )
|
||||
return handler;
|
||||
node = node->Next();
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
wxBitmapHandler *wxBitmap::FindHandler(const wxString& extension, long bitmapType)
|
||||
{
|
||||
wxNode *node = sm_handlers.First();
|
||||
while ( node )
|
||||
{
|
||||
wxBitmapHandler *handler = (wxBitmapHandler *)node->Data();
|
||||
if ( handler->GetExtension() == extension &&
|
||||
(bitmapType == -1 || handler->GetType() == bitmapType) )
|
||||
return handler;
|
||||
node = node->Next();
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
wxBitmapHandler *wxBitmap::FindHandler(long bitmapType)
|
||||
{
|
||||
wxNode *node = sm_handlers.First();
|
||||
while ( node )
|
||||
{
|
||||
wxBitmapHandler *handler = (wxBitmapHandler *)node->Data();
|
||||
if (handler->GetType() == bitmapType)
|
||||
return handler;
|
||||
node = node->Next();
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* wxMask
|
||||
*/
|
||||
|
||||
wxMask::wxMask()
|
||||
{
|
||||
/* TODO
|
||||
m_maskBitmap = 0;
|
||||
*/
|
||||
}
|
||||
|
||||
// Construct a mask from a bitmap and a colour indicating
|
||||
// the transparent area
|
||||
wxMask::wxMask(const wxBitmap& bitmap, const wxColour& colour)
|
||||
{
|
||||
/* TODO
|
||||
m_maskBitmap = 0;
|
||||
*/
|
||||
Create(bitmap, colour);
|
||||
}
|
||||
|
||||
// Construct a mask from a bitmap and a palette index indicating
|
||||
// the transparent area
|
||||
wxMask::wxMask(const wxBitmap& bitmap, int paletteIndex)
|
||||
{
|
||||
/* TODO
|
||||
m_maskBitmap = 0;
|
||||
*/
|
||||
|
||||
Create(bitmap, paletteIndex);
|
||||
}
|
||||
|
||||
// Construct a mask from a mono bitmap (copies the bitmap).
|
||||
wxMask::wxMask(const wxBitmap& bitmap)
|
||||
{
|
||||
/* TODO
|
||||
m_maskBitmap = 0;
|
||||
*/
|
||||
|
||||
Create(bitmap);
|
||||
}
|
||||
|
||||
wxMask::~wxMask()
|
||||
{
|
||||
// TODO: delete mask bitmap
|
||||
}
|
||||
|
||||
// Create a mask from a mono bitmap (copies the bitmap).
|
||||
bool wxMask::Create(const wxBitmap& bitmap)
|
||||
{
|
||||
// TODO
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Create a mask from a bitmap and a palette index indicating
|
||||
// the transparent area
|
||||
bool wxMask::Create(const wxBitmap& bitmap, int paletteIndex)
|
||||
{
|
||||
// TODO
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Create a mask from a bitmap and a colour indicating
|
||||
// the transparent area
|
||||
bool wxMask::Create(const wxBitmap& bitmap, const wxColour& colour)
|
||||
{
|
||||
// TODO
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* wxBitmapHandler
|
||||
*/
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxBitmapHandler, wxObject)
|
||||
|
||||
bool wxBitmapHandler::Create(wxBitmap *bitmap, void *data, long type, int width, int height, int depth)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool wxBitmapHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long type,
|
||||
int desiredWidth, int desiredHeight)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool wxBitmapHandler::SaveFile(wxBitmap *bitmap, const wxString& name, int type, const wxPalette *palette)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Standard handlers
|
||||
*/
|
||||
|
||||
/* TODO: bitmap handlers, a bit like this:
|
||||
class WXDLLEXPORT wxBMPResourceHandler: public wxBitmapHandler
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxBMPResourceHandler)
|
||||
public:
|
||||
inline wxBMPResourceHandler()
|
||||
{
|
||||
m_name = "Windows bitmap resource";
|
||||
m_extension = "";
|
||||
m_type = wxBITMAP_TYPE_BMP_RESOURCE;
|
||||
};
|
||||
|
||||
virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
|
||||
int desiredWidth, int desiredHeight);
|
||||
};
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxBMPResourceHandler, wxBitmapHandler)
|
||||
*/
|
||||
|
||||
void wxBitmap::CleanUpHandlers()
|
||||
{
|
||||
wxNode *node = sm_handlers.First();
|
||||
while ( node )
|
||||
{
|
||||
wxBitmapHandler *handler = (wxBitmapHandler *)node->Data();
|
||||
wxNode *next = node->Next();
|
||||
delete handler;
|
||||
delete node;
|
||||
node = next;
|
||||
}
|
||||
}
|
||||
|
||||
void wxBitmap::InitStandardHandlers()
|
||||
{
|
||||
/* TODO: initialize all standard bitmap or derive class handlers here.
|
||||
AddHandler(new wxBMPResourceHandler);
|
||||
AddHandler(new wxBMPFileHandler);
|
||||
AddHandler(new wxXPMFileHandler);
|
||||
AddHandler(new wxXPMDataHandler);
|
||||
AddHandler(new wxICOResourceHandler);
|
||||
AddHandler(new wxICOFileHandler);
|
||||
*/
|
||||
}
|
65
src/os2/bmpbuttn.cpp
Normal file
65
src/os2/bmpbuttn.cpp
Normal file
@ -0,0 +1,65 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: bmpbuttn.cpp
|
||||
// Purpose: wxBitmapButton
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "bmpbuttn.h"
|
||||
#endif
|
||||
|
||||
#include "wx/bmpbuttn.h"
|
||||
|
||||
#if !USE_SHARED_LIBRARY
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton, wxButton)
|
||||
#endif
|
||||
|
||||
bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size, long style,
|
||||
const wxValidator& validator,
|
||||
const wxString& name)
|
||||
{
|
||||
m_buttonBitmap = bitmap;
|
||||
SetName(name);
|
||||
SetValidator(validator);
|
||||
parent->AddChild(this);
|
||||
|
||||
m_backgroundColour = parent->GetBackgroundColour() ;
|
||||
m_foregroundColour = parent->GetForegroundColour() ;
|
||||
m_windowStyle = style;
|
||||
m_marginX = 0;
|
||||
m_marginY = 0;
|
||||
|
||||
int x = pos.x;
|
||||
int y = pos.y;
|
||||
int width = size.x;
|
||||
int height = size.y;
|
||||
|
||||
if (id == -1)
|
||||
m_windowId = NewControlId();
|
||||
else
|
||||
m_windowId = id;
|
||||
|
||||
if ( width == -1 && bitmap.Ok())
|
||||
width = bitmap.GetWidth() + 2*m_marginX;
|
||||
|
||||
if ( height == -1 && bitmap.Ok())
|
||||
height = bitmap.GetHeight() + 2*m_marginY;
|
||||
|
||||
/* TODO: create bitmap button
|
||||
*/
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void wxBitmapButton::SetBitmapLabel(const wxBitmap& bitmap)
|
||||
{
|
||||
m_buttonBitmap = bitmap;
|
||||
}
|
||||
|
140
src/os2/brush.cpp
Normal file
140
src/os2/brush.cpp
Normal file
@ -0,0 +1,140 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: brush.cpp
|
||||
// Purpose: wxBrush
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "brush.h"
|
||||
#endif
|
||||
|
||||
#include "wx/setup.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/brush.h"
|
||||
|
||||
#if !USE_SHARED_LIBRARIES
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxBrush, wxGDIObject)
|
||||
#endif
|
||||
|
||||
wxBrushRefData::wxBrushRefData()
|
||||
{
|
||||
m_style = wxSOLID;
|
||||
// TODO: null data
|
||||
}
|
||||
|
||||
wxBrushRefData::wxBrushRefData(const wxBrushRefData& data)
|
||||
{
|
||||
m_style = data.m_style;
|
||||
m_stipple = data.m_stipple;
|
||||
m_colour = data.m_colour;
|
||||
/* TODO: null data
|
||||
m_hBrush = 0;
|
||||
*/
|
||||
}
|
||||
|
||||
wxBrushRefData::~wxBrushRefData()
|
||||
{
|
||||
// TODO: delete data
|
||||
}
|
||||
|
||||
// Brushes
|
||||
wxBrush::wxBrush()
|
||||
{
|
||||
if ( wxTheBrushList )
|
||||
wxTheBrushList->AddBrush(this);
|
||||
}
|
||||
|
||||
wxBrush::~wxBrush()
|
||||
{
|
||||
if ( wxTheBrushList )
|
||||
wxTheBrushList->RemoveBrush(this);
|
||||
}
|
||||
|
||||
wxBrush::wxBrush(const wxColour& col, int Style)
|
||||
{
|
||||
m_refData = new wxBrushRefData;
|
||||
|
||||
M_BRUSHDATA->m_colour = col;
|
||||
M_BRUSHDATA->m_style = Style;
|
||||
|
||||
RealizeResource();
|
||||
|
||||
if ( wxTheBrushList )
|
||||
wxTheBrushList->AddBrush(this);
|
||||
}
|
||||
|
||||
wxBrush::wxBrush(const wxBitmap& stipple)
|
||||
{
|
||||
m_refData = new wxBrushRefData;
|
||||
|
||||
M_BRUSHDATA->m_style = wxSTIPPLE;
|
||||
M_BRUSHDATA->m_stipple = stipple;
|
||||
|
||||
RealizeResource();
|
||||
|
||||
if ( wxTheBrushList )
|
||||
wxTheBrushList->AddBrush(this);
|
||||
}
|
||||
|
||||
void wxBrush::Unshare()
|
||||
{
|
||||
// Don't change shared data
|
||||
if (!m_refData)
|
||||
{
|
||||
m_refData = new wxBrushRefData();
|
||||
}
|
||||
else
|
||||
{
|
||||
wxBrushRefData* ref = new wxBrushRefData(*(wxBrushRefData*)m_refData);
|
||||
UnRef();
|
||||
m_refData = ref;
|
||||
}
|
||||
}
|
||||
|
||||
void wxBrush::SetColour(const wxColour& col)
|
||||
{
|
||||
Unshare();
|
||||
|
||||
M_BRUSHDATA->m_colour = col;
|
||||
|
||||
RealizeResource();
|
||||
}
|
||||
|
||||
void wxBrush::SetColour(unsigned char r, unsigned char g, unsigned char b)
|
||||
{
|
||||
Unshare();
|
||||
|
||||
M_BRUSHDATA->m_colour.Set(r, g, b);
|
||||
|
||||
RealizeResource();
|
||||
}
|
||||
|
||||
void wxBrush::SetStyle(int Style)
|
||||
{
|
||||
Unshare();
|
||||
|
||||
M_BRUSHDATA->m_style = Style;
|
||||
|
||||
RealizeResource();
|
||||
}
|
||||
|
||||
void wxBrush::SetStipple(const wxBitmap& Stipple)
|
||||
{
|
||||
Unshare();
|
||||
|
||||
M_BRUSHDATA->m_stipple = Stipple;
|
||||
|
||||
RealizeResource();
|
||||
}
|
||||
|
||||
bool wxBrush::RealizeResource()
|
||||
{
|
||||
// TODO: create the brush
|
||||
return FALSE;
|
||||
}
|
||||
|
75
src/os2/button.cpp
Normal file
75
src/os2/button.cpp
Normal file
@ -0,0 +1,75 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: button.cpp
|
||||
// Purpose: wxButton
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "button.h"
|
||||
#endif
|
||||
|
||||
#include "wx/button.h"
|
||||
|
||||
#if !USE_SHARED_LIBRARY
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxButton, wxControl)
|
||||
#endif
|
||||
|
||||
// Button
|
||||
|
||||
bool wxButton::Create(wxWindow *parent, wxWindowID id, const wxString& label,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size, long style,
|
||||
const wxValidator& validator,
|
||||
const wxString& name)
|
||||
{
|
||||
SetName(name);
|
||||
SetValidator(validator);
|
||||
m_windowStyle = style;
|
||||
|
||||
parent->AddChild((wxButton *)this);
|
||||
|
||||
if (id == -1)
|
||||
m_windowId = NewControlId();
|
||||
else
|
||||
m_windowId = id;
|
||||
|
||||
// TODO: create button
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void wxButton::SetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void wxButton::SetDefault()
|
||||
{
|
||||
wxWindow *parent = (wxWindow *)GetParent();
|
||||
if (parent)
|
||||
parent->SetDefaultItem(this);
|
||||
|
||||
// TODO: make button the default
|
||||
}
|
||||
|
||||
wxString wxButton::GetLabel() const
|
||||
{
|
||||
// TODO
|
||||
return wxString("");
|
||||
}
|
||||
|
||||
void wxButton::SetLabel(const wxString& label)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void wxButton::Command (wxCommandEvent & event)
|
||||
{
|
||||
ProcessCommand (event);
|
||||
}
|
||||
|
117
src/os2/checkbox.cpp
Normal file
117
src/os2/checkbox.cpp
Normal file
@ -0,0 +1,117 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: checkbox.cpp
|
||||
// Purpose: wxCheckBox
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: 04/01/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "checkbox.h"
|
||||
#endif
|
||||
|
||||
#include "wx/checkbox.h"
|
||||
|
||||
#if !USE_SHARED_LIBRARY
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxCheckBox, wxControl)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxBitmapCheckBox, wxCheckBox)
|
||||
#endif
|
||||
|
||||
// Single check box item
|
||||
bool wxCheckBox::Create(wxWindow *parent, wxWindowID id, const wxString& label,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size, long style,
|
||||
const wxValidator& validator,
|
||||
const wxString& name)
|
||||
{
|
||||
SetName(name);
|
||||
SetValidator(validator);
|
||||
m_windowStyle = style;
|
||||
|
||||
if (parent) parent->AddChild(this);
|
||||
|
||||
if ( id == -1 )
|
||||
m_windowId = NewControlId();
|
||||
else
|
||||
m_windowId = id;
|
||||
|
||||
// TODO: create checkbox
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void wxCheckBox::SetLabel(const wxString& label)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void wxCheckBox::SetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void wxCheckBox::SetValue(bool val)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
bool wxCheckBox::GetValue() const
|
||||
{
|
||||
// TODO
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void wxCheckBox::Command (wxCommandEvent & event)
|
||||
{
|
||||
SetValue ((event.GetInt() != 0));
|
||||
ProcessCommand (event);
|
||||
}
|
||||
|
||||
// Bitmap checkbox
|
||||
bool wxBitmapCheckBox::Create(wxWindow *parent, wxWindowID id, const wxBitmap *label,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size, long style,
|
||||
const wxValidator& validator,
|
||||
const wxString& name)
|
||||
{
|
||||
SetName(name);
|
||||
SetValidator(validator);
|
||||
m_windowStyle = style;
|
||||
|
||||
if (parent) parent->AddChild(this);
|
||||
|
||||
if ( id == -1 )
|
||||
m_windowId = NewControlId();
|
||||
else
|
||||
m_windowId = id;
|
||||
|
||||
// TODO: Create the bitmap checkbox
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void wxBitmapCheckBox::SetLabel(const wxBitmap& bitmap)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void wxBitmapCheckBox::SetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void wxBitmapCheckBox::SetValue(bool val)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
bool wxBitmapCheckBox::GetValue() const
|
||||
{
|
||||
// TODOD
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
74
src/os2/checklst.cpp
Normal file
74
src/os2/checklst.cpp
Normal file
@ -0,0 +1,74 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: checklst.cpp
|
||||
// Purpose: implementation of wxCheckListBox class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// headers & declarations
|
||||
// ============================================================================
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "checklst.h"
|
||||
#endif
|
||||
|
||||
#include "wx/checklst.h"
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
#if !USE_SHARED_LIBRARY
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxCheckListBox, wxListBox)
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// implementation of wxCheckListBox class
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// define event table
|
||||
// ------------------
|
||||
BEGIN_EVENT_TABLE(wxCheckListBox, wxListBox)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
// control creation
|
||||
// ----------------
|
||||
|
||||
// def ctor: use Create() to really create the control
|
||||
wxCheckListBox::wxCheckListBox() : wxListBox()
|
||||
{
|
||||
}
|
||||
|
||||
// ctor which creates the associated control
|
||||
wxCheckListBox::wxCheckListBox(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos, const wxSize& size,
|
||||
int nStrings, const wxString choices[],
|
||||
long style, const wxValidator& val,
|
||||
const wxString& name)
|
||||
: wxListBox()
|
||||
{
|
||||
// TODO: you'll probably need a separate Create instead of using
|
||||
// the wxListBox one as here.
|
||||
Create(parent, id, pos, size, nStrings, choices, style|wxLB_OWNERDRAW, val, name);
|
||||
}
|
||||
|
||||
// check items
|
||||
// -----------
|
||||
|
||||
bool wxCheckListBox::IsChecked(uint uiIndex) const
|
||||
{
|
||||
// TODO
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void wxCheckListBox::Check(uint uiIndex, bool bCheck)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
|
119
src/os2/choice.cpp
Normal file
119
src/os2/choice.cpp
Normal file
@ -0,0 +1,119 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: choice.cpp
|
||||
// Purpose: wxChoice
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "choice.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/choice.h"
|
||||
|
||||
#if !USE_SHARED_LIBRARY
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl)
|
||||
#endif
|
||||
|
||||
bool wxChoice::Create(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
int n, const wxString choices[],
|
||||
long style,
|
||||
const wxValidator& validator,
|
||||
const wxString& name)
|
||||
{
|
||||
SetName(name);
|
||||
SetValidator(validator);
|
||||
m_noStrings = n;
|
||||
m_windowStyle = style;
|
||||
|
||||
if (parent) parent->AddChild(this);
|
||||
|
||||
if ( id == -1 )
|
||||
m_windowId = (int)NewControlId();
|
||||
else
|
||||
m_windowId = id;
|
||||
|
||||
// TODO: create choice control
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void wxChoice::Append(const wxString& item)
|
||||
{
|
||||
// TODO
|
||||
m_noStrings ++;
|
||||
}
|
||||
|
||||
void wxChoice::Delete(int n)
|
||||
{
|
||||
// TODO
|
||||
m_noStrings --;
|
||||
}
|
||||
|
||||
void wxChoice::Clear()
|
||||
{
|
||||
// TODO
|
||||
m_noStrings = 0;
|
||||
}
|
||||
|
||||
int wxChoice::GetSelection() const
|
||||
{
|
||||
// TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
void wxChoice::SetSelection(int n)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
int wxChoice::FindString(const wxString& s) const
|
||||
{
|
||||
// TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
wxString wxChoice::GetString(int n) const
|
||||
{
|
||||
// TODO
|
||||
return wxString("");
|
||||
}
|
||||
|
||||
void wxChoice::SetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
wxString wxChoice::GetStringSelection () const
|
||||
{
|
||||
int sel = GetSelection ();
|
||||
if (sel > -1)
|
||||
return wxString(this->GetString (sel));
|
||||
else
|
||||
return wxString("");
|
||||
}
|
||||
|
||||
bool wxChoice::SetStringSelection (const wxString& s)
|
||||
{
|
||||
int sel = FindString (s);
|
||||
if (sel > -1)
|
||||
{
|
||||
SetSelection (sel);
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void wxChoice::Command(wxCommandEvent & event)
|
||||
{
|
||||
SetSelection (event.GetInt());
|
||||
ProcessCommand (event);
|
||||
}
|
||||
|
237
src/os2/clipbrd.cpp
Normal file
237
src/os2/clipbrd.cpp
Normal file
@ -0,0 +1,237 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: clipbrd.cpp
|
||||
// Purpose: Clipboard functionality
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation
|
||||
#pragma implementation "clipbrd.h"
|
||||
#endif
|
||||
|
||||
#include "wx/app.h"
|
||||
#include "wx/frame.h"
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/metafile.h"
|
||||
#include "wx/clipbrd.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#if !USE_SHARED_LIBRARY
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxClipboard, wxObject)
|
||||
IMPLEMENT_ABSTRACT_CLASS(wxClipboardClient, wxObject)
|
||||
#endif
|
||||
|
||||
bool wxOpenClipboard()
|
||||
{
|
||||
// TODO
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool wxCloseClipboard()
|
||||
{
|
||||
// TODO
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool wxEmptyClipboard()
|
||||
{
|
||||
// TODO
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool wxClipboardOpen()
|
||||
{
|
||||
// TODO
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool wxIsClipboardFormatAvailable(int dataFormat)
|
||||
{
|
||||
// TODO
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool wxSetClipboardData(int dataFormat, wxObject *obj, int width, int height)
|
||||
{
|
||||
// TODO
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
wxObject *wxGetClipboardData(int dataFormat, long *len)
|
||||
{
|
||||
// TODO
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int wxEnumClipboardFormats(int dataFormat)
|
||||
{
|
||||
// TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wxRegisterClipboardFormat(char *formatName)
|
||||
{
|
||||
// TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool wxGetClipboardFormatName(int dataFormat, char *formatName, int maxCount)
|
||||
{
|
||||
// TODO
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Generalized clipboard implementation by Matthew Flatt
|
||||
*/
|
||||
|
||||
wxClipboard *wxTheClipboard = NULL;
|
||||
|
||||
void wxInitClipboard()
|
||||
{
|
||||
if (!wxTheClipboard)
|
||||
wxTheClipboard = new wxClipboard;
|
||||
}
|
||||
|
||||
wxClipboard::wxClipboard()
|
||||
{
|
||||
clipOwner = NULL;
|
||||
cbString = NULL;
|
||||
}
|
||||
|
||||
wxClipboard::~wxClipboard()
|
||||
{
|
||||
if (clipOwner)
|
||||
clipOwner->BeingReplaced();
|
||||
if (cbString)
|
||||
delete[] cbString;
|
||||
}
|
||||
|
||||
static int FormatStringToID(char *str)
|
||||
{
|
||||
if (!strcmp(str, "TEXT"))
|
||||
return wxDF_TEXT;
|
||||
|
||||
return wxRegisterClipboardFormat(str);
|
||||
}
|
||||
|
||||
void wxClipboard::SetClipboardClient(wxClipboardClient *client, long time)
|
||||
{
|
||||
bool got_selection;
|
||||
|
||||
if (clipOwner)
|
||||
clipOwner->BeingReplaced();
|
||||
clipOwner = client;
|
||||
if (cbString) {
|
||||
delete[] cbString;
|
||||
cbString = NULL;
|
||||
}
|
||||
|
||||
if (wxOpenClipboard()) {
|
||||
char **formats, *data;
|
||||
int i;
|
||||
int ftype;
|
||||
long size;
|
||||
|
||||
formats = clipOwner->formats.ListToArray(FALSE);
|
||||
for (i = clipOwner->formats.Number(); i--; ) {
|
||||
ftype = FormatStringToID(formats[i]);
|
||||
data = clipOwner->GetData(formats[i], &size);
|
||||
if (!wxSetClipboardData(ftype, (wxObject *)data, size, 1)) {
|
||||
got_selection = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i < 0)
|
||||
got_selection = wxCloseClipboard();
|
||||
} else
|
||||
got_selection = FALSE;
|
||||
|
||||
got_selection = FALSE; // Assume another process takes over
|
||||
|
||||
if (!got_selection) {
|
||||
clipOwner->BeingReplaced();
|
||||
clipOwner = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
wxClipboardClient *wxClipboard::GetClipboardClient()
|
||||
{
|
||||
return clipOwner;
|
||||
}
|
||||
|
||||
void wxClipboard::SetClipboardString(char *str, long time)
|
||||
{
|
||||
bool got_selection;
|
||||
|
||||
if (clipOwner) {
|
||||
clipOwner->BeingReplaced();
|
||||
clipOwner = NULL;
|
||||
}
|
||||
if (cbString)
|
||||
delete[] cbString;
|
||||
|
||||
cbString = str;
|
||||
|
||||
if (wxOpenClipboard()) {
|
||||
if (!wxSetClipboardData(wxDF_TEXT, (wxObject *)str))
|
||||
got_selection = FALSE;
|
||||
else
|
||||
got_selection = wxCloseClipboard();
|
||||
} else
|
||||
got_selection = FALSE;
|
||||
|
||||
got_selection = FALSE; // Assume another process takes over
|
||||
|
||||
if (!got_selection) {
|
||||
delete[] cbString;
|
||||
cbString = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
char *wxClipboard::GetClipboardString(long time)
|
||||
{
|
||||
char *str;
|
||||
long length;
|
||||
|
||||
str = GetClipboardData("TEXT", &length, time);
|
||||
if (!str) {
|
||||
str = new char[1];
|
||||
*str = 0;
|
||||
}
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
char *wxClipboard::GetClipboardData(char *format, long *length, long time)
|
||||
{
|
||||
if (clipOwner) {
|
||||
if (clipOwner->formats.Member(format))
|
||||
return clipOwner->GetData(format, length);
|
||||
else
|
||||
return NULL;
|
||||
} else if (cbString) {
|
||||
if (!strcmp(format, "TEXT"))
|
||||
return copystring(cbString);
|
||||
else
|
||||
return NULL;
|
||||
} else {
|
||||
if (wxOpenClipboard()) {
|
||||
receivedString = (char *)wxGetClipboardData(FormatStringToID(format),
|
||||
length);
|
||||
wxCloseClipboard();
|
||||
} else
|
||||
receivedString = NULL;
|
||||
|
||||
return receivedString;
|
||||
}
|
||||
}
|
||||
|
53
src/os2/colordlg.cpp
Normal file
53
src/os2/colordlg.cpp
Normal file
@ -0,0 +1,53 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: colordlg.cpp
|
||||
// Purpose: wxColourDialog class. NOTE: you can use the generic class
|
||||
// if you wish, instead of implementing this.
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "colordlg.h"
|
||||
#endif
|
||||
|
||||
#include "wx/stubs/colordlg.h"
|
||||
|
||||
#if !USE_SHARED_LIBRARY
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxColourDialog, wxDialog)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* wxColourDialog
|
||||
*/
|
||||
|
||||
wxColourDialog::wxColourDialog()
|
||||
{
|
||||
m_dialogParent = NULL;
|
||||
}
|
||||
|
||||
wxColourDialog::wxColourDialog(wxWindow *parent, wxColourData *data)
|
||||
{
|
||||
Create(parent, data);
|
||||
}
|
||||
|
||||
bool wxColourDialog::Create(wxWindow *parent, wxColourData *data)
|
||||
{
|
||||
m_dialogParent = parent;
|
||||
|
||||
if (data)
|
||||
m_colourData = *data;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int wxColourDialog::ShowModal()
|
||||
{
|
||||
/* TODO: implement dialog
|
||||
*/
|
||||
|
||||
return wxID_CANCEL;
|
||||
}
|
||||
|
103
src/os2/colour.cpp
Normal file
103
src/os2/colour.cpp
Normal file
@ -0,0 +1,103 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: colour.cpp
|
||||
// Purpose: wxColour class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "colour.h"
|
||||
#endif
|
||||
|
||||
#include "wx/gdicmn.h"
|
||||
#include "wx/colour.h"
|
||||
|
||||
#if !USE_SHARED_LIBRARY
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxColour, wxObject)
|
||||
#endif
|
||||
|
||||
// Colour
|
||||
|
||||
wxColour::wxColour ()
|
||||
{
|
||||
m_isInit = FALSE;
|
||||
m_red = m_blue = m_green = 0;
|
||||
/* TODO
|
||||
m_pixel = 0;
|
||||
*/
|
||||
}
|
||||
|
||||
wxColour::wxColour (unsigned char r, unsigned char g, unsigned char b)
|
||||
{
|
||||
m_red = r;
|
||||
m_green = g;
|
||||
m_blue = b;
|
||||
m_isInit = TRUE;
|
||||
/* TODO
|
||||
m_pixel = PALETTERGB (m_red, m_green, m_blue);
|
||||
*/
|
||||
}
|
||||
|
||||
wxColour::wxColour (const wxColour& col)
|
||||
{
|
||||
m_red = col.m_red;
|
||||
m_green = col.m_green;
|
||||
m_blue = col.m_blue;
|
||||
m_isInit = col.m_isInit;
|
||||
/* TODO
|
||||
m_pixel = col.m_pixel;
|
||||
*/
|
||||
}
|
||||
|
||||
wxColour& wxColour::operator =(const wxColour& col)
|
||||
{
|
||||
m_red = col.m_red;
|
||||
m_green = col.m_green;
|
||||
m_blue = col.m_blue;
|
||||
m_isInit = col.m_isInit;
|
||||
/* TODO
|
||||
m_pixel = col.m_pixel;
|
||||
*/
|
||||
return *this;
|
||||
}
|
||||
|
||||
void wxColour::InitFromName(const wxString& col)
|
||||
{
|
||||
wxColour *the_colour = wxTheColourDatabase->FindColour (col);
|
||||
if (the_colour)
|
||||
{
|
||||
m_red = the_colour->Red ();
|
||||
m_green = the_colour->Green ();
|
||||
m_blue = the_colour->Blue ();
|
||||
m_isInit = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_red = 0;
|
||||
m_green = 0;
|
||||
m_blue = 0;
|
||||
m_isInit = FALSE;
|
||||
}
|
||||
/* TODO
|
||||
m_pixel = PALETTERGB (m_red, m_green, m_blue);
|
||||
*/
|
||||
}
|
||||
|
||||
wxColour::~wxColour ()
|
||||
{
|
||||
}
|
||||
|
||||
void wxColour::Set (unsigned char r, unsigned char g, unsigned char b)
|
||||
{
|
||||
m_red = r;
|
||||
m_green = g;
|
||||
m_blue = b;
|
||||
m_isInit = TRUE;
|
||||
/* TODO
|
||||
m_pixel = PALETTERGB (m_red, m_green, m_blue);
|
||||
*/
|
||||
}
|
165
src/os2/combobox.cpp
Normal file
165
src/os2/combobox.cpp
Normal file
@ -0,0 +1,165 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: combobox.cpp
|
||||
// Purpose: wxComboBox class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "combobox.h"
|
||||
#endif
|
||||
|
||||
#include "wx/combobox.h"
|
||||
|
||||
#if !USE_SHARED_LIBRARY
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxComboBox, wxControl)
|
||||
#endif
|
||||
|
||||
bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
|
||||
const wxString& value,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
int n, const wxString choices[],
|
||||
long style,
|
||||
const wxValidator& validator,
|
||||
const wxString& name)
|
||||
{
|
||||
SetName(name);
|
||||
SetValidator(validator);
|
||||
m_noStrings = n;
|
||||
m_windowStyle = style;
|
||||
|
||||
if (parent) parent->AddChild(this);
|
||||
|
||||
if ( id == -1 )
|
||||
m_windowId = (int)NewControlId();
|
||||
else
|
||||
m_windowId = id;
|
||||
|
||||
// TODO: create combobox control
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
wxString wxComboBox::GetValue() const
|
||||
{
|
||||
// TODO
|
||||
return wxString("");
|
||||
}
|
||||
|
||||
void wxComboBox::SetValue(const wxString& value)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
// Clipboard operations
|
||||
void wxComboBox::Copy()
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void wxComboBox::Cut()
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void wxComboBox::Paste()
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void wxComboBox::SetEditable(bool editable)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void wxComboBox::SetInsertionPoint(long pos)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void wxComboBox::SetInsertionPointEnd()
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
long wxComboBox::GetInsertionPoint() const
|
||||
{
|
||||
// TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
long wxComboBox::GetLastPosition() const
|
||||
{
|
||||
// TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
void wxComboBox::Replace(long from, long to, const wxString& value)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void wxComboBox::Remove(long from, long to)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void wxComboBox::SetSelection(long from, long to)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void wxComboBox::Append(const wxString& item)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void wxComboBox::Delete(int n)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void wxComboBox::Clear()
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
int wxComboBox::GetSelection() const
|
||||
{
|
||||
// TODO
|
||||
return -1;
|
||||
}
|
||||
|
||||
void wxComboBox::SetSelection(int n)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
int wxComboBox::FindString(const wxString& s) const
|
||||
{
|
||||
// TODO
|
||||
return -1;
|
||||
}
|
||||
|
||||
wxString wxComboBox::GetString(int n) const
|
||||
{
|
||||
// TODO
|
||||
return wxString("");
|
||||
}
|
||||
|
||||
wxString wxComboBox::GetStringSelection() const
|
||||
{
|
||||
// TODO
|
||||
return wxString("");
|
||||
}
|
||||
|
||||
bool wxComboBox::SetStringSelection(const wxString& sel)
|
||||
{
|
||||
// TODO
|
||||
return FALSE;
|
||||
}
|
95
src/os2/control.cpp
Normal file
95
src/os2/control.cpp
Normal file
@ -0,0 +1,95 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: control.cpp
|
||||
// Purpose: wxControl class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "control.h"
|
||||
#endif
|
||||
|
||||
#include "wx/control.h"
|
||||
|
||||
#if !USE_SHARED_LIBRARY
|
||||
IMPLEMENT_ABSTRACT_CLASS(wxControl, wxWindow)
|
||||
|
||||
BEGIN_EVENT_TABLE(wxControl, wxWindow)
|
||||
END_EVENT_TABLE()
|
||||
#endif
|
||||
|
||||
// Item members
|
||||
wxControl::wxControl()
|
||||
{
|
||||
m_backgroundColour = *wxWHITE;
|
||||
m_foregroundColour = *wxBLACK;
|
||||
m_callback = 0;
|
||||
}
|
||||
|
||||
wxControl::~wxControl()
|
||||
{
|
||||
// If we delete an item, we should initialize the parent panel,
|
||||
// because it could now be invalid.
|
||||
wxWindow *parent = (wxWindow *)GetParent();
|
||||
if (parent)
|
||||
{
|
||||
if (parent->GetDefaultItem() == (wxButton*) this)
|
||||
parent->SetDefaultItem(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
void wxControl::SetLabel(const wxString& label)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
wxString wxControl::GetLabel() const
|
||||
{
|
||||
// TODO
|
||||
return wxString("");
|
||||
}
|
||||
|
||||
void wxControl::ProcessCommand (wxCommandEvent & event)
|
||||
{
|
||||
// Tries:
|
||||
// 1) A callback function (to become obsolete)
|
||||
// 2) OnCommand, starting at this window and working up parent hierarchy
|
||||
// 3) OnCommand then calls ProcessEvent to search the event tables.
|
||||
if (m_callback)
|
||||
{
|
||||
(void) (*(m_callback)) (*this, event);
|
||||
}
|
||||
else
|
||||
{
|
||||
GetEventHandler()->OnCommand(*this, event);
|
||||
}
|
||||
}
|
||||
|
||||
void wxControl::Centre (int direction)
|
||||
{
|
||||
int x, y, width, height, panel_width, panel_height, new_x, new_y;
|
||||
|
||||
wxWindow *parent = (wxWindow *) GetParent ();
|
||||
if (!parent)
|
||||
return;
|
||||
|
||||
parent->GetClientSize (&panel_width, &panel_height);
|
||||
GetSize (&width, &height);
|
||||
GetPosition (&x, &y);
|
||||
|
||||
new_x = x;
|
||||
new_y = y;
|
||||
|
||||
if (direction & wxHORIZONTAL)
|
||||
new_x = (int) ((panel_width - width) / 2);
|
||||
|
||||
if (direction & wxVERTICAL)
|
||||
new_y = (int) ((panel_height - height) / 2);
|
||||
|
||||
SetSize (new_x, new_y, width, height);
|
||||
}
|
||||
|
187
src/os2/cursor.cpp
Normal file
187
src/os2/cursor.cpp
Normal file
@ -0,0 +1,187 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: cursor.cpp
|
||||
// Purpose: wxCursor class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "cursor.h"
|
||||
#endif
|
||||
|
||||
#include "wx/cursor.h"
|
||||
#include "wx/icon.h"
|
||||
|
||||
#if !USE_SHARED_LIBRARIES
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxCursor, wxBitmap)
|
||||
#endif
|
||||
|
||||
wxCursorRefData::wxCursorRefData()
|
||||
{
|
||||
m_width = 32; m_height = 32;
|
||||
|
||||
/* TODO
|
||||
m_hCursor = 0 ;
|
||||
*/
|
||||
}
|
||||
|
||||
wxCursorRefData::~wxCursorRefData()
|
||||
{
|
||||
// TODO: destroy cursor
|
||||
}
|
||||
|
||||
// Cursors
|
||||
wxCursor::wxCursor()
|
||||
{
|
||||
}
|
||||
|
||||
wxCursor::wxCursor(const char WXUNUSED(bits)[], int WXUNUSED(width), int WXUNUSED(height),
|
||||
int WXUNUSED(hotSpotX), int WXUNUSED(hotSpotY), const char WXUNUSED(maskBits)[])
|
||||
{
|
||||
}
|
||||
|
||||
wxCursor::wxCursor(const wxString& cursor_file, long flags, int hotSpotX, int hotSpotY)
|
||||
{
|
||||
m_refData = new wxCursorRefData;
|
||||
|
||||
// TODO: create cursor from a file
|
||||
}
|
||||
|
||||
// Cursors by stock number
|
||||
wxCursor::wxCursor(int cursor_type)
|
||||
{
|
||||
m_refData = new wxCursorRefData;
|
||||
|
||||
/* TODO
|
||||
switch (cursor_type)
|
||||
{
|
||||
case wxCURSOR_WAIT:
|
||||
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_WAIT);
|
||||
break;
|
||||
case wxCURSOR_IBEAM:
|
||||
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_IBEAM);
|
||||
break;
|
||||
case wxCURSOR_CROSS:
|
||||
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_CROSS);
|
||||
break;
|
||||
case wxCURSOR_SIZENWSE:
|
||||
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_SIZENWSE);
|
||||
break;
|
||||
case wxCURSOR_SIZENESW:
|
||||
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_SIZENESW);
|
||||
break;
|
||||
case wxCURSOR_SIZEWE:
|
||||
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_SIZEWE);
|
||||
break;
|
||||
case wxCURSOR_SIZENS:
|
||||
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_SIZENS);
|
||||
break;
|
||||
case wxCURSOR_CHAR:
|
||||
{
|
||||
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_ARROW);
|
||||
break;
|
||||
}
|
||||
case wxCURSOR_HAND:
|
||||
{
|
||||
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_HAND");
|
||||
break;
|
||||
}
|
||||
case wxCURSOR_BULLSEYE:
|
||||
{
|
||||
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_BULLSEYE");
|
||||
break;
|
||||
}
|
||||
case wxCURSOR_PENCIL:
|
||||
{
|
||||
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_PENCIL");
|
||||
break;
|
||||
}
|
||||
case wxCURSOR_MAGNIFIER:
|
||||
{
|
||||
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_MAGNIFIER");
|
||||
break;
|
||||
}
|
||||
case wxCURSOR_NO_ENTRY:
|
||||
{
|
||||
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_NO_ENTRY");
|
||||
break;
|
||||
}
|
||||
case wxCURSOR_LEFT_BUTTON:
|
||||
{
|
||||
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_ARROW);
|
||||
break;
|
||||
}
|
||||
case wxCURSOR_RIGHT_BUTTON:
|
||||
{
|
||||
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_ARROW);
|
||||
break;
|
||||
}
|
||||
case wxCURSOR_MIDDLE_BUTTON:
|
||||
{
|
||||
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_ARROW);
|
||||
break;
|
||||
}
|
||||
case wxCURSOR_SIZING:
|
||||
{
|
||||
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_SIZING");
|
||||
break;
|
||||
}
|
||||
case wxCURSOR_WATCH:
|
||||
{
|
||||
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_WATCH");
|
||||
break;
|
||||
}
|
||||
case wxCURSOR_SPRAYCAN:
|
||||
{
|
||||
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_ROLLER");
|
||||
break;
|
||||
}
|
||||
case wxCURSOR_PAINT_BRUSH:
|
||||
{
|
||||
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_PBRUSH");
|
||||
break;
|
||||
}
|
||||
case wxCURSOR_POINT_LEFT:
|
||||
{
|
||||
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_PLEFT");
|
||||
break;
|
||||
}
|
||||
case wxCURSOR_POINT_RIGHT:
|
||||
{
|
||||
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_PRIGHT");
|
||||
break;
|
||||
}
|
||||
case wxCURSOR_QUESTION_ARROW:
|
||||
{
|
||||
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_QARROW");
|
||||
break;
|
||||
}
|
||||
case wxCURSOR_BLANK:
|
||||
{
|
||||
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_BLANK");
|
||||
break;
|
||||
}
|
||||
default:
|
||||
case wxCURSOR_ARROW:
|
||||
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_ARROW);
|
||||
break;
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
wxCursor::~wxCursor()
|
||||
{
|
||||
}
|
||||
|
||||
// Global cursor setting
|
||||
void wxSetCursor(const wxCursor& cursor)
|
||||
{
|
||||
// TODO (optional on platforms with no global cursor)
|
||||
}
|
||||
|
||||
|
147
src/os2/data.cpp
Normal file
147
src/os2/data.cpp
Normal file
@ -0,0 +1,147 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: data.cpp
|
||||
// Purpose: Various data
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation
|
||||
#endif
|
||||
|
||||
#include "wx/wx.h"
|
||||
|
||||
#if wxUSE_POSTSCRIPT
|
||||
#include "wx/dcps.h"
|
||||
#endif
|
||||
|
||||
#define _MAXPATHLEN 500
|
||||
|
||||
// Useful buffer, initialized in CommonInit
|
||||
char *wxBuffer = NULL;
|
||||
|
||||
// Windows List
|
||||
wxList wxTopLevelWindows;
|
||||
|
||||
// List of windows pending deletion
|
||||
wxList wxPendingDelete;
|
||||
|
||||
int wxPageNumber;
|
||||
|
||||
// GDI Object Lists
|
||||
wxBrushList *wxTheBrushList = NULL;
|
||||
wxPenList *wxThePenList = NULL;
|
||||
wxFontList *wxTheFontList = NULL;
|
||||
wxBitmapList *wxTheBitmapList = NULL;
|
||||
|
||||
wxColourDatabase *wxTheColourDatabase = NULL;
|
||||
|
||||
// Stock objects
|
||||
wxFont *wxNORMAL_FONT;
|
||||
wxFont *wxSMALL_FONT;
|
||||
wxFont *wxITALIC_FONT;
|
||||
wxFont *wxSWISS_FONT;
|
||||
wxPen *wxRED_PEN;
|
||||
|
||||
wxPen *wxCYAN_PEN;
|
||||
wxPen *wxGREEN_PEN;
|
||||
wxPen *wxBLACK_PEN;
|
||||
wxPen *wxWHITE_PEN;
|
||||
wxPen *wxTRANSPARENT_PEN;
|
||||
wxPen *wxBLACK_DASHED_PEN;
|
||||
wxPen *wxGREY_PEN;
|
||||
wxPen *wxMEDIUM_GREY_PEN;
|
||||
wxPen *wxLIGHT_GREY_PEN;
|
||||
|
||||
wxBrush *wxBLUE_BRUSH;
|
||||
wxBrush *wxGREEN_BRUSH;
|
||||
wxBrush *wxWHITE_BRUSH;
|
||||
wxBrush *wxBLACK_BRUSH;
|
||||
wxBrush *wxTRANSPARENT_BRUSH;
|
||||
wxBrush *wxCYAN_BRUSH;
|
||||
wxBrush *wxRED_BRUSH;
|
||||
wxBrush *wxGREY_BRUSH;
|
||||
wxBrush *wxMEDIUM_GREY_BRUSH;
|
||||
wxBrush *wxLIGHT_GREY_BRUSH;
|
||||
|
||||
wxColour *wxBLACK;
|
||||
wxColour *wxWHITE;
|
||||
wxColour *wxRED;
|
||||
wxColour *wxBLUE;
|
||||
wxColour *wxGREEN;
|
||||
wxColour *wxCYAN;
|
||||
wxColour *wxLIGHT_GREY;
|
||||
|
||||
wxCursor *wxSTANDARD_CURSOR = NULL;
|
||||
wxCursor *wxHOURGLASS_CURSOR = NULL;
|
||||
wxCursor *wxCROSS_CURSOR = NULL;
|
||||
|
||||
// 'Null' objects
|
||||
wxAcceleratorTable wxNullAcceleratorTable;
|
||||
wxBitmap wxNullBitmap;
|
||||
wxIcon wxNullIcon;
|
||||
wxCursor wxNullCursor;
|
||||
wxPen wxNullPen;
|
||||
wxBrush wxNullBrush;
|
||||
wxPalette wxNullPalette;
|
||||
wxFont wxNullFont;
|
||||
wxColour wxNullColour;
|
||||
|
||||
// Default window names
|
||||
const char *wxButtonNameStr = "button";
|
||||
const char *wxCanvasNameStr = "canvas";
|
||||
const char *wxCheckBoxNameStr = "check";
|
||||
const char *wxChoiceNameStr = "choice";
|
||||
const char *wxComboBoxNameStr = "comboBox";
|
||||
const char *wxDialogNameStr = "dialog";
|
||||
const char *wxFrameNameStr = "frame";
|
||||
const char *wxGaugeNameStr = "gauge";
|
||||
const char *wxStaticBoxNameStr = "groupBox";
|
||||
const char *wxListBoxNameStr = "listBox";
|
||||
const char *wxStaticTextNameStr = "message";
|
||||
const char *wxStaticBitmapNameStr = "message";
|
||||
const char *wxMultiTextNameStr = "multitext";
|
||||
const char *wxPanelNameStr = "panel";
|
||||
const char *wxRadioBoxNameStr = "radioBox";
|
||||
const char *wxRadioButtonNameStr = "radioButton";
|
||||
const char *wxBitmapRadioButtonNameStr = "radioButton";
|
||||
const char *wxScrollBarNameStr = "scrollBar";
|
||||
const char *wxSliderNameStr = "slider";
|
||||
const char *wxStaticNameStr = "static";
|
||||
const char *wxTextCtrlWindowNameStr = "textWindow";
|
||||
const char *wxTextCtrlNameStr = "text";
|
||||
const char *wxVirtListBoxNameStr = "virtListBox";
|
||||
const char *wxButtonBarNameStr = "buttonbar";
|
||||
const char *wxEnhDialogNameStr = "Shell";
|
||||
const char *wxToolBarNameStr = "toolbar";
|
||||
const char *wxStatusLineNameStr = "status_line";
|
||||
const char *wxEmptyString = "";
|
||||
const char *wxGetTextFromUserPromptStr = "Input Text";
|
||||
const char *wxMessageBoxCaptionStr = "Message";
|
||||
const char *wxFileSelectorPromptStr = "Select a file";
|
||||
const char *wxFileSelectorDefaultWildcardStr = "*.*";
|
||||
const char *wxInternalErrorStr = "wxWindows Internal Error";
|
||||
const char *wxFatalErrorStr = "wxWindows Fatal Error";
|
||||
|
||||
// See wx/utils.h
|
||||
const char *wxFloatToStringStr = "%.2f";
|
||||
const char *wxDoubleToStringStr = "%.2f";
|
||||
|
||||
#if wxUSE_SHARED_LIBRARY
|
||||
///// Event tables (also must be in one, statically-linked file for shared libraries)
|
||||
|
||||
// This is the base, wxEvtHandler 'bootstrap' code which is expanded manually here
|
||||
const wxEventTable *wxEvtHandler::GetEventTable() const { return &wxEvtHandler::sm_eventTable; }
|
||||
|
||||
const wxEventTable wxEvtHandler::sm_eventTable =
|
||||
{ NULL, &wxEvtHandler::sm_eventTableEntries[0] };
|
||||
|
||||
const wxEventTableEntry wxEvtHandler::sm_eventTableEntries[] = { { 0, 0, 0, NULL } };
|
||||
#endif
|
||||
|
||||
const wxSize wxDefaultSize(-1, -1);
|
||||
const wxPoint wxDefaultPosition(-1, -1);
|
385
src/os2/dc.cpp
Normal file
385
src/os2/dc.cpp
Normal file
@ -0,0 +1,385 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dc.cpp
|
||||
// Purpose: wxDC class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "dc.h"
|
||||
#endif
|
||||
|
||||
#include "wx/dc.h"
|
||||
|
||||
#if !USE_SHARED_LIBRARY
|
||||
IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject)
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// constants
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#define mm2inches 0.0393700787402
|
||||
#define inches2mm 25.4
|
||||
#define mm2twips 56.6929133859
|
||||
#define twips2mm 0.0176388888889
|
||||
#define mm2pt 2.83464566929
|
||||
#define pt2mm 0.352777777778
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxDC
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
wxDC::wxDC(void)
|
||||
{
|
||||
m_ok = FALSE;
|
||||
m_optimize = FALSE;
|
||||
m_autoSetting = FALSE;
|
||||
m_colour = TRUE;
|
||||
m_clipping = FALSE;
|
||||
|
||||
m_mm_to_pix_x = 1.0;
|
||||
m_mm_to_pix_y = 1.0;
|
||||
|
||||
m_logicalOriginX = 0;
|
||||
m_logicalOriginY = 0;
|
||||
m_deviceOriginX = 0;
|
||||
m_deviceOriginY = 0;
|
||||
m_internalDeviceOriginX = 0;
|
||||
m_internalDeviceOriginY = 0;
|
||||
m_externalDeviceOriginX = 0;
|
||||
m_externalDeviceOriginY = 0;
|
||||
|
||||
m_logicalScaleX = 1.0;
|
||||
m_logicalScaleY = 1.0;
|
||||
m_userScaleX = 1.0;
|
||||
m_userScaleY = 1.0;
|
||||
m_scaleX = 1.0;
|
||||
m_scaleY = 1.0;
|
||||
|
||||
m_mappingMode = wxMM_TEXT;
|
||||
m_needComputeScaleX = FALSE;
|
||||
m_needComputeScaleY = FALSE;
|
||||
|
||||
m_signX = 1; // default x-axis left to right
|
||||
m_signY = 1; // default y-axis top down
|
||||
|
||||
m_maxX = m_maxY = -100000;
|
||||
m_minY = m_minY = 100000;
|
||||
|
||||
m_logicalFunction = wxCOPY;
|
||||
// m_textAlignment = wxALIGN_TOP_LEFT;
|
||||
m_backgroundMode = wxTRANSPARENT;
|
||||
|
||||
m_textForegroundColour = *wxBLACK;
|
||||
m_textBackgroundColour = *wxWHITE;
|
||||
m_pen = *wxBLACK_PEN;
|
||||
m_font = *wxNORMAL_FONT;
|
||||
m_brush = *wxTRANSPARENT_BRUSH;
|
||||
m_backgroundBrush = *wxWHITE_BRUSH;
|
||||
|
||||
// m_palette = wxAPP_COLOURMAP;
|
||||
};
|
||||
|
||||
wxDC::~wxDC(void)
|
||||
{
|
||||
};
|
||||
|
||||
void wxDC::DrawIcon( const wxIcon &WXUNUSED(icon), long WXUNUSED(x), long WXUNUSED(y), bool WXUNUSED(useMask) )
|
||||
{
|
||||
};
|
||||
|
||||
void wxDC::DrawPoint( wxPoint& point )
|
||||
{
|
||||
DrawPoint( point.x, point.y );
|
||||
};
|
||||
|
||||
void wxDC::DrawPolygon( wxList *list, long xoffset, long yoffset, int fillStyle )
|
||||
{
|
||||
int n = list->Number();
|
||||
wxPoint *points = new wxPoint[n];
|
||||
|
||||
int i = 0;
|
||||
for( wxNode *node = list->First(); node; node = node->Next() )
|
||||
{
|
||||
wxPoint *point = (wxPoint *)node->Data();
|
||||
points[i].x = point->x;
|
||||
points[i++].y = point->y;
|
||||
};
|
||||
DrawPolygon( n, points, xoffset, yoffset, fillStyle );
|
||||
delete[] points;
|
||||
};
|
||||
|
||||
void wxDC::DrawLines( wxList *list, long xoffset, long yoffset )
|
||||
{
|
||||
int n = list->Number();
|
||||
wxPoint *points = new wxPoint[n];
|
||||
|
||||
int i = 0;
|
||||
for( wxNode *node = list->First(); node; node = node->Next() )
|
||||
{
|
||||
wxPoint *point = (wxPoint *)node->Data();
|
||||
points[i].x = point->x;
|
||||
points[i++].y = point->y;
|
||||
};
|
||||
DrawLines( n, points, xoffset, yoffset );
|
||||
delete []points;
|
||||
};
|
||||
|
||||
void wxDC::DrawSpline( long x1, long y1, long x2, long y2, long x3, long y3 )
|
||||
{
|
||||
wxList list;
|
||||
list.Append( (wxObject*)new wxPoint(x1, y1) );
|
||||
list.Append( (wxObject*)new wxPoint(x2, y2) );
|
||||
list.Append( (wxObject*)new wxPoint(x3, y3) );
|
||||
DrawSpline(&list);
|
||||
wxNode *node = list.First();
|
||||
while (node)
|
||||
{
|
||||
wxPoint *p = (wxPoint*)node->Data();
|
||||
delete p;
|
||||
node = node->Next();
|
||||
};
|
||||
};
|
||||
|
||||
void wxDC::DrawSpline( int n, wxPoint points[] )
|
||||
{
|
||||
wxList list;
|
||||
for (int i = 0; i < n; i++) list.Append( (wxObject*)&points[i] );
|
||||
DrawSpline( &list );
|
||||
};
|
||||
|
||||
void wxDC::SetClippingRegion( long x, long y, long width, long height )
|
||||
{
|
||||
m_clipping = TRUE;
|
||||
m_clipX1 = x;
|
||||
m_clipY1 = y;
|
||||
m_clipX2 = x + width;
|
||||
m_clipY2 = y + height;
|
||||
};
|
||||
|
||||
void wxDC::DestroyClippingRegion(void)
|
||||
{
|
||||
m_clipping = FALSE;
|
||||
};
|
||||
|
||||
void wxDC::GetClippingBox( long *x, long *y, long *width, long *height ) const
|
||||
{
|
||||
if (m_clipping)
|
||||
{
|
||||
if (x) *x = m_clipX1;
|
||||
if (y) *y = m_clipY1;
|
||||
if (width) *width = (m_clipX2 - m_clipX1);
|
||||
if (height) *height = (m_clipY2 - m_clipY1);
|
||||
}
|
||||
else
|
||||
*x = *y = *width = *height = 0;
|
||||
};
|
||||
|
||||
void wxDC::GetSize( int* width, int* height ) const
|
||||
{
|
||||
*width = m_maxX-m_minX;
|
||||
*height = m_maxY-m_minY;
|
||||
};
|
||||
|
||||
void wxDC::GetSizeMM( long* width, long* height ) const
|
||||
{
|
||||
int w = 0;
|
||||
int h = 0;
|
||||
GetSize( &w, &h );
|
||||
*width = long( double(w) / (m_scaleX*m_mm_to_pix_x) );
|
||||
*height = long( double(h) / (m_scaleY*m_mm_to_pix_y) );
|
||||
};
|
||||
|
||||
void wxDC::SetTextForeground( const wxColour &col )
|
||||
{
|
||||
if (!Ok()) return;
|
||||
m_textForegroundColour = col;
|
||||
};
|
||||
|
||||
void wxDC::SetTextBackground( const wxColour &col )
|
||||
{
|
||||
if (!Ok()) return;
|
||||
m_textBackgroundColour = col;
|
||||
};
|
||||
|
||||
void wxDC::SetMapMode( int mode )
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
case wxMM_TWIPS:
|
||||
SetLogicalScale( twips2mm*m_mm_to_pix_x, twips2mm*m_mm_to_pix_y );
|
||||
break;
|
||||
case wxMM_POINTS:
|
||||
SetLogicalScale( pt2mm*m_mm_to_pix_x, pt2mm*m_mm_to_pix_y );
|
||||
break;
|
||||
case wxMM_METRIC:
|
||||
SetLogicalScale( m_mm_to_pix_x, m_mm_to_pix_y );
|
||||
break;
|
||||
case wxMM_LOMETRIC:
|
||||
SetLogicalScale( m_mm_to_pix_x/10.0, m_mm_to_pix_y/10.0 );
|
||||
break;
|
||||
default:
|
||||
case wxMM_TEXT:
|
||||
SetLogicalScale( 1.0, 1.0 );
|
||||
break;
|
||||
};
|
||||
if (mode != wxMM_TEXT)
|
||||
{
|
||||
m_needComputeScaleX = TRUE;
|
||||
m_needComputeScaleY = TRUE;
|
||||
};
|
||||
};
|
||||
|
||||
void wxDC::SetUserScale( double x, double y )
|
||||
{
|
||||
// allow negative ? -> no
|
||||
m_userScaleX = x;
|
||||
m_userScaleY = y;
|
||||
ComputeScaleAndOrigin();
|
||||
};
|
||||
|
||||
void wxDC::GetUserScale( double *x, double *y )
|
||||
{
|
||||
if (x) *x = m_userScaleX;
|
||||
if (y) *y = m_userScaleY;
|
||||
};
|
||||
|
||||
void wxDC::SetLogicalScale( double x, double y )
|
||||
{
|
||||
// allow negative ?
|
||||
m_logicalScaleX = x;
|
||||
m_logicalScaleY = y;
|
||||
ComputeScaleAndOrigin();
|
||||
};
|
||||
|
||||
void wxDC::GetLogicalScale( double *x, double *y )
|
||||
{
|
||||
if (x) *x = m_logicalScaleX;
|
||||
if (y) *y = m_logicalScaleY;
|
||||
};
|
||||
|
||||
void wxDC::SetLogicalOrigin( long x, long y )
|
||||
{
|
||||
m_logicalOriginX = x * m_signX; // is this still correct ?
|
||||
m_logicalOriginY = y * m_signY;
|
||||
ComputeScaleAndOrigin();
|
||||
};
|
||||
|
||||
void wxDC::GetLogicalOrigin( long *x, long *y )
|
||||
{
|
||||
if (x) *x = m_logicalOriginX;
|
||||
if (y) *y = m_logicalOriginY;
|
||||
};
|
||||
|
||||
void wxDC::SetDeviceOrigin( long x, long y )
|
||||
{
|
||||
m_externalDeviceOriginX = x;
|
||||
m_externalDeviceOriginY = y;
|
||||
ComputeScaleAndOrigin();
|
||||
};
|
||||
|
||||
void wxDC::GetDeviceOrigin( long *x, long *y )
|
||||
{
|
||||
// if (x) *x = m_externalDeviceOriginX;
|
||||
// if (y) *y = m_externalDeviceOriginY;
|
||||
if (x) *x = m_deviceOriginX;
|
||||
if (y) *y = m_deviceOriginY;
|
||||
};
|
||||
|
||||
void wxDC::SetInternalDeviceOrigin( long x, long y )
|
||||
{
|
||||
m_internalDeviceOriginX = x;
|
||||
m_internalDeviceOriginY = y;
|
||||
ComputeScaleAndOrigin();
|
||||
};
|
||||
|
||||
void wxDC::GetInternalDeviceOrigin( long *x, long *y )
|
||||
{
|
||||
if (x) *x = m_internalDeviceOriginX;
|
||||
if (y) *y = m_internalDeviceOriginY;
|
||||
};
|
||||
|
||||
void wxDC::SetAxisOrientation( bool xLeftRight, bool yBottomUp )
|
||||
{
|
||||
m_signX = (xLeftRight ? 1 : -1);
|
||||
m_signY = (yBottomUp ? -1 : 1);
|
||||
ComputeScaleAndOrigin();
|
||||
};
|
||||
|
||||
long wxDC::DeviceToLogicalX(long x) const
|
||||
{
|
||||
return XDEV2LOG(x);
|
||||
};
|
||||
|
||||
long wxDC::DeviceToLogicalY(long y) const
|
||||
{
|
||||
return YDEV2LOG(y);
|
||||
};
|
||||
|
||||
long wxDC::DeviceToLogicalXRel(long x) const
|
||||
{
|
||||
return XDEV2LOGREL(x);
|
||||
};
|
||||
|
||||
long wxDC::DeviceToLogicalYRel(long y) const
|
||||
{
|
||||
return YDEV2LOGREL(y);
|
||||
};
|
||||
|
||||
long wxDC::LogicalToDeviceX(long x) const
|
||||
{
|
||||
return XLOG2DEV(x);
|
||||
};
|
||||
|
||||
long wxDC::LogicalToDeviceY(long y) const
|
||||
{
|
||||
return YLOG2DEV(y);
|
||||
};
|
||||
|
||||
long wxDC::LogicalToDeviceXRel(long x) const
|
||||
{
|
||||
return XLOG2DEVREL(x);
|
||||
};
|
||||
|
||||
long wxDC::LogicalToDeviceYRel(long y) const
|
||||
{
|
||||
return YLOG2DEVREL(y);
|
||||
};
|
||||
|
||||
void wxDC::CalcBoundingBox( long x, long y )
|
||||
{
|
||||
if (x < m_minX) m_minX = x;
|
||||
if (y < m_minY) m_minY = y;
|
||||
if (x > m_maxX) m_maxX = x;
|
||||
if (y > m_maxY) m_maxY = y;
|
||||
};
|
||||
|
||||
void wxDC::ComputeScaleAndOrigin(void)
|
||||
{
|
||||
// CMB: copy scale to see if it changes
|
||||
double origScaleX = m_scaleX;
|
||||
double origScaleY = m_scaleY;
|
||||
|
||||
m_scaleX = m_logicalScaleX * m_userScaleX;
|
||||
m_scaleY = m_logicalScaleY * m_userScaleY;
|
||||
|
||||
m_deviceOriginX = m_internalDeviceOriginX + m_externalDeviceOriginX;
|
||||
m_deviceOriginY = m_internalDeviceOriginY + m_externalDeviceOriginY;
|
||||
|
||||
// CMB: if scale has changed call SetPen to recalulate the line width
|
||||
if (m_scaleX != origScaleX || m_scaleY != origScaleY)
|
||||
{
|
||||
// this is a bit artificial, but we need to force wxDC to think
|
||||
// the pen has changed
|
||||
wxPen* pen = & GetPen();
|
||||
wxPen tempPen;
|
||||
m_pen = tempPen;
|
||||
SetPen(* pen);
|
||||
}
|
||||
};
|
||||
|
635
src/os2/dcclient.cpp
Normal file
635
src/os2/dcclient.cpp
Normal file
@ -0,0 +1,635 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dcclient.cpp
|
||||
// Purpose: wxClientDC class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "dcclient.h"
|
||||
#endif
|
||||
|
||||
#include "wx/dcclient.h"
|
||||
#include "wx/dcmemory.h"
|
||||
#include "wx/region.h"
|
||||
#include <math.h>
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// constants
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#define RAD2DEG 57.2957795131
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxPaintDC
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#if !USE_SHARED_LIBRARY
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxWindowDC, wxDC)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxClientDC, wxWindowDC)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPaintDC, wxWindowDC)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* wxWindowDC
|
||||
*/
|
||||
|
||||
wxWindowDC::wxWindowDC(void)
|
||||
{
|
||||
};
|
||||
|
||||
wxWindowDC::wxWindowDC( wxWindow *window )
|
||||
{
|
||||
};
|
||||
|
||||
wxWindowDC::~wxWindowDC(void)
|
||||
{
|
||||
};
|
||||
|
||||
void wxWindowDC::FloodFill( long WXUNUSED(x1), long WXUNUSED(y1),
|
||||
const wxColour& WXUNUSED(col), int WXUNUSED(style) )
|
||||
{
|
||||
};
|
||||
|
||||
bool wxWindowDC::GetPixel( long WXUNUSED(x1), long WXUNUSED(y1), wxColour *WXUNUSED(col) ) const
|
||||
{
|
||||
return FALSE;
|
||||
};
|
||||
|
||||
void wxWindowDC::DrawLine( long x1, long y1, long x2, long y2 )
|
||||
{
|
||||
if (!Ok()) return;
|
||||
|
||||
};
|
||||
|
||||
void wxWindowDC::CrossHair( long x, long y )
|
||||
{
|
||||
if (!Ok()) return;
|
||||
|
||||
};
|
||||
|
||||
void wxWindowDC::DrawArc( long x1, long y1, long x2, long y2, long xc, long yc )
|
||||
{
|
||||
if (!Ok()) return;
|
||||
|
||||
long xx1 = XLOG2DEV(x1);
|
||||
long yy1 = YLOG2DEV(y1);
|
||||
long xx2 = XLOG2DEV(x2);
|
||||
long yy2 = YLOG2DEV(y2);
|
||||
long xxc = XLOG2DEV((long)xc);
|
||||
long yyc = YLOG2DEV((long)yc);
|
||||
double dx = xx1 - xxc;
|
||||
double dy = yy1 - yyc;
|
||||
double radius = sqrt(dx*dx+dy*dy);
|
||||
long r = (long)radius;
|
||||
double radius1, radius2;
|
||||
|
||||
if (xx1 == xx2 && yy1 == yy2)
|
||||
{
|
||||
radius1 = 0.0;
|
||||
radius2 = 360.0;
|
||||
}
|
||||
else
|
||||
if (radius == 0.0)
|
||||
{
|
||||
radius1 = radius2 = 0.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
radius1 = (xx1 - xxc == 0) ?
|
||||
(yy1 - yyc < 0) ? 90.0 : -90.0 :
|
||||
-atan2(double(yy1-yyc), double(xx1-xxc)) * RAD2DEG;
|
||||
radius2 = (xx2 - xxc == 0) ?
|
||||
(yy2 - yyc < 0) ? 90.0 : -90.0 :
|
||||
-atan2(double(yy2-yyc), double(xx2-xxc)) * RAD2DEG;
|
||||
};
|
||||
long alpha1 = long(radius1 * 64.0);
|
||||
long alpha2 = long((radius2 - radius1) * 64.0);
|
||||
while (alpha2 <= 0) alpha2 += 360*64;
|
||||
while (alpha1 > 360*64) alpha1 -= 360*64;
|
||||
|
||||
if (m_brush.GetStyle() != wxTRANSPARENT) {};
|
||||
|
||||
if (m_pen.GetStyle() != wxTRANSPARENT) {};
|
||||
|
||||
};
|
||||
|
||||
void wxWindowDC::DrawEllipticArc( long x, long y, long width, long height, double sa, double ea )
|
||||
{
|
||||
if (!Ok()) return;
|
||||
|
||||
long xx = XLOG2DEV(x);
|
||||
long yy = YLOG2DEV(y);
|
||||
long ww = m_signX * XLOG2DEVREL(width);
|
||||
long hh = m_signY * YLOG2DEVREL(height);
|
||||
|
||||
// CMB: handle -ve width and/or height
|
||||
if (ww < 0) { ww = -ww; xx = xx - ww; }
|
||||
if (hh < 0) { hh = -hh; yy = yy - hh; }
|
||||
|
||||
long start = long(sa * 64.0);
|
||||
long end = long(ea * 64.0);
|
||||
if (m_brush.GetStyle() != wxTRANSPARENT) {};
|
||||
|
||||
if (m_pen.GetStyle() != wxTRANSPARENT) {};
|
||||
};
|
||||
|
||||
void wxWindowDC::DrawPoint( long x, long y )
|
||||
{
|
||||
if (!Ok()) return;
|
||||
|
||||
if (m_pen.GetStyle() != wxTRANSPARENT) {};
|
||||
};
|
||||
|
||||
void wxWindowDC::DrawLines( int n, wxPoint points[], long xoffset, long yoffset )
|
||||
{
|
||||
if (!Ok()) return;
|
||||
|
||||
if (m_pen.GetStyle() == wxTRANSPARENT) return;
|
||||
|
||||
for (int i = 0; i < n-1; i++)
|
||||
{
|
||||
long x1 = XLOG2DEV(points[i].x + xoffset);
|
||||
long x2 = XLOG2DEV(points[i+1].x + xoffset);
|
||||
long y1 = YLOG2DEV(points[i].y + yoffset); // oh, what a waste
|
||||
long y2 = YLOG2DEV(points[i+1].y + yoffset);
|
||||
};
|
||||
};
|
||||
|
||||
void wxWindowDC::DrawLines( wxList *points, long xoffset, long yoffset )
|
||||
{
|
||||
if (!Ok()) return;
|
||||
|
||||
if (m_pen.GetStyle() == wxTRANSPARENT) return;
|
||||
|
||||
wxNode *node = points->First();
|
||||
while (node->Next())
|
||||
{
|
||||
wxPoint *point = (wxPoint*)node->Data();
|
||||
wxPoint *npoint = (wxPoint*)node->Next()->Data();
|
||||
long x1 = XLOG2DEV(point->x + xoffset);
|
||||
long x2 = XLOG2DEV(npoint->x + xoffset);
|
||||
long y1 = YLOG2DEV(point->y + yoffset); // and again...
|
||||
long y2 = YLOG2DEV(npoint->y + yoffset);
|
||||
node = node->Next();
|
||||
};
|
||||
};
|
||||
|
||||
void wxWindowDC::DrawPolygon( int WXUNUSED(n), wxPoint WXUNUSED(points)[],
|
||||
long WXUNUSED(xoffset), long WXUNUSED(yoffset), int WXUNUSED(fillStyle) )
|
||||
{
|
||||
if (!Ok()) return;
|
||||
};
|
||||
|
||||
void wxWindowDC::DrawPolygon( wxList *WXUNUSED(lines), long WXUNUSED(xoffset),
|
||||
long WXUNUSED(yoffset), int WXUNUSED(fillStyle) )
|
||||
{
|
||||
if (!Ok()) return;
|
||||
};
|
||||
|
||||
void wxWindowDC::DrawRectangle( long x, long y, long width, long height )
|
||||
{
|
||||
if (!Ok()) return;
|
||||
|
||||
long xx = XLOG2DEV(x);
|
||||
long yy = YLOG2DEV(y);
|
||||
long ww = m_signX * XLOG2DEVREL(width);
|
||||
long hh = m_signY * YLOG2DEVREL(height);
|
||||
|
||||
// CMB: draw nothing if transformed w or h is 0
|
||||
if (ww == 0 || hh == 0) return;
|
||||
|
||||
// CMB: handle -ve width and/or height
|
||||
if (ww < 0) { ww = -ww; xx = xx - ww; }
|
||||
if (hh < 0) { hh = -hh; yy = yy - hh; }
|
||||
|
||||
if (m_brush.GetStyle() != wxTRANSPARENT) {};
|
||||
|
||||
if (m_pen.GetStyle() != wxTRANSPARENT) {};
|
||||
};
|
||||
|
||||
void wxWindowDC::DrawRoundedRectangle( long x, long y, long width, long height, double radius )
|
||||
{
|
||||
if (!Ok()) return;
|
||||
|
||||
if (radius < 0.0) radius = - radius * ((width < height) ? width : height);
|
||||
|
||||
long xx = XLOG2DEV(x);
|
||||
long yy = YLOG2DEV(y);
|
||||
long ww = m_signX * XLOG2DEVREL(width);
|
||||
long hh = m_signY * YLOG2DEVREL(height);
|
||||
long rr = XLOG2DEVREL((long)radius);
|
||||
|
||||
// CMB: handle -ve width and/or height
|
||||
if (ww < 0) { ww = -ww; xx = xx - ww; }
|
||||
if (hh < 0) { hh = -hh; yy = yy - hh; }
|
||||
|
||||
// CMB: if radius is zero use DrawRectangle() instead to avoid
|
||||
// X drawing errors with small radii
|
||||
if (rr == 0)
|
||||
{
|
||||
DrawRectangle( x, y, width, height );
|
||||
return;
|
||||
}
|
||||
|
||||
// CMB: draw nothing if transformed w or h is 0
|
||||
if (ww == 0 || hh == 0) return;
|
||||
|
||||
// CMB: adjust size if outline is drawn otherwise the result is
|
||||
// 1 pixel too wide and high
|
||||
if (m_pen.GetStyle() != wxTRANSPARENT)
|
||||
{
|
||||
ww--;
|
||||
hh--;
|
||||
}
|
||||
|
||||
// CMB: ensure dd is not larger than rectangle otherwise we
|
||||
// get an hour glass shape
|
||||
long dd = 2 * rr;
|
||||
if (dd > ww) dd = ww;
|
||||
if (dd > hh) dd = hh;
|
||||
rr = dd / 2;
|
||||
|
||||
if (m_brush.GetStyle() != wxTRANSPARENT)
|
||||
{
|
||||
};
|
||||
|
||||
if (m_pen.GetStyle() != wxTRANSPARENT)
|
||||
{
|
||||
};
|
||||
};
|
||||
|
||||
void wxWindowDC::DrawEllipse( long x, long y, long width, long height )
|
||||
{
|
||||
if (!Ok()) return;
|
||||
|
||||
long xx = XLOG2DEV(x);
|
||||
long yy = YLOG2DEV(y);
|
||||
long ww = m_signX * XLOG2DEVREL(width);
|
||||
long hh = m_signY * YLOG2DEVREL(height);
|
||||
|
||||
// CMB: handle -ve width and/or height
|
||||
if (ww < 0) { ww = -ww; xx = xx - ww; }
|
||||
if (hh < 0) { hh = -hh; yy = yy - hh; }
|
||||
|
||||
if (m_brush.GetStyle() != wxTRANSPARENT) {};
|
||||
|
||||
if (m_pen.GetStyle() != wxTRANSPARENT) {};
|
||||
};
|
||||
|
||||
bool wxWindowDC::CanDrawBitmap(void) const
|
||||
{
|
||||
return TRUE;
|
||||
};
|
||||
|
||||
void wxWindowDC::DrawIcon( const wxIcon &icon, long x, long y, bool useMask )
|
||||
{
|
||||
if (!Ok()) return;
|
||||
|
||||
if (!icon.Ok()) return;
|
||||
|
||||
int xx = XLOG2DEV(x);
|
||||
int yy = YLOG2DEV(y);
|
||||
|
||||
};
|
||||
|
||||
bool wxWindowDC::Blit( long xdest, long ydest, long width, long height,
|
||||
wxDC *source, long xsrc, long ysrc, int WXUNUSED(logical_func), bool WXUNUSED(useMask) )
|
||||
{
|
||||
if (!Ok()) return FALSE;
|
||||
|
||||
// CMB 20/5/98: add blitting of bitmaps
|
||||
if (source->IsKindOf(CLASSINFO(wxMemoryDC)))
|
||||
{
|
||||
wxMemoryDC* srcDC = (wxMemoryDC*)source;
|
||||
/*
|
||||
GdkBitmap* bmap = srcDC->m_selected.GetBitmap();
|
||||
if (bmap)
|
||||
{
|
||||
gdk_draw_bitmap (
|
||||
m_window,
|
||||
m_textGC,
|
||||
bmap,
|
||||
source->DeviceToLogicalX(xsrc), source->DeviceToLogicalY(ysrc),
|
||||
XLOG2DEV(xdest), YLOG2DEV(ydest),
|
||||
source->DeviceToLogicalXRel(width), source->DeviceToLogicalYRel(height)
|
||||
);
|
||||
return TRUE;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
};
|
||||
|
||||
void wxWindowDC::DrawText( const wxString &text, long x, long y, bool
|
||||
WXUNUSED(use16) )
|
||||
{
|
||||
if (!Ok()) return;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
bool wxWindowDC::CanGetTextExtent(void) const
|
||||
{
|
||||
return TRUE;
|
||||
};
|
||||
|
||||
void wxWindowDC::GetTextExtent( const wxString &string, long *width, long *height,
|
||||
long *WXUNUSED(descent), long *WXUNUSED(externalLeading),
|
||||
wxFont *WXUNUSED(theFont), bool WXUNUSED(use16) )
|
||||
{
|
||||
if (!Ok()) return;
|
||||
|
||||
};
|
||||
|
||||
long wxWindowDC::GetCharWidth(void)
|
||||
{
|
||||
if (!Ok()) return 0;
|
||||
return 0;
|
||||
};
|
||||
|
||||
long wxWindowDC::GetCharHeight(void)
|
||||
{
|
||||
if (!Ok()) return 0;
|
||||
return 0;
|
||||
};
|
||||
|
||||
void wxWindowDC::Clear(void)
|
||||
{
|
||||
if (!Ok()) return;
|
||||
|
||||
};
|
||||
|
||||
void wxWindowDC::SetFont( const wxFont &font )
|
||||
{
|
||||
if (!Ok()) return;
|
||||
|
||||
m_font = font;
|
||||
};
|
||||
|
||||
void wxWindowDC::SetPen( const wxPen &pen )
|
||||
{
|
||||
if (!Ok()) return;
|
||||
|
||||
if (m_pen == pen) return;
|
||||
|
||||
m_pen = pen;
|
||||
|
||||
if (!m_pen.Ok()) return;
|
||||
};
|
||||
|
||||
void wxWindowDC::SetBrush( const wxBrush &brush )
|
||||
{
|
||||
if (!Ok()) return;
|
||||
|
||||
if (m_brush == brush) return;
|
||||
|
||||
m_brush = brush;
|
||||
|
||||
if (!m_brush.Ok()) return;
|
||||
|
||||
};
|
||||
|
||||
void wxWindowDC::SetBackground( const wxBrush &brush )
|
||||
{
|
||||
if (!Ok()) return;
|
||||
|
||||
if (m_backgroundBrush == brush) return;
|
||||
|
||||
m_backgroundBrush = brush;
|
||||
|
||||
if (!m_backgroundBrush.Ok()) return;
|
||||
|
||||
};
|
||||
|
||||
void wxWindowDC::SetLogicalFunction( int function )
|
||||
{
|
||||
if (m_logicalFunction == function) return;
|
||||
};
|
||||
|
||||
void wxWindowDC::SetTextForeground( const wxColour &col )
|
||||
{
|
||||
if (!Ok()) return;
|
||||
|
||||
if (m_textForegroundColour == col) return;
|
||||
|
||||
m_textForegroundColour = col;
|
||||
if (!m_textForegroundColour.Ok()) return;
|
||||
};
|
||||
|
||||
void wxWindowDC::SetTextBackground( const wxColour &col )
|
||||
{
|
||||
if (!Ok()) return;
|
||||
|
||||
if (m_textBackgroundColour == col) return;
|
||||
|
||||
m_textBackgroundColour = col;
|
||||
if (!m_textBackgroundColour.Ok()) return;
|
||||
};
|
||||
|
||||
void wxWindowDC::SetBackgroundMode( int mode )
|
||||
{
|
||||
m_backgroundMode = mode;
|
||||
|
||||
if (m_brush.GetStyle() != wxSOLID && m_brush.GetStyle() != wxTRANSPARENT)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
void wxWindowDC::SetPalette( const wxPalette& WXUNUSED(palette) )
|
||||
{
|
||||
};
|
||||
|
||||
void wxWindowDC::SetClippingRegion( long x, long y, long width, long height )
|
||||
{
|
||||
wxDC::SetClippingRegion( x, y, width, height );
|
||||
|
||||
// TODO
|
||||
|
||||
};
|
||||
|
||||
void wxWindowDC::SetClippingRegion( const wxRegion& region )
|
||||
{
|
||||
wxRect box = region.GetBox();
|
||||
|
||||
wxDC::SetClippingRegion( box.x, box.y, box.width, box.height );
|
||||
|
||||
// TODO
|
||||
}
|
||||
|
||||
void wxWindowDC::DestroyClippingRegion(void)
|
||||
{
|
||||
wxDC::DestroyClippingRegion();
|
||||
|
||||
};
|
||||
|
||||
// ----------------------------------- spline code ----------------------------------------
|
||||
|
||||
void wx_quadratic_spline(double a1, double b1, double a2, double b2,
|
||||
double a3, double b3, double a4, double b4);
|
||||
void wx_clear_stack(void);
|
||||
int wx_spline_pop(double *x1, double *y1, double *x2, double *y2, double *x3,
|
||||
double *y3, double *x4, double *y4);
|
||||
void wx_spline_push(double x1, double y1, double x2, double y2, double x3, double y3,
|
||||
double x4, double y4);
|
||||
static bool wx_spline_add_point(double x, double y);
|
||||
static void wx_spline_draw_point_array(wxDC *dc);
|
||||
|
||||
wxList wx_spline_point_list;
|
||||
|
||||
#define half(z1, z2) ((z1+z2)/2.0)
|
||||
#define THRESHOLD 5
|
||||
|
||||
/* iterative version */
|
||||
|
||||
void wx_quadratic_spline(double a1, double b1, double a2, double b2, double a3, double b3, double a4,
|
||||
double b4)
|
||||
{
|
||||
register double xmid, ymid;
|
||||
double x1, y1, x2, y2, x3, y3, x4, y4;
|
||||
|
||||
wx_clear_stack();
|
||||
wx_spline_push(a1, b1, a2, b2, a3, b3, a4, b4);
|
||||
|
||||
while (wx_spline_pop(&x1, &y1, &x2, &y2, &x3, &y3, &x4, &y4)) {
|
||||
xmid = (double)half(x2, x3);
|
||||
ymid = (double)half(y2, y3);
|
||||
if (fabs(x1 - xmid) < THRESHOLD && fabs(y1 - ymid) < THRESHOLD &&
|
||||
fabs(xmid - x4) < THRESHOLD && fabs(ymid - y4) < THRESHOLD) {
|
||||
wx_spline_add_point( x1, y1 );
|
||||
wx_spline_add_point( xmid, ymid );
|
||||
} else {
|
||||
wx_spline_push(xmid, ymid, (double)half(xmid, x3), (double)half(ymid, y3),
|
||||
(double)half(x3, x4), (double)half(y3, y4), x4, y4);
|
||||
wx_spline_push(x1, y1, (double)half(x1, x2), (double)half(y1, y2),
|
||||
(double)half(x2, xmid), (double)half(y2, ymid), xmid, ymid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* utilities used by spline drawing routines */
|
||||
|
||||
typedef struct wx_spline_stack_struct {
|
||||
double x1, y1, x2, y2, x3, y3, x4, y4;
|
||||
} Stack;
|
||||
|
||||
#define SPLINE_STACK_DEPTH 20
|
||||
static Stack wx_spline_stack[SPLINE_STACK_DEPTH];
|
||||
static Stack *wx_stack_top;
|
||||
static int wx_stack_count;
|
||||
|
||||
void wx_clear_stack(void)
|
||||
{
|
||||
wx_stack_top = wx_spline_stack;
|
||||
wx_stack_count = 0;
|
||||
}
|
||||
|
||||
void wx_spline_push(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)
|
||||
{
|
||||
wx_stack_top->x1 = x1;
|
||||
wx_stack_top->y1 = y1;
|
||||
wx_stack_top->x2 = x2;
|
||||
wx_stack_top->y2 = y2;
|
||||
wx_stack_top->x3 = x3;
|
||||
wx_stack_top->y3 = y3;
|
||||
wx_stack_top->x4 = x4;
|
||||
wx_stack_top->y4 = y4;
|
||||
wx_stack_top++;
|
||||
wx_stack_count++;
|
||||
}
|
||||
|
||||
int wx_spline_pop(double *x1, double *y1, double *x2, double *y2,
|
||||
double *x3, double *y3, double *x4, double *y4)
|
||||
{
|
||||
if (wx_stack_count == 0)
|
||||
return (0);
|
||||
wx_stack_top--;
|
||||
wx_stack_count--;
|
||||
*x1 = wx_stack_top->x1;
|
||||
*y1 = wx_stack_top->y1;
|
||||
*x2 = wx_stack_top->x2;
|
||||
*y2 = wx_stack_top->y2;
|
||||
*x3 = wx_stack_top->x3;
|
||||
*y3 = wx_stack_top->y3;
|
||||
*x4 = wx_stack_top->x4;
|
||||
*y4 = wx_stack_top->y4;
|
||||
return (1);
|
||||
}
|
||||
|
||||
static bool wx_spline_add_point(double x, double y)
|
||||
{
|
||||
wxPoint *point = new wxPoint ;
|
||||
point->x = (int) x;
|
||||
point->y = (int) y;
|
||||
wx_spline_point_list.Append((wxObject*)point);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void wx_spline_draw_point_array(wxDC *dc)
|
||||
{
|
||||
dc->DrawLines(&wx_spline_point_list, 0, 0 );
|
||||
wxNode *node = wx_spline_point_list.First();
|
||||
while (node)
|
||||
{
|
||||
wxPoint *point = (wxPoint *)node->Data();
|
||||
delete point;
|
||||
delete node;
|
||||
node = wx_spline_point_list.First();
|
||||
}
|
||||
}
|
||||
|
||||
void wxWindowDC::DrawSpline( wxList *points )
|
||||
{
|
||||
wxPoint *p;
|
||||
double cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4;
|
||||
double x1, y1, x2, y2;
|
||||
|
||||
wxNode *node = points->First();
|
||||
p = (wxPoint *)node->Data();
|
||||
|
||||
x1 = p->x;
|
||||
y1 = p->y;
|
||||
|
||||
node = node->Next();
|
||||
p = (wxPoint *)node->Data();
|
||||
|
||||
x2 = p->x;
|
||||
y2 = p->y;
|
||||
cx1 = (double)((x1 + x2) / 2);
|
||||
cy1 = (double)((y1 + y2) / 2);
|
||||
cx2 = (double)((cx1 + x2) / 2);
|
||||
cy2 = (double)((cy1 + y2) / 2);
|
||||
|
||||
wx_spline_add_point(x1, y1);
|
||||
|
||||
while ((node = node->Next()) != NULL)
|
||||
{
|
||||
p = (wxPoint *)node->Data();
|
||||
x1 = x2;
|
||||
y1 = y2;
|
||||
x2 = p->x;
|
||||
y2 = p->y;
|
||||
cx4 = (double)(x1 + x2) / 2;
|
||||
cy4 = (double)(y1 + y2) / 2;
|
||||
cx3 = (double)(x1 + cx4) / 2;
|
||||
cy3 = (double)(y1 + cy4) / 2;
|
||||
|
||||
wx_quadratic_spline(cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4);
|
||||
|
||||
cx1 = cx4;
|
||||
cy1 = cy4;
|
||||
cx2 = (double)(cx1 + x2) / 2;
|
||||
cy2 = (double)(cy1 + y2) / 2;
|
||||
}
|
||||
|
||||
wx_spline_add_point( cx1, cy1 );
|
||||
wx_spline_add_point( x2, y2 );
|
||||
|
||||
wx_spline_draw_point_array( this );
|
||||
};
|
64
src/os2/dcmemory.cpp
Normal file
64
src/os2/dcmemory.cpp
Normal file
@ -0,0 +1,64 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dcmemory.cpp
|
||||
// Purpose: wxMemoryDC class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "dcmemory.h"
|
||||
#endif
|
||||
|
||||
#include "wx/dcmemory.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxMemoryDC
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC,wxPaintDC)
|
||||
|
||||
wxMemoryDC::wxMemoryDC(void)
|
||||
{
|
||||
m_ok = FALSE;
|
||||
};
|
||||
|
||||
wxMemoryDC::wxMemoryDC( wxDC *WXUNUSED(dc) )
|
||||
{
|
||||
m_ok = FALSE;
|
||||
};
|
||||
|
||||
wxMemoryDC::~wxMemoryDC(void)
|
||||
{
|
||||
};
|
||||
|
||||
void wxMemoryDC::SelectObject( const wxBitmap& bitmap )
|
||||
{
|
||||
m_selected = bitmap;
|
||||
if (m_selected.Ok())
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
m_ok = FALSE;
|
||||
};
|
||||
};
|
||||
|
||||
void wxMemoryDC::GetSize( int *width, int *height ) const
|
||||
{
|
||||
if (m_selected.Ok())
|
||||
{
|
||||
if (width) (*width) = m_selected.GetWidth();
|
||||
if (height) (*height) = m_selected.GetHeight();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (width) (*width) = 0;
|
||||
if (height) (*height) = 0;
|
||||
};
|
||||
};
|
||||
|
||||
|
32
src/os2/dcscreen.cpp
Normal file
32
src/os2/dcscreen.cpp
Normal file
@ -0,0 +1,32 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dcscreen.cpp
|
||||
// Purpose: wxScreenDC class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "dcscreen.h"
|
||||
#endif
|
||||
|
||||
#include "wx/dcscreen.h"
|
||||
|
||||
#if !USE_SHARED_LIBRARY
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxScreenDC, wxWindowDC)
|
||||
#endif
|
||||
|
||||
// Create a DC representing the whole screen
|
||||
wxScreenDC::wxScreenDC()
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
wxScreenDC::~wxScreenDC()
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
286
src/os2/dialog.cpp
Normal file
286
src/os2/dialog.cpp
Normal file
@ -0,0 +1,286 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dialog.cpp
|
||||
// Purpose: wxDialog class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "dialog.h"
|
||||
#endif
|
||||
|
||||
#include "wx/dialog.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/frame.h"
|
||||
#include "wx/app.h"
|
||||
#include "wx/settings.h"
|
||||
|
||||
// Lists to keep track of windows, so we can disable/enable them
|
||||
// for modal dialogs
|
||||
wxList wxModalDialogs;
|
||||
wxList wxModelessWindows; // Frames and modeless dialogs
|
||||
extern wxList wxPendingDelete;
|
||||
|
||||
#if !USE_SHARED_LIBRARY
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxDialog, wxPanel)
|
||||
|
||||
BEGIN_EVENT_TABLE(wxDialog, wxPanel)
|
||||
EVT_BUTTON(wxID_OK, wxDialog::OnOK)
|
||||
EVT_BUTTON(wxID_APPLY, wxDialog::OnApply)
|
||||
EVT_BUTTON(wxID_CANCEL, wxDialog::OnCancel)
|
||||
EVT_CHAR_HOOK(wxDialog::OnCharHook)
|
||||
EVT_SYS_COLOUR_CHANGED(wxDialog::OnSysColourChanged)
|
||||
EVT_CLOSE(wxDialog::OnCloseWindow)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
#endif
|
||||
|
||||
wxDialog::wxDialog()
|
||||
{
|
||||
SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));
|
||||
}
|
||||
|
||||
bool wxDialog::Create(wxWindow *parent, wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style,
|
||||
const wxString& name)
|
||||
{
|
||||
m_windowStyle = style;
|
||||
|
||||
SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));
|
||||
SetName(name);
|
||||
|
||||
if (!parent)
|
||||
wxTopLevelWindows.Append(this);
|
||||
|
||||
if (parent) parent->AddChild(this);
|
||||
|
||||
if ( id == -1 )
|
||||
m_windowId = (int)NewControlId();
|
||||
else
|
||||
m_windowId = id;
|
||||
|
||||
// TODO: create dialog
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void wxDialog::SetModal(bool flag)
|
||||
{
|
||||
if ( flag )
|
||||
m_windowStyle |= wxDIALOG_MODAL ;
|
||||
else
|
||||
if ( m_windowStyle & wxDIALOG_MODAL )
|
||||
m_windowStyle -= wxDIALOG_MODAL ;
|
||||
|
||||
wxModelessWindows.DeleteObject(this);
|
||||
if (!flag)
|
||||
wxModelessWindows.Append(this);
|
||||
}
|
||||
|
||||
wxDialog::~wxDialog()
|
||||
{
|
||||
// TODO
|
||||
wxTopLevelWindows.DeleteObject(this);
|
||||
|
||||
if ( (GetWindowStyleFlag() & wxDIALOG_MODAL) != wxDIALOG_MODAL )
|
||||
wxModelessWindows.DeleteObject(this);
|
||||
|
||||
// If this is the last top-level window, exit.
|
||||
if (wxTheApp && (wxTopLevelWindows.Number() == 0))
|
||||
{
|
||||
wxTheApp->SetTopWindow(NULL);
|
||||
|
||||
if (wxTheApp->GetExitOnFrameDelete())
|
||||
{
|
||||
// TODO: exit
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// By default, pressing escape cancels the dialog
|
||||
void wxDialog::OnCharHook(wxKeyEvent& event)
|
||||
{
|
||||
if (event.m_keyCode == WXK_ESCAPE)
|
||||
{
|
||||
// Behaviour changed in 2.0: we'll send a Cancel message
|
||||
// to the dialog instead of Close.
|
||||
wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
|
||||
cancelEvent.SetEventObject( this );
|
||||
GetEventHandler()->ProcessEvent(cancelEvent);
|
||||
|
||||
return;
|
||||
}
|
||||
// We didn't process this event.
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
void wxDialog::Iconize(bool WXUNUSED(iconize))
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
bool wxDialog::IsIconized() const
|
||||
{
|
||||
// TODO
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void wxDialog::SetClientSize(int width, int height)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void wxDialog::GetPosition(int *x, int *y) const
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
bool wxDialog::Show(bool show)
|
||||
{
|
||||
// TODO
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void wxDialog::SetTitle(const wxString& title)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
wxString wxDialog::GetTitle() const
|
||||
{
|
||||
// TODO
|
||||
return wxString("");
|
||||
}
|
||||
|
||||
void wxDialog::Centre(int direction)
|
||||
{
|
||||
int x_offset,y_offset ;
|
||||
int display_width, display_height;
|
||||
int width, height, x, y;
|
||||
wxWindow *parent = GetParent();
|
||||
if ((direction & wxCENTER_FRAME) && parent)
|
||||
{
|
||||
parent->GetPosition(&x_offset,&y_offset) ;
|
||||
parent->GetSize(&display_width,&display_height) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
wxDisplaySize(&display_width, &display_height);
|
||||
x_offset = 0 ;
|
||||
y_offset = 0 ;
|
||||
}
|
||||
|
||||
GetSize(&width, &height);
|
||||
GetPosition(&x, &y);
|
||||
|
||||
if (direction & wxHORIZONTAL)
|
||||
x = (int)((display_width - width)/2);
|
||||
if (direction & wxVERTICAL)
|
||||
y = (int)((display_height - height)/2);
|
||||
|
||||
SetSize(x+x_offset, y+y_offset, width, height);
|
||||
}
|
||||
|
||||
// Replacement for Show(TRUE) for modal dialogs - returns return code
|
||||
int wxDialog::ShowModal()
|
||||
{
|
||||
m_windowStyle |= wxDIALOG_MODAL;
|
||||
// TODO: modal showing
|
||||
Show(TRUE);
|
||||
return GetReturnCode();
|
||||
}
|
||||
|
||||
void wxDialog::EndModal(int retCode)
|
||||
{
|
||||
SetReturnCode(retCode);
|
||||
// TODO modal un-showing
|
||||
Show(FALSE);
|
||||
}
|
||||
|
||||
// Standard buttons
|
||||
void wxDialog::OnOK(wxCommandEvent& event)
|
||||
{
|
||||
if ( Validate() && TransferDataFromWindow() )
|
||||
{
|
||||
if ( IsModal() )
|
||||
EndModal(wxID_OK);
|
||||
else
|
||||
{
|
||||
SetReturnCode(wxID_OK);
|
||||
this->Show(FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void wxDialog::OnApply(wxCommandEvent& event)
|
||||
{
|
||||
if (Validate())
|
||||
TransferDataFromWindow();
|
||||
// TODO probably need to disable the Apply button until things change again
|
||||
}
|
||||
|
||||
void wxDialog::OnCancel(wxCommandEvent& event)
|
||||
{
|
||||
if ( IsModal() )
|
||||
EndModal(wxID_CANCEL);
|
||||
else
|
||||
{
|
||||
SetReturnCode(wxID_CANCEL);
|
||||
this->Show(FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
void wxDialog::OnCloseWindow(wxCloseEvent& event)
|
||||
{
|
||||
// We'll send a Cancel message by default,
|
||||
// which may close the dialog.
|
||||
// Check for looping if the Cancel event handler calls Close().
|
||||
|
||||
// Note that if a cancel button and handler aren't present in the dialog,
|
||||
// nothing will happen when you close the dialog via the window manager, or
|
||||
// via Close().
|
||||
// We wouldn't want to destroy the dialog by default, since the dialog may have been
|
||||
// created on the stack.
|
||||
// However, this does mean that calling dialog->Close() won't delete the dialog
|
||||
// unless the handler for wxID_CANCEL does so. So use Destroy() if you want to be
|
||||
// sure to destroy the dialog.
|
||||
// The default OnCancel (above) simply ends a modal dialog, and hides a modeless dialog.
|
||||
|
||||
static wxList closing;
|
||||
|
||||
if ( closing.Member(this) )
|
||||
return;
|
||||
|
||||
closing.Append(this);
|
||||
|
||||
wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
|
||||
cancelEvent.SetEventObject( this );
|
||||
GetEventHandler()->ProcessEvent(cancelEvent); // This may close the dialog
|
||||
|
||||
closing.DeleteObject(this);
|
||||
}
|
||||
|
||||
// Destroy the window (delayed, if a managed window)
|
||||
bool wxDialog::Destroy()
|
||||
{
|
||||
if (!wxPendingDelete.Member(this))
|
||||
wxPendingDelete.Append(this);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void wxDialog::OnSysColourChanged(wxSysColourChangedEvent& event)
|
||||
{
|
||||
SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void wxDialog::Fit()
|
||||
{
|
||||
}
|
42
src/os2/dirdlg.cpp
Normal file
42
src/os2/dirdlg.cpp
Normal file
@ -0,0 +1,42 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dirdlg.cpp
|
||||
// Purpose: wxDirDialog
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "dirdlg.h"
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/dialog.h"
|
||||
#include "wx/dirdlg.h"
|
||||
|
||||
#include "wx/cmndata.h"
|
||||
|
||||
#if !USE_SHARED_LIBRARY
|
||||
IMPLEMENT_CLASS(wxDirDialog, wxDialog)
|
||||
#endif
|
||||
|
||||
wxDirDialog::wxDirDialog(wxWindow *parent, const wxString& message,
|
||||
const wxString& defaultPath,
|
||||
long style, const wxPoint& pos)
|
||||
{
|
||||
m_message = message;
|
||||
m_dialogStyle = style;
|
||||
m_parent = parent;
|
||||
m_path = defaultPath;
|
||||
}
|
||||
|
||||
int wxDirDialog::ShowModal()
|
||||
{
|
||||
// TODO
|
||||
return wxID_CANCEL;
|
||||
}
|
||||
|
133
src/os2/dnd.cpp
Normal file
133
src/os2/dnd.cpp
Normal file
@ -0,0 +1,133 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dnd.cpp
|
||||
// Purpose: wxDropTarget, wxDropSource, wxDataObject implementation
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 1998 AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "dnd.h"
|
||||
#endif
|
||||
|
||||
#include "wx/dnd.h"
|
||||
#include "wx/window.h"
|
||||
#include "wx/app.h"
|
||||
#include "wx/gdicmn.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// global
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxDropTarget
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxDropTarget::wxDropTarget()
|
||||
{
|
||||
};
|
||||
|
||||
wxDropTarget::~wxDropTarget()
|
||||
{
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxTextDropTarget
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxTextDropTarget::OnDrop( long x, long y, const void *pData )
|
||||
{
|
||||
OnDropText( x, y, (const char*)pData );
|
||||
return TRUE;
|
||||
};
|
||||
|
||||
bool wxTextDropTarget::OnDropText( long x, long y, const char *psz )
|
||||
{
|
||||
printf( "Got dropped text: %s.\n", psz );
|
||||
printf( "At x: %d, y: %d.\n", (int)x, (int)y );
|
||||
return TRUE;
|
||||
};
|
||||
|
||||
size_t wxTextDropTarget::GetFormatCount() const
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
wxDataFormat wxTextDropTarget::GetFormat(size_t WXUNUSED(n)) const
|
||||
{
|
||||
return wxDF_TEXT;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxFileDropTarget
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxFileDropTarget::OnDropFiles( long x, long y, size_t nFiles, const char * const WXUNUSED(aszFiles)[] )
|
||||
{
|
||||
printf( "Got %d dropped files.\n", (int)nFiles );
|
||||
printf( "At x: %d, y: %d.\n", (int)x, (int)y );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool wxFileDropTarget::OnDrop(long x, long y, const void *WXUNUSED(pData) )
|
||||
{
|
||||
char *str = "/this/is/a/path.txt";
|
||||
|
||||
return OnDropFiles(x, y, 1, &str );
|
||||
}
|
||||
|
||||
size_t wxFileDropTarget::GetFormatCount() const
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
wxDataFormat wxFileDropTarget::GetFormat(size_t WXUNUSED(n)) const
|
||||
{
|
||||
return wxDF_FILENAME;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// wxDropSource
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// drag request
|
||||
|
||||
wxDropSource::wxDropSource( wxWindow *win )
|
||||
{
|
||||
// TODO
|
||||
// m_window = win;
|
||||
m_data = NULL;
|
||||
|
||||
// m_defaultCursor = wxCursor( wxCURSOR_NO_ENTRY );
|
||||
// m_goaheadCursor = wxCursor( wxCURSOR_HAND );
|
||||
};
|
||||
|
||||
wxDropSource::wxDropSource( wxDataObject &data, wxWindow *win )
|
||||
{
|
||||
// TODO
|
||||
// m_window = win;
|
||||
m_data = &data;
|
||||
|
||||
// m_defaultCursor = wxCursor( wxCURSOR_NO_ENTRY );
|
||||
// m_goaheadCursor = wxCursor( wxCURSOR_HAND );
|
||||
};
|
||||
|
||||
void wxDropSource::SetData( wxDataObject &data )
|
||||
{
|
||||
m_data = &data;
|
||||
};
|
||||
|
||||
wxDropSource::~wxDropSource(void)
|
||||
{
|
||||
};
|
||||
|
||||
wxDragResult wxDropSource::DoDragDrop( bool WXUNUSED(bAllowMove) )
|
||||
{
|
||||
// TODO
|
||||
return wxDragError;
|
||||
};
|
||||
|
28
src/os2/dummy.cpp
Normal file
28
src/os2/dummy.cpp
Normal file
@ -0,0 +1,28 @@
|
||||
/*
|
||||
* File: dummy.cc
|
||||
* Purpose: See below
|
||||
* Author: Julian Smart
|
||||
* Created: 1993
|
||||
* Updated:
|
||||
* Copyright: (c) 1993, AIAI, University of Edinburgh
|
||||
*/
|
||||
|
||||
/* A dummy file to include wx.h. If precompiling wx.h, I
|
||||
* always start by compiling this and producing the PCH file.
|
||||
* Then subsequent source files use the PCH file.
|
||||
*
|
||||
* If precompiling wx.h for wxWindows and derived apps,
|
||||
* link dummy.obj with your program.
|
||||
*
|
||||
* This will produce a big PCH file.
|
||||
*/
|
||||
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#define INCL_OS2
|
||||
#include <os2.h>
|
||||
|
||||
#if defined(__VISAGECPP__)
|
||||
char wxDummyChar = 0;
|
||||
#endif
|
||||
|
23
src/os2/dummydll.cpp
Normal file
23
src/os2/dummydll.cpp
Normal file
@ -0,0 +1,23 @@
|
||||
/*
|
||||
* File: dummydll.cc
|
||||
* Purpose:
|
||||
* Author: Julian Smart
|
||||
* Created: 1993
|
||||
* Updated:
|
||||
* Copyright: (c) 1993, AIAI, University of Edinburgh
|
||||
*/
|
||||
|
||||
/* static const char sccsid[] = "@(#)dummydll.cc 1.2 5/9/94"; */
|
||||
|
||||
/*
|
||||
* A dummy file to include wx.h. If precompiling wx.h, I
|
||||
* always start by compiling this and producing the PCH file.
|
||||
* Then subsequent source files use the PCH file.
|
||||
*/
|
||||
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#if defined(__VISAGECPP__)
|
||||
char wxDummyChar=0;
|
||||
#endif
|
||||
|
138
src/os2/filedlg.cpp
Normal file
138
src/os2/filedlg.cpp
Normal file
@ -0,0 +1,138 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: filedlg.cpp
|
||||
// Purpose: wxFileDialog
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "filedlg.h"
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/dialog.h"
|
||||
#include "wx/filedlg.h"
|
||||
#include "wx/intl.h"
|
||||
|
||||
#if !USE_SHARED_LIBRARY
|
||||
IMPLEMENT_CLASS(wxFileDialog, wxDialog)
|
||||
#endif
|
||||
|
||||
wxString wxFileSelector(const char *title,
|
||||
const char *defaultDir, const char *defaultFileName,
|
||||
const char *defaultExtension, const char *filter, int flags,
|
||||
wxWindow *parent, int x, int y)
|
||||
{
|
||||
// If there's a default extension specified but no filter, we create a suitable
|
||||
// filter.
|
||||
|
||||
wxString filter2("");
|
||||
if ( defaultExtension && !filter )
|
||||
filter2 = wxString("*.") + wxString(defaultExtension) ;
|
||||
else if ( filter )
|
||||
filter2 = filter;
|
||||
|
||||
wxString defaultDirString;
|
||||
if (defaultDir)
|
||||
defaultDirString = defaultDir;
|
||||
else
|
||||
defaultDirString = "";
|
||||
|
||||
wxString defaultFilenameString;
|
||||
if (defaultFileName)
|
||||
defaultFilenameString = defaultFileName;
|
||||
else
|
||||
defaultFilenameString = "";
|
||||
|
||||
wxFileDialog fileDialog(parent, title, defaultDirString, defaultFilenameString, filter2, flags, wxPoint(x, y));
|
||||
|
||||
if ( fileDialog.ShowModal() == wxID_OK )
|
||||
{
|
||||
return fileDialog.GetPath();
|
||||
}
|
||||
else
|
||||
return wxEmptyString;
|
||||
}
|
||||
|
||||
wxString wxFileSelectorEx(const char *title,
|
||||
const char *defaultDir,
|
||||
const char *defaultFileName,
|
||||
int* defaultFilterIndex,
|
||||
const char *filter,
|
||||
int flags,
|
||||
wxWindow* parent,
|
||||
int x,
|
||||
int y)
|
||||
|
||||
{
|
||||
wxFileDialog fileDialog(parent, title ? title : "", defaultDir ? defaultDir : "",
|
||||
defaultFileName ? defaultFileName : "", filter ? filter : "", flags, wxPoint(x, y));
|
||||
|
||||
if ( fileDialog.ShowModal() == wxID_OK )
|
||||
{
|
||||
*defaultFilterIndex = fileDialog.GetFilterIndex();
|
||||
return fileDialog.GetPath();
|
||||
}
|
||||
else
|
||||
return wxEmptyString;
|
||||
}
|
||||
|
||||
wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message,
|
||||
const wxString& defaultDir, const wxString& defaultFileName, const wxString& wildCard,
|
||||
long style, const wxPoint& pos)
|
||||
{
|
||||
m_message = message;
|
||||
m_dialogStyle = style;
|
||||
m_parent = parent;
|
||||
m_path = "";
|
||||
m_fileName = defaultFileName;
|
||||
m_dir = defaultDir;
|
||||
m_wildCard = wildCard;
|
||||
m_filterIndex = 1;
|
||||
}
|
||||
|
||||
int wxFileDialog::ShowModal()
|
||||
{
|
||||
// TODO
|
||||
return wxID_CANCEL;
|
||||
}
|
||||
|
||||
// Generic file load/save dialog
|
||||
static wxString wxDefaultFileSelector(bool load, const char *what, const char *extension, const char *default_name, wxWindow *parent)
|
||||
{
|
||||
char *ext = (char *)extension;
|
||||
|
||||
char prompt[50];
|
||||
wxString str;
|
||||
if (load)
|
||||
str = "Load %s file";
|
||||
else
|
||||
str = "Save %s file";
|
||||
sprintf(prompt, wxGetTranslation(str), what);
|
||||
|
||||
if (*ext == '.') ext++;
|
||||
char wild[60];
|
||||
sprintf(wild, "*.%s", ext);
|
||||
|
||||
return wxFileSelector (prompt, NULL, default_name, ext, wild, 0, parent);
|
||||
}
|
||||
|
||||
// Generic file load dialog
|
||||
wxString wxLoadFileSelector(const char *what, const char *extension, const char *default_name, wxWindow *parent)
|
||||
{
|
||||
return wxDefaultFileSelector(TRUE, what, extension, default_name, parent);
|
||||
}
|
||||
|
||||
|
||||
// Generic file save dialog
|
||||
wxString wxSaveFileSelector(const char *what, const char *extension, const char *default_name, wxWindow *parent)
|
||||
{
|
||||
return wxDefaultFileSelector(FALSE, what, extension, default_name, parent);
|
||||
}
|
||||
|
||||
|
244
src/os2/font.cpp
Normal file
244
src/os2/font.cpp
Normal file
@ -0,0 +1,244 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: font.cpp
|
||||
// Purpose: wxFont class
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "font.h"
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/string.h"
|
||||
#include "wx/font.h"
|
||||
#include "wx/gdicmn.h"
|
||||
|
||||
#if !USE_SHARED_LIBRARIES
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject)
|
||||
#endif
|
||||
|
||||
wxFontRefData::wxFontRefData()
|
||||
{
|
||||
m_style = 0;
|
||||
m_pointSize = 0;
|
||||
m_family = 0;
|
||||
m_style = 0;
|
||||
m_weight = 0;
|
||||
m_underlined = 0;
|
||||
m_faceName = "";
|
||||
/* TODO
|
||||
m_hFont = 0;
|
||||
*/
|
||||
}
|
||||
|
||||
wxFontRefData::wxFontRefData(const wxFontRefData& data)
|
||||
{
|
||||
m_style = data.m_style;
|
||||
m_pointSize = data.m_pointSize;
|
||||
m_family = data.m_family;
|
||||
m_style = data.m_style;
|
||||
m_weight = data.m_weight;
|
||||
m_underlined = data.m_underlined;
|
||||
m_faceName = data.m_faceName;
|
||||
/* TODO
|
||||
m_hFont = 0;
|
||||
*/
|
||||
}
|
||||
|
||||
wxFontRefData::~wxFontRefData()
|
||||
{
|
||||
// TODO: delete font data
|
||||
}
|
||||
|
||||
wxFont::wxFont()
|
||||
{
|
||||
if ( wxTheFontList )
|
||||
wxTheFontList->Append(this);
|
||||
}
|
||||
|
||||
wxFont::wxFont(int pointSize, int family, int style, int weight, bool underlined, const wxString& faceName)
|
||||
{
|
||||
Create(pointSize, family, style, weight, underlined, faceName);
|
||||
|
||||
if ( wxTheFontList )
|
||||
wxTheFontList->Append(this);
|
||||
}
|
||||
|
||||
bool wxFont::Create(int pointSize, int family, int style, int weight, bool underlined, const wxString& faceName)
|
||||
{
|
||||
UnRef();
|
||||
m_refData = new wxFontRefData;
|
||||
|
||||
M_FONTDATA->m_family = family;
|
||||
M_FONTDATA->m_style = style;
|
||||
M_FONTDATA->m_weight = weight;
|
||||
M_FONTDATA->m_pointSize = pointSize;
|
||||
M_FONTDATA->m_underlined = underlined;
|
||||
M_FONTDATA->m_faceName = faceName;
|
||||
|
||||
RealizeResource();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
wxFont::~wxFont()
|
||||
{
|
||||
if (wxTheFontList)
|
||||
wxTheFontList->DeleteObject(this);
|
||||
}
|
||||
|
||||
bool wxFont::RealizeResource()
|
||||
{
|
||||
// TODO: create the font (if there is a native font object)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void wxFont::Unshare()
|
||||
{
|
||||
// Don't change shared data
|
||||
if (!m_refData)
|
||||
{
|
||||
m_refData = new wxFontRefData();
|
||||
}
|
||||
else
|
||||
{
|
||||
wxFontRefData* ref = new wxFontRefData(*(wxFontRefData*)m_refData);
|
||||
UnRef();
|
||||
m_refData = ref;
|
||||
}
|
||||
}
|
||||
|
||||
void wxFont::SetPointSize(int pointSize)
|
||||
{
|
||||
Unshare();
|
||||
|
||||
M_FONTDATA->m_pointSize = pointSize;
|
||||
|
||||
RealizeResource();
|
||||
}
|
||||
|
||||
void wxFont::SetFamily(int family)
|
||||
{
|
||||
Unshare();
|
||||
|
||||
M_FONTDATA->m_family = family;
|
||||
|
||||
RealizeResource();
|
||||
}
|
||||
|
||||
void wxFont::SetStyle(int style)
|
||||
{
|
||||
Unshare();
|
||||
|
||||
M_FONTDATA->m_style = style;
|
||||
|
||||
RealizeResource();
|
||||
}
|
||||
|
||||
void wxFont::SetWeight(int weight)
|
||||
{
|
||||
Unshare();
|
||||
|
||||
M_FONTDATA->m_weight = weight;
|
||||
|
||||
RealizeResource();
|
||||
}
|
||||
|
||||
void wxFont::SetFaceName(const wxString& faceName)
|
||||
{
|
||||
Unshare();
|
||||
|
||||
M_FONTDATA->m_faceName = faceName;
|
||||
|
||||
RealizeResource();
|
||||
}
|
||||
|
||||
void wxFont::SetUnderlined(bool underlined)
|
||||
{
|
||||
Unshare();
|
||||
|
||||
M_FONTDATA->m_underlined = underlined;
|
||||
|
||||
RealizeResource();
|
||||
}
|
||||
|
||||
wxString wxFont::GetFamilyString() const
|
||||
{
|
||||
wxString fam("");
|
||||
switch (GetFamily())
|
||||
{
|
||||
case wxDECORATIVE:
|
||||
fam = "wxDECORATIVE";
|
||||
break;
|
||||
case wxROMAN:
|
||||
fam = "wxROMAN";
|
||||
break;
|
||||
case wxSCRIPT:
|
||||
fam = "wxSCRIPT";
|
||||
break;
|
||||
case wxSWISS:
|
||||
fam = "wxSWISS";
|
||||
break;
|
||||
case wxMODERN:
|
||||
fam = "wxMODERN";
|
||||
break;
|
||||
case wxTELETYPE:
|
||||
fam = "wxTELETYPE";
|
||||
break;
|
||||
default:
|
||||
fam = "wxDEFAULT";
|
||||
break;
|
||||
}
|
||||
return fam;
|
||||
}
|
||||
|
||||
/* New font system */
|
||||
wxString wxFont::GetFaceName() const
|
||||
{
|
||||
wxString str("");
|
||||
if (M_FONTDATA)
|
||||
str = M_FONTDATA->m_faceName ;
|
||||
return str;
|
||||
}
|
||||
|
||||
wxString wxFont::GetStyleString() const
|
||||
{
|
||||
wxString styl("");
|
||||
switch (GetStyle())
|
||||
{
|
||||
case wxITALIC:
|
||||
styl = "wxITALIC";
|
||||
break;
|
||||
case wxSLANT:
|
||||
styl = "wxSLANT";
|
||||
break;
|
||||
default:
|
||||
styl = "wxNORMAL";
|
||||
break;
|
||||
}
|
||||
return styl;
|
||||
}
|
||||
|
||||
wxString wxFont::GetWeightString() const
|
||||
{
|
||||
wxString w("");
|
||||
switch (GetWeight())
|
||||
{
|
||||
case wxBOLD:
|
||||
w = "wxBOLD";
|
||||
break;
|
||||
case wxLIGHT:
|
||||
w = "wxLIGHT";
|
||||
break;
|
||||
default:
|
||||
w = "wxNORMAL";
|
||||
break;
|
||||
}
|
||||
return w;
|
||||
}
|
||||
|
55
src/os2/fontdlg.cpp
Normal file
55
src/os2/fontdlg.cpp
Normal file
@ -0,0 +1,55 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: fontdlg.cpp
|
||||
// Purpose: wxFontDialog class. NOTE: you can use the generic class
|
||||
// if you wish, instead of implementing this.
|
||||
// Author: AUTHOR
|
||||
// Modified by:
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "fontdlg.h"
|
||||
#endif
|
||||
|
||||
#include "wx/stubs/fontdlg.h"
|
||||
#include "wx/cmndata.h"
|
||||
|
||||
#if !USE_SHARED_LIBRARY
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxFontDialog, wxDialog)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* wxFontDialog
|
||||
*/
|
||||
|
||||
wxFontDialog::wxFontDialog()
|
||||
{
|
||||
m_dialogParent = NULL;
|
||||
}
|
||||
|
||||
wxFontDialog::wxFontDialog(wxWindow *parent, wxFontData *data)
|
||||
{
|
||||
Create(parent, data);
|
||||
}
|
||||
|
||||
bool wxFontDialog::Create(wxWindow *parent, wxFontData *data)
|
||||
{
|
||||
m_dialogParent = parent;
|
||||
|
||||
if (data)
|
||||
m_fontData = *data;
|
||||
|
||||
// TODO: you may need to do dialog creation here, unless it's
|
||||
// done in ShowModal.
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int wxFontDialog::ShowModal()
|
||||
{
|
||||
// TODO: show (maybe create) the dialog
|
||||
return wxID_CANCEL;
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user