-----
__X__ any X, but not GTK
-__WXMOTIF__ Motif
-__XT__ Xt; mutually exclusive with WX_MOTIF (?)
-__WXGTK__ GTK
-__XVIEW__ Obsolete!
-__WXMSW__ Any Windows
-__MAC__ MacOS
+__WXMOTIF__ Motif
+__WXXT__ Xt; mutually exclusive with WX_MOTIF (?)
+__WXGTK__ GTK
+__WXMSW__ Any Windows
+__WXMAC__ MacOS
__UNIX__ any Unix
+__WINDOWS__ any Windows
__WIN95__ GUI for Windows 95 and above; NT 4.0 and above.
__WIN32__ WIN32 API
__NT__ Windows NT
-__CURSES__ CURSES
+__WXCURSES__ CURSES
+__WXSTUBS__ Stubbed version ('template' wxWin implementation)
In fact, they should better all start with __WX instead of __ only.
The only GUIs implemented for 2.0 are __WXGTK__, __WXMSW__ and __WXMOTIF__
--- /dev/null
+#ifndef _WX_ACCEL_H_BASE_
+#define _WX_ACCEL_H_BASE_
+
+#if defined(__WXMSW__)
+#include "wx/msw/accel.h"
+#elif defined(__WXMOTIF__)
+#include "wx/motif/accel.h"
+#elif defined(__WXGTK__)
+#include "wx/gtk/accel.h"
+#elif defined(__WXQT__)
+#include "wx/qt/accel.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/accel.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/accel.h"
+#endif
+
+#endif
+ // _WX_ACCEL_H_BASE_
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifndef __APPH_BASE__
-#define __APPH_BASE__
+#ifndef _WX_APP_H_BASE_
+#define _WX_APP_H_BASE_
#ifdef __WXMSW__
class WXDLLEXPORT wxApp;
#if defined(__WXMSW__)
#include "wx/msw/app.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/app.h"
+#include "wx/motif/app.h"
#elif defined(__WXQT__)
#include "wx/qt/app.h"
#elif defined(__WXGTK__)
#include "wx/gtk/app.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/app.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/app.h"
#endif
-
// Having a global instance of this class allows
// wxApp to be aware of the app creator function.
// wxApp can then call this function to create a new
#endif
- // __APPH_BASE__
+ // _WX_APP_H_BASE_
-#ifndef __BITMAPH_BASE__
-#define __BITMAPH_BASE__
+#ifndef _WX_BITMAP_H_BASE_
+#define _WX_BITMAP_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/bitmap.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/bitmap.h"
+#include "wx/motif/bitmap.h"
#elif defined(__WXGTK__)
#include "wx/gtk/bitmap.h"
#elif defined(__WXQT__)
#include "wx/qt/bitmap.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/bitmap.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/bitmap.h"
#endif
#endif
- // __BITMAPH_BASE__
+ // _WX_BITMAP_H_BASE_
-#ifndef __BMPBUTTONH_BASE__
-#define __BMPBUTTONH_BASE__
+#ifndef _WX_BMPBUTTON_H_BASE_
+#define _WX_BMPBUTTON_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/bmpbuttn.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/bmpbuttn.h"
+#include "wx/motif/bmpbuttn.h"
#elif defined(__WXGTK__)
#include "wx/gtk/bmpbuttn.h"
#elif defined(__WXQT__)
#include "wx/qt/bmpbuttn.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/bmpbuttn.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/bmpbuttn.h"
#endif
#endif
-#ifndef __BRUSHH_BASE__
-#define __BRUSHH_BASE__
+#ifndef _WX_BRUSH_H_BASE_
+#define _WX_BRUSH_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/brush.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/brush.h"
+#include "wx/motif/brush.h"
#elif defined(__WXGTK__)
#include "wx/gtk/brush.h"
#elif defined(__WXQT__)
#include "wx/qt/brush.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/brush.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/brush.h"
#endif
#endif
- // __BRUSHH_BASE__
+ // _WX_BRUSH_H_BASE_
-#ifndef __BUTTONH_BASE__
-#define __BUTTONH_BASE__
+#ifndef _WX_BUTTON_H_BASE_
+#define _WX_BUTTON_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/button.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/button.h"
+#include "wx/motif/button.h"
#elif defined(__WXGTK__)
#include "wx/gtk/button.h"
#elif defined(__WXQT__)
#include "wx/qt/button.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/button.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/button.h"
#endif
#endif
- // __BUTTONH_BASE__
+ // _WX_BUTTON_H_BASE_
-#ifndef __CHECKBOXH_BASE__
-#define __CHECKBOXH_BASE__
+#ifndef _WX_CHECKBOX_H_BASE_
+#define _WX_CHECKBOX_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/checkbox.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/checkbox.h"
+#include "wx/motif/checkbox.h"
#elif defined(__WXGTK__)
#include "wx/gtk/checkbox.h"
#elif defined(__WXQT__)
#include "wx/qt/checkbox.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/checkbox.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/checkbox.h"
#endif
#endif
- // __CHECKBOXH_BASE__
+ // _WX_CHECKBOX_H_BASE_
--- /dev/null
+#ifndef _WX_CHECKLST_H_BASE_
+#define _WX_CHECKLST_H_BASE_
+
+#if defined(__WXMSW__)
+#include "wx/msw/checklst.h"
+#elif defined(__WXMOTIF__)
+#include "wx/motif/checklst.h"
+#elif defined(__WXGTK__)
+#include "wx/gtk/checklst.h"
+#elif defined(__WXQT__)
+#include "wx/qt/checklst.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/checklst.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/checklst.h"
+#endif
+
+#endif
+ // _WX_CHECKLST_H_BASE_
-#ifndef __CHOICDLGH_BASE__
-#define __CHOICDLGH_BASE__
+#ifndef _WX_CHOICDLG_H_BASE_
+#define _WX_CHOICDLG_H_BASE_
#include "wx/generic/choicdgg.h"
#endif
- // __CHOICDLGH_BASE__
+ // _WX_CHOICDLG_H_BASE_
-#ifndef __CHOICEH_BASE__
-#define __CHOICEH_BASE__
+#ifndef _WX_CHOICE_H_BASE_
+#define _WX_CHOICE_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/choice.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/choice.h"
+#include "wx/motif/choice.h"
#elif defined(__WXGTK__)
#include "wx/gtk/choice.h"
#elif defined(__WXQT__)
#include "wx/qt/choice.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/choice.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/choice.h"
#endif
#endif
- // __CHOICEH_BASE__
+ // _WX_CHOICE_H_BASE_
-#ifndef __CLIPBRDH_BASE__
-#define __CLIPBRDH_BASE__
+#ifndef _WX_CLIPBRD_H_BASE_
+#define _WX_CLIPBRD_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/clipbrd.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/clipbrd.h"
+#include "wx/motif/clipbrd.h"
#elif defined(__WXGTK__)
#include "wx/gtk/clipbrd.h"
#elif defined(__WXQT__)
#include "wx/gtk/clipbrd.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/clipbrd.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/clipbrd.h"
#endif
#endif
- // __CLIPBRDH_BASE__
+ // _WX_CLIPBRD_H_BASE_
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifndef __CMNDATAH_BASE__
-#define __CMNDATAH_BASE__
+#ifndef _WX_CMNDATA_H_BASE_
+#define _WX_CMNDATA_H_BASE_
#ifdef __GNUG__
#pragma interface "cmndata.h"
#endif
+#include "wx/font.h"
+#include "wx/colour.h"
+
class WXDLLEXPORT wxColourData: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxColourData)
#endif
- // __CMNDATAH_BASE__
+ // _WX_CMNDATA_H_BASE_
-#ifndef __COLORDLGH_BASE__
-#define __COLORDLGH_BASE__
+#ifndef _WX_COLORDLG_H_BASE_
+#define _WX_COLORDLG_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/colordlg.h"
#include "wx/generic/colrdlgg.h"
#elif defined(__WXQT__)
#include "wx/generic/colrdlgg.h"
+#elif defined(__WXMAC__)
+#include "wx/generic/colrdlgg.h"
+#elif defined(__WXSTUBS__)
+#include "wx/generic/colrdlgg.h"
#endif
#endif
- // __COLORDLGH_BASE__
+ // _WX_COLORDLG_H_BASE_
--- /dev/null
+#ifndef _WX_COLOUR_H_BASE_
+#define _WX_COLOUR_H_BASE_
+
+#if defined(__WXMSW__)
+#include "wx/msw/colour.h"
+#elif defined(__WXMOTIF__)
+#include "wx/motif/colour.h"
+#elif defined(__WXGTK__)
+#include "wx/gtk/colour.h"
+#elif defined(__WXQT__)
+#include "wx/qt/colour.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/colour.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/colour.h"
+#endif
+
+#endif
+ // _WX_COLOUR_H_BASE_
-#ifndef __COMBOBOXH_BASE__
-#define __COMBOBOXH_BASE__
+#ifndef _WX_COMBOBOX_H_BASE_
+#define _WX_COMBOBOX_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/combobox.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/combobox.h"
+#include "wx/motif/combobox.h"
#elif defined(__WXGTK__)
#include "wx/gtk/combobox.h"
#elif defined(__WXQT__)
#include "wx/qt/combobox.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/combobox.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/combobox.h"
#endif
#endif
- // __COMBOBOXH_BASE__
+ // _WX_COMBOBOX_H_BASE_
// Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////////
-#ifndef _wxCONFIG_H
-#define _wxCONFIG_H
+#ifndef _WX_CONFIG_H_
+#define _WX_CONFIG_H_
#ifdef __GNUG__
#pragma interface "config.h"
#define wxConfig wxFileConfig
#endif
-#endif //_wxCONFIG_H
+#endif // _WX_CONFIG_H_
-#ifndef __CONTROLH_BASE__
-#define __CONTROLH_BASE__
+#ifndef _WX_CONTROL_H_BASE_
+#define _WX_CONTROL_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/control.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/control.h"
+#include "wx/motif/control.h"
#elif defined(__WXGTK__)
#include "wx/gtk/control.h"
#elif defined(__WXQT__)
#include "wx/qt/control.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/control.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/control.h"
#endif
#endif
- // __CONTROLH_BASE__
+ // _WX_CONTROL_H_BASE_
-#ifndef __CURSORH_BASE__
-#define __CURSORH_BASE__
+#ifndef _WX_CURSOR_H_BASE_
+#define _WX_CURSOR_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/cursor.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/cursor.h"
+#include "wx/motif/cursor.h"
#elif defined(__WXGTK__)
#include "wx/gtk/cursor.h"
#elif defined(__WXQT__)
#include "wx/qt/cursor.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/cursor.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/cursor.h"
#endif
#endif
- // __CURSORH_BASE__
+ // _WX_CURSOR_H_BASE_
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifndef __WXDATEH__
-#define __WXDATEH__
+#ifndef _WX_DATE_H_
+#define _WX_DATE_H_
#ifdef __GNUG__
#pragma interface "date.h"
#endif
#endif
- // __WXDATEH__
+ // _WX_DATE_H_
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
-#ifndef __DATSTREAMH__
-#define __DATSTREAMH__
+#ifndef _WX_DATSTREAM_H_
+#define _WX_DATSTREAM_H_
#ifdef __GNUG__
#pragma interface "datstrm.h"
};
#endif
- // __DATSTREAMH__
+ // _WX_DATSTREAM_H_
-#ifndef __DCH_BASE__
-#define __DCH_BASE__
+#ifndef _WX_DC_H_BASE_
+#define _WX_DC_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/dc.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/dc.h"
+#include "wx/motif/dc.h"
#elif defined(__WXGTK__)
#include "wx/gtk/dc.h"
#elif defined(__WXQT__)
#include "wx/qt/dc.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/dc.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/dc.h"
#endif
#endif
- // __DCH_BASE__
+ // _WX_DC_H_BASE_
-#ifndef __DCCLIENTH_BASE__
-#define __DCCLIENTH_BASE__
+#ifndef _WX_DCCLIENT_H_BASE_
+#define _WX_DCCLIENT_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/dcclient.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/dcclient.h"
+#include "wx/motif/dcclient.h"
#elif defined(__WXGTK__)
#include "wx/gtk/dcclient.h"
#elif defined(__WXQT__)
#include "wx/qt/dcclient.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/dcclient.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/dcclient.h"
#endif
#endif
- // __DCCLIENTH_BASE__
+ // _WX_DCCLIENT_H_BASE_
-#ifndef __DCMEMORYH_BASE__
-#define __DCMEMORYH_BASE__
+#ifndef _WX_DCMEMORY_H_BASE_
+#define _WX_DCMEMORY_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/dcmemory.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/dcmemory.h"
+#include "wx/motif/dcmemory.h"
#elif defined(__WXGTK__)
#include "wx/gtk/dcmemory.h"
#elif defined(__WXQT__)
#include "wx/qt/dcmemory.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/dcmemory.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/dcmemory.h"
#endif
#endif
- // __DCMEMORYH_BASE__
+ // _WX_DCMEMORY_H_BASE_
-#ifndef __DCPRINTH_BASE__
-#define __DCPRINTH_BASE__
+#ifndef _WX_DCPRINT_H_BASE_
+#define _WX_DCPRINT_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/dcprint.h"
#endif
#endif
- // __DCPRINTH_BASE__
+ // _WX_DCPRINT_H_BASE_
-#ifndef __DCSCREENH_BASE__
-#define __DCSCREENH_BASE__
+#ifndef _WX_DCSCREEN_H_BASE_
+#define _WX_DCSCREEN_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/dcscreen.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/dcscreen.h"
+#include "wx/motif/dcscreen.h"
#elif defined(__WXGTK__)
#include "wx/gtk/dcscreen.h"
#elif defined(__WXQT__)
#include "wx/qt/dcscreen.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/dcscreen.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/dcscreen.h"
#endif
#endif
- // __DCSCREENH_BASE__
+ // _WX_DCSCREEN_H_BASE_
-#ifndef __DDEH_BASE__
-#define __DDEH_BASE__
+#ifndef _WX_DDE_H_BASE_
+#define _WX_DDE_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/dde.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/dde.h"
+#include "wx/motif/dde.h"
#elif defined(__WXGTK__)
#include "wx/gtk/dde.h"
#elif defined(__WXQT__)
#include "wx/qt/dde.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/dde.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/dde.h"
#endif
#endif
- // __DDEH_BASE__
+ // _WX_DDE_H_BASE_
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
-#ifndef __WXDEBUGH__
-#define __WXDEBUGH__
+#ifndef _WX_DEBUG_H_
+#define _WX_DEBUG_H_
#include <assert.h>
//@}
-#endif // __WXDEBUGH__
+#endif // _WX_DEBUG_H_
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifndef __DEFSH__
-#define __DEFSH__
+#ifndef _WX_DEFS_H_
+#define _WX_DEFS_H_
#ifdef __GNUG__
#pragma interface "defs.h"
#endif
#if defined(__WXMOTIF__)
# define __X__
-#elif defined(__WXMSW__) || defined(__WINDOWS_386__) || defined(__NT__) || defined(__MSDOS__)
-# ifndef __WXMSW__
-# define __WXMSW__
-# endif
#endif
// wxWindows checks for WIN32, not __WIN32__
-#if ((defined(WIN32) || defined(__NT__)) && !defined(__WIN32__))
+#if ((defined(WIN32) || defined(__NT__)) && !defined(__WIN32__) && !defined(__WXSTUBS__))
#define __WIN32__
#endif
#if defined(__WXMSW__) && defined(__X__)
# error "Target can't be both X and Windows"
#elif !defined(__WXMOTIF__) && !defined(__WXMSW__) && !defined(__WXGTK__) && \
- !defined(__MAC__) && !defined(__X__) && !defined(__WXQT__)
-#error "No Target! Use -D[__WXMOTIF__|__WXGTK__|__WXMSW__|__MAC__|__QT__]"
+ !defined(__WXMAC__) && !defined(__X__) && !defined(__WXQT__) && !defined(__WXSTUBS__)
+#error "No Target! Use -D[__WXMOTIF__|__WXGTK__|__WXMSW__|__WXMAC__|__WXQT__|__WXSTUBS__]"
#endif
-#if defined(__WXMOTIF__) || defined(__WXGTK__) || defined(__WXQT__)
+#if defined(__WXMOTIF__) || defined(__WXGTK__) || defined(__WXQT__) || defined(__WXSTUBS__)
// Bool is now obsolete, use bool instead
// typedef int Bool;
#endif
#ifndef __UNIX__ // Windows
- #ifndef __WXMSW__
- #define __WXMSW__
- #endif
-
#if defined(_MSC_VER)
#define __VISUALC__
#elif defined(__BCPLUSPLUS__) && !defined(__BORLANDC__)
#elif defined(__WXMSW__)
#define FILE_PATH_SEPARATOR ('\\')
#else
- #error "don't know path separator for this platform"
+ #define FILE_PATH_SEPARATOR ('/')
#endif
// ----------------------------------------------------------------------------
// OS mnemonics -- Identify the running OS (useful for Windows)
// [Not all platforms are currently available or supported]
enum {
- wxCURSES,
+ wxUNKNOWN_PLATFORM,
+ wxCURSES, // Text-only CURSES
wxXVIEW_X, // Sun's XView OpenLOOK toolkit
wxMOTIF_X, // OSF Motif 1.x.x
- wxCOSE_X, // OSF Common Desktop Environment
+ wxCOSE_X, // OSF Common Desktop Environment
wxNEXTSTEP, // NeXTStep
wxMACINTOSH, // Apple System 7
- wxGEOS, // GEOS
- wxOS2_PM, // OS/2 Workplace
+ wxGTK, // GTK
+ wxQT, // Qt
+ wxGEOS, // GEOS
+ wxOS2_PM, // OS/2 Workplace
wxWINDOWS, // Windows or WfW
wxPENWINDOWS, // Windows for Pen Computing
wxWINDOWS_NT, // Windows NT
- wxWIN32S, // Windows 32S API
- wxWIN95, // Windows 95
- wxWIN386 // Watcom 32-bit supervisor modus
+ wxWIN32S, // Windows 32S API
+ wxWIN95, // Windows 95
+ wxWIN386 // Watcom 32-bit supervisor modus
};
// Printing
#endif
#endif
- // __WXDEFSH__
+ // _WX_DEFS_H_
-#ifndef __DIALOGH_BASE__
-#define __DIALOGH_BASE__
+#ifndef _WX_DIALOG_H_BASE_
+#define _WX_DIALOG_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/dialog.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/dialog.h"
+#include "wx/motif/dialog.h"
#elif defined(__WXGTK__)
#include "wx/gtk/dialog.h"
#elif defined(__WXQT__)
#include "wx/qt/dialog.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/dialog.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/dialog.h"
#endif
#endif
- // __DIALOGH_BASE__
+ // _WX_DIALOG_H_BASE_
-#ifndef __DIRDLGH_BASE__
-#define __DIRDLGH_BASE__
+#ifndef _WX_DIRDLG_H_BASE_
+#define _WX_DIRDLG_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/dirdlg.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/dirdlg.h"
+#include "wx/motif/dirdlg.h"
#elif defined(__WXGTK__)
#include "wx/gtk/dirdlg.h"
#elif defined(__WXQT__)
#include "wx/qt/dirdlg.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/dirdlg.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/dirdlg.h"
#endif
#endif
- // __DIRDLGH_BASE__
+ // _WX_DIRDLG_H_BASE_
-#ifndef __DNDH_BASE__
-#define __DNDH_BASE__
+#ifndef _WX_DND_H_BASE_
+#define _WX_DND_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/ole/dropsrc.h"
#include "wx/gtk/dnd.h"
#elif defined(__WXQT__)
#include "wx/qt/dnd.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/dnd.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/dnd.h"
#endif
#endif
- // __DNDH_BASE__
+ // _WX_DND_H_BASE_
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifndef __DOCH__
-#define __DOCH__
+#ifndef _WX_DOCH__
+#define _WX_DOCH__
#ifdef __GNUG__
#pragma interface "docview.h"
-#ifndef __DYNLIB_H__
-#define __DYNLIB_H__
+#ifndef _WX_DYNLIB_H__
+#define _WX_DYNLIB_H__
#ifdef __GNUG__
#pragma interface
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifndef __EVENTH__
-#define __EVENTH__
+#ifndef _WX_EVENTH__
+#define _WX_EVENTH__
#ifdef __GNUG__
#pragma interface "event.h"
wxEVT_NC_RIGHT_DCLICK,
*/
+class WXDLLEXPORT wxDC;
class WXDLLEXPORT wxMouseEvent: public wxEvent
{
DECLARE_DYNAMIC_CLASS(wxMouseEvent)
{ wxEVT_UPDATE_UI, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxUpdateUIEventFunction) & func, NULL },\
#endif
- // __EVENTH__
+ // _WX_EVENTH__
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifndef __EXPRH__
-#define __EXPRH__
+#ifndef _WX_EXPRH__
+#define _WX_EXPRH__
#include <math.h>
#include <stdlib.h>
#endif
#endif
- // __EXPRH__
+ // _WX_EXPRH__
};
#endif
- // __FILEH__
+ // _WX_FILEH__
-#ifndef __FILEDLGH_BASE__
-#define __FILEDLGH_BASE__
+#ifndef _WX_FILEDLG_H_BASE_
+#define _WX_FILEDLG_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/filedlg.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/filedlg.h"
+#include "wx/motif/filedlg.h"
#elif defined(__WXGTK__)
#include "wx/gtk/filedlg.h"
#elif defined(__WXQT__)
#include "wx/qt/filedlg.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/filedlg.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/filedlg.h"
#endif
#endif
- // __FILEDLGH_BASE__
+ // _WX_FILEDLG_H_BASE_
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
-#ifndef __FILEFNH__
-#define __FILEFNH__
+#ifndef _FILEFN_H_
+#define _FILEFN_H_
#ifdef __GNUG__
#pragma interface "filefn.h"
};
#endif
- // __FILEFNH__
+ // _WX_FILEFN_H_
-#ifndef __FONTH_BASE__
-#define __FONTH_BASE__
+#ifndef _WX_FONT_H_BASE_
+#define _WX_FONT_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/font.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/font.h"
+#include "wx/motif/font.h"
#elif defined(__WXGTK__)
#include "wx/gtk/font.h"
#elif defined(__WXQT__)
#include "wx/qt/font.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/font.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/font.h"
#endif
#endif
- // __FONTH_BASE__
+ // _WX_FONT_H_BASE_
-#ifndef __FONTDLGH_BASE__
-#define __FONTDLGH_BASE__
+#ifndef _WX_FONTDLG_H_BASE_
+#define _WX_FONTDLG_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/fontdlg.h"
#include "wx/generic/fontdlgg.h"
# define wxFontDialog wxGenericFontDialog
# define classwxFontDialog classwxGenericFontDialog
+#elif defined(__WXMAC__)
+#include "wx/generic/fontdlgg.h"
+# define wxFontDialog wxGenericFontDialog
+# define classwxFontDialog classwxGenericFontDialog
+#elif defined(__WXSTUBS__)
+#include "wx/generic/fontdlgg.h"
+# define wxFontDialog wxGenericFontDialog
+# define classwxFontDialog classwxGenericFontDialog
#endif
#endif
- // __FONTDLGH_BASE__
+ // _WX_FONTDLG_H_BASE_
-#ifndef __FRAMEH_BASE__
-#define __FRAMEH_BASE__
+#ifndef _WX_FRAME_H_BASE_
+#define _WX_FRAME_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/frame.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/frame.h"
+#include "wx/motif/frame.h"
#elif defined(__WXGTK__)
#include "wx/gtk/frame.h"
#elif defined(__WXQT__)
#include "wx/qt/frame.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/frame.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/frame.h"
#endif
#endif
- // __FRAMEH_BASE__
+ // _WX_FRAME_H_BASE_
// Copyright: (c) Guilhem Lavaux
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifndef __WXFSTREAM_H__
-#define __WXFSTREAM_H__
+#ifndef _WX_WXFSTREAM_H__
+#define _WX_WXFSTREAM_H__
#include <wx/object.h>
#include <wx/string.h>
-#ifndef __GAUGEH_BASE__
-#define __GAUGEH_BASE__
+#ifndef _WX_GAUGE_H_BASE_
+#define _WX_GAUGE_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/gauge.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/gauge.h"
+#include "wx/motif/gauge.h"
#elif defined(__WXGTK__)
#include "wx/gtk/gauge.h"
#elif defined(__WXQT__)
#include "wx/qt/gauge.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/gauge.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/gauge.h"
#endif
#endif
- // __GAUGEH_BASE__
+ // _WX_GAUGE_H_BASE_
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifndef __GDICMNH__
-#define __GDICMNH__
+#ifndef _WX_GDICMNH__
+#define _WX_GDICMNH__
#ifdef __GNUG__
#pragma interface "gdicmn.h"
#include "wx/object.h"
#include "wx/list.h"
#include "wx/hash.h"
+#include "wx/string.h"
#include "wx/setup.h"
-
-#ifdef __WXMSW__
-#include "wx/msw/colour.h"
-#elif defined(__WXMOTIF__)
-#include "wx/xt/colour.h"
-#elif defined(__WXGTK__)
-#include "wx/gtk/colour.h"
-#elif defined(__WXQT__)
-#include "wx/qt/colour.h"
-#endif
+#include "wx/colour.h"
// Standard cursors
typedef enum {
class WXDLLEXPORT wxBitmap;
class WXDLLEXPORT wxCursor;
class WXDLLEXPORT wxIcon;
+class WXDLLEXPORT wxColour;
+class WXDLLEXPORT wxString;
// Management of pens, brushes and fonts
class WXDLLEXPORT wxPenList: public wxList
};
#endif
- // __GDICMNH__
+ // _WX_GDICMNH__
-#ifndef __GDIOBJH_BASE__
-#define __GDIOBJH_BASE__
+#ifndef _WX_GDIOBJ_H_BASE_
+#define _WX_GDIOBJ_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/gdiobj.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/gdiobj.h"
+#include "wx/motif/gdiobj.h"
#elif defined(__WXGTK__)
#include "wx/gtk/gdiobj.h"
#elif defined(__WXQT__)
#include "wx/qt/gdiobj.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/gdiobj.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/gdiobj.h"
#endif
#endif
- // __GDIOBJH_BASE__
+ // _WX_GDIOBJ_H_BASE_
-#ifndef __GRIDH_BASE__
-#define __GRIDH_BASE__
+#ifndef _WX_GRID_H_BASE_
+#define _WX_GRID_H_BASE_
#include "wx/generic/gridg.h"
#endif
#endif
- // __GRIDH_BASE__
+ // _WX_GRID_H_BASE_
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifndef __WXHASHH__
-#define __WXHASHH__
+#ifndef _WX_WXHASHH__
+#define _WX_WXHASHH__
#ifdef __GNUG__
#pragma interface "hash.h"
};
#endif
- // __WXHASHH__
+ // _WX_WXHASHH__
-#ifndef __HELPH_BASE__
-#define __HELPH_BASE__
+#ifndef _WX_HELP_H_BASE_
+#define _WX_HELP_H_BASE_
#ifdef __WXMSW__
#include "wx/msw/helpwin.h"
#endif
#endif
- // __HELPH_BASE__
+ // _WX_HELP_H_BASE_
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
-#ifndef __HELPBASEH__
-#define __HELPBASEH__
+#ifndef _WX_HELPBASEH__
+#define _WX_HELPBASEH__
#ifdef __GNUG__
#pragma interface "helpbase.h"
#endif // USE_HELP
#endif
- // __HELPBASEH__
+ // _WX_HELPBASEH__
-#ifndef __HELPHTMLH_BASE__
-#define __HELPHTMLH_BASE__
+#ifndef _WX_HELPHTML_H_BASE_
+#define _WX_HELPHTML_H_BASE_
#include "wx/generic/helphtml.h"
#endif
- // __HELPHTMLH_BASE__
+ // _WX_HELPHTML_H_BASE_
-#ifndef __HELPWINH_BASE__
-#define __HELPWINH_BASE__
+#ifndef _WX_HELPWIN_H_BASE_
+#define _WX_HELPWIN_H_BASE_
#include "wx/msw/helpwin.h"
#endif
- // __HELPWINH_BASE__
+ // _WX_HELPWIN_H_BASE_
-#ifndef __HELPXLPH_BASE__
-#define __HELPXLPH_BASE__
+#ifndef _WX_HELPXLP_H_BASE_
+#define _WX_HELPXLP_H_BASE_
#include "wx/generic/helpxlp.h"
#endif
- // __HELPXLPH_BASE__
+ // _WX_HELPXLP_H_BASE_
-#ifndef __ICONH_BASE__
-#define __ICONH_BASE__
+#ifndef _WX_ICON_H_BASE_
+#define _WX_ICON_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/icon.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/icon.h"
+#include "wx/motif/icon.h"
#elif defined(__WXGTK__)
#include "wx/gtk/icon.h"
#elif defined(__WXQT__)
#include "wx/qt/icon.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/icon.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/icon.h"
#endif
#endif
- // __ICONH_BASE__
+ // _WX_ICON_H_BASE_
-#ifndef __IMAGLISTH_BASE__
-#define __IMAGLISTH_BASE__
+#ifndef _WX_IMAGLIST_H_BASE_
+#define _WX_IMAGLIST_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/imaglist.h"
#include "wx/generic/imaglist.h"
#elif defined(__WXQT__)
#include "wx/generic/imaglist.h"
+#elif defined(__WXMAC__)
+#include "wx/generic/imaglist.h"
+#elif defined(__WXSTUBS__)
+#include "wx/generic/imaglist.h"
#endif
#endif
- // __IMAGLISTH_BASE__
+ // _WX_IMAGLIST_H_BASE_
}
#endif
- // __INTLH__
+ // _WX_INTLH__
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
-#ifndef __IPCBASEH__
-#define __IPCBASEH__
+#ifndef _WX_IPCBASEH__
+#define _WX_IPCBASEH__
#ifdef __GNUG__
#pragma interface "ipcbase.h"
};
#endif
- // __IPCBASEH__
+ // _WX_IPCBASEH__
-#ifndef __JOYSTICKH_BASE__
-#define __JOYSTICKH_BASE__
+#ifndef _WX_JOYSTICK_H_BASE_
+#define _WX_JOYSTICK_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/joystick.h"
#elif defined(__WXMOTIF__)
+#include "wx/motif/joystick.h"
#elif defined(__WXGTK__)
#include "wx/gtk/joystick.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/joystick.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/joystick.h"
#endif
#endif
- // __JOYSTICKH_BASE__
+ // _WX_JOYSTICK_H_BASE_
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
-#ifndef __LAYOUTH__
-#define __LAYOUTH__
+#ifndef _WX_LAYOUTH__
+#define _WX_LAYOUTH__
#ifdef __GNUG__
#pragma interface "layout.h"
};
#endif
- // __LAYOUTH__
+ // _WX_LAYOUTH__
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
-#ifndef __LISTH__
-#define __LISTH__
+#ifndef _WX_LISTH__
+#define _WX_LISTH__
#ifdef __GNUG__
#pragma interface "list.h"
};
#endif
- // __LISTH__
+ // _WX_LISTH__
-#ifndef __LISTBOXH_BASE__
-#define __LISTBOXH_BASE__
+#ifndef _WX_LISTBOX_H_BASE_
+#define _WX_LISTBOX_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/listbox.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/listbox.h"
+#include "wx/motif/listbox.h"
#elif defined(__WXGTK__)
#include "wx/gtk/listbox.h"
#elif defined(__WXQT__)
#include "wx/qt/listbox.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/listbox.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/listbox.h"
#endif
#endif
- // __LISTBOXH_BASE__
+ // _WX_LISTBOX_H_BASE_
-#ifndef __LISTCTRLH_BASE__
-#define __LISTCTRLH_BASE__
+#ifndef _WX_LISTCTRL_H_BASE_
+#define _WX_LISTCTRL_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/listctrl.h"
#include "wx/generic/listctrl.h"
#elif defined(__WXQT__)
#include "wx/generic/listctrl.h"
+#elif defined(__WXMAC__)
+#include "wx/generic/listctrl.h"
+#elif defined(__WXSTUBS__)
+#include "wx/generic/listctrl.h"
#endif
#endif
- // __LISTCTRLH_BASE__
+ // _WX_LISTCTRL_H_BASE_
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
-#ifndef __LOGH__
-#define __LOGH__
+#ifndef _WX_LOG_H_
+#define _WX_LOG_H_
#ifdef __GNUG__
#pragma interface "log.h"
};
// log everything to an "ostream", cerr by default
+class ostream;
class WXDLLEXPORT wxLogStream : public wxLog
{
public:
inline void wxLogLastError(const char *) { }
#endif //debug/!debug
-#endif //__LOGH__
+#endif // _WX_LOG_H_
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifndef __MATRIXH__
-#define __MATRIXH__
+#ifndef _WX_MATRIXH__
+#define _WX_MATRIXH__
#ifdef __GNUG__
#pragma interface "matrix.h"
}
#endif
- // __MATRIXH__
+ // _WX_MATRIXH__
-#ifndef __MDIH_BASE__
-#define __MDIH_BASE__
+#ifndef _WX_MDI_H_BASE_
+#define _WX_MDI_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/mdi.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/mdi.h"
+#include "wx/motif/mdi.h"
#elif defined(__WXGTK__)
#include "wx/gtk/mdi.h"
#elif defined(__WXQT__)
#include "wx/qt/mdi.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/mdi.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/mdi.h"
#endif
#endif
- // __MDIH_BASE__
+ // _WX_MDI_H_BASE_
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
-#ifndef __MEMORYH__
-#define __MEMORYH__
+#ifndef _WX_MEMORYH__
+#define _WX_MEMORYH__
#ifdef __GNUG__
#pragma interface "memory.h"
#endif // WXDEBUG
#endif
- // __MEMORYH__
+ // _WX_MEMORYH__
-#ifndef __MENUH_BASE__
-#define __MENUH_BASE__
+#ifndef _WX_MENU_H_BASE_
+#define _WX_MENU_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/menu.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/menu.h"
+#include "wx/motif/menu.h"
#elif defined(__WXGTK__)
#include "wx/gtk/menu.h"
#elif defined(__WXQT__)
#include "wx/qt/menu.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/menu.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/menu.h"
#endif
#endif
- // __MENUH_BASE__
+ // _WX_MENU_H_BASE_
-#ifndef __METAFILEH_BASE__
-#define __METAFILEH_BASE__
+#ifndef _WX_METAFILE_H_BASE_
+#define _WX_METAFILE_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/metafile.h"
#endif
#endif
- // __METAFILEH_BASE__
+ // _WX_METAFILE_H_BASE_
-#ifndef __MINIFRAMH_BASE__
-#define __MINIFRAMH_BASE_
+#ifndef _WX_MINIFRAM_H_BASE_
+#define _WX_MINIFRAMH_BASE_
#if defined(__WXMSW__)
#include "wx/msw/minifram.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/minifram.h"
+#include "wx/motif/minifram.h"
#elif defined(__WXGTK__)
#include "wx/gtk/minifram.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/minifram.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/minifram.h"
#endif
#endif
- // __MINIFRAMH_BASE__
+ // _WX_MINIFRAM_H_BASE_
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifndef __MODULEH__
-#define __MODULEH__
+#ifndef _WX_MODULEH__
+#define _WX_MODULEH__
#ifdef __GNUG__
#pragma interface "module.h"
-#ifndef __MSGDLGH_BASE__
-#define __MSGDLGH_BASE__
+#ifndef _WX_MSGDLG_H_BASE_
+#define _WX_MSGDLG_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/msgdlg.h"
#include "wx/generic/msgdlgg.h"
#elif defined(__WXQT__)
#include "wx/generic/msgdlgg.h"
+#elif defined(__WXMAC__)
+#include "wx/generic/msgdlgg.h"
+#elif defined(__WXSTUBS__)
+#include "wx/generic/msgdlgg.h"
#endif
#endif
- // __MSGDLGH_BASE__
+ // _WX_MSGDLG_H_BASE_
// Copyright: (c) Guilhem Lavaux
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifndef __WXMMSTREAM_H__
-#define __WXMMSTREAM_H__
+#ifndef _WX_WXMMSTREAM_H__
+#define _WX_WXMMSTREAM_H__
#include <wx/stream.h>
CrossHair(pt.x, pt.y);
}
- virtual void DrawArc(long x1,long y1,long x2,long y2,double xc, double yc);
- inline void DrawArc(const wxPoint& pt1, const wxPoint& pt2, double xc, double yc)
+ virtual void DrawArc(long x1,long y1,long x2,long y2,long xc, long yc);
+ inline void DrawArc(const wxPoint& pt1, const wxPoint& pt2, const wxPoint& centre)
{
- DrawArc(pt1.x, pt1.y, pt2.x, pt2.y, xc, yc);
+ DrawArc(pt1.x, pt1.y, pt2.x, pt2.y, centre.x, centre.y);
}
virtual void DrawEllipticArc (long x, long y, long w, long h, double sa, double ea);
-#ifndef __NOTEBOOKH_BASE__
-#define __NOTEBOOKH_BASE__
+#ifndef _WX_NOTEBOOK_H_BASE_
+#define _WX_NOTEBOOK_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/notebook.h"
#elif defined(__WXMOTIF__)
- #error "wxNotebook not implemented under Motif"
+ #include "wx/motif/notebook.h"
#elif defined(__WXGTK__)
#include "wx/gtk/notebook.h"
#elif defined(__WXQT__)
#include "wx/qt/notebook.h"
+#elif defined(__WXMAC__)
+ #include "wx/mac/notebook.h"
+#elif defined(__WXSTUBS__)
+ #include "wx/stubs/notebook.h"
#endif
#endif
- // __NOTEBOOKH_BASE__
+ // _WX_NOTEBOOK_H_BASE_
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifndef __OBJECTH__
-#define __OBJECTH__
+#ifndef _WX_OBJECTH__
+#define _WX_OBJECTH__
#ifdef __GNUG__
#pragma interface "object.h"
#endif
#endif
- // __OBJECTH__
+ // _WX_OBJECTH__
// Copyright: (c) 1998 Guilhem Lavaux
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
-#ifndef __WXOBJSTRM_H__
-#define __WXOBJSTRM_H__
+#ifndef _WX_WXOBJSTRM_H__
+#define _WX_WXOBJSTRM_H__
#ifdef __GNUG__
#pragma interface
#pragma interface "odbc.h"
#endif
-#ifndef __ODBCH__
-#define __ODBCH__
+#ifndef _WX_ODBCH__
+#define _WX_ODBCH__
#ifdef __WXMSW__
#include <windows.h>
-#ifndef __PALETTEH_BASE__
-#define __PALETTEH_BASE__
+#ifndef _WX_PALETTE_H_BASE_
+#define _WX_PALETTE_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/palette.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/palette.h"
+#include "wx/motif/palette.h"
#elif defined(__WXGTK__)
#include "wx/gtk/palette.h"
#elif defined(__WXQT__)
#include "wx/qt/palette.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/palette.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/palette.h"
#endif
#endif
- // __PALETTEH_BASE__
+ // _WX_PALETTE_H_BASE_
-#ifndef __PANELH_BASE__
-#define __PANELH_BASE__
+#ifndef _WX_PANEL_H_BASE_
+#define _WX_PANEL_H_BASE_
#include "wx/generic/panelg.h"
#endif
- // __PANELH_BASE_
+ // _WX_PANELH_BASE_
-#ifndef __PENH_BASE__
-#define __PENH_BASE__
+#ifndef _WX_PEN_H_BASE_
+#define _WX_PEN_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/pen.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/pen.h"
+#include "wx/motif/pen.h"
#elif defined(__WXGTK__)
#include "wx/gtk/pen.h"
#elif defined(__WXQT__)
#include "wx/qt/pen.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/pen.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/pen.h"
#endif
#endif
- // __PENH_BASE__
+ // _WX_PEN_H_BASE_
-#ifndef __PNGHANDH_BASE__
-#define __PNGHANDH_BASE__
+#ifndef _WX_PNGHAND_H_BASE_
+#define _WX_PNGHAND_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/pnghand.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/pnghand.h"
+#include "wx/motif/pnghand.h"
#elif defined(__WXGTK__)
#include "wx/gtk/pnghand.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/pnghand.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/pnghand.h"
#endif
#endif
- // __PNGHANDH_BASE__
+ // _WX_PNGHAND_H_BASE_
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifndef __POSTSCRPH__
-#define __POSTSCRPH__
+#ifndef _WX_POSTSCRPH__
+#define _WX_POSTSCRPH__
#ifdef __GNUG__
#pragma interface "postscrp.h"
#endif // USE_POSTSCRIPT
#endif
- // __POSTSCRPH__
+ // _WX_POSTSCRPH__
-#ifndef __PRINTH_BASE__
-#define __PRINTH_BASE__
+#ifndef _WX_PRINT_H_BASE_
+#define _WX_PRINT_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/printwin.h"
#endif
- // __PRINTH_BASE__
+ // _WX_PRINT_H_BASE_
-#ifndef __PRINTDLGH_BASE__
-#define __PRINTDLGH_BASE__
+#ifndef _WX_PRINTDLG_H_BASE_
+#define _WX_PRINTDLG_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/printdlg.h"
#include "wx/generic/prntdlgg.h"
#elif defined(__WXGTK__)
#include "wx/generic/prntdlgg.h"
+#elif defined(__WXQT__)
+#include "wx/generic/prntdlgg.h"
+#elif defined(__WXMAC__)
+#include "wx/generic/prntdlgg.h"
+#elif defined(__WXSRUBS__)
+#include "wx/generic/prntdlgg.h"
#endif
#endif
- // __PRINTDLGH_BASE__
+ // _WX_PRINTDLG_H_BASE_
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifndef __PRNTBASEH__
-#define __PRNTBASEH__
+#ifndef _WX_PRNTBASEH__
+#define _WX_PRNTBASEH__
#ifdef __GNUG__
#pragma interface "prntbase.h"
#include "wx/panel.h"
#include "wx/scrolwin.h"
#include "wx/dialog.h"
+#include "wx/frame.h"
class WXDLLEXPORT wxDC;
class WXDLLEXPORT wxButton;
};
#endif
- // __PRNTBASEH__
+ // _WX_PRNTBASEH__
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
-#ifndef __PROCESSH__
-#define __PROCESSH__
+#ifndef _WX_PROCESSH__
+#define _WX_PROCESSH__
#ifdef __GNUG__
#pragma interface "process.h"
#define EVT_END_PROCESS(id, func) { wxEVT_END_TERMINATE, id, -1, (wxObjectEvent) (wxEventFunction) (wxProcessEventFunction) & fn, NULL},
#endif
- // __PROCESSH__
+ // _WX_PROCESSH__
-#ifndef __RADIOBOXH_BASE__
-#define __RADIOBOXH_BASE__
+#ifndef _WX_RADIOBOX_H_BASE_
+#define _WX_RADIOBOX_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/radiobox.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/radiobox.h"
+#include "wx/motif/radiobox.h"
#elif defined(__WXGTK__)
#include "wx/gtk/radiobox.h"
#elif defined(__WXQT__)
#include "wx/qt/radiobox.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/radiobox.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/radiobox.h"
#endif
#endif
- // __RADIOBOXH_BASE__
+ // _WX_RADIOBOX_H_BASE_
-#ifndef __RADIOBUTH_BASE__
-#define __RADIOBUTH_BASE__
+#ifndef _WX_RADIOBUT_H_BASE_
+#define _WX_RADIOBUT_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/radiobut.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/radiobut.h"
+#include "wx/motif/radiobut.h"
#elif defined(__WXGTK__)
#include "wx/gtk/radiobut.h"
#elif defined(__WXQT__)
#include "wx/qt/radiobut.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/radiobut.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/radiobut.h"
#endif
#endif
- // __RADIOBUTH_BASE__
+ // _WX_RADIOBUT_H_BASE_
-#ifndef __REGIONH_BASE__
-#define __REGIONH_BASE__
+#ifndef _WX_REGION_H_BASE_
+#define _WX_REGION_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/region.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/region.h"
+#include "wx/motif/region.h"
#elif defined(__WXGTK__)
#include "wx/gtk/region.h"
#elif defined(__WXQT__)
#include "wx/qt/region.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/region.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/region.h"
#endif
#endif
- // __REGIONH_BASE__
+ // _WX_REGION_H_BASE_
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifndef __RESOURCEH__
-#define __RESOURCEH__
+#ifndef _WX_RESOURCEH__
+#define _WX_RESOURCEH__
#ifdef __GNUG__
#pragma interface "resource.h"
#endif
#endif
- // __RESOURCEH__
+ // _WX_RESOURCEH__
-#ifndef __SCROLBARH_BASE__
-#define __SCROLBARH_BASE__
+#ifndef _WX_SCROLBAR_H_BASE_
+#define _WX_SCROLBAR_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/scrolbar.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/scrolbar.h"
+#include "wx/motif/scrolbar.h"
#elif defined(__WXGTK__)
#include "wx/gtk/scrolbar.h"
#elif defined(__WXQT__)
#include "wx/qt/scrolbar.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/scrolbar.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/scrolbar.h"
#endif
#endif
- // __SCROLBARH_BASE__
+ // _WX_SCROLBAR_H_BASE_
-#ifndef __SCROLWINH_BASE__
-#define __SCROLWINH_BASE__
+#ifndef _WX_SCROLWIN_H_BASE_
+#define _WX_SCROLWIN_H_BASE_
#include "wx/generic/scrolwin.h"
#endif
- // __SCROLWINH_BASE__
+ // _WX_SCROLWIN_H_BASE_
// Copyright: (c) Guilhem Lavaux
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
-#ifndef __WX_SERBASEH_H__
-#define __WX_SERBASEH_H__
+#ifndef _WX_WX_SERBASEH_H__
+#define _WX_WX_SERBASEH_H__
#include <wx/dynlib.h>
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifndef __SETTINGSH_BASE__
-#define __SETTINGSH_BASE__
+#ifndef _WX_SETTINGS_H_BASE_
+#define _WX_SETTINGS_H_BASE_
#define wxSYS_WHITE_BRUSH 0
#define wxSYS_LTGRAY_BRUSH 1
#if defined(__WXMSW__)
#include "wx/msw/settings.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/settings.h"
+#include "wx/motif/settings.h"
#elif defined(__WXGTK__)
#include "wx/gtk/settings.h"
#elif defined(__WXQT__)
#include "wx/qt/settings.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/settings.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/settings.h"
#endif
#endif
- // __SETTINGSH_BASE__
+ // _WX_SETTINGS_H_BASE_
-#ifndef __SETUPH_BASE__
-#define __SETUPH_BASE__
+#ifndef _WX_SETUP_H_BASE_
+#define _WX_SETUP_H_BASE_
// compatibility code, to be removed asap:
-#if !defined(__WXMSW__) && !defined(__WXGTK__) && !defined(__WXMOTIF__) && !defined(__WXQT__)
-# if defined(__WINDOWS__)
-# define __WXMSW__
-# else
-# error No __WXxxx__ define set! Please define __WXGTK__,__WXMSW__ or __WXMOTIF__.
-# endif
+#if !defined(__WXMSW__) && !defined(__WXGTK__) && !defined(__WXMOTIF__) && !defined(__WXQT__) && !defined(__WXSTUBS__) && !defined(__WXMAC__)
+# error No __WXxxx__ define set! Please define one of __WXGTK__,__WXMSW__,__WXMOTIF__,__WXMAC__,__WXQT__,__WXSTUBS__
#endif
#if defined(__WXMSW__)
#include "wx/msw/setup.h"
-#else
+#elif defined(__WXMAC__)
+#include "wx/mac/setup.h"
+#elif defined(__WXQT__)
+#include "wx/qt/setup.h"
+#elif defined(__WXMOTIF__)
+#include "wx/motif/setup.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/setup.h"
+#elif defined(__WXGTK__)
#include "wx/../../install/unix/setup/setup.h"
#endif
#endif
- // __SETUPH_BASE__
+ // _WX_SETUP_H_BASE_
-#ifndef __SLIDERH_BASE__
-#define __SLIDERH_BASE__
+#ifndef _WX_SLIDER_H_BASE_
+#define _WX_SLIDER_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/slider.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/slider.h"
+#include "wx/motif/slider.h"
#elif defined(__WXGTK__)
#include "wx/gtk/slider.h"
#elif defined(__WXQT__)
#include "wx/qt/slider.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/slider.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/slider.h"
#endif
#endif
- // __SLIDERH_BASE__
+ // _WX_SLIDER_H_BASE_
-#ifndef __SPINBUTTH_BASE__
-#define __SPINBUTTH_BASE__
+#ifndef _WX_SPINBUTT_H_BASE_
+#define _WX_SPINBUTT_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/spinbutt.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/spinbutt.h"
+#include "wx/motif/spinbutt.h"
#elif defined(__WXGTK__)
#include "wx/gtk/spinbutt.h"
#elif defined(__WXQT__)
#include "wx/qt/spinbutt.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/spinbutt.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/spinbutt.h"
#endif
#endif
- // __SPINBUTTH_BASE__
+ // _WX_SPINBUTT_H_BASE_
-#ifndef __SPLITTERH_BASE__
-#define __SPLITTERH_BASE__
+#ifndef _WX_SPLITTER_H_BASE_
+#define _WX_SPLITTER_H_BASE_
#include "wx/generic/splitter.h"
#endif
- // __SPLITTERH_BASE__
+ // _WX_SPLITTER_H_BASE_
-#ifndef __STATBMPH_BASE__
-#define __STATBMPH_BASE__
+#ifndef _WX_STATBMP_H_BASE_
+#define _WX_STATBMP_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/statbmp.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/statbmp.h"
+#include "wx/motif/statbmp.h"
#elif defined(__WXGTK__)
#include "wx/gtk/statbmp.h"
#elif defined(__WXQT__)
#include "wx/qt/statbmp.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/statbmp.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/statbmp.h"
#endif
#endif
- // __STATBMPH_BASE__
+ // _WX_STATBMP_H_BASE_
-#ifndef __STATBOXH_BASE__
-#define __STATBOXH_BASE__
+#ifndef _WX_STATBOX_H_BASE_
+#define _WX_STATBOX_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/statbox.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/statbox.h"
+#include "wx/motif/statbox.h"
#elif defined(__WXGTK__)
#include "wx/gtk/statbox.h"
#elif defined(__WXQT__)
#include "wx/qt/statbox.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/statbox.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/statbox.h"
#endif
#endif
- // __STATBOXH_BASE__
+ // _WX_STATBOX_H_BASE_
-#ifndef __STATTEXTH_BASE__
-#define __STATTEXTH_BASE_
+#ifndef _WX_STATTEXT_H_BASE_
+#define _WX_STATTEXT_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/stattext.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/stattext.h"
+#include "wx/motif/stattext.h"
#elif defined(__WXGTK__)
#include "wx/gtk/stattext.h"
#elif defined(__WXQT__)
#include "wx/qt/stattext.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/stattext.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/stattext.h"
#endif
#endif
- // __STATTEXTH_BASE__
+ // _WX_STATTEXT_H_BASE_
-#ifndef __STATUSBRH_BASE__
-#define __STATUSBRH_BASE__
+#ifndef _WX_STATUSBR_H_BASE_
+#define _WX_STATUSBR_H_BASE_
#include "wx/generic/statusbr.h"
#endif
- // __STATUSBRH_BASE__
+ // _WX_STATUSBR_H_BASE_
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
-#ifndef __WXSTREAM_H__
-#define __WXSTREAM_H__
+#ifndef _WX_WXSTREAM_H__
+#define _WX_WXSTREAM_H__
#ifdef __GNUG__
#pragma interface
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
-#ifndef __WXSTRINGH__
-#define __WXSTRINGH__
+#ifndef _WX_WXSTRINGH__
+#define _WX_WXSTRINGH__
#ifdef __GNUG__
#pragma interface "string.h"
#endif //std::string compatibility
-#endif // __WXSTRINGH__
+#endif // _WX_WXSTRINGH__
//@}
#endif
#include "wx/object.h"
+#include "wx/string.h"
class WXDLLEXPORT wxAcceleratorTable;
#include "wx/defs.h"
#include "wx/object.h"
+#include "wx/gdicmn.h"
+#include "wx/event.h"
class WXDLLEXPORT wxFrame;
class WXDLLEXPORT wxWindow;
#pragma interface "checklst.h"
#endif
+#include "wx/listbox.h"
+
typedef unsigned int uint;
class wxCheckListBox : public wxListBox
bool IsChecked(uint uiIndex) const;
void Check(uint uiIndex, bool bCheck = TRUE);
- // accessors
- uint GetItemHeight() const { return m_nItemHeight; }
-
DECLARE_EVENT_TABLE()
};
#pragma interface "colour.h"
#endif
+#include "wx/object.h"
+#include "wx/string.h"
+
// Colour
class WXDLLEXPORT wxColour: public wxObject
{
inline bool operator != (const wxColour& colour) { return (!(m_red == colour.m_red && m_green == colour.m_green && m_blue == colour.m_blue)); }
+/* TODO
WXCOLORREF GetPixel() const { return m_pixel; };
+*/
private:
bool m_isInit;
wxCursor(int cursor_type);
~wxCursor();
- virtual bool Ok() const { return (m_refData != NULL && M_CURSORDATA->m_hCursor) ; }
+ // 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; }
// constants
//-----------------------------------------------------------------------------
+#ifndef MM_TEXT
#define MM_TEXT 0
#define MM_ISOTROPIC 1
#define MM_ANISOTROPIC 2
#define MM_TWIPS 5
#define MM_POINTS 6
#define MM_METRIC 7
+#endif
//-----------------------------------------------------------------------------
// global variables
virtual bool Ok(void) const { return m_ok; };
- virtual void FloodFill( long x1, long y1, wxColour *col, int style=wxFLOOD_SURFACE ) = 0;
+ 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);
+ FloodFill(pt.x, pt.y, (wxColour*) & col, style);
}
+
virtual bool GetPixel( long x1, long y1, wxColour *col ) const = 0;
inline bool GetPixel(const wxPoint& pt, wxColour *col) const
{
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)
+ 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, xc, yc);
+ 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;
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 void Clear(void) = 0;
virtual void SetFont( const wxFont &font ) = 0;
- virtual wxFont *GetFont(void) const { return &m_font; };
+ virtual wxFont *GetFont(void) const { return (wxFont*) &m_font; };
virtual void SetPen( const wxPen &pen ) = 0;
- virtual wxPen *GetPen(void) const { return &m_pen; };
+ virtual wxPen *GetPen(void) const { return (wxPen*) &m_pen; };
virtual void SetBrush( const wxBrush &brush ) = 0;
- virtual wxBrush *GetBrush(void) const { return &m_brush; };
+ virtual wxBrush *GetBrush(void) const { return (wxBrush*) &m_brush; };
virtual void SetBackground( const wxBrush &brush ) = 0;
- virtual wxBrush *GetBackground(void) const { return &m_backgroundBrush; };
+ virtual wxBrush *GetBackground(void) const { return (wxBrush*) &m_backgroundBrush; };
virtual void SetLogicalFunction( int function ) = 0;
virtual int GetLogicalFunction(void) const { return m_logicalFunction; };
//-----------------------------------------------------------------------------
class WXDLLEXPORT wxPaintDC;
+class WXDLLEXPORT wxWindow;
// Under Windows, wxClientDC, wxPaintDC and wxWindowDC are implemented differently.
// On many platforms, however, they will be the same.
~wxPaintDC(void);
- virtual void FloodFill( long x1, long y1, wxColour *col, int style=wxFLOOD_SURFACE );
+ 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 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 );
#include "wx/dialog.h"
+WXDLLEXPORT_DATA(extern const char*) wxFileSelectorPromptStr;
+
class WXDLLEXPORT wxDirDialog: public wxDialog
{
DECLARE_DYNAMIC_CLASS(wxDirDialog)
--- /dev/null
+///////////////////////////////////////////////////////////////////////////////
+// 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 uint 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 uint 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 uint 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
+//-------------------------------------------------------------------------
+
+class WXDLLEXPORT 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
+ //_WX_DND_H_
+
friend class WXDLLEXPORT wxFont;
public:
wxFontRefData();
+ wxFontRefData(const wxFontRefData& data);
~wxFontRefData();
protected:
int m_pointSize;
// Implementation
protected:
+ bool RealizeResource();
void Unshare();
};
void OnSize(wxSizeEvent& event);
void OnActivate(wxActivateEvent& event);
+ void OnSysColourChanged(wxSysColourChangedEvent& event);
void SetMenuBar(wxMenuBar *menu_bar);
protected:
+ // TODO maybe have this member
+ wxMDIClientWindow *m_clientWindow;
+
DECLARE_EVENT_TABLE()
};
virtual bool SetClipboard(int width = 0, int height = 0);
virtual bool Play(wxDC *dc);
- inline bool Ok() { return m_metaFile != 0; };
+ // TODO
+ inline bool Ok() { return FALSE; };
/* TODO: Implementation
inline WXHANDLE GetHMETAFILE() { return m_metaFile; }
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
-#include <wx/dynarray.h>
+#include "wx/dynarray.h"
+#include "wx/event.h"
+#include "wx/control.h"
// ----------------------------------------------------------------------------
// types
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
#include "wx/gdiobj.h"
+#include "wx/colour.h"
+#include "wx/bitmap.h"
-typedef WXDWORD wxDash ;
+typedef long wxDash ;
class WXDLLEXPORT wxPen;
// Implementation
// Useful helper: create the brush resource
- void RealizeResource();
+ bool RealizeResource();
// When setting properties, we must make sure we're not changing
// another object
private:
wxPrintData m_printData;
wxDC* m_printerDC;
- bool m_destroyDC;
- char* m_deviceName;
- char* m_driverName;
- char* m_portName;
wxWindow* m_dialogParent;
};
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
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();
#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 USE_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 USE_TOOLBAR 1
+ // Use toolbars
#define USE_DRAG_AND_DROP 1
// 0 for no drag and drop
// since you may well need to output
// an error log in a production
// version (or non-debugging beta)
-#define USE_GLOBAL_MEMORY_OPERATORS 1
+#define USE_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.
void OnSize(wxSizeEvent& event);
DECLARE_EVENT_TABLE()
+
+protected:
+ void CopyFieldsWidth(const int widths[]);
+ void SetFieldsWidth();
};
#endif
bool Free();
private:
- byte* m_waveData;
+ char* m_waveData;
int m_waveLength;
bool m_isResource;
};
// (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 ;
wxObject *GetChild(int number) const ;
- inline void SetShowing(bool show);
- inline bool IsUserEnabled() const;
- inline bool GetTransparentBackground() const ;
+ // Generates a new id for controls
+ static int NewControlId();
// Responds to colour changes: passes event on to children.
void OnSysColourChanged(wxSysColourChangedEvent& event);
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 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; }
-#ifndef __TABH_BASE__
-#define __TABH_BASE__
+#ifndef _WX_TAB_H_BASE_
+#define _WX_TAB_H_BASE_
#include "wx/generic/tabg.h"
#endif
- // __TABH_BASE__
+ // _WX_TAB_H_BASE_
-#ifndef __TABCTRLH_BASE__
-#define __TABCTRLH_BASE__
+#ifndef _WX_TABCTRL_H_BASE_
+#define _WX_TABCTRL_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/tabctrl.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/tabctrl.h"
+#include "wx/motif/tabctrl.h"
#elif defined(__WXGTK__)
+#elif defined(__WXMAC__)
+#include "wx/mac/tabctrl.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/tabctrl.h"
#endif
#endif
- // __TABCTRLH_BASE__
+ // _WX_TABCTRL_H_BASE_
--- /dev/null
+#ifndef _WX_TASKBAR_H_BASE_
+#define _WX_TASKBAR_H_BASE_
+
+#if defined(__WXMSW__)
+#include "wx/msw/taskbar.h"
+#elif defined(__WXMOTIF__)
+#elif defined(__WXGTK__)
+#elif defined(__WXQT__)
+#elif defined(__WXMAC__)
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/taskbar.h"
+#endif
+
+#endif
+ // _WX_TASKBAR_H_BASE_
-#ifndef __TBAR95H_BASE__
-#define __TBAR95H_BASE__
+#ifndef _WX_TBAR95_H_BASE_
+#define _WX_TBAR95_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/tbar95.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/tbar95.h"
+#include "wx/motif/tbar95.h"
#elif defined(__WXGTK__)
#include "wx/gtk/tbar95.h"
#endif
#endif
- // __TBAR95H_BASE__
+ // _WX_TBAR95_H_BASE_
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifndef __TBARBASEH__
-#define __TBARBASEH__
+#ifndef _WX_TBARBASE_H_
+#define _WX_TBARBASE_H_
#ifdef __GNUG__
#pragma interface "tbarbase.h"
#endif
+#include "wx/setup.h"
#include "wx/defs.h"
-#if USE_TOOLBAR
-
#include "wx/bitmap.h"
#include "wx/list.h"
#include "wx/control.h"
DECLARE_EVENT_TABLE()
};
-#endif // USE_TOOLBAR
#endif
- // __TBARBASEH__
+ // _WX_TBARBASE_H_
-#ifndef __TBARMSWH_BASE__
-#define __TBARMSWH_BASE__
+#ifndef _WX_TBARMSW_H_BASE_
+#define _WX_TBARMSW_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/tbarmsw.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/tbarmsw.h"
+#include "wx/motif/tbarmsw.h"
#elif defined(__WXGTK__)
#include "wx/gtk/tbarmsw.h"
#endif
#endif
- // __TBARMSWH_BASE__
+ // _WX_TBARMSW_H_BASE_
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifndef __TBARSMPLH__
-#define __TBARSMPLH__
+#ifndef _WX_TBARSMPLH__
+#define _WX_TBARSMPLH__
#ifdef __GNUG__
#pragma interface "tbarsmpl.h"
#endif // USE_TOOLBAR
#endif
- // __TBARSMPLH__
+ // _WX_TBARSMPLH__
-#ifndef __TEXTCTRLH_BASE__
-#define __TEXTCTRLH_BASE__
+#ifndef _WX_TEXTCTRL_H_BASE_
+#define _WX_TEXTCTRL_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/textctrl.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/textctrl.h"
+#include "wx/motif/textctrl.h"
#elif defined(__WXGTK__)
#include "wx/gtk/textctrl.h"
#elif defined(__WXQT__)
#include "wx/qt/textctrl.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/textctrl.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/textctrl.h"
#endif
#endif
- // __TEXTCTRLH_BASE__
+ // _WX_TEXTCTRL_H_BASE_
-#ifndef __TEXTDLGH_BASE__
-#define __TEXTDLGH_BASE__
+#ifndef _WX_TEXTDLG_H_BASE_
+#define _WX_TEXTDLG_H_BASE_
#include "wx/generic/textdlgg.h"
#endif
- // __TEXTDLGH_BASE__
+ // _WX_TEXTDLG_H_BASE_
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifndef __THREADH__
-#define __THREADH__
+#ifndef _WX_THREADH__
+#define _WX_THREADH__
#ifdef __GNUG__
#pragma interface "thread.h"
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifndef __TIMEH__
-#define __TIMEH__
+#ifndef _WX_TIMEH__
+#define _WX_TIMEH__
#include "wx/object.h"
#endif
// USE_TIMEDATE
#endif
- // __TIMEH__
+ // _WX_TIMEH__
-#ifndef __TIMERH_BASE__
-#define __TIMERH_BASE__
+#ifndef _WX_TIMER_H_BASE_
+#define _WX_TIMER_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/timer.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/timer.h"
+#include "wx/motif/timer.h"
#elif defined(__WXGTK__)
#include "wx/gtk/timer.h"
#elif defined(__WXQT__)
#include "wx/qt/timer.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/timer.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/timer.h"
#endif
#endif
- // __TIMERH_BASE__
+ // _WX_TIMER_H_BASE_
# include "wx/gtk/tbargtk.h"
#elif defined(__WXQT__)
# include "wx/qt/tbarqt.h"
+#elif defined(__WXMAC__)
+# include "wx/mac/toolbar.h"
+#elif defined(__WXSTUBS__)
+# include "wx/stubs/toolbar.h"
#endif
#endif
-#ifndef __TREECTRLH_BASE__
-#define __TREECTRLH_BASE__
+#ifndef _WX_TREECTRL_H_BASE_
+#define _WX_TREECTRL_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/treectrl.h"
#elif defined(__WXMOTIF__)
#include "wx/generic/treectrl.h"
#elif defined(__WXGTK__)
+#include "wx/gtk/treectrl.h"
+#elif defined(__WXQT__)
+#include "wx/qt/treectrl.h"
+#elif defined(__WXMAC__)
+#include "wx/generic/treectrl.h"
+#elif defined(__WXSTUBS__)
#include "wx/generic/treectrl.h"
#endif
#endif
- // __TREECTRLH_BASE__
+ // _WX_TREECTRL_H_BASE_
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifndef __TYPESH__
-#define __TYPESH__
+#ifndef _WX_TYPESH__
+#define _WX_TYPESH__
#ifdef __GNUG__
// #pragma interface "types.h"
#define wxTYPE_USER 500
#endif
- // __TYPESH__
+ // _WX_TYPESH__
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
-#ifndef __UTILSH__
-#define __UTILSH__
+#ifndef _WX_UTILSH__
+#define _WX_UTILSH__
#ifdef __GNUG__
#pragma interface "utils.h"
#endif //__X__
#endif
- // __UTILSH__
+ // _WX_UTILSH__
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
-#ifndef __VALIDATEH__
-#define __VALIDATEH__
+#ifndef _WX_VALIDATEH__
+#define _WX_VALIDATEH__
#ifdef __GNUG__
#pragma interface "validate.h"
WXDLLEXPORT_DATA(extern const wxValidator) wxDefaultValidator;
#endif
- // __VALIDATEH__
+ // _WX_VALIDATEH__
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
-#ifndef __VALTEXTH__
-#define __VALTEXTH__
+#ifndef _WX_VALTEXTH__
+#define _WX_VALTEXTH__
#ifdef __GNUG__
#pragma interface "valtext.h"
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
-#ifndef __VERSIONH__
-#define __VERSIONH__
+#ifndef _WX_VERSIONH__
+#define _WX_VERSIONH__
/* Bump-up with each new version */
#define wxMAJOR_VERSION 2
#define wxVERSION_FLOAT float(wxMAJOR_VERSION + (wxMINOR_VERSION/10.0) + (wxRELEASE_NUMBER/100.0) + (wxBETA_NUMBER/10000.0))
#endif
- // __VERSIONH__
+ // _WX_VERSIONH__
-#ifndef __WINDOWH_BASE__
-#define __WINDOWH_BASE__
+#ifndef _WX_WINDOW_H_BASE_
+#define _WX_WINDOW_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/window.h"
#elif defined(__WXMOTIF__)
-#include "wx/xt/window.h"
+#include "wx/motif/window.h"
#elif defined(__WXGTK__)
#include "wx/gtk/window.h"
#elif defined(__WXQT__)
#include "wx/qt/window.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/window.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/window.h"
#endif
#endif
- // __WINDOWH_BASE__
+ // _WX_WINDOW_H_BASE_
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifndef __WXH__
-#define __WXH__
+#ifndef _WX_WXH__
+#define _WX_WXH__
#include "wx/setup.h" // Which features to include - user editable
#include "wx/defs.h"
#include "wx/intl.h"
#endif
- // __WXH__
+ // _WX_WXH__
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifndef __WXEXPRH__
-#define __WXEXPRH__
+#ifndef _WX_WXEXPRH__
+#define _WX_WXEXPRH__
#ifdef __GNUG__
#pragma interface "wxexpr.h"
/////////////////////////////////////////////////////////////////////////////
// check if to use precompiled headers
-#if (defined(__BORLANDC__) || defined(_MSC_VER) || defined(__WATCOMC__) || defined(__GNUWIN32__)) // && !defined(WXMAKINGDLL)
+#if (defined(__BORLANDC__) || defined(_MSC_VER) || defined(__WATCOMC__) || defined(__GNUWIN32__)) && defined(__WXMSW__)
#if !NOPCH
#define WX_PRECOMP
#endif
// Copyright: (c) Guilhem Lavaux
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifndef __WXZSTREAM_H__
-#define __WXZSTREAM_H__
+#ifndef _WX_WXZSTREAM_H__
+#define _WX_WXZSTREAM_H__
#ifdef __GNUG__
#pragma interface
#ifndef WX_PRECOMP
#include <stdio.h>
+#include "wx/string.h"
#include "wx/utils.h"
#include "wx/app.h"
#endif
wxPageSetupData::~wxPageSetupData(void)
{
-#if defined(__WIN95__)
+#if defined(__WIN95__) && defined(__WXMSW__)
PAGESETUPDLG *pd = (PAGESETUPDLG *)m_pageSetupData;
if ( pd && pd->hDevMode )
GlobalFree(pd->hDevMode);
m_enableHelp = data.m_enableHelp;
}
-#if defined(__WIN95__)
+#if defined(__WXMSW__) && defined(__WIN95__)
void wxPageSetupData::ConvertToNative(void)
{
PAGESETUPDLG *pd = (PAGESETUPDLG*) m_pageSetupData;
#if USE_DOC_VIEW_ARCHITECTURE
#ifndef WX_PRECOMP
+#include "wx/string.h"
#include "wx/utils.h"
#include "wx/app.h"
#include "wx/dc.h"
#include <windows.h> // for GetTempFileName
#elif (defined(__UNIX__) || defined(__GNUWIN32__))
#include <unistd.h>
+#elif (defined(__WXSTUBS__))
+ // Have to ifdef this for different environments
+ #include <io.h>
#else
#error "Please specify the header with file functions declarations."
#endif //Win/UNIX
#define tell(fd) lseek(fd, 0, SEEK_CUR)
#endif //_MSC_VER
+#ifdef __BORLANDC__
+ #define W_OK 2
+ #define R_OK 4
+#endif
+
// there is no distinction between text and binary files under Unix
#ifdef __UNIX__
#define O_BINARY (0)
// otherwise rename() in Commit() might not work (if the files are on
// different partitions for example). Unfortunately, the only standard
// (POSIX) temp file creation function tmpnam() can't do it.
- #ifdef __UNIX__
+ #if defined(__UNIX__) || defined(__WXSTUBS__)
static const char *szMktempSuffix = "XXXXXX";
m_strTemp << strName << szMktempSuffix;
mktemp((char *)m_strTemp.c_str()); // will do because length doesn't change
#ifdef __UNIX__
strDir = "/etc/";
+ #elif defined(__WXSTUBS__)
+ // TODO
+ wxASSERT( TRUE ) ;
#else // Windows
#ifndef _MAX_PATH
#define _MAX_PATH 512
#include <dirent.h>
#endif
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
#ifndef __GNUWIN32__
#include <direct.h>
#include <dos.h>
#include <dir.h>
#endif
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
#include "windows.h"
#endif
void wxPathList::AddEnvList (const wxString& envVariable)
{
static const char PATH_TOKS[] =
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
" ;"; // Don't seperate with colon in DOS (used for drive)
#else
" :;";
{
wxString path2((char *) node->Data ());
if (
-#if defined(__WXMSW__) || defined(__VMS__)
+#if defined(__WINDOWS__) || defined(__VMS__)
// Case INDEPENDENT
path.CompareTo (path2, wxString::ignoreCase) == 0
#else
if (ch != '\\' && ch != '/')
strcat (wxBuffer, "/");
strcat (wxBuffer, filename);
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
Unix2DosFilename (wxBuffer);
#endif
if (wxFileExists (wxBuffer))
lastCh = buf[len-1];
if (lastCh != '/' && lastCh != '\\')
{
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
strcat(buf, "\\");
#else
strcat(buf, "/");
#ifdef __VMS__
|| (filename[0] == '[' && filename[1] != '.')
#endif
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
/* MSDOS */
|| filename[0] == '\\' || (isalpha (filename[0]) && filename[1] == ':')
#endif
#ifdef __VMS__
return FALSE;
#elif (defined(__GNUWIN32__) && !defined(__MINGW32__)) || !defined(__WXMSW__)
+#if defined(__WIN32__) // Could happen in __WXSTUBS__ mode
+ return (mkdir(WXSTRINGCAST dir) == 0);
+#else
return (mkdir (WXSTRINGCAST dir, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) == 0);
+#endif
#else
return (mkdir(WXSTRINGCAST dir) == 0);
#endif
// Get a temporary filename, opening and closing the file.
char *wxGetTempFileName(const wxString& prefix, char *buf)
{
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
#ifndef __WIN32__
char tmp[144];
{
#ifdef __UNIX__
return (chdir(d) == 0);
-#elif defined(__WXMSW__)
+#elif defined(__WINDOWS__)
#ifdef __WIN32__
return (bool)(SetCurrentDirectory(d) != 0);
else return NULL;
#endif
+// TODO for other implementations. This should really go into
+// platform-specific directories.
+#ifdef __WXSTUBS__
+ else return NULL;
+#endif
+
#ifdef __WXGTK__
else {
wxColour *col = new wxColour( colour );
#include <wx/string.h>
#include <wx/intl.h>
#include <wx/menu.h>
+ #include <wx/frame.h>
#include <wx/generic/msgdlgg.h>
#include <wx/filedlg.h>
{
wxString strTime = TimeStamp();
- #ifdef __WIN32__
+ #if defined(__WIN32__) && !defined(__WXSTUBS__)
// don't prepend debug/trace here: it goes to the debug window
// anyhow, but do put a timestamp
OutputDebugString(strTime + szString + "\n\r");
{
#ifdef __WXMSW__
DebugBreak();
+ #elif defined(__WXSTUBS__)
+ // TODO
#else // Unix
raise(SIGTRAP);
#endif // Win/Unix
#endif
#ifndef WX_PRECOMP
-#include "wx.h"
+#include "wx/wx.h"
#endif
#if USE_TOOLBAR
if (bitmap && bitmap->Ok())
{
- if (bitmap->GetColourMap())
- memDC.SetPalette(*bitmap->GetColourMap());
+ if (bitmap->GetPalette())
+ memDC.SetPalette(*bitmap->GetPalette());
int ax = (int)tool->m_x,
ay = (int)tool->m_y,
// default type is the native one
const wxTextFile::Type wxTextFile::typeDefault = wxTextFile::
-#if defined(__WXMSW__)
+#if defined(__WINDOWS__)
Type_Dos;
#elif defined(__UNIX__)
Type_Unix;
-#elif defined(__MAC__)
+#elif defined(__WXMAC__)
Type_Mac;
// if you feel brave, remove the next line
#error "wxTextFile: code for Mac files is untested."
*timeZone = tp->tm_gmtoff; // ???
*dstObserved = tp->tm_isdst;
#endif
+#elif defined(__WXSTUBS__)
+ return FALSE;
#else
// #error wxGetLocalTime not implemented.
struct timeval tp;
}
#endif
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
#ifndef __GNUWIN32__
#define strcasecmp stricmp
int objectSizeX = m_totalCols;
int pageSizeX = 1;
int viewLengthX = m_totalCols;
+
+/*
m_hScrollBar->SetViewLength(viewLengthX);
m_hScrollBar->SetObjectLength(objectSizeX);
m_hScrollBar->SetPageSize(pageSizeX);
+*/
+ m_hScrollBar->SetScrollbar(m_hScrollBar->GetPosition(), pageSizeX, objectSizeX, viewLengthX);
int objectSizeY = m_totalRows;
int pageSizeY = 1;
int viewLengthY = m_totalRows;
+/*
m_vScrollBar->SetViewLength(viewLengthY);
m_vScrollBar->SetObjectLength(objectSizeY);
m_vScrollBar->SetPageSize(pageSizeY);
+*/
+
+ m_vScrollBar->SetScrollbar(m_vScrollBar->GetPosition(), pageSizeY, objectSizeY, viewLengthY);
AdjustScrollbars();
dc->SetBrush(*cell->GetBackgroundBrush());
dc->SetPen(*wxTRANSPARENT_PEN);
-#ifdef 0 // In wxWin 2.0 the dc code is exact. RR.
+#if 0 // In wxWin 2.0 the dc code is exact. RR.
#ifdef __WXMOTIF__
dc->DrawRectangle(rect->x+1, rect->y+1, rect->width-1, rect->height-1);
#else
// Eventually, we'll respond to colour change messages
InitColours();
- SetDoubleClick(TRUE);
-
// For debugging purposes, to see the background.
// SetBackground(wxBLUE_BRUSH);
}
CFG = $(WXDIR)\src\msw\wxwin32.cfg
WXLIBDIR = $(WXDIR)\lib
WXINC = $(WXDIR)\include
-WIN95FLAG = -D__WIN95__
+WIN95FLAG = -D__WIN95__ -D__WINDOWS__
!ifndef FINAL
FINAL=0
# many things as we can, to catch portability problems sooner.
WARN = -Wall
-# -pedantic -Wpointer-arith -Wtraditional -Wcast-align \
-# -Wenum-clash -Wnested-externs -Woverloaded-virtual \
-# -Winline -Wconversion
-
-# not good with too few 'const' decls in wxWindows
-# -Wcast-qual -Wwrite-strings
-
-# too hard (problems with system header files)
-# -Wstrict-prototypes -Wmissing-prototypes
-# -Wredudant-decs
-
# Which GUI, -Dwx_xview or -Dwx_motif (don't change this)
-GUI = -D__WXMSW__
+GUI = -D__WXMSW__ -D__WINDOWS__
# Optimization
# OPT = -O
# AROPTIONS = crs # For IRIX and Solaris (both SYSVR4).
AROPTIONS = ruv
RANLIB = ranlib
-# RANLIB = echo # Uncomment this line for IRIX and Solaris
# Compiler libraries: defaults to GCC libraries
# Solaris: -lgen -ldl -lsocket -lnsl
#added for win95
COMPPATHS=
-# HP-specific compiler library: an AIAI convenience
-HPCOMPLIBS=
-
-# LDLIBS for specific GUIs
-
-# The following for LINUX and Motif 2.0:
-#MOTIFLDLIBS = -lwx_motif $(COMPLIBS) -lXm -lXmu -lXpm -lXt -lXext -lX11 -lm
-
-#BASICMOTIFLDLIBS = -lwx_motif /aiai/packages/motif1.2.1/motif/sun4/lib/libXm.a /aiai/packages/motif1.2.1/motif/sun4/lib/libXmu.a /aiai/packages/motif1.2.1/motif/sun4/lib/libXt.a /aiai/packages/motif1.2.1/motif/sun4/lib/libX11.a -lm
-# Apparently libg++ (in COMPLIBS) should go before libXm because of a clash of
-# function name: re_create.
-#BASICMOTIFLDLIBS = -lwx_motif $(COMPLIBS) -lXm -lXmu -lXt -lX11 -lm
-
-#MOTIFLDLIBS = $(BASICMOTIFLDLIBS) $(COMPLIBS)
-
-#XVIEWLDLIBS = -lwx_ol -lxview -lolgx -lX11 -lm $(COMPLIBS)
-#HPLDLIBS=-lwx_hp -lXm -lXmu -lXt -lX11 -lm
-#CYGNUSLDLIBS=
-# Default LDLIBS for XView (don't change this)
-#LDLIBS = $(CYGNUSLDLIBS)
-
-# _ol or _motif (don't need to change, the makefiles will take
-# care of it if you use motif/hp/xview targets)
-#GUISUFFIX=_ol
-
########################## Directories ###############################
WXINC=$(WXDIR)/include
WXBASESRC=$(WXDIR)/src/common
WXLIB=$(WXDIR)/lib/$(LIBPREFIX)wx.$(LIBSUFF)
-INC = -I$(WXINC) -I$(WXDIR)/src/png -I$(WXDIR)/src/zlib $(EXTRAINC)$(COMPPATHS)
+INC = -I$(WXINC) -I$(WXDIR)/src/png -I$(WXDIR)/include/wx/msw/gnuwin32 -I$(WXDIR)/src/zlib $(EXTRAINC)$(COMPPATHS)
RCLFLAGS=-cpp "cpp -lang-c++ -DWIN32 -D_WIN32 -DRCL_INVOKED -I$(WXWIN)\include"
#LIBS = -lctl3d32 $(WXLIB) $(WINLIBS) $(COMPLIBS)
CFLAGS = $(XINCLUDE) $(INC) $(OPTIONS) $(GUI) $(DEBUGFLAGS) -DWXDEBUG='$(WXDEBUG)' $(WARN) $(OPT)
LDFLAGS = -Wl,--subsystem,windows -mwindows -L$(WXDIR)/lib
-# Extra patch link for XView
-#XVIEW_LINK = $(WXDIR)/src/x/objects_ol/sb_scrol.o # $(WXDIR)/src/x/objects_ol/xvwinlp.o
-
.SUFFIXES: .rc .$(RESSUFF) .$(RSCSUFF) .cpp .c
# Set these in a batch file instead e.g. install/cygnus.bat
!if "$(DLL)" == "0"
PCH=WX.PCH
PRECOMP=/YuWX/WXPREC.H /Fp$(WXDIR)\src\msw\$(PCH)
-CPPFLAGS= $(DEBUG_FLAGS) $(OPTIONS) $(INC) $(EXTRAFLAGS) /DWXDEBUG=1 /D__WXDEBUG__ /AL /Gt4 /Gx- /W4 /G2sw $(OPT) /D__WXMSW__ $(PRECOMP)
-CPPFLAGS2= $(DEBUG_FLAGS) $(OPTIONS) $(INC) $(EXTRAFLAGS) /DWXDEBUG=1 /D__WXDEBUG__ /AL /Gt4 /Gx- /W4 /G2sw $(OPT) /D__WXMSW__
+CPPFLAGS= $(DEBUG_FLAGS) $(OPTIONS) $(INC) $(EXTRAFLAGS) /DWXDEBUG=1 /D__WXDEBUG__ /AL /Gt4 /Gx- /W4 /G2sw $(OPT) /D__WXMSW__ /D__WINDOWS__ $(PRECOMP)
+CPPFLAGS2= $(DEBUG_FLAGS) $(OPTIONS) $(INC) $(EXTRAFLAGS) /DWXDEBUG=1 /D__WXDEBUG__ /AL /Gt4 /Gx- /W4 /G2sw $(OPT) /D__WXMSW__ /D__WINDOWS__
LINKFLAGS=$(LINK_DEBUG_FLAGS) /NOD /SEG:512 /ONERROR:NOEXE
DUMMY=dummy
!else
PCH=WX.PCH
PRECOMP=/YuWX/WXPREC.H /Fp$(WXDIR)\src\msw\$(PCH)
-CPPFLAGS= $(DEBUG_FLAGS) $(OPTIONS) $(INC) $(EXTRAFLAGS) /AL /Gt4 /Gx- /W4 /G2s /GD $(OPT) /D__WXMSW__ $(PRECOMP)
-CPPFLAGS2= $(DEBUG_FLAGS) $(OPTIONS) $(INC) $(EXTRAFLAGS) /AL /Gt4 /Gx- /W4 /G2s /GD $(OPT) /D__WXMSW__
+CPPFLAGS= $(DEBUG_FLAGS) $(OPTIONS) $(INC) $(EXTRAFLAGS) /AL /Gt4 /Gx- /W4 /G2s /GD $(OPT) /D__WXMSW__ /D__WINDOWS__$(PRECOMP)
+CPPFLAGS2= $(DEBUG_FLAGS) $(OPTIONS) $(INC) $(EXTRAFLAGS) /AL /Gt4 /Gx- /W4 /G2s /GD $(OPT) /D__WXMSW__ /D__WINDOWS__
LINKFLAGS=$(LINK_DEBUG_FLAGS) /NOD /SEG:512 /ONERROR:NOEXE
DUMMY=dummydll
!endif
#endif
// use debug CRT functions for memory leak detections in VC++
-/* THIS CRAPS OUT in VC++ 5.
+/* Doesn't work when using the makefiles, for some reason.
#if defined(__WXDEBUG__) && defined(_MSC_VER)
#include <crtdbg.h>
#endif
{
wxhInstance = (HINSTANCE) hInstance;
-/* No, sorry, whatever this is, forget it. Doesn't work with VC++ 5.
-
+/* Doesn't work when using the makefiles, for some reason.
#if defined(__WXDEBUG__) && defined(_MSC_VER)
// do check for memory leaks on program exit
// (another useful flag is _CRTDBG_DELAY_FREE_MEM_DF which doesn't free
CalcBoundingBox(x2, y2);
}
-void wxDC::DrawArc(long x1,long y1,long x2,long y2,double xc,double yc)
+void wxDC::DrawArc(long x1,long y1,long x2,long y2, long xc, long yc)
{
double dx = xc-x1 ;
double dy = yc-y1 ;
-WE
-I$(WXINC);$(BCCDIR)\include;$(WXDIR)/src/png;$(WXDIR)/src/zlib
--I$(WXDIR)\include\msw\gnuwin32
+-I$(WXDIR)\include\wx\msw\gnuwin32
-L$(BCCDIR)\lib
-D__WXWIN__
-D__WXMSW__
+-D__WINDOWS__
-DWIN32
$(OPT)
$(DEBUG_FLAGS)
$(COMMDIR)\log.obj \
$(COMMDIR)\memory.obj \
$(COMMDIR)\module.obj \
- $(COMMDIR)\object.obj \
$(COMMDIR)\odbc.obj \
+ $(COMMDIR)\object.obj \
$(COMMDIR)\postscrp.obj \
$(COMMDIR)\prntbase.obj \
$(COMMDIR)\resource.obj \
$(COMMDIR)\datstrm.obj \
$(COMMDIR)\wincmn.obj
-
MSWOBJS = \
$(MSWDIR)\accel.obj \
$(MSWDIR)\app.obj \
}
// Deal with child commands from buttons etc.
-bool wxWindow::MSWOnCommand(WXWORD id, WXWORD cmd, WXHWND WXUNUSED(control))
+bool wxWindow::MSWOnCommand(WXWORD id, WXWORD cmd, WXHWND control)
{
#if WXDEBUG > 1
wxDebugMsg("wxWindow::MSWOnCommand\n");
}
else
{
-#if WXDEBUG > 1
- wxDebugMsg("Could not find item!\n");
- char buf[100];
- wxDebugMsg("Item ids for this panel:\n");
-
- wxNode *current = GetChildren()->First();
- while (current)
- {
- wxObject *obj = (wxObject *)current->Data() ;
- if (obj->IsKindOf(CLASSINFO(wxControl)))
- {
- wxControl *item = (wxControl *)current->Data();
- sprintf(buf, " %d\n", (int)item->m_windowId);
- wxDebugMsg(buf);
- }
- current = current->Next();
- }
- wxYield();
-#endif
- return FALSE;
+ wxWindow *win = wxFindWinFromHandle(control);
+ if (win)
+ return win->MSWCommand(cmd, id);
}
+ return FALSE;
}
long wxWindow::MSWOnSysCommand(WXWPARAM wParam, WXLPARAM lParam)
MAKEPRECOMP=/YcWX/WXPREC.H
!endif
-CPPFLAGS=$(WINFLAGS) $(DEBUG_FLAGS) $(PRECOMP) $(EXTRAFLAGS) /D__WXMSW__ /DDEBUG=1 $(INC) $(OPT) $(EXTRADLLFLAGS) $(CRTFLAG) /GX /D__WXDEBUG__ /DWXDEBUG=1 /DSTRICT
+CPPFLAGS=$(WINFLAGS) $(DEBUG_FLAGS) $(PRECOMP) $(EXTRAFLAGS) /D__WXMSW__ /DDEBUG=1 $(INC) $(OPT) $(EXTRADLLFLAGS) $(CRTFLAG) /D__WINDOWS__ /GX /D__WXDEBUG__ /DWXDEBUG=1 /DSTRICT
# If you don't include wxprec.h, use CPPFLAGS2
-CPPFLAGS2=$(WINFLAGS) $(DEBUG_FLAGS) /D__WXMSW__ /DDEBUG=1 $(INC) $(EXTRAFLAGS) $(OPT) $(EXTRADLLFLAGS) $(CRTFLAG) /GX /D__WXDEBUG__ /DWXDEBUG=1 /DSTRICT
+CPPFLAGS2=$(WINFLAGS) $(DEBUG_FLAGS) /D__WXMSW__ /DDEBUG=1 $(INC) $(EXTRAFLAGS) $(OPT) $(EXTRADLLFLAGS) $(CRTFLAG) /D__WINDOWS__ /GX /D__WXDEBUG__ /DWXDEBUG=1 /DSTRICT
LINKFLAGS=$(LINK_DEBUG_FLAGS) $(WINLINKFLAGS) -entry:WinMainCRTStartup
DUMMY=dummy
!endif
PRECOMP=/YuWX/WXPREC.H /Fp$(WXDIR)\src\msw\$(PCH) /Fd$(WXDIR)\lib\wx.pdb
-CPPFLAGS=$(WINFLAGS) $(DEBUG_FLAGS) $(PRECOMP) $(EXTRAFLAGS) /D__WXMSW__ $(INC) $(OPT) /D_DLL $(CRTFLAG) $(EXTRADLLFLAGS) /D_WINDOWS /D_WINDLL
-CPPFLAGS2=$(WINFLAGS) $(DEBUG_FLAGS) /D__WXMSW__ $(INC) $(EXTRAFLAGS) $(OPT) /D_DLL $(CRTFLAG) $(EXTRADLLFLAGS) /D_WINDOWS /D_WINDLL
+CPPFLAGS=$(WINFLAGS) $(DEBUG_FLAGS) $(PRECOMP) $(EXTRAFLAGS) /D__WXMSW__ $(INC) $(OPT) /D_DLL $(CRTFLAG) $(EXTRADLLFLAGS) /D_WINDOWS /D__WINDOWS__ /D_WINDLL
+CPPFLAGS2=$(WINFLAGS) $(DEBUG_FLAGS) /D__WXMSW__ $(INC) $(EXTRAFLAGS) $(OPT) /D_DLL $(CRTFLAG) $(EXTRADLLFLAGS) /D_WINDOWS /D__WINDOWS__ /D_WINDLL
LINKFLAGS=$(LINK_DEBUG_FLAGS) -machine:i386 -subsystem:windows,$(APPVER) -dll # -entry:_DllMainCRTStartup$(DLLENTRY)
!endif
#include "wx/setup.h"
#include "wx/accel.h"
+#include "wx/string.h"
#if !USE_SHARED_LIBRARIES
IMPLEMENT_DYNAMIC_CLASS(wxAcceleratorTable, wxObject)
#include "wx/msgdlg.h"
#include "wx/log.h"
#include "wx/module.h"
+#include "wx/memory.h"
#if USE_WX_RESOURCES
#include "wx/resource.h"
#endif
+#if USE_POSTSCRIPT
+#include "wx/postscrp.h"
+#endif
+
#include <string.h>
-#if defined(__WIN95__) && !defined(__GNUWIN32__)
extern char *wxBuffer;
extern wxList wxPendingDelete;
return 0;
};
- wxTheApp = (* wxApp::GetInitializerFunction()) ();
+ wxTheApp = (wxApp*) (* wxApp::GetInitializerFunction()) ();
};
if (!wxTheApp)
if (!wxTheApp->OnInit()) return 0;
- wxTheApp->m_initialized = (wxTopLevelWindows.Number() > 0);
-
int retValue = 0;
if (wxTheApp->Initialized()) retValue = wxTheApp->OnRun();
// define event table
// ------------------
BEGIN_EVENT_TABLE(wxCheckListBox, wxListBox)
- EVT_CHAR(wxCheckListBox::OnChar)
- EVT_LEFT_DOWN(wxCheckListBox::OnLeftClick)
END_EVENT_TABLE()
// control creation
void wxCheckListBox::Check(uint uiIndex, bool bCheck)
{
// TODO
- return FALSE;
}
/////////////////////////////////////////////////////////////////////////////
// Name: colordlg.cpp
-// Purpose: wxColourDialog class
+// Purpose: wxColourDialog class. NOTE: you can use the generic class
+// if you wish, instead of implementing this.
// Author: AUTHOR
// Modified by:
// Created: ??/??/98
#pragma implementation "colordlg.h"
#endif
-#include "wx/colordlg.h"
+#include "wx/stubs/colordlg.h"
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxColourDialog, wxDialog)
wxWindow *parent = (wxWindow *)GetParent();
if (parent)
{
- if (parent->GetDefaultItem() == this)
+ if (parent->GetDefaultItem() == (wxButton*) this)
parent->SetDefaultItem(NULL);
}
}
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:
}
}
-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;
#endif
#include "wx/cursor.h"
+#include "wx/icon.h"
#if !USE_SHARED_LIBRARIES
IMPLEMENT_DYNAMIC_CLASS(wxCursor, wxBitmap)
wxPrintPaperDatabase* wxThePrintPaperDatabase = NULL;
#endif
+#if USE_SHARED_LIBRARY
///// Event tables (also must be in one, statically-linked file for shared libraries)
// This is the base, wxEvtHandler 'bootstrap' code which is expanded manually here
{ NULL, &wxEvtHandler::sm_eventTableEntries[0] };
const wxEventTableEntry wxEvtHandler::sm_eventTableEntries[] = { { 0, 0, 0, NULL } };
+#endif
const wxSize wxDefaultSize(-1, -1);
const wxPoint wxDefaultPosition(-1, -1);
// wxDC
//-----------------------------------------------------------------------------
-IMPLEMENT_ABSTRACT_CLASS(wxDC,wxObject)
-
wxDC::wxDC(void)
{
m_ok = FALSE;
};
void wxPaintDC::FloodFill( long WXUNUSED(x1), long WXUNUSED(y1),
- wxColour *WXUNUSED(col), int WXUNUSED(style) )
+ wxColour* WXUNUSED(col), int WXUNUSED(style) )
{
};
};
-void wxPaintDC::DrawArc( long x1, long y1, long x2, long y2, double xc, double yc )
+void wxPaintDC::DrawArc( long x1, long y1, long x2, long y2, long xc, long yc )
{
if (!Ok()) return;
long wxPaintDC::GetCharWidth(void)
{
if (!Ok()) return 0;
-
+ return 0;
};
long wxPaintDC::GetCharHeight(void)
{
if (!Ok()) return 0;
-
+ return 0;
};
void wxPaintDC::Clear(void)
#include "wx/dcmemory.h"
-#if !USE_SHARED_LIBRARY
-IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC, wxDC)
-#endif
-
//-----------------------------------------------------------------------------
// wxMemoryDC
//-----------------------------------------------------------------------------
// By default, pressing escape cancels the dialog
void wxDialog::OnCharHook(wxKeyEvent& event)
{
- if (GetHWND())
+ if (event.m_keyCode == WXK_ESCAPE)
{
- 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);
GetEventHandler()->ProcessEvent(cancelEvent);
return;
- }
}
// We didn't process this event.
event.Skip();
#include "wx/utils.h"
#include "wx/dialog.h"
#include "wx/dirdlg.h"
-#endif
#include "wx/cmndata.h"
#include "wx/utils.h"
#include "wx/dialog.h"
#include "wx/filedlg.h"
+#include "wx/intl.h"
#if !USE_SHARED_LIBRARY
IMPLEMENT_CLASS(wxFileDialog, wxDialog)
int wxFileDialog::ShowModal()
{
// TODO
- wxID_CANCEL;
+ return wxID_CANCEL;
}
// Generic file load/save dialog
#pragma implementation "font.h"
#endif
+#include "wx/defs.h"
+#include "wx/string.h"
#include "wx/font.h"
+#include "wx/gdicmn.h"
#if !USE_SHARED_LIBRARIES
IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject)
/////////////////////////////////////////////////////////////////////////////
// Name: fontdlg.cpp
-// Purpose: wxFontDialog class
+// Purpose: wxFontDialog class. NOTE: you can use the generic class
+// if you wish, instead of implementing this.
// Author: AUTHOR
// Modified by:
// Created: ??/??/98
#pragma implementation "fontdlg.h"
#endif
-#include "wx/fontdlg.h"
+#include "wx/stubs/fontdlg.h"
#include "wx/cmndata.h"
#if !USE_SHARED_LIBRARY
#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;
// 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() )
return m_gaugePos;
}
-void wxGauge::SetForegroundColour(const wxColour& col)
-{
- m_foregroundColour = col ;
-}
-
-void wxGauge::SetBackgroundColour(const wxColour& col)
-{
- m_backgroundColour = col ;
-}
-
/////////////////////////////////////////////////////////////////////////////
// Name: imaglist.cpp
-// Purpose: wxImageList
+// Purpose: wxImageList. You may wish to use the generic version.
// Author: AUTHOR
// Modified by:
// Created: ??/??/98
#pragma implementation "imaglist.h"
#endif
-#include "wx/msw/imaglist.h"
+#include "wx/stubs/imaglist.h"
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxImageList, wxObject)
#endif
#include "wx/listbox.h"
-
+#include "wx/settings.h"
#include "wx/dynarray.h"
#include "wx/log.h"
{
}
-void wxListBox::SetupColours()
-{
- SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOW));
-}
-
void wxListBox::SetFirstItem(int N)
{
// TODO
#pragma implementation "listctrl.h"
#endif
-#include "wx/listctrl.h"
+#include "wx/stubs/textctrl.h"
+#include "wx/stubs/listctrl.h"
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxListCtrl, wxControl)
int flags = 0;
if ( which == wxIMAGE_LIST_NORMAL )
{
- flags = LVSIL_NORMAL;
m_imageListNormal = imageList;
}
else if ( which == wxIMAGE_LIST_SMALL )
{
- flags = LVSIL_SMALL;
m_imageListSmall = imageList;
}
else if ( which == wxIMAGE_LIST_STATE )
{
- flags = LVSIL_STATE;
m_imageListState = imageList;
}
// TODO set image list
int main(int argc, char* argv[])
{
- return wxEntry(argc, argv[]);
+ return wxEntry(argc, argv);
}
--- /dev/null
+#
+# File: makefile.nt
+# 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 <ntwin32.mak>
+
+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)\fontdlgg.obj \
+ $(GENDIR)\gridg.obj \
+ $(GENDIR)\msgdlgg.obj \
+ $(GENDIR)\panelg.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)\postscrp.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)\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)/postscrp.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)/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)/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)/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
+
#endif
#include "wx/mdi.h"
+#include "wx/menu.h"
+#include "wx/settings.h"
extern wxList wxModelessWindows;
#include "wx/menu.h"
#include "wx/menuitem.h"
#include "wx/log.h"
+#include "wx/utils.h"
// other standard headers
// ----------------------
{
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);
+*/
}
bool wxWindow::PopupMenu(wxMenu *menu, int x, int y)
// TODO
}
-wxMenuBar::wxMenuBar(int n, wxMenu *Mmnus[], const wxString titles[])
+wxMenuBar::wxMenuBar(int n, wxMenu *menus[], const wxString titles[])
{
m_eventHandler = this;
m_menuCount = n;
for (i = 0; i < m_menuCount; i++)
{
if (m_menus[i]->FindItemForId (Id))
- eturn wxString(m_menus[i]->GetHelpString (Id));
+ return wxString(m_menus[i]->GetHelpString (Id));
}
return wxString("");
}
#pragma implementation "metafile.h"
#endif
-#include "wx/metafile.h"
+#include "wx/object.h"
+#include "wx/string.h"
+#include "wx/dc.h"
+#include "wx/stubs/metafile.h"
#include "wx/clipbrd.h"
extern bool wxClipboardIsOpen;
#pragma implementation "msgdlg.h"
#endif
-#include "wx/msgdlg.h"
+#include "wx/stubs/msgdlg.h"
#if !USE_SHARED_LIBRARY
IMPLEMENT_CLASS(wxMessageDialog, wxDialog)
m_windowId = id == -1 ? NewControlId() : id;
- // colors and font
- m_backgroundColour = wxColour(GetSysColor(COLOR_BTNFACE));
- m_foregroundColour = *wxBLACK ;
-
// style
m_windowStyle = style;
SetSelection(nSel);
// fit the notebook page to the tab control's display area
- int w, hl
+ int w, h;
GetSize(&w, &h);
uint nCount = m_aPages.Count();
{
}
-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();
#pragma implementation "print.h"
#endif
-#include "wx/print.h"
+#include "wx/stubs/print.h"
+#include "wx/stubs/printdlg.h"
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxPrinter, wxPrinterBase)
-IMPLEMENT_CLASS(wxWindowsPrintPreview, wxPrintPreviewBase)
+IMPLEMENT_CLASS(wxPrintPreview, wxPrintPreviewBase)
#endif
/*
* Print preview
*/
-wxWindowsPrintPreview::wxWindowsPrintPreview(wxPrintout *printout, wxPrintout *printoutForPrinting, wxPrintData *data):
+wxPrintPreview::wxPrintPreview(wxPrintout *printout, wxPrintout *printoutForPrinting, wxPrintData *data):
wxPrintPreviewBase(printout, printoutForPrinting, data)
{
DetermineScaling();
}
-wxWindowsPrintPreview::~wxWindowsPrintPreview()
+wxPrintPreview::~wxPrintPreview()
{
}
-bool wxWindowsPrintPreview::Print(bool interactive)
+bool wxPrintPreview::Print(bool interactive)
{
if (!printPrintout)
return FALSE;
return printer.Print(previewFrame, printPrintout, interactive);
}
-void wxWindowsPrintPreview::DetermineScaling()
+void wxPrintPreview::DetermineScaling()
{
// TODO
}
#pragma implementation "printdlg.h"
#endif
-#include "wx/printdlg.h"
+#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.
wxPrintDialog::wxPrintDialog():
wxDialog()
{
- dialogParent = NULL;
- printerDC = NULL;
- destroyDC = TRUE;
- deviceName = NULL;
- driverName = NULL;
- portName = NULL;
+ m_dialogParent = NULL;
+ m_printerDC = NULL;
}
wxPrintDialog::wxPrintDialog(wxWindow *p, wxPrintData* data):
bool wxPrintDialog::Create(wxWindow *p, wxPrintData* data)
{
- dialogParent = p;
- printerDC = NULL;
- destroyDC = TRUE;
- deviceName = NULL;
- driverName = NULL;
- portName = NULL;
+ m_dialogParent = p;
+ m_printerDC = NULL;
if ( data )
- printData = *data;
+ m_printData = *data;
return TRUE;
}
wxPrintDialog::~wxPrintDialog()
{
- if (destroyDC && printerDC)
- delete printerDC;
- if (deviceName) delete[] deviceName;
- if (driverName) delete[] driverName;
- if (portName) delete[] portName;
+ if (m_printerDC)
+ delete m_printerDC;
}
int wxPrintDialog::ShowModal()
wxDC *wxPrintDialog::GetPrintDC()
{
- if (printerDC)
+ if (m_printerDC)
{
- destroyDC = FALSE;
- return printerDC;
+ wxDC* dc = m_printerDC;
+ m_printerDC = NULL;
+ return dc;
}
else
return NULL;
#pragma implementation "region.h"
#endif
-#include "wx/wxprec.h"
-
-#ifdef __BORLANDC__
-#pragma hdrstop
-#endif
-
-#include "wx/msw/region.h"
+#include "wx/region.h"
#include "wx/gdicmn.h"
-#include <windows.h>
-
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxRegion, wxGDIObject)
IMPLEMENT_DYNAMIC_CLASS(wxRegionIterator, wxObject)
{
// TODO
}
-
- HRGN m_region;
};
void wxScrollBar::Command(wxCommandEvent& event)
{
- SetValue(event.m_commandInt);
+ SetPosition(event.m_commandInt);
ProcessCommand(event);
}
wxColour wxSystemSettings::GetSystemColour(int index)
{
// TODO
- return col;
+ return wxColour();
}
wxFont wxSystemSettings::GetSystemFont(int index)
{
// TODO
- return wxFont;
+ return wxFont();
}
// Get a system metric, e.g. scrollbar size
#pragma implementation "slider.h"
#endif
-#include "wx/msw/slider.h"
+#include "wx/slider.h"
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxSlider, wxControl)
#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 <stdio.h>
#if !USE_SHARED_LIBRARY
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;
+
+ // TODO
+ return FALSE;
}
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);
+ // TODO
}
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);
+ // TODO
}
-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);
-}
-
-
return FALSE;
}
-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::SetFieldsCount(int nFields, const int widths[])
{
wxASSERT( (nFields > 0) && (nFields < 255) );
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];
#pragma implementation "tabctrl.h"
#endif
+#include "wx/control.h"
#include "wx/tabctrl.h"
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxTabCtrl, wxControl)
BEGIN_EVENT_TABLE(wxTabCtrl, wxControl)
- EVT_SIZE(wxTabCtrl::OnSize)
- EVT_PAINT(wxTabCtrl::OnPaint)
- EVT_KILL_FOCUS(wxTabCtrl::OnKillFocus)
- EVT_MOUSE_EVENTS(wxTabCtrl::OnMouseEvent)
- EVT_SYS_COLOUR_CHANGED(wxTabCtrl::OnSysColourChanged)
END_EVENT_TABLE()
#endif
#include "wx/textctrl.h"
#include "wx/settings.h"
+#include "wx/filefn.h"
+#include "wx/utils.h"
#if defined(__BORLANDC__) && !defined(__WIN32__)
#include <alloc.h>
void wxTextCtrl::Replace(long from, long to, const wxString& value)
{
// TODO
- return 0;
}
void wxTextCtrl::Remove(long from, long to)
#include "wx/module.h"
#include "wx/thread.h"
+#include "wx/utils.h"
enum thread_state {
STATE_IDLE = 0,
bool wxThread::IsMain()
{
// TODO
+ return FALSE;
}
wxThread::wxThread()
wxTimer::wxTimer()
{
m_milli = 0 ;
- m_lastMilli = -1 ;
m_id = 0;
m_oneShot = FALSE;
}
bool wxTimer::Start(int milliseconds,bool mode)
{
m_oneShot = mode ;
- if (m_milliseconds < 0)
- m_milliseconds = lastMilli;
-
- if (m_milliseconds <= 0)
+ if (milliseconds <= 0)
return FALSE;
- m_lastMilli = m_milli = m_milliseconds;
+ m_milli = milliseconds;
// TODO: set the timer going.
return FALSE;
#pragma implementation "toolbar.h"
#endif
-// For compilers that support precompilation, includes "wx.h".
-#include "wx/wxprec.h"
-
-#ifdef __BORLANDC__
-#pragma hdrstop
-#endif
-
-#ifndef WX_PRECOMP
-#include "wx.h"
-#endif
-
+#include "wx/wx.h"
#include "wx/toolbar.h"
#if !USE_SHARED_LIBRARY
tool->m_enabled = enable;
// TODO enable button
}
- }
}
void wxToolBar::ToggleTool(int toolIndex, bool toggle)
/////////////////////////////////////////////////////////////////////////////
// Name: treectrl.cpp
-// Purpose: wxTreeCtrl
+// Purpose: wxTreeCtrl. See also Robert's generic wxTreeCtrl.
// Author: AUTHOR
// Modified by:
// Created: ??/??/98
#pragma implementation "treectrl.h"
#endif
-#include "wx/treectrl.h"
+#include "wx/stubs/textctrl.h"
+#include "wx/stubs/treectrl.h"
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxTreeCtrl, wxControl)
break;
case wxTREE_EXPAND_COLLAPSE_RESET:
- mswAction = TVE_COLLAPSERESET;
break;
case wxTREE_EXPAND_TOGGLE:
- mswAction = TVE_TOGGLE;
break;
default:
#pragma implementation "wave.h"
#endif
+#include "wx/object.h"
+#include "wx/string.h"
#include "wx/stubs/wave.h"
wxWave::wxWave()
#include "wx/button.h"
#include "wx/settings.h"
#include "wx/msgdlg.h"
+#include "wx/frame.h"
#include "wx/menuitem.h"
#include "wx/log.h"
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);
+ {
+ // TODO
+ }
}
#endif
void wxWindow::SetScrollPos(int orient, int pos, bool refresh)
{
// TODO
- return 0;
+ return;
}
// New function that will replace some of the above.
void wxWindow::ScrollWindow(int dx, int dy, const wxRectangle *rect)
{
// TODO
- return 0;
+ return;
}
void wxWindow::SetFont(const wxFont& font)
}
}
-// 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)
return (m_updateRegion.Contains(rect) != wxOutRegion);
}
+/*
+ * Allocates control IDs
+ */
+
+int wxWindow::NewControlId()
+{
+ static int s_controlId = 0;
+ s_controlId ++;
+ return s_controlId;
+}
+
// in the application itself.
IMPLEMENT_APP(MyApp)
-// This statement initialises the whole application
-MyApp myApp;
-
MyApp::MyApp(void)
{
frame = NULL;
menu_bar->Append(help_menu, "&Help");
frame->canvas = frame->CreateCanvas(NULL, frame);
- frame->palette = myApp.CreatePalette(frame);
+ frame->palette = wxGetApp().CreatePalette(frame);
myDocManager->CreateDocument("", wxDOC_NEW);
//// Associate the menu bar with the frame
MyFrame *GetMainFrame(void)
{
- return myApp.frame;
+ return wxGetApp().frame;
}
void wxShape::AssignNewIds()
{
- if (m_id == 0)
- m_id = NewId();
+// if (m_id == 0)
+ m_id = NewId();
wxNode *node = m_children.First();
while (node)
{
clause->AddAttributeValue("pen_style", (long)penStyle);
wxString penColour = wxTheColourDatabase->FindName(m_pen->GetColour());
- if ((penColour != "") && (penColour != "BLACK"))
+ if (penColour == "")
+ {
+ wxString hex(oglColourToHex(m_pen->GetColour()));
+ hex = wxString("#") + hex;
+ clause->AddAttributeValueString("pen_colour", hex);
+ }
+ else if (penColour != "BLACK")
clause->AddAttributeValueString("pen_colour", penColour);
}
{
wxString brushColour = wxTheColourDatabase->FindName(m_brush->GetColour());
- if ((brushColour != "") && (brushColour != "WHITE"))
+ if (brushColour == "")
+ {
+ wxString hex(oglColourToHex(m_brush->GetColour()));
+ hex = wxString("#") + hex;
+ clause->AddAttributeValueString("brush_colour", hex);
+ }
+ else if (brushColour != "WHITE")
clause->AddAttributeValueString("brush_colour", brushColour);
if (m_brush->GetStyle() != wxSOLID)
if (brush_string == "")
brush_string = "WHITE";
- m_pen = wxThePenList->FindOrCreatePen(pen_string, pen_width, pen_style);
+ if (pen_string[0] == '#')
+ {
+ wxColour col(oglHexToColour(pen_string.After('#')));
+ m_pen = wxThePenList->FindOrCreatePen(col, pen_width, pen_style);
+ }
+ else
+ m_pen = wxThePenList->FindOrCreatePen(pen_string, pen_width, pen_style);
+
if (!m_pen)
m_pen = wxBLACK_PEN;
- m_brush = wxTheBrushList->FindOrCreateBrush(brush_string, brush_style);
+ if (brush_string[0] == '#')
+ {
+ wxColour col(oglHexToColour(brush_string.After('#')));
+ m_brush = wxTheBrushList->FindOrCreateBrush(col, brush_style);
+ }
+ else
+ m_brush = wxTheBrushList->FindOrCreateBrush(brush_string, brush_style);
+
if (!m_brush)
m_brush = wxWHITE_BRUSH;
inline float GetWidth() const { return m_width; }
inline float GetHeight() const { return m_height; }
+ inline void SetWidth(float w) { m_width = w; }
+ inline void SetHeight(float h) { m_height = h; }
protected:
float m_width;
void wxPolygonShape::OnDrawOutline(wxDC& dc, float x, float y, float w, float h)
{
dc.SetBrush(wxTRANSPARENT_BRUSH);
+ // Multiply all points by proportion of new size to old size
+ float x_proportion = (float)(fabs(w/m_originalWidth));
+ float y_proportion = (float)(fabs(h/m_originalHeight));
- int n = m_points->Number();
+ int n = m_originalPoints->Number();
wxPoint *intPoints = new wxPoint[n];
int i;
for (i = 0; i < n; i++)
{
- wxRealPoint* point = (wxRealPoint*) m_points->Nth(i)->Data();
- intPoints[i].x = (int) point->x;
- intPoints[i].y = (int) point->y;
+ wxRealPoint* point = (wxRealPoint*) m_originalPoints->Nth(i)->Data();
+ intPoints[i].x = (int) (x_proportion * point->x);
+ intPoints[i].y = (int) (y_proportion * point->y);
}
dc.DrawPolygon(n, intPoints, x, y);
delete[] intPoints;
{
}
+// Calculate what new size would be, at end of resize
+void wxPolygonControlPoint::CalculateNewSize(float x, float y)
+{
+ float bound_x;
+ float bound_y;
+ GetShape()->GetBoundingBoxMin(&bound_x, &bound_y);
+
+ float dist = (float)sqrt((x - m_shape->GetX())*(x - m_shape->GetX()) +
+ (y - m_shape->GetY())*(y - m_shape->GetY()));
+
+ m_newSize.x = (float)(dist/this->m_originalDistance)*this->m_originalSize.x;
+ m_newSize.y = (float)(dist/this->m_originalDistance)*this->m_originalSize.y;
+}
+
+
// Implement resizing polygon or moving the vertex.
void wxPolygonControlPoint::OnDragLeft(bool draw, float x, float y, int keys, int attachment)
{
dc.SetPen(dottedPen);
dc.SetBrush((* wxTRANSPARENT_BRUSH));
- float bound_x;
- float bound_y;
- this->GetBoundingBoxMin(&bound_x, &bound_y);
-/*
- float new_width = (float)(2.0*fabs(x - this->GetX()));
- float new_height = (float)(2.0*fabs(y - this->GetY()));
-*/
- float dist = (float)sqrt((x - this->GetX())*(x - this->GetX()) +
- (y - this->GetY())*(y - this->GetY()));
-
- if (keys & KEY_CTRL)
+ if (0) // keys & KEY_CTRL)
{
+ // TODO: mend this code. Currently we rely on altering the
+ // actual points, but we should assume we're not, as per
+ // the normal sizing case.
m_canvas->Snap(&x, &y);
// Move point
}
else
{
- float new_width = (float)(dist/ppt->m_originalDistance)*ppt->m_originalSize.x;
- float new_height = (float)(dist/ppt->m_originalDistance)*ppt->m_originalSize.y;
-
- // Non-recursive SetSize for speed
- this->SetSize(new_width, new_height, FALSE);
+ ppt->CalculateNewSize(x, y);
}
- float w, h;
- this->GetBoundingBoxMax(&w, &h);
- this->GetEventHandler()->OnDrawOutline(dc, this->GetX(), this->GetY(), w, h);
+
+ this->GetEventHandler()->OnDrawOutline(dc, this->GetX(), this->GetY(),
+ ppt->GetNewSize().x, ppt->GetNewSize().y);
}
void wxPolygonShape::OnSizingBeginDragLeft(wxControlPoint* pt, float x, float y, int keys, int attachment)
float dist = (float)sqrt((x - this->GetX())*(x - this->GetX()) +
(y - this->GetY())*(y - this->GetY()));
-
ppt->m_originalDistance = dist;
ppt->m_originalSize.x = bound_x;
ppt->m_originalSize.y = bound_y;
dc.SetPen(dottedPen);
dc.SetBrush((* wxTRANSPARENT_BRUSH));
- if (keys & KEY_CTRL)
+ if (0) // keys & KEY_CTRL)
{
+ // TODO: mend this code. Currently we rely on altering the
+ // actual points, but we should assume we're not, as per
+ // the normal sizing case.
m_canvas->Snap(&x, &y);
// Move point
}
else
{
- float new_width = (float)(dist/ppt->m_originalDistance)*ppt->m_originalSize.x;
- float new_height = (float)(dist/ppt->m_originalDistance)*ppt->m_originalSize.y;
-
- // Non-recursive SetSize for speed
- this->SetSize(new_width, new_height, FALSE);
+ ppt->CalculateNewSize(x, y);
}
- float w, h;
- this->GetBoundingBoxMax(&w, &h);
- this->GetEventHandler()->OnDrawOutline(dc, this->GetX(), this->GetY(), w, h);
+ this->GetEventHandler()->OnDrawOutline(dc, this->GetX(), this->GetY(),
+ ppt->GetNewSize().x, ppt->GetNewSize().y);
m_canvas->CaptureMouse();
}
void wxPolygonShape::OnSizingEndDragLeft(wxControlPoint* pt, float x, float y, int keys, int attachment)
{
+ wxPolygonControlPoint* ppt = (wxPolygonControlPoint*) pt;
+
wxClientDC dc(GetCanvas());
GetCanvas()->PrepareDC(dc);
((wxPolygonShape *)this)->CalculateBoundingBox();
((wxPolygonShape *)this)->UpdateOriginalPoints();
}
+ else
+ {
+ SetSize(ppt->GetNewSize().x, ppt->GetNewSize().y);
+ }
((wxPolygonShape *)this)->CalculateBoundingBox();
((wxPolygonShape *)this)->CalculatePolygonCentre();
void OnBeginDragLeft(float x, float y, int keys=0, int attachment = 0);
void OnEndDragLeft(float x, float y, int keys=0, int attachment = 0);
+ // Calculate what new size would be, at end of resize
+ virtual void CalculateNewSize(float x, float y);
+
+ // Get new size
+ inline wxRealPoint GetNewSize() const { return m_newSize; };
+
public:
wxRealPoint* m_polygonVertex;
wxRealPoint m_originalSize;
float m_originalDistance;
+ wxRealPoint m_newSize;
};
/*
*
*/
-IMPLEMENT_DYNAMIC_CLASS(wxDrawnShape, wxShape)
+IMPLEMENT_DYNAMIC_CLASS(wxDrawnShape, wxRectangleShape)
wxDrawnShape::wxDrawnShape():wxRectangleShape(100.0, 50.0)
{
void wxDrawnShape::Scale(float sx, float sy)
{
m_metafile.Scale(sx, sy);
+ m_metafile.CalculateSize(this);
}
void wxDrawnShape::Translate(float x, float y)
{
m_metafile.Translate(x, y);
+ m_metafile.CalculateSize(this);
}
void wxDrawnShape::Rotate(float x, float y, float theta)
node = node->Next();
}
m_rotation = theta;
+
+ m_metafile.CalculateSize(this);
}
#ifdef PROLOGIO
return m_metafile.LoadFromMetaFile(filename, &m_width, &m_height);
}
+// Set of functions for drawing into a pseudo metafile.
+// They use integers, but doubles are used internally for accuracy
+// when scaling.
+
+void wxDrawnShape::DrawLine(const wxPoint& pt1, const wxPoint& pt2)
+{
+ m_metafile.DrawLine(pt1, pt2);
+}
+
+void wxDrawnShape::DrawRectangle(const wxRect& rect)
+{
+ m_metafile.DrawRectangle(rect);
+}
+
+void wxDrawnShape::DrawRoundedRectangle(const wxRect& rect, double radius)
+{
+ m_metafile.DrawRoundedRectangle(rect, radius);
+}
+
+void wxDrawnShape::DrawEllipse(const wxRect& rect)
+{
+ m_metafile.DrawEllipse(rect);
+}
+
+void wxDrawnShape::DrawPoint(const wxPoint& pt)
+{
+ m_metafile.DrawPoint(pt);
+}
+
+void wxDrawnShape::DrawText(const wxString& text, const wxPoint& pt)
+{
+ m_metafile.DrawText(text, pt);
+}
+
+void wxDrawnShape::DrawLines(int n, wxPoint pts[])
+{
+ m_metafile.DrawLines(n, pts);
+}
+
+void wxDrawnShape::DrawPolygon(int n, wxPoint pts[])
+{
+ m_metafile.DrawPolygon(n, pts);
+}
+
+void wxDrawnShape::DrawSpline(int n, wxPoint pts[])
+{
+ m_metafile.DrawSpline(n, pts);
+}
+
+void wxDrawnShape::SetClippingRect(const wxRect& rect)
+{
+ m_metafile.SetClippingRect(rect);
+}
+
+void wxDrawnShape::DestroyClippingRect()
+{
+ m_metafile.DestroyClippingRect();
+}
+
+void wxDrawnShape::SetPen(wxPen* pen, bool isOutline)
+{
+ m_metafile.SetPen(pen, isOutline);
+}
+
+void wxDrawnShape::SetBrush(wxBrush* brush, bool isFill)
+{
+ m_metafile.SetBrush(brush, isFill);
+}
+
+void wxDrawnShape::SetFont(wxFont* font)
+{
+ m_metafile.SetFont(font);
+}
+
+void wxDrawnShape::SetTextColour(const wxColour& colour)
+{
+ m_metafile.SetTextColour(colour);
+}
+
+void wxDrawnShape::SetBackgroundColour(const wxColour& colour)
+{
+ m_metafile.SetBackgroundColour(colour);
+}
+
+void wxDrawnShape::SetBackgroundMode(int mode)
+{
+ m_metafile.SetBackgroundMode(mode);
+}
+
+
/*
* Individual operations
*
wxOpSetGDI::wxOpSetGDI(int theOp, wxPseudoMetaFile *theImage, int theGdiIndex, int theMode):
wxDrawOp(theOp)
{
- gdiIndex = theGdiIndex;
- image = theImage;
- mode = theMode;
+ m_gdiIndex = theGdiIndex;
+ m_image = theImage;
+ m_mode = theMode;
}
void wxOpSetGDI::Do(wxDC& dc, float xoffset, float yoffset)
{
- switch (op)
+ switch (m_op)
{
case DRAWOP_SET_PEN:
{
// Check for overriding this operation for outline
// colour
- if (image->m_outlineColours.Member((wxObject *)gdiIndex))
+ if (m_image->m_outlineColours.Member((wxObject *)m_gdiIndex))
{
- if (image->m_outlinePen)
- dc.SetPen(image->m_outlinePen);
+ if (m_image->m_outlinePen)
+ dc.SetPen(m_image->m_outlinePen);
}
else
{
- wxNode *node = image->m_gdiObjects.Nth(gdiIndex);
+ wxNode *node = m_image->m_gdiObjects.Nth(m_gdiIndex);
if (node)
{
wxPen *pen = (wxPen *)node->Data();
{
// Check for overriding this operation for outline or fill
// colour
- if (image->m_outlineColours.Member((wxObject *)gdiIndex))
+ if (m_image->m_outlineColours.Member((wxObject *)m_gdiIndex))
{
// Need to construct a brush to match the outline pen's colour
- if (image->m_outlinePen)
+ if (m_image->m_outlinePen)
{
- wxBrush *br = wxTheBrushList->FindOrCreateBrush(image->m_outlinePen->GetColour(), wxSOLID);
+ wxBrush *br = wxTheBrushList->FindOrCreateBrush(m_image->m_outlinePen->GetColour(), wxSOLID);
if (br)
dc.SetBrush(br);
}
}
- else if (image->m_fillColours.Member((wxObject *)gdiIndex))
+ else if (m_image->m_fillColours.Member((wxObject *)m_gdiIndex))
{
- if (image->m_fillBrush)
+ if (m_image->m_fillBrush)
{
- dc.SetBrush(image->m_fillBrush);
+ dc.SetBrush(m_image->m_fillBrush);
}
}
else
{
- wxNode *node = image->m_gdiObjects.Nth(gdiIndex);
+ wxNode *node = m_image->m_gdiObjects.Nth(m_gdiIndex);
if (node)
{
wxBrush *brush = (wxBrush *)node->Data();
}
case DRAWOP_SET_FONT:
{
- wxNode *node = image->m_gdiObjects.Nth(gdiIndex);
+ wxNode *node = m_image->m_gdiObjects.Nth(m_gdiIndex);
if (node)
{
wxFont *font = (wxFont *)node->Data();
}
case DRAWOP_SET_TEXT_COLOUR:
{
- wxColour col(r,g,b);
+ wxColour col(m_r,m_g,m_b);
dc.SetTextForeground(col);
break;
}
case DRAWOP_SET_BK_COLOUR:
{
- wxColour col(r,g,b);
+ wxColour col(m_r,m_g,m_b);
dc.SetTextBackground(col);
break;
}
case DRAWOP_SET_BK_MODE:
{
- dc.SetBackgroundMode(mode);
+ dc.SetBackgroundMode(m_mode);
break;
}
default:
wxDrawOp *wxOpSetGDI::Copy(wxPseudoMetaFile *newImage)
{
- wxOpSetGDI *newOp = new wxOpSetGDI(op, newImage, gdiIndex, mode);
- newOp->r = r;
- newOp->g = g;
- newOp->b = b;
+ wxOpSetGDI *newOp = new wxOpSetGDI(m_op, newImage, m_gdiIndex, m_mode);
+ newOp->m_r = m_r;
+ newOp->m_g = m_g;
+ newOp->m_b = m_b;
return newOp;
}
-wxExpr *wxOpSetGDI::WritewxExpr(wxPseudoMetaFile *image)
+wxExpr *wxOpSetGDI::WriteExpr(wxPseudoMetaFile *image)
{
wxExpr *expr = new wxExpr(PrologList);
- expr->Append(new wxExpr((long)op));
- switch (op)
+ expr->Append(new wxExpr((long)m_op));
+ switch (m_op)
{
case DRAWOP_SET_PEN:
case DRAWOP_SET_BRUSH:
case DRAWOP_SET_FONT:
{
- expr->Append(new wxExpr((long)gdiIndex));
+ expr->Append(new wxExpr((long)m_gdiIndex));
break;
}
case DRAWOP_SET_TEXT_COLOUR:
case DRAWOP_SET_BK_COLOUR:
{
- expr->Append(new wxExpr((long)r));
- expr->Append(new wxExpr((long)g));
- expr->Append(new wxExpr((long)b));
+ expr->Append(new wxExpr((long)m_r));
+ expr->Append(new wxExpr((long)m_g));
+ expr->Append(new wxExpr((long)m_b));
break;
}
case DRAWOP_SET_BK_MODE:
{
- expr->Append(new wxExpr((long)mode));
+ expr->Append(new wxExpr((long)m_mode));
break;
}
default:
return expr;
}
-void wxOpSetGDI::ReadwxExpr(wxPseudoMetaFile *image, wxExpr *expr)
+void wxOpSetGDI::ReadExpr(wxPseudoMetaFile *image, wxExpr *expr)
{
- switch (op)
+ switch (m_op)
{
case DRAWOP_SET_PEN:
case DRAWOP_SET_BRUSH:
case DRAWOP_SET_FONT:
{
- gdiIndex = (int)expr->Nth(1)->IntegerValue();
+ m_gdiIndex = (int)expr->Nth(1)->IntegerValue();
break;
}
case DRAWOP_SET_TEXT_COLOUR:
case DRAWOP_SET_BK_COLOUR:
{
- r = (unsigned char)expr->Nth(1)->IntegerValue();
- g = (unsigned char)expr->Nth(2)->IntegerValue();
- b = (unsigned char)expr->Nth(3)->IntegerValue();
+ m_r = (unsigned char)expr->Nth(1)->IntegerValue();
+ m_g = (unsigned char)expr->Nth(2)->IntegerValue();
+ m_b = (unsigned char)expr->Nth(3)->IntegerValue();
break;
}
case DRAWOP_SET_BK_MODE:
{
- mode = (int)expr->Nth(1)->IntegerValue();
+ m_mode = (int)expr->Nth(1)->IntegerValue();
break;
}
default:
wxOpSetClipping::wxOpSetClipping(int theOp, float theX1, float theY1,
float theX2, float theY2):wxDrawOp(theOp)
{
- x1 = theX1;
- y1 = theY1;
- x2 = theX2;
- y2 = theY2;
+ m_x1 = theX1;
+ m_y1 = theY1;
+ m_x2 = theX2;
+ m_y2 = theY2;
}
wxDrawOp *wxOpSetClipping::Copy(wxPseudoMetaFile *newImage)
{
- wxOpSetClipping *newOp = new wxOpSetClipping(op, x1, y1, x2, y2);
+ wxOpSetClipping *newOp = new wxOpSetClipping(m_op, m_x1, m_y1, m_x2, m_y2);
return newOp;
}
void wxOpSetClipping::Do(wxDC& dc, float xoffset, float yoffset)
{
- switch (op)
+ switch (m_op)
{
case DRAWOP_SET_CLIPPING_RECT:
{
- dc.SetClippingRegion(x1 + xoffset, y1 + yoffset, x2 + xoffset, y2 + yoffset);
+ dc.SetClippingRegion(m_x1 + xoffset, m_y1 + yoffset, m_x2 + xoffset, m_y2 + yoffset);
break;
}
case DRAWOP_DESTROY_CLIPPING_RECT:
void wxOpSetClipping::Scale(float xScale, float yScale)
{
- x1 *= xScale;
- y1 *= yScale;
- x2 *= xScale;
- y2 *= yScale;
+ m_x1 *= xScale;
+ m_y1 *= yScale;
+ m_x2 *= xScale;
+ m_y2 *= yScale;
}
void wxOpSetClipping::Translate(float x, float y)
{
- x1 += x;
- y1 += y;
+ m_x1 += x;
+ m_y1 += y;
}
-wxExpr *wxOpSetClipping::WritewxExpr(wxPseudoMetaFile *image)
+wxExpr *wxOpSetClipping::WriteExpr(wxPseudoMetaFile *image)
{
wxExpr *expr = new wxExpr(PrologList);
- expr->Append(new wxExpr((long)op));
- switch (op)
+ expr->Append(new wxExpr((long)m_op));
+ switch (m_op)
{
case DRAWOP_SET_CLIPPING_RECT:
{
- expr->Append(new wxExpr(x1));
- expr->Append(new wxExpr(y1));
- expr->Append(new wxExpr(x2));
- expr->Append(new wxExpr(y2));
+ expr->Append(new wxExpr(m_x1));
+ expr->Append(new wxExpr(m_y1));
+ expr->Append(new wxExpr(m_x2));
+ expr->Append(new wxExpr(m_y2));
break;
}
default:
return expr;
}
-void wxOpSetClipping::ReadwxExpr(wxPseudoMetaFile *image, wxExpr *expr)
+void wxOpSetClipping::ReadExpr(wxPseudoMetaFile *image, wxExpr *expr)
{
- switch (op)
+ switch (m_op)
{
case DRAWOP_SET_CLIPPING_RECT:
{
- x1 = expr->Nth(1)->RealValue();
- y1 = expr->Nth(2)->RealValue();
- x2 = expr->Nth(3)->RealValue();
- y2 = expr->Nth(4)->RealValue();
+ m_x1 = expr->Nth(1)->RealValue();
+ m_y1 = expr->Nth(2)->RealValue();
+ m_x2 = expr->Nth(3)->RealValue();
+ m_y2 = expr->Nth(4)->RealValue();
break;
}
default:
wxOpDraw::wxOpDraw(int theOp, float theX1, float theY1, float theX2, float theY2,
float theRadius, char *s):wxDrawOp(theOp)
{
- x1 = theX1;
- y1 = theY1;
- x2 = theX2;
- y2 = theY2;
- radius = theRadius;
- if (s) textString = copystring(s);
- else textString = NULL;
+ m_x1 = theX1;
+ m_y1 = theY1;
+ m_x2 = theX2;
+ m_y2 = theY2;
+ m_radius = theRadius;
+ if (s) m_textString = copystring(s);
+ else m_textString = NULL;
}
wxOpDraw::~wxOpDraw()
{
- if (textString) delete[] textString;
+ if (m_textString) delete[] m_textString;
}
wxDrawOp *wxOpDraw::Copy(wxPseudoMetaFile *newImage)
{
- wxOpDraw *newOp = new wxOpDraw(op, x1, y1, x2, y2, radius, textString);
+ wxOpDraw *newOp = new wxOpDraw(m_op, m_x1, m_y1, m_x2, m_y2, m_radius, m_textString);
return newOp;
}
void wxOpDraw::Do(wxDC& dc, float xoffset, float yoffset)
{
- switch (op)
+ switch (m_op)
{
case DRAWOP_DRAW_LINE:
{
- dc.DrawLine(x1+xoffset, y1+yoffset, x2+xoffset, y2+yoffset);
+ dc.DrawLine(m_x1+xoffset, m_y1+yoffset, m_x2+xoffset, m_y2+yoffset);
break;
}
case DRAWOP_DRAW_RECT:
{
- dc.DrawRectangle(x1+xoffset, y1+yoffset, x2+xoffset, y2+yoffset);
+ dc.DrawRectangle(m_x1+xoffset, m_y1+yoffset, m_x2, m_y2);
break;
}
case DRAWOP_DRAW_ROUNDED_RECT:
{
- dc.DrawRoundedRectangle(x1+xoffset, y1+yoffset, x2+xoffset, y2+yoffset, radius);
+ dc.DrawRoundedRectangle(m_x1+xoffset, m_y1+yoffset, m_x2, m_y2, m_radius);
break;
}
case DRAWOP_DRAW_ELLIPSE:
{
- dc.DrawEllipse(x1+xoffset, y1+yoffset, x2+xoffset, y2+yoffset);
+ dc.DrawEllipse(m_x1+xoffset, m_y1+yoffset, m_x2, m_y2);
break;
}
case DRAWOP_DRAW_POINT:
{
- dc.DrawPoint(x1+xoffset, y1+yoffset);
+ dc.DrawPoint(m_x1+xoffset, m_y1+yoffset);
break;
}
case DRAWOP_DRAW_TEXT:
{
- dc.DrawText(textString, x1+xoffset, y1+yoffset);
+ dc.DrawText(m_textString, m_x1+xoffset, m_y1+yoffset);
break;
}
default:
void wxOpDraw::Scale(float scaleX, float scaleY)
{
- x1 *= scaleX;
- y1 *= scaleY;
- x2 *= scaleX;
- y2 *= scaleY;
- radius *= scaleX;
+ m_x1 *= scaleX;
+ m_y1 *= scaleY;
+ m_x2 *= scaleX;
+ m_y2 *= scaleY;
+ m_radius *= scaleX;
}
void wxOpDraw::Translate(float x, float y)
{
- x1 += x;
- y1 += y;
+ m_x1 += x;
+ m_y1 += y;
}
void wxOpDraw::Rotate(float x, float y, float sinTheta, float cosTheta)
{
- x1 = x1*cosTheta - y1*sinTheta + x*(1 - cosTheta) + y*sinTheta;
- y1 = x1*sinTheta + y1*cosTheta + y*(1 - cosTheta) + x*sinTheta;
-
- switch (op)
+ m_x1 = m_x1*cosTheta - m_y1*sinTheta + x*(1 - cosTheta) + y*sinTheta;
+ m_y1 = m_x1*sinTheta + m_y1*cosTheta + y*(1 - cosTheta) + x*sinTheta;
+
+ switch (m_op)
{
case DRAWOP_DRAW_LINE:
{
- x2 = x2*cosTheta - y2*sinTheta + x*(1 - cosTheta) + y*sinTheta;
- y2 = x2*sinTheta + y2*cosTheta + y*(1 - cosTheta) + x*sinTheta;
+ m_x2 = m_x2*cosTheta - m_y2*sinTheta + x*(1 - cosTheta) + y*sinTheta;
+ m_y2 = m_x2*sinTheta + m_y2*cosTheta + y*(1 - cosTheta) + x*sinTheta;
break;
}
default:
}
}
-wxExpr *wxOpDraw::WritewxExpr(wxPseudoMetaFile *image)
+wxExpr *wxOpDraw::WriteExpr(wxPseudoMetaFile *image)
{
wxExpr *expr = new wxExpr(PrologList);
- expr->Append(new wxExpr((long)op));
- switch (op)
+ expr->Append(new wxExpr((long)m_op));
+ switch (m_op)
{
case DRAWOP_DRAW_LINE:
case DRAWOP_DRAW_RECT:
case DRAWOP_DRAW_ELLIPSE:
{
- expr->Append(new wxExpr(x1));
- expr->Append(new wxExpr(y1));
- expr->Append(new wxExpr(x2));
- expr->Append(new wxExpr(y2));
+ expr->Append(new wxExpr(m_x1));
+ expr->Append(new wxExpr(m_y1));
+ expr->Append(new wxExpr(m_x2));
+ expr->Append(new wxExpr(m_y2));
break;
}
case DRAWOP_DRAW_ROUNDED_RECT:
{
- expr->Append(new wxExpr(x1));
- expr->Append(new wxExpr(y1));
- expr->Append(new wxExpr(x2));
- expr->Append(new wxExpr(y2));
- expr->Append(new wxExpr(radius));
+ expr->Append(new wxExpr(m_x1));
+ expr->Append(new wxExpr(m_y1));
+ expr->Append(new wxExpr(m_x2));
+ expr->Append(new wxExpr(m_y2));
+ expr->Append(new wxExpr(m_radius));
break;
}
case DRAWOP_DRAW_POINT:
{
- expr->Append(new wxExpr(x1));
- expr->Append(new wxExpr(y1));
+ expr->Append(new wxExpr(m_x1));
+ expr->Append(new wxExpr(m_y1));
break;
}
case DRAWOP_DRAW_TEXT:
{
- expr->Append(new wxExpr(x1));
- expr->Append(new wxExpr(y1));
- expr->Append(new wxExpr(PrologString, textString));
+ expr->Append(new wxExpr(m_x1));
+ expr->Append(new wxExpr(m_y1));
+ expr->Append(new wxExpr(PrologString, m_textString));
break;
}
case DRAWOP_DRAW_ARC:
return expr;
}
-void wxOpDraw::ReadwxExpr(wxPseudoMetaFile *image, wxExpr *expr)
+void wxOpDraw::ReadExpr(wxPseudoMetaFile *image, wxExpr *expr)
{
- switch (op)
+ switch (m_op)
{
case DRAWOP_DRAW_LINE:
case DRAWOP_DRAW_RECT:
case DRAWOP_DRAW_ELLIPSE:
{
- x1 = expr->Nth(1)->RealValue();
- y1 = expr->Nth(2)->RealValue();
- x2 = expr->Nth(3)->RealValue();
- y2 = expr->Nth(4)->RealValue();
+ m_x1 = expr->Nth(1)->RealValue();
+ m_y1 = expr->Nth(2)->RealValue();
+ m_x2 = expr->Nth(3)->RealValue();
+ m_y2 = expr->Nth(4)->RealValue();
break;
}
case DRAWOP_DRAW_ROUNDED_RECT:
{
- x1 = expr->Nth(1)->RealValue();
- y1 = expr->Nth(2)->RealValue();
- x2 = expr->Nth(3)->RealValue();
- y2 = expr->Nth(4)->RealValue();
- radius = expr->Nth(5)->RealValue();
+ m_x1 = expr->Nth(1)->RealValue();
+ m_y1 = expr->Nth(2)->RealValue();
+ m_x2 = expr->Nth(3)->RealValue();
+ m_y2 = expr->Nth(4)->RealValue();
+ m_radius = expr->Nth(5)->RealValue();
break;
}
case DRAWOP_DRAW_POINT:
{
- x1 = expr->Nth(1)->RealValue();
- y1 = expr->Nth(2)->RealValue();
+ m_x1 = expr->Nth(1)->RealValue();
+ m_y1 = expr->Nth(2)->RealValue();
break;
}
case DRAWOP_DRAW_TEXT:
{
- x1 = expr->Nth(1)->RealValue();
- y1 = expr->Nth(2)->RealValue();
- textString = copystring(expr->Nth(3)->StringValue());
+ m_x1 = expr->Nth(1)->RealValue();
+ m_y1 = expr->Nth(2)->RealValue();
+ m_textString = copystring(expr->Nth(3)->StringValue());
break;
}
case DRAWOP_DRAW_ARC:
wxOpPolyDraw::wxOpPolyDraw(int theOp, int n, wxRealPoint *thePoints):wxDrawOp(theOp)
{
- noPoints = n;
- points = thePoints;
+ m_noPoints = n;
+ m_points = thePoints;
}
wxOpPolyDraw::~wxOpPolyDraw()
{
- delete[] points;
+ delete[] m_points;
}
wxDrawOp *wxOpPolyDraw::Copy(wxPseudoMetaFile *newImage)
{
- wxRealPoint *newPoints = new wxRealPoint[noPoints];
- for (int i = 0; i < noPoints; i++)
+ wxRealPoint *newPoints = new wxRealPoint[m_noPoints];
+ for (int i = 0; i < m_noPoints; i++)
{
- newPoints[i].x = points[i].x;
- newPoints[i].y = points[i].y;
+ newPoints[i].x = m_points[i].x;
+ newPoints[i].y = m_points[i].y;
}
- wxOpPolyDraw *newOp = new wxOpPolyDraw(op, noPoints, newPoints);
+ wxOpPolyDraw *newOp = new wxOpPolyDraw(m_op, m_noPoints, newPoints);
return newOp;
}
void wxOpPolyDraw::Do(wxDC& dc, float xoffset, float yoffset)
{
- switch (op)
+ switch (m_op)
{
case DRAWOP_DRAW_POLYLINE:
{
- wxPoint *actualPoints = new wxPoint[noPoints];
+ wxPoint *actualPoints = new wxPoint[m_noPoints];
int i;
- for (i = 0; i < noPoints; i++)
+ for (i = 0; i < m_noPoints; i++)
{
- actualPoints[i].x = (long) points[i].x;
- actualPoints[i].y = (long) points[i].y;
+ actualPoints[i].x = (long) m_points[i].x;
+ actualPoints[i].y = (long) m_points[i].y;
}
- dc.DrawLines(noPoints, actualPoints, xoffset, yoffset);
+ dc.DrawLines(m_noPoints, actualPoints, xoffset, yoffset);
delete[] actualPoints;
break;
}
case DRAWOP_DRAW_POLYGON:
{
- wxPoint *actualPoints = new wxPoint[noPoints];
+ wxPoint *actualPoints = new wxPoint[m_noPoints];
int i;
- for (i = 0; i < noPoints; i++)
+ for (i = 0; i < m_noPoints; i++)
{
- actualPoints[i].x = (long) points[i].x;
- actualPoints[i].y = (long) points[i].y;
+ actualPoints[i].x = (long) m_points[i].x;
+ actualPoints[i].y = (long) m_points[i].y;
}
- dc.DrawPolygon(noPoints, actualPoints, xoffset, yoffset);
+ dc.DrawPolygon(m_noPoints, actualPoints, xoffset, yoffset);
delete[] actualPoints;
break;
}
case DRAWOP_DRAW_SPLINE:
{
-// dc.DrawSpline(noPoints, points, xoffset, yoffset);
+ wxPoint *actualPoints = new wxPoint[m_noPoints];
+ int i;
+ for (i = 0; i < m_noPoints; i++)
+ {
+ actualPoints[i].x = (long) m_points[i].x;
+ actualPoints[i].y = (long) m_points[i].y;
+ }
+
+ dc.DrawSpline(m_noPoints, actualPoints); // no offsets in DrawSpline // , xoffset, yoffset);
+
+ delete[] actualPoints;
+ break;
break;
}
default:
void wxOpPolyDraw::Scale(float scaleX, float scaleY)
{
- for (int i = 0; i < noPoints; i++)
+ for (int i = 0; i < m_noPoints; i++)
{
- points[i].x *= scaleX;
- points[i].y *= scaleY;
+ m_points[i].x *= scaleX;
+ m_points[i].y *= scaleY;
}
}
void wxOpPolyDraw::Translate(float x, float y)
{
- for (int i = 0; i < noPoints; i++)
+ for (int i = 0; i < m_noPoints; i++)
{
- points[i].x += x;
- points[i].y += y;
+ m_points[i].x += x;
+ m_points[i].y += y;
}
}
void wxOpPolyDraw::Rotate(float x, float y, float sinTheta, float cosTheta)
{
- for (int i = 0; i < noPoints; i++)
+ for (int i = 0; i < m_noPoints; i++)
{
- float x1 = points[i].x;
- float y1 = points[i].y;
- points[i].x = x1*cosTheta - y1*sinTheta + x*(1 - cosTheta) + y*sinTheta;
- points[i].y = x1*sinTheta + y1*cosTheta + y*(1 - cosTheta) + x*sinTheta;
+ float x1 = m_points[i].x;
+ float y1 = m_points[i].y;
+ m_points[i].x = x1*cosTheta - y1*sinTheta + x*(1 - cosTheta) + y*sinTheta;
+ m_points[i].y = x1*sinTheta + y1*cosTheta + y*(1 - cosTheta) + x*sinTheta;
}
}
-wxExpr *wxOpPolyDraw::WritewxExpr(wxPseudoMetaFile *image)
+wxExpr *wxOpPolyDraw::WriteExpr(wxPseudoMetaFile *image)
{
wxExpr *expr = new wxExpr(PrologList);
- expr->Append(new wxExpr((long)op));
- expr->Append(new wxExpr((long)noPoints));
+ expr->Append(new wxExpr((long)m_op));
+ expr->Append(new wxExpr((long)m_noPoints));
// char buf1[9];
char buf2[5];
*
*/
- for (int i = 0; i < noPoints; i++)
+ for (int i = 0; i < m_noPoints; i++)
{
- long signedX = (long)(points[i].x*100.0);
- long signedY = (long)(points[i].y*100.0);
+ long signedX = (long)(m_points[i].x*100.0);
+ long signedY = (long)(m_points[i].y*100.0);
// Scale to 0 -> 64K
long unSignedX = (long)(signedX + 32767.0);
return expr;
}
-void wxOpPolyDraw::ReadwxExpr(wxPseudoMetaFile *image, wxExpr *expr)
+void wxOpPolyDraw::ReadExpr(wxPseudoMetaFile *image, wxExpr *expr)
{
- noPoints = (int)expr->Nth(1)->IntegerValue();
+ m_noPoints = (int)expr->Nth(1)->IntegerValue();
char buf1[5];
char buf2[5];
- points = new wxRealPoint[noPoints];
+ m_points = new wxRealPoint[m_noPoints];
int i = 0;
int bufPtr = 0;
wxString hexString = expr->Nth(2)->StringValue();
- while (i < noPoints)
+ while (i < m_noPoints)
{
buf1[0] = hexString[bufPtr];
buf1[1] = hexString[bufPtr + 1];
int testY = (signed int)unSignedY;
#endif
- points[i].x = (float)(signedX / 100.0);
- points[i].y = (float)(signedY / 100.0);
+ m_points[i].x = (float)(signedX / 100.0);
+ m_points[i].y = (float)(signedY / 100.0);
i ++;
}
m_rotateable = TRUE;
m_width = 0.0;
m_height = 0.0;
+ m_outlinePen = NULL;
+ m_fillBrush = NULL;
}
wxPseudoMetaFile::wxPseudoMetaFile(wxPseudoMetaFile& mf)
}
m_ops.Clear();
m_gdiObjects.Clear();
+ m_outlineColours.Clear();
+ m_fillColours.Clear();
}
void wxPseudoMetaFile::Draw(wxDC& dc, float xoffset, float yoffset)
{
sprintf(buf, "op%d", i);
wxDrawOp *op = (wxDrawOp *)node->Data();
- wxExpr *expr = op->WritewxExpr(this);
+ wxExpr *expr = op->WriteExpr(this);
if (expr)
{
clause->AddAttributeValue(buf, expr);
case DRAWOP_SET_BK_MODE:
{
wxOpSetGDI *theOp = new wxOpSetGDI(opId, this, 0);
- theOp->ReadwxExpr(this, expr);
+ theOp->ReadExpr(this, expr);
m_ops.Append(theOp);
break;
}
case DRAWOP_DESTROY_CLIPPING_RECT:
{
wxOpSetClipping *theOp = new wxOpSetClipping(opId, 0.0, 0.0, 0.0, 0.0);
- theOp->ReadwxExpr(this, expr);
+ theOp->ReadExpr(this, expr);
m_ops.Append(theOp);
break;
}
case DRAWOP_DRAW_TEXT:
{
wxOpDraw *theOp = new wxOpDraw(opId, 0.0, 0.0, 0.0, 0.0);
- theOp->ReadwxExpr(this, expr);
+ theOp->ReadExpr(this, expr);
m_ops.Append(theOp);
break;
}
case DRAWOP_DRAW_POLYGON:
{
wxOpPolyDraw *theOp = new wxOpPolyDraw(opId, 0, NULL);
- theOp->ReadwxExpr(this, expr);
+ theOp->ReadExpr(this, expr);
m_ops.Append(theOp);
break;
}
copy.m_width = m_width;
copy.m_height = m_height;
copy.m_rotateable = m_rotateable;
+ copy.m_fillBrush = m_fillBrush;
+ copy.m_outlinePen = m_outlinePen;
+
+ copy.Clear();
// Copy the GDI objects
wxNode *node = m_gdiObjects.First();
}
// Copy the outline/fill operations
- copy.m_outlineColours.Clear();
node = m_outlineColours.First();
while (node)
{
copy.m_outlineColours.Append((wxObject *)node->Data());
node = node->Next();
}
- copy.m_fillColours.Clear();
node = m_fillColours.First();
while (node)
{
case META_SETBKCOLOR:
{
wxOpSetGDI *op = new wxOpSetGDI(DRAWOP_SET_BK_COLOUR, this, 0);
- op->r = (unsigned char)record->param1;
- op->g = (unsigned char)record->param2;
- op->b = (unsigned char)record->param3;
+ op->m_r = (unsigned char)record->param1;
+ op->m_g = (unsigned char)record->param2;
+ op->m_b = (unsigned char)record->param3;
m_ops.Append(op);
break;
}
case META_SETTEXTCOLOR:
{
wxOpSetGDI *op = new wxOpSetGDI(DRAWOP_SET_TEXT_COLOUR, this, 0);
- op->r = (unsigned char)record->param1;
- op->g = (unsigned char)record->param2;
- op->b = (unsigned char)record->param3;
+ op->m_r = (unsigned char)record->param1;
+ op->m_g = (unsigned char)record->param2;
+ op->m_b = (unsigned char)record->param3;
m_ops.Append(op);
break;
}
{
/*
wxMetaRecord *rec = new wxMetaRecord(META_EXCLUDECLIPRECT);
- rec->param4 = getshort(handle); // y2
+ rec->param4 = getshort(handle); // m_y2
rec->param3 = getshort(handle); // x2
rec->param2 = getshort(handle); // y1
rec->param1 = getshort(handle); // x1
case META_INTERSECTCLIPRECT:
{
/*
- rec->param4 = getshort(handle); // y2
+ rec->param4 = getshort(handle); // m_y2
rec->param3 = getshort(handle); // x2
rec->param2 = getshort(handle); // y1
rec->param1 = getshort(handle); // x1
while (node)
{
wxDrawOp *op = (wxDrawOp *)node->Data();
- switch (op->op)
+ switch (op->GetOp())
{
case DRAWOP_DRAW_LINE:
case DRAWOP_DRAW_RECT:
case DRAWOP_DRAW_TEXT:
{
wxOpDraw *opDraw = (wxOpDraw *)op;
- if (opDraw->x1 < minX) minX = opDraw->x1;
- if (opDraw->x1 > maxX) maxX = opDraw->x1;
- if (opDraw->y1 < minY) minY = opDraw->y1;
- if (opDraw->y1 > maxY) maxY = opDraw->y1;
- if (op->op == DRAWOP_DRAW_LINE)
+ if (opDraw->m_x1 < minX) minX = opDraw->m_x1;
+ if (opDraw->m_x1 > maxX) maxX = opDraw->m_x1;
+ if (opDraw->m_y1 < minY) minY = opDraw->m_y1;
+ if (opDraw->m_y1 > maxY) maxY = opDraw->m_y1;
+ if (op->GetOp() == DRAWOP_DRAW_LINE)
{
- if (opDraw->x2 < minX) minX = opDraw->x2;
- if (opDraw->x2 > maxX) maxX = opDraw->x2;
- if (opDraw->y2 < minY) minY = opDraw->y2;
- if (opDraw->y2 > maxY) maxY = opDraw->y2;
+ if (opDraw->m_x2 < minX) minX = opDraw->m_x2;
+ if (opDraw->m_x2 > maxX) maxX = opDraw->m_x2;
+ if (opDraw->m_y2 < minY) minY = opDraw->m_y2;
+ if (opDraw->m_y2 > maxY) maxY = opDraw->m_y2;
}
- else if (op->op == DRAWOP_DRAW_RECT ||
- op->op == DRAWOP_DRAW_ROUNDED_RECT ||
- op->op == DRAWOP_DRAW_ELLIPSE)
+ else if (op->GetOp() == DRAWOP_DRAW_RECT ||
+ op->GetOp() == DRAWOP_DRAW_ROUNDED_RECT ||
+ op->GetOp() == DRAWOP_DRAW_ELLIPSE)
{
- if ((opDraw->x1 + opDraw->x2) < minX) minX = (opDraw->x1 + opDraw->x2);
- if ((opDraw->x1 + opDraw->x2) > maxX) maxX = (opDraw->x1 + opDraw->x2);
- if ((opDraw->y1 + opDraw->y2) < minY) minY = (opDraw->y1 + opDraw->y2);
- if ((opDraw->y1 + opDraw->y2) > maxY) maxY = (opDraw->y1 + opDraw->y2);
+ if ((opDraw->m_x1 + opDraw->m_x2) < minX) minX = (opDraw->m_x1 + opDraw->m_x2);
+ if ((opDraw->m_x1 + opDraw->m_x2) > maxX) maxX = (opDraw->m_x1 + opDraw->m_x2);
+ if ((opDraw->m_y1 + opDraw->m_y2) < minY) minY = (opDraw->m_y1 + opDraw->m_y2);
+ if ((opDraw->m_y1 + opDraw->m_y2) > maxY) maxY = (opDraw->m_y1 + opDraw->m_y2);
}
break;
}
case DRAWOP_DRAW_SPLINE:
{
wxOpPolyDraw *poly = (wxOpPolyDraw *)op;
- for (int i = 0; i < poly->noPoints; i++)
+ for (int i = 0; i < poly->m_noPoints; i++)
{
- if (poly->points[i].x < minX) minX = poly->points[i].x;
- if (poly->points[i].x > maxX) maxX = poly->points[i].x;
- if (poly->points[i].y < minY) minY = poly->points[i].y;
- if (poly->points[i].y > maxY) maxY = poly->points[i].y;
+ if (poly->m_points[i].x < minX) minX = poly->m_points[i].x;
+ if (poly->m_points[i].x > maxX) maxX = poly->m_points[i].x;
+ if (poly->m_points[i].y < minY) minY = poly->m_points[i].y;
+ if (poly->m_points[i].y > maxY) maxY = poly->m_points[i].y;
}
break;
}
*/
}
+// Calculate size from current operations
+void wxPseudoMetaFile::CalculateSize(wxDrawnShape* shape)
+{
+ float boundMinX, boundMinY, boundMaxX, boundMaxY;
+
+ GetBounds(& boundMinX, & boundMinY, & boundMaxX, & boundMaxY);
+
+ SetSize(boundMaxX - boundMinX, boundMaxY - boundMinY);
+
+ if (shape)
+ {
+ shape->SetWidth(m_width);
+ shape->SetHeight(m_height);
+ }
+}
+
+// Set of functions for drawing into a pseudo metafile.
+// They use integers, but doubles are used internally for accuracy
+// when scaling.
+
+void wxPseudoMetaFile::DrawLine(const wxPoint& pt1, const wxPoint& pt2)
+{
+ wxOpDraw *theOp = new wxOpDraw(DRAWOP_DRAW_LINE,
+ (double) pt1.x, (double) pt1.y, (double) pt2.x, (double) pt2.y);
+
+ m_ops.Append(theOp);
+}
+
+void wxPseudoMetaFile::DrawRectangle(const wxRect& rect)
+{
+ wxOpDraw *theOp = new wxOpDraw(DRAWOP_DRAW_RECT,
+ (double) rect.x, (double) rect.y, (double) rect.width, (double) rect.height);
+
+ m_ops.Append(theOp);
+}
+
+void wxPseudoMetaFile::DrawRoundedRectangle(const wxRect& rect, double radius)
+{
+ wxOpDraw *theOp = new wxOpDraw(DRAWOP_DRAW_ROUNDED_RECT,
+ (double) rect.x, (double) rect.y, (double) rect.width, (double) rect.height);
+
+ theOp->m_radius = radius;
+
+ m_ops.Append(theOp);
+}
+
+void wxPseudoMetaFile::DrawEllipse(const wxRect& rect)
+{
+ wxOpDraw *theOp = new wxOpDraw(DRAWOP_DRAW_ELLIPSE,
+ (double) rect.x, (double) rect.y, (double) rect.width, (double) rect.height);
+
+ m_ops.Append(theOp);
+}
+
+void wxPseudoMetaFile::DrawPoint(const wxPoint& pt)
+{
+ wxOpDraw *theOp = new wxOpDraw(DRAWOP_DRAW_POINT,
+ (double) pt.x, (double) pt.y, 0.0, 0.0);
+
+ m_ops.Append(theOp);
+}
+
+void wxPseudoMetaFile::DrawText(const wxString& text, const wxPoint& pt)
+{
+ wxOpDraw *theOp = new wxOpDraw(DRAWOP_DRAW_TEXT,
+ (double) pt.x, (double) pt.y, 0.0, 0.0);
+
+ theOp->m_textString = copystring(text);
+
+ m_ops.Append(theOp);
+}
+
+void wxPseudoMetaFile::DrawLines(int n, wxPoint pts[])
+{
+ wxRealPoint* realPoints = new wxRealPoint[n];
+ int i;
+ for (i = 0; i < n; i++)
+ {
+ realPoints[i].x = pts[i].x;
+ realPoints[i].y = pts[i].y;
+ }
+ wxOpPolyDraw* theOp = new wxOpPolyDraw(DRAWOP_DRAW_POLYLINE, n, realPoints);
+ m_ops.Append(theOp);
+}
+
+void wxPseudoMetaFile::DrawPolygon(int n, wxPoint pts[])
+{
+ wxRealPoint* realPoints = new wxRealPoint[n];
+ int i;
+ for (i = 0; i < n; i++)
+ {
+ realPoints[i].x = pts[i].x;
+ realPoints[i].y = pts[i].y;
+ }
+ wxOpPolyDraw* theOp = new wxOpPolyDraw(DRAWOP_DRAW_POLYGON, n, realPoints);
+ m_ops.Append(theOp);
+}
+
+void wxPseudoMetaFile::DrawSpline(int n, wxPoint pts[])
+{
+ wxRealPoint* realPoints = new wxRealPoint[n];
+ int i;
+ for (i = 0; i < n; i++)
+ {
+ realPoints[i].x = pts[i].x;
+ realPoints[i].y = pts[i].y;
+ }
+ wxOpPolyDraw* theOp = new wxOpPolyDraw(DRAWOP_DRAW_SPLINE, n, realPoints);
+ m_ops.Append(theOp);
+}
+
+void wxPseudoMetaFile::SetClippingRect(const wxRect& rect)
+{
+ wxOpSetClipping* theOp = new wxOpSetClipping(DRAWOP_SET_CLIPPING_RECT,
+ (double) rect.x, (double) rect.y, (double) rect.width, (double) rect.height);
+}
+
+void wxPseudoMetaFile::DestroyClippingRect()
+{
+ wxOpSetClipping* theOp = new wxOpSetClipping(DRAWOP_DESTROY_CLIPPING_RECT,
+ 0.0, 0.0, 0.0, 0.0);
+
+ m_ops.Append(theOp);
+}
+
+void wxPseudoMetaFile::SetPen(wxPen* pen, bool isOutline)
+{
+ m_gdiObjects.Append(pen);
+ int n = m_gdiObjects.Number();
+
+ wxOpSetGDI* theOp = new wxOpSetGDI(DRAWOP_SET_PEN, this, n - 1);
+
+ m_ops.Append(theOp);
+
+ if (isOutline)
+ {
+ m_outlineColours.Append((wxObject*) (n - 1));
+ }
+}
+
+void wxPseudoMetaFile::SetBrush(wxBrush* brush, bool isFill)
+{
+ m_gdiObjects.Append(brush);
+ int n = m_gdiObjects.Number();
+
+ wxOpSetGDI* theOp = new wxOpSetGDI(DRAWOP_SET_BRUSH, this, n - 1);
+
+ m_ops.Append(theOp);
+
+ if (isFill)
+ {
+ m_fillColours.Append((wxObject*) (n - 1));
+ }
+}
+
+void wxPseudoMetaFile::SetFont(wxFont* font)
+{
+ m_gdiObjects.Append(font);
+ int n = m_gdiObjects.Number();
+
+ wxOpSetGDI* theOp = new wxOpSetGDI(DRAWOP_SET_FONT, this, n - 1);
+
+ m_ops.Append(theOp);
+}
+
+void wxPseudoMetaFile::SetTextColour(const wxColour& colour)
+{
+ wxOpSetGDI* theOp = new wxOpSetGDI(DRAWOP_SET_TEXT_COLOUR, this, 0);
+ theOp->m_r = colour.Red();
+ theOp->m_g = colour.Green();
+ theOp->m_b = colour.Blue();
+
+ m_ops.Append(theOp);
+}
+
+void wxPseudoMetaFile::SetBackgroundColour(const wxColour& colour)
+{
+ wxOpSetGDI* theOp = new wxOpSetGDI(DRAWOP_SET_BK_COLOUR, this, 0);
+ theOp->m_r = colour.Red();
+ theOp->m_g = colour.Green();
+ theOp->m_b = colour.Blue();
+
+ m_ops.Append(theOp);
+}
+
+void wxPseudoMetaFile::SetBackgroundMode(int mode)
+{
+ wxOpSetGDI* theOp = new wxOpSetGDI(DRAWOP_SET_BK_MODE, this, 0, mode);
+
+ m_ops.Append(theOp);
+}
#include "basic.h"
+class wxDrawnShape;
class wxPseudoMetaFile: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxPseudoMetaFile)
void GetBounds(float *minX, float *minY, float *maxX, float *maxY);
+ // Calculate size from current operations
+ void CalculateSize(wxDrawnShape* shape);
+
inline wxList& GetOutlineColours() const { return (wxList&) m_outlineColours; }
inline wxList& GetFillColours() const { return (wxList&) m_fillColours; }
inline void SetRotateable(bool rot) { m_rotateable = rot; }
inline bool GetRotateable() const { return m_rotateable; }
+ inline void SetSize(float w, float h) { m_width = w; m_height = h; }
+
+ inline void SetFillBrush(wxBrush* brush) { m_fillBrush = brush; }
+ inline wxBrush* GetFillBrush() const { return m_fillBrush; }
+
+ inline void SetOutlinePen(wxPen* pen) { m_outlinePen = pen; }
+ inline wxPen* GetOutlinePen() const { return m_outlinePen; }
+
+public:
+ /// Set of functions for drawing into a pseudo metafile.
+ /// They use integers, but doubles are used internally for accuracy
+ /// when scaling.
+
+ virtual void DrawLine(const wxPoint& pt1, const wxPoint& pt2);
+ virtual void DrawRectangle(const wxRect& rect);
+ virtual void DrawRoundedRectangle(const wxRect& rect, double radius);
+ virtual void DrawEllipse(const wxRect& rect);
+ virtual void DrawPoint(const wxPoint& pt);
+ virtual void DrawText(const wxString& text, const wxPoint& pt);
+ virtual void DrawLines(int n, wxPoint pts[]);
+ virtual void DrawPolygon(int n, wxPoint pts[]);
+ virtual void DrawSpline(int n, wxPoint pts[]);
+
+ virtual void SetClippingRect(const wxRect& rect);
+ virtual void DestroyClippingRect();
+
+ virtual void SetPen(wxPen* pen, bool isOutline = FALSE); // TODO: eventually, just store GDI object attributes, not actual
+ virtual void SetBrush(wxBrush* brush, bool isFill = FALSE); // pens/brushes etc.
+ virtual void SetFont(wxFont* font);
+ virtual void SetTextColour(const wxColour& colour);
+ virtual void SetBackgroundColour(const wxColour& colour);
+ virtual void SetBackgroundMode(int mode);
+
public:
bool m_rotateable;
float m_width;
inline void SetSaveToFile(bool save) { m_saveToFile = save; }
inline wxPseudoMetaFile& GetMetaFile() const { return (wxPseudoMetaFile&) m_metafile; }
+ /// Set of functions for drawing into a pseudo metafile.
+ /// They use integers, but doubles are used internally for accuracy
+ /// when scaling.
+
+ virtual void DrawLine(const wxPoint& pt1, const wxPoint& pt2);
+ virtual void DrawRectangle(const wxRect& rect);
+ virtual void DrawRoundedRectangle(const wxRect& rect, double radius);
+ virtual void DrawEllipse(const wxRect& rect);
+ virtual void DrawPoint(const wxPoint& pt);
+ virtual void DrawText(const wxString& text, const wxPoint& pt);
+ virtual void DrawLines(int n, wxPoint pts[]);
+ virtual void DrawPolygon(int n, wxPoint pts[]);
+ virtual void DrawSpline(int n, wxPoint pts[]);
+
+ virtual void SetClippingRect(const wxRect& rect);
+ virtual void DestroyClippingRect();
+
+ virtual void SetPen(wxPen* pen, bool isOutline = FALSE); // TODO: eventually, just store GDI object attributes, not actual
+ virtual void SetBrush(wxBrush* brush, bool isFill = FALSE); // pens/brushes etc.
+ virtual void SetFont(wxFont* font);
+ virtual void SetTextColour(const wxColour& colour);
+ virtual void SetBackgroundColour(const wxColour& colour);
+ virtual void SetBackgroundMode(int mode);
+
+ // Set the width/height according to the shapes in the metafile.
+ // Call this after drawing into the shape.
+ inline void CalculateSize() { m_metafile.CalculateSize(this); }
+
private:
wxPseudoMetaFile m_metafile;
// Don't save all wxDrawnShape metafiles to file: sometimes
// we take the metafile data from a symbol library.
bool m_saveToFile;
-
};
#endif
class wxDrawOp: public wxObject
{
- public:
- int op;
-
- inline wxDrawOp(int theOp) { op = theOp; }
+public:
+ inline wxDrawOp(int theOp) { m_op = theOp; }
inline ~wxDrawOp() {}
inline virtual void Scale(float xScale, float yScale) {};
inline virtual void Translate(float x, float y) {};
inline virtual void Rotate(float x, float y, float sinTheta, float cosTheta) {};
virtual void Do(wxDC& dc, float xoffset, float yoffset) = 0;
virtual wxDrawOp *Copy(wxPseudoMetaFile *newImage) = 0;
- virtual wxExpr *WritewxExpr(wxPseudoMetaFile *image) = 0;
- virtual void ReadwxExpr(wxPseudoMetaFile *image, wxExpr *expr) = 0;
+ virtual wxExpr *WriteExpr(wxPseudoMetaFile *image) = 0;
+ virtual void ReadExpr(wxPseudoMetaFile *image, wxExpr *expr) = 0;
+
+ int GetOp() const { return m_op; }
+
+protected:
+ int m_op;
+
};
/*
class wxOpSetGDI: public wxDrawOp
{
public:
- int mode;
- int gdiIndex;
- wxPseudoMetaFile *image;
- unsigned char r;
- unsigned char g;
- unsigned char b;
wxOpSetGDI(int theOp, wxPseudoMetaFile *theImage, int theGdiIndex, int theMode = 0);
void Do(wxDC& dc, float xoffset, float yoffset);
wxDrawOp *Copy(wxPseudoMetaFile *newImage);
- wxExpr *WritewxExpr(wxPseudoMetaFile *image);
- void ReadwxExpr(wxPseudoMetaFile *image, wxExpr *expr);
+ wxExpr *WriteExpr(wxPseudoMetaFile *image);
+ void ReadExpr(wxPseudoMetaFile *image, wxExpr *expr);
+
+public:
+ int m_mode;
+ int m_gdiIndex;
+ wxPseudoMetaFile* m_image;
+ unsigned char m_r;
+ unsigned char m_g;
+ unsigned char m_b;
};
/*
class wxOpSetClipping: public wxDrawOp
{
- public:
- float x1;
- float y1;
- float x2;
- float y2;
+public:
wxOpSetClipping(int theOp, float theX1, float theY1, float theX2, float theY2);
void Do(wxDC& dc, float xoffset, float yoffset);
void Scale(float xScale, float yScale);
void Translate(float x, float y);
wxDrawOp *Copy(wxPseudoMetaFile *newImage);
- wxExpr *WritewxExpr(wxPseudoMetaFile *image);
- void ReadwxExpr(wxPseudoMetaFile *image, wxExpr *expr);
+ wxExpr *WriteExpr(wxPseudoMetaFile *image);
+ void ReadExpr(wxPseudoMetaFile *image, wxExpr *expr);
+
+public:
+ float m_x1;
+ float m_y1;
+ float m_x2;
+ float m_y2;
};
/*
class wxOpDraw: public wxDrawOp
{
public:
- float x1;
- float y1;
- float x2;
- float y2;
- float x3;
- float radius;
- char *textString;
-
wxOpDraw(int theOp, float theX1, float theY1, float theX2, float theY2,
float radius = 0.0, char *s = NULL);
~wxOpDraw();
void Translate(float x, float y);
void Rotate(float x, float y, float sinTheta, float cosTheta);
wxDrawOp *Copy(wxPseudoMetaFile *newImage);
- wxExpr *WritewxExpr(wxPseudoMetaFile *image);
- void ReadwxExpr(wxPseudoMetaFile *image, wxExpr *expr);
+ wxExpr *WriteExpr(wxPseudoMetaFile *image);
+ void ReadExpr(wxPseudoMetaFile *image, wxExpr *expr);
+
+public:
+ float m_x1;
+ float m_y1;
+ float m_x2;
+ float m_y2;
+ float m_x3;
+ float m_radius;
+ char* m_textString;
+
};
/*
class wxOpPolyDraw: public wxDrawOp
{
- public:
- wxRealPoint *points;
- int noPoints;
-
+public:
wxOpPolyDraw(int theOp, int n, wxRealPoint *thePoints);
~wxOpPolyDraw();
void Do(wxDC& dc, float xoffset, float yoffset);
void Translate(float x, float y);
void Rotate(float x, float y, float sinTheta, float cosTheta);
wxDrawOp *Copy(wxPseudoMetaFile *newImage);
- wxExpr *WritewxExpr(wxPseudoMetaFile *image);
- void ReadwxExpr(wxPseudoMetaFile *image, wxExpr *expr);
+ wxExpr *WriteExpr(wxPseudoMetaFile *image);
+ void ReadExpr(wxPseudoMetaFile *image, wxExpr *expr);
+
+public:
+ wxRealPoint* m_points;
+ int m_noPoints;
+
};
#endif
// Override select, to create/delete temporary label-moving objects
void wxLineShape::Select(bool select, wxDC* dc)
{
- wxShape::Select(select);
+ wxShape::Select(select, dc);
if (select)
{
for (int i = 0; i < 3; i++)
inline WXTYPE _GetType() const { return m_arrowType; }
inline int GetPosition() const { return m_arrowEnd; }
+ inline void SetPosition(int pos) { m_arrowEnd = pos; }
inline float GetXOffset() const { return m_xOffset; }
inline float GetYOffset() const { return m_yOffset; }
inline float GetSpacing() const { return m_spacing; }
// Does the copying for this object
void Copy(wxShape& copy);
- // New OGL stuff
+ // Add an arrowhead.
wxArrowHead *AddArrow(WXTYPE type, int end = ARROW_POSITION_END,
float arrowSize = 10.0, float xOffset = 0.0, const wxString& name = "",
wxPseudoMetaFile *mf = NULL, long arrowId = -1);
bool DeleteArrowHead(long arrowId);
void DrawArrow(wxDC& dc, wxArrowHead *arrow, float xOffset, bool proportionalOffset);
inline void SetIgnoreOffsets(bool ignore) { m_ignoreArrowOffsets = ignore; }
+ inline wxList& GetArrows() const { return (wxList&) m_arcArrows; }
// Find horizontal width for drawing a line with
// arrows in minimum space. Assume arrows at
{
GraphicsBullseyeCursor = new wxCursor(wxCURSOR_BULLSEYE);
- g_oglNormalFont = new wxFont(12, wxMODERN, wxNORMAL, wxNORMAL);
+ g_oglNormalFont = new wxFont(10, wxSWISS, wxNORMAL, wxNORMAL);
black_pen = new wxPen("BLACK", 1, wxSOLID);
}
}
+/*
+ * Hex<->Dec conversion
+ */
+
+// Array used in DecToHex conversion routine.
+static char sg_HexArray[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B',
+ 'C', 'D', 'E', 'F' };
+
+// Convert 2-digit hex number to decimal
+unsigned int oglHexToDec(char* buf)
+{
+ int firstDigit, secondDigit;
+
+ if (buf[0] >= 'A')
+ firstDigit = buf[0] - 'A' + 10;
+ else
+ firstDigit = buf[0] - '0';
+
+ if (buf[1] >= 'A')
+ secondDigit = buf[1] - 'A' + 10;
+ else
+ secondDigit = buf[1] - '0';
+
+ return firstDigit * 16 + secondDigit;
+}
+
+// Convert decimal integer to 2-character hex string
+void oglDecToHex(unsigned int dec, char *buf)
+{
+ int firstDigit = (int)(dec/16.0);
+ int secondDigit = (int)(dec - (firstDigit*16.0));
+ buf[0] = sg_HexArray[firstDigit];
+ buf[1] = sg_HexArray[secondDigit];
+ buf[2] = 0;
+}
+
+// 3-digit hex to wxColour
+wxColour oglHexToColour(const wxString& hex)
+{
+ if (hex.Length() == 6)
+ {
+ char buf[7];
+ strncpy(buf, hex, 7);
+ unsigned int r = oglHexToDec((char *)buf);
+ unsigned int g = oglHexToDec((char *)(buf+2));
+ unsigned int b = oglHexToDec((char *)(buf+4));
+ return wxColour(r, g, b);
+ }
+ else
+ return wxColour(0,0,0);
+}
+
+// RGB to 3-digit hex
+wxString oglColourToHex(const wxColour& colour)
+{
+ char buf[7];
+ unsigned int red = colour.Red();
+ unsigned int green = colour.Green();
+ unsigned int blue = colour.Blue();
+
+ oglDecToHex(red, buf);
+ oglDecToHex(green, buf+2);
+ oglDecToHex(blue, buf+4);
+
+ return wxString(buf);
+}
+
extern wxFont *MatchFont(int point_size);
+extern wxString oglColourToHex(const wxColour& colour);
+extern wxColour oglHexToColour(const wxString& hex);
+extern void oglDecToHex(unsigned int dec, char *buf);
+extern unsigned int oglHexToDec(char* buf);
+
+
#endif
// _OGL_MISC_H_