From: Václav Slavík Date: Sat, 26 May 2001 10:05:06 +0000 (+0000) Subject: removed stubs and qt 'ports' X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/e7f8e8b78846ceabf310e1fa206d60988f0df7ac?ds=inline removed stubs and qt 'ports' git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10334 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/qt/app.h b/include/wx/qt/app.h deleted file mode 100644 index 8535882520..0000000000 --- a/include/wx/qt/app.h +++ /dev/null @@ -1,156 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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" - -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; - -void WXDLLEXPORT wxCleanUp(); -void WXDLLEXPORT wxCommonCleanUp(); // Call this from the platform's wxCleanUp() -void WXDLLEXPORT wxCommonInit(); // Call this from the platform's initialization - -// 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() ; - - virtual 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 void CommonInit(); - static void CommonCleanUp(); - 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_ - diff --git a/include/wx/qt/bitmap.h b/include/wx/qt/bitmap.h deleted file mode 100644 index 195944f835..0000000000 --- a/include/wx/qt/bitmap.h +++ /dev/null @@ -1,198 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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); } - inline wxBitmap(const wxBitmap* bitmap) { if (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) : NULL); } - void SetPalette(const wxPalette& palette); - - inline wxMask *GetMask() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_bitmapMask : 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_ diff --git a/include/wx/qt/bmpbuttn.h b/include/wx/qt/bmpbuttn.h deleted file mode 100644 index defe39e438..0000000000 --- a/include/wx/qt/bmpbuttn.h +++ /dev/null @@ -1,83 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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; -}; - -#endif - // _WX_BMPBUTTN_H_ diff --git a/include/wx/qt/brush.h b/include/wx/qt/brush.h deleted file mode 100644 index 2475bd0b24..0000000000 --- a/include/wx/qt/brush.h +++ /dev/null @@ -1,86 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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 wxString& col, int style); - wxBrush(const wxBitmap& stipple); - inline wxBrush(const wxBrush& brush) { Ref(brush); } - inline wxBrush(const wxBrush* brush) { if (brush) Ref(*brush); } - ~wxBrush(); - - virtual void SetColour(const wxColour& col) ; - virtual void SetColour(const wxString& 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 - void RealizeResource(); - - // When setting properties, we must make sure we're not changing - // another object - void Unshare(); -}; - -#endif - // _WX_BRUSH_H_ diff --git a/include/wx/qt/button.h b/include/wx/qt/button.h deleted file mode 100644 index 68b67d8c96..0000000000 --- a/include/wx/qt/button.h +++ /dev/null @@ -1,53 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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(); - virtual void SetLabel(const wxString& label); - virtual wxString GetLabel() const ; - virtual void Command(wxCommandEvent& event); -}; - -#endif - // _WX_BUTTON_H_ diff --git a/include/wx/qt/checkbox.h b/include/wx/qt/checkbox.h deleted file mode 100644 index 8bf41d9958..0000000000 --- a/include/wx/qt/checkbox.h +++ /dev/null @@ -1,81 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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); -}; - -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); -}; -#endif - // _WX_CHECKBOX_H_ diff --git a/include/wx/qt/choice.h b/include/wx/qt/choice.h deleted file mode 100644 index 7f360ed5cc..0000000000 --- a/include/wx/qt/choice.h +++ /dev/null @@ -1,72 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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; -}; - -#endif - // _WX_CHOICE_H_ diff --git a/include/wx/qt/colour.h b/include/wx/qt/colour.h deleted file mode 100644 index e8fca8e3b4..0000000000 --- a/include/wx/qt/colour.h +++ /dev/null @@ -1,68 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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 - -// Colour -class WXDLLEXPORT wxColour: public wxObject -{ - DECLARE_DYNAMIC_CLASS(wxColour) -public: - wxColour(); - wxColour(unsigned char r, unsigned char g, unsigned char b); - wxColour(unsigned long colRGB) { Set(colRGB); } - wxColour(const wxColour& col); - wxColour(const wxString& col); - ~wxColour() ; - wxColour& operator =(const wxColour& src) ; - wxColour& operator =(const wxString& src) ; - inline int Ok() const { return (m_isInit) ; } - - void Set(unsigned char r, unsigned char g, unsigned char b); - 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)); - } - - inline unsigned char Red() const { return m_red; } - inline unsigned char Green() const { return m_green; } - inline unsigned char Blue() const { return m_blue; } - - inline bool operator == (const wxColour& colour) { return (m_red == colour.m_red && m_green == colour.m_green && m_blue == colour.m_blue); } - - inline bool operator != (const wxColour& colour) { return (!(m_red == colour.m_red && m_green == colour.m_green && m_blue == colour.m_blue)); } - - 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 ; -*/ -}; - -#define wxColor wxColour - -#endif - // _WX_COLOUR_H_ diff --git a/include/wx/qt/combobox.h b/include/wx/qt/combobox.h deleted file mode 100644 index 86895e561c..0000000000 --- a/include/wx/qt/combobox.h +++ /dev/null @@ -1,78 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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: see wxChoice - - // 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(int n) - { - wxChoice::SetSelection(n); - } - virtual void SetSelection(long from, long to); - virtual void SetEditable(bool editable); -}; - -#endif - // _WX_COMBOBOX_H_ diff --git a/include/wx/qt/control.h b/include/wx/qt/control.h deleted file mode 100644 index 5432b5c5e7..0000000000 --- a/include/wx/qt/control.h +++ /dev/null @@ -1,50 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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)) = 0; // 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_ diff --git a/include/wx/qt/cursor.h b/include/wx/qt/cursor.h deleted file mode 100644 index 9cf490cdc6..0000000000 --- a/include/wx/qt/cursor.h +++ /dev/null @@ -1,75 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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); } - inline wxCursor(const wxCursor* cursor) { if (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(); - - virtual bool Ok() const { return (m_refData != NULL && M_CURSORDATA->m_hCursor) ; } - - 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_ diff --git a/include/wx/qt/dc.h b/include/wx/qt/dc.h deleted file mode 100644 index 9943b0e2ab..0000000000 --- a/include/wx/qt/dc.h +++ /dev/null @@ -1,373 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: dc.h -// Purpose: wxDC class -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DC_H_ -#define _WX_DC_H_ - -#ifdef __GNUG__ -#pragma interface "dc.h" -#endif - -#include "wx/pen.h" -#include "wx/brush.h" -#include "wx/icon.h" -#include "wx/font.h" -#include "wx/gdicmn.h" - -//----------------------------------------------------------------------------- -// constants -//----------------------------------------------------------------------------- - -#define MM_TEXT 0 -#define MM_ISOTROPIC 1 -#define MM_ANISOTROPIC 2 -#define MM_LOMETRIC 3 -#define MM_HIMETRIC 4 -#define MM_TWIPS 5 -#define MM_POINTS 6 -#define MM_METRIC 7 - -//----------------------------------------------------------------------------- -// global variables -//----------------------------------------------------------------------------- - -extern int wxPageNumber; - -//----------------------------------------------------------------------------- -// wxDC -//----------------------------------------------------------------------------- - -class WXDLLEXPORT wxDC: public wxObject -{ - DECLARE_ABSTRACT_CLASS(wxDC) - - public: - - wxDC(void); - ~wxDC(void); - - void BeginDrawing(void) {}; - void EndDrawing(void) {}; - - virtual bool Ok(void) const { return m_ok; }; - - virtual void FloodFill( long x1, long y1, wxColour *col, int style=wxFLOOD_SURFACE ) = 0; - inline void FloodFill(const wxPoint& pt, const wxColour& col, int style=wxFLOOD_SURFACE) - { - FloodFill(pt.x, pt.y, col, style); - } - virtual bool GetPixel( long x1, long y1, wxColour *col ) const = 0; - inline bool GetPixel(const wxPoint& pt, wxColour *col) const - { - return GetPixel(pt.x, pt.y, col); - } - - virtual void DrawLine( long x1, long y1, long x2, long y2 ) = 0; - inline void DrawLine(const wxPoint& pt1, const wxPoint& pt2) - { - DrawLine(pt1.x, pt1.y, pt2.x, pt2.y); - } - - virtual void CrossHair( long x, long y ) = 0; - inline void CrossHair(const wxPoint& pt) - { - CrossHair(pt.x, pt.y); - } - - virtual void DrawArc( long x1, long y1, long x2, long y2, double xc, double yc ) = 0; - inline void DrawArc(const wxPoint& pt1, const wxPoint& pt2, double xc, double yc) - { - DrawArc(pt1.x, pt1.y, pt2.x, pt2.y, xc, yc); - } - - virtual void DrawEllipticArc( long x, long y, long width, long height, double sa, double ea ) = 0; - virtual void DrawEllipticArc (const wxPoint& pt, const wxSize& sz, double sa, double ea) - { - DrawEllipticArc(pt.x, pt.y, sz.x, sz.y, sa, ea); - } - - virtual void DrawPoint( long x, long y ) = 0; - virtual void DrawPoint( wxPoint& point ); - - virtual void DrawLines( int n, wxPoint points[], long xoffset = 0, long yoffset = 0 ) = 0; - virtual void DrawLines( wxList *points, long xoffset = 0, long yoffset = 0 ); - virtual void DrawPolygon( int n, wxPoint points[], long xoffset = 0, long yoffset = 0, - int fillStyle=wxODDEVEN_RULE ) = 0; - virtual void DrawPolygon( wxList *lines, long xoffset = 0, long yoffset = 0, - int fillStyle=wxODDEVEN_RULE ); - - virtual void DrawRectangle( long x, long y, long width, long height ) = 0; - inline void DrawRectangle(const wxPoint& pt, const wxSize& sz) - { - DrawRectangle(pt.x, pt.y, sz.x, sz.y); - } - inline void DrawRectangle(const wxRect& rect) - { - DrawRectangle(rect.x, rect.y, rect.width, rect.height); - } - virtual void DrawRoundedRectangle( long x, long y, long width, long height, double radius = 20.0 ) = 0; - inline void DrawRoundedRectangle(const wxPoint& pt, const wxSize& sz, double radius = 20.0) - { - DrawRoundedRectangle(pt.x, pt.y, sz.x, sz.y, radius); - } - inline void DrawRoundedRectangle(const wxRect& rect, double radius = 20.0) - { - DrawRoundedRectangle(rect.x, rect.y, rect.width, rect.height, radius); - } - - virtual void DrawEllipse( long x, long y, long width, long height ) = 0; - inline void DrawEllipse(const wxPoint& pt, const wxSize& sz) - { - DrawEllipse(pt.x, pt.y, sz.x, sz.y); - } - inline void DrawEllipse(const wxRect& rect) - { - DrawEllipse(rect.x, rect.y, rect.width, rect.height); - } - - virtual void DrawIcon(const wxIcon& icon, long x, long y) = 0; - - virtual void DrawSpline( long x1, long y1, long x2, long y2, long x3, long y3 ); - virtual void DrawSpline( wxList *points ); - virtual void DrawSpline( int n, wxPoint points[] ); - - virtual bool CanDrawBitmap(void) const = 0; - - virtual void DrawIcon( const wxIcon &icon, long x, long y, bool useMask=FALSE ); - inline void DrawIcon(const wxIcon& icon, const wxPoint& pt) - { - DrawIcon(icon, pt.x, pt.y); - } - - // TODO DrawBitmap is not always the same as DrawIcon, especially if bitmaps and - // icons are implemented differently. - void DrawBitmap( const wxBitmap &bmp, long x, long y, bool useMask=FALSE ) - { DrawIcon( *((wxIcon*)(&bmp)), x, y, useMask ); } - - virtual bool Blit( long xdest, long ydest, long width, long height, - wxDC *source, long xsrc, long ysrc, int logical_func = wxCOPY, bool useMask=FALSE ) = 0; - inline bool Blit(const wxPoint& destPt, const wxSize& sz, - wxDC *source, const wxPoint& srcPt, int rop = wxCOPY, bool useMask = FALSE) - { - return Blit(destPt.x, destPt.y, sz.x, sz.y, source, srcPt.x, srcPt.y, rop, useMask); - } - - virtual void DrawText( const wxString &text, long x, long y, bool use16 = FALSE ) = 0; - inline void DrawText(const wxString& text, const wxPoint& pt, bool use16bit = FALSE) - { - DrawText(text, pt.x, pt.y, use16bit); - } - - virtual bool CanGetTextExtent(void) const = 0; - virtual void GetTextExtent( const wxString &string, long *width, long *height, - long *descent = NULL, long *externalLeading = NULL, - wxFont *theFont = NULL, bool use16 = FALSE ) = 0; - virtual long GetCharWidth(void) = 0; - virtual long GetCharHeight(void) = 0; - - virtual void Clear(void) = 0; - - virtual void SetFont( const wxFont &font ) = 0; - virtual wxFont *GetFont(void) const { return &m_font; }; - - virtual void SetPen( const wxPen &pen ) = 0; - virtual wxPen *GetPen(void) const { return &m_pen; }; - - virtual void SetBrush( const wxBrush &brush ) = 0; - virtual wxBrush *GetBrush(void) const { return &m_brush; }; - - virtual void SetBackground( const wxBrush &brush ) = 0; - virtual wxBrush *GetBackground(void) const { return &m_backgroundBrush; }; - - virtual void SetLogicalFunction( int function ) = 0; - virtual int GetLogicalFunction(void) const { return m_logicalFunction; }; - - virtual void SetTextForeground( const wxColour &col ); - virtual void SetTextBackground( const wxColour &col ); - virtual wxColour& GetTextBackground(void) const { return (wxColour&)m_textBackgroundColour; }; - virtual wxColour& GetTextForeground(void) const { return (wxColour&)m_textForegroundColour; }; - - virtual void SetBackgroundMode( int mode ) = 0; - virtual int GetBackgroundMode(void) const { return m_backgroundMode; }; - - virtual void SetPalette( const wxPalette& palette ) = 0; - void SetColourMap( const wxPalette& palette ) { SetPalette(palette); }; - - // the first two must be overridden and called - virtual void SetClippingRegion( long x, long y, long width, long height ); - virtual void DestroyClippingRegion(void); - virtual void GetClippingBox( long *x, long *y, long *width, long *height ) const; - - virtual inline long MinX(void) const { return m_minX; } - virtual inline long MaxX(void) const { return m_maxX; } - virtual inline long MinY(void) const { return m_minY; } - virtual inline long MaxY(void) const { return m_maxY; } - - virtual void GetSize( int* width, int* height ) const; - inline wxSize GetSize(void) const { int w, h; GetSize(&w, &h); return wxSize(w, h); } - virtual void GetSizeMM( long* width, long* height ) const; - - virtual bool StartDoc( const wxString& WXUNUSED(message) ) { return TRUE; }; - virtual void EndDoc(void) {}; - virtual void StartPage(void) {}; - virtual void EndPage(void) {}; - - virtual void SetMapMode( int mode ); - virtual int GetMapMode(void) const { return m_mappingMode; }; - - virtual void SetUserScale( double x, double y ); - virtual void GetUserScale( double *x, double *y ); - virtual void SetLogicalScale( double x, double y ); - virtual void GetLogicalScale( double *x, double *y ); - - virtual void SetLogicalOrigin( long x, long y ); - virtual void GetLogicalOrigin( long *x, long *y ); - virtual void SetDeviceOrigin( long x, long y ); - virtual void GetDeviceOrigin( long *x, long *y ); - virtual void SetInternalDeviceOrigin( long x, long y ); - virtual void GetInternalDeviceOrigin( long *x, long *y ); - - virtual void SetAxisOrientation( bool xLeftRight, bool yBottomUp ); - - virtual void SetOptimization( bool WXUNUSED(optimize) ) {}; - virtual bool GetOptimization(void) { return m_optimize; }; - - virtual long DeviceToLogicalX(long x) const; - virtual long DeviceToLogicalY(long y) const; - virtual long DeviceToLogicalXRel(long x) const; - virtual long DeviceToLogicalYRel(long y) const; - virtual long LogicalToDeviceX(long x) const; - virtual long LogicalToDeviceY(long y) const; - virtual long LogicalToDeviceXRel(long x) const; - virtual long LogicalToDeviceYRel(long y) const; - - public: - - void CalcBoundingBox( long x, long y ); - void ComputeScaleAndOrigin(void); - - long XDEV2LOG(long x) const - { - long new_x = x - m_deviceOriginX; - if (new_x > 0) - return (long)((double)(new_x) / m_scaleX + 0.5) * m_signX + m_logicalOriginX; - else - return (long)((double)(new_x) / m_scaleX - 0.5) * m_signX + m_logicalOriginX; - } - long XDEV2LOGREL(long x) const - { - if (x > 0) - return (long)((double)(x) / m_scaleX + 0.5); - else - return (long)((double)(x) / m_scaleX - 0.5); - } - long YDEV2LOG(long y) const - { - long new_y = y - m_deviceOriginY; - if (new_y > 0) - return (long)((double)(new_y) / m_scaleY + 0.5) * m_signY + m_logicalOriginY; - else - return (long)((double)(new_y) / m_scaleY - 0.5) * m_signY + m_logicalOriginY; - } - long YDEV2LOGREL(long y) const - { - if (y > 0) - return (long)((double)(y) / m_scaleY + 0.5); - else - return (long)((double)(y) / m_scaleY - 0.5); - } - long XLOG2DEV(long x) const - { - long new_x = x - m_logicalOriginX; - if (new_x > 0) - return (long)((double)(new_x) * m_scaleX + 0.5) * m_signX + m_deviceOriginX; - else - return (long)((double)(new_x) * m_scaleX - 0.5) * m_signX + m_deviceOriginX; - } - long XLOG2DEVREL(long x) const - { - if (x > 0) - return (long)((double)(x) * m_scaleX + 0.5); - else - return (long)((double)(x) * m_scaleX - 0.5); - } - long YLOG2DEV(long y) const - { - long new_y = y - m_logicalOriginY; - if (new_y > 0) - return (long)((double)(new_y) * m_scaleY + 0.5) * m_signY + m_deviceOriginY; - else - return (long)((double)(new_y) * m_scaleY - 0.5) * m_signY + m_deviceOriginY; - } - long YLOG2DEVREL(long y) const - { - if (y > 0) - return (long)((double)(y) * m_scaleY + 0.5); - else - return (long)((double)(y) * m_scaleY - 0.5); - } - - virtual void DrawOpenSpline( wxList *points ) = 0; - - public: - - bool m_ok; - bool m_colour; - - // not sure, what these mean - bool m_clipping; // Is clipping on right now ? - bool m_isInteractive; // Is GetPixel possible ? - bool m_autoSetting; // wxMSW only ? - bool m_dontDelete; // wxMSW only ? - bool m_optimize; // wxMSW only ? - wxString m_filename; // Not sure where this belongs. - - wxPen m_pen; - wxBrush m_brush; - wxBrush m_backgroundBrush; - wxColour m_textForegroundColour; - wxColour m_textBackgroundColour; - wxFont m_font; - - int m_logicalFunction; - int m_backgroundMode; - int m_textAlignment; // gone in wxWin 2.0 ? - - int m_mappingMode; - - // not sure what for, but what is a mm on a screen you don't know the size of? - double m_mm_to_pix_x,m_mm_to_pix_y; - - long m_internalDeviceOriginX,m_internalDeviceOriginY; // If un-scrolled is non-zero or - // d.o. changes with scrolling. - // Set using SetInternalDeviceOrigin(). - - long m_externalDeviceOriginX,m_externalDeviceOriginY; // To be set by external classes - // such as wxScrolledWindow - // using SetDeviceOrigin() - - long m_deviceOriginX,m_deviceOriginY; // Sum of the two above. - - long m_logicalOriginX,m_logicalOriginY; // User defined. - - double m_scaleX,m_scaleY; - double m_logicalScaleX,m_logicalScaleY; - double m_userScaleX,m_userScaleY; - long m_signX,m_signY; - - bool m_needComputeScaleX,m_needComputeScaleY; // not yet used - - long m_clipX1,m_clipY1,m_clipX2,m_clipY2; - long m_minX,m_maxX,m_minY,m_maxY; -}; - -#endif - // _WX_DC_H_ diff --git a/include/wx/qt/dcclient.h b/include/wx/qt/dcclient.h deleted file mode 100644 index 828a507d75..0000000000 --- a/include/wx/qt/dcclient.h +++ /dev/null @@ -1,100 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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; - -// Under Windows, wxClientDC, wxPaintDC and wxWindowDC are implemented differently. -// On many platforms, however, they will be the same. - -typedef wxPaintDC wxClientDC; -typedef wxPaintDC wxWindowDC; - -//----------------------------------------------------------------------------- -// wxPaintDC -//----------------------------------------------------------------------------- - -class WXDLLEXPORT wxPaintDC: public wxDC -{ - DECLARE_DYNAMIC_CLASS(wxPaintDC) - - public: - - wxPaintDC(void); - wxPaintDC( wxWindow *win ); - - ~wxPaintDC(void); - - virtual void FloodFill( long x1, long y1, 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, double xc, double 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 DestroyClippingRegion(void); - - virtual void DrawOpenSpline( wxList *points ); -}; - -#endif - // _WX_DCCLIENT_H_ diff --git a/include/wx/qt/dcmemory.h b/include/wx/qt/dcmemory.h deleted file mode 100644 index c6c5737642..0000000000 --- a/include/wx/qt/dcmemory.h +++ /dev/null @@ -1,38 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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_ diff --git a/include/wx/qt/dcscreen.h b/include/wx/qt/dcscreen.h deleted file mode 100644 index 27961a1caa..0000000000 --- a/include/wx/qt/dcscreen.h +++ /dev/null @@ -1,39 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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 wxPaintDC -{ - 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_ - diff --git a/include/wx/qt/dialog.h b/include/wx/qt/dialog.h deleted file mode 100644 index d68cc7c9a0..0000000000 --- a/include/wx/qt/dialog.h +++ /dev/null @@ -1,97 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: dialog.h -// Purpose: wxDialog class -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DIALOG_H_ -#define _WX_DIALOG_H_ - -#ifdef __GNUG__ -#pragma interface "dialog.h" -#endif - -#include "wx/panel.h" - -WXDLLEXPORT_DATA(extern const char*) wxDialogNameStr; - -// Dialog boxes -class WXDLLEXPORT wxDialog: public wxPanel -{ - DECLARE_DYNAMIC_CLASS(wxDialog) -public: - - wxDialog(); - - // Constructor with a modal flag, but no window id - the old convention - inline wxDialog(wxWindow *parent, - const wxString& title, bool modal, - int x = -1, int y= -1, int width = 500, int height = 500, - long style = wxDEFAULT_DIALOG_STYLE, - const wxString& name = wxDialogNameStr) - { - long modalStyle = modal ? wxDIALOG_MODAL : wxDIALOG_MODELESS ; - Create(parent, -1, title, wxPoint(x, y), wxSize(width, height), style|modalStyle, name); - } - - // Constructor with no modal flag - the new convention. - inline wxDialog(wxWindow *parent, wxWindowID id, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_DIALOG_STYLE, - const wxString& name = wxDialogNameStr) - { - Create(parent, id, title, pos, size, style, name); - } - - bool Create(wxWindow *parent, wxWindowID id, - const wxString& title, // bool modal = FALSE, // TODO make this a window style? - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_DIALOG_STYLE, - const wxString& name = wxDialogNameStr); - - ~wxDialog(); - - virtual bool Destroy(); - void SetClientSize(int width, int height); - void GetPosition(int *x, int *y) const; - bool Show(bool show); - void Iconize(bool iconize); - - virtual bool IsIconized() const; - void Fit(); - - void SetTitle(const wxString& title); - wxString GetTitle() const ; - - void OnCharHook(wxKeyEvent& 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); } - - 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); - -DECLARE_EVENT_TABLE() -}; - -#endif - // _WX_DIALOG_H_ diff --git a/include/wx/qt/dirdlg.h b/include/wx/qt/dirdlg.h deleted file mode 100644 index fe36bb7fec..0000000000 --- a/include/wx/qt/dirdlg.h +++ /dev/null @@ -1,47 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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" - -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_ diff --git a/include/wx/qt/dnd.h b/include/wx/qt/dnd.h deleted file mode 100644 index 217561903a..0000000000 --- a/include/wx/qt/dnd.h +++ /dev/null @@ -1,239 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: dnd.h -// Purpose: declaration of the wxDropTarget class -// Author: Robert Roebling -// RCS-ID: -// Copyright: (c) 1998 Vadim Zeitlin, Robert Roebling -// Licence: wxWindows license -/////////////////////////////////////////////////////////////////////////////// - - -#ifndef __GTKDNDH__ -#define __GTKDNDH__ - -#ifdef __GNUG__ -#pragma interface -#endif - -#include "wx/defs.h" -#include "wx/object.h" -#include "wx/string.h" -#include "wx/cursor.h" - -//------------------------------------------------------------------------- -// classes -//------------------------------------------------------------------------- - -class wxWindow; - -class wxDataObject; -class wxTextDataObject; -class wxFileDataObject; - -class wxDropTarget; -class wxTextDropTarget; -class wxFileDropTarget; - -class wxDropSource; - -//------------------------------------------------------------------------- -// wxDataObject -//------------------------------------------------------------------------- - -class 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 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 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 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 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 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 -//------------------------------------------------------------------------- - -class wxDropSource: public wxObject -{ - public: - - enum DragResult - { - Error, // error prevented the d&d operation from completing - None, // drag target didn't accept the data - Copy, // the data was successfully copied - Move, // the data was successfully moved - Cancel // the operation was cancelled by user (not an error) - }; - - wxDropSource( wxWindow *win ); - wxDropSource( wxDataObject &data, wxWindow *win ); - - ~wxDropSource(void); - - void SetData( wxDataObject &data ); - DragResult DoDragDrop( bool bAllowMove = FALSE ); - - virtual bool GiveFeedback( DragResult WXUNUSED(effect), bool WXUNUSED(bScrolling) ) { return TRUE; }; - - protected: - - wxDataObject *m_data; -}; - -#endif - //__GTKDNDH__ - diff --git a/include/wx/qt/filedlg.h b/include/wx/qt/filedlg.h deleted file mode 100644 index 1abeed4d68..0000000000 --- a/include/wx/qt/filedlg.h +++ /dev/null @@ -1,71 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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 - -#endif - // _WX_FILEDLG_H_ diff --git a/include/wx/qt/font.h b/include/wx/qt/font.h deleted file mode 100644 index 2079f2d0f0..0000000000 --- a/include/wx/qt/font.h +++ /dev/null @@ -1,88 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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(); -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); } - inline wxFont(const wxFont* font) { if (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: - void Unshare(); -}; - -#endif - // _WX_FONT_H_ diff --git a/include/wx/qt/frame.h b/include/wx/qt/frame.h deleted file mode 100644 index 2e76caab02..0000000000 --- a/include/wx/qt/frame.h +++ /dev/null @@ -1,154 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: frame.h -// Purpose: wxFrame class -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#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/accel.h" - -WXDLLEXPORT_DATA(extern const char*) wxFrameNameStr; -WXDLLEXPORT_DATA(extern const char*) wxToolBarNameStr; - -class WXDLLEXPORT wxMenuBar; -class WXDLLEXPORT wxStatusBar; - -class WXDLLEXPORT wxFrame: public wxWindow { - - DECLARE_DYNAMIC_CLASS(wxFrame) - -public: - wxFrame(); - inline 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(); - void SetClientSize(int width, int height); - void GetClientSize(int *width, int *height) const; - - void GetSize(int *width, int *height) const ; - void GetPosition(int *x, int *y) const ; - void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); - - void 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 ; - - // Set title - void SetTitle(const wxString& title); - wxString GetTitle() const ; - - void Centre(int direction = wxBOTH); - - // Call this to simulate a menu command - virtual void Command(int id); - virtual void ProcessCommand(int id); - - // Set icon - virtual void SetIcon(const wxIcon& icon); - - // Create status line - virtual wxStatusBar* CreateStatusBar(int number=1, long style = wxST_SIZEGRIP, wxWindowID id = 0, - const wxString& name = "statusBar"); - inline wxStatusBar *GetStatusBar() const { return m_frameStatusBar; } - virtual void PositionStatusBar(); - virtual wxStatusBar *OnCreateStatusBar(int number, long style, wxWindowID id, - const wxString& name); - - // Create toolbar - virtual wxToolBar* CreateToolBar(long style = wxNO_BORDER|wxTB_HORIZONTAL, wxWindowID id = -1, const wxString& name = wxToolBarNameStr); - virtual wxToolBar *OnCreateToolBar(long style, wxWindowID id, const wxString& name); - // If made known to the frame, the frame will manage it automatically. - virtual inline void SetToolBar(wxToolBar *toolbar) { m_frameToolBar = toolbar; } - virtual inline wxToolBar *GetToolBar() const { return m_frameToolBar; } - virtual void PositionToolBar(); - - // Set status line text - virtual void SetStatusText(const wxString& text, int number = 0); - - // 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; }; - - // Fit frame around subwindows - virtual void Fit(); - - // Iconize - virtual void Iconize(bool iconize); - - virtual bool IsIconized() const ; - - // Compatibility - inline bool Iconized() const { return IsIconized(); } - - virtual void Maximize(bool maximize); - - virtual void SetAcceleratorTable(const wxAcceleratorTable& accel); - - // Responds to colour changes - void OnSysColourChanged(wxSysColourChangedEvent& event); - - // Query app for menu item updates (called from OnIdle) - void DoMenuUpdates(); - void DoMenuUpdates(wxMenu* menu); - - // Checks if there is a toolbar, and returns the first free client position - virtual wxPoint GetClientAreaOrigin() const; - -protected: - wxMenuBar * m_frameMenuBar; - wxStatusBar * m_frameStatusBar; - wxIcon m_icon; - bool m_iconized; - static bool m_useNativeStatusBar; - wxToolBar * m_frameToolBar ; - wxAcceleratorTable m_acceleratorTable; - - DECLARE_EVENT_TABLE() -}; - -#endif - // _WX_FRAME_H_ diff --git a/include/wx/qt/gauge.h b/include/wx/qt/gauge.h deleted file mode 100644 index ce19d9ef1f..0000000000 --- a/include/wx/qt/gauge.h +++ /dev/null @@ -1,69 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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; -}; - -#endif - // _WX_GAUGE_H_ diff --git a/include/wx/qt/gdiobj.h b/include/wx/qt/gdiobj.h deleted file mode 100644 index 9263d4d6ad..0000000000 --- a/include/wx/qt/gdiobj.h +++ /dev/null @@ -1,48 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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_ diff --git a/include/wx/qt/icon.h b/include/wx/qt/icon.h deleted file mode 100644 index f68c23154b..0000000000 --- a/include/wx/qt/icon.h +++ /dev/null @@ -1,107 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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); } - inline wxIcon(const wxIcon* icon) { if (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(); - - 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) ; } -}; - -/* 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_ diff --git a/include/wx/qt/joystick.h b/include/wx/qt/joystick.h deleted file mode 100644 index 30324fc035..0000000000 --- a/include/wx/qt/joystick.h +++ /dev/null @@ -1,93 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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_ diff --git a/include/wx/qt/listbox.h b/include/wx/qt/listbox.h deleted file mode 100644 index d95db4379b..0000000000 --- a/include/wx/qt/listbox.h +++ /dev/null @@ -1,97 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: listbox.h -// Purpose: wxListBox class -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// 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 char*) wxListBoxNameStr; - -// forward decl for GetSelections() -class WXDLLEXPORT wxArrayInt; - -WXDLLEXPORT_DATA(extern const char*) wxEmptyString; - -// List box item -class WXDLLEXPORT wxListBox: public wxControl -{ - DECLARE_DYNAMIC_CLASS(wxListBox) - public: - - wxListBox(); - inline 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(); - - virtual void Append(const wxString& item); - virtual void Append(const wxString& item, char *clientData); - virtual void Set(int n, const wxString* choices, char **clientData = NULL); - virtual int FindString(const wxString& s) const ; - virtual void Clear(); - virtual void SetSelection(int n, bool select = TRUE); - - virtual void Deselect(int n); - - // For single choice list item only - virtual int GetSelection() const ; - virtual void Delete(int n); - virtual char *GetClientData(int n) const ; - virtual void SetClientData(int n, char *clientData); - virtual void SetString(int n, const wxString& s); - - // For single or multiple choice list item - virtual int GetSelections(wxArrayInt& aSelections) const; - virtual bool Selected(int n) const ; - virtual wxString GetString(int n) const ; - virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); - - // Set the specified item at the first visible item - // or scroll to max range. - 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); - - protected: - int m_noItems; - int m_selected; -}; - -#endif - // _WX_LISTBOX_H_ diff --git a/include/wx/qt/mdi.h b/include/wx/qt/mdi.h deleted file mode 100644 index 1daec94008..0000000000 --- a/include/wx/qt/mdi.h +++ /dev/null @@ -1,160 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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 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: - -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(); -}; - -/* 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_ diff --git a/include/wx/qt/menu.h b/include/wx/qt/menu.h deleted file mode 100644 index 1654602141..0000000000 --- a/include/wx/qt/menu.h +++ /dev/null @@ -1,157 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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); }; - - // 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; } - - 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; -}; - -// ---------------------------------------------------------------------------- -// 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_ diff --git a/include/wx/qt/notebook.h b/include/wx/qt/notebook.h deleted file mode 100644 index b5834ec181..0000000000 --- a/include/wx/qt/notebook.h +++ /dev/null @@ -1,202 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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 - -// ---------------------------------------------------------------------------- -// 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); - - // operations - // ---------- - // remove one page from the notebook - bool DeletePage(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_ diff --git a/include/wx/qt/palette.h b/include/wx/qt/palette.h deleted file mode 100644 index a5c85bb1d0..0000000000 --- a/include/wx/qt/palette.h +++ /dev/null @@ -1,66 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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); } - inline wxPalette(const wxPalette* palette) { UnRef(); if (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; } - - virtual bool FreeResource(bool force = FALSE); -/* TODO: implementation - inline WXHPALETTE GetHPALETTE() const { return (M_PALETTEDATA ? M_PALETTEDATA->m_hPalette : 0); } - void SetHPALETTE(WXHPALETTE pal); -*/ -}; - -#endif - // _WX_PALETTE_H_ diff --git a/include/wx/qt/pen.h b/include/wx/qt/pen.h deleted file mode 100644 index 8989d44435..0000000000 --- a/include/wx/qt/pen.h +++ /dev/null @@ -1,105 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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/gdicmn.h" - -typedef WXDWORD wxQTDash; - -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 ; - wxQTDash * 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 wxString& col, int width, int style); - wxPen(const wxBitmap& stipple, int width); - inline wxPen(const wxPen& pen) { Ref(pen); } - inline wxPen(const wxPen* pen) { if (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(const wxString& col) ; - void SetColour(const unsigned char r, const unsigned char g, const 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 ? (wxDash*)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) : NULL); }; - -// Implementation - - // Useful helper: create the brush resource - void RealizeResource(); - - // When setting properties, we must make sure we're not changing - // another object - void Unshare(); -}; - -#endif - // _WX_PEN_H_ diff --git a/include/wx/qt/radiobox.h b/include/wx/qt/radiobox.h deleted file mode 100644 index cb7c5ba405..0000000000 --- a/include/wx/qt/radiobox.h +++ /dev/null @@ -1,88 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: radiobox.h -// Purpose: wxRadioBox class -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// 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 char*) wxRadioBoxNameStr; - -// List box item -class WXDLLEXPORT wxBitmap ; - -class WXDLLEXPORT wxRadioBox: public wxControl -{ - DECLARE_DYNAMIC_CLASS(wxRadioBox) -public: - wxRadioBox(); - - inline wxRadioBox(wxWindow *parent, wxWindowID id, const wxString& title, - const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - int n = 0, const wxString choices[] = NULL, - int majorDim = 0, long style = wxRA_HORIZONTAL, - 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); - - int FindString(const wxString& s) const; - void SetSelection(int N); - int GetSelection() const; - wxString GetString(int N) const; - void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); - void GetSize(int *x, int *y) const; - void GetPosition(int *x, int *y) const; - wxString GetLabel() const; - void SetLabel(const wxString& label); - void SetLabel(int item, const wxString& label) ; - wxString GetLabel(int item) const; - bool Show(bool show); - void SetFocus(); - void Enable(bool enable); - void Enable(int item, bool enable); - void Show(int item, bool show) ; - inline void SetLabelFont(const wxFont& WXUNUSED(font)) {}; - inline void SetButtonFont(const wxFont& font) { SetFont(font); } - - virtual wxString GetStringSelection() const; - virtual bool SetStringSelection(const wxString& s); - inline virtual int Number() const { return m_noItems; } ; - void Command(wxCommandEvent& event); - - inline int GetNumberOfRowsOrCols() const { return m_noRowsOrCols; } - inline void SetNumberOfRowsOrCols(int n) { m_noRowsOrCols = n; } - -protected: -/* TODO: implementation - WXHWND * m_radioButtons; -*/ - int m_majorDim ; - int m_noItems; - int m_noRowsOrCols; - int m_selectedButton; - -}; - -#endif - // _WX_RADIOBOX_H_ diff --git a/include/wx/qt/radiobut.h b/include/wx/qt/radiobut.h deleted file mode 100644 index 7a4ce62d50..0000000000 --- a/include/wx/qt/radiobut.h +++ /dev/null @@ -1,92 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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); - virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor, - WXUINT message, WXWPARAM wParam, WXLPARAM lParam); -}; - -// 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_ diff --git a/include/wx/qt/region.h b/include/wx/qt/region.h deleted file mode 100644 index 02bf97845f..0000000000 --- a/include/wx/qt/region.h +++ /dev/null @@ -1,140 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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" - -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); - -/* TODO: implementation - wxRegion(WXHRGN hRegion); // Hangs on to this region -*/ - - 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(); } - -private: - long m_current; - long m_numRects; - wxRegion m_region; - wxRect* m_rects; -}; - -#endif - // _WX_REGION_H_ diff --git a/include/wx/qt/scrolbar.h b/include/wx/qt/scrolbar.h deleted file mode 100644 index eeef6727c5..0000000000 --- a/include/wx/qt/scrolbar.h +++ /dev/null @@ -1,68 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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 GetPosition() const ; - inline int GetThumbSize() const { return m_pageSize; } - inline int GetPageSize() const { return m_viewSize; } - inline int GetRange() const { return m_objectSize; } - - virtual void SetPosition(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_ diff --git a/include/wx/qt/settings.h b/include/wx/qt/settings.h deleted file mode 100644 index 7cd3cbe19e..0000000000 --- a/include/wx/qt/settings.h +++ /dev/null @@ -1,129 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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" - -#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_ diff --git a/include/wx/qt/slider.h b/include/wx/qt/slider.h deleted file mode 100644 index 239e914e5c..0000000000 --- a/include/wx/qt/slider.h +++ /dev/null @@ -1,91 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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() -}; - -#endif - // _WX_SLIDER_H_ diff --git a/include/wx/qt/statbmp.h b/include/wx/qt/statbmp.h deleted file mode 100644 index f371fddd2d..0000000000 --- a/include/wx/qt/statbmp.h +++ /dev/null @@ -1,64 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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; - -}; - -#endif - // _WX_STATBMP_H_ diff --git a/include/wx/qt/statbox.h b/include/wx/qt/statbox.h deleted file mode 100644 index 1aa4a6f88a..0000000000 --- a/include/wx/qt/statbox.h +++ /dev/null @@ -1,57 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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() -}; - -#endif - // _WX_STATBOX_H_ diff --git a/include/wx/qt/stattext.h b/include/wx/qt/stattext.h deleted file mode 100644 index aa8eaf229e..0000000000 --- a/include/wx/qt/stattext.h +++ /dev/null @@ -1,56 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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)) {}; -}; - -#endif - // _WX_STATTEXT_H_ diff --git a/include/wx/qt/tbargtk.h b/include/wx/qt/tbargtk.h deleted file mode 100644 index f6a3636927..0000000000 --- a/include/wx/qt/tbargtk.h +++ /dev/null @@ -1,139 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: tbargtk.h -// Purpose: GTK toolbar -// Author: Robert Roebling -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id$ -// Copyright: (c) Robert Roebling -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef __TBARGTKH__ -#define __TBARGTKH__ - -#ifdef __GNUG__ -#pragma interface -#endif - -#include "wx/defs.h" -#include "wx/control.h" - -//----------------------------------------------------------------------------- -// classes -//----------------------------------------------------------------------------- - -class wxToolBarTool; -class wxToolBar; - -//----------------------------------------------------------------------------- -// constants -//----------------------------------------------------------------------------- - -#define wxTOOL_STYLE_BUTTON 1 -#define wxTOOL_STYLE_SEPARATOR 2 - -//----------------------------------------------------------------------------- -// global data -//----------------------------------------------------------------------------- - -extern const char *wxToolBarNameStr; - -//----------------------------------------------------------------------------- -// wxToolBarTool -//----------------------------------------------------------------------------- - -class wxToolBarTool: public wxObject -{ - DECLARE_DYNAMIC_CLASS(wxToolBarTool) - - public: - - wxToolBarTool(void) {}; - wxToolBarTool( wxToolBar *owner, int theIndex = 0, - const wxBitmap& bitmap1 = wxNullBitmap, const wxBitmap& bitmap2 = wxNullBitmap, - bool toggle = FALSE, wxObject *clientData = NULL, - const wxString& shortHelpString = "", const wxString& longHelpString = ""); - ~wxToolBarTool(void); - - public: - - int m_toolStyle; - wxObject *m_clientData; - int m_index; - bool m_toggleState; - bool m_isToggle; - bool m_deleteSecondBitmap; - bool m_enabled; - wxBitmap m_bitmap1; - wxBitmap m_bitmap2; - bool m_isMenuCommand; - wxString m_shortHelpString; - wxString m_longHelpString; - wxToolBar *m_owner; -}; - -//----------------------------------------------------------------------------- -// wxToolBar -//----------------------------------------------------------------------------- - -class wxToolBar: public wxControl -{ - DECLARE_DYNAMIC_CLASS(wxToolBar) - - public: - - wxToolBar(void); - wxToolBar( wxWindow *parent, wxWindowID id, - const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = 0, const wxString& name = wxToolBarNameStr ); - ~wxToolBar(void); - - bool Create( wxWindow *parent, wxWindowID id, - const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = 0, const wxString& name = wxToolBarNameStr); - - // Only allow toggle if returns TRUE. Call when left button up. - virtual bool OnLeftClick(int toolIndex, bool toggleDown); - - // Call when right button down. - virtual void OnRightClick(int toolIndex, float x, float y); - - // Called when the mouse cursor enters a tool bitmap. - // Argument is -1 if mouse is exiting the toolbar. - virtual void OnMouseEnter(int toolIndex); - - // 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. - virtual wxToolBarTool *AddTool( int toolIndex, const wxBitmap& bitmap, - const wxBitmap& pushedBitmap = wxNullBitmap, bool toggle = FALSE, - float xPos = -1, float yPos = -1, wxObject *clientData = NULL, - const wxString& helpString1 = "", const wxString& helpString2 = ""); - virtual void AddSeparator(void); - virtual void ClearTools(void); - - virtual void Realize(void); - - virtual void EnableTool(int toolIndex, bool enable); - virtual void ToggleTool(int toolIndex, bool toggle); // toggle is TRUE if toggled on - virtual wxObject *GetToolClientData(int index) const; - - virtual bool GetToolState(int toolIndex) const; - virtual bool GetToolEnabled(int toolIndex) const; - - virtual void SetMargins(int x, int y); - void SetMargins(const wxSize& size) { SetMargins(size.x, size.y); }; - virtual void SetToolPacking(int packing); - virtual void SetToolSeparation(int separation); - - public: - - wxList m_tools; - - DECLARE_EVENT_TABLE() -}; - -#endif - // __TBARGTKH__ - diff --git a/include/wx/qt/textctrl.h b/include/wx/qt/textctrl.h deleted file mode 100644 index 6b323a9fbe..0000000000 --- a/include/wx/qt/textctrl.h +++ /dev/null @@ -1,140 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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 -#else -#include -#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 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); - - // 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); - - // Implementation - // -------------- - virtual void Command(wxCommandEvent& event); - -protected: - wxString m_fileName; - - DECLARE_EVENT_TABLE() -}; - -#endif - // _WX_TEXTCTRL_H_ diff --git a/include/wx/qt/timer.h b/include/wx/qt/timer.h deleted file mode 100644 index 426f431b00..0000000000 --- a/include/wx/qt/timer.h +++ /dev/null @@ -1,53 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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 milli; }; - bool OneShot() const { return oneShot; } - -protected: - bool oneShot ; - int milli ; - int lastMilli ; - - long 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. - */ - -#endif - // _WX_TIMER_H_ diff --git a/include/wx/qt/window.h b/include/wx/qt/window.h deleted file mode 100644 index cac783dfc4..0000000000 --- a/include/wx/qt/window.h +++ /dev/null @@ -1,547 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: window.h -// Purpose: wxWindow class -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_WINDOW_H_ -#define _WX_WINDOW_H_ - -#ifdef __GNUG__ -#pragma interface "window.h" -#endif - -#include "wx/gdicmn.h" -#include "wx/icon.h" -#include "wx/cursor.h" -#include "wx/pen.h" -#include "wx/font.h" -#include "wx/validate.h" -#include "wx/event.h" -#include "wx/string.h" -#include "wx/list.h" -#include "wx/region.h" - -#define wxKEY_SHIFT 1 -#define wxKEY_CTRL 2 - -/* - * Base class for frame, panel, canvas, panel items, dialog box. - * - */ - -/* - * Event handler: windows have themselves as their event handlers - * by default, but their event handlers could be set to another - * object entirely. This separation can reduce the amount of - * derivation required, and allow alteration of a window's functionality - * (e.g. by a resource editor that temporarily switches event handlers). - */ - -class WXDLLEXPORT wxWindow; -class WXDLLEXPORT wxEvent; -class WXDLLEXPORT wxCommandEvent; -class WXDLLEXPORT wxKeyEvent; -class WXDLLEXPORT wxControl; -class WXDLLEXPORT wxCursor; -class WXDLLEXPORT wxColourMap; -class WXDLLEXPORT wxFont; -class WXDLLEXPORT wxMenu; -class WXDLLEXPORT wxRect; -class WXDLLEXPORT wxBitmap; -class WXDLLEXPORT wxSizer; -class WXDLLEXPORT wxList; -class WXDLLEXPORT wxLayoutConstraints; -class WXDLLEXPORT wxMouseEvent; -class WXDLLEXPORT wxButton; -class WXDLLEXPORT wxColour; -class WXDLLEXPORT wxBrush; -class WXDLLEXPORT wxPen; -class WXDLLEXPORT wxIcon; -class WXDLLEXPORT wxDC; -class WXDLLEXPORT wxValidator; - -#if wxUSE_DRAG_AND_DROP -class WXDLLEXPORT wxDropTarget; -#endif - -#if wxUSE_WX_RESOURCES -class WXDLLEXPORT wxResourceTable; -class WXDLLEXPORT wxItemResource; -#endif - -WXDLLEXPORT_DATA(extern const char*) wxPanelNameStr; - -WXDLLEXPORT_DATA(extern const wxSize) wxDefaultSize; -WXDLLEXPORT_DATA(extern const wxPoint) wxDefaultPosition; - -class WXDLLEXPORT wxWindow: public wxEvtHandler -{ - DECLARE_ABSTRACT_CLASS(wxWindow) - - friend class wxDC; - friend class wxPaintDC; - -public: - wxWindow(); - inline wxWindow(wxWindow *parent, wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxPanelNameStr) - { - m_children = new wxList; - 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); - - // Fit the window around the items - virtual void Fit(); - - // Show or hide the window - virtual bool Show(bool show); - - // Is the window shown? - virtual bool IsShown() const; - - // Raise the window to the top of the Z order - virtual void Raise(); - - // Lower the window to the bottom of the Z order - virtual void Lower(); - - // Is the window enabled? - virtual bool IsEnabled() const; - - // For compatibility - inline bool Enabled() const { return IsEnabled(); } - - // Dialog support: override these and call - // base class members to add functionality - // that can't be done using validators. - - // Transfer values to controls. If returns FALSE, - // it's an application error (pops up a dialog) - virtual bool TransferDataToWindow(); - - // Transfer values from controls. If returns FALSE, - // transfer failed: don't quit - virtual bool TransferDataFromWindow(); - - // Validate controls. If returns FALSE, - // validation failed: don't quit - virtual bool Validate(); - - // Return code for dialogs - inline void SetReturnCode(int retCode); - inline int GetReturnCode(); - - // Set the cursor - virtual void SetCursor(const wxCursor& cursor); - inline virtual wxCursor *GetCursor() const { return (wxCursor *)& m_windowCursor; }; - - // Get the window with the focus - static wxWindow *FindFocus(); - - // Get character size - virtual int GetCharHeight() const; - virtual int GetCharWidth() const; - - // Get overall window size - virtual void GetSize(int *width, int *height) const; - - // Get window position, relative to parent (or screen if no parent) - virtual void GetPosition(int *x, int *y) const; - - // Get client (application-useable) size - virtual void GetClientSize(int *width, int *height) const; - - // Set overall size and position - virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); - inline virtual void SetSize(int width, int height) { SetSize(-1, -1, width, height, wxSIZE_USE_EXISTING); } - inline virtual void Move(int x, int y) { SetSize(x, y, -1, -1, wxSIZE_USE_EXISTING); } - - // Set client size - virtual void SetClientSize(int width, int size); - - // Convert client to screen coordinates - virtual void ClientToScreen(int *x, int *y) const; - - // Convert screen to client coordinates - virtual void ScreenToClient(int *x, int *y) const; - - // Set the focus to this window - virtual void SetFocus(); - - // Capture/release mouse - virtual void CaptureMouse(); - virtual void ReleaseMouse(); - - // Enable or disable the window - virtual void Enable(bool enable); - -#if wxUSE_DRAG_AND_DROP - // Associate a drop target with this window (if the window already had a drop - // target, it's deleted!) and return the current drop target (may be NULL). - void SetDropTarget(wxDropTarget *pDropTarget); - wxDropTarget *GetDropTarget() const { return m_pDropTarget; } -#endif - - // Accept files for dragging - virtual void DragAcceptFiles(bool accept); - - // Update region access - virtual wxRegion GetUpdateRegion() const; - virtual bool IsExposed(int x, int y, int w, int h) const; - virtual bool IsExposed(const wxPoint& pt) const; - virtual bool IsExposed(const wxRect& rect) const; - - // Set/get the window title - virtual inline void SetTitle(const wxString& WXUNUSED(title)) {}; - inline virtual wxString GetTitle() const { return wxString(""); }; - // Most windows have the concept of a label; for frames, this is the - // title; for items, this is the label or button text. - inline virtual wxString GetLabel() const { return GetTitle(); } - - // Set/get the window name (used for resource setting in X) - inline virtual wxString GetName() const; - inline virtual void SetName(const wxString& name); - - // Centre the window - virtual void Centre(int direction) ; - inline void Center(int direction = wxHORIZONTAL) { Centre(direction); } - - // Popup a menu - virtual bool PopupMenu(wxMenu *menu, int x, int y); - - // Send the window a refresh event - virtual void Refresh(bool eraseBack = TRUE, const wxRect *rect = NULL); - - // New functions that will replace the above. - virtual void SetScrollbar(int orient, int pos, int thumbVisible, - int range, bool refresh = TRUE); - - virtual void SetScrollPos(int orient, int pos, bool refresh = TRUE); - virtual int GetScrollPos(int orient) const; - virtual int GetScrollRange(int orient) const; - virtual int GetScrollThumb(int orient) const; - - virtual void ScrollWindow(int dx, int dy, const wxRect *rect = NULL); - - // Caret manipulation - virtual void CreateCaret(int w, int h); - virtual void CreateCaret(const wxBitmap *bitmap); - virtual void DestroyCaret(); - virtual void ShowCaret(bool show); - virtual void SetCaretPos(int x, int y); - virtual void GetCaretPos(int *x, int *y) const; - - // Tell window how much it can be sized - virtual void SetSizeHints(int minW = -1, int minH = -1, int maxW = -1, int maxH = -1, int incW = -1, int incH = -1); - - // Set/get the window's identifier - inline int GetId() const; - inline void SetId(int id); - - // Make the window modal (all other windows unresponsive) - virtual void MakeModal(bool modal); - - // Get the private handle (platform-dependent) - inline void *GetHandle() const; - - // Set/get the window's relatives - inline wxWindow *GetParent() const; - inline void SetParent(wxWindow *p) ; - inline wxWindow *GetGrandParent() const; - inline wxList *GetChildren() const; - - // Set/get the window's font - virtual void SetFont(const wxFont& f); - inline virtual wxFont *GetFont() const; - - // Set/get the window's validator - void SetValidator(const wxValidator& validator); - inline wxValidator *GetValidator() const; - - // Set/get the window's style - inline void SetWindowStyleFlag(long flag); - inline long GetWindowStyleFlag() const; - - // Set/get event handler - inline void SetEventHandler(wxEvtHandler *handler); - inline wxEvtHandler *GetEventHandler() const; - - // Push/pop event handler (i.e. allow a chain of event handlers - // be searched) - void PushEventHandler(wxEvtHandler *handler) ; - wxEvtHandler *PopEventHandler(bool deleteHandler = FALSE) ; - - // Close the window by calling OnClose, posting a deletion - virtual bool Close(bool force = FALSE); - - // Destroy the window (delayed, if a managed window) - virtual bool Destroy() ; - - // Mode for telling default OnSize members to - // call Layout(), if not using Sizers, just top-down constraints - inline void SetAutoLayout(bool a); - inline bool GetAutoLayout() const; - - // Set/get constraints - inline wxLayoutConstraints *GetConstraints() const; - void SetConstraints(wxLayoutConstraints *c); - - // Set/get window background colour - inline virtual void SetBackgroundColour(const wxColour& col); - inline virtual wxColour GetBackgroundColour() const; - - // Set/get window foreground colour - inline virtual void SetForegroundColour(const wxColour& col); - inline virtual wxColour GetForegroundColour() const; - - // Set/get window default background colour (for children to inherit). - // NOTE: these may be removed in later revisions. - inline virtual void SetDefaultBackgroundColour(const wxColour& col); - inline virtual wxColour GetDefaultBackgroundColour(void) const; - - // Set/get window default foreground colour (for children to inherit) - inline virtual void SetDefaultForegroundColour(const wxColour& col); - inline virtual wxColour GetDefaultForegroundColour(void) const; - - // Get the default button, if there is one - inline virtual wxButton *GetDefaultItem() const; - inline virtual void SetDefaultItem(wxButton *but); - - // Override to define new behaviour for default action (e.g. double clicking - // on a listbox) - virtual void OnDefaultAction(wxControl *initiatingItem); - - // Resource loading -#if wxUSE_WX_RESOURCES - virtual bool LoadFromResource(wxWindow *parent, const wxString& resourceName, const wxResourceTable *table = NULL); - virtual wxControl *CreateItem(const wxItemResource *childResource, const wxResourceTable *table = NULL); -#endif - - // Native resource loading - virtual bool LoadNativeDialog(wxWindow* parent, wxWindowID& id); - virtual bool LoadNativeDialog(wxWindow* parent, const wxString& name); - virtual wxWindow* GetWindowChild1(wxWindowID& id); - virtual wxWindow* GetWindowChild(wxWindowID& id); - - virtual void GetTextExtent(const wxString& string, int *x, int *y, - int *descent = NULL, - int *externalLeading = NULL, - const wxFont *theFont = NULL, bool use16 = FALSE) const; - - // Is the window retained? - inline bool IsRetained() const; - - // Warp the pointer the given position - virtual void WarpPointer(int x_pos, int y_pos) ; - - // Clear the window - virtual void Clear(); - - // Find a window by id or name - virtual wxWindow *FindWindow(long id); - virtual wxWindow *FindWindow(const wxString& name); - - // Constraint operations - bool Layout(); - void SetSizer(wxSizer *sizer); // Adds sizer child to this window - inline wxSizer *GetSizer() const ; - inline wxWindow *GetSizerParent() const ; - inline void SetSizerParent(wxWindow *win); - - // Do Update UI processing for controls - void UpdateWindowUI(); - - void OnEraseBackground(wxEraseEvent& event); - void OnChar(wxKeyEvent& event); - void OnPaint(wxPaintEvent& event); - void OnIdle(wxIdleEvent& event); - - // Does this window want to accept keyboard focus? - virtual bool AcceptsFocus() const; - -public: - //////////////////////////////////////////////////////////////////////// - //// IMPLEMENTATION - - // 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); - - // Executes the default message - virtual long Default(); - -/* TODO: you may need something like this - // Determine whether 3D effects are wanted - virtual WXDWORD Determine3DEffects(WXDWORD defaultBorderStyle, bool *want3D); -*/ - - virtual void AddChild(wxWindow *child); // Adds reference to the child object - virtual void RemoveChild(wxWindow *child); // Removes reference to child - // (but doesn't delete the child object) - virtual void DestroyChildren(); // Removes and destroys all children - - // Constraint implementation - void UnsetConstraints(wxLayoutConstraints *c); - inline wxList *GetConstraintsInvolvedIn() const ; - // Back-pointer to other windows we're involved with, so if we delete - // this window, we must delete any constraints we're involved with. - void AddConstraintReference(wxWindow *otherWin); - void RemoveConstraintReference(wxWindow *otherWin); - void DeleteRelatedConstraints(); - - virtual void ResetConstraints(); - virtual void SetConstraintSizes(bool recurse = TRUE); - virtual bool LayoutPhase1(int *noChanges); - virtual bool LayoutPhase2(int *noChanges); - virtual bool DoPhase(int); - // Transforms from sizer coordinate space to actual - // parent coordinate space - virtual void TransformSizerToActual(int *x, int *y) const ; - - // Set size with transformation to actual coordinates if nec. - virtual void SizerSetSize(int x, int y, int w, int h); - virtual void SizerMove(int x, int y); - - // Only set/get the size/position of the constraint (if any) - virtual void SetSizeConstraint(int x, int y, int w, int h); - virtual void MoveConstraint(int x, int y); - virtual void GetSizeConstraint(int *w, int *h) const ; - virtual void GetClientSizeConstraint(int *w, int *h) const ; - virtual void GetPositionConstraint(int *x, int *y) const ; - - wxObject *GetChild(int number) const ; - - inline void SetShowing(bool show); - inline bool IsUserEnabled() const; - inline bool GetTransparentBackground() const ; - - // Responds to colour changes: passes event on to children. - void OnSysColourChanged(wxSysColourChangedEvent& event); - - // Transfers data to any child controls - void OnInitDialog(wxInitDialogEvent& event); - - // Sends an OnInitDialog event, which in turns transfers data to - // to the window via validators. - virtual void InitDialog(); - - //////////////////////////////////////////////////////////////////////// - //// PROTECTED DATA -protected: - int m_windowId; - long m_windowStyle; // Store the window's style - wxEvtHandler * m_windowEventHandler; // Usually is 'this' - wxLayoutConstraints * m_constraints; // Constraints for this window - wxList * m_constraintsInvolvedIn; // List of constraints we're involved in - wxSizer * m_windowSizer; // Window's top-level sizer (if any) - wxWindow * m_sizerParent; // Window's parent sizer (if any) - bool m_autoLayout; // Whether to call Layout() in OnSize - wxWindow * m_windowParent; // Each window always knows its parent - wxValidator * m_windowValidator; - int m_minSizeX; - int m_minSizeY; - int m_maxSizeX; - int m_maxSizeY; - - // Caret data - int m_caretWidth; - int m_caretHeight; - bool m_caretEnabled; - bool m_caretShown; - wxFont m_windowFont; // Window's font - wxCursor m_windowCursor; // Window's cursor - wxString m_windowName; // Window name - - wxButton * m_defaultItem; - - wxColour m_backgroundColour ; - wxColour m_foregroundColour ; - wxColour m_defaultBackgroundColour; - wxColour m_defaultForegroundColour; - -#if wxUSE_DRAG_AND_DROP - wxDropTarget *m_pDropTarget; // the current drop target or NULL -#endif //USE_DRAG_AND_DROP - -public: - wxRegion m_updateRegion; - wxList * m_children; // Window's children - int m_returnCode; - -DECLARE_EVENT_TABLE() -}; - -//////////////////////////////////////////////////////////////////////// -//// INLINES - -inline void *wxWindow::GetHandle() const { return (void *)NULL; } -inline int wxWindow::GetId() const { return m_windowId; } -inline void wxWindow::SetId(int id) { m_windowId = id; } -inline wxWindow *wxWindow::GetParent() const { return m_windowParent; } -inline void wxWindow::SetParent(wxWindow *p) { m_windowParent = p; } -inline wxWindow *wxWindow::GetGrandParent() const { return (m_windowParent ? m_windowParent->m_windowParent : NULL); } -inline wxList *wxWindow::GetChildren() const { return m_children; } -inline wxFont *wxWindow::GetFont() const { return (wxFont *) & m_windowFont; } -inline wxString wxWindow::GetName() const { return m_windowName; } -inline void wxWindow::SetName(const wxString& name) { m_windowName = name; } -inline long wxWindow::GetWindowStyleFlag() const { return m_windowStyle; } -inline void wxWindow::SetWindowStyleFlag(long flag) { m_windowStyle = flag; } -inline void wxWindow::SetDoubleClick(bool flag) { m_doubleClickAllowed = flag; } -inline bool wxWindow::GetDoubleClick() const { return m_doubleClickAllowed; } -inline void wxWindow::SetEventHandler(wxEvtHandler *handler) { m_windowEventHandler = handler; } -inline wxEvtHandler *wxWindow::GetEventHandler() const { return m_windowEventHandler; } -inline void wxWindow::SetAutoLayout(bool a) { m_autoLayout = a; } -inline bool wxWindow::GetAutoLayout() const { return m_autoLayout; } -inline wxLayoutConstraints *wxWindow::GetConstraints() const { return m_constraints; } -inline void wxWindow::SetBackgroundColour(const wxColour& col) { m_backgroundColour = col; }; -inline wxColour wxWindow::GetBackgroundColour() const { return m_backgroundColour; }; -inline void wxWindow::SetForegroundColour(const wxColour& col) { m_foregroundColour = col; }; -inline wxColour wxWindow::GetForegroundColour() const { return m_foregroundColour; }; -inline void wxWindow::SetDefaultForegroundColour(const wxColour& col) { m_defaultForegroundColour = col; }; -inline wxColour wxWindow::GetDefaultForegroundColour(void) const { return m_defaultForegroundColour; }; -inline void wxWindow::SetDefaultBackgroundColour(const wxColour& col) { m_defaultBackgroundColour = col; }; -inline wxColour wxWindow::GetDefaultBackgroundColour(void) const { return m_defaultBackgroundColour; }; - -inline wxButton *wxWindow::GetDefaultItem() const { return m_defaultItem; } -inline void wxWindow::SetDefaultItem(wxButton *but) { m_defaultItem = but; } -inline bool wxWindow::IsRetained() const { return ((m_windowStyle & wxRETAINED) == wxRETAINED); } - -inline void wxWindow::SetShowing(bool show) { m_isShown = show; } -inline wxList *wxWindow::GetConstraintsInvolvedIn() const { return m_constraintsInvolvedIn; } -inline wxSizer *wxWindow::GetSizer() const { return m_windowSizer; } -inline wxWindow *wxWindow::GetSizerParent() const { return m_sizerParent; } -inline void wxWindow::SetSizerParent(wxWindow *win) { m_sizerParent = win; } -inline wxValidator *wxWindow::GetValidator() const { return m_windowValidator; } -inline bool wxWindow::IsUserEnabled() const { return m_winEnabled; } -inline bool wxWindow::GetTransparentBackground() const { return m_backgroundTransparent; } -inline void wxWindow::SetReturnCode(int retCode) { m_returnCode = retCode; } -inline int wxWindow::GetReturnCode() { return m_returnCode; } - -// Get the active window. -wxWindow* WXDLLEXPORT wxGetActiveWindow(); - -WXDLLEXPORT_DATA(extern wxList) wxTopLevelWindows; - -#endif - // _WX_WINDOW_H_ diff --git a/include/wx/stubs/accel.h b/include/wx/stubs/accel.h deleted file mode 100644 index ec39737483..0000000000 --- a/include/wx/stubs/accel.h +++ /dev/null @@ -1,80 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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_ diff --git a/include/wx/stubs/app.h b/include/wx/stubs/app.h deleted file mode 100644 index fba1c3f241..0000000000 --- a/include/wx/stubs/app.h +++ /dev/null @@ -1,156 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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_ - diff --git a/include/wx/stubs/bitmap.h b/include/wx/stubs/bitmap.h deleted file mode 100644 index 1d2f5417e5..0000000000 --- a/include/wx/stubs/bitmap.h +++ /dev/null @@ -1,197 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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_ diff --git a/include/wx/stubs/bmpbuttn.h b/include/wx/stubs/bmpbuttn.h deleted file mode 100644 index defe39e438..0000000000 --- a/include/wx/stubs/bmpbuttn.h +++ /dev/null @@ -1,83 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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; -}; - -#endif - // _WX_BMPBUTTN_H_ diff --git a/include/wx/stubs/brush.h b/include/wx/stubs/brush.h deleted file mode 100644 index a0a1bd7471..0000000000 --- a/include/wx/stubs/brush.h +++ /dev/null @@ -1,83 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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_ diff --git a/include/wx/stubs/button.h b/include/wx/stubs/button.h deleted file mode 100644 index 68b67d8c96..0000000000 --- a/include/wx/stubs/button.h +++ /dev/null @@ -1,53 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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(); - virtual void SetLabel(const wxString& label); - virtual wxString GetLabel() const ; - virtual void Command(wxCommandEvent& event); -}; - -#endif - // _WX_BUTTON_H_ diff --git a/include/wx/stubs/checkbox.h b/include/wx/stubs/checkbox.h deleted file mode 100644 index cfc102058a..0000000000 --- a/include/wx/stubs/checkbox.h +++ /dev/null @@ -1,81 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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); -}; - -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); -}; -#endif - // _WX_CHECKBOX_H_ diff --git a/include/wx/stubs/checklst.h b/include/wx/stubs/checklst.h deleted file mode 100644 index 19b4ccb8d3..0000000000 --- a/include/wx/stubs/checklst.h +++ /dev/null @@ -1,47 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// 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_ diff --git a/include/wx/stubs/choice.h b/include/wx/stubs/choice.h deleted file mode 100644 index 7f360ed5cc..0000000000 --- a/include/wx/stubs/choice.h +++ /dev/null @@ -1,72 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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; -}; - -#endif - // _WX_CHOICE_H_ diff --git a/include/wx/stubs/clipbrd.h b/include/wx/stubs/clipbrd.h deleted file mode 100644 index 697dc9d939..0000000000 --- a/include/wx/stubs/clipbrd.h +++ /dev/null @@ -1,104 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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_ diff --git a/include/wx/stubs/colordlg.h b/include/wx/stubs/colordlg.h deleted file mode 100644 index 556c2f316e..0000000000 --- a/include/wx/stubs/colordlg.h +++ /dev/null @@ -1,46 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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_ diff --git a/include/wx/stubs/colour.h b/include/wx/stubs/colour.h deleted file mode 100644 index 24028b6756..0000000000 --- a/include/wx/stubs/colour.h +++ /dev/null @@ -1,97 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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_ diff --git a/include/wx/stubs/combobox.h b/include/wx/stubs/combobox.h deleted file mode 100644 index 07054af74e..0000000000 --- a/include/wx/stubs/combobox.h +++ /dev/null @@ -1,84 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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_ diff --git a/include/wx/stubs/control.h b/include/wx/stubs/control.h deleted file mode 100644 index c75756a72a..0000000000 --- a/include/wx/stubs/control.h +++ /dev/null @@ -1,50 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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_ diff --git a/include/wx/stubs/cursor.h b/include/wx/stubs/cursor.h deleted file mode 100644 index bc6397069f..0000000000 --- a/include/wx/stubs/cursor.h +++ /dev/null @@ -1,75 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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_ diff --git a/include/wx/stubs/dc.h b/include/wx/stubs/dc.h deleted file mode 100644 index 596e26de9a..0000000000 --- a/include/wx/stubs/dc.h +++ /dev/null @@ -1,372 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: dc.h -// Purpose: wxDC class -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DC_H_ -#define _WX_DC_H_ - -#ifdef __GNUG__ -#pragma interface "dc.h" -#endif - -#include "wx/pen.h" -#include "wx/brush.h" -#include "wx/icon.h" -#include "wx/font.h" -#include "wx/gdicmn.h" - -//----------------------------------------------------------------------------- -// constants -//----------------------------------------------------------------------------- - -#ifndef MM_TEXT -#define MM_TEXT 0 -#define MM_ISOTROPIC 1 -#define MM_ANISOTROPIC 2 -#define MM_LOMETRIC 3 -#define MM_HIMETRIC 4 -#define MM_TWIPS 5 -#define MM_POINTS 6 -#define MM_METRIC 7 -#endif - -//----------------------------------------------------------------------------- -// global variables -//----------------------------------------------------------------------------- - -extern int wxPageNumber; - -//----------------------------------------------------------------------------- -// wxDC -//----------------------------------------------------------------------------- - -class WXDLLEXPORT wxDC: public wxObject -{ - DECLARE_ABSTRACT_CLASS(wxDC) - - public: - - wxDC(void); - ~wxDC(void); - - void BeginDrawing(void) {}; - void EndDrawing(void) {}; - - virtual bool Ok(void) const { return m_ok; }; - - virtual void FloodFill( long x1, long y1, const wxColour& col, int style=wxFLOOD_SURFACE ) = 0; - inline void FloodFill(const wxPoint& pt, const wxColour& col, int style=wxFLOOD_SURFACE) - { - FloodFill(pt.x, pt.y, col, style); - } - - virtual bool GetPixel( long x1, long y1, wxColour *col ) const = 0; - inline bool GetPixel(const wxPoint& pt, wxColour *col) const - { - return GetPixel(pt.x, pt.y, col); - } - - virtual void DrawLine( long x1, long y1, long x2, long y2 ) = 0; - inline void DrawLine(const wxPoint& pt1, const wxPoint& pt2) - { - DrawLine(pt1.x, pt1.y, pt2.x, pt2.y); - } - - virtual void CrossHair( long x, long y ) = 0; - inline void CrossHair(const wxPoint& pt) - { - CrossHair(pt.x, pt.y); - } - - virtual void DrawArc( long x1, long y1, long x2, long y2, long xc, long yc ) = 0; - inline void DrawArc(const wxPoint& pt1, const wxPoint& pt2, const wxPoint& centre) - { - DrawArc(pt1.x, pt1.y, pt2.x, pt2.y, centre.x, centre.y); - } - - virtual void DrawEllipticArc( long x, long y, long width, long height, double sa, double ea ) = 0; - virtual void DrawEllipticArc (const wxPoint& pt, const wxSize& sz, double sa, double ea) - { - DrawEllipticArc(pt.x, pt.y, sz.x, sz.y, sa, ea); - } - - virtual void DrawPoint( long x, long y ) = 0; - virtual void DrawPoint( wxPoint& point ); - - virtual void DrawLines( int n, wxPoint points[], long xoffset = 0, long yoffset = 0 ) = 0; - virtual void DrawLines( wxList *points, long xoffset = 0, long yoffset = 0 ); - virtual void DrawPolygon( int n, wxPoint points[], long xoffset = 0, long yoffset = 0, - int fillStyle=wxODDEVEN_RULE ) = 0; - virtual void DrawPolygon( wxList *lines, long xoffset = 0, long yoffset = 0, - int fillStyle=wxODDEVEN_RULE ); - - virtual void DrawRectangle( long x, long y, long width, long height ) = 0; - inline void DrawRectangle(const wxPoint& pt, const wxSize& sz) - { - DrawRectangle(pt.x, pt.y, sz.x, sz.y); - } - inline void DrawRectangle(const wxRect& rect) - { - DrawRectangle(rect.x, rect.y, rect.width, rect.height); - } - virtual void DrawRoundedRectangle( long x, long y, long width, long height, double radius = 20.0 ) = 0; - inline void DrawRoundedRectangle(const wxPoint& pt, const wxSize& sz, double radius = 20.0) - { - DrawRoundedRectangle(pt.x, pt.y, sz.x, sz.y, radius); - } - inline void DrawRoundedRectangle(const wxRect& rect, double radius = 20.0) - { - DrawRoundedRectangle(rect.x, rect.y, rect.width, rect.height, radius); - } - - virtual void DrawEllipse( long x, long y, long width, long height ) = 0; - inline void DrawEllipse(const wxPoint& pt, const wxSize& sz) - { - DrawEllipse(pt.x, pt.y, sz.x, sz.y); - } - inline void DrawEllipse(const wxRect& rect) - { - DrawEllipse(rect.x, rect.y, rect.width, rect.height); - } - - virtual void DrawSpline( long x1, long y1, long x2, long y2, long x3, long y3 ); - virtual void DrawSpline( wxList *points ) = 0; - virtual void DrawSpline( int n, wxPoint points[] ); - - virtual bool CanDrawBitmap(void) const = 0; - - virtual void DrawIcon( const wxIcon &icon, long x, long y, bool useMask=FALSE ); - inline void DrawIcon(const wxIcon& icon, const wxPoint& pt) - { - DrawIcon(icon, pt.x, pt.y); - } - - // TODO DrawBitmap is not always the same as DrawIcon, especially if bitmaps and - // icons are implemented differently. - void DrawBitmap( const wxBitmap &bmp, long x, long y, bool useMask=FALSE ) - { DrawIcon( *((wxIcon*)(&bmp)), x, y, useMask ); } - - virtual bool Blit( long xdest, long ydest, long width, long height, - wxDC *source, long xsrc, long ysrc, int logical_func = wxCOPY, bool useMask=FALSE ) = 0; - inline bool Blit(const wxPoint& destPt, const wxSize& sz, - wxDC *source, const wxPoint& srcPt, int rop = wxCOPY, bool useMask = FALSE) - { - return Blit(destPt.x, destPt.y, sz.x, sz.y, source, srcPt.x, srcPt.y, rop, useMask); - } - - virtual void DrawText( const wxString &text, long x, long y, bool use16 = FALSE ) = 0; - inline void DrawText(const wxString& text, const wxPoint& pt, bool use16bit = FALSE) - { - DrawText(text, pt.x, pt.y, use16bit); - } - - virtual bool CanGetTextExtent(void) const = 0; - virtual void GetTextExtent( const wxString &string, long *width, long *height, - long *descent = NULL, long *externalLeading = NULL, - wxFont *theFont = NULL, bool use16 = FALSE ) = 0; - virtual long GetCharWidth(void) = 0; - virtual long GetCharHeight(void) = 0; - - virtual void Clear(void) = 0; - - virtual void SetFont( const wxFont &font ) = 0; - virtual wxFont& GetFont(void) const { return (wxFont&) m_font; }; - - virtual void SetPen( const wxPen &pen ) = 0; - virtual wxPen& GetPen(void) const { return (wxPen&) m_pen; }; - - virtual void SetBrush( const wxBrush &brush ) = 0; - virtual wxBrush& GetBrush(void) const { return (wxBrush&) m_brush; }; - - virtual void SetBackground( const wxBrush &brush ) = 0; - virtual wxBrush& GetBackground(void) const { return (wxBrush&) m_backgroundBrush; }; - - virtual void SetLogicalFunction( int function ) = 0; - virtual int GetLogicalFunction(void) const { return m_logicalFunction; }; - - virtual void SetTextForeground( const wxColour &col ); - virtual void SetTextBackground( const wxColour &col ); - virtual wxColour& GetTextBackground(void) const { return (wxColour&)m_textBackgroundColour; }; - virtual wxColour& GetTextForeground(void) const { return (wxColour&)m_textForegroundColour; }; - - virtual void SetBackgroundMode( int mode ) = 0; - virtual int GetBackgroundMode(void) const { return m_backgroundMode; }; - - virtual void SetPalette( const wxPalette& palette ) = 0; - void SetColourMap( const wxPalette& palette ) { SetPalette(palette); }; - - // the first two must be overridden and called - virtual void SetClippingRegion( long x, long y, long width, long height ); - virtual void DestroyClippingRegion(void); - virtual void GetClippingBox( long *x, long *y, long *width, long *height ) const; - - virtual inline long MinX(void) const { return m_minX; } - virtual inline long MaxX(void) const { return m_maxX; } - virtual inline long MinY(void) const { return m_minY; } - virtual inline long MaxY(void) const { return m_maxY; } - - virtual void GetSize( int* width, int* height ) const; - inline wxSize GetSize(void) const { int w, h; GetSize(&w, &h); return wxSize(w, h); } - virtual void GetSizeMM( long* width, long* height ) const; - - virtual bool StartDoc( const wxString& WXUNUSED(message) ) { return TRUE; }; - virtual void EndDoc(void) {}; - virtual void StartPage(void) {}; - virtual void EndPage(void) {}; - - virtual void SetMapMode( int mode ); - virtual int GetMapMode(void) const { return m_mappingMode; }; - - virtual void SetUserScale( double x, double y ); - virtual void GetUserScale( double *x, double *y ); - virtual void SetLogicalScale( double x, double y ); - virtual void GetLogicalScale( double *x, double *y ); - - virtual void SetLogicalOrigin( long x, long y ); - virtual void GetLogicalOrigin( long *x, long *y ); - virtual void SetDeviceOrigin( long x, long y ); - virtual void GetDeviceOrigin( long *x, long *y ); - virtual void SetInternalDeviceOrigin( long x, long y ); - virtual void GetInternalDeviceOrigin( long *x, long *y ); - - virtual void SetAxisOrientation( bool xLeftRight, bool yBottomUp ); - - virtual void SetOptimization( bool WXUNUSED(optimize) ) {}; - virtual bool GetOptimization(void) { return m_optimize; }; - - virtual long DeviceToLogicalX(long x) const; - virtual long DeviceToLogicalY(long y) const; - virtual long DeviceToLogicalXRel(long x) const; - virtual long DeviceToLogicalYRel(long y) const; - virtual long LogicalToDeviceX(long x) const; - virtual long LogicalToDeviceY(long y) const; - virtual long LogicalToDeviceXRel(long x) const; - virtual long LogicalToDeviceYRel(long y) const; - - public: - - void CalcBoundingBox( long x, long y ); - void ComputeScaleAndOrigin(void); - - long XDEV2LOG(long x) const - { - long new_x = x - m_deviceOriginX; - if (new_x > 0) - return (long)((double)(new_x) / m_scaleX + 0.5) * m_signX + m_logicalOriginX; - else - return (long)((double)(new_x) / m_scaleX - 0.5) * m_signX + m_logicalOriginX; - } - long XDEV2LOGREL(long x) const - { - if (x > 0) - return (long)((double)(x) / m_scaleX + 0.5); - else - return (long)((double)(x) / m_scaleX - 0.5); - } - long YDEV2LOG(long y) const - { - long new_y = y - m_deviceOriginY; - if (new_y > 0) - return (long)((double)(new_y) / m_scaleY + 0.5) * m_signY + m_logicalOriginY; - else - return (long)((double)(new_y) / m_scaleY - 0.5) * m_signY + m_logicalOriginY; - } - long YDEV2LOGREL(long y) const - { - if (y > 0) - return (long)((double)(y) / m_scaleY + 0.5); - else - return (long)((double)(y) / m_scaleY - 0.5); - } - long XLOG2DEV(long x) const - { - long new_x = x - m_logicalOriginX; - if (new_x > 0) - return (long)((double)(new_x) * m_scaleX + 0.5) * m_signX + m_deviceOriginX; - else - return (long)((double)(new_x) * m_scaleX - 0.5) * m_signX + m_deviceOriginX; - } - long XLOG2DEVREL(long x) const - { - if (x > 0) - return (long)((double)(x) * m_scaleX + 0.5); - else - return (long)((double)(x) * m_scaleX - 0.5); - } - long YLOG2DEV(long y) const - { - long new_y = y - m_logicalOriginY; - if (new_y > 0) - return (long)((double)(new_y) * m_scaleY + 0.5) * m_signY + m_deviceOriginY; - else - return (long)((double)(new_y) * m_scaleY - 0.5) * m_signY + m_deviceOriginY; - } - long YLOG2DEVREL(long y) const - { - if (y > 0) - return (long)((double)(y) * m_scaleY + 0.5); - else - return (long)((double)(y) * m_scaleY - 0.5); - } - - public: - - bool m_ok; - bool m_colour; - - // not sure, what these mean - bool m_clipping; // Is clipping on right now ? - bool m_isInteractive; // Is GetPixel possible ? - bool m_autoSetting; // wxMSW only ? - bool m_dontDelete; // wxMSW only ? - bool m_optimize; // wxMSW only ? - wxString m_filename; // Not sure where this belongs. - - wxPen m_pen; - wxBrush m_brush; - wxBrush m_backgroundBrush; - wxColour m_textForegroundColour; - wxColour m_textBackgroundColour; - wxFont m_font; - - int m_logicalFunction; - int m_backgroundMode; - int m_textAlignment; // gone in wxWin 2.0 ? - - int m_mappingMode; - - // not sure what for, but what is a mm on a screen you don't know the size of? - double m_mm_to_pix_x,m_mm_to_pix_y; - - long m_internalDeviceOriginX,m_internalDeviceOriginY; // If un-scrolled is non-zero or - // d.o. changes with scrolling. - // Set using SetInternalDeviceOrigin(). - - long m_externalDeviceOriginX,m_externalDeviceOriginY; // To be set by external classes - // such as wxScrolledWindow - // using SetDeviceOrigin() - - long m_deviceOriginX,m_deviceOriginY; // Sum of the two above. - - long m_logicalOriginX,m_logicalOriginY; // User defined. - - double m_scaleX,m_scaleY; - double m_logicalScaleX,m_logicalScaleY; - double m_userScaleX,m_userScaleY; - long m_signX,m_signY; - - bool m_needComputeScaleX,m_needComputeScaleY; // not yet used - - long m_clipX1,m_clipY1,m_clipX2,m_clipY2; - long m_minX,m_maxX,m_minY,m_maxY; -}; - -#endif - // _WX_DC_H_ diff --git a/include/wx/stubs/dcclient.h b/include/wx/stubs/dcclient.h deleted file mode 100644 index 29e4e6f7a0..0000000000 --- a/include/wx/stubs/dcclient.h +++ /dev/null @@ -1,125 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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 ); -}; - -//----------------------------------------------------------------------------- -// 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_ diff --git a/include/wx/stubs/dcmemory.h b/include/wx/stubs/dcmemory.h deleted file mode 100644 index c6c5737642..0000000000 --- a/include/wx/stubs/dcmemory.h +++ /dev/null @@ -1,38 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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_ diff --git a/include/wx/stubs/dcprint.h b/include/wx/stubs/dcprint.h deleted file mode 100644 index 2ea66d15bf..0000000000 --- a/include/wx/stubs/dcprint.h +++ /dev/null @@ -1,34 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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_ - diff --git a/include/wx/stubs/dcscreen.h b/include/wx/stubs/dcscreen.h deleted file mode 100644 index e04b450f69..0000000000 --- a/include/wx/stubs/dcscreen.h +++ /dev/null @@ -1,39 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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_ - diff --git a/include/wx/stubs/dialog.h b/include/wx/stubs/dialog.h deleted file mode 100644 index d68cc7c9a0..0000000000 --- a/include/wx/stubs/dialog.h +++ /dev/null @@ -1,97 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: dialog.h -// Purpose: wxDialog class -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DIALOG_H_ -#define _WX_DIALOG_H_ - -#ifdef __GNUG__ -#pragma interface "dialog.h" -#endif - -#include "wx/panel.h" - -WXDLLEXPORT_DATA(extern const char*) wxDialogNameStr; - -// Dialog boxes -class WXDLLEXPORT wxDialog: public wxPanel -{ - DECLARE_DYNAMIC_CLASS(wxDialog) -public: - - wxDialog(); - - // Constructor with a modal flag, but no window id - the old convention - inline wxDialog(wxWindow *parent, - const wxString& title, bool modal, - int x = -1, int y= -1, int width = 500, int height = 500, - long style = wxDEFAULT_DIALOG_STYLE, - const wxString& name = wxDialogNameStr) - { - long modalStyle = modal ? wxDIALOG_MODAL : wxDIALOG_MODELESS ; - Create(parent, -1, title, wxPoint(x, y), wxSize(width, height), style|modalStyle, name); - } - - // Constructor with no modal flag - the new convention. - inline wxDialog(wxWindow *parent, wxWindowID id, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_DIALOG_STYLE, - const wxString& name = wxDialogNameStr) - { - Create(parent, id, title, pos, size, style, name); - } - - bool Create(wxWindow *parent, wxWindowID id, - const wxString& title, // bool modal = FALSE, // TODO make this a window style? - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_DIALOG_STYLE, - const wxString& name = wxDialogNameStr); - - ~wxDialog(); - - virtual bool Destroy(); - void SetClientSize(int width, int height); - void GetPosition(int *x, int *y) const; - bool Show(bool show); - void Iconize(bool iconize); - - virtual bool IsIconized() const; - void Fit(); - - void SetTitle(const wxString& title); - wxString GetTitle() const ; - - void OnCharHook(wxKeyEvent& 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); } - - 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); - -DECLARE_EVENT_TABLE() -}; - -#endif - // _WX_DIALOG_H_ diff --git a/include/wx/stubs/dirdlg.h b/include/wx/stubs/dirdlg.h deleted file mode 100644 index 44f96238e2..0000000000 --- a/include/wx/stubs/dirdlg.h +++ /dev/null @@ -1,49 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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_ diff --git a/include/wx/stubs/dnd.h b/include/wx/stubs/dnd.h deleted file mode 100644 index 5a7a65335f..0000000000 --- a/include/wx/stubs/dnd.h +++ /dev/null @@ -1,238 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// 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; - -//------------------------------------------------------------------------- -// 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_ - diff --git a/include/wx/stubs/filedlg.h b/include/wx/stubs/filedlg.h deleted file mode 100644 index bd6075eb15..0000000000 --- a/include/wx/stubs/filedlg.h +++ /dev/null @@ -1,89 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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_ diff --git a/include/wx/stubs/font.h b/include/wx/stubs/font.h deleted file mode 100644 index aff8fb3a75..0000000000 --- a/include/wx/stubs/font.h +++ /dev/null @@ -1,89 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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_ diff --git a/include/wx/stubs/fontdlg.h b/include/wx/stubs/fontdlg.h deleted file mode 100644 index 39da6fd967..0000000000 --- a/include/wx/stubs/fontdlg.h +++ /dev/null @@ -1,46 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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_ - diff --git a/include/wx/stubs/frame.h b/include/wx/stubs/frame.h deleted file mode 100644 index 540caf249e..0000000000 --- a/include/wx/stubs/frame.h +++ /dev/null @@ -1,159 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: frame.h -// Purpose: wxFrame class -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_FRAME_H_ -#define _WX_FRAME_H_ - -#ifdef __GNUG__ -#pragma interface "frame.h" -#endif - -#include "wx/window.h" -#include "wx/toolbar.h" - -#if wxUSE_ACCEL -#include "wx/accel.h" -#endif - -WXDLLEXPORT_DATA(extern const char*) wxFrameNameStr; -WXDLLEXPORT_DATA(extern const char*) wxToolBarNameStr; - -class WXDLLEXPORT wxMenuBar; -class WXDLLEXPORT wxStatusBar; - -class WXDLLEXPORT wxFrame: public wxWindow { - - DECLARE_DYNAMIC_CLASS(wxFrame) - -public: - wxFrame(); - inline 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(); - void SetClientSize(int width, int height); - void GetClientSize(int *width, int *height) const; - - void GetSize(int *width, int *height) const ; - void GetPosition(int *x, int *y) const ; - void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); - void ClientToScreen(int *x, int *y) const; - void ScreenToClient(int *x, int *y) const; - - void OnSize(wxSizeEvent& event); - void OnMenuHighlight(wxMenuEvent& event); - 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 ; - - // Set title - void SetTitle(const wxString& title); - wxString GetTitle() const ; - - void Centre(int direction = wxBOTH); - - // Call this to simulate a menu command - virtual void Command(int id); - virtual void ProcessCommand(int id); - - // Set icon - virtual void SetIcon(const wxIcon& icon); - - // Create status line - virtual wxStatusBar* CreateStatusBar(int number=1, long style = wxST_SIZEGRIP, wxWindowID id = 0, - const wxString& name = "statusBar"); - inline wxStatusBar *GetStatusBar() const { return m_frameStatusBar; } - virtual void PositionStatusBar(); - virtual wxStatusBar *OnCreateStatusBar(int number, long style, wxWindowID id, - const wxString& name); - - // Create toolbar - virtual wxToolBar* CreateToolBar(long style = wxNO_BORDER|wxTB_HORIZONTAL, wxWindowID id = -1, const wxString& name = wxToolBarNameStr); - virtual wxToolBar *OnCreateToolBar(long style, wxWindowID id, const wxString& name); - // If made known to the frame, the frame will manage it automatically. - virtual inline void SetToolBar(wxToolBar *toolbar) { m_frameToolBar = toolbar; } - virtual inline wxToolBar *GetToolBar() const { return m_frameToolBar; } - virtual void PositionToolBar(); - - // Set status line text - virtual void SetStatusText(const wxString& text, int number = 0); - - // 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; }; - - // Fit frame around subwindows - virtual void Fit(); - - // Iconize - virtual void Iconize(bool iconize); - - virtual bool IsIconized() const ; - - // Compatibility - inline bool Iconized() const { return IsIconized(); } - - // Is the frame maximized? - virtual bool IsMaximized(void) const ; - - virtual void Maximize(bool maximize); - - // 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); - - // Checks if there is a toolbar, and returns the first free client position - virtual wxPoint GetClientAreaOrigin() const; - -protected: - wxMenuBar * m_frameMenuBar; - wxStatusBar * m_frameStatusBar; - wxIcon m_icon; - bool m_iconized; - static bool m_useNativeStatusBar; - wxToolBar * m_frameToolBar ; - - DECLARE_EVENT_TABLE() -}; - -#endif - // _WX_FRAME_H_ diff --git a/include/wx/stubs/gauge.h b/include/wx/stubs/gauge.h deleted file mode 100644 index ce19d9ef1f..0000000000 --- a/include/wx/stubs/gauge.h +++ /dev/null @@ -1,69 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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; -}; - -#endif - // _WX_GAUGE_H_ diff --git a/include/wx/stubs/gdiobj.h b/include/wx/stubs/gdiobj.h deleted file mode 100644 index 9263d4d6ad..0000000000 --- a/include/wx/stubs/gdiobj.h +++ /dev/null @@ -1,48 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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_ diff --git a/include/wx/stubs/helpxxxx.h b/include/wx/stubs/helpxxxx.h deleted file mode 100644 index d53c28b7e4..0000000000 --- a/include/wx/stubs/helpxxxx.h +++ /dev/null @@ -1,52 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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_ diff --git a/include/wx/stubs/icon.h b/include/wx/stubs/icon.h deleted file mode 100644 index df475672ba..0000000000 --- a/include/wx/stubs/icon.h +++ /dev/null @@ -1,106 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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(); - - 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) ; } -}; - -/* 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_ diff --git a/include/wx/stubs/imaglist.h b/include/wx/stubs/imaglist.h deleted file mode 100644 index 7e66ffb36a..0000000000 --- a/include/wx/stubs/imaglist.h +++ /dev/null @@ -1,145 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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_ diff --git a/include/wx/stubs/joystick.h b/include/wx/stubs/joystick.h deleted file mode 100644 index 30324fc035..0000000000 --- a/include/wx/stubs/joystick.h +++ /dev/null @@ -1,93 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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_ diff --git a/include/wx/stubs/listbox.h b/include/wx/stubs/listbox.h deleted file mode 100644 index d95db4379b..0000000000 --- a/include/wx/stubs/listbox.h +++ /dev/null @@ -1,97 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: listbox.h -// Purpose: wxListBox class -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// 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 char*) wxListBoxNameStr; - -// forward decl for GetSelections() -class WXDLLEXPORT wxArrayInt; - -WXDLLEXPORT_DATA(extern const char*) wxEmptyString; - -// List box item -class WXDLLEXPORT wxListBox: public wxControl -{ - DECLARE_DYNAMIC_CLASS(wxListBox) - public: - - wxListBox(); - inline 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(); - - virtual void Append(const wxString& item); - virtual void Append(const wxString& item, char *clientData); - virtual void Set(int n, const wxString* choices, char **clientData = NULL); - virtual int FindString(const wxString& s) const ; - virtual void Clear(); - virtual void SetSelection(int n, bool select = TRUE); - - virtual void Deselect(int n); - - // For single choice list item only - virtual int GetSelection() const ; - virtual void Delete(int n); - virtual char *GetClientData(int n) const ; - virtual void SetClientData(int n, char *clientData); - virtual void SetString(int n, const wxString& s); - - // For single or multiple choice list item - virtual int GetSelections(wxArrayInt& aSelections) const; - virtual bool Selected(int n) const ; - virtual wxString GetString(int n) const ; - virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); - - // Set the specified item at the first visible item - // or scroll to max range. - 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); - - protected: - int m_noItems; - int m_selected; -}; - -#endif - // _WX_LISTBOX_H_ diff --git a/include/wx/stubs/listctrl.h b/include/wx/stubs/listctrl.h deleted file mode 100644 index 6dfc25df98..0000000000 --- a/include/wx/stubs/listctrl.h +++ /dev/null @@ -1,451 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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_ diff --git a/include/wx/stubs/mdi.h b/include/wx/stubs/mdi.h deleted file mode 100644 index 6f9fc294e2..0000000000 --- a/include/wx/stubs/mdi.h +++ /dev/null @@ -1,164 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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(); -}; - -/* 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_ diff --git a/include/wx/stubs/menu.h b/include/wx/stubs/menu.h deleted file mode 100644 index db15f8fc70..0000000000 --- a/include/wx/stubs/menu.h +++ /dev/null @@ -1,172 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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_ diff --git a/include/wx/stubs/menuitem.h b/include/wx/stubs/menuitem.h deleted file mode 100644 index 9c912967f1..0000000000 --- a/include/wx/stubs/menuitem.h +++ /dev/null @@ -1,95 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: menuitem.h -// Purpose: wxMenuItem class -// Author: Vadim Zeitlin -// Modified by: -// Created: 11.11.97 -// RCS-ID: $Id$ -// Copyright: (c) 1998 Vadim Zeitlin -// 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 diff --git a/include/wx/stubs/metafile.h b/include/wx/stubs/metafile.h deleted file mode 100644 index e4be296d92..0000000000 --- a/include/wx/stubs/metafile.h +++ /dev/null @@ -1,101 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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_ diff --git a/include/wx/stubs/minifram.h b/include/wx/stubs/minifram.h deleted file mode 100644 index 8f1644d558..0000000000 --- a/include/wx/stubs/minifram.h +++ /dev/null @@ -1,46 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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_ diff --git a/include/wx/stubs/msgdlg.h b/include/wx/stubs/msgdlg.h deleted file mode 100644 index 58fa8e51ae..0000000000 --- a/include/wx/stubs/msgdlg.h +++ /dev/null @@ -1,50 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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_ diff --git a/include/wx/stubs/notebook.h b/include/wx/stubs/notebook.h deleted file mode 100644 index 18b0793da2..0000000000 --- a/include/wx/stubs/notebook.h +++ /dev/null @@ -1,209 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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_ diff --git a/include/wx/stubs/palette.h b/include/wx/stubs/palette.h deleted file mode 100644 index 3482b33934..0000000000 --- a/include/wx/stubs/palette.h +++ /dev/null @@ -1,64 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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_ diff --git a/include/wx/stubs/pen.h b/include/wx/stubs/pen.h deleted file mode 100644 index 4cb73dcb8e..0000000000 --- a/include/wx/stubs/pen.h +++ /dev/null @@ -1,113 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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" - -// PORTERS, NB: this typedef is the platform specific type for dashes.. -// change all occurences of XSTUBX in pen.h and pen.cpp to something -// meaningful for your port (eg. wxMSWDash, wxGTKDash) and change the -// type from long to whatever your platform requires. - -typedef long wxXSTUBXDash; - -// wxDash is typedef'd in gdicmn.h and is the type that should be used -// for all public interfaces. Convert parameters to the wxXSTUBXDash -// type for use inside the platform specific methods, and cast them -// back to wxDash again before passing back to the user. -- RL - -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; - wxXSTUBXDash *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 ? (wxDash*)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_ diff --git a/include/wx/stubs/print.h b/include/wx/stubs/print.h deleted file mode 100644 index bac3703496..0000000000 --- a/include/wx/stubs/print.h +++ /dev/null @@ -1,56 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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_ diff --git a/include/wx/stubs/printdlg.h b/include/wx/stubs/printdlg.h deleted file mode 100644 index ac31a49096..0000000000 --- a/include/wx/stubs/printdlg.h +++ /dev/null @@ -1,70 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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, wxPrintData* data = NULL); - ~wxPrintDialog(); - - bool Create(wxWindow *parent, wxPrintData* data = NULL); - virtual int ShowModal(); - - inline wxPrintData& GetPrintData() { return m_printData; } - virtual wxDC *GetPrintDC(); - - private: - wxPrintData m_printData; - wxDC* m_printerDC; - wxWindow* m_dialogParent; -}; - -class WXDLLEXPORT wxPageSetupDialog: public wxDialog -{ - DECLARE_DYNAMIC_CLASS(wxPageSetupDialog) - - private: - wxPageSetupData m_pageSetupData; - wxWindow* m_dialogParent; - 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; } -}; - -#endif - // _WX_PRINTDLG_H_ diff --git a/include/wx/stubs/private.h b/include/wx/stubs/private.h deleted file mode 100644 index 922c172436..0000000000 --- a/include/wx/stubs/private.h +++ /dev/null @@ -1,21 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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_ diff --git a/include/wx/stubs/radiobox.h b/include/wx/stubs/radiobox.h deleted file mode 100644 index cb7c5ba405..0000000000 --- a/include/wx/stubs/radiobox.h +++ /dev/null @@ -1,88 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: radiobox.h -// Purpose: wxRadioBox class -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// 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 char*) wxRadioBoxNameStr; - -// List box item -class WXDLLEXPORT wxBitmap ; - -class WXDLLEXPORT wxRadioBox: public wxControl -{ - DECLARE_DYNAMIC_CLASS(wxRadioBox) -public: - wxRadioBox(); - - inline wxRadioBox(wxWindow *parent, wxWindowID id, const wxString& title, - const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - int n = 0, const wxString choices[] = NULL, - int majorDim = 0, long style = wxRA_HORIZONTAL, - 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); - - int FindString(const wxString& s) const; - void SetSelection(int N); - int GetSelection() const; - wxString GetString(int N) const; - void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); - void GetSize(int *x, int *y) const; - void GetPosition(int *x, int *y) const; - wxString GetLabel() const; - void SetLabel(const wxString& label); - void SetLabel(int item, const wxString& label) ; - wxString GetLabel(int item) const; - bool Show(bool show); - void SetFocus(); - void Enable(bool enable); - void Enable(int item, bool enable); - void Show(int item, bool show) ; - inline void SetLabelFont(const wxFont& WXUNUSED(font)) {}; - inline void SetButtonFont(const wxFont& font) { SetFont(font); } - - virtual wxString GetStringSelection() const; - virtual bool SetStringSelection(const wxString& s); - inline virtual int Number() const { return m_noItems; } ; - void Command(wxCommandEvent& event); - - inline int GetNumberOfRowsOrCols() const { return m_noRowsOrCols; } - inline void SetNumberOfRowsOrCols(int n) { m_noRowsOrCols = n; } - -protected: -/* TODO: implementation - WXHWND * m_radioButtons; -*/ - int m_majorDim ; - int m_noItems; - int m_noRowsOrCols; - int m_selectedButton; - -}; - -#endif - // _WX_RADIOBOX_H_ diff --git a/include/wx/stubs/radiobut.h b/include/wx/stubs/radiobut.h deleted file mode 100644 index 8e8bf1313d..0000000000 --- a/include/wx/stubs/radiobut.h +++ /dev/null @@ -1,90 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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_ diff --git a/include/wx/stubs/region.h b/include/wx/stubs/region.h deleted file mode 100644 index 04d143c2e9..0000000000 --- a/include/wx/stubs/region.h +++ /dev/null @@ -1,137 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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_ diff --git a/include/wx/stubs/scrolbar.h b/include/wx/stubs/scrolbar.h deleted file mode 100644 index 3ec992e78e..0000000000 --- a/include/wx/stubs/scrolbar.h +++ /dev/null @@ -1,68 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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_ diff --git a/include/wx/stubs/settings.h b/include/wx/stubs/settings.h deleted file mode 100644 index 8ed994f1ba..0000000000 --- a/include/wx/stubs/settings.h +++ /dev/null @@ -1,133 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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_ diff --git a/include/wx/stubs/setup.h b/include/wx/stubs/setup.h deleted file mode 100644 index 566b0d414d..0000000000 --- a/include/wx/stubs/setup.h +++ /dev/null @@ -1,170 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: setup.h -// Purpose: Configuration for the library -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_SETUP_H_ -#define _WX_SETUP_H_ - -/* - * General features - * - */ - -#define wxUSE_CONSTRAINTS 1 - // Use constraints mechanism -#define wxUSE_CONFIG 1 - // Use wxConfig, with CreateConfig in wxApp -#define _WX_GOODCOMPILER__ - // gcc can have problems, but Windows compilers - // are generally OK. -#define WXWIN_COMPATIBILITY 1 - // Compatibility with 1.66 API. - // Level 0: no backward compatibility, all new features - // Level 1: wxDC, OnSize (etc.) compatibility, but - // some new features such as event tables - -#define wxUSE_POSTSCRIPT 1 - // 0 for no PostScript device context -#define wxUSE_AFM_FOR_POSTSCRIPT 0 - // 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 -#define wxUSE_HELP 1 - // 0 for no help facility -#define wxUSE_RESOURCES 1 - // 0 for no wxGetResource/wxWriteResource -#define wxUSE_CLIPBOARD 1 - // 0 for no clipboard functions -#define wxUSE_SPLINES 1 - // 0 for no splines -#define wxUSE_XFIG_SPLINE_CODE 1 - // 1 for XFIG spline code, 0 for AIAI spline code. -// AIAI spline code is slower, but freer of copyright issues. - // 0 for no splines - -#define wxUSE_TOOLBAR 1 - // Use toolbars -#define wxUSE_DRAG_AND_DROP 1 - // 0 for no drag and drop - -#define wxUSE_WX_RESOURCES 1 - // Use .wxr resource mechanism (requires PrologIO library) - -#define wxUSE_DOC_VIEW_ARCHITECTURE 1 - // Set to 0 to disable document/view architecture -#define wxUSE_PRINTING_ARCHITECTURE 1 - // Set to 0 to disable print/preview architecture code -#define wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW 1 - // Set to 0 to disable PostScript print/preview architecture code - // under Windows (just use Windows printing). -#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 0 - // 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. - -#define REMOVE_UNUSED_ARG 1 - // Set this to 0 if your compiler can't cope - // with omission of prototype parameters. - -#define wxUSE_C_MAIN 0 - // Set to 1 to use main.c instead of main.cpp (UNIX only) - -#define wxUSE_ODBC 0 - // Define 1 to use ODBC classes - -#define wxODBC_FWD_ONLY_CURSORS 1 - // For backward compatibility reasons, this parameter now only - // controls the default scrolling method used by cursors. This - // default behavior can be overriden by setting the second param - // of wxDB::GetDbConnection() to indicate whether the connection - // (and any wxTable()s that use the connection) should support - // forward only scrolling of cursors, or both forward and backward - // Support for backward scrolling cursors is dependent on the - // data source as well as the ODBC driver being used. - -#define wxODBC_BACKWARD_COMPATABILITY 0 - // Default is 0. Set to 1 to use the deprecated classes, enum - // types, function, member variables. With a setting of 1, full - // backward compatability with the 2.0.x release is possible. - // It is STRONGLY recommended that this be set to 0, as - // future development will be done only on the non-deprecated - // functions/classes/member variables/etc. - -#define wxUSE_IOSTREAMH 1 - // VC++ 4.2 and above allows and - // but you can't mix them. Set to 1 for , - // 0 for - -#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_TIMEDATE 1 - // Use time and date -#define wxUSE_THREADS 0 - // Use threads - -#define wxUSE_ZLIB 1 - // Use zlib for compression in streams and PNG code -#define wxUSE_LIBPNG 1 - // Use PNG bitmap code -#define wxUSE_LIBPNG 0 - // Use JPEG bitmap code -#define wxUSE_LIBGIF 0 - // Use GIF bitmap code -#define wxUSE_STD_IOSTREAM 1 - // Use standard C++ streams if 1. If 0, use wxWin - // streams implementation. - -#define wxUSE_SERIAL 0 - // Use serialization - -#define wxUSE_TOOLTIPS 0 - // Use tooltips - -#define wxUSE_DYNLIB_CLASS 0 - // Use wxLibrary -#define wxUSE_SOCKETS 1 - // Set to 1 to use socket classes -/* - * 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 - -#endif - // _WX_SETUP_H_ diff --git a/include/wx/stubs/slider.h b/include/wx/stubs/slider.h deleted file mode 100644 index 239e914e5c..0000000000 --- a/include/wx/stubs/slider.h +++ /dev/null @@ -1,91 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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() -}; - -#endif - // _WX_SLIDER_H_ diff --git a/include/wx/stubs/spinbutt.h b/include/wx/stubs/spinbutt.h deleted file mode 100644 index afdb978c3f..0000000000 --- a/include/wx/stubs/spinbutt.h +++ /dev/null @@ -1,97 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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_ diff --git a/include/wx/stubs/statbmp.h b/include/wx/stubs/statbmp.h deleted file mode 100644 index f371fddd2d..0000000000 --- a/include/wx/stubs/statbmp.h +++ /dev/null @@ -1,64 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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; - -}; - -#endif - // _WX_STATBMP_H_ diff --git a/include/wx/stubs/statbox.h b/include/wx/stubs/statbox.h deleted file mode 100644 index 1aa4a6f88a..0000000000 --- a/include/wx/stubs/statbox.h +++ /dev/null @@ -1,57 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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() -}; - -#endif - // _WX_STATBOX_H_ diff --git a/include/wx/stubs/stattext.h b/include/wx/stubs/stattext.h deleted file mode 100644 index aa8eaf229e..0000000000 --- a/include/wx/stubs/stattext.h +++ /dev/null @@ -1,56 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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)) {}; -}; - -#endif - // _WX_STATTEXT_H_ diff --git a/include/wx/stubs/statusbr.h b/include/wx/stubs/statusbr.h deleted file mode 100644 index 28567b19e1..0000000000 --- a/include/wx/stubs/statusbr.h +++ /dev/null @@ -1,53 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// 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 diff --git a/include/wx/stubs/tabctrl.h b/include/wx/stubs/tabctrl.h deleted file mode 100644 index 80740019b4..0000000000 --- a/include/wx/stubs/tabctrl.h +++ /dev/null @@ -1,138 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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_ diff --git a/include/wx/stubs/taskbar.h b/include/wx/stubs/taskbar.h deleted file mode 100644 index 7f4a36b8b4..0000000000 --- a/include/wx/stubs/taskbar.h +++ /dev/null @@ -1,49 +0,0 @@ -///////////////////////////////////////////////////////////////////////// -// 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 -#include - -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_ diff --git a/include/wx/stubs/textctrl.h b/include/wx/stubs/textctrl.h deleted file mode 100644 index 09c11e063e..0000000000 --- a/include/wx/stubs/textctrl.h +++ /dev/null @@ -1,167 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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 -#else -#include -#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() -}; - -#endif - // _WX_TEXTCTRL_H_ diff --git a/include/wx/stubs/timer.h b/include/wx/stubs/timer.h deleted file mode 100644 index e668d30bec..0000000000 --- a/include/wx/stubs/timer.h +++ /dev/null @@ -1,53 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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. - */ - -#endif - // _WX_TIMER_H_ diff --git a/include/wx/stubs/toolbar.h b/include/wx/stubs/toolbar.h deleted file mode 100644 index e42c5827ef..0000000000 --- a/include/wx/stubs/toolbar.h +++ /dev/null @@ -1,77 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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 void Layout() {} - - // 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_ diff --git a/include/wx/stubs/treectrl.h b/include/wx/stubs/treectrl.h deleted file mode 100644 index 14fac525fc..0000000000 --- a/include/wx/stubs/treectrl.h +++ /dev/null @@ -1,282 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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 -*/ - -#ifndef __WXMAC_X__ -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&); -#endif - -#endif - // _WX_TREECTRL_H_ diff --git a/include/wx/stubs/wave.h b/include/wx/stubs/wave.h deleted file mode 100644 index e55bd5aa5f..0000000000 --- a/include/wx/stubs/wave.h +++ /dev/null @@ -1,44 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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_ diff --git a/include/wx/stubs/window.h b/include/wx/stubs/window.h deleted file mode 100644 index b94c1afe41..0000000000 --- a/include/wx/stubs/window.h +++ /dev/null @@ -1,584 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: window.h -// Purpose: wxWindow class -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_WINDOW_H_ -#define _WX_WINDOW_H_ - -#ifdef __GNUG__ -#pragma interface "window.h" -#endif - -#include "wx/gdicmn.h" -#include "wx/icon.h" -#include "wx/cursor.h" -#include "wx/pen.h" -#include "wx/font.h" -#include "wx/validate.h" -#include "wx/event.h" -#include "wx/string.h" -#include "wx/list.h" -#include "wx/region.h" -#include "wx/accel.h" -#include "wx/intl.h" - -#define wxKEY_SHIFT 1 -#define wxKEY_CTRL 2 - -/* - * Base class for frame, panel, canvas, panel items, dialog box. - * - */ - -/* - * Event handler: windows have themselves as their event handlers - * by default, but their event handlers could be set to another - * object entirely. This separation can reduce the amount of - * derivation required, and allow alteration of a window's functionality - * (e.g. by a resource editor that temporarily switches event handlers). - */ - -class WXDLLEXPORT wxWindow; -class WXDLLEXPORT wxEvent; -class WXDLLEXPORT wxCommandEvent; -class WXDLLEXPORT wxKeyEvent; -class WXDLLEXPORT wxControl; -class WXDLLEXPORT wxCursor; -class WXDLLEXPORT wxColourMap; -class WXDLLEXPORT wxFont; -class WXDLLEXPORT wxMenu; -class WXDLLEXPORT wxRect; -class WXDLLEXPORT wxBitmap; -class WXDLLEXPORT wxSizer; -class WXDLLEXPORT wxList; -class WXDLLEXPORT wxLayoutConstraints; -class WXDLLEXPORT wxMouseEvent; -class WXDLLEXPORT wxButton; -class WXDLLEXPORT wxColour; -class WXDLLEXPORT wxBrush; -class WXDLLEXPORT wxPen; -class WXDLLEXPORT wxIcon; -class WXDLLEXPORT wxDC; -class WXDLLEXPORT wxValidator; - -#if wxUSE_DRAG_AND_DROP -class WXDLLEXPORT wxDropTarget; -#endif - -#if wxUSE_WX_RESOURCES -class WXDLLEXPORT wxResourceTable; -class WXDLLEXPORT wxItemResource; -#endif - -WXDLLEXPORT_DATA(extern const char*) wxPanelNameStr; - -WXDLLEXPORT_DATA(extern const wxSize) wxDefaultSize; -WXDLLEXPORT_DATA(extern const wxPoint) wxDefaultPosition; - -//----------------------------------------------------------------------------- -// wxClientData -//----------------------------------------------------------------------------- - -class wxClientData -{ -public: - wxClientData() { } - virtual ~wxClientData() { } -}; - -//----------------------------------------------------------------------------- -// wxStringClientData -//----------------------------------------------------------------------------- - -class wxStringClientData: public wxClientData -{ -public: - wxStringClientData() { } - wxStringClientData( wxString &data ) { m_data = data; } - void SetData( wxString &data ) { m_data = data; } - wxString GetData() const { return m_data; } - -private: - wxString m_data; -}; - -class WXDLLEXPORT wxWindow: public wxEvtHandler -{ - DECLARE_ABSTRACT_CLASS(wxWindow) - - friend class wxDC; - friend class wxPaintDC; - -public: - wxWindow(); - inline wxWindow(wxWindow *parent, wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxPanelNameStr) - { - m_children = new wxList; - 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); - - // Fit the window around the items - virtual void Fit(); - - // Show or hide the window - virtual bool Show(bool show); - - // Is the window shown? - virtual bool IsShown() const; - - // Raise the window to the top of the Z order - virtual void Raise(); - - // Lower the window to the bottom of the Z order - virtual void Lower(); - - // Is the window enabled? - virtual bool IsEnabled() const; - - // For compatibility - inline bool Enabled() const { return IsEnabled(); } - - // Dialog support: override these and call - // base class members to add functionality - // that can't be done using validators. - - // Transfer values to controls. If returns FALSE, - // it's an application error (pops up a dialog) - virtual bool TransferDataToWindow(); - - // Transfer values from controls. If returns FALSE, - // transfer failed: don't quit - virtual bool TransferDataFromWindow(); - - // Validate controls. If returns FALSE, - // validation failed: don't quit - virtual bool Validate(); - - // Return code for dialogs - inline void SetReturnCode(int retCode); - inline int GetReturnCode(); - - // Set the cursor - virtual void SetCursor(const wxCursor& cursor); - inline virtual wxCursor *GetCursor() const { return (wxCursor *)& m_windowCursor; }; - - // Get the window with the focus - static wxWindow *FindFocus(); - - // Get character size - virtual int GetCharHeight() const; - virtual int GetCharWidth() const; - - // Get overall window size - virtual void GetSize(int *width, int *height) const; - - // Get window position, relative to parent (or screen if no parent) - virtual void GetPosition(int *x, int *y) const; - - // Get client (application-useable) size - virtual void GetClientSize(int *width, int *height) const; - - // Set overall size and position - virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); - inline virtual void SetSize(int width, int height) { SetSize(-1, -1, width, height, wxSIZE_USE_EXISTING); } - inline virtual void Move(int x, int y) { SetSize(x, y, -1, -1, wxSIZE_USE_EXISTING); } - - // Set client size - virtual void SetClientSize(int width, int size); - - // Convert client to screen coordinates - virtual void ClientToScreen(int *x, int *y) const; - - // Convert screen to client coordinates - virtual void ScreenToClient(int *x, int *y) const; - - // Set the focus to this window - virtual void SetFocus(); - - // Capture/release mouse - virtual void CaptureMouse(); - virtual void ReleaseMouse(); - - // Enable or disable the window - virtual void Enable(bool enable); - -#if wxUSE_DRAG_AND_DROP - // Associate a drop target with this window (if the window already had a drop - // target, it's deleted!) and return the current drop target (may be NULL). - void SetDropTarget(wxDropTarget *pDropTarget); - wxDropTarget *GetDropTarget() const { return m_pDropTarget; } -#endif - - // Accept files for dragging - virtual void DragAcceptFiles(bool accept); - - // tooltips - // create a tooltip with this text - void SetToolTip(const wxString& tip); - - // TODO -#if 0 - // pointer may be NULL to remove the tooltip - void SetToolTip(wxToolTip *tooltip); - // get the current tooltip (may return NULL if none) - wxToolTip* GetToolTip() const { return m_tooltip; } -#endif - - // Update region access - virtual wxRegion GetUpdateRegion() const; - virtual bool IsExposed(int x, int y, int w, int h) const; - virtual bool IsExposed(const wxPoint& pt) const; - virtual bool IsExposed(const wxRect& rect) const; - - // Set/get the window title - virtual inline void SetTitle(const wxString& WXUNUSED(title)) {}; - inline virtual wxString GetTitle() const { return wxString(""); }; - // Most windows have the concept of a label; for frames, this is the - // title; for items, this is the label or button text. - inline virtual wxString GetLabel() const { return GetTitle(); } - - // Set/get the window name (used for resource setting in X) - inline virtual wxString GetName() const; - inline virtual void SetName(const wxString& name); - - // Centre the window - virtual void Centre(int direction) ; - inline void Center(int direction = wxHORIZONTAL) { Centre(direction); } - - // Popup a menu - virtual bool PopupMenu(wxMenu *menu, int x, int y); - - // Send the window a refresh event - virtual void Refresh(bool eraseBack = TRUE, const wxRect *rect = NULL); - - // New functions that will replace the above. - virtual void SetScrollbar(int orient, int pos, int thumbVisible, - int range, bool refresh = TRUE); - - virtual void SetScrollPos(int orient, int pos, bool refresh = TRUE); - virtual int GetScrollPos(int orient) const; - virtual int GetScrollRange(int orient) const; - virtual int GetScrollThumb(int orient) const; - - virtual void ScrollWindow(int dx, int dy, const wxRect *rect = NULL); - - // Caret manipulation - virtual void CreateCaret(int w, int h); - virtual void CreateCaret(const wxBitmap *bitmap); - virtual void DestroyCaret(); - virtual void ShowCaret(bool show); - virtual void SetCaretPos(int x, int y); - virtual void GetCaretPos(int *x, int *y) const; - - // Tell window how much it can be sized - virtual void SetSizeHints(int minW = -1, int minH = -1, int maxW = -1, int maxH = -1, int incW = -1, int incH = -1); - - // Set/get the window's identifier - inline int GetId() const; - inline void SetId(int id); - - virtual void SetAcceleratorTable(const wxAcceleratorTable& accel); - inline virtual wxAcceleratorTable& GetAcceleratorTable() const { return (wxAcceleratorTable&) m_acceleratorTable; } - - // Make the window modal (all other windows unresponsive) - virtual void MakeModal(bool modal); - - // Get the private handle (platform-dependent) - inline void *GetHandle() const; - - // Set/get the window's relatives - inline wxWindow *GetParent() const; - inline void SetParent(wxWindow *p) ; - inline wxWindow *GetGrandParent() const; - inline wxList& GetChildren() const; - - // Set/get the window's font - virtual void SetFont(const wxFont& f); - inline virtual wxFont& GetFont() const; - - // Set/get the window's validator - void SetValidator(const wxValidator& validator); - inline wxValidator *GetValidator() const; - - // Set/get the window's style - inline void SetWindowStyleFlag(long flag); - inline long GetWindowStyleFlag() const; - - // Handle a control command - virtual void OnCommand(wxWindow& win, wxCommandEvent& event); - - // Set/get event handler - inline void SetEventHandler(wxEvtHandler *handler); - inline wxEvtHandler *GetEventHandler() const; - - // Push/pop event handler (i.e. allow a chain of event handlers - // be searched) - void PushEventHandler(wxEvtHandler *handler) ; - wxEvtHandler *PopEventHandler(bool deleteHandler = FALSE) ; - - // Close the window by calling OnClose, posting a deletion - virtual bool Close(bool force = FALSE); - - // Destroy the window (delayed, if a managed window) - virtual bool Destroy() ; - - // Mode for telling default OnSize members to - // call Layout(), if not using Sizers, just top-down constraints - inline void SetAutoLayout(bool a); - inline bool GetAutoLayout() const; - - // Set/get constraints - inline wxLayoutConstraints *GetConstraints() const; - void SetConstraints(wxLayoutConstraints *c); - - // Set/get window background colour - inline virtual void SetBackgroundColour(const wxColour& col); - inline virtual wxColour GetBackgroundColour() const; - - // Set/get window foreground colour - inline virtual void SetForegroundColour(const wxColour& col); - inline virtual wxColour GetForegroundColour() const; - - // Get the default button, if there is one - inline virtual wxButton *GetDefaultItem() const; - inline virtual void SetDefaultItem(wxButton *but); - - // Override to define new behaviour for default action (e.g. double clicking - // on a listbox) - virtual void OnDefaultAction(wxControl *initiatingItem); - - // Resource loading -#if wxUSE_WX_RESOURCES - virtual bool LoadFromResource(wxWindow *parent, const wxString& resourceName, const wxResourceTable *table = NULL); - virtual wxControl *CreateItem(const wxItemResource* childResource, const wxItemResource* parentResource, - const wxResourceTable *table = (const wxResourceTable *) NULL); -#endif - - virtual void GetTextExtent(const wxString& string, int *x, int *y, - int *descent = NULL, - int *externalLeading = NULL, - const wxFont *theFont = NULL, bool use16 = FALSE) const; - - // Is the window retained? - inline bool IsRetained() const; - - // Warp the pointer the given position - virtual void WarpPointer(int x_pos, int y_pos) ; - - // Clear the window - virtual void Clear(); - - // Find a window by id or name - virtual wxWindow *FindWindow(long id); - virtual wxWindow *FindWindow(const wxString& name); - - // Constraint operations - bool Layout(); - void SetSizer(wxSizer *sizer); // Adds sizer child to this window - inline wxSizer *GetSizer() const ; - inline wxWindow *GetSizerParent() const ; - inline void SetSizerParent(wxWindow *win); - - // Do Update UI processing for controls - void UpdateWindowUI(); - - void OnEraseBackground(wxEraseEvent& event); - void OnChar(wxKeyEvent& event); - void OnKeyDown(wxKeyEvent& event); - void OnKeyUp(wxKeyEvent& event); - void OnPaint(wxPaintEvent& event); - void OnIdle(wxIdleEvent& event); - - // Does this window want to accept keyboard focus? - virtual bool AcceptsFocus() const; - - virtual void PrepareDC( wxDC &dc ) {}; - - -public: - //////////////////////////////////////////////////////////////////////// - //// IMPLEMENTATION - - // 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); - - // Executes the default message - virtual long Default(); - -/* TODO: you may need something like this - // Determine whether 3D effects are wanted - virtual WXDWORD Determine3DEffects(WXDWORD defaultBorderStyle, bool *want3D); -*/ - - virtual void AddChild(wxWindow *child); // Adds reference to the child object - virtual void RemoveChild(wxWindow *child); // Removes reference to child - // (but doesn't delete the child object) - virtual void DestroyChildren(); // Removes and destroys all children - - inline bool IsBeingDeleted() const { return FALSE; } // TODO: Should probably eliminate this - - // Constraint implementation - void UnsetConstraints(wxLayoutConstraints *c); - inline wxList *GetConstraintsInvolvedIn() const ; - // Back-pointer to other windows we're involved with, so if we delete - // this window, we must delete any constraints we're involved with. - void AddConstraintReference(wxWindow *otherWin); - void RemoveConstraintReference(wxWindow *otherWin); - void DeleteRelatedConstraints(); - - virtual void ResetConstraints(); - virtual void SetConstraintSizes(bool recurse = TRUE); - virtual bool LayoutPhase1(int *noChanges); - virtual bool LayoutPhase2(int *noChanges); - virtual bool DoPhase(int); - // Transforms from sizer coordinate space to actual - // parent coordinate space - virtual void TransformSizerToActual(int *x, int *y) const ; - - // Set size with transformation to actual coordinates if nec. - virtual void SizerSetSize(int x, int y, int w, int h); - virtual void SizerMove(int x, int y); - - // Only set/get the size/position of the constraint (if any) - virtual void SetSizeConstraint(int x, int y, int w, int h); - virtual void MoveConstraint(int x, int y); - virtual void GetSizeConstraint(int *w, int *h) const ; - virtual void GetClientSizeConstraint(int *w, int *h) const ; - virtual void GetPositionConstraint(int *x, int *y) const ; - - // Dialog units translations. Implemented in wincmn.cpp. - wxPoint ConvertPixelsToDialog(const wxPoint& pt) ; - wxPoint ConvertDialogToPixels(const wxPoint& pt) ; - inline wxSize ConvertPixelsToDialog(const wxSize& sz) - { wxPoint pt(ConvertPixelsToDialog(wxPoint(sz.x, sz.y))); return wxSize(pt.x, pt.y); } - inline wxSize ConvertDialogToPixels(const wxSize& sz) - { wxPoint pt(ConvertDialogToPixels(wxPoint(sz.x, sz.y))); return wxSize(pt.x, pt.y); } - - wxObject *GetChild(int number) const ; - - // Generates a new id for controls - static int NewControlId(); - - // Responds to colour changes: passes event on to children. - void OnSysColourChanged(wxSysColourChangedEvent& event); - - // Transfers data to any child controls - void OnInitDialog(wxInitDialogEvent& event); - - // Sends an OnInitDialog event, which in turns transfers data to - // to the window via validators. - virtual void InitDialog(); - - //////////////////////////////////////////////////////////////////////// - //// PROTECTED DATA -protected: - int m_windowId; - long m_windowStyle; // Store the window's style - wxEvtHandler * m_windowEventHandler; // Usually is 'this' - wxLayoutConstraints * m_constraints; // Constraints for this window - wxList * m_constraintsInvolvedIn; // List of constraints we're involved in - wxSizer * m_windowSizer; // Window's top-level sizer (if any) - wxWindow * m_sizerParent; // Window's parent sizer (if any) - bool m_autoLayout; // Whether to call Layout() in OnSize - wxWindow * m_windowParent; // Each window always knows its parent - wxValidator * m_windowValidator; - int m_minSizeX; - int m_minSizeY; - int m_maxSizeX; - int m_maxSizeY; - - // Caret data - int m_caretWidth; - int m_caretHeight; - bool m_caretEnabled; - bool m_caretShown; - wxFont m_windowFont; // Window's font - wxCursor m_windowCursor; // Window's cursor - wxString m_windowName; // Window name - - wxButton * m_defaultItem; - - wxColour m_backgroundColour ; - wxColour m_foregroundColour ; - wxAcceleratorTable m_acceleratorTable; - -#if wxUSE_DRAG_AND_DROP - wxDropTarget *m_pDropTarget; // the current drop target or NULL -#endif //USE_DRAG_AND_DROP - -public: - wxRegion m_updateRegion; - wxList * m_children; // Window's children - int m_returnCode; - -DECLARE_EVENT_TABLE() -}; - -//////////////////////////////////////////////////////////////////////// -//// INLINES - -inline void *wxWindow::GetHandle() const { return (void *)NULL; } -inline int wxWindow::GetId() const { return m_windowId; } -inline void wxWindow::SetId(int id) { m_windowId = id; } -inline wxWindow *wxWindow::GetParent() const { return m_windowParent; } -inline void wxWindow::SetParent(wxWindow *p) { m_windowParent = p; } -inline wxWindow *wxWindow::GetGrandParent() const { return (m_windowParent ? m_windowParent->m_windowParent : (wxWindow*) NULL); } -inline wxList& wxWindow::GetChildren() const { return (wxList&) * m_children; } -inline wxFont& wxWindow::GetFont() const { return (wxFont&) m_windowFont; } -inline wxString wxWindow::GetName() const { return m_windowName; } -inline void wxWindow::SetName(const wxString& name) { m_windowName = name; } -inline long wxWindow::GetWindowStyleFlag() const { return m_windowStyle; } -inline void wxWindow::SetWindowStyleFlag(long flag) { m_windowStyle = flag; } -inline void wxWindow::SetEventHandler(wxEvtHandler *handler) { m_windowEventHandler = handler; } -inline wxEvtHandler *wxWindow::GetEventHandler() const { return m_windowEventHandler; } -inline void wxWindow::SetAutoLayout(bool a) { m_autoLayout = a; } -inline bool wxWindow::GetAutoLayout() const { return m_autoLayout; } -inline wxLayoutConstraints *wxWindow::GetConstraints() const { return m_constraints; } -inline void wxWindow::SetBackgroundColour(const wxColour& col) { m_backgroundColour = col; }; -inline wxColour wxWindow::GetBackgroundColour() const { return m_backgroundColour; }; -inline void wxWindow::SetForegroundColour(const wxColour& col) { m_foregroundColour = col; }; -inline wxColour wxWindow::GetForegroundColour() const { return m_foregroundColour; }; - -inline wxButton *wxWindow::GetDefaultItem() const { return m_defaultItem; } -inline void wxWindow::SetDefaultItem(wxButton *but) { m_defaultItem = but; } -inline bool wxWindow::IsRetained() const { return ((m_windowStyle & wxRETAINED) == wxRETAINED); } - -inline wxList *wxWindow::GetConstraintsInvolvedIn() const { return m_constraintsInvolvedIn; } -inline wxSizer *wxWindow::GetSizer() const { return m_windowSizer; } -inline wxWindow *wxWindow::GetSizerParent() const { return m_sizerParent; } -inline void wxWindow::SetSizerParent(wxWindow *win) { m_sizerParent = win; } -inline wxValidator *wxWindow::GetValidator() const { return m_windowValidator; } -inline void wxWindow::SetReturnCode(int retCode) { m_returnCode = retCode; } -inline int wxWindow::GetReturnCode() { return m_returnCode; } - -// Get the active window. -wxWindow* WXDLLEXPORT wxGetActiveWindow(); - -WXDLLEXPORT_DATA(extern wxList) wxTopLevelWindows; - -#endif - // _WX_WINDOW_H_ diff --git a/src/qt/app.cpp b/src/qt/app.cpp deleted file mode 100644 index 0294c58bc4..0000000000 --- a/src/qt/app.cpp +++ /dev/null @@ -1,393 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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" - -#if wxUSE_WX_RESOURCES -#include "wx/resource.h" -#endif - -#include - -#if defined(__WIN95__) && !defined(__GNUWIN32__) -extern char *wxBuffer; -extern wxList wxPendingDelete; - -wxApp *wxTheApp = NULL; - -IMPLEMENT_DYNAMIC_CLASS(wxApp, wxEvtHandler) -BEGIN_EVENT_TABLE(wxApp, wxEvtHandler) - EVT_IDLE(wxApp::OnIdle) -END_EVENT_TABLE() - -long wxApp::sm_lastMessageTime = 0; - -void wxApp::CommonInit() -{ -#ifdef __WXMSW__ - wxBuffer = new char[1500]; -#else - wxBuffer = new char[BUFSIZ + 512]; -#endif - - wxClassInfo::InitializeClasses(); - - wxTheColourDatabase = new wxColourDatabase(wxKEY_STRING); - wxTheColourDatabase->Initialize(); - wxInitializeStockObjects(); - -#if wxUSE_WX_RESOURCES - wxInitializeResourceSystem(); -#endif - - // For PostScript printing -#if wxUSE_POSTSCRIPT - wxInitializePrintSetupData(); - wxThePrintPaperDatabase = new wxPrintPaperDatabase; - wxThePrintPaperDatabase->CreateDatabase(); -#endif - - wxBitmap::InitStandardHandlers(); - - wxModule::RegisterModules(); - wxASSERT( wxModule::InitializeModules() == TRUE ); -} - -void wxApp::CommonCleanUp() -{ - 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; - -#if wxUSE_POSTSCRIPT - wxInitializePrintSetupData(FALSE); - delete wxThePrintPaperDatabase; - wxThePrintPaperDatabase = NULL; -#endif - - wxBitmap::CleanUpHandlers(); - - delete[] wxBuffer; - wxBuffer = NULL; - - // do it as the very last thing because everything else can log messages - delete wxLog::SetActiveTarget(NULL); -} - -int wxEntry( int argc, char *argv[] ) -{ - wxClassInfo::InitializeClasses(); - -#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT - -#if !defined(_WINDLL) - streambuf* sBuf = new wxDebugStreamBuf; -#else - streambuf* sBuf = NULL; -#endif - ostream* oStr = new ostream(sBuf) ; - wxDebugContext::SetStream(oStr, sBuf); - -#endif - - if (!wxTheApp) - { - if (!wxApp::GetInitializerFunction()) - { - printf( "wxWindows error: No initializer - use IMPLEMENT_APP macro.\n" ); - return 0; - }; - - wxTheApp = (* wxApp::GetInitializerFunction()) (); - }; - - if (!wxTheApp) - { - printf( "wxWindows error: wxTheApp == NULL\n" ); - return 0; - }; - - wxTheApp->argc = argc; - wxTheApp->argv = argv; - - // TODO: your platform-specific initialization. - - wxApp::CommonInit(); - - // 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; - - wxTheApp->m_initialized = (wxTopLevelWindows.Number() > 0); - - int retValue = 0; - - if (wxTheApp->Initialized()) retValue = wxTheApp->OnRun(); - - wxTheApp->DeletePendingObjects(); - - wxTheApp->OnExit(); - - wxApp::CommonCleanUp(); - -#if (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 - - 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::CommonCleanUp(); -/* - * 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; -} - diff --git a/src/qt/bdiag.xbm b/src/qt/bdiag.xbm deleted file mode 100644 index 9ff0a1822f..0000000000 --- a/src/qt/bdiag.xbm +++ /dev/null @@ -1,6 +0,0 @@ -#define bdiag_width 16 -#define bdiag_height 16 -static char bdiag_bits[] = { - 0x80, 0x80, 0x40, 0x40, 0x20, 0x20, 0x10, 0x10, 0x08, 0x08, 0x04, 0x04, - 0x02, 0x02, 0x01, 0x01, 0x80, 0x80, 0x40, 0x40, 0x20, 0x20, 0x10, 0x10, - 0x08, 0x08, 0x04, 0x04, 0x02, 0x02, 0x01, 0x01}; diff --git a/src/qt/bitmap.cpp b/src/qt/bitmap.cpp deleted file mode 100644 index d6f9fa87e3..0000000000 --- a/src/qt/bitmap.cpp +++ /dev/null @@ -1,428 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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" - -IMPLEMENT_DYNAMIC_CLASS(wxBitmap, wxGDIObject) -IMPLEMENT_DYNAMIC_CLASS(wxMask, wxObject) - -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); -*/ -} diff --git a/src/qt/bmpbuttn.cpp b/src/qt/bmpbuttn.cpp deleted file mode 100644 index 03c4ceeb63..0000000000 --- a/src/qt/bmpbuttn.cpp +++ /dev/null @@ -1,63 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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" - -IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton, wxButton) - -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->GetDefaultBackgroundColour() ; - m_foregroundColour = parent->GetDefaultForegroundColour() ; - 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; -} - diff --git a/src/qt/brush.cpp b/src/qt/brush.cpp deleted file mode 100644 index 587080575b..0000000000 --- a/src/qt/brush.cpp +++ /dev/null @@ -1,160 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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" - -IMPLEMENT_DYNAMIC_CLASS(wxBrush, wxGDIObject) - -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 wxString& col, int Style) -{ - m_refData = new wxBrushRefData; - - // Implicit conversion from string to wxColour via colour database - 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(const wxString& col) -{ - Unshare(); - - M_BRUSHDATA->m_colour = col; - - RealizeResource(); -} - -void wxBrush::SetColour(const unsigned char r, const unsigned char g, const 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(); -} - -void wxBrush::RealizeResource() -{ -// TODO: create the brush -} - diff --git a/src/qt/button.cpp b/src/qt/button.cpp deleted file mode 100644 index 2928e0d96f..0000000000 --- a/src/qt/button.cpp +++ /dev/null @@ -1,73 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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" - -IMPLEMENT_DYNAMIC_CLASS(wxButton, wxControl) - -// 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); -} - diff --git a/src/qt/cdiag.xbm b/src/qt/cdiag.xbm deleted file mode 100644 index 15dc7ba86d..0000000000 --- a/src/qt/cdiag.xbm +++ /dev/null @@ -1,6 +0,0 @@ -#define cdiag_width 16 -#define cdiag_height 16 -static char cdiag_bits[] = { - 0x81, 0x81, 0x42, 0x42, 0x24, 0x24, 0x18, 0x18, 0x18, 0x18, 0x24, 0x24, - 0x42, 0x42, 0x81, 0x81, 0x81, 0x81, 0x42, 0x42, 0x24, 0x24, 0x18, 0x18, - 0x18, 0x18, 0x24, 0x24, 0x42, 0x42, 0x81, 0x81}; diff --git a/src/qt/checkbox.cpp b/src/qt/checkbox.cpp deleted file mode 100644 index f7b1c6ad10..0000000000 --- a/src/qt/checkbox.cpp +++ /dev/null @@ -1,115 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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" - -IMPLEMENT_DYNAMIC_CLASS(wxCheckBox, wxControl) -IMPLEMENT_DYNAMIC_CLASS(wxBitmapCheckBox, wxCheckBox) - -// 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; -} - - diff --git a/src/qt/choice.cpp b/src/qt/choice.cpp deleted file mode 100644 index c6a1d250e2..0000000000 --- a/src/qt/choice.cpp +++ /dev/null @@ -1,117 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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" - -IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl) - -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); -} - diff --git a/src/qt/colour.cpp b/src/qt/colour.cpp deleted file mode 100644 index 4ccd4afc15..0000000000 --- a/src/qt/colour.cpp +++ /dev/null @@ -1,124 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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" - -IMPLEMENT_DYNAMIC_CLASS(wxColour, wxObject) - -// 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; -} - -wxColour::wxColour (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 () -{ -} - -wxColour& wxColour::operator = (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); -*/ - return (*this); -} - -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); -*/ -} diff --git a/src/qt/combobox.cpp b/src/qt/combobox.cpp deleted file mode 100644 index 788a456b7f..0000000000 --- a/src/qt/combobox.cpp +++ /dev/null @@ -1,114 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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" - -IMPLEMENT_DYNAMIC_CLASS(wxComboBox, wxControl) - -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 -} - diff --git a/src/qt/control.cpp b/src/qt/control.cpp deleted file mode 100644 index 4786140bef..0000000000 --- a/src/qt/control.cpp +++ /dev/null @@ -1,109 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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" - -IMPLEMENT_ABSTRACT_CLASS(wxControl, wxWindow) - -BEGIN_EVENT_TABLE(wxControl, wxWindow) -END_EVENT_TABLE() - -// 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() == this) - parent->SetDefaultItem(NULL); - } -} - -void wxControl::SetLabel(const wxString& label) -{ - // TODO -} - -wxString wxControl::GetLabel() const -{ - // TODO - return wxString(""); -} - -/* - * Allocates control IDs within the appropriate range - */ - -int NewControlId() -{ - static int s_controlId = 0; - s_controlId ++; - return s_controlId; -} - -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::SetClientSize (int width, int height) -{ - SetSize (-1, -1, width, height); -} - -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); -} - diff --git a/src/qt/cross.xbm b/src/qt/cross.xbm deleted file mode 100644 index b07cbe7fcd..0000000000 --- a/src/qt/cross.xbm +++ /dev/null @@ -1,6 +0,0 @@ -#define cross_width 15 -#define cross_height 15 -static char cross_bits[] = { - 0x84, 0x10, 0x84, 0x10, 0xff, 0x7f, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, - 0x84, 0x10, 0xff, 0x7f, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, - 0xff, 0x7f, 0x84, 0x10, 0x84, 0x10}; diff --git a/src/qt/cursor.cpp b/src/qt/cursor.cpp deleted file mode 100644 index 29b7d5c996..0000000000 --- a/src/qt/cursor.cpp +++ /dev/null @@ -1,184 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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" - -IMPLEMENT_DYNAMIC_CLASS(wxCursor, wxBitmap) - -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 wxIconRefData; - - // TODO: create cursor from a file -} - -// Cursors by stock number -wxCursor::wxCursor(int cursor_type) -{ - m_refData = new wxIconRefData; - -/* 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) -} - - diff --git a/src/qt/data.cpp b/src/qt/data.cpp deleted file mode 100644 index 6748ee636f..0000000000 --- a/src/qt/data.cpp +++ /dev/null @@ -1,145 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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" - -#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_POSTSCRIPT -wxPrintPaperDatabase* wxThePrintPaperDatabase = NULL; -#endif - -///// 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 } }; - -const wxSize wxDefaultSize(-1, -1); -const wxPoint wxDefaultPosition(-1, -1); diff --git a/src/qt/dc.cpp b/src/qt/dc.cpp deleted file mode 100644 index a4cb431cf9..0000000000 --- a/src/qt/dc.cpp +++ /dev/null @@ -1,390 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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" - -IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject) - -//----------------------------------------------------------------------------- -// 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 -//----------------------------------------------------------------------------- - -IMPLEMENT_ABSTRACT_CLASS(wxDC,wxObject) - -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( wxList *points ) -{ - DrawOpenSpline( points ); -}; - -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); - } -}; - diff --git a/src/qt/dcclient.cpp b/src/qt/dcclient.cpp deleted file mode 100644 index 081a7d57f5..0000000000 --- a/src/qt/dcclient.cpp +++ /dev/null @@ -1,618 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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 - -//----------------------------------------------------------------------------- -// constants -//----------------------------------------------------------------------------- - -#define RAD2DEG 57.2957795131 - -//----------------------------------------------------------------------------- -// wxPaintDC -//----------------------------------------------------------------------------- - -//IMPLEMENT_DYNAMIC_CLASS(wxClientDC, wxDC) -//IMPLEMENT_DYNAMIC_CLASS(wxWindowDC, wxDC) -IMPLEMENT_DYNAMIC_CLASS(wxPaintDC, wxDC) - - -wxPaintDC::wxPaintDC(void) -{ -}; - -wxPaintDC::wxPaintDC( wxWindow *window ) -{ -}; - -wxPaintDC::~wxPaintDC(void) -{ -}; - -void wxPaintDC::FloodFill( long WXUNUSED(x1), long WXUNUSED(y1), - wxColour *WXUNUSED(col), int WXUNUSED(style) ) -{ -}; - -bool wxPaintDC::GetPixel( long WXUNUSED(x1), long WXUNUSED(y1), wxColour *WXUNUSED(col) ) const -{ - return FALSE; -}; - -void wxPaintDC::DrawLine( long x1, long y1, long x2, long y2 ) -{ - if (!Ok()) return; - -}; - -void wxPaintDC::CrossHair( long x, long y ) -{ - if (!Ok()) return; - -}; - -void wxPaintDC::DrawArc( long x1, long y1, long x2, long y2, double xc, double 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 wxPaintDC::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 wxPaintDC::DrawPoint( long x, long y ) -{ - if (!Ok()) return; - - if (m_pen.GetStyle() != wxTRANSPARENT) {}; -}; - -void wxPaintDC::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 wxPaintDC::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 wxPaintDC::DrawPolygon( int WXUNUSED(n), wxPoint WXUNUSED(points)[], - long WXUNUSED(xoffset), long WXUNUSED(yoffset), int WXUNUSED(fillStyle) ) -{ - if (!Ok()) return; -}; - -void wxPaintDC::DrawPolygon( wxList *WXUNUSED(lines), long WXUNUSED(xoffset), - long WXUNUSED(yoffset), int WXUNUSED(fillStyle) ) -{ - if (!Ok()) return; -}; - -void wxPaintDC::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 wxPaintDC::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 wxPaintDC::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 wxPaintDC::CanDrawBitmap(void) const -{ - return TRUE; -}; - -void wxPaintDC::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 wxPaintDC::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 wxPaintDC::DrawText( const wxString &text, long x, long y, bool -WXUNUSED(use16) ) -{ - if (!Ok()) return; - -}; - - - -bool wxPaintDC::CanGetTextExtent(void) const -{ - return TRUE; -}; - -void wxPaintDC::GetTextExtent( const wxString &string, long *width, long *height, - long *WXUNUSED(descent), long *WXUNUSED(externalLeading), - wxFont *WXUNUSED(theFont), bool WXUNUSED(use16) ) -{ - if (!Ok()) return; - -}; - -long wxPaintDC::GetCharWidth(void) -{ - if (!Ok()) return 0; - -}; - -long wxPaintDC::GetCharHeight(void) -{ - if (!Ok()) return 0; - -}; - -void wxPaintDC::Clear(void) -{ - if (!Ok()) return; - -}; - -void wxPaintDC::SetFont( const wxFont &font ) -{ - if (!Ok()) return; - - m_font = font; -}; - -void wxPaintDC::SetPen( const wxPen &pen ) -{ - if (!Ok()) return; - - if (m_pen == pen) return; - - m_pen = pen; - - if (!m_pen.Ok()) return; -}; - -void wxPaintDC::SetBrush( const wxBrush &brush ) -{ - if (!Ok()) return; - - if (m_brush == brush) return; - - m_brush = brush; - - if (!m_brush.Ok()) return; - -}; - -void wxPaintDC::SetBackground( const wxBrush &brush ) -{ - if (!Ok()) return; - - if (m_backgroundBrush == brush) return; - - m_backgroundBrush = brush; - - if (!m_backgroundBrush.Ok()) return; - -}; - -void wxPaintDC::SetLogicalFunction( int function ) -{ - if (m_logicalFunction == function) return; -}; - -void wxPaintDC::SetTextForeground( const wxColour &col ) -{ - if (!Ok()) return; - - if (m_textForegroundColour == col) return; - - m_textForegroundColour = col; - if (!m_textForegroundColour.Ok()) return; -}; - -void wxPaintDC::SetTextBackground( const wxColour &col ) -{ - if (!Ok()) return; - - if (m_textBackgroundColour == col) return; - - m_textBackgroundColour = col; - if (!m_textBackgroundColour.Ok()) return; -}; - -void wxPaintDC::SetBackgroundMode( int mode ) -{ - m_backgroundMode = mode; - - if (m_brush.GetStyle() != wxSOLID && m_brush.GetStyle() != wxTRANSPARENT) - { - } -}; - -void wxPaintDC::SetPalette( const wxPalette& WXUNUSED(palette) ) -{ -}; - -void wxPaintDC::SetClippingRegion( long x, long y, long width, long height ) -{ - wxDC::SetClippingRegion( x, y, width, height ); - -}; - -void wxPaintDC::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 wxPaintDC::DrawOpenSpline( 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 ); -}; diff --git a/src/qt/dcmemory.cpp b/src/qt/dcmemory.cpp deleted file mode 100644 index 91552f1c58..0000000000 --- a/src/qt/dcmemory.cpp +++ /dev/null @@ -1,66 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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" - -IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC, wxDC) - -//----------------------------------------------------------------------------- -// 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; - }; -}; - - diff --git a/src/qt/dcscreen.cpp b/src/qt/dcscreen.cpp deleted file mode 100644 index cea4a7c792..0000000000 --- a/src/qt/dcscreen.cpp +++ /dev/null @@ -1,30 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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" - -IMPLEMENT_DYNAMIC_CLASS(wxScreenDC, wxPaintDC) - -// Create a DC representing the whole screen -wxScreenDC::wxScreenDC() -{ - // TODO -} - -wxScreenDC::~wxScreenDC() -{ - // TODO -} - diff --git a/src/qt/dialog.cpp b/src/qt/dialog.cpp deleted file mode 100644 index d49b4cf98c..0000000000 --- a/src/qt/dialog.cpp +++ /dev/null @@ -1,291 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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; - -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() - - -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 (GetHWND()) - { - 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; - wxFrame *frame ; - if (direction & wxCENTER_FRAME) - { - frame = (wxFrame*)GetParent() ; - if (frame) - { - frame->GetPosition(&x_offset,&y_offset) ; - frame->GetSize(&display_width,&display_height) ; - } - } - else - frame = NULL ; - - if (frame==NULL) - { - 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(); -} - diff --git a/src/qt/dnd.cpp b/src/qt/dnd.cpp deleted file mode 100644 index ec82cb6dc1..0000000000 --- a/src/qt/dnd.cpp +++ /dev/null @@ -1,133 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// 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) -{ -}; - -wxDropSource::DragResult wxDropSource::DoDragDrop( bool WXUNUSED(bAllowMove) ) -{ - // TODO - return Error; -}; - diff --git a/src/qt/fdiag.xbm b/src/qt/fdiag.xbm deleted file mode 100644 index 67d3b4732a..0000000000 --- a/src/qt/fdiag.xbm +++ /dev/null @@ -1,6 +0,0 @@ -#define fdiag_width 16 -#define fdiag_height 16 -static char fdiag_bits[] = { - 0x01, 0x01, 0x02, 0x02, 0x04, 0x04, 0x08, 0x08, 0x10, 0x10, 0x20, 0x20, - 0x40, 0x40, 0x80, 0x80, 0x01, 0x01, 0x02, 0x02, 0x04, 0x04, 0x08, 0x08, - 0x10, 0x10, 0x20, 0x20, 0x40, 0x40, 0x80, 0x80}; diff --git a/src/qt/filedlg.cpp b/src/qt/filedlg.cpp deleted file mode 100644 index 57ff74897b..0000000000 --- a/src/qt/filedlg.cpp +++ /dev/null @@ -1,140 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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" - -IMPLEMENT_CLASS(wxFileDialog, wxDialog) - -char *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 ) - { - strcpy(wxBuffer, (const char *)fileDialog.GetPath()); - return wxBuffer; - } - else - return NULL; -} - -char *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(); - strcpy(wxBuffer, (const char *)fileDialog.GetPath()); - return wxBuffer; - } - else - return NULL; -} - -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 - wxID_CANCEL; -} - -// Generic file load/save dialog -static char * -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 -char * -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 -char * -wxSaveFileSelector(const char *what, const char *extension, const char *default_name, wxWindow *parent) -{ - return wxDefaultFileSelector(FALSE, what, extension, default_name, parent); -} - - diff --git a/src/qt/font.cpp b/src/qt/font.cpp deleted file mode 100644 index a47c8e43ec..0000000000 --- a/src/qt/font.cpp +++ /dev/null @@ -1,239 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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/font.h" - -IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject) - -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; -} - diff --git a/src/qt/frame.cpp b/src/qt/frame.cpp deleted file mode 100644 index 8807b62f89..0000000000 --- a/src/qt/frame.cpp +++ /dev/null @@ -1,533 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: frame.cpp -// Purpose: wxFrame -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "frame.h" -#endif - -#include "wx/frame.h" -#include "wx/statusbr.h" -#include "wx/toolbar.h" -#include "wx/menuitem.h" - -extern wxList wxModelessWindows; -extern wxList wxPendingDelete; - -BEGIN_EVENT_TABLE(wxFrame, wxWindow) - EVT_SIZE(wxFrame::OnSize) - EVT_ACTIVATE(wxFrame::OnActivate) - EVT_MENU_HIGHLIGHT_ALL(wxFrame::OnMenuHighlight) - EVT_SYS_COLOUR_CHANGED(wxFrame::OnSysColourChanged) - EVT_IDLE(wxFrame::OnIdle) - EVT_CLOSE(wxFrame::OnCloseWindow) -END_EVENT_TABLE() - -IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxWindow) - -#if wxUSE_NATIVE_STATUSBAR -bool wxFrame::m_useNativeStatusBar = TRUE; -#else -bool wxFrame::m_useNativeStatusBar = FALSE; -#endif - -wxFrame::wxFrame() -{ - m_frameToolBar = NULL ; - m_frameMenuBar = NULL; - m_frameStatusBar = NULL; - - m_windowParent = NULL; - m_iconized = FALSE; -} - -bool wxFrame::Create(wxWindow *parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - if (!parent) - wxTopLevelWindows.Append(this); - - SetName(name); - m_windowStyle = style; - m_frameMenuBar = NULL; - m_frameToolBar = NULL ; - m_frameStatusBar = NULL; - - SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE)); - - if ( id > -1 ) - m_windowId = id; - else - m_windowId = (int)NewControlId(); - - if (parent) parent->AddChild(this); - - wxModelessWindows.Append(this); - - // TODO: create frame. - - return FALSE; -} - -wxFrame::~wxFrame() -{ - wxTopLevelWindows.DeleteObject(this); - - if (m_frameStatusBar) - delete m_frameStatusBar; - if (m_frameMenuBar) - delete m_frameMenuBar; - -/* Check if it's the last top-level window */ - - if (wxTheApp && (wxTopLevelWindows.Number() == 0)) - { - wxTheApp->SetTopWindow(NULL); - - if (wxTheApp->GetExitOnFrameDelete()) - { - // TODO signal to the app that we're going to close - } - } - - wxModelessWindows.DeleteObject(this); -} - -// Get size *available for subwindows* i.e. excluding menu bar, toolbar etc. -void wxFrame::GetClientSize(int *x, int *y) const -{ - // TODO -} - -// Set the client size (i.e. leave the calculation of borders etc. -// to wxWindows) -void wxFrame::SetClientSize(int width, int height) -{ - // TODO -} - -void wxFrame::GetSize(int *width, int *height) const -{ - // TODO -} - -void wxFrame::GetPosition(int *x, int *y) const -{ - // TODO -} - -void wxFrame::SetSize(int x, int y, int width, int height, int sizeFlags) -{ - // TODO -} - -bool wxFrame::Show(bool show) -{ - // TODO - return FALSE; -} - -void wxFrame::Iconize(bool iconize) -{ - // TODO -} - -// Equivalent to maximize/restore in Windows -void wxFrame::Maximize(bool maximize) -{ - // TODO -} - -bool wxFrame::IsIconized() const -{ - // TODO - return FALSE; -} - -void wxFrame::SetTitle(const wxString& title) -{ - // TODO -} - -wxString wxFrame::GetTitle() const -{ - // TODO - return wxString(""); -} - -void wxFrame::SetIcon(const wxIcon& icon) -{ - m_icon = icon; - // TODO -} - -void wxFrame::SetAcceleratorTable(const wxAcceleratorTable& accel) -{ - m_acceleratorTable = accel; -} - -wxStatusBar *wxFrame::OnCreateStatusBar(int number, long style, wxWindowID id, - const wxString& name) -{ - wxStatusBar *statusBar = NULL; - - statusBar = new wxStatusBar(this, id, wxPoint(0, 0), wxSize(100, 20), - style, name); - - // Set the height according to the font and the border size - wxClientDC dc(statusBar); - dc.SetFont(* statusBar->GetFont()); - - long x, y; - dc.GetTextExtent("X", &x, &y); - - int height = (int)( (y * 1.1) + 2* statusBar->GetBorderY()); - - statusBar->SetSize(-1, -1, 100, height); - - statusBar->SetFieldsCount(number); - return statusBar; -} - -wxStatusBar* wxFrame::CreateStatusBar(int number, long style, wxWindowID id, - const wxString& name) -{ - // Calling CreateStatusBar twice is an error. - wxCHECK_MSG( m_frameStatusBar == NULL, FALSE, - "recreating status bar in wxFrame" ); - - m_frameStatusBar = OnCreateStatusBar(number, style, id, - name); - if ( m_frameStatusBar ) - { - PositionStatusBar(); - return m_frameStatusBar; - } - else - return NULL; -} - -void wxFrame::SetStatusText(const wxString& text, int number) -{ - wxCHECK_RET( m_frameStatusBar != NULL, "no statusbar to set text for" ); - - m_frameStatusBar->SetStatusText(text, number); -} - -void wxFrame::SetStatusWidths(int n, const int widths_field[]) -{ - wxCHECK_RET( m_frameStatusBar != NULL, "no statusbar to set widths for" ); - - m_frameStatusBar->SetStatusWidths(n, widths_field); - PositionStatusBar(); -} - -void wxFrame::PositionStatusBar() -{ - int w, h; - GetClientSize(&w, &h); - int sw, sh; - m_frameStatusBar->GetSize(&sw, &sh); - - // Since we wish the status bar to be directly under the client area, - // we use the adjusted sizes without using wxSIZE_NO_ADJUSTMENTS. - m_frameStatusBar->SetSize(0, h, w, sh); -} - -void wxFrame::SetMenuBar(wxMenuBar *menuBar) -{ - if (!menuBar) - { - m_frameMenuBar = NULL; - return; - } - - m_frameMenuBar = menuBar; - - // TODO -} - -void wxFrame::Fit() -{ - // Work out max. size - wxNode *node = GetChildren()->First(); - int max_width = 0; - int max_height = 0; - while (node) - { - // Find a child that's a subwindow, but not a dialog box. - wxWindow *win = (wxWindow *)node->Data(); - - if (!win->IsKindOf(CLASSINFO(wxFrame)) && - !win->IsKindOf(CLASSINFO(wxDialog))) - { - int width, height; - int x, y; - win->GetSize(&width, &height); - win->GetPosition(&x, &y); - - if ((x + width) > max_width) - max_width = x + width; - if ((y + height) > max_height) - max_height = y + height; - } - node = node->Next(); - } - SetClientSize(max_width, max_height); -} - -// Responds to colour changes, and passes event on to children. -void wxFrame::OnSysColourChanged(wxSysColourChangedEvent& event) -{ - SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE)); - Refresh(); - - if ( m_frameStatusBar ) - { - wxSysColourChangedEvent event2; - event2.SetEventObject( m_frameStatusBar ); - m_frameStatusBar->ProcessEvent(event2); - } - - // Propagate the event to the non-top-level children - wxWindow::OnSysColourChanged(event); -} - -// Default resizing behaviour - if only ONE subwindow, -// resize to client rectangle size -void wxFrame::OnSize(wxSizeEvent& event) -{ - // if we're using constraints - do use them - #if wxUSE_CONSTRAINTS - if ( GetAutoLayout() ) { - Layout(); - return; - } - #endif - - // do we have _exactly_ one child? - wxWindow *child = NULL; - for ( wxNode *node = GetChildren()->First(); node; node = node->Next() ) - { - wxWindow *win = (wxWindow *)node->Data(); - if ( !win->IsKindOf(CLASSINFO(wxFrame)) && - !win->IsKindOf(CLASSINFO(wxDialog)) && - (win != GetStatusBar()) && - (win != GetToolBar()) ) - { - if ( child ) - return; // it's our second subwindow - nothing to do - child = win; - } - } - - if ( child ) { - // we have exactly one child - set it's size to fill the whole frame - int clientW, clientH; - GetClientSize(&clientW, &clientH); - - int x = 0; - int y = 0; - - child->SetSize(x, y, clientW, clientH); - } -} - -// Default activation behaviour - set the focus for the first child -// subwindow found. -void wxFrame::OnActivate(wxActivateEvent& event) -{ - for(wxNode *node = GetChildren()->First(); node; node = node->Next()) - { - // Find a child that's a subwindow, but not a dialog box. - wxWindow *child = (wxWindow *)node->Data(); - if (!child->IsKindOf(CLASSINFO(wxFrame)) && - !child->IsKindOf(CLASSINFO(wxDialog))) - { -#if WXDEBUG > 1 - wxDebugMsg("wxFrame::OnActivate: about to set the child's focus.\n"); -#endif - child->SetFocus(); - return; - } - } -} - -// The default implementation for the close window event. -void wxFrame::OnCloseWindow(wxCloseEvent& event) -{ - this->Destroy(); -} - -// Destroy the window (delayed, if a managed window) -bool wxFrame::Destroy() -{ - if (!wxPendingDelete.Member(this)) - wxPendingDelete.Append(this); - return TRUE; -} - -// Default menu selection behaviour - display a help string -void wxFrame::OnMenuHighlight(wxMenuEvent& event) -{ - if (GetStatusBar()) - { - if (event.GetMenuId() == -1) - SetStatusText(""); - else - { - wxMenuBar *menuBar = GetMenuBar(); - if (menuBar) - { - wxString helpString(menuBar->GetHelpString(event.GetMenuId())); - if (helpString != "") - SetStatusText(helpString); - } - } - } -} - -wxMenuBar *wxFrame::GetMenuBar() const -{ - return m_frameMenuBar; -} - -void wxFrame::Centre(int direction) -{ - int display_width, display_height, width, height, x, y; - wxDisplaySize(&display_width, &display_height); - - 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, y, width, height); -} - -// Call this to simulate a menu command -void wxFrame::Command(int id) -{ - ProcessCommand(id); -} - -void wxFrame::ProcessCommand(int id) -{ - wxCommandEvent commandEvent(wxEVENT_TYPE_MENU_COMMAND, id); - commandEvent.SetInt( id ); - commandEvent.SetEventObject( this ); - - wxMenuBar *bar = GetMenuBar() ; - if (!bar) - return; - -/* TODO: check the menu item if required - wxMenuItem *item = bar->FindItemForId(id) ; - if (item && item->IsCheckable()) - { - bar->Check(id,!bar->Checked(id)) ; - } -*/ - - GetEventHandler()->ProcessEvent(commandEvent); -} - -// Checks if there is a toolbar, and returns the first free client position -wxPoint wxFrame::GetClientAreaOrigin() const -{ - wxPoint pt(0, 0); - if (GetToolBar()) - { - int w, h; - GetToolBar()->GetSize(& w, & h); - - if (GetToolBar()->GetWindowStyleFlag() & wxTB_VERTICAL) - { - pt.x += w; - } - else - { - pt.y += h; - } - } - return pt; -} - -wxToolBar* wxFrame::CreateToolBar(long style, wxWindowID id, const wxString& name) -{ - wxCHECK_MSG( m_frameToolBar == NULL, FALSE, - "recreating toolbar in wxFrame" ); - - wxToolBar* toolBar = OnCreateToolBar(style, id, name); - if (toolBar) - { - SetToolBar(toolBar); - PositionToolBar(); - return toolBar; - } - else - { - return NULL; - } -} - -wxToolBar* wxFrame::OnCreateToolBar(long style, wxWindowID id, const wxString& name) -{ - return new wxToolBar(this, id, wxDefaultPosition, wxDefaultSize, style, name); -} - -void wxFrame::PositionToolBar() -{ - int cw, ch; - - // TODO: we actually need to use the low-level client size, before - // the toolbar/status bar were added. - // So DEFINITELY replace the line below with something appropriate. - - wxCHECK_MSG( TRUE, FALSE, - "PositionToolBar not implemented properly, see frame.cpp" ); - - GetClientSize(& cw, &ch); - - if ( GetStatusBar() ) - { - int statusX, statusY; - GetStatusBar()->GetClientSize(&statusX, &statusY); - ch -= statusY; - } - - if (GetToolBar()) - { - int tw, th; - GetToolBar()->GetSize(& tw, & th); - - if (GetToolBar()->GetWindowStyleFlag() & wxTB_VERTICAL) - { - // Use the 'real' position. wxSIZE_NO_ADJUSTMENTS - // means, pretend we don't have toolbar/status bar, so we - // have the original client size. - GetToolBar()->SetSize(0, 0, tw, ch, wxSIZE_NO_ADJUSTMENTS); - } - else - { - // Use the 'real' position - GetToolBar()->SetSize(0, 0, cw, th, wxSIZE_NO_ADJUSTMENTS); - } - } -} - diff --git a/src/qt/gauge.cpp b/src/qt/gauge.cpp deleted file mode 100644 index 14b5c4267d..0000000000 --- a/src/qt/gauge.cpp +++ /dev/null @@ -1,103 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: gauge.cpp -// Purpose: wxGauge class -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "gauge.h" -#endif - -#include "wx/gauge.h" - -IMPLEMENT_DYNAMIC_CLASS(wxGauge, wxControl) - -bool wxGauge::Create(wxWindow *parent, wxWindowID id, - int range, - const wxPoint& pos, - const wxSize& size, - long style, - const wxValidator& validator, - const wxString& name) -{ - SetName(name); - SetValidator(validator); - m_rangeMax = range; - m_windowStyle = style; - - if (parent) parent->AddChild(this); - - if ( id == -1 ) - m_windowId = (int)NewControlId(); - else - m_windowId = id; - - - // TODO - return FALSE; -} - -void wxGauge::SetSize(int x, int y, int width, int height, int sizeFlags) -{ - // TODO -} - -void wxGauge::SetShadowWidth(int w) -{ - // TODO optional -} - -void wxGauge::SetBezelFace(int w) -{ - // TODO optional -} - -void wxGauge::SetRange(int r) -{ - m_rangeMax = r; - // TODO -} - -void wxGauge::SetValue(int pos) -{ - m_gaugePos = pos; - // TODO -} - -int wxGauge::GetShadowWidth() const -{ - // TODO optional - return 0; -} - -int wxGauge::GetBezelFace() const -{ - // TODO optional - return 0; -} - -int wxGauge::GetRange() const -{ - return m_rangeMax; -} - -int wxGauge::GetValue() const -{ - return m_gaugePos; -} - -void wxGauge::SetForegroundColour(const wxColour& col) -{ - m_foregroundColour = col ; -} - -void wxGauge::SetBackgroundColour(const wxColour& col) -{ - m_backgroundColour = col ; -} - diff --git a/src/qt/gdiobj.cpp b/src/qt/gdiobj.cpp deleted file mode 100644 index 46b1aa871f..0000000000 --- a/src/qt/gdiobj.cpp +++ /dev/null @@ -1,20 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: gdiobj.cpp -// Purpose: wxGDIObject class -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "gdiobj.h" -#endif - -#include "wx/gdiobj.h" - -IMPLEMENT_DYNAMIC_CLASS(wxGDIObject, wxObject) - -// TODO: Nothing to do, unless you want to. diff --git a/src/qt/horiz.xbm b/src/qt/horiz.xbm deleted file mode 100644 index ff3309bcc4..0000000000 --- a/src/qt/horiz.xbm +++ /dev/null @@ -1,6 +0,0 @@ -#define horiz_width 15 -#define horiz_height 15 -static char horiz_bits[] = { - 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00}; diff --git a/src/qt/icon.cpp b/src/qt/icon.cpp deleted file mode 100644 index cc5b28500e..0000000000 --- a/src/qt/icon.cpp +++ /dev/null @@ -1,68 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: icon.cpp -// Purpose: wxIcon class -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "icon.h" -#endif - -#include "wx/icon.h" - -IMPLEMENT_DYNAMIC_CLASS(wxIcon, wxBitmap) - -/* - * Icons - */ - - -wxIconRefData::wxIconRefData() -{ - // TODO: init icon handle -} - -wxIconRefData::~wxIconRefData() -{ - // TODO: destroy icon handle -} - -wxIcon::wxIcon() -{ -} - -wxIcon::wxIcon(const char WXUNUSED(bits)[], int WXUNUSED(width), int WXUNUSED(height)) -{ -} - -wxIcon::wxIcon(const wxString& icon_file, long flags, - int desiredWidth, int desiredHeight) - -{ - LoadFile(icon_file, flags, desiredWidth, desiredHeight); -} - -wxIcon::~wxIcon() -{ -} - -bool wxIcon::LoadFile(const wxString& filename, long type, - int desiredWidth, int desiredHeight) -{ - UnRef(); - - m_refData = new wxIconRefData; - - wxBitmapHandler *handler = FindHandler(type); - - if ( handler ) - return handler->LoadFile(this, filename, type, desiredWidth, desiredHeight); - else - return FALSE; -} - diff --git a/src/qt/joystick.cpp b/src/qt/joystick.cpp deleted file mode 100644 index 6677277f48..0000000000 --- a/src/qt/joystick.cpp +++ /dev/null @@ -1,279 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: joystick.cpp -// Purpose: wxJoystick class -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "joystick.h" -#endif - -#include - -IMPLEMENT_DYNAMIC_CLASS(wxJoystick, wxObject) - -// Attributes -//////////////////////////////////////////////////////////////////////////// - -wxPoint wxJoystick::GetPosition() const -{ - // TODO - return wxPoint(0, 0); -} - -int wxJoystick::GetZPosition() const -{ - // TODO - return 0; -} - -int wxJoystick::GetButtonState() const -{ - // TODO - return 0; -} - -int wxJoystick::GetPOVPosition() const -{ - // TODO - return 0; -} - -int wxJoystick::GetPOVCTSPosition() const -{ - // TODO - return 0; -} - -int wxJoystick::GetRudderPosition() const -{ - // TODO - return 0; -} - -int wxJoystick::GetUPosition() const -{ - // TODO - return 0; -} - -int wxJoystick::GetVPosition() const -{ - // TODO - return 0; -} - -int wxJoystick::GetMovementThreshold() const -{ - // TODO - return 0; -} - -void wxJoystick::SetMovementThreshold(int threshold) -{ - // TODO -} - -// Capabilities -//////////////////////////////////////////////////////////////////////////// - -bool wxJoystick::IsOk() const -{ - // TODO - return FALSE; -} - -int wxJoystick::GetNumberJoysticks() const -{ - // TODO - return 0; -} - -int wxJoystick::GetManufacturerId() const -{ - // TODO - return 0; -} - -int wxJoystick::GetProductId() const -{ - // TODO - return 0; -} - -wxString wxJoystick::GetProductName() const -{ - // TODO - return wxString(""); -} - -int wxJoystick::GetXMin() const -{ - // TODO - return 0; -} - -int wxJoystick::GetYMin() const -{ - // TODO - return 0; -} - -int wxJoystick::GetZMin() const -{ - // TODO - return 0; -} - -int wxJoystick::GetXMax() const -{ - // TODO - return 0; -} - -int wxJoystick::GetYMax() const -{ - // TODO - return 0; -} - -int wxJoystick::GetZMax() const -{ - // TODO - return 0; -} - -int wxJoystick::GetNumberButtons() const -{ - // TODO - return 0; -} - -int wxJoystick::GetNumberAxes() const -{ - // TODO - return 0; -} - -int wxJoystick::GetMaxButtons() const -{ - // TODO - return 0; -} - -int wxJoystick::GetMaxAxes() const -{ - // TODO - return 0; -} - -int wxJoystick::GetPollingMin() const -{ - // TODO - return 0; -} - -int wxJoystick::GetPollingMax() const -{ - // TODO - return 0; -} - -int wxJoystick::GetRudderMin() const -{ - // TODO - return 0; -} - -int wxJoystick::GetRudderMax() const -{ - // TODO - return 0; -} - -int wxJoystick::GetUMin() const -{ - // TODO - return 0; -} - -int wxJoystick::GetUMax() const -{ - // TODO - return 0; -} - -int wxJoystick::GetVMin() const -{ - // TODO - return 0; -} - -int wxJoystick::GetVMax() const -{ - // TODO - return 0; -} - -bool wxJoystick::HasRudder() const -{ - // TODO - return FALSE; -} - -bool wxJoystick::HasZ() const -{ - // TODO - return FALSE; -} - -bool wxJoystick::HasU() const -{ - // TODO - return FALSE; -} - -bool wxJoystick::HasV() const -{ - // TODO - return FALSE; -} - -bool wxJoystick::HasPOV() const -{ - // TODO - return FALSE; -} - -bool wxJoystick::HasPOV4Dir() const -{ - // TODO - return FALSE; -} - -bool wxJoystick::HasPOVCTS() const -{ - // TODO - return FALSE; -} - -// Operations -//////////////////////////////////////////////////////////////////////////// - -bool wxJoystick::SetCapture(wxWindow* win, int pollingFreq) -{ - // TODO - return FALSE; -} - -bool wxJoystick::ReleaseCapture() -{ - // TODO - return FALSE; -} - diff --git a/src/qt/listbox.cpp b/src/qt/listbox.cpp deleted file mode 100644 index f3d95d0d97..0000000000 --- a/src/qt/listbox.cpp +++ /dev/null @@ -1,238 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: listbox.cpp -// Purpose: wxListBox -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "listbox.h" -#endif - -#include "wx/listbox.h" - -#include "wx/dynarray.h" -#include "wx/log.h" - - IMPLEMENT_DYNAMIC_CLASS(wxListBox, wxControl) - -// ============================================================================ -// list box control implementation -// ============================================================================ - -// Listbox item -wxListBox::wxListBox() -{ - m_noItems = 0; - m_selected = 0; -} - -bool wxListBox::Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos, - const wxSize& size, - int n, const wxString choices[], - long style, - const wxValidator& validator, - const wxString& name) -{ - m_noItems = n; - m_selected = 0; - - SetName(name); - SetValidator(validator); - - if (parent) parent->AddChild(this); - - wxSystemSettings settings; - SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOW)); - - m_windowId = ( id == -1 ) ? (int)NewControlId() : id; - - // TODO create listbox - - return FALSE; -} - -wxListBox::~wxListBox() -{ -} - -void wxListBox::SetupColours() -{ - SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOW)); -} - -void wxListBox::SetFirstItem(int N) -{ - // TODO -} - -void wxListBox::SetFirstItem(const wxString& s) -{ - // TODO -} - -void wxListBox::Delete(int N) -{ - m_noItems --; - // TODO -} - -void wxListBox::Append(const wxString& item) -{ - m_noItems ++; - - // TODO -} - -void wxListBox::Append(const wxString& item, char *Client_data) -{ - m_noItems ++; - - // TODO -} - -void wxListBox::Set(int n, const wxString *choices, char** clientData) -{ - m_noItems = n; - - // TODO -} - -int wxListBox::FindString(const wxString& s) const -{ - // TODO - return -1; -} - -void wxListBox::Clear() -{ - m_noItems = 0; - // TODO -} - -void wxListBox::SetSelection(int N, bool select) -{ - // TODO -} - -bool wxListBox::Selected(int N) const -{ - // TODO - return FALSE; -} - -void wxListBox::Deselect(int N) -{ - // TODO -} - -char *wxListBox::GetClientData(int N) const -{ - // TODO - return (char *)NULL; -} - -void wxListBox::SetClientData(int N, char *Client_data) -{ - // TODO -} - -// Return number of selections and an array of selected integers -int wxListBox::GetSelections(wxArrayInt& aSelections) const -{ - aSelections.Empty(); - -/* TODO - if ((m_windowStyle & wxLB_MULTIPLE) || (m_windowStyle & wxLB_EXTENDED)) - { - int no_sel = ?? - for ( int n = 0; n < no_sel; n++ ) - aSelections.Add(??); - - return no_sel; - } - else // single-selection listbox - { - aSelections.Add(??); - - return 1; - } -*/ - return 0; -} - -// Get single selection, for single choice list items -int wxListBox::GetSelection() const -{ - // TODO - return -1; -} - -// Find string for position -wxString wxListBox::GetString(int N) const -{ - // TODO - return wxString(""); -} - -void wxListBox::SetSize(int x, int y, int width, int height, int sizeFlags) -{ - // TODO -} - -void wxListBox::InsertItems(int nItems, const wxString items[], int pos) -{ - m_noItems += nItems; - - // TODO -} - -void wxListBox::SetString(int N, const wxString& s) -{ - // TODO -} - -int wxListBox::Number () const -{ - return m_noItems; -} - -// For single selection items only -wxString wxListBox::GetStringSelection () const -{ - int sel = GetSelection (); - if (sel > -1) - return this->GetString (sel); - else - return wxString(""); -} - -bool wxListBox::SetStringSelection (const wxString& s, bool flag) -{ - int sel = FindString (s); - if (sel > -1) - { - SetSelection (sel, flag); - return TRUE; - } - else - return FALSE; -} - -void wxListBox::Command (wxCommandEvent & event) -{ - if (event.m_extraLong) - SetSelection (event.m_commandInt); - else - { - Deselect (event.m_commandInt); - return; - } - ProcessCommand (event); -} - diff --git a/src/qt/mdi.cpp b/src/qt/mdi.cpp deleted file mode 100644 index 7ece99f432..0000000000 --- a/src/qt/mdi.cpp +++ /dev/null @@ -1,261 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: mdi.cpp -// Purpose: MDI classes -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "mdi.h" -#endif - -#include "wx/mdi.h" - -extern wxList wxModelessWindows; - -IMPLEMENT_DYNAMIC_CLASS(wxMDIParentFrame, wxFrame) -IMPLEMENT_DYNAMIC_CLASS(wxMDIChildFrame, wxFrame) -IMPLEMENT_DYNAMIC_CLASS(wxMDIClientWindow, wxWindow) - -BEGIN_EVENT_TABLE(wxMDIParentFrame, wxFrame) - EVT_SIZE(wxMDIParentFrame::OnSize) - EVT_ACTIVATE(wxMDIParentFrame::OnActivate) - EVT_SYS_COLOUR_CHANGED(wxMDIParentFrame::OnSysColourChanged) -END_EVENT_TABLE() - -BEGIN_EVENT_TABLE(wxMDIClientWindow, wxWindow) - EVT_SCROLL(wxMDIClientWindow::OnScroll) -END_EVENT_TABLE() - - -// Parent frame - -wxMDIParentFrame::wxMDIParentFrame() -{ -} - -bool wxMDIParentFrame::Create(wxWindow *parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - if (!parent) - wxTopLevelWindows.Append(this); - - SetName(name); - m_windowStyle = style; - - if (parent) parent->AddChild(this); - - if ( id > -1 ) - m_windowId = id; - else - m_windowId = (int)NewControlId(); - - // TODO: create MDI parent frame - - wxModelessWindows.Append(this); - - return TRUE; -} - -wxMDIParentFrame::~wxMDIParentFrame() -{ -} - -// Get size *available for subwindows* i.e. excluding menu bar. -void wxMDIParentFrame::GetClientSize(int *x, int *y) const -{ - // TODO -} - -void wxMDIParentFrame::SetMenuBar(wxMenuBar *menu_bar) -{ - // TODO - if (!menu_bar) - { - m_frameMenuBar = NULL; - return; - } - - if (menu_bar->m_menuBarFrame) - return; - - m_frameMenuBar = menu_bar; -} - -void wxMDIParentFrame::OnSize(wxSizeEvent& event) -{ -#if wxUSE_CONSTRAINTS - if (GetAutoLayout()) - Layout(); -#endif - int x = 0; - int y = 0; - int width, height; - GetClientSize(&width, &height); - - if ( GetClientWindow() ) - GetClientWindow()->SetSize(x, y, width, height); -} - -void wxMDIParentFrame::OnActivate(wxActivateEvent& event) -{ - // Do nothing -} - -// Returns the active MDI child window -wxMDIChildFrame *wxMDIParentFrame::GetActiveChild() const -{ - // TODO - return NULL; -} - -// Create the client window class (don't Create the window, -// just return a new class) -wxMDIClientWindow *wxMDIParentFrame::OnCreateClient() -{ - return new wxMDIClientWindow ; -} - -// Responds to colour changes, and passes event on to children. -void wxMDIParentFrame::OnSysColourChanged(wxSysColourChangedEvent& event) -{ - // TODO - - // Propagate the event to the non-top-level children - wxFrame::OnSysColourChanged(event); -} - -// MDI operations -void wxMDIParentFrame::Cascade() -{ - // TODO -} - -void wxMDIParentFrame::Tile() -{ - // TODO -} - -void wxMDIParentFrame::ArrangeIcons() -{ - // TODO -} - -void wxMDIParentFrame::ActivateNext() -{ - // TODO -} - -void wxMDIParentFrame::ActivatePrevious() -{ - // TODO -} - -// Child frame - -wxMDIChildFrame::wxMDIChildFrame() -{ -} - -bool wxMDIChildFrame::Create(wxMDIParentFrame *parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - SetName(name); - - if ( id > -1 ) - m_windowId = id; - else - m_windowId = (int)NewControlId(); - - if (parent) parent->AddChild(this); - - // TODO: create child frame - - wxModelessWindows.Append(this); - return FALSE; -} - -wxMDIChildFrame::~wxMDIChildFrame() -{ -} - -// Set the client size (i.e. leave the calculation of borders etc. -// to wxWindows) -void wxMDIChildFrame::SetClientSize(int width, int height) -{ - // TODO -} - -void wxMDIChildFrame::GetPosition(int *x, int *y) const -{ - // TODO -} - -void wxMDIChildFrame::SetMenuBar(wxMenuBar *menu_bar) -{ - // TODO - if (!menu_bar) - { - m_frameMenuBar = NULL; - return; - } - - if (menu_bar->m_menuBarFrame) - return; - m_frameMenuBar = menu_bar; -} - -// MDI operations -void wxMDIChildFrame::Maximize() -{ - // TODO -} - -void wxMDIChildFrame::Restore() -{ - // TODO -} - -void wxMDIChildFrame::Activate() -{ - // TODO -} - -// Client window - -wxMDIClientWindow::wxMDIClientWindow() -{ -} - -wxMDIClientWindow::~wxMDIClientWindow() -{ -} - -bool wxMDIClientWindow::CreateClient(wxMDIParentFrame *parent, long style) -{ - // TODO create client window - m_backgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE); - - return FALSE; -} - -// Explicitly call default scroll behaviour -void wxMDIClientWindow::OnScroll(wxScrollEvent& event) -{ - Default(); // Default processing -} - diff --git a/src/qt/menu.cpp b/src/qt/menu.cpp deleted file mode 100644 index fcb7f97014..0000000000 --- a/src/qt/menu.cpp +++ /dev/null @@ -1,566 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: menu.cpp -// Purpose: wxMenu, wxMenuBar, wxMenuItem -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - - -// ============================================================================ -// headers & declarations -// ============================================================================ - -// wxWindows headers -// ----------------- - -#ifdef __GNUG__ -#pragma implementation "menu.h" -#pragma implementation "menuitem.h" -#endif - -#include "wx/menu.h" -#include "wx/menuitem.h" -#include "wx/log.h" - -// other standard headers -// ---------------------- -#include - -IMPLEMENT_DYNAMIC_CLASS(wxMenu, wxEvtHandler) -IMPLEMENT_DYNAMIC_CLASS(wxMenuBar, wxEvtHandler) - -// ============================================================================ -// implementation -// ============================================================================ - -// Menus - -// Construct a menu with optional title (then use append) -wxMenu::wxMenu(const wxString& title, const wxFunction func) -{ - m_title = title; - m_parent = NULL; - m_eventHandler = this; - m_noItems = 0; - m_menuBar = NULL; - if (m_title != "") - { - Append(-2, m_title) ; - AppendSeparator() ; - } - - Callback(func); - - // TODO create menu -} - -// The wxWindow destructor will take care of deleting the submenus. -wxMenu::~wxMenu() -{ - // TODO destroy menu and children - - wxNode *node = m_menuItems.First(); - while (node) - { - wxMenuItem *item = (wxMenuItem *)node->Data(); - - // Delete child menus. - // Beware: they must not be appended to children list!!! - // (because order of delete is significant) - if (item->GetSubMenu()) - item->DeleteSubMenu(); - - wxNode *next = node->Next(); - delete item; - delete node; - node = next; - } -} - -void wxMenu::Break() -{ - // TODO -} - -// function appends a new item or submenu to the menu -void wxMenu::Append(wxMenuItem *pItem) -{ - // TODO - - wxCHECK_RET( pItem != NULL, "can't append NULL item to the menu" ); - - m_menuItems.Append(pItem); - - m_noItems++; -} - -void wxMenu::AppendSeparator() -{ - // TODO - Append(new wxMenuItem(this, ID_SEPARATOR)); -} - -// Pullright item -void wxMenu::Append(int Id, const wxString& label, wxMenu *SubMenu, - const wxString& helpString) -{ - Append(new wxMenuItem(this, Id, label, helpString, FALSE, SubMenu)); -} - -// Ordinary menu item -void wxMenu::Append(int Id, const wxString& label, - const wxString& helpString, bool checkable) -{ - // 'checkable' parameter is useless for Windows. - Append(new wxMenuItem(this, Id, label, helpString, checkable)); -} - -void wxMenu::Delete(int id) -{ - wxNode *node; - wxMenuItem *item; - int pos; - - for (pos = 0, node = m_menuItems.First(); node; node = node->Next(), pos++) { - item = (wxMenuItem *)node->Data(); - if (item->GetId() == id) - break; - } - - if (!node) - return; - - m_menuItems.DeleteNode(node); - delete item; - - // TODO -} - -void wxMenu::Enable(int Id, bool Flag) -{ - wxMenuItem *item = FindItemForId(Id); - wxCHECK_RET( item != NULL, "can't enable non-existing menu item" ); - - item->Enable(Flag); -} - -bool wxMenu::Enabled(int Id) const -{ - wxMenuItem *item = FindItemForId(Id); - wxCHECK( item != NULL, FALSE ); - - return item->IsEnabled(); -} - -void wxMenu::Check(int Id, bool Flag) -{ - wxMenuItem *item = FindItemForId(Id); - wxCHECK_RET( item != NULL, "can't get status of non-existing menu item" ); - - item->Check(Flag); -} - -bool wxMenu::Checked(int Id) const -{ - wxMenuItem *item = FindItemForId(Id); - wxCHECK( item != NULL, FALSE ); - - return item->IsChecked(); -} - -void wxMenu::SetTitle(const wxString& label) -{ - m_title = label ; - // TODO -} - -const wxString& wxMenu::GetTitle() const -{ - return m_title; -} - -void wxMenu::SetLabel(int id, const wxString& label) -{ - wxMenuItem *item = FindItemForId(id) ; - if (item==NULL) - return; - - if (item->GetSubMenu()==NULL) - { - // TODO - } - else - { - // TODO - } - item->SetName(label); -} - -wxString wxMenu::GetLabel(int Id) const -{ - // TODO - return wxString("") ; -} - -// Finds the item id matching the given string, -1 if not found. -int wxMenu::FindItem (const wxString& itemString) const -{ - char buf1[200]; - char buf2[200]; - wxStripMenuCodes ((char *)(const char *)itemString, buf1); - - for (wxNode * node = m_menuItems.First (); node; node = node->Next ()) - { - wxMenuItem *item = (wxMenuItem *) node->Data (); - if (item->GetSubMenu()) - { - int ans = item->GetSubMenu()->FindItem(itemString); - if (ans > -1) - return ans; - } - if ( !item->IsSeparator() ) - { - wxStripMenuCodes((char *)item->GetName().c_str(), buf2); - if (strcmp(buf1, buf2) == 0) - return item->GetId(); - } - } - - return -1; -} - -wxMenuItem *wxMenu::FindItemForId(int itemId, wxMenu ** itemMenu) const -{ - if (itemMenu) - *itemMenu = NULL; - for (wxNode * node = m_menuItems.First (); node; node = node->Next ()) - { - wxMenuItem *item = (wxMenuItem *) node->Data (); - - if (item->GetId() == itemId) - { - if (itemMenu) - *itemMenu = (wxMenu *) this; - return item; - } - - if (item->GetSubMenu()) - { - wxMenuItem *ans = item->GetSubMenu()->FindItemForId (itemId, itemMenu); - if (ans) - return ans; - } - } - - if (itemMenu) - *itemMenu = NULL; - return NULL; -} - -void wxMenu::SetHelpString(int itemId, const wxString& helpString) -{ - wxMenuItem *item = FindItemForId (itemId); - if (item) - item->SetHelp(helpString); -} - -wxString wxMenu::GetHelpString (int itemId) const -{ - wxMenuItem *item = FindItemForId (itemId); - wxString str(""); - return (item == NULL) ? str : item->GetHelp(); -} - -void wxMenu::ProcessCommand(wxCommandEvent & event) -{ - bool processed = FALSE; - - // Try a callback - if (m_callback) - { - (void) (*(m_callback)) (*this, event); - processed = TRUE; - } - - // Try the menu's event handler - if ( !processed && GetEventHandler()) - { - processed = GetEventHandler()->ProcessEvent(event); - } - - // Try the window the menu was popped up from (and up - // through the hierarchy) - if ( !processed && GetInvokingWindow()) - processed = GetInvokingWindow()->ProcessEvent(event); -} - -bool wxWindow::PopupMenu(wxMenu *menu, int x, int y) -{ - // TODO - return FALSE; -} - -// Menu Bar -wxMenuBar::wxMenuBar() -{ - m_eventHandler = this; - m_menuCount = 0; - m_menus = NULL; - m_titles = NULL; - m_menuBarFrame = NULL; - - // TODO -} - -wxMenuBar::wxMenuBar(int n, wxMenu *Mmnus[], const wxString titles[]) -{ - m_eventHandler = this; - m_menuCount = n; - m_menus = menus; - m_titles = new wxString[n]; - int i; - for ( i = 0; i < n; i++ ) - m_titles[i] = titles[i]; - m_menuBarFrame = NULL; - - // TODO -} - -wxMenuBar::~wxMenuBar() -{ - int i; - for (i = 0; i < m_menuCount; i++) - { - delete m_menus[i]; - } - delete[] m_menus; - delete[] m_titles; - - // TODO -} - -// Must only be used AFTER menu has been attached to frame, -// otherwise use individual menus to enable/disable items -void wxMenuBar::Enable(int id, bool flag) -{ - wxMenu *itemMenu = NULL; - wxMenuItem *item = FindItemForId(id, &itemMenu) ; - if (!item) - return; - - // TODO -} - -void wxMenuBar::EnableTop(int pos, bool flag) -{ - // TODO -} - -// Must only be used AFTER menu has been attached to frame, -// otherwise use individual menus -void wxMenuBar::Check(int id, bool flag) -{ - wxMenu *itemMenu = NULL; - wxMenuItem *item = FindItemForId(id, &itemMenu) ; - if (!item) - return; - - if (!item->IsCheckable()) - return ; - - // TODO -} - -bool wxMenuBar::Checked(int id) const -{ - wxMenu *itemMenu = NULL; - wxMenuItem *item = FindItemForId(id, &itemMenu) ; - if (!item) - return FALSE; - - // TODO - return FALSE; -} - -bool wxMenuBar::Enabled(int id) const -{ - wxMenu *itemMenu = NULL; - wxMenuItem *item = FindItemForId(id, &itemMenu) ; - if (!item) - return FALSE; - - // TODO - return FALSE ; -} - - -void wxMenuBar::SetLabel(int id, const wxString& label) -{ - wxMenu *itemMenu = NULL; - wxMenuItem *item = FindItemForId(id, &itemMenu) ; - - if (!item) - return; - - // TODO -} - -wxString wxMenuBar::GetLabel(int id) const -{ - wxMenu *itemMenu = NULL; - wxMenuItem *item = FindItemForId(id, &itemMenu) ; - - if (!item) - return wxString(""); - - // TODO - return wxString("") ; -} - -void wxMenuBar::SetLabelTop(int pos, const wxString& label) -{ - // TODO -} - -wxString wxMenuBar::GetLabelTop(int pos) const -{ - // TODO - return wxString(""); -} - -bool wxMenuBar::OnDelete(wxMenu *a_menu, int pos) -{ - // TODO - return FALSE; -} - -bool wxMenuBar::OnAppend(wxMenu *a_menu, const char *title) -{ - // TODO - return FALSE; -} - -void wxMenuBar::Append (wxMenu * menu, const wxString& title) -{ - if (!OnAppend(menu, title)) - return; - - m_menuCount ++; - wxMenu **new_menus = new wxMenu *[m_menuCount]; - wxString *new_titles = new wxString[m_menuCount]; - int i; - - for (i = 0; i < m_menuCount - 1; i++) - { - new_menus[i] = m_menus[i]; - m_menus[i] = NULL; - new_titles[i] = m_titles[i]; - m_titles[i] = ""; - } - if (m_menus) - { - delete[]m_menus; - delete[]m_titles; - } - m_menus = new_menus; - m_titles = new_titles; - - m_menus[m_menuCount - 1] = (wxMenu *)menu; - m_titles[m_menuCount - 1] = title; - - // TODO -} - -void wxMenuBar::Delete(wxMenu * menu, int i) -{ - int j; - int ii = (int) i; - - if (menu != 0) - { - for (ii = 0; ii < m_menuCount; ii++) - { - if (m_menus[ii] == menu) - break; - } - if (ii >= m_menuCount) - return; - } else - { - if (ii < 0 || ii >= m_menuCount) - return; - menu = m_menus[ii]; - } - - if (!OnDelete(menu, ii)) - return; - - menu->SetParent(NULL); - - -- m_menuCount; - for (j = ii; j < m_menuCount; j++) - { - m_menus[j] = m_menus[j + 1]; - m_titles[j] = m_titles[j + 1]; - } -} - -// Find the menu menuString, item itemString, and return the item id. -// Returns -1 if none found. -int wxMenuBar::FindMenuItem (const wxString& menuString, const wxString& itemString) const -{ - char buf1[200]; - char buf2[200]; - wxStripMenuCodes ((char *)(const char *)menuString, buf1); - int i; - for (i = 0; i < m_menuCount; i++) - { - wxStripMenuCodes ((char *)(const char *)m_titles[i], buf2); - if (strcmp (buf1, buf2) == 0) - return m_menus[i]->FindItem (itemString); - } - return -1; -} - -wxMenuItem *wxMenuBar::FindItemForId (int Id, wxMenu ** itemMenu) const -{ - if (itemMenu) - *itemMenu = NULL; - - wxMenuItem *item = NULL; - int i; - for (i = 0; i < m_menuCount; i++) - if ((item = m_menus[i]->FindItemForId (Id, itemMenu))) - return item; - return NULL; -} - -void wxMenuBar::SetHelpString (int Id, const wxString& helpString) -{ - int i; - for (i = 0; i < m_menuCount; i++) - { - if (m_menus[i]->FindItemForId (Id)) - { - m_menus[i]->SetHelpString (Id, helpString); - return; - } - } -} - -wxString wxMenuBar::GetHelpString (int Id) const -{ - int i; - for (i = 0; i < m_menuCount; i++) - { - if (m_menus[i]->FindItemForId (Id)) - eturn wxString(m_menus[i]->GetHelpString (Id)); - } - return wxString(""); -} - - diff --git a/src/qt/notebook.cpp b/src/qt/notebook.cpp deleted file mode 100644 index b0448791a4..0000000000 --- a/src/qt/notebook.cpp +++ /dev/null @@ -1,369 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: notebook.cpp -// Purpose: implementation of wxNotebook -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- -#ifdef __GNUG__ -#pragma implementation "notebook.h" -#endif - -#include -#include -#include -#include - -// ---------------------------------------------------------------------------- -// macros -// ---------------------------------------------------------------------------- - -// check that the page index is valid -#define IS_VALID_PAGE(nPage) (((nPage) >= 0) && ((nPage) < GetPageCount())) - -// ---------------------------------------------------------------------------- -// event table -// ---------------------------------------------------------------------------- - -BEGIN_EVENT_TABLE(wxNotebook, wxControl) - EVT_NOTEBOOK_PAGE_CHANGED(-1, wxNotebook::OnSelChange) - - EVT_SIZE(wxNotebook::OnSize) - EVT_SET_FOCUS(wxNotebook::OnSetFocus) - EVT_NAVIGATION_KEY(wxNotebook::OnNavigationKey) -END_EVENT_TABLE() - -IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxControl) -IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxCommandEvent) - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxNotebook construction -// ---------------------------------------------------------------------------- - -// common part of all ctors -void wxNotebook::Init() -{ - m_pImageList = NULL; - m_nSelection = -1; -} - -// default for dynamic class -wxNotebook::wxNotebook() -{ - Init(); -} - -// the same arguments as for wxControl -wxNotebook::wxNotebook(wxWindow *parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - Init(); - - Create(parent, id, pos, size, style, name); -} - -// Create() function -bool wxNotebook::Create(wxWindow *parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - // base init - SetName(name); - SetParent(parent); - - m_windowId = id == -1 ? NewControlId() : id; - - // colors and font - m_backgroundColour = wxColour(GetSysColor(COLOR_BTNFACE)); - m_foregroundColour = *wxBLACK ; - - // style - m_windowStyle = style; - - if ( parent != NULL ) - parent->AddChild(this); - - // TODO - - return FALSE; -} - -// dtor -wxNotebook::~wxNotebook() -{ -} - -// ---------------------------------------------------------------------------- -// wxNotebook accessors -// ---------------------------------------------------------------------------- -int wxNotebook::GetPageCount() const -{ - return m_aPages.Count(); -} - -int wxNotebook::GetRowCount() const -{ - // TODO - return 0; -} - -int wxNotebook::SetSelection(int nPage) -{ - wxASSERT( IS_VALID_PAGE(nPage) ); - - ChangePage(m_nSelection, nPage); - - // TODO - return 0; -} - -void wxNotebook::AdvanceSelection(bool bForward) -{ - int nSel = GetSelection(); - int nMax = GetPageCount() - 1; - if ( bForward ) - SetSelection(nSel == nMax ? 0 : nSel + 1); - else - SetSelection(nSel == 0 ? nMax : nSel - 1); -} - -bool wxNotebook::SetPageText(int nPage, const wxString& strText) -{ - wxASSERT( IS_VALID_PAGE(nPage) ); - - // TODO - return FALSE; -} - -wxString wxNotebook::GetPageText(int nPage) const -{ - wxASSERT( IS_VALID_PAGE(nPage) ); - - // TODO - return wxString(""); -} - -int wxNotebook::GetPageImage(int nPage) const -{ - wxASSERT( IS_VALID_PAGE(nPage) ); - - // TODO - return 0; -} - -bool wxNotebook::SetPageImage(int nPage, int nImage) -{ - wxASSERT( IS_VALID_PAGE(nPage) ); - - // TODO - return FALSE; -} - -void wxNotebook::SetImageList(wxImageList* imageList) -{ - m_pImageList = imageList; - // TODO -} - -// ---------------------------------------------------------------------------- -// wxNotebook operations -// ---------------------------------------------------------------------------- - -// remove one page from the notebook -bool wxNotebook::DeletePage(int nPage) -{ - wxCHECK( IS_VALID_PAGE(nPage), FALSE ); - - // TODO: delete native widget page - - delete m_aPages[nPage]; - m_aPages.Remove(nPage); - - return TRUE; -} - -// remove all pages -bool wxNotebook::DeleteAllPages() -{ - // TODO: delete native widget pages - - int nPageCount = GetPageCount(); - int nPage; - for ( nPage = 0; nPage < nPageCount; nPage++ ) - delete m_aPages[nPage]; - - m_aPages.Clear(); - - return TRUE; -} - -// add a page to the notebook -bool wxNotebook::AddPage(wxNotebookPage *pPage, - const wxString& strText, - bool bSelect, - int imageId) -{ - return InsertPage(GetPageCount(), pPage, strText, bSelect, imageId); -} - -// same as AddPage() but does it at given position -bool wxNotebook::InsertPage(int nPage, - wxNotebookPage *pPage, - const wxString& strText, - bool bSelect, - int imageId) -{ - wxASSERT( pPage != NULL ); - wxCHECK( IS_VALID_PAGE(nPage) || nPage == GetPageCount(), FALSE ); - - // TODO: insert native widget page - - // save the pointer to the page - m_aPages.Insert(pPage, nPage); - - // some page must be selected: either this one or the first one if there is - // still no selection - if ( bSelect ) - m_nSelection = nPage; - else if ( m_nSelection == -1 ) - m_nSelection = 0; - - return TRUE; -} - -// ---------------------------------------------------------------------------- -// wxNotebook callbacks -// ---------------------------------------------------------------------------- - -// @@@ OnSize() is used for setting the font when it's called for the first -// time because doing it in ::Create() doesn't work (for unknown reasons) -void wxNotebook::OnSize(wxSizeEvent& event) -{ - static bool s_bFirstTime = TRUE; - if ( s_bFirstTime ) { - // TODO: any first-time-size processing. - s_bFirstTime = FALSE; - } - - // TODO: all this may or may not be necessary for your platform - - // emulate page change (it's esp. important to do it first time because - // otherwise our page would stay invisible) - int nSel = m_nSelection; - m_nSelection = -1; - SetSelection(nSel); - - // fit the notebook page to the tab control's display area - int w, hl - GetSize(&w, &h); - - uint nCount = m_aPages.Count(); - for ( uint nPage = 0; nPage < nCount; nPage++ ) { - wxNotebookPage *pPage = m_aPages[nPage]; - pPage->SetSize(0, 0, w, h); - if ( pPage->GetAutoLayout() ) - pPage->Layout(); - } - - // Processing continues to next OnSize - event.Skip(); -} - -void wxNotebook::OnSelChange(wxNotebookEvent& event) -{ - // is it our tab control? - if ( event.GetEventObject() == this ) - ChangePage(event.GetOldSelection(), event.GetSelection()); - - // we want to give others a chance to process this message as well - event.Skip(); -} - -void wxNotebook::OnSetFocus(wxFocusEvent& event) -{ - // set focus to the currently selected page if any - if ( m_nSelection != -1 ) - m_aPages[m_nSelection]->SetFocus(); - - event.Skip(); -} - -void wxNotebook::OnNavigationKey(wxNavigationKeyEvent& event) -{ - if ( event.IsWindowChange() ) { - // change pages - AdvanceSelection(event.GetDirection()); - } - else { - // pass to the parent - if ( GetParent() ) { - event.SetCurrentFocus(this); - GetParent()->ProcessEvent(event); - } - } -} - -// ---------------------------------------------------------------------------- -// wxNotebook base class virtuals -// ---------------------------------------------------------------------------- - -// override these 2 functions to do nothing: everything is done in OnSize - -void wxNotebook::SetConstraintSizes(bool /* recurse */) -{ - // don't set the sizes of the pages - their correct size is not yet known - wxControl::SetConstraintSizes(FALSE); -} - -bool wxNotebook::DoPhase(int /* nPhase */) -{ - return TRUE; -} - -void wxNotebook::Command(wxCommandEvent& event) -{ - wxFAIL_MSG("wxNotebook::Command not implemented"); -} - -// ---------------------------------------------------------------------------- -// wxNotebook helper functions -// ---------------------------------------------------------------------------- - -// hide the currently active panel and show the new one -void wxNotebook::ChangePage(int nOldSel, int nSel) -{ - wxASSERT( nOldSel != nSel ); // impossible - - if ( nOldSel != -1 ) { - m_aPages[nOldSel]->Show(FALSE); - } - - wxNotebookPage *pPage = m_aPages[nSel]; - pPage->Show(TRUE); - pPage->SetFocus(); - - m_nSelection = nSel; -} - diff --git a/src/qt/palette.cpp b/src/qt/palette.cpp deleted file mode 100644 index dfbc153094..0000000000 --- a/src/qt/palette.cpp +++ /dev/null @@ -1,89 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: palette.cpp -// Purpose: wxPalette -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "palette.h" -#endif - -#include "wx/palette.h" - -IMPLEMENT_DYNAMIC_CLASS(wxPalette, wxGDIObject) - -/* - * Palette - * - */ - -wxPaletteRefData::wxPaletteRefData() -{ - // TODO -} - -wxPaletteRefData::~wxPaletteRefData() -{ - // TODO -} - -wxPalette::wxPalette() -{ -} - -wxPalette::wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue) -{ - Create(n, red, green, blue); -} - -wxPalette::~wxPalette() -{ -} - -bool wxPalette::FreeResource(bool force) -{ - if ( M_PALETTEDATA && M_PALETTEDATA->m_hPalette) - { - DeleteObject((HPALETTE)M_PALETTEDATA->m_hPalette); - } - return TRUE; -} - -bool wxPalette::Create(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue) -{ - UnRef(); - - m_refData = new wxPaletteRefData; - - // TODO - - return FALSE; -} - -int wxPalette::GetPixel(const unsigned char red, const unsigned char green, const unsigned char blue) const -{ - if ( !m_refData ) - return FALSE; - - // TODO - return FALSE; -} - -bool wxPalette::GetRGB(int index, unsigned char *red, unsigned char *green, unsigned char *blue) const -{ - if ( !m_refData ) - return FALSE; - - if (index < 0 || index > 255) - return FALSE; - - // TODO - return FALSE; -} - - diff --git a/src/qt/pen.cpp b/src/qt/pen.cpp deleted file mode 100644 index 9ff7032fb2..0000000000 --- a/src/qt/pen.cpp +++ /dev/null @@ -1,227 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: pen.cpp -// Purpose: wxPen -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "pen.h" -#endif - -#include "wx/setup.h" -#include "wx/utils.h" -#include "wx/pen.h" - -IMPLEMENT_DYNAMIC_CLASS(wxPen, wxGDIObject) - -wxPenRefData::wxPenRefData() -{ - m_style = wxSOLID; - m_width = 1; - m_join = wxJOIN_ROUND ; - m_cap = wxCAP_ROUND ; - m_nbDash = 0 ; - m_dash = (wxQTDash*)NULL; -/* TODO: null data - m_hPen = 0; -*/ -} - -wxPenRefData::wxPenRefData(const wxPenRefData& data) -{ - m_style = data.m_style; - m_width = data.m_width; - m_join = data.m_join; - m_cap = data.m_cap; - m_nbDash = data.m_nbDash; - m_dash = data.m_dash; - m_colour = data.m_colour; -/* TODO: null data - m_hPen = 0; -*/ -} - -wxPenRefData::~wxPenRefData() -{ - // TODO: delete data -} - -// Pens - -wxPen::wxPen() -{ - if ( wxThePenList ) - wxThePenList->AddPen(this); -} - -wxPen::~wxPen() -{ - if (wxThePenList) - wxThePenList->RemovePen(this); -} - -// Should implement Create -wxPen::wxPen(const wxColour& col, int Width, int Style) -{ - m_refData = new wxPenRefData; - - M_PENDATA->m_colour = col; - M_PENDATA->m_width = Width; - M_PENDATA->m_style = Style; - M_PENDATA->m_join = wxJOIN_ROUND ; - M_PENDATA->m_cap = wxCAP_ROUND ; - M_PENDATA->m_nbDash = 0 ; - M_PENDATA->m_dash = (wxQTDash*)NULL; - - RealizeResource(); - - if ( wxThePenList ) - wxThePenList->AddPen(this); -} - -wxPen::wxPen(const wxBitmap& stipple, int Width) -{ - m_refData = new wxPenRefData; - - M_PENDATA->m_stipple = stipple; - M_PENDATA->m_width = Width; - M_PENDATA->m_style = wxSTIPPLE; - M_PENDATA->m_join = wxJOIN_ROUND ; - M_PENDATA->m_cap = wxCAP_ROUND ; - M_PENDATA->m_nbDash = 0 ; - M_PENDATA->m_dash = (wxQTDash*)NULL; - - RealizeResource(); - - if ( wxThePenList ) - wxThePenList->AddPen(this); -} - -wxPen::wxPen(const wxString& col, int Width, int Style) -{ - m_refData = new wxPenRefData; - - M_PENDATA->m_colour = col; - M_PENDATA->m_width = Width; - M_PENDATA->m_style = Style; - M_PENDATA->m_join = wxJOIN_ROUND ; - M_PENDATA->m_cap = wxCAP_ROUND ; - M_PENDATA->m_nbDash = 0 ; - M_PENDATA->m_dash = (wxQTDash*)NULL; - - RealizeResource(); - - if ( wxThePenList ) - wxThePenList->AddPen(this); -} - -void wxPen::Unshare() -{ - // Don't change shared data - if (!m_refData) - { - m_refData = new wxPenRefData(); - } - else - { - wxPenRefData* ref = new wxPenRefData(*(wxPenRefData*)m_refData); - UnRef(); - m_refData = ref; - } -} - -void wxPen::SetColour(const wxColour& col) -{ - Unshare(); - - M_PENDATA->m_colour = col; - - RealizeResource(); -} - -void wxPen::SetColour(const wxString& col) -{ - Unshare(); - - M_PENDATA->m_colour = col; - - RealizeResource(); -} - -void wxPen::SetColour(const unsigned char r, const unsigned char g, const unsigned char b) -{ - Unshare(); - - M_PENDATA->m_colour.Set(r, g, b); - - RealizeResource(); -} - -void wxPen::SetWidth(int Width) -{ - Unshare(); - - M_PENDATA->m_width = Width; - - RealizeResource(); -} - -void wxPen::SetStyle(int Style) -{ - Unshare(); - - M_PENDATA->m_style = Style; - - RealizeResource(); -} - -void wxPen::SetStipple(const wxBitmap& Stipple) -{ - Unshare(); - - M_PENDATA->m_stipple = Stipple; - M_PENDATA->m_style = wxSTIPPLE; - - RealizeResource(); -} - -void wxPen::SetDashes(int nb_dashes, const wxDash *Dash) -{ - Unshare(); - - M_PENDATA->m_nbDash = nb_dashes; - M_PENDATA->m_dash = (wxQTDash *)Dash; - - RealizeResource(); -} - -void wxPen::SetJoin(int Join) -{ - Unshare(); - - M_PENDATA->m_join = Join; - - RealizeResource(); -} - -void wxPen::SetCap(int Cap) -{ - Unshare(); - - M_PENDATA->m_cap = Cap; - - RealizeResource(); -} - -bool wxPen::RealizeResource() -{ - // TODO: create actual pen - return FALSE; -} - - diff --git a/src/qt/radiobox.cpp b/src/qt/radiobox.cpp deleted file mode 100644 index a3ecae6d01..0000000000 --- a/src/qt/radiobox.cpp +++ /dev/null @@ -1,192 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: radiobox.cpp -// Purpose: wxRadioBox -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "radiobox.h" -#endif - -#include "wx/radiobox.h" - -IMPLEMENT_DYNAMIC_CLASS(wxRadioBox, wxControl) - -// Radio box item -wxRadioBox::wxRadioBox() -{ - m_selectedButton = -1; - m_noItems = 0; - m_noRowsOrCols = 0; - m_majorDim = 0 ; -} - -bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& title, - const wxPoint& pos, const wxSize& size, - int n, const wxString choices[], - int majorDim, long style, - const wxValidator& val, const wxString& name) -{ - m_selectedButton = -1; - m_noItems = n; - - SetName(name); - SetValidator(val); - - parent->AddChild(this); - - m_windowStyle = (long&)style; - - if (id == -1) - m_windowId = NewControlId(); - else - m_windowId = id; - - m_noRowsOrCols = majorDim; - - if (majorDim==0) - m_majorDim = n ; - else - m_majorDim = majorDim ; - - - // TODO create radiobox - return FALSE; -} - - -wxRadioBox::~wxRadioBox() -{ - // TODO -} - -wxString wxRadioBox::GetLabel(int item) const -{ - // TODO - return wxString(""); -} - -void wxRadioBox::SetLabel(int item, const wxString& label) -{ - // TODO -} - -int wxRadioBox::FindString(const wxString& s) const -{ - // TODO - return -1; -} - -void wxRadioBox::SetSelection(int n) -{ - if ((n < 0) || (n >= m_noItems)) - return; - // TODO - - m_selectedButton = n; -} - -// Get single selection, for single choice list items -int wxRadioBox::GetSelection() const -{ - return m_selectedButton; -} - -// Find string for position -wxString wxRadioBox::GetString(int n) const -{ - // TODO - return wxString(""); -} - -void wxRadioBox::SetSize(int x, int y, int width, int height, int sizeFlags) -{ - // TODO -} - -void wxRadioBox::GetSize(int *width, int *height) const -{ - // TODO -} - -void wxRadioBox::GetPosition(int *x, int *y) const -{ - // TODO -} - -wxString wxRadioBox::GetLabel() const -{ - // TODO - return wxString(""); -} - -void wxRadioBox::SetLabel(const wxString& label) -{ - // TODO -} - -void wxRadioBox::SetFocus() -{ - // TODO -} - -bool wxRadioBox::Show(bool show) -{ - // TODO - return FALSE; -} - -// Enable a specific button -void wxRadioBox::Enable(int item, bool enable) -{ - // TODO -} - -// Enable all controls -void wxRadioBox::Enable(bool enable) -{ - wxControl::Enable(enable); - - // TODO -} - -// Show a specific button -void wxRadioBox::Show(int item, bool show) -{ - // TODO -} - -// For single selection items only -wxString wxRadioBox::GetStringSelection () const -{ - int sel = GetSelection (); - if (sel > -1) - return this->GetString (sel); - else - return wxString(""); -} - -bool wxRadioBox::SetStringSelection (const wxString& s) -{ - int sel = FindString (s); - if (sel > -1) - { - SetSelection (sel); - return TRUE; - } - else - return FALSE; -} - -void wxRadioBox::Command (wxCommandEvent & event) -{ - SetSelection (event.m_commandInt); - ProcessCommand (event); -} - - diff --git a/src/qt/radiobut.cpp b/src/qt/radiobut.cpp deleted file mode 100644 index 3fd6d78d2d..0000000000 --- a/src/qt/radiobut.cpp +++ /dev/null @@ -1,66 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: radiobut.cpp -// Purpose: wxRadioButton -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "radiobut.h" -#endif - -#include "wx/radiobut.h" - -IMPLEMENT_DYNAMIC_CLASS(wxRadioButton, wxControl) - -bool wxRadioButton::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); - - if (parent) parent->AddChild(this); - - if ( id == -1 ) - m_windowId = (int)NewControlId(); - else - m_windowId = id; - - m_windowStyle = style ; - - // TODO create radiobutton - return FALSE; -} - -void wxRadioButton::SetLabel(const wxString& label) -{ - // TODO -} - -void wxRadioButton::SetValue(bool value) -{ - // TODO -} - -// Get single selection, for single choice list items -bool wxRadioButton::GetValue() const -{ - // TODO - return FALSE; -} - -void wxRadioButton::Command (wxCommandEvent & event) -{ - SetValue ( (event.m_commandInt != 0) ); - ProcessCommand (event); -} - - diff --git a/src/qt/region.cpp b/src/qt/region.cpp deleted file mode 100644 index 7945594c99..0000000000 --- a/src/qt/region.cpp +++ /dev/null @@ -1,371 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// File: region.cpp -// Purpose: Region class -// Author: Markus Holzem/Julian Smart/AUTHOR -// Created: Fri Oct 24 10:46:34 MET 1997 -// RCS-ID: $Id$ -// Copyright: (c) 1997 Markus Holzem/Julian Smart/AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "region.h" -#endif - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ -#pragma hdrstop -#endif - -#include "wx/msw/region.h" -#include "wx/gdicmn.h" - -#include - - IMPLEMENT_DYNAMIC_CLASS(wxRegion, wxGDIObject) - IMPLEMENT_DYNAMIC_CLASS(wxRegionIterator, wxObject) - -//----------------------------------------------------------------------------- -// wxRegionRefData implementation -//----------------------------------------------------------------------------- - -class WXDLLEXPORT wxRegionRefData : public wxGDIRefData { -public: - wxRegionRefData() - { - } - - wxRegionRefData(const wxRegionRefData& data) - { - // TODO - } - - ~wxRegionRefData() - { - // TODO - } - - HRGN m_region; -}; - - -//----------------------------------------------------------------------------- -// wxRegion -//----------------------------------------------------------------------------- - -/*! - * Create an empty region. - */ -wxRegion::wxRegion() -{ - m_refData = new wxRegionRefData; - // TODO create empty region -} - -wxRegion::wxRegion(long x, long y, long w, long h) -{ - m_refData = new wxRegionRefData; - // TODO create rect region -} - -wxRegion::wxRegion(const wxPoint& topLeft, const wxPoint& bottomRight) -{ - m_refData = new wxRegionRefData; - // TODO create rect region -} - -wxRegion::wxRegion(const wxRect& rect) -{ - m_refData = new wxRegionRefData; - // TODO create rect region -} - -/*! - * Destroy the region. - */ -wxRegion::~wxRegion() -{ - // m_refData unrefed in ~wxObject -} - -//----------------------------------------------------------------------------- -//# Modify region -//----------------------------------------------------------------------------- - -//! Clear current region -void wxRegion::Clear() -{ - UnRef(); -} - -//! Combine rectangle (x, y, w, h) with this. -bool wxRegion::Combine(long x, long y, long width, long height, wxRegionOp op) -{ - // Don't change shared data - if (!m_refData) { - m_refData = new wxRegionRefData(); - } else if (m_refData->GetRefCount() > 1) { - wxRegionRefData* ref = (wxRegionRefData*)m_refData; - UnRef(); - m_refData = new wxRegionRefData(*ref); - } - // If ref count is 1, that means it's 'ours' anyway so no action. - - // TODO create rect region - - int mode = 0; // TODO platform-specific code - switch (op) - { - case wxRGN_AND: - // TODO - break ; - case wxRGN_OR: - // TODO - break ; - case wxRGN_XOR: - // TODO - break ; - case wxRGN_DIFF: - // TODO - break ; - case wxRGN_COPY: - default: - // TODO - break ; - } - - // TODO do combine region - - return FALSE; -} - -//! Union /e region with this. -bool wxRegion::Combine(const wxRegion& region, wxRegionOp op) -{ - if (region.Empty()) - return FALSE; - - // Don't change shared data - if (!m_refData) { - m_refData = new wxRegionRefData(); - } else if (m_refData->GetRefCount() > 1) { - wxRegionRefData* ref = (wxRegionRefData*)m_refData; - UnRef(); - m_refData = new wxRegionRefData(*ref); - } - - int mode = 0; // TODO platform-specific code - switch (op) - { - case wxRGN_AND: - // TODO - break ; - case wxRGN_OR: - // TODO - break ; - case wxRGN_XOR: - // TODO - break ; - case wxRGN_DIFF: - // TODO - break ; - case wxRGN_COPY: - default: - // TODO - break ; - } - - // TODO combine region - - return FALSE; -} - -bool wxRegion::Combine(const wxRect& rect, wxRegionOp op) -{ - return Combine(rect.GetLeft(), rect.GetTop(), rect.GetWidth(), rect.GetHeight(), op); -} - -//----------------------------------------------------------------------------- -//# Information on region -//----------------------------------------------------------------------------- - -// Outer bounds of region -void wxRegion::GetBox(long& x, long& y, long&w, long &h) const -{ - if (m_refData) { - // TODO get box - } else { - x = y = w = h = 0; - } -} - -wxRect wxRegion::GetBox() const -{ - long x, y, w, h; - GetBox(x, y, w, h); - return wxRect(x, y, w, h); -} - -// Is region empty? -bool wxRegion::Empty() const -{ - // TODO - return FALSE; -} - -//----------------------------------------------------------------------------- -//# Tests -//----------------------------------------------------------------------------- - -// Does the region contain the point (x,y)? -wxRegionContain wxRegion::Contains(long x, long y) const -{ - if (!m_refData) - return wxOutRegion; - - // TODO. Return wxInRegion if within region. - if (0) - return wxInRegion; - return wxOutRegion; -} - -// Does the region contain the point pt? -wxRegionContain wxRegion::Contains(const wxPoint& pt) const -{ - if (!m_refData) - return wxOutRegion; - - // TODO. Return wxInRegion if within region. - if (0) - return wxInRegion; - else - return wxOutRegion; -} - -// Does the region contain the rectangle (x, y, w, h)? -wxRegionContain wxRegion::Contains(long x, long y, long w, long h) const -{ - if (!m_refData) - return wxOutRegion; - - // TODO. Return wxInRegion if within region. - if (0) - return wxInRegion; - else - return wxOutRegion; -} - -// Does the region contain the rectangle rect -wxRegionContain wxRegion::Contains(const wxRect& rect) const -{ - if (!m_refData) - return wxOutRegion; - - long x, y, w, h; - x = rect.x; - y = rect.y; - w = rect.GetWidth(); - h = rect.GetHeight(); - return Contains(x, y, w, h); -} - -/////////////////////////////////////////////////////////////////////////////// -// // -// wxRegionIterator // -// // -/////////////////////////////////////////////////////////////////////////////// - -/*! - * Initialize empty iterator - */ -wxRegionIterator::wxRegionIterator() : m_current(0), m_numRects(0), m_rects(NULL) -{ -} - -wxRegionIterator::~wxRegionIterator() -{ - if (m_rects) - delete[] m_rects; -} - -/*! - * Initialize iterator for region - */ -wxRegionIterator::wxRegionIterator(const wxRegion& region) -{ - m_rects = NULL; - - Reset(region); -} - -/*! - * Reset iterator for a new /e region. - */ -void wxRegionIterator::Reset(const wxRegion& region) -{ - m_current = 0; - m_region = region; - - if (m_rects) - delete[] m_rects; - - m_rects = NULL; - - if (m_region.Empty()) - m_numRects = 0; - else - { - // TODO create m_rects and fill with rectangles for this region - m_numRects = 0; - } -} - -/*! - * Increment iterator. The rectangle returned is the one after the - * incrementation. - */ -void wxRegionIterator::operator ++ () -{ - if (m_current < m_numRects) - ++m_current; -} - -/*! - * Increment iterator. The rectangle returned is the one before the - * incrementation. - */ -void wxRegionIterator::operator ++ (int) -{ - if (m_current < m_numRects) - ++m_current; -} - -long wxRegionIterator::GetX() const -{ - if (m_current < m_numRects) - return m_rects[m_current].x; - return 0; -} - -long wxRegionIterator::GetY() const -{ - if (m_current < m_numRects) - return m_rects[m_current].y; - return 0; -} - -long wxRegionIterator::GetW() const -{ - if (m_current < m_numRects) - return m_rects[m_current].width ; - return 0; -} - -long wxRegionIterator::GetH() const -{ - if (m_current < m_numRects) - return m_rects[m_current].height; - return 0; -} - diff --git a/src/qt/scrolbar.cpp b/src/qt/scrolbar.cpp deleted file mode 100644 index 942fe02228..0000000000 --- a/src/qt/scrolbar.cpp +++ /dev/null @@ -1,76 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: scrolbar.cpp -// Purpose: wxScrollBar -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "scrolbar.h" -#endif - -#include "wx/scrolbar.h" - -IMPLEMENT_DYNAMIC_CLASS(wxScrollBar, wxControl) - - -// Scrollbar -bool wxScrollBar::Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos, - const wxSize& size, long style, - const wxValidator& validator, - const wxString& name) -{ - if (!parent) - return FALSE; - parent->AddChild(this); - SetName(name); - SetValidator(validator); - - m_windowStyle = style; - - if ( id == -1 ) - m_windowId = (int)NewControlId(); - else - m_windowId = id; - - // TODO create scrollbar - return TRUE; -} - -wxScrollBar::~wxScrollBar() -{ -} - -void wxScrollBar::SetPosition(int viewStart) -{ - // TODO -} - -int wxScrollBar::GetPosition() const -{ - // TODO - return 0; -} - -void wxScrollBar::SetScrollbar(int position, int thumbSize, int range, int pageSize, - bool refresh) -{ - m_viewSize = pageSize; - m_pageSize = thumbSize; - m_objectSize = range; - - // TODO -} - - -void wxScrollBar::Command(wxCommandEvent& event) -{ - SetValue(event.m_commandInt); - ProcessCommand(event); -} - diff --git a/src/qt/settings.cpp b/src/qt/settings.cpp deleted file mode 100644 index 0450dbc8e4..0000000000 --- a/src/qt/settings.cpp +++ /dev/null @@ -1,151 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: settings.cpp -// Purpose: wxSettings -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "settings.h" -#endif - -#include "wx/settings.h" - -wxColour wxSystemSettings::GetSystemColour(int index) -{ - // TODO - return col; -} - -wxFont wxSystemSettings::GetSystemFont(int index) -{ - // TODO - return wxFont; -} - -// Get a system metric, e.g. scrollbar size -int wxSystemSettings::GetSystemMetric(int index) -{ - switch ( index) - { - case wxSYS_MOUSE_BUTTONS: - // TODO - return 0; - case wxSYS_BORDER_X: - // TODO - return 0; - case wxSYS_BORDER_Y: - // TODO - return 0; - case wxSYS_CURSOR_X: - // TODO - return 0; - case wxSYS_CURSOR_Y: - // TODO - return 0; - case wxSYS_DCLICK_X: - // TODO - return 0; - case wxSYS_DCLICK_Y: - // TODO - return 0; - case wxSYS_DRAG_X: - // TODO - return 0; - case wxSYS_DRAG_Y: - // TODO - return 0; - case wxSYS_EDGE_X: - // TODO - return 0; - case wxSYS_EDGE_Y: - // TODO - return 0; - case wxSYS_HSCROLL_ARROW_X: - // TODO - return 0; - case wxSYS_HSCROLL_ARROW_Y: - // TODO - return 0; - case wxSYS_HTHUMB_X: - // TODO - return 0; - case wxSYS_ICON_X: - // TODO - return 0; - case wxSYS_ICON_Y: - // TODO - return 0; - case wxSYS_ICONSPACING_X: - // TODO - return 0; - case wxSYS_ICONSPACING_Y: - // TODO - return 0; - case wxSYS_WINDOWMIN_X: - // TODO - return 0; - case wxSYS_WINDOWMIN_Y: - // TODO - return 0; - case wxSYS_SCREEN_X: - // TODO - return 0; - case wxSYS_SCREEN_Y: - // TODO - return 0; - case wxSYS_FRAMESIZE_X: - // TODO - return 0; - case wxSYS_FRAMESIZE_Y: - // TODO - return 0; - case wxSYS_SMALLICON_X: - // TODO - return 0; - case wxSYS_SMALLICON_Y: - // TODO - return 0; - case wxSYS_HSCROLL_Y: - // TODO - return 0; - case wxSYS_VSCROLL_X: - // TODO - return 0; - case wxSYS_VSCROLL_ARROW_X: - // TODO - return 0; - case wxSYS_VSCROLL_ARROW_Y: - // TODO - return 0; - case wxSYS_VTHUMB_Y: - // TODO - return 0; - case wxSYS_CAPTION_Y: - // TODO - return 0; - case wxSYS_MENU_Y: - // TODO - return 0; - case wxSYS_NETWORK_PRESENT: - // TODO - return 0; - case wxSYS_PENWINDOWS_PRESENT: - // TODO - return 0; - case wxSYS_SHOW_SOUNDS: - // TODO - return 0; - case wxSYS_SWAP_BUTTONS: - // TODO - return 0; - default: - return 0; - } - return 0; -} - diff --git a/src/qt/slider.cpp b/src/qt/slider.cpp deleted file mode 100644 index b3d00c8af6..0000000000 --- a/src/qt/slider.cpp +++ /dev/null @@ -1,183 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: slider.cpp -// Purpose: wxSlider -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "slider.h" -#endif - -#include "wx/msw/slider.h" - -IMPLEMENT_DYNAMIC_CLASS(wxSlider, wxControl) - -// Slider -wxSlider::wxSlider() -{ - m_pageSize = 1; - m_lineSize = 1; - m_rangeMax = 0; - m_rangeMin = 0; - m_tickFreq = 0; -} - -bool wxSlider::Create(wxWindow *parent, wxWindowID id, - int value, int minValue, int maxValue, - const wxPoint& pos, - const wxSize& size, long style, - const wxValidator& validator, - const wxString& name) -{ - SetName(name); - SetValidator(validator); - - if (parent) parent->AddChild(this); - - m_lineSize = 1; - m_windowStyle = style; - m_tickFreq = 0; - - if ( id == -1 ) - m_windowId = (int)NewControlId(); - else - m_windowId = id; - - m_rangeMax = maxValue; - m_rangeMin = minValue; - - m_pageSize = (int)((maxValue-minValue)/10); - - // TODO create slider - - return FALSE; -} - -wxSlider::~wxSlider() -{ -} - -int wxSlider::GetValue() const -{ - // TODO - return 0; -} - -void wxSlider::SetValue(int value) -{ - // TODO -} - -void wxSlider::GetSize(int *width, int *height) const -{ - // TODO -} - -void wxSlider::GetPosition(int *x, int *y) const -{ - // TODO -} - -void wxSlider::SetSize(int x, int y, int width, int height, int sizeFlags) -{ - // TODO -} - -void wxSlider::SetRange(int minValue, int maxValue) -{ - m_rangeMin = minValue; - m_rangeMax = maxValue; - - // TODO -} - -// For trackbars only -void wxSlider::SetTickFreq(int n, int pos) -{ - // TODO - m_tickFreq = n; -} - -void wxSlider::SetPageSize(int pageSize) -{ - // TODO - m_pageSize = pageSize; -} - -int wxSlider::GetPageSize() const -{ - return m_pageSize; -} - -void wxSlider::ClearSel() -{ - // TODO -} - -void wxSlider::ClearTicks() -{ - // TODO -} - -void wxSlider::SetLineSize(int lineSize) -{ - m_lineSize = lineSize; - // TODO -} - -int wxSlider::GetLineSize() const -{ - // TODO - return 0; -} - -int wxSlider::GetSelEnd() const -{ - // TODO - return 0; -} - -int wxSlider::GetSelStart() const -{ - // TODO - return 0; -} - -void wxSlider::SetSelection(int minPos, int maxPos) -{ - // TODO -} - -void wxSlider::SetThumbLength(int len) -{ - // TODO -} - -int wxSlider::GetThumbLength() const -{ - // TODO - return 0; -} - -void wxSlider::SetTick(int tickPos) -{ - // TODO -} - -void wxSlider::Command (wxCommandEvent & event) -{ - SetValue (event.GetInt()); - ProcessCommand (event); -} - -bool wxSlider::Show(bool show) -{ - // TODO - return TRUE; -} - diff --git a/src/qt/statbmp.cpp b/src/qt/statbmp.cpp deleted file mode 100644 index 115d5cc999..0000000000 --- a/src/qt/statbmp.cpp +++ /dev/null @@ -1,57 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: statbmp.cpp -// Purpose: wxStaticBitmap -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "statbmp.h" -#endif - -#include "wx/statbmp.h" - -IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap, wxControl) - -/* - * wxStaticBitmap - */ - -bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID id, - const wxBitmap& bitmap, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - m_messageBitmap = bitmap; - SetName(name); - if (parent) parent->AddChild(this); - - if ( id == -1 ) - m_windowId = (int)NewControlId(); - else - m_windowId = id; - - m_windowStyle = style; - - // TODO: create static bitmap control - return FALSE; -} - -void wxStaticBitmap::SetSize(int x, int y, int width, int height, int sizeFlags) -{ - // TODO -} - -void wxStaticBitmap::SetBitmap(const wxBitmap& bitmap) -{ - m_messageBitmap = bitmap; - - // TODO: redraw bitmap -} - diff --git a/src/qt/statbox.cpp b/src/qt/statbox.cpp deleted file mode 100644 index 95bfc3b2c4..0000000000 --- a/src/qt/statbox.cpp +++ /dev/null @@ -1,60 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: statbox.cpp -// Purpose: wxStaticBox -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "statbox.h" -#endif - -#include "wx/statbox.h" - -IMPLEMENT_DYNAMIC_CLASS(wxStaticBox, wxControl) - -BEGIN_EVENT_TABLE(wxStaticBox, wxControl) - EVT_ERASE_BACKGROUND(wxStaticBox::OnEraseBackground) -END_EVENT_TABLE() - - -/* - * Static box - */ - -bool wxStaticBox::Create(wxWindow *parent, wxWindowID id, - const wxString& label, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - SetName(name); - - if (parent) parent->AddChild(this); - - if ( id == -1 ) - m_windowId = (int)NewControlId(); - else - m_windowId = id; - - m_windowStyle = style; - - // TODO: create static box - return FALSE; -} - -void wxStaticBox::SetLabel(const wxString& label) -{ - // TODO -} - -void wxStaticBox::SetSize(int x, int y, int width, int height, int sizeFlags) -{ - // TODO -} - diff --git a/src/qt/stattext.cpp b/src/qt/stattext.cpp deleted file mode 100644 index 7f551c4569..0000000000 --- a/src/qt/stattext.cpp +++ /dev/null @@ -1,209 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: stattext.cpp -// Purpose: wxStaticText -// Author: AUTHOR -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "stattext.h" -#endif - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ -#pragma hdrstop -#endif - -#ifndef WX_PRECOMP -#include "wx/app.h" -#endif - -#include "wx/stattext.h" -#include "wx/msw/private.h" -#include - -IMPLEMENT_DYNAMIC_CLASS(wxStaticText, wxControl) - -bool wxStaticText::Create(wxWindow *parent, wxWindowID id, - const wxString& label, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - SetName(name); - if (parent) parent->AddChild(this); - - SetBackgroundColour(parent->GetDefaultBackgroundColour()) ; - SetForegroundColour(parent->GetDefaultForegroundColour()) ; - - if ( id == -1 ) - m_windowId = (int)NewControlId(); - else - m_windowId = id; - - int x = pos.x; - int y = pos.y; - int width = size.x; - int height = size.y; - - m_windowStyle = style; - - long msStyle = WS_CHILD|WS_VISIBLE; - if (m_windowStyle & wxALIGN_CENTRE) - msStyle |= SS_CENTER; - else if (m_windowStyle & wxALIGN_RIGHT) - msStyle |= SS_RIGHT; - else - msStyle |= SS_LEFT; - - // Even with extended styles, need to combine with WS_BORDER - // for them to look right. - if ((m_windowStyle & wxSIMPLE_BORDER) || (m_windowStyle & wxRAISED_BORDER) || - (m_windowStyle & wxSUNKEN_BORDER) || (m_windowStyle & wxDOUBLE_BORDER)) - msStyle |= WS_BORDER; - - HWND static_item = CreateWindowEx(MakeExtendedStyle(m_windowStyle), "STATIC", (const char *)label, - msStyle, - 0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)m_windowId, - wxGetInstance(), NULL); - -#if CTL3D -/* - if (!(GetParent()->GetWindowStyleFlag() & wxUSER_COLOURS)) - Ctl3dSubclassCtl(static_item); -*/ -#endif - - m_hWnd = (WXHWND)static_item; - - SubclassWin((WXHWND)static_item); - - SetFont(* parent->GetFont()); - SetSize(x, y, width, height); - return TRUE; -} - -void wxStaticText::SetSize(int x, int y, int width, int height, int sizeFlags) -{ - int currentX, currentY; - GetPosition(¤tX, ¤tY); - int x1 = x; - int y1 = y; - - if (x == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE)) - x1 = currentX; - if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE)) - y1 = currentY; - - AdjustForParentClientOrigin(x1, y1, sizeFlags); - - int actualWidth = width; - int actualHeight = height; - - char buf[300]; - int current_width; - int cyf; - - ::GetWindowText((HWND) GetHWND(), buf, 300); - GetTextExtent(buf, ¤t_width, &cyf, NULL, NULL,GetFont()); - - int ww, hh; - GetSize(&ww, &hh); - - // If we're prepared to use the existing width, then... - if (width == -1 && ((sizeFlags & wxSIZE_AUTO_WIDTH) != wxSIZE_AUTO_WIDTH)) - actualWidth = ww; - else if (width == -1) - { - int cx; - int cy; - wxGetCharSize(GetHWND(), &cx, &cy,GetFont()); - actualWidth = (int)(current_width + cx) ; - } - - // If we're prepared to use the existing height, then... - if (height == -1 && ((sizeFlags & wxSIZE_AUTO_HEIGHT) != wxSIZE_AUTO_HEIGHT)) - actualHeight = hh; - else if (height == -1) - { - actualHeight = (int)(cyf) ; - } - - MoveWindow((HWND) GetHWND(), x1, y1, actualWidth, actualHeight, TRUE); -} - -void wxStaticText::SetLabel(const wxString& label) -{ - int w, h; - RECT rect; - - wxWindow *parent = GetParent(); - GetWindowRect((HWND) GetHWND(), &rect); - - // Since we now have the absolute screen coords, - // if there's a parent we must subtract its top left corner - POINT point; - point.x = rect.left; - point.y = rect.top; - if (parent) - { - ::ScreenToClient((HWND) parent->GetHWND(), &point); - } - - GetTextExtent(label, &w, &h, NULL, NULL, GetFont()); - MoveWindow((HWND) GetHWND(), point.x, point.y, (int)(w + 10), (int)h, - TRUE); - SetWindowText((HWND) GetHWND(), (const char *)label); -} - -WXHBRUSH wxStaticText::OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor, - WXUINT message, WXWPARAM wParam, WXLPARAM lParam) -{ -/* -#if CTL3D - if ( m_useCtl3D ) - { - HBRUSH hbrush = Ctl3dCtlColorEx(message, wParam, lParam); - - if (hbrush != (HBRUSH) 0) - return hbrush; - else - return (HBRUSH)MSWDefWindowProc(message, wParam, lParam); - } -#endif -*/ - - if (GetParent()->GetTransparentBackground()) - SetBkMode((HDC) pDC, TRANSPARENT); - else - SetBkMode((HDC) pDC, OPAQUE); - - ::SetBkColor((HDC) pDC, RGB(GetBackgroundColour().Red(), GetBackgroundColour().Green(), GetBackgroundColour().Blue())); - ::SetTextColor((HDC) pDC, RGB(GetForegroundColour().Red(), GetForegroundColour().Green(), GetForegroundColour().Blue())); - - wxBrush *backgroundBrush = wxTheBrushList->FindOrCreateBrush(GetBackgroundColour(), wxSOLID); - - // Note that this will be cleaned up in wxApp::OnIdle, if backgroundBrush - // has a zero usage count. -// backgroundBrush->RealizeResource(); - return (WXHBRUSH) backgroundBrush->GetResourceHandle(); -} - -long wxStaticText::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) -{ - // Ensure that static items get messages. Some controls don't like this - // message to be intercepted (e.g. RichEdit), hence the tests. - if (nMsg == WM_NCHITTEST) - return (long)HTCLIENT; - - return wxWindow::MSWWindowProc(nMsg, wParam, lParam); -} - - diff --git a/src/qt/tbargtk.cpp b/src/qt/tbargtk.cpp deleted file mode 100644 index f2c8dfcd74..0000000000 --- a/src/qt/tbargtk.cpp +++ /dev/null @@ -1,193 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: tbargtk.cpp -// Purpose: GTK toolbar -// Author: Robert Roebling -// Modified by: -// Created: 01/02/97 -// RCS-ID: -// Copyright: (c) Robert Roebling -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "tbargtk.h" -#endif - -#include "wx/toolbar.h" - -//----------------------------------------------------------------------------- -// wxToolBarTool -//----------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxToolBarTool,wxObject) - -wxToolBarTool::wxToolBarTool( wxToolBar *owner, int theIndex, - const wxBitmap& bitmap1, const wxBitmap& bitmap2, - bool toggle, wxObject *clientData, - const wxString& shortHelpString, const wxString& longHelpString ) -{ - m_owner = owner; - m_index = theIndex; - m_bitmap1 = bitmap1; - m_bitmap2 = bitmap2; - m_isToggle = toggle; - m_enabled = TRUE; - m_toggleState = FALSE; - m_shortHelpString = shortHelpString; - m_longHelpString = longHelpString; - m_isMenuCommand = TRUE; - m_clientData = clientData; - m_deleteSecondBitmap = FALSE; -}; - -wxToolBarTool::~wxToolBarTool(void) -{ -}; - -//----------------------------------------------------------------------------- -// wxToolBar -//----------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxToolBar,wxControl) - -BEGIN_EVENT_TABLE(wxToolBar, wxControl) -END_EVENT_TABLE() - -wxToolBar::wxToolBar(void) -{ -}; - -wxToolBar::wxToolBar( wxWindow *parent, wxWindowID id, - const wxPoint& pos, const wxSize& size, - long style, const wxString& name ) -{ - Create( parent, id, pos, size, style, name ); -}; - -wxToolBar::~wxToolBar(void) -{ -}; - -bool wxToolBar::Create( wxWindow *parent, wxWindowID id, - const wxPoint& pos, const wxSize& size, - long style, const wxString& name ) -{ - return TRUE; -}; - -bool wxToolBar::OnLeftClick( int toolIndex, bool toggleDown ) -{ - wxCommandEvent event( wxEVT_COMMAND_TOOL_CLICKED, toolIndex ); - event.SetEventObject(this); - event.SetInt( toolIndex ); - event.SetExtraLong((long) toggleDown); - - GetEventHandler()->ProcessEvent(event); - - return TRUE; -}; - -void wxToolBar::OnRightClick( int toolIndex, float WXUNUSED(x), float WXUNUSED(y) ) -{ - wxCommandEvent event( wxEVT_COMMAND_TOOL_RCLICKED, toolIndex ); - event.SetEventObject( this ); - event.SetInt( toolIndex ); - - GetEventHandler()->ProcessEvent(event); -}; - -void wxToolBar::OnMouseEnter( int toolIndex ) -{ - wxCommandEvent event( wxEVT_COMMAND_TOOL_ENTER, toolIndex ); - event.SetEventObject(this); - event.SetInt( toolIndex ); - - GetEventHandler()->ProcessEvent(event); -}; - -wxToolBarTool *wxToolBar::AddTool( int toolIndex, const wxBitmap& bitmap, - const wxBitmap& pushedBitmap, bool toggle, - float WXUNUSED(xPos), float WXUNUSED(yPos), wxObject *clientData, - const wxString& helpString1, const wxString& helpString2 ) -{ -}; - -void wxToolBar::AddSeparator(void) -{ -}; - -void wxToolBar::ClearTools(void) -{ -}; - -void wxToolBar::Realize(void) -{ -}; - -void wxToolBar::EnableTool(int toolIndex, bool enable) -{ - wxNode *node = m_tools.First(); - while (node) - { - wxToolBarTool *tool = (wxToolBarTool*)node->Data(); - if (tool->m_index == toolIndex) - { - tool->m_enabled = enable; - return; - } - node = node->Next(); - }; -}; - -void wxToolBar::ToggleTool(int WXUNUSED(toolIndex), bool WXUNUSED(toggle) ) -{ -}; - -wxObject *wxToolBar::GetToolClientData(int index) const -{ - wxNode *node = m_tools.First(); - while (node) - { - wxToolBarTool *tool = (wxToolBarTool*)node->Data(); - if (tool->m_index == index) return tool->m_clientData;; - node = node->Next(); - }; - return (wxObject*)NULL; -}; - -bool wxToolBar::GetToolState(int toolIndex) const -{ - wxNode *node = m_tools.First(); - while (node) - { - wxToolBarTool *tool = (wxToolBarTool*)node->Data(); - if (tool->m_index == toolIndex) return tool->m_toggleState; - node = node->Next(); - }; - return FALSE; -}; - -bool wxToolBar::GetToolEnabled(int toolIndex) const -{ - wxNode *node = m_tools.First(); - while (node) - { - wxToolBarTool *tool = (wxToolBarTool*)node->Data(); - if (tool->m_index == toolIndex) return tool->m_enabled; - node = node->Next(); - }; - return FALSE; -}; - -void wxToolBar::SetMargins( int WXUNUSED(x), int WXUNUSED(y) ) -{ -}; - -void wxToolBar::SetToolPacking( int WXUNUSED(packing) ) -{ -}; - -void wxToolBar::SetToolSeparation( int separation ) -{ -}; - diff --git a/src/qt/textctrl.cpp b/src/qt/textctrl.cpp deleted file mode 100644 index f8267f300b..0000000000 --- a/src/qt/textctrl.cpp +++ /dev/null @@ -1,442 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: textctrl.cpp -// Purpose: wxTextCtrl -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "textctrl.h" -#endif - -#include -#include -#include - -#include "wx/textctrl.h" -#include "wx/settings.h" - -#if defined(__BORLANDC__) && !defined(__WIN32__) -#include -#else -#ifndef __GNUWIN32__ -#include -#endif -#endif - -IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl, wxControl) - -BEGIN_EVENT_TABLE(wxTextCtrl, wxControl) - EVT_CHAR(wxTextCtrl::OnChar) - EVT_DROP_FILES(wxTextCtrl::OnDropFiles) - EVT_ERASE_BACKGROUND(wxTextCtrl::OnEraseBackground) -END_EVENT_TABLE() - -// Text item -wxTextCtrl::wxTextCtrl() -#ifndef NO_TEXT_WINDOW_STREAM - :streambuf() -#endif -{ - m_fileName = ""; -} - -bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id, - const wxString& value, - const wxPoint& pos, - const wxSize& size, long style, - const wxValidator& validator, - const wxString& name) -{ - m_fileName = ""; - SetName(name); - SetValidator(validator); - if (parent) parent->AddChild(this); - - m_windowStyle = style; - - if ( id == -1 ) - m_windowId = (int)NewControlId(); - else - m_windowId = id; - - return TRUE; -} - -wxString wxTextCtrl::GetValue() const -{ - // TODO - return wxString(""); -} - -void wxTextCtrl::SetValue(const wxString& value) -{ - // TODO -} - -void wxTextCtrl::SetSize(int x, int y, int width, int height, int sizeFlags) -{ - // TODO -} - -// Clipboard operations -void wxTextCtrl::Copy() -{ - // TODO -} - -void wxTextCtrl::Cut() -{ - // TODO -} - -void wxTextCtrl::Paste() -{ - // TODO -} - -void wxTextCtrl::SetEditable(bool editable) -{ - // TODO -} - -void wxTextCtrl::SetInsertionPoint(long pos) -{ - // TODO -} - -void wxTextCtrl::SetInsertionPointEnd() -{ - long pos = GetLastPosition(); - SetInsertionPoint(pos); -} - -long wxTextCtrl::GetInsertionPoint() const -{ - // TODO - return 0; -} - -long wxTextCtrl::GetLastPosition() const -{ - // TODO - return 0; -} - -void wxTextCtrl::Replace(long from, long to, const wxString& value) -{ - // TODO - return 0; -} - -void wxTextCtrl::Remove(long from, long to) -{ - // TODO -} - -void wxTextCtrl::SetSelection(long from, long to) -{ - // TODO -} - -bool wxTextCtrl::LoadFile(const wxString& file) -{ - if (!wxFileExists(file)) - return FALSE; - - m_fileName = file; - - Clear(); - - ifstream input((char*) (const char*) file, ios::nocreate | ios::in); - - if (!input.bad()) - { - struct stat stat_buf; - if (stat(file, &stat_buf) < 0) - return FALSE; - // This may need to be a bigger buffer than the file size suggests, - // if it's a UNIX file. Give it an extra 1000 just in case. - char *tmp_buffer = (char*)malloc((size_t)(stat_buf.st_size+1+1000)); - long no_lines = 0; - long pos = 0; - while (!input.eof() && input.peek() != EOF) - { - input.getline(wxBuffer, 500); - int len = strlen(wxBuffer); - wxBuffer[len] = 13; - wxBuffer[len+1] = 10; - wxBuffer[len+2] = 0; - strcpy(tmp_buffer+pos, wxBuffer); - pos += strlen(wxBuffer); - no_lines++; - } - - // TODO add line - - free(tmp_buffer); - - return TRUE; - } - return FALSE; -} - -// If file is null, try saved file name first -// Returns TRUE if succeeds. -bool wxTextCtrl::SaveFile(const wxString& file) -{ - wxString theFile(file); - if (theFile == "") - theFile = m_fileName; - if (theFile == "") - return FALSE; - m_fileName = theFile; - - ofstream output((char*) (const char*) theFile); - if (output.bad()) - return FALSE; - - // TODO get and save text - - return FALSE; -} - -void wxTextCtrl::WriteText(const wxString& text) -{ - // TODO write text to control -} - -void wxTextCtrl::AppendText(const wxString& text) -{ - // TODO append text to control -} - -void wxTextCtrl::Clear() -{ - // TODO -} - -bool wxTextCtrl::IsModified() const -{ - // TODO - return FALSE; -} - -// Makes 'unmodified' -void wxTextCtrl::DiscardEdits() -{ - // TODO -} - -int wxTextCtrl::GetNumberOfLines() const -{ - // TODO - return 0; -} - -long wxTextCtrl::XYToPosition(long x, long y) const -{ - // TODO - return 0; -} - -void wxTextCtrl::PositionToXY(long pos, long *x, long *y) const -{ - // TODO -} - -void wxTextCtrl::ShowPosition(long pos) -{ - // TODO -} - -int wxTextCtrl::GetLineLength(long lineNo) const -{ - // TODO - return 0; -} - -wxString wxTextCtrl::GetLineText(long lineNo) const -{ - // TODO - return wxString(""); -} - -/* - * Text item - */ - -void wxTextCtrl::Command(wxCommandEvent & event) -{ - SetValue (event.GetString()); - ProcessCommand (event); -} - -void wxTextCtrl::OnDropFiles(wxDropFilesEvent& event) -{ - // By default, load the first file into the text window. - if (event.GetNumberOfFiles() > 0) - { - LoadFile(event.GetFiles()[0]); - } -} - -// The streambuf code was partly taken from chapter 3 by Jerry Schwarz of -// AT&T's "C++ Lanuage System Release 3.0 Library Manual" - Stein Somers - -//========================================================================= -// Called then the buffer is full (gcc 2.6.3) -// or when "endl" is output (Borland 4.5) -//========================================================================= -// Class declaration using multiple inheritance doesn't work properly for -// Borland. See note in wb_text.h. -#ifndef NO_TEXT_WINDOW_STREAM -int wxTextCtrl::overflow(int c) -{ - // Make sure there is a holding area - if ( allocate()==EOF ) - { - wxError("Streambuf allocation failed","Internal error"); - return EOF; - } - - // Verify that there are no characters in get area - if ( gptr() && gptr() < egptr() ) - { - wxError("Who's trespassing my get area?","Internal error"); - return EOF; - } - - // Reset get area - setg(0,0,0); - - // Make sure there is a put area - if ( ! pptr() ) - { -/* This doesn't seem to be fatal so comment out error message */ -// wxError("Put area not opened","Internal error"); - setp( base(), base() ); - } - - // Determine how many characters have been inserted but no consumed - int plen = pptr() - pbase(); - - // Now Jerry relies on the fact that the buffer is at least 2 chars - // long, but the holding area "may be as small as 1" ??? - // And we need an additional \0, so let's keep this inefficient but - // safe copy. - - // If c!=EOF, it is a character that must also be comsumed - int xtra = c==EOF? 0 : 1; - - // Write temporary C-string to wxTextWindow - { - char *txt = new char[plen+xtra+1]; - memcpy(txt, pbase(), plen); - txt[plen] = (char)c; // append c - txt[plen+xtra] = '\0'; // append '\0' or overwrite c - // If the put area already contained \0, output will be truncated there - AppendText(txt); - delete[] txt; - } - - // Reset put area - setp(pbase(), epptr()); - -#if defined(__WATCOMC__) - return __NOT_EOF; -#elif defined(zapeof) // HP-UX (all cfront based?) - return zapeof(c); -#else - return c!=EOF ? c : 0; // this should make everybody happy -#endif -} - -//========================================================================= -// called then "endl" is output (gcc) or then explicit sync is done (Borland) -//========================================================================= -int wxTextCtrl::sync() -{ - // Verify that there are no characters in get area - if ( gptr() && gptr() < egptr() ) - { - wxError("Who's trespassing my get area?","Internal error"); - return EOF; - } - - if ( pptr() && pptr() > pbase() ) return overflow(EOF); - - return 0; -/* OLD CODE - int len = pptr() - pbase(); - char *txt = new char[len+1]; - strncpy(txt, pbase(), len); - txt[len] = '\0'; - (*this) << txt; - setp(pbase(), epptr()); - delete[] txt; - return 0; -*/ -} - -//========================================================================= -// Should not be called by a "ostream". Used by a "istream" -//========================================================================= -int wxTextCtrl::underflow() -{ - return EOF; -} -#endif - -wxTextCtrl& wxTextCtrl::operator<<(const wxString& s) -{ - AppendText(s); - return *this; -} - -wxTextCtrl& wxTextCtrl::operator<<(float f) -{ - wxString str; - str.Printf("%.2f", f); - AppendText(str); - return *this; -} - -wxTextCtrl& wxTextCtrl::operator<<(double d) -{ - wxString str; - str.Printf("%.2f", d); - AppendText(str); - return *this; -} - -wxTextCtrl& wxTextCtrl::operator<<(int i) -{ - wxString str; - str.Printf("%d", i); - AppendText(str); - return *this; -} - -wxTextCtrl& wxTextCtrl::operator<<(long i) -{ - wxString str; - str.Printf("%ld", i); - AppendText(str); - return *this; -} - -wxTextCtrl& wxTextCtrl::operator<<(const char c) -{ - char buf[2]; - - buf[0] = c; - buf[1] = 0; - AppendText(buf); - return *this; -} - diff --git a/src/qt/threadgui.inc b/src/qt/threadgui.inc deleted file mode 100644 index 165fef3c01..0000000000 --- a/src/qt/threadgui.inc +++ /dev/null @@ -1,65 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: threadgui.inc -// Purpose: GUI thread manager for GTK -// Author: Original from Wolfram Gloger/Guilhem Lavaux -// Modified by: -// Created: 04/22/98 -// RCS-ID: $Id$ -// Copyright: (c) Wolfram Gloger (1996, 1997); Guilhem Lavaux (1998) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#include -#include - -// for select() -#include -#include -#ifdef __sgi -#include -#endif - -#include - - -///////////////////////////////////////////////////////////////////////////// -// Static variables -///////////////////////////////////////////////////////////////////////////// - -static int p_thrd_pipe[2] = { -1, -1 }; -// WorkProc in GTK -static gint p_thrd_inid; - -#define THREAD_SEND_EXIT_MSG(ptr) write(p_thrd_pipe[1], &ptr, sizeof(ptr)); - -static void -ThreadExitProc(gpointer WXUNUSED(client), gint fid, - GdkInputCondition WXUNUSED(cond)) -{ - wxThread* ptr; - - if (fid != p_thrd_pipe[0]) - return; - if (read(fid, &ptr, sizeof(ptr)) == sizeof(ptr)) { - //fprintf(stderr, "calling OnExit %p\n", ptr); - ptr->OnExit(); - } else { - //fprintf(stderr, "this should never happen\n"); - } -} - -// Global initialization -static void wxThreadGuiInit() -{ - pipe(p_thrd_pipe); - p_thrd_inid = gdk_input_add(p_thrd_pipe[0], GDK_INPUT_READ, - ThreadExitProc, 0); -} - -// Global cleanup -static void wxThreadGuiExit() -{ - gdk_input_remove(p_thrd_inid); - close(p_thrd_pipe[0]); - close(p_thrd_pipe[1]); -} diff --git a/src/qt/threadno.cpp b/src/qt/threadno.cpp deleted file mode 100644 index 8cf94d1e06..0000000000 --- a/src/qt/threadno.cpp +++ /dev/null @@ -1,187 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: thread.cpp -// Purpose: No thread support -// Author: Original from Wolfram Gloger/Guilhem Lavaux -// Modified by: -// Created: 04/22/98 -// RCS-ID: $Id$ -// Copyright: (c) Wolfram Gloger (1996, 1997); Guilhem Lavaux (1998) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ -#pragma implementation "thread.h" -#endif - -#include "wx/wx.h" -#include "wx/module.h" -#include "wx/thread.h" - -wxMutex::wxMutex() -{ - m_locked = 0; -} - -wxMutex::~wxMutex() -{ - if (m_locked) - wxDebugMsg("wxMutex warning: destroying a locked mutex (%d locks)\n", m_locked); -} - -wxMutexError wxMutex::Lock() -{ - m_locked++; - return MUTEX_NO_ERROR; -} - -wxMutexError wxMutex::TryLock() -{ - if (m_locked > 0) - return MUTEX_BUSY; - m_locked++; - return MUTEX_NO_ERROR; -} - -wxMutexError wxMutex::Unlock() -{ - if (m_locked == 0) - return MUTEX_UNLOCKED; - m_locked--; - return MUTEX_NO_ERROR; -} - -wxCondition::wxCondition() -{ -} - -wxCondition::~wxCondition() -{ -} - -void wxCondition::Wait(wxMutex& WXUNUSED(mutex)) -{ -} - -bool wxCondition::Wait(wxMutex& WXUNUSED(mutex), unsigned long WXUNUSED(sec), - unsigned long WXUNUSED(nsec)) -{ - return FALSE; -} - -void wxCondition::Signal() -{ -} - -void wxCondition::Broadcast() -{ -} - -struct wxThreadInternal { - int thread_id; - void* exit_status; -}; - -wxThreadError wxThread::Create() -{ - p_internal->exit_status = Entry(); - OnExit(); - return THREAD_NO_ERROR; -} - -wxThreadError wxThread::Destroy() -{ - return THREAD_NOT_RUNNING; -} - -wxThreadError wxThread::Pause() -{ - return THREAD_NOT_RUNNING; -} - -wxThreadError wxThread::Resume() -{ - return THREAD_NOT_RUNNING; -} - -void wxThread::DeferDestroy( bool WXUNUSED(on) ) -{ -} - -void wxThread::TestDestroy() -{ -} - -void *wxThread::Join() -{ - return p_internal->exit_status; -} - -unsigned long wxThread::GetID() const -{ - return 0; -} - -wxThread *wxThread::GetThreadFromID(unsigned long WXUNUSED(id)) const -{ - return NULL; -} - -bool wxThread::IsMain() -{ - return TRUE; -} - -bool wxThread::IsRunning() const -{ - return FALSE; -} - -bool wxThread::IsAlive() const -{ - return FALSE; -} - -void wxThread::SetPriority(int WXUNUSED(prio)) { } -int wxThread::GetPriority() const { return 0; } - -wxMutex *wxMainMutex; // controls access to all GUI functions - -wxThread::wxThread() -{ - p_internal = new wxThreadInternal(); -} - -wxThread::~wxThread() -{ - Destroy(); - Join(); - delete p_internal; -} - -// The default callback just joins the thread and throws away the result. -void wxThread::OnExit() -{ - Join(); -} - - -// Automatic initialization -class wxThreadModule : public wxModule { - DECLARE_DYNAMIC_CLASS(wxThreadModule) -public: - bool OnInit(); - void OnExit(); -}; - -bool wxThreadModule::OnInit() { - wxMainMutex = new wxMutex(); - wxMainMutex->Lock(); - return TRUE; -} - -void wxThreadModule::OnExit() -{ - wxMainMutex->Unlock(); - delete wxMainMutex; -} - -IMPLEMENT_DYNAMIC_CLASS(wxThreadModule, wxModule) diff --git a/src/qt/threadpsx.cpp b/src/qt/threadpsx.cpp deleted file mode 100644 index 2d4912c05a..0000000000 --- a/src/qt/threadpsx.cpp +++ /dev/null @@ -1,396 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: threadpsx.cpp -// Purpose: wxThread (Posix) Implementation -// Author: Original from Wolfram Gloger/Guilhem Lavaux -// Modified by: -// Created: 04/22/98 -// RCS-ID: $Id$ -// Copyright: (c) Wolfram Gloger (1996, 1997); Guilhem Lavaux (1998) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ -#pragma implementation "thread.h" -#endif - -#include -#include -#include -#include -#include "wx/thread.h" -#include "wx/module.h" -#include "wx/utils.h" - -enum thread_state { - STATE_IDLE = 0, - STATE_RUNNING, - STATE_PAUSING, - STATE_PAUSED, - STATE_CANCELED, - STATE_EXITED -}; - -///////////////////////////////////////////////////////////////////////////// -// Static variables -///////////////////////////////////////////////////////////////////////////// - -static pthread_t p_mainid; -static wxMutex p_list_mutex; -static wxList p_threads_list; - -wxMutex *wxMainMutex; // controls access to all GUI functions - -///////////////////////////////////////////////////////////////////////////// -// GUI thread manager -///////////////////////////////////////////////////////////////////////////// -#include "threadgui.inc" - -///////////////////////////////////////////////////////////////////////////// -// wxThread: Posix Thread implementation (Mutex) -///////////////////////////////////////////////////////////////////////////// - -class wxMutexInternal { -public: - pthread_mutex_t p_mutex; -}; - -wxMutex::wxMutex() -{ - p_internal = new wxMutexInternal; - pthread_mutex_init(&(p_internal->p_mutex), NULL); - m_locked = 0; -} - -wxMutex::~wxMutex() -{ - if (m_locked > 0) - wxDebugMsg("wxMutex warning: freeing a locked mutex (%d locks)\n", - m_locked); - - pthread_mutex_destroy(&(p_internal->p_mutex)); - delete p_internal; -} - -wxMutexError wxMutex::Lock() -{ - int err; - - err = pthread_mutex_lock(&(p_internal->p_mutex)); - if (err == EDEADLK) - return MUTEX_DEAD_LOCK; - m_locked++; - return MUTEX_NO_ERROR; -} - -wxMutexError wxMutex::TryLock() -{ - int err; - - if (m_locked) - return MUTEX_BUSY; - err = pthread_mutex_trylock(&(p_internal->p_mutex)); - switch (err) { - case EBUSY: return MUTEX_BUSY; - } - m_locked++; - return MUTEX_NO_ERROR; -} - -wxMutexError wxMutex::Unlock() -{ - if (m_locked > 0) - m_locked--; - else - return MUTEX_UNLOCKED; - pthread_mutex_unlock(&(p_internal->p_mutex)); - return MUTEX_NO_ERROR; -} - -///////////////////////////////////////////////////////////////////////////// -// wxThread: Posix Thread implementation (Condition) -///////////////////////////////////////////////////////////////////////////// - -class wxConditionInternal { -public: - pthread_cond_t p_condition; -}; - -wxCondition::wxCondition() -{ - p_internal = new wxConditionInternal; - pthread_cond_init(&(p_internal->p_condition), NULL); -} - -wxCondition::~wxCondition() -{ - pthread_cond_destroy(&(p_internal->p_condition)); - delete p_internal; -} - -void wxCondition::Wait(wxMutex& mutex) -{ - pthread_cond_wait(&(p_internal->p_condition), &(mutex.p_internal->p_mutex)); -} - -bool wxCondition::Wait(wxMutex& mutex, unsigned long sec, unsigned long nsec) -{ - struct timespec tspec; - - tspec.tv_sec = time(NULL)+sec; - tspec.tv_nsec = nsec; - return (pthread_cond_timedwait(&(p_internal->p_condition), &(mutex.p_internal->p_mutex), &tspec) != ETIMEDOUT); -} - -void wxCondition::Signal() -{ - pthread_cond_signal(&(p_internal->p_condition)); -} - -void wxCondition::Broadcast() -{ - pthread_cond_broadcast(&(p_internal->p_condition)); -} - -///////////////////////////////////////////////////////////////////////////// -// wxThread: Posix Thread implementation (Thread) -///////////////////////////////////////////////////////////////////////////// - -class wxThreadInternal { -public: - wxThreadInternal() { state = STATE_IDLE; } - ~wxThreadInternal() {} - static void *PthreadStart(void *ptr); - pthread_t thread_id; - int state; - int prio; - int defer_destroy; - int id; -}; - -void *wxThreadInternal::PthreadStart(void *ptr) -{ - wxThread *thread = (wxThread *)ptr; - - // Add the current thread to the list - p_list_mutex.Lock(); - thread->p_internal->id = p_threads_list.Number(); - p_threads_list.Append((wxObject *)thread); - p_list_mutex.Unlock(); - - // Call the main entry - pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL); - void* status = thread->Entry(); - - thread->Exit(status); - - return NULL; -} - -wxThreadError wxThread::Create() -{ - pthread_attr_t a; - int min_prio, max_prio, p; - struct sched_param sp; - - if (p_internal->state != STATE_IDLE) - return THREAD_RUNNING; - - // Change thread priority - pthread_attr_init(&a); - pthread_attr_getschedpolicy(&a, &p); - - min_prio = sched_get_priority_min(p); - max_prio = sched_get_priority_max(p); - - pthread_attr_getschedparam(&a, &sp); - sp.sched_priority = min_prio + - (p_internal->prio*(max_prio-min_prio))/100; - pthread_attr_setschedparam(&a, &sp); - - // this is the point of no return - p_internal->state = STATE_RUNNING; - if (pthread_create(&p_internal->thread_id, &a, - wxThreadInternal::PthreadStart, (void *)this) != 0) { - p_internal->state = STATE_IDLE; - pthread_attr_destroy(&a); - return THREAD_NO_RESOURCE; - } - pthread_attr_destroy(&a); - - return THREAD_NO_ERROR; -} - -void wxThread::SetPriority(int prio) -{ - if (p_internal->state == STATE_RUNNING) - return; - - if (prio > 100) - prio = 100; - if (prio < 0) - prio = 0; - p_internal->prio = prio; -} - -int wxThread::GetPriority() const -{ - return p_internal->prio; -} - -void wxThread::DeferDestroy(bool on) -{ - if (on) - pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL); - else - pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL); -} - -wxThreadError wxThread::Destroy() -{ - int res = 0; - - if (p_internal->state == STATE_RUNNING) { - res = pthread_cancel(p_internal->thread_id); - if (res == 0) - p_internal->state = STATE_CANCELED; - } - - return THREAD_NO_ERROR; -} - -wxThreadError wxThread::Pause() -{ - if (p_internal->state != STATE_RUNNING) - return THREAD_NOT_RUNNING; - - if (!p_internal->defer_destroy) - return THREAD_MISC_ERROR; - - p_internal->state = STATE_PAUSING; - return THREAD_NO_ERROR; -} - -wxThreadError wxThread::Resume() -{ - if (p_internal->state == STATE_PAUSING || p_internal->state == STATE_PAUSED) - p_internal->state = STATE_RUNNING; - - return THREAD_NO_ERROR; -} - -void *wxThread::Join() -{ - void* status = 0; - - if (p_internal->state != STATE_IDLE) { - bool do_unlock = wxThread::IsMain(); - - while (p_internal->state == STATE_RUNNING) - wxYield(); - - if (do_unlock) - wxMainMutex->Unlock(); - pthread_join(p_internal->thread_id, &status); - if (do_unlock) - wxMainMutex->Lock(); - - p_list_mutex.Lock(); - delete p_threads_list.Nth(p_internal->id); - p_list_mutex.Unlock(); - - p_internal->state = STATE_IDLE; - } - return status; -} - -unsigned long wxThread::GetID() const -{ - return p_internal->id; -} - -wxThread *wxThread::GetThreadFromID(unsigned long id) -{ - wxNode *node = p_threads_list.Nth(id); - - if (!node) - return NULL; - return (wxThread *)node->Data(); -} - -void wxThread::Exit(void *status) -{ - wxThread* ptr = this; - - THREAD_SEND_EXIT_MSG(ptr); - p_internal->state = STATE_EXITED; - pthread_exit(status); -} - -void wxThread::TestDestroy() -{ - if (p_internal->state == STATE_PAUSING) { - p_internal->state = STATE_PAUSED; - while (p_internal->state == STATE_PAUSED) { - pthread_testcancel(); - usleep(1); - } - } - pthread_testcancel(); -} - -bool wxThread::IsMain() -{ - return (bool)pthread_equal(pthread_self(), p_mainid); -} - -bool wxThread::IsRunning() const -{ - return (p_internal->state == STATE_RUNNING); -} - -bool wxThread::IsAlive() const -{ - return (p_internal->state == STATE_RUNNING) || - (p_internal->state == STATE_PAUSING) || - (p_internal->state == STATE_PAUSED); -} - -wxThread::wxThread() -{ - p_internal = new wxThreadInternal(); -} - -wxThread::~wxThread() -{ - Destroy(); - Join(); - delete p_internal; -} - -// The default callback just joins the thread and throws away the result. -void wxThread::OnExit() -{ - Join(); -} - -// Automatic initialization -class wxThreadModule : public wxModule { - DECLARE_DYNAMIC_CLASS(wxThreadModule) -public: - virtual bool OnInit() { - wxMainMutex = new wxMutex(); - wxThreadGuiInit(); - p_mainid = pthread_self(); - p_threads_list = wxList(wxKEY_INTEGER); - wxMainMutex->Lock(); - - return TRUE; - } - - virtual void OnExit() { - wxMainMutex->Unlock(); - wxThreadGuiExit(); - delete wxMainMutex; - } -}; - -IMPLEMENT_DYNAMIC_CLASS(wxThreadModule, wxModule) diff --git a/src/qt/threadsgi.cpp b/src/qt/threadsgi.cpp deleted file mode 100644 index 66b6b0da7b..0000000000 --- a/src/qt/threadsgi.cpp +++ /dev/null @@ -1,254 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: threadsgi.cpp -// Purpose: wxThread (SGI) Implementation -// Author: Original from Wolfram Gloger/Guilhem Lavaux -// Modified by: -// Created: 04/22/98 -// RCS-ID: $Id$ -// Copyright: (c) Wolfram Gloger (1996, 1997); Guilhem Lavaux (1998) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ -#pragma implementation "thread.h" -#endif - -#include -#include - -#include -#include -#include -#include "wx/thread.h" -#include "wx/module.h" -#include "wx/utils.h" - -enum thread_state { - STATE_IDLE = 0, - STATE_RUNNING, - STATE_CANCELED, - STATE_EXITED -}; - -///////////////////////////////////////////////////////////////////////////// -// Static variables -///////////////////////////////////////////////////////////////////////////// - -static int p_mainid; -wxMutex *wxMainMutex; - -#include "threadgui.inc" - -///////////////////////////////////////////////////////////////////////////// -// Unix implementations (SGI threads) -///////////////////////////////////////////////////////////////////////////// - -class wxMutexInternal { -public: - abilock_t p_mutex; -}; - -wxMutex::wxMutex() -{ - m_locked = 0; - p_internal = new wxMutexInternal; - init_lock(&(p_internal->p_mutex)); -} - -wxMutex::~wxMutex() -{ - if (m_locked > 0) - wxDebugMsg("wxMutex warning: freeing a locked mutex (%d locks)\n", - m_locked); - delete p_internal; -} - -wxMutexError wxMutex::Lock() -{ - spin_lock(&(p_internal->p_mutex)); - m_locked++; - return MUTEX_NO_ERROR; -} - -wxMutexError wxMutex::TryLock() -{ - if (acquire_lock(&(p_internal->p_mutex)) != 0) - return MUTEX_BUSY; - m_locked++; - return MUTEX_NO_ERROR; -} - -wxMutexError wxMutex::Unlock() -{ - if (m_locked == 0) - return MUTEX_UNLOCKED; - release_lock(&(p_internal->p_mutex)); - m_locked--; - return MUTEX_NO_ERROR; -} - -// GL: Don't know how it works on SGI. Wolfram ? - -wxCondition::wxCondition() {} -wxCondition::~wxCondition() {} -int wxCondition::Wait(wxMutex& WXUNUSED(mutex)) { return 0;} -int wxCondition::Wait(wxMutex& WXUNUSED(mutex), unsigned long WXUNUSED(sec), - unsigned long WXUNUSED(nsec)) { return 0; } -int wxCondition::Signal() { return 0; } -int wxCondition::Broadcast() { return 0; } - -class -wxThreadPrivate { -public: - wxThreadPrivate() { thread_id = 0; state = STATE_IDLE; } - ~wxThreadPrivate() {} - static void SprocStart(void *ptr); - static void SignalHandler(int sig); -public: - int state, thread_id; - void* exit_status; -}; - -void wxThreadPrivate::SprocStart(void *ptr) -{ - void* status; - - wxThread *thr = (wxThread *)ptr; - - thr->p_internal->thread_id = getpid(); - thr->p_internal->exit_status = 0; - status = thr->Entry(); - thr->Exit(status); -} - -void wxThread::Exit(void* status) -{ - wxThread* ptr = this; - THREAD_SEND_EXIT_MSG(ptr); - p_internal->state = STATE_EXITED; - p_internal->exit_status = status; - _exit(0); -} - -wxThreadError wxThread::Create() -{ - if (p_internal->state != STATE_IDLE) - return THREAD_RUNNING; - p_internal->state = STATE_RUNNING; - if (sproc(p_internal->SprocStart, PR_SALL, this) < 0) { - p_internal->state = STATE_IDLE; - return THREAD_NO_RESOURCE; - } - return THREAD_NO_ERROR; -} - -wxThreadError wxThread::Destroy() -{ - if (p_internal->state == STATE_RUNNING) - p_internal->state = STATE_CANCELED; - - return THREAD_NO_ERROR; -} - -wxThreadError wxThread::Pause() -{ - return THREAD_NO_ERROR; -} - -wxThreadError wxThread::Resume() -{ - return THREAD_NO_ERROR; -} - -void *wxThread::Join() -{ - if (p_internal->state != STATE_IDLE) { - bool do_unlock = wxThread::IsMain(); - int stat; - - if (do_unlock) - wxMainMutex->Unlock(); - waitpid(p_internal->thread_id, &stat, 0); - if (do_unlock) - wxMainMutex->Lock(); - if (!WIFEXITED(stat) && !WIFSIGNALED(stat)) - return 0; - p_internal->state = STATE_IDLE; - return p_internal->exit_status; - } - return 0; -} - -unsigned long wxThread::GetID() const -{ - return (unsigned long)p_internal->thread_id; -} - -void wxThread::TestDestroy() -{ - if (p_internal->state == STATE_CANCELED) { - p_internal->exit_status = 0; - _exit(0); - } -} - -void wxThread::SetPriority(int prio) -{ -} - -int wxThread::GetPriority() const -{ - return 0; -} - -bool wxThread::IsMain() -{ - return (int)getpid() == main_id; -} - -bool wxThread::IsAlive() const -{ - return (p_internal->state == STATE_RUNNING); -} - -bool wxThread::IsRunning() const -{ - return (p_internal->state == STATE_RUNNING); -} - -wxThread::wxThread() -{ - p_internal = new wxThreadPrivate(); -} - -wxThread::~wxThread() -{ - Cancel(); - Join(); - delete p_internal; -} - -// The default callback just joins the thread and throws away the result. -void wxThread::OnExit() -{ - Join(); -} - -// Global initialization -class wxThreadModule : public wxModule { - DECLARE_DYNAMIC_CLASS(wxThreadModule) -public: - virtual bool OnInit() { - wxMainMutex = new wxMutex(); - wxThreadGuiInit(); - p_mainid = (int)getpid(); - wxMainMutex->Lock(); - } - - virtual void OnExit() { - wxMainMutex->Unlock(); - wxThreadGuiExit(); - delete wxMainMutex; - } -}; - -IMPLEMENT_DYNAMIC_CLASS(wxThreadModule, wxModule) diff --git a/src/qt/timer.cpp b/src/qt/timer.cpp deleted file mode 100644 index c07c4a5f82..0000000000 --- a/src/qt/timer.cpp +++ /dev/null @@ -1,54 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: timer.cpp -// Purpose: wxTimer implementation -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "timer.h" -#endif - -#include "wx/timer.h" - -IMPLEMENT_ABSTRACT_CLASS(wxTimer, wxObject) - -wxTimer::wxTimer() -{ - m_milli = 0 ; - m_lastMilli = -1 ; - m_id = 0; - m_oneShot = FALSE; -} - -wxTimer::~wxTimer() -{ - Stop(); -} - -bool wxTimer::Start(int milliseconds,bool mode) -{ - m_oneShot = mode ; - if (m_milliseconds < 0) - m_milliseconds = lastMilli; - - if (m_milliseconds <= 0) - return FALSE; - - m_lastMilli = m_milli = m_milliseconds; - - // TODO: set the timer going. - return FALSE; -} - -void wxTimer::Stop() -{ - m_id = 0 ; - m_milli = 0 ; -} - - diff --git a/src/qt/utilsgtk.cpp b/src/qt/utilsgtk.cpp deleted file mode 100644 index bf6669325c..0000000000 --- a/src/qt/utilsgtk.cpp +++ /dev/null @@ -1,367 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: utils.cpp -// Purpose: -// Author: Robert Roebling -// Created: 01/02/97 -// Id: -// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - - -//#ifdef __GNUG__ -//#pragma implementation "utils.h" -//#endif - -#include "wx/utils.h" -#include "wx/string.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef __SVR4__ -#include -#endif - -//------------------------------------------------------------------------ -// misc. -//------------------------------------------------------------------------ - -void wxBell(void) -{ - gdk_beep(); -}; - -void wxSleep(int nSecs) -{ - sleep(nSecs); -}; - -int wxKill(long pid, int sig) -{ - return kill(pid, sig); -}; - -void wxDisplaySize( int *width, int *height ) -{ - if (width) *width = gdk_screen_width(); - if (height) *height = gdk_screen_height(); -} - -//------------------------------------------------------------------------ -// user and home routines -//------------------------------------------------------------------------ - -char* wxGetHomeDir( char *dest ) -{ - wxString tmp = wxGetUserHome( wxString() ); - if (tmp.IsNull()) - strcpy( wxBuffer, "/" ); - else - strcpy( wxBuffer, tmp ); - if (dest) strcpy( dest, WXSTRINGCAST tmp ); - return wxBuffer; -}; - -char *wxGetUserHome( const wxString &user ) -{ - struct passwd *who = NULL; - - if (user.IsNull() || (user== "")) - { - register char *ptr; - - if ((ptr = getenv("HOME")) != NULL) - return ptr; - if ((ptr = getenv("USER")) != NULL - || (ptr = getenv("LOGNAME")) != NULL) { - who = getpwnam(ptr); - } - // We now make sure the the user exists! - if (who == NULL) - who = getpwuid(getuid()); - } - else - who = getpwnam (user); - - return who ? who->pw_dir : (char*)NULL; -}; - -//------------------------------------------------------------------------ -// id routines -//------------------------------------------------------------------------ - -bool wxGetHostName(char *buf, int sz) -{ - *buf = '\0'; -#if defined(__SVR4__) && !defined(__sgi) - return (sysinfo(SI_HOSTNAME, buf, sz) != -1); -#else /* BSD Sockets */ - char name[255]; - struct hostent *h; - // Get hostname - if (gethostname(name, sizeof(name)/sizeof(char)-1) == -1) - return FALSE; - // Get official full name of host - strncpy(buf, (h=gethostbyname(name))!=NULL ? h->h_name : name, sz-1); - return TRUE; -#endif -} - -bool wxGetUserId(char *buf, int sz) -{ - struct passwd *who; - - *buf = '\0'; - if ((who = getpwuid(getuid ())) != NULL) { - strncpy (buf, who->pw_name, sz-1); - return TRUE; - } - return FALSE; -} - -bool wxGetUserName(char *buf, int sz) -{ - struct passwd *who; - - *buf = '\0'; - if ((who = getpwuid (getuid ())) != NULL) { - strncpy (buf, who->pw_gecos, sz - 1); - return TRUE; - } - return FALSE; -} - -//------------------------------------------------------------------------ -// error and debug output routines -//------------------------------------------------------------------------ - -void wxDebugMsg( const char *format, ... ) -{ - va_list ap; - va_start( ap, format ); - vfprintf( stderr, format, ap ); - fflush( stderr ); - va_end(ap); -}; - -void wxError( const wxString &msg, const wxString &title ) -{ - fprintf( stderr, "Error " ); - if (!title.IsNull()) fprintf( stderr, "%s ", WXSTRINGCAST(title) ); - if (!msg.IsNull()) fprintf( stderr, ": %s", WXSTRINGCAST(msg) ); - fprintf( stderr, ".\n" ); -}; - -void wxFatalError( const wxString &msg, const wxString &title ) -{ - fprintf( stderr, "Error " ); - if (!title.IsNull()) fprintf( stderr, "%s ", WXSTRINGCAST(title) ); - if (!msg.IsNull()) fprintf( stderr, ": %s", WXSTRINGCAST(msg) ); - fprintf( stderr, ".\n" ); - exit(1); -}; - -//------------------------------------------------------------------------ -// directory routines -//------------------------------------------------------------------------ - -bool wxDirExists( const wxString& dir ) -{ - char buf[500]; - strcpy( buf, WXSTRINGCAST(dir) ); - struct stat sbuf; - return ((stat(buf, &sbuf) != -1) && S_ISDIR(sbuf.st_mode) ? TRUE : FALSE); -}; - -//------------------------------------------------------------------------ -// wild character routines -//------------------------------------------------------------------------ - -bool wxIsWild( const wxString& pattern ) -{ - wxString tmp = pattern; - char *pat = WXSTRINGCAST(tmp); - while (*pat) { - switch (*pat++) { - case '?': case '*': case '[': case '{': - return TRUE; - case '\\': - if (!*pat++) - return FALSE; - } - } - return FALSE; -}; - - -bool wxMatchWild( const wxString& pat, const wxString& text, bool dot_special ) -{ - wxString tmp1 = pat; - char *pattern = WXSTRINGCAST(tmp1); - wxString tmp2 = text; - char *str = WXSTRINGCAST(tmp2); - char c; - char *cp; - bool done = FALSE, ret_code, ok; - // Below is for vi fans - const char OB = '{', CB = '}'; - - // dot_special means '.' only matches '.' - if (dot_special && *str == '.' && *pattern != *str) - return FALSE; - - while ((*pattern != '\0') && (!done) - && (((*str=='\0')&&((*pattern==OB)||(*pattern=='*')))||(*str!='\0'))) { - switch (*pattern) { - case '\\': - pattern++; - if (*pattern != '\0') - pattern++; - break; - case '*': - pattern++; - ret_code = FALSE; - while ((*str!='\0') - && (!(ret_code=wxMatchWild(pattern, str++, FALSE)))) - /*loop*/; - if (ret_code) { - while (*str != '\0') - str++; - while (*pattern != '\0') - pattern++; - } - break; - case '[': - pattern++; - repeat: - if ((*pattern == '\0') || (*pattern == ']')) { - done = TRUE; - break; - } - if (*pattern == '\\') { - pattern++; - if (*pattern == '\0') { - done = TRUE; - break; - } - } - if (*(pattern + 1) == '-') { - c = *pattern; - pattern += 2; - if (*pattern == ']') { - done = TRUE; - break; - } - if (*pattern == '\\') { - pattern++; - if (*pattern == '\0') { - done = TRUE; - break; - } - } - if ((*str < c) || (*str > *pattern)) { - pattern++; - goto repeat; - } - } else if (*pattern != *str) { - pattern++; - goto repeat; - } - pattern++; - while ((*pattern != ']') && (*pattern != '\0')) { - if ((*pattern == '\\') && (*(pattern + 1) != '\0')) - pattern++; - pattern++; - } - if (*pattern != '\0') { - pattern++, str++; - } - break; - case '?': - pattern++; - str++; - break; - case OB: - pattern++; - while ((*pattern != CB) && (*pattern != '\0')) { - cp = str; - ok = TRUE; - while (ok && (*cp != '\0') && (*pattern != '\0') - && (*pattern != ',') && (*pattern != CB)) { - if (*pattern == '\\') - pattern++; - ok = (*pattern++ == *cp++); - } - if (*pattern == '\0') { - ok = FALSE; - done = TRUE; - break; - } else if (ok) { - str = cp; - while ((*pattern != CB) && (*pattern != '\0')) { - if (*++pattern == '\\') { - if (*++pattern == CB) - pattern++; - } - } - } else { - while (*pattern!=CB && *pattern!=',' && *pattern!='\0') { - if (*++pattern == '\\') { - if (*++pattern == CB || *pattern == ',') - pattern++; - } - } - } - if (*pattern != '\0') - pattern++; - } - break; - default: - if (*str == *pattern) { - str++, pattern++; - } else { - done = TRUE; - } - } - } - while (*pattern == '*') - pattern++; - return ((*str == '\0') && (*pattern == '\0')); -}; - -//------------------------------------------------------------------------ -// subprocess routines -//------------------------------------------------------------------------ - -long wxExecute( char **argv, bool sync, wxProcess *process ) -{ -}; - -long wxExecute( const wxString& command, bool sync, wxProcess *process ) -{ - if (command.IsNull() || command == "") return FALSE; - - int argc = 0; - char *argv[127]; - char tmp[1024]; - const char *IFS = " \t\n"; - - strncpy (tmp, command, sizeof(tmp) / sizeof(char) - 1); - tmp[sizeof (tmp) / sizeof (char) - 1] = '\0'; - argv[argc++] = strtok (tmp, IFS); - while ((argv[argc++] = strtok(NULL, IFS)) != NULL) - /* loop */ ; - return wxExecute(argv, sync, process); -}; - - diff --git a/src/qt/utilsres.cpp b/src/qt/utilsres.cpp deleted file mode 100644 index 562f0f31ca..0000000000 --- a/src/qt/utilsres.cpp +++ /dev/null @@ -1,332 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: utils.cpp -// Purpose: -// Author: Robert Roebling -// Created: 01/02/97 -// Id: -// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - - -//#ifdef __GNUG__ -//#pragma implementation "utils.h" -//#endif - -#include "wx/utils.h" -#include "wx/string.h" -#include "wx/list.h" - -#include -#include -#include -#ifdef __SVR4__ -#include -#endif - -#include -#include -#include - - -//----------------------------------------------------------------------------- -// constants -//----------------------------------------------------------------------------- - -// Yuck this is really BOTH site and platform dependent -// so we should use some other strategy! -#ifdef __SUN__ - #define DEFAULT_XRESOURCE_DIR "/usr/openwin/lib/app-defaults" -#else - #define DEFAULT_XRESOURCE_DIR "/usr/lib/X11/app-defaults" -#endif - -//----------------------------------------------------------------------------- -// glabal data (data.cpp) -//----------------------------------------------------------------------------- - -extern wxList wxResourceCache; -extern XrmDatabase wxResourceDatabase; - -//----------------------------------------------------------------------------- -// utility functions for get/write resources -//----------------------------------------------------------------------------- - -static char *GetResourcePath(char *buf, char *name, bool create) -{ - if (create && FileExists(name)) { - strcpy(buf, name); - return buf; // Exists so ... - } - if (*name == '/') - strcpy(buf, name); - else { - // Put in standard place for resource files if not absolute - strcpy(buf, DEFAULT_XRESOURCE_DIR); - strcat(buf, "/"); - strcat(buf, FileNameFromPath(name)); - } - if (create) { - // Touch the file to create it - FILE *fd = fopen(buf, "w"); - if (fd) fclose(fd); - } - return buf; -} - -// Read $HOME for what it says is home, if not -// read $USER or $LOGNAME for user name else determine -// the Real User, then determine the Real home dir. -static char *GetIniFile(char *dest, const char *filename) -{ - char *home = NULL; - if (filename && wxIsAbsolutePath(filename)) - { - strcpy(dest, filename); - } - else - { - if ((home = wxGetUserHome(wxString())) != NULL) - { - strcpy(dest, home); - if (dest[strlen(dest) - 1] != '/') strcat(dest, "/"); - if (filename == NULL) - { - if ((filename = getenv("XENVIRONMENT")) == NULL) filename = ".Xdefaults"; - } - else - if (*filename != '.') strcat(dest, "."); - strcat(dest, filename); - } - else - { - dest[0] = '\0'; - } - } - return dest; -} - -static void wxXMergeDatabases(void) -{ - XrmDatabase homeDB, serverDB, applicationDB; - char filenamebuf[1024]; - - char *filename = &filenamebuf[0]; - char *environment; -// char *classname = gdk_progclass; // Robert Roebling ?? - printf( "Fixme.\n"); - char name[256]; - (void)strcpy(name, "/usr/lib/X11/app-defaults/"); - (void)strcat(name, classname ? classname : "wxWindows"); - - // Get application defaults file, if any - if ((applicationDB = XrmGetFileDatabase(name))) - (void)XrmMergeDatabases(applicationDB, &wxResourceDatabase); - - // Merge server defaults, created by xrdb, loaded as a property of the root - // window when the server initializes and loaded into the display - // structure on XOpenDisplay; - // if not defined, use .Xdefaults - printf( "Fixme.\n"); -/* if (XResourceManagerString(GDK_DISPLAY()) != NULL) { - serverDB = XrmGetStringDatabase(XResourceManagerString(GDK_DISPLAY())); - } else { - (void)GetIniFile(filename, NULL); - serverDB = XrmGetFileDatabase(filename); - } -*/ - if (serverDB) - XrmMergeDatabases(serverDB, &wxResourceDatabase); - - // Open XENVIRONMENT file, or if not defined, the .Xdefaults, - // and merge into existing database - - if ((environment = getenv("XENVIRONMENT")) == NULL) { - size_t len; - environment = GetIniFile(filename, NULL); - len = strlen(environment); -#if !defined(SVR4) || defined(__sgi) - (void)gethostname(environment + len, 1024 - len); -#else - (void)sysinfo(SI_HOSTNAME, environment + len, 1024 - len); -#endif - } - if ((homeDB = XrmGetFileDatabase(environment))) - XrmMergeDatabases(homeDB, &wxResourceDatabase); -} - -//----------------------------------------------------------------------------- -// called on application exit -//----------------------------------------------------------------------------- - -void wxFlushResources(void) -{ - char nameBuffer[512]; - - wxNode *node = wxResourceCache.First(); - while (node) { - char *file = node->key.string; - // If file doesn't exist, create it first. - (void)GetResourcePath(nameBuffer, file, TRUE); - - XrmDatabase database = (XrmDatabase)node->Data(); - XrmPutFileDatabase(database, nameBuffer); - XrmDestroyDatabase(database); - wxNode *next = node->Next(); - delete node; - node = next; - } -} - -void wxDeleteResources(const char *file) -{ - char buffer[500]; - (void)GetIniFile(buffer, file); - - wxNode *node = wxResourceCache.Find(buffer); - if (node) { - XrmDatabase database = (XrmDatabase)node->Data(); - XrmDestroyDatabase(database); - delete node; - } -} - -//----------------------------------------------------------------------------- -// resource functions -//----------------------------------------------------------------------------- - -bool wxWriteResource(const wxString& section, const wxString& entry, const wxString& value, const wxString& file ) -{ - char buffer[500]; - - if (!entry) return FALSE; - - (void)GetIniFile(buffer, file); - - XrmDatabase database; - wxNode *node = wxResourceCache.Find(buffer); - if (node) - database = (XrmDatabase)node->Data(); - else { - database = XrmGetFileDatabase(buffer); - wxResourceCache.Append(buffer, (wxObject *)database); - } - char resName[300]; - strcpy(resName, !section.IsNull() ? WXSTRINGCAST section : "wxWindows"); - strcat(resName, "."); - strcat(resName, entry); - XrmPutStringResource(&database, resName, value); - return TRUE; -}; - -bool wxWriteResource(const wxString& section, const wxString& entry, float value, const wxString& file ) -{ - char buf[50]; - sprintf(buf, "%.4f", value); - return wxWriteResource(section, entry, buf, file); -}; - -bool wxWriteResource(const wxString& section, const wxString& entry, long value, const wxString& file ) -{ - char buf[50]; - sprintf(buf, "%ld", value); - return wxWriteResource(section, entry, buf, file); -}; - -bool wxWriteResource(const wxString& section, const wxString& entry, int value, const wxString& file ) -{ - char buf[50]; - sprintf(buf, "%d", value); - return wxWriteResource(section, entry, buf, file); -}; - -bool wxGetResource(const wxString& section, const wxString& entry, char **value, const wxString& file ) -{ - if (!wxResourceDatabase) - wxXMergeDatabases(); - - XrmDatabase database; - if (file) { - char buffer[500]; - // Is this right? Trying to get it to look in the user's - // home directory instead of current directory -- JACS - (void)GetIniFile(buffer, file); - - wxNode *node = wxResourceCache.Find(buffer); - if (node) - database = (XrmDatabase)node->Data(); - else { - database = XrmGetFileDatabase(buffer); - wxResourceCache.Append(buffer, (wxObject *)database); - } - } else - database = wxResourceDatabase; - - XrmValue xvalue; - char *str_type[20]; - char buf[150]; - strcpy(buf, section); - strcat(buf, "."); - strcat(buf, entry); - - bool success = XrmGetResource(database, buf, "*", str_type, &xvalue); - // Try different combinations of upper/lower case, just in case... - if (!success) { - buf[0] = (isupper(buf[0]) ? tolower(buf[0]) : toupper(buf[0])); - success = XrmGetResource(database, buf, "*", str_type, &xvalue); - } - if (success) { - if (*value) - delete[] *value; - *value = new char[xvalue.size + 1]; - strncpy(*value, xvalue.addr, (int)xvalue.size); - return TRUE; - } - return FALSE; -}; - -bool wxGetResource(const wxString& section, const wxString& entry, float *value, const wxString& file ) -{ - char *s = NULL; - bool succ = wxGetResource(section, entry, &s, file); - if (succ) { - *value = (float)strtod(s, NULL); - delete[]s; - return TRUE; - } else - return FALSE; -}; - -bool wxGetResource(const wxString& section, const wxString& entry, long *value, const wxString& file ) -{ - char *s = NULL; - bool succ = wxGetResource(section, entry, &s, file); - if (succ) { - *value = strtol(s, NULL, 10); - delete[]s; - return TRUE; - } else - return FALSE; -}; - -bool wxGetResource(const wxString& section, const wxString& entry, int *value, const wxString& file ) -{ - char *s = NULL; - bool succ = wxGetResource(section, entry, &s, file); - if (succ) { - // Handle True, False here - // True, Yes, Enables, Set or Activated - if (*s == 'T' || *s == 'Y' || *s == 'E' || *s == 'S' || *s == 'A') - *value = TRUE; - // False, No, Disabled, Reset, Cleared, Deactivated - else if (*s == 'F' || *s == 'N' || *s == 'D' || *s == 'R' || *s == 'C') - *value = FALSE; - // Handle as Integer - else - *value = (int)strtol(s, NULL, 10); - delete[]s; - return TRUE; - } else - return FALSE; -}; - diff --git a/src/qt/verti.xbm b/src/qt/verti.xbm deleted file mode 100644 index 2dd9dc4c05..0000000000 --- a/src/qt/verti.xbm +++ /dev/null @@ -1,6 +0,0 @@ -#define verti_width 15 -#define verti_height 15 -static char verti_bits[] = { - 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, - 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, - 0x84, 0x10, 0x84, 0x10, 0x84, 0x10}; diff --git a/src/qt/window.cpp b/src/qt/window.cpp deleted file mode 100644 index 761e34e9d0..0000000000 --- a/src/qt/window.cpp +++ /dev/null @@ -1,1282 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: windows.cpp -// Purpose: wxWindow -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "window.h" -#endif - -#include "wx/setup.h" -#include "wx/menu.h" -#include "wx/dc.h" -#include "wx/dcclient.h" -#include "wx/utils.h" -#include "wx/app.h" -#include "wx/panel.h" -#include "wx/layout.h" -#include "wx/dialog.h" -#include "wx/listbox.h" -#include "wx/button.h" -#include "wx/settings.h" -#include "wx/msgdlg.h" - -#include "wx/menuitem.h" -#include "wx/log.h" - -#if wxUSE_DRAG_AND_DROP -#include "wx/dnd.h" -#endif - -#include - -extern wxList wxPendingDelete; - -IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxEvtHandler) - -BEGIN_EVENT_TABLE(wxWindow, wxEvtHandler) - EVT_CHAR(wxWindow::OnChar) - EVT_ERASE_BACKGROUND(wxWindow::OnEraseBackground) - EVT_SYS_COLOUR_CHANGED(wxWindow::OnSysColourChanged) - EVT_INIT_DIALOG(wxWindow::OnInitDialog) - EVT_IDLE(wxWindow::OnIdle) -END_EVENT_TABLE() - - - -// Constructor -wxWindow::wxWindow() -{ - // Generic - m_windowId = 0; - m_windowStyle = 0; - m_windowParent = NULL; - m_windowEventHandler = this; - m_windowName = ""; - m_windowCursor = *wxSTANDARD_CURSOR; - m_children = new wxList; - m_constraints = NULL; - m_constraintsInvolvedIn = NULL; - m_windowSizer = NULL; - m_sizerParent = NULL; - m_autoLayout = FALSE; - m_windowValidator = NULL; - m_defaultItem = NULL; - m_returnCode = 0; - m_caretWidth = 0; m_caretHeight = 0; - m_caretEnabled = FALSE; - m_caretShown = FALSE; - m_backgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOW) ; ; - m_foregroundColour = *wxBLACK; - m_defaultForegroundColour = *wxBLACK ; - m_defaultBackgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE) ; - -#if wxUSE_DRAG_AND_DROP - m_pDropTarget = NULL; -#endif -} - -// Destructor -wxWindow::~wxWindow() -{ - // Have to delete constraints/sizer FIRST otherwise - // sizers may try to look at deleted windows as they - // delete themselves. -#if wxUSE_CONSTRAINTS - DeleteRelatedConstraints(); - if (m_constraints) - { - // This removes any dangling pointers to this window - // in other windows' constraintsInvolvedIn lists. - UnsetConstraints(m_constraints); - delete m_constraints; - m_constraints = NULL; - } - if (m_windowSizer) - { - delete m_windowSizer; - m_windowSizer = NULL; - } - // If this is a child of a sizer, remove self from parent - if (m_sizerParent) - m_sizerParent->RemoveChild((wxWindow *)this); -#endif - - if (m_windowParent) - m_windowParent->RemoveChild(this); - - DestroyChildren(); - - // TODO: destroy the window - - delete m_children; - m_children = NULL; - - // Just in case the window has been Closed, but - // we're then deleting immediately: don't leave - // dangling pointers. - wxPendingDelete.DeleteObject(this); - - if ( m_windowValidator ) - delete m_windowValidator; -} - -// Destroy the window (delayed, if a managed window) -bool wxWindow::Destroy() -{ - delete this; - return TRUE; -} - -// Constructor -bool wxWindow::Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - // Generic - m_windowId = 0; - m_windowStyle = 0; - m_windowParent = NULL; - m_windowEventHandler = this; - m_windowName = ""; - m_windowCursor = *wxSTANDARD_CURSOR; - m_constraints = NULL; - m_constraintsInvolvedIn = NULL; - m_windowSizer = NULL; - m_sizerParent = NULL; - m_autoLayout = FALSE; - m_windowValidator = NULL; - -#if wxUSE_DRAG_AND_DROP - m_pDropTarget = NULL; -#endif - - m_caretWidth = 0; m_caretHeight = 0; - m_caretEnabled = FALSE; - m_caretShown = FALSE; - m_minSizeX = -1; - m_minSizeY = -1; - m_maxSizeX = -1; - m_maxSizeY = -1; - m_defaultItem = NULL; - m_windowParent = NULL; - if (!parent) - return FALSE; - - if (parent) parent->AddChild(this); - - m_returnCode = 0; - - SetName(name); - - if ( id == -1 ) - m_windowId = (int)NewControlId(); - else - m_windowId = id; - - m_backgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOW) ; ; - m_foregroundColour = *wxBLACK; - m_defaultForegroundColour = *wxBLACK ; - m_defaultBackgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE) ; - - m_windowStyle = style; - - if ( id == -1 ) - m_windowId = (int)NewControlId(); - else - m_windowId = id; - - // TODO: create the window - - return TRUE; -} - -void wxWindow::SetFocus() -{ - // TODO -} - -void wxWindow::Enable(bool enable) -{ - // TODO -} - -void wxWindow::CaptureMouse() -{ - // TODO -} - -void wxWindow::ReleaseMouse() -{ - // TODO -} - -// Push/pop event handler (i.e. allow a chain of event handlers -// be searched) -void wxWindow::PushEventHandler(wxEvtHandler *handler) -{ - handler->SetNextHandler(GetEventHandler()); - SetEventHandler(handler); -} - -wxEvtHandler *wxWindow::PopEventHandler(bool deleteHandler) -{ - if ( GetEventHandler() ) - { - wxEvtHandler *handlerA = GetEventHandler(); - wxEvtHandler *handlerB = handlerA->GetNextHandler(); - handlerA->SetNextHandler(NULL); - SetEventHandler(handlerB); - if ( deleteHandler ) - { - delete handlerA; - return NULL; - } - else - return handlerA; - } - else - return NULL; -} - -#if wxUSE_DRAG_AND_DROP - -void wxWindow::SetDropTarget(wxDropTarget *pDropTarget) -{ - if ( m_pDropTarget != 0 ) { - m_pDropTarget->Revoke(m_hWnd); - delete m_pDropTarget; - } - - m_pDropTarget = pDropTarget; - if ( m_pDropTarget != 0 ) - m_pDropTarget->Register(m_hWnd); -} - -#endif - -// Old style file-manager drag&drop -void wxWindow::DragAcceptFiles(bool accept) -{ - // TODO -} - -// Get total size -void wxWindow::GetSize(int *x, int *y) const -{ - // TODO -} - -void wxWindow::GetPosition(int *x, int *y) const -{ - // TODO -} - -void wxWindow::ScreenToClient(int *x, int *y) const -{ - // TODO -} - -void wxWindow::ClientToScreen(int *x, int *y) const -{ - // TODO -} - -void wxWindow::SetCursor(const wxCursor& cursor) -{ - m_windowCursor = cursor; - if (m_windowCursor.Ok()) - { - // TODO - } -} - - -// Get size *available for subwindows* i.e. excluding menu bar etc. -void wxWindow::GetClientSize(int *x, int *y) const -{ - // TODO -} - -void wxWindow::SetSize(int x, int y, int width, int height, int sizeFlags) -{ - // TODO -} - -void wxWindow::SetClientSize(int width, int height) -{ - // TODO -} - -// For implementation purposes - sometimes decorations make the client area -// smaller -wxPoint wxWindow::GetClientAreaOrigin() const -{ - return wxPoint(0, 0); -} - -// Makes an adjustment to the window position (for example, a frame that has -// a toolbar that it manages itself). -void wxWindow::AdjustForParentClientOrigin(int& x, int& y, int sizeFlags) -{ - if (((sizeFlags & wxSIZE_NO_ADJUSTMENTS) == 0) && GetParent()) - { - wxPoint pt(GetParent()->GetClientAreaOrigin()); - x += pt.x; y += pt.y; - } -} - -bool wxWindow::Show(bool show) -{ - // TODO - return FALSE; -} - -bool wxWindow::IsShown() const -{ - // TODO - return FALSE; -} - -int wxWindow::GetCharHeight() const -{ - // TODO - return 0; -} - -int wxWindow::GetCharWidth() const -{ - // TODO - return 0; -} - -void wxWindow::GetTextExtent(const wxString& string, int *x, int *y, - int *descent, int *externalLeading, const wxFont *theFont, bool) const -{ - wxFont *fontToUse = (wxFont *)theFont; - if (!fontToUse) - fontToUse = (wxFont *) & m_windowFont; - - // TODO -} - -void wxWindow::Refresh(bool eraseBack, const wxRect *rect) -{ - // TODO -} - -// Responds to colour changes: passes event on to children. -void wxWindow::OnSysColourChanged(wxSysColourChangedEvent& event) -{ - wxNode *node = GetChildren()->First(); - while ( node ) - { - // Only propagate to non-top-level windows - wxWindow *win = (wxWindow *)node->Data(); - if ( win->GetParent() ) - { - wxSysColourChangedEvent event2; - event.m_eventObject = win; - win->GetEventHandler()->ProcessEvent(event2); - } - - node = node->Next(); - } -} - -// This can be called by the app (or wxWindows) to do default processing for the current -// event. Save message/event info in wxWindow so they can be used in this function. -long wxWindow::Default() -{ - // TODO - return 0; -} - -void wxWindow::InitDialog() -{ - wxInitDialogEvent event(GetId()); - event.SetEventObject( this ); - GetEventHandler()->ProcessEvent(event); -} - -// Default init dialog behaviour is to transfer data to window -void wxWindow::OnInitDialog(wxInitDialogEvent& event) -{ - TransferDataToWindow(); -} - -// Caret manipulation -void wxWindow::CreateCaret(int w, int h) -{ - m_caretWidth = w; - m_caretHeight = h; - m_caretEnabled = TRUE; -} - -void wxWindow::CreateCaret(const wxBitmap *WXUNUSED(bitmap)) -{ - // TODO -} - -void wxWindow::ShowCaret(bool show) -{ - // TODO -} - -void wxWindow::DestroyCaret() -{ - // TODO - m_caretEnabled = FALSE; -} - -void wxWindow::SetCaretPos(int x, int y) -{ - // TODO -} - -void wxWindow::GetCaretPos(int *x, int *y) const -{ - // TODO -} - -wxWindow *wxGetActiveWindow() -{ - // TODO - return NULL; -} - -void wxWindow::SetSizeHints(int minW, int minH, int maxW, int maxH, int WXUNUSED(incW), int WXUNUSED(incH)) -{ - m_minSizeX = minW; - m_minSizeY = minH; - m_maxSizeX = maxW; - m_maxSizeY = maxH; -} - -void wxWindow::Centre(int direction) -{ - int x, y, width, height, panel_width, panel_height, new_x, new_y; - - wxWindow *father = (wxWindow *)GetParent(); - if (!father) - return; - - father->GetClientSize(&panel_width, &panel_height); - GetSize(&width, &height); - GetPosition(&x, &y); - - new_x = -1; - new_y = -1; - - 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, -1, -1); - -} - -// Coordinates relative to the window -void wxWindow::WarpPointer (int x_pos, int y_pos) -{ - // TODO -} - -void wxWindow::OnEraseBackground(wxEraseEvent& event) -{ - // TODO - Default(); -} - -int wxWindow::GetScrollPos(int orient) const -{ - // TODO - return 0; -} - -// This now returns the whole range, not just the number -// of positions that we can scroll. -int wxWindow::GetScrollRange(int orient) const -{ - // TODO - return 0; -} - -int wxWindow::GetScrollThumb(int orient) const -{ - // TODO - return 0; -} - -void wxWindow::SetScrollPos(int orient, int pos, bool refresh) -{ - // TODO - return 0; -} - -// New function that will replace some of the above. -void wxWindow::SetScrollbar(int orient, int pos, int thumbVisible, - int range, bool refresh) -{ - // TODO -} - -// Does a physical scroll -void wxWindow::ScrollWindow(int dx, int dy, const wxRect *rect) -{ - // TODO - return 0; -} - -void wxWindow::SetFont(const wxFont& font) -{ - m_windowFont = font; - - if (!m_windowFont.Ok()) - return; - // TODO -} - -void wxWindow::OnChar(wxKeyEvent& event) -{ - if ( event.KeyCode() == WXK_TAB ) { - // propagate the TABs to the parent - it's up to it to decide what - // to do with it - if ( GetParent() ) { - if ( GetParent()->ProcessEvent(event) ) - return; - } - } -} - -void wxWindow::OnPaint(wxPaintEvent& event) -{ - Default(); -} - -bool wxWindow::IsEnabled() const -{ - // TODO - return FALSE; -} - -// Dialog support: override these and call -// base class members to add functionality -// that can't be done using validators. -// NOTE: these functions assume that controls -// are direct children of this window, not grandchildren -// or other levels of descendant. - -// Transfer values to controls. If returns FALSE, -// it's an application error (pops up a dialog) -bool wxWindow::TransferDataToWindow() -{ - wxNode *node = GetChildren()->First(); - while ( node ) - { - wxWindow *child = (wxWindow *)node->Data(); - if ( child->GetValidator() && - !child->GetValidator()->TransferToWindow() ) - { - wxMessageBox("Application Error", "Could not transfer data to window", wxOK|wxICON_EXCLAMATION); - return FALSE; - } - - node = node->Next(); - } - return TRUE; -} - -// Transfer values from controls. If returns FALSE, -// validation failed: don't quit -bool wxWindow::TransferDataFromWindow() -{ - wxNode *node = GetChildren()->First(); - while ( node ) - { - wxWindow *child = (wxWindow *)node->Data(); - if ( child->GetValidator() && !child->GetValidator()->TransferFromWindow() ) - { - return FALSE; - } - - node = node->Next(); - } - return TRUE; -} - -bool wxWindow::Validate() -{ - wxNode *node = GetChildren()->First(); - while ( node ) - { - wxWindow *child = (wxWindow *)node->Data(); - if ( child->GetValidator() && /* child->GetValidator()->Ok() && */ !child->GetValidator()->Validate(this) ) - { - return FALSE; - } - - node = node->Next(); - } - return TRUE; -} - -// Get the window with the focus -wxWindow *wxWindow::FindFocus() -{ - // TODO - return NULL; -} - -void wxWindow::AddChild(wxWindow *child) -{ - GetChildren()->Append(child); - child->m_windowParent = this; -} - -void wxWindow::RemoveChild(wxWindow *child) -{ - if (GetChildren()) - GetChildren()->DeleteObject(child); - child->m_windowParent = NULL; -} - -void wxWindow::DestroyChildren() -{ - if (GetChildren()) { - wxNode *node; - while ((node = GetChildren()->First()) != (wxNode *)NULL) { - wxWindow *child; - if ((child = (wxWindow *)node->Data()) != (wxWindow *)NULL) { - delete child; - if ( GetChildren()->Member(child) ) - delete node; - } - } /* while */ - } -} - -void wxWindow::MakeModal(bool modal) -{ - // Disable all other windows - if (this->IsKindOf(CLASSINFO(wxDialog)) || this->IsKindOf(CLASSINFO(wxFrame))) - { - wxNode *node = wxTopLevelWindows.First(); - while (node) - { - wxWindow *win = (wxWindow *)node->Data(); - if (win != this) - win->Enable(!modal); - - node = node->Next(); - } - } -} - -// If nothing defined for this, try the parent. -// E.g. we may be a button loaded from a resource, with no callback function -// defined. -void wxWindow::OnCommand(wxWindow& win, wxCommandEvent& event) -{ - if (GetEventHandler()->ProcessEvent(event) ) - return; - if (m_windowParent) - m_windowParent->GetEventHandler()->OnCommand(win, event); -} - -void wxWindow::SetConstraints(wxLayoutConstraints *c) -{ - if (m_constraints) - { - UnsetConstraints(m_constraints); - delete m_constraints; - } - m_constraints = c; - if (m_constraints) - { - // Make sure other windows know they're part of a 'meaningful relationship' - if (m_constraints->left.GetOtherWindow() && (m_constraints->left.GetOtherWindow() != this)) - m_constraints->left.GetOtherWindow()->AddConstraintReference((wxWindow *)this); - if (m_constraints->top.GetOtherWindow() && (m_constraints->top.GetOtherWindow() != this)) - m_constraints->top.GetOtherWindow()->AddConstraintReference((wxWindow *)this); - if (m_constraints->right.GetOtherWindow() && (m_constraints->right.GetOtherWindow() != this)) - m_constraints->right.GetOtherWindow()->AddConstraintReference((wxWindow *)this); - if (m_constraints->bottom.GetOtherWindow() && (m_constraints->bottom.GetOtherWindow() != this)) - m_constraints->bottom.GetOtherWindow()->AddConstraintReference((wxWindow *)this); - if (m_constraints->width.GetOtherWindow() && (m_constraints->width.GetOtherWindow() != this)) - m_constraints->width.GetOtherWindow()->AddConstraintReference((wxWindow *)this); - if (m_constraints->height.GetOtherWindow() && (m_constraints->height.GetOtherWindow() != this)) - m_constraints->height.GetOtherWindow()->AddConstraintReference((wxWindow *)this); - if (m_constraints->centreX.GetOtherWindow() && (m_constraints->centreX.GetOtherWindow() != this)) - m_constraints->centreX.GetOtherWindow()->AddConstraintReference((wxWindow *)this); - if (m_constraints->centreY.GetOtherWindow() && (m_constraints->centreY.GetOtherWindow() != this)) - m_constraints->centreY.GetOtherWindow()->AddConstraintReference((wxWindow *)this); - } -} - -// This removes any dangling pointers to this window -// in other windows' constraintsInvolvedIn lists. -void wxWindow::UnsetConstraints(wxLayoutConstraints *c) -{ - if (c) - { - if (c->left.GetOtherWindow() && (c->top.GetOtherWindow() != this)) - c->left.GetOtherWindow()->RemoveConstraintReference((wxWindow *)this); - if (c->top.GetOtherWindow() && (c->top.GetOtherWindow() != this)) - c->top.GetOtherWindow()->RemoveConstraintReference((wxWindow *)this); - if (c->right.GetOtherWindow() && (c->right.GetOtherWindow() != this)) - c->right.GetOtherWindow()->RemoveConstraintReference((wxWindow *)this); - if (c->bottom.GetOtherWindow() && (c->bottom.GetOtherWindow() != this)) - c->bottom.GetOtherWindow()->RemoveConstraintReference((wxWindow *)this); - if (c->width.GetOtherWindow() && (c->width.GetOtherWindow() != this)) - c->width.GetOtherWindow()->RemoveConstraintReference((wxWindow *)this); - if (c->height.GetOtherWindow() && (c->height.GetOtherWindow() != this)) - c->height.GetOtherWindow()->RemoveConstraintReference((wxWindow *)this); - if (c->centreX.GetOtherWindow() && (c->centreX.GetOtherWindow() != this)) - c->centreX.GetOtherWindow()->RemoveConstraintReference((wxWindow *)this); - if (c->centreY.GetOtherWindow() && (c->centreY.GetOtherWindow() != this)) - c->centreY.GetOtherWindow()->RemoveConstraintReference((wxWindow *)this); - } -} - -// Back-pointer to other windows we're involved with, so if we delete -// this window, we must delete any constraints we're involved with. -void wxWindow::AddConstraintReference(wxWindow *otherWin) -{ - if (!m_constraintsInvolvedIn) - m_constraintsInvolvedIn = new wxList; - if (!m_constraintsInvolvedIn->Member(otherWin)) - m_constraintsInvolvedIn->Append(otherWin); -} - -// REMOVE back-pointer to other windows we're involved with. -void wxWindow::RemoveConstraintReference(wxWindow *otherWin) -{ - if (m_constraintsInvolvedIn) - m_constraintsInvolvedIn->DeleteObject(otherWin); -} - -// Reset any constraints that mention this window -void wxWindow::DeleteRelatedConstraints() -{ - if (m_constraintsInvolvedIn) - { - wxNode *node = m_constraintsInvolvedIn->First(); - while (node) - { - wxWindow *win = (wxWindow *)node->Data(); - wxNode *next = node->Next(); - wxLayoutConstraints *constr = win->GetConstraints(); - - // Reset any constraints involving this window - if (constr) - { - constr->left.ResetIfWin((wxWindow *)this); - constr->top.ResetIfWin((wxWindow *)this); - constr->right.ResetIfWin((wxWindow *)this); - constr->bottom.ResetIfWin((wxWindow *)this); - constr->width.ResetIfWin((wxWindow *)this); - constr->height.ResetIfWin((wxWindow *)this); - constr->centreX.ResetIfWin((wxWindow *)this); - constr->centreY.ResetIfWin((wxWindow *)this); - } - delete node; - node = next; - } - delete m_constraintsInvolvedIn; - m_constraintsInvolvedIn = NULL; - } -} - -void wxWindow::SetSizer(wxSizer *sizer) -{ - m_windowSizer = sizer; - if (sizer) - sizer->SetSizerParent((wxWindow *)this); -} - -/* - * New version - */ - -bool wxWindow::Layout() -{ - if (GetConstraints()) - { - int w, h; - GetClientSize(&w, &h); - GetConstraints()->width.SetValue(w); - GetConstraints()->height.SetValue(h); - } - - // If top level (one sizer), evaluate the sizer's constraints. - if (GetSizer()) - { - int noChanges; - GetSizer()->ResetConstraints(); // Mark all constraints as unevaluated - GetSizer()->LayoutPhase1(&noChanges); - GetSizer()->LayoutPhase2(&noChanges); - GetSizer()->SetConstraintSizes(); // Recursively set the real window sizes - return TRUE; - } - else - { - // Otherwise, evaluate child constraints - ResetConstraints(); // Mark all constraints as unevaluated - DoPhase(1); // Just one phase need if no sizers involved - DoPhase(2); - SetConstraintSizes(); // Recursively set the real window sizes - } - return TRUE; -} - - -// Do a phase of evaluating constraints: -// the default behaviour. wxSizers may do a similar -// thing, but also impose their own 'constraints' -// and order the evaluation differently. -bool wxWindow::LayoutPhase1(int *noChanges) -{ - wxLayoutConstraints *constr = GetConstraints(); - if (constr) - { - return constr->SatisfyConstraints((wxWindow *)this, noChanges); - } - else - return TRUE; -} - -bool wxWindow::LayoutPhase2(int *noChanges) -{ - *noChanges = 0; - - // Layout children - DoPhase(1); - DoPhase(2); - return TRUE; -} - -// Do a phase of evaluating child constraints -bool wxWindow::DoPhase(int phase) -{ - int noIterations = 0; - int maxIterations = 500; - int noChanges = 1; - int noFailures = 0; - wxList succeeded; - while ((noChanges > 0) && (noIterations < maxIterations)) - { - noChanges = 0; - noFailures = 0; - wxNode *node = GetChildren()->First(); - while (node) - { - wxWindow *child = (wxWindow *)node->Data(); - if (!child->IsKindOf(CLASSINFO(wxFrame)) && !child->IsKindOf(CLASSINFO(wxDialog))) - { - wxLayoutConstraints *constr = child->GetConstraints(); - if (constr) - { - if (succeeded.Member(child)) - { - } - else - { - int tempNoChanges = 0; - bool success = ( (phase == 1) ? child->LayoutPhase1(&tempNoChanges) : child->LayoutPhase2(&tempNoChanges) ) ; - noChanges += tempNoChanges; - if (success) - { - succeeded.Append(child); - } - } - } - } - node = node->Next(); - } - noIterations ++; - } - return TRUE; -} - -void wxWindow::ResetConstraints() -{ - wxLayoutConstraints *constr = GetConstraints(); - if (constr) - { - constr->left.SetDone(FALSE); - constr->top.SetDone(FALSE); - constr->right.SetDone(FALSE); - constr->bottom.SetDone(FALSE); - constr->width.SetDone(FALSE); - constr->height.SetDone(FALSE); - constr->centreX.SetDone(FALSE); - constr->centreY.SetDone(FALSE); - } - wxNode *node = GetChildren()->First(); - while (node) - { - wxWindow *win = (wxWindow *)node->Data(); - if (!win->IsKindOf(CLASSINFO(wxFrame)) && !win->IsKindOf(CLASSINFO(wxDialog))) - win->ResetConstraints(); - node = node->Next(); - } -} - -// Need to distinguish between setting the 'fake' size for -// windows and sizers, and setting the real values. -void wxWindow::SetConstraintSizes(bool recurse) -{ - wxLayoutConstraints *constr = GetConstraints(); - if (constr && constr->left.GetDone() && constr->right.GetDone() && - constr->width.GetDone() && constr->height.GetDone()) - { - int x = constr->left.GetValue(); - int y = constr->top.GetValue(); - int w = constr->width.GetValue(); - int h = constr->height.GetValue(); - - // If we don't want to resize this window, just move it... - if ((constr->width.GetRelationship() != wxAsIs) || - (constr->height.GetRelationship() != wxAsIs)) - { - // Calls Layout() recursively. AAAGH. How can we stop that. - // Simply take Layout() out of non-top level OnSizes. - SizerSetSize(x, y, w, h); - } - else - { - SizerMove(x, y); - } - } - else if (constr) - { - char *windowClass = this->GetClassInfo()->GetClassName(); - - wxString winName; - if (GetName() == "") - winName = "unnamed"; - else - winName = GetName(); - wxDebugMsg("Constraint(s) not satisfied for window of type %s, name %s:\n", (const char *)windowClass, (const char *)winName); - if (!constr->left.GetDone()) - wxDebugMsg(" unsatisfied 'left' constraint.\n"); - if (!constr->right.GetDone()) - wxDebugMsg(" unsatisfied 'right' constraint.\n"); - if (!constr->width.GetDone()) - wxDebugMsg(" unsatisfied 'width' constraint.\n"); - if (!constr->height.GetDone()) - wxDebugMsg(" unsatisfied 'height' constraint.\n"); - wxDebugMsg("Please check constraints: try adding AsIs() constraints.\n"); - } - - if (recurse) - { - wxNode *node = GetChildren()->First(); - while (node) - { - wxWindow *win = (wxWindow *)node->Data(); - if (!win->IsKindOf(CLASSINFO(wxFrame)) && !win->IsKindOf(CLASSINFO(wxDialog))) - win->SetConstraintSizes(); - node = node->Next(); - } - } -} - -// This assumes that all sizers are 'on' the same -// window, i.e. the parent of this window. -void wxWindow::TransformSizerToActual(int *x, int *y) const -{ - if (!m_sizerParent || m_sizerParent->IsKindOf(CLASSINFO(wxDialog)) || - m_sizerParent->IsKindOf(CLASSINFO(wxFrame)) ) - return; - - int xp, yp; - m_sizerParent->GetPosition(&xp, &yp); - m_sizerParent->TransformSizerToActual(&xp, &yp); - *x += xp; - *y += yp; -} - -void wxWindow::SizerSetSize(int x, int y, int w, int h) -{ - int xx = x; - int yy = y; - TransformSizerToActual(&xx, &yy); - SetSize(xx, yy, w, h); -} - -void wxWindow::SizerMove(int x, int y) -{ - int xx = x; - int yy = y; - TransformSizerToActual(&xx, &yy); - Move(xx, yy); -} - -// Only set the size/position of the constraint (if any) -void wxWindow::SetSizeConstraint(int x, int y, int w, int h) -{ - wxLayoutConstraints *constr = GetConstraints(); - if (constr) - { - if (x != -1) - { - constr->left.SetValue(x); - constr->left.SetDone(TRUE); - } - if (y != -1) - { - constr->top.SetValue(y); - constr->top.SetDone(TRUE); - } - if (w != -1) - { - constr->width.SetValue(w); - constr->width.SetDone(TRUE); - } - if (h != -1) - { - constr->height.SetValue(h); - constr->height.SetDone(TRUE); - } - } -} - -void wxWindow::MoveConstraint(int x, int y) -{ - wxLayoutConstraints *constr = GetConstraints(); - if (constr) - { - if (x != -1) - { - constr->left.SetValue(x); - constr->left.SetDone(TRUE); - } - if (y != -1) - { - constr->top.SetValue(y); - constr->top.SetDone(TRUE); - } - } -} - -void wxWindow::GetSizeConstraint(int *w, int *h) const -{ - wxLayoutConstraints *constr = GetConstraints(); - if (constr) - { - *w = constr->width.GetValue(); - *h = constr->height.GetValue(); - } - else - GetSize(w, h); -} - -void wxWindow::GetClientSizeConstraint(int *w, int *h) const -{ - wxLayoutConstraints *constr = GetConstraints(); - if (constr) - { - *w = constr->width.GetValue(); - *h = constr->height.GetValue(); - } - else - GetClientSize(w, h); -} - -void wxWindow::GetPositionConstraint(int *x, int *y) const -{ - wxLayoutConstraints *constr = GetConstraints(); - if (constr) - { - *x = constr->left.GetValue(); - *y = constr->top.GetValue(); - } - else - GetPosition(x, y); -} - -bool wxWindow::Close(bool force) -{ - wxCloseEvent event(wxEVT_CLOSE_WINDOW, m_windowId); - event.SetEventObject(this); -#if WXWIN_COMPATIBILITY - event.SetForce(force); -#endif - event.SetCanVeto(!force); - - return GetEventHandler()->ProcessEvent(event); -} - -wxObject* wxWindow::GetChild(int number) const -{ - // Return a pointer to the Nth object in the window - if (!GetChildren()) - return(NULL) ; - wxNode *node = GetChildren()->First(); - int n = number; - while (node && n--) - node = node->Next() ; - if (node) - { - wxObject *obj = (wxObject *)node->Data(); - return(obj) ; - } - else - return NULL ; -} - -void wxWindow::OnDefaultAction(wxControl *initiatingItem) -{ - // Obsolete function -} - -void wxWindow::Clear() -{ - wxClientDC dc(this); - wxBrush brush(GetBackgroundColour(), wxSOLID); - dc.SetBackground(brush); - dc.Clear(); -} - -// Fits the panel around the items -void wxWindow::Fit() -{ - int maxX = 0; - int maxY = 0; - wxNode *node = GetChildren()->First(); - while ( node ) - { - wxWindow *win = (wxWindow *)node->Data(); - int wx, wy, ww, wh; - win->GetPosition(&wx, &wy); - win->GetSize(&ww, &wh); - if ( wx + ww > maxX ) - maxX = wx + ww; - if ( wy + wh > maxY ) - maxY = wy + wh; - - node = node->Next(); - } - SetClientSize(maxX + 5, maxY + 5); -} - -void wxWindow::SetValidator(const wxValidator& validator) -{ - if ( m_windowValidator ) - delete m_windowValidator; - m_windowValidator = validator.Clone(); - - if ( m_windowValidator ) - m_windowValidator->SetWindow(this) ; -} - -// Find a window by id or name -wxWindow *wxWindow::FindWindow(long id) -{ - if ( GetId() == id) - return this; - - wxNode *node = GetChildren()->First(); - while ( node ) - { - wxWindow *child = (wxWindow *)node->Data(); - wxWindow *found = child->FindWindow(id); - if ( found ) - return found; - node = node->Next(); - } - return NULL; -} - -wxWindow *wxWindow::FindWindow(const wxString& name) -{ - if ( GetName() == name) - return this; - - wxNode *node = GetChildren()->First(); - while ( node ) - { - wxWindow *child = (wxWindow *)node->Data(); - wxWindow *found = child->FindWindow(name); - if ( found ) - return found; - node = node->Next(); - } - return NULL; -} - -void wxWindow::OnIdle(wxIdleEvent& event) -{ -/* TODO: you may need to do something like this - * if your GUI doesn't generate enter/leave events - - // Check if we need to send a LEAVE event - if (m_mouseInWindow) - { - POINT pt; - ::GetCursorPos(&pt); - if (::WindowFromPoint(pt) != (HWND) GetHWND()) - { - // Generate a LEAVE event - m_mouseInWindow = FALSE; - MSWOnMouseLeave(pt.x, pt.y, 0); - } - } -*/ - - // This calls the UI-update mechanism (querying windows for - // menu/toolbar/control state information) - UpdateWindowUI(); -} - -// Raise the window to the top of the Z order -void wxWindow::Raise() -{ - // TODO -} - -// Lower the window to the bottom of the Z order -void wxWindow::Lower() -{ - // TODO -} - -bool wxWindow::AcceptsFocus() const -{ - return IsShown() && IsEnabled(); -} - -// Update region access -wxRegion wxWindow::GetUpdateRegion() const -{ - return m_updateRegion; -} - -bool wxWindow::IsExposed(int x, int y, int w, int h) const -{ - return (m_updateRegion.Contains(x, y, w, h) != wxOutRegion); -} - -bool wxWindow::IsExposed(const wxPoint& pt) const -{ - return (m_updateRegion.Contains(pt) != wxOutRegion); -} - -bool wxWindow::IsExposed(const wxRect& rect) const -{ - return (m_updateRegion.Contains(rect) != wxOutRegion); -} - - diff --git a/src/stubs/accel.cpp b/src/stubs/accel.cpp deleted file mode 100644 index f8796e111a..0000000000 --- a/src/stubs/accel.cpp +++ /dev/null @@ -1,91 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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" - -IMPLEMENT_DYNAMIC_CLASS(wxAcceleratorTable, wxObject) - -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; -} - diff --git a/src/stubs/app.cpp b/src/stubs/app.cpp deleted file mode 100644 index 681e661556..0000000000 --- a/src/stubs/app.cpp +++ /dev/null @@ -1,389 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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 - -extern char *wxBuffer; -extern wxList wxPendingDelete; - -wxApp *wxTheApp = NULL; - -IMPLEMENT_DYNAMIC_CLASS(wxApp, wxEvtHandler) -BEGIN_EVENT_TABLE(wxApp, wxEvtHandler) - EVT_IDLE(wxApp::OnIdle) -END_EVENT_TABLE() - -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; -} - diff --git a/src/stubs/bitmap.cpp b/src/stubs/bitmap.cpp deleted file mode 100644 index d6f9fa87e3..0000000000 --- a/src/stubs/bitmap.cpp +++ /dev/null @@ -1,428 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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" - -IMPLEMENT_DYNAMIC_CLASS(wxBitmap, wxGDIObject) -IMPLEMENT_DYNAMIC_CLASS(wxMask, wxObject) - -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); -*/ -} diff --git a/src/stubs/bmpbuttn.cpp b/src/stubs/bmpbuttn.cpp deleted file mode 100644 index b39c2c3bcd..0000000000 --- a/src/stubs/bmpbuttn.cpp +++ /dev/null @@ -1,63 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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" - -IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton, wxButton) - -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; -} - diff --git a/src/stubs/brush.cpp b/src/stubs/brush.cpp deleted file mode 100644 index 7c9f52ae2a..0000000000 --- a/src/stubs/brush.cpp +++ /dev/null @@ -1,138 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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" - -IMPLEMENT_DYNAMIC_CLASS(wxBrush, wxGDIObject) - -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; -} - diff --git a/src/stubs/button.cpp b/src/stubs/button.cpp deleted file mode 100644 index 2928e0d96f..0000000000 --- a/src/stubs/button.cpp +++ /dev/null @@ -1,73 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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" - -IMPLEMENT_DYNAMIC_CLASS(wxButton, wxControl) - -// 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); -} - diff --git a/src/stubs/checkbox.cpp b/src/stubs/checkbox.cpp deleted file mode 100644 index 1fcf88c9e6..0000000000 --- a/src/stubs/checkbox.cpp +++ /dev/null @@ -1,115 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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" - -IMPLEMENT_DYNAMIC_CLASS(wxCheckBox, wxControl) -IMPLEMENT_DYNAMIC_CLASS(wxBitmapCheckBox, wxCheckBox) - -// 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; -} - - diff --git a/src/stubs/checklst.cpp b/src/stubs/checklst.cpp deleted file mode 100644 index 18433b99d0..0000000000 --- a/src/stubs/checklst.cpp +++ /dev/null @@ -1,72 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// 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 -// ============================================================================ - - IMPLEMENT_DYNAMIC_CLASS(wxCheckListBox, wxListBox) - -// ---------------------------------------------------------------------------- -// 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 -} - - diff --git a/src/stubs/choice.cpp b/src/stubs/choice.cpp deleted file mode 100644 index c6a1d250e2..0000000000 --- a/src/stubs/choice.cpp +++ /dev/null @@ -1,117 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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" - -IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl) - -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); -} - diff --git a/src/stubs/clipbrd.cpp b/src/stubs/clipbrd.cpp deleted file mode 100644 index 6ffe21ddb5..0000000000 --- a/src/stubs/clipbrd.cpp +++ /dev/null @@ -1,235 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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 - -IMPLEMENT_DYNAMIC_CLASS(wxClipboard, wxObject) -IMPLEMENT_ABSTRACT_CLASS(wxClipboardClient, wxObject) - -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; - } -} - diff --git a/src/stubs/colordlg.cpp b/src/stubs/colordlg.cpp deleted file mode 100644 index 56450e7304..0000000000 --- a/src/stubs/colordlg.cpp +++ /dev/null @@ -1,51 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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" - -IMPLEMENT_DYNAMIC_CLASS(wxColourDialog, wxDialog) - -/* - * 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; -} - diff --git a/src/stubs/colour.cpp b/src/stubs/colour.cpp deleted file mode 100644 index f2c7fe382c..0000000000 --- a/src/stubs/colour.cpp +++ /dev/null @@ -1,101 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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" - -IMPLEMENT_DYNAMIC_CLASS(wxColour, wxObject) - -// 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); -*/ -} diff --git a/src/stubs/combobox.cpp b/src/stubs/combobox.cpp deleted file mode 100644 index 568529db54..0000000000 --- a/src/stubs/combobox.cpp +++ /dev/null @@ -1,163 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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" - -IMPLEMENT_DYNAMIC_CLASS(wxComboBox, wxControl) - -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; -} diff --git a/src/stubs/control.cpp b/src/stubs/control.cpp deleted file mode 100644 index 6ce584b2ea..0000000000 --- a/src/stubs/control.cpp +++ /dev/null @@ -1,93 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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" - -IMPLEMENT_ABSTRACT_CLASS(wxControl, wxWindow) - -BEGIN_EVENT_TABLE(wxControl, wxWindow) -END_EVENT_TABLE() - -// 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); -} - diff --git a/src/stubs/cursor.cpp b/src/stubs/cursor.cpp deleted file mode 100644 index bc04cc617c..0000000000 --- a/src/stubs/cursor.cpp +++ /dev/null @@ -1,185 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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" - -IMPLEMENT_DYNAMIC_CLASS(wxCursor, wxBitmap) - -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) -} - - diff --git a/src/stubs/data.cpp b/src/stubs/data.cpp deleted file mode 100644 index d9d4c562d5..0000000000 --- a/src/stubs/data.cpp +++ /dev/null @@ -1,136 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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"; - - -const wxSize wxDefaultSize(-1, -1); -const wxPoint wxDefaultPosition(-1, -1); diff --git a/src/stubs/dc.cpp b/src/stubs/dc.cpp deleted file mode 100644 index a70a0f1d13..0000000000 --- a/src/stubs/dc.cpp +++ /dev/null @@ -1,383 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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" - -IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject) - -//----------------------------------------------------------------------------- -// 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); - } -}; - diff --git a/src/stubs/dcclient.cpp b/src/stubs/dcclient.cpp deleted file mode 100644 index 4962885bf9..0000000000 --- a/src/stubs/dcclient.cpp +++ /dev/null @@ -1,633 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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 - -//----------------------------------------------------------------------------- -// constants -//----------------------------------------------------------------------------- - -#define RAD2DEG 57.2957795131 - -//----------------------------------------------------------------------------- -// wxPaintDC -//----------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxWindowDC, wxDC) -IMPLEMENT_DYNAMIC_CLASS(wxClientDC, wxWindowDC) -IMPLEMENT_DYNAMIC_CLASS(wxPaintDC, wxWindowDC) - -/* - * 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 ); -}; diff --git a/src/stubs/dcmemory.cpp b/src/stubs/dcmemory.cpp deleted file mode 100644 index 7cbd330821..0000000000 --- a/src/stubs/dcmemory.cpp +++ /dev/null @@ -1,64 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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; - }; -}; - - diff --git a/src/stubs/dcscreen.cpp b/src/stubs/dcscreen.cpp deleted file mode 100644 index 5d592d8b96..0000000000 --- a/src/stubs/dcscreen.cpp +++ /dev/null @@ -1,30 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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" - -IMPLEMENT_DYNAMIC_CLASS(wxScreenDC, wxWindowDC) - -// Create a DC representing the whole screen -wxScreenDC::wxScreenDC() -{ - // TODO -} - -wxScreenDC::~wxScreenDC() -{ - // TODO -} - diff --git a/src/stubs/dialog.cpp b/src/stubs/dialog.cpp deleted file mode 100644 index f0358af36a..0000000000 --- a/src/stubs/dialog.cpp +++ /dev/null @@ -1,284 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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; - -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() - - -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() -{ -} diff --git a/src/stubs/dirdlg.cpp b/src/stubs/dirdlg.cpp deleted file mode 100644 index 511f8f929b..0000000000 --- a/src/stubs/dirdlg.cpp +++ /dev/null @@ -1,40 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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" - -IMPLEMENT_CLASS(wxDirDialog, wxDialog) - -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; -} - diff --git a/src/stubs/dnd.cpp b/src/stubs/dnd.cpp deleted file mode 100644 index 32088eef0f..0000000000 --- a/src/stubs/dnd.cpp +++ /dev/null @@ -1,133 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// 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; -}; - diff --git a/src/stubs/filedlg.cpp b/src/stubs/filedlg.cpp deleted file mode 100644 index 8d1b8731a0..0000000000 --- a/src/stubs/filedlg.cpp +++ /dev/null @@ -1,136 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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" - -IMPLEMENT_CLASS(wxFileDialog, wxDialog) - -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); -} - - diff --git a/src/stubs/font.cpp b/src/stubs/font.cpp deleted file mode 100644 index c152046ec4..0000000000 --- a/src/stubs/font.cpp +++ /dev/null @@ -1,242 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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" - -IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject) - -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; -} - diff --git a/src/stubs/fontdlg.cpp b/src/stubs/fontdlg.cpp deleted file mode 100644 index 13fa1b0c47..0000000000 --- a/src/stubs/fontdlg.cpp +++ /dev/null @@ -1,53 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// 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" - -IMPLEMENT_DYNAMIC_CLASS(wxFontDialog, wxDialog) - -/* - * 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; -} - diff --git a/src/stubs/frame.cpp b/src/stubs/frame.cpp deleted file mode 100644 index aeb2a78007..0000000000 --- a/src/stubs/frame.cpp +++ /dev/null @@ -1,560 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: frame.cpp -// Purpose: wxFrame -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "frame.h" -#endif - -#include "wx/frame.h" -#include "wx/statusbr.h" -#include "wx/toolbar.h" -#include "wx/menuitem.h" -#include "wx/menu.h" -#include "wx/dcclient.h" -#include "wx/dialog.h" -#include "wx/settings.h" -#include "wx/app.h" - -extern wxList wxModelessWindows; -extern wxList wxPendingDelete; - -BEGIN_EVENT_TABLE(wxFrame, wxWindow) - EVT_SIZE(wxFrame::OnSize) - EVT_ACTIVATE(wxFrame::OnActivate) - EVT_MENU_HIGHLIGHT_ALL(wxFrame::OnMenuHighlight) - EVT_SYS_COLOUR_CHANGED(wxFrame::OnSysColourChanged) - EVT_IDLE(wxFrame::OnIdle) - EVT_CLOSE(wxFrame::OnCloseWindow) -END_EVENT_TABLE() - -IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxWindow) - -#if wxUSE_NATIVE_STATUSBAR -bool wxFrame::m_useNativeStatusBar = TRUE; -#else -bool wxFrame::m_useNativeStatusBar = FALSE; -#endif - -wxFrame::wxFrame() -{ - m_frameToolBar = NULL ; - m_frameMenuBar = NULL; - m_frameStatusBar = NULL; - - m_windowParent = NULL; - m_iconized = FALSE; -} - -bool wxFrame::Create(wxWindow *parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - if (!parent) - wxTopLevelWindows.Append(this); - - SetName(name); - m_windowStyle = style; - m_frameMenuBar = NULL; - m_frameToolBar = NULL ; - m_frameStatusBar = NULL; - - SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE)); - - if ( id > -1 ) - m_windowId = id; - else - m_windowId = (int)NewControlId(); - - if (parent) parent->AddChild(this); - - wxModelessWindows.Append(this); - - // TODO: create frame. - - return FALSE; -} - -wxFrame::~wxFrame() -{ - wxTopLevelWindows.DeleteObject(this); - - if (m_frameStatusBar) - delete m_frameStatusBar; - if (m_frameMenuBar) - delete m_frameMenuBar; - -/* Check if it's the last top-level window */ - - if (wxTheApp && (wxTopLevelWindows.Number() == 0)) - { - wxTheApp->SetTopWindow(NULL); - - if (wxTheApp->GetExitOnFrameDelete()) - { - // TODO signal to the app that we're going to close - } - } - - wxModelessWindows.DeleteObject(this); -} - -// Get size *available for subwindows* i.e. excluding menu bar, toolbar etc. -void wxFrame::GetClientSize(int *x, int *y) const -{ - // TODO -} - -// Set the client size (i.e. leave the calculation of borders etc. -// to wxWindows) -void wxFrame::SetClientSize(int width, int height) -{ - // TODO -} - -void wxFrame::GetSize(int *width, int *height) const -{ - // TODO -} - -void wxFrame::GetPosition(int *x, int *y) const -{ - // TODO -} - -void wxFrame::SetSize(int x, int y, int width, int height, int sizeFlags) -{ - // TODO -} - -bool wxFrame::Show(bool show) -{ - // TODO - return FALSE; -} - -void wxFrame::Iconize(bool iconize) -{ - // TODO -} - -// Equivalent to maximize/restore in Windows -void wxFrame::Maximize(bool maximize) -{ - // TODO -} - -bool wxFrame::IsIconized() const -{ - // TODO - return FALSE; -} - -// Is the frame maximized? -bool wxFrame::IsMaximized(void) const -{ - // TODO - return FALSE; -} - -void wxFrame::SetTitle(const wxString& title) -{ - // TODO -} - -wxString wxFrame::GetTitle() const -{ - // TODO - return wxString(""); -} - -void wxFrame::SetIcon(const wxIcon& icon) -{ - m_icon = icon; - // TODO -} - -wxStatusBar *wxFrame::OnCreateStatusBar(int number, long style, wxWindowID id, - const wxString& name) -{ - wxStatusBar *statusBar = NULL; - - statusBar = new wxStatusBar(this, id, wxPoint(0, 0), wxSize(100, 20), - style, name); - - // Set the height according to the font and the border size - wxClientDC dc(statusBar); - dc.SetFont(statusBar->GetFont()); - - long x, y; - dc.GetTextExtent("X", &x, &y); - - int height = (int)( (y * 1.1) + 2* statusBar->GetBorderY()); - - statusBar->SetSize(-1, -1, 100, height); - - statusBar->SetFieldsCount(number); - return statusBar; -} - -wxStatusBar* wxFrame::CreateStatusBar(int number, long style, wxWindowID id, - const wxString& name) -{ - // Calling CreateStatusBar twice is an error. - wxCHECK_MSG( m_frameStatusBar == NULL, FALSE, - "recreating status bar in wxFrame" ); - - m_frameStatusBar = OnCreateStatusBar(number, style, id, - name); - if ( m_frameStatusBar ) - { - PositionStatusBar(); - return m_frameStatusBar; - } - else - return NULL; -} - -void wxFrame::SetStatusText(const wxString& text, int number) -{ - wxCHECK_RET( m_frameStatusBar != NULL, "no statusbar to set text for" ); - - m_frameStatusBar->SetStatusText(text, number); -} - -void wxFrame::SetStatusWidths(int n, const int widths_field[]) -{ - wxCHECK_RET( m_frameStatusBar != NULL, "no statusbar to set widths for" ); - - m_frameStatusBar->SetStatusWidths(n, widths_field); - PositionStatusBar(); -} - -void wxFrame::PositionStatusBar() -{ - int w, h; - GetClientSize(&w, &h); - int sw, sh; - m_frameStatusBar->GetSize(&sw, &sh); - - // Since we wish the status bar to be directly under the client area, - // we use the adjusted sizes without using wxSIZE_NO_ADJUSTMENTS. - m_frameStatusBar->SetSize(0, h, w, sh); -} - -void wxFrame::SetMenuBar(wxMenuBar *menuBar) -{ - if (!menuBar) - { - m_frameMenuBar = NULL; - return; - } - - m_frameMenuBar = menuBar; - - // TODO -} - -void wxFrame::Fit() -{ - // Work out max. size - wxNode *node = GetChildren().First(); - int max_width = 0; - int max_height = 0; - while (node) - { - // Find a child that's a subwindow, but not a dialog box. - wxWindow *win = (wxWindow *)node->Data(); - - if (!win->IsKindOf(CLASSINFO(wxFrame)) && - !win->IsKindOf(CLASSINFO(wxDialog))) - { - int width, height; - int x, y; - win->GetSize(&width, &height); - win->GetPosition(&x, &y); - - if ((x + width) > max_width) - max_width = x + width; - if ((y + height) > max_height) - max_height = y + height; - } - node = node->Next(); - } - SetClientSize(max_width, max_height); -} - -// Responds to colour changes, and passes event on to children. -void wxFrame::OnSysColourChanged(wxSysColourChangedEvent& event) -{ - SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE)); - Refresh(); - - if ( m_frameStatusBar ) - { - wxSysColourChangedEvent event2; - event2.SetEventObject( m_frameStatusBar ); - m_frameStatusBar->ProcessEvent(event2); - } - - // Propagate the event to the non-top-level children - wxWindow::OnSysColourChanged(event); -} - -// Default resizing behaviour - if only ONE subwindow, -// resize to client rectangle size -void wxFrame::OnSize(wxSizeEvent& event) -{ - // if we're using constraints - do use them - #if wxUSE_CONSTRAINTS - if ( GetAutoLayout() ) { - Layout(); - return; - } - #endif - - // do we have _exactly_ one child? - wxWindow *child = NULL; - for ( wxNode *node = GetChildren().First(); node; node = node->Next() ) - { - wxWindow *win = (wxWindow *)node->Data(); - if ( !win->IsKindOf(CLASSINFO(wxFrame)) && - !win->IsKindOf(CLASSINFO(wxDialog)) && - (win != GetStatusBar()) && - (win != GetToolBar()) ) - { - if ( child ) - return; // it's our second subwindow - nothing to do - child = win; - } - } - - if ( child ) { - // we have exactly one child - set it's size to fill the whole frame - int clientW, clientH; - GetClientSize(&clientW, &clientH); - - int x = 0; - int y = 0; - - child->SetSize(x, y, clientW, clientH); - } -} - -// Default activation behaviour - set the focus for the first child -// subwindow found. -void wxFrame::OnActivate(wxActivateEvent& event) -{ - for(wxNode *node = GetChildren().First(); node; node = node->Next()) - { - // Find a child that's a subwindow, but not a dialog box. - wxWindow *child = (wxWindow *)node->Data(); - if (!child->IsKindOf(CLASSINFO(wxFrame)) && - !child->IsKindOf(CLASSINFO(wxDialog))) - { - child->SetFocus(); - return; - } - } -} - -// The default implementation for the close window event. - -void wxFrame::OnCloseWindow(wxCloseEvent& event) -{ - this->Destroy(); -} - -// Destroy the window (delayed, if a managed window) -bool wxFrame::Destroy() -{ - if (!wxPendingDelete.Member(this)) - wxPendingDelete.Append(this); - return TRUE; -} - -// Default menu selection behaviour - display a help string -void wxFrame::OnMenuHighlight(wxMenuEvent& event) -{ - if (GetStatusBar()) - { - if (event.GetMenuId() == -1) - SetStatusText(""); - else - { - wxMenuBar *menuBar = GetMenuBar(); - if (menuBar) - { - wxString helpString(menuBar->GetHelpString(event.GetMenuId())); - if (helpString != "") - SetStatusText(helpString); - } - } - } -} - -wxMenuBar *wxFrame::GetMenuBar() const -{ - return m_frameMenuBar; -} - -void wxFrame::Centre(int direction) -{ - int display_width, display_height, width, height, x, y; - wxDisplaySize(&display_width, &display_height); - - 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, y, width, height); -} - -// Call this to simulate a menu command -void wxFrame::Command(int id) -{ - ProcessCommand(id); -} - -void wxFrame::ProcessCommand(int id) -{ - wxCommandEvent commandEvent(wxEVENT_TYPE_MENU_COMMAND, id); - commandEvent.SetInt( id ); - commandEvent.SetEventObject( this ); - - wxMenuBar *bar = GetMenuBar() ; - if (!bar) - return; - -/* TODO: check the menu item if required - wxMenuItem *item = bar->FindItemForId(id) ; - if (item && item->IsCheckable()) - { - bar->Check(id,!bar->Checked(id)) ; - } -*/ - - wxEvtHandler* evtHandler = GetEventHandler(); - evtHandler->ProcessEvent(commandEvent); -} - -// Checks if there is a toolbar, and returns the first free client position -wxPoint wxFrame::GetClientAreaOrigin() const -{ - wxPoint pt(0, 0); - if (GetToolBar()) - { - int w, h; - GetToolBar()->GetSize(& w, & h); - - if (GetToolBar()->GetWindowStyleFlag() & wxTB_VERTICAL) - { - pt.x += w; - } - else - { - pt.y += h; - } - } - return pt; -} - -void wxFrame::ScreenToClient(int *x, int *y) const -{ - wxWindow::ScreenToClient(x, y); - - // We may be faking the client origin. - // So a window that's really at (0, 30) may appear - // (to wxWin apps) to be at (0, 0). - wxPoint pt(GetClientAreaOrigin()); - *x -= pt.x; - *y -= pt.y; -} - -void wxFrame::ClientToScreen(int *x, int *y) const -{ - // We may be faking the client origin. - // So a window that's really at (0, 30) may appear - // (to wxWin apps) to be at (0, 0). - wxPoint pt1(GetClientAreaOrigin()); - *x += pt1.x; - *y += pt1.y; - - wxWindow::ClientToScreen(x, y); -} - -wxToolBar* wxFrame::CreateToolBar(long style, wxWindowID id, const wxString& name) -{ - wxCHECK_MSG( m_frameToolBar == NULL, FALSE, - "recreating toolbar in wxFrame" ); - - wxToolBar* toolBar = OnCreateToolBar(style, id, name); - if (toolBar) - { - SetToolBar(toolBar); - PositionToolBar(); - return toolBar; - } - else - { - return NULL; - } -} - -wxToolBar* wxFrame::OnCreateToolBar(long style, wxWindowID id, const wxString& name) -{ - return new wxToolBar(this, id, wxDefaultPosition, wxDefaultSize, style, name); -} - -void wxFrame::PositionToolBar() -{ - int cw, ch; - - // TODO: we actually need to use the low-level client size, before - // the toolbar/status bar were added. - // So DEFINITELY replace the line below with something appropriate. - - GetClientSize(& cw, &ch); - - if ( GetStatusBar() ) - { - int statusX, statusY; - GetStatusBar()->GetClientSize(&statusX, &statusY); - ch -= statusY; - } - - if (GetToolBar()) - { - int tw, th; - GetToolBar()->GetSize(& tw, & th); - - if (GetToolBar()->GetWindowStyleFlag() & wxTB_VERTICAL) - { - // Use the 'real' position. wxSIZE_NO_ADJUSTMENTS - // means, pretend we don't have toolbar/status bar, so we - // have the original client size. - GetToolBar()->SetSize(0, 0, tw, ch, wxSIZE_NO_ADJUSTMENTS); - } - else - { - // Use the 'real' position - GetToolBar()->SetSize(0, 0, cw, th, wxSIZE_NO_ADJUSTMENTS); - } - } -} - diff --git a/src/stubs/gauge.cpp b/src/stubs/gauge.cpp deleted file mode 100644 index 98976d4311..0000000000 --- a/src/stubs/gauge.cpp +++ /dev/null @@ -1,93 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: gauge.cpp -// Purpose: wxGauge class -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "gauge.h" -#endif - -#include "wx/gauge.h" - -IMPLEMENT_DYNAMIC_CLASS(wxGauge, wxControl) - -bool wxGauge::Create(wxWindow *parent, wxWindowID id, - int range, - const wxPoint& pos, - const wxSize& size, - long style, - const wxValidator& validator, - const wxString& name) -{ - SetName(name); - SetValidator(validator); - m_rangeMax = range; - m_windowStyle = style; - - if (parent) parent->AddChild(this); - - if ( id == -1 ) - m_windowId = (int)NewControlId(); - else - m_windowId = id; - - - // TODO - return FALSE; -} - -void wxGauge::SetSize(int x, int y, int width, int height, int sizeFlags) -{ - // TODO -} - -void wxGauge::SetShadowWidth(int w) -{ - // TODO optional -} - -void wxGauge::SetBezelFace(int w) -{ - // TODO optional -} - -void wxGauge::SetRange(int r) -{ - m_rangeMax = r; - // TODO -} - -void wxGauge::SetValue(int pos) -{ - m_gaugePos = pos; - // TODO -} - -int wxGauge::GetShadowWidth() const -{ - // TODO optional - return 0; -} - -int wxGauge::GetBezelFace() const -{ - // TODO optional - return 0; -} - -int wxGauge::GetRange() const -{ - return m_rangeMax; -} - -int wxGauge::GetValue() const -{ - return m_gaugePos; -} - diff --git a/src/stubs/gdiobj.cpp b/src/stubs/gdiobj.cpp deleted file mode 100644 index 46b1aa871f..0000000000 --- a/src/stubs/gdiobj.cpp +++ /dev/null @@ -1,20 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: gdiobj.cpp -// Purpose: wxGDIObject class -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "gdiobj.h" -#endif - -#include "wx/gdiobj.h" - -IMPLEMENT_DYNAMIC_CLASS(wxGDIObject, wxObject) - -// TODO: Nothing to do, unless you want to. diff --git a/src/stubs/gsockno.c b/src/stubs/gsockno.c deleted file mode 100644 index 0f40f3efdc..0000000000 --- a/src/stubs/gsockno.c +++ /dev/null @@ -1,34 +0,0 @@ -/* ------------------------------------------------------------------------- - * Project: GSocket (Generic Socket) for WX - * Name: gsockno.c - * Purpose: GSocket stub GUI file - * CVSID: $Id$ - * ------------------------------------------------------------------------- - */ -#include -#include "gsocket.h" - -void _GSocket_GUI_Init(GSocket *socket) -{ -} - -void _GSocket_GUI_Destroy(GSocket *socket) -{ -} - -void _GSocket_Install_Callback(GSocket *socket, GSocketEvent event) -{ -} - -void _GSocket_Uninstall_Callback(GSocket *socket, GSocketEvent event) -{ -} - -unsigned long GSocket_GetEventID(GSocket *socket) -{ - return 0; -} - -void GSocket_DoEvent(unsigned long evt_id) -{ -} diff --git a/src/stubs/helpxxxx.cpp b/src/stubs/helpxxxx.cpp deleted file mode 100644 index b7f0babfa2..0000000000 --- a/src/stubs/helpxxxx.cpp +++ /dev/null @@ -1,81 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: helpxxxx.cpp -// Purpose: Help system: native implementation -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "helpxxxx.h" -#endif - -#include "wx/stubs/helpxxxx.h" - -#include - -IMPLEMENT_DYNAMIC_CLASS(wxXXXXHelpController, wxHelpControllerBase) - -wxXXXXHelpController::wxXXXXHelpController() -{ - m_helpFile = ""; -} - -wxXXXXHelpController::~wxXXXXHelpController() -{ -} - -bool wxXXXXHelpController::Initialize(const wxString& filename) -{ - m_helpFile = filename; - // TODO any other inits - return TRUE; -} - -bool wxXXXXHelpController::LoadFile(const wxString& file) -{ - m_helpFile = file; - // TODO - return TRUE; -} - -bool wxXXXXHelpController::DisplayContents() -{ - // TODO - return FALSE; -} - -bool wxXXXXHelpController::DisplaySection(int section) -{ - // TODO - return FALSE; -} - -bool wxXXXXHelpController::DisplayBlock(long block) -{ - // TODO - return FALSE; -} - -bool wxXXXXHelpController::KeywordSearch(const wxString& k) -{ - if (m_helpFile == "") return FALSE; - - // TODO - return FALSE; -} - -// Can't close the help window explicitly in WinHelp -bool wxXXXXHelpController::Quit() -{ - // TODO - return FALSE; -} - -void wxXXXXHelpController::OnQuit() -{ -} - diff --git a/src/stubs/icon.cpp b/src/stubs/icon.cpp deleted file mode 100644 index cc5b28500e..0000000000 --- a/src/stubs/icon.cpp +++ /dev/null @@ -1,68 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: icon.cpp -// Purpose: wxIcon class -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "icon.h" -#endif - -#include "wx/icon.h" - -IMPLEMENT_DYNAMIC_CLASS(wxIcon, wxBitmap) - -/* - * Icons - */ - - -wxIconRefData::wxIconRefData() -{ - // TODO: init icon handle -} - -wxIconRefData::~wxIconRefData() -{ - // TODO: destroy icon handle -} - -wxIcon::wxIcon() -{ -} - -wxIcon::wxIcon(const char WXUNUSED(bits)[], int WXUNUSED(width), int WXUNUSED(height)) -{ -} - -wxIcon::wxIcon(const wxString& icon_file, long flags, - int desiredWidth, int desiredHeight) - -{ - LoadFile(icon_file, flags, desiredWidth, desiredHeight); -} - -wxIcon::~wxIcon() -{ -} - -bool wxIcon::LoadFile(const wxString& filename, long type, - int desiredWidth, int desiredHeight) -{ - UnRef(); - - m_refData = new wxIconRefData; - - wxBitmapHandler *handler = FindHandler(type); - - if ( handler ) - return handler->LoadFile(this, filename, type, desiredWidth, desiredHeight); - else - return FALSE; -} - diff --git a/src/stubs/imaglist.cpp b/src/stubs/imaglist.cpp deleted file mode 100644 index cb4b9ff01c..0000000000 --- a/src/stubs/imaglist.cpp +++ /dev/null @@ -1,116 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: imaglist.cpp -// Purpose: wxImageList. You may wish to use the generic version. -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "imaglist.h" -#endif - -#include "wx/stubs/imaglist.h" - -IMPLEMENT_DYNAMIC_CLASS(wxImageList, wxObject) - -wxImageList::wxImageList() -{ - // TODO: init image list handle, if any -} - -wxImageList::~wxImageList() -{ - // TODO: destroy image list handle, if any -} - - -// Attributes -//////////////////////////////////////////////////////////////////////////// - -// Returns the number of images in the image list. -int wxImageList::GetImageCount() const -{ - // TODO - return 0; -} - -// Operations -//////////////////////////////////////////////////////////////////////////// - -// Creates an image list -bool wxImageList::Create(int width, int height, bool mask, int initial) -{ - // TODO - return FALSE; -} - -// Adds a bitmap, and optionally a mask bitmap. -// Note that wxImageList creates new bitmaps, so you may delete -// 'bitmap' and 'mask'. -int wxImageList::Add(const wxBitmap& bitmap, const wxBitmap& mask) -{ - // TODO - return 0; -} - -// Adds a bitmap, using the specified colour to create the mask bitmap -// Note that wxImageList creates new bitmaps, so you may delete -// 'bitmap'. -int wxImageList::Add(const wxBitmap& bitmap, const wxColour& maskColour) -{ - // TODO - return 0; -} - -// Adds a bitmap and mask from an icon. -int wxImageList::Add(const wxIcon& icon) -{ - // TODO - return 0; -} - -// Replaces a bitmap, optionally passing a mask bitmap. -// Note that wxImageList creates new bitmaps, so you may delete -// 'bitmap' and 'mask'. -bool wxImageList::Replace(int index, const wxBitmap& bitmap, const wxBitmap& mask) -{ - // TODO - return 0; -} - -// Replaces a bitmap and mask from an icon. -bool wxImageList::Replace(int index, const wxIcon& icon) -{ - // TODO - return 0; -} - -// Removes the image at the given index. -bool wxImageList::Remove(int index) -{ - // TODO - return FALSE; -} - -// Remove all images -bool wxImageList::RemoveAll() -{ - // TODO - return FALSE; -} - -// 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 wxImageList::Draw(int index, wxDC& dc, int x, int y, - int flags, bool solidBackground) -{ - // TODO - return FALSE; -} - diff --git a/src/stubs/joystick.cpp b/src/stubs/joystick.cpp deleted file mode 100644 index 6677277f48..0000000000 --- a/src/stubs/joystick.cpp +++ /dev/null @@ -1,279 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: joystick.cpp -// Purpose: wxJoystick class -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "joystick.h" -#endif - -#include - -IMPLEMENT_DYNAMIC_CLASS(wxJoystick, wxObject) - -// Attributes -//////////////////////////////////////////////////////////////////////////// - -wxPoint wxJoystick::GetPosition() const -{ - // TODO - return wxPoint(0, 0); -} - -int wxJoystick::GetZPosition() const -{ - // TODO - return 0; -} - -int wxJoystick::GetButtonState() const -{ - // TODO - return 0; -} - -int wxJoystick::GetPOVPosition() const -{ - // TODO - return 0; -} - -int wxJoystick::GetPOVCTSPosition() const -{ - // TODO - return 0; -} - -int wxJoystick::GetRudderPosition() const -{ - // TODO - return 0; -} - -int wxJoystick::GetUPosition() const -{ - // TODO - return 0; -} - -int wxJoystick::GetVPosition() const -{ - // TODO - return 0; -} - -int wxJoystick::GetMovementThreshold() const -{ - // TODO - return 0; -} - -void wxJoystick::SetMovementThreshold(int threshold) -{ - // TODO -} - -// Capabilities -//////////////////////////////////////////////////////////////////////////// - -bool wxJoystick::IsOk() const -{ - // TODO - return FALSE; -} - -int wxJoystick::GetNumberJoysticks() const -{ - // TODO - return 0; -} - -int wxJoystick::GetManufacturerId() const -{ - // TODO - return 0; -} - -int wxJoystick::GetProductId() const -{ - // TODO - return 0; -} - -wxString wxJoystick::GetProductName() const -{ - // TODO - return wxString(""); -} - -int wxJoystick::GetXMin() const -{ - // TODO - return 0; -} - -int wxJoystick::GetYMin() const -{ - // TODO - return 0; -} - -int wxJoystick::GetZMin() const -{ - // TODO - return 0; -} - -int wxJoystick::GetXMax() const -{ - // TODO - return 0; -} - -int wxJoystick::GetYMax() const -{ - // TODO - return 0; -} - -int wxJoystick::GetZMax() const -{ - // TODO - return 0; -} - -int wxJoystick::GetNumberButtons() const -{ - // TODO - return 0; -} - -int wxJoystick::GetNumberAxes() const -{ - // TODO - return 0; -} - -int wxJoystick::GetMaxButtons() const -{ - // TODO - return 0; -} - -int wxJoystick::GetMaxAxes() const -{ - // TODO - return 0; -} - -int wxJoystick::GetPollingMin() const -{ - // TODO - return 0; -} - -int wxJoystick::GetPollingMax() const -{ - // TODO - return 0; -} - -int wxJoystick::GetRudderMin() const -{ - // TODO - return 0; -} - -int wxJoystick::GetRudderMax() const -{ - // TODO - return 0; -} - -int wxJoystick::GetUMin() const -{ - // TODO - return 0; -} - -int wxJoystick::GetUMax() const -{ - // TODO - return 0; -} - -int wxJoystick::GetVMin() const -{ - // TODO - return 0; -} - -int wxJoystick::GetVMax() const -{ - // TODO - return 0; -} - -bool wxJoystick::HasRudder() const -{ - // TODO - return FALSE; -} - -bool wxJoystick::HasZ() const -{ - // TODO - return FALSE; -} - -bool wxJoystick::HasU() const -{ - // TODO - return FALSE; -} - -bool wxJoystick::HasV() const -{ - // TODO - return FALSE; -} - -bool wxJoystick::HasPOV() const -{ - // TODO - return FALSE; -} - -bool wxJoystick::HasPOV4Dir() const -{ - // TODO - return FALSE; -} - -bool wxJoystick::HasPOVCTS() const -{ - // TODO - return FALSE; -} - -// Operations -//////////////////////////////////////////////////////////////////////////// - -bool wxJoystick::SetCapture(wxWindow* win, int pollingFreq) -{ - // TODO - return FALSE; -} - -bool wxJoystick::ReleaseCapture() -{ - // TODO - return FALSE; -} - diff --git a/src/stubs/listbox.cpp b/src/stubs/listbox.cpp deleted file mode 100644 index 2445810473..0000000000 --- a/src/stubs/listbox.cpp +++ /dev/null @@ -1,233 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: listbox.cpp -// Purpose: wxListBox -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "listbox.h" -#endif - -#include "wx/listbox.h" -#include "wx/settings.h" -#include "wx/dynarray.h" -#include "wx/log.h" - - IMPLEMENT_DYNAMIC_CLASS(wxListBox, wxControl) - -// ============================================================================ -// list box control implementation -// ============================================================================ - -// Listbox item -wxListBox::wxListBox() -{ - m_noItems = 0; - m_selected = 0; -} - -bool wxListBox::Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos, - const wxSize& size, - int n, const wxString choices[], - long style, - const wxValidator& validator, - const wxString& name) -{ - m_noItems = n; - m_selected = 0; - - SetName(name); - SetValidator(validator); - - if (parent) parent->AddChild(this); - - wxSystemSettings settings; - SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOW)); - - m_windowId = ( id == -1 ) ? (int)NewControlId() : id; - - // TODO create listbox - - return FALSE; -} - -wxListBox::~wxListBox() -{ -} - -void wxListBox::SetFirstItem(int N) -{ - // TODO -} - -void wxListBox::SetFirstItem(const wxString& s) -{ - // TODO -} - -void wxListBox::Delete(int N) -{ - m_noItems --; - // TODO -} - -void wxListBox::Append(const wxString& item) -{ - m_noItems ++; - - // TODO -} - -void wxListBox::Append(const wxString& item, char *Client_data) -{ - m_noItems ++; - - // TODO -} - -void wxListBox::Set(int n, const wxString *choices, char** clientData) -{ - m_noItems = n; - - // TODO -} - -int wxListBox::FindString(const wxString& s) const -{ - // TODO - return -1; -} - -void wxListBox::Clear() -{ - m_noItems = 0; - // TODO -} - -void wxListBox::SetSelection(int N, bool select) -{ - // TODO -} - -bool wxListBox::Selected(int N) const -{ - // TODO - return FALSE; -} - -void wxListBox::Deselect(int N) -{ - // TODO -} - -char *wxListBox::GetClientData(int N) const -{ - // TODO - return (char *)NULL; -} - -void wxListBox::SetClientData(int N, char *Client_data) -{ - // TODO -} - -// Return number of selections and an array of selected integers -int wxListBox::GetSelections(wxArrayInt& aSelections) const -{ - aSelections.Empty(); - -/* TODO - if ((m_windowStyle & wxLB_MULTIPLE) || (m_windowStyle & wxLB_EXTENDED)) - { - int no_sel = ?? - for ( int n = 0; n < no_sel; n++ ) - aSelections.Add(??); - - return no_sel; - } - else // single-selection listbox - { - aSelections.Add(??); - - return 1; - } -*/ - return 0; -} - -// Get single selection, for single choice list items -int wxListBox::GetSelection() const -{ - // TODO - return -1; -} - -// Find string for position -wxString wxListBox::GetString(int N) const -{ - // TODO - return wxString(""); -} - -void wxListBox::SetSize(int x, int y, int width, int height, int sizeFlags) -{ - // TODO -} - -void wxListBox::InsertItems(int nItems, const wxString items[], int pos) -{ - m_noItems += nItems; - - // TODO -} - -void wxListBox::SetString(int N, const wxString& s) -{ - // TODO -} - -int wxListBox::Number () const -{ - return m_noItems; -} - -// For single selection items only -wxString wxListBox::GetStringSelection () const -{ - int sel = GetSelection (); - if (sel > -1) - return this->GetString (sel); - else - return wxString(""); -} - -bool wxListBox::SetStringSelection (const wxString& s, bool flag) -{ - int sel = FindString (s); - if (sel > -1) - { - SetSelection (sel, flag); - return TRUE; - } - else - return FALSE; -} - -void wxListBox::Command (wxCommandEvent & event) -{ - if (event.m_extraLong) - SetSelection (event.m_commandInt); - else - { - Deselect (event.m_commandInt); - return; - } - ProcessCommand (event); -} - diff --git a/src/stubs/listctrl.cpp b/src/stubs/listctrl.cpp deleted file mode 100644 index 2c11981bf2..0000000000 --- a/src/stubs/listctrl.cpp +++ /dev/null @@ -1,594 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: listctrl.cpp -// Purpose: wxListCtrl. See also Robert's generic wxListCtrl -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "listctrl.h" -#endif - -#include "wx/stubs/textctrl.h" -#include "wx/stubs/listctrl.h" - -IMPLEMENT_DYNAMIC_CLASS(wxListCtrl, wxControl) -IMPLEMENT_DYNAMIC_CLASS(wxListItem, wxObject) - - -wxListCtrl::wxListCtrl() -{ - m_imageListNormal = NULL; - m_imageListSmall = NULL; - m_imageListState = NULL; - m_baseStyle = 0; - m_colCount = 0; -} - -bool wxListCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, - long style, const wxValidator& validator, const wxString& name) -{ - m_imageListNormal = NULL; - m_imageListSmall = NULL; - m_imageListState = NULL; - m_colCount = 0; - - SetValidator(validator); - SetName(name); - - m_windowStyle = style; - - SetParent(parent); - - m_windowId = (id == -1) ? NewControlId() : id; - - if (parent) parent->AddChild(this); - - // TODO create list control - return TRUE; -} - -wxListCtrl::~wxListCtrl() -{ -} - -// Add or remove a single window style -void wxListCtrl::SetSingleStyle(long style, bool add) -{ - long flag = GetWindowStyleFlag(); - - // Get rid of conflicting styles - if ( add ) - { - if ( style & wxLC_MASK_TYPE) - flag = flag & ~wxLC_MASK_TYPE ; - if ( style & wxLC_MASK_ALIGN ) - flag = flag & ~wxLC_MASK_ALIGN ; - if ( style & wxLC_MASK_SORT ) - flag = flag & ~wxLC_MASK_SORT ; - } - - if ( flag & style ) - { - if ( !add ) - flag -= style; - } - else - { - if ( add ) - { - flag |= style; - } - } - - m_windowStyle = flag; - - /* TODO RecreateWindow(); */ -} - -// Set the whole window style -void wxListCtrl::SetWindowStyleFlag(long flag) -{ - m_windowStyle = flag; - - /* TODO RecreateWindow(); */ -} - - -// Gets information about this column -bool wxListCtrl::GetColumn(int col, wxListItem& item) const -{ - // TODO - return FALSE; -} - -// Sets information about this column -bool wxListCtrl::SetColumn(int col, wxListItem& item) -{ - // TODO - return FALSE; -} - -// Gets the column width -int wxListCtrl::GetColumnWidth(int col) const -{ - // TODO - return 0; -} - -// Sets the column width -bool wxListCtrl::SetColumnWidth(int col, int width) -{ - // TODO - return FALSE; -} - -// 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 wxListCtrl::GetCountPerPage() const -{ - // TODO - return 0; -} - -// Gets the edit control for editing labels. -wxTextCtrl* wxListCtrl::GetEditControl() const -{ - return m_textCtrl; -} - -// Gets information about the item -bool wxListCtrl::GetItem(wxListItem& info) const -{ - // TODO - return FALSE; -} - -// Sets information about the item -bool wxListCtrl::SetItem(wxListItem& info) -{ - // TODO - return FALSE; -} - -long wxListCtrl::SetItem(long index, int col, const wxString& label, int imageId) -{ - wxListItem info; - info.m_text = label; - info.m_mask = wxLIST_MASK_TEXT; - info.m_itemId = index; - info.m_col = col; - if ( imageId > -1 ) - { - info.m_image = imageId; - info.m_mask |= wxLIST_MASK_IMAGE; - } - return SetItem(info); -} - - -// Gets the item state -int wxListCtrl::GetItemState(long item, long stateMask) const -{ - wxListItem info; - - info.m_mask = wxLIST_MASK_STATE ; - info.m_stateMask = stateMask; - info.m_itemId = item; - - if (!GetItem(info)) - return 0; - - return info.m_state; -} - -// Sets the item state -bool wxListCtrl::SetItemState(long item, long state, long stateMask) -{ - wxListItem info; - - info.m_mask = wxLIST_MASK_STATE ; - info.m_state = state; - info.m_stateMask = stateMask; - info.m_itemId = item; - - return SetItem(info); -} - -// Sets the item image -bool wxListCtrl::SetItemImage(long item, int image, int selImage) -{ - wxListItem info; - - info.m_mask = wxLIST_MASK_IMAGE ; - info.m_image = image; - info.m_itemId = item; - - return SetItem(info); -} - -// Gets the item text -wxString wxListCtrl::GetItemText(long item) const -{ - wxListItem info; - - info.m_mask = wxLIST_MASK_TEXT ; - info.m_itemId = item; - - if (!GetItem(info)) - return wxString(""); - return info.m_text; -} - -// Sets the item text -void wxListCtrl::SetItemText(long item, const wxString& str) -{ - wxListItem info; - - info.m_mask = wxLIST_MASK_TEXT ; - info.m_itemId = item; - info.m_text = str; - - SetItem(info); -} - -// Gets the item data -long wxListCtrl::GetItemData(long item) const -{ - wxListItem info; - - info.m_mask = wxLIST_MASK_DATA ; - info.m_itemId = item; - - if (!GetItem(info)) - return 0; - return info.m_data; -} - -// Sets the item data -bool wxListCtrl::SetItemData(long item, long data) -{ - wxListItem info; - - info.m_mask = wxLIST_MASK_DATA ; - info.m_itemId = item; - info.m_data = data; - - return SetItem(info); -} - -// Gets the item rectangle -bool wxListCtrl::GetItemRect(long item, wxRect& rect, int code) const -{ - // TODO - return FALSE; -} - -// Gets the item position -bool wxListCtrl::GetItemPosition(long item, wxPoint& pos) const -{ - // TODO - return FALSE; -} - -// Sets the item position. -bool wxListCtrl::SetItemPosition(long item, const wxPoint& pos) -{ - // TODO - return FALSE; -} - -// Gets the number of items in the list control -int wxListCtrl::GetItemCount() const -{ - // TODO - return FALSE; -} - -// 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 wxListCtrl::GetItemSpacing(bool isSmall) const -{ - // TODO - return FALSE; -} - -// Gets the number of selected items in the list control -int wxListCtrl::GetSelectedItemCount() const -{ - // TODO - return FALSE; -} - -// Gets the text colour of the listview -wxColour wxListCtrl::GetTextColour() const -{ - // TODO - return wxColour(); -} - -// Sets the text colour of the listview -void wxListCtrl::SetTextColour(const wxColour& col) -{ - // TODO -} - -// Gets the index of the topmost visible item when in -// list or report view -long wxListCtrl::GetTopItem() const -{ - // TODO - return 0; -} - -// Searches for an item, starting from 'item'. -// 'geometry' is one of -// wxLIST_NEXT_ABOVE/ALL/BELOW/LEFT/RIGHT. -// 'state' is a state bit flag, one or more of -// wxLIST_STATE_DROPHILITED/FOCUSED/SELECTED/CUT. -// item can be -1 to find the first item that matches the -// specified flags. -// Returns the item or -1 if unsuccessful. -long wxListCtrl::GetNextItem(long item, int geom, int state) const -{ - // TODO - return 0; -} - -wxImageList *wxListCtrl::GetImageList(int which) const -{ - if ( which == wxIMAGE_LIST_NORMAL ) - { - return m_imageListNormal; - } - else if ( which == wxIMAGE_LIST_SMALL ) - { - return m_imageListSmall; - } - else if ( which == wxIMAGE_LIST_STATE ) - { - return m_imageListState; - } - return NULL; -} - -void wxListCtrl::SetImageList(wxImageList *imageList, int which) -{ - int flags = 0; - if ( which == wxIMAGE_LIST_NORMAL ) - { - m_imageListNormal = imageList; - } - else if ( which == wxIMAGE_LIST_SMALL ) - { - m_imageListSmall = imageList; - } - else if ( which == wxIMAGE_LIST_STATE ) - { - m_imageListState = imageList; - } - // TODO set image list -} - -// Operations -//////////////////////////////////////////////////////////////////////////// - -// Arranges the items -bool wxListCtrl::Arrange(int flag) -{ - // TODO - return FALSE; -} - -// Deletes an item -bool wxListCtrl::DeleteItem(long item) -{ - // TODO - return FALSE; -} - -// Deletes all items -bool wxListCtrl::DeleteAllItems() -{ - // TODO - return FALSE; -} - -// Deletes all items -bool wxListCtrl::DeleteAllColumns() -{ - // TODO - return FALSE; -} - -// Deletes a column -bool wxListCtrl::DeleteColumn(int col) -{ - // TODO - return FALSE; -} - -// Clears items, and columns if there are any. -void wxListCtrl::ClearAll() -{ - DeleteAllItems(); - if ( m_colCount > 0 ) - DeleteAllColumns(); -} - -// Edit the label -wxTextCtrl* wxListCtrl::EditLabel(long item, wxClassInfo* textControlClass) -{ - // TODO - return NULL; -} - -// End label editing, optionally cancelling the edit -bool wxListCtrl::EndEditLabel(bool cancel) -{ - // TODO - return FALSE; -} - -// Ensures this item is visible -bool wxListCtrl::EnsureVisible(long item) -{ - // TODO - return FALSE; -} - -// Find an item whose label matches this string, starting from the item after 'start' -// or the beginning if 'start' is -1. -long wxListCtrl::FindItem(long start, const wxString& str, bool partial) -{ - // TODO - return FALSE; -} - -// Find an item whose data matches this data, starting from the item after 'start' -// or the beginning if 'start' is -1. -long wxListCtrl::FindItem(long start, long data) -{ - // TODO - return 0; -} - -// Find an item nearest this position in the specified direction, starting from -// the item after 'start' or the beginning if 'start' is -1. -long wxListCtrl::FindItem(long start, const wxPoint& pt, int direction) -{ - // TODO - return 0; -} - -// Determines which item (if any) is at the specified point, -// giving details in 'flags' (see wxLIST_HITTEST_... flags above) -long wxListCtrl::HitTest(const wxPoint& point, int& flags) -{ - // TODO - return 0; -} - -// Inserts an item, returning the index of the new item if successful, -// -1 otherwise. -long wxListCtrl::InsertItem(wxListItem& info) -{ - // TODO - return 0; -} - -long wxListCtrl::InsertItem(long index, const wxString& label) -{ - wxListItem info; - info.m_text = label; - info.m_mask = wxLIST_MASK_TEXT; - info.m_itemId = index; - return InsertItem(info); -} - -// Inserts an image item -long wxListCtrl::InsertItem(long index, int imageIndex) -{ - wxListItem info; - info.m_image = imageIndex; - info.m_mask = wxLIST_MASK_IMAGE; - info.m_itemId = index; - return InsertItem(info); -} - -// Inserts an image/string item -long wxListCtrl::InsertItem(long index, const wxString& label, int imageIndex) -{ - wxListItem info; - info.m_image = imageIndex; - info.m_text = label; - info.m_mask = wxLIST_MASK_IMAGE | wxLIST_MASK_TEXT; - info.m_itemId = index; - return InsertItem(info); -} - -// For list view mode (only), inserts a column. -long wxListCtrl::InsertColumn(long col, wxListItem& item) -{ - // TODO - return 0; -} - -long wxListCtrl::InsertColumn(long col, const wxString& heading, int format, - int width) -{ - wxListItem item; - item.m_mask = wxLIST_MASK_TEXT | wxLIST_MASK_FORMAT; - item.m_text = heading; - if ( width > -1 ) - { - item.m_mask |= wxLIST_MASK_WIDTH; - item.m_width = width; - } - item.m_format = format; - - return InsertColumn(col, item); -} - -// 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 wxListCtrl::ScrollList(int dx, int dy) -{ - // TODO - return FALSE; -} - -// 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 wxListCtrl::SortItems(wxListCtrlCompare fn, long data) -{ - // TODO - return FALSE; -} - -// List item structure -wxListItem::wxListItem() -{ - m_mask = 0; - m_itemId = 0; - m_col = 0; - m_state = 0; - m_stateMask = 0; - m_image = 0; - m_data = 0; - - m_format = wxLIST_FORMAT_CENTRE; - m_width = 0; -} - -// List event -IMPLEMENT_DYNAMIC_CLASS(wxListEvent, wxCommandEvent) - -wxListEvent::wxListEvent(wxEventType commandType, int id): - wxCommandEvent(commandType, id) -{ - m_code = 0; - m_itemIndex = 0; - m_col = 0; - m_cancelled = FALSE; -} - diff --git a/src/stubs/main.cpp b/src/stubs/main.cpp deleted file mode 100644 index 47a9924bae..0000000000 --- a/src/stubs/main.cpp +++ /dev/null @@ -1,18 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: main.cpp -// Purpose: Entry point -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#include "wx/app.h" - -int main(int argc, char* argv[]) -{ - return wxEntry(argc, argv); -} - diff --git a/src/stubs/makefile.unx b/src/stubs/makefile.unx deleted file mode 100644 index 9e789a14a0..0000000000 --- a/src/stubs/makefile.unx +++ /dev/null @@ -1,204 +0,0 @@ -# -# File: makefile.unx -# Author: Julian Smart -# Created: 1998 -# Updated: -# Copyright: (c) 1998 -# -# -# Makefile for wxStubs library, Unix - -EXTRACFLAGS=-DLEX_SCANNER - -include ../make.env - -LIB_CPP_SRC=\ -\ - ../common/cmndata.cpp \ - ../common/config.cpp \ - ../common/date.cpp \ - ../common/docmdi.cpp \ - ../common/docview.cpp \ - ../common/dynarray.cpp \ - ../common/dynlib.cpp \ - ../common/event.cpp \ - ../common/file.cpp \ - ../common/fileconf.cpp \ - ../common/filefn.cpp \ - ../common/gdicmn.cpp \ - ../common/hash.cpp \ - ../common/helpbase.cpp \ - ../common/intl.cpp \ - ../common/ipcbase.cpp \ - ../common/layout.cpp \ - ../common/list.cpp \ - ../common/log.cpp \ - ../common/matrix.cpp \ - ../common/memory.cpp \ - ../common/module.cpp \ - ../common/object.cpp \ - ../common/odbc.cpp \ - ../common/prntbase.cpp \ - ../common/resource.cpp \ - ../common/serbase.cpp \ - ../common/string.cpp \ - ../common/textfile.cpp \ - ../common/tbarbase.cpp \ - ../common/tbarsmpl.cpp \ - ../common/timercmn.cpp \ - ../common/utilscmn.cpp \ - ../common/wincmn.cpp \ - ../common/framecmn.cpp \ - ../common/stream.cpp \ - ../common/datstrm.cpp \ - ../common/wfstream.cpp \ - ../common/mstream.cpp \ - ../common/zstream.cpp \ - ../common/objstrm.cpp \ - ../common/sckstrm.cpp \ - ../common/validate.cpp \ - ../common/valgen.cpp \ - ../common/valtext.cpp \ - ../common/variant.cpp \ - ../common/wxexpr.cpp \ - ../common/socket.cpp \ - ../common/sckaddr.cpp \ - ../common/sckipc.cpp \ - ../common/protocol.cpp \ - ../common/ftp.cpp \ - ../common/http.cpp \ - ../common/url.cpp \ - ../common/tokenzr.cpp \ -\ - accel.cpp \ - app.cpp \ - bitmap.cpp \ - bmpbuttn.cpp \ - brush.cpp \ - button.cpp \ - checkbox.cpp \ - choice.cpp \ - clipbrd.cpp \ - colour.cpp \ - colordlg.cpp \ - control.cpp \ - combobox.cpp \ - cursor.cpp \ - data.cpp \ - dc.cpp \ - dcclient.cpp \ - dcmemory.cpp \ - dcscreen.cpp \ - dialog.cpp \ - dnd.cpp \ - filedlg.cpp \ - font.cpp \ - fontdlg.cpp \ - frame.cpp \ - gauge.cpp \ - gdiobj.cpp \ - helpxxxx.cpp \ - icon.cpp \ - listbox.cpp \ - joystick.cpp \ - main.cpp \ - mdi.cpp \ - menu.cpp \ - menuitem.cpp \ - metafile.cpp \ - minifram.cpp \ - msgdlg.cpp \ - notebook.cpp \ - palette.cpp \ - pen.cpp \ - print.cpp \ - radiobox.cpp \ - radiobut.cpp \ - region.cpp \ - scrolbar.cpp \ - settings.cpp \ - slider.cpp \ - spinbutt.cpp \ - statbox.cpp \ - statbmp.cpp \ - stattext.cpp \ - taskbar.cpp \ - textctrl.cpp \ - thread.cpp \ - timer.cpp \ - toolbar.cpp \ - utils.cpp \ - utilsexc.cpp \ - wave.cpp \ - window.cpp \ -\ - ../generic/choicdgg.cpp \ - ../generic/colrdlgg.cpp \ - ../generic/dcpsg.cpp \ - ../generic/dirdlgg.cpp \ - ../generic/fontdlgg.cpp \ - ../generic/gridg.cpp \ - ../generic/imaglist.cpp \ - ../generic/listctrl.cpp \ - ../generic/laywin.cpp \ - ../generic/msgdlgg.cpp \ - ../generic/panelg.cpp \ - ../generic/prop.cpp \ - ../generic/proplist.cpp \ - ../generic/propform.cpp \ - ../generic/printps.cpp \ - ../generic/prntdlgg.cpp \ - ../generic/sashwin.cpp \ - ../generic/scrolwin.cpp \ - ../generic/splitter.cpp \ - ../generic/statusbr.cpp \ - ../generic/tabg.cpp \ - ../generic/textdlgg.cpp \ - ../generic/treectrl.cpp - -# If you're not using the generic ones, you -# may wish to define platform-specific ones -# dirdlg.cpp \ -# treectrl.cpp \ -# listctrl.cpp \ -# imaglist.cpp \ -# statusbr.cpp \ - -LIB_C_SRC=\ -\ - ../common/y_tab.c \ - ../common/extended.c - -all: $(WXLIB) - -# Define library objects -OBJECTS=\ - $(LIB_CPP_SRC:.cpp=.o) $(LIB_C_SRC:.c=.o) - -$(WXLIB) : $(OBJECTS) - ar $(AROPTIONS) $@ $(OBJECTS) - $(RANLIB) $@ - -../common/y_tab.$(OBJSUFF): ../common/y_tab.c ../common/lex_yy.c - $(CCLEX) -c $(CFLAGS) -o $@ ../common/y_tab.c - -# Replace lex with flex if you run into compilation -# problems with lex_yy.c. See also note about LEX_SCANNER -# above. -../common/lex_yy.c: ../common/lexer.l - $(LEX) ../common/lexer.l - sed -e "s/BUFSIZ/5000/g" < ../common/lex.yy.c | \ - sed -e "s/yyoutput(c)/void yyoutput(c)/g" | \ - sed -e "s/YYLMAX 200/YYLMAX 5000/g" > ../common/lex_yy.c - /bin/rm -f ../common/lex.yy.c - -# Replace yacc with bison if you run into compilation -# problems with y_tab.c. -../common/y_tab.c: ../common/parser.y - $(YACC) ../common/parser.y - mv y.tab.c ../common/y_tab.c - - -clean: - rm -f $(OBJECTS) $(WXLIB) - diff --git a/src/stubs/makefile.vc b/src/stubs/makefile.vc deleted file mode 100644 index b0a6240fef..0000000000 --- a/src/stubs/makefile.vc +++ /dev/null @@ -1,979 +0,0 @@ -# -# File: makefile.vc -# Author: Julian Smart -# Created: 1997 -# Updated: -# Copyright: (c) 1997, Julian Smart -# -# "%W% %G%" -# -# Makefile : Builds wxWindows stubs library wxstubs.lib for VC++ (32-bit) -# Arguments: -# -# FINAL=1 argument to nmake to build version with no debugging info. -# - -!include - -APPVER=3.50 # 4.0 -# This means 'enable Windows 95 features' (in wxWindows and in VC++ 4.0). -WINVERSION=-DWINVER=0x0400 - -# On Alpha machines, change to CPU=ALPHA -CPU=i386 - -# Suffixes -OBJSUFF=obj -SRCSUFF=cpp - -WINFLAGS=-c -W3 -Dtry=__try -Dexcept=__except -Dleave=__leave -Dfinally=__finally -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 $(WINVERSION) -D__WIN32__ -D__WINDOWS__ -WINLINKFLAGS=/INCREMENTAL:NO /NOLOGO -align:0x1000 -machine:$(CPU) -subsystem:windows,$(APPVER) -WINLIBS=kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib oldnames.lib\ - comctl32.lib ctl3d32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib # libci.lib # libci.lib required for VC++ 4.2 - -# Change this to your WXWIN directory -WXDIR=$(WXWIN) - -WXSRC=$(WXDIR)\src\stubs -WXINC=$(WXDIR)\include -WXBASESRC=$(WXDIR)\src\common - -WXLIB=$(WXDIR)\lib\wxstubs.lib - -EXTRADLLFLAGS= - -INC=-I$(WXINC) -I$(WXDIR)/src/png -I$(WXDIR)/src/zlib $(EXTRAINC) -LIBS = $(EXTRALIBS) $(WXLIB) $(WINLIBS) - -!ifndef FINAL -FINAL=0 -DEBUG=1 -!endif - -# Set this to 1 if you don't want to use precompiled headers -NOPCH=1 - -OPTIONS= - -!if "$(FINAL)" == "0" -OPT = /Od /Gy -# ***N.B.*** to save space/time, comment out /FR to avoid browse info (.sbr files) being generated -DEBUG_FLAGS= /Zi # /FR -LINK_DEBUG_FLAGS=-debug:full -debugtype:cv # /PDB:NONE -CRTFLAG=/MD -!else -# /O1 - smallest code -# /O2 - fastest code -OPT = /O1 # /O2 # /Od -DEBUG_FLAGS= -LINK_DEBUG_FLAGS=/RELEASE -CRTFLAG=/MD -!endif - -PCH= -PRECOMP= -MAKEPRECOMP= - -CPPFLAGS=$(WINFLAGS) $(DEBUG_FLAGS) $(PRECOMP) $(EXTRAFLAGS) /D__WXSTUBS__ /DDEBUG=1 $(INC) $(OPT) $(CRTFLAG) /GX /D__WXDEBUG__ /DWXDEBUG=1 -# If you don't include wxprec.h, use CPPFLAGS2 -CPPFLAGS2=$(WINFLAGS) $(DEBUG_FLAGS) /D__WXSTUBS__ /DDEBUG=1 $(INC) $(EXTRAFLAGS) $(OPT) $(CRTFLAG) /GX /D__WXDEBUG__ /DWXDEBUG=1 -LINKFLAGS=$(LINK_DEBUG_FLAGS) $(WINLINKFLAGS) -entry:WinMainCRTStartup - -THISDIR=$(WXWIN)\src\stubs - -LIBTARGET=$(WXLIB) - -# Please set these according to the settings in wx_setup.h, so we can include -# the appropriate libraries in wx.lib - -PERIPH_LIBS= -PERIPH_TARGET= -PERIPH_CLEAN_TARGET= - -GENDIR=..\generic -COMMDIR=..\common -STUBSDIR=. - -DOCDIR = $(WXDIR)\docs - -GENERICOBJS= \ - $(GENDIR)\choicdgg.obj \ - $(GENDIR)\colrdlgg.obj \ - $(GENDIR)\dcpsg.obj \ - $(GENDIR)\fontdlgg.obj \ - $(GENDIR)\gridg.obj \ - $(GENDIR)\msgdlgg.obj \ - $(GENDIR)\panelg.obj \ - $(GENDIR)\prop.obj \ - $(GENDIR)\propform.obj \ - $(GENDIR)\proplist.obj \ - $(GENDIR)\printps.obj \ - $(GENDIR)\prntdlgg.obj \ - $(GENDIR)\scrolwin.obj \ - $(GENDIR)\splitter.obj \ - $(GENDIR)\statusbr.obj \ - $(GENDIR)\tabg.obj \ - $(GENDIR)\textdlgg.obj - -# $(GENDIR)\helpxlp.obj \ - -COMMONOBJS = \ - $(COMMDIR)\cmndata.obj \ - $(COMMDIR)\config.obj \ - $(COMMDIR)\docview.obj \ - $(COMMDIR)\docmdi.obj \ - $(COMMDIR)\dynarray.obj \ - $(COMMDIR)\event.obj \ - $(COMMDIR)\file.obj \ - $(COMMDIR)\filefn.obj \ - $(COMMDIR)\fileconf.obj \ - $(COMMDIR)\framecmn.obj \ - $(COMMDIR)\gdicmn.obj \ - $(COMMDIR)\intl.obj \ - $(COMMDIR)\ipcbase.obj \ - $(COMMDIR)\helpbase.obj \ - $(COMMDIR)\layout.obj \ - $(COMMDIR)\log.obj \ - $(COMMDIR)\memory.obj \ - $(COMMDIR)\module.obj \ - $(COMMDIR)\object.obj \ - $(COMMDIR)\prntbase.obj \ - $(COMMDIR)\resource.obj \ - $(COMMDIR)\tbarbase.obj \ - $(COMMDIR)\tbarsmpl.obj \ - $(COMMDIR)\textfile.obj \ - $(COMMDIR)\timercmn.obj \ - $(COMMDIR)\utilscmn.obj \ - $(COMMDIR)\validate.obj \ - $(COMMDIR)\valgen.obj \ - $(COMMDIR)\valtext.obj \ - $(COMMDIR)\date.obj \ - $(COMMDIR)\hash.obj \ - $(COMMDIR)\list.obj \ - $(COMMDIR)\string.obj \ - $(COMMDIR)\time.obj \ - $(COMMDIR)\wxexpr.obj \ - $(COMMDIR)\y_tab.obj \ - $(COMMDIR)\extended.obj \ - $(COMMDIR)\process.obj \ - $(COMMDIR)\fstream.obj \ - $(COMMDIR)\mstream.obj \ - $(COMMDIR)\zstream.obj \ - $(COMMDIR)\stream.obj \ - $(COMMDIR)\datstrm.obj \ - $(COMMDIR)\wincmn.obj - -# $(COMMDIR)\odbc.obj \ - -STUBSOBJS = \ - $(STUBSDIR)\accel.obj \ - $(STUBSDIR)\app.obj \ - $(STUBSDIR)\bitmap.obj \ - $(STUBSDIR)\bmpbuttn.obj \ - $(STUBSDIR)\brush.obj \ - $(STUBSDIR)\button.obj \ - $(STUBSDIR)\checkbox.obj \ - $(STUBSDIR)\checklst.obj \ - $(STUBSDIR)\choice.obj \ - $(STUBSDIR)\clipbrd.obj \ - $(STUBSDIR)\colordlg.obj \ - $(STUBSDIR)\colour.obj \ - $(STUBSDIR)\combobox.obj \ - $(STUBSDIR)\control.obj \ - $(STUBSDIR)\cursor.obj \ - $(STUBSDIR)\data.obj \ - $(STUBSDIR)\dc.obj \ - $(STUBSDIR)\dcmemory.obj \ - $(STUBSDIR)\dcclient.obj \ - $(STUBSDIR)\dcscreen.obj \ - $(STUBSDIR)\dialog.obj \ - $(STUBSDIR)\dirdlg.obj \ - $(STUBSDIR)\filedlg.obj \ - $(STUBSDIR)\font.obj \ - $(STUBSDIR)\fontdlg.obj \ - $(STUBSDIR)\frame.obj \ - $(STUBSDIR)\gauge.obj \ - $(STUBSDIR)\gdiobj.obj \ - $(STUBSDIR)\helpxxxx.obj \ - $(STUBSDIR)\icon.obj \ - $(STUBSDIR)\imaglist.obj \ - $(STUBSDIR)\joystick.obj \ - $(STUBSDIR)\listbox.obj \ - $(STUBSDIR)\listctrl.obj \ - $(STUBSDIR)\main.obj \ - $(STUBSDIR)\mdi.obj \ - $(STUBSDIR)\menu.obj \ - $(STUBSDIR)\menuitem.obj \ - $(STUBSDIR)\metafile.obj \ - $(STUBSDIR)\minifram.obj \ - $(STUBSDIR)\msgdlg.obj \ - $(STUBSDIR)\notebook.obj \ - $(STUBSDIR)\palette.obj \ - $(STUBSDIR)\pen.obj \ - $(STUBSDIR)\printdlg.obj \ - $(STUBSDIR)\print.obj \ - $(STUBSDIR)\radiobox.obj \ - $(STUBSDIR)\radiobut.obj \ - $(STUBSDIR)\region.obj \ - $(STUBSDIR)\scrolbar.obj \ - $(STUBSDIR)\settings.obj \ - $(STUBSDIR)\slider.obj \ - $(STUBSDIR)\spinbutt.obj \ - $(STUBSDIR)\statbmp.obj \ - $(STUBSDIR)\statbox.obj \ - $(STUBSDIR)\statusbr.obj \ - $(STUBSDIR)\stattext.obj \ - $(STUBSDIR)\tabctrl.obj \ - $(STUBSDIR)\taskbar.obj \ - $(STUBSDIR)\toolbar.obj \ - $(STUBSDIR)\textctrl.obj \ - $(STUBSDIR)\thread.obj \ - $(STUBSDIR)\timer.obj \ - $(STUBSDIR)\treectrl.obj \ - $(STUBSDIR)\utils.obj \ - $(STUBSDIR)\utilsexc.obj \ - $(STUBSDIR)\wave.obj \ - $(STUBSDIR)\window.obj - - -OBJECTS = $(COMMONOBJS) $(GENERICOBJS) $(STUBSOBJS) - -# Normal, static library -all: $(OBJECTS) $(PERIPH_TARGET) $(LIBTARGET) - -$(WXDIR)\lib\wxstubs.lib: $(OBJECTS) $(PERIPH_LIBS) - -erase $(LIBTARGET) - $(implib) @<< --out:$@ --machine:$(CPU) -$(OBJECTS) $(PERIPH_LIBS) -<< - -######################################################## -# Windows-specific objects - -$(STUBSDIR)/accel.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/app.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/bitmap.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/bmpbuttn.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/brush.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/button.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/choice.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/checkbox.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/checklst.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/clipbrd.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/colordlg.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/colour.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/combobox.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/control.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/cursor.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/data.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/dc.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/dcmemory.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/dcclient.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/dcprint.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/dcscreen.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/dialog.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/dirdlg.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/filedlg.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/font.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/fontdlg.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/frame.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/gauge.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/gdiobj.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/icon.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/imaglist.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/joystick.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/listbox.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF) -<< - -$(STUBSDIR)/listctrl.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF) -<< - -$(STUBSDIR)/main.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/mdi.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/menu.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/menuitem.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/metafile.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/minifram.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/msgdlg.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/notebook.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/palette.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/pen.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/printdlg.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/print.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/radiobox.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/radiobut.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/region.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/scrolbar.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/settings.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/slider.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/spinbutt.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/statbmp.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/statbox.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/statusbr.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/stattext.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/tabctrl.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/taskbar.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/toolbar.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/textctrl.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/thread.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/timer.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/treectrl.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/utils.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/utilsexc.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/wave.obj: $*.$(SRCSUFF) - echo $(CPPFLAGS) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(STUBSDIR)/window.obj: $*.$(SRCSUFF) - echo $(CPPFLAGS) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -######################################################## -# Common objects (always compiled) - -$(COMMDIR)/cmndata.obj: $*.$(SRCSUFF) - echo $(CPPFLAGS) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(COMMDIR)/config.obj: $*.$(SRCSUFF) - echo $(CPPFLAGS) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(COMMDIR)/db.obj: $*.$(SRCSUFF) - echo $(CPPFLAGS) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(COMMDIR)/dbtable.obj: $*.$(SRCSUFF) - echo $(CPPFLAGS) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(COMMDIR)/docview.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(COMMDIR)/docmdi.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(COMMDIR)/dynarray.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(COMMDIR)/event.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(COMMDIR)/file.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(COMMDIR)/fileconf.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(COMMDIR)/filefn.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(COMMDIR)/framecmn.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(COMMDIR)/gdicmn.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(COMMDIR)/intl.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(COMMDIR)/ipcbase.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(COMMDIR)/helpbase.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(COMMDIR)/layout.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(COMMDIR)/log.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(COMMDIR)/memory.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(COMMDIR)/module.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(COMMDIR)/object.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(COMMDIR)/odbc.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(COMMDIR)/prntbase.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(COMMDIR)/resource.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(COMMDIR)/tbarbase.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(COMMDIR)/tbarsmpl.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(COMMDIR)/textfile.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(COMMDIR)/timercmn.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(COMMDIR)/utilscmn.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(COMMDIR)/validate.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(COMMDIR)/valgen.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(COMMDIR)/valtext.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(COMMDIR)/date.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(COMMDIR)/wxexpr.obj: $*.$(SRCSUFF) - echo $(CPPFLAGS) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(COMMDIR)/hash.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(COMMDIR)/list.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(COMMDIR)/string.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(COMMDIR)/matrix.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -#$(COMMDIR)/wxstrgnu/wxstrgnu.obj: $*.$(SRCSUFF) -# cl @<< -#$(CPPFLAGS2) /c /Tp $*.$(SRCSUFF) /Fo$@ -#<< - -#$(COMMDIR)/wxstrgnu/wxregex.obj: $*.$(SRCSUFF) -# cl @<< -#$(CPPFLAGS2) /c /Tp $*.$(SRCSUFF) /Fo$@ -#<< - -$(COMMDIR)/time.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(COMMDIR)\stream.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(COMMDIR)\fstream.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(COMMDIR)\mstream.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(COMMDIR)\zstream.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(COMMDIR)\datstrm.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(COMMDIR)/extended.obj: $*.c - cl @<< -$(CPPFLAGS2) /c /Tp $*.c /Fo$@ -<< - -$(COMMDIR)/process.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS2) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(COMMDIR)/wincmn.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS2) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(COMMDIR)/y_tab.obj: $*.c $(COMMDIR)/lex_yy.c - cl @<< -$(CPPFLAGS2) /c $*.c -DUSE_DEFINE -DYY_USE_PROTOS /Fo$@ -<< - -$(COMMDIR)/y_tab.c: $(COMMDIR)/dosyacc.c - copy $(COMMDIR)\dosyacc.c $(COMMDIR)\y_tab.c - -$(COMMDIR)/lex_yy.c: $(COMMDIR)/doslex.c - copy $(COMMDIR)\doslex.c $(COMMDIR)\lex_yy.c - -######################################################## -# Generic objects (not always compiled, depending on -# whether platforms have native implementations) - -$(GENDIR)/choicdgg.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(GENDIR)/colrdlgg.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(GENDIR)/dcpsg.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(GENDIR)/fontdlgg.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(GENDIR)/gridg.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(GENDIR)/helpxlp.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(GENDIR)/msgdlgg.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(GENDIR)/panelg.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(GENDIR)/prop.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(GENDIR)/propform.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(GENDIR)/proplist.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(GENDIR)/printps.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(GENDIR)/prntdlgg.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(GENDIR)/scrolwin.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(GENDIR)/splitter.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(GENDIR)/statusbr.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(GENDIR)/tabg.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(GENDIR)/textdlgg.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - -$(OBJECTS): $(WXDIR)/include/wx/stubs/setup.h - -clean: $(PERIPH_CLEAN_TARGET) - -erase *.obj - -erase $(LIBTARGET) - -erase $(WXDIR)\lib\*.pdb - -erase *.pdb - -erase *.sbr - -erase *.pch - cd $(WXDIR)\src\stubs - cd $(GENDIR) - -erase *.pdb - -erase *.sbr - -erase *.obj - cd $(WXDIR)\src\stubs - cd $(COMMDIR) - -erase *.pdb - -erase *.sbr - -erase *.obj - -erase y_tab.c - -erase lex_yy.c - cd $(WXDIR)\src\stubs - -cleanall: clean - diff --git a/src/stubs/mdi.cpp b/src/stubs/mdi.cpp deleted file mode 100644 index 9e62e1d15c..0000000000 --- a/src/stubs/mdi.cpp +++ /dev/null @@ -1,263 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: mdi.cpp -// Purpose: MDI classes -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "mdi.h" -#endif - -#include "wx/mdi.h" -#include "wx/menu.h" -#include "wx/settings.h" - -extern wxList wxModelessWindows; - -IMPLEMENT_DYNAMIC_CLASS(wxMDIParentFrame, wxFrame) -IMPLEMENT_DYNAMIC_CLASS(wxMDIChildFrame, wxFrame) -IMPLEMENT_DYNAMIC_CLASS(wxMDIClientWindow, wxWindow) - -BEGIN_EVENT_TABLE(wxMDIParentFrame, wxFrame) - EVT_SIZE(wxMDIParentFrame::OnSize) - EVT_ACTIVATE(wxMDIParentFrame::OnActivate) - EVT_SYS_COLOUR_CHANGED(wxMDIParentFrame::OnSysColourChanged) -END_EVENT_TABLE() - -BEGIN_EVENT_TABLE(wxMDIClientWindow, wxWindow) - EVT_SCROLL(wxMDIClientWindow::OnScroll) -END_EVENT_TABLE() - - -// Parent frame - -wxMDIParentFrame::wxMDIParentFrame() -{ -} - -bool wxMDIParentFrame::Create(wxWindow *parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - if (!parent) - wxTopLevelWindows.Append(this); - - SetName(name); - m_windowStyle = style; - - if (parent) parent->AddChild(this); - - if ( id > -1 ) - m_windowId = id; - else - m_windowId = (int)NewControlId(); - - // TODO: create MDI parent frame - - wxModelessWindows.Append(this); - - return TRUE; -} - -wxMDIParentFrame::~wxMDIParentFrame() -{ -} - -// Get size *available for subwindows* i.e. excluding menu bar. -void wxMDIParentFrame::GetClientSize(int *x, int *y) const -{ - // TODO -} - -void wxMDIParentFrame::SetMenuBar(wxMenuBar *menu_bar) -{ - // TODO - if (!menu_bar) - { - m_frameMenuBar = NULL; - return; - } - - if (menu_bar->m_menuBarFrame) - return; - - m_frameMenuBar = menu_bar; -} - -void wxMDIParentFrame::OnSize(wxSizeEvent& event) -{ -#if wxUSE_CONSTRAINTS - if (GetAutoLayout()) - Layout(); -#endif - int x = 0; - int y = 0; - int width, height; - GetClientSize(&width, &height); - - if ( GetClientWindow() ) - GetClientWindow()->SetSize(x, y, width, height); -} - -void wxMDIParentFrame::OnActivate(wxActivateEvent& event) -{ - // Do nothing -} - -// Returns the active MDI child window -wxMDIChildFrame *wxMDIParentFrame::GetActiveChild() const -{ - // TODO - return NULL; -} - -// Create the client window class (don't Create the window, -// just return a new class) -wxMDIClientWindow *wxMDIParentFrame::OnCreateClient() -{ - return new wxMDIClientWindow ; -} - -// Responds to colour changes, and passes event on to children. -void wxMDIParentFrame::OnSysColourChanged(wxSysColourChangedEvent& event) -{ - // TODO - - // Propagate the event to the non-top-level children - wxFrame::OnSysColourChanged(event); -} - -// MDI operations -void wxMDIParentFrame::Cascade() -{ - // TODO -} - -void wxMDIParentFrame::Tile() -{ - // TODO -} - -void wxMDIParentFrame::ArrangeIcons() -{ - // TODO -} - -void wxMDIParentFrame::ActivateNext() -{ - // TODO -} - -void wxMDIParentFrame::ActivatePrevious() -{ - // TODO -} - -// Child frame - -wxMDIChildFrame::wxMDIChildFrame() -{ -} - -bool wxMDIChildFrame::Create(wxMDIParentFrame *parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - SetName(name); - - if ( id > -1 ) - m_windowId = id; - else - m_windowId = (int)NewControlId(); - - if (parent) parent->AddChild(this); - - // TODO: create child frame - - wxModelessWindows.Append(this); - return FALSE; -} - -wxMDIChildFrame::~wxMDIChildFrame() -{ -} - -// Set the client size (i.e. leave the calculation of borders etc. -// to wxWindows) -void wxMDIChildFrame::SetClientSize(int width, int height) -{ - // TODO -} - -void wxMDIChildFrame::GetPosition(int *x, int *y) const -{ - // TODO -} - -void wxMDIChildFrame::SetMenuBar(wxMenuBar *menu_bar) -{ - // TODO - if (!menu_bar) - { - m_frameMenuBar = NULL; - return; - } - - if (menu_bar->m_menuBarFrame) - return; - m_frameMenuBar = menu_bar; -} - -// MDI operations -void wxMDIChildFrame::Maximize() -{ - // TODO -} - -void wxMDIChildFrame::Restore() -{ - // TODO -} - -void wxMDIChildFrame::Activate() -{ - // TODO -} - -// Client window - -wxMDIClientWindow::wxMDIClientWindow() -{ -} - -wxMDIClientWindow::~wxMDIClientWindow() -{ -} - -bool wxMDIClientWindow::CreateClient(wxMDIParentFrame *parent, long style) -{ - // TODO create client window - m_backgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE); - - return FALSE; -} - -// Explicitly call default scroll behaviour -void wxMDIClientWindow::OnScroll(wxScrollEvent& event) -{ - Default(); // Default processing -} - diff --git a/src/stubs/menu.cpp b/src/stubs/menu.cpp deleted file mode 100644 index 32188c4b4a..0000000000 --- a/src/stubs/menu.cpp +++ /dev/null @@ -1,612 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: menu.cpp -// Purpose: wxMenu, wxMenuBar, wxMenuItem -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - - -// ============================================================================ -// headers & declarations -// ============================================================================ - -// wxWindows headers -// ----------------- - -#ifdef __GNUG__ -#pragma implementation "menu.h" -#pragma implementation "menuitem.h" -#endif - -#include "wx/menu.h" -#include "wx/menuitem.h" -#include "wx/log.h" -#include "wx/utils.h" - -// other standard headers -// ---------------------- -#include - -IMPLEMENT_DYNAMIC_CLASS(wxMenu, wxEvtHandler) -IMPLEMENT_DYNAMIC_CLASS(wxMenuBar, wxEvtHandler) - -// ============================================================================ -// implementation -// ============================================================================ - -// Menus - -// Construct a menu with optional title (then use append) -wxMenu::wxMenu(const wxString& title, const wxFunction func) -{ - m_title = title; - m_parent = NULL; - m_eventHandler = this; - m_noItems = 0; - m_menuBar = NULL; - m_clientData = (void*) NULL; - if (m_title != "") - { - Append(-2, m_title) ; - AppendSeparator() ; - } - - Callback(func); - - // TODO create menu -} - -// The wxWindow destructor will take care of deleting the submenus. -wxMenu::~wxMenu() -{ - // TODO destroy menu and children - - wxNode *node = m_menuItems.First(); - while (node) - { - wxMenuItem *item = (wxMenuItem *)node->Data(); - - // Delete child menus. - // Beware: they must not be appended to children list!!! - // (because order of delete is significant) - if (item->GetSubMenu()) - item->DeleteSubMenu(); - - wxNode *next = node->Next(); - delete item; - delete node; - node = next; - } -} - -void wxMenu::Break() -{ - // TODO -} - -// function appends a new item or submenu to the menu -void wxMenu::Append(wxMenuItem *pItem) -{ - // TODO - - wxCHECK_RET( pItem != NULL, "can't append NULL item to the menu" ); - - m_menuItems.Append(pItem); - - m_noItems++; -} - -void wxMenu::AppendSeparator() -{ - // TODO - Append(new wxMenuItem(this, ID_SEPARATOR)); -} - -// Pullright item -void wxMenu::Append(int Id, const wxString& label, wxMenu *SubMenu, - const wxString& helpString) -{ - Append(new wxMenuItem(this, Id, label, helpString, FALSE, SubMenu)); -} - -// Ordinary menu item -void wxMenu::Append(int Id, const wxString& label, - const wxString& helpString, bool checkable) -{ - // 'checkable' parameter is useless for Windows. - Append(new wxMenuItem(this, Id, label, helpString, checkable)); -} - -void wxMenu::Delete(int id) -{ - wxNode *node; - wxMenuItem *item; - int pos; - - for (pos = 0, node = m_menuItems.First(); node; node = node->Next(), pos++) { - item = (wxMenuItem *)node->Data(); - if (item->GetId() == id) - break; - } - - if (!node) - return; - - m_menuItems.DeleteNode(node); - delete item; - - // TODO -} - -void wxMenu::Enable(int Id, bool Flag) -{ - wxMenuItem *item = FindItemForId(Id); - wxCHECK_RET( item != NULL, "can't enable non-existing menu item" ); - - item->Enable(Flag); -} - -bool wxMenu::Enabled(int Id) const -{ - wxMenuItem *item = FindItemForId(Id); - wxCHECK( item != NULL, FALSE ); - - return item->IsEnabled(); -} - -void wxMenu::Check(int Id, bool Flag) -{ - wxMenuItem *item = FindItemForId(Id); - wxCHECK_RET( item != NULL, "can't get status of non-existing menu item" ); - - item->Check(Flag); -} - -bool wxMenu::Checked(int Id) const -{ - wxMenuItem *item = FindItemForId(Id); - wxCHECK( item != NULL, FALSE ); - - return item->IsChecked(); -} - -void wxMenu::SetTitle(const wxString& label) -{ - m_title = label ; - // TODO -} - -const wxString wxMenu::GetTitle() const -{ - return m_title; -} - -void wxMenu::SetLabel(int id, const wxString& label) -{ - wxMenuItem *item = FindItemForId(id) ; - if (item==NULL) - return; - - if (item->GetSubMenu()==NULL) - { - // TODO - } - else - { - // TODO - } - item->SetName(label); -} - -wxString wxMenu::GetLabel(int Id) const -{ - // TODO - return wxString("") ; -} - -// Finds the item id matching the given string, -1 if not found. -int wxMenu::FindItem (const wxString& itemString) const -{ - char buf1[200]; - char buf2[200]; - wxStripMenuCodes ((char *)(const char *)itemString, buf1); - - for (wxNode * node = m_menuItems.First (); node; node = node->Next ()) - { - wxMenuItem *item = (wxMenuItem *) node->Data (); - if (item->GetSubMenu()) - { - int ans = item->GetSubMenu()->FindItem(itemString); - if (ans > -1) - return ans; - } - if ( !item->IsSeparator() ) - { - wxStripMenuCodes((char *)item->GetName().c_str(), buf2); - if (strcmp(buf1, buf2) == 0) - return item->GetId(); - } - } - - return -1; -} - -wxMenuItem *wxMenu::FindItemForId(int itemId, wxMenu ** itemMenu) const -{ - if (itemMenu) - *itemMenu = NULL; - for (wxNode * node = m_menuItems.First (); node; node = node->Next ()) - { - wxMenuItem *item = (wxMenuItem *) node->Data (); - - if (item->GetId() == itemId) - { - if (itemMenu) - *itemMenu = (wxMenu *) this; - return item; - } - - if (item->GetSubMenu()) - { - wxMenuItem *ans = item->GetSubMenu()->FindItemForId (itemId, itemMenu); - if (ans) - return ans; - } - } - - if (itemMenu) - *itemMenu = NULL; - return NULL; -} - -void wxMenu::SetHelpString(int itemId, const wxString& helpString) -{ - wxMenuItem *item = FindItemForId (itemId); - if (item) - item->SetHelp(helpString); -} - -wxString wxMenu::GetHelpString (int itemId) const -{ - wxMenuItem *item = FindItemForId (itemId); - wxString str(""); - return (item == NULL) ? str : item->GetHelp(); -} - -void wxMenu::ProcessCommand(wxCommandEvent & event) -{ - bool processed = FALSE; - - // Try a callback - if (m_callback) - { - (void) (*(m_callback)) (*this, event); - processed = TRUE; - } - - // Try the menu's event handler - if ( !processed && GetEventHandler()) - { - processed = GetEventHandler()->ProcessEvent(event); - } -/* TODO - // Try the window the menu was popped up from (and up - // through the hierarchy) - if ( !processed && GetInvokingWindow()) - processed = GetInvokingWindow()->ProcessEvent(event); -*/ -} - -// Update 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 wxMenu::UpdateUI(wxEvtHandler* source) -{ - if (!source && GetInvokingWindow()) - source = GetInvokingWindow()->GetEventHandler(); - if (!source) - source = GetEventHandler(); - if (!source) - source = this; - - wxNode* node = GetItems().First(); - while (node) - { - wxMenuItem* item = (wxMenuItem*) node->Data(); - if ( !item->IsSeparator() ) - { - wxWindowID id = item->GetId(); - wxUpdateUIEvent event(id); - event.SetEventObject( source ); - - if (source->ProcessEvent(event)) - { - if (event.GetSetText()) - SetLabel(id, event.GetText()); - if (event.GetSetChecked()) - Check(id, event.GetChecked()); - if (event.GetSetEnabled()) - Enable(id, event.GetEnabled()); - } - - if (item->GetSubMenu()) - item->GetSubMenu()->UpdateUI(source); - } - node = node->Next(); - } -} - -bool wxWindow::PopupMenu(wxMenu *menu, int x, int y) -{ - menu->SetInvokingWindow(this); - menu->UpdateUI(); - - // TODO - return FALSE; -} - -// Menu Bar -wxMenuBar::wxMenuBar() -{ - m_eventHandler = this; - m_menuCount = 0; - m_menus = NULL; - m_titles = NULL; - m_menuBarFrame = NULL; - - // TODO -} - -wxMenuBar::wxMenuBar(int n, wxMenu *menus[], const wxString titles[]) -{ - m_eventHandler = this; - m_menuCount = n; - m_menus = menus; - m_titles = new wxString[n]; - int i; - for ( i = 0; i < n; i++ ) - m_titles[i] = titles[i]; - m_menuBarFrame = NULL; - - // TODO -} - -wxMenuBar::~wxMenuBar() -{ - int i; - for (i = 0; i < m_menuCount; i++) - { - delete m_menus[i]; - } - delete[] m_menus; - delete[] m_titles; - - // TODO -} - -// Must only be used AFTER menu has been attached to frame, -// otherwise use individual menus to enable/disable items -void wxMenuBar::Enable(int id, bool flag) -{ - wxMenu *itemMenu = NULL; - wxMenuItem *item = FindItemForId(id, &itemMenu) ; - if (!item) - return; - - // TODO -} - -void wxMenuBar::EnableTop(int pos, bool flag) -{ - // TODO -} - -// Must only be used AFTER menu has been attached to frame, -// otherwise use individual menus -void wxMenuBar::Check(int id, bool flag) -{ - wxMenu *itemMenu = NULL; - wxMenuItem *item = FindItemForId(id, &itemMenu) ; - if (!item) - return; - - if (!item->IsCheckable()) - return ; - - // TODO -} - -bool wxMenuBar::Checked(int id) const -{ - wxMenu *itemMenu = NULL; - wxMenuItem *item = FindItemForId(id, &itemMenu) ; - if (!item) - return FALSE; - - // TODO - return FALSE; -} - -bool wxMenuBar::Enabled(int id) const -{ - wxMenu *itemMenu = NULL; - wxMenuItem *item = FindItemForId(id, &itemMenu) ; - if (!item) - return FALSE; - - // TODO - return FALSE ; -} - - -void wxMenuBar::SetLabel(int id, const wxString& label) -{ - wxMenu *itemMenu = NULL; - wxMenuItem *item = FindItemForId(id, &itemMenu) ; - - if (!item) - return; - - // TODO -} - -wxString wxMenuBar::GetLabel(int id) const -{ - wxMenu *itemMenu = NULL; - wxMenuItem *item = FindItemForId(id, &itemMenu) ; - - if (!item) - return wxString(""); - - // TODO - return wxString("") ; -} - -void wxMenuBar::SetLabelTop(int pos, const wxString& label) -{ - // TODO -} - -wxString wxMenuBar::GetLabelTop(int pos) const -{ - // TODO - return wxString(""); -} - -bool wxMenuBar::OnDelete(wxMenu *a_menu, int pos) -{ - // TODO - return FALSE; -} - -bool wxMenuBar::OnAppend(wxMenu *a_menu, const char *title) -{ - // TODO - return FALSE; -} - -void wxMenuBar::Append (wxMenu * menu, const wxString& title) -{ - if (!OnAppend(menu, title)) - return; - - m_menuCount ++; - wxMenu **new_menus = new wxMenu *[m_menuCount]; - wxString *new_titles = new wxString[m_menuCount]; - int i; - - for (i = 0; i < m_menuCount - 1; i++) - { - new_menus[i] = m_menus[i]; - m_menus[i] = NULL; - new_titles[i] = m_titles[i]; - m_titles[i] = ""; - } - if (m_menus) - { - delete[]m_menus; - delete[]m_titles; - } - m_menus = new_menus; - m_titles = new_titles; - - m_menus[m_menuCount - 1] = (wxMenu *)menu; - m_titles[m_menuCount - 1] = title; - - // TODO -} - -void wxMenuBar::Delete(wxMenu * menu, int i) -{ - int j; - int ii = (int) i; - - if (menu != 0) - { - for (ii = 0; ii < m_menuCount; ii++) - { - if (m_menus[ii] == menu) - break; - } - if (ii >= m_menuCount) - return; - } else - { - if (ii < 0 || ii >= m_menuCount) - return; - menu = m_menus[ii]; - } - - if (!OnDelete(menu, ii)) - return; - - menu->SetParent(NULL); - - -- m_menuCount; - for (j = ii; j < m_menuCount; j++) - { - m_menus[j] = m_menus[j + 1]; - m_titles[j] = m_titles[j + 1]; - } -} - -// Find the menu menuString, item itemString, and return the item id. -// Returns -1 if none found. -int wxMenuBar::FindMenuItem (const wxString& menuString, const wxString& itemString) const -{ - char buf1[200]; - char buf2[200]; - wxStripMenuCodes ((char *)(const char *)menuString, buf1); - int i; - for (i = 0; i < m_menuCount; i++) - { - wxStripMenuCodes ((char *)(const char *)m_titles[i], buf2); - if (strcmp (buf1, buf2) == 0) - return m_menus[i]->FindItem (itemString); - } - return -1; -} - -wxMenuItem *wxMenuBar::FindItemForId (int Id, wxMenu ** itemMenu) const -{ - if (itemMenu) - *itemMenu = NULL; - - wxMenuItem *item = NULL; - int i; - for (i = 0; i < m_menuCount; i++) - if ((item = m_menus[i]->FindItemForId (Id, itemMenu))) - return item; - return NULL; -} - -void wxMenuBar::SetHelpString (int Id, const wxString& helpString) -{ - int i; - for (i = 0; i < m_menuCount; i++) - { - if (m_menus[i]->FindItemForId (Id)) - { - m_menus[i]->SetHelpString (Id, helpString); - return; - } - } -} - -wxString wxMenuBar::GetHelpString (int Id) const -{ - int i; - for (i = 0; i < m_menuCount; i++) - { - if (m_menus[i]->FindItemForId (Id)) - return wxString(m_menus[i]->GetHelpString (Id)); - } - return wxString(""); -} - - diff --git a/src/stubs/menuitem.cpp b/src/stubs/menuitem.cpp deleted file mode 100644 index 4827ada322..0000000000 --- a/src/stubs/menuitem.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: menuitem.cpp -// Purpose: wxMenuItem implementation -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// headers & declarations -// ============================================================================ - -#include "wx/menu.h" -#include "wx/menuitem.h" - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// dynamic classes implementation -// ---------------------------------------------------------------------------- - - IMPLEMENT_DYNAMIC_CLASS(wxMenuItem, wxObject) - -// ---------------------------------------------------------------------------- -// wxMenuItem -// ---------------------------------------------------------------------------- - -// ctor & dtor -// ----------- - -wxMenuItem::wxMenuItem(wxMenu *pParentMenu, int id, - const wxString& strName, const wxString& strHelp, - bool bCheckable, - wxMenu *pSubMenu) : - m_bCheckable(bCheckable), - m_strName(strName), - m_strHelp(strHelp) -{ - wxASSERT( pParentMenu != NULL ); - - m_pParentMenu = pParentMenu; - m_pSubMenu = pSubMenu; - m_idItem = id; - m_bEnabled = TRUE; -} - -wxMenuItem::~wxMenuItem() -{ -} - -// misc -// ---- - -// delete the sub menu -void wxMenuItem::DeleteSubMenu() -{ - wxASSERT( m_pSubMenu != NULL ); - - delete m_pSubMenu; - m_pSubMenu = NULL; -} - -// change item state -// ----------------- - -void wxMenuItem::Enable(bool bDoEnable) -{ - if ( m_bEnabled != bDoEnable ) { - if ( m_pSubMenu == NULL ) { // normal menu item - // TODO - } - else // submenu - { - // TODO - } - - m_bEnabled = bDoEnable; - } -} - -void wxMenuItem::Check(bool bDoCheck) -{ - wxCHECK_RET( IsCheckable(), "only checkable items may be checked" ); - - if ( m_bChecked != bDoCheck ) { - // TODO - m_bChecked = bDoCheck; - } diff --git a/src/stubs/metafile.cpp b/src/stubs/metafile.cpp deleted file mode 100644 index 4c5d6ac137..0000000000 --- a/src/stubs/metafile.cpp +++ /dev/null @@ -1,237 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: metafile.cpp -// Purpose: wxMetaFile, wxMetaFileDC etc. These classes are optional. -// Author: AUTHOR -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "metafile.h" -#endif - -#include "wx/object.h" -#include "wx/string.h" -#include "wx/dc.h" -#include "wx/stubs/metafile.h" -#include "wx/clipbrd.h" - -extern bool wxClipboardIsOpen; - -IMPLEMENT_DYNAMIC_CLASS(wxMetaFile, wxObject) -IMPLEMENT_ABSTRACT_CLASS(wxMetaFileDC, wxDC) - -wxMetaFile::wxMetaFile(const wxString& file) -{ - // TODO -} - -wxMetaFile::~wxMetaFile() -{ - // TODO -} - -bool wxMetaFile::SetClipboard(int width, int height) -{ - bool alreadyOpen=wxClipboardOpen(); - if (!alreadyOpen) - { - wxOpenClipboard(); - if (!wxEmptyClipboard()) return FALSE; - } - bool success = wxSetClipboardData(wxDF_METAFILE,this, width,height); - if (!alreadyOpen) wxCloseClipboard(); - return (bool) success; -} - -bool wxMetaFile::Play(wxDC *dc) -{ - // TODO - return FALSE; -} - -/* - * Metafile device context - * - */ - -// Original constructor that does not takes origin and extent. If you use this, -// *DO* give origin/extent arguments to wxMakeMetaFilePlaceable. -wxMetaFileDC::wxMetaFileDC(const wxString& file) -{ - // TODO -} - -// New constructor that takes origin and extent. If you use this, don't -// give origin/extent arguments to wxMakeMetaFilePlaceable. -wxMetaFileDC::wxMetaFileDC(const wxString& file, int xext, int yext, int xorg, int yorg) -{ - // TODO -} - -wxMetaFileDC::~wxMetaFileDC() -{ -} - -void wxMetaFileDC::GetTextExtent(const wxString& string, float *x, float *y, - float *descent, float *externalLeading, wxFont *theFont, bool use16bit) -{ - // TODO -} - -wxMetaFile *wxMetaFileDC::Close() -{ - // TODO - return NULL; -} - -void wxMetaFileDC::SetMapMode(int mode) -{ - // TODO -} - -#if 0 - -#ifdef __WIN32__ -struct RECT32 -{ - short left; - short top; - short right; - short bottom; -}; - -struct mfPLACEABLEHEADER { - DWORD key; - short hmf; - RECT32 bbox; - WORD inch; - DWORD reserved; - WORD checksum; -}; -#else -struct mfPLACEABLEHEADER { - DWORD key; - HANDLE hmf; - RECT bbox; - WORD inch; - DWORD reserved; - WORD checksum; -}; -#endif - -/* - * 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. - * - */ - -bool wxMakeMetaFilePlaceable(const wxString& filename, float scale) -{ - return wxMakeMetaFilePlaceable(filename, 0, 0, 0, 0, scale, FALSE); -} - -bool wxMakeMetaFilePlaceable(const wxString& filename, int x1, int y1, int x2, int y2, float scale, bool useOriginAndExtent) -{ - // I'm not sure if this is the correct way of suggesting a scale - // to the client application, but it's the only way I can find. - int unitsPerInch = (int)(576/scale); - - mfPLACEABLEHEADER header; - header.key = 0x9AC6CDD7L; - header.hmf = 0; - header.bbox.left = (int)(x1); - header.bbox.top = (int)(y1); - header.bbox.right = (int)(x2); - header.bbox.bottom = (int)(y2); - header.inch = unitsPerInch; - header.reserved = 0; - - // Calculate checksum - WORD *p; - mfPLACEABLEHEADER *pMFHead = &header; - for (p =(WORD *)pMFHead,pMFHead -> checksum = 0; - p < (WORD *)&pMFHead ->checksum; ++p) - pMFHead ->checksum ^= *p; - - FILE *fd = fopen((char *)(const char *)filename, "rb"); - if (!fd) return FALSE; - - char tempFileBuf[256]; - wxGetTempFileName("mf", tempFileBuf); - FILE *fHandle = fopen(tempFileBuf, "wb"); - if (!fHandle) - return FALSE; - fwrite((void *)&header, sizeof(unsigned char), sizeof(mfPLACEABLEHEADER), fHandle); - - // Calculate origin and extent - int originX = x1; - int originY = y1; - int extentX = x2 - x1; - int extentY = (y2 - y1); - - // Read metafile header and write - METAHEADER metaHeader; - fread((void *)&metaHeader, sizeof(unsigned char), sizeof(metaHeader), fd); - - if (useOriginAndExtent) - metaHeader.mtSize += 15; - else - metaHeader.mtSize += 5; - - fwrite((void *)&metaHeader, sizeof(unsigned char), sizeof(metaHeader), fHandle); - - // Write SetMapMode, SetWindowOrigin and SetWindowExt records - char modeBuffer[8]; - char originBuffer[10]; - char extentBuffer[10]; - METARECORD *modeRecord = (METARECORD *)&modeBuffer; - - METARECORD *originRecord = (METARECORD *)&originBuffer; - METARECORD *extentRecord = (METARECORD *)&extentBuffer; - - modeRecord->rdSize = 4; - modeRecord->rdFunction = META_SETMAPMODE; - modeRecord->rdParm[0] = MM_ANISOTROPIC; - - originRecord->rdSize = 5; - originRecord->rdFunction = META_SETWINDOWORG; - originRecord->rdParm[0] = originY; - originRecord->rdParm[1] = originX; - - extentRecord->rdSize = 5; - extentRecord->rdFunction = META_SETWINDOWEXT; - extentRecord->rdParm[0] = extentY; - extentRecord->rdParm[1] = extentX; - - fwrite((void *)modeBuffer, sizeof(char), 8, fHandle); - - if (useOriginAndExtent) - { - fwrite((void *)originBuffer, sizeof(char), 10, fHandle); - fwrite((void *)extentBuffer, sizeof(char), 10, fHandle); - } - - int ch = -2; - while (ch != EOF) - { - ch = getc(fd); - if (ch != EOF) - { - putc(ch, fHandle); - } - } - fclose(fHandle); - fclose(fd); - wxRemoveFile(filename); - wxCopyFile(tempFileBuf, filename); - wxRemoveFile(tempFileBuf); - return TRUE; -} - -#endif - diff --git a/src/stubs/minifram.cpp b/src/stubs/minifram.cpp deleted file mode 100644 index cbe09b7d81..0000000000 --- a/src/stubs/minifram.cpp +++ /dev/null @@ -1,20 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: minifram.cpp -// Purpose: wxMiniFrame. Optional; identical to wxFrame if not supported. -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "minifram.h" -#endif - -#include "wx/minifram.h" - -IMPLEMENT_DYNAMIC_CLASS(wxMiniFrame, wxFrame) - - diff --git a/src/stubs/msgdlg.cpp b/src/stubs/msgdlg.cpp deleted file mode 100644 index 11831c3c34..0000000000 --- a/src/stubs/msgdlg.cpp +++ /dev/null @@ -1,34 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: msgdlg.cpp -// Purpose: wxMessageDialog -// Author: AUTHOR -// Modified by: -// Created: 04/01/98 -// RCS-ID: $$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "msgdlg.h" -#endif - -#include "wx/stubs/msgdlg.h" - -IMPLEMENT_CLASS(wxMessageDialog, wxDialog) - -wxMessageDialog::wxMessageDialog(wxWindow *parent, const wxString& message, const wxString& caption, - long style, const wxPoint& pos) -{ - m_caption = caption; - m_message = message; - m_dialogStyle = style; - m_parent = parent; -} - -int wxMessageDialog::ShowModal() -{ - // TODO - return wxID_CANCEL; -} - diff --git a/src/stubs/notebook.cpp b/src/stubs/notebook.cpp deleted file mode 100644 index 9ac9c0bf4a..0000000000 --- a/src/stubs/notebook.cpp +++ /dev/null @@ -1,380 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: notebook.cpp -// Purpose: implementation of wxNotebook -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- -#ifdef __GNUG__ -#pragma implementation "notebook.h" -#endif - -#include -#include -#include -#include - -// ---------------------------------------------------------------------------- -// macros -// ---------------------------------------------------------------------------- - -// check that the page index is valid -#define IS_VALID_PAGE(nPage) (((nPage) >= 0) && ((nPage) < GetPageCount())) - -// ---------------------------------------------------------------------------- -// event table -// ---------------------------------------------------------------------------- - -BEGIN_EVENT_TABLE(wxNotebook, wxControl) - EVT_NOTEBOOK_PAGE_CHANGED(-1, wxNotebook::OnSelChange) - - EVT_SIZE(wxNotebook::OnSize) - EVT_SET_FOCUS(wxNotebook::OnSetFocus) - EVT_NAVIGATION_KEY(wxNotebook::OnNavigationKey) -END_EVENT_TABLE() - -IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxControl) -IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxCommandEvent) - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxNotebook construction -// ---------------------------------------------------------------------------- - -// common part of all ctors -void wxNotebook::Init() -{ - m_pImageList = NULL; - m_nSelection = -1; -} - -// default for dynamic class -wxNotebook::wxNotebook() -{ - Init(); -} - -// the same arguments as for wxControl -wxNotebook::wxNotebook(wxWindow *parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - Init(); - - Create(parent, id, pos, size, style, name); -} - -// Create() function -bool wxNotebook::Create(wxWindow *parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - // base init - SetName(name); - SetParent(parent); - - m_windowId = id == -1 ? NewControlId() : id; - - // style - m_windowStyle = style; - - if ( parent != NULL ) - parent->AddChild(this); - - // TODO - - return FALSE; -} - -// dtor -wxNotebook::~wxNotebook() -{ -} - -// ---------------------------------------------------------------------------- -// wxNotebook accessors -// ---------------------------------------------------------------------------- -int wxNotebook::GetPageCount() const -{ - return m_aPages.Count(); -} - -int wxNotebook::GetRowCount() const -{ - // TODO - return 0; -} - -int wxNotebook::SetSelection(int nPage) -{ - wxASSERT( IS_VALID_PAGE(nPage) ); - - ChangePage(m_nSelection, nPage); - - // TODO - return 0; -} - -void wxNotebook::AdvanceSelection(bool bForward) -{ - int nSel = GetSelection(); - int nMax = GetPageCount() - 1; - if ( bForward ) - SetSelection(nSel == nMax ? 0 : nSel + 1); - else - SetSelection(nSel == 0 ? nMax : nSel - 1); -} - -bool wxNotebook::SetPageText(int nPage, const wxString& strText) -{ - wxASSERT( IS_VALID_PAGE(nPage) ); - - // TODO - return FALSE; -} - -wxString wxNotebook::GetPageText(int nPage) const -{ - wxASSERT( IS_VALID_PAGE(nPage) ); - - // TODO - return wxString(""); -} - -int wxNotebook::GetPageImage(int nPage) const -{ - wxASSERT( IS_VALID_PAGE(nPage) ); - - // TODO - return 0; -} - -bool wxNotebook::SetPageImage(int nPage, int nImage) -{ - wxASSERT( IS_VALID_PAGE(nPage) ); - - // TODO - return FALSE; -} - -void wxNotebook::SetImageList(wxImageList* imageList) -{ - m_pImageList = imageList; - // TODO -} - -// ---------------------------------------------------------------------------- -// wxNotebook operations -// ---------------------------------------------------------------------------- - -// remove one page from the notebook -bool wxNotebook::DeletePage(int nPage) -{ - wxCHECK( IS_VALID_PAGE(nPage), FALSE ); - - // TODO: delete native widget page - - delete m_aPages[nPage]; - m_aPages.Remove(nPage); - - return TRUE; -} - -// remove one page from the notebook, without deleting the window -bool wxNotebook::RemovePage(int nPage) -{ - wxCHECK( IS_VALID_PAGE(nPage), FALSE ); - - m_aPages.Remove(nPage); - - return TRUE; -} - -// remove all pages -bool wxNotebook::DeleteAllPages() -{ - // TODO: delete native widget pages - - int nPageCount = GetPageCount(); - int nPage; - for ( nPage = 0; nPage < nPageCount; nPage++ ) - delete m_aPages[nPage]; - - m_aPages.Clear(); - - return TRUE; -} - -// add a page to the notebook -bool wxNotebook::AddPage(wxNotebookPage *pPage, - const wxString& strText, - bool bSelect, - int imageId) -{ - return InsertPage(GetPageCount(), pPage, strText, bSelect, imageId); -} - -// same as AddPage() but does it at given position -bool wxNotebook::InsertPage(int nPage, - wxNotebookPage *pPage, - const wxString& strText, - bool bSelect, - int imageId) -{ - wxASSERT( pPage != NULL ); - wxCHECK( IS_VALID_PAGE(nPage) || nPage == GetPageCount(), FALSE ); - - // TODO: insert native widget page - - // save the pointer to the page - m_aPages.Insert(pPage, nPage); - - // some page must be selected: either this one or the first one if there is - // still no selection - if ( bSelect ) - m_nSelection = nPage; - else if ( m_nSelection == -1 ) - m_nSelection = 0; - - return TRUE; -} - -// ---------------------------------------------------------------------------- -// wxNotebook callbacks -// ---------------------------------------------------------------------------- - -// @@@ OnSize() is used for setting the font when it's called for the first -// time because doing it in ::Create() doesn't work (for unknown reasons) -void wxNotebook::OnSize(wxSizeEvent& event) -{ - static bool s_bFirstTime = TRUE; - if ( s_bFirstTime ) { - // TODO: any first-time-size processing. - s_bFirstTime = FALSE; - } - - // TODO: all this may or may not be necessary for your platform - - // emulate page change (it's esp. important to do it first time because - // otherwise our page would stay invisible) - int nSel = m_nSelection; - m_nSelection = -1; - SetSelection(nSel); - - // fit the notebook page to the tab control's display area - int w, h; - GetSize(&w, &h); - - unsigned int nCount = m_aPages.Count(); - for ( unsigned int nPage = 0; nPage < nCount; nPage++ ) { - wxNotebookPage *pPage = m_aPages[nPage]; - pPage->SetSize(0, 0, w, h); - if ( pPage->GetAutoLayout() ) - pPage->Layout(); - } - - // Processing continues to next OnSize - event.Skip(); -} - -void wxNotebook::OnSelChange(wxNotebookEvent& event) -{ - // is it our tab control? - if ( event.GetEventObject() == this ) - ChangePage(event.GetOldSelection(), event.GetSelection()); - - // we want to give others a chance to process this message as well - event.Skip(); -} - -void wxNotebook::OnSetFocus(wxFocusEvent& event) -{ - // set focus to the currently selected page if any - if ( m_nSelection != -1 ) - m_aPages[m_nSelection]->SetFocus(); - - event.Skip(); -} - -void wxNotebook::OnNavigationKey(wxNavigationKeyEvent& event) -{ - if ( event.IsWindowChange() ) { - // change pages - AdvanceSelection(event.GetDirection()); - } - else { - // pass to the parent - if ( GetParent() ) { - event.SetCurrentFocus(this); - GetParent()->ProcessEvent(event); - } - } -} - -// ---------------------------------------------------------------------------- -// wxNotebook base class virtuals -// ---------------------------------------------------------------------------- - -// override these 2 functions to do nothing: everything is done in OnSize - -void wxNotebook::SetConstraintSizes(bool /* recurse */) -{ - // don't set the sizes of the pages - their correct size is not yet known - wxControl::SetConstraintSizes(FALSE); -} - -bool wxNotebook::DoPhase(int /* nPhase */) -{ - return TRUE; -} - -void wxNotebook::Command(wxCommandEvent& event) -{ - wxFAIL_MSG("wxNotebook::Command not implemented"); -} - -// ---------------------------------------------------------------------------- -// wxNotebook helper functions -// ---------------------------------------------------------------------------- - -// hide the currently active panel and show the new one -void wxNotebook::ChangePage(int nOldSel, int nSel) -{ - wxASSERT( nOldSel != nSel ); // impossible - - if ( nOldSel != -1 ) { - m_aPages[nOldSel]->Show(FALSE); - } - - wxNotebookPage *pPage = m_aPages[nSel]; - pPage->Show(TRUE); - pPage->SetFocus(); - - m_nSelection = nSel; -} - -void wxNotebook::SetTabSize(const wxSize& sz) -{ - // TODO -} - diff --git a/src/stubs/palette.cpp b/src/stubs/palette.cpp deleted file mode 100644 index 44ae8cc9e3..0000000000 --- a/src/stubs/palette.cpp +++ /dev/null @@ -1,80 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: palette.cpp -// Purpose: wxPalette -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "palette.h" -#endif - -#include "wx/palette.h" - -IMPLEMENT_DYNAMIC_CLASS(wxPalette, wxGDIObject) - -/* - * Palette - * - */ - -wxPaletteRefData::wxPaletteRefData() -{ - // TODO -} - -wxPaletteRefData::~wxPaletteRefData() -{ - // TODO -} - -wxPalette::wxPalette() -{ -} - -wxPalette::wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue) -{ - Create(n, red, green, blue); -} - -wxPalette::~wxPalette() -{ -} - -bool wxPalette::Create(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue) -{ - UnRef(); - - m_refData = new wxPaletteRefData; - - // TODO - - return FALSE; -} - -int wxPalette::GetPixel(const unsigned char red, const unsigned char green, const unsigned char blue) const -{ - if ( !m_refData ) - return FALSE; - - // TODO - return FALSE; -} - -bool wxPalette::GetRGB(int index, unsigned char *red, unsigned char *green, unsigned char *blue) const -{ - if ( !m_refData ) - return FALSE; - - if (index < 0 || index > 255) - return FALSE; - - // TODO - return FALSE; -} - - diff --git a/src/stubs/pen.cpp b/src/stubs/pen.cpp deleted file mode 100644 index ff76f284a4..0000000000 --- a/src/stubs/pen.cpp +++ /dev/null @@ -1,200 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: pen.cpp -// Purpose: wxPen -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "pen.h" -#endif - -#include "wx/setup.h" -#include "wx/utils.h" -#include "wx/pen.h" - -IMPLEMENT_DYNAMIC_CLASS(wxPen, wxGDIObject) - -wxPenRefData::wxPenRefData() -{ - m_style = wxSOLID; - m_width = 1; - m_join = wxJOIN_ROUND ; - m_cap = wxCAP_ROUND ; - m_nbDash = 0 ; - m_dash = (wxXSTUBXDash*)NULL; -/* TODO: null data - m_hPen = 0; -*/ -} - -wxPenRefData::wxPenRefData(const wxPenRefData& data) -{ - m_style = data.m_style; - m_width = data.m_width; - m_join = data.m_join; - m_cap = data.m_cap; - m_nbDash = data.m_nbDash; - m_dash = data.m_dash; - m_colour = data.m_colour; -/* TODO: null data - m_hPen = 0; -*/ -} - -wxPenRefData::~wxPenRefData() -{ - // TODO: delete data -} - -// Pens - -wxPen::wxPen() -{ - if ( wxThePenList ) - wxThePenList->AddPen(this); -} - -wxPen::~wxPen() -{ - if (wxThePenList) - wxThePenList->RemovePen(this); -} - -// Should implement Create -wxPen::wxPen(const wxColour& col, int Width, int Style) -{ - m_refData = new wxPenRefData; - - M_PENDATA->m_colour = col; - M_PENDATA->m_width = Width; - M_PENDATA->m_style = Style; - M_PENDATA->m_join = wxJOIN_ROUND ; - M_PENDATA->m_cap = wxCAP_ROUND ; - M_PENDATA->m_nbDash = 0 ; - M_PENDATA->m_dash = (wxXSTUBXDash*)NULL; - - RealizeResource(); - - if ( wxThePenList ) - wxThePenList->AddPen(this); -} - -wxPen::wxPen(const wxBitmap& stipple, int Width) -{ - m_refData = new wxPenRefData; - - M_PENDATA->m_stipple = stipple; - M_PENDATA->m_width = Width; - M_PENDATA->m_style = wxSTIPPLE; - M_PENDATA->m_join = wxJOIN_ROUND ; - M_PENDATA->m_cap = wxCAP_ROUND ; - M_PENDATA->m_nbDash = 0 ; - M_PENDATA->m_dash = (wxXSTUBXDash*)NULL; - - RealizeResource(); - - if ( wxThePenList ) - wxThePenList->AddPen(this); -} - -void wxPen::Unshare() -{ - // Don't change shared data - if (!m_refData) - { - m_refData = new wxPenRefData(); - } - else - { - wxPenRefData* ref = new wxPenRefData(*(wxPenRefData*)m_refData); - UnRef(); - m_refData = ref; - } -} - -void wxPen::SetColour(const wxColour& col) -{ - Unshare(); - - M_PENDATA->m_colour = col; - - RealizeResource(); -} - -void wxPen::SetColour(unsigned char r, unsigned char g, unsigned char b) -{ - Unshare(); - - M_PENDATA->m_colour.Set(r, g, b); - - RealizeResource(); -} - -void wxPen::SetWidth(int Width) -{ - Unshare(); - - M_PENDATA->m_width = Width; - - RealizeResource(); -} - -void wxPen::SetStyle(int Style) -{ - Unshare(); - - M_PENDATA->m_style = Style; - - RealizeResource(); -} - -void wxPen::SetStipple(const wxBitmap& Stipple) -{ - Unshare(); - - M_PENDATA->m_stipple = Stipple; - M_PENDATA->m_style = wxSTIPPLE; - - RealizeResource(); -} - -void wxPen::SetDashes(int nb_dashes, const wxDash *Dash) -{ - Unshare(); - - M_PENDATA->m_nbDash = nb_dashes; - M_PENDATA->m_dash = (wxXSTUBXDash*)Dash; - - RealizeResource(); -} - -void wxPen::SetJoin(int Join) -{ - Unshare(); - - M_PENDATA->m_join = Join; - - RealizeResource(); -} - -void wxPen::SetCap(int Cap) -{ - Unshare(); - - M_PENDATA->m_cap = Cap; - - RealizeResource(); -} - -bool wxPen::RealizeResource() -{ - // TODO: create actual pen - return FALSE; -} - - diff --git a/src/stubs/print.cpp b/src/stubs/print.cpp deleted file mode 100644 index d694aadd4f..0000000000 --- a/src/stubs/print.cpp +++ /dev/null @@ -1,80 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: print.cpp -// Purpose: Print framework -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "print.h" -#endif - -#include "wx/stubs/print.h" -#include "wx/stubs/printdlg.h" - -IMPLEMENT_DYNAMIC_CLASS(wxPrinter, wxPrinterBase) -IMPLEMENT_CLASS(wxPrintPreview, wxPrintPreviewBase) - -/* - * Printer - */ - -wxPrinter::wxPrinter(wxPrintData *data): - wxPrinterBase(data) -{ -} - -wxPrinter::~wxPrinter() -{ -} - -bool wxPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt) -{ - // TODO. See wxPostScriptPrinter::Print for hints. - return FALSE; -} - -bool wxPrinter::PrintDialog(wxWindow *parent) -{ - wxPrintDialog dialog(parent, & m_printData); - return (dialog.ShowModal() == wxID_OK); -} - -bool wxPrinter::Setup(wxWindow *parent) -{ - wxPrintDialog dialog(parent, & m_printData); - dialog.GetPrintData().SetSetupDialog(TRUE); - return (dialog.ShowModal() == wxID_OK); -} - -/* - * Print preview - */ - -wxPrintPreview::wxPrintPreview(wxPrintout *printout, wxPrintout *printoutForPrinting, wxPrintData *data): - wxPrintPreviewBase(printout, printoutForPrinting, data) -{ - DetermineScaling(); -} - -wxPrintPreview::~wxPrintPreview() -{ -} - -bool wxPrintPreview::Print(bool interactive) -{ - if (!m_printPrintout) - return FALSE; - wxPrinter printer(&m_printData); - return printer.Print(m_previewFrame, m_printPrintout, interactive); -} - -void wxPrintPreview::DetermineScaling() -{ - // TODO -} - diff --git a/src/stubs/printdlg.cpp b/src/stubs/printdlg.cpp deleted file mode 100644 index c6438e083c..0000000000 --- a/src/stubs/printdlg.cpp +++ /dev/null @@ -1,113 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: printdlg.cpp -// Purpose: wxPrintDialog, wxPageSetupDialog -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "printdlg.h" -#endif - -#include "wx/object.h" -#include "wx/stubs/printdlg.h" -#include "wx/dcprint.h" - -// Use generic page setup dialog: use your own native one if one exists. -#include "wx/generic/prntdlgg.h" - -IMPLEMENT_DYNAMIC_CLASS(wxPrintDialog, wxDialog) -IMPLEMENT_CLASS(wxPageSetupDialog, wxDialog) - -wxPrintDialog::wxPrintDialog(): - wxDialog() -{ - m_dialogParent = NULL; - m_printerDC = NULL; -} - -wxPrintDialog::wxPrintDialog(wxWindow *p, wxPrintData* data): - wxDialog() -{ - Create(p, data); -} - -bool wxPrintDialog::Create(wxWindow *p, wxPrintData* data) -{ - m_dialogParent = p; - m_printerDC = NULL; - - if ( data ) - m_printData = *data; - - return TRUE; -} - -wxPrintDialog::~wxPrintDialog() -{ - if (m_printerDC) - delete m_printerDC; -} - -int wxPrintDialog::ShowModal() -{ - // TODO - return wxID_CANCEL; -} - -wxDC *wxPrintDialog::GetPrintDC() -{ - if (m_printerDC) - { - wxDC* dc = m_printerDC; - m_printerDC = NULL; - return dc; - } - else - return NULL; -} - -/* - * wxPageSetupDialog - */ - -wxPageSetupDialog::wxPageSetupDialog(): - wxDialog() -{ - m_dialogParent = NULL; -} - -wxPageSetupDialog::wxPageSetupDialog(wxWindow *p, wxPageSetupData *data): - wxDialog() -{ - Create(p, data); -} - -bool wxPageSetupDialog::Create(wxWindow *p, wxPageSetupData *data) -{ - m_dialogParent = p; - - if (data) - m_pageSetupData = (*data); - - return TRUE; -} - -wxPageSetupDialog::~wxPageSetupDialog() -{ -} - -int wxPageSetupDialog::ShowModal() -{ - // Uses generic page setup dialog - wxGenericPageSetupDialog *genericPageSetupDialog = new wxGenericPageSetupDialog(GetParent(), & m_pageSetupData); - int ret = genericPageSetupDialog->ShowModal(); - m_pageSetupData = genericPageSetupDialog->GetPageSetupData(); - genericPageSetupDialog->Close(TRUE); - return ret; -} - diff --git a/src/stubs/radiobox.cpp b/src/stubs/radiobox.cpp deleted file mode 100644 index a3ecae6d01..0000000000 --- a/src/stubs/radiobox.cpp +++ /dev/null @@ -1,192 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: radiobox.cpp -// Purpose: wxRadioBox -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "radiobox.h" -#endif - -#include "wx/radiobox.h" - -IMPLEMENT_DYNAMIC_CLASS(wxRadioBox, wxControl) - -// Radio box item -wxRadioBox::wxRadioBox() -{ - m_selectedButton = -1; - m_noItems = 0; - m_noRowsOrCols = 0; - m_majorDim = 0 ; -} - -bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& title, - const wxPoint& pos, const wxSize& size, - int n, const wxString choices[], - int majorDim, long style, - const wxValidator& val, const wxString& name) -{ - m_selectedButton = -1; - m_noItems = n; - - SetName(name); - SetValidator(val); - - parent->AddChild(this); - - m_windowStyle = (long&)style; - - if (id == -1) - m_windowId = NewControlId(); - else - m_windowId = id; - - m_noRowsOrCols = majorDim; - - if (majorDim==0) - m_majorDim = n ; - else - m_majorDim = majorDim ; - - - // TODO create radiobox - return FALSE; -} - - -wxRadioBox::~wxRadioBox() -{ - // TODO -} - -wxString wxRadioBox::GetLabel(int item) const -{ - // TODO - return wxString(""); -} - -void wxRadioBox::SetLabel(int item, const wxString& label) -{ - // TODO -} - -int wxRadioBox::FindString(const wxString& s) const -{ - // TODO - return -1; -} - -void wxRadioBox::SetSelection(int n) -{ - if ((n < 0) || (n >= m_noItems)) - return; - // TODO - - m_selectedButton = n; -} - -// Get single selection, for single choice list items -int wxRadioBox::GetSelection() const -{ - return m_selectedButton; -} - -// Find string for position -wxString wxRadioBox::GetString(int n) const -{ - // TODO - return wxString(""); -} - -void wxRadioBox::SetSize(int x, int y, int width, int height, int sizeFlags) -{ - // TODO -} - -void wxRadioBox::GetSize(int *width, int *height) const -{ - // TODO -} - -void wxRadioBox::GetPosition(int *x, int *y) const -{ - // TODO -} - -wxString wxRadioBox::GetLabel() const -{ - // TODO - return wxString(""); -} - -void wxRadioBox::SetLabel(const wxString& label) -{ - // TODO -} - -void wxRadioBox::SetFocus() -{ - // TODO -} - -bool wxRadioBox::Show(bool show) -{ - // TODO - return FALSE; -} - -// Enable a specific button -void wxRadioBox::Enable(int item, bool enable) -{ - // TODO -} - -// Enable all controls -void wxRadioBox::Enable(bool enable) -{ - wxControl::Enable(enable); - - // TODO -} - -// Show a specific button -void wxRadioBox::Show(int item, bool show) -{ - // TODO -} - -// For single selection items only -wxString wxRadioBox::GetStringSelection () const -{ - int sel = GetSelection (); - if (sel > -1) - return this->GetString (sel); - else - return wxString(""); -} - -bool wxRadioBox::SetStringSelection (const wxString& s) -{ - int sel = FindString (s); - if (sel > -1) - { - SetSelection (sel); - return TRUE; - } - else - return FALSE; -} - -void wxRadioBox::Command (wxCommandEvent & event) -{ - SetSelection (event.m_commandInt); - ProcessCommand (event); -} - - diff --git a/src/stubs/radiobut.cpp b/src/stubs/radiobut.cpp deleted file mode 100644 index 3fd6d78d2d..0000000000 --- a/src/stubs/radiobut.cpp +++ /dev/null @@ -1,66 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: radiobut.cpp -// Purpose: wxRadioButton -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "radiobut.h" -#endif - -#include "wx/radiobut.h" - -IMPLEMENT_DYNAMIC_CLASS(wxRadioButton, wxControl) - -bool wxRadioButton::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); - - if (parent) parent->AddChild(this); - - if ( id == -1 ) - m_windowId = (int)NewControlId(); - else - m_windowId = id; - - m_windowStyle = style ; - - // TODO create radiobutton - return FALSE; -} - -void wxRadioButton::SetLabel(const wxString& label) -{ - // TODO -} - -void wxRadioButton::SetValue(bool value) -{ - // TODO -} - -// Get single selection, for single choice list items -bool wxRadioButton::GetValue() const -{ - // TODO - return FALSE; -} - -void wxRadioButton::Command (wxCommandEvent & event) -{ - SetValue ( (event.m_commandInt != 0) ); - ProcessCommand (event); -} - - diff --git a/src/stubs/region.cpp b/src/stubs/region.cpp deleted file mode 100644 index 85aea95133..0000000000 --- a/src/stubs/region.cpp +++ /dev/null @@ -1,361 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// File: region.cpp -// Purpose: Region class -// Author: Markus Holzem/Julian Smart/AUTHOR -// Created: Fri Oct 24 10:46:34 MET 1997 -// RCS-ID: $Id$ -// Copyright: (c) 1997 Markus Holzem/Julian Smart/AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "region.h" -#endif - -#include "wx/region.h" -#include "wx/gdicmn.h" - - IMPLEMENT_DYNAMIC_CLASS(wxRegion, wxGDIObject) - IMPLEMENT_DYNAMIC_CLASS(wxRegionIterator, wxObject) - -//----------------------------------------------------------------------------- -// wxRegionRefData implementation -//----------------------------------------------------------------------------- - -class WXDLLEXPORT wxRegionRefData : public wxGDIRefData { -public: - wxRegionRefData() - { - } - - wxRegionRefData(const wxRegionRefData& data) - { - // TODO - } - - ~wxRegionRefData() - { - // TODO - } -}; - - -//----------------------------------------------------------------------------- -// wxRegion -//----------------------------------------------------------------------------- - -/*! - * Create an empty region. - */ -wxRegion::wxRegion() -{ - m_refData = new wxRegionRefData; - // TODO create empty region -} - -wxRegion::wxRegion(long x, long y, long w, long h) -{ - m_refData = new wxRegionRefData; - // TODO create rect region -} - -wxRegion::wxRegion(const wxPoint& topLeft, const wxPoint& bottomRight) -{ - m_refData = new wxRegionRefData; - // TODO create rect region -} - -wxRegion::wxRegion(const wxRect& rect) -{ - m_refData = new wxRegionRefData; - // TODO create rect region -} - -/*! - * Destroy the region. - */ -wxRegion::~wxRegion() -{ - // m_refData unrefed in ~wxObject -} - -//----------------------------------------------------------------------------- -//# Modify region -//----------------------------------------------------------------------------- - -//! Clear current region -void wxRegion::Clear() -{ - UnRef(); -} - -//! Combine rectangle (x, y, w, h) with this. -bool wxRegion::Combine(long x, long y, long width, long height, wxRegionOp op) -{ - // Don't change shared data - if (!m_refData) { - m_refData = new wxRegionRefData(); - } else if (m_refData->GetRefCount() > 1) { - wxRegionRefData* ref = (wxRegionRefData*)m_refData; - UnRef(); - m_refData = new wxRegionRefData(*ref); - } - // If ref count is 1, that means it's 'ours' anyway so no action. - - // TODO create rect region - - int mode = 0; // TODO platform-specific code - switch (op) - { - case wxRGN_AND: - // TODO - break ; - case wxRGN_OR: - // TODO - break ; - case wxRGN_XOR: - // TODO - break ; - case wxRGN_DIFF: - // TODO - break ; - case wxRGN_COPY: - default: - // TODO - break ; - } - - // TODO do combine region - - return FALSE; -} - -//! Union /e region with this. -bool wxRegion::Combine(const wxRegion& region, wxRegionOp op) -{ - if (region.Empty()) - return FALSE; - - // Don't change shared data - if (!m_refData) { - m_refData = new wxRegionRefData(); - } else if (m_refData->GetRefCount() > 1) { - wxRegionRefData* ref = (wxRegionRefData*)m_refData; - UnRef(); - m_refData = new wxRegionRefData(*ref); - } - - int mode = 0; // TODO platform-specific code - switch (op) - { - case wxRGN_AND: - // TODO - break ; - case wxRGN_OR: - // TODO - break ; - case wxRGN_XOR: - // TODO - break ; - case wxRGN_DIFF: - // TODO - break ; - case wxRGN_COPY: - default: - // TODO - break ; - } - - // TODO combine region - - return FALSE; -} - -bool wxRegion::Combine(const wxRect& rect, wxRegionOp op) -{ - return Combine(rect.GetLeft(), rect.GetTop(), rect.GetWidth(), rect.GetHeight(), op); -} - -//----------------------------------------------------------------------------- -//# Information on region -//----------------------------------------------------------------------------- - -// Outer bounds of region -void wxRegion::GetBox(long& x, long& y, long&w, long &h) const -{ - if (m_refData) { - // TODO get box - } else { - x = y = w = h = 0; - } -} - -wxRect wxRegion::GetBox() const -{ - long x, y, w, h; - GetBox(x, y, w, h); - return wxRect(x, y, w, h); -} - -// Is region empty? -bool wxRegion::Empty() const -{ - // TODO - return FALSE; -} - -//----------------------------------------------------------------------------- -//# Tests -//----------------------------------------------------------------------------- - -// Does the region contain the point (x,y)? -wxRegionContain wxRegion::Contains(long x, long y) const -{ - if (!m_refData) - return wxOutRegion; - - // TODO. Return wxInRegion if within region. - if (0) - return wxInRegion; - return wxOutRegion; -} - -// Does the region contain the point pt? -wxRegionContain wxRegion::Contains(const wxPoint& pt) const -{ - if (!m_refData) - return wxOutRegion; - - // TODO. Return wxInRegion if within region. - if (0) - return wxInRegion; - else - return wxOutRegion; -} - -// Does the region contain the rectangle (x, y, w, h)? -wxRegionContain wxRegion::Contains(long x, long y, long w, long h) const -{ - if (!m_refData) - return wxOutRegion; - - // TODO. Return wxInRegion if within region. - if (0) - return wxInRegion; - else - return wxOutRegion; -} - -// Does the region contain the rectangle rect -wxRegionContain wxRegion::Contains(const wxRect& rect) const -{ - if (!m_refData) - return wxOutRegion; - - long x, y, w, h; - x = rect.x; - y = rect.y; - w = rect.GetWidth(); - h = rect.GetHeight(); - return Contains(x, y, w, h); -} - -/////////////////////////////////////////////////////////////////////////////// -// // -// wxRegionIterator // -// // -/////////////////////////////////////////////////////////////////////////////// - -/*! - * Initialize empty iterator - */ -wxRegionIterator::wxRegionIterator() : m_current(0), m_numRects(0), m_rects(NULL) -{ -} - -wxRegionIterator::~wxRegionIterator() -{ - if (m_rects) - delete[] m_rects; -} - -/*! - * Initialize iterator for region - */ -wxRegionIterator::wxRegionIterator(const wxRegion& region) -{ - m_rects = NULL; - - Reset(region); -} - -/*! - * Reset iterator for a new /e region. - */ -void wxRegionIterator::Reset(const wxRegion& region) -{ - m_current = 0; - m_region = region; - - if (m_rects) - delete[] m_rects; - - m_rects = NULL; - - if (m_region.Empty()) - m_numRects = 0; - else - { - // TODO create m_rects and fill with rectangles for this region - m_numRects = 0; - } -} - -/*! - * Increment iterator. The rectangle returned is the one after the - * incrementation. - */ -void wxRegionIterator::operator ++ () -{ - if (m_current < m_numRects) - ++m_current; -} - -/*! - * Increment iterator. The rectangle returned is the one before the - * incrementation. - */ -void wxRegionIterator::operator ++ (int) -{ - if (m_current < m_numRects) - ++m_current; -} - -long wxRegionIterator::GetX() const -{ - if (m_current < m_numRects) - return m_rects[m_current].x; - return 0; -} - -long wxRegionIterator::GetY() const -{ - if (m_current < m_numRects) - return m_rects[m_current].y; - return 0; -} - -long wxRegionIterator::GetW() const -{ - if (m_current < m_numRects) - return m_rects[m_current].width ; - return 0; -} - -long wxRegionIterator::GetH() const -{ - if (m_current < m_numRects) - return m_rects[m_current].height; - return 0; -} - diff --git a/src/stubs/scrolbar.cpp b/src/stubs/scrolbar.cpp deleted file mode 100644 index dca07b3b79..0000000000 --- a/src/stubs/scrolbar.cpp +++ /dev/null @@ -1,76 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: scrolbar.cpp -// Purpose: wxScrollBar -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "scrolbar.h" -#endif - -#include "wx/scrolbar.h" - -IMPLEMENT_DYNAMIC_CLASS(wxScrollBar, wxControl) - - -// Scrollbar -bool wxScrollBar::Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos, - const wxSize& size, long style, - const wxValidator& validator, - const wxString& name) -{ - if (!parent) - return FALSE; - parent->AddChild(this); - SetName(name); - SetValidator(validator); - - m_windowStyle = style; - - if ( id == -1 ) - m_windowId = (int)NewControlId(); - else - m_windowId = id; - - // TODO create scrollbar - return TRUE; -} - -wxScrollBar::~wxScrollBar() -{ -} - -void wxScrollBar::SetThumbPosition(int viewStart) -{ - // TODO -} - -int wxScrollBar::GetThumbPosition() const -{ - // TODO - return 0; -} - -void wxScrollBar::SetScrollbar(int position, int thumbSize, int range, int pageSize, - bool refresh) -{ - m_viewSize = pageSize; - m_pageSize = thumbSize; - m_objectSize = range; - - // TODO -} - - -void wxScrollBar::Command(wxCommandEvent& event) -{ - SetThumbPosition(event.m_commandInt); - ProcessCommand(event); -} - diff --git a/src/stubs/settings.cpp b/src/stubs/settings.cpp deleted file mode 100644 index 2beda5c2a6..0000000000 --- a/src/stubs/settings.cpp +++ /dev/null @@ -1,176 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: settings.cpp -// Purpose: wxSettings -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "settings.h" -#endif - -#include "wx/settings.h" - -wxColour wxSystemSettings::GetSystemColour(int index) -{ - // TODO - return wxColour(); -} - -wxFont wxSystemSettings::GetSystemFont(int index) -{ - // TODO - switch (index) - { - case wxSYS_DEVICE_DEFAULT_FONT: - { - break; - } - case wxSYS_DEFAULT_PALETTE: - { - break; - } - case wxSYS_SYSTEM_FIXED_FONT: - { - break; - } - case wxSYS_SYSTEM_FONT: - { - break; - } - default: - case wxSYS_DEFAULT_GUI_FONT: - { - break; - } - } - - return wxFont(); -} - -// Get a system metric, e.g. scrollbar size -int wxSystemSettings::GetSystemMetric(int index) -{ - switch ( index) - { - case wxSYS_MOUSE_BUTTONS: - // TODO - return 0; - case wxSYS_BORDER_X: - // TODO - return 0; - case wxSYS_BORDER_Y: - // TODO - return 0; - case wxSYS_CURSOR_X: - // TODO - return 0; - case wxSYS_CURSOR_Y: - // TODO - return 0; - case wxSYS_DCLICK_X: - // TODO - return 0; - case wxSYS_DCLICK_Y: - // TODO - return 0; - case wxSYS_DRAG_X: - // TODO - return 0; - case wxSYS_DRAG_Y: - // TODO - return 0; - case wxSYS_EDGE_X: - // TODO - return 0; - case wxSYS_EDGE_Y: - // TODO - return 0; - case wxSYS_HSCROLL_ARROW_X: - // TODO - return 0; - case wxSYS_HSCROLL_ARROW_Y: - // TODO - return 0; - case wxSYS_HTHUMB_X: - // TODO - return 0; - case wxSYS_ICON_X: - // TODO - return 0; - case wxSYS_ICON_Y: - // TODO - return 0; - case wxSYS_ICONSPACING_X: - // TODO - return 0; - case wxSYS_ICONSPACING_Y: - // TODO - return 0; - case wxSYS_WINDOWMIN_X: - // TODO - return 0; - case wxSYS_WINDOWMIN_Y: - // TODO - return 0; - case wxSYS_SCREEN_X: - // TODO - return 0; - case wxSYS_SCREEN_Y: - // TODO - return 0; - case wxSYS_FRAMESIZE_X: - // TODO - return 0; - case wxSYS_FRAMESIZE_Y: - // TODO - return 0; - case wxSYS_SMALLICON_X: - // TODO - return 0; - case wxSYS_SMALLICON_Y: - // TODO - return 0; - case wxSYS_HSCROLL_Y: - // TODO - return 0; - case wxSYS_VSCROLL_X: - // TODO - return 0; - case wxSYS_VSCROLL_ARROW_X: - // TODO - return 0; - case wxSYS_VSCROLL_ARROW_Y: - // TODO - return 0; - case wxSYS_VTHUMB_Y: - // TODO - return 0; - case wxSYS_CAPTION_Y: - // TODO - return 0; - case wxSYS_MENU_Y: - // TODO - return 0; - case wxSYS_NETWORK_PRESENT: - // TODO - return 0; - case wxSYS_PENWINDOWS_PRESENT: - // TODO - return 0; - case wxSYS_SHOW_SOUNDS: - // TODO - return 0; - case wxSYS_SWAP_BUTTONS: - // TODO - return 0; - default: - return 0; - } - return 0; -} - diff --git a/src/stubs/slider.cpp b/src/stubs/slider.cpp deleted file mode 100644 index 54d33f1a0f..0000000000 --- a/src/stubs/slider.cpp +++ /dev/null @@ -1,188 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: slider.cpp -// Purpose: wxSlider -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "slider.h" -#endif - -#include "wx/slider.h" - -IMPLEMENT_DYNAMIC_CLASS(wxSlider, wxControl) - -BEGIN_EVENT_TABLE(wxSlider, wxControl) -END_EVENT_TABLE() - - - -// Slider -wxSlider::wxSlider() -{ - m_pageSize = 1; - m_lineSize = 1; - m_rangeMax = 0; - m_rangeMin = 0; - m_tickFreq = 0; -} - -bool wxSlider::Create(wxWindow *parent, wxWindowID id, - int value, int minValue, int maxValue, - const wxPoint& pos, - const wxSize& size, long style, - const wxValidator& validator, - const wxString& name) -{ - SetName(name); - SetValidator(validator); - - if (parent) parent->AddChild(this); - - m_lineSize = 1; - m_windowStyle = style; - m_tickFreq = 0; - - if ( id == -1 ) - m_windowId = (int)NewControlId(); - else - m_windowId = id; - - m_rangeMax = maxValue; - m_rangeMin = minValue; - - m_pageSize = (int)((maxValue-minValue)/10); - - // TODO create slider - - return FALSE; -} - -wxSlider::~wxSlider() -{ -} - -int wxSlider::GetValue() const -{ - // TODO - return 0; -} - -void wxSlider::SetValue(int value) -{ - // TODO -} - -void wxSlider::GetSize(int *width, int *height) const -{ - // TODO -} - -void wxSlider::GetPosition(int *x, int *y) const -{ - // TODO -} - -void wxSlider::SetSize(int x, int y, int width, int height, int sizeFlags) -{ - // TODO -} - -void wxSlider::SetRange(int minValue, int maxValue) -{ - m_rangeMin = minValue; - m_rangeMax = maxValue; - - // TODO -} - -// For trackbars only -void wxSlider::SetTickFreq(int n, int pos) -{ - // TODO - m_tickFreq = n; -} - -void wxSlider::SetPageSize(int pageSize) -{ - // TODO - m_pageSize = pageSize; -} - -int wxSlider::GetPageSize() const -{ - return m_pageSize; -} - -void wxSlider::ClearSel() -{ - // TODO -} - -void wxSlider::ClearTicks() -{ - // TODO -} - -void wxSlider::SetLineSize(int lineSize) -{ - m_lineSize = lineSize; - // TODO -} - -int wxSlider::GetLineSize() const -{ - // TODO - return 0; -} - -int wxSlider::GetSelEnd() const -{ - // TODO - return 0; -} - -int wxSlider::GetSelStart() const -{ - // TODO - return 0; -} - -void wxSlider::SetSelection(int minPos, int maxPos) -{ - // TODO -} - -void wxSlider::SetThumbLength(int len) -{ - // TODO -} - -int wxSlider::GetThumbLength() const -{ - // TODO - return 0; -} - -void wxSlider::SetTick(int tickPos) -{ - // TODO -} - -void wxSlider::Command (wxCommandEvent & event) -{ - SetValue (event.GetInt()); - ProcessCommand (event); -} - -bool wxSlider::Show(bool show) -{ - // TODO - return TRUE; -} - diff --git a/src/stubs/spinbutt.cpp b/src/stubs/spinbutt.cpp deleted file mode 100644 index 754b935cfd..0000000000 --- a/src/stubs/spinbutt.cpp +++ /dev/null @@ -1,76 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: spinbutt.cpp -// Purpose: wxSpinButton -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "spinbutt.h" -#endif - -#include "wx/spinbutt.h" - -IMPLEMENT_DYNAMIC_CLASS(wxSpinButton, wxControl) - -wxSpinButton::wxSpinButton() -{ - m_min = 0; - m_max = 100; -} - -bool wxSpinButton::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, - long style, const wxString& name) -{ - SetName(name); - - m_windowStyle = style; - - SetParent(parent); - - m_min = 0; - m_max = 100; - - m_windowId = (id == -1) ? NewControlId() : id; - - // TODO create spin button - return FALSE; -} - -wxSpinButton::~wxSpinButton() -{ -} - -// Attributes -//////////////////////////////////////////////////////////////////////////// - -int wxSpinButton::GetValue() const -{ - // TODO - return 0; -} - -void wxSpinButton::SetValue(int val) -{ - // TODO -} - -void wxSpinButton::SetRange(int minVal, int maxVal) -{ - m_min = minVal; - m_max = maxVal; - // TODO -} - -// Spin event -IMPLEMENT_DYNAMIC_CLASS(wxSpinEvent, wxScrollEvent) - -wxSpinEvent::wxSpinEvent(wxEventType commandType, int id): - wxScrollEvent(commandType, id) -{ -} - diff --git a/src/stubs/statbmp.cpp b/src/stubs/statbmp.cpp deleted file mode 100644 index 115d5cc999..0000000000 --- a/src/stubs/statbmp.cpp +++ /dev/null @@ -1,57 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: statbmp.cpp -// Purpose: wxStaticBitmap -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "statbmp.h" -#endif - -#include "wx/statbmp.h" - -IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap, wxControl) - -/* - * wxStaticBitmap - */ - -bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID id, - const wxBitmap& bitmap, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - m_messageBitmap = bitmap; - SetName(name); - if (parent) parent->AddChild(this); - - if ( id == -1 ) - m_windowId = (int)NewControlId(); - else - m_windowId = id; - - m_windowStyle = style; - - // TODO: create static bitmap control - return FALSE; -} - -void wxStaticBitmap::SetSize(int x, int y, int width, int height, int sizeFlags) -{ - // TODO -} - -void wxStaticBitmap::SetBitmap(const wxBitmap& bitmap) -{ - m_messageBitmap = bitmap; - - // TODO: redraw bitmap -} - diff --git a/src/stubs/statbox.cpp b/src/stubs/statbox.cpp deleted file mode 100644 index 95bfc3b2c4..0000000000 --- a/src/stubs/statbox.cpp +++ /dev/null @@ -1,60 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: statbox.cpp -// Purpose: wxStaticBox -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "statbox.h" -#endif - -#include "wx/statbox.h" - -IMPLEMENT_DYNAMIC_CLASS(wxStaticBox, wxControl) - -BEGIN_EVENT_TABLE(wxStaticBox, wxControl) - EVT_ERASE_BACKGROUND(wxStaticBox::OnEraseBackground) -END_EVENT_TABLE() - - -/* - * Static box - */ - -bool wxStaticBox::Create(wxWindow *parent, wxWindowID id, - const wxString& label, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - SetName(name); - - if (parent) parent->AddChild(this); - - if ( id == -1 ) - m_windowId = (int)NewControlId(); - else - m_windowId = id; - - m_windowStyle = style; - - // TODO: create static box - return FALSE; -} - -void wxStaticBox::SetLabel(const wxString& label) -{ - // TODO -} - -void wxStaticBox::SetSize(int x, int y, int width, int height, int sizeFlags) -{ - // TODO -} - diff --git a/src/stubs/stattext.cpp b/src/stubs/stattext.cpp deleted file mode 100644 index 9de4821b48..0000000000 --- a/src/stubs/stattext.cpp +++ /dev/null @@ -1,58 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: stattext.cpp -// Purpose: wxStaticText -// Author: AUTHOR -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "stattext.h" -#endif - -#include "wx/app.h" -#include "wx/stattext.h" - -#include - -IMPLEMENT_DYNAMIC_CLASS(wxStaticText, wxControl) - -bool wxStaticText::Create(wxWindow *parent, wxWindowID id, - const wxString& label, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - SetName(name); - if (parent) parent->AddChild(this); - - SetBackgroundColour(parent->GetBackgroundColour()) ; - SetForegroundColour(parent->GetForegroundColour()) ; - - if ( id == -1 ) - m_windowId = (int)NewControlId(); - else - m_windowId = id; - - m_windowStyle = style; - - SetFont(parent->GetFont()); - - // TODO - return FALSE; -} - -void wxStaticText::SetSize(int x, int y, int width, int height, int sizeFlags) -{ - // TODO -} - -void wxStaticText::SetLabel(const wxString& label) -{ - // TODO -} - diff --git a/src/stubs/statusbr.cpp b/src/stubs/statusbr.cpp deleted file mode 100644 index 34bdee3ea5..0000000000 --- a/src/stubs/statusbr.cpp +++ /dev/null @@ -1,160 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: statbar.cpp -// Purpose: native implementation of wxStatusBar (optional) -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) 1998 AUTHOR -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "statusbr.h" -#endif - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/stubs/statusbr.h" - -IMPLEMENT_DYNAMIC_CLASS(wxStatusBarXX, wxStatusBar); - -BEGIN_EVENT_TABLE(wxStatusBarXX, wxStatusBar) - EVT_SIZE(wxStatusBarXX::OnSize) -END_EVENT_TABLE() - - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxStatusBarXX class -// ---------------------------------------------------------------------------- - -wxStatusBarXX::wxStatusBarXX() -{ - SetParent(NULL); -} - -wxStatusBarXX::wxStatusBarXX(wxWindow *parent, wxWindowID id, long style) -{ - Create(parent, id, style); -} - -bool wxStatusBarXX::Create(wxWindow *parent, wxWindowID id, long style) -{ - SetParent(parent); - - if (id == -1) - m_windowId = NewControlId(); - else - m_windowId = id; - - // TODO: create status bar - return FALSE; -} - -void wxStatusBarXX::SetFieldsCount(int nFields, const int widths[]) -{ - wxASSERT( (nFields > 0) && (nFields < 255) ); - - m_nFields = nFields; - - CopyFieldsWidth(widths); - SetFieldsWidth(); -} - -void wxStatusBarXX::SetStatusWidths(int n, const int widths[]) -{ - wxASSERT( n == m_nFields ); - - CopyFieldsWidth(widths); - SetFieldsWidth(); -} - -void wxStatusBarXX::CopyFieldsWidth(const int widths[]) -{ - if (widths && !m_statusWidths) - m_statusWidths = new int[m_nFields]; - - if ( widths != NULL ) { - for ( int i = 0; i < m_nFields; i++ ) - m_statusWidths[i] = widths[i]; - } - else { - delete [] m_statusWidths; - m_statusWidths = NULL; - } -} - -void wxStatusBarXX::SetFieldsWidth() -{ - int *pWidths = new int[m_nFields]; - - int nWindowWidth, y; - GetClientSize(&nWindowWidth, &y); - - if ( m_statusWidths == NULL ) { - // default: all fields have the same width - int nWidth = nWindowWidth / m_nFields; - for ( int i = 0; i < m_nFields; i++ ) - pWidths[i] = (i + 1) * nWidth; - } - else { - // -1 doesn't mean the same thing for wxWindows and Win32, recalc - int nTotalWidth = 0, - nVarCount = 0, - i; - for ( i = 0; i < m_nFields; i++ ) { - if ( m_statusWidths[i] == -1 ) - nVarCount++; - else - nTotalWidth += m_statusWidths[i]; - } - - if ( nVarCount == 0 ) { - // wrong! at least one field must be of variable width - wxFAIL; - - nVarCount++; - } - - int nVarWidth = (nWindowWidth - nTotalWidth) / nVarCount; - - // do fill the array - int nCurPos = 0; - for ( i = 0; i < m_nFields; i++ ) { - if ( m_statusWidths[i] == -1 ) - nCurPos += nVarWidth; - else - nCurPos += m_statusWidths[i]; - pWidths[i] = nCurPos; - } - } - - // TODO: set widths - - delete [] pWidths; -} - -void wxStatusBarXX::SetStatusText(const wxString& strText, int nField) -{ - // TODO -} - -wxString wxStatusBarXX::GetStatusText(int nField) const -{ - wxASSERT( (nField > -1) && (nField < m_nFields) ); - - // TODO - return wxString(""); -} - -void wxStatusBarXX::OnSize(wxSizeEvent& event) -{ - // adjust fields widths to the new size - SetFieldsWidth(); -} diff --git a/src/stubs/tabctrl.cpp b/src/stubs/tabctrl.cpp deleted file mode 100644 index 07aa4a3056..0000000000 --- a/src/stubs/tabctrl.cpp +++ /dev/null @@ -1,199 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: tabctrl.cpp -// Purpose: wxTabCtrl -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "tabctrl.h" -#endif - -#include "wx/control.h" -#include "wx/tabctrl.h" - -IMPLEMENT_DYNAMIC_CLASS(wxTabCtrl, wxControl) - -BEGIN_EVENT_TABLE(wxTabCtrl, wxControl) -END_EVENT_TABLE() - -wxTabCtrl::wxTabCtrl() -{ - m_imageList = NULL; -} - -bool wxTabCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, - long style, const wxString& name) -{ - m_imageList = NULL; - - SetName(name); - - m_windowStyle = style; - - SetParent(parent); - - m_windowId = (id < 0 ? NewControlId() : id); - - if (parent) parent->AddChild(this); - - // TODO: create tab control - return FALSE; -} - -wxTabCtrl::~wxTabCtrl() -{ -} - -void wxTabCtrl::Command(wxCommandEvent& event) -{ -} - -// Delete all items -bool wxTabCtrl::DeleteAllItems() -{ - // TODO - return FALSE; -} - -// Delete an item -bool wxTabCtrl::DeleteItem(int item) -{ - // TODO - return FALSE; -} - -// Get the selection -int wxTabCtrl::GetSelection() const -{ - // TODO - return 0; -} - -// Get the tab with the current keyboard focus -int wxTabCtrl::GetCurFocus() const -{ - // TODO - return 0; -} - -// Get the associated image list -wxImageList* wxTabCtrl::GetImageList() const -{ - return m_imageList; -} - -// Get the number of items -int wxTabCtrl::GetItemCount() const -{ - // TODO - return 0; -} - -// Get the rect corresponding to the tab -bool wxTabCtrl::GetItemRect(int item, wxRect& wxrect) const -{ - // TODO - return FALSE; -} - -// Get the number of rows -int wxTabCtrl::GetRowCount() const -{ - // TODO - return 0; -} - -// Get the item text -wxString wxTabCtrl::GetItemText(int item) const -{ - // TODO - return wxString(""); -} - -// Get the item image -int wxTabCtrl::GetItemImage(int item) const -{ - // TODO - return 0; -} - -// Get the item data -void* wxTabCtrl::GetItemData(int item) const -{ - // TODO - return NULL; -} - -// Hit test -int wxTabCtrl::HitTest(const wxPoint& pt, long& flags) -{ - // TODO - return 0; -} - -// Insert an item -bool wxTabCtrl::InsertItem(int item, const wxString& text, int imageId, void* data) -{ - // TODO - return FALSE; -} - -// Set the selection -int wxTabCtrl::SetSelection(int item) -{ - // TODO - return 0; -} - -// Set the image list -void wxTabCtrl::SetImageList(wxImageList* imageList) -{ - // TODO -} - -// Set the text for an item -bool wxTabCtrl::SetItemText(int item, const wxString& text) -{ - // TODO - return FALSE; -} - -// Set the image for an item -bool wxTabCtrl::SetItemImage(int item, int image) -{ - // TODO - return FALSE; -} - -// Set the data for an item -bool wxTabCtrl::SetItemData(int item, void* data) -{ - // TODO - return FALSE; -} - -// Set the size for a fixed-width tab control -void wxTabCtrl::SetItemSize(const wxSize& size) -{ - // TODO -} - -// Set the padding between tabs -void wxTabCtrl::SetPadding(const wxSize& padding) -{ - // TODO -} - -// Tab event -IMPLEMENT_DYNAMIC_CLASS(wxTabEvent, wxCommandEvent) - -wxTabEvent::wxTabEvent(wxEventType commandType, int id): - wxCommandEvent(commandType, id) -{ -} - diff --git a/src/stubs/taskbar.cpp b/src/stubs/taskbar.cpp deleted file mode 100644 index 5c91250cf0..0000000000 --- a/src/stubs/taskbar.cpp +++ /dev/null @@ -1,70 +0,0 @@ -///////////////////////////////////////////////////////////////////////// -// File: taskbar.cpp -// Purpose: Implements wxTaskBarIcon class for manipulating icons on -// the task bar. Optional. -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "taskbar.h" -#endif - -#include - -wxTaskBarIcon::wxTaskBarIcon() -{ - // TODO -} - -wxTaskBarIcon::~wxTaskBarIcon() -{ - // TODO -} - -// Operations -bool wxTaskBarIcon::SetIcon(const wxIcon& icon, const wxString& tooltip) -{ - // TODO - return FALSE; -} - -bool wxTaskBarIcon::RemoveIcon() -{ - // TODO - return FALSE; -} - -// Overridables -void wxTaskBarIcon::OnMouseMove() -{ -} - -void wxTaskBarIcon::OnLButtonDown() -{ -} - -void wxTaskBarIcon::OnLButtonUp() -{ -} - -void wxTaskBarIcon::OnRButtonDown() -{ -} - -void wxTaskBarIcon::OnRButtonUp() -{ -} - -void wxTaskBarIcon::OnLButtonDClick() -{ -} - -void wxTaskBarIcon::OnRButtonDClick() -{ -} - diff --git a/src/stubs/textctrl.cpp b/src/stubs/textctrl.cpp deleted file mode 100644 index cb3d68aad0..0000000000 --- a/src/stubs/textctrl.cpp +++ /dev/null @@ -1,556 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: textctrl.cpp -// Purpose: wxTextCtrl -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "textctrl.h" -#endif - -#include -#include -#include - -#include "wx/textctrl.h" -#include "wx/settings.h" -#include "wx/filefn.h" -#include "wx/utils.h" - -#if defined(__BORLANDC__) && !defined(__WIN32__) -#include -#else -#ifndef __GNUWIN32__ -#include -#endif -#endif - -IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl, wxControl) - -BEGIN_EVENT_TABLE(wxTextCtrl, wxControl) - EVT_DROP_FILES(wxTextCtrl::OnDropFiles) - EVT_MENU(wxID_CUT, wxTextCtrl::OnCut) - EVT_MENU(wxID_COPY, wxTextCtrl::OnCopy) - EVT_MENU(wxID_PASTE, wxTextCtrl::OnPaste) - EVT_MENU(wxID_UNDO, wxTextCtrl::OnUndo) - EVT_MENU(wxID_REDO, wxTextCtrl::OnRedo) - - EVT_UPDATE_UI(wxID_CUT, wxTextCtrl::OnUpdateCut) - EVT_UPDATE_UI(wxID_COPY, wxTextCtrl::OnUpdateCopy) - EVT_UPDATE_UI(wxID_PASTE, wxTextCtrl::OnUpdatePaste) - EVT_UPDATE_UI(wxID_UNDO, wxTextCtrl::OnUpdateUndo) - EVT_UPDATE_UI(wxID_REDO, wxTextCtrl::OnUpdateRedo) -END_EVENT_TABLE() - -// Text item -wxTextCtrl::wxTextCtrl() -#ifndef NO_TEXT_WINDOW_STREAM - :streambuf() -#endif -{ - m_fileName = ""; -} - -bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id, - const wxString& value, - const wxPoint& pos, - const wxSize& size, long style, - const wxValidator& validator, - const wxString& name) -{ - m_fileName = ""; - SetName(name); - SetValidator(validator); - if (parent) parent->AddChild(this); - - m_windowStyle = style; - - if ( id == -1 ) - m_windowId = (int)NewControlId(); - else - m_windowId = id; - - return TRUE; -} - -wxString wxTextCtrl::GetValue() const -{ - // TODO - return wxString(""); -} - -void wxTextCtrl::SetValue(const wxString& value) -{ - // TODO -} - -void wxTextCtrl::SetSize(int x, int y, int width, int height, int sizeFlags) -{ - // TODO -} - -// Clipboard operations -void wxTextCtrl::Copy() -{ - // TODO -} - -void wxTextCtrl::Cut() -{ - // TODO -} - -void wxTextCtrl::Paste() -{ - // TODO -} - -void wxTextCtrl::SetEditable(bool editable) -{ - // TODO -} - -void wxTextCtrl::SetInsertionPoint(long pos) -{ - // TODO -} - -void wxTextCtrl::SetInsertionPointEnd() -{ - long pos = GetLastPosition(); - SetInsertionPoint(pos); -} - -long wxTextCtrl::GetInsertionPoint() const -{ - // TODO - return 0; -} - -long wxTextCtrl::GetLastPosition() const -{ - // TODO - return 0; -} - -void wxTextCtrl::Replace(long from, long to, const wxString& value) -{ - // TODO -} - -void wxTextCtrl::Remove(long from, long to) -{ - // TODO -} - -void wxTextCtrl::SetSelection(long from, long to) -{ - // TODO -} - -bool wxTextCtrl::LoadFile(const wxString& file) -{ - if (!wxFileExists(file)) - return FALSE; - - m_fileName = file; - - Clear(); - - ifstream input((char*) (const char*) file, ios::nocreate | ios::in); - - if (!input.bad()) - { - struct stat stat_buf; - if (stat(file, &stat_buf) < 0) - return FALSE; - // This may need to be a bigger buffer than the file size suggests, - // if it's a UNIX file. Give it an extra 1000 just in case. - char *tmp_buffer = (char*)malloc((size_t)(stat_buf.st_size+1+1000)); - long no_lines = 0; - long pos = 0; - while (!input.eof() && input.peek() != EOF) - { - input.getline(wxBuffer, 500); - int len = strlen(wxBuffer); - wxBuffer[len] = 13; - wxBuffer[len+1] = 10; - wxBuffer[len+2] = 0; - strcpy(tmp_buffer+pos, wxBuffer); - pos += strlen(wxBuffer); - no_lines++; - } - - // TODO add line - - free(tmp_buffer); - - return TRUE; - } - return FALSE; -} - -// If file is null, try saved file name first -// Returns TRUE if succeeds. -bool wxTextCtrl::SaveFile(const wxString& file) -{ - wxString theFile(file); - if (theFile == "") - theFile = m_fileName; - if (theFile == "") - return FALSE; - m_fileName = theFile; - - ofstream output((char*) (const char*) theFile); - if (output.bad()) - return FALSE; - - // TODO get and save text - - return FALSE; -} - -void wxTextCtrl::WriteText(const wxString& text) -{ - // TODO write text to control -} - -void wxTextCtrl::AppendText(const wxString& text) -{ - // TODO append text to control -} - -void wxTextCtrl::Clear() -{ - // TODO -} - -bool wxTextCtrl::IsModified() const -{ - // TODO - return FALSE; -} - -// Makes 'unmodified' -void wxTextCtrl::DiscardEdits() -{ - // TODO -} - -int wxTextCtrl::GetNumberOfLines() const -{ - // TODO - return 0; -} - -long wxTextCtrl::XYToPosition(long x, long y) const -{ - // TODO - return 0; -} - -void wxTextCtrl::PositionToXY(long pos, long *x, long *y) const -{ - // TODO -} - -void wxTextCtrl::ShowPosition(long pos) -{ - // TODO -} - -int wxTextCtrl::GetLineLength(long lineNo) const -{ - // TODO - return 0; -} - -wxString wxTextCtrl::GetLineText(long lineNo) const -{ - // TODO - return wxString(""); -} - -bool wxTextCtrl::CanCopy() const -{ - // Can copy if there's a selection - long from, to; - GetSelection(& from, & to); - return (from != to) ; -} - -bool wxTextCtrl::CanCut() const -{ - // Can cut if there's a selection - long from, to; - GetSelection(& from, & to); - return (from != to) ; -} - -bool wxTextCtrl::CanPaste() const -{ - return IsEditable() ; -} - -// Undo/redo -void wxTextCtrl::Undo() -{ - // TODO -} - -void wxTextCtrl::Redo() -{ - // TODO -} - -bool wxTextCtrl::CanUndo() const -{ - // TODO - return FALSE; -} - -bool wxTextCtrl::CanRedo() const -{ - // TODO - return FALSE; -} - -// If the return values from and to are the same, there is no -// selection. -void wxTextCtrl::GetSelection(long* from, long* to) const -{ - // TODO - *from = 0; - *to = 0; -} - -bool wxTextCtrl::IsEditable() const -{ - // TODO - return FALSE; -} - -void wxTextCtrl::Command(wxCommandEvent & event) -{ - SetValue (event.GetString()); - ProcessCommand (event); -} - -void wxTextCtrl::OnDropFiles(wxDropFilesEvent& event) -{ - // By default, load the first file into the text window. - if (event.GetNumberOfFiles() > 0) - { - LoadFile(event.GetFiles()[0]); - } -} - -// The streambuf code was partly taken from chapter 3 by Jerry Schwarz of -// AT&T's "C++ Lanuage System Release 3.0 Library Manual" - Stein Somers - -//========================================================================= -// Called then the buffer is full (gcc 2.6.3) -// or when "endl" is output (Borland 4.5) -//========================================================================= -// Class declaration using multiple inheritance doesn't work properly for -// Borland. See note in wb_text.h. -#ifndef NO_TEXT_WINDOW_STREAM -int wxTextCtrl::overflow(int c) -{ - // Make sure there is a holding area - if ( allocate()==EOF ) - { - wxError("Streambuf allocation failed","Internal error"); - return EOF; - } - - // Verify that there are no characters in get area - if ( gptr() && gptr() < egptr() ) - { - wxError("Who's trespassing my get area?","Internal error"); - return EOF; - } - - // Reset get area - setg(0,0,0); - - // Make sure there is a put area - if ( ! pptr() ) - { -/* This doesn't seem to be fatal so comment out error message */ -// wxError("Put area not opened","Internal error"); - setp( base(), base() ); - } - - // Determine how many characters have been inserted but no consumed - int plen = pptr() - pbase(); - - // Now Jerry relies on the fact that the buffer is at least 2 chars - // long, but the holding area "may be as small as 1" ??? - // And we need an additional \0, so let's keep this inefficient but - // safe copy. - - // If c!=EOF, it is a character that must also be comsumed - int xtra = c==EOF? 0 : 1; - - // Write temporary C-string to wxTextWindow - { - char *txt = new char[plen+xtra+1]; - memcpy(txt, pbase(), plen); - txt[plen] = (char)c; // append c - txt[plen+xtra] = '\0'; // append '\0' or overwrite c - // If the put area already contained \0, output will be truncated there - AppendText(txt); - delete[] txt; - } - - // Reset put area - setp(pbase(), epptr()); - -#if defined(__WATCOMC__) - return __NOT_EOF; -#elif defined(zapeof) // HP-UX (all cfront based?) - return zapeof(c); -#else - return c!=EOF ? c : 0; // this should make everybody happy -#endif -} - -//========================================================================= -// called then "endl" is output (gcc) or then explicit sync is done (Borland) -//========================================================================= -int wxTextCtrl::sync() -{ - // Verify that there are no characters in get area - if ( gptr() && gptr() < egptr() ) - { - wxError("Who's trespassing my get area?","Internal error"); - return EOF; - } - - if ( pptr() && pptr() > pbase() ) return overflow(EOF); - - return 0; -/* OLD CODE - int len = pptr() - pbase(); - char *txt = new char[len+1]; - strncpy(txt, pbase(), len); - txt[len] = '\0'; - (*this) << txt; - setp(pbase(), epptr()); - delete[] txt; - return 0; -*/ -} - -//========================================================================= -// Should not be called by a "ostream". Used by a "istream" -//========================================================================= -int wxTextCtrl::underflow() -{ - return EOF; -} -#endif - -wxTextCtrl& wxTextCtrl::operator<<(const wxString& s) -{ - AppendText(s); - return *this; -} - -wxTextCtrl& wxTextCtrl::operator<<(float f) -{ - wxString str; - str.Printf("%.2f", f); - AppendText(str); - return *this; -} - -wxTextCtrl& wxTextCtrl::operator<<(double d) -{ - wxString str; - str.Printf("%.2f", d); - AppendText(str); - return *this; -} - -wxTextCtrl& wxTextCtrl::operator<<(int i) -{ - wxString str; - str.Printf("%d", i); - AppendText(str); - return *this; -} - -wxTextCtrl& wxTextCtrl::operator<<(long i) -{ - wxString str; - str.Printf("%ld", i); - AppendText(str); - return *this; -} - -wxTextCtrl& wxTextCtrl::operator<<(const char c) -{ - char buf[2]; - - buf[0] = c; - buf[1] = 0; - AppendText(buf); - return *this; -} - -void wxTextCtrl::OnCut(wxCommandEvent& event) -{ - Cut(); -} - -void wxTextCtrl::OnCopy(wxCommandEvent& event) -{ - Copy(); -} - -void wxTextCtrl::OnPaste(wxCommandEvent& event) -{ - Paste(); -} - -void wxTextCtrl::OnUndo(wxCommandEvent& event) -{ - Undo(); -} - -void wxTextCtrl::OnRedo(wxCommandEvent& event) -{ - Redo(); -} - -void wxTextCtrl::OnUpdateCut(wxUpdateUIEvent& event) -{ - event.Enable( CanCut() ); -} - -void wxTextCtrl::OnUpdateCopy(wxUpdateUIEvent& event) -{ - event.Enable( CanCopy() ); -} - -void wxTextCtrl::OnUpdatePaste(wxUpdateUIEvent& event) -{ - event.Enable( CanPaste() ); -} - -void wxTextCtrl::OnUpdateUndo(wxUpdateUIEvent& event) -{ - event.Enable( CanUndo() ); -} - -void wxTextCtrl::OnUpdateRedo(wxUpdateUIEvent& event) -{ - event.Enable( CanRedo() ); -} diff --git a/src/stubs/thread.cpp b/src/stubs/thread.cpp deleted file mode 100644 index 34ad1a4f14..0000000000 --- a/src/stubs/thread.cpp +++ /dev/null @@ -1,265 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: thread.cpp -// Purpose: wxThread Implementation. For Unix ports, see e.g. src/gtk -// Author: Original from Wolfram Gloger/Guilhem Lavaux -// Modified by: -// Created: 04/22/98 -// RCS-ID: $Id$ -// Copyright: (c) Wolfram Gloger (1996, 1997); Guilhem Lavaux (1998) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "thread.h" -#endif - -#include "wx/module.h" -#include "wx/thread.h" -#include "wx/utils.h" - -#if wxUSE_THREADS - -enum thread_state { - STATE_IDLE = 0, - STATE_RUNNING, - STATE_CANCELED, - STATE_EXITED -}; - -///////////////////////////////////////////////////////////////////////////// -// Static variables -///////////////////////////////////////////////////////////////////////////// - -wxMutex *wxMainMutex; // controls access to all GUI functions - -///////////////////////////////////////////////////////////////////////////// -// Windows implementation -///////////////////////////////////////////////////////////////////////////// - -class wxMutexInternal { -public: - // TODO: internal mutex handle -}; - -wxMutex::wxMutex() -{ - p_internal = new wxMutexInternal; - // TODO: create internal mutext handle - m_locked = 0; -} - -wxMutex::~wxMutex() -{ - if (m_locked > 0) - wxDebugMsg("wxMutex warning: freeing a locked mutex (%d locks)\n", m_locked); - // TODO: free internal mutext handle -} - -wxMutexError wxMutex::Lock() -{ - // TODO - m_locked++; - return wxMUTEX_NO_ERROR; -} - -wxMutexError wxMutex::TryLock() -{ - // TODO - m_locked++; - return wxMUTEX_NO_ERROR; -} - -wxMutexError wxMutex::Unlock() -{ - if (m_locked > 0) - m_locked--; - - // TODO - return wxMUTEX_NO_ERROR; -} - -class wxConditionInternal { -public: - // TODO: internal handle - int waiters; -}; - -wxCondition::wxCondition() -{ - p_internal = new wxConditionInternal; - // TODO: create internal handle - p_internal->waiters = 0; -} - -wxCondition::~wxCondition() -{ - // TODO: destroy internal handle -} - -void wxCondition::Wait(wxMutex& mutex) -{ - mutex.Unlock(); - p_internal->waiters++; - // TODO wait here - p_internal->waiters--; - mutex.Lock(); -} - -bool wxCondition::Wait(wxMutex& mutex, unsigned long sec, - unsigned long nsec) -{ - mutex.Unlock(); - p_internal->waiters++; - - // TODO wait here - p_internal->waiters--; - mutex.Lock(); - - return FALSE; -} - -void wxCondition::Signal() -{ - // TODO -} - -void wxCondition::Broadcast() -{ - // TODO -} - -class wxThreadInternal { -public: - // TODO -}; - -wxThreadError wxThread::Create() -{ - // TODO - return wxTHREAD_NO_ERROR; -} - -wxThreadError wxThread::Destroy() -{ - // TODO - return wxTHREAD_NO_ERROR; -} - -wxThreadError wxThread::Pause() -{ - // TODO - return wxTHREAD_NO_ERROR; -} - -wxThreadError wxThread::Resume() -{ - // TODO - return wxTHREAD_NO_ERROR; -} - -void wxThread::Exit(void *status) -{ - // TODO -} - -void wxThread::SetPriority(int prio) -{ - // TODO -} - -int wxThread::GetPriority() const -{ - // TODO - return 0; -} - -void wxThread::DeferDestroy(bool on) -{ - // TODO -} - -void wxThread::TestDestroy() -{ - // TODO -} - -void *wxThread::Join() -{ - // TODO - return (void*) NULL; -} - -unsigned long wxThread::GetID() const -{ - // TODO - return 0; -} - -/* -wxThread *wxThread::GetThreadFromID(unsigned long id) -{ - // TODO - return NULL; -} -*/ - -bool wxThread::IsAlive() const -{ - // TODO - return FALSE; -} - -bool wxThread::IsRunning() const -{ - // TODO - return FALSE; -} - -bool wxThread::IsMain() -{ - // TODO - return FALSE; -} - -wxThread::wxThread() -{ - p_internal = new wxThreadInternal(); - - // TODO -} - -wxThread::~wxThread() -{ - Destroy(); - Join(); - delete p_internal; -} - -// The default callback just joins the thread and throws away the result. -void wxThread::OnExit() -{ - Join(); -} - -// Automatic initialization -class wxThreadModule : public wxModule { - DECLARE_DYNAMIC_CLASS(wxThreadModule) -public: - virtual bool OnInit() { - /* TODO p_mainid = GetCurrentThread(); */ - wxMainMutex = new wxMutex(); - wxMainMutex->Lock(); - return TRUE; - } - - // Global cleanup - virtual void OnExit() { - wxMainMutex->Unlock(); - delete wxMainMutex; - } -}; - -IMPLEMENT_DYNAMIC_CLASS(wxThreadModule, wxModule) - -#endif - // wxUSE_THREADS diff --git a/src/stubs/timer.cpp b/src/stubs/timer.cpp deleted file mode 100644 index d845d50108..0000000000 --- a/src/stubs/timer.cpp +++ /dev/null @@ -1,50 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: timer.cpp -// Purpose: wxTimer implementation -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "timer.h" -#endif - -#include "wx/timer.h" - -IMPLEMENT_ABSTRACT_CLASS(wxTimer, wxObject) - -wxTimer::wxTimer() -{ - m_milli = 0 ; - m_id = 0; - m_oneShot = FALSE; -} - -wxTimer::~wxTimer() -{ - Stop(); -} - -bool wxTimer::Start(int milliseconds,bool mode) -{ - m_oneShot = mode ; - if (milliseconds <= 0) - return FALSE; - - m_milli = milliseconds; - - // TODO: set the timer going. - return FALSE; -} - -void wxTimer::Stop() -{ - m_id = 0 ; - m_milli = 0 ; -} - - diff --git a/src/stubs/toolbar.cpp b/src/stubs/toolbar.cpp deleted file mode 100644 index b83ce5e0e8..0000000000 --- a/src/stubs/toolbar.cpp +++ /dev/null @@ -1,143 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: toolbar.cpp -// Purpose: wxToolBar -// Author: AUTHOR -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "toolbar.h" -#endif - -#include "wx/wx.h" -#include "wx/toolbar.h" - -IMPLEMENT_DYNAMIC_CLASS(wxToolBar, wxToolBarBase) - -BEGIN_EVENT_TABLE(wxToolBar, wxToolBarBase) -END_EVENT_TABLE() - -wxToolBar::wxToolBar() -{ - m_maxWidth = -1; - m_maxHeight = -1; - m_defaultWidth = 24; - m_defaultHeight = 22; - // TODO -} - -bool wxToolBar::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, - long style, const wxString& name) -{ - m_maxWidth = -1; - m_maxHeight = -1; - - m_defaultWidth = 24; - m_defaultHeight = 22; - SetName(name); - - m_windowStyle = style; - - SetParent(parent); - - if (parent) parent->AddChild(this); - - // TODO create toolbar - - return FALSE; -} - -wxToolBar::~wxToolBar() -{ - // TODO -} - -bool wxToolBar::CreateTools() -{ - if (m_tools.Number() == 0) - return FALSE; - - // TODO - return FALSE; -} - -void wxToolBar::SetToolBitmapSize(const wxSize& size) -{ - m_defaultWidth = size.x; m_defaultHeight = size.y; - // TODO -} - -wxSize wxToolBar::GetMaxSize() const -{ - // TODO - return wxSize(0, 0); -} - -// The button size is bigger than the bitmap size -wxSize wxToolBar::GetToolSize() const -{ - // TODO - return wxSize(m_defaultWidth + 8, m_defaultHeight + 7); -} - -void wxToolBar::EnableTool(int toolIndex, bool enable) -{ - wxNode *node = m_tools.Find((long)toolIndex); - if (node) - { - wxToolBarTool *tool = (wxToolBarTool *)node->Data(); - tool->m_enabled = enable; - // TODO enable button - } -} - -void wxToolBar::ToggleTool(int toolIndex, bool toggle) -{ - wxNode *node = m_tools.Find((long)toolIndex); - if (node) - { - wxToolBarTool *tool = (wxToolBarTool *)node->Data(); - if (tool->m_isToggle) - { - tool->m_toggleState = toggle; - // TODO: set toggle state - } - } -} - -void wxToolBar::ClearTools() -{ - // TODO - wxToolBarBase::ClearTools(); -} - -// 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 *wxToolBar::AddTool(int index, const wxBitmap& bitmap, const wxBitmap& pushedBitmap, - bool toggle, long xPos, long yPos, wxObject *clientData, const wxString& helpString1, const wxString& helpString2) -{ - wxToolBarTool *tool = new wxToolBarTool(index, bitmap, wxNullBitmap, toggle, xPos, yPos, helpString1, helpString2); - tool->m_clientData = clientData; - - if (xPos > -1) - tool->m_x = xPos; - else - tool->m_x = m_xMargin; - - if (yPos > -1) - tool->m_y = yPos; - else - tool->m_y = m_yMargin; - - tool->SetSize(GetDefaultButtonWidth(), GetDefaultButtonHeight()); - - m_tools.Append((long)index, tool); - return tool; -} - diff --git a/src/stubs/treectrl.cpp b/src/stubs/treectrl.cpp deleted file mode 100644 index 3aea32e970..0000000000 --- a/src/stubs/treectrl.cpp +++ /dev/null @@ -1,416 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: treectrl.cpp -// Purpose: wxTreeCtrl. See also Robert's generic wxTreeCtrl. -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "treectrl.h" -#endif - -#include "wx/stubs/textctrl.h" -#include "wx/stubs/treectrl.h" - -IMPLEMENT_DYNAMIC_CLASS(wxTreeCtrl, wxControl) -IMPLEMENT_DYNAMIC_CLASS(wxTreeItem, wxObject) - - -wxTreeCtrl::wxTreeCtrl() -{ - m_imageListNormal = NULL; - m_imageListState = NULL; - m_textCtrl = NULL; -} - -bool wxTreeCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, - long style, const wxValidator& validator, const wxString& name) -{ - SetName(name); - SetValidator(validator); - - m_imageListNormal = NULL; - m_imageListState = NULL; - m_textCtrl = NULL; - - m_windowStyle = style; - - SetParent(parent); - - m_windowId = (id == -1) ? NewControlId() : id; - - if (parent) parent->AddChild(this); - - // TODO create tree control - - return FALSE; -} - -wxTreeCtrl::~wxTreeCtrl() -{ - if (m_textCtrl) - { - delete m_textCtrl; - } -} - -// Attributes -int wxTreeCtrl::GetCount() const -{ - // TODO - return 0; -} - -int wxTreeCtrl::GetIndent() const -{ - // TODO - return 0; -} - -void wxTreeCtrl::SetIndent(int indent) -{ - // TODO -} - -wxImageList *wxTreeCtrl::GetImageList(int which) const -{ - if ( which == wxIMAGE_LIST_NORMAL ) - { - return m_imageListNormal; - } - else if ( which == wxIMAGE_LIST_STATE ) - { - return m_imageListState; - } - return NULL; -} - -void wxTreeCtrl::SetImageList(wxImageList *imageList, int which) -{ - if ( which == wxIMAGE_LIST_NORMAL ) - { - m_imageListNormal = imageList; - } - else if ( which == wxIMAGE_LIST_STATE ) - { - m_imageListState = imageList; - } - // TODO -} - -long wxTreeCtrl::GetNextItem(long item, int code) const -{ - // TODO - return 0; -} - -bool wxTreeCtrl::ItemHasChildren(long item) const -{ - // TODO - return FALSE; -} - -long wxTreeCtrl::GetChild(long item) const -{ - // TODO - return 0; -} - -long wxTreeCtrl::GetParent(long item) const -{ - // TODO - return 0; -} - -long wxTreeCtrl::GetFirstVisibleItem() const -{ - // TODO - return 0; -} - -long wxTreeCtrl::GetNextVisibleItem(long item) const -{ - // TODO - return 0; -} - -long wxTreeCtrl::GetSelection() const -{ - // TODO - return 0; -} - -long wxTreeCtrl::GetRootItem() const -{ - // TODO - return 0; -} - -bool wxTreeCtrl::GetItem(wxTreeItem& info) const -{ - // TODO - return FALSE; -} - -bool wxTreeCtrl::SetItem(wxTreeItem& info) -{ - // TODO - return FALSE; -} - -int wxTreeCtrl::GetItemState(long item, long stateMask) const -{ - wxTreeItem info; - - info.m_mask = wxTREE_MASK_STATE ; - info.m_stateMask = stateMask; - info.m_itemId = item; - - if (!GetItem(info)) - return 0; - - return info.m_state; -} - -bool wxTreeCtrl::SetItemState(long item, long state, long stateMask) -{ - wxTreeItem info; - - info.m_mask = wxTREE_MASK_STATE ; - info.m_state = state; - info.m_stateMask = stateMask; - info.m_itemId = item; - - return SetItem(info); -} - -bool wxTreeCtrl::SetItemImage(long item, int image, int selImage) -{ - wxTreeItem info; - - info.m_mask = wxTREE_MASK_IMAGE ; - info.m_image = image; - if ( selImage > -1) - { - info.m_selectedImage = selImage; - info.m_mask |= wxTREE_MASK_SELECTED_IMAGE; - } - info.m_itemId = item; - - return SetItem(info); -} - -wxString wxTreeCtrl::GetItemText(long item) const -{ - wxTreeItem info; - - info.m_mask = wxTREE_MASK_TEXT ; - info.m_itemId = item; - - if (!GetItem(info)) - return wxString(""); - return info.m_text; -} - -void wxTreeCtrl::SetItemText(long item, const wxString& str) -{ - wxTreeItem info; - - info.m_mask = wxTREE_MASK_TEXT ; - info.m_itemId = item; - info.m_text = str; - - SetItem(info); -} - -long wxTreeCtrl::GetItemData(long item) const -{ - wxTreeItem info; - - info.m_mask = wxTREE_MASK_DATA ; - info.m_itemId = item; - - if (!GetItem(info)) - return 0; - return info.m_data; -} - -bool wxTreeCtrl::SetItemData(long item, long data) -{ - wxTreeItem info; - - info.m_mask = wxTREE_MASK_DATA ; - info.m_itemId = item; - info.m_data = data; - - return SetItem(info); -} - -bool wxTreeCtrl::GetItemRect(long item, wxRect& rect, bool textOnly) const -{ - // TODO - return FALSE; -} - -wxTextCtrl* wxTreeCtrl::GetEditControl() const -{ - return m_textCtrl; -} - -// Operations -bool wxTreeCtrl::DeleteItem(long item) -{ - // TODO - return FALSE; -} - -bool wxTreeCtrl::ExpandItem(long item, int action) -{ - // TODO - switch ( action ) - { - case wxTREE_EXPAND_EXPAND: - break; - - case wxTREE_EXPAND_COLLAPSE: - break; - - case wxTREE_EXPAND_COLLAPSE_RESET: - break; - - case wxTREE_EXPAND_TOGGLE: - break; - - default: - wxFAIL_MSG("unknown action in wxTreeCtrl::ExpandItem"); - } - - bool bOk = FALSE; // TODO expand item - - // May not send messages, so emulate them - if ( bOk ) { - wxTreeEvent event(wxEVT_NULL, m_windowId); - event.m_item.m_itemId = item; - event.m_item.m_mask = - event.m_item.m_stateMask = 0xffff; // get all - GetItem(event.m_item); - - bool bIsExpanded = (event.m_item.m_state & wxTREE_STATE_EXPANDED) != 0; - - event.m_code = action; - event.SetEventObject(this); - - // @@@ return values of {EXPAND|COLLAPS}ING event handler is discarded - event.SetEventType(bIsExpanded ? wxEVT_COMMAND_TREE_ITEM_EXPANDING - : wxEVT_COMMAND_TREE_ITEM_COLLAPSING); - GetEventHandler()->ProcessEvent(event); - - event.SetEventType(bIsExpanded ? wxEVT_COMMAND_TREE_ITEM_EXPANDED - : wxEVT_COMMAND_TREE_ITEM_COLLAPSED); - GetEventHandler()->ProcessEvent(event); - } - - return bOk; -} - -long wxTreeCtrl::InsertItem(long parent, wxTreeItem& info, long insertAfter) -{ - // TODO - return 0; -} - -long wxTreeCtrl::InsertItem(long parent, const wxString& label, int image, int selImage, - long insertAfter) -{ - wxTreeItem info; - info.m_text = label; - info.m_mask = wxTREE_MASK_TEXT; - if ( image > -1 ) - { - info.m_mask |= wxTREE_MASK_IMAGE | wxTREE_MASK_SELECTED_IMAGE; - info.m_image = image; - if ( selImage == -1 ) - info.m_selectedImage = image; - else - info.m_selectedImage = selImage; - } - - return InsertItem(parent, info, insertAfter); -} - -bool wxTreeCtrl::SelectItem(long item) -{ - // TODO - return FALSE; -} - -bool wxTreeCtrl::ScrollTo(long item) -{ - // TODO - return FALSE; -} - -bool wxTreeCtrl::DeleteAllItems() -{ - // TODO - return FALSE; -} - -wxTextCtrl* wxTreeCtrl::EditLabel(long item, wxClassInfo* textControlClass) -{ - // TODO - return NULL; -} - -// End label editing, optionally cancelling the edit -bool wxTreeCtrl::EndEditLabel(bool cancel) -{ - // TODO - return FALSE; -} - -long wxTreeCtrl::HitTest(const wxPoint& point, int& flags) -{ - // TODO - return 0; -} - -bool wxTreeCtrl::SortChildren(long item) -{ - // TODO - return FALSE; -} - -bool wxTreeCtrl::EnsureVisible(long item) -{ - // TODO - return FALSE; -} - -// Tree item structure -wxTreeItem::wxTreeItem() -{ - m_mask = 0; - m_itemId = 0; - m_state = 0; - m_stateMask = 0; - m_image = -1; - m_selectedImage = -1; - m_children = 0; - m_data = 0; -} - -// Tree event -IMPLEMENT_DYNAMIC_CLASS(wxTreeEvent, wxCommandEvent) - -wxTreeEvent::wxTreeEvent(wxEventType commandType, int id): - wxCommandEvent(commandType, id) -{ - m_code = 0; - m_oldItem = 0; -} - diff --git a/src/stubs/utils.cpp b/src/stubs/utils.cpp deleted file mode 100644 index 940bdc21bc..0000000000 --- a/src/stubs/utils.cpp +++ /dev/null @@ -1,272 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: utils.cpp -// Purpose: Various utilities -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -// Note: this is done in utilscmn.cpp now. -// #pragma implementation -// #pragma implementation "utils.h" -#endif - -#include "wx/setup.h" -#include "wx/utils.h" -#include "wx/app.h" - -#include - -#include -#include -#include -#include - -// Get full hostname (eg. DoDo.BSn-Germany.crg.de) -bool wxGetHostName(char *buf, int maxSize) -{ - // TODO - return FALSE; -} - -// Get user ID e.g. jacs -bool wxGetUserId(char *buf, int maxSize) -{ - // TODO - return FALSE; -} - -// Get user name e.g. AUTHOR -bool wxGetUserName(char *buf, int maxSize) -{ - // TODO - return FALSE; -} - -int wxKill(long pid, int sig) -{ - // TODO - return 0; -} - -// -// Execute a program in an Interactive Shell -// -bool wxShell(const wxString& command) -{ - // TODO - return FALSE; -} - -// Get free memory in bytes, or -1 if cannot determine amount (e.g. on UNIX) -long wxGetFreeMemory() -{ - // TODO - return 0; -} - -void wxSleep(int nSecs) -{ - // TODO -} - -// Consume all events until no more left -void wxFlushEvents() -{ -} - -// Output a debug message, in a system dependent fashion. -void wxDebugMsg(const char *fmt ...) -{ - va_list ap; - static char buffer[512]; - - if (!wxTheApp->GetWantDebugOutput()) - return ; - - va_start(ap, fmt); - - // wvsprintf(buffer,fmt,ap) ; - // TODO: output buffer - - va_end(ap); -} - -// Non-fatal error: pop up message box and (possibly) continue -void wxError(const wxString& msg, const wxString& title) -{ - // TODO - wxExit(); -} - -// Fatal error: pop up message box and abort -void wxFatalError(const wxString& msg, const wxString& title) -{ - // TODO -} - -// Emit a beeeeeep -void wxBell() -{ - // TODO -} - -int wxGetOsVersion(int *majorVsn, int *minorVsn) -{ - // TODO - return 0; -} - -// Reading and writing resources (eg WIN.INI, .Xdefaults) -#if wxUSE_RESOURCES -bool wxWriteResource(const wxString& section, const wxString& entry, const wxString& value, const wxString& file) -{ - // TODO - return FALSE; -} - -bool wxWriteResource(const wxString& section, const wxString& entry, float value, const wxString& file) -{ - char buf[50]; - sprintf(buf, "%.4f", value); - return wxWriteResource(section, entry, buf, file); -} - -bool wxWriteResource(const wxString& section, const wxString& entry, long value, const wxString& file) -{ - char buf[50]; - sprintf(buf, "%ld", value); - return wxWriteResource(section, entry, buf, file); -} - -bool wxWriteResource(const wxString& section, const wxString& entry, int value, const wxString& file) -{ - char buf[50]; - sprintf(buf, "%d", value); - return wxWriteResource(section, entry, buf, file); -} - -bool wxGetResource(const wxString& section, const wxString& entry, char **value, const wxString& file) -{ - // TODO - return FALSE; -} - -bool wxGetResource(const wxString& section, const wxString& entry, float *value, const wxString& file) -{ - char *s = NULL; - bool succ = wxGetResource(section, entry, (char **)&s, file); - if (succ) - { - *value = (float)strtod(s, NULL); - delete[] s; - return TRUE; - } - else return FALSE; -} - -bool wxGetResource(const wxString& section, const wxString& entry, long *value, const wxString& file) -{ - char *s = NULL; - bool succ = wxGetResource(section, entry, (char **)&s, file); - if (succ) - { - *value = strtol(s, NULL, 10); - delete[] s; - return TRUE; - } - else return FALSE; -} - -bool wxGetResource(const wxString& section, const wxString& entry, int *value, const wxString& file) -{ - char *s = NULL; - bool succ = wxGetResource(section, entry, (char **)&s, file); - if (succ) - { - *value = (int)strtol(s, NULL, 10); - delete[] s; - return TRUE; - } - else return FALSE; -} -#endif // wxUSE_RESOURCES - -static int wxBusyCursorCount = 0; - -// Set the cursor to the busy cursor for all windows -void wxBeginBusyCursor(wxCursor *cursor) -{ - wxBusyCursorCount ++; - if (wxBusyCursorCount == 1) - { - // TODO - } - else - { - // TODO - } -} - -// Restore cursor to normal -void wxEndBusyCursor() -{ - if (wxBusyCursorCount == 0) - return; - - wxBusyCursorCount --; - if (wxBusyCursorCount == 0) - { - // TODO - } -} - -// TRUE if we're between the above two calls -bool wxIsBusy() -{ - return (wxBusyCursorCount > 0); -} - -char *wxGetUserHome (const wxString& user) -{ - // TODO - return NULL; -} - -// Check whether this window wants to process messages, e.g. Stop button -// in long calculations. -bool wxCheckForInterrupt(wxWindow *wnd) -{ - // TODO - return FALSE; -} - -void wxGetMousePosition( int* x, int* y ) -{ - // TODO -}; - -// Return TRUE if we have a colour display -bool wxColourDisplay() -{ - // TODO - return TRUE; -} - -// Returns depth of screen -int wxDisplayDepth() -{ - // TODO - return 0; -} - -// Get size of display -void wxDisplaySize(int *width, int *height) -{ - // TODO -} - diff --git a/src/stubs/utilsexc.cpp b/src/stubs/utilsexc.cpp deleted file mode 100644 index b842d08e90..0000000000 --- a/src/stubs/utilsexc.cpp +++ /dev/null @@ -1,28 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: utilsexec.cpp -// Purpose: Execution-related utilities -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation -#endif - -#include "wx/utils.h" - -#include -#include -#include - -#define wxEXECUTE_WIN_MESSAGE 10000 - -long wxExecute(const wxString& command, bool sync, wxProcess *handler) -{ - // TODO - return 0; -} diff --git a/src/stubs/wave.cpp b/src/stubs/wave.cpp deleted file mode 100644 index c25681858c..0000000000 --- a/src/stubs/wave.cpp +++ /dev/null @@ -1,61 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wave.cpp -// Purpose: wxWave class implementation: optional -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "wave.h" -#endif - -#include "wx/object.h" -#include "wx/string.h" -#include "wx/stubs/wave.h" - -wxWave::wxWave() - : m_waveData(NULL), m_waveLength(0), m_isResource(FALSE) -{ -} - -wxWave::wxWave(const wxString& sFileName, bool isResource) - : m_waveData(NULL), m_waveLength(0), m_isResource(FALSE) -{ - Create(sFileName, isResource); -} - - -wxWave::~wxWave() -{ - Free(); -} - -bool wxWave::Create(const wxString& fileName, bool isResource) -{ - Free(); - - // TODO - - return FALSE; -} - -bool wxWave::Play(bool async, bool looped) const -{ - if (!IsOk()) - return FALSE; - - // TODO - return FALSE; -} - -bool wxWave::Free() -{ - // TODO - return FALSE; -} - - diff --git a/src/stubs/window.cpp b/src/stubs/window.cpp deleted file mode 100644 index 0eeda07dfc..0000000000 --- a/src/stubs/window.cpp +++ /dev/null @@ -1,1315 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: windows.cpp -// Purpose: wxWindow -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "window.h" -#endif - -#include "wx/setup.h" -#include "wx/menu.h" -#include "wx/dc.h" -#include "wx/dcclient.h" -#include "wx/utils.h" -#include "wx/app.h" -#include "wx/panel.h" -#include "wx/layout.h" -#include "wx/dialog.h" -#include "wx/listbox.h" -#include "wx/button.h" -#include "wx/settings.h" -#include "wx/msgdlg.h" -#include "wx/frame.h" - -#include "wx/menuitem.h" -#include "wx/log.h" - -#if wxUSE_DRAG_AND_DROP -#include "wx/dnd.h" -#endif - -#include - -extern wxList wxPendingDelete; - -IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxEvtHandler) - -BEGIN_EVENT_TABLE(wxWindow, wxEvtHandler) - EVT_CHAR(wxWindow::OnChar) - EVT_KEY_DOWN(wxWindow::OnKeyDown) - EVT_KEY_UP(wxWindow::OnKeyUp) - EVT_ERASE_BACKGROUND(wxWindow::OnEraseBackground) - EVT_SYS_COLOUR_CHANGED(wxWindow::OnSysColourChanged) - EVT_INIT_DIALOG(wxWindow::OnInitDialog) - EVT_IDLE(wxWindow::OnIdle) -END_EVENT_TABLE() - - - -// Constructor -wxWindow::wxWindow() -{ - // Generic - m_isWindow = TRUE; // An optimization - m_windowId = 0; - m_windowStyle = 0; - m_windowParent = NULL; - m_windowEventHandler = this; - m_windowName = ""; - m_windowCursor = *wxSTANDARD_CURSOR; - m_children = new wxList; - m_constraints = NULL; - m_constraintsInvolvedIn = NULL; - m_windowSizer = NULL; - m_sizerParent = NULL; - m_autoLayout = FALSE; - m_windowValidator = NULL; - m_defaultItem = NULL; - m_returnCode = 0; - m_caretWidth = 0; m_caretHeight = 0; - m_caretEnabled = FALSE; - m_caretShown = FALSE; - m_backgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE) ; - // m_backgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOW) ; ; - m_foregroundColour = *wxBLACK; - -#if wxUSE_DRAG_AND_DROP - m_pDropTarget = NULL; -#endif -} - -// Destructor -wxWindow::~wxWindow() -{ - // Have to delete constraints/sizer FIRST otherwise - // sizers may try to look at deleted windows as they - // delete themselves. -#if wxUSE_CONSTRAINTS - DeleteRelatedConstraints(); - if (m_constraints) - { - // This removes any dangling pointers to this window - // in other windows' constraintsInvolvedIn lists. - UnsetConstraints(m_constraints); - delete m_constraints; - m_constraints = NULL; - } - if (m_windowSizer) - { - delete m_windowSizer; - m_windowSizer = NULL; - } - // If this is a child of a sizer, remove self from parent - if (m_sizerParent) - m_sizerParent->RemoveChild((wxWindow *)this); -#endif - - if (m_windowParent) - m_windowParent->RemoveChild(this); - - DestroyChildren(); - - // TODO: destroy the window - - delete m_children; - m_children = NULL; - - // Just in case the window has been Closed, but - // we're then deleting immediately: don't leave - // dangling pointers. - wxPendingDelete.DeleteObject(this); - - if ( m_windowValidator ) - delete m_windowValidator; -} - -// Destroy the window (delayed, if a managed window) -bool wxWindow::Destroy() -{ - delete this; - return TRUE; -} - -// Constructor -bool wxWindow::Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - // Generic - m_isWindow = TRUE; // An optimization - m_windowId = 0; - m_windowStyle = 0; - m_windowParent = NULL; - m_windowEventHandler = this; - m_windowName = ""; - m_windowCursor = *wxSTANDARD_CURSOR; - m_constraints = NULL; - m_constraintsInvolvedIn = NULL; - m_windowSizer = NULL; - m_sizerParent = NULL; - m_autoLayout = FALSE; - m_windowValidator = NULL; - -#if wxUSE_DRAG_AND_DROP - m_pDropTarget = NULL; -#endif - - m_caretWidth = 0; m_caretHeight = 0; - m_caretEnabled = FALSE; - m_caretShown = FALSE; - m_minSizeX = -1; - m_minSizeY = -1; - m_maxSizeX = -1; - m_maxSizeY = -1; - m_defaultItem = NULL; - m_windowParent = NULL; - if (!parent) - return FALSE; - - if (parent) parent->AddChild(this); - - m_returnCode = 0; - - SetName(name); - - if ( id == -1 ) - m_windowId = (int)NewControlId(); - else - m_windowId = id; - - // m_backgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOW) ; ; - m_backgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE) ; - m_foregroundColour = *wxBLACK; - - m_windowStyle = style; - - if ( id == -1 ) - m_windowId = (int)NewControlId(); - else - m_windowId = id; - - // TODO: create the window - - return TRUE; -} - -void wxWindow::SetFocus() -{ - // TODO -} - -void wxWindow::Enable(bool enable) -{ - // TODO -} - -void wxWindow::CaptureMouse() -{ - // TODO -} - -void wxWindow::ReleaseMouse() -{ - // TODO -} - -// Push/pop event handler (i.e. allow a chain of event handlers -// be searched) -void wxWindow::PushEventHandler(wxEvtHandler *handler) -{ - handler->SetNextHandler(GetEventHandler()); - SetEventHandler(handler); -} - -wxEvtHandler *wxWindow::PopEventHandler(bool deleteHandler) -{ - if ( GetEventHandler() ) - { - wxEvtHandler *handlerA = GetEventHandler(); - wxEvtHandler *handlerB = handlerA->GetNextHandler(); - handlerA->SetNextHandler(NULL); - SetEventHandler(handlerB); - if ( deleteHandler ) - { - delete handlerA; - return NULL; - } - else - return handlerA; - } - else - return NULL; -} - -#if wxUSE_DRAG_AND_DROP - -void wxWindow::SetDropTarget(wxDropTarget *pDropTarget) -{ - if ( m_pDropTarget != 0 ) { - delete m_pDropTarget; - } - - m_pDropTarget = pDropTarget; - if ( m_pDropTarget != 0 ) - { - // TODO - } -} - -#endif - -// Old style file-manager drag&drop -void wxWindow::DragAcceptFiles(bool accept) -{ - // TODO -} - -// Get total size -void wxWindow::GetSize(int *x, int *y) const -{ - // TODO -} - -void wxWindow::GetPosition(int *x, int *y) const -{ - // TODO -} - -void wxWindow::ScreenToClient(int *x, int *y) const -{ - // TODO -} - -void wxWindow::ClientToScreen(int *x, int *y) const -{ - // TODO -} - -void wxWindow::SetCursor(const wxCursor& cursor) -{ - m_windowCursor = cursor; - if (m_windowCursor.Ok()) - { - // TODO - } -} - - -// Get size *available for subwindows* i.e. excluding menu bar etc. -void wxWindow::GetClientSize(int *x, int *y) const -{ - // TODO -} - -void wxWindow::SetSize(int x, int y, int width, int height, int sizeFlags) -{ - // TODO -} - -void wxWindow::SetClientSize(int width, int height) -{ - // TODO -} - -// For implementation purposes - sometimes decorations make the client area -// smaller -wxPoint wxWindow::GetClientAreaOrigin() const -{ - return wxPoint(0, 0); -} - -// Makes an adjustment to the window position (for example, a frame that has -// a toolbar that it manages itself). -void wxWindow::AdjustForParentClientOrigin(int& x, int& y, int sizeFlags) -{ - if (((sizeFlags & wxSIZE_NO_ADJUSTMENTS) == 0) && GetParent()) - { - wxPoint pt(GetParent()->GetClientAreaOrigin()); - x += pt.x; y += pt.y; - } -} - -bool wxWindow::Show(bool show) -{ - // TODO - return FALSE; -} - -bool wxWindow::IsShown() const -{ - // TODO - return FALSE; -} - -int wxWindow::GetCharHeight() const -{ - // TODO - return 0; -} - -int wxWindow::GetCharWidth() const -{ - // TODO - return 0; -} - -void wxWindow::GetTextExtent(const wxString& string, int *x, int *y, - int *descent, int *externalLeading, const wxFont *theFont, bool) const -{ - wxFont *fontToUse = (wxFont *)theFont; - if (!fontToUse) - fontToUse = (wxFont *) & m_windowFont; - - // TODO -} - -void wxWindow::Refresh(bool eraseBack, const wxRect *rect) -{ - // TODO -} - -// Responds to colour changes: passes event on to children. -void wxWindow::OnSysColourChanged(wxSysColourChangedEvent& event) -{ - wxNode *node = GetChildren().First(); - while ( node ) - { - // Only propagate to non-top-level windows - wxWindow *win = (wxWindow *)node->Data(); - if ( win->GetParent() ) - { - wxSysColourChangedEvent event2; - event.m_eventObject = win; - win->GetEventHandler()->ProcessEvent(event2); - } - - node = node->Next(); - } -} - -// This can be called by the app (or wxWindows) to do default processing for the current -// event. Save message/event info in wxWindow so they can be used in this function. -long wxWindow::Default() -{ - // TODO - return 0; -} - -void wxWindow::InitDialog() -{ - wxInitDialogEvent event(GetId()); - event.SetEventObject( this ); - GetEventHandler()->ProcessEvent(event); -} - -// Default init dialog behaviour is to transfer data to window -void wxWindow::OnInitDialog(wxInitDialogEvent& event) -{ - TransferDataToWindow(); -} - -// Caret manipulation -void wxWindow::CreateCaret(int w, int h) -{ - m_caretWidth = w; - m_caretHeight = h; - m_caretEnabled = TRUE; -} - -void wxWindow::CreateCaret(const wxBitmap *WXUNUSED(bitmap)) -{ - // TODO -} - -void wxWindow::ShowCaret(bool show) -{ - // TODO -} - -void wxWindow::DestroyCaret() -{ - // TODO - m_caretEnabled = FALSE; -} - -void wxWindow::SetCaretPos(int x, int y) -{ - // TODO -} - -void wxWindow::GetCaretPos(int *x, int *y) const -{ - // TODO -} - -wxWindow *wxGetActiveWindow() -{ - // TODO - return NULL; -} - -void wxWindow::SetSizeHints(int minW, int minH, int maxW, int maxH, int WXUNUSED(incW), int WXUNUSED(incH)) -{ - m_minSizeX = minW; - m_minSizeY = minH; - m_maxSizeX = maxW; - m_maxSizeY = maxH; -} - -void wxWindow::Centre(int direction) -{ - int x, y, width, height, panel_width, panel_height, new_x, new_y; - - wxWindow *father = (wxWindow *)GetParent(); - if (!father) - return; - - father->GetClientSize(&panel_width, &panel_height); - GetSize(&width, &height); - GetPosition(&x, &y); - - new_x = -1; - new_y = -1; - - 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, -1, -1); - -} - -// Coordinates relative to the window -void wxWindow::WarpPointer (int x_pos, int y_pos) -{ - // TODO -} - -void wxWindow::OnEraseBackground(wxEraseEvent& event) -{ - // TODO - Default(); -} - -int wxWindow::GetScrollPos(int orient) const -{ - // TODO - return 0; -} - -// This now returns the whole range, not just the number -// of positions that we can scroll. -int wxWindow::GetScrollRange(int orient) const -{ - // TODO - return 0; -} - -int wxWindow::GetScrollThumb(int orient) const -{ - // TODO - return 0; -} - -void wxWindow::SetScrollPos(int orient, int pos, bool refresh) -{ - // TODO - return; -} - -// New function that will replace some of the above. -void wxWindow::SetScrollbar(int orient, int pos, int thumbVisible, - int range, bool refresh) -{ - // TODO -} - -// Does a physical scroll -void wxWindow::ScrollWindow(int dx, int dy, const wxRect *rect) -{ - // TODO - return; -} - -void wxWindow::SetFont(const wxFont& font) -{ - m_windowFont = font; - - if (!m_windowFont.Ok()) - return; - // TODO -} - -void wxWindow::OnChar(wxKeyEvent& event) -{ -/* ?? - if ( event.KeyCode() == WXK_TAB ) { - // propagate the TABs to the parent - it's up to it to decide what - // to do with it - if ( GetParent() ) { - if ( GetParent()->ProcessEvent(event) ) - return; - } - } -*/ - Default(); -} - -void wxWindow::OnKeyDown(wxKeyEvent& event) -{ - Default(); -} - -void wxWindow::OnKeyUp(wxKeyEvent& event) -{ - Default(); -} - -void wxWindow::OnPaint(wxPaintEvent& event) -{ - Default(); -} - -bool wxWindow::IsEnabled() const -{ - // TODO - return FALSE; -} - -// Dialog support: override these and call -// base class members to add functionality -// that can't be done using validators. -// NOTE: these functions assume that controls -// are direct children of this window, not grandchildren -// or other levels of descendant. - -// Transfer values to controls. If returns FALSE, -// it's an application error (pops up a dialog) -bool wxWindow::TransferDataToWindow() -{ - wxNode *node = GetChildren().First(); - while ( node ) - { - wxWindow *child = (wxWindow *)node->Data(); - if ( child->GetValidator() && - !child->GetValidator()->TransferToWindow() ) - { - wxMessageBox("Application Error", "Could not transfer data to window", wxOK|wxICON_EXCLAMATION); - return FALSE; - } - - node = node->Next(); - } - return TRUE; -} - -// Transfer values from controls. If returns FALSE, -// validation failed: don't quit -bool wxWindow::TransferDataFromWindow() -{ - wxNode *node = GetChildren().First(); - while ( node ) - { - wxWindow *child = (wxWindow *)node->Data(); - if ( child->GetValidator() && !child->GetValidator()->TransferFromWindow() ) - { - return FALSE; - } - - node = node->Next(); - } - return TRUE; -} - -bool wxWindow::Validate() -{ - wxNode *node = GetChildren().First(); - while ( node ) - { - wxWindow *child = (wxWindow *)node->Data(); - if ( child->GetValidator() && /* child->GetValidator()->Ok() && */ !child->GetValidator()->Validate(this) ) - { - return FALSE; - } - - node = node->Next(); - } - return TRUE; -} - -// Get the window with the focus -wxWindow *wxWindow::FindFocus() -{ - // TODO - return NULL; -} - -void wxWindow::AddChild(wxWindow *child) -{ - GetChildren().Append(child); - child->m_windowParent = this; -} - -void wxWindow::RemoveChild(wxWindow *child) -{ - GetChildren().DeleteObject(child); - child->m_windowParent = NULL; -} - -void wxWindow::DestroyChildren() -{ - wxNode *node; - while ((node = GetChildren().First()) != (wxNode *)NULL) { - wxWindow *child; - if ((child = (wxWindow *)node->Data()) != (wxWindow *)NULL) { - delete child; - if ( GetChildren().Member(child) ) - delete node; - } - } /* while */ -} - -void wxWindow::MakeModal(bool modal) -{ - // Disable all other windows - if (this->IsKindOf(CLASSINFO(wxDialog)) || this->IsKindOf(CLASSINFO(wxFrame))) - { - wxNode *node = wxTopLevelWindows.First(); - while (node) - { - wxWindow *win = (wxWindow *)node->Data(); - if (win != this) - win->Enable(!modal); - - node = node->Next(); - } - } -} - -// If nothing defined for this, try the parent. -// E.g. we may be a button loaded from a resource, with no callback function -// defined. -void wxWindow::OnCommand(wxWindow& win, wxCommandEvent& event) -{ - if (GetEventHandler()->ProcessEvent(event) ) - return; - if (m_windowParent) - m_windowParent->GetEventHandler()->OnCommand(win, event); -} - -void wxWindow::SetConstraints(wxLayoutConstraints *c) -{ - if (m_constraints) - { - UnsetConstraints(m_constraints); - delete m_constraints; - } - m_constraints = c; - if (m_constraints) - { - // Make sure other windows know they're part of a 'meaningful relationship' - if (m_constraints->left.GetOtherWindow() && (m_constraints->left.GetOtherWindow() != this)) - m_constraints->left.GetOtherWindow()->AddConstraintReference((wxWindow *)this); - if (m_constraints->top.GetOtherWindow() && (m_constraints->top.GetOtherWindow() != this)) - m_constraints->top.GetOtherWindow()->AddConstraintReference((wxWindow *)this); - if (m_constraints->right.GetOtherWindow() && (m_constraints->right.GetOtherWindow() != this)) - m_constraints->right.GetOtherWindow()->AddConstraintReference((wxWindow *)this); - if (m_constraints->bottom.GetOtherWindow() && (m_constraints->bottom.GetOtherWindow() != this)) - m_constraints->bottom.GetOtherWindow()->AddConstraintReference((wxWindow *)this); - if (m_constraints->width.GetOtherWindow() && (m_constraints->width.GetOtherWindow() != this)) - m_constraints->width.GetOtherWindow()->AddConstraintReference((wxWindow *)this); - if (m_constraints->height.GetOtherWindow() && (m_constraints->height.GetOtherWindow() != this)) - m_constraints->height.GetOtherWindow()->AddConstraintReference((wxWindow *)this); - if (m_constraints->centreX.GetOtherWindow() && (m_constraints->centreX.GetOtherWindow() != this)) - m_constraints->centreX.GetOtherWindow()->AddConstraintReference((wxWindow *)this); - if (m_constraints->centreY.GetOtherWindow() && (m_constraints->centreY.GetOtherWindow() != this)) - m_constraints->centreY.GetOtherWindow()->AddConstraintReference((wxWindow *)this); - } -} - -// This removes any dangling pointers to this window -// in other windows' constraintsInvolvedIn lists. -void wxWindow::UnsetConstraints(wxLayoutConstraints *c) -{ - if (c) - { - if (c->left.GetOtherWindow() && (c->top.GetOtherWindow() != this)) - c->left.GetOtherWindow()->RemoveConstraintReference((wxWindow *)this); - if (c->top.GetOtherWindow() && (c->top.GetOtherWindow() != this)) - c->top.GetOtherWindow()->RemoveConstraintReference((wxWindow *)this); - if (c->right.GetOtherWindow() && (c->right.GetOtherWindow() != this)) - c->right.GetOtherWindow()->RemoveConstraintReference((wxWindow *)this); - if (c->bottom.GetOtherWindow() && (c->bottom.GetOtherWindow() != this)) - c->bottom.GetOtherWindow()->RemoveConstraintReference((wxWindow *)this); - if (c->width.GetOtherWindow() && (c->width.GetOtherWindow() != this)) - c->width.GetOtherWindow()->RemoveConstraintReference((wxWindow *)this); - if (c->height.GetOtherWindow() && (c->height.GetOtherWindow() != this)) - c->height.GetOtherWindow()->RemoveConstraintReference((wxWindow *)this); - if (c->centreX.GetOtherWindow() && (c->centreX.GetOtherWindow() != this)) - c->centreX.GetOtherWindow()->RemoveConstraintReference((wxWindow *)this); - if (c->centreY.GetOtherWindow() && (c->centreY.GetOtherWindow() != this)) - c->centreY.GetOtherWindow()->RemoveConstraintReference((wxWindow *)this); - } -} - -// Back-pointer to other windows we're involved with, so if we delete -// this window, we must delete any constraints we're involved with. -void wxWindow::AddConstraintReference(wxWindow *otherWin) -{ - if (!m_constraintsInvolvedIn) - m_constraintsInvolvedIn = new wxList; - if (!m_constraintsInvolvedIn->Member(otherWin)) - m_constraintsInvolvedIn->Append(otherWin); -} - -// REMOVE back-pointer to other windows we're involved with. -void wxWindow::RemoveConstraintReference(wxWindow *otherWin) -{ - if (m_constraintsInvolvedIn) - m_constraintsInvolvedIn->DeleteObject(otherWin); -} - -// Reset any constraints that mention this window -void wxWindow::DeleteRelatedConstraints() -{ - if (m_constraintsInvolvedIn) - { - wxNode *node = m_constraintsInvolvedIn->First(); - while (node) - { - wxWindow *win = (wxWindow *)node->Data(); - wxNode *next = node->Next(); - wxLayoutConstraints *constr = win->GetConstraints(); - - // Reset any constraints involving this window - if (constr) - { - constr->left.ResetIfWin((wxWindow *)this); - constr->top.ResetIfWin((wxWindow *)this); - constr->right.ResetIfWin((wxWindow *)this); - constr->bottom.ResetIfWin((wxWindow *)this); - constr->width.ResetIfWin((wxWindow *)this); - constr->height.ResetIfWin((wxWindow *)this); - constr->centreX.ResetIfWin((wxWindow *)this); - constr->centreY.ResetIfWin((wxWindow *)this); - } - delete node; - node = next; - } - delete m_constraintsInvolvedIn; - m_constraintsInvolvedIn = NULL; - } -} - -void wxWindow::SetSizer(wxSizer *sizer) -{ - m_windowSizer = sizer; - if (sizer) - sizer->SetSizerParent((wxWindow *)this); -} - -/* - * New version - */ - -bool wxWindow::Layout() -{ - if (GetConstraints()) - { - int w, h; - GetClientSize(&w, &h); - GetConstraints()->width.SetValue(w); - GetConstraints()->height.SetValue(h); - } - - // If top level (one sizer), evaluate the sizer's constraints. - if (GetSizer()) - { - int noChanges; - GetSizer()->ResetConstraints(); // Mark all constraints as unevaluated - GetSizer()->LayoutPhase1(&noChanges); - GetSizer()->LayoutPhase2(&noChanges); - GetSizer()->SetConstraintSizes(); // Recursively set the real window sizes - return TRUE; - } - else - { - // Otherwise, evaluate child constraints - ResetConstraints(); // Mark all constraints as unevaluated - DoPhase(1); // Just one phase need if no sizers involved - DoPhase(2); - SetConstraintSizes(); // Recursively set the real window sizes - } - return TRUE; -} - - -// Do a phase of evaluating constraints: -// the default behaviour. wxSizers may do a similar -// thing, but also impose their own 'constraints' -// and order the evaluation differently. -bool wxWindow::LayoutPhase1(int *noChanges) -{ - wxLayoutConstraints *constr = GetConstraints(); - if (constr) - { - return constr->SatisfyConstraints((wxWindow *)this, noChanges); - } - else - return TRUE; -} - -bool wxWindow::LayoutPhase2(int *noChanges) -{ - *noChanges = 0; - - // Layout children - DoPhase(1); - DoPhase(2); - return TRUE; -} - -// Do a phase of evaluating child constraints -bool wxWindow::DoPhase(int phase) -{ - int noIterations = 0; - int maxIterations = 500; - int noChanges = 1; - int noFailures = 0; - wxList succeeded; - while ((noChanges > 0) && (noIterations < maxIterations)) - { - noChanges = 0; - noFailures = 0; - wxNode *node = GetChildren().First(); - while (node) - { - wxWindow *child = (wxWindow *)node->Data(); - if (!child->IsKindOf(CLASSINFO(wxFrame)) && !child->IsKindOf(CLASSINFO(wxDialog))) - { - wxLayoutConstraints *constr = child->GetConstraints(); - if (constr) - { - if (succeeded.Member(child)) - { - } - else - { - int tempNoChanges = 0; - bool success = ( (phase == 1) ? child->LayoutPhase1(&tempNoChanges) : child->LayoutPhase2(&tempNoChanges) ) ; - noChanges += tempNoChanges; - if (success) - { - succeeded.Append(child); - } - } - } - } - node = node->Next(); - } - noIterations ++; - } - return TRUE; -} - -void wxWindow::ResetConstraints() -{ - wxLayoutConstraints *constr = GetConstraints(); - if (constr) - { - constr->left.SetDone(FALSE); - constr->top.SetDone(FALSE); - constr->right.SetDone(FALSE); - constr->bottom.SetDone(FALSE); - constr->width.SetDone(FALSE); - constr->height.SetDone(FALSE); - constr->centreX.SetDone(FALSE); - constr->centreY.SetDone(FALSE); - } - wxNode *node = GetChildren().First(); - while (node) - { - wxWindow *win = (wxWindow *)node->Data(); - if (!win->IsKindOf(CLASSINFO(wxFrame)) && !win->IsKindOf(CLASSINFO(wxDialog))) - win->ResetConstraints(); - node = node->Next(); - } -} - -// Need to distinguish between setting the 'fake' size for -// windows and sizers, and setting the real values. -void wxWindow::SetConstraintSizes(bool recurse) -{ - wxLayoutConstraints *constr = GetConstraints(); - if (constr && constr->left.GetDone() && constr->right.GetDone() && - constr->width.GetDone() && constr->height.GetDone()) - { - int x = constr->left.GetValue(); - int y = constr->top.GetValue(); - int w = constr->width.GetValue(); - int h = constr->height.GetValue(); - - // If we don't want to resize this window, just move it... - if ((constr->width.GetRelationship() != wxAsIs) || - (constr->height.GetRelationship() != wxAsIs)) - { - // Calls Layout() recursively. AAAGH. How can we stop that. - // Simply take Layout() out of non-top level OnSizes. - SizerSetSize(x, y, w, h); - } - else - { - SizerMove(x, y); - } - } - else if (constr) - { - char *windowClass = this->GetClassInfo()->GetClassName(); - - wxString winName; - if (GetName() == "") - winName = "unnamed"; - else - winName = GetName(); - wxDebugMsg("Constraint(s) not satisfied for window of type %s, name %s:\n", (const char *)windowClass, (const char *)winName); - if (!constr->left.GetDone()) - wxDebugMsg(" unsatisfied 'left' constraint.\n"); - if (!constr->right.GetDone()) - wxDebugMsg(" unsatisfied 'right' constraint.\n"); - if (!constr->width.GetDone()) - wxDebugMsg(" unsatisfied 'width' constraint.\n"); - if (!constr->height.GetDone()) - wxDebugMsg(" unsatisfied 'height' constraint.\n"); - wxDebugMsg("Please check constraints: try adding AsIs() constraints.\n"); - } - - if (recurse) - { - wxNode *node = GetChildren().First(); - while (node) - { - wxWindow *win = (wxWindow *)node->Data(); - if (!win->IsKindOf(CLASSINFO(wxFrame)) && !win->IsKindOf(CLASSINFO(wxDialog))) - win->SetConstraintSizes(); - node = node->Next(); - } - } -} - -// This assumes that all sizers are 'on' the same -// window, i.e. the parent of this window. -void wxWindow::TransformSizerToActual(int *x, int *y) const -{ - if (!m_sizerParent || m_sizerParent->IsKindOf(CLASSINFO(wxDialog)) || - m_sizerParent->IsKindOf(CLASSINFO(wxFrame)) ) - return; - - int xp, yp; - m_sizerParent->GetPosition(&xp, &yp); - m_sizerParent->TransformSizerToActual(&xp, &yp); - *x += xp; - *y += yp; -} - -void wxWindow::SizerSetSize(int x, int y, int w, int h) -{ - int xx = x; - int yy = y; - TransformSizerToActual(&xx, &yy); - SetSize(xx, yy, w, h); -} - -void wxWindow::SizerMove(int x, int y) -{ - int xx = x; - int yy = y; - TransformSizerToActual(&xx, &yy); - Move(xx, yy); -} - -// Only set the size/position of the constraint (if any) -void wxWindow::SetSizeConstraint(int x, int y, int w, int h) -{ - wxLayoutConstraints *constr = GetConstraints(); - if (constr) - { - if (x != -1) - { - constr->left.SetValue(x); - constr->left.SetDone(TRUE); - } - if (y != -1) - { - constr->top.SetValue(y); - constr->top.SetDone(TRUE); - } - if (w != -1) - { - constr->width.SetValue(w); - constr->width.SetDone(TRUE); - } - if (h != -1) - { - constr->height.SetValue(h); - constr->height.SetDone(TRUE); - } - } -} - -void wxWindow::MoveConstraint(int x, int y) -{ - wxLayoutConstraints *constr = GetConstraints(); - if (constr) - { - if (x != -1) - { - constr->left.SetValue(x); - constr->left.SetDone(TRUE); - } - if (y != -1) - { - constr->top.SetValue(y); - constr->top.SetDone(TRUE); - } - } -} - -void wxWindow::GetSizeConstraint(int *w, int *h) const -{ - wxLayoutConstraints *constr = GetConstraints(); - if (constr) - { - *w = constr->width.GetValue(); - *h = constr->height.GetValue(); - } - else - GetSize(w, h); -} - -void wxWindow::GetClientSizeConstraint(int *w, int *h) const -{ - wxLayoutConstraints *constr = GetConstraints(); - if (constr) - { - *w = constr->width.GetValue(); - *h = constr->height.GetValue(); - } - else - GetClientSize(w, h); -} - -void wxWindow::GetPositionConstraint(int *x, int *y) const -{ - wxLayoutConstraints *constr = GetConstraints(); - if (constr) - { - *x = constr->left.GetValue(); - *y = constr->top.GetValue(); - } - else - GetPosition(x, y); -} - -bool wxWindow::Close(bool force) -{ - wxCloseEvent event(wxEVT_CLOSE_WINDOW, m_windowId); - event.SetEventObject(this); -#if WXWIN_COMPATIBILITY - event.SetForce(force); -#endif - event.SetCanVeto(!force); - - return GetEventHandler()->ProcessEvent(event); -} - -wxObject* wxWindow::GetChild(int number) const -{ - // Return a pointer to the Nth object in the window - wxNode *node = GetChildren().First(); - int n = number; - while (node && n--) - node = node->Next() ; - if (node) - { - wxObject *obj = (wxObject *)node->Data(); - return(obj) ; - } - else - return NULL ; -} - -void wxWindow::OnDefaultAction(wxControl *initiatingItem) -{ - // Obsolete function -} - -void wxWindow::Clear() -{ - wxClientDC dc(this); - wxBrush brush(GetBackgroundColour(), wxSOLID); - dc.SetBackground(brush); - dc.Clear(); -} - -// Fits the panel around the items -void wxWindow::Fit() -{ - int maxX = 0; - int maxY = 0; - wxNode *node = GetChildren().First(); - while ( node ) - { - wxWindow *win = (wxWindow *)node->Data(); - int wx, wy, ww, wh; - win->GetPosition(&wx, &wy); - win->GetSize(&ww, &wh); - if ( wx + ww > maxX ) - maxX = wx + ww; - if ( wy + wh > maxY ) - maxY = wy + wh; - - node = node->Next(); - } - SetClientSize(maxX + 5, maxY + 5); -} - -void wxWindow::SetValidator(const wxValidator& validator) -{ - if ( m_windowValidator ) - delete m_windowValidator; - m_windowValidator = validator.Clone(); - - if ( m_windowValidator ) - m_windowValidator->SetWindow(this) ; -} - -void wxWindow::SetAcceleratorTable(const wxAcceleratorTable& accel) -{ - m_acceleratorTable = accel; -} - -// Find a window by id or name -wxWindow *wxWindow::FindWindow(long id) -{ - if ( GetId() == id) - return this; - - wxNode *node = GetChildren().First(); - while ( node ) - { - wxWindow *child = (wxWindow *)node->Data(); - wxWindow *found = child->FindWindow(id); - if ( found ) - return found; - node = node->Next(); - } - return NULL; -} - -wxWindow *wxWindow::FindWindow(const wxString& name) -{ - if ( GetName() == name) - return this; - - wxNode *node = GetChildren().First(); - while ( node ) - { - wxWindow *child = (wxWindow *)node->Data(); - wxWindow *found = child->FindWindow(name); - if ( found ) - return found; - node = node->Next(); - } - return NULL; -} - -void wxWindow::OnIdle(wxIdleEvent& event) -{ -/* TODO: you may need to do something like this - * if your GUI doesn't generate enter/leave events - - // Check if we need to send a LEAVE event - if (m_mouseInWindow) - { - POINT pt; - ::GetCursorPos(&pt); - if (::WindowFromPoint(pt) != (HWND) GetHWND()) - { - // Generate a LEAVE event - m_mouseInWindow = FALSE; - MSWOnMouseLeave(pt.x, pt.y, 0); - } - } -*/ - - // This calls the UI-update mechanism (querying windows for - // menu/toolbar/control state information) - UpdateWindowUI(); -} - -// Raise the window to the top of the Z order -void wxWindow::Raise() -{ - // TODO -} - -// Lower the window to the bottom of the Z order -void wxWindow::Lower() -{ - // TODO -} - -bool wxWindow::AcceptsFocus() const -{ - return IsShown() && IsEnabled(); -} - -// Update region access -wxRegion wxWindow::GetUpdateRegion() const -{ - return m_updateRegion; -} - -bool wxWindow::IsExposed(int x, int y, int w, int h) const -{ - return (m_updateRegion.Contains(x, y, w, h) != wxOutRegion); -} - -bool wxWindow::IsExposed(const wxPoint& pt) const -{ - return (m_updateRegion.Contains(pt) != wxOutRegion); -} - -bool wxWindow::IsExposed(const wxRect& rect) const -{ - return (m_updateRegion.Contains(rect) != wxOutRegion); -} - -void wxWindow::SetToolTip(const wxString& tooltip) -{ - // TODO -} - -/* - * Allocates control IDs - */ - -int wxWindow::NewControlId() -{ - static int s_controlId = 0; - s_controlId ++; - return s_controlId; -} - -