diff --git a/include/wx/motif/setup0.h b/include/wx/motif/setup0.h new file mode 100644 index 0000000000..75a04668dc --- /dev/null +++ b/include/wx/motif/setup0.h @@ -0,0 +1,1166 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: wx/motif/setup.h +// Purpose: Configuration for the library +// Author: Julian Smart +// Modified by: +// Created: 01/02/97 +// RCS-ID: $Id$ +// Copyright: (c) Julian Smart +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_SETUP_H_ +#define _WX_SETUP_H_ + +/* --- start common options --- */ +// ---------------------------------------------------------------------------- +// global settings +// ---------------------------------------------------------------------------- + +// define this to 0 when building wxBase library - this can also be done from +// makefile/project file overriding the value here +#ifndef wxUSE_GUI + #define wxUSE_GUI 1 +#endif // wxUSE_GUI + +// ---------------------------------------------------------------------------- +// compatibility settings +// ---------------------------------------------------------------------------- + +// This setting determines the compatibility with 2.2 API: set it to 1 to +// enable it but please consider updating your code instead. +// +// Default is 0 +// +// Recommended setting: 0 (please update your code) +#define WXWIN_COMPATIBILITY_2_2 0 + +// This setting determines the compatibility with 2.4 API: set it to 0 to +// flag all cases of using deprecated functions. +// +// Default is 1 but please try building your code with 0 as the default will +// change to 0 in the next version and the deprecated functions will disappear +// in the version after it completely. +// +// Recommended setting: 0 (please update your code) +#define WXWIN_COMPATIBILITY_2_4 1 + +// MSW-only: Set to 0 for accurate dialog units, else 1 for old behaviour when +// default system font is used for wxWindow::GetCharWidth/Height() instead of +// the current font. +// +// Default is 0 +// +// Recommended setting: 0 +#define wxDIALOG_UNIT_COMPATIBILITY 0 + +// ---------------------------------------------------------------------------- +// debugging settings +// ---------------------------------------------------------------------------- + +// Generic comment about debugging settings: they are very useful if you don't +// use any other memory leak detection tools such as Purify/BoundsChecker, but +// are probably redundant otherwise. Also, Visual C++ CRT has the same features +// as wxWidgets memory debugging subsystem built in since version 5.0 and you +// may prefer to use it instead of built in memory debugging code because it is +// faster and more fool proof. +// +// Using VC++ CRT memory debugging is enabled by default in debug mode +// (__WXDEBUG__) if wxUSE_GLOBAL_MEMORY_OPERATORS is *not* enabled (i.e. is 0) +// and if __NO_VC_CRTDBG__ is not defined. + +// If 1, enables wxDebugContext, for writing error messages to file, etc. If +// __WXDEBUG__ is not defined, will still use the normal memory operators. +// +// Default is 0 +// +// Recommended setting: 0 +#define wxUSE_DEBUG_CONTEXT 0 + +// 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. This switch is currently ignored for mingw / cygwin +// +// Default is 0 +// +// Recommended setting: 1 if you are not using a memory debugging tool, else 0 +#define wxUSE_MEMORY_TRACING 0 + +// In debug mode, cause new and delete to be redefined globally. +// If this causes problems (e.g. link errors which is a common problem +// especially if you use another library which also redefines the global new +// and delete), set this to 0. +// This switch is currently ignored for mingw / cygwin +// +// Default is 0 +// +// Recommended setting: 0 +#define wxUSE_GLOBAL_MEMORY_OPERATORS 0 + +// In debug mode, causes new to be defined to be WXDEBUG_NEW (see object.h). If +// this causes problems (e.g. link errors), set this to 0. You may need to set +// this to 0 if using templates (at least for VC++). This switch is currently +// ignored for mingw / cygwin / CodeWarrior +// +// Default is 0 +// +// Recommended setting: 0 +#define wxUSE_DEBUG_NEW_ALWAYS 0 + +// wxHandleFatalExceptions() may be used to catch the program faults at run +// time and, instead of terminating the program with a usual GPF message box, +// call the user-defined wxApp::OnFatalException() function. If you set +// wxUSE_ON_FATAL_EXCEPTION to 0, wxHandleFatalExceptions() will not work. +// +// This setting is for Win32 only and can only be enabled if your compiler +// supports Win32 structured exception handling (currently only VC++ does) +// +// Default is 1 +// +// Recommended setting: 1 if your compiler supports it. +#define wxUSE_ON_FATAL_EXCEPTION 1 + +// Set this to 1 to be able to generate a human-readable (unlike +// machine-readable minidump created by wxCrashReport::Generate()) stack back +// trace when your program crashes using wxStackWalker +// +// Default is 1 if supported by the compiler. +// +// Recommended setting: 1, set to 0 if your programs never crash +#define wxUSE_STACKWALKER 0 + +// Set this to 1 to compile in wxDebugReport class which allows you to create +// and optionally upload to your web site a debug report consisting of back +// trace of the crash (if wxUSE_STACKWALKER == 1) and other information. +// +// Default is 1 if supported by the compiler. +// +// Recommended setting: 1, it is compiled into a separate library so there +// is no overhead if you don't use it +#define wxUSE_DEBUGREPORT 1 + +// ---------------------------------------------------------------------------- +// Unicode support +// ---------------------------------------------------------------------------- + +// Set wxUSE_UNICODE to 1 to compile wxWidgets in Unicode mode: wxChar will be +// defined as wchar_t, wxString will use Unicode internally. If you set this +// to 1, you must use wxT() macro for all literal strings in the program. +// +// Unicode is currently only fully supported under Windows NT/2000/XP +// (Windows 9x doesn't support it and the programs compiled in Unicode mode +// will not run under 9x -- but see wxUSE_UNICODE_MSLU below). +// +// Default is 0 +// +// Recommended setting: 0 (unless you only plan to use Windows NT/2000/XP) +#ifndef wxUSE_UNICODE + #define wxUSE_UNICODE 0 +#endif + +// Setting wxUSE_WCHAR_T to 1 gives you some degree of Unicode support without +// compiling the program in Unicode mode. More precisely, it will be possible +// to construct wxString from a wide (Unicode) string and convert any wxString +// to Unicode. +// +// Default is 1 +// +// Recommended setting: 1 +#define wxUSE_WCHAR_T 1 + +// ---------------------------------------------------------------------------- +// global features +// ---------------------------------------------------------------------------- + +// Compile library in exception-safe mode? If set to 1, the library will try to +// behave correctly in presence of exceptions (even though it still will not +// use the exceptions itself) and notify the user code about any unhandled +// exceptions. If set to 0, propagation of the exceptions through the library +// code will lead to undefined behaviour -- but the code itself will be +// slightly smaller and faster. +// +// Note that like wxUSE_THREADS this option is automatically set to 0 if +// wxNO_EXCEPTIONS is defined. +// +// Default is 1 +// +// Recommended setting: depends on whether you intend to use C++ exceptions +// in your own code (1 if you do, 0 if you don't) +#define wxUSE_EXCEPTIONS 1 + +// Set wxUSE_EXTENDED_RTTI to 1 to use extended RTTI +// +// Default is 0 +// +// Recommended setting: 0 (this is still work in progress...) +#define wxUSE_EXTENDED_RTTI 0 + +#if defined(__BORLANDC__) +#undef wxUSE_EXTENDED_RTTI +#define wxUSE_EXTENDED_RTTI 1 +#endif + +// Set wxUSE_STL to 1 to derive wxList(Foo) and wxArray(Foo) from +// std::list and std::vector, with a compatibility interface, +// and for wxHashMap to be implemented with templates. +// +// Default is 0 +// +// Recommended setting: YMMV +#define wxUSE_STL 0 + +// Support for message/error logging. This includes wxLogXXX() functions and +// wxLog and derived classes. Don't set this to 0 unless you really know what +// you are doing. +// +// Default is 1 +// +// Recommended setting: 1 (always) +#define wxUSE_LOG 1 + +// Recommended setting: 1 +#define wxUSE_LOGWINDOW 1 + +// Recommended setting: 1 +#define wxUSE_LOGGUI 1 + +// Recommended setting: 1 +#define wxUSE_LOG_DIALOG 1 + +// Support for command line parsing using wxCmdLineParser class. +// +// Default is 1 +// +// Recommended setting: 1 (can be set to 0 if you don't use the cmd line) +#define wxUSE_CMDLINE_PARSER 1 + +// Support for multithreaded applications: if 1, compile in thread classes +// (thread.h) and make the library a bit more thread safe. Although thread +// support is quite stable by now, you may still consider recompiling the +// library without it if you have no use for it - this will result in a +// somewhat smaller and faster operation. +// +// Notice that if wxNO_THREADS is defined, wxUSE_THREADS is automatically reset +// to 0 in wx/chkconf.h, so, for example, if you set USE_THREADS to 0 in +// build/msw/config.* file this value will have no effect. +// +// Default is 1 +// +// Recommended setting: 0 unless you do plan to develop MT applications +#define wxUSE_THREADS 1 + +// If enabled (1), compiles wxWidgets streams classes +#define wxUSE_STREAMS 1 + +// Use standard C++ streams if 1. If 0, use wxWin streams implementation only. +#define wxUSE_STD_IOSTREAM 0 + +// Enable conversion to standard C++ string if 1. +#define wxUSE_STD_STRING 0 + +// ---------------------------------------------------------------------------- +// non GUI features selection +// ---------------------------------------------------------------------------- + +// Set wxUSE_LONGLONG to 1 to compile the wxLongLong class. This is a 64 bit +// integer which is implemented in terms of native 64 bit integers if any or +// uses emulation otherwise. +// +// This class is required by wxDateTime and so you should enable it if you want +// to use wxDateTime. For most modern platforms, it will use the native 64 bit +// integers in which case (almost) all of its functions are inline and it +// almost does not take any space, so there should be no reason to switch it +// off. +// +// Recommended setting: 1 +#define wxUSE_LONGLONG 1 + +// Set wxUSE_(F)FILE to 1 to compile wx(F)File classes. wxFile uses low level +// POSIX functions for file access, wxFFile uses ANSI C stdio.h functions. +// +// Default is 1 +// +// Recommended setting: 1 (wxFile is highly recommended as it is required by +// i18n code, wxFileConfig and others) +#define wxUSE_FILE 1 +#define wxUSE_FFILE 1 + +// Use wxFSVolume class providing access to the configured/active mount points +// +// Default is 1 +// +// Recommended setting: 1 (but may be safely disabled if you don't use it) +#define wxUSE_FSVOLUME 1 + +// Use wxStandardPaths class which allows to retrieve some standard locations +// in the file system +// +// Default is 1 +// +// Recommended setting: 1 (may be disabled to save space, but not much) +#define wxUSE_STDPATHS 1 + +// use wxTextBuffer class: required by wxTextFile +#define wxUSE_TEXTBUFFER 1 + +// use wxTextFile class: requires wxFile and wxTextBuffer, required by +// wxFileConfig +#define wxUSE_TEXTFILE 1 + +// i18n support: _() macro, wxLocale class. Requires wxTextFile. +#define wxUSE_INTL 1 + +// Set wxUSE_DATETIME to 1 to compile the wxDateTime and related classes which +// allow to manipulate dates, times and time intervals. wxDateTime replaces the +// old wxTime and wxDate classes which are still provided for backwards +// compatibility (and implemented in terms of wxDateTime). +// +// Note that this class is relatively new and is still officially in alpha +// stage because some features are not yet (fully) implemented. It is already +// quite useful though and should only be disabled if you are aiming at +// absolutely minimal version of the library. +// +// Requires: wxUSE_LONGLONG +// +// Default is 1 +// +// Recommended setting: 1 +#define wxUSE_DATETIME 1 + +// Set wxUSE_TIMER to 1 to compile wxTimer class +// +// Default is 1 +// +// Recommended setting: 1 +#define wxUSE_TIMER 1 + +// Use wxStopWatch clas. +// +// Default is 1 +// +// Recommended setting: 1 (needed by wxSocket) +#define wxUSE_STOPWATCH 1 + +// Setting wxUSE_CONFIG to 1 enables the use of wxConfig and related classes +// which allow the application to store its settings in the persistent +// storage. Setting this to 1 will also enable on-demand creation of the +// global config object in wxApp. +// +// See also wxUSE_CONFIG_NATIVE below. +// +// Recommended setting: 1 +#define wxUSE_CONFIG 1 + +// If wxUSE_CONFIG is 1, you may choose to use either the native config +// classes under Windows (using .INI files under Win16 and the registry under +// Win32) or the portable text file format used by the config classes under +// Unix. +// +// Default is 1 to use native classes. Note that you may still use +// wxFileConfig even if you set this to 1 - just the config object created by +// default for the applications needs will be a wxRegConfig or wxIniConfig and +// not wxFileConfig. +// +// Recommended setting: 1 +#define wxUSE_CONFIG_NATIVE 1 + +// If wxUSE_DIALUP_MANAGER is 1, compile in wxDialUpManager class which allows +// to connect/disconnect from the network and be notified whenever the dial-up +// network connection is established/terminated. Requires wxUSE_DYNAMIC_LOADER. +// +// Default is 1. +// +// Recommended setting: 1 +#define wxUSE_DIALUP_MANAGER 0 + +// Compile in classes for run-time DLL loading and function calling. +// Required by wxUSE_DIALUP_MANAGER. +// +// This setting is for Win32 only +// +// Default is 1. +// +// Recommended setting: 1 +#define wxUSE_DYNLIB_CLASS 1 + +// experimental, don't use for now +#define wxUSE_DYNAMIC_LOADER 1 + +// Set to 1 to use socket classes +#define wxUSE_SOCKETS 1 + +// Set to 1 to enable virtual file systems (required by wxHTML) +#define wxUSE_FILESYSTEM 1 + +// Set to 1 to enable virtual ZIP filesystem (requires wxUSE_FILESYSTEM) +#define wxUSE_FS_ZIP 1 + +// Set to 1 to enable virtual Internet filesystem (requires wxUSE_FILESYSTEM) +#define wxUSE_FS_INET 1 + +// wxArchive classes for accessing archives such as zip and tar +#define wxUSE_ARCHIVE_STREAMS 1 + +// Set to 1 to compile wxZipInput/OutputStream classes. +#define wxUSE_ZIPSTREAM 1 + +// Set to 1 to compile wxZlibInput/OutputStream classes. Also required by +// wxUSE_LIBPNG +#define wxUSE_ZLIB 1 + +// If enabled, the code written by Apple will be used to write, in a portable +// way, float on the disk. See extended.c for the license which is different +// from wxWidgets one. +// +// Default is 1. +// +// Recommended setting: 1 unless you don't like the license terms (unlikely) +#define wxUSE_APPLE_IEEE 1 + +// Joystick support class +#define wxUSE_JOYSTICK 0 + +// wxFontMapper class +#define wxUSE_FONTMAP 1 + +// wxMimeTypesManager class +#define wxUSE_MIMETYPE 1 + +// wxProtocol and related classes: if you want to use either of wxFTP, wxHTTP +// or wxURL you need to set this to 1. +// +// Default is 1. +// +// Recommended setting: 1 +#define wxUSE_PROTOCOL 1 + +// The settings for the individual URL schemes +#define wxUSE_PROTOCOL_FILE 1 +#define wxUSE_PROTOCOL_FTP 1 +#define wxUSE_PROTOCOL_HTTP 1 + +// Define this to use wxURL class. +#define wxUSE_URL 1 + +// Define this to use native platform url and protocol support. +// Currently valid only for MS-Windows. +// Note: if you set this to 1, you can open ftp/http/gopher sites +// and obtain a valid input stream for these sites +// even when you set wxUSE_PROTOCOL_FTP/HTTP to 0. +// Doing so reduces the code size. +// +// This code is experimental and subject to change. +#define wxUSE_URL_NATIVE 0 + +// Support for regular expression matching via wxRegEx class: enable this to +// use POSIX regular expressions in your code. You need to compile regex +// library from src/regex to use it under Windows. +// +// Default is 0 +// +// Recommended setting: 1 if your compiler supports it, if it doesn't please +// contribute us a makefile for src/regex for it +#define wxUSE_REGEX 1 + +// wxSystemOptions class +#define wxUSE_SYSTEM_OPTIONS 1 + +// wxSound class +#define wxUSE_SOUND 0 + +// Use wxMediaCtrl +// +// Default is 1. +// +// Recommended setting: 1 +#define wxUSE_MEDIACTRL 1 + +// Use GStreamer for Unix (req a lot of dependancies) +// +// Default is 0 +// +// Recommended setting: 1 (wxMediaCtrl won't work by default without it) +#define wxUSE_GSTREAMER 0 + +// Use wxWidget's XRC XML-based resource system. Recommended. +// +// Default is 1 +// +// Recommended setting: 1 (requires wxUSE_XML) +#define wxUSE_XRC 1 + +// XML parsing classes. Note that their API will change in the future, so +// using wxXmlDocument and wxXmlNode in your app is not recommended. +// +// Default is 1 +// +// Recommended setting: 1 (required by XRC) +#if wxUSE_XRC +# define wxUSE_XML 1 +#else +# define wxUSE_XML 0 +#endif + +// ---------------------------------------------------------------------------- +// Individual GUI controls +// ---------------------------------------------------------------------------- + +// You must set wxUSE_CONTROLS to 1 if you are using any controls at all +// (without it, wxControl class is not compiled) +// +// Default is 1 +// +// Recommended setting: 1 (don't change except for very special programs) +#define wxUSE_CONTROLS 1 + +// wxPopupWindow class is a top level transient window. It is currently used +// to implement wxTipWindow +// +// Default is 1 +// +// Recommended setting: 1 (may be set to 0 if you don't wxUSE_TIPWINDOW) +#define wxUSE_POPUPWIN 1 + +// wxTipWindow allows to implement the custom tooltips, it is used by the +// context help classes. Requires wxUSE_POPUPWIN. +// +// Default is 1 +// +// Recommended setting: 1 (may be set to 0) +#define wxUSE_TIPWINDOW 1 + +// Each of the settings below corresponds to one wxWidgets control. They are +// all switched on by default but may be disabled if you are sure that your +// program (including any standard dialogs it can show!) doesn't need them and +// if you desperately want to save some space. If you use any of these you must +// set wxUSE_CONTROLS as well. +// +// Default is 1 +// +// Recommended setting: 1 +#define wxUSE_BUTTON 1 // wxButton +#define wxUSE_BMPBUTTON 1 // wxBitmapButton +#define wxUSE_CALENDARCTRL 1 // wxCalendarCtrl +#define wxUSE_CHECKBOX 1 // wxCheckBox +#define wxUSE_CHECKLISTBOX 1 // wxCheckListBox (requires wxUSE_OWNER_DRAWN) +#define wxUSE_CHOICE 1 // wxChoice +#define wxUSE_COMBOBOX 1 // wxComboBox +#define wxUSE_DATEPICKCTRL 1 // wxDatePickerCtrl +#define wxUSE_GAUGE 1 // wxGauge +#define wxUSE_LISTBOX 1 // wxListBox +#define wxUSE_LISTCTRL 1 // wxListCtrl +#define wxUSE_RADIOBOX 1 // wxRadioBox +#define wxUSE_RADIOBTN 1 // wxRadioButton +#define wxUSE_SCROLLBAR 1 // wxScrollBar +#define wxUSE_SLIDER 1 // wxSlider +#define wxUSE_SPINBTN 1 // wxSpinButton +#define wxUSE_SPINCTRL 1 // wxSpinCtrl +#define wxUSE_STATBOX 1 // wxStaticBox +#define wxUSE_STATLINE 1 // wxStaticLine +#define wxUSE_STATTEXT 1 // wxStaticText +#define wxUSE_STATBMP 1 // wxStaticBitmap +#define wxUSE_TEXTCTRL 1 // wxTextCtrl +#define wxUSE_TOGGLEBTN 1 // requires wxButton +#define wxUSE_TREECTRL 1 // wxTreeCtrl + +// Use a status bar class? Depending on the value of wxUSE_NATIVE_STATUSBAR +// below either wxStatusBar95 or a generic wxStatusBar will be used. +// +// Default is 1 +// +// Recommended setting: 1 +#define wxUSE_STATUSBAR 1 + +// Two status bar implementations are available under Win32: the generic one +// or the wrapper around native control. For native look and feel the native +// version should be used. +// +// Default is 1 for the platforms where native status bar is supported. +// +// Recommended setting: 1 (there is no advantage in using the generic one) +#define wxUSE_NATIVE_STATUSBAR 1 + +// wxToolBar related settings: if wxUSE_TOOLBAR is 0, don't compile any toolbar +// classes at all. Otherwise, use the native toolbar class unless +// wxUSE_TOOLBAR_NATIVE is 0. +// +// Default is 1 for all settings. +// +// Recommended setting: 1 for wxUSE_TOOLBAR and wxUSE_TOOLBAR_NATIVE. +#define wxUSE_TOOLBAR 1 +#define wxUSE_TOOLBAR_NATIVE 1 + +// wxNotebook is a control with several "tabs" located on one of its sides. It +// may be used to logically organise the data presented to the user instead of +// putting everything in one huge dialog. It replaces wxTabControl and related +// classes of wxWin 1.6x. +// +// Default is 1. +// +// Recommended setting: 1 +#define wxUSE_NOTEBOOK 1 + +// wxListbook control is similar to wxNotebook but uses wxListCtrl instead of +// the tabs +// +// Default is 1. +// +// Recommended setting: 1 +#define wxUSE_LISTBOOK 1 + +// wxChoicebook control is similar to wxNotebook but uses wxChoice instead of +// the tabs +// +// Default is 1. +// +// Recommended setting: 1 +#define wxUSE_CHOICEBOOK 1 + +// wxTabDialog is a generic version of wxNotebook but it is incompatible with +// the new class. It shouldn't be used in new code. +// +// Default is 0. +// +// Recommended setting: 0 (use wxNotebook) +#define wxUSE_TAB_DIALOG 0 + +// wxGrid class +// +// Default is 1, set to 0 to cut down compilation time and binaries size if you +// don't use it. +// +// Recommended setting: 1 +// +#define wxUSE_GRID 1 + +// wxMiniFrame class: a frame with narrow title bar +// +// Default is 1. +// +// Recommended setting: 1 (it doesn't cost almost anything) +#define wxUSE_MINIFRAME 1 + +// ---------------------------------------------------------------------------- +// Miscellaneous GUI stuff +// ---------------------------------------------------------------------------- + +// wxAcceleratorTable/Entry classes and support for them in wxMenu(Bar) +#define wxUSE_ACCEL 1 + +// Hotkey support (currently Windows only) +#define wxUSE_HOTKEY 1 + +// Use wxCaret: a class implementing a "cursor" in a text control (called caret +// under Windows). +// +// Default is 1. +// +// Recommended setting: 1 (can be safely set to 0, not used by the library) +#define wxUSE_CARET 1 + +// Use wxDisplay class: it allows enumerating all displays on a system and +// working with them. +// +// Default is 0 because it isn't yet implemented on all platforms +// +// Recommended setting: 1 if you need it, can be safely set to 0 otherwise +#if defined(__BORLANDC__) + #define wxUSE_DISPLAY 1 +#else + #define wxUSE_DISPLAY 0 +#endif + +// Miscellaneous geometry code: needed for Canvas library +#define wxUSE_GEOMETRY 1 + +// Use wxImageList. This class is needed by wxNotebook, wxTreeCtrl and +// wxListCtrl. +// +// Default is 1. +// +// Recommended setting: 1 (set it to 0 if you don't use any of the controls +// enumerated above, then this class is mostly useless too) +#define wxUSE_IMAGLIST 1 + +// Use wxMenu, wxMenuBar, wxMenuItem. +// +// Default is 1. +// +// Recommended setting: 1 (can't be disabled under MSW) +#define wxUSE_MENUS 1 + +// Use wxSashWindow class. +// +// Default is 1. +// +// Recommended setting: 1 +#define wxUSE_SASH 1 + +// Use wxSplitterWindow class. +// +// Default is 1. +// +// Recommended setting: 1 +#define wxUSE_SPLITTER 1 + +// Use wxToolTip and wxWindow::Set/GetToolTip() methods. +// +// Default is 1. +// +// Recommended setting: 1 +#define wxUSE_TOOLTIPS 0 + +// wxValidator class and related methods +#define wxUSE_VALIDATORS 1 + +// ---------------------------------------------------------------------------- +// common dialogs +// ---------------------------------------------------------------------------- + +// 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. +// +// Default is 1 +// +// Recommended setting: 1 (unless it really doesn't work) +#define wxUSE_COMMON_DIALOGS 1 + +// wxBusyInfo displays window with message when app is busy. Works in same way +// as wxBusyCursor +#define wxUSE_BUSYINFO 1 + +// Use single/multiple choice dialogs. +// +// Default is 1 +// +// Recommended setting: 1 (used in the library itself) +#define wxUSE_CHOICEDLG 1 + +// Use colour picker dialog +// +// Default is 1 +// +// Recommended setting: 1 +#define wxUSE_COLOURDLG 1 + +// wxDirDlg class for getting a directory name from user +#define wxUSE_DIRDLG 1 + +// TODO: setting to choose the generic or native one + +// Use file open/save dialogs. +// +// Default is 1 +// +// Recommended setting: 1 (used in many places in the library itself) +#define wxUSE_FILEDLG 1 + +// Use find/replace dialogs. +// +// Default is 1 +// +// Recommended setting: 1 (but may be safely set to 0) +#define wxUSE_FINDREPLDLG 1 + +// Use font picker dialog +// +// Default is 1 +// +// Recommended setting: 1 (used in the library itself) +#define wxUSE_FONTDLG 1 + +// Use wxMessageDialog and wxMessageBox. +// +// Default is 1 +// +// Recommended setting: 1 (used in the library itself) +#define wxUSE_MSGDLG 1 + +// progress dialog class for lengthy operations +#define wxUSE_PROGRESSDLG 1 + +// support for startup tips (wxShowTip &c) +#define wxUSE_STARTUP_TIPS 1 + +// text entry dialog and wxGetTextFromUser function +#define wxUSE_TEXTDLG 1 + +// number entry dialog +#define wxUSE_NUMBERDLG 1 + +// splash screen class +#define wxUSE_SPLASH 1 + +// wizards +#define wxUSE_WIZARDDLG 1 + +// ---------------------------------------------------------------------------- +// Metafiles support +// ---------------------------------------------------------------------------- + +// Windows supports the graphics format known as metafile which is, though not +// portable, is widely used under Windows and so is supported by wxWin (under +// Windows only, of course). Win16 (Win3.1) used the so-called "Window +// MetaFiles" or WMFs which were replaced with "Enhanced MetaFiles" or EMFs in +// Win32 (Win9x, NT, 2000). Both of these are supported in wxWin and, by +// default, WMFs will be used under Win16 and EMFs under Win32. This may be +// changed by setting wxUSE_WIN_METAFILES_ALWAYS to 1 and/or setting +// wxUSE_ENH_METAFILE to 0. You may also set wxUSE_METAFILE to 0 to not compile +// in any metafile related classes at all. +// +// Default is 1 for wxUSE_ENH_METAFILE and 0 for wxUSE_WIN_METAFILES_ALWAYS. +// +// Recommended setting: default or 0 for everything for portable programs. +#define wxUSE_METAFILE 1 +#define wxUSE_ENH_METAFILE 1 +#define wxUSE_WIN_METAFILES_ALWAYS 0 + +// ---------------------------------------------------------------------------- +// Big GUI components +// ---------------------------------------------------------------------------- + +// Set to 0 to disable MDI support. +// +// Requires wxUSE_NOTEBOOK under platforms other than MSW. +// +// Default is 1. +// +// Recommended setting: 1, can be safely set to 0. +#define wxUSE_MDI 1 + +// Set to 0 to disable document/view architecture +#define wxUSE_DOC_VIEW_ARCHITECTURE 1 + +// Set to 0 to disable MDI document/view architecture +// +// Requires wxUSE_MDI && wxUSE_DOC_VIEW_ARCHITECTURE +#define wxUSE_MDI_ARCHITECTURE 1 + +// Set to 0 to disable print/preview architecture code +#define wxUSE_PRINTING_ARCHITECTURE 0 + +// wxHTML sublibrary allows to display HTML in wxWindow programs and much, +// much more. +// +// Default is 1. +// +// Recommended setting: 1 (wxHTML is great!), set to 0 if you want compile a +// smaller library. +#define wxUSE_HTML 1 + +// Setting wxUSE_GLCANVAS to 1 enables OpenGL support. You need to have OpenGL +// headers and libraries to be able to compile the library with wxUSE_GLCANVAS +// set to 1. Note that for some compilers (notably Microsoft Visual C++) you +// will need to manually add opengl32.lib and glu32.lib to the list of +// libraries linked with your program if you use OpenGL. +// +// Default is 0. +// +// Recommended setting: 1 if you intend to use OpenGL, 0 otherwise +#ifdef __DMC__ +#define wxUSE_GLCANVAS 0 +#else +#define wxUSE_GLCANVAS 1 +#endif + +// ---------------------------------------------------------------------------- +// Data transfer +// ---------------------------------------------------------------------------- + +// Use wxClipboard class for clipboard copy/paste. +// +// Default is 1. +// +// Recommended setting: 1 +#define wxUSE_CLIPBOARD 1 + +// Use wxDataObject and related classes. Needed for clipboard and OLE drag and +// drop +// +// Default is 1. +// +// Recommended setting: 1 +#define wxUSE_DATAOBJ 1 + +// Use wxDropTarget and wxDropSource classes for drag and drop (this is +// different from "built in" drag and drop in wxTreeCtrl which is always +// available). Requires wxUSE_DATAOBJ. +// +// Default is 1. +// +// Recommended setting: 1 +#define wxUSE_DRAG_AND_DROP 0 + +// Use wxAccessible for enhanced and customisable accessibility. +// Depends on wxUSE_OLE. +// +// Default is 0. +// +// Recommended setting (at present): 0 +#define wxUSE_ACCESSIBILITY 0 + +// ---------------------------------------------------------------------------- +// miscellaneous settings +// ---------------------------------------------------------------------------- + +// wxSingleInstanceChecker class allows to verify at startup if another program +// instance is running (it is only available under Win32) +// +// Default is 1 +// +// Recommended setting: 1 (the class is tiny, disabling it won't save much +// space) +#define wxUSE_SNGLINST_CHECKER 1 + +#define wxUSE_DRAGIMAGE 1 + +#define wxUSE_IPC 1 + // 0 for no interprocess comms +#define wxUSE_HELP 1 + // 0 for no help facility +#define wxUSE_MS_HTML_HELP 1 + // 0 for no MS HTML Help + +// Use wxHTML-based help controller? +#define wxUSE_WXHTML_HELP 1 + +#define wxUSE_RESOURCES 0 + // 0 for no wxGetResource/wxWriteResource +#define wxUSE_CONSTRAINTS 1 + // 0 for no window layout constraint system + +#define wxUSE_SPLINES 1 + // 0 for no splines + +#define wxUSE_MOUSEWHEEL 1 + // Include mouse wheel support + +// ---------------------------------------------------------------------------- +// postscript support settings +// ---------------------------------------------------------------------------- + +// Set to 1 for PostScript device context. +#define wxUSE_POSTSCRIPT 0 + +// Set to 1 to use font metric files in GetTextExtent +#define wxUSE_AFM_FOR_POSTSCRIPT 1 + +// ---------------------------------------------------------------------------- +// database classes +// ---------------------------------------------------------------------------- + +// Define 1 to use ODBC classes +#define wxUSE_ODBC 0 + +// For backward compatibility reasons, this parameter now only controls the +// default scrolling method used by cursors. This default behavior can be +// overriden by setting the second param of wxDB::wxDbGetConnection() or +// wxDb() constructor to indicate whether the connection (and any wxDbTable()s +// that use the connection) should support forward only scrolling of cursors, +// or both forward and backward support for backward scrolling cursors is +// dependent on the data source as well as the ODBC driver being used. +#define wxODBC_FWD_ONLY_CURSORS 1 + +// Default is 0. Set to 1 to use the deprecated classes, enum types, function, +// member variables. With a setting of 1, full backward compatibility with the +// 2.0.x release is possible. It is STRONGLY recommended that this be set to 0, +// as future development will be done only on the non-deprecated +// functions/classes/member variables/etc. +#define wxODBC_BACKWARD_COMPATABILITY 0 + +// ---------------------------------------------------------------------------- +// other compiler (mis)features +// ---------------------------------------------------------------------------- + +// Set this to 0 if your compiler can't cope with omission of prototype +// parameters. +// +// Default is 1. +// +// Recommended setting: 1 (should never need to set this to 0) +#define REMOVE_UNUSED_ARG 1 + +// VC++ 4.2 and above allows and but you can't mix +// them. Set to 1 for , 0 for . Note that VC++ 7.1 +// and later doesn't support wxUSE_IOSTREAMH == 1 and so will be +// used anyhow. +// +// Default is 1. +// +// Recommended setting: whatever your compiler likes more +#define wxUSE_IOSTREAMH 1 + +// ---------------------------------------------------------------------------- +// image format support +// ---------------------------------------------------------------------------- + +// wxImage supports many different image formats which can be configured at +// compile-time. BMP is always supported, others are optional and can be safely +// disabled if you don't plan to use images in such format sometimes saving +// substantial amount of code in the final library. +// +// Some formats require an extra library which is included in wxWin sources +// which is mentioned if it is the case. + +// Set to 1 for wxImage support (recommended). +#define wxUSE_IMAGE 1 + +// Set to 1 for PNG format support (requires libpng). Also requires wxUSE_ZLIB. +#define wxUSE_LIBPNG 1 + +// Set to 1 for JPEG format support (requires libjpeg) +#define wxUSE_LIBJPEG 1 + +// Set to 1 for TIFF format support (requires libtiff) +#define wxUSE_LIBTIFF 1 + +// Set to 1 for GIF format support +#define wxUSE_GIF 1 + +// Set to 1 for PNM format support +#define wxUSE_PNM 1 + +// Set to 1 for PCX format support +#define wxUSE_PCX 1 + +// Set to 1 for IFF format support (Amiga format) +#define wxUSE_IFF 0 + +// Set to 1 for XPM format support +#define wxUSE_XPM 1 + +// Set to 1 for MS Icons and Cursors format support +#define wxUSE_ICO_CUR 1 + +// Set to 1 to compile in wxPalette class +#define wxUSE_PALETTE 1 + +/* --- end common options --- */ + +// ---------------------------------------------------------------------------- +// Windows-only settings +// ---------------------------------------------------------------------------- + +// Set wxUSE_UNICODE_MSLU to 1 if you're compiling wxWidgets in Unicode mode +// and want to run your programs under Windows 9x and not only NT/2000/XP. +// This setting enables use of unicows.dll from MSLU (MS Layer for Unicode, see +// http://www.microsoft.com/globaldev/handson/dev/mslu_announce.mspx). Note +// that you will have to modify the makefiles to include unicows.lib import +// library as the first library (see installation instructions in install.txt +// to learn how to do it when building the library or samples). +// +// If your compiler doesn't have unicows.lib, you can get a version of it at +// http://libunicows.sourceforge.net +// +// Default is 0 +// +// Recommended setting: 0 (1 if you want to deploy Unicode apps on 9x systems) +#ifndef wxUSE_UNICODE_MSLU + #define wxUSE_UNICODE_MSLU 0 +#endif + +// Set this to 1 if you want to use wxWidgets and MFC in the same program. This +// will override some other settings (see below) +// +// Default is 0. +// +// Recommended setting: 0 unless you really have to use MFC +#define wxUSE_MFC 0 + +// Set this to 1 for generic OLE support: this is required for drag-and-drop, +// clipboard, OLE Automation. Only set it to 0 if your compiler is very old and +// can't compile/doesn't have the OLE headers. +// +// Default is 1. +// +// Recommended setting: 1 +#define wxUSE_OLE 1 + +// wxDC cacheing implementation +#define wxUSE_DC_CACHEING 1 + +// Set this to 1 to enable the use of DIB's for wxBitmap to support +// bitmaps > 16MB on Win95/98/Me. Set to 0 to use DDB's only. +#define wxUSE_DIB_FOR_BITMAP 0 + +// Set this to 1 to enable wxDIB +#define wxUSE_WXDIB 1 + +// Set to 0 to disable PostScript print/preview architecture code under Windows +// (just use Windows printing). +#define wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW 1 + +// Set this to 1 to use RICHEDIT controls for wxTextCtrl with style wxTE_RICH +// which allows to put more than ~32Kb of text in it even under Win9x (NT +// doesn't have such limitation). +// +// Default is 1 for compilers which support it +// +// Recommended setting: 1, only set it to 0 if your compiler doesn't have +// or can't compile +#if defined(__WIN95__) && !defined(__WINE__) && !defined(__GNUWIN32_OLD__) +#define wxUSE_RICHEDIT 1 + +// TODO: This should be ifdef'ed for any compilers that don't support +// RichEdit 2.0 but do have RichEdit 1.0... +#define wxUSE_RICHEDIT2 1 + +#else +#define wxUSE_RICHEDIT 0 +#define wxUSE_RICHEDIT2 0 +#endif + +// Set this to 1 to enable support for the owner-drawn menu and listboxes. This +// is required by wxUSE_CHECKLISTBOX. +// +// Default is 1. +// +// Recommended setting: 1, set to 0 for a small library size reduction +#define wxUSE_OWNER_DRAWN 1 + +// Set to 1 to compile MS Windows XP theme engine support +#define wxUSE_UXTHEME 1 + +// Set to 1 to auto-adapt to MS Windows XP themes where possible +// (notably, wxNotebook pages) +#define wxUSE_UXTHEME_AUTO 1 + +// ---------------------------------------------------------------------------- +// Generic versions of native controls +// ---------------------------------------------------------------------------- + +// Set this to 1 to be able to use wxDatePickerCtrlGeneric in addition to the +// native wxDatePickerCtrl +// +// Default is 0. +// +// Recommended setting: 0, this is mainly used for testing +#define wxUSE_DATEPICKCTRL_GENERIC 0 + +// ---------------------------------------------------------------------------- +// Crash debugging helpers +// ---------------------------------------------------------------------------- + +// Set this to 1 to be able to use wxCrashReport::Generate() to create mini +// dumps of your program when it crashes (or at any other moment) +// +// Default is 1 if supported by the compiler (VC++ and recent BC++ only). +// +// Recommended setting: 1, set to 0 if your programs never crash +#define wxUSE_CRASHREPORT 1 + +// ---------------------------------------------------------------------------- +// obsolete settings +// ---------------------------------------------------------------------------- + +// NB: all settings in this section are obsolete and should not be used/changed +// at all, they will disappear + +// Define 1 to use bitmap messages. +#define wxUSE_BITMAP_MESSAGE 1 + +#endif // _WX_SETUP_H_ + diff --git a/include/wx/os2/private.h b/include/wx/os2/private.h index aab13247a9..02a11b3ac5 100644 --- a/include/wx/os2/private.h +++ b/include/wx/os2/private.h @@ -26,13 +26,25 @@ #include #define I_NEED_OS2_H #include - #ifdef __cplusplus - extern "C" { + + // include this header from here for many of the GUI related code + #if wxUSE_GUI + extern "C" { + #include + } #endif - #include - #ifdef __cplusplus + + // provide Unix-like pipe() + #include + #include + #include + // Use ::DosCreatePipe or ::DosCreateNPipe under OS/2 + // for more see http://posix2.sourceforge.net/guide.html + inline int pipe( int WXUNUSED(filedes)[2] ) + { + wxFAIL_MSG(wxT("Implement first")); + return -1; } - #endif #endif #if defined (__EMX__) && !defined(USE_OS2_TOOLKIT_HEADERS) && !defined(HAVE_SPBCDATA) diff --git a/src/motif/dcclient.cpp b/src/motif/dcclient.cpp index 989387e18a..2c22186df2 100644 --- a/src/motif/dcclient.cpp +++ b/src/motif/dcclient.cpp @@ -443,8 +443,8 @@ void wxWindowDC::DoDrawLines( int n, wxPoint points[], wxCoord xoffset, wxCoord for (i = 0; i < n; i++) { - xpoints[i].x = XLOG2DEV (points[i].x + xoffset); - xpoints[i].y = YLOG2DEV (points[i].y + yoffset); + xpoints[i].x = (short)XLOG2DEV (points[i].x + xoffset); + xpoints[i].y = (short)YLOG2DEV (points[i].y + yoffset); } XDrawLines ((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc, xpoints, n, 0); @@ -452,8 +452,8 @@ void wxWindowDC::DoDrawLines( int n, wxPoint points[], wxCoord xoffset, wxCoord { for (i = 0; i < n; i++) { - xpoints[i].x = XLOG2DEV_2 (points[i].x + xoffset); - xpoints[i].y = YLOG2DEV_2 (points[i].y + yoffset); + xpoints[i].x = (short)XLOG2DEV_2 (points[i].x + xoffset); + xpoints[i].y = (short)YLOG2DEV_2 (points[i].y + yoffset); } XDrawLines ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking, xpoints, n, 0); } @@ -471,10 +471,10 @@ void wxWindowDC::DoDrawPolygon( int n, wxPoint points[], int i; for (i = 0; i < n; i++) { - xpoints1[i].x = XLOG2DEV (points[i].x + xoffset); - xpoints1[i].y = YLOG2DEV (points[i].y + yoffset); - xpoints2[i].x = XLOG2DEV_2 (points[i].x + xoffset); - xpoints2[i].y = YLOG2DEV_2 (points[i].y + yoffset); + xpoints1[i].x = (short)XLOG2DEV (points[i].x + xoffset); + xpoints1[i].y = (short)YLOG2DEV (points[i].y + yoffset); + xpoints2[i].x = (short)XLOG2DEV_2 (points[i].x + xoffset); + xpoints2[i].y = (short)YLOG2DEV_2 (points[i].y + yoffset); CalcBoundingBox (points[i].x + xoffset, points[i].y + yoffset); } @@ -1578,7 +1578,7 @@ void wxWindowDC::SetPen( const wxPen &pen ) { int factor = scaled_width == 0 ? 1 : scaled_width; for (int i = 0; i < req_nb_dash; i++) - real_req_dash[i] = req_dash[i] * factor; + real_req_dash[i] = (wxX11Dash)(req_dash[i] * factor); XSetDashes ((Display*) m_display, (GC) m_gc, 0, real_req_dash, req_nb_dash); if (m_window && m_window->GetBackingPixmap()) @@ -2072,10 +2072,10 @@ void wxWindowDC::DoSetClippingRegion( wxCoord x, wxCoord y, if (m_window && m_window->GetBackingPixmap()) { XRectangle rects[1]; - rects[0].x = XLOG2DEV_2(x); - rects[0].y = YLOG2DEV_2(y); - rects[0].width = XLOG2DEVREL(width); - rects[0].height = YLOG2DEVREL(height); + rects[0].x = (short)XLOG2DEV_2(x); + rects[0].y = (short)YLOG2DEV_2(y); + rects[0].width = (unsigned short)XLOG2DEVREL(width); + rects[0].height = (unsigned short)YLOG2DEVREL(height); XSetClipRectangles((Display*) m_display, (GC) m_gcBacking, 0, 0, rects, 1, Unsorted); } @@ -2094,10 +2094,10 @@ void wxWindowDC::DoSetClippingRegionAsRegion( const wxRegion& region ) if (m_window && m_window->GetBackingPixmap()) { XRectangle rects[1]; - rects[0].x = XLOG2DEV_2(box.x); - rects[0].y = YLOG2DEV_2(box.y); - rects[0].width = XLOG2DEVREL(box.width); - rects[0].height = YLOG2DEVREL(box.height); + rects[0].x = (short)XLOG2DEV_2(box.x); + rects[0].y = (short)YLOG2DEV_2(box.y); + rects[0].width = (unsigned short)XLOG2DEVREL(box.width); + rects[0].height = (unsigned short)YLOG2DEVREL(box.height); XSetClipRectangles((Display*) m_display, (GC) m_gcBacking, 0, 0, rects, 1, Unsorted); } diff --git a/src/motif/dialog.cpp b/src/motif/dialog.cpp index ec095ae2c3..c230211bfc 100644 --- a/src/motif/dialog.cpp +++ b/src/motif/dialog.cpp @@ -113,32 +113,32 @@ bool wxDialog::Create(wxWindow *parent, wxWindowID id, ChangeFont(false); // Can't remember what this was about... but I think it's necessary. - if (wxUSE_INVISIBLE_RESIZE) - { - if (pos.x > -1) - XtVaSetValues(dialogShell, XmNx, pos.x, - NULL); - if (pos.y > -1) - XtVaSetValues(dialogShell, XmNy, pos.y, - NULL); +#if wxUSE_INVISIBLE_RESIZE + if (pos.x > -1) + XtVaSetValues(dialogShell, XmNx, pos.x, + NULL); + if (pos.y > -1) + XtVaSetValues(dialogShell, XmNy, pos.y, + NULL); - if (size.x > -1) - XtVaSetValues(dialogShell, XmNwidth, size.x, NULL); - if (size.y > -1) - XtVaSetValues(dialogShell, XmNheight, size.y, NULL); - } + if (size.x > -1) + XtVaSetValues(dialogShell, XmNwidth, size.x, NULL); + if (size.y > -1) + XtVaSetValues(dialogShell, XmNheight, size.y, NULL); +#endif // Positioning of the dialog doesn't work properly unless the dialog // is managed, so we manage without mapping to the screen. // To show, we map the shell (actually it's parent). - if (!wxUSE_INVISIBLE_RESIZE) - XtVaSetValues(shell, XmNmappedWhenManaged, False, NULL); +#if !wxUSE_INVISIBLE_RESIZE + XtVaSetValues(shell, XmNmappedWhenManaged, False, NULL); +#endif + +#if !wxUSE_INVISIBLE_RESIZE + XtManageChild(dialogShell); + SetSize(pos.x, pos.y, size.x, size.y); +#endif - if (!wxUSE_INVISIBLE_RESIZE) - { - XtManageChild(dialogShell); - SetSize(pos.x, pos.y, size.x, size.y); - } XtAddEventHandler(dialogShell,ExposureMask,False, wxUniversalRepaintProc, (XtPointer) this); @@ -148,11 +148,11 @@ bool wxDialog::Create(wxWindow *parent, wxWindowID id, } bool wxDialog::XmDoCreateTLW(wxWindow* parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style, + wxWindowID WXUNUSED(id), + const wxString& WXUNUSED(title), + const wxPoint& WXUNUSED(pos), + const wxSize& WXUNUSED(size), + long WXUNUSED(style), const wxString& name) { Widget parentWidget = (Widget) 0; @@ -224,10 +224,13 @@ wxDialog::~wxDialog() } m_modalShowing = false; - if (!wxUSE_INVISIBLE_RESIZE && m_mainWidget) + +#if !wxUSE_INVISIBLE_RESIZE + if (m_mainWidget) { XtUnmapWidget((Widget) m_mainWidget); } +#endif PreDestroy(); @@ -299,10 +302,11 @@ bool wxDialog::Show( bool show ) if (show) { - if (!wxUSE_INVISIBLE_RESIZE) - XtMapWidget(XtParent((Widget) m_mainWidget)); - else - XtManageChild((Widget)m_mainWidget) ; +#if !wxUSE_INVISIBLE_RESIZE + XtMapWidget(XtParent((Widget) m_mainWidget)); +#else + XtManageChild((Widget)m_mainWidget) ; +#endif XRaiseWindow( XtDisplay( (Widget)m_mainWidget ), XtWindow( (Widget)m_mainWidget) ); @@ -310,10 +314,11 @@ bool wxDialog::Show( bool show ) } else { - if (!wxUSE_INVISIBLE_RESIZE) - XtUnmapWidget(XtParent((Widget) m_mainWidget)); - else - XtUnmanageChild((Widget)m_mainWidget) ; +#if !wxUSE_INVISIBLE_RESIZE + XtUnmapWidget(XtParent((Widget) m_mainWidget)); +#else + XtUnmanageChild((Widget)m_mainWidget) ; +#endif XFlush(XtDisplay((Widget)m_mainWidget)); XSync(XtDisplay((Widget)m_mainWidget), False); diff --git a/src/motif/evtloop.cpp b/src/motif/evtloop.cpp index c2f7d4ac31..f2edf7f43b 100644 --- a/src/motif/evtloop.cpp +++ b/src/motif/evtloop.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: motif/evtloop.cpp +// Name: src/motif/evtloop.cpp // Purpose: implements wxEventLoop for Motif // Author: Mattia Barbon // Modified by: @@ -257,7 +257,7 @@ bool CheckForAccelerator(XEvent* event) wxWindow* win = NULL; // Find the first wxWindow that corresponds to this event window - while (widget && !(win = wxGetWindowFromTable(widget))) + while (widget && ((win = wxGetWindowFromTable(widget))!=NULL)) widget = XtParent(widget); if (!widget || !win) @@ -291,7 +291,7 @@ bool CheckForKeyDown(XEvent* event) wxWindow* win = NULL; // Find the first wxWindow that corresponds to this event window - while (widget && !(win = wxGetWindowFromTable(widget))) + while (widget && ((win = wxGetWindowFromTable(widget))!=NULL)) widget = XtParent(widget); if (!widget || !win) @@ -317,7 +317,7 @@ bool CheckForKeyUp(XEvent* event) wxWindow* win = NULL; // Find the first wxWindow that corresponds to this event window - while (widget && !(win = wxGetWindowFromTable(widget))) + while (widget && ((win = wxGetWindowFromTable(widget))!=NULL)) widget = XtParent(widget); if (!widget || !win) @@ -472,7 +472,7 @@ bool wxAddIdleCallback() { if (!wxInitIdleFds()) return false; - + // install input handler for wxWakeUpIdle XtAppAddInput((XtAppContext) wxTheApp->GetAppContext(), idleFds[0], diff --git a/src/motif/frame.cpp b/src/motif/frame.cpp index 9dd9f80673..562720af2d 100644 --- a/src/motif/frame.cpp +++ b/src/motif/frame.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: motif/frame.cpp +// Name: src/motif/frame.cpp // Purpose: wxFrame // Author: Julian Smart // Modified by: @@ -184,7 +184,8 @@ bool wxFrame::Create(wxWindow *parent, PreResize(); - wxSizeEvent sizeEvent(wxSize(width, height), GetId()); + wxSize newSize(width, height); + wxSizeEvent sizeEvent(newSize, GetId()); sizeEvent.SetEventObject(this); GetEventHandler()->ProcessEvent(sizeEvent); @@ -192,11 +193,11 @@ bool wxFrame::Create(wxWindow *parent, return true; } -bool wxFrame::XmDoCreateTLW(wxWindow* parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, +bool wxFrame::XmDoCreateTLW(wxWindow* WXUNUSED(parent), + wxWindowID WXUNUSED(id), + const wxString& WXUNUSED(title), + const wxPoint& WXUNUSED(pos), + const wxSize& WXUNUSED(size), long style, const wxString& name) { @@ -330,7 +331,7 @@ void wxFrame::DoGetClientSize(int *x, int *y) const { int sbw, sbh; m_frameStatusBar->GetSize(& sbw, & sbh); - yy -= sbh; + yy = (Dimension)(yy - sbh); } #if wxUSE_TOOLBAR if (m_frameToolBar) @@ -338,9 +339,9 @@ void wxFrame::DoGetClientSize(int *x, int *y) const int tbw, tbh; m_frameToolBar->GetSize(& tbw, & tbh); if (m_frameToolBar->GetWindowStyleFlag() & wxTB_VERTICAL) - xx -= tbw; + xx = (Dimension)(xx - tbw); else - yy -= tbh; + yy = (Dimension)(yy - tbh); } #endif // wxUSE_TOOLBAR @@ -385,7 +386,8 @@ void wxFrame::DoSetClientSize(int width, int height) } PreResize(); - wxSizeEvent sizeEvent(wxSize(width, height), GetId()); + wxSize newSize(width, height); + wxSizeEvent sizeEvent(newSize, GetId()); sizeEvent.SetEventObject(this); GetEventHandler()->ProcessEvent(sizeEvent); diff --git a/src/motif/gauge.cpp b/src/motif/gauge.cpp index 9cfc19a5c0..268e733f16 100644 --- a/src/motif/gauge.cpp +++ b/src/motif/gauge.cpp @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: gauge.cpp +// Name: src/motif/gauge.cpp // Purpose: wxGauge class // Author: Julian Smart // Modified by: // Created: 17/09/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // For compilers that support precompilation, includes "wx.h". @@ -24,6 +24,10 @@ # include "wx/gauge.h" +#ifdef __OS2__ +#include +#endif + #ifdef __VMS__ #pragma message disable nosimpint #endif @@ -67,8 +71,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxGauge, wxControl) */ //// PUBLIC XMGAUGE DECLARATIONS -typedef struct _XmGaugeClassRec* XmGaugeWidgetClass; -typedef struct _XmGaugeRec* XmGaugeWidget; +typedef struct _XmGaugeClassRec* XmGaugeWidgetClass; +typedef struct _XmGaugeRec* XmGaugeWidget; #ifdef __cplusplus extern "C" WidgetClass xmGaugeWidgetClass; @@ -217,9 +221,9 @@ typedef struct { } XmGaugeClassPart; typedef struct _XmGaugeClassRec { - CoreClassPart core_class; - XmPrimitiveClassPart primitive_class; - XmGaugeClassPart gauge_class; + CoreClassPart core_class; + XmPrimitiveClassPart primitive_class; + XmGaugeClassPart gauge_class; } XmGaugeClassRec; @@ -234,16 +238,16 @@ typedef struct _XmGaugePart{ XtCallbackList valueChangedCallback; /* private fields */ - Boolean dragging; /* drag in progress ? */ + Boolean dragging; /* drag in progress ? */ int oldx, oldy; GC gc; } XmGaugePart; typedef struct _XmGaugeRec { - CorePart core; - XmPrimitivePart primitive; - XmGaugePart gauge; + CorePart core; + XmPrimitivePart primitive; + XmGaugePart gauge; } XmGaugeRec; extern XmGaugeClassRec xmGaugeClassRec; @@ -404,7 +408,7 @@ DrawSlider(XmGaugeWidget gw, Boolean clear) } switch(THIS.orientation) { case XmHORIZONTAL: - /* size = (gw->core.width - 2 * sht) / ratio; */ + /* size = (gw->core.width - 2 * sht) / ratio; */ /* A fix suggested by Dmitri Chubraev */ size = (gw->core.width - 2 * sht) /((float)THIS.maximum-(float)THIS.minimum)*(float)THIS.value; switch(THIS.processingDirection) { @@ -423,7 +427,7 @@ DrawSlider(XmGaugeWidget gw, Boolean clear) break; case XmVERTICAL: size = (gw->core.height - 2 * sht) /((float)THIS.maximum-(float)THIS.minimum)*(float)THIS.value; - /* size = (gw->core.height - 2 * sht)/ ratio; */ + /* size = (gw->core.height - 2 * sht)/ ratio; */ switch(THIS.processingDirection) { case XmMAX_ON_RIGHT: case XmMAX_ON_BOTTOM: @@ -511,7 +515,7 @@ ExposeProc(Widget w, XEvent *WXUNUSED(event), Region WXUNUSED(r)) gw->primitive.top_shadow_GC, gw->primitive.bottom_shadow_GC, 0, 0, w->core.width, w->core.height, - sht, XmSHADOW_IN); + (Dimension)sht, XmSHADOW_IN); DrawSlider(gw, False); #undef THIS } @@ -551,53 +555,53 @@ resources[] = { XmGaugeClassRec xmGaugeClassRec = { - { /* core fields */ - (WidgetClass) &xmPrimitiveClassRec, /* superclass */ - "XmGauge", /* class_name */ - sizeof(XmGaugeRec), /* widget_size */ - NULL, /* class_initialize */ - NULL, /* class_part_initialize */ - False, /* class_inited */ - Initialize, /* initialize */ - NULL, /* initialize_hook */ - XtInheritRealize, /* realize */ - actions, /* actions */ - XtNumber(actions), /* num_actions */ - resources, /* resources */ - XtNumber(resources), /* num_resources */ - NULLQUARK, /* xrm_class */ - True, /* compress_motion */ - True, /* compress_exposure */ - True, /* compress_enterleave */ - False, /* visible_interest */ - Destroy, /* destroy */ - NULL, /* resize */ - ExposeProc, /* expose */ - SetValues, /* set_values */ - NULL, /* set_values_hook */ - XtInheritSetValuesAlmost, /* set_values_almost */ - NULL, /* get_values_hook */ - NULL, /* accept_focus */ - XtVersion, /* version */ - NULL, /* callback_private */ - translations, /* tm_table */ - NULL, /* query_geometry */ - NULL, /* display_accelerator */ - NULL /* extension */ + { /* core fields */ + (WidgetClass) &xmPrimitiveClassRec, /* superclass */ + "XmGauge", /* class_name */ + sizeof(XmGaugeRec), /* widget_size */ + NULL, /* class_initialize */ + NULL, /* class_part_initialize */ + False, /* class_inited */ + Initialize, /* initialize */ + NULL, /* initialize_hook */ + XtInheritRealize, /* realize */ + actions, /* actions */ + XtNumber(actions), /* num_actions */ + resources, /* resources */ + XtNumber(resources), /* num_resources */ + NULLQUARK, /* xrm_class */ + True, /* compress_motion */ + True, /* compress_exposure */ + True, /* compress_enterleave */ + False, /* visible_interest */ + Destroy, /* destroy */ + NULL, /* resize */ + ExposeProc, /* expose */ + SetValues, /* set_values */ + NULL, /* set_values_hook */ + XtInheritSetValuesAlmost, /* set_values_almost */ + NULL, /* get_values_hook */ + NULL, /* accept_focus */ + XtVersion, /* version */ + NULL, /* callback_private */ + translations, /* tm_table */ + NULL, /* query_geometry */ + NULL, /* display_accelerator */ + NULL /* extension */ }, - /* primitive_class fields */ + /* primitive_class fields */ { - NULL, /* border_highlight */ - NULL, /* border_unhighlight */ - NULL, /* translations */ - NULL, /* arm_and_activate */ - NULL, /* syn_resources */ - 0, /* num_syn_resources */ - NULL /* extension */ - }, - { /* gauge fields */ - 0 /* empty */ - } + NULL, /* border_highlight */ + NULL, /* border_unhighlight */ + NULL, /* translations */ + NULL, /* arm_and_activate */ + NULL, /* syn_resources */ + 0, /* num_syn_resources */ + NULL /* extension */ + }, + { /* gauge fields */ + 0 /* empty */ + } }; WidgetClass xmGaugeWidgetClass = (WidgetClass)&xmGaugeClassRec; diff --git a/src/motif/gdiobj.cpp b/src/motif/gdiobj.cpp index 00289e33d8..77985aa1ad 100644 --- a/src/motif/gdiobj.cpp +++ b/src/motif/gdiobj.cpp @@ -1,14 +1,18 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: gdiobj.cpp +// Name: src/motif/gdiobj.cpp // Purpose: wxGDIObject class // Author: Julian Smart // Modified by: // Created: 17/09/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + #include "wx/gdiobj.h" IMPLEMENT_DYNAMIC_CLASS(wxGDIObject, wxObject) diff --git a/src/motif/gsockmot.cpp b/src/motif/gsockmot.cpp index c61f8346eb..ef711c8c3e 100644 --- a/src/motif/gsockmot.cpp +++ b/src/motif/gsockmot.cpp @@ -1,12 +1,13 @@ -/* ------------------------------------------------------------------------- - * Project: GSocket (Generic Socket) for WX - * Name: gsockmot.c - * Purpose: GSocket: Motif part - * CVSID: $Id$ - * Licence: The wxWindows licence - * ------------------------------------------------------------------------- */ +///////////////////////////////////////////////////////////////////////////// +// Name: src/motif/gsockmot.cpp +// Project: GSocket (Generic Socket) for WX +// Purpose: GSocket: Motif part +// CVSID: $Id$ +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// -#include "wx/setup.h" +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" #if wxUSE_SOCKETS @@ -17,24 +18,26 @@ extern "C" XtAppContext wxGetAppContext(); -static void _GSocket_Motif_Input(XtPointer data, int *fid, - XtInputId *id) +static void _GSocket_Motif_Input(XtPointer data, int *WXUNUSED(fid), + XtInputId *WXUNUSED(id)) { - GSocket *socket = (GSocket *)data; + GSocket *socket = (GSocket *)data; - socket->Detected_Read(); + socket->Detected_Read(); } -static void _GSocket_Motif_Output(XtPointer data, int *fid, - XtInputId *id) +static void _GSocket_Motif_Output(XtPointer data, int *WXUNUSED(fid), + XtInputId *WXUNUSED(id)) { - GSocket *socket = (GSocket *)data; + GSocket *socket = (GSocket *)data; - socket->Detected_Write(); + socket->Detected_Write(); } bool GSocketGUIFunctionsTableConcrete::CanUseEventLoop() -{ return true; } +{ + return true; +} bool GSocketGUIFunctionsTableConcrete::OnInit(void) { @@ -47,88 +50,88 @@ void GSocketGUIFunctionsTableConcrete::OnExit(void) bool GSocketGUIFunctionsTableConcrete::Init_Socket(GSocket *socket) { - int *m_id; + int *m_id; - socket->m_gui_dependent = (char *)malloc(sizeof(int)*2); - m_id = (int *)(socket->m_gui_dependent); + socket->m_gui_dependent = (char *)malloc(sizeof(int)*2); + m_id = (int *)(socket->m_gui_dependent); - m_id[0] = -1; - m_id[1] = -1; + m_id[0] = -1; + m_id[1] = -1; - return true; + return true; } void GSocketGUIFunctionsTableConcrete::Destroy_Socket(GSocket *socket) { - free(socket->m_gui_dependent); + free(socket->m_gui_dependent); } void GSocketGUIFunctionsTableConcrete::Install_Callback(GSocket *socket, GSocketEvent event) { - int *m_id = (int *)(socket->m_gui_dependent); - int c; + int *m_id = (int *)(socket->m_gui_dependent); + int c; - if (socket->m_fd == -1) - return; + if (socket->m_fd == -1) + return; - switch (event) - { - case GSOCK_LOST: /* fall-through */ - case GSOCK_INPUT: c = 0; break; - case GSOCK_OUTPUT: c = 1; break; - case GSOCK_CONNECTION: c = ((socket->m_server) ? 0 : 1); break; - default: return; - } + switch (event) + { + case GSOCK_LOST: /* fall-through */ + case GSOCK_INPUT: c = 0; break; + case GSOCK_OUTPUT: c = 1; break; + case GSOCK_CONNECTION: c = ((socket->m_server) ? 0 : 1); break; + default: return; + } - if (m_id[c] != -1) - XtRemoveInput(m_id[c]); + if (m_id[c] != -1) + XtRemoveInput(m_id[c]); - if (c == 0) - { - m_id[0] = XtAppAddInput(wxGetAppContext(), socket->m_fd, - (XtPointer *)XtInputReadMask, - (XtInputCallbackProc) _GSocket_Motif_Input, - (XtPointer) socket); - } - else - { - m_id[1] = XtAppAddInput(wxGetAppContext(), socket->m_fd, - (XtPointer *)XtInputWriteMask, - (XtInputCallbackProc) _GSocket_Motif_Output, - (XtPointer) socket); - } + if (c == 0) + { + m_id[0] = XtAppAddInput(wxGetAppContext(), socket->m_fd, + (XtPointer *)XtInputReadMask, + (XtInputCallbackProc) _GSocket_Motif_Input, + (XtPointer) socket); + } + else + { + m_id[1] = XtAppAddInput(wxGetAppContext(), socket->m_fd, + (XtPointer *)XtInputWriteMask, + (XtInputCallbackProc) _GSocket_Motif_Output, + (XtPointer) socket); + } } void GSocketGUIFunctionsTableConcrete::Uninstall_Callback(GSocket *socket, GSocketEvent event) { - int *m_id = (int *)(socket->m_gui_dependent); - int c; + int *m_id = (int *)(socket->m_gui_dependent); + int c; - switch (event) - { - case GSOCK_LOST: /* fall-through */ - case GSOCK_INPUT: c = 0; break; - case GSOCK_OUTPUT: c = 1; break; - case GSOCK_CONNECTION: c = ((socket->m_server) ? 0 : 1); break; - default: return; - } + switch (event) + { + case GSOCK_LOST: /* fall-through */ + case GSOCK_INPUT: c = 0; break; + case GSOCK_OUTPUT: c = 1; break; + case GSOCK_CONNECTION: c = ((socket->m_server) ? 0 : 1); break; + default: return; + } - if (m_id[c] != -1) - XtRemoveInput(m_id[c]); + if (m_id[c] != -1) + XtRemoveInput(m_id[c]); - m_id[c] = -1; + m_id[c] = -1; } void GSocketGUIFunctionsTableConcrete::Enable_Events(GSocket *socket) { - Install_Callback(socket, GSOCK_INPUT); - Install_Callback(socket, GSOCK_OUTPUT); + Install_Callback(socket, GSOCK_INPUT); + Install_Callback(socket, GSOCK_OUTPUT); } void GSocketGUIFunctionsTableConcrete::Disable_Events(GSocket *socket) { - Uninstall_Callback(socket, GSOCK_INPUT); - Uninstall_Callback(socket, GSOCK_OUTPUT); + Uninstall_Callback(socket, GSOCK_INPUT); + Uninstall_Callback(socket, GSOCK_OUTPUT); } #else /* !wxUSE_SOCKETS */ diff --git a/src/motif/icon.cpp b/src/motif/icon.cpp index f9fdf93b8d..f3904bb57f 100644 --- a/src/motif/icon.cpp +++ b/src/motif/icon.cpp @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: icon.cpp +// Name: src/motif/icon.cpp // Purpose: wxIcon class // Author: Julian Smart // Modified by: // Created: 17/09/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // For compilers that support precompilation, includes "wx.h". @@ -57,7 +57,7 @@ bool wxIcon::LoadFile(const wxString& filename, wxBitmapType type, UnRef(); wxBitmapHandler *handler = FindHandler(type); - + if ( handler ) return handler->LoadFile(this, filename, type, desiredWidth, desiredHeight); diff --git a/src/motif/listbox.cpp b/src/motif/listbox.cpp index f9c75ae82a..0f5deaca4d 100644 --- a/src/motif/listbox.cpp +++ b/src/motif/listbox.cpp @@ -306,7 +306,7 @@ int wxDoFindStringInList(Widget w, const wxString& s) return -1; } -int wxListBox::FindString(const wxString& s, bool bCase) const +int wxListBox::FindString(const wxString& s, bool WXUNUSED(bCase)) const { // FIXME: back to base class for not supported value of bCase diff --git a/src/motif/menu.cpp b/src/motif/menu.cpp index a394709cbb..9bc0d3a2af 100644 --- a/src/motif/menu.cpp +++ b/src/motif/menu.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: menu.cpp +// Name: src/motif/menu.cpp // Purpose: wxMenu, wxMenuBar, wxMenuItem // Author: Julian Smart // Modified by: @@ -140,7 +140,7 @@ wxMenuItem* wxMenu::DoInsert(size_t pos, wxMenuItem *item) item->GetSubMenu()->m_topLevelMenu = m_topLevelMenu; } - return pos == GetMenuItemCount() ? wxMenuBase::DoAppend(item) : + return pos == GetMenuItemCount() ? wxMenuBase::DoAppend(item) : wxMenuBase::DoInsert(pos, item); } @@ -338,12 +338,14 @@ wxMenuItem *wxMenuBar::FindItem(int id, wxMenu ** itemMenu) const if (itemMenu) *itemMenu = NULL; - wxMenuItem *item = NULL; size_t menuCount = GetMenuCount(); for (size_t i = 0; i < menuCount; i++) - if ((item = m_menus.Item(i)->GetData()->FindItem(id, itemMenu))) - return item; - return NULL; + { + wxMenuItem *item = m_menus.Item(i)->GetData()->FindItem(id, itemMenu); + if (item) return item; + } + + return NULL; } // Create menubar @@ -465,7 +467,12 @@ void wxMenu::DestroyWidgetAndDetach() * */ -WXWidget wxMenu::CreateMenu (wxMenuBar * menuBar, WXWidget parent, wxMenu * topMenu, size_t index, const wxString& title, bool pullDown) +WXWidget wxMenu::CreateMenu (wxMenuBar * menuBar, + WXWidget parent, + wxMenu * topMenu, + size_t WXUNUSED(index), + const wxString& title, + bool pullDown) { Widget menu = (Widget) 0; Widget buttonWidget = (Widget) 0; @@ -671,6 +678,8 @@ void wxMenu::ChangeFont(bool keepOriginalSize) if (item->GetSubMenu()) item->GetSubMenu()->ChangeFont(keepOriginalSize); } +#else + wxUnusedVar(keepOriginalSize); #endif } diff --git a/src/motif/minifram.cpp b/src/motif/minifram.cpp index d1aabac578..b2e1ad6746 100644 --- a/src/motif/minifram.cpp +++ b/src/motif/minifram.cpp @@ -1,14 +1,17 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: minifram.cpp +// Name: src/motif/minifram.cpp // Purpose: wxMiniFrame. Optional; identical to wxFrame if not supported. // Author: Julian Smart // Modified by: // Created: 17/09/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + #include "wx/minifram.h" IMPLEMENT_DYNAMIC_CLASS(wxMiniFrame, wxFrame) diff --git a/src/motif/palette.cpp b/src/motif/palette.cpp index c7021da303..1a203ae82c 100644 --- a/src/motif/palette.cpp +++ b/src/motif/palette.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: palette.cpp +// Name: src/motif/palette.cpp // Purpose: wxPalette // Author: Julian Smart // Modified by: @@ -147,9 +147,9 @@ bool wxPalette::Create(int n, const unsigned char *red, const unsigned char *gre pix_array_n = n; xcol.flags = DoRed | DoGreen | DoBlue; for(int i = 0; i < n; i++) { - xcol.red = (unsigned short)red[i] << 8; - xcol.green = (unsigned short)green[i] << 8; - xcol.blue = (unsigned short)blue[i] << 8; + xcol.red = (unsigned short)(red[i] << 8); + xcol.green = (unsigned short)(green[i] << 8); + xcol.blue = (unsigned short)(blue[i] << 8); pix_array[i] = (XAllocColor(display, cmap, &xcol) == 0) ? 0 : xcol.pixel; } @@ -165,7 +165,9 @@ bool wxPalette::Create(int n, const unsigned char *red, const unsigned char *gre return true; } -int wxPalette::GetPixel(const unsigned char red, const unsigned char green, const unsigned char blue) const +int wxPalette::GetPixel(const unsigned char WXUNUSED(red), + const unsigned char WXUNUSED(green), + const unsigned char WXUNUSED(blue)) const { if ( !m_refData ) return false; @@ -290,9 +292,9 @@ bool wxPalette::TransferBitmap8(unsigned char *data, unsigned long sz, struct rgb24 { unsigned char r, g, b; } *dptr = (struct rgb24 *)dest; while(sz-- > 0) { if((int)*data < pix_array_n) { - dptr->r = pix_array[*data] & 0xFF; - dptr->g = (pix_array[*data] >> 8) & 0xFF; - dptr->b = (pix_array[*data] >> 16) & 0xFF; + dptr->r = (unsigned char)(pix_array[*data] & 0xFF); + dptr->g = (unsigned char)((pix_array[*data] >> 8) & 0xFF); + dptr->b = (unsigned char)((pix_array[*data] >> 16) & 0xFF); } data++; dptr++; diff --git a/src/motif/radiobut.cpp b/src/motif/radiobut.cpp index 5f9674abce..82c359104b 100644 --- a/src/motif/radiobut.cpp +++ b/src/motif/radiobut.cpp @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: radiobut.cpp +// Name: src/motif/radiobut.cpp // Purpose: wxRadioButton // Author: Julian Smart // Modified by: // Created: 17/09/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // For compilers that support precompilation, includes "wx.h". @@ -147,7 +147,7 @@ void wxRadioButton::ChangeBackgroundColour() NULL); } -void wxRadioButtonCallback (Widget w, XtPointer clientData, +void wxRadioButtonCallback (Widget WXUNUSED(w), XtPointer clientData, XmToggleButtonCallbackStruct * cbs) { if (!cbs->set) diff --git a/src/motif/scrolbar.cpp b/src/motif/scrolbar.cpp index 2fe66c299d..789220c16f 100644 --- a/src/motif/scrolbar.cpp +++ b/src/motif/scrolbar.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: scrolbar.cpp +// Name: src/motif/scrolbar.cpp // Purpose: wxScrollBar // Author: Julian Smart // Modified by: diff --git a/src/motif/settings.cpp b/src/motif/settings.cpp index 628c7c1774..1db7bea1f4 100644 --- a/src/motif/settings.cpp +++ b/src/motif/settings.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: motif/settings.cpp +// Name: src/motif/settings.cpp // Purpose: wxSettings // Author: Julian Smart // Modified by: @@ -41,7 +41,7 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index) if (NULL == but_setting_wid && wxTheApp && wxTheApp->GetTopLevelWidget()) { but_setting_wid = XtVaCreateWidget("settings_button", xmPushButtonWidgetClass, - (Widget)wxTheApp->GetTopLevelWidget(), NULL); + (Widget)wxTheApp->GetTopLevelWidget(), NULL); } switch (index) @@ -70,7 +70,9 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index) XtVaGetValues(but_setting_wid, XtVaTypedArg, XmNbackground, XtRColor, &bg, sizeof(bg), NULL); - return wxColor(bg.red >> 8, bg.green >> 8, bg.blue >> 8); + return wxColor((unsigned char)(bg.red >> 8), + (unsigned char)(bg.green >> 8), + (unsigned char)(bg.blue >> 8)); } else { @@ -113,7 +115,9 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index) XtVaGetValues(but_setting_wid, XtVaTypedArg, XmNforeground, XtRColor, &fg, sizeof(fg), NULL); - return wxColor(fg.red >> 8, fg.green >> 8, fg.blue >> 8); + return wxColor((unsigned char)(fg.red >> 8), + (unsigned char)(fg.green >> 8), + (unsigned char)(fg.blue >> 8)); } else { @@ -133,7 +137,9 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index) XtVaGetValues(but_setting_wid, XtVaTypedArg, XmNbackground, XtRColor, &bg, sizeof(bg), NULL); - return wxColor(bg.red >> 8, bg.green >> 8, bg.blue >> 8); + return wxColor((unsigned char)(bg.red >> 8), + (unsigned char)(bg.green >> 8), + (unsigned char)(bg.blue >> 8)); } else { @@ -163,11 +169,13 @@ wxFont wxSystemSettingsNative::GetFont(wxSystemFont index) || wxFont::GetDefaultEncoding() == wxFONTENCODING_EUC_JP) pointSize = 15; + wxFont font; + switch (index) { case wxSYS_SYSTEM_FIXED_FONT: { - return wxFont(pointSize, wxMODERN, wxNORMAL, wxNORMAL, false); + font = wxFont(pointSize, wxMODERN, wxNORMAL, wxNORMAL, false); break; } case wxSYS_DEVICE_DEFAULT_FONT: @@ -175,12 +183,12 @@ wxFont wxSystemSettingsNative::GetFont(wxSystemFont index) case wxSYS_DEFAULT_GUI_FONT: default: { - return wxFont(pointSize, wxSWISS, wxNORMAL, wxNORMAL, false); + font = wxFont(pointSize, wxSWISS, wxNORMAL, wxNORMAL, false); break; } } - return wxFont(); + return font; } // Get a system metric, e.g. scrollbar size @@ -193,7 +201,7 @@ int wxSystemSettingsNative::GetMetric(wxSystemMetric index, wxWindow* WXUNUSED(w case wxSYS_HSCROLL_Y: case wxSYS_VSCROLL_X: return 15; - + case wxSYS_SCREEN_X: return_value = DisplayWidth( wxGlobalDisplay(), 0 ); break; diff --git a/src/motif/spinbutt.cpp b/src/motif/spinbutt.cpp index f01ea0a2a4..e742ea7be4 100644 --- a/src/motif/spinbutt.cpp +++ b/src/motif/spinbutt.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: spinbutt.cpp +// Name: src/motif/spinbutt.cpp // Purpose: wxSpinButton // Author: Julian Smart // Modified by: @@ -182,7 +182,8 @@ void wxArrowButton::StopTimerCallback( Widget w, XtPointer clientData, btn->m_timer = 0; } -bool wxArrowButton::Create( wxSpinButton* parent, wxWindowID id, +bool wxArrowButton::Create( wxSpinButton* parent, + wxWindowID WXUNUSED(id), ArrowDirection d, const wxPoint& pos, const wxSize& size ) { diff --git a/src/motif/textctrl.cpp b/src/motif/textctrl.cpp index 0efb6c71d0..ef011a5056 100644 --- a/src/motif/textctrl.cpp +++ b/src/motif/textctrl.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: textctrl.cpp +// Name: src/motif/textctrl.cpp // Purpose: wxTextCtrl // Author: Julian Smart // Modified by: @@ -136,7 +136,7 @@ bool wxTextCtrl::Create(wxWindow *parent, XtSetArg (args[count], (String) wxFont::GetFontTag(), m_font.GetFontType( XtDisplay(parentWidget) ) ); ++count; XtSetArg (args[count], XmNwordWrap, wantWordWrap); ++count; - XtSetArg (args[count], XmNvalue, value.c_str()); ++count; + XtSetArg (args[count], XmNvalue, value.c_str()); ++count; XtSetArg (args[count], XmNeditable, style & wxTE_READONLY ? False : True); ++count; XtSetArg (args[count], XmNeditMode, XmMULTI_LINE_EDIT ); ++count; @@ -249,7 +249,7 @@ void wxTextCtrl::SetValue(const wxString& text) SetInsertionPoint(text.length()); XmTextShowPosition ((Widget) m_mainWidget, text.length()); - m_modified = TRUE; + m_modified = true; m_inSetValue = false; } @@ -498,7 +498,7 @@ wxString wxTextCtrl::GetLineText(long lineNo) const if (s) { - wxString buf(""); + wxString buf; long i; int currentLine = 0; for (i = 0; currentLine != lineNo && s[i]; i++ ) @@ -549,7 +549,7 @@ void wxTextCtrl::OnChar(wxKeyEvent& event) textStruct->doit = True; if (isascii(event.m_keyCode) && (textStruct->text->length == 1)) { - textStruct->text->ptr[0] = ((event.m_keyCode == WXK_RETURN) ? 10 : event.m_keyCode); + textStruct->text->ptr[0] = (char)((event.m_keyCode == WXK_RETURN) ? 10 : event.m_keyCode); } } } diff --git a/src/motif/toolbar.cpp b/src/motif/toolbar.cpp index 70fa4d3931..b7a1a782aa 100644 --- a/src/motif/toolbar.cpp +++ b/src/motif/toolbar.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: motif/toolbar.cpp +// Name: src/motif/toolbar.cpp // Purpose: wxToolBar // Author: Julian Smart // Modified by: 13.12.99 by VZ during toolbar classes reorganization @@ -417,7 +417,7 @@ bool wxToolBar::Realize() (Pixmap)tmp.GetDrawable() : tool->GetInsensPixmap(); } - + if (tool->CanBeToggled()) { // Toggle button @@ -492,7 +492,7 @@ bool wxToolBar::DoInsertTool(size_t WXUNUSED(pos), wxToolBarToolBase *tool) return true; } -bool wxToolBar::DoDeleteTool(size_t pos, wxToolBarToolBase *tool) +bool wxToolBar::DoDeleteTool(size_t WXUNUSED(pos), wxToolBarToolBase *tool) { tool->Detach(); @@ -516,7 +516,7 @@ bool wxToolBar::DoDeleteTool(size_t pos, wxToolBarToolBase *tool) offset = isVertical ? size.y : size.x; offset += packing; break; - } + } case wxTOOL_STYLE_SEPARATOR: offset = isVertical ? 0 : separatorSize; break; @@ -542,14 +542,14 @@ bool wxToolBar::DoDeleteTool(size_t pos, wxToolBarToolBase *tool) { case wxTOOL_STYLE_CONTROL: { - wxPoint pos = t->GetControl()->GetPosition(); + wxPoint location = t->GetControl()->GetPosition(); if( isVertical ) - pos.y -= offset; + location.y -= offset; else - pos.x -= offset; + location.x -= offset; - t->GetControl()->Move( pos ); + t->GetControl()->Move( location ); break; } case wxTOOL_STYLE_SEPARATOR: @@ -563,9 +563,9 @@ bool wxToolBar::DoDeleteTool(size_t pos, wxToolBarToolBase *tool) NULL ); if( isVertical ) - y -= offset; + y = (Dimension)(y - offset); else - x -= offset; + x = (Dimension)(x - offset); XtVaSetValues( t->GetButtonWidget(), XmNx, x, @@ -621,12 +621,12 @@ void wxToolBar::DoSetSize(int x, int y, int width, int height, int sizeFlags) } wxToolBarBase::DoSetSize(x, y, width, height, sizeFlags); - + // We must refresh the frame size when the toolbar changes size // otherwise the toolbar can be shown incorrectly if ( old_width != width || old_height != height ) { - // But before we send the size event check it + // But before we send the size event check it // we have a frame that is not being deleted. wxFrame *frame = wxDynamicCast(GetParent(), wxFrame); if ( frame && !frame->IsBeingDeleted() ) @@ -754,7 +754,7 @@ void wxToolBarTimer::Notify() // Move the tooltip more or less above the button int yOffset = 20; // TODO: What should be really? - y -= yOffset; + y = (Position)(y - yOffset); if (y < yOffset) y = 0; /************************************************************/ diff --git a/src/motif/toplevel.cpp b/src/motif/toplevel.cpp index 7d0613e6b8..01342c5b9b 100644 --- a/src/motif/toplevel.cpp +++ b/src/motif/toplevel.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: motif/toplevel.cpp +// Name: src/motif/toplevel.cpp // Purpose: wxTopLevelWindow Motif implementation // Author: Mattia Barbon // Modified by: @@ -270,8 +270,8 @@ WXWidget wxTopLevelWindowMotif::GetShellWidget() const return (WXWidget) GetShell( this ); } -bool wxTopLevelWindowMotif::ShowFullScreen( bool show, - long style ) +bool wxTopLevelWindowMotif::ShowFullScreen( bool WXUNUSED(show), + long WXUNUSED(style) ) { // TODO, see wxGTK return false; @@ -318,7 +318,7 @@ bool wxTopLevelWindowMotif::IsIconized() const XmNiconic, &iconic, NULL ); - return iconic; + return (iconic == True); } void wxTopLevelWindowMotif::Maximize( bool maximize ) diff --git a/src/motif/utils.cpp b/src/motif/utils.cpp index fee2d0fb03..a0838b3bb0 100644 --- a/src/motif/utils.cpp +++ b/src/motif/utils.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: utils.cpp +// Name: src/motif/utils.cpp // Purpose: Various utilities // Author: Julian Smart // Modified by: @@ -180,7 +180,7 @@ static char * GetIniFile (char *dest, const char *filename) { strcpy(dest, filename); } - else if ((home = wxGetUserHome("")) != NULL) + else if ((home = wxGetUserHome()) != NULL) { strcpy(dest, home); if (dest[strlen(dest) - 1] != '/') @@ -314,7 +314,7 @@ bool wxGetResource(const wxString& section, const wxString& entry, char **value, XrmDatabase database; - if (file != "") + if (!file.empty()) { char buffer[500]; @@ -454,7 +454,7 @@ void wxXMergeDatabases (wxApp * theApp, Display * display) environment = GetIniFile (filename, NULL); len = strlen (environment); wxString hostname = wxGetHostName(); - if ( !!hostname ) + if ( !hostname.empty() ) strncat(environment, hostname, 1024 - len); } homeDB = XrmGetFileDatabase (environment); @@ -667,9 +667,9 @@ void wxHSVToXColor(wxHSV *hsv,XColor *rgb) case 4: r = t, g = p, b = v; break; case 5: r = v, g = p, b = q; break; } - rgb->red = r << 8; - rgb->green = g << 8; - rgb->blue = b << 8; + rgb->red = (unsigned short)(r << 8); + rgb->green = (unsigned short)(g << 8); + rgb->blue = (unsigned short)(b << 8); } void wxXColorToHSV(wxHSV *hsv,XColor *rgb) @@ -811,6 +811,7 @@ char wxFindMnemonic (const char *s) char* wxFindAccelerator( const char *s ) { #if 1 + wxUnusedVar(s); // VZ: this function returns incorrect keysym which completely breaks kbd // handling return NULL; @@ -878,6 +879,7 @@ char* wxFindAccelerator( const char *s ) XmString wxFindAcceleratorText (const char *s) { #if 1 + wxUnusedVar(s); // VZ: this function returns incorrect keysym which completely breaks kbd // handling return NULL; @@ -934,6 +936,9 @@ extern void wxDoChangeFont(WXWidget widget, const wxFont& font) XtVaSetValues( w, wxFont::GetFontTag(), font.GetFontTypeC( XtDisplay(w) ), NULL ); +#else + wxUnusedVar(widget); + wxUnusedVar(font); #endif } diff --git a/src/motif/window.cpp b/src/motif/window.cpp index 2f588ebfef..97c6ec4941 100644 --- a/src/motif/window.cpp +++ b/src/motif/window.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: windows.cpp +// Name: src/motif/windows.cpp // Purpose: wxWindow // Author: Julian Smart // Modified by: @@ -200,7 +200,7 @@ void wxWindow::Init() m_winCaptured = false; m_isShown = true; - + m_hScrollBar = m_vScrollBar = m_borderWidget = @@ -352,7 +352,7 @@ wxWindow::~wxWindow() { if (g_captureWindow == this) g_captureWindow = NULL; - + m_isBeingDeleted = true; // Motif-specific actions first @@ -747,12 +747,12 @@ int wxWindow::GetScrollPos(int orient) const int wxWindow::GetScrollRange(int orient) const { Widget scrollBar = (Widget)GetScrollbar((wxOrientation)orient); - // CE scintilla windows don't always have these scrollbars + // CE scintilla windows don't always have these scrollbars // and it tends to pile up a whole bunch of asserts //wxCHECK_MSG( scrollBar, 0, "no such scrollbar" ); int range = 0; - if (scrollBar) + if (scrollBar) XtVaGetValues(scrollBar, XmNmaximum, &range, NULL); return range; } @@ -1175,7 +1175,7 @@ void wxWindow::DoGetSize(int *x, int *y) const XmNwidth, &xx, XmNheight, &yy, NULL ); - if(x) *x = xx; + if(x) *x = xx; if(y) *y = yy; } @@ -1183,7 +1183,7 @@ void wxWindow::DoGetPosition(int *x, int *y) const { Widget widget = (Widget) ( m_drawingArea ? - ( m_borderWidget ? m_borderWidget : m_scrolledWindow ) : + ( m_borderWidget ? m_borderWidget : m_scrolledWindow ) : GetTopWidget() ); Position xx, yy; @@ -1194,8 +1194,8 @@ void wxWindow::DoGetPosition(int *x, int *y) const if (GetParent()) { wxPoint pt(GetParent()->GetClientAreaOrigin()); - xx -= pt.x; - yy -= pt.y; + xx = (Position)(xx - pt.x); + yy = (Position)(yy - pt.y); } if(x) *x = xx; @@ -1455,7 +1455,7 @@ int wxWindow::GetCharHeight() const wxCHECK_MSG( m_font.Ok(), 0, "valid window font needed" ); int height; - + wxGetTextExtent (GetXDisplay(), m_font, 1.0, "x", NULL, &height, NULL, NULL); @@ -1467,7 +1467,7 @@ int wxWindow::GetCharWidth() const wxCHECK_MSG( m_font.Ok(), 0, "valid window font needed" ); int width; - + wxGetTextExtent (GetXDisplay(), m_font, 1.0, "x", &width, NULL, NULL, NULL); @@ -1894,9 +1894,8 @@ void wxWidgetResizeProc(Widget w, XConfigureEvent *WXUNUSED(event), if (win->PreResize()) { - int width, height; - win->GetSize(&width, &height); - wxSizeEvent sizeEvent(wxSize(width, height), win->GetId()); + wxSize newSize(win->GetSize()); + wxSizeEvent sizeEvent(newSize, win->GetId()); sizeEvent.SetEventObject(win); win->GetEventHandler()->ProcessEvent(sizeEvent); } @@ -2315,10 +2314,10 @@ bool wxTranslateMouseEvent(wxMouseEvent& wxevent, wxWindow *win, || (event_right_is_down (xevent) && (eventType != wxEVT_RIGHT_UP))); - wxevent.m_shiftDown = xevent->xbutton.state & ShiftMask; - wxevent.m_controlDown = xevent->xbutton.state & ControlMask; - wxevent.m_altDown = xevent->xbutton.state & Mod3Mask; - wxevent.m_metaDown = xevent->xbutton.state & Mod1Mask; + wxevent.m_shiftDown = (xevent->xbutton.state & ShiftMask) == ShiftMask; + wxevent.m_controlDown = (xevent->xbutton.state & ControlMask) == ControlMask; + wxevent.m_altDown = (xevent->xbutton.state & Mod3Mask) == Mod3Mask; + wxevent.m_metaDown = (xevent->xbutton.state & Mod1Mask) == Mod1Mask; wxevent.SetId(win->GetId()); wxevent.SetEventObject(win); @@ -2364,9 +2363,8 @@ bool wxTranslateKeyEvent(wxKeyEvent& wxevent, wxWindow *win, if (id > -1) return true; - else - return false; - break; + + return false; } default: break; @@ -2389,9 +2387,9 @@ int wxComputeColours (Display *display, wxColour * back, wxColour * fore) if (back) { - g_itemColors[0].red = (((long) back->Red ()) << 8); - g_itemColors[0].green = (((long) back->Green ()) << 8); - g_itemColors[0].blue = (((long) back->Blue ()) << 8); + g_itemColors[0].red = (unsigned short)(((long) back->Red ()) << 8); + g_itemColors[0].green = (unsigned short)(((long) back->Green ()) << 8); + g_itemColors[0].blue = (unsigned short)(((long) back->Blue ()) << 8); g_itemColors[0].flags = DoRed | DoGreen | DoBlue; if (colorProc == (XmColorProc) NULL) { @@ -2409,9 +2407,9 @@ int wxComputeColours (Display *display, wxColour * back, wxColour * fore) } if (fore) { - g_itemColors[wxFORE_INDEX].red = (((long) fore->Red ()) << 8); - g_itemColors[wxFORE_INDEX].green = (((long) fore->Green ()) << 8); - g_itemColors[wxFORE_INDEX].blue = (((long) fore->Blue ()) << 8); + g_itemColors[wxFORE_INDEX].red = (unsigned short)(((long) fore->Red ()) << 8); + g_itemColors[wxFORE_INDEX].green = (unsigned short)(((long) fore->Green ()) << 8); + g_itemColors[wxFORE_INDEX].blue = (unsigned short)(((long) fore->Blue ()) << 8); g_itemColors[wxFORE_INDEX].flags = DoRed | DoGreen | DoBlue; if (result == wxNO_COLORS) result = wxFORE_COLORS;