// ----------------------------------------------------------------------------
// it won't compile without it anyhow
-#ifndef USE_CONFIG
- #error "Please define USE_CONFIG or remove config.cpp from your makefile"
-#endif // USE_CONFIG
+#ifndef wxUSE_CONFIG
+ #error "Please define wxUSE_CONFIG or remove config.cpp from your makefile"
+#endif // wxUSE_CONFIG
// ----------------------------------------------------------------------------
// constants
#include "wx/object.h"
#include "wx/string.h"
-#if USE_TIMEDATE
+#if wxUSE_TIMEDATE
enum wxdate_format_type {wxMDY, wxDAY, wxMONTH, wxFULL, wxEUROPEAN};
#include "wx/cmndata.h"
#include "wx/string.h"
-#if USE_PRINTING_ARCHITECTURE
+#if wxUSE_PRINTING_ARCHITECTURE
#include "wx/print.h"
#endif
inline wxDocManager *GetDocumentManager(void) const { return m_viewDocument->GetDocumentManager(); }
-#if USE_PRINTING_ARCHITECTURE
+#if wxUSE_PRINTING_ARCHITECTURE
virtual wxPrintout *OnCreatePrintout(void);
#endif
* Provide simple default printing facilities
*/
-#if USE_PRINTING_ARCHITECTURE
+#if wxUSE_PRINTING_ARCHITECTURE
class WXDLLEXPORT wxDocPrintout: public wxPrintout
{
DECLARE_DYNAMIC_CLASS(wxDocPrintout)
// ----------------------------------------------------------------------------
// it won't compile without it anyhow
-#ifndef USE_CONFIG
- #error "Please define USE_CONFIG or remove fileconf.cpp from your makefile"
-#endif // USE_CONFIG
+#ifndef wxUSE_CONFIG
+ #error "Please define wxUSE_CONFIG or remove fileconf.cpp from your makefile"
+#endif // wxUSE_CONFIG
// ----------------------------------------------------------------------------
// wxFileConfig
#include <stdio.h>
#include "wx/wx.h"
-#if USE_HELP
+#if wxUSE_HELP
#include "wx/helpbase.h"
wxXLPHelpClient helpClient;
};
-#endif // USE_HELP
+#endif // wxUSE_HELP
#endif
// __HELPXLPH__
// an exception to the general rule that a normal header doesn't include other
// headers - only because ownerdrw.h is not always included and I don't want
// to write #ifdef's everywhere...
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
#include "wx/ownerdrw.h"
#endif
// wxMenuItem: an item in the menu, optionally implements owner-drawn behaviour
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxMenuItem: public wxObject
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
, public wxOwnerDrawn
#endif
{
bool m_bEnabled, // enabled or greyed?
m_bChecked; // checked? (only if checkable)
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
// wxOwnerDrawn base class already has these variables - nothing to do
#else //!owner drawn
#include "wx/string.h"
#include "wx/control.h"
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
#include <iostream.h>
#else
#include <iostream>
// an exception to the general rule that a normal header doesn't include other
// headers - only because ownerdrw.h is not always included and I don't want
// to write #ifdef's everywhere...
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
#include "wx/ownerdrw.h"
#endif
// wxMenuItem: an item in the menu, optionally implements owner-drawn behaviour
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxMenuItem: public wxObject
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
, public wxOwnerDrawn
#endif
{
bool m_bEnabled, // enabled or greyed?
m_bChecked; // checked? (only if checkable)
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
// wxOwnerDrawn base class already has these variables - nothing to do
#else //!owner drawn
#include "wx/string.h"
#include "wx/control.h"
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
#include <iostream.h>
#else
#include <iostream>
#include "wx/wx.h"
-#if USE_HELP
+#if wxUSE_HELP
// Defines the API for help controllers
class WXDLLEXPORT wxHelpControllerBase: public wxObject
virtual void OnQuit(void) {};
};
-#endif // USE_HELP
+#endif // wxUSE_HELP
#endif
// _WX_HELPBASEH__
info, or to be a straight call to the new operator.
*/
-#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
+#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
#include <stddef.h>
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
#include <iostream.h>
#else
#include <iostream>
// Currently, these merely call malloc and free; only the wxObject
// operators do something interesting. But this allows WXDEBUG_NEW to
// work for all 'new's in a file.
-#if USE_GLOBAL_MEMORY_OPERATORS
+#if wxUSE_GLOBAL_MEMORY_OPERATORS
#ifdef new
#undef new
// an exception to the general rule that a normal header doesn't include other
// headers - only because ownerdrw.h is not always included and I don't want
// to write #ifdef's everywhere...
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
#include "wx/ownerdrw.h"
#endif
// wxMenuItem: an item in the menu, optionally implements owner-drawn behaviour
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxMenuItem: public wxObject
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
, public wxOwnerDrawn
#endif
{
wxMenuBar* m_menuBar;
wxMenu* m_topMenu; // Top-level menu e.g. popup-menu
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
// wxOwnerDrawn base class already has these variables - nothing to do
#else //!owner drawn
*
*/
-#define USE_CONSTRAINTS 1
+#define wxUSE_CONSTRAINTS 1
// Use constraints mechanism
-#define USE_CONFIG 1
+#define wxUSE_CONFIG 1
// Use wxConfig, with CreateConfig in wxApp
#define _WX_GOODCOMPILER__
// gcc can have problems, but Windows compilers
// Level 1: wxDC, OnSize (etc.) compatibility, but
// some new features such as event tables
-#define USE_POSTSCRIPT 1
+#define wxUSE_POSTSCRIPT 1
// 0 for no PostScript device context
-#define USE_AFM_FOR_POSTSCRIPT 0
+#define wxUSE_AFM_FOR_POSTSCRIPT 0
// 1 to use font metric files in GetTextExtent
-#define USE_METAFILE 1
+#define wxUSE_METAFILE 1
// 0 for no Metafile and metafile device context
-#define USE_IPC 1
+#define wxUSE_IPC 1
// 0 for no interprocess comms
-#define USE_HELP 1
+#define wxUSE_HELP 1
// 0 for no help facility
-#define USE_RESOURCES 1
+#define wxUSE_RESOURCES 1
// 0 for no wxGetResource/wxWriteResource
-#define USE_CLIPBOARD 1
+#define wxUSE_CLIPBOARD 1
// 0 for no clipboard functions
-#define USE_SPLINES 1
+#define wxUSE_SPLINES 1
// 0 for no splines
-#define USE_XFIG_SPLINE_CODE 1
+#define wxUSE_XFIG_SPLINE_CODE 1
// 1 for XFIG spline code, 0 for AIAI spline code.
// AIAI spline code is slower, but freer of copyright issues.
// 0 for no splines
-#define USE_TOOLBAR 1
+#define wxUSE_TOOLBAR 1
// Use toolbars
-#define USE_DRAG_AND_DROP 1
+#define wxUSE_DRAG_AND_DROP 1
// 0 for no drag and drop
-#define USE_WX_RESOURCES 1
+#define wxUSE_WX_RESOURCES 1
// Use .wxr resource mechanism (requires PrologIO library)
-#define USE_DOC_VIEW_ARCHITECTURE 1
+#define wxUSE_DOC_VIEW_ARCHITECTURE 1
// Set to 0 to disable document/view architecture
-#define USE_PRINTING_ARCHITECTURE 1
+#define wxUSE_PRINTING_ARCHITECTURE 1
// Set to 0 to disable print/preview architecture code
-#define USE_POSTSCRIPT_ARCHITECTURE_IN_MSW 1
+#define wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW 1
// Set to 0 to disable PostScript print/preview architecture code
// under Windows (just use Windows printing).
-#define USE_DYNAMIC_CLASSES 1
+#define wxUSE_DYNAMIC_CLASSES 1
// If 1, enables provision of run-time type information.
// NOW MANDATORY: don't change.
-#define USE_MEMORY_TRACING 1
+#define wxUSE_MEMORY_TRACING 1
// If 1, enables debugging versions of wxObject::new and
// wxObject::delete *IF* WXDEBUG is also defined.
// WARNING: this code may not work with all architectures, especially
// if alignment is an issue.
-#define USE_DEBUG_CONTEXT 1
+#define wxUSE_DEBUG_CONTEXT 1
// If 1, enables wxDebugContext, for
// writing error messages to file, etc.
// If WXDEBUG is not defined, will still use
// since you may well need to output
// an error log in a production
// version (or non-debugging beta)
-#define USE_GLOBAL_MEMORY_OPERATORS 0
+#define wxUSE_GLOBAL_MEMORY_OPERATORS 0
// In debug mode, cause new and delete to be redefined globally.
// If this causes problems (e.g. link errors), set this to 0.
// Set this to 0 if your compiler can't cope
// with omission of prototype parameters.
-#define USE_C_MAIN 0
+#define wxUSE_C_MAIN 0
// Set to 1 to use main.c instead of main.cpp (UNIX only)
-#define USE_ODBC 0
+#define wxUSE_ODBC 0
// Define 1 to use ODBC classes
-#define USE_IOSTREAMH 1
+#define wxUSE_IOSTREAMH 1
// VC++ 4.2 and above allows <iostream> and <iostream.h>
// but you can't mix them. Set to 1 for <iostream.h>,
// 0 for <iostream>
-#define USE_WXCONFIG 1
+#define wxUSE_WXCONFIG 1
// if enabled, compiles built-in OS independent wxConfig
// class and it's file (any platform) and registry (Win)
// based implementations
*
*/
-#define USE_APPLE_IEEE 1
+#define wxUSE_APPLE_IEEE 1
// if enabled, the float codec written by Apple
// will be used to write, in a portable way,
// float on the disk
#include "wx/control.h"
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
#include <iostream.h>
#else
#include <iostream>
class WXDLLEXPORT wxDC;
class WXDLLEXPORT wxValidator;
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
class WXDLLEXPORT wxDropTarget;
#endif
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
class WXDLLEXPORT wxResourceTable;
class WXDLLEXPORT wxItemResource;
#endif
// Enable or disable the window
virtual void Enable(bool enable);
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
// Associate a drop target with this window (if the window already had a drop
// target, it's deleted!) and return the current drop target (may be NULL).
void SetDropTarget(wxDropTarget *pDropTarget);
virtual void OnDefaultAction(wxControl *initiatingItem);
// Resource loading
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
virtual bool LoadFromResource(wxWindow *parent, const wxString& resourceName, const wxResourceTable *table = NULL);
virtual wxControl *CreateItem(const wxItemResource *childResource, const wxResourceTable *table = NULL);
#endif
wxColour m_defaultForegroundColour;
wxAcceleratorTable m_acceleratorTable;
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
wxDropTarget *m_pDropTarget; // the current drop target or NULL
#endif //USE_DRAG_AND_DROP
// Initialize with raw data
wxBitmap(const char bits[], int width, int height, int depth = 1);
-#if USE_XPM_IN_MSW
+#if wxUSE_XPM_IN_MSW
class wxItem;
// Initialize with XPM data
wxBitmap(const char **data, wxItem *anItem = NULL);
#include "wx/defs.h"
#include "wx/setup.h"
-#if USE_CLIPBOARD
+#if wxUSE_CLIPBOARD
#include "wx/list.h"
/* The clipboard */
WXDLLEXPORT_DATA(extern wxClipboard*) wxTheClipboard;
-#endif // USE_CLIPBOARD
+#endif // wxUSE_CLIPBOARD
#endif
// _WX_CLIPBRD_H_
#include "wx/choice.h"
-#if USE_COMBOBOX
+#if wxUSE_COMBOBOX
WXDLLEXPORT_DATA(extern const char*) wxComboBoxNameStr;
WXDLLEXPORT_DATA(extern const char*) wxEmptyString;
virtual bool MSWCommand(WXUINT param, WXWORD id);
};
-#endif // USE_COMBOBOX
+#endif // wxUSE_COMBOBOX
#endif
// _WX_COMBOBOX_H_
return Blit(destPt.x, destPt.y, sz.x, sz.y, source, srcPt.x, srcPt.y, rop, useMask);
}
-#if USE_SPLINES
+#if wxUSE_SPLINES
// Splines
// 3-point spline
virtual void DrawSpline(long x1, long y1, long x2, long y2, long x3, long y3);
#include "wx/wx.h"
-#if USE_HELP
+#if wxUSE_HELP
#include "wx/helpbase.h"
wxString m_helpFile;
};
-#endif // USE_HELP
+#endif // wxUSE_HELP
#endif
// _WX_HELPWIN_H_
WXDLLEXPORT_DATA(extern const char*) wxListBoxNameStr;
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
class WXDLLEXPORT wxOwnerDrawn;
// define the array of list box items
bool MSWCommand(WXUINT param, WXWORD id);
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
bool MSWOnMeasure(WXMEASUREITEMSTRUCT *item);
bool MSWOnDraw(WXDRAWITEMSTRUCT *item);
int m_noItems;
int m_selected;
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
// control items
wxListBoxItemsArray m_aItems;
#endif
// an exception to the general rule that a normal header doesn't include other
// headers - only because ownerdrw.h is not always included and I don't want
// to write #ifdef's everywhere...
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
#include "wx/ownerdrw.h"
#endif
// wxMenuItem: an item in the menu, optionally implements owner-drawn behaviour
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxMenuItem: public wxObject
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
, public wxOwnerDrawn
#endif
{
bool m_bEnabled, // enabled or greyed?
m_bChecked; // checked? (only if checkable)
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
// wxOwnerDrawn base class already has these variables - nothing to do
#else //!owner drawn
#include "wx/setup.h"
-#if USE_METAFILE
+#if wxUSE_METAFILE
#include "wx/dc.h"
/*
// Optional origin and extent
bool WXDLLEXPORT wxMakeMetaFilePlaceable(const wxString& filename, int x1, int y1, int x2, int y2, float scale = 1.0, bool useOriginAndExtent = TRUE);
-#endif // USE_METAFILE
+#endif // wxUSE_METAFILE
#endif
// _WX_METAFIILE_H_
#endif
#if !USE_DRAG_AND_DROP
- #error "You should #define USE_DRAG_AND_DROP to 1 to compile this file!"
+ #error "You should #define wxUSE_DRAG_AND_DROP to 1 to compile this file!"
#endif //WX_DRAG_DROP
// ----------------------------------------------------------------------------
#endif
#if !USE_DRAG_AND_DROP
- #error "You should #define USE_DRAG_AND_DROP to 1 to compile this file!"
+ #error "You should #define wxUSE_DRAG_AND_DROP to 1 to compile this file!"
#endif //WX_DRAG_DROP
// ----------------------------------------------------------------------------
#define DLGPROC FARPROC
#endif
-#if USE_PENWIN
+#if wxUSE_PENWIN
void WXDLLEXPORT wxRegisterPenWin(void);
void WXDLLEXPORT wxCleanUpPenWin(void);
void WXDLLEXPORT wxEnablePenAppHooks (bool hook);
#endif
-#if USE_ITSY_BITSY
+#if wxUSE_ITSY_BITSY
#define IBS_HORZCAPTION 0x4000L
#define IBS_VERTCAPTION 0x8000L
// ----------------------------------------------------------------------------
// mutable hack (see also registry.cpp)
// ----------------------------------------------------------------------------
-#if USE_MUTABLE
+#if wxUSE_MUTABLE
#define MUTABLE mutable
#else
#define MUTABLE
*
*/
-#define USE_CONFIG 1
+#define wxUSE_CONFIG 1
// Use wxConfig, with CreateConfig in wxApp
#define _WX_GOODCOMPILER__
// gcc can have problems, but Windows compilers
// Level 1: wxDC, OnSize (etc.) compatibility, but
// some new features such as event tables
-#define USE_AUTOTRANS 1
+#define wxUSE_AUTOTRANS 1
// Define wxTString
-#define USE_POSTSCRIPT 1
+#define wxUSE_POSTSCRIPT 1
// 0 for no PostScript device context
-#define USE_AFM_FOR_POSTSCRIPT 0
+#define wxUSE_AFM_FOR_POSTSCRIPT 0
// 1 to use font metric files in GetTextExtent
-#define USE_METAFILE 1
+#define wxUSE_METAFILE 1
// 0 for no Metafile and metafile device context
-#define USE_FORM 0
+#define wxUSE_FORM 0
// 0 for no wxForm
-#define USE_IPC 1
+#define wxUSE_IPC 1
// 0 for no interprocess comms
// Note: wxHELP uses IPC under X so these are interdependent!
-#define USE_HELP 1
+#define wxUSE_HELP 1
// 0 for no help facility
-#define USE_RESOURCES 1
+#define wxUSE_RESOURCES 1
// 0 for no wxGetResource/wxWriteResource
-#define USE_CONSTRAINTS 1
+#define wxUSE_CONSTRAINTS 1
// 0 for no window layout constraint system
-#define USE_TIMEDATE 1
+#define wxUSE_TIMEDATE 1
// 0 for no wxTime/wxDate classes
-#define USE_CLIPBOARD 1
+#define wxUSE_CLIPBOARD 1
// 0 for no clipboard functions
-#define USE_SPLINES 1
+#define wxUSE_SPLINES 1
// 0 for no splines
-#define USE_XFIG_SPLINE_CODE 1
+#define wxUSE_XFIG_SPLINE_CODE 1
// 1 for XFIG spline code, 0 for AIAI spline code.
// AIAI spline code is slower, but freer of copyright issues.
-#define USE_DRAG_AND_DROP 1
+#define wxUSE_DRAG_AND_DROP 1
// 0 for no drag and drop
-#define USE_TOOLBAR 1
+#define wxUSE_TOOLBAR 1
// Define 1 to use toolbar classes
-#define USE_BUTTONBAR 1
+#define wxUSE_BUTTONBAR 1
// Define 1 to use buttonbar classes (enhanced toolbar
// for MS Windows)
-#define USE_GAUGE 1
+#define wxUSE_GAUGE 1
// Define 1 to use Microsoft's gauge (Windows)
// or Bull's gauge (Motif) library (both in contrib).
-#define USE_COMBOBOX 1
+#define wxUSE_COMBOBOX 1
// Define 1 to use COMBOXBOX control (Windows)
// or FWW's ComboBox widget (Motif).
-#define USE_RADIOBUTTON 1
+#define wxUSE_RADIOBUTTON 1
// Define 1 to use radio button control
-#define USE_SCROLLBAR 1
+#define wxUSE_SCROLLBAR 1
// Define 1 to compile contributed wxScrollBar class
-#define USE_XPM_IN_X 1
-#define USE_XPM_IN_MSW 0
+#define wxUSE_XPM_IN_X 1
+#define wxUSE_XPM_IN_MSW 0
// Define 1 to support the XPM package in wxBitmap,
// separated by platform. If 1, you must link in
// the XPM library to your applications.
-#define USE_IMAGE_LOADING_IN_X 1
+#define wxUSE_IMAGE_LOADING_IN_X 1
// Use dynamic icon/bitmap loading/saving code in utils/image under X.
// If this is 1, you will need to link your applications
// with image_X.lib. where X is motif, ol, or hp.
-#define USE_IMAGE_LOADING_IN_MSW 1
+#define wxUSE_IMAGE_LOADING_IN_MSW 1
// Use dynamic DIB loading/saving code in utils/dib under MSW.
-#define USE_RESOURCE_LOADING_IN_MSW 0
+#define wxUSE_RESOURCE_LOADING_IN_MSW 0
// Use dynamic icon/cursor loading/saving code
// under MSW.
-#define USE_WX_RESOURCES 1
+#define wxUSE_WX_RESOURCES 1
// Use .wxr resource mechanism (requires PrologIO library)
-#define USE_GNU_WXSTRING 0
+#define wxUSE_GNU_WXSTRING 0
// Define 1 to use modified GNU wxString class
// from (stefan.hammes@urz.uni-heidelberg.de) in contrib\string
// TODO: why does this give an unresolved 'wxRegex::Search'
#define HAVE_SOCKET 1
// Use WinSock if 1
-#define USE_DOC_VIEW_ARCHITECTURE 1
+#define wxUSE_DOC_VIEW_ARCHITECTURE 1
// Set to 0 to disable document/view architecture
-#define USE_PRINTING_ARCHITECTURE 1
+#define wxUSE_PRINTING_ARCHITECTURE 1
// Set to 0 to disable print/preview architecture code
-#define USE_POSTSCRIPT_ARCHITECTURE_IN_MSW 1
+#define wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW 1
// Set to 0 to disable PostScript print/preview architecture code
// under Windows (just use Windows printing).
-#define USE_DYNAMIC_CLASSES 1
+#define wxUSE_DYNAMIC_CLASSES 1
// If 1, enables provision of run-time type information.
// NOW MANDATORY: don't change.
-#define USE_MEMORY_TRACING 1
+#define wxUSE_MEMORY_TRACING 1
// If 1, enables debugging versions of wxObject::new and
// wxObject::delete *IF* WXDEBUG is also defined.
// WARNING: this code may not work with all architectures, especially
// if alignment is an issue.
-#define USE_DEBUG_CONTEXT 1
+#define wxUSE_DEBUG_CONTEXT 1
// If 1, enables wxDebugContext, for
// writing error messages to file, etc.
// If WXDEBUG is not defined, will still use
// 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 wxUSE_GLOBAL_MEMORY_OPERATORS 1
// In debug mode, cause new and delete to be redefined globally.
// If this causes problems (e.g. link errors), set this to 0.
// Set this to 0 if your compiler can't cope
// with omission of prototype parameters.
-#define USE_C_MAIN 0
+#define wxUSE_C_MAIN 0
// Set to 1 to use main.c instead of main.cpp (UNIX only)
-#define USE_ODBC 1
+#define wxUSE_ODBC 1
// Define 1 to use ODBC classes
-#define USE_IOSTREAMH 1
+#define wxUSE_IOSTREAMH 1
// VC++ 4.2 and above allows <iostream> and <iostream.h>
// but you can't mix them. Set to 1 for <iostream.h>,
// 0 for <iostream>
-#define USE_WXCONFIG 1
+#define wxUSE_WXCONFIG 1
// if enabled, compiles built-in OS independent wxConfig
// class and it's file (any platform) and registry (Win)
// based implementations
*
*/
-#define USE_APPLE_IEEE 1
+#define wxUSE_APPLE_IEEE 1
// if enabled, the float codec written by Apple
// will be used to write, in a portable way,
// float on the disk
// See note above about using FAFA and CTL3D.
#endif
-#define USE_COMMON_DIALOGS 1
+#define wxUSE_COMMON_DIALOGS 1
// On rare occasions (e.g. using DJGPP) may want
// to omit common dialogs
// (e.g. file selector, printer dialog).
// Switching this off also switches off
// the printing architecture and interactive
// wxPrinterDC.
-#define USE_ITSY_BITSY 1
+#define wxUSE_ITSY_BITSY 1
// Define 1 to use Microsoft's ItsyBitsy
// small title bar library, for wxMiniFrame
-#define USE_BITMAP_MESSAGE 1
+#define wxUSE_BITMAP_MESSAGE 1
// Define 1 to use bitmap messages.
-#define USE_PORTABLE_FONTS_IN_MSW 0
+#define wxUSE_PORTABLE_FONTS_IN_MSW 0
// Define 1 to use new portable font scheme in Windows
// (used by default under X)
#define FONT_SIZE_COMPATIBILITY 0
// Define 1 for font size to be backward compatible
// to 1.63 and earlier. 1.64 and later define point
// sizes to be compatible with Windows.
-#define USE_GENERIC_DIALOGS_IN_MSW 1
+#define wxUSE_GENERIC_DIALOGS_IN_MSW 1
// Define 1 to use generic dialogs in Windows, even though
// they duplicate native common dialog (e.g. wxColourDialog)
-#define USE_PENWINDOWS 0
+#define wxUSE_PENWINDOWS 0
// Set to 1 to use PenWindows
-#define USE_OWNER_DRAWN 0
+#define wxUSE_OWNER_DRAWN 0
// Owner-drawn menus and listboxes
-#define USE_NATIVE_STATUSBAR 1
+#define wxUSE_NATIVE_STATUSBAR 1
// Set to 0 to use cross-platform wxStatusBar
/*
*
*/
-#define USE_TYPEDEFS 0
+#define wxUSE_TYPEDEFS 0
// Use typedefs not classes for wxPoint
// and others, to reduce overhead and avoid
// MS C7 memory bug. Bounds checker
// Can't use OLE drag and drop in Windows 3.1 because we don't know how
// to implement UUIDs
// GnuWin32 doesn't have appropriate headers for e.g. IUnknown.
-#undef USE_DRAG_AND_DROP
-#define USE_DRAG_AND_DROP 0
+#undef wxUSE_DRAG_AND_DROP
+#define wxUSE_DRAG_AND_DROP 0
#endif
// Only WIN32 supports wxStatusBar95
-#if !defined(__WIN32__) && USE_NATIVE_STATUSBAR
-#undef USE_NATIVE_STATUSBAR
-#define USE_NATIVE_STATUSBAR 0
+#if !defined(__WIN32__) && wxUSE_NATIVE_STATUSBAR
+#undef wxUSE_NATIVE_STATUSBAR
+#define wxUSE_NATIVE_STATUSBAR 0
#endif
// Minimal setup e.g. for compiling small utilities
#define MINIMAL_WXWINDOWS_SETUP 0
#if MINIMAL_WXWINDOWS_SETUP
-#undef USE_POSTSCRIPT
-# define USE_POSTSCRIPT 0
-#undef USE_PRINTING_ARCHITECTURE
-# define USE_PRINTING_ARCHITECTURE 0
-#undef USE_POSTSCRIPT_ARCHITECTURE_IN_MSW
-# define USE_POSTSCRIPT_ARCHITECTURE_IN_MSW 0
-#undef USE_METAFILE
-# define USE_METAFILE 0
-#undef USE_FORM
-# define USE_FORM 0
-#undef USE_SPLINES
-# define USE_SPLINES 0
-#undef USE_SCROLLBAR
-# define USE_SCROLLBAR 0
-#undef USE_COMBOBOX
-# define USE_COMBOBOX 0
-#undef USE_RADIOBUTTON
-# define USE_RADIOBUTTON 0
-#undef USE_XPM_IN_MSW
-# define USE_XPM_IN_MSW 0
-#undef USE_WX_RESOURCES
-# define USE_WX_RESOURCES 0
-#undef USE_DOC_VIEW_ARCHITECTURE
-# define USE_DOC_VIEW_ARCHITECTURE 0
-#undef USE_GNU_WXSTRING
-# define USE_GNU_WXSTRING 0
-#undef USE_ODBC
-# define USE_ODBC 0
-#undef USE_TIMEDATE
-# define USE_TIMEDATE 0
+#undef wxUSE_POSTSCRIPT
+# define wxUSE_POSTSCRIPT 0
+#undef wxUSE_PRINTING_ARCHITECTURE
+# define wxUSE_PRINTING_ARCHITECTURE 0
+#undef wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW
+# define wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW 0
+#undef wxUSE_METAFILE
+# define wxUSE_METAFILE 0
+#undef wxUSE_FORM
+# define wxUSE_FORM 0
+#undef wxUSE_SPLINES
+# define wxUSE_SPLINES 0
+#undef wxUSE_SCROLLBAR
+# define wxUSE_SCROLLBAR 0
+#undef wxUSE_COMBOBOX
+# define wxUSE_COMBOBOX 0
+#undef wxUSE_RADIOBUTTON
+# define wxUSE_RADIOBUTTON 0
+#undef wxUSE_XPM_IN_MSW
+# define wxUSE_XPM_IN_MSW 0
+#undef wxUSE_WX_RESOURCES
+# define wxUSE_WX_RESOURCES 0
+#undef wxUSE_DOC_VIEW_ARCHITECTURE
+# define wxUSE_DOC_VIEW_ARCHITECTURE 0
+#undef wxUSE_GNU_WXSTRING
+# define wxUSE_GNU_WXSTRING 0
+#undef wxUSE_ODBC
+# define wxUSE_ODBC 0
+#undef wxUSE_TIMEDATE
+# define wxUSE_TIMEDATE 0
#undef CTL3D
# define CTL3D 0
-#undef USE_ITSY_BITSY
-# define USE_ITSY_BITSY 0
-#undef USE_IMAGE_LOADING_IN_MSW
-# define USE_IMAGE_LOADING_IN_MSW 0
-#undef USE_GAUGE
-# define USE_GAUGE 0
-#undef USE_RESOURCE_LOADING_IN_MSW
-# define USE_RESOURCE_LOADING_IN_MSW 0
-#undef USE_DRAG_AND_DROP
-# define USE_DRAG_AND_DROP 0
+#undef wxUSE_ITSY_BITSY
+# define wxUSE_ITSY_BITSY 0
+#undef wxUSE_IMAGE_LOADING_IN_MSW
+# define wxUSE_IMAGE_LOADING_IN_MSW 0
+#undef wxUSE_GAUGE
+# define wxUSE_GAUGE 0
+#undef wxUSE_RESOURCE_LOADING_IN_MSW
+# define wxUSE_RESOURCE_LOADING_IN_MSW 0
+#undef wxUSE_DRAG_AND_DROP
+# define wxUSE_DRAG_AND_DROP 0
#endif
#endif
#pragma interface "statbr95.h"
#endif
-#if USE_NATIVE_STATUSBAR
+#if wxUSE_NATIVE_STATUSBAR
class WXDLLEXPORT wxStatusBar95 : public wxStatusBar
{
void SetFieldsWidth();
};
-#endif // USE_NATIVE_STATUSBAR
+#endif // wxUSE_NATIVE_STATUSBAR
#endif //_STATBR95_H
\ No newline at end of file
#pragma interface "tbar95.h"
#endif
-#if USE_BUTTONBAR && USE_TOOLBAR
+#if wxUSE_BUTTONBAR && wxUSE_TOOLBAR
#include "wx/tbarbase.h"
WXDLLEXPORT_DATA(extern const char*) wxToolBarNameStr;
DECLARE_EVENT_TABLE()
};
-#endif // USE_TOOL/BUTTONBAR
+#endif // wxUSE_TOOL/BUTTONBAR
#endif
// _WX_TBAR95_H_
#pragma interface "tbarmsw.h"
#endif
-#if USE_BUTTONBAR && USE_TOOLBAR
+#if wxUSE_BUTTONBAR && wxUSE_TOOLBAR
#include "wx/tbarbase.h"
WXDLLEXPORT_DATA(extern const char*) wxButtonBarNameStr;
#define wxTBSTATE_HIDDEN 0x08 // button is hidden
#define wxTBSTATE_INDETERMINATE 0x10 // button is indeterminate
-#endif // USE_TOOL/BUTTONBAR
+#endif // wxUSE_TOOL/BUTTONBAR
#endif
// _WX_TBARMSW_H_
#include "wx/control.h"
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
#include <iostream.h>
#else
#include <iostream>
class WXDLLEXPORT wxDC;
class WXDLLEXPORT wxValidator;
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
class WXDLLEXPORT wxDropTarget;
#endif
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
class WXDLLEXPORT wxResourceTable;
class WXDLLEXPORT wxItemResource;
#endif
// Enable or disable the window
virtual void Enable(bool enable);
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
// Associate a drop target with this window (if the window already had a drop
// target, it's deleted!) and return the current drop target (may be NULL).
void SetDropTarget(wxDropTarget *pDropTarget);
virtual void OnDefaultAction(wxControl *initiatingItem);
// Resource loading
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
virtual bool LoadFromResource(wxWindow *parent, const wxString& resourceName, const wxResourceTable *table = NULL);
virtual wxControl *CreateItem(const wxItemResource *childResource, const wxResourceTable *table = NULL);
#endif
bool m_winCaptured;
wxString m_windowName; // Window name
-#if USE_EXTENDED_STATICS
+#if wxUSE_EXTENDED_STATICS
wxList m_staticItems;
#endif
bool m_mouseInWindow;
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
wxDropTarget *m_pDropTarget; // the current drop target or NULL
#endif //USE_DRAG_AND_DROP
class WXDLLEXPORT wxObject;
-#if USE_DYNAMIC_CLASSES
+#if wxUSE_DYNAMIC_CLASSES
#ifdef __GNUWIN32__
#ifdef GetClassName
wxObject* WXDLLEXPORT wxCreateDynamicObject(const char *name);
-#ifdef USE_SERIAL
+#ifdef wxUSE_SERIAL
wxObject* WXDLLEXPORT wxCreateStoredObject( wxInputStream& stream );
#endif
// Unfortunately Borland seems to need this include.
#ifdef __BORLANDC__
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
#include <iostream.h>
#else
#include <iostream>
bool IsKindOf(wxClassInfo *info) const;
-#if WXDEBUG && USE_MEMORY_TRACING
+#if WXDEBUG && wxUSE_MEMORY_TRACING
void * operator new (size_t size, char * fileName = NULL, int lineNum = 0);
void operator delete (void * buf);
#endif
-#if WXDEBUG || USE_DEBUG_CONTEXT
+#if WXDEBUG || wxUSE_DEBUG_CONTEXT
virtual void Dump(ostream& str);
#endif
-#ifdef USE_SERIAL
+#ifdef wxUSE_SERIAL
virtual void StoreObject( wxObjectOutputStream &stream );
virtual void LoadObject( wxObjectInputStream &stream );
#endif
protected:
wxObjectRefData* m_refData;
-#ifdef USE_SERIAL
+#ifdef wxUSE_SERIAL
wxObject_Serialize* m_serialObj;
#endif
};
int m_count;
};
-#if WXDEBUG && USE_GLOBAL_MEMORY_OPERATORS
+#if WXDEBUG && wxUSE_GLOBAL_MEMORY_OPERATORS
//#ifndef WXDEBUG_NEW
//#define WXDEBUG_NEW new(__FILE__,__LINE__)
//#endif
#include "wx/setup.h"
-#if USE_ODBC
+#if wxUSE_ODBC
#ifdef __GNUG__
#pragma interface "odbc.h"
#endif
-#endif // USE_ODBC
+#endif // wxUSE_ODBC
#include "wx/dc.h"
#include "wx/dialog.h"
-#if USE_POSTSCRIPT
+#if wxUSE_POSTSCRIPT
class WXDLLIMPORT ofstream;
class WXDLLEXPORT wxPostScriptDC: public wxDC
WXDLLEXPORT_DATA(extern wxPrintPaperDatabase*) wxThePrintPaperDatabase;
-#endif // USE_POSTSCRIPT
+#endif // wxUSE_POSTSCRIPT
#endif
// _WX_POSTSCRPH__
#include "wx/control.h"
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
#include <iostream.h>
#else
#include <iostream>
class WXDLLEXPORT wxDC;
class WXDLLEXPORT wxValidator;
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
class WXDLLEXPORT wxDropTarget;
#endif
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
class WXDLLEXPORT wxResourceTable;
class WXDLLEXPORT wxItemResource;
#endif
// Enable or disable the window
virtual void Enable(bool enable);
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
// Associate a drop target with this window (if the window already had a drop
// target, it's deleted!) and return the current drop target (may be NULL).
void SetDropTarget(wxDropTarget *pDropTarget);
virtual void OnDefaultAction(wxControl *initiatingItem);
// Resource loading
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
virtual bool LoadFromResource(wxWindow *parent, const wxString& resourceName, const wxResourceTable *table = NULL);
virtual wxControl *CreateItem(const wxItemResource *childResource, const wxResourceTable *table = NULL);
#endif
wxColour m_defaultBackgroundColour;
wxColour m_defaultForegroundColour;
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
wxDropTarget *m_pDropTarget; // the current drop target or NULL
#endif //USE_DRAG_AND_DROP
#include "wx/setup.h"
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
#include <stdio.h>
// A few further types not in wx_types.h
wxInputStream& operator>>(int& i);
wxInputStream& operator>>(long& i);
wxInputStream& operator>>(float& i);
-#if USE_SERIAL
+#if wxUSE_SERIAL
wxInputStream& operator>>(wxObject *& obj);
#endif
wxOutputStream& operator<<(int i);
wxOutputStream& operator<<(long i);
wxOutputStream& operator<<(double f);
-#if USE_SERIAL
+#if wxUSE_SERIAL
wxOutputStream& operator<<(wxObject& obj);
#endif
/** @name generic attributes & operations */
//@{
/// as standard strlen()
- size_t Len() const { return GetStringData() ? GetStringData()->nDataLength : 0; }
+ size_t Len() const { return GetStringData()->nDataLength; }
/// string contains any characters?
bool IsEmpty() const { return Len() == 0; }
/// reinitialize string (and free data!)
void Empty()
{
- if ( GetStringData() && GetStringData()->nDataLength != 0 )
+ if ( GetStringData()->nDataLength != 0 )
Reinit();
wxASSERT( GetStringData()->nDataLength == 0 );
// an exception to the general rule that a normal header doesn't include other
// headers - only because ownerdrw.h is not always included and I don't want
// to write #ifdef's everywhere...
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
#include "wx/ownerdrw.h"
#endif
// wxMenuItem: an item in the menu, optionally implements owner-drawn behaviour
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxMenuItem: public wxObject
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
, public wxOwnerDrawn
#endif
{
bool m_bEnabled, // enabled or greyed?
m_bChecked; // checked? (only if checkable)
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
// wxOwnerDrawn base class already has these variables - nothing to do
#else //!owner drawn
*
*/
-#define USE_CONSTRAINTS 1
+#define wxUSE_CONSTRAINTS 1
// Use constraints mechanism
-#define USE_CONFIG 1
+#define wxUSE_CONFIG 1
// Use wxConfig, with CreateConfig in wxApp
#define _WX_GOODCOMPILER__
// gcc can have problems, but Windows compilers
// Level 1: wxDC, OnSize (etc.) compatibility, but
// some new features such as event tables
-#define USE_POSTSCRIPT 1
+#define wxUSE_POSTSCRIPT 1
// 0 for no PostScript device context
-#define USE_AFM_FOR_POSTSCRIPT 0
+#define wxUSE_AFM_FOR_POSTSCRIPT 0
// 1 to use font metric files in GetTextExtent
-#define USE_METAFILE 1
+#define wxUSE_METAFILE 1
// 0 for no Metafile and metafile device context
-#define USE_IPC 1
+#define wxUSE_IPC 1
// 0 for no interprocess comms
-#define USE_HELP 1
+#define wxUSE_HELP 1
// 0 for no help facility
-#define USE_RESOURCES 1
+#define wxUSE_RESOURCES 1
// 0 for no wxGetResource/wxWriteResource
-#define USE_CLIPBOARD 1
+#define wxUSE_CLIPBOARD 1
// 0 for no clipboard functions
-#define USE_SPLINES 1
+#define wxUSE_SPLINES 1
// 0 for no splines
-#define USE_XFIG_SPLINE_CODE 1
+#define wxUSE_XFIG_SPLINE_CODE 1
// 1 for XFIG spline code, 0 for AIAI spline code.
// AIAI spline code is slower, but freer of copyright issues.
// 0 for no splines
-#define USE_TOOLBAR 1
+#define wxUSE_TOOLBAR 1
// Use toolbars
-#define USE_DRAG_AND_DROP 1
+#define wxUSE_DRAG_AND_DROP 1
// 0 for no drag and drop
-#define USE_WX_RESOURCES 1
+#define wxUSE_WX_RESOURCES 1
// Use .wxr resource mechanism (requires PrologIO library)
-#define USE_DOC_VIEW_ARCHITECTURE 1
+#define wxUSE_DOC_VIEW_ARCHITECTURE 1
// Set to 0 to disable document/view architecture
-#define USE_PRINTING_ARCHITECTURE 1
+#define wxUSE_PRINTING_ARCHITECTURE 1
// Set to 0 to disable print/preview architecture code
-#define USE_POSTSCRIPT_ARCHITECTURE_IN_MSW 1
+#define wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW 1
// Set to 0 to disable PostScript print/preview architecture code
// under Windows (just use Windows printing).
-#define USE_DYNAMIC_CLASSES 1
+#define wxUSE_DYNAMIC_CLASSES 1
// If 1, enables provision of run-time type information.
// NOW MANDATORY: don't change.
-#define USE_MEMORY_TRACING 1
+#define wxUSE_MEMORY_TRACING 1
// If 1, enables debugging versions of wxObject::new and
// wxObject::delete *IF* WXDEBUG is also defined.
// WARNING: this code may not work with all architectures, especially
// if alignment is an issue.
-#define USE_DEBUG_CONTEXT 1
+#define wxUSE_DEBUG_CONTEXT 1
// If 1, enables wxDebugContext, for
// writing error messages to file, etc.
// If WXDEBUG is not defined, will still use
// since you may well need to output
// an error log in a production
// version (or non-debugging beta)
-#define USE_GLOBAL_MEMORY_OPERATORS 0
+#define wxUSE_GLOBAL_MEMORY_OPERATORS 0
// In debug mode, cause new and delete to be redefined globally.
// If this causes problems (e.g. link errors), set this to 0.
// Set this to 0 if your compiler can't cope
// with omission of prototype parameters.
-#define USE_C_MAIN 0
+#define wxUSE_C_MAIN 0
// Set to 1 to use main.c instead of main.cpp (UNIX only)
-#define USE_ODBC 0
+#define wxUSE_ODBC 0
// Define 1 to use ODBC classes
-#define USE_IOSTREAMH 1
+#define wxUSE_IOSTREAMH 1
// VC++ 4.2 and above allows <iostream> and <iostream.h>
// but you can't mix them. Set to 1 for <iostream.h>,
// 0 for <iostream>
-#define USE_WXCONFIG 1
+#define wxUSE_WXCONFIG 1
// if enabled, compiles built-in OS independent wxConfig
// class and it's file (any platform) and registry (Win)
// based implementations
*
*/
-#define USE_APPLE_IEEE 1
+#define wxUSE_APPLE_IEEE 1
// if enabled, the float codec written by Apple
// will be used to write, in a portable way,
// float on the disk
#include "wx/control.h"
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
#include <iostream.h>
#else
#include <iostream>
class WXDLLEXPORT wxDC;
class WXDLLEXPORT wxValidator;
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
class WXDLLEXPORT wxDropTarget;
#endif
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
class WXDLLEXPORT wxResourceTable;
class WXDLLEXPORT wxItemResource;
#endif
// Enable or disable the window
virtual void Enable(bool enable);
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
// Associate a drop target with this window (if the window already had a drop
// target, it's deleted!) and return the current drop target (may be NULL).
void SetDropTarget(wxDropTarget *pDropTarget);
virtual void OnDefaultAction(wxControl *initiatingItem);
// Resource loading
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
virtual bool LoadFromResource(wxWindow *parent, const wxString& resourceName, const wxResourceTable *table = NULL);
virtual wxControl *CreateItem(const wxItemResource *childResource, const wxResourceTable *table = NULL);
#endif
wxColour m_defaultForegroundColour;
wxAcceleratorTable m_acceleratorTable;
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
wxDropTarget *m_pDropTarget; // the current drop target or NULL
#endif //USE_DRAG_AND_DROP
#include "wx/defs.h"
-#if USE_TOOLBAR
+#if wxUSE_TOOLBAR
#include "wx/bitmap.h"
#include "wx/list.h"
};
-#endif // USE_TOOLBAR
+#endif // wxUSE_TOOLBAR
#endif
// _WX_TBARSMPLH__
#include "wx/object.h"
-#if USE_TIMEDATE
+#if wxUSE_TIMEDATE
#ifdef __GNUG__
#pragma interface "time.h"
};
#endif
- // USE_TIMEDATE
+ // wxUSE_TIMEDATE
#endif
// _WX_TIMEH__
#include "wx/filefn.h"
#include "wx/process.h"
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
#include <iostream.h>
#else
#include <iostream>
int sync(void);
};
-// #if WXDEBUG && USE_GLOBAL_MEMORY_OPERATORS
+// #if WXDEBUG && wxUSE_GLOBAL_MEMORY_OPERATORS
// #define new WXDEBUG_NEW
// #endif
void WXDLLEXPORT wxFatalError(const wxString& msg, const wxString& title = wxFatalErrorStr);
// Reading and writing resources (eg WIN.INI, .Xdefaults)
-#if USE_RESOURCES
+#if wxUSE_RESOURCES
bool WXDLLEXPORT wxWriteResource(const wxString& section, const wxString& entry, const wxString& value, const wxString& file = "");
bool WXDLLEXPORT wxWriteResource(const wxString& section, const wxString& entry, float value, const wxString& file = "");
bool WXDLLEXPORT wxWriteResource(const wxString& section, const wxString& entry, long value, const wxString& file = "");
bool WXDLLEXPORT wxGetResource(const wxString& section, const wxString& entry, float *value, const wxString& file = "");
bool WXDLLEXPORT wxGetResource(const wxString& section, const wxString& entry, long *value, const wxString& file = "");
bool WXDLLEXPORT wxGetResource(const wxString& section, const wxString& entry, int *value, const wxString& file = "");
-#endif // USE_RESOURCES
+#endif // wxUSE_RESOURCES
// Get current Home dir and copy to dest (returns pstr->c_str())
const char* WXDLLEXPORT wxGetHomeDir(wxString *pstr);
#include "wx/string.h"
#include "wx/list.h"
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
#include <iostream.h>
#else
#include <iostream>
#include "wx/dirdlg.h"
#include "wx/cmndata.h"
#include "wx/intl.h"
-#ifdef USE_SERIAL
+#ifdef wxUSE_SERIAL
#include "wx/objstrm.h"
#include "wx/serbase.h"
#endif
#include "wx/defs.h"
#include "wx/string.h"
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
#include <iostream.h>
#else
#include <iostream>
#include <wx/fontdlg.h>
#include <wx/choicdlg.h>
-#if !defined(__WXMSW__) || USE_GENERIC_DIALOGS_IN_MSW
+#if !defined(__WXMSW__) || wxUSE_GENERIC_DIALOGS_IN_MSW
#include <wx/generic/colrdlgg.h>
#include <wx/generic/fontdlgg.h>
#endif
file_menu->Append(DIALOGS_CHOOSE_COLOUR, "&Choose colour");
-#if !defined(__WXMSW__) || USE_GENERIC_DIALOGS_IN_MSW
+#if !defined(__WXMSW__) || wxUSE_GENERIC_DIALOGS_IN_MSW
file_menu->Append(DIALOGS_CHOOSE_COLOUR_GENERIC, "Choose colour (&generic)");
#endif
file_menu->AppendSeparator();
file_menu->Append(DIALOGS_CHOOSE_FONT, "Choose &font");
-#if !defined(__WXMSW__) || USE_GENERIC_DIALOGS_IN_MSW
+#if !defined(__WXMSW__) || wxUSE_GENERIC_DIALOGS_IN_MSW
file_menu->Append(DIALOGS_CHOOSE_FONT_GENERIC, "Choose f&ont (generic)");
#endif
dialog->Close();
}
-#if !defined(__WXMSW__) || USE_GENERIC_DIALOGS_IN_MSW
+#if !defined(__WXMSW__) || wxUSE_GENERIC_DIALOGS_IN_MSW
void MyFrame::ChooseColourGeneric(wxCommandEvent& WXUNUSED(event))
{
wxColourData data;
EVT_MENU(DIALOGS_FILE_OPEN, MyFrame::FileOpen)
EVT_MENU(DIALOGS_FILE_SAVE, MyFrame::FileSave)
EVT_MENU(DIALOGS_DIR_CHOOSE, MyFrame::DirChoose)
-#if !defined(__WXMSW__) || USE_GENERIC_DIALOGS_IN_MSW
+#if !defined(__WXMSW__) || wxUSE_GENERIC_DIALOGS_IN_MSW
EVT_MENU(DIALOGS_CHOOSE_COLOUR_GENERIC, MyFrame::ChooseColourGeneric)
EVT_MENU(DIALOGS_CHOOSE_FONT_GENERIC, MyFrame::ChooseFontGeneric)
#endif
void FileSave(wxCommandEvent& event);
void DirChoose(wxCommandEvent& event);
-#if !defined(__WXMSW__) || USE_GENERIC_DIALOGS_IN_MSW
+#if !defined(__WXMSW__) || wxUSE_GENERIC_DIALOGS_IN_MSW
void ChooseColourGeneric(wxCommandEvent& event);
void ChooseFontGeneric(wxCommandEvent& event);
#endif
#endif
#if !USE_DOC_VIEW_ARCHITECTURE
-#error You must set USE_DOC_VIEW_ARCHITECTURE to 1 in wx_setup.h!
+#error You must set wxUSE_DOC_VIEW_ARCHITECTURE to 1 in wx_setup.h!
#endif
#include "doc.h"
#endif
#if !USE_DOC_VIEW_ARCHITECTURE
-#error You must set USE_DOC_VIEW_ARCHITECTURE to 1 in wx_setup.h!
+#error You must set wxUSE_DOC_VIEW_ARCHITECTURE to 1 in wx_setup.h!
#endif
#include "wx/docview.h"
#endif
#if !USE_DOC_VIEW_ARCHITECTURE
-#error You must set USE_DOC_VIEW_ARCHITECTURE to 1 in wx_setup.h!
+#error You must set wxUSE_DOC_VIEW_ARCHITECTURE to 1 in wx_setup.h!
#endif
#include "docview.h"
#endif
#if !USE_DOC_VIEW_ARCHITECTURE
-#error You must set USE_DOC_VIEW_ARCHITECTURE to 1 in wx_setup.h!
+#error You must set wxUSE_DOC_VIEW_ARCHITECTURE to 1 in wx_setup.h!
#endif
#include "doc.h"
#endif
#if !USE_DOC_VIEW_ARCHITECTURE
-#error You must set USE_DOC_VIEW_ARCHITECTURE to 1 in wx_setup.h!
+#error You must set wxUSE_DOC_VIEW_ARCHITECTURE to 1 in wx_setup.h!
#endif
#include "docview.h"
#endif
#if !USE_DOC_VIEW_ARCHITECTURE
-#error You must set USE_DOC_VIEW_ARCHITECTURE to 1 in wx_setup.h!
+#error You must set wxUSE_DOC_VIEW_ARCHITECTURE to 1 in wx_setup.h!
#endif
#include "docview.h"
#endif
#if !USE_CONSTRAINTS
-#error You must set USE_CONSTRAINTS to 1 in wx_setup.h!
+#error You must set wxUSE_CONSTRAINTS to 1 in wx_setup.h!
#endif
#include <ctype.h>
void OnQuit(wxCommandEvent& event);
void OnAbout(wxCommandEvent& event);
+ void OnPopupMenu(wxCommandEvent& event);
+ void OnRightDown(wxMouseEvent& event);
+
private:
// any class wishing to process wxWindows events must use this macro
DECLARE_EVENT_TABLE()
// menu items
Minimal_Quit = 1,
Minimal_About,
+ Minimal_Test1,
+ Minimal_Test2,
// controls start here (the numbers are, of course, arbitrary)
Minimal_Text = 1000,
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
EVT_MENU(Minimal_Quit, MyFrame::OnQuit)
EVT_MENU(Minimal_About, MyFrame::OnAbout)
+
+ EVT_MENU_RANGE(Minimal_Test1, Minimal_Test2, MyFrame::OnPopupMenu)
+
+ EVT_RIGHT_DOWN(MyFrame::OnRightDown)
END_EVENT_TABLE()
// Create a new application object: this macro will allow wxWindows to create
SetMenuBar(menuBar);
// create a status bar just for fun (by default with 1 pane only)
- CreateStatusBar();
+ CreateStatusBar(2);
SetStatusText("Welcome to wxWindows!");
-
- // now create some controls
-
- // a panel first - if there were several controls, it would allow us to
- // navigate between them from the keyboard
- wxPanel *panel = new wxPanel(this, -1, wxPoint(0, 0), wxSize(400, 200));
-
- // and a static control whose parent is the panel
- (void)new wxStaticText(panel, -1, "Hello, world!", wxPoint(10, 10));
}
wxMessageBox("This is a minimal sample\nA second line in the message box",
"About Minimal", wxOK | wxICON_INFORMATION, this);
}
+
+void MyFrame::OnPopupMenu(wxCommandEvent& event)
+{
+ wxString str;
+ str.Printf("Test%d clicked.", event.GetId() == Minimal_Test1 ? 1 : 2);
+ SetStatusText(str, 1);
+}
+
+void MyFrame::OnRightDown(wxMouseEvent& event)
+{
+ class MyMenu : public wxMenu
+ {
+ public:
+ MyMenu()
+ {
+ Append(Minimal_Test1, "Test&1");
+ AppendSeparator();
+ Append(Minimal_Test2, "Test&2");
+ }
+
+ ~MyMenu() { printf("menu destroyed"); }
+ } *menu = new MyMenu;
+
+ PopupMenu(menu, event.GetX(), event.GetY());
+}
#endif
#if !USE_PRINTING_ARCHITECTURE
-#error You must set USE_PRINTING_ARCHITECTURE to 1 in wx_setup.h to compile this demo.
+#error You must set wxUSE_PRINTING_ARCHITECTURE to 1 in wx_setup.h to compile this demo.
#endif
#include <ctype.h>
EVT_MENU(wxID_HELP, MyFrame::OnAbout)
EVT_CLOSE(MyFrame::OnCloseWindow)
EVT_TOOL_RANGE(wxID_OPEN, wxID_PASTE, MyFrame::OnToolLeftClick)
- EVT_TOOL_ENTER(ID_TOOLBAR, MyFrame::OnToolEnter)
+ EVT_TOOL_ENTER(wxID_OPEN, MyFrame::OnToolEnter)
END_EVENT_TABLE()
// Define my frame constructor
#include "wx/setup.h"
-#if USE_TIMEDATE
+#if wxUSE_TIMEDATE
#include "wx/date.h"
#include <wx/intl.h>
#include <string.h>
#include <stdlib.h>
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
#include <iostream.h>
#else
#include <iostream>
double wxDataInputStream::ReadDouble()
{
-#if USE_APPLE_IEEE
+#if wxUSE_APPLE_IEEE
char buf[10];
Read(buf, 10);
{
char buf[10];
-#if USE_APPLE_IEEE
+#if wxUSE_APPLE_IEEE
ConvertToIeeeExtended(d, (unsigned char *)buf);
#else
# pragma warning "wxDataStream::WriteDouble() not using IeeeExtended - will not work!"
#include <wx/wx.h>
#endif //WX_PRECOMP
-#if USE_ODBC
+#if wxUSE_ODBC
#include <wx/db.h>
} // GetDataSource()
#endif
- // USE_ODBC
+ // wxUSE_ODBC
#include <wx/wx.h>
#endif //WX_PRECOMP
-#if USE_ODBC
+#if wxUSE_ODBC
#include <wx/dbtable.h>
} // wxTable::Refresh()
#endif
- // USE_ODBC
+ // wxUSE_ODBC
#include "wx/defs.h"
#endif
-#if USE_DOC_VIEW_ARCHITECTURE
+#if wxUSE_DOC_VIEW_ARCHITECTURE
#ifndef WX_PRECOMP
#include "wx/wx.h"
}
#endif
- // USE_DOC_VIEW_ARCHITECTURE
+ // wxUSE_DOC_VIEW_ARCHITECTURE
#include "wx/defs.h"
#endif
-#if USE_DOC_VIEW_ARCHITECTURE
+#if wxUSE_DOC_VIEW_ARCHITECTURE
#ifndef WX_PRECOMP
#include "wx/string.h"
#include <stdio.h>
#include <string.h>
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
#include <iostream.h>
#else
#include <iostream>
IMPLEMENT_DYNAMIC_CLASS(wxDocManager, wxEvtHandler)
IMPLEMENT_CLASS(wxDocChildFrame, wxFrame)
IMPLEMENT_CLASS(wxDocParentFrame, wxFrame)
-#if USE_PRINTING_ARCHITECTURE
+#if wxUSE_PRINTING_ARCHITECTURE
IMPLEMENT_DYNAMIC_CLASS(wxDocPrintout, wxPrintout)
#endif
IMPLEMENT_CLASS(wxCommand, wxObject)
return GetDocument() ? GetDocument()->Close() : TRUE;
}
-#if USE_PRINTING_ARCHITECTURE
+#if wxUSE_PRINTING_ARCHITECTURE
wxPrintout *wxView::OnCreatePrintout(void)
{
return new wxDocPrintout(this);
return m_docManager->Clear(FALSE);
}
-#if USE_PRINTING_ARCHITECTURE
+#if wxUSE_PRINTING_ARCHITECTURE
wxDocPrintout::wxDocPrintout(wxView *view, const wxString& title):
wxPrintout(WXSTRINGCAST title)
}
#endif
- // End USE_DOC_VIEW_ARCHITECTURE
+ // End wxUSE_DOC_VIEW_ARCHITECTURE
#endif //__BORLANDC__
#ifndef WX_PRECOMP
- #include <wx/string.h>
- #include <wx/intl.h>
+ #include "wx/string.h"
+ #include "wx/intl.h"
#endif //WX_PRECOMP
-#include <wx/app.h>
-#include <wx/dynarray.h>
-#include <wx/file.h>
-#include <wx/log.h>
-#include <wx/textfile.h>
-#include <wx/config.h>
-#include <wx/fileconf.h>
-#include <wx/utils.h>
+#include "wx/app.h"
+#include "wx/dynarray.h"
+#include "wx/file.h"
+#include "wx/log.h"
+#include "wx/textfile.h"
+#include "wx/config.h"
+#include "wx/fileconf.h"
+
+#include "wx/utils.h" // for wxGetHomeDir
// _WINDOWS_ is defined when windows.h is included,
// __WXMSW__ is defined for MS Windows compilation
#include "wx/helpbase.h"
-#if USE_HELP
+#if wxUSE_HELP
#if !USE_SHARED_LIBRARY
IMPLEMENT_CLASS(wxHelpControllerBase, wxObject)
#endif
-#endif // USE_HELP
+#endif // wxUSE_HELP
#include "wx/defs.h"
-#if USE_CONSTRAINTS
+#if wxUSE_CONSTRAINTS
#ifndef WX_PRECOMP
#include "wx/window.h"
#include "wx/defs.h"
#endif
-#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
+#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
#ifdef __GNUG__
// #pragma implementation
#include <stdlib.h>
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
#include <iostream.h>
#else
#include <iostream>
// We'll only do malloc and free for the moment: leave the interesting
// stuff for the wxObject versions.
-#if WXDEBUG && USE_GLOBAL_MEMORY_OPERATORS
+#if WXDEBUG && wxUSE_GLOBAL_MEMORY_OPERATORS
#ifdef new
#undef new
#endif
}
-#else // USE_MEMORY_TRACING && WXDEBUG
+#else // wxUSE_MEMORY_TRACING && WXDEBUG
void wxTrace(const char *WXUNUSED(fmt) ...)
{
}
#ifndef WX_PRECOMP
#include "wx/hash.h"
-#ifdef USE_SERIAL
+#ifdef wxUSE_SERIAL
#include "wx/objstrm.h"
#include "wx/serbase.h"
#endif
#include <string.h>
#include <assert.h>
-#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
+#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
#include "wx/memory.h"
#endif
-#if WXDEBUG || USE_DEBUG_CONTEXT
+#if WXDEBUG || wxUSE_DEBUG_CONTEXT
// for wxObject::Dump
#include <iostream.h>
#endif
wxObject::wxObject(void)
{
m_refData = (wxObjectRefData *) NULL;
-#ifdef USE_SERIAL
+#ifdef wxUSE_SERIAL
m_serialObj = (wxObject_Serialize *)NULL;
#endif
}
wxObject::~wxObject(void)
{
UnRef();
-#ifdef USE_SERIAL
+#ifdef wxUSE_SERIAL
if (m_serialObj)
delete m_serialObj;
#endif
return FALSE;
}
-#if WXDEBUG || USE_DEBUG_CONTEXT
+#if WXDEBUG || wxUSE_DEBUG_CONTEXT
void wxObject::Dump(ostream& str)
{
if (GetClassInfo() && GetClassInfo()->GetClassName())
}
#endif
-#if WXDEBUG && USE_MEMORY_TRACING
+#if WXDEBUG && wxUSE_MEMORY_TRACING
#ifdef new
#undef new
return (wxObject*) NULL;
}
-#ifdef USE_SERIAL
+#ifdef wxUSE_SERIAL
#include "wx/serbase.h"
#include "wx/dynlib.h"
#include "wx/setup.h"
#endif
-#if USE_SERIAL
+#if wxUSE_SERIAL
#include "wx/object.h"
#include "wx/objstrm.h"
#include "wx/defs.h"
-#if USE_ODBC
+#if wxUSE_ODBC
#ifndef WX_PRECOMP
#include "wx/utils.h"
return dirty;
}
-#endif // USE_ODBC
+#endif // wxUSE_ODBC
#include "wx/defs.h"
-#if USE_POSTSCRIPT
+#if wxUSE_POSTSCRIPT
#ifndef WX_PRECOMP
#include "wx/intl.h"
#include "wx/msw/private.h"
#endif
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
#include <iostream.h>
#else
#include <iostream>
#define _MAXPATHLEN 500
/* See "wxspline.inc" and "xfspline.inc" */
-#if USE_XFIG_SPLINE_CODE
+#if wxUSE_XFIG_SPLINE_CODE
static const char *wxPostScriptHeaderSpline = " \
/DrawSplineSection {\n\
/y3 exch def\n\
// No extra PS header for this spline implementation.
static const char *wxPostScriptHeaderSpline = (char *) NULL;
-#endif /* USE_XFIG_SPLINE_CODE */
+#endif /* wxUSE_XFIG_SPLINE_CODE */
// steve, 05.09.94
// VMS has a bug in the ofstream class.
#include "wx/checkbox.h"
#include "wx/slider.h"
#include "wx/statbox.h"
-#if USE_GAUGE
+#if wxUSE_GAUGE
#include "wx/gauge.h"
#endif
#include "wx/textctrl.h"
#include "wx/intl.h"
#endif
-#if USE_SCROLLBAR
+#if wxUSE_SCROLLBAR
#include "wx/scrolbar.h"
#endif
-#if USE_COMBOBOX
+#if wxUSE_COMBOBOX
#include "wx/combobox.h"
#endif
#include "wx/log.h"
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
#include <ctype.h>
#include <math.h>
bitmap = wxResourceCreateBitmap(childResource->GetValue4(), (wxResourceTable *)this);
childResource->SetBitmap(bitmap);
}
-#if USE_BITMAP_MESSAGE
+#if wxUSE_BITMAP_MESSAGE
if (bitmap)
control = new wxStaticBitmap(parent, id, *bitmap,
wxPoint(childResource->GetX(), childResource->GetY()),
((wxCheckBox *)control)->SetValue((childResource->GetValue1() != 0));
}
-#if USE_GAUGE
+#if wxUSE_GAUGE
else if (itemType == wxString("wxGauge"))
{
control = new wxGauge(parent, id, (int)childResource->GetValue2(),
((wxGauge *)control)->SetValue((int)childResource->GetValue1());
}
#endif
-#if USE_RADIOBUTTON
+#if wxUSE_RADIOBUTTON
else if (itemType == wxString("wxRadioButton"))
{
control = new wxRadioButton(parent, id, childResource->GetTitle(), // (int)childResource->GetValue1(),
childResource->GetStyle(), wxDefaultValidator, childResource->GetName());
}
#endif
-#if USE_SCROLLBAR
+#if wxUSE_SCROLLBAR
else if (itemType == wxString("wxScrollBar"))
{
control = new wxScrollBar(parent, id,
if (strings)
delete[] strings;
}
-#if USE_COMBOBOX
+#if wxUSE_COMBOBOX
else if (itemType == wxString("wxComboBox"))
{
wxStringList *stringList = childResource->GetStringValues();
controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count)));
}
}
-#if USE_RADIOBUTTON
+#if wxUSE_RADIOBUTTON
else if (controlType == "wxRadioButton")
{
// Check for default value
}
}
}
-#if USE_COMBOBOX
+#if wxUSE_COMBOBOX
else if (controlType == "wxComboBox")
{
PrologExpr *textValue = expr->Nth(count);
}
case wxBITMAP_TYPE_XPM_DATA:
{
-#if (defined(__WXGTK__)) || (defined(__WXMSW__) && USE_XPM_IN_MSW)
+#if (defined(__WXGTK__)) || (defined(__WXMSW__) && wxUSE_XPM_IN_MSW)
wxItemResource *item = table->FindResource(name);
if (!item)
{
{
// *** XPM ICON NOT YET IMPLEMENTED IN WXWINDOWS ***
/*
-#if (defined(__WXGTK__)) || (defined(__WXMSW__) && USE_XPM_IN_MSW)
+#if (defined(__WXGTK__)) || (defined(__WXMSW__) && wxUSE_XPM_IN_MSW)
wxItemResource *item = table->FindResource(name);
if (!item)
{
return table->CreateItem((wxWindow *)this, (wxItemResource *)resource);
}
-#endif // USE_WX_RESOURCES
+#endif // wxUSE_WX_RESOURCES
return *this;
}
-#if USE_SERIAL
+#if wxUSE_SERIAL
wxInputStream& wxInputStream::operator>>(wxObject *& obj)
{
wxObjectInputStream obj_s(*this);
return Write(strfloat, strfloat.Len());
}
-#if USE_SERIAL
+#if wxUSE_SERIAL
wxOutputStream& wxOutputStream::operator<<(wxObject& obj)
{
wxObjectOutputStream obj_s(*this);
#include <windows.h>
#endif
-#if USE_TOOLBAR
+#if wxUSE_TOOLBAR
#include "wx/tbarbase.h"
// Default OnSize resets scrollbars, if any
void wxToolBarBase::OnSize(wxSizeEvent& event)
{
-#if USE_CONSTRAINTS
+#if wxUSE_CONSTRAINTS
if (GetAutoLayout())
Layout();
#endif
#include "wx/wx.h"
#endif
-#if USE_TOOLBAR
+#if wxUSE_TOOLBAR
#include "wx/tbarsmpl.h"
#include "wx/setup.h"
-#if USE_TIMEDATE
+#if wxUSE_TIMEDATE
#include "wx/time.h"
#include "wx/date.h"
#include "wx/utils.h"
#include <wx/intl.h>
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
#include <iostream.h>
#else
#include <iostream>
#include "wx/frame.h"
#endif
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
#include <iostream.h>
#else
#include <iostream>
// Set to zero to use no double-buffering
#ifdef __WXMSW__
-#define USE_DOUBLE_BUFFERING 1
+#define wxUSE_DOUBLE_BUFFERING 1
#else
-#define USE_DOUBLE_BUFFERING 0
+#define wxUSE_DOUBLE_BUFFERING 0
#endif
#define wxGRID_DRAG_NONE 0
int w, h;
GetClientSize(&w, &h);
- bool useDoubleBuffering = (bool) USE_DOUBLE_BUFFERING;
+ bool useDoubleBuffering = (bool) wxUSE_DOUBLE_BUFFERING;
if (useDoubleBuffering)
{
// Reuse the old bitmap if possible
#include "wx/generic/helpxlp.h"
-#if USE_HELP
+#if wxUSE_HELP
#include <time.h>
#ifdef __X__
return TRUE;
}
-#endif // USE_HELP
+#endif // wxUSE_HELP
// Default OnSize resets scrollbars, if any
void wxScrolledWindow::OnSize(wxSizeEvent& WXUNUSED(event))
{
-#if USE_CONSTRAINTS
+#if wxUSE_CONSTRAINTS
if (GetAutoLayout())
Layout();
#endif
gdk_imlib/misc.c \
gdk_imlib/rend.c \
gdk_imlib/save.c \
- gdk_imlib/utils.c \
- \
- iodbc/dlf.c \
- iodbc/dlproc.c \
- iodbc/herr.c \
- iodbc/henv.c \
- iodbc/hdbc.c \
- iodbc/hstmt.c \
- iodbc/connect.c \
- iodbc/prepare.c \
- iodbc/result.c \
- iodbc/execute.c \
- iodbc/fetch.c \
- iodbc/info.c \
- iodbc/catalog.c \
- iodbc/misc.c \
- iodbc/itrace.c
+ gdk_imlib/utils.c
#include "unistd.h"
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
#include "../gdk_imlib/gdk_imlib.h"
#endif
{
/*
-#if USE_RESOURCES
+#if wxUSE_RESOURCES
(void) wxGetResource("wxWindows", "OsVersion", &wxOsVersion);
#endif
*/
wxInitializeResourceSystem();
// For PostScript printing
-#if USE_POSTSCRIPT
+#if wxUSE_POSTSCRIPT
wxInitializePrintSetupData();
wxThePrintPaperDatabase = new wxPrintPaperDatabase;
wxThePrintPaperDatabase->CreateDatabase();
wxClassInfo::InitializeClasses();
-#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
+#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
streambuf* sBuf = new wxDebugStreamBuf;
ostream* oStr = new ostream(sBuf) ;
gtk_init( &argc, &argv );
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
gdk_imlib_init();
delete[] wxBuffer;
-#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
+#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
if (wxDebugContext::CountObjectsLeft() > 0)
{
#include "wx/icon.h"
#include "gdk/gdkprivate.h"
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
#include "../gdk_imlib/gdk_imlib.h"
#include "gdk/gdkx.h" // GDK_DISPLAY
wxMask::~wxMask(void)
{
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
// do not delete the mask, gdk_imlib does it for you
#else
if (m_bitmap) gdk_bitmap_unref( m_bitmap );
int m_width;
int m_height;
int m_bpp;
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
GdkImlibImage *m_image;
#endif
wxPalette *m_palette;
m_height = 0;
m_bpp = 0;
m_palette = (wxPalette *) NULL;
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
m_image = (GdkImlibImage *) NULL;
#endif
}
wxBitmapRefData::~wxBitmapRefData(void)
{
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
if (m_pixmap) gdk_imlib_free_pixmap( m_pixmap );
if (m_image) gdk_imlib_kill_image( m_image );
#else
{
m_refData = new wxBitmapRefData();
-#ifndef USE_GDK_IMLIB
+#ifndef wxUSE_GDK_IMLIB
GdkBitmap *mask = NULL;
return;
}
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
if (M_BMPDATA->m_bitmap)
{
return FALSE;
}
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
if (M_BMPDATA->m_bitmap)
{
bool wxBitmap::LoadFile( const wxString &name, int WXUNUSED(type) )
{
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
UnRef();
m_refData = new wxBitmapRefData();
return;
}
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
DestroyImage();
return;
}
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
if (!M_BMPDATA->m_image) RecreateImage();
#include "wx/gdicmn.h"
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
#include "../gdk_imlib/gdk_imlib.h"
#endif
if ((M_COLDATA->m_hasPixel) && (M_COLDATA->m_colormap == cmap)) return;
M_COLDATA->FreeColour();
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
int r = M_COLDATA->m_color.red >> SHIFT;
int g = M_COLDATA->m_color.green >> SHIFT;
#endif
-#if USE_SHARED_LIBRARY
+#if wxUSE_SHARED_LIBRARY
/*
* For wxWindows to be made into a dynamic library (e.g. Sun),
* all IMPLEMENT_... macros must be in one place.
#include "wx/choice.h"
IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl)
-#if USE_CLIPBOARD
+#if wxUSE_CLIPBOARD
#include "wx/clipbrd.h"
IMPLEMENT_DYNAMIC_CLASS(wxClipboard, wxObject)
IMPLEMENT_ABSTRACT_CLASS(wxClipboardClient, wxObject)
#endif
-#if USE_COMBOBOX
+#if wxUSE_COMBOBOX
#include "wx/combobox.h"
IMPLEMENT_DYNAMIC_CLASS(wxComboBox, wxControl)
#endif
#include "wx/colordlg.h"
#include "wx/fontdlg.h"
-#if !defined(wx_msw) || USE_GENERIC_DIALOGS_IN_MSW
+#if !defined(wx_msw) || wxUSE_GENERIC_DIALOGS_IN_MSW
#include "wx/generic/colordlg.h"
#include "wx/generic/fontdlg.h"
IMPLEMENT_DYNAMIC_CLASS(wxGenericColourDialog, wxDialog)
#endif
*/
-#if defined(wx_x) || (defined(wx_msw) && USE_PORTABLE_FONTS_IN_MSW)
+#if defined(wx_x) || (defined(wx_msw) && wxUSE_PORTABLE_FONTS_IN_MSW)
IMPLEMENT_DYNAMIC_CLASS(wxFontNameDirectory, wxObject)
#endif
IMPLEMENT_DYNAMIC_CLASS(wxList, wxObject)
IMPLEMENT_DYNAMIC_CLASS(wxStringList, wxList)
-#if USE_PRINTING_ARCHITECTURE
+#if wxUSE_PRINTING_ARCHITECTURE
#include "wx/print.h"
IMPLEMENT_DYNAMIC_CLASS(wxPrintDialog, wxDialog)
IMPLEMENT_DYNAMIC_CLASS(wxPrinterBase, wxObject)
IMPLEMENT_CLASS(wxGenericPrintSetupDialog, wxDialog)
#endif
-#if USE_POSTSCRIPT
+#if wxUSE_POSTSCRIPT
#include "wx/postscrp.h"
IMPLEMENT_DYNAMIC_CLASS(wxPostScriptDC, wxDC)
IMPLEMENT_DYNAMIC_CLASS(wxPrintSetupData, wxObject)
IMPLEMENT_DYNAMIC_CLASS(wxPrintPaperDatabase, wxList)
#endif
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
#include "wx/resource.h"
IMPLEMENT_DYNAMIC_CLASS(wxItemResource, wxObject)
IMPLEMENT_DYNAMIC_CLASS(wxResourceTable, wxHashTable)
#include "wx/process.h"
IMPLEMENT_DYNAMIC_CLASS(wxProcess, wxEvtHandler)
-#if USE_TIMEDATE
+#if wxUSE_TIMEDATE
#include "wx/date.h"
IMPLEMENT_DYNAMIC_CLASS(wxDate, wxObject)
#endif
-#if USE_DOC_VIEW_ARCHITECTURE
+#if wxUSE_DOC_VIEW_ARCHITECTURE
#include "wx/docview.h"
//IMPLEMENT_ABSTRACT_CLASS(wxDocItem, wxObject)
IMPLEMENT_ABSTRACT_CLASS(wxDocument, wxEvtHandler)
IMPLEMENT_DYNAMIC_CLASS(wxDocManager, wxEvtHandler)
IMPLEMENT_CLASS(wxDocChildFrame, wxFrame)
IMPLEMENT_CLASS(wxDocParentFrame, wxFrame)
-#if USE_PRINTING_ARCHITECTURE
+#if wxUSE_PRINTING_ARCHITECTURE
IMPLEMENT_DYNAMIC_CLASS(wxDocPrintout, wxPrintout)
#endif
IMPLEMENT_CLASS(wxCommand, wxObject)
IMPLEMENT_DYNAMIC_CLASS(wxFileHistory, wxObject)
#endif
-#if USE_CONSTRAINTS
+#if wxUSE_CONSTRAINTS
#include "wx/layout.h"
IMPLEMENT_DYNAMIC_CLASS(wxIndividualLayoutConstraint, wxObject)
IMPLEMENT_DYNAMIC_CLASS(wxLayoutConstraints, wxObject)
IMPLEMENT_DYNAMIC_CLASS(wxRowColSizer, wxSizer)
#endif
-#if USE_TOOLBAR
+#if wxUSE_TOOLBAR
#include "wx/tbarbase.h"
IMPLEMENT_DYNAMIC_CLASS(wxToolBarTool, wxObject)
IMPLEMENT_DYNAMIC_CLASS(wxToolBarBase, wxControl)
EVT_SYS_COLOUR_CHANGED(wxStatusBar::OnSysColourChanged)
END_EVENT_TABLE()
-#if USE_TIMEDATE
+#if wxUSE_TIMEDATE
#include "wx/time.h"
IMPLEMENT_DYNAMIC_CLASS(wxTime, wxObject)
#endif
#include "wx/statbox.h"
IMPLEMENT_DYNAMIC_CLASS(wxStaticBox, wxControl)
-#if USE_IPC
+#if wxUSE_IPC
#include "wx/dde.h"
IMPLEMENT_ABSTRACT_CLASS(wxDDEObject, wxObject)
IMPLEMENT_DYNAMIC_CLASS(wxDDEServer, wxDDEObject)
IMPLEMENT_DYNAMIC_CLASS(wxStaticText, wxControl)
IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap, wxControl)
-#if USE_METAFILE
+#if wxUSE_METAFILE
#include "wx/metafile.h"
IMPLEMENT_DYNAMIC_CLASS(wxMetaFile, wxObject)
IMPLEMENT_ABSTRACT_CLASS(wxMetaFileDC, wxDC)
#include "wx/dirdlg.h"
#include "wx/choicdlg.h"
-#if !defined(wx_msw) || USE_GENERIC_DIALOGS_IN_MSW
+#if !defined(wx_msw) || wxUSE_GENERIC_DIALOGS_IN_MSW
#include "wx/generic/msgdlgg.h"
IMPLEMENT_CLASS(wxGenericMessageDialog, wxDialog)
#endif
IMPLEMENT_CLASS(wxMessageDialog)
#endif
-#if USE_GAUGE
+#if wxUSE_GAUGE
#ifdef wx_motif
#include "../../contrib/xmgauge/gauge.h"
#endif
EVT_ERASE_BACKGROUND(wxControl::OnEraseBackground)
END_EVENT_TABLE()
-#if !defined(wx_msw) || USE_GENERIC_DIALOGS_IN_MSW
+#if !defined(wx_msw) || wxUSE_GENERIC_DIALOGS_IN_MSW
BEGIN_EVENT_TABLE(wxGenericMessageDialog, wxDialog)
EVT_BUTTON(wxID_YES, wxGenericMessageDialog::OnYes)
EVT_BUTTON(wxID_NO, wxGenericMessageDialog::OnNo)
#include "wx/dcmemory.h"
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
#include "../gdk_imlib/gdk_imlib.h"
#endif
{
m_ok = FALSE;
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
m_cmap = gdk_imlib_get_colormap();
#else
m_cmap = gdk_colormap_get_system();
{
m_ok = FALSE;
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
m_cmap = gdk_imlib_get_colormap();
#else
m_cmap = gdk_colormap_get_system();
bool wxPalette::Create( int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue)
{
+ wxFAIL_MSG("not implemented");
+
+ return FALSE;
};
int wxPalette::GetPixel( const unsigned char red, const unsigned char green, const unsigned char blue ) const
{
+ wxFAIL_MSG("not implemented");
+
+ return 0;
};
bool wxPalette::GetRGB( int pixel, unsigned char *red, unsigned char *green, unsigned char *blue ) const
{
+ wxFAIL_MSG("not implemented");
+
+ return 0;
};
#include "wx/settings.h"
#include "wx/log.h"
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
#include "../gdk_imlib/gdk_imlib.h"
#endif
I have been asked several times about writing some documentation about
the GTK port of wxWindows, especially its internal structures. Obviously,
you cannot understand wxGTK without knowing a little about the GTK, but
- some more information about what the wxWindow, which is the base class
+ some more information about what the wxWindow, which is the base class
for all other window classes, does seems required as well.
-
+
What does wxWindow do? It contains the common interface for the following
jobs of its descentants:
-
+
1) Define the rudimentary behaviour common to all window classes, such as
resizing, intercepting user input so as to make it possible to use these
events for special purposes in a derived class, window names etc.
class is allowed to contain children, which holds true for those window
classes, which do not display a native GTK widget. To name them, these
classes are wxPanel, wxScrolledWindow, wxDialog, wxFrame. The MDI frame-
- work classes are a special case and are handled a bit differently from
+ work classes are a special case and are handled a bit differently from
the rest.
-
+
3) Provide the possibility to draw into a client area of a window. This,
too, only holds true for classes that do not display a native GTK widget
as above.
-
+
4) Provide the entire mechanism for scrolling widgets. This actaul inter-
face for this is usually in wxScrolledWidget, but the GTK implementation
is in this class.
-
+
5) A multitude of helper or extra methods for special purposes, such as
Drag'n'Drop, managing validators etc.
-
+
Normally one might expect, that one wxWindows class would always contain
one GTK widget. Under GTK, there is no such allround widget that has all
the functionality. Moreover, the GTK defines a client area as a different
represent a client area in the sense of wxWindows capable to do the jobs
2), 3) and 4). I have written this class and it resides in win_gtk.c of
this directory.
-
+
All windows must have a widget, with which they interact with other under-
lying GTK widget. It is this widget, e.g. that has to be resized etc and
thw wxWindow class has a member variable called m_widget which holds a
and all other widgets must be children of this widget on the GTK level.
The top-most widget, which also represents the client area, must be in
the m_wxwindow field and must be of the type GtkMyFixed.
-
+
As I said, the window classes that display a GTK native widget only have
one widget, so in the case of e.g. the wxButton class m_widget holds a
pointer to a GtkButton widget. But windows with client areas (for drawing
and children) have a m_widget field that is a pointer to a GtkScrolled-
Window and a m_wxwindow field that is pointer to a GtkMyFixed and this
one is (in the GTK sense) a child of the GtkScrolledWindow.
-
+
If the m_wxwindow field is set, then all input to this widget is inter-
cepted and sent to the wxWindows class. If not, all input to the widget
that gets pointed to by m_widget gets intercepted and sent to the class.
extern wxList wxPendingDelete;
extern wxList wxTopLevelWindows;
extern bool g_blockEventsOnDrag;
- bool g_capturing = FALSE;
+static bool g_capturing = FALSE;
+
+// hack: we need something to pass to gtk_menu_popup, so we store the time of
+// the last click here
+static guint32 gs_timeLastClick = 0;
//-----------------------------------------------------------------------------
// "expose_event" (of m_wxwindow, not of m_widget)
//-----------------------------------------------------------------------------
static void gtk_window_expose_callback( GtkWidget *WXUNUSED(widget), GdkEventExpose *gdk_event, wxWindow *win )
-{
+{
if (!win->HasVMT()) return;
if (g_blockEventsOnDrag) return;
-
+
win->m_updateRegion.Union( gdk_event->area.x,
gdk_event->area.y,
- gdk_event->area.width,
+ gdk_event->area.width,
gdk_event->area.height );
-
+
if (gdk_event->count > 0) return;
/*
wxPaintEvent event( win->GetId() );
event.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event );
-
+
win->m_updateRegion.Clear();
}
//-----------------------------------------------------------------------------
static void gtk_window_draw_callback( GtkWidget *WXUNUSED(widget), GdkRectangle *rect, wxWindow *win )
-{
+{
if (!win->HasVMT()) return;
if (g_blockEventsOnDrag) return;
-
+
win->m_updateRegion.Union( rect->x, rect->y, rect->width, rect->height );
-
+
wxPaintEvent event( win->GetId() );
event.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event );
-
+
win->m_updateRegion.Clear();
}
//-----------------------------------------------------------------------------
static gint gtk_window_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxWindow *win )
-{
+{
if (!win->HasVMT()) return FALSE;
if (g_blockEventsOnDrag) return FALSE;
case GDK_F12: key_code = WXK_F12; break;
default:
{
- if ((gdk_event->keyval >= 0x20) && (gdk_event->keyval <= 0xFF))
+ if ((gdk_event->keyval >= 0x20) && (gdk_event->keyval <= 0xFF))
key_code = gdk_event->keyval;
}
}
if (!key_code) return FALSE;
-
+
wxKeyEvent event( wxEVT_CHAR );
event.m_shiftDown = (gdk_event->state & GDK_SHIFT_MASK);
event.m_controlDown = (gdk_event->state & GDK_CONTROL_MASK);
event.m_x = 0;
event.m_y = 0;
event.SetEventObject( win );
-
+
bool ret = win->GetEventHandler()->ProcessEvent( event );
-
+
if (!ret)
{
wxWindow *ancestor = win;
while (ancestor)
- {
+ {
int command = ancestor->GetAcceleratorTable()->GetCommand( event );
if (command != -1)
{
wxCommandEvent command_event( wxEVT_COMMAND_MENU_SELECTED, command );
ret = ancestor->GetEventHandler()->ProcessEvent( command_event );
- break;
+ break;
}
ancestor = ancestor->GetParent();
}
}
-
+
if (ret)
{
- if ((gdk_event->keyval >= 0x20) && (gdk_event->keyval <= 0xFF))
+ if ((gdk_event->keyval >= 0x20) && (gdk_event->keyval <= 0xFF))
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "key_press_event" );
}
-
+
return ret;
}
static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton *gdk_event, wxWindow *win )
{
if (!win->IsOwnGtkWindow( gdk_event->window )) return TRUE;
-
+
if (g_blockEventsOnDrag) return TRUE;
if (win->m_wxwindow)
if (GTK_WIDGET_CAN_FOCUS(win->m_wxwindow) && !GTK_WIDGET_HAS_FOCUS (win->m_wxwindow) )
{
gtk_widget_grab_focus (win->m_wxwindow);
-
+
/*
printf( "GrabFocus from " );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
printf( win->GetClassInfo()->GetClassName() );
printf( ".\n" );
*/
-
+
}
}
-
+
if (!win->HasVMT()) return TRUE;
/*
*/
wxEventType event_type = wxEVT_LEFT_DOWN;
-
+
if (gdk_event->button == 1)
{
switch (gdk_event->type)
default: break;
}
}
-
+
wxMouseEvent event( event_type );
event.m_shiftDown = (gdk_event->state & GDK_SHIFT_MASK);
event.m_controlDown = (gdk_event->state & GDK_CONTROL_MASK);
event.m_leftDown = (gdk_event->state & GDK_BUTTON1_MASK);
event.m_middleDown = (gdk_event->state & GDK_BUTTON2_MASK);
event.m_rightDown = (gdk_event->state & GDK_BUTTON3_MASK);
-
+
event.m_x = (long)gdk_event->x;
event.m_y = (long)gdk_event->y;
-
+
// Some control don't have their own X window and thus cannot get
- // any events.
-
+ // any events.
+
if (!g_capturing)
{
wxNode *node = win->GetChildren()->First();
wxWindow *child = (wxWindow*)node->Data();
if ((child->m_x <= event.m_x) &&
(child->m_y <= event.m_y) &&
- (child->m_x+child->m_width >= event.m_x) &&
- (child->m_y+child->m_height >= event.m_y))
+ (child->m_x+child->m_width >= event.m_x) &&
+ (child->m_y+child->m_height >= event.m_y))
{
win = child;
event.m_x -= child->m_x;
node = node->Next();
}
}
-
+
event.SetEventObject( win );
-
+
+ gs_timeLastClick = gdk_event->time;
+
if (win->GetEventHandler()->ProcessEvent( event ))
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "button_press_event" );
-
+
return TRUE;
}
//-----------------------------------------------------------------------------
static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButton *gdk_event, wxWindow *win )
-{
+{
if (!win->IsOwnGtkWindow( gdk_event->window )) return TRUE;
-
+
if (g_blockEventsOnDrag) return TRUE;
if (!win->HasVMT()) return TRUE;
-
+
/*
printf( "OnButtonRelease from " );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
printf( win->GetClassInfo()->GetClassName() );
printf( ".\n" );
*/
-
+
wxEventType event_type = wxEVT_NULL;
-
+
switch (gdk_event->button)
{
case 1: event_type = wxEVT_LEFT_UP; break;
event.m_rightDown = (gdk_event->state & GDK_BUTTON3_MASK);
event.m_x = (long)gdk_event->x;
event.m_y = (long)gdk_event->y;
-
+
// Some control don't have their own X window and thus cannot get
- // any events.
-
+ // any events.
+
if (!g_capturing)
{
wxNode *node = win->GetChildren()->First();
wxWindow *child = (wxWindow*)node->Data();
if ((child->m_x <= event.m_x) &&
(child->m_y <= event.m_y) &&
- (child->m_x+child->m_width >= event.m_x) &&
- (child->m_y+child->m_height >= event.m_y))
+ (child->m_x+child->m_width >= event.m_x) &&
+ (child->m_y+child->m_height >= event.m_y))
{
win = child;
event.m_x -= child->m_x;
node = node->Next();
}
}
-
+
event.SetEventObject( win );
-
+
if (win->GetEventHandler()->ProcessEvent( event ))
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "button_release_event" );
-
+
return TRUE;
}
//-----------------------------------------------------------------------------
static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion *gdk_event, wxWindow *win )
-{
+{
if (!win->IsOwnGtkWindow( gdk_event->window )) return TRUE;
-
+
if (g_blockEventsOnDrag) return TRUE;
if (!win->HasVMT()) return TRUE;
-
+
/*
printf( "OnMotion from " );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
printf( win->GetClassInfo()->GetClassName() );
printf( ".\n" );
*/
-
+
wxMouseEvent event( wxEVT_MOTION );
event.m_shiftDown = (gdk_event->state & GDK_SHIFT_MASK);
event.m_controlDown = (gdk_event->state & GDK_CONTROL_MASK);
event.m_leftDown = (gdk_event->state & GDK_BUTTON1_MASK);
event.m_middleDown = (gdk_event->state & GDK_BUTTON2_MASK);
event.m_rightDown = (gdk_event->state & GDK_BUTTON3_MASK);
-
+
event.m_x = (long)gdk_event->x;
event.m_y = (long)gdk_event->y;
-
+
// Some control don't have their own X window and thus cannot get
- // any events.
-
+ // any events.
+
if (!g_capturing)
{
wxNode *node = win->GetChildren()->First();
wxWindow *child = (wxWindow*)node->Data();
if ((child->m_x <= event.m_x) &&
(child->m_y <= event.m_y) &&
- (child->m_x+child->m_width >= event.m_x) &&
- (child->m_y+child->m_height >= event.m_y))
+ (child->m_x+child->m_width >= event.m_x) &&
+ (child->m_y+child->m_height >= event.m_y))
{
win = child;
event.m_x -= child->m_x;
node = node->Next();
}
}
-
+
event.SetEventObject( win );
-
+
if (win->GetEventHandler()->ProcessEvent( event ))
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "motion_notify_event" );
-
+
return TRUE;
}
if (GTK_WIDGET_CAN_FOCUS(win->m_wxwindow))
{
GTK_WIDGET_SET_FLAGS (win->m_wxwindow, GTK_HAS_FOCUS);
-/*
+/*
printf( "SetFocus flag from " );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
printf( win->GetClassInfo()->GetClassName() );
*/
}
}
-
+
if (!win->HasVMT()) return TRUE;
-
+
/*
printf( "OnSetFocus from " );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
printf( WXSTRINGCAST win->GetLabel() );
printf( ".\n" );
*/
-
+
wxFocusEvent event( wxEVT_SET_FOCUS, win->GetId() );
event.SetEventObject( win );
-
+
if (win->GetEventHandler()->ProcessEvent( event ))
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "focus_in_event" );
-
+
return TRUE;
}
if (GTK_WIDGET_CAN_FOCUS(win->m_wxwindow))
GTK_WIDGET_UNSET_FLAGS (win->m_wxwindow, GTK_HAS_FOCUS);
}
-
+
if (!win->HasVMT()) return TRUE;
-
+
/*
printf( "OnKillFocus from " );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
printf( win->GetClassInfo()->GetClassName() );
printf( ".\n" );
*/
-
+
wxFocusEvent event( wxEVT_KILL_FOCUS, win->GetId() );
event.SetEventObject( win );
-
+
if (win->GetEventHandler()->ProcessEvent( event ))
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "focus_out_event" );
static gint gtk_window_enter_callback( GtkWidget *widget, GdkEventCrossing *gdk_event, wxWindow *win )
{
if (widget->window != gdk_event->window) return TRUE;
-
+
if (g_blockEventsOnDrag) return TRUE;
-
+
if (!win->HasVMT()) return TRUE;
-
+
/*
printf( "OnEnter from " );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
printf( win->GetClassInfo()->GetClassName() );
printf( ".\n" );
*/
-
+
if ((widget->window) && (win->m_cursor))
gdk_window_set_cursor( widget->window, win->m_cursor->GetCursor() );
-
+
wxMouseEvent event( wxEVT_ENTER_WINDOW );
event.SetEventObject( win );
-
+
if (win->GetEventHandler()->ProcessEvent( event ))
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "enter_notify_event" );
-
+
return TRUE;
}
-
+
//-----------------------------------------------------------------------------
// "leave_notify_event"
//-----------------------------------------------------------------------------
static gint gtk_window_leave_callback( GtkWidget *widget, GdkEventCrossing *gdk_event, wxWindow *win )
{
if (widget->window != gdk_event->window) return TRUE;
-
+
if (g_blockEventsOnDrag) return TRUE;
-
+
if (!win->HasVMT()) return TRUE;
-
+
/*
printf( "OnLeave from " );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
printf( win->GetClassInfo()->GetClassName() );
printf( ".\n" );
*/
-
+
if ((widget->window) && (win->m_cursor))
gdk_window_set_cursor( widget->window, wxSTANDARD_CURSOR->GetCursor() );
-
+
wxMouseEvent event( wxEVT_LEAVE_WINDOW );
event.SetEventObject( win );
-
+
if (win->GetEventHandler()->ProcessEvent( event ))
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "leave_notify_event" );
-
+
return TRUE;
}
-
+
//-----------------------------------------------------------------------------
// "value_changed" from m_vAdjust
//-----------------------------------------------------------------------------
printf( win->GetClassInfo()->GetClassName() );
printf( ".\n" );
*/
-
+
if (!win->HasVMT()) return;
-
+
float diff = win->m_vAdjust->value - win->m_oldVerticalPos;
if (fabs(diff) < 0.2) return;
-
+
wxEventType command = wxEVT_NULL;
-
+
float line_step = win->m_vAdjust->step_increment;
float page_step = win->m_vAdjust->page_increment;
-
+
if (fabs(diff-line_step) < 0.2) command = wxEVT_SCROLL_LINEDOWN;
else if (fabs(diff+line_step) < 0.2) command = wxEVT_SCROLL_LINEUP;
else if (fabs(diff-page_step) < 0.2) command = wxEVT_SCROLL_PAGEDOWN;
else if (fabs(diff+page_step) < 0.2) command = wxEVT_SCROLL_PAGEUP;
else command = wxEVT_SCROLL_THUMBTRACK;
-
+
int value = (int)(win->m_vAdjust->value+0.5);
wxScrollEvent event( command, win->GetId(), value, wxVERTICAL );
//-----------------------------------------------------------------------------
static void gtk_window_hscroll_callback( GtkWidget *WXUNUSED(widget), wxWindow *win )
-{
+{
if (g_blockEventsOnDrag) return;
-
+
/*
printf( "OnHScroll from " );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
printf( win->GetClassInfo()->GetClassName() );
printf( ".\n" );
*/
-
+
if (!win->HasVMT()) return;
-
+
float diff = win->m_hAdjust->value - win->m_oldHorizontalPos;
if (fabs(diff) < 0.2) return;
-
+
wxEventType command = wxEVT_NULL;
-
+
float line_step = win->m_hAdjust->step_increment;
float page_step = win->m_hAdjust->page_increment;
-
+
if (fabs(diff-line_step) < 0.2) command = wxEVT_SCROLL_LINEDOWN;
else if (fabs(diff+line_step) < 0.2) command = wxEVT_SCROLL_LINEUP;
else if (fabs(diff-page_step) < 0.2) command = wxEVT_SCROLL_PAGEDOWN;
else command = wxEVT_SCROLL_THUMBTRACK;
int value = (int)(win->m_hAdjust->value+0.5);
-
+
wxScrollEvent event( command, win->GetId(), value, wxHORIZONTAL );
event.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event );
printf( win->GetClassInfo()->GetClassName() );
printf( ".\n" );
*/
-
+
if (!win->HasVMT()) return;
-
+
wxEventType command = wxEVT_SCROLL_THUMBTRACK;
int value = (int)(win->m_vAdjust->value+0.5);
//-----------------------------------------------------------------------------
static void gtk_window_hscroll_change_callback( GtkWidget *WXUNUSED(widget), wxWindow *win )
-{
+{
if (g_blockEventsOnDrag) return;
-
+
/*
printf( "OnHScroll change from " );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
printf( win->GetClassInfo()->GetClassName() );
printf( ".\n" );
*/
-
+
if (!win->HasVMT()) return;
-
+
wxEventType command = wxEVT_SCROLL_THUMBTRACK;
int value = (int)(win->m_hAdjust->value+0.5);
-
+
wxScrollEvent event( command, win->GetId(), value, wxHORIZONTAL );
event.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event );
if (gdk_event->window != widget->slider) return FALSE;
win->m_isScrolling = TRUE;
-
+
return FALSE;
}
if (gdk_event->window != widget->slider) return FALSE;
GtkScrolledWindow *s_window = GTK_SCROLLED_WINDOW(win->m_widget);
-
+
if (widget == GTK_RANGE(s_window->vscrollbar))
gtk_signal_emit_by_name( GTK_OBJECT(win->m_hAdjust), "value_changed" );
- else
+ else
gtk_signal_emit_by_name( GTK_OBJECT(win->m_vAdjust), "value_changed" );
-
+
win->m_isScrolling = FALSE;
-
+
return FALSE;
}
static void gtk_window_drop_callback( GtkWidget *widget, GdkEvent *event, wxWindow *win )
{
if (!win->HasVMT()) return;
-
+
if (win->GetDropTarget())
{
int x = 0;
gdk_window_get_pointer( widget->window, &x, &y, (GdkModifierType *) NULL );
win->GetDropTarget()->Drop( event, x, y );
}
-
+
/*
g_free (event->dropdataavailable.data);
g_free (event->dropdataavailable.data_type);
m_isShown = FALSE;
m_isEnabled = TRUE;
m_needParent = TRUE;
-
+
m_cursor = (wxCursor *) NULL;
-
+
PreCreation( parent, id, pos, size, style, name );
-
+
m_widget = gtk_scrolled_window_new( (GtkAdjustment *) NULL, (GtkAdjustment *) NULL );
m_hasScrolling = TRUE;
-
+
GtkScrolledWindow *s_window = GTK_SCROLLED_WINDOW(m_widget);
-
+
gtk_signal_connect( GTK_OBJECT(s_window->vscrollbar), "button_press_event",
(GtkSignalFunc)gtk_scrollbar_button_press_callback, (gpointer) this );
GtkScrolledWindowClass *scroll_class = GTK_SCROLLED_WINDOW_CLASS( GTK_OBJECT(m_widget)->klass );
scroll_class->scrollbar_spacing = 0;
-
+
gtk_scrolled_window_set_policy( s_window, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC );
-
+
m_oldHorizontalPos = 0.0;
m_oldVerticalPos = 0.0;
-
+
m_hAdjust = gtk_range_get_adjustment( GTK_RANGE(s_window->hscrollbar) );
m_vAdjust = gtk_range_get_adjustment( GTK_RANGE(s_window->vscrollbar) );
-
+
gtk_signal_connect( GTK_OBJECT(m_hAdjust), "value_changed",
(GtkSignalFunc) gtk_window_hscroll_callback, (gpointer) this );
gtk_signal_connect( GTK_OBJECT(m_vAdjust), "value_changed",
(GtkSignalFunc) gtk_window_vscroll_callback, (gpointer) this );
-
+
gtk_signal_connect( GTK_OBJECT(m_hAdjust), "changed",
(GtkSignalFunc) gtk_window_hscroll_change_callback, (gpointer) this );
gtk_signal_connect(GTK_OBJECT(m_vAdjust), "changed",
(GtkSignalFunc) gtk_window_vscroll_change_callback, (gpointer) this );
-
+
GtkViewport *viewport = GTK_VIEWPORT(s_window->viewport);
-
+
if (m_windowStyle & wxRAISED_BORDER)
{
gtk_viewport_set_shadow_type( viewport, GTK_SHADOW_OUT );
{
gtk_viewport_set_shadow_type( viewport, GTK_SHADOW_NONE );
}
-
+
m_wxwindow = gtk_myfixed_new();
-
+
if (m_wxwindow) GTK_WIDGET_UNSET_FLAGS( m_widget, GTK_CAN_FOCUS );
-
+
if (m_windowStyle & wxTAB_TRAVERSAL == wxTAB_TRAVERSAL)
GTK_WIDGET_UNSET_FLAGS( m_wxwindow, GTK_CAN_FOCUS );
else
// shut the viewport up
gtk_viewport_set_hadjustment( viewport, (GtkAdjustment*) gtk_adjustment_new( 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) );
gtk_viewport_set_vadjustment( viewport, (GtkAdjustment*) gtk_adjustment_new( 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) );
-
- // I _really_ don't want scrollbars in the beginning
+
+ // I _really_ don't want scrollbars in the beginning
m_vAdjust->lower = 0.0;
m_vAdjust->upper = 1.0;
m_vAdjust->value = 0.0;
m_hAdjust->page_increment = 1.0;
m_hAdjust->page_size = 5.0;
gtk_signal_emit_by_name( GTK_OBJECT(m_hAdjust), "changed" );
-
+
gtk_widget_show( m_wxwindow );
-
+
PostCreation();
-
+
Show( TRUE );
- return TRUE;
+ return TRUE;
}
wxWindow::~wxWindow(void)
{
m_hasVMT = FALSE;
-
+
if (m_pDropTarget) delete m_pDropTarget;
-
+
if (m_parent) m_parent->RemoveChild( this );
if (m_widget) Show( FALSE );
DestroyChildren();
-
+
if (m_wxwindow) gtk_widget_destroy( m_wxwindow );
-
+
if (m_widget) gtk_widget_destroy( m_widget );
-
+
wxDELETE(m_cursor);
DeleteRelatedConstraints();
// wxWindow::LoadNativeDialog but we weren't a dialog
// class
wxTopLevelWindows.DeleteObject(this);
-
+
if (m_windowValidator) delete m_windowValidator;
}
void wxWindow::PostCreation(void)
{
if (m_parent) m_parent->AddChild( this );
-
+
if (m_wxwindow)
{
- gtk_signal_connect( GTK_OBJECT(m_wxwindow), "expose_event",
+ gtk_signal_connect( GTK_OBJECT(m_wxwindow), "expose_event",
GTK_SIGNAL_FUNC(gtk_window_expose_callback), (gpointer)this );
-
- gtk_signal_connect( GTK_OBJECT(m_wxwindow), "draw",
+
+ gtk_signal_connect( GTK_OBJECT(m_wxwindow), "draw",
GTK_SIGNAL_FUNC(gtk_window_draw_callback), (gpointer)this );
}
-
+
ConnectWidget( GetConnectWidget() );
-
+
if (m_widget && m_parent) gtk_widget_realize( m_widget );
-
+
if (m_wxwindow)
{
gtk_widget_realize( m_wxwindow );
gdk_gc_set_exposures( m_wxwindow->style->fg_gc[0], TRUE );
}
-
+
SetCursor( *wxSTANDARD_CURSOR );
-
+
m_hasVMT = TRUE;
}
gtk_signal_connect( GTK_OBJECT(widget), "button_press_event",
GTK_SIGNAL_FUNC(gtk_window_button_press_callback), (gpointer)this );
-
+
gtk_signal_connect( GTK_OBJECT(widget), "button_release_event",
GTK_SIGNAL_FUNC(gtk_window_button_release_callback), (gpointer)this );
-
+
gtk_signal_connect( GTK_OBJECT(widget), "motion_notify_event",
GTK_SIGNAL_FUNC(gtk_window_motion_notify_callback), (gpointer)this );
-
- gtk_signal_connect( GTK_OBJECT(widget), "focus_in_event",
+
+ gtk_signal_connect( GTK_OBJECT(widget), "focus_in_event",
GTK_SIGNAL_FUNC(gtk_window_focus_in_callback), (gpointer)this );
- gtk_signal_connect( GTK_OBJECT(widget), "focus_out_event",
+ gtk_signal_connect( GTK_OBJECT(widget), "focus_out_event",
GTK_SIGNAL_FUNC(gtk_window_focus_out_callback), (gpointer)this );
- gtk_signal_connect( GTK_OBJECT(widget), "enter_notify_event",
+ gtk_signal_connect( GTK_OBJECT(widget), "enter_notify_event",
GTK_SIGNAL_FUNC(gtk_window_enter_callback), (gpointer)this );
-
- gtk_signal_connect( GTK_OBJECT(widget), "leave_notify_event",
+
+ gtk_signal_connect( GTK_OBJECT(widget), "leave_notify_event",
GTK_SIGNAL_FUNC(gtk_window_leave_callback), (gpointer)this );
}
bool wxWindow::Close( bool force )
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
wxCloseEvent event(wxEVT_CLOSE_WINDOW, m_windowId);
event.SetEventObject(this);
event.SetForce(force);
bool wxWindow::Destroy(void)
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
m_hasVMT = FALSE;
delete this;
return TRUE;
bool wxWindow::DestroyChildren(void)
{
- if (GetChildren())
+ if (GetChildren())
{
wxNode *node;
- while ((node = GetChildren()->First()) != (wxNode *)NULL)
+ while ((node = GetChildren()->First()) != (wxNode *)NULL)
{
wxWindow *child;
- if ((child = (wxWindow *)node->Data()) != (wxWindow *)NULL)
+ if ((child = (wxWindow *)node->Data()) != (wxWindow *)NULL)
{
delete child;
if (GetChildren()->Member(child)) delete node;
}
void wxWindow::ImplementSetSize(void)
-{
+{
if ((m_minWidth != -1) && (m_width < m_minWidth)) m_width = m_minWidth;
if ((m_minHeight != -1) && (m_height < m_minHeight)) m_height = m_minHeight;
if ((m_maxWidth != -1) && (m_width > m_maxWidth)) m_width = m_minWidth;
gtk_widget_set_uposition( m_widget, m_x, m_y );
return;
}
-
+
if (!m_parent)
{
wxFAIL_MSG( "wxWindow::SetSize error.\n" );
return;
}
-
+
if ((m_parent) && (m_parent->m_wxwindow))
gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), m_widget, m_x, m_y );
-
- // Don't do anything for children of wxNotebook and wxMDIChildFrame
+
+ // Don't do anything for children of wxNotebook and wxMDIChildFrame
}
void wxWindow::SetSize( int x, int y, int width, int height, int sizeFlags )
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
if (m_resizing) return; // I don't like recursions
m_resizing = TRUE;
-
+
int newX = x;
int newY = y;
int newW = width;
int newH = height;
-
+
if ((sizeFlags & wxSIZE_USE_EXISTING) == wxSIZE_USE_EXISTING)
{
if (newX == -1) newX = m_x;
if (newW == -1) newW = m_width;
if (newH == -1) newH = m_height;
}
-
+
if ((sizeFlags & wxSIZE_AUTO_WIDTH) == wxSIZE_AUTO_WIDTH)
{
if (newW == -1) newW = 80;
}
-
+
if ((sizeFlags & wxSIZE_AUTO_HEIGHT) == wxSIZE_AUTO_HEIGHT)
{
if (newH == -1) newH = 26;
}
-
+
if ((m_x != newX) || (m_y != newY) || (!m_sizeSet))
{
m_x = newX;
ImplementSetSize();
}
m_sizeSet = TRUE;
-
+
wxSizeEvent event( wxSize(m_width,m_height), GetId() );
event.SetEventObject( this );
ProcessEvent( event );
-
+
m_resizing = FALSE;
}
void wxWindow::GetSize( int *width, int *height ) const
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
if (width) (*width) = m_width;
if (height) (*height) = m_height;
}
void wxWindow::SetClientSize( int width, int height )
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
if (!m_wxwindow)
{
SetSize( width, height );
{
int dw = 0;
int dh = 0;
-
+
if (!m_hasScrolling)
{
/*
do we have sunken dialogs ?
-
+
GtkStyleClass *window_class = m_wxwindow->style->klass;
-
+
dw += 2 * window_class->xthickness;
dh += 2 * window_class->ythickness;
*/
{
GtkScrolledWindow *scroll_window = GTK_SCROLLED_WINDOW(m_widget);
GtkScrolledWindowClass *scroll_class = GTK_SCROLLED_WINDOW_CLASS( GTK_OBJECT(m_widget)->klass );
-
+
GtkWidget *viewport = scroll_window->viewport;
GtkStyleClass *viewport_class = viewport->style->klass;
-
+
GtkWidget *hscrollbar = scroll_window->hscrollbar;
GtkWidget *vscrollbar = scroll_window->vscrollbar;
-
+
if ((m_windowStyle & wxRAISED_BORDER) ||
(m_windowStyle & wxSUNKEN_BORDER))
{
dw += 2 * viewport_class->xthickness;
dh += 2 * viewport_class->ythickness;
}
-
+
if (GTK_WIDGET_VISIBLE(vscrollbar))
{
dw += vscrollbar->allocation.width;
dw += scroll_class->scrollbar_spacing;
}
-
+
if (GTK_WIDGET_VISIBLE(hscrollbar))
{
dh += hscrollbar->allocation.height;
dw += scroll_class->scrollbar_spacing;
}
}
-
+
SetSize( width+dw, height+dh );
}
}
void wxWindow::GetClientSize( int *width, int *height ) const
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
if (!m_wxwindow)
{
if (width) (*width) = m_width;
{
int dw = 0;
int dh = 0;
-
+
if (!m_hasScrolling)
{
/*
do we have sunken dialogs ?
-
+
GtkStyleClass *window_class = m_wxwindow->style->klass;
-
+
dw += 2 * window_class->xthickness;
dh += 2 * window_class->ythickness;
*/
{
GtkScrolledWindow *scroll_window = GTK_SCROLLED_WINDOW(m_widget);
GtkScrolledWindowClass *scroll_class = GTK_SCROLLED_WINDOW_CLASS( GTK_OBJECT(m_widget)->klass );
-
+
GtkWidget *viewport = scroll_window->viewport;
GtkStyleClass *viewport_class = viewport->style->klass;
-
+
GtkWidget *hscrollbar = scroll_window->hscrollbar;
GtkWidget *vscrollbar = scroll_window->vscrollbar;
-
+
if ((m_windowStyle & wxRAISED_BORDER) ||
(m_windowStyle & wxSUNKEN_BORDER))
{
dw += 2 * viewport_class->xthickness;
dh += 2 * viewport_class->ythickness;
}
-
+
if (GTK_WIDGET_VISIBLE(vscrollbar))
{
// dw += vscrollbar->allocation.width;
dw += 15; // range.slider_width = 11 + 2*2pts edge
dw += scroll_class->scrollbar_spacing;
}
-
+
if (GTK_WIDGET_VISIBLE(hscrollbar))
{
// dh += hscrollbar->allocation.height;
dh += scroll_class->scrollbar_spacing;
}
}
-
+
if (width) (*width) = m_width - dw;
if (height) (*height) = m_height - dh;
}
void wxWindow::GetPosition( int *x, int *y ) const
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
if (x) (*x) = m_x;
if (y) (*y) = m_y;
}
void wxWindow::ClientToScreen( int *x, int *y )
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
GdkWindow *source = (GdkWindow *) NULL;
if (m_wxwindow)
source = m_wxwindow->window;
else
source = m_widget->window;
-
+
int org_x = 0;
int org_y = 0;
gdk_window_get_origin( source, &org_x, &org_y );
if (!m_wxwindow)
- {
+ {
if (GTK_WIDGET_NO_WINDOW (m_widget))
{
org_x += m_widget->allocation.x;
org_y += m_widget->allocation.y;
}
}
-
- if (x) *x += org_x;
- if (y) *y += org_y;
+
+ if (x) *x += org_x;
+ if (y) *y += org_y;
}
void wxWindow::ScreenToClient( int *x, int *y )
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
GdkWindow *source = (GdkWindow *) NULL;
if (m_wxwindow)
source = m_wxwindow->window;
else
source = m_widget->window;
-
+
int org_x = 0;
int org_y = 0;
gdk_window_get_origin( source, &org_x, &org_y );
if (!m_wxwindow)
- {
+ {
if (GTK_WIDGET_NO_WINDOW (m_widget))
{
org_x += m_widget->allocation.x;
org_y += m_widget->allocation.y;
}
}
-
- if (x) *x -= org_x;
- if (y) *y -= org_y;
+
+ if (x) *x -= org_x;
+ if (y) *y -= org_y;
}
void wxWindow::Centre( int direction )
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
if (IS_KIND_OF(this,wxDialog) || IS_KIND_OF(this,wxFrame))
{
if (direction & wxHORIZONTAL == wxHORIZONTAL) m_x = (gdk_screen_width () - m_width) / 2;
void wxWindow::Fit(void)
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
int maxX = 0;
int maxY = 0;
wxNode *node = GetChildren()->First();
void wxWindow::SetSizeHints( int minW, int minH, int maxW, int maxH, int WXUNUSED(incW), int WXUNUSED(incH) )
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
m_minWidth = minW;
m_minHeight = minH;
m_maxWidth = maxW;
bool wxWindow::Show( bool show )
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
if (show)
gtk_widget_show( m_widget );
else
gtk_widget_hide( m_widget );
- m_isShown = show;
+ m_isShown = show;
return TRUE;
}
void wxWindow::Enable( bool enable )
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
m_isEnabled = enable;
gtk_widget_set_sensitive( m_widget, enable );
if (m_wxwindow) gtk_widget_set_sensitive( m_wxwindow, enable );
int wxWindow::GetCharHeight(void) const
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
if (!m_font.Ok())
{
wxFAIL_MSG( "invalid font" );
return -1;
}
-
+
GdkFont *font = m_font.GetInternalFont( 1.0 );
return font->ascent + font->descent;
}
int wxWindow::GetCharWidth(void) const
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
if (!m_font.Ok())
{
wxFAIL_MSG( "invalid font" );
return -1;
}
-
+
GdkFont *font = m_font.GetInternalFont( 1.0 );
return gdk_string_width( font, "H" );
}
int *descent, int *externalLeading, const wxFont *theFont, bool WXUNUSED(use16) ) const
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
wxFont fontToUse = m_font;
if (theFont) fontToUse = *theFont;
-
+
if (!fontToUse.Ok())
{
wxFAIL_MSG( "invalid font" );
return;
}
wxASSERT_MSG( (m_font.Ok()), "invalid font" );
-
+
GdkFont *font = fontToUse.GetInternalFont( 1.0 );
if (x) (*x) = gdk_string_width( font, string );
if (y) (*y) = font->ascent + font->descent;
void wxWindow::SetFocus(void)
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
GtkWidget *connect_widget = GetConnectWidget();
if (connect_widget)
{
wxASSERT_MSG( (m_wxwindow != NULL), "window need client area" );
wxASSERT_MSG( (child != NULL), "invalid child" );
wxASSERT_MSG( (child->m_widget != NULL), "invalid child" );
-
+
// Addchild is (often) called before the program
// has left the parents constructor so that no
// virtual tables work yet. The approach below
// practically imitates virtual tables, i.e. it
// implements a different AddChild() behaviour
- // for wxFrame, wxDialog, wxWindow and
+ // for wxFrame, wxDialog, wxWindow and
// wxMDIParentFrame.
// wxFrame and wxDialog as children aren't placed into the parents
-
+
if (( IS_KIND_OF(child,wxFrame) || IS_KIND_OF(child,wxDialog) ) &&
(!IS_KIND_OF(child,wxMDIChildFrame)))
{
m_children.Append( child );
-
+
if ((child->m_x != -1) && (child->m_y != -1))
gtk_widget_set_uposition( child->m_widget, child->m_x, child->m_y );
-
+
return;
}
-
- // In the case of an wxMDIChildFrame descendant, we use the
+
+ // In the case of an wxMDIChildFrame descendant, we use the
// client windows's AddChild()
-
+
if (IS_KIND_OF(this,wxMDIParentFrame))
{
if (IS_KIND_OF(child,wxMDIChildFrame))
{
wxMDIClientWindow *client = ((wxMDIParentFrame*)this)->GetClientWindow();
if (client)
- {
+ {
client->AddChild( child );
return;
}
}
}
-
+
// wxNotebook is very special, so it has a private AddChild()
-
+
if (IS_KIND_OF(this,wxNotebook))
{
wxNotebook *tab = (wxNotebook*)this;
tab->AddChild( child );
return;
}
-
+
// wxFrame has a private AddChild
-
+
if (IS_KIND_OF(this,wxFrame) && !IS_KIND_OF(this,wxMDIChildFrame))
{
wxFrame *frame = (wxFrame*)this;
frame->AddChild( child );
return;
}
-
+
// All the rest
-
+
m_children.Append( child );
- if (m_wxwindow) gtk_myfixed_put( GTK_MYFIXED(m_wxwindow), child->m_widget,
+ if (m_wxwindow) gtk_myfixed_put( GTK_MYFIXED(m_wxwindow), child->m_widget,
child->m_x, child->m_y );
-
+
gtk_widget_set_usize( child->m_widget, child->m_width, child->m_height );
}
void wxWindow::Raise(void)
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
if (m_widget) gdk_window_raise( m_widget->window );
}
void wxWindow::Lower(void)
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
if (m_widget) gdk_window_lower( m_widget->window );
}
void wxWindow::SetCursor( const wxCursor &cursor )
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
if (m_cursor == NULL)
{
wxFAIL_MSG( "wxWindow::SetCursor m_cursor == NULL" );
m_cursor = new wxCursor( wxCURSOR_ARROW );
}
-
+
if (cursor.Ok())
{
if (*((wxCursor*)&cursor) == m_cursor) return;
if ((m_widget) && (m_widget->window))
gdk_window_set_cursor( m_widget->window, m_cursor->GetCursor() );
-
+
if ((m_wxwindow) && (m_wxwindow->window))
gdk_window_set_cursor( m_wxwindow->window, m_cursor->GetCursor() );
}
void wxWindow::Refresh( bool eraseBackground, const wxRect *rect )
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
if (eraseBackground && m_wxwindow && m_wxwindow->window)
{
if (rect)
- gdk_window_clear_area( m_wxwindow->window,
- rect->x,
- rect->y,
- rect->width,
+ gdk_window_clear_area( m_wxwindow->window,
+ rect->x,
+ rect->y,
+ rect->width,
rect->height );
else
- Clear();
+ Clear();
}
if (!rect)
{
int w = 0;
int h = 0;
GetClientSize( &w, &h );
-
+
GdkRectangle gdk_rect;
gdk_rect.x = 0;
gdk_rect.y = 0;
gdk_rect.y = rect->y;
gdk_rect.width = rect->width;
gdk_rect.height = rect->height;
-
+
if (m_wxwindow)
gtk_widget_draw( m_wxwindow, &gdk_rect );
else
void wxWindow::Clear(void)
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
if (m_wxwindow && m_wxwindow->window) gdk_window_clear( m_wxwindow->window );
}
void wxWindow::SetBackgroundColour( const wxColour &colour )
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
m_backgroundColour = colour;
if (m_wxwindow)
{
bool wxWindow::Validate(void)
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
wxNode *node = GetChildren()->First();
while (node)
{
wxWindow *child = (wxWindow *)node->Data();
- if (child->GetValidator() && /* child->GetValidator()->Ok() && */ !child->GetValidator()->Validate(this))
+ if (child->GetValidator() && /* child->GetValidator()->Ok() && */ !child->GetValidator()->Validate(this))
{ return FALSE; }
node = node->Next();
}
bool wxWindow::TransferDataToWindow(void)
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
wxNode *node = GetChildren()->First();
while (node)
{
bool wxWindow::TransferDataFromWindow(void)
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
wxNode *node = GetChildren()->First();
while (node)
{
void wxWindow::InitDialog(void)
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
wxInitDialogEvent event(GetId());
event.SetEventObject( this );
GetEventHandler()->ProcessEvent(event);
bool wxWindow::PopupMenu( wxMenu *menu, int WXUNUSED(x), int WXUNUSED(y) )
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
SetInvokingWindow( menu, this );
- gtk_menu_popup( GTK_MENU(menu->m_menu), (GtkWidget *) NULL, (GtkWidget *) NULL, (GtkMenuPositionFunc) NULL, NULL, 0, 0 );
+ gtk_menu_popup(
+ GTK_MENU(menu->m_menu),
+ (GtkWidget *)NULL, // parent menu shell
+ (GtkWidget *)NULL, // parent menu item
+ (GtkMenuPositionFunc)NULL,
+ NULL, // client data
+ 0, // button used to activate it
+ 0//gs_timeLastClick // the time of activation
+ );
return TRUE;
}
void wxWindow::SetDropTarget( wxDropTarget *dropTarget )
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
GtkWidget *dnd_widget = GetConnectWidget();
-
+
DisconnectDnDWidget( dnd_widget );
-
+
if (m_pDropTarget) delete m_pDropTarget;
m_pDropTarget = dropTarget;
-
+
ConnectDnDWidget( dnd_widget );
}
void wxWindow::ConnectDnDWidget( GtkWidget *widget )
{
if (!m_pDropTarget) return;
-
+
m_pDropTarget->RegisterWidget( widget );
-
+
gtk_signal_connect( GTK_OBJECT(widget), "drop_data_available_event",
GTK_SIGNAL_FUNC(gtk_window_drop_callback), (gpointer)this );
}
void wxWindow::DisconnectDnDWidget( GtkWidget *widget )
{
if (!m_pDropTarget) return;
-
+
gtk_signal_disconnect_by_func( GTK_OBJECT(widget),
GTK_SIGNAL_FUNC(gtk_window_drop_callback), (gpointer)this );
-
+
m_pDropTarget->UnregisterWidget( widget );
}
{
GtkWidget *connect_widget = m_widget;
if (m_wxwindow) connect_widget = m_wxwindow;
-
+
return connect_widget;
}
-
+
bool wxWindow::IsOwnGtkWindow( GdkWindow *window )
{
if (m_wxwindow) return (window == m_wxwindow->window);
void wxWindow::SetFont( const wxFont &font )
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
if (((wxFont*)&font)->Ok())
m_font = font;
else
{
style = gtk_widget_get_style( m_widget );
}
-
+
gdk_font_unref( style->font );
style->font = gdk_font_ref( m_font.GetInternalFont( 1.0 ) );
-
+
gtk_widget_set_style( m_widget, style );
}
void wxWindow::CaptureMouse(void)
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
wxASSERT_MSG( (g_capturing == FALSE), "CaptureMouse called twice" );
-
+
GtkWidget *connect_widget = GetConnectWidget();
gtk_grab_add( connect_widget );
gdk_pointer_grab ( connect_widget->window, FALSE,
(GdkEventMask)
- (GDK_BUTTON_PRESS_MASK |
+ (GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK |
- GDK_POINTER_MOTION_MASK),
+ GDK_POINTER_MOTION_MASK),
(GdkWindow *) NULL, (GdkCursor *) NULL, GDK_CURRENT_TIME );
g_capturing = TRUE;
}
void wxWindow::ReleaseMouse(void)
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
wxASSERT_MSG( (g_capturing == TRUE), "ReleaseMouse called twice" );
-
+
GtkWidget *connect_widget = GetConnectWidget();
gtk_grab_remove( connect_widget );
gdk_pointer_ungrab ( GDK_CURRENT_TIME );
int range, bool refresh )
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
wxASSERT_MSG( (m_wxwindow != NULL), "window needs client area" );
-
+
if (!m_wxwindow) return;
if (orient == wxHORIZONTAL)
float fpos = (float)pos;
float frange = (float)range;
float fthumb = (float)thumbVisible;
-
+
if ((fabs(frange-m_hAdjust->upper) < 0.2) &&
(fabs(fthumb-m_hAdjust->page_size) < 0.2))
{
SetScrollPos( orient, pos, refresh );
return;
}
-
+
m_oldHorizontalPos = fpos;
-
+
m_hAdjust->lower = 0.0;
m_hAdjust->upper = frange;
m_hAdjust->value = fpos;
float fpos = (float)pos;
float frange = (float)range;
float fthumb = (float)thumbVisible;
-
+
if ((fabs(frange-m_vAdjust->upper) < 0.2) &&
(fabs(fthumb-m_vAdjust->page_size) < 0.2))
{
SetScrollPos( orient, pos, refresh );
return;
}
-
+
m_oldVerticalPos = fpos;
-
+
m_vAdjust->lower = 0.0;
m_vAdjust->upper = frange;
m_vAdjust->value = fpos;
m_vAdjust->page_increment = (float)(wxMax(fthumb,0));
m_vAdjust->page_size = fthumb;
}
-
+
if (m_wxwindow->window)
{
if (orient == wxHORIZONTAL)
gtk_signal_emit_by_name( GTK_OBJECT(m_hAdjust), "changed" );
else
gtk_signal_emit_by_name( GTK_OBJECT(m_vAdjust), "changed" );
-
+
gtk_widget_set_usize( m_widget, m_width, m_height );
}
}
void wxWindow::SetScrollPos( int orient, int pos, bool WXUNUSED(refresh) )
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
wxASSERT_MSG( (m_wxwindow != NULL), "window needs client area" );
-
+
if (!m_wxwindow) return;
-
+
if (orient == wxHORIZONTAL)
{
float fpos = (float)pos;
if (fabs(fpos-m_vAdjust->value) < 0.2) return;
m_vAdjust->value = fpos;
}
-
+
if (!m_isScrolling)
{
if (m_wxwindow->window)
- {
+ {
if (orient == wxHORIZONTAL)
gtk_signal_emit_by_name( GTK_OBJECT(m_hAdjust), "value_changed" );
- else
+ else
gtk_signal_emit_by_name( GTK_OBJECT(m_vAdjust), "value_changed" );
}
}
int wxWindow::GetScrollThumb( int orient ) const
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
wxASSERT_MSG( (m_wxwindow != NULL), "window needs client area" );
-
+
if (!m_wxwindow) return 0;
if (orient == wxHORIZONTAL)
int wxWindow::GetScrollPos( int orient ) const
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
wxASSERT_MSG( (m_wxwindow != NULL), "window needs client area" );
-
+
if (!m_wxwindow) return 0;
if (orient == wxHORIZONTAL)
int wxWindow::GetScrollRange( int orient ) const
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
wxASSERT_MSG( (m_wxwindow != NULL), "window needs client area" );
-
+
if (!m_wxwindow) return 0;
if (orient == wxHORIZONTAL)
void wxWindow::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) )
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
wxASSERT_MSG( (m_wxwindow != NULL), "window needs client area" );
-
+
if (!m_wxwindow) return;
int cw = 0;
int ch = 0;
GetClientSize( &cw, &ch );
-
+
int w = cw - abs(dx);
int h = ch - abs(dy);
if ((h < 0) || (w < 0))
if (dy > 0) d_y = dy;
gdk_window_copy_area( m_wxwindow->window, m_wxwindow->style->fg_gc[0], d_x, d_y,
m_wxwindow->window, s_x, s_y, w, h );
-
+
wxRect rect;
if (dx < 0) rect.x = cw+dx; else rect.x = 0;
if (dy < 0) rect.y = ch+dy; else rect.y = 0;
if (dy != 0) rect.width = cw; else rect.width = abs(dx);
if (dx != 0) rect.height = ch; else rect.height = abs(dy);
-
+
Refresh( TRUE, &rect );
}
GetConstraints()->width.SetValue(w);
GetConstraints()->height.SetValue(h);
}
-
+
// If top level (one sizer), evaluate the sizer's constraints.
if (GetSizer())
{
bool wxWindow::LayoutPhase2(int *noChanges)
{
*noChanges = 0;
-
+
// Layout children
DoPhase(1);
DoPhase(2);
if (!m_sizerParent || m_sizerParent->IsKindOf(CLASSINFO(wxDialog)) ||
m_sizerParent->IsKindOf(CLASSINFO(wxFrame)) )
return;
-
+
int xp, yp;
m_sizerParent->GetPosition(&xp, &yp);
m_sizerParent->TransformSizerToActual(&xp, &yp);
#include "unistd.h"
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
#include "../gdk_imlib/gdk_imlib.h"
#endif
{
/*
-#if USE_RESOURCES
+#if wxUSE_RESOURCES
(void) wxGetResource("wxWindows", "OsVersion", &wxOsVersion);
#endif
*/
wxInitializeResourceSystem();
// For PostScript printing
-#if USE_POSTSCRIPT
+#if wxUSE_POSTSCRIPT
wxInitializePrintSetupData();
wxThePrintPaperDatabase = new wxPrintPaperDatabase;
wxThePrintPaperDatabase->CreateDatabase();
wxClassInfo::InitializeClasses();
-#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
+#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
streambuf* sBuf = new wxDebugStreamBuf;
ostream* oStr = new ostream(sBuf) ;
gtk_init( &argc, &argv );
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
gdk_imlib_init();
delete[] wxBuffer;
-#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
+#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
if (wxDebugContext::CountObjectsLeft() > 0)
{
#include "wx/icon.h"
#include "gdk/gdkprivate.h"
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
#include "../gdk_imlib/gdk_imlib.h"
#include "gdk/gdkx.h" // GDK_DISPLAY
wxMask::~wxMask(void)
{
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
// do not delete the mask, gdk_imlib does it for you
#else
if (m_bitmap) gdk_bitmap_unref( m_bitmap );
int m_width;
int m_height;
int m_bpp;
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
GdkImlibImage *m_image;
#endif
wxPalette *m_palette;
m_height = 0;
m_bpp = 0;
m_palette = (wxPalette *) NULL;
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
m_image = (GdkImlibImage *) NULL;
#endif
}
wxBitmapRefData::~wxBitmapRefData(void)
{
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
if (m_pixmap) gdk_imlib_free_pixmap( m_pixmap );
if (m_image) gdk_imlib_kill_image( m_image );
#else
{
m_refData = new wxBitmapRefData();
-#ifndef USE_GDK_IMLIB
+#ifndef wxUSE_GDK_IMLIB
GdkBitmap *mask = NULL;
return;
}
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
if (M_BMPDATA->m_bitmap)
{
return FALSE;
}
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
if (M_BMPDATA->m_bitmap)
{
bool wxBitmap::LoadFile( const wxString &name, int WXUNUSED(type) )
{
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
UnRef();
m_refData = new wxBitmapRefData();
return;
}
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
DestroyImage();
return;
}
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
if (!M_BMPDATA->m_image) RecreateImage();
#include "wx/gdicmn.h"
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
#include "../gdk_imlib/gdk_imlib.h"
#endif
if ((M_COLDATA->m_hasPixel) && (M_COLDATA->m_colormap == cmap)) return;
M_COLDATA->FreeColour();
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
int r = M_COLDATA->m_color.red >> SHIFT;
int g = M_COLDATA->m_color.green >> SHIFT;
#endif
-#if USE_SHARED_LIBRARY
+#if wxUSE_SHARED_LIBRARY
/*
* For wxWindows to be made into a dynamic library (e.g. Sun),
* all IMPLEMENT_... macros must be in one place.
#include "wx/choice.h"
IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl)
-#if USE_CLIPBOARD
+#if wxUSE_CLIPBOARD
#include "wx/clipbrd.h"
IMPLEMENT_DYNAMIC_CLASS(wxClipboard, wxObject)
IMPLEMENT_ABSTRACT_CLASS(wxClipboardClient, wxObject)
#endif
-#if USE_COMBOBOX
+#if wxUSE_COMBOBOX
#include "wx/combobox.h"
IMPLEMENT_DYNAMIC_CLASS(wxComboBox, wxControl)
#endif
#include "wx/colordlg.h"
#include "wx/fontdlg.h"
-#if !defined(wx_msw) || USE_GENERIC_DIALOGS_IN_MSW
+#if !defined(wx_msw) || wxUSE_GENERIC_DIALOGS_IN_MSW
#include "wx/generic/colordlg.h"
#include "wx/generic/fontdlg.h"
IMPLEMENT_DYNAMIC_CLASS(wxGenericColourDialog, wxDialog)
#endif
*/
-#if defined(wx_x) || (defined(wx_msw) && USE_PORTABLE_FONTS_IN_MSW)
+#if defined(wx_x) || (defined(wx_msw) && wxUSE_PORTABLE_FONTS_IN_MSW)
IMPLEMENT_DYNAMIC_CLASS(wxFontNameDirectory, wxObject)
#endif
IMPLEMENT_DYNAMIC_CLASS(wxList, wxObject)
IMPLEMENT_DYNAMIC_CLASS(wxStringList, wxList)
-#if USE_PRINTING_ARCHITECTURE
+#if wxUSE_PRINTING_ARCHITECTURE
#include "wx/print.h"
IMPLEMENT_DYNAMIC_CLASS(wxPrintDialog, wxDialog)
IMPLEMENT_DYNAMIC_CLASS(wxPrinterBase, wxObject)
IMPLEMENT_CLASS(wxGenericPrintSetupDialog, wxDialog)
#endif
-#if USE_POSTSCRIPT
+#if wxUSE_POSTSCRIPT
#include "wx/postscrp.h"
IMPLEMENT_DYNAMIC_CLASS(wxPostScriptDC, wxDC)
IMPLEMENT_DYNAMIC_CLASS(wxPrintSetupData, wxObject)
IMPLEMENT_DYNAMIC_CLASS(wxPrintPaperDatabase, wxList)
#endif
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
#include "wx/resource.h"
IMPLEMENT_DYNAMIC_CLASS(wxItemResource, wxObject)
IMPLEMENT_DYNAMIC_CLASS(wxResourceTable, wxHashTable)
#include "wx/process.h"
IMPLEMENT_DYNAMIC_CLASS(wxProcess, wxEvtHandler)
-#if USE_TIMEDATE
+#if wxUSE_TIMEDATE
#include "wx/date.h"
IMPLEMENT_DYNAMIC_CLASS(wxDate, wxObject)
#endif
-#if USE_DOC_VIEW_ARCHITECTURE
+#if wxUSE_DOC_VIEW_ARCHITECTURE
#include "wx/docview.h"
//IMPLEMENT_ABSTRACT_CLASS(wxDocItem, wxObject)
IMPLEMENT_ABSTRACT_CLASS(wxDocument, wxEvtHandler)
IMPLEMENT_DYNAMIC_CLASS(wxDocManager, wxEvtHandler)
IMPLEMENT_CLASS(wxDocChildFrame, wxFrame)
IMPLEMENT_CLASS(wxDocParentFrame, wxFrame)
-#if USE_PRINTING_ARCHITECTURE
+#if wxUSE_PRINTING_ARCHITECTURE
IMPLEMENT_DYNAMIC_CLASS(wxDocPrintout, wxPrintout)
#endif
IMPLEMENT_CLASS(wxCommand, wxObject)
IMPLEMENT_DYNAMIC_CLASS(wxFileHistory, wxObject)
#endif
-#if USE_CONSTRAINTS
+#if wxUSE_CONSTRAINTS
#include "wx/layout.h"
IMPLEMENT_DYNAMIC_CLASS(wxIndividualLayoutConstraint, wxObject)
IMPLEMENT_DYNAMIC_CLASS(wxLayoutConstraints, wxObject)
IMPLEMENT_DYNAMIC_CLASS(wxRowColSizer, wxSizer)
#endif
-#if USE_TOOLBAR
+#if wxUSE_TOOLBAR
#include "wx/tbarbase.h"
IMPLEMENT_DYNAMIC_CLASS(wxToolBarTool, wxObject)
IMPLEMENT_DYNAMIC_CLASS(wxToolBarBase, wxControl)
EVT_SYS_COLOUR_CHANGED(wxStatusBar::OnSysColourChanged)
END_EVENT_TABLE()
-#if USE_TIMEDATE
+#if wxUSE_TIMEDATE
#include "wx/time.h"
IMPLEMENT_DYNAMIC_CLASS(wxTime, wxObject)
#endif
#include "wx/statbox.h"
IMPLEMENT_DYNAMIC_CLASS(wxStaticBox, wxControl)
-#if USE_IPC
+#if wxUSE_IPC
#include "wx/dde.h"
IMPLEMENT_ABSTRACT_CLASS(wxDDEObject, wxObject)
IMPLEMENT_DYNAMIC_CLASS(wxDDEServer, wxDDEObject)
IMPLEMENT_DYNAMIC_CLASS(wxStaticText, wxControl)
IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap, wxControl)
-#if USE_METAFILE
+#if wxUSE_METAFILE
#include "wx/metafile.h"
IMPLEMENT_DYNAMIC_CLASS(wxMetaFile, wxObject)
IMPLEMENT_ABSTRACT_CLASS(wxMetaFileDC, wxDC)
#include "wx/dirdlg.h"
#include "wx/choicdlg.h"
-#if !defined(wx_msw) || USE_GENERIC_DIALOGS_IN_MSW
+#if !defined(wx_msw) || wxUSE_GENERIC_DIALOGS_IN_MSW
#include "wx/generic/msgdlgg.h"
IMPLEMENT_CLASS(wxGenericMessageDialog, wxDialog)
#endif
IMPLEMENT_CLASS(wxMessageDialog)
#endif
-#if USE_GAUGE
+#if wxUSE_GAUGE
#ifdef wx_motif
#include "../../contrib/xmgauge/gauge.h"
#endif
EVT_ERASE_BACKGROUND(wxControl::OnEraseBackground)
END_EVENT_TABLE()
-#if !defined(wx_msw) || USE_GENERIC_DIALOGS_IN_MSW
+#if !defined(wx_msw) || wxUSE_GENERIC_DIALOGS_IN_MSW
BEGIN_EVENT_TABLE(wxGenericMessageDialog, wxDialog)
EVT_BUTTON(wxID_YES, wxGenericMessageDialog::OnYes)
EVT_BUTTON(wxID_NO, wxGenericMessageDialog::OnNo)
#include "wx/dcmemory.h"
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
#include "../gdk_imlib/gdk_imlib.h"
#endif
{
m_ok = FALSE;
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
m_cmap = gdk_imlib_get_colormap();
#else
m_cmap = gdk_colormap_get_system();
{
m_ok = FALSE;
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
m_cmap = gdk_imlib_get_colormap();
#else
m_cmap = gdk_colormap_get_system();
bool wxPalette::Create( int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue)
{
+ wxFAIL_MSG("not implemented");
+
+ return FALSE;
};
int wxPalette::GetPixel( const unsigned char red, const unsigned char green, const unsigned char blue ) const
{
+ wxFAIL_MSG("not implemented");
+
+ return 0;
};
bool wxPalette::GetRGB( int pixel, unsigned char *red, unsigned char *green, unsigned char *blue ) const
{
+ wxFAIL_MSG("not implemented");
+
+ return 0;
};
#include "wx/settings.h"
#include "wx/log.h"
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
#include "../gdk_imlib/gdk_imlib.h"
#endif
I have been asked several times about writing some documentation about
the GTK port of wxWindows, especially its internal structures. Obviously,
you cannot understand wxGTK without knowing a little about the GTK, but
- some more information about what the wxWindow, which is the base class
+ some more information about what the wxWindow, which is the base class
for all other window classes, does seems required as well.
-
+
What does wxWindow do? It contains the common interface for the following
jobs of its descentants:
-
+
1) Define the rudimentary behaviour common to all window classes, such as
resizing, intercepting user input so as to make it possible to use these
events for special purposes in a derived class, window names etc.
class is allowed to contain children, which holds true for those window
classes, which do not display a native GTK widget. To name them, these
classes are wxPanel, wxScrolledWindow, wxDialog, wxFrame. The MDI frame-
- work classes are a special case and are handled a bit differently from
+ work classes are a special case and are handled a bit differently from
the rest.
-
+
3) Provide the possibility to draw into a client area of a window. This,
too, only holds true for classes that do not display a native GTK widget
as above.
-
+
4) Provide the entire mechanism for scrolling widgets. This actaul inter-
face for this is usually in wxScrolledWidget, but the GTK implementation
is in this class.
-
+
5) A multitude of helper or extra methods for special purposes, such as
Drag'n'Drop, managing validators etc.
-
+
Normally one might expect, that one wxWindows class would always contain
one GTK widget. Under GTK, there is no such allround widget that has all
the functionality. Moreover, the GTK defines a client area as a different
represent a client area in the sense of wxWindows capable to do the jobs
2), 3) and 4). I have written this class and it resides in win_gtk.c of
this directory.
-
+
All windows must have a widget, with which they interact with other under-
lying GTK widget. It is this widget, e.g. that has to be resized etc and
thw wxWindow class has a member variable called m_widget which holds a
and all other widgets must be children of this widget on the GTK level.
The top-most widget, which also represents the client area, must be in
the m_wxwindow field and must be of the type GtkMyFixed.
-
+
As I said, the window classes that display a GTK native widget only have
one widget, so in the case of e.g. the wxButton class m_widget holds a
pointer to a GtkButton widget. But windows with client areas (for drawing
and children) have a m_widget field that is a pointer to a GtkScrolled-
Window and a m_wxwindow field that is pointer to a GtkMyFixed and this
one is (in the GTK sense) a child of the GtkScrolledWindow.
-
+
If the m_wxwindow field is set, then all input to this widget is inter-
cepted and sent to the wxWindows class. If not, all input to the widget
that gets pointed to by m_widget gets intercepted and sent to the class.
extern wxList wxPendingDelete;
extern wxList wxTopLevelWindows;
extern bool g_blockEventsOnDrag;
- bool g_capturing = FALSE;
+static bool g_capturing = FALSE;
+
+// hack: we need something to pass to gtk_menu_popup, so we store the time of
+// the last click here
+static guint32 gs_timeLastClick = 0;
//-----------------------------------------------------------------------------
// "expose_event" (of m_wxwindow, not of m_widget)
//-----------------------------------------------------------------------------
static void gtk_window_expose_callback( GtkWidget *WXUNUSED(widget), GdkEventExpose *gdk_event, wxWindow *win )
-{
+{
if (!win->HasVMT()) return;
if (g_blockEventsOnDrag) return;
-
+
win->m_updateRegion.Union( gdk_event->area.x,
gdk_event->area.y,
- gdk_event->area.width,
+ gdk_event->area.width,
gdk_event->area.height );
-
+
if (gdk_event->count > 0) return;
/*
wxPaintEvent event( win->GetId() );
event.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event );
-
+
win->m_updateRegion.Clear();
}
//-----------------------------------------------------------------------------
static void gtk_window_draw_callback( GtkWidget *WXUNUSED(widget), GdkRectangle *rect, wxWindow *win )
-{
+{
if (!win->HasVMT()) return;
if (g_blockEventsOnDrag) return;
-
+
win->m_updateRegion.Union( rect->x, rect->y, rect->width, rect->height );
-
+
wxPaintEvent event( win->GetId() );
event.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event );
-
+
win->m_updateRegion.Clear();
}
//-----------------------------------------------------------------------------
static gint gtk_window_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxWindow *win )
-{
+{
if (!win->HasVMT()) return FALSE;
if (g_blockEventsOnDrag) return FALSE;
case GDK_F12: key_code = WXK_F12; break;
default:
{
- if ((gdk_event->keyval >= 0x20) && (gdk_event->keyval <= 0xFF))
+ if ((gdk_event->keyval >= 0x20) && (gdk_event->keyval <= 0xFF))
key_code = gdk_event->keyval;
}
}
if (!key_code) return FALSE;
-
+
wxKeyEvent event( wxEVT_CHAR );
event.m_shiftDown = (gdk_event->state & GDK_SHIFT_MASK);
event.m_controlDown = (gdk_event->state & GDK_CONTROL_MASK);
event.m_x = 0;
event.m_y = 0;
event.SetEventObject( win );
-
+
bool ret = win->GetEventHandler()->ProcessEvent( event );
-
+
if (!ret)
{
wxWindow *ancestor = win;
while (ancestor)
- {
+ {
int command = ancestor->GetAcceleratorTable()->GetCommand( event );
if (command != -1)
{
wxCommandEvent command_event( wxEVT_COMMAND_MENU_SELECTED, command );
ret = ancestor->GetEventHandler()->ProcessEvent( command_event );
- break;
+ break;
}
ancestor = ancestor->GetParent();
}
}
-
+
if (ret)
{
- if ((gdk_event->keyval >= 0x20) && (gdk_event->keyval <= 0xFF))
+ if ((gdk_event->keyval >= 0x20) && (gdk_event->keyval <= 0xFF))
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "key_press_event" );
}
-
+
return ret;
}
static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton *gdk_event, wxWindow *win )
{
if (!win->IsOwnGtkWindow( gdk_event->window )) return TRUE;
-
+
if (g_blockEventsOnDrag) return TRUE;
if (win->m_wxwindow)
if (GTK_WIDGET_CAN_FOCUS(win->m_wxwindow) && !GTK_WIDGET_HAS_FOCUS (win->m_wxwindow) )
{
gtk_widget_grab_focus (win->m_wxwindow);
-
+
/*
printf( "GrabFocus from " );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
printf( win->GetClassInfo()->GetClassName() );
printf( ".\n" );
*/
-
+
}
}
-
+
if (!win->HasVMT()) return TRUE;
/*
*/
wxEventType event_type = wxEVT_LEFT_DOWN;
-
+
if (gdk_event->button == 1)
{
switch (gdk_event->type)
default: break;
}
}
-
+
wxMouseEvent event( event_type );
event.m_shiftDown = (gdk_event->state & GDK_SHIFT_MASK);
event.m_controlDown = (gdk_event->state & GDK_CONTROL_MASK);
event.m_leftDown = (gdk_event->state & GDK_BUTTON1_MASK);
event.m_middleDown = (gdk_event->state & GDK_BUTTON2_MASK);
event.m_rightDown = (gdk_event->state & GDK_BUTTON3_MASK);
-
+
event.m_x = (long)gdk_event->x;
event.m_y = (long)gdk_event->y;
-
+
// Some control don't have their own X window and thus cannot get
- // any events.
-
+ // any events.
+
if (!g_capturing)
{
wxNode *node = win->GetChildren()->First();
wxWindow *child = (wxWindow*)node->Data();
if ((child->m_x <= event.m_x) &&
(child->m_y <= event.m_y) &&
- (child->m_x+child->m_width >= event.m_x) &&
- (child->m_y+child->m_height >= event.m_y))
+ (child->m_x+child->m_width >= event.m_x) &&
+ (child->m_y+child->m_height >= event.m_y))
{
win = child;
event.m_x -= child->m_x;
node = node->Next();
}
}
-
+
event.SetEventObject( win );
-
+
+ gs_timeLastClick = gdk_event->time;
+
if (win->GetEventHandler()->ProcessEvent( event ))
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "button_press_event" );
-
+
return TRUE;
}
//-----------------------------------------------------------------------------
static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButton *gdk_event, wxWindow *win )
-{
+{
if (!win->IsOwnGtkWindow( gdk_event->window )) return TRUE;
-
+
if (g_blockEventsOnDrag) return TRUE;
if (!win->HasVMT()) return TRUE;
-
+
/*
printf( "OnButtonRelease from " );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
printf( win->GetClassInfo()->GetClassName() );
printf( ".\n" );
*/
-
+
wxEventType event_type = wxEVT_NULL;
-
+
switch (gdk_event->button)
{
case 1: event_type = wxEVT_LEFT_UP; break;
event.m_rightDown = (gdk_event->state & GDK_BUTTON3_MASK);
event.m_x = (long)gdk_event->x;
event.m_y = (long)gdk_event->y;
-
+
// Some control don't have their own X window and thus cannot get
- // any events.
-
+ // any events.
+
if (!g_capturing)
{
wxNode *node = win->GetChildren()->First();
wxWindow *child = (wxWindow*)node->Data();
if ((child->m_x <= event.m_x) &&
(child->m_y <= event.m_y) &&
- (child->m_x+child->m_width >= event.m_x) &&
- (child->m_y+child->m_height >= event.m_y))
+ (child->m_x+child->m_width >= event.m_x) &&
+ (child->m_y+child->m_height >= event.m_y))
{
win = child;
event.m_x -= child->m_x;
node = node->Next();
}
}
-
+
event.SetEventObject( win );
-
+
if (win->GetEventHandler()->ProcessEvent( event ))
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "button_release_event" );
-
+
return TRUE;
}
//-----------------------------------------------------------------------------
static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion *gdk_event, wxWindow *win )
-{
+{
if (!win->IsOwnGtkWindow( gdk_event->window )) return TRUE;
-
+
if (g_blockEventsOnDrag) return TRUE;
if (!win->HasVMT()) return TRUE;
-
+
/*
printf( "OnMotion from " );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
printf( win->GetClassInfo()->GetClassName() );
printf( ".\n" );
*/
-
+
wxMouseEvent event( wxEVT_MOTION );
event.m_shiftDown = (gdk_event->state & GDK_SHIFT_MASK);
event.m_controlDown = (gdk_event->state & GDK_CONTROL_MASK);
event.m_leftDown = (gdk_event->state & GDK_BUTTON1_MASK);
event.m_middleDown = (gdk_event->state & GDK_BUTTON2_MASK);
event.m_rightDown = (gdk_event->state & GDK_BUTTON3_MASK);
-
+
event.m_x = (long)gdk_event->x;
event.m_y = (long)gdk_event->y;
-
+
// Some control don't have their own X window and thus cannot get
- // any events.
-
+ // any events.
+
if (!g_capturing)
{
wxNode *node = win->GetChildren()->First();
wxWindow *child = (wxWindow*)node->Data();
if ((child->m_x <= event.m_x) &&
(child->m_y <= event.m_y) &&
- (child->m_x+child->m_width >= event.m_x) &&
- (child->m_y+child->m_height >= event.m_y))
+ (child->m_x+child->m_width >= event.m_x) &&
+ (child->m_y+child->m_height >= event.m_y))
{
win = child;
event.m_x -= child->m_x;
node = node->Next();
}
}
-
+
event.SetEventObject( win );
-
+
if (win->GetEventHandler()->ProcessEvent( event ))
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "motion_notify_event" );
-
+
return TRUE;
}
if (GTK_WIDGET_CAN_FOCUS(win->m_wxwindow))
{
GTK_WIDGET_SET_FLAGS (win->m_wxwindow, GTK_HAS_FOCUS);
-/*
+/*
printf( "SetFocus flag from " );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
printf( win->GetClassInfo()->GetClassName() );
*/
}
}
-
+
if (!win->HasVMT()) return TRUE;
-
+
/*
printf( "OnSetFocus from " );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
printf( WXSTRINGCAST win->GetLabel() );
printf( ".\n" );
*/
-
+
wxFocusEvent event( wxEVT_SET_FOCUS, win->GetId() );
event.SetEventObject( win );
-
+
if (win->GetEventHandler()->ProcessEvent( event ))
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "focus_in_event" );
-
+
return TRUE;
}
if (GTK_WIDGET_CAN_FOCUS(win->m_wxwindow))
GTK_WIDGET_UNSET_FLAGS (win->m_wxwindow, GTK_HAS_FOCUS);
}
-
+
if (!win->HasVMT()) return TRUE;
-
+
/*
printf( "OnKillFocus from " );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
printf( win->GetClassInfo()->GetClassName() );
printf( ".\n" );
*/
-
+
wxFocusEvent event( wxEVT_KILL_FOCUS, win->GetId() );
event.SetEventObject( win );
-
+
if (win->GetEventHandler()->ProcessEvent( event ))
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "focus_out_event" );
static gint gtk_window_enter_callback( GtkWidget *widget, GdkEventCrossing *gdk_event, wxWindow *win )
{
if (widget->window != gdk_event->window) return TRUE;
-
+
if (g_blockEventsOnDrag) return TRUE;
-
+
if (!win->HasVMT()) return TRUE;
-
+
/*
printf( "OnEnter from " );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
printf( win->GetClassInfo()->GetClassName() );
printf( ".\n" );
*/
-
+
if ((widget->window) && (win->m_cursor))
gdk_window_set_cursor( widget->window, win->m_cursor->GetCursor() );
-
+
wxMouseEvent event( wxEVT_ENTER_WINDOW );
event.SetEventObject( win );
-
+
if (win->GetEventHandler()->ProcessEvent( event ))
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "enter_notify_event" );
-
+
return TRUE;
}
-
+
//-----------------------------------------------------------------------------
// "leave_notify_event"
//-----------------------------------------------------------------------------
static gint gtk_window_leave_callback( GtkWidget *widget, GdkEventCrossing *gdk_event, wxWindow *win )
{
if (widget->window != gdk_event->window) return TRUE;
-
+
if (g_blockEventsOnDrag) return TRUE;
-
+
if (!win->HasVMT()) return TRUE;
-
+
/*
printf( "OnLeave from " );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
printf( win->GetClassInfo()->GetClassName() );
printf( ".\n" );
*/
-
+
if ((widget->window) && (win->m_cursor))
gdk_window_set_cursor( widget->window, wxSTANDARD_CURSOR->GetCursor() );
-
+
wxMouseEvent event( wxEVT_LEAVE_WINDOW );
event.SetEventObject( win );
-
+
if (win->GetEventHandler()->ProcessEvent( event ))
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "leave_notify_event" );
-
+
return TRUE;
}
-
+
//-----------------------------------------------------------------------------
// "value_changed" from m_vAdjust
//-----------------------------------------------------------------------------
printf( win->GetClassInfo()->GetClassName() );
printf( ".\n" );
*/
-
+
if (!win->HasVMT()) return;
-
+
float diff = win->m_vAdjust->value - win->m_oldVerticalPos;
if (fabs(diff) < 0.2) return;
-
+
wxEventType command = wxEVT_NULL;
-
+
float line_step = win->m_vAdjust->step_increment;
float page_step = win->m_vAdjust->page_increment;
-
+
if (fabs(diff-line_step) < 0.2) command = wxEVT_SCROLL_LINEDOWN;
else if (fabs(diff+line_step) < 0.2) command = wxEVT_SCROLL_LINEUP;
else if (fabs(diff-page_step) < 0.2) command = wxEVT_SCROLL_PAGEDOWN;
else if (fabs(diff+page_step) < 0.2) command = wxEVT_SCROLL_PAGEUP;
else command = wxEVT_SCROLL_THUMBTRACK;
-
+
int value = (int)(win->m_vAdjust->value+0.5);
wxScrollEvent event( command, win->GetId(), value, wxVERTICAL );
//-----------------------------------------------------------------------------
static void gtk_window_hscroll_callback( GtkWidget *WXUNUSED(widget), wxWindow *win )
-{
+{
if (g_blockEventsOnDrag) return;
-
+
/*
printf( "OnHScroll from " );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
printf( win->GetClassInfo()->GetClassName() );
printf( ".\n" );
*/
-
+
if (!win->HasVMT()) return;
-
+
float diff = win->m_hAdjust->value - win->m_oldHorizontalPos;
if (fabs(diff) < 0.2) return;
-
+
wxEventType command = wxEVT_NULL;
-
+
float line_step = win->m_hAdjust->step_increment;
float page_step = win->m_hAdjust->page_increment;
-
+
if (fabs(diff-line_step) < 0.2) command = wxEVT_SCROLL_LINEDOWN;
else if (fabs(diff+line_step) < 0.2) command = wxEVT_SCROLL_LINEUP;
else if (fabs(diff-page_step) < 0.2) command = wxEVT_SCROLL_PAGEDOWN;
else command = wxEVT_SCROLL_THUMBTRACK;
int value = (int)(win->m_hAdjust->value+0.5);
-
+
wxScrollEvent event( command, win->GetId(), value, wxHORIZONTAL );
event.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event );
printf( win->GetClassInfo()->GetClassName() );
printf( ".\n" );
*/
-
+
if (!win->HasVMT()) return;
-
+
wxEventType command = wxEVT_SCROLL_THUMBTRACK;
int value = (int)(win->m_vAdjust->value+0.5);
//-----------------------------------------------------------------------------
static void gtk_window_hscroll_change_callback( GtkWidget *WXUNUSED(widget), wxWindow *win )
-{
+{
if (g_blockEventsOnDrag) return;
-
+
/*
printf( "OnHScroll change from " );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
printf( win->GetClassInfo()->GetClassName() );
printf( ".\n" );
*/
-
+
if (!win->HasVMT()) return;
-
+
wxEventType command = wxEVT_SCROLL_THUMBTRACK;
int value = (int)(win->m_hAdjust->value+0.5);
-
+
wxScrollEvent event( command, win->GetId(), value, wxHORIZONTAL );
event.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event );
if (gdk_event->window != widget->slider) return FALSE;
win->m_isScrolling = TRUE;
-
+
return FALSE;
}
if (gdk_event->window != widget->slider) return FALSE;
GtkScrolledWindow *s_window = GTK_SCROLLED_WINDOW(win->m_widget);
-
+
if (widget == GTK_RANGE(s_window->vscrollbar))
gtk_signal_emit_by_name( GTK_OBJECT(win->m_hAdjust), "value_changed" );
- else
+ else
gtk_signal_emit_by_name( GTK_OBJECT(win->m_vAdjust), "value_changed" );
-
+
win->m_isScrolling = FALSE;
-
+
return FALSE;
}
static void gtk_window_drop_callback( GtkWidget *widget, GdkEvent *event, wxWindow *win )
{
if (!win->HasVMT()) return;
-
+
if (win->GetDropTarget())
{
int x = 0;
gdk_window_get_pointer( widget->window, &x, &y, (GdkModifierType *) NULL );
win->GetDropTarget()->Drop( event, x, y );
}
-
+
/*
g_free (event->dropdataavailable.data);
g_free (event->dropdataavailable.data_type);
m_isShown = FALSE;
m_isEnabled = TRUE;
m_needParent = TRUE;
-
+
m_cursor = (wxCursor *) NULL;
-
+
PreCreation( parent, id, pos, size, style, name );
-
+
m_widget = gtk_scrolled_window_new( (GtkAdjustment *) NULL, (GtkAdjustment *) NULL );
m_hasScrolling = TRUE;
-
+
GtkScrolledWindow *s_window = GTK_SCROLLED_WINDOW(m_widget);
-
+
gtk_signal_connect( GTK_OBJECT(s_window->vscrollbar), "button_press_event",
(GtkSignalFunc)gtk_scrollbar_button_press_callback, (gpointer) this );
GtkScrolledWindowClass *scroll_class = GTK_SCROLLED_WINDOW_CLASS( GTK_OBJECT(m_widget)->klass );
scroll_class->scrollbar_spacing = 0;
-
+
gtk_scrolled_window_set_policy( s_window, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC );
-
+
m_oldHorizontalPos = 0.0;
m_oldVerticalPos = 0.0;
-
+
m_hAdjust = gtk_range_get_adjustment( GTK_RANGE(s_window->hscrollbar) );
m_vAdjust = gtk_range_get_adjustment( GTK_RANGE(s_window->vscrollbar) );
-
+
gtk_signal_connect( GTK_OBJECT(m_hAdjust), "value_changed",
(GtkSignalFunc) gtk_window_hscroll_callback, (gpointer) this );
gtk_signal_connect( GTK_OBJECT(m_vAdjust), "value_changed",
(GtkSignalFunc) gtk_window_vscroll_callback, (gpointer) this );
-
+
gtk_signal_connect( GTK_OBJECT(m_hAdjust), "changed",
(GtkSignalFunc) gtk_window_hscroll_change_callback, (gpointer) this );
gtk_signal_connect(GTK_OBJECT(m_vAdjust), "changed",
(GtkSignalFunc) gtk_window_vscroll_change_callback, (gpointer) this );
-
+
GtkViewport *viewport = GTK_VIEWPORT(s_window->viewport);
-
+
if (m_windowStyle & wxRAISED_BORDER)
{
gtk_viewport_set_shadow_type( viewport, GTK_SHADOW_OUT );
{
gtk_viewport_set_shadow_type( viewport, GTK_SHADOW_NONE );
}
-
+
m_wxwindow = gtk_myfixed_new();
-
+
if (m_wxwindow) GTK_WIDGET_UNSET_FLAGS( m_widget, GTK_CAN_FOCUS );
-
+
if (m_windowStyle & wxTAB_TRAVERSAL == wxTAB_TRAVERSAL)
GTK_WIDGET_UNSET_FLAGS( m_wxwindow, GTK_CAN_FOCUS );
else
// shut the viewport up
gtk_viewport_set_hadjustment( viewport, (GtkAdjustment*) gtk_adjustment_new( 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) );
gtk_viewport_set_vadjustment( viewport, (GtkAdjustment*) gtk_adjustment_new( 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) );
-
- // I _really_ don't want scrollbars in the beginning
+
+ // I _really_ don't want scrollbars in the beginning
m_vAdjust->lower = 0.0;
m_vAdjust->upper = 1.0;
m_vAdjust->value = 0.0;
m_hAdjust->page_increment = 1.0;
m_hAdjust->page_size = 5.0;
gtk_signal_emit_by_name( GTK_OBJECT(m_hAdjust), "changed" );
-
+
gtk_widget_show( m_wxwindow );
-
+
PostCreation();
-
+
Show( TRUE );
- return TRUE;
+ return TRUE;
}
wxWindow::~wxWindow(void)
{
m_hasVMT = FALSE;
-
+
if (m_pDropTarget) delete m_pDropTarget;
-
+
if (m_parent) m_parent->RemoveChild( this );
if (m_widget) Show( FALSE );
DestroyChildren();
-
+
if (m_wxwindow) gtk_widget_destroy( m_wxwindow );
-
+
if (m_widget) gtk_widget_destroy( m_widget );
-
+
wxDELETE(m_cursor);
DeleteRelatedConstraints();
// wxWindow::LoadNativeDialog but we weren't a dialog
// class
wxTopLevelWindows.DeleteObject(this);
-
+
if (m_windowValidator) delete m_windowValidator;
}
void wxWindow::PostCreation(void)
{
if (m_parent) m_parent->AddChild( this );
-
+
if (m_wxwindow)
{
- gtk_signal_connect( GTK_OBJECT(m_wxwindow), "expose_event",
+ gtk_signal_connect( GTK_OBJECT(m_wxwindow), "expose_event",
GTK_SIGNAL_FUNC(gtk_window_expose_callback), (gpointer)this );
-
- gtk_signal_connect( GTK_OBJECT(m_wxwindow), "draw",
+
+ gtk_signal_connect( GTK_OBJECT(m_wxwindow), "draw",
GTK_SIGNAL_FUNC(gtk_window_draw_callback), (gpointer)this );
}
-
+
ConnectWidget( GetConnectWidget() );
-
+
if (m_widget && m_parent) gtk_widget_realize( m_widget );
-
+
if (m_wxwindow)
{
gtk_widget_realize( m_wxwindow );
gdk_gc_set_exposures( m_wxwindow->style->fg_gc[0], TRUE );
}
-
+
SetCursor( *wxSTANDARD_CURSOR );
-
+
m_hasVMT = TRUE;
}
gtk_signal_connect( GTK_OBJECT(widget), "button_press_event",
GTK_SIGNAL_FUNC(gtk_window_button_press_callback), (gpointer)this );
-
+
gtk_signal_connect( GTK_OBJECT(widget), "button_release_event",
GTK_SIGNAL_FUNC(gtk_window_button_release_callback), (gpointer)this );
-
+
gtk_signal_connect( GTK_OBJECT(widget), "motion_notify_event",
GTK_SIGNAL_FUNC(gtk_window_motion_notify_callback), (gpointer)this );
-
- gtk_signal_connect( GTK_OBJECT(widget), "focus_in_event",
+
+ gtk_signal_connect( GTK_OBJECT(widget), "focus_in_event",
GTK_SIGNAL_FUNC(gtk_window_focus_in_callback), (gpointer)this );
- gtk_signal_connect( GTK_OBJECT(widget), "focus_out_event",
+ gtk_signal_connect( GTK_OBJECT(widget), "focus_out_event",
GTK_SIGNAL_FUNC(gtk_window_focus_out_callback), (gpointer)this );
- gtk_signal_connect( GTK_OBJECT(widget), "enter_notify_event",
+ gtk_signal_connect( GTK_OBJECT(widget), "enter_notify_event",
GTK_SIGNAL_FUNC(gtk_window_enter_callback), (gpointer)this );
-
- gtk_signal_connect( GTK_OBJECT(widget), "leave_notify_event",
+
+ gtk_signal_connect( GTK_OBJECT(widget), "leave_notify_event",
GTK_SIGNAL_FUNC(gtk_window_leave_callback), (gpointer)this );
}
bool wxWindow::Close( bool force )
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
wxCloseEvent event(wxEVT_CLOSE_WINDOW, m_windowId);
event.SetEventObject(this);
event.SetForce(force);
bool wxWindow::Destroy(void)
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
m_hasVMT = FALSE;
delete this;
return TRUE;
bool wxWindow::DestroyChildren(void)
{
- if (GetChildren())
+ if (GetChildren())
{
wxNode *node;
- while ((node = GetChildren()->First()) != (wxNode *)NULL)
+ while ((node = GetChildren()->First()) != (wxNode *)NULL)
{
wxWindow *child;
- if ((child = (wxWindow *)node->Data()) != (wxWindow *)NULL)
+ if ((child = (wxWindow *)node->Data()) != (wxWindow *)NULL)
{
delete child;
if (GetChildren()->Member(child)) delete node;
}
void wxWindow::ImplementSetSize(void)
-{
+{
if ((m_minWidth != -1) && (m_width < m_minWidth)) m_width = m_minWidth;
if ((m_minHeight != -1) && (m_height < m_minHeight)) m_height = m_minHeight;
if ((m_maxWidth != -1) && (m_width > m_maxWidth)) m_width = m_minWidth;
gtk_widget_set_uposition( m_widget, m_x, m_y );
return;
}
-
+
if (!m_parent)
{
wxFAIL_MSG( "wxWindow::SetSize error.\n" );
return;
}
-
+
if ((m_parent) && (m_parent->m_wxwindow))
gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), m_widget, m_x, m_y );
-
- // Don't do anything for children of wxNotebook and wxMDIChildFrame
+
+ // Don't do anything for children of wxNotebook and wxMDIChildFrame
}
void wxWindow::SetSize( int x, int y, int width, int height, int sizeFlags )
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
if (m_resizing) return; // I don't like recursions
m_resizing = TRUE;
-
+
int newX = x;
int newY = y;
int newW = width;
int newH = height;
-
+
if ((sizeFlags & wxSIZE_USE_EXISTING) == wxSIZE_USE_EXISTING)
{
if (newX == -1) newX = m_x;
if (newW == -1) newW = m_width;
if (newH == -1) newH = m_height;
}
-
+
if ((sizeFlags & wxSIZE_AUTO_WIDTH) == wxSIZE_AUTO_WIDTH)
{
if (newW == -1) newW = 80;
}
-
+
if ((sizeFlags & wxSIZE_AUTO_HEIGHT) == wxSIZE_AUTO_HEIGHT)
{
if (newH == -1) newH = 26;
}
-
+
if ((m_x != newX) || (m_y != newY) || (!m_sizeSet))
{
m_x = newX;
ImplementSetSize();
}
m_sizeSet = TRUE;
-
+
wxSizeEvent event( wxSize(m_width,m_height), GetId() );
event.SetEventObject( this );
ProcessEvent( event );
-
+
m_resizing = FALSE;
}
void wxWindow::GetSize( int *width, int *height ) const
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
if (width) (*width) = m_width;
if (height) (*height) = m_height;
}
void wxWindow::SetClientSize( int width, int height )
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
if (!m_wxwindow)
{
SetSize( width, height );
{
int dw = 0;
int dh = 0;
-
+
if (!m_hasScrolling)
{
/*
do we have sunken dialogs ?
-
+
GtkStyleClass *window_class = m_wxwindow->style->klass;
-
+
dw += 2 * window_class->xthickness;
dh += 2 * window_class->ythickness;
*/
{
GtkScrolledWindow *scroll_window = GTK_SCROLLED_WINDOW(m_widget);
GtkScrolledWindowClass *scroll_class = GTK_SCROLLED_WINDOW_CLASS( GTK_OBJECT(m_widget)->klass );
-
+
GtkWidget *viewport = scroll_window->viewport;
GtkStyleClass *viewport_class = viewport->style->klass;
-
+
GtkWidget *hscrollbar = scroll_window->hscrollbar;
GtkWidget *vscrollbar = scroll_window->vscrollbar;
-
+
if ((m_windowStyle & wxRAISED_BORDER) ||
(m_windowStyle & wxSUNKEN_BORDER))
{
dw += 2 * viewport_class->xthickness;
dh += 2 * viewport_class->ythickness;
}
-
+
if (GTK_WIDGET_VISIBLE(vscrollbar))
{
dw += vscrollbar->allocation.width;
dw += scroll_class->scrollbar_spacing;
}
-
+
if (GTK_WIDGET_VISIBLE(hscrollbar))
{
dh += hscrollbar->allocation.height;
dw += scroll_class->scrollbar_spacing;
}
}
-
+
SetSize( width+dw, height+dh );
}
}
void wxWindow::GetClientSize( int *width, int *height ) const
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
if (!m_wxwindow)
{
if (width) (*width) = m_width;
{
int dw = 0;
int dh = 0;
-
+
if (!m_hasScrolling)
{
/*
do we have sunken dialogs ?
-
+
GtkStyleClass *window_class = m_wxwindow->style->klass;
-
+
dw += 2 * window_class->xthickness;
dh += 2 * window_class->ythickness;
*/
{
GtkScrolledWindow *scroll_window = GTK_SCROLLED_WINDOW(m_widget);
GtkScrolledWindowClass *scroll_class = GTK_SCROLLED_WINDOW_CLASS( GTK_OBJECT(m_widget)->klass );
-
+
GtkWidget *viewport = scroll_window->viewport;
GtkStyleClass *viewport_class = viewport->style->klass;
-
+
GtkWidget *hscrollbar = scroll_window->hscrollbar;
GtkWidget *vscrollbar = scroll_window->vscrollbar;
-
+
if ((m_windowStyle & wxRAISED_BORDER) ||
(m_windowStyle & wxSUNKEN_BORDER))
{
dw += 2 * viewport_class->xthickness;
dh += 2 * viewport_class->ythickness;
}
-
+
if (GTK_WIDGET_VISIBLE(vscrollbar))
{
// dw += vscrollbar->allocation.width;
dw += 15; // range.slider_width = 11 + 2*2pts edge
dw += scroll_class->scrollbar_spacing;
}
-
+
if (GTK_WIDGET_VISIBLE(hscrollbar))
{
// dh += hscrollbar->allocation.height;
dh += scroll_class->scrollbar_spacing;
}
}
-
+
if (width) (*width) = m_width - dw;
if (height) (*height) = m_height - dh;
}
void wxWindow::GetPosition( int *x, int *y ) const
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
if (x) (*x) = m_x;
if (y) (*y) = m_y;
}
void wxWindow::ClientToScreen( int *x, int *y )
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
GdkWindow *source = (GdkWindow *) NULL;
if (m_wxwindow)
source = m_wxwindow->window;
else
source = m_widget->window;
-
+
int org_x = 0;
int org_y = 0;
gdk_window_get_origin( source, &org_x, &org_y );
if (!m_wxwindow)
- {
+ {
if (GTK_WIDGET_NO_WINDOW (m_widget))
{
org_x += m_widget->allocation.x;
org_y += m_widget->allocation.y;
}
}
-
- if (x) *x += org_x;
- if (y) *y += org_y;
+
+ if (x) *x += org_x;
+ if (y) *y += org_y;
}
void wxWindow::ScreenToClient( int *x, int *y )
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
GdkWindow *source = (GdkWindow *) NULL;
if (m_wxwindow)
source = m_wxwindow->window;
else
source = m_widget->window;
-
+
int org_x = 0;
int org_y = 0;
gdk_window_get_origin( source, &org_x, &org_y );
if (!m_wxwindow)
- {
+ {
if (GTK_WIDGET_NO_WINDOW (m_widget))
{
org_x += m_widget->allocation.x;
org_y += m_widget->allocation.y;
}
}
-
- if (x) *x -= org_x;
- if (y) *y -= org_y;
+
+ if (x) *x -= org_x;
+ if (y) *y -= org_y;
}
void wxWindow::Centre( int direction )
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
if (IS_KIND_OF(this,wxDialog) || IS_KIND_OF(this,wxFrame))
{
if (direction & wxHORIZONTAL == wxHORIZONTAL) m_x = (gdk_screen_width () - m_width) / 2;
void wxWindow::Fit(void)
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
int maxX = 0;
int maxY = 0;
wxNode *node = GetChildren()->First();
void wxWindow::SetSizeHints( int minW, int minH, int maxW, int maxH, int WXUNUSED(incW), int WXUNUSED(incH) )
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
m_minWidth = minW;
m_minHeight = minH;
m_maxWidth = maxW;
bool wxWindow::Show( bool show )
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
if (show)
gtk_widget_show( m_widget );
else
gtk_widget_hide( m_widget );
- m_isShown = show;
+ m_isShown = show;
return TRUE;
}
void wxWindow::Enable( bool enable )
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
m_isEnabled = enable;
gtk_widget_set_sensitive( m_widget, enable );
if (m_wxwindow) gtk_widget_set_sensitive( m_wxwindow, enable );
int wxWindow::GetCharHeight(void) const
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
if (!m_font.Ok())
{
wxFAIL_MSG( "invalid font" );
return -1;
}
-
+
GdkFont *font = m_font.GetInternalFont( 1.0 );
return font->ascent + font->descent;
}
int wxWindow::GetCharWidth(void) const
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
if (!m_font.Ok())
{
wxFAIL_MSG( "invalid font" );
return -1;
}
-
+
GdkFont *font = m_font.GetInternalFont( 1.0 );
return gdk_string_width( font, "H" );
}
int *descent, int *externalLeading, const wxFont *theFont, bool WXUNUSED(use16) ) const
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
wxFont fontToUse = m_font;
if (theFont) fontToUse = *theFont;
-
+
if (!fontToUse.Ok())
{
wxFAIL_MSG( "invalid font" );
return;
}
wxASSERT_MSG( (m_font.Ok()), "invalid font" );
-
+
GdkFont *font = fontToUse.GetInternalFont( 1.0 );
if (x) (*x) = gdk_string_width( font, string );
if (y) (*y) = font->ascent + font->descent;
void wxWindow::SetFocus(void)
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
GtkWidget *connect_widget = GetConnectWidget();
if (connect_widget)
{
wxASSERT_MSG( (m_wxwindow != NULL), "window need client area" );
wxASSERT_MSG( (child != NULL), "invalid child" );
wxASSERT_MSG( (child->m_widget != NULL), "invalid child" );
-
+
// Addchild is (often) called before the program
// has left the parents constructor so that no
// virtual tables work yet. The approach below
// practically imitates virtual tables, i.e. it
// implements a different AddChild() behaviour
- // for wxFrame, wxDialog, wxWindow and
+ // for wxFrame, wxDialog, wxWindow and
// wxMDIParentFrame.
// wxFrame and wxDialog as children aren't placed into the parents
-
+
if (( IS_KIND_OF(child,wxFrame) || IS_KIND_OF(child,wxDialog) ) &&
(!IS_KIND_OF(child,wxMDIChildFrame)))
{
m_children.Append( child );
-
+
if ((child->m_x != -1) && (child->m_y != -1))
gtk_widget_set_uposition( child->m_widget, child->m_x, child->m_y );
-
+
return;
}
-
- // In the case of an wxMDIChildFrame descendant, we use the
+
+ // In the case of an wxMDIChildFrame descendant, we use the
// client windows's AddChild()
-
+
if (IS_KIND_OF(this,wxMDIParentFrame))
{
if (IS_KIND_OF(child,wxMDIChildFrame))
{
wxMDIClientWindow *client = ((wxMDIParentFrame*)this)->GetClientWindow();
if (client)
- {
+ {
client->AddChild( child );
return;
}
}
}
-
+
// wxNotebook is very special, so it has a private AddChild()
-
+
if (IS_KIND_OF(this,wxNotebook))
{
wxNotebook *tab = (wxNotebook*)this;
tab->AddChild( child );
return;
}
-
+
// wxFrame has a private AddChild
-
+
if (IS_KIND_OF(this,wxFrame) && !IS_KIND_OF(this,wxMDIChildFrame))
{
wxFrame *frame = (wxFrame*)this;
frame->AddChild( child );
return;
}
-
+
// All the rest
-
+
m_children.Append( child );
- if (m_wxwindow) gtk_myfixed_put( GTK_MYFIXED(m_wxwindow), child->m_widget,
+ if (m_wxwindow) gtk_myfixed_put( GTK_MYFIXED(m_wxwindow), child->m_widget,
child->m_x, child->m_y );
-
+
gtk_widget_set_usize( child->m_widget, child->m_width, child->m_height );
}
void wxWindow::Raise(void)
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
if (m_widget) gdk_window_raise( m_widget->window );
}
void wxWindow::Lower(void)
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
if (m_widget) gdk_window_lower( m_widget->window );
}
void wxWindow::SetCursor( const wxCursor &cursor )
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
if (m_cursor == NULL)
{
wxFAIL_MSG( "wxWindow::SetCursor m_cursor == NULL" );
m_cursor = new wxCursor( wxCURSOR_ARROW );
}
-
+
if (cursor.Ok())
{
if (*((wxCursor*)&cursor) == m_cursor) return;
if ((m_widget) && (m_widget->window))
gdk_window_set_cursor( m_widget->window, m_cursor->GetCursor() );
-
+
if ((m_wxwindow) && (m_wxwindow->window))
gdk_window_set_cursor( m_wxwindow->window, m_cursor->GetCursor() );
}
void wxWindow::Refresh( bool eraseBackground, const wxRect *rect )
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
if (eraseBackground && m_wxwindow && m_wxwindow->window)
{
if (rect)
- gdk_window_clear_area( m_wxwindow->window,
- rect->x,
- rect->y,
- rect->width,
+ gdk_window_clear_area( m_wxwindow->window,
+ rect->x,
+ rect->y,
+ rect->width,
rect->height );
else
- Clear();
+ Clear();
}
if (!rect)
{
int w = 0;
int h = 0;
GetClientSize( &w, &h );
-
+
GdkRectangle gdk_rect;
gdk_rect.x = 0;
gdk_rect.y = 0;
gdk_rect.y = rect->y;
gdk_rect.width = rect->width;
gdk_rect.height = rect->height;
-
+
if (m_wxwindow)
gtk_widget_draw( m_wxwindow, &gdk_rect );
else
void wxWindow::Clear(void)
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
if (m_wxwindow && m_wxwindow->window) gdk_window_clear( m_wxwindow->window );
}
void wxWindow::SetBackgroundColour( const wxColour &colour )
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
m_backgroundColour = colour;
if (m_wxwindow)
{
bool wxWindow::Validate(void)
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
wxNode *node = GetChildren()->First();
while (node)
{
wxWindow *child = (wxWindow *)node->Data();
- if (child->GetValidator() && /* child->GetValidator()->Ok() && */ !child->GetValidator()->Validate(this))
+ if (child->GetValidator() && /* child->GetValidator()->Ok() && */ !child->GetValidator()->Validate(this))
{ return FALSE; }
node = node->Next();
}
bool wxWindow::TransferDataToWindow(void)
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
wxNode *node = GetChildren()->First();
while (node)
{
bool wxWindow::TransferDataFromWindow(void)
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
wxNode *node = GetChildren()->First();
while (node)
{
void wxWindow::InitDialog(void)
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
wxInitDialogEvent event(GetId());
event.SetEventObject( this );
GetEventHandler()->ProcessEvent(event);
bool wxWindow::PopupMenu( wxMenu *menu, int WXUNUSED(x), int WXUNUSED(y) )
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
SetInvokingWindow( menu, this );
- gtk_menu_popup( GTK_MENU(menu->m_menu), (GtkWidget *) NULL, (GtkWidget *) NULL, (GtkMenuPositionFunc) NULL, NULL, 0, 0 );
+ gtk_menu_popup(
+ GTK_MENU(menu->m_menu),
+ (GtkWidget *)NULL, // parent menu shell
+ (GtkWidget *)NULL, // parent menu item
+ (GtkMenuPositionFunc)NULL,
+ NULL, // client data
+ 0, // button used to activate it
+ 0//gs_timeLastClick // the time of activation
+ );
return TRUE;
}
void wxWindow::SetDropTarget( wxDropTarget *dropTarget )
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
GtkWidget *dnd_widget = GetConnectWidget();
-
+
DisconnectDnDWidget( dnd_widget );
-
+
if (m_pDropTarget) delete m_pDropTarget;
m_pDropTarget = dropTarget;
-
+
ConnectDnDWidget( dnd_widget );
}
void wxWindow::ConnectDnDWidget( GtkWidget *widget )
{
if (!m_pDropTarget) return;
-
+
m_pDropTarget->RegisterWidget( widget );
-
+
gtk_signal_connect( GTK_OBJECT(widget), "drop_data_available_event",
GTK_SIGNAL_FUNC(gtk_window_drop_callback), (gpointer)this );
}
void wxWindow::DisconnectDnDWidget( GtkWidget *widget )
{
if (!m_pDropTarget) return;
-
+
gtk_signal_disconnect_by_func( GTK_OBJECT(widget),
GTK_SIGNAL_FUNC(gtk_window_drop_callback), (gpointer)this );
-
+
m_pDropTarget->UnregisterWidget( widget );
}
{
GtkWidget *connect_widget = m_widget;
if (m_wxwindow) connect_widget = m_wxwindow;
-
+
return connect_widget;
}
-
+
bool wxWindow::IsOwnGtkWindow( GdkWindow *window )
{
if (m_wxwindow) return (window == m_wxwindow->window);
void wxWindow::SetFont( const wxFont &font )
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
if (((wxFont*)&font)->Ok())
m_font = font;
else
{
style = gtk_widget_get_style( m_widget );
}
-
+
gdk_font_unref( style->font );
style->font = gdk_font_ref( m_font.GetInternalFont( 1.0 ) );
-
+
gtk_widget_set_style( m_widget, style );
}
void wxWindow::CaptureMouse(void)
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
wxASSERT_MSG( (g_capturing == FALSE), "CaptureMouse called twice" );
-
+
GtkWidget *connect_widget = GetConnectWidget();
gtk_grab_add( connect_widget );
gdk_pointer_grab ( connect_widget->window, FALSE,
(GdkEventMask)
- (GDK_BUTTON_PRESS_MASK |
+ (GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK |
- GDK_POINTER_MOTION_MASK),
+ GDK_POINTER_MOTION_MASK),
(GdkWindow *) NULL, (GdkCursor *) NULL, GDK_CURRENT_TIME );
g_capturing = TRUE;
}
void wxWindow::ReleaseMouse(void)
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
wxASSERT_MSG( (g_capturing == TRUE), "ReleaseMouse called twice" );
-
+
GtkWidget *connect_widget = GetConnectWidget();
gtk_grab_remove( connect_widget );
gdk_pointer_ungrab ( GDK_CURRENT_TIME );
int range, bool refresh )
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
wxASSERT_MSG( (m_wxwindow != NULL), "window needs client area" );
-
+
if (!m_wxwindow) return;
if (orient == wxHORIZONTAL)
float fpos = (float)pos;
float frange = (float)range;
float fthumb = (float)thumbVisible;
-
+
if ((fabs(frange-m_hAdjust->upper) < 0.2) &&
(fabs(fthumb-m_hAdjust->page_size) < 0.2))
{
SetScrollPos( orient, pos, refresh );
return;
}
-
+
m_oldHorizontalPos = fpos;
-
+
m_hAdjust->lower = 0.0;
m_hAdjust->upper = frange;
m_hAdjust->value = fpos;
float fpos = (float)pos;
float frange = (float)range;
float fthumb = (float)thumbVisible;
-
+
if ((fabs(frange-m_vAdjust->upper) < 0.2) &&
(fabs(fthumb-m_vAdjust->page_size) < 0.2))
{
SetScrollPos( orient, pos, refresh );
return;
}
-
+
m_oldVerticalPos = fpos;
-
+
m_vAdjust->lower = 0.0;
m_vAdjust->upper = frange;
m_vAdjust->value = fpos;
m_vAdjust->page_increment = (float)(wxMax(fthumb,0));
m_vAdjust->page_size = fthumb;
}
-
+
if (m_wxwindow->window)
{
if (orient == wxHORIZONTAL)
gtk_signal_emit_by_name( GTK_OBJECT(m_hAdjust), "changed" );
else
gtk_signal_emit_by_name( GTK_OBJECT(m_vAdjust), "changed" );
-
+
gtk_widget_set_usize( m_widget, m_width, m_height );
}
}
void wxWindow::SetScrollPos( int orient, int pos, bool WXUNUSED(refresh) )
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
wxASSERT_MSG( (m_wxwindow != NULL), "window needs client area" );
-
+
if (!m_wxwindow) return;
-
+
if (orient == wxHORIZONTAL)
{
float fpos = (float)pos;
if (fabs(fpos-m_vAdjust->value) < 0.2) return;
m_vAdjust->value = fpos;
}
-
+
if (!m_isScrolling)
{
if (m_wxwindow->window)
- {
+ {
if (orient == wxHORIZONTAL)
gtk_signal_emit_by_name( GTK_OBJECT(m_hAdjust), "value_changed" );
- else
+ else
gtk_signal_emit_by_name( GTK_OBJECT(m_vAdjust), "value_changed" );
}
}
int wxWindow::GetScrollThumb( int orient ) const
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
wxASSERT_MSG( (m_wxwindow != NULL), "window needs client area" );
-
+
if (!m_wxwindow) return 0;
if (orient == wxHORIZONTAL)
int wxWindow::GetScrollPos( int orient ) const
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
wxASSERT_MSG( (m_wxwindow != NULL), "window needs client area" );
-
+
if (!m_wxwindow) return 0;
if (orient == wxHORIZONTAL)
int wxWindow::GetScrollRange( int orient ) const
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
wxASSERT_MSG( (m_wxwindow != NULL), "window needs client area" );
-
+
if (!m_wxwindow) return 0;
if (orient == wxHORIZONTAL)
void wxWindow::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) )
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
-
+
wxASSERT_MSG( (m_wxwindow != NULL), "window needs client area" );
-
+
if (!m_wxwindow) return;
int cw = 0;
int ch = 0;
GetClientSize( &cw, &ch );
-
+
int w = cw - abs(dx);
int h = ch - abs(dy);
if ((h < 0) || (w < 0))
if (dy > 0) d_y = dy;
gdk_window_copy_area( m_wxwindow->window, m_wxwindow->style->fg_gc[0], d_x, d_y,
m_wxwindow->window, s_x, s_y, w, h );
-
+
wxRect rect;
if (dx < 0) rect.x = cw+dx; else rect.x = 0;
if (dy < 0) rect.y = ch+dy; else rect.y = 0;
if (dy != 0) rect.width = cw; else rect.width = abs(dx);
if (dx != 0) rect.height = ch; else rect.height = abs(dy);
-
+
Refresh( TRUE, &rect );
}
GetConstraints()->width.SetValue(w);
GetConstraints()->height.SetValue(h);
}
-
+
// If top level (one sizer), evaluate the sizer's constraints.
if (GetSizer())
{
bool wxWindow::LayoutPhase2(int *noChanges)
{
*noChanges = 0;
-
+
// Layout children
DoPhase(1);
DoPhase(2);
if (!m_sizerParent || m_sizerParent->IsKindOf(CLASSINFO(wxDialog)) ||
m_sizerParent->IsKindOf(CLASSINFO(wxFrame)) )
return;
-
+
int xp, yp;
m_sizerParent->GetPosition(&xp, &yp);
m_sizerParent->TransformSizerToActual(&xp, &yp);
#include "wx/module.h"
#include "wx/memory.h"
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
#include "wx/resource.h"
#endif
-#if USE_POSTSCRIPT
+#if wxUSE_POSTSCRIPT
#include "wx/postscrp.h"
#endif
wxBuffer = new char[BUFSIZ + 512];
#endif
-#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
+#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
streambuf* sBuf = new wxDebugStreamBuf;
ostream* oStr = new ostream(sBuf) ;
wxTheColourDatabase->Initialize();
wxInitializeStockObjects();
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
wxInitializeResourceSystem();
#endif
// For PostScript printing
-#if USE_POSTSCRIPT
+#if wxUSE_POSTSCRIPT
wxInitializePrintSetupData();
wxThePrintPaperDatabase = new wxPrintPaperDatabase;
wxThePrintPaperDatabase->CreateDatabase();
wxModule::CleanUpModules();
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
wxCleanUpResourceSystem();
#endif
delete wxTheColourDatabase;
wxTheColourDatabase = NULL;
-#if USE_POSTSCRIPT
+#if wxUSE_POSTSCRIPT
wxInitializePrintSetupData(FALSE);
delete wxThePrintPaperDatabase;
wxThePrintPaperDatabase = NULL;
delete wxTheApp;
wxTheApp = NULL;
-#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
+#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
// At this point we want to check if there are any memory
// blocks that aren't part of the wxDebugContext itself,
// as a special case. Then when dumping we need to ignore
const char *wxFloatToStringStr = "%.2f";
const char *wxDoubleToStringStr = "%.2f";
-#if USE_POSTSCRIPT
+#if wxUSE_POSTSCRIPT
wxPrintPaperDatabase* wxThePrintPaperDatabase = NULL;
#endif
-#if USE_SHARED_LIBRARY
+#if wxUSE_SHARED_LIBRARY
///// Event tables (also must be in one, statically-linked file for shared libraries)
// This is the base, wxEvtHandler 'bootstrap' code which is expanded manually here
wxList wxModelessWindows; // Frames and modeless dialogs
extern wxList wxPendingDelete;
-#define USE_INVISIBLE_RESIZE 1
+#define wxUSE_INVISIBLE_RESIZE 1
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxDialog, wxPanel)
IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxWindow)
#endif
-#if USE_NATIVE_STATUSBAR
+#if wxUSE_NATIVE_STATUSBAR
bool wxFrame::m_useNativeStatusBar = TRUE;
#else
bool wxFrame::m_useNativeStatusBar = FALSE;
void wxFrame::OnSize(wxSizeEvent& event)
{
// if we're using constraints - do use them
- #if USE_CONSTRAINTS
+ #if wxUSE_CONSTRAINTS
if ( GetAutoLayout() ) {
Layout();
return;
void wxMDIParentFrame::OnSize(wxSizeEvent& event)
{
-#if USE_CONSTRAINTS
+#if wxUSE_CONSTRAINTS
if (GetAutoLayout())
Layout();
#endif
XmString label_str = XmStringCreateSimple (wxBuffer);
buttonWidget = XtVaCreateManagedWidget (wxBuffer,
-#if USE_GADGETS
+#if wxUSE_GADGETS
xmCascadeButtonGadgetClass, (Widget) parent,
#else
xmCascadeButtonWidgetClass, (Widget) parent,
}
// Reading and writing resources (eg WIN.INI, .Xdefaults)
-#if USE_RESOURCES
+#if wxUSE_RESOURCES
bool wxWriteResource(const wxString& section, const wxString& entry, const wxString& value, const wxString& file)
{
// TODO
}
else return FALSE;
}
-#endif // USE_RESOURCES
+#endif // wxUSE_RESOURCES
static int wxBusyCursorCount = 0;
#include "wx/menuitem.h"
#include "wx/log.h"
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
#include "wx/dnd.h"
#endif
m_defaultForegroundColour = *wxBLACK ;
m_defaultBackgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE) ;
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
m_pDropTarget = NULL;
#endif
// Have to delete constraints/sizer FIRST otherwise
// sizers may try to look at deleted windows as they
// delete themselves.
-#if USE_CONSTRAINTS
+#if wxUSE_CONSTRAINTS
DeleteRelatedConstraints();
if (m_constraints)
{
m_sizerParent = NULL;
m_autoLayout = FALSE;
m_windowValidator = NULL;
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
m_pDropTarget = NULL;
#endif
m_caretWidth = 0; m_caretHeight = 0;
return NULL;
}
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
void wxWindow::SetDropTarget(wxDropTarget *pDropTarget)
{
#include "wx/log.h"
#include "wx/module.h"
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
#include "wx/resource.h"
#endif
#endif // debug build under MS VC++
*/
- #if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
+ #if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
#if defined(_WINDLL)
streambuf* sBuf = NULL;
#else // EXE
ostream* oStr = new ostream(sBuf) ;
wxDebugContext::SetStream(oStr, sBuf);
- #endif // USE_MEMORY_TRACING
+ #endif // wxUSE_MEMORY_TRACING
wxClassInfo::InitializeClasses();
- #if USE_RESOURCES
+ #if wxUSE_RESOURCES
wxGetResource("wxWindows", "OsVersion", &wxOsVersion);
#endif
wxInitializeStockLists();
wxInitializeStockObjects();
- #if USE_WX_RESOURCES
+ #if wxUSE_WX_RESOURCES
wxInitializeResourceSystem();
#endif
// For PostScript printing
- #if USE_POSTSCRIPT
+ #if wxUSE_POSTSCRIPT
wxInitializePrintSetupData();
wxThePrintPaperDatabase = new wxPrintPaperDatabase;
wxThePrintPaperDatabase->CreateDatabase();
wxDisableButtonBrush = ::CreateBrushIndirect( & lb ) ;
::DeleteObject( (HGDIOBJ)lb.lbHatch ) ;
- #if USE_PENWINDOWS
+ #if wxUSE_PENWINDOWS
wxRegisterPenWin();
#endif
//// COMMON CLEANUP
wxModule::CleanUpModules();
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
wxCleanUpResourceSystem();
// wxDefaultResourceTable->ClearTable();
delete wxTheColourDatabase;
wxTheColourDatabase = NULL;
-#if USE_POSTSCRIPT
+#if wxUSE_POSTSCRIPT
wxInitializePrintSetupData(FALSE);
delete wxThePrintPaperDatabase;
wxThePrintPaperDatabase = NULL;
FreeLibrary(gs_hRichEdit);
#endif
-#if USE_PENWINDOWS
+#if wxUSE_PENWINDOWS
wxCleanUpPenWin();
#endif
delete wxTheApp;
wxTheApp = NULL;
-#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
+#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
// At this point we want to check if there are any memory
// blocks that aren't part of the wxDebugContext itself,
// as a special case. Then when dumping we need to ignore
#include "assert.h"
-#if USE_XPM_IN_MSW
+#if wxUSE_XPM_IN_MSW
#define FOR_MSW 1
#include "../../contrib/wxxpm/libxpm.34b/lib/xpm34.h"
#endif
wxTheBitmapList->AddBitmap(this);
}
-#if USE_XPM_IN_MSW
+#if wxUSE_XPM_IN_MSW
// Create from data
wxBitmap::wxBitmap(const char **data, wxItem *WXUNUSED(anItem))
{
bool wxBMPFileHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
int desiredWidth, int desiredHeight)
{
-#if USE_IMAGE_LOADING_IN_MSW
+#if wxUSE_IMAGE_LOADING_IN_MSW
wxPalette *palette = NULL;
bool success = FALSE;
/*
bool wxBMPFileHandler::SaveFile(wxBitmap *bitmap, const wxString& name, int type, const wxPalette *pal)
{
-#if USE_IMAGE_LOADING_IN_MSW
+#if wxUSE_IMAGE_LOADING_IN_MSW
wxPalette *actualPalette = (wxPalette *)pal;
if (!actualPalette && (!M_BITMAPHANDLERDATA->m_bitmapPalette.IsNull()))
actualPalette = & (M_BITMAPHANDLERDATA->m_bitmapPalette);
bool wxXPMFileHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
int desiredWidth, int desiredHeight)
{
-#if USE_XPM_IN_MSW
+#if wxUSE_XPM_IN_MSW
XImage *ximage;
XpmAttributes xpmAttr;
HDC dc;
bool wxXPMFileHandler::SaveFile(wxBitmap *bitmap, const wxString& name, int type, const wxPalette *palette)
{
-#if USE_XPM_IN_MSW
+#if wxUSE_XPM_IN_MSW
HDC dc = NULL;
Visual *visual = NULL;
bool wxXPMDataHandler::Create(wxBitmap *bitmap, void *data, long flags, int width, int height, int depth)
{
-#if USE_XPM_IN_MSW
+#if wxUSE_XPM_IN_MSW
XImage *ximage;
int ErrorStatus;
XpmAttributes xpmAttr;
#pragma hdrstop
#endif
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
#include <windows.h>
#include "wx/setup.h"
#endif
-#if USE_CLIPBOARD
+#if wxUSE_CLIPBOARD
#ifndef WX_PRECOMP
#include "wx/app.h"
}
case wxDF_DIB:
{
-#if USE_IMAGE_LOADING_IN_MSW
+#if wxUSE_IMAGE_LOADING_IN_MSW
HBITMAP hBitmap=(HBITMAP) ((wxBitmap *)obj)->GetHBITMAP();
HANDLE hDIB=BitmapToDIB(hBitmap,NULL); // NULL==uses system palette
bool success = (::SetClipboardData(CF_DIB,hDIB) != 0);
return success;
break;
}
-#if USE_METAFILE
+#if wxUSE_METAFILE
case wxDF_METAFILE:
{
wxMetaFile *wxMF = (wxMetaFile *)obj;
}
-#endif // USE_CLIPBOARD
+#endif // wxUSE_CLIPBOARD
#include "wx/setup.h"
#endif
-#if USE_COMBOBOX
+#if wxUSE_COMBOBOX
#include "wx/combobox.h"
#include "wx/clipbrd.h"
void wxComboBox::Replace(long from, long to, const wxString& value)
{
-#if USE_CLIPBOARD
+#if wxUSE_CLIPBOARD
HWND hWnd = (HWND) GetHWND();
long fromChar = from;
long toChar = to;
}
#endif
- // USE_COMBOBOX
+ // wxUSE_COMBOBOX
#include "assert.h"
-#if USE_XPM_IN_MSW
+#if wxUSE_XPM_IN_MSW
#define FOR_MSW 1
#include "..\..\contrib\wxxpm\libxpm.34b\lib\xpm34.h"
#endif
-#if USE_RESOURCE_LOADING_IN_MSW
+#if wxUSE_RESOURCE_LOADING_IN_MSW
#include "wx/msw/curico.h"
#include "wx/msw/curicop.h"
#endif
}
else if (flags & wxBITMAP_TYPE_CUR)
{
-#if USE_RESOURCE_LOADING_IN_MSW
+#if wxUSE_RESOURCE_LOADING_IN_MSW
M_CURSORDATA->m_hCursor = (WXHCURSOR) ReadCursorFile((char *)(const char *)cursor_file, wxGetInstance(), &M_CURSORDATA->m_width, &M_CURSORDATA->m_height);
M_CURSORDATA->m_destroyCursor = TRUE;
#endif
}
else if (flags & wxBITMAP_TYPE_ICO)
{
-#if USE_RESOURCE_LOADING_IN_MSW
+#if wxUSE_RESOURCE_LOADING_IN_MSW
M_CURSORDATA->m_hCursor = (WXHCURSOR) IconToCursor((char *)(const char *)cursor_file, wxGetInstance(), hotSpotX, hotSpotY, &M_CURSORDATA->m_width, &M_CURSORDATA->m_height);
M_CURSORDATA->m_destroyCursor = TRUE;
#endif
}
else if (flags & wxBITMAP_TYPE_BMP)
{
-#if USE_RESOURCE_LOADING_IN_MSW
+#if wxUSE_RESOURCE_LOADING_IN_MSW
HBITMAP hBitmap = 0;
HPALETTE hPalette = 0;
bool success = ReadDIB((char *)(const char *)cursor_file, &hBitmap, &hPalette) != 0;
const char *wxUserResourceStr = "TEXT";
#endif
-#if USE_POSTSCRIPT
+#if wxUSE_POSTSCRIPT
wxPrintPaperDatabase* wxThePrintPaperDatabase = NULL;
#endif
-#if USE_SHARED_LIBRARY
+#if wxUSE_SHARED_LIBRARY
/*
* For wxWindows to be made into a dynamic library (e.g. Sun),
* all IMPLEMENT_... macros must be in one place.
#include "wx/choice.h"
IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl)
-#if USE_CLIPBOARD
+#if wxUSE_CLIPBOARD
#include "wx/clipbrd.h"
IMPLEMENT_DYNAMIC_CLASS(wxClipboard, wxObject)
IMPLEMENT_ABSTRACT_CLASS(wxClipboardClient, wxObject)
#endif
-#if USE_COMBOBOX
+#if wxUSE_COMBOBOX
#include "wx/combobox.h"
IMPLEMENT_DYNAMIC_CLASS(wxComboBox, wxControl)
#endif
#include "wx/colordlg.h"
#include "wx/fontdlg.h"
-#if !defined(__WXMSW__) || USE_GENERIC_DIALOGS_IN_MSW
+#if !defined(__WXMSW__) || wxUSE_GENERIC_DIALOGS_IN_MSW
#include "wx/generic/colordlg.h"
#include "wx/generic/fontdlg.h"
IMPLEMENT_DYNAMIC_CLASS(wxGenericColourDialog, wxDialog)
#include "wx/helpbase.h"
IMPLEMENT_CLASS(wxHelpControllerBase, wxObject)
-#if USE_HELP
+#if wxUSE_HELP
#ifdef __WXMSW__
#include "wx/msw/helpwin.h"
IMPLEMENT_DYNAMIC_CLASS(wxList, wxObject)
IMPLEMENT_DYNAMIC_CLASS(wxStringList, wxList)
-#if USE_PRINTING_ARCHITECTURE
+#if wxUSE_PRINTING_ARCHITECTURE
#include "wx/print.h"
IMPLEMENT_DYNAMIC_CLASS(wxPrintDialog, wxDialog)
IMPLEMENT_DYNAMIC_CLASS(wxPrinterBase, wxObject)
IMPLEMENT_CLASS(wxGenericPrintSetupDialog, wxDialog)
#endif
-#if USE_POSTSCRIPT
+#if wxUSE_POSTSCRIPT
#include "wx/postscrp.h"
IMPLEMENT_DYNAMIC_CLASS(wxPostScriptDC, wxDC)
IMPLEMENT_DYNAMIC_CLASS(wxPrintSetupData, wxObject)
IMPLEMENT_DYNAMIC_CLASS(wxPrintPaperDatabase, wxList)
#endif
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
#include "wx/resource.h"
IMPLEMENT_DYNAMIC_CLASS(wxItemResource, wxObject)
IMPLEMENT_DYNAMIC_CLASS(wxResourceTable, wxHashTable)
#include "wx/process.h"
IMPLEMENT_DYNAMIC_CLASS(wxProcess, wxEvtHandler)
-#if USE_TIMEDATE
+#if wxUSE_TIMEDATE
#include "wx/date.h"
IMPLEMENT_DYNAMIC_CLASS(wxDate, wxObject)
#endif
-#if USE_DOC_VIEW_ARCHITECTURE
+#if wxUSE_DOC_VIEW_ARCHITECTURE
#include "wx/docview.h"
//IMPLEMENT_ABSTRACT_CLASS(wxDocItem, wxObject)
IMPLEMENT_ABSTRACT_CLASS(wxDocument, wxEvtHandler)
IMPLEMENT_DYNAMIC_CLASS(wxDocManager, wxEvtHandler)
IMPLEMENT_CLASS(wxDocChildFrame, wxFrame)
IMPLEMENT_CLASS(wxDocParentFrame, wxFrame)
-#if USE_PRINTING_ARCHITECTURE
+#if wxUSE_PRINTING_ARCHITECTURE
IMPLEMENT_DYNAMIC_CLASS(wxDocPrintout, wxPrintout)
#endif
IMPLEMENT_CLASS(wxCommand, wxObject)
IMPLEMENT_DYNAMIC_CLASS(wxFileHistory, wxObject)
#endif
-#if USE_CONSTRAINTS
+#if wxUSE_CONSTRAINTS
#include "wx/layout.h"
IMPLEMENT_DYNAMIC_CLASS(wxIndividualLayoutConstraint, wxObject)
IMPLEMENT_DYNAMIC_CLASS(wxLayoutConstraints, wxObject)
IMPLEMENT_DYNAMIC_CLASS(wxRowColSizer, wxSizer)
#endif
-#if USE_TOOLBAR
+#if wxUSE_TOOLBAR
#include "wx/tbarbase.h"
IMPLEMENT_DYNAMIC_CLASS(wxToolBarTool, wxObject)
IMPLEMENT_DYNAMIC_CLASS(wxToolBarBase, wxControl)
EVT_SYS_COLOUR_CHANGED(wxStatusBar::OnSysColourChanged)
END_EVENT_TABLE()
-#if USE_TIMEDATE
+#if wxUSE_TIMEDATE
#include "wx/time.h"
IMPLEMENT_DYNAMIC_CLASS(wxTime, wxObject)
#endif
#include "wx/statbox.h"
IMPLEMENT_DYNAMIC_CLASS(wxStaticBox, wxControl)
-#if USE_IPC
+#if wxUSE_IPC
#include "wx/dde.h"
IMPLEMENT_CLASS(wxServerBase, wxObject)
IMPLEMENT_CLASS(wxClientBase, wxObject)
IMPLEMENT_DYNAMIC_CLASS(wxStaticText, wxControl)
IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap, wxControl)
-#if USE_METAFILE
+#if wxUSE_METAFILE
#include "wx/metafile.h"
IMPLEMENT_DYNAMIC_CLASS(wxMetaFile, wxObject)
IMPLEMENT_ABSTRACT_CLASS(wxMetaFileDC, wxDC)
#include "wx/dirdlg.h"
#include "wx/choicdlg.h"
-#if !defined(__WXMSW__) || USE_GENERIC_DIALOGS_IN_MSW
+#if !defined(__WXMSW__) || wxUSE_GENERIC_DIALOGS_IN_MSW
#include "wx/generic/msgdlgg.h"
IMPLEMENT_CLASS(wxGenericMessageDialog, wxDialog)
#endif
IMPLEMENT_CLASS(wxMessageDialog)
#endif
-#if USE_GAUGE
+#if wxUSE_GAUGE
#ifdef __WXMOTIF__
#include "../../contrib/xmgauge/gauge.h"
#endif
EVT_ERASE_BACKGROUND(wxControl::OnEraseBackground)
END_EVENT_TABLE()
-#if !defined(__WXMSW__) || USE_GENERIC_DIALOGS_IN_MSW
+#if !defined(__WXMSW__) || wxUSE_GENERIC_DIALOGS_IN_MSW
BEGIN_EVENT_TABLE(wxGenericMessageDialog, wxDialog)
EVT_BUTTON(wxID_YES, wxGenericMessageDialog::OnYes)
EVT_BUTTON(wxID_NO, wxGenericMessageDialog::OnNo)
#include <math.h>
#include <fstream.h>
-#if USE_COMMON_DIALOGS
+#if wxUSE_COMMON_DIALOGS
#include <commdlg.h>
#endif
*height = h;
}
-#if USE_SPLINES
+#if wxUSE_SPLINES
#include "xfspline.inc"
-#endif // USE_SPLINES
+#endif // wxUSE_SPLINES
void wxDC::DrawPolygon(wxList *list, long xoffset, long yoffset,int fillStyle)
{
m_textBackgroundColour = colour;
}
-#if USE_SPLINES
+#if wxUSE_SPLINES
// Make a 3-point spline
void wxDC::DrawSpline(long x1, long y1, long x2, long y2, long x3, long y3)
{
#include <windows.h>
-#if USE_COMMON_DIALOGS
+#if wxUSE_COMMON_DIALOGS
#include <commdlg.h>
#endif
if (!file.IsNull() && file != "")
m_filename = file;
-#if USE_COMMON_DIALOGS
+#if wxUSE_COMMON_DIALOGS
if (interactive)
{
PRINTDLG pd;
#include "wx/defs.h"
#endif
-#if USE_IPC
+#if wxUSE_IPC
#ifndef WX_PRECOMP
#include "wx/utils.h"
}
#endif
- // USE_IPC
+ // wxUSE_IPC
#include "wx/msw/private.h"
-#if USE_COMMON_DIALOGS
+#if wxUSE_COMMON_DIALOGS
#include <commdlg.h>
#endif
#if !USE_SHARED_LIBRARIES
IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject)
-#if USE_PORTABLE_FONTS_IN_MSW
+#if wxUSE_PORTABLE_FONTS_IN_MSW
IMPLEMENT_DYNAMIC_CLASS(wxFontNameDirectory, wxObject)
#endif
#undef LoadAccelerators
#endif
-#if USE_NATIVE_STATUSBAR
+#if wxUSE_NATIVE_STATUSBAR
#include <wx/msw/statbr95.h>
#endif
IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxWindow)
#endif
-#if USE_NATIVE_STATUSBAR
+#if wxUSE_NATIVE_STATUSBAR
bool wxFrame::m_useNativeStatusBar = TRUE;
#else
bool wxFrame::m_useNativeStatusBar = FALSE;
{
wxStatusBar *statusBar = NULL;
-#if USE_NATIVE_STATUSBAR
+#if wxUSE_NATIVE_STATUSBAR
if (UsesNativeStatusBar())
{
statusBar = new wxStatusBar95(this, id, style);
{
// native status bar positions itself
if (m_frameStatusBar
-#if USE_NATIVE_STATUSBAR
+#if wxUSE_NATIVE_STATUSBAR
&& !m_frameStatusBar->IsKindOf(CLASSINFO(wxStatusBar95))
#endif
)
// Keep this in wxFrame because it saves recoding this function
// in wxTinyFrame
-#if USE_ITSY_BITSY
+#if wxUSE_ITSY_BITSY
if (style & wxTINY_CAPTION_VERT)
msflags |= IBS_VERTCAPTION;
if (style & wxTINY_CAPTION_HORIZ)
if (!m_iconized)
{
// forward WM_SIZE to status bar control
-#if USE_NATIVE_STATUSBAR
+#if wxUSE_NATIVE_STATUSBAR
if (m_frameStatusBar && m_frameStatusBar->IsKindOf(CLASSINFO(wxStatusBar95)))
{
wxSizeEvent event(wxSize(x, y), m_frameStatusBar->GetId());
void wxFrame::OnSize(wxSizeEvent& event)
{
// if we're using constraints - do use them
- #if USE_CONSTRAINTS
+ #if wxUSE_CONSTRAINTS
if ( GetAutoLayout() ) {
Layout();
return;
#include "wx/defs.h"
#endif
-#if USE_GAUGE && defined(__WIN95__)
+#if wxUSE_GAUGE && defined(__WIN95__)
#include "wx/msw/gauge95.h"
#include "wx/msw/private.h"
m_backgroundColour = col ;
}
-#endif // USE_GAUGE
+#endif // wxUSE_GAUGE
#include "wx/defs.h"
#endif
-#if USE_GAUGE
+#if wxUSE_GAUGE
#include "wx/msw/gaugemsw.h"
#include "wx/msw/private.h"
/** EOF: zyzgauge.c **/
-#endif // USE_GAUGE
+#endif // wxUSE_GAUGE
#include "wx/msw/helpwin.h"
-#if USE_HELP
+#if wxUSE_HELP
#include <time.h>
#ifdef __WXMSW__
{
}
-#endif // USE_HELP
+#endif // wxUSE_HELP
#include "wx/msw/private.h"
#include "assert.h"
-#if USE_XPM_IN_MSW
+#if wxUSE_XPM_IN_MSW
#define FOR_MSW 1
#include "..\..\contrib\wxxpm\libxpm.34b\lib\xpm34.h"
#endif
-#if USE_RESOURCE_LOADING_IN_MSW
+#if wxUSE_RESOURCE_LOADING_IN_MSW
#include "wx/msw/curico.h"
#include "wx/msw/curicop.h"
#endif
bool wxICOFileHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
int desiredWidth, int desiredHeight)
{
-#if USE_RESOURCE_LOADING_IN_MSW
+#if wxUSE_RESOURCE_LOADING_IN_MSW
if ( bitmap->IsKindOf(CLASSINFO(wxIcon)) )
{
wxIcon *icon = (wxIcon *)bitmap;
#undef GetCharWidth
#endif
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
#include "wx/ownerdrw.h"
#endif
// list box item declaration and implementation
// ============================================================================
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
class wxListBoxItem : public wxOwnerDrawn
{
if (m_windowStyle & wxLB_SORT)
wstyle |= LBS_SORT;
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
if ( m_windowStyle & wxLB_OWNERDRAW ) {
// we don't support LBS_OWNERDRAWVARIABLE yet
wstyle |= LBS_OWNERDRAWFIXED;
SendMessage(wx_list, LB_ADDSTRING, 0, (LPARAM)(const char *)choices[ui]);
}
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
if ( m_windowStyle & wxLB_OWNERDRAW ) {
for (ui = 0; ui < (size_t)n; ui++) {
// create new item which will process WM_{DRAW|MEASURE}ITEM messages
wxListBox::~wxListBox(void)
{
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
size_t uiCount = m_aItems.Count();
while ( uiCount-- != 0 ) {
delete m_aItems[uiCount];
int index = ListBox_AddString(hwnd, item);
m_noItems ++;
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
if ( m_windowStyle & wxLB_OWNERDRAW ) {
wxOwnerDrawn *pNewItem = CreateItem(-1); // dummy argument
pNewItem->SetName(item);
int index = ListBox_AddString(hwnd, item);
m_noItems ++;
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
if ( m_windowStyle & wxLB_OWNERDRAW ) {
// client data must be pointer to wxOwnerDrawn, otherwise we would crash
// in OnMeasure/OnDraw.
}
m_noItems = n;
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
if ( m_windowStyle & wxLB_OWNERDRAW ) {
// first delete old items
size_t ui = m_aItems.Count();
ListBox_InsertString(hwnd, i + pos, items[i]);
m_noItems += nItems;
- #if USE_OWNER_DRAWN
+ #if wxUSE_OWNER_DRAWN
if ( m_windowStyle & wxLB_OWNERDRAW ) {
for ( i = 0; i < nItems; i++ ) {
wxOwnerDrawn *pNewItem = CreateItem((size_t)(pos + i));
if (sel >= 0)
SetSelection(sel);
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
if ( m_windowStyle & wxLB_OWNERDRAW )
// update item's text
m_aItems[N]->SetName(s);
return wxControl::MSWWindowProc(nMsg, wParam, lParam);
}
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
// drawing
// -------
}
#endif
- // USE_OWNER_DRAWN
+ // wxUSE_OWNER_DRAWN
#include "wx/mdi.h"
#include "wx/msw/private.h"
-#if USE_NATIVE_STATUSBAR
+#if wxUSE_NATIVE_STATUSBAR
#include <wx/msw/statbr95.h>
#endif
void wxMDIParentFrame::OnSize(wxSizeEvent& event)
{
-#if USE_CONSTRAINTS
+#if wxUSE_CONSTRAINTS
if (GetAutoLayout())
Layout();
#endif
/* Already done in MSWOnSize
// forward WM_SIZE to status bar control
-#if USE_NATIVE_STATUSBAR
+#if wxUSE_NATIVE_STATUSBAR
if (m_frameStatusBar && m_frameStatusBar->IsKindOf(CLASSINFO(wxStatusBar95)))
((wxStatusBar95 *)m_frameStatusBar)->OnSize(event);
#endif
GetEventHandler()->ProcessEvent(event);
#else
-#if USE_CONSTRAINTS
+#if wxUSE_CONSTRAINTS
if (GetAutoLayout())
Layout();
#endif
if (!m_iconized)
{
// forward WM_SIZE to status bar control
-#if USE_NATIVE_STATUSBAR
+#if wxUSE_NATIVE_STATUSBAR
if (m_frameStatusBar && m_frameStatusBar->IsKindOf(CLASSINFO(wxStatusBar95)))
{
wxSizeEvent event(wxSize(x, y), m_frameStatusBar->GetId());
if (!m_iconized)
{
// forward WM_SIZE to status bar control
-#if USE_NATIVE_STATUSBAR
+#if wxUSE_NATIVE_STATUSBAR
if (m_frameStatusBar && m_frameStatusBar->IsKindOf(CLASSINFO(wxStatusBar95)))
{
wxSizeEvent event(wxSize(x, y), m_frameStatusBar->GetId());
#include "wx/utils.h"
#endif
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
#include "wx/ownerdrw.h"
#endif
LPCSTR pData;
wxString name("");
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
if ( pItem->IsOwnerDrawn() ) { // want to get {Measure|Draw}Item messages?
// item draws itself, pass pointer to it in data parameter
flags |= MF_OWNERDRAW;
// ----------------------------------------------------------------------------
#if !defined(USE_SHARED_LIBRARY) || !USE_SHARED_LIBRARY
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
IMPLEMENT_DYNAMIC_CLASS2(wxMenuItem, wxObject, wxOwnerDrawn)
#else //!USE_OWNER_DRAWN
IMPLEMENT_DYNAMIC_CLASS(wxMenuItem, wxObject)
const wxString& strName, const wxString& strHelp,
bool bCheckable,
wxMenu *pSubMenu) :
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
wxOwnerDrawn(strName, bCheckable),
#else //no owner drawn support
m_bCheckable(bCheckable),
{
wxASSERT( pParentMenu != NULL );
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
// set default menu colors
#define SYS_COLOR(c) (wxSystemSettings::GetSystemColour(wxSYS_COLOUR_##c))
#include "wx/setup.h"
#endif
-#if USE_METAFILE
+#if wxUSE_METAFILE
#ifndef WX_PRECOMP
#include "wx/utils.h"
return TRUE;
}
-#endif // USE_METAFILE
+#endif // wxUSE_METAFILE
#include "wx/utils.h"
#endif
-#if USE_ITSY_BITSY
+#if wxUSE_ITSY_BITSY
#include "wx/minifram.h"
#include "wx/msw/private.h"
// Unfortunately there is a bug in the Windows 3.0 8514 driver
// in using ExtTextOut() to a memory DC. If you are drawing
// to an off screen bitmap, then blitting that bitmap to the
-// display, do not #define USE_EXTTEXTOUT below.
+// display, do not #define wxUSE_EXTTEXTOUT below.
//
// The following macro (DRAWFASTRECT) draws a filled rectangle
// with no border and a solid color. It uses the current back-
// ground color as the fill color.
//////////////////////////////////////////////////////////////////////
-#define USE_EXTTEXTOUT
-#ifdef USE_EXTTEXTOUT
+#define wxUSE_EXTTEXTOUT
+#ifdef wxUSE_EXTTEXTOUT
#define DRAWFASTRECT(hdc,lprc) ExtTextOut(hdc,0,0,ETO_OPAQUE,lprc,NULL,0,NULL)
#else
#define DRAWFASTRECT(hdc,lprc) {\
} // DrawArrow()
-#endif // USE_ITSY_BITSY
+#endif // wxUSE_ITSY_BITSY
#include <wx/setup.h>
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
#include <wx/log.h>
#include <wx/msw/ole/oleutils.h>
#include <wx/setup.h>
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
#include <wx/log.h>
}
#endif
- // USE_DRAG_AND_DROP
+ // wxUSE_DRAG_AND_DROP
return FALSE;
}
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
// ----------------------------------------------------------------------------
// Debug support
#endif //WXDEBUG
#endif
- // USE_DRAG_AND_DROP
+ // wxUSE_DRAG_AND_DROP
#include <wx/setup.h>
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
// standard headers
#include <rpc.h> // UUID related functions
}
#endif
- // USE_DRAG_AND_DROP
+ // wxUSE_DRAG_AND_DROP
#include "wx/msw/private.h"
-#if USE_PENWINDOWS
+#if wxUSE_PENWINDOWS
#ifdef __BORLANDC__
#define RPA_DEFAULT 1
}
#endif
- // End USE_PENWINDOWS
+ // End wxUSE_PENWINDOWS
void wxRegisterPenWin(void)
{
-#if USE_PENWINDOWS
+#if wxUSE_PENWINDOWS
///////////////////////////////////////////////////////////////////////
// If running on a Pen Windows system, register this app so all
// EDIT controls in dialogs are replaced by HEDIT controls.
void wxCleanUpPenWin(void)
{
-#if USE_PENWINDOWS
+#if wxUSE_PENWINDOWS
if (g_hPenWin) {
// Unregister this app
if (RegPenApp != NULL)
#include <commctrl.h>
#endif
-#if USE_NATIVE_STATUSBAR
+#if wxUSE_NATIVE_STATUSBAR
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxStatusBar95, wxStatusBar);
#include "wx.h"
#endif
-#if USE_BUTTONBAR && USE_TOOLBAR && defined(__WIN95__)
+#if wxUSE_BUTTONBAR && wxUSE_TOOLBAR && defined(__WIN95__)
#ifndef __GNUWIN32__
#include "malloc.h"
#include "wx.h"
#endif
-#if USE_BUTTONBAR && USE_TOOLBAR
+#if wxUSE_BUTTONBAR && wxUSE_TOOLBAR
#ifndef __GNUWIN32__
#include "malloc.h"
/////// Non-Windows 95 implementation
#if !USE_IMAGE_LOADING_IN_MSW
-#error If USE_IMAGE_LOADING_IN_MSW is set to 0, then USE_BUTTONBAR must be set to 0 too.
+#error If wxUSE_IMAGE_LOADING_IN_MSW is set to 0, then wxUSE_BUTTONBAR must be set to 0 too.
#endif
#if !USE_SHARED_LIBRARY
#include "wx/settings.h"
#endif
-#if USE_CLIPBOARD
+#if wxUSE_CLIPBOARD
#include "wx/app.h"
#include "wx/clipbrd.h"
#endif
return *buf ? TRUE : FALSE;
// }
#else
-#if !defined(__WATCOMC__) && !defined(__GNUWIN32__) && USE_PENWINDOWS
+#if !defined(__WATCOMC__) && !defined(__GNUWIN32__) && wxUSE_PENWINDOWS
extern HANDLE g_hPenWin; // PenWindows Running?
if (g_hPenWin)
{
# ifdef __WINDOWS_386__
retValue = wxWIN386;
# else
-# if !defined(__WATCOMC__) && !defined(GNUWIN32) && USE_PENWINDOWS
+# if !defined(__WATCOMC__) && !defined(GNUWIN32) && wxUSE_PENWINDOWS
extern HANDLE g_hPenWin;
retValue = g_hPenWin ? wxPENWINDOWS : wxWINDOWS ;
# endif
}
// Reading and writing resources (eg WIN.INI, .Xdefaults)
-#if USE_RESOURCES
+#if wxUSE_RESOURCES
bool wxWriteResource(const wxString& section, const wxString& entry, const wxString& value, const wxString& file)
{
if (file != "")
}
else return FALSE;
}
-#endif // USE_RESOURCES
+#endif // wxUSE_RESOURCES
// Old cursor
static HCURSOR wxBusyCursorOld = 0;
#include "wx/msgdlg.h"
#endif
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
#include "wx/ownerdrw.h"
#endif
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
#include "wx/msw/ole/droptgt.h"
#endif
m_lastEvent = -1;
m_returnCode = 0;
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
m_pDropTarget = NULL;
#endif
}
// Have to delete constraints/sizer FIRST otherwise
// sizers may try to look at deleted windows as they
// delete themselves.
-#if USE_CONSTRAINTS
+#if wxUSE_CONSTRAINTS
DeleteRelatedConstraints();
if (m_constraints)
{
m_sizerParent = NULL;
m_autoLayout = FALSE;
m_windowValidator = NULL;
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
m_pDropTarget = NULL;
#endif
return NULL;
}
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
void wxWindow::SetDropTarget(wxDropTarget *pDropTarget)
{
wxDebugMsg("wxWindow::MSWOnDestroy %d\n", handle);
#endif
// delete our drop target if we've got one
- #if USE_DRAG_AND_DROP
+ #if wxUSE_DRAG_AND_DROP
if ( m_pDropTarget != NULL ) {
m_pDropTarget->Revoke(m_hWnd);
bool wxWindow::MSWOnDrawItem(int id, WXDRAWITEMSTRUCT *itemStruct)
{
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
if ( id == 0 ) { // is it a menu item?
DRAWITEMSTRUCT *pDrawStruct = (DRAWITEMSTRUCT *)itemStruct;
wxMenuItem *pMenuItem = (wxMenuItem *)(pDrawStruct->itemData);
#endif // owner-drawn menus
wxWindow *item = FindItem(id);
-#if USE_DYNAMIC_CLASSES
+#if wxUSE_DYNAMIC_CLASSES
if (item && item->IsKindOf(CLASSINFO(wxControl)))
{
return ((wxControl *)item)->MSWOnDraw(itemStruct);
bool wxWindow::MSWOnMeasureItem(int id, WXMEASUREITEMSTRUCT *itemStruct)
{
-#if USE_OWNER_DRAWN
+#if wxUSE_OWNER_DRAWN
if ( id == 0 ) { // is it a menu item?
MEASUREITEMSTRUCT *pMeasureStruct = (MEASUREITEMSTRUCT *)itemStruct;
wxMenuItem *pMenuItem = (wxMenuItem *)(pMeasureStruct->itemData);
#endif // owner-drawn menus
wxWindow *item = FindItem(id);
-#if USE_DYNAMIC_CLASSES
+#if wxUSE_DYNAMIC_CLASSES
if (item && item->IsKindOf(CLASSINFO(wxControl)))
{
return ((wxControl *)item)->MSWOnMeasure(itemStruct);
#include "wx/log.h"
#include "wx/module.h"
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
#include "wx/resource.h"
#endif
wxTheColourDatabase->Initialize();
wxInitializeStockObjects();
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
wxInitializeResourceSystem();
#endif
// For PostScript printing
-#if USE_POSTSCRIPT
+#if wxUSE_POSTSCRIPT
wxInitializePrintSetupData();
wxThePrintPaperDatabase = new wxPrintPaperDatabase;
wxThePrintPaperDatabase->CreateDatabase();
{
wxModule::CleanUpModules();
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
wxCleanUpResourceSystem();
#endif
delete wxTheColourDatabase;
wxTheColourDatabase = NULL;
-#if USE_POSTSCRIPT
+#if wxUSE_POSTSCRIPT
wxInitializePrintSetupData(FALSE);
delete wxThePrintPaperDatabase;
wxThePrintPaperDatabase = NULL;
{
wxClassInfo::InitializeClasses();
-#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
+#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
#if !defined(_WINDLL)
streambuf* sBuf = new wxDebugStreamBuf;
wxApp::CommonCleanUp();
-#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
+#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
// At this point we want to check if there are any memory
// blocks that aren't part of the wxDebugContext itself,
// as a special case. Then when dumping we need to ignore
const char *wxFloatToStringStr = "%.2f";
const char *wxDoubleToStringStr = "%.2f";
-#if USE_POSTSCRIPT
+#if wxUSE_POSTSCRIPT
wxPrintPaperDatabase* wxThePrintPaperDatabase = NULL;
#endif
IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxWindow)
#endif
-#if USE_NATIVE_STATUSBAR
+#if wxUSE_NATIVE_STATUSBAR
bool wxFrame::m_useNativeStatusBar = TRUE;
#else
bool wxFrame::m_useNativeStatusBar = FALSE;
void wxFrame::OnSize(wxSizeEvent& event)
{
// if we're using constraints - do use them
- #if USE_CONSTRAINTS
+ #if wxUSE_CONSTRAINTS
if ( GetAutoLayout() ) {
Layout();
return;
void wxMDIParentFrame::OnSize(wxSizeEvent& event)
{
-#if USE_CONSTRAINTS
+#if wxUSE_CONSTRAINTS
if (GetAutoLayout())
Layout();
#endif
#include "wx/menuitem.h"
#include "wx/log.h"
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
#include "wx/dnd.h"
#endif
m_defaultForegroundColour = *wxBLACK ;
m_defaultBackgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE) ;
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
m_pDropTarget = NULL;
#endif
}
// Have to delete constraints/sizer FIRST otherwise
// sizers may try to look at deleted windows as they
// delete themselves.
-#if USE_CONSTRAINTS
+#if wxUSE_CONSTRAINTS
DeleteRelatedConstraints();
if (m_constraints)
{
m_autoLayout = FALSE;
m_windowValidator = NULL;
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
m_pDropTarget = NULL;
#endif
return NULL;
}
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
void wxWindow::SetDropTarget(wxDropTarget *pDropTarget)
{
#include "wx/module.h"
#include "wx/memory.h"
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
#include "wx/resource.h"
#endif
-#if USE_POSTSCRIPT
+#if wxUSE_POSTSCRIPT
#include "wx/postscrp.h"
#endif
wxBuffer = new char[BUFSIZ + 512];
#endif
-#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
+#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
streambuf* sBuf = new wxDebugStreamBuf;
ostream* oStr = new ostream(sBuf) ;
wxTheColourDatabase->Initialize();
wxInitializeStockObjects();
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
wxInitializeResourceSystem();
#endif
// For PostScript printing
-#if USE_POSTSCRIPT
+#if wxUSE_POSTSCRIPT
wxInitializePrintSetupData();
wxThePrintPaperDatabase = new wxPrintPaperDatabase;
wxThePrintPaperDatabase->CreateDatabase();
{
wxModule::CleanUpModules();
-#if USE_WX_RESOURCES
+#if wxUSE_WX_RESOURCES
wxCleanUpResourceSystem();
#endif
delete wxTheColourDatabase;
wxTheColourDatabase = NULL;
-#if USE_POSTSCRIPT
+#if wxUSE_POSTSCRIPT
wxInitializePrintSetupData(FALSE);
delete wxThePrintPaperDatabase;
wxThePrintPaperDatabase = NULL;
delete wxTheApp;
wxTheApp = NULL;
-#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
+#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
// At this point we want to check if there are any memory
// blocks that aren't part of the wxDebugContext itself,
// as a special case. Then when dumping we need to ignore
const char *wxFloatToStringStr = "%.2f";
const char *wxDoubleToStringStr = "%.2f";
-#if USE_POSTSCRIPT
+#if wxUSE_POSTSCRIPT
wxPrintPaperDatabase* wxThePrintPaperDatabase = NULL;
#endif
-#if USE_SHARED_LIBRARY
+#if wxUSE_SHARED_LIBRARY
///// Event tables (also must be in one, statically-linked file for shared libraries)
// This is the base, wxEvtHandler 'bootstrap' code which is expanded manually here
IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxWindow)
#endif
-#if USE_NATIVE_STATUSBAR
+#if wxUSE_NATIVE_STATUSBAR
bool wxFrame::m_useNativeStatusBar = TRUE;
#else
bool wxFrame::m_useNativeStatusBar = FALSE;
void wxFrame::OnSize(wxSizeEvent& event)
{
// if we're using constraints - do use them
- #if USE_CONSTRAINTS
+ #if wxUSE_CONSTRAINTS
if ( GetAutoLayout() ) {
Layout();
return;
void wxMDIParentFrame::OnSize(wxSizeEvent& event)
{
-#if USE_CONSTRAINTS
+#if wxUSE_CONSTRAINTS
if (GetAutoLayout())
Layout();
#endif
}
// Reading and writing resources (eg WIN.INI, .Xdefaults)
-#if USE_RESOURCES
+#if wxUSE_RESOURCES
bool wxWriteResource(const wxString& section, const wxString& entry, const wxString& value, const wxString& file)
{
// TODO
}
else return FALSE;
}
-#endif // USE_RESOURCES
+#endif // wxUSE_RESOURCES
static int wxBusyCursorCount = 0;
#include "wx/menuitem.h"
#include "wx/log.h"
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
#include "wx/dnd.h"
#endif
m_defaultForegroundColour = *wxBLACK ;
m_defaultBackgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE) ;
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
m_pDropTarget = NULL;
#endif
}
// Have to delete constraints/sizer FIRST otherwise
// sizers may try to look at deleted windows as they
// delete themselves.
-#if USE_CONSTRAINTS
+#if wxUSE_CONSTRAINTS
DeleteRelatedConstraints();
if (m_constraints)
{
m_autoLayout = FALSE;
m_windowValidator = NULL;
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
m_pDropTarget = NULL;
#endif
return NULL;
}
-#if USE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
void wxWindow::SetDropTarget(wxDropTarget *pDropTarget)
{
#endif
#if !USE_DOC_VIEW_ARCHITECTURE
-#error You must set USE_DOC_VIEW_ARCHITECTURE to 1 in wx_setup.h!
+#error You must set wxUSE_DOC_VIEW_ARCHITECTURE to 1 in wx_setup.h!
#endif
#include "ogledit.h"
#endif
#if !USE_DOC_VIEW_ARCHITECTURE
-#error You must set USE_DOC_VIEW_ARCHITECTURE to 1 in wx_setup.h!
+#error You must set wxUSE_DOC_VIEW_ARCHITECTURE to 1 in wx_setup.h!
#endif
#include "ogledit.h"
#include <wx/colordlg.h>
#if !USE_DOC_VIEW_ARCHITECTURE
-#error You must set USE_DOC_VIEW_ARCHITECTURE to 1 in wx_setup.h!
+#error You must set wxUSE_DOC_VIEW_ARCHITECTURE to 1 in wx_setup.h!
#endif
#include "ogledit.h"
#include <wx/wxexpr.h>
#endif
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
#include <iostream.h>
#else
#include <iostream>
#include <wx/wxexpr.h>
#endif
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
#include <iostream.h>
#else
#include <iostream>
#include <wx/wxexpr.h>
#endif
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
#include <iostream.h>
#else
#include <iostream>
#include <wx/wxexpr.h>
#endif
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
#include <iostream.h>
#else
#include <iostream>
#include <wx/types.h>
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
#include <iostream.h>
#else
#include <iostream>
#include <wx/wxexpr.h>
#endif
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
#include <iostream.h>
#else
#include <iostream>
#include "helpers.h"
#ifdef __WXGTK__
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
#include "gdk_imlib/gdk_imlib.h"
#endif
#endif
gtk_init( &argc, &argv );
delete [] argv;
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
gdk_imlib_init();
gtk_widget_push_visual(gdk_imlib_get_visual());
gtk_widget_push_colormap(gdk_imlib_get_colormap());
/////////////////////////////////////////////////////////////////////////////
//
// $Log$
+// Revision 1.9 1998/09/25 13:28:52 VZ
+// USE_xxx constants renamed to wxUSE_xxx. This is an incompatible change, you
+// must recompile everything after upgrading!
+//
// Revision 1.8 1998/08/27 21:59:08 RD
// Some chicken-and-egg problems solved for wxPython on wxGTK
//