diff --git a/.mailmap b/.mailmap index 3a58332ba7..79a840e34a 100644 --- a/.mailmap +++ b/.mailmap @@ -1,6 +1,7 @@ ARATA Mizuki Artur Wieczorek Daniel Kulp +Blake Eryx Bogdan Iordanescu Cătălin Răceanu @@ -31,7 +32,9 @@ Richard Fath Steve Browne Tim Kosse -Tim Stahlhut +Tim Stahlhut +Tim Stahlhut +Tim Stahlhut Tobias Taschner Václav Slavík diff --git a/.travis.yml b/.travis.yml index f3ffc1cad3..8380d561c1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,7 @@ matrix: env: wxGTK_VERSION=3 wxCONFIGURE_FLAGS="--enable-cxx11 --enable-stl" wxMAKEFILE_FLAGS="CXXFLAGS=-std=c++11" - dist: trusty compiler: clang - env: wxCONFIGURE_FLAGS="--disable-shared --disable-sys-libs" + env: wxCONFIGURE_FLAGS="--disable-shared --disable-sys-libs --disable-webview" - dist: trusty compiler: gcc env: wxTOOLSET=cmake wxCMAKE_GENERATOR="Unix Makefiles" diff --git a/Makefile.in b/Makefile.in index d7bc3e8d99..04eaa957f2 100644 --- a/Makefile.in +++ b/Makefile.in @@ -2176,6 +2176,16 @@ COND_USE_STC_1___wxscintilla___depname = \ @COND_PLATFORM_UNIX_1@PLUGIN_VERSION0 = $(WX_VERSION) @COND_PLATFORM_UNIX_0@PLUGVERDELIM = @COND_PLATFORM_UNIX_1@PLUGVERDELIM = - +COND_PLATFORM_WIN32_1_QT_PLATFORM_HDR = \ + wx/msw/dib.h \ + wx/msw/ole/automtn.h \ + wx/msw/joystick.h \ + wx/msw/sound.h \ + wx/msw/ole/safearray.h \ + wx/msw/ole/oleutils.h \ + wx/msw/ole/comimpl.h \ + wx/msw/ole/uuid.h +@COND_PLATFORM_WIN32_1@QT_PLATFORM_HDR = $(COND_PLATFORM_WIN32_1_QT_PLATFORM_HDR) COND_PLATFORM_MACOSX_1_GTK_PLATFORM_HDR = \ wx/generic/caret.h \ wx/generic/imaglist.h \ @@ -2210,7 +2220,6 @@ COND_PLATFORM_WIN32_1_GTK_PLATFORM_HDR = \ @COND_PLATFORM_WIN32_1@GTK_PLATFORM_HDR = $(COND_PLATFORM_WIN32_1_GTK_PLATFORM_HDR) @COND_TOOLKIT_GTK_TOOLKIT_VERSION_2@UNIV_PLATFORM_HDR \ @COND_TOOLKIT_GTK_TOOLKIT_VERSION_2@ = wx/generic/animate.h -@COND_TOOLKIT_MSW@UNIV_PLATFORM_HDR = wx/msw/evtloop.h @COND_TOOLKIT_MSW@UNIV_PLATFORM_HDR = wx/generic/animate.h @COND_TOOLKIT_X11@UNIV_PLATFORM_HDR = wx/generic/animate.h @COND_TOOLKIT_MSW@MSW_HTML_HDR = wx/msw/helpbest.h @@ -2772,12 +2781,12 @@ COND_TOOLKIT_MSW_LOWLEVEL_HDR = \ wx/msw/popupwin.h \ wx/msw/uxtheme.h \ wx/msw/htmlhelp.h \ - wx/generic/activityindicator.h \ wx/msw/helpwin.h \ wx/msw/taskbar.h \ wx/msw/helpchm.h \ wx/msw/sound.h \ - wx/msw/joystick.h + wx/msw/joystick.h \ + wx/msw/evtloop.h @COND_TOOLKIT_MSW@LOWLEVEL_HDR = $(COND_TOOLKIT_MSW_LOWLEVEL_HDR) @COND_TOOLKIT_OSX_COCOA@LOWLEVEL_HDR = @COND_TOOLKIT_OSX_IPHONE@LOWLEVEL_HDR = @@ -3163,7 +3172,6 @@ COND_TOOLKIT_MSW_GUI_HDR = \ wx/msw/dirdlg.h \ wx/msw/dragimag.h \ wx/msw/enhmeta.h \ - wx/msw/evtloop.h \ wx/msw/filedlg.h \ wx/msw/font.h \ wx/msw/frame.h \ @@ -3234,6 +3242,7 @@ COND_TOOLKIT_MSW_GUI_HDR = \ wx/msw/timectrl.h \ wx/msw/datectrl.h \ wx/msw/calctrl.h \ + wx/generic/activityindicator.h \ wx/msw/checklst.h \ wx/msw/fdrepdlg.h \ wx/msw/fontdlg.h \ @@ -3305,7 +3314,6 @@ COND_TOOLKIT_OSX_COCOA_GUI_HDR = \ wx/osx/fontdlg.h \ wx/osx/frame.h \ wx/osx/gauge.h \ - wx/osx/imaglist.h \ wx/osx/listbox.h \ wx/osx/listctrl.h \ wx/osx/mdi.h \ @@ -3359,6 +3367,7 @@ COND_TOOLKIT_OSX_COCOA_GUI_HDR = \ wx/generic/statusbr.h \ wx/osx/appprogress.h \ wx/generic/icon.h \ + wx/generic/imaglist.h \ wx/osx/cocoa/chkconf.h \ wx/osx/cocoa/evtloop.h \ wx/osx/cocoa/private.h \ @@ -3415,7 +3424,6 @@ COND_TOOLKIT_OSX_IPHONE_GUI_HDR = \ wx/osx/fontdlg.h \ wx/osx/frame.h \ wx/osx/gauge.h \ - wx/osx/imaglist.h \ wx/osx/listbox.h \ wx/osx/listctrl.h \ wx/osx/mdi.h \ @@ -3469,6 +3477,7 @@ COND_TOOLKIT_OSX_IPHONE_GUI_HDR = \ wx/generic/statusbr.h \ wx/osx/appprogress.h \ wx/generic/icon.h \ + wx/generic/imaglist.h \ wx/osx/iphone/chkconf.h \ wx/osx/iphone/evtloop.h \ wx/osx/iphone/private.h \ @@ -3479,8 +3488,6 @@ COND_TOOLKIT_OSX_IPHONE_GUI_HDR = \ COND_TOOLKIT_QT_GUI_HDR = \ wx/qt/accel.h \ wx/qt/app.h \ - wx/qt/apptbase.h \ - wx/qt/apptrait.h \ wx/qt/bitmap.h \ wx/qt/bmpbuttn.h \ wx/qt/brush.h \ @@ -3496,7 +3503,6 @@ COND_TOOLKIT_QT_GUI_HDR = \ wx/qt/colour.h \ wx/qt/combobox.h \ wx/qt/control.h \ - wx/qt/converter.h \ wx/qt/ctrlsub.h \ wx/qt/cursor.h \ wx/qt/dataform.h \ @@ -3547,16 +3553,12 @@ COND_TOOLKIT_QT_GUI_HDR = \ wx/qt/statusbar.h \ wx/qt/stattext.h \ wx/qt/textctrl.h \ - wx/qt/textdlg.h \ wx/qt/textentry.h \ wx/qt/tglbtn.h \ - wx/qt/timer.h \ wx/qt/toolbar.h \ wx/qt/tooltip.h \ wx/qt/toplevel.h \ - wx/qt/utils.h \ wx/qt/window.h \ - wx/qt/private/winevent.h \ wx/generic/fdrepdlg.h \ wx/generic/filepickerg.h \ wx/generic/clrpickerg.h \ @@ -3568,7 +3570,8 @@ COND_TOOLKIT_QT_GUI_HDR = \ wx/qt/taskbar.h \ wx/generic/activityindicator.h \ wx/qt/dataview.h \ - wx/qt/dvrenderers.h + wx/qt/dvrenderers.h \ + $(QT_PLATFORM_HDR) @COND_TOOLKIT_QT@GUI_HDR = $(COND_TOOLKIT_QT_GUI_HDR) @COND_TOOLKIT_COCOA@MEDIA_PLATFORM_HDR = @COND_TOOLKIT_GTK@MEDIA_PLATFORM_HDR = @@ -3783,7 +3786,6 @@ COND_USE_GUI_1_ALL_GUI_HEADERS = \ wx/dialup.h \ wx/dirctrl.h \ wx/display.h \ - wx/display_impl.h \ wx/dnd.h \ wx/docmdi.h \ wx/docview.h \ @@ -4872,7 +4874,6 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION____LOWLEVEL_SRC_OBJECTS = \ monodll_generic_caret.o \ monodll_generic_imaglist.o \ monodll_unix_dialup.o \ - monodll_displayx11.o \ monodll_unix_fontenum.o \ monodll_unix_fontutil.o \ monodll_uiactionx11.o \ @@ -4912,7 +4913,8 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION____LOWLEVEL_SRC_OBJECTS = \ monodll_gtk1_toplevel.o \ monodll_gtk1_utilsgtk.o \ monodll_gtk1_win_gtk.o \ - monodll_gtk1_window.o + monodll_gtk1_window.o \ + monodll_displayx11.o @COND_TOOLKIT_GTK_TOOLKIT_VERSION_@__LOWLEVEL_SRC_OBJECTS = $(COND_TOOLKIT_GTK_TOOLKIT_VERSION____LOWLEVEL_SRC_OBJECTS) COND_TOOLKIT_GTK_TOOLKIT_VERSION_2___LOWLEVEL_SRC_OBJECTS = \ $(__GTK_PLATFORM_SRC_OBJECTS) \ @@ -5032,7 +5034,6 @@ COND_TOOLKIT_MOTIF___LOWLEVEL_SRC_OBJECTS = \ monodll_generic_caret.o \ monodll_generic_imaglist.o \ monodll_unix_dialup.o \ - monodll_displayx11.o \ monodll_unix_fontenum.o \ monodll_unix_fontutil.o \ monodll_uiactionx11.o \ @@ -5047,7 +5048,8 @@ COND_TOOLKIT_MOTIF___LOWLEVEL_SRC_OBJECTS = \ monodll_x11_palette.o \ monodll_x11_pen.o \ monodll_x11_region.o \ - monodll_utilsx.o + monodll_utilsx.o \ + monodll_displayx11.o @COND_TOOLKIT_MOTIF@__LOWLEVEL_SRC_OBJECTS = $(COND_TOOLKIT_MOTIF___LOWLEVEL_SRC_OBJECTS) COND_TOOLKIT_MSW___LOWLEVEL_SRC_OBJECTS = \ monodll_activex.o \ @@ -5114,8 +5116,8 @@ COND_TOOLKIT_MSW___LOWLEVEL_SRC_OBJECTS = \ monodll_msw_sound.o \ monodll_automtn.o \ monodll_notifmsgrt.o \ - monodll_generic_activityindicator.o \ - monodll_uuid.o + monodll_uuid.o \ + monodll_msw_evtloop.o @COND_TOOLKIT_MSW@__LOWLEVEL_SRC_OBJECTS = $(COND_TOOLKIT_MSW___LOWLEVEL_SRC_OBJECTS) @COND_TOOLKIT_OSX_COCOA@__LOWLEVEL_SRC_OBJECTS = \ @COND_TOOLKIT_OSX_COCOA@ $(__OSX_LOWLEVEL_SRC_OBJECTS) @@ -5125,7 +5127,6 @@ COND_TOOLKIT_X11___LOWLEVEL_SRC_OBJECTS = \ monodll_generic_caret.o \ monodll_generic_imaglist.o \ monodll_unix_dialup.o \ - monodll_displayx11.o \ monodll_unix_fontenum.o \ monodll_unix_fontutil.o \ monodll_uiactionx11.o \ @@ -5162,7 +5163,8 @@ COND_TOOLKIT_X11___LOWLEVEL_SRC_OBJECTS = \ monodll_x11_toplevel.o \ monodll_x11_utils.o \ monodll_utilsx.o \ - monodll_x11_window.o + monodll_x11_window.o \ + monodll_displayx11.o @COND_TOOLKIT_X11@__LOWLEVEL_SRC_OBJECTS = $(COND_TOOLKIT_X11___LOWLEVEL_SRC_OBJECTS) COND_TOOLKIT_GTK_TOOLKIT_VERSION____GUI_SRC_OBJECTS = \ monodll_generic_accel.o \ @@ -5499,7 +5501,6 @@ COND_TOOLKIT_MSW___GUI_SRC_OBJECTS = \ monodll_msw_dialog.o \ monodll_msw_dirdlg.o \ monodll_dragimag.o \ - monodll_msw_evtloop.o \ monodll_msw_filedlg.o \ monodll_msw_frame.o \ monodll_msw_gauge.o \ @@ -5547,6 +5548,7 @@ COND_TOOLKIT_MSW___GUI_SRC_OBJECTS = \ monodll_msw_datetimectrl.o \ monodll_timectrl.o \ monodll_datecontrols.o \ + monodll_generic_activityindicator.o \ monodll_msw_checklst.o \ monodll_msw_fdrepdlg.o \ monodll_msw_fontdlg.o @@ -5605,7 +5607,9 @@ COND_TOOLKIT_OSX_COCOA___GUI_SRC_OBJECTS = \ monodll_cocoa_dataview.o \ monodll_timectrl_osx.o \ monodll_taskbarcmn.o \ - monodll_cocoa_activityindicator.o + monodll_cocoa_activityindicator.o \ + monodll_cocoa_statbmp.o \ + monodll_core_display.o @COND_TOOLKIT_OSX_COCOA@__GUI_SRC_OBJECTS = $(COND_TOOLKIT_OSX_COCOA___GUI_SRC_OBJECTS) COND_TOOLKIT_OSX_IPHONE___GUI_SRC_OBJECTS = \ $(__OSX_COMMON_SRC_OBJECTS) \ @@ -5625,11 +5629,11 @@ COND_TOOLKIT_OSX_IPHONE___GUI_SRC_OBJECTS = \ monodll_iphone_toolbar.o \ monodll_iphone_utils.o \ monodll_iphone_window.o \ - monodll_cocoa_stdpaths.o \ monodll_iphone_settings.o \ monodll_sound_osx.o \ monodll_core_sound.o \ - monodll_animateg.o + monodll_animateg.o \ + monodll_iphone_statbmp.o @COND_TOOLKIT_OSX_IPHONE@__GUI_SRC_OBJECTS = $(COND_TOOLKIT_OSX_IPHONE___GUI_SRC_OBJECTS) COND_TOOLKIT_QT___GUI_SRC_OBJECTS = \ monodll_taskbarcmn.o \ @@ -5725,8 +5729,20 @@ COND_TOOLKIT_QT___GUI_SRC_OBJECTS = \ monodll_qt_toplevel.o \ monodll_qt_uiaction.o \ monodll_qt_utils.o \ - monodll_qt_window.o + monodll_qt_window.o \ + $(__QT_PLATFORM_SRC_OBJECTS) @COND_TOOLKIT_QT@__GUI_SRC_OBJECTS = $(COND_TOOLKIT_QT___GUI_SRC_OBJECTS) +COND_PLATFORM_WIN32_1___QT_PLATFORM_SRC_OBJECTS = \ + monodll_comimpl.o \ + monodll_msw_dialup.o \ + monodll_dib.o \ + monodll_msw_joystick.o \ + monodll_oleutils.o \ + monodll_uuid.o \ + monodll_safearray.o \ + monodll_msw_sound.o \ + monodll_automtn.o +@COND_PLATFORM_WIN32_1@__QT_PLATFORM_SRC_OBJECTS = $(COND_PLATFORM_WIN32_1___QT_PLATFORM_SRC_OBJECTS) COND_TOOLKIT_DFB___LOWLEVEL_SRC_OBJECTS_1 = \ monodll_fontmgrcmn.o \ monodll_animateg.o \ @@ -5762,7 +5778,6 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION____LOWLEVEL_SRC_OBJECTS_1 = \ monodll_generic_caret.o \ monodll_generic_imaglist.o \ monodll_unix_dialup.o \ - monodll_displayx11.o \ monodll_unix_fontenum.o \ monodll_unix_fontutil.o \ monodll_uiactionx11.o \ @@ -5802,7 +5817,8 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION____LOWLEVEL_SRC_OBJECTS_1 = \ monodll_gtk1_toplevel.o \ monodll_gtk1_utilsgtk.o \ monodll_gtk1_win_gtk.o \ - monodll_gtk1_window.o + monodll_gtk1_window.o \ + monodll_displayx11.o @COND_TOOLKIT_GTK_TOOLKIT_VERSION_@__LOWLEVEL_SRC_OBJECTS_1 = $(COND_TOOLKIT_GTK_TOOLKIT_VERSION____LOWLEVEL_SRC_OBJECTS_1) COND_TOOLKIT_GTK_TOOLKIT_VERSION_2___LOWLEVEL_SRC_OBJECTS_1 = \ $(__GTK_PLATFORM_SRC_OBJECTS) \ @@ -5922,7 +5938,6 @@ COND_TOOLKIT_MOTIF___LOWLEVEL_SRC_OBJECTS_1 = \ monodll_generic_caret.o \ monodll_generic_imaglist.o \ monodll_unix_dialup.o \ - monodll_displayx11.o \ monodll_unix_fontenum.o \ monodll_unix_fontutil.o \ monodll_uiactionx11.o \ @@ -5937,7 +5952,8 @@ COND_TOOLKIT_MOTIF___LOWLEVEL_SRC_OBJECTS_1 = \ monodll_x11_palette.o \ monodll_x11_pen.o \ monodll_x11_region.o \ - monodll_utilsx.o + monodll_utilsx.o \ + monodll_displayx11.o @COND_TOOLKIT_MOTIF@__LOWLEVEL_SRC_OBJECTS_1 = $(COND_TOOLKIT_MOTIF___LOWLEVEL_SRC_OBJECTS_1) COND_TOOLKIT_MSW___LOWLEVEL_SRC_OBJECTS_1 = \ monodll_activex.o \ @@ -6004,8 +6020,8 @@ COND_TOOLKIT_MSW___LOWLEVEL_SRC_OBJECTS_1 = \ monodll_msw_sound.o \ monodll_automtn.o \ monodll_notifmsgrt.o \ - monodll_generic_activityindicator.o \ - monodll_uuid.o + monodll_uuid.o \ + monodll_msw_evtloop.o @COND_TOOLKIT_MSW@__LOWLEVEL_SRC_OBJECTS_1 = $(COND_TOOLKIT_MSW___LOWLEVEL_SRC_OBJECTS_1) @COND_TOOLKIT_OSX_COCOA@__LOWLEVEL_SRC_OBJECTS_1 = \ @COND_TOOLKIT_OSX_COCOA@ $(__OSX_LOWLEVEL_SRC_OBJECTS) @@ -6015,7 +6031,6 @@ COND_TOOLKIT_X11___LOWLEVEL_SRC_OBJECTS_1 = \ monodll_generic_caret.o \ monodll_generic_imaglist.o \ monodll_unix_dialup.o \ - monodll_displayx11.o \ monodll_unix_fontenum.o \ monodll_unix_fontutil.o \ monodll_uiactionx11.o \ @@ -6052,11 +6067,11 @@ COND_TOOLKIT_X11___LOWLEVEL_SRC_OBJECTS_1 = \ monodll_x11_toplevel.o \ monodll_x11_utils.o \ monodll_utilsx.o \ - monodll_x11_window.o + monodll_x11_window.o \ + monodll_displayx11.o @COND_TOOLKIT_X11@__LOWLEVEL_SRC_OBJECTS_1 = $(COND_TOOLKIT_X11___LOWLEVEL_SRC_OBJECTS_1) @COND_TOOLKIT_GTK_TOOLKIT_VERSION_2@__UNIV_PLATFORM_SRC_OBJECTS \ @COND_TOOLKIT_GTK_TOOLKIT_VERSION_2@ = monodll_animateg.o -@COND_TOOLKIT_MSW@__UNIV_PLATFORM_SRC_OBJECTS = monodll_msw_evtloop.o @COND_TOOLKIT_MSW@__UNIV_PLATFORM_SRC_OBJECTS = monodll_animateg.o @COND_TOOLKIT_X11@__UNIV_PLATFORM_SRC_OBJECTS = monodll_animateg.o @COND_TOOLKIT_COCOA@__MEDIA_PLATFORM_SRC_OBJECTS = \ @@ -6835,7 +6850,6 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION____LOWLEVEL_SRC_OBJECTS_2 = \ monolib_generic_caret.o \ monolib_generic_imaglist.o \ monolib_unix_dialup.o \ - monolib_displayx11.o \ monolib_unix_fontenum.o \ monolib_unix_fontutil.o \ monolib_uiactionx11.o \ @@ -6875,7 +6889,8 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION____LOWLEVEL_SRC_OBJECTS_2 = \ monolib_gtk1_toplevel.o \ monolib_gtk1_utilsgtk.o \ monolib_gtk1_win_gtk.o \ - monolib_gtk1_window.o + monolib_gtk1_window.o \ + monolib_displayx11.o @COND_TOOLKIT_GTK_TOOLKIT_VERSION_@__LOWLEVEL_SRC_OBJECTS_2 = $(COND_TOOLKIT_GTK_TOOLKIT_VERSION____LOWLEVEL_SRC_OBJECTS_2) COND_TOOLKIT_GTK_TOOLKIT_VERSION_2___LOWLEVEL_SRC_OBJECTS_2 = \ $(__GTK_PLATFORM_SRC_OBJECTS_27) \ @@ -6995,7 +7010,6 @@ COND_TOOLKIT_MOTIF___LOWLEVEL_SRC_OBJECTS_2 = \ monolib_generic_caret.o \ monolib_generic_imaglist.o \ monolib_unix_dialup.o \ - monolib_displayx11.o \ monolib_unix_fontenum.o \ monolib_unix_fontutil.o \ monolib_uiactionx11.o \ @@ -7010,7 +7024,8 @@ COND_TOOLKIT_MOTIF___LOWLEVEL_SRC_OBJECTS_2 = \ monolib_x11_palette.o \ monolib_x11_pen.o \ monolib_x11_region.o \ - monolib_utilsx.o + monolib_utilsx.o \ + monolib_displayx11.o @COND_TOOLKIT_MOTIF@__LOWLEVEL_SRC_OBJECTS_2 = $(COND_TOOLKIT_MOTIF___LOWLEVEL_SRC_OBJECTS_2) COND_TOOLKIT_MSW___LOWLEVEL_SRC_OBJECTS_2 = \ monolib_activex.o \ @@ -7077,8 +7092,8 @@ COND_TOOLKIT_MSW___LOWLEVEL_SRC_OBJECTS_2 = \ monolib_msw_sound.o \ monolib_automtn.o \ monolib_notifmsgrt.o \ - monolib_generic_activityindicator.o \ - monolib_uuid.o + monolib_uuid.o \ + monolib_msw_evtloop.o @COND_TOOLKIT_MSW@__LOWLEVEL_SRC_OBJECTS_2 = $(COND_TOOLKIT_MSW___LOWLEVEL_SRC_OBJECTS_2) @COND_TOOLKIT_OSX_COCOA@__LOWLEVEL_SRC_OBJECTS_2 = \ @COND_TOOLKIT_OSX_COCOA@ $(__OSX_LOWLEVEL_SRC_OBJECTS_17) @@ -7088,7 +7103,6 @@ COND_TOOLKIT_X11___LOWLEVEL_SRC_OBJECTS_2 = \ monolib_generic_caret.o \ monolib_generic_imaglist.o \ monolib_unix_dialup.o \ - monolib_displayx11.o \ monolib_unix_fontenum.o \ monolib_unix_fontutil.o \ monolib_uiactionx11.o \ @@ -7125,7 +7139,8 @@ COND_TOOLKIT_X11___LOWLEVEL_SRC_OBJECTS_2 = \ monolib_x11_toplevel.o \ monolib_x11_utils.o \ monolib_utilsx.o \ - monolib_x11_window.o + monolib_x11_window.o \ + monolib_displayx11.o @COND_TOOLKIT_X11@__LOWLEVEL_SRC_OBJECTS_2 = $(COND_TOOLKIT_X11___LOWLEVEL_SRC_OBJECTS_2) COND_TOOLKIT_GTK_TOOLKIT_VERSION____GUI_SRC_OBJECTS_1 = \ monolib_generic_accel.o \ @@ -7462,7 +7477,6 @@ COND_TOOLKIT_MSW___GUI_SRC_OBJECTS_1 = \ monolib_msw_dialog.o \ monolib_msw_dirdlg.o \ monolib_dragimag.o \ - monolib_msw_evtloop.o \ monolib_msw_filedlg.o \ monolib_msw_frame.o \ monolib_msw_gauge.o \ @@ -7510,6 +7524,7 @@ COND_TOOLKIT_MSW___GUI_SRC_OBJECTS_1 = \ monolib_msw_datetimectrl.o \ monolib_timectrl.o \ monolib_datecontrols.o \ + monolib_generic_activityindicator.o \ monolib_msw_checklst.o \ monolib_msw_fdrepdlg.o \ monolib_msw_fontdlg.o @@ -7568,7 +7583,9 @@ COND_TOOLKIT_OSX_COCOA___GUI_SRC_OBJECTS_1 = \ monolib_cocoa_dataview.o \ monolib_timectrl_osx.o \ monolib_taskbarcmn.o \ - monolib_cocoa_activityindicator.o + monolib_cocoa_activityindicator.o \ + monolib_cocoa_statbmp.o \ + monolib_core_display.o @COND_TOOLKIT_OSX_COCOA@__GUI_SRC_OBJECTS_1 = $(COND_TOOLKIT_OSX_COCOA___GUI_SRC_OBJECTS_1) COND_TOOLKIT_OSX_IPHONE___GUI_SRC_OBJECTS_1 = \ $(__OSX_COMMON_SRC_OBJECTS_0) \ @@ -7588,11 +7605,11 @@ COND_TOOLKIT_OSX_IPHONE___GUI_SRC_OBJECTS_1 = \ monolib_iphone_toolbar.o \ monolib_iphone_utils.o \ monolib_iphone_window.o \ - monolib_cocoa_stdpaths.o \ monolib_iphone_settings.o \ monolib_sound_osx.o \ monolib_core_sound.o \ - monolib_animateg.o + monolib_animateg.o \ + monolib_iphone_statbmp.o @COND_TOOLKIT_OSX_IPHONE@__GUI_SRC_OBJECTS_1 = $(COND_TOOLKIT_OSX_IPHONE___GUI_SRC_OBJECTS_1) COND_TOOLKIT_QT___GUI_SRC_OBJECTS_1 = \ monolib_taskbarcmn.o \ @@ -7688,8 +7705,20 @@ COND_TOOLKIT_QT___GUI_SRC_OBJECTS_1 = \ monolib_qt_toplevel.o \ monolib_qt_uiaction.o \ monolib_qt_utils.o \ - monolib_qt_window.o + monolib_qt_window.o \ + $(__QT_PLATFORM_SRC_OBJECTS_1) @COND_TOOLKIT_QT@__GUI_SRC_OBJECTS_1 = $(COND_TOOLKIT_QT___GUI_SRC_OBJECTS_1) +COND_PLATFORM_WIN32_1___QT_PLATFORM_SRC_OBJECTS_1 = \ + monolib_comimpl.o \ + monolib_msw_dialup.o \ + monolib_dib.o \ + monolib_msw_joystick.o \ + monolib_oleutils.o \ + monolib_uuid.o \ + monolib_safearray.o \ + monolib_msw_sound.o \ + monolib_automtn.o +@COND_PLATFORM_WIN32_1@__QT_PLATFORM_SRC_OBJECTS_1 = $(COND_PLATFORM_WIN32_1___QT_PLATFORM_SRC_OBJECTS_1) COND_TOOLKIT_DFB___LOWLEVEL_SRC_OBJECTS_3 = \ monolib_fontmgrcmn.o \ monolib_animateg.o \ @@ -7725,7 +7754,6 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION____LOWLEVEL_SRC_OBJECTS_3 = \ monolib_generic_caret.o \ monolib_generic_imaglist.o \ monolib_unix_dialup.o \ - monolib_displayx11.o \ monolib_unix_fontenum.o \ monolib_unix_fontutil.o \ monolib_uiactionx11.o \ @@ -7765,7 +7793,8 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION____LOWLEVEL_SRC_OBJECTS_3 = \ monolib_gtk1_toplevel.o \ monolib_gtk1_utilsgtk.o \ monolib_gtk1_win_gtk.o \ - monolib_gtk1_window.o + monolib_gtk1_window.o \ + monolib_displayx11.o @COND_TOOLKIT_GTK_TOOLKIT_VERSION_@__LOWLEVEL_SRC_OBJECTS_3 = $(COND_TOOLKIT_GTK_TOOLKIT_VERSION____LOWLEVEL_SRC_OBJECTS_3) COND_TOOLKIT_GTK_TOOLKIT_VERSION_2___LOWLEVEL_SRC_OBJECTS_3 = \ $(__GTK_PLATFORM_SRC_OBJECTS_27) \ @@ -7885,7 +7914,6 @@ COND_TOOLKIT_MOTIF___LOWLEVEL_SRC_OBJECTS_3 = \ monolib_generic_caret.o \ monolib_generic_imaglist.o \ monolib_unix_dialup.o \ - monolib_displayx11.o \ monolib_unix_fontenum.o \ monolib_unix_fontutil.o \ monolib_uiactionx11.o \ @@ -7900,7 +7928,8 @@ COND_TOOLKIT_MOTIF___LOWLEVEL_SRC_OBJECTS_3 = \ monolib_x11_palette.o \ monolib_x11_pen.o \ monolib_x11_region.o \ - monolib_utilsx.o + monolib_utilsx.o \ + monolib_displayx11.o @COND_TOOLKIT_MOTIF@__LOWLEVEL_SRC_OBJECTS_3 = $(COND_TOOLKIT_MOTIF___LOWLEVEL_SRC_OBJECTS_3) COND_TOOLKIT_MSW___LOWLEVEL_SRC_OBJECTS_3 = \ monolib_activex.o \ @@ -7967,8 +7996,8 @@ COND_TOOLKIT_MSW___LOWLEVEL_SRC_OBJECTS_3 = \ monolib_msw_sound.o \ monolib_automtn.o \ monolib_notifmsgrt.o \ - monolib_generic_activityindicator.o \ - monolib_uuid.o + monolib_uuid.o \ + monolib_msw_evtloop.o @COND_TOOLKIT_MSW@__LOWLEVEL_SRC_OBJECTS_3 = $(COND_TOOLKIT_MSW___LOWLEVEL_SRC_OBJECTS_3) @COND_TOOLKIT_OSX_COCOA@__LOWLEVEL_SRC_OBJECTS_3 = \ @COND_TOOLKIT_OSX_COCOA@ $(__OSX_LOWLEVEL_SRC_OBJECTS_17) @@ -7978,7 +8007,6 @@ COND_TOOLKIT_X11___LOWLEVEL_SRC_OBJECTS_3 = \ monolib_generic_caret.o \ monolib_generic_imaglist.o \ monolib_unix_dialup.o \ - monolib_displayx11.o \ monolib_unix_fontenum.o \ monolib_unix_fontutil.o \ monolib_uiactionx11.o \ @@ -8015,11 +8043,11 @@ COND_TOOLKIT_X11___LOWLEVEL_SRC_OBJECTS_3 = \ monolib_x11_toplevel.o \ monolib_x11_utils.o \ monolib_utilsx.o \ - monolib_x11_window.o + monolib_x11_window.o \ + monolib_displayx11.o @COND_TOOLKIT_X11@__LOWLEVEL_SRC_OBJECTS_3 = $(COND_TOOLKIT_X11___LOWLEVEL_SRC_OBJECTS_3) @COND_TOOLKIT_GTK_TOOLKIT_VERSION_2@__UNIV_PLATFORM_SRC_OBJECTS_1 \ @COND_TOOLKIT_GTK_TOOLKIT_VERSION_2@ = monolib_animateg.o -@COND_TOOLKIT_MSW@__UNIV_PLATFORM_SRC_OBJECTS_1 = monolib_msw_evtloop.o @COND_TOOLKIT_MSW@__UNIV_PLATFORM_SRC_OBJECTS_1 = monolib_animateg.o @COND_TOOLKIT_X11@__UNIV_PLATFORM_SRC_OBJECTS_1 = monolib_animateg.o @COND_TOOLKIT_COCOA@__MEDIA_PLATFORM_SRC_OBJECTS_1 = \ @@ -8945,7 +8973,6 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION____LOWLEVEL_SRC_OBJECTS_4 = \ coredll_generic_caret.o \ coredll_generic_imaglist.o \ coredll_unix_dialup.o \ - coredll_displayx11.o \ coredll_unix_fontenum.o \ coredll_unix_fontutil.o \ coredll_uiactionx11.o \ @@ -8985,7 +9012,8 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION____LOWLEVEL_SRC_OBJECTS_4 = \ coredll_gtk1_toplevel.o \ coredll_gtk1_utilsgtk.o \ coredll_gtk1_win_gtk.o \ - coredll_gtk1_window.o + coredll_gtk1_window.o \ + coredll_displayx11.o @COND_TOOLKIT_GTK_TOOLKIT_VERSION_@__LOWLEVEL_SRC_OBJECTS_4 = $(COND_TOOLKIT_GTK_TOOLKIT_VERSION____LOWLEVEL_SRC_OBJECTS_4) COND_TOOLKIT_GTK_TOOLKIT_VERSION_2___LOWLEVEL_SRC_OBJECTS_4 = \ $(__GTK_PLATFORM_SRC_OBJECTS_1_4) \ @@ -9105,7 +9133,6 @@ COND_TOOLKIT_MOTIF___LOWLEVEL_SRC_OBJECTS_4 = \ coredll_generic_caret.o \ coredll_generic_imaglist.o \ coredll_unix_dialup.o \ - coredll_displayx11.o \ coredll_unix_fontenum.o \ coredll_unix_fontutil.o \ coredll_uiactionx11.o \ @@ -9120,7 +9147,8 @@ COND_TOOLKIT_MOTIF___LOWLEVEL_SRC_OBJECTS_4 = \ coredll_x11_palette.o \ coredll_x11_pen.o \ coredll_x11_region.o \ - coredll_utilsx.o + coredll_utilsx.o \ + coredll_displayx11.o @COND_TOOLKIT_MOTIF@__LOWLEVEL_SRC_OBJECTS_4 = $(COND_TOOLKIT_MOTIF___LOWLEVEL_SRC_OBJECTS_4) COND_TOOLKIT_MSW___LOWLEVEL_SRC_OBJECTS_4 = \ coredll_activex.o \ @@ -9187,8 +9215,8 @@ COND_TOOLKIT_MSW___LOWLEVEL_SRC_OBJECTS_4 = \ coredll_msw_sound.o \ coredll_automtn.o \ coredll_notifmsgrt.o \ - coredll_generic_activityindicator.o \ - coredll_uuid.o + coredll_uuid.o \ + coredll_msw_evtloop.o @COND_TOOLKIT_MSW@__LOWLEVEL_SRC_OBJECTS_4 = $(COND_TOOLKIT_MSW___LOWLEVEL_SRC_OBJECTS_4) @COND_TOOLKIT_OSX_COCOA@__LOWLEVEL_SRC_OBJECTS_4 = \ @COND_TOOLKIT_OSX_COCOA@ $(__OSX_LOWLEVEL_SRC_OBJECTS_1_1) @@ -9198,7 +9226,6 @@ COND_TOOLKIT_X11___LOWLEVEL_SRC_OBJECTS_4 = \ coredll_generic_caret.o \ coredll_generic_imaglist.o \ coredll_unix_dialup.o \ - coredll_displayx11.o \ coredll_unix_fontenum.o \ coredll_unix_fontutil.o \ coredll_uiactionx11.o \ @@ -9235,7 +9262,8 @@ COND_TOOLKIT_X11___LOWLEVEL_SRC_OBJECTS_4 = \ coredll_x11_toplevel.o \ coredll_x11_utils.o \ coredll_utilsx.o \ - coredll_x11_window.o + coredll_x11_window.o \ + coredll_displayx11.o @COND_TOOLKIT_X11@__LOWLEVEL_SRC_OBJECTS_4 = $(COND_TOOLKIT_X11___LOWLEVEL_SRC_OBJECTS_4) COND_TOOLKIT_GTK_TOOLKIT_VERSION____GUI_SRC_OBJECTS_2 = \ coredll_generic_accel.o \ @@ -9572,7 +9600,6 @@ COND_TOOLKIT_MSW___GUI_SRC_OBJECTS_2 = \ coredll_msw_dialog.o \ coredll_msw_dirdlg.o \ coredll_dragimag.o \ - coredll_msw_evtloop.o \ coredll_msw_filedlg.o \ coredll_msw_frame.o \ coredll_msw_gauge.o \ @@ -9620,6 +9647,7 @@ COND_TOOLKIT_MSW___GUI_SRC_OBJECTS_2 = \ coredll_msw_datetimectrl.o \ coredll_timectrl.o \ coredll_datecontrols.o \ + coredll_generic_activityindicator.o \ coredll_msw_checklst.o \ coredll_msw_fdrepdlg.o \ coredll_msw_fontdlg.o @@ -9678,7 +9706,9 @@ COND_TOOLKIT_OSX_COCOA___GUI_SRC_OBJECTS_2 = \ coredll_cocoa_dataview.o \ coredll_timectrl_osx.o \ coredll_taskbarcmn.o \ - coredll_cocoa_activityindicator.o + coredll_cocoa_activityindicator.o \ + coredll_cocoa_statbmp.o \ + coredll_core_display.o @COND_TOOLKIT_OSX_COCOA@__GUI_SRC_OBJECTS_2 = $(COND_TOOLKIT_OSX_COCOA___GUI_SRC_OBJECTS_2) COND_TOOLKIT_OSX_IPHONE___GUI_SRC_OBJECTS_2 = \ $(__OSX_COMMON_SRC_OBJECTS_8) \ @@ -9698,11 +9728,11 @@ COND_TOOLKIT_OSX_IPHONE___GUI_SRC_OBJECTS_2 = \ coredll_iphone_toolbar.o \ coredll_iphone_utils.o \ coredll_iphone_window.o \ - coredll_stdpaths.o \ coredll_iphone_settings.o \ coredll_sound_osx.o \ coredll_core_sound.o \ - coredll_animateg.o + coredll_animateg.o \ + coredll_iphone_statbmp.o @COND_TOOLKIT_OSX_IPHONE@__GUI_SRC_OBJECTS_2 = $(COND_TOOLKIT_OSX_IPHONE___GUI_SRC_OBJECTS_2) COND_TOOLKIT_QT___GUI_SRC_OBJECTS_2 = \ coredll_taskbarcmn.o \ @@ -9798,8 +9828,20 @@ COND_TOOLKIT_QT___GUI_SRC_OBJECTS_2 = \ coredll_qt_toplevel.o \ coredll_qt_uiaction.o \ coredll_qt_utils.o \ - coredll_qt_window.o + coredll_qt_window.o \ + $(__QT_PLATFORM_SRC_OBJECTS_2) @COND_TOOLKIT_QT@__GUI_SRC_OBJECTS_2 = $(COND_TOOLKIT_QT___GUI_SRC_OBJECTS_2) +COND_PLATFORM_WIN32_1___QT_PLATFORM_SRC_OBJECTS_2 = \ + coredll_comimpl.o \ + coredll_msw_dialup.o \ + coredll_dib.o \ + coredll_msw_joystick.o \ + coredll_oleutils.o \ + coredll_uuid.o \ + coredll_safearray.o \ + coredll_msw_sound.o \ + coredll_automtn.o +@COND_PLATFORM_WIN32_1@__QT_PLATFORM_SRC_OBJECTS_2 = $(COND_PLATFORM_WIN32_1___QT_PLATFORM_SRC_OBJECTS_2) COND_TOOLKIT_DFB___LOWLEVEL_SRC_OBJECTS_5 = \ coredll_fontmgrcmn.o \ coredll_animateg.o \ @@ -9835,7 +9877,6 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION____LOWLEVEL_SRC_OBJECTS_5 = \ coredll_generic_caret.o \ coredll_generic_imaglist.o \ coredll_unix_dialup.o \ - coredll_displayx11.o \ coredll_unix_fontenum.o \ coredll_unix_fontutil.o \ coredll_uiactionx11.o \ @@ -9875,7 +9916,8 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION____LOWLEVEL_SRC_OBJECTS_5 = \ coredll_gtk1_toplevel.o \ coredll_gtk1_utilsgtk.o \ coredll_gtk1_win_gtk.o \ - coredll_gtk1_window.o + coredll_gtk1_window.o \ + coredll_displayx11.o @COND_TOOLKIT_GTK_TOOLKIT_VERSION_@__LOWLEVEL_SRC_OBJECTS_5 = $(COND_TOOLKIT_GTK_TOOLKIT_VERSION____LOWLEVEL_SRC_OBJECTS_5) COND_TOOLKIT_GTK_TOOLKIT_VERSION_2___LOWLEVEL_SRC_OBJECTS_5 = \ $(__GTK_PLATFORM_SRC_OBJECTS_1_4) \ @@ -9995,7 +10037,6 @@ COND_TOOLKIT_MOTIF___LOWLEVEL_SRC_OBJECTS_5 = \ coredll_generic_caret.o \ coredll_generic_imaglist.o \ coredll_unix_dialup.o \ - coredll_displayx11.o \ coredll_unix_fontenum.o \ coredll_unix_fontutil.o \ coredll_uiactionx11.o \ @@ -10010,7 +10051,8 @@ COND_TOOLKIT_MOTIF___LOWLEVEL_SRC_OBJECTS_5 = \ coredll_x11_palette.o \ coredll_x11_pen.o \ coredll_x11_region.o \ - coredll_utilsx.o + coredll_utilsx.o \ + coredll_displayx11.o @COND_TOOLKIT_MOTIF@__LOWLEVEL_SRC_OBJECTS_5 = $(COND_TOOLKIT_MOTIF___LOWLEVEL_SRC_OBJECTS_5) COND_TOOLKIT_MSW___LOWLEVEL_SRC_OBJECTS_5 = \ coredll_activex.o \ @@ -10077,8 +10119,8 @@ COND_TOOLKIT_MSW___LOWLEVEL_SRC_OBJECTS_5 = \ coredll_msw_sound.o \ coredll_automtn.o \ coredll_notifmsgrt.o \ - coredll_generic_activityindicator.o \ - coredll_uuid.o + coredll_uuid.o \ + coredll_msw_evtloop.o @COND_TOOLKIT_MSW@__LOWLEVEL_SRC_OBJECTS_5 = $(COND_TOOLKIT_MSW___LOWLEVEL_SRC_OBJECTS_5) @COND_TOOLKIT_OSX_COCOA@__LOWLEVEL_SRC_OBJECTS_5 = \ @COND_TOOLKIT_OSX_COCOA@ $(__OSX_LOWLEVEL_SRC_OBJECTS_1_1) @@ -10088,7 +10130,6 @@ COND_TOOLKIT_X11___LOWLEVEL_SRC_OBJECTS_5 = \ coredll_generic_caret.o \ coredll_generic_imaglist.o \ coredll_unix_dialup.o \ - coredll_displayx11.o \ coredll_unix_fontenum.o \ coredll_unix_fontutil.o \ coredll_uiactionx11.o \ @@ -10125,11 +10166,11 @@ COND_TOOLKIT_X11___LOWLEVEL_SRC_OBJECTS_5 = \ coredll_x11_toplevel.o \ coredll_x11_utils.o \ coredll_utilsx.o \ - coredll_x11_window.o + coredll_x11_window.o \ + coredll_displayx11.o @COND_TOOLKIT_X11@__LOWLEVEL_SRC_OBJECTS_5 = $(COND_TOOLKIT_X11___LOWLEVEL_SRC_OBJECTS_5) @COND_TOOLKIT_GTK_TOOLKIT_VERSION_2@__UNIV_PLATFORM_SRC_OBJECTS_2 \ @COND_TOOLKIT_GTK_TOOLKIT_VERSION_2@ = coredll_animateg.o -@COND_TOOLKIT_MSW@__UNIV_PLATFORM_SRC_OBJECTS_2 = coredll_msw_evtloop.o @COND_TOOLKIT_MSW@__UNIV_PLATFORM_SRC_OBJECTS_2 = coredll_animateg.o @COND_TOOLKIT_X11@__UNIV_PLATFORM_SRC_OBJECTS_2 = coredll_animateg.o @COND_PLATFORM_UNIX_1_USE_PLUGINS_0@__PLUGIN_SRC_OBJECTS_2 \ @@ -10650,7 +10691,6 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION____LOWLEVEL_SRC_OBJECTS_6 = \ corelib_generic_caret.o \ corelib_generic_imaglist.o \ corelib_unix_dialup.o \ - corelib_displayx11.o \ corelib_unix_fontenum.o \ corelib_unix_fontutil.o \ corelib_uiactionx11.o \ @@ -10690,7 +10730,8 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION____LOWLEVEL_SRC_OBJECTS_6 = \ corelib_gtk1_toplevel.o \ corelib_gtk1_utilsgtk.o \ corelib_gtk1_win_gtk.o \ - corelib_gtk1_window.o + corelib_gtk1_window.o \ + corelib_displayx11.o @COND_TOOLKIT_GTK_TOOLKIT_VERSION_@__LOWLEVEL_SRC_OBJECTS_6 = $(COND_TOOLKIT_GTK_TOOLKIT_VERSION____LOWLEVEL_SRC_OBJECTS_6) COND_TOOLKIT_GTK_TOOLKIT_VERSION_2___LOWLEVEL_SRC_OBJECTS_6 = \ $(__GTK_PLATFORM_SRC_OBJECTS_2_2) \ @@ -10810,7 +10851,6 @@ COND_TOOLKIT_MOTIF___LOWLEVEL_SRC_OBJECTS_6 = \ corelib_generic_caret.o \ corelib_generic_imaglist.o \ corelib_unix_dialup.o \ - corelib_displayx11.o \ corelib_unix_fontenum.o \ corelib_unix_fontutil.o \ corelib_uiactionx11.o \ @@ -10825,7 +10865,8 @@ COND_TOOLKIT_MOTIF___LOWLEVEL_SRC_OBJECTS_6 = \ corelib_x11_palette.o \ corelib_x11_pen.o \ corelib_x11_region.o \ - corelib_utilsx.o + corelib_utilsx.o \ + corelib_displayx11.o @COND_TOOLKIT_MOTIF@__LOWLEVEL_SRC_OBJECTS_6 = $(COND_TOOLKIT_MOTIF___LOWLEVEL_SRC_OBJECTS_6) COND_TOOLKIT_MSW___LOWLEVEL_SRC_OBJECTS_6 = \ corelib_activex.o \ @@ -10892,8 +10933,8 @@ COND_TOOLKIT_MSW___LOWLEVEL_SRC_OBJECTS_6 = \ corelib_msw_sound.o \ corelib_automtn.o \ corelib_notifmsgrt.o \ - corelib_generic_activityindicator.o \ - corelib_uuid.o + corelib_uuid.o \ + corelib_msw_evtloop.o @COND_TOOLKIT_MSW@__LOWLEVEL_SRC_OBJECTS_6 = $(COND_TOOLKIT_MSW___LOWLEVEL_SRC_OBJECTS_6) @COND_TOOLKIT_OSX_COCOA@__LOWLEVEL_SRC_OBJECTS_6 = \ @COND_TOOLKIT_OSX_COCOA@ $(__OSX_LOWLEVEL_SRC_OBJECTS_1_4) @@ -10903,7 +10944,6 @@ COND_TOOLKIT_X11___LOWLEVEL_SRC_OBJECTS_6 = \ corelib_generic_caret.o \ corelib_generic_imaglist.o \ corelib_unix_dialup.o \ - corelib_displayx11.o \ corelib_unix_fontenum.o \ corelib_unix_fontutil.o \ corelib_uiactionx11.o \ @@ -10940,7 +10980,8 @@ COND_TOOLKIT_X11___LOWLEVEL_SRC_OBJECTS_6 = \ corelib_x11_toplevel.o \ corelib_x11_utils.o \ corelib_utilsx.o \ - corelib_x11_window.o + corelib_x11_window.o \ + corelib_displayx11.o @COND_TOOLKIT_X11@__LOWLEVEL_SRC_OBJECTS_6 = $(COND_TOOLKIT_X11___LOWLEVEL_SRC_OBJECTS_6) COND_TOOLKIT_GTK_TOOLKIT_VERSION____GUI_SRC_OBJECTS_3 = \ corelib_generic_accel.o \ @@ -11277,7 +11318,6 @@ COND_TOOLKIT_MSW___GUI_SRC_OBJECTS_3 = \ corelib_msw_dialog.o \ corelib_msw_dirdlg.o \ corelib_dragimag.o \ - corelib_msw_evtloop.o \ corelib_msw_filedlg.o \ corelib_msw_frame.o \ corelib_msw_gauge.o \ @@ -11325,6 +11365,7 @@ COND_TOOLKIT_MSW___GUI_SRC_OBJECTS_3 = \ corelib_msw_datetimectrl.o \ corelib_timectrl.o \ corelib_datecontrols.o \ + corelib_generic_activityindicator.o \ corelib_msw_checklst.o \ corelib_msw_fdrepdlg.o \ corelib_msw_fontdlg.o @@ -11383,7 +11424,9 @@ COND_TOOLKIT_OSX_COCOA___GUI_SRC_OBJECTS_3 = \ corelib_cocoa_dataview.o \ corelib_timectrl_osx.o \ corelib_taskbarcmn.o \ - corelib_cocoa_activityindicator.o + corelib_cocoa_activityindicator.o \ + corelib_cocoa_statbmp.o \ + corelib_core_display.o @COND_TOOLKIT_OSX_COCOA@__GUI_SRC_OBJECTS_3 = $(COND_TOOLKIT_OSX_COCOA___GUI_SRC_OBJECTS_3) COND_TOOLKIT_OSX_IPHONE___GUI_SRC_OBJECTS_3 = \ $(__OSX_COMMON_SRC_OBJECTS_9) \ @@ -11403,11 +11446,11 @@ COND_TOOLKIT_OSX_IPHONE___GUI_SRC_OBJECTS_3 = \ corelib_iphone_toolbar.o \ corelib_iphone_utils.o \ corelib_iphone_window.o \ - corelib_stdpaths.o \ corelib_iphone_settings.o \ corelib_sound_osx.o \ corelib_core_sound.o \ - corelib_animateg.o + corelib_animateg.o \ + corelib_iphone_statbmp.o @COND_TOOLKIT_OSX_IPHONE@__GUI_SRC_OBJECTS_3 = $(COND_TOOLKIT_OSX_IPHONE___GUI_SRC_OBJECTS_3) COND_TOOLKIT_QT___GUI_SRC_OBJECTS_3 = \ corelib_taskbarcmn.o \ @@ -11503,8 +11546,20 @@ COND_TOOLKIT_QT___GUI_SRC_OBJECTS_3 = \ corelib_qt_toplevel.o \ corelib_qt_uiaction.o \ corelib_qt_utils.o \ - corelib_qt_window.o + corelib_qt_window.o \ + $(__QT_PLATFORM_SRC_OBJECTS_3) @COND_TOOLKIT_QT@__GUI_SRC_OBJECTS_3 = $(COND_TOOLKIT_QT___GUI_SRC_OBJECTS_3) +COND_PLATFORM_WIN32_1___QT_PLATFORM_SRC_OBJECTS_3 = \ + corelib_comimpl.o \ + corelib_msw_dialup.o \ + corelib_dib.o \ + corelib_msw_joystick.o \ + corelib_oleutils.o \ + corelib_uuid.o \ + corelib_safearray.o \ + corelib_msw_sound.o \ + corelib_automtn.o +@COND_PLATFORM_WIN32_1@__QT_PLATFORM_SRC_OBJECTS_3 = $(COND_PLATFORM_WIN32_1___QT_PLATFORM_SRC_OBJECTS_3) COND_TOOLKIT_DFB___LOWLEVEL_SRC_OBJECTS_7 = \ corelib_fontmgrcmn.o \ corelib_animateg.o \ @@ -11540,7 +11595,6 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION____LOWLEVEL_SRC_OBJECTS_7 = \ corelib_generic_caret.o \ corelib_generic_imaglist.o \ corelib_unix_dialup.o \ - corelib_displayx11.o \ corelib_unix_fontenum.o \ corelib_unix_fontutil.o \ corelib_uiactionx11.o \ @@ -11580,7 +11634,8 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION____LOWLEVEL_SRC_OBJECTS_7 = \ corelib_gtk1_toplevel.o \ corelib_gtk1_utilsgtk.o \ corelib_gtk1_win_gtk.o \ - corelib_gtk1_window.o + corelib_gtk1_window.o \ + corelib_displayx11.o @COND_TOOLKIT_GTK_TOOLKIT_VERSION_@__LOWLEVEL_SRC_OBJECTS_7 = $(COND_TOOLKIT_GTK_TOOLKIT_VERSION____LOWLEVEL_SRC_OBJECTS_7) COND_TOOLKIT_GTK_TOOLKIT_VERSION_2___LOWLEVEL_SRC_OBJECTS_7 = \ $(__GTK_PLATFORM_SRC_OBJECTS_2_2) \ @@ -11700,7 +11755,6 @@ COND_TOOLKIT_MOTIF___LOWLEVEL_SRC_OBJECTS_7 = \ corelib_generic_caret.o \ corelib_generic_imaglist.o \ corelib_unix_dialup.o \ - corelib_displayx11.o \ corelib_unix_fontenum.o \ corelib_unix_fontutil.o \ corelib_uiactionx11.o \ @@ -11715,7 +11769,8 @@ COND_TOOLKIT_MOTIF___LOWLEVEL_SRC_OBJECTS_7 = \ corelib_x11_palette.o \ corelib_x11_pen.o \ corelib_x11_region.o \ - corelib_utilsx.o + corelib_utilsx.o \ + corelib_displayx11.o @COND_TOOLKIT_MOTIF@__LOWLEVEL_SRC_OBJECTS_7 = $(COND_TOOLKIT_MOTIF___LOWLEVEL_SRC_OBJECTS_7) COND_TOOLKIT_MSW___LOWLEVEL_SRC_OBJECTS_7 = \ corelib_activex.o \ @@ -11782,8 +11837,8 @@ COND_TOOLKIT_MSW___LOWLEVEL_SRC_OBJECTS_7 = \ corelib_msw_sound.o \ corelib_automtn.o \ corelib_notifmsgrt.o \ - corelib_generic_activityindicator.o \ - corelib_uuid.o + corelib_uuid.o \ + corelib_msw_evtloop.o @COND_TOOLKIT_MSW@__LOWLEVEL_SRC_OBJECTS_7 = $(COND_TOOLKIT_MSW___LOWLEVEL_SRC_OBJECTS_7) @COND_TOOLKIT_OSX_COCOA@__LOWLEVEL_SRC_OBJECTS_7 = \ @COND_TOOLKIT_OSX_COCOA@ $(__OSX_LOWLEVEL_SRC_OBJECTS_1_4) @@ -11793,7 +11848,6 @@ COND_TOOLKIT_X11___LOWLEVEL_SRC_OBJECTS_7 = \ corelib_generic_caret.o \ corelib_generic_imaglist.o \ corelib_unix_dialup.o \ - corelib_displayx11.o \ corelib_unix_fontenum.o \ corelib_unix_fontutil.o \ corelib_uiactionx11.o \ @@ -11830,11 +11884,11 @@ COND_TOOLKIT_X11___LOWLEVEL_SRC_OBJECTS_7 = \ corelib_x11_toplevel.o \ corelib_x11_utils.o \ corelib_utilsx.o \ - corelib_x11_window.o + corelib_x11_window.o \ + corelib_displayx11.o @COND_TOOLKIT_X11@__LOWLEVEL_SRC_OBJECTS_7 = $(COND_TOOLKIT_X11___LOWLEVEL_SRC_OBJECTS_7) @COND_TOOLKIT_GTK_TOOLKIT_VERSION_2@__UNIV_PLATFORM_SRC_OBJECTS_3 \ @COND_TOOLKIT_GTK_TOOLKIT_VERSION_2@ = corelib_animateg.o -@COND_TOOLKIT_MSW@__UNIV_PLATFORM_SRC_OBJECTS_3 = corelib_msw_evtloop.o @COND_TOOLKIT_MSW@__UNIV_PLATFORM_SRC_OBJECTS_3 = corelib_animateg.o @COND_TOOLKIT_X11@__UNIV_PLATFORM_SRC_OBJECTS_3 = corelib_animateg.o @COND_PLATFORM_UNIX_1_USE_PLUGINS_0@__PLUGIN_SRC_OBJECTS_3 \ @@ -13119,13 +13173,14 @@ COND_PLATFORM_MACOSX_1___OSX_COMMON_SRC_OBJECTS = \ monodll_prntdlgg.o \ monodll_generic_statusbr.o \ monodll_generic_textmeasure.o \ - monodll_generic_icon.o + monodll_generic_icon.o \ + monodll_statbmp_osx.o \ + monodll_generic_imaglist.o @COND_PLATFORM_MACOSX_1@__OSX_COMMON_SRC_OBJECTS = $(COND_PLATFORM_MACOSX_1___OSX_COMMON_SRC_OBJECTS) COND_PLATFORM_MACOSX_1___GTK_PLATFORM_SRC_OBJECTS = \ monodll_generic_caret.o \ monodll_generic_imaglist.o \ monodll_unix_dialup.o \ - monodll_displayx11.o \ monodll_unix_fontenum.o \ monodll_unix_fontutil.o \ monodll_uiactionx11.o \ @@ -13139,7 +13194,6 @@ COND_PLATFORM_UNIX_1___GTK_PLATFORM_SRC_OBJECTS = \ monodll_generic_caret.o \ monodll_generic_imaglist.o \ monodll_unix_dialup.o \ - monodll_displayx11.o \ monodll_unix_fontenum.o \ monodll_unix_fontutil.o \ monodll_uiactionx11.o \ @@ -13172,7 +13226,6 @@ COND_PLATFORM_MACOSX_1___OSX_LOWLEVEL_SRC_OBJECTS = \ monodll_osx_brush.o \ monodll_dialog_osx.o \ monodll_osx_fontutil.o \ - monodll_osx_imaglist.o \ monodll_osx_minifram.o \ monodll_nonownedwnd_osx.o \ monodll_osx_palette.o \ @@ -13184,7 +13237,6 @@ COND_PLATFORM_MACOSX_1___OSX_LOWLEVEL_SRC_OBJECTS = \ monodll_core_bitmap.o \ monodll_core_colour.o \ monodll_core_dcmemory.o \ - monodll_core_display.o \ monodll_core_fontenum.o \ monodll_hid.o \ monodll_printmac.o \ @@ -13262,13 +13314,14 @@ COND_PLATFORM_MACOSX_1___OSX_COMMON_SRC_OBJECTS_0 = \ monolib_prntdlgg.o \ monolib_generic_statusbr.o \ monolib_generic_textmeasure.o \ - monolib_generic_icon.o + monolib_generic_icon.o \ + monolib_statbmp_osx.o \ + monolib_generic_imaglist.o @COND_PLATFORM_MACOSX_1@__OSX_COMMON_SRC_OBJECTS_0 = $(COND_PLATFORM_MACOSX_1___OSX_COMMON_SRC_OBJECTS_0) COND_PLATFORM_MACOSX_1___GTK_PLATFORM_SRC_OBJECTS_27 = \ monolib_generic_caret.o \ monolib_generic_imaglist.o \ monolib_unix_dialup.o \ - monolib_displayx11.o \ monolib_unix_fontenum.o \ monolib_unix_fontutil.o \ monolib_uiactionx11.o \ @@ -13282,7 +13335,6 @@ COND_PLATFORM_UNIX_1___GTK_PLATFORM_SRC_OBJECTS_27 = \ monolib_generic_caret.o \ monolib_generic_imaglist.o \ monolib_unix_dialup.o \ - monolib_displayx11.o \ monolib_unix_fontenum.o \ monolib_unix_fontutil.o \ monolib_uiactionx11.o \ @@ -13315,7 +13367,6 @@ COND_PLATFORM_MACOSX_1___OSX_LOWLEVEL_SRC_OBJECTS_17 = \ monolib_osx_brush.o \ monolib_dialog_osx.o \ monolib_osx_fontutil.o \ - monolib_osx_imaglist.o \ monolib_osx_minifram.o \ monolib_nonownedwnd_osx.o \ monolib_osx_palette.o \ @@ -13327,7 +13378,6 @@ COND_PLATFORM_MACOSX_1___OSX_LOWLEVEL_SRC_OBJECTS_17 = \ monolib_core_bitmap.o \ monolib_core_colour.o \ monolib_core_dcmemory.o \ - monolib_core_display.o \ monolib_core_fontenum.o \ monolib_hid.o \ monolib_printmac.o \ @@ -13405,13 +13455,14 @@ COND_PLATFORM_MACOSX_1___OSX_COMMON_SRC_OBJECTS_8 = \ coredll_prntdlgg.o \ coredll_generic_statusbr.o \ coredll_generic_textmeasure.o \ - coredll_generic_icon.o + coredll_generic_icon.o \ + coredll_statbmp_osx.o \ + coredll_generic_imaglist.o @COND_PLATFORM_MACOSX_1@__OSX_COMMON_SRC_OBJECTS_8 = $(COND_PLATFORM_MACOSX_1___OSX_COMMON_SRC_OBJECTS_8) COND_PLATFORM_MACOSX_1___GTK_PLATFORM_SRC_OBJECTS_1_4 = \ coredll_generic_caret.o \ coredll_generic_imaglist.o \ coredll_unix_dialup.o \ - coredll_displayx11.o \ coredll_unix_fontenum.o \ coredll_unix_fontutil.o \ coredll_uiactionx11.o \ @@ -13425,7 +13476,6 @@ COND_PLATFORM_UNIX_1___GTK_PLATFORM_SRC_OBJECTS_1_4 = \ coredll_generic_caret.o \ coredll_generic_imaglist.o \ coredll_unix_dialup.o \ - coredll_displayx11.o \ coredll_unix_fontenum.o \ coredll_unix_fontutil.o \ coredll_uiactionx11.o \ @@ -13458,7 +13508,6 @@ COND_PLATFORM_MACOSX_1___OSX_LOWLEVEL_SRC_OBJECTS_1_1 = \ coredll_osx_brush.o \ coredll_dialog_osx.o \ coredll_osx_fontutil.o \ - coredll_osx_imaglist.o \ coredll_osx_minifram.o \ coredll_nonownedwnd_osx.o \ coredll_osx_palette.o \ @@ -13470,7 +13519,6 @@ COND_PLATFORM_MACOSX_1___OSX_LOWLEVEL_SRC_OBJECTS_1_1 = \ coredll_core_bitmap.o \ coredll_core_colour.o \ coredll_core_dcmemory.o \ - coredll_core_display.o \ coredll_core_fontenum.o \ coredll_hid.o \ coredll_printmac.o \ @@ -13545,13 +13593,14 @@ COND_PLATFORM_MACOSX_1___OSX_COMMON_SRC_OBJECTS_9 = \ corelib_prntdlgg.o \ corelib_generic_statusbr.o \ corelib_generic_textmeasure.o \ - corelib_generic_icon.o + corelib_generic_icon.o \ + corelib_statbmp_osx.o \ + corelib_generic_imaglist.o @COND_PLATFORM_MACOSX_1@__OSX_COMMON_SRC_OBJECTS_9 = $(COND_PLATFORM_MACOSX_1___OSX_COMMON_SRC_OBJECTS_9) COND_PLATFORM_MACOSX_1___GTK_PLATFORM_SRC_OBJECTS_2_2 = \ corelib_generic_caret.o \ corelib_generic_imaglist.o \ corelib_unix_dialup.o \ - corelib_displayx11.o \ corelib_unix_fontenum.o \ corelib_unix_fontutil.o \ corelib_uiactionx11.o \ @@ -13565,7 +13614,6 @@ COND_PLATFORM_UNIX_1___GTK_PLATFORM_SRC_OBJECTS_2_2 = \ corelib_generic_caret.o \ corelib_generic_imaglist.o \ corelib_unix_dialup.o \ - corelib_displayx11.o \ corelib_unix_fontenum.o \ corelib_unix_fontutil.o \ corelib_uiactionx11.o \ @@ -13598,7 +13646,6 @@ COND_PLATFORM_MACOSX_1___OSX_LOWLEVEL_SRC_OBJECTS_1_4 = \ corelib_osx_brush.o \ corelib_dialog_osx.o \ corelib_osx_fontutil.o \ - corelib_osx_imaglist.o \ corelib_osx_minifram.o \ corelib_nonownedwnd_osx.o \ corelib_osx_palette.o \ @@ -13610,7 +13657,6 @@ COND_PLATFORM_MACOSX_1___OSX_LOWLEVEL_SRC_OBJECTS_1_4 = \ corelib_core_bitmap.o \ corelib_core_colour.o \ corelib_core_dcmemory.o \ - corelib_core_display.o \ corelib_core_fontenum.o \ corelib_hid.o \ corelib_printmac.o \ @@ -15787,6 +15833,9 @@ monodll_core_secretstore.o: $(srcdir)/src/osx/core/secretstore.cpp $(MONODLL_ODE monodll_fswatcher_fsevents.o: $(srcdir)/src/osx/fswatcher_fsevents.cpp $(MONODLL_ODEP) $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/osx/fswatcher_fsevents.cpp +monodll_cocoa_stdpaths.o: $(srcdir)/src/osx/cocoa/stdpaths.mm $(MONODLL_ODEP) + $(CXXC) -c -o $@ $(MONODLL_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/stdpaths.mm + monodll_event.o: $(srcdir)/src/common/event.cpp $(MONODLL_ODEP) $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/common/event.cpp @@ -16456,6 +16505,12 @@ monodll_timectrl_osx.o: $(srcdir)/src/osx/timectrl_osx.cpp $(MONODLL_ODEP) monodll_cocoa_activityindicator.o: $(srcdir)/src/osx/cocoa/activityindicator.mm $(MONODLL_ODEP) $(CXXC) -c -o $@ $(MONODLL_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/activityindicator.mm +monodll_cocoa_statbmp.o: $(srcdir)/src/osx/cocoa/statbmp.mm $(MONODLL_ODEP) + $(CXXC) -c -o $@ $(MONODLL_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/statbmp.mm + +monodll_core_display.o: $(srcdir)/src/osx/core/display.cpp $(MONODLL_ODEP) + $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/osx/core/display.cpp + monodll_regiong.o: $(srcdir)/src/generic/regiong.cpp $(MONODLL_ODEP) $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/regiong.cpp @@ -16507,6 +16562,9 @@ monodll_iphone_window.o: $(srcdir)/src/osx/iphone/window.mm $(MONODLL_ODEP) monodll_iphone_settings.o: $(srcdir)/src/osx/iphone/settings.mm $(MONODLL_ODEP) $(CXXC) -c -o $@ $(MONODLL_OBJCXXFLAGS) $(srcdir)/src/osx/iphone/settings.mm +monodll_iphone_statbmp.o: $(srcdir)/src/osx/iphone/statbmp.mm $(MONODLL_ODEP) + $(CXXC) -c -o $@ $(MONODLL_OBJCXXFLAGS) $(srcdir)/src/osx/iphone/statbmp.mm + monodll_qt_accel.o: $(srcdir)/src/qt/accel.cpp $(MONODLL_ODEP) $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/qt/accel.cpp @@ -17431,12 +17489,6 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP) @COND_PLATFORM_MACOSX_1@monodll_fswatcher_kqueue.o: $(srcdir)/src/unix/fswatcher_kqueue.cpp $(MONODLL_ODEP) @COND_PLATFORM_MACOSX_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/unix/fswatcher_kqueue.cpp -@COND_PLATFORM_MACOSX_1@monodll_cocoa_stdpaths.o: $(srcdir)/src/osx/cocoa/stdpaths.mm $(MONODLL_ODEP) -@COND_PLATFORM_MACOSX_1@ $(CXXC) -c -o $@ $(MONODLL_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/stdpaths.mm - -@COND_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@monodll_cocoa_stdpaths.o: $(srcdir)/src/osx/cocoa/stdpaths.mm $(MONODLL_ODEP) -@COND_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/stdpaths.mm - @COND_PLATFORM_UNIX_1@monodll_socketiohandler.o: $(srcdir)/src/common/socketiohandler.cpp $(MONODLL_ODEP) @COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/common/socketiohandler.cpp @@ -17497,6 +17549,12 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP) @COND_TOOLKIT_DFB_USE_GUI_1@monodll_generic_caret.o: $(srcdir)/src/generic/caret.cpp $(MONODLL_ODEP) @COND_TOOLKIT_DFB_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/caret.cpp +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@monodll_generic_imaglist.o: $(srcdir)/src/generic/imaglist.cpp $(MONODLL_ODEP) +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/imaglist.cpp + +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@monodll_generic_imaglist.o: $(srcdir)/src/generic/imaglist.cpp $(MONODLL_ODEP) +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/imaglist.cpp + @COND_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@monodll_generic_imaglist.o: $(srcdir)/src/generic/imaglist.cpp $(MONODLL_ODEP) @COND_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/imaglist.cpp @@ -17566,33 +17624,6 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP) @COND_TOOLKIT_X11_USE_GUI_1@monodll_unix_dialup.o: $(srcdir)/src/unix/dialup.cpp $(MONODLL_ODEP) @COND_TOOLKIT_X11_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/unix/dialup.cpp -@COND_PLATFORM_UNIX_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@monodll_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(MONODLL_ODEP) -@COND_PLATFORM_UNIX_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp - -@COND_PLATFORM_MACOSX_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@monodll_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(MONODLL_ODEP) -@COND_PLATFORM_MACOSX_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp - -@COND_PLATFORM_UNIX_1_TOOLKIT_GTK_TOOLKIT_VERSION_3_USE_GUI_1@monodll_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(MONODLL_ODEP) -@COND_PLATFORM_UNIX_1_TOOLKIT_GTK_TOOLKIT_VERSION_3_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp - -@COND_PLATFORM_MACOSX_1_TOOLKIT_GTK_TOOLKIT_VERSION_3_USE_GUI_1@monodll_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(MONODLL_ODEP) -@COND_PLATFORM_MACOSX_1_TOOLKIT_GTK_TOOLKIT_VERSION_3_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp - -@COND_PLATFORM_UNIX_1_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@monodll_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(MONODLL_ODEP) -@COND_PLATFORM_UNIX_1_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp - -@COND_PLATFORM_MACOSX_1_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@monodll_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(MONODLL_ODEP) -@COND_PLATFORM_MACOSX_1_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp - -@COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1@monodll_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(MONODLL_ODEP) -@COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp - -@COND_TOOLKIT_MOTIF_USE_GUI_1@monodll_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(MONODLL_ODEP) -@COND_TOOLKIT_MOTIF_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp - -@COND_TOOLKIT_X11_USE_GUI_1@monodll_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(MONODLL_ODEP) -@COND_TOOLKIT_X11_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp - @COND_PLATFORM_UNIX_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@monodll_unix_fontenum.o: $(srcdir)/src/unix/fontenum.cpp $(MONODLL_ODEP) @COND_PLATFORM_UNIX_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/unix/fontenum.cpp @@ -17845,6 +17876,9 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP) @COND_TOOLKIT_X11_USE_GUI_1@monodll_taskbarx11.o: $(srcdir)/src/unix/taskbarx11.cpp $(MONODLL_ODEP) @COND_TOOLKIT_X11_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/unix/taskbarx11.cpp +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@monodll_automtn.o: $(srcdir)/src/msw/ole/automtn.cpp $(MONODLL_ODEP) +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/ole/automtn.cpp + @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@monodll_automtn.o: $(srcdir)/src/msw/ole/automtn.cpp $(MONODLL_ODEP) @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/ole/automtn.cpp @@ -17857,6 +17891,9 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@monodll_automtn.o: $(srcdir)/src/msw/ole/automtn.cpp $(MONODLL_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/ole/automtn.cpp +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@monodll_comimpl.o: $(srcdir)/src/msw/ole/comimpl.cpp $(MONODLL_ODEP) +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/ole/comimpl.cpp + @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@monodll_comimpl.o: $(srcdir)/src/msw/ole/comimpl.cpp $(MONODLL_ODEP) @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/ole/comimpl.cpp @@ -17869,6 +17906,9 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@monodll_comimpl.o: $(srcdir)/src/msw/ole/comimpl.cpp $(MONODLL_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/ole/comimpl.cpp +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@monodll_oleutils.o: $(srcdir)/src/msw/ole/oleutils.cpp $(MONODLL_ODEP) +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/ole/oleutils.cpp + @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@monodll_oleutils.o: $(srcdir)/src/msw/ole/oleutils.cpp $(MONODLL_ODEP) @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/ole/oleutils.cpp @@ -17881,6 +17921,9 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@monodll_oleutils.o: $(srcdir)/src/msw/ole/oleutils.cpp $(MONODLL_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/ole/oleutils.cpp +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@monodll_safearray.o: $(srcdir)/src/msw/ole/safearray.cpp $(MONODLL_ODEP) +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/ole/safearray.cpp + @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@monodll_safearray.o: $(srcdir)/src/msw/ole/safearray.cpp $(MONODLL_ODEP) @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/ole/safearray.cpp @@ -17893,6 +17936,9 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@monodll_safearray.o: $(srcdir)/src/msw/ole/safearray.cpp $(MONODLL_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/ole/safearray.cpp +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@monodll_uuid.o: $(srcdir)/src/msw/ole/uuid.cpp $(MONODLL_ODEP) +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/ole/uuid.cpp + @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@monodll_uuid.o: $(srcdir)/src/msw/ole/uuid.cpp $(MONODLL_ODEP) @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/ole/uuid.cpp @@ -17905,6 +17951,9 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@monodll_uuid.o: $(srcdir)/src/msw/ole/uuid.cpp $(MONODLL_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/ole/uuid.cpp +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@monodll_msw_dialup.o: $(srcdir)/src/msw/dialup.cpp $(MONODLL_ODEP) +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/dialup.cpp + @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@monodll_msw_dialup.o: $(srcdir)/src/msw/dialup.cpp $(MONODLL_ODEP) @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/dialup.cpp @@ -17917,6 +17966,9 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@monodll_msw_dialup.o: $(srcdir)/src/msw/dialup.cpp $(MONODLL_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/dialup.cpp +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@monodll_dib.o: $(srcdir)/src/msw/dib.cpp $(MONODLL_ODEP) +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/dib.cpp + @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@monodll_dib.o: $(srcdir)/src/msw/dib.cpp $(MONODLL_ODEP) @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/dib.cpp @@ -17953,6 +18005,9 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@monodll_utilswin.o: $(srcdir)/src/msw/utilswin.cpp $(MONODLL_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/utilswin.cpp +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@monodll_msw_sound.o: $(srcdir)/src/msw/sound.cpp $(MONODLL_ODEP) +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/sound.cpp + @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@monodll_msw_sound.o: $(srcdir)/src/msw/sound.cpp $(MONODLL_ODEP) @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/sound.cpp @@ -17965,6 +18020,9 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@monodll_msw_sound.o: $(srcdir)/src/msw/sound.cpp $(MONODLL_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/sound.cpp +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@monodll_msw_joystick.o: $(srcdir)/src/msw/joystick.cpp $(MONODLL_ODEP) +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/joystick.cpp + @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@monodll_msw_joystick.o: $(srcdir)/src/msw/joystick.cpp $(MONODLL_ODEP) @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/joystick.cpp @@ -18421,6 +18479,15 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP) @COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1@monodll_gtk1_window.o: $(srcdir)/src/gtk1/window.cpp $(MONODLL_ODEP) @COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/gtk1/window.cpp +@COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1@monodll_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(MONODLL_ODEP) +@COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp + +@COND_TOOLKIT_MOTIF_USE_GUI_1@monodll_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(MONODLL_ODEP) +@COND_TOOLKIT_MOTIF_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp + +@COND_TOOLKIT_X11_USE_GUI_1@monodll_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(MONODLL_ODEP) +@COND_TOOLKIT_X11_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp + @COND_TOOLKIT_MOTIF_USE_GUI_1@monodll_x11_bitmap.o: $(srcdir)/src/x11/bitmap.cpp $(MONODLL_ODEP) @COND_TOOLKIT_MOTIF_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/x11/bitmap.cpp @@ -18616,23 +18683,8 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@monodll_notifmsgrt.o: $(srcdir)/src/msw/rt/notifmsgrt.cpp $(MONODLL_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/rt/notifmsgrt.cpp -@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1_WXUNIV_0@monodll_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(MONODLL_ODEP) -@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp - -@COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1_WXUNIV_0@monodll_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(MONODLL_ODEP) -@COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp - -@COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@monodll_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(MONODLL_ODEP) -@COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp - -@COND_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@monodll_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(MONODLL_ODEP) -@COND_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp - -@COND_TOOLKIT_MSW_USE_GUI_1@monodll_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(MONODLL_ODEP) -@COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp - -@COND_USE_GUI_1_WXUNIV_1@monodll_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(MONODLL_ODEP) -@COND_USE_GUI_1_WXUNIV_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp +@COND_TOOLKIT_MSW_USE_GUI_1@monodll_msw_evtloop.o: $(srcdir)/src/msw/evtloop.cpp $(MONODLL_ODEP) +@COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/evtloop.cpp @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@monodll_artmac.o: $(srcdir)/src/osx/artmac.cpp $(MONODLL_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/osx/artmac.cpp @@ -18658,12 +18710,6 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@monodll_osx_fontutil.o: $(srcdir)/src/osx/fontutil.cpp $(MONODLL_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/osx/fontutil.cpp -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@monodll_osx_imaglist.o: $(srcdir)/src/osx/imaglist.cpp $(MONODLL_ODEP) -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/osx/imaglist.cpp - -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@monodll_osx_imaglist.o: $(srcdir)/src/osx/imaglist.cpp $(MONODLL_ODEP) -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/osx/imaglist.cpp - @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@monodll_osx_minifram.o: $(srcdir)/src/osx/minifram.cpp $(MONODLL_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/osx/minifram.cpp @@ -18730,12 +18776,6 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@monodll_core_dcmemory.o: $(srcdir)/src/osx/core/dcmemory.cpp $(MONODLL_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/osx/core/dcmemory.cpp -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@monodll_core_display.o: $(srcdir)/src/osx/core/display.cpp $(MONODLL_ODEP) -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/osx/core/display.cpp - -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@monodll_core_display.o: $(srcdir)/src/osx/core/display.cpp $(MONODLL_ODEP) -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/osx/core/display.cpp - @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@monodll_core_fontenum.o: $(srcdir)/src/osx/core/fontenum.cpp $(MONODLL_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/osx/core/fontenum.cpp @@ -19597,6 +19637,24 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP) @COND_USE_GUI_1_WXUNIV_1@monodll_fontdlgg.o: $(srcdir)/src/generic/fontdlgg.cpp $(MONODLL_ODEP) @COND_USE_GUI_1_WXUNIV_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/fontdlgg.cpp +@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1_WXUNIV_0@monodll_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(MONODLL_ODEP) +@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp + +@COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1_WXUNIV_0@monodll_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(MONODLL_ODEP) +@COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp + +@COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@monodll_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(MONODLL_ODEP) +@COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp + +@COND_TOOLKIT_MSW_USE_GUI_1_WXUNIV_0@monodll_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(MONODLL_ODEP) +@COND_TOOLKIT_MSW_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp + +@COND_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@monodll_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(MONODLL_ODEP) +@COND_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp + +@COND_USE_GUI_1_WXUNIV_1@monodll_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(MONODLL_ODEP) +@COND_USE_GUI_1_WXUNIV_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp + @COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1_WXUNIV_0@monodll_clrpickerg.o: $(srcdir)/src/generic/clrpickerg.cpp $(MONODLL_ODEP) @COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/clrpickerg.cpp @@ -19708,9 +19766,6 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP) @COND_USE_GUI_1_WXUNIV_1@monodll_mdig.o: $(srcdir)/src/generic/mdig.cpp $(MONODLL_ODEP) @COND_USE_GUI_1_WXUNIV_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/mdig.cpp -@COND_TOOLKIT_MSW_USE_GUI_1@monodll_msw_evtloop.o: $(srcdir)/src/msw/evtloop.cpp $(MONODLL_ODEP) -@COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/evtloop.cpp - @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@monodll_anybutton_osx.o: $(srcdir)/src/osx/anybutton_osx.cpp $(MONODLL_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/osx/anybutton_osx.cpp @@ -20017,6 +20072,12 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@monodll_utilscocoa.o: $(srcdir)/src/osx/carbon/utilscocoa.mm $(MONODLL_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_OBJCXXFLAGS) $(srcdir)/src/osx/carbon/utilscocoa.mm +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@monodll_statbmp_osx.o: $(srcdir)/src/osx/statbmp_osx.cpp $(MONODLL_ODEP) +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/osx/statbmp_osx.cpp + +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@monodll_statbmp_osx.o: $(srcdir)/src/osx/statbmp_osx.cpp $(MONODLL_ODEP) +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/osx/statbmp_osx.cpp + @COND_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@monodll_core_sound.o: $(srcdir)/src/osx/core/sound.cpp $(MONODLL_ODEP) @COND_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/osx/core/sound.cpp @@ -21025,6 +21086,9 @@ monolib_core_secretstore.o: $(srcdir)/src/osx/core/secretstore.cpp $(MONOLIB_ODE monolib_fswatcher_fsevents.o: $(srcdir)/src/osx/fswatcher_fsevents.cpp $(MONOLIB_ODEP) $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/osx/fswatcher_fsevents.cpp +monolib_cocoa_stdpaths.o: $(srcdir)/src/osx/cocoa/stdpaths.mm $(MONOLIB_ODEP) + $(CXXC) -c -o $@ $(MONOLIB_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/stdpaths.mm + monolib_event.o: $(srcdir)/src/common/event.cpp $(MONOLIB_ODEP) $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/common/event.cpp @@ -21694,6 +21758,12 @@ monolib_timectrl_osx.o: $(srcdir)/src/osx/timectrl_osx.cpp $(MONOLIB_ODEP) monolib_cocoa_activityindicator.o: $(srcdir)/src/osx/cocoa/activityindicator.mm $(MONOLIB_ODEP) $(CXXC) -c -o $@ $(MONOLIB_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/activityindicator.mm +monolib_cocoa_statbmp.o: $(srcdir)/src/osx/cocoa/statbmp.mm $(MONOLIB_ODEP) + $(CXXC) -c -o $@ $(MONOLIB_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/statbmp.mm + +monolib_core_display.o: $(srcdir)/src/osx/core/display.cpp $(MONOLIB_ODEP) + $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/osx/core/display.cpp + monolib_regiong.o: $(srcdir)/src/generic/regiong.cpp $(MONOLIB_ODEP) $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/regiong.cpp @@ -21745,6 +21815,9 @@ monolib_iphone_window.o: $(srcdir)/src/osx/iphone/window.mm $(MONOLIB_ODEP) monolib_iphone_settings.o: $(srcdir)/src/osx/iphone/settings.mm $(MONOLIB_ODEP) $(CXXC) -c -o $@ $(MONOLIB_OBJCXXFLAGS) $(srcdir)/src/osx/iphone/settings.mm +monolib_iphone_statbmp.o: $(srcdir)/src/osx/iphone/statbmp.mm $(MONOLIB_ODEP) + $(CXXC) -c -o $@ $(MONOLIB_OBJCXXFLAGS) $(srcdir)/src/osx/iphone/statbmp.mm + monolib_qt_accel.o: $(srcdir)/src/qt/accel.cpp $(MONOLIB_ODEP) $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/qt/accel.cpp @@ -22669,12 +22742,6 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP) @COND_PLATFORM_MACOSX_1@monolib_fswatcher_kqueue.o: $(srcdir)/src/unix/fswatcher_kqueue.cpp $(MONOLIB_ODEP) @COND_PLATFORM_MACOSX_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/unix/fswatcher_kqueue.cpp -@COND_PLATFORM_MACOSX_1@monolib_cocoa_stdpaths.o: $(srcdir)/src/osx/cocoa/stdpaths.mm $(MONOLIB_ODEP) -@COND_PLATFORM_MACOSX_1@ $(CXXC) -c -o $@ $(MONOLIB_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/stdpaths.mm - -@COND_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@monolib_cocoa_stdpaths.o: $(srcdir)/src/osx/cocoa/stdpaths.mm $(MONOLIB_ODEP) -@COND_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/stdpaths.mm - @COND_PLATFORM_UNIX_1@monolib_socketiohandler.o: $(srcdir)/src/common/socketiohandler.cpp $(MONOLIB_ODEP) @COND_PLATFORM_UNIX_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/common/socketiohandler.cpp @@ -22735,6 +22802,12 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_DFB_USE_GUI_1@monolib_generic_caret.o: $(srcdir)/src/generic/caret.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_DFB_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/caret.cpp +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@monolib_generic_imaglist.o: $(srcdir)/src/generic/imaglist.cpp $(MONOLIB_ODEP) +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/imaglist.cpp + +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@monolib_generic_imaglist.o: $(srcdir)/src/generic/imaglist.cpp $(MONOLIB_ODEP) +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/imaglist.cpp + @COND_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@monolib_generic_imaglist.o: $(srcdir)/src/generic/imaglist.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/imaglist.cpp @@ -22804,33 +22877,6 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_X11_USE_GUI_1@monolib_unix_dialup.o: $(srcdir)/src/unix/dialup.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_X11_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/unix/dialup.cpp -@COND_PLATFORM_UNIX_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@monolib_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(MONOLIB_ODEP) -@COND_PLATFORM_UNIX_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp - -@COND_PLATFORM_MACOSX_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@monolib_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(MONOLIB_ODEP) -@COND_PLATFORM_MACOSX_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp - -@COND_PLATFORM_UNIX_1_TOOLKIT_GTK_TOOLKIT_VERSION_3_USE_GUI_1@monolib_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(MONOLIB_ODEP) -@COND_PLATFORM_UNIX_1_TOOLKIT_GTK_TOOLKIT_VERSION_3_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp - -@COND_PLATFORM_MACOSX_1_TOOLKIT_GTK_TOOLKIT_VERSION_3_USE_GUI_1@monolib_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(MONOLIB_ODEP) -@COND_PLATFORM_MACOSX_1_TOOLKIT_GTK_TOOLKIT_VERSION_3_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp - -@COND_PLATFORM_UNIX_1_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@monolib_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(MONOLIB_ODEP) -@COND_PLATFORM_UNIX_1_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp - -@COND_PLATFORM_MACOSX_1_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@monolib_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(MONOLIB_ODEP) -@COND_PLATFORM_MACOSX_1_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp - -@COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1@monolib_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(MONOLIB_ODEP) -@COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp - -@COND_TOOLKIT_MOTIF_USE_GUI_1@monolib_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(MONOLIB_ODEP) -@COND_TOOLKIT_MOTIF_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp - -@COND_TOOLKIT_X11_USE_GUI_1@monolib_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(MONOLIB_ODEP) -@COND_TOOLKIT_X11_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp - @COND_PLATFORM_UNIX_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@monolib_unix_fontenum.o: $(srcdir)/src/unix/fontenum.cpp $(MONOLIB_ODEP) @COND_PLATFORM_UNIX_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/unix/fontenum.cpp @@ -23083,6 +23129,9 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_X11_USE_GUI_1@monolib_taskbarx11.o: $(srcdir)/src/unix/taskbarx11.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_X11_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/unix/taskbarx11.cpp +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@monolib_automtn.o: $(srcdir)/src/msw/ole/automtn.cpp $(MONOLIB_ODEP) +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/ole/automtn.cpp + @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@monolib_automtn.o: $(srcdir)/src/msw/ole/automtn.cpp $(MONOLIB_ODEP) @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/ole/automtn.cpp @@ -23095,6 +23144,9 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@monolib_automtn.o: $(srcdir)/src/msw/ole/automtn.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/ole/automtn.cpp +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@monolib_comimpl.o: $(srcdir)/src/msw/ole/comimpl.cpp $(MONOLIB_ODEP) +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/ole/comimpl.cpp + @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@monolib_comimpl.o: $(srcdir)/src/msw/ole/comimpl.cpp $(MONOLIB_ODEP) @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/ole/comimpl.cpp @@ -23107,6 +23159,9 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@monolib_comimpl.o: $(srcdir)/src/msw/ole/comimpl.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/ole/comimpl.cpp +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@monolib_oleutils.o: $(srcdir)/src/msw/ole/oleutils.cpp $(MONOLIB_ODEP) +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/ole/oleutils.cpp + @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@monolib_oleutils.o: $(srcdir)/src/msw/ole/oleutils.cpp $(MONOLIB_ODEP) @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/ole/oleutils.cpp @@ -23119,6 +23174,9 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@monolib_oleutils.o: $(srcdir)/src/msw/ole/oleutils.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/ole/oleutils.cpp +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@monolib_safearray.o: $(srcdir)/src/msw/ole/safearray.cpp $(MONOLIB_ODEP) +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/ole/safearray.cpp + @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@monolib_safearray.o: $(srcdir)/src/msw/ole/safearray.cpp $(MONOLIB_ODEP) @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/ole/safearray.cpp @@ -23131,6 +23189,9 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@monolib_safearray.o: $(srcdir)/src/msw/ole/safearray.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/ole/safearray.cpp +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@monolib_uuid.o: $(srcdir)/src/msw/ole/uuid.cpp $(MONOLIB_ODEP) +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/ole/uuid.cpp + @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@monolib_uuid.o: $(srcdir)/src/msw/ole/uuid.cpp $(MONOLIB_ODEP) @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/ole/uuid.cpp @@ -23143,6 +23204,9 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@monolib_uuid.o: $(srcdir)/src/msw/ole/uuid.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/ole/uuid.cpp +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@monolib_msw_dialup.o: $(srcdir)/src/msw/dialup.cpp $(MONOLIB_ODEP) +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/dialup.cpp + @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@monolib_msw_dialup.o: $(srcdir)/src/msw/dialup.cpp $(MONOLIB_ODEP) @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/dialup.cpp @@ -23155,6 +23219,9 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@monolib_msw_dialup.o: $(srcdir)/src/msw/dialup.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/dialup.cpp +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@monolib_dib.o: $(srcdir)/src/msw/dib.cpp $(MONOLIB_ODEP) +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/dib.cpp + @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@monolib_dib.o: $(srcdir)/src/msw/dib.cpp $(MONOLIB_ODEP) @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/dib.cpp @@ -23191,6 +23258,9 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@monolib_utilswin.o: $(srcdir)/src/msw/utilswin.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/utilswin.cpp +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@monolib_msw_sound.o: $(srcdir)/src/msw/sound.cpp $(MONOLIB_ODEP) +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/sound.cpp + @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@monolib_msw_sound.o: $(srcdir)/src/msw/sound.cpp $(MONOLIB_ODEP) @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/sound.cpp @@ -23203,6 +23273,9 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@monolib_msw_sound.o: $(srcdir)/src/msw/sound.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/sound.cpp +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@monolib_msw_joystick.o: $(srcdir)/src/msw/joystick.cpp $(MONOLIB_ODEP) +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/joystick.cpp + @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@monolib_msw_joystick.o: $(srcdir)/src/msw/joystick.cpp $(MONOLIB_ODEP) @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/joystick.cpp @@ -23659,6 +23732,15 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1@monolib_gtk1_window.o: $(srcdir)/src/gtk1/window.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/gtk1/window.cpp +@COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1@monolib_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(MONOLIB_ODEP) +@COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp + +@COND_TOOLKIT_MOTIF_USE_GUI_1@monolib_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(MONOLIB_ODEP) +@COND_TOOLKIT_MOTIF_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp + +@COND_TOOLKIT_X11_USE_GUI_1@monolib_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(MONOLIB_ODEP) +@COND_TOOLKIT_X11_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp + @COND_TOOLKIT_MOTIF_USE_GUI_1@monolib_x11_bitmap.o: $(srcdir)/src/x11/bitmap.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_MOTIF_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/x11/bitmap.cpp @@ -23854,23 +23936,8 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@monolib_notifmsgrt.o: $(srcdir)/src/msw/rt/notifmsgrt.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/rt/notifmsgrt.cpp -@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1_WXUNIV_0@monolib_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(MONOLIB_ODEP) -@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp - -@COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1_WXUNIV_0@monolib_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(MONOLIB_ODEP) -@COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp - -@COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@monolib_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(MONOLIB_ODEP) -@COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp - -@COND_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@monolib_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(MONOLIB_ODEP) -@COND_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp - -@COND_TOOLKIT_MSW_USE_GUI_1@monolib_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(MONOLIB_ODEP) -@COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp - -@COND_USE_GUI_1_WXUNIV_1@monolib_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(MONOLIB_ODEP) -@COND_USE_GUI_1_WXUNIV_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp +@COND_TOOLKIT_MSW_USE_GUI_1@monolib_msw_evtloop.o: $(srcdir)/src/msw/evtloop.cpp $(MONOLIB_ODEP) +@COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/evtloop.cpp @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@monolib_artmac.o: $(srcdir)/src/osx/artmac.cpp $(MONOLIB_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/osx/artmac.cpp @@ -23896,12 +23963,6 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@monolib_osx_fontutil.o: $(srcdir)/src/osx/fontutil.cpp $(MONOLIB_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/osx/fontutil.cpp -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@monolib_osx_imaglist.o: $(srcdir)/src/osx/imaglist.cpp $(MONOLIB_ODEP) -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/osx/imaglist.cpp - -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@monolib_osx_imaglist.o: $(srcdir)/src/osx/imaglist.cpp $(MONOLIB_ODEP) -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/osx/imaglist.cpp - @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@monolib_osx_minifram.o: $(srcdir)/src/osx/minifram.cpp $(MONOLIB_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/osx/minifram.cpp @@ -23968,12 +24029,6 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@monolib_core_dcmemory.o: $(srcdir)/src/osx/core/dcmemory.cpp $(MONOLIB_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/osx/core/dcmemory.cpp -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@monolib_core_display.o: $(srcdir)/src/osx/core/display.cpp $(MONOLIB_ODEP) -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/osx/core/display.cpp - -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@monolib_core_display.o: $(srcdir)/src/osx/core/display.cpp $(MONOLIB_ODEP) -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/osx/core/display.cpp - @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@monolib_core_fontenum.o: $(srcdir)/src/osx/core/fontenum.cpp $(MONOLIB_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/osx/core/fontenum.cpp @@ -24835,6 +24890,24 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP) @COND_USE_GUI_1_WXUNIV_1@monolib_fontdlgg.o: $(srcdir)/src/generic/fontdlgg.cpp $(MONOLIB_ODEP) @COND_USE_GUI_1_WXUNIV_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/fontdlgg.cpp +@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1_WXUNIV_0@monolib_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(MONOLIB_ODEP) +@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp + +@COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1_WXUNIV_0@monolib_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(MONOLIB_ODEP) +@COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp + +@COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@monolib_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(MONOLIB_ODEP) +@COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp + +@COND_TOOLKIT_MSW_USE_GUI_1_WXUNIV_0@monolib_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(MONOLIB_ODEP) +@COND_TOOLKIT_MSW_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp + +@COND_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@monolib_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(MONOLIB_ODEP) +@COND_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp + +@COND_USE_GUI_1_WXUNIV_1@monolib_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(MONOLIB_ODEP) +@COND_USE_GUI_1_WXUNIV_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp + @COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1_WXUNIV_0@monolib_clrpickerg.o: $(srcdir)/src/generic/clrpickerg.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/clrpickerg.cpp @@ -24946,9 +25019,6 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP) @COND_USE_GUI_1_WXUNIV_1@monolib_mdig.o: $(srcdir)/src/generic/mdig.cpp $(MONOLIB_ODEP) @COND_USE_GUI_1_WXUNIV_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/mdig.cpp -@COND_TOOLKIT_MSW_USE_GUI_1@monolib_msw_evtloop.o: $(srcdir)/src/msw/evtloop.cpp $(MONOLIB_ODEP) -@COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/evtloop.cpp - @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@monolib_anybutton_osx.o: $(srcdir)/src/osx/anybutton_osx.cpp $(MONOLIB_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/osx/anybutton_osx.cpp @@ -25255,6 +25325,12 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@monolib_utilscocoa.o: $(srcdir)/src/osx/carbon/utilscocoa.mm $(MONOLIB_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_OBJCXXFLAGS) $(srcdir)/src/osx/carbon/utilscocoa.mm +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@monolib_statbmp_osx.o: $(srcdir)/src/osx/statbmp_osx.cpp $(MONOLIB_ODEP) +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/osx/statbmp_osx.cpp + +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@monolib_statbmp_osx.o: $(srcdir)/src/osx/statbmp_osx.cpp $(MONOLIB_ODEP) +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/osx/statbmp_osx.cpp + @COND_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@monolib_core_sound.o: $(srcdir)/src/osx/core/sound.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/osx/core/sound.cpp @@ -27595,6 +27671,12 @@ coredll_timectrl_osx.o: $(srcdir)/src/osx/timectrl_osx.cpp $(COREDLL_ODEP) coredll_cocoa_activityindicator.o: $(srcdir)/src/osx/cocoa/activityindicator.mm $(COREDLL_ODEP) $(CXXC) -c -o $@ $(COREDLL_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/activityindicator.mm +coredll_cocoa_statbmp.o: $(srcdir)/src/osx/cocoa/statbmp.mm $(COREDLL_ODEP) + $(CXXC) -c -o $@ $(COREDLL_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/statbmp.mm + +coredll_core_display.o: $(srcdir)/src/osx/core/display.cpp $(COREDLL_ODEP) + $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/osx/core/display.cpp + coredll_regiong.o: $(srcdir)/src/generic/regiong.cpp $(COREDLL_ODEP) $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/regiong.cpp @@ -27643,12 +27725,12 @@ coredll_iphone_utils.o: $(srcdir)/src/osx/iphone/utils.mm $(COREDLL_ODEP) coredll_iphone_window.o: $(srcdir)/src/osx/iphone/window.mm $(COREDLL_ODEP) $(CXXC) -c -o $@ $(COREDLL_OBJCXXFLAGS) $(srcdir)/src/osx/iphone/window.mm -coredll_stdpaths.o: $(srcdir)/src/osx/cocoa/stdpaths.mm $(COREDLL_ODEP) - $(CXXC) -c -o $@ $(COREDLL_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/stdpaths.mm - coredll_iphone_settings.o: $(srcdir)/src/osx/iphone/settings.mm $(COREDLL_ODEP) $(CXXC) -c -o $@ $(COREDLL_OBJCXXFLAGS) $(srcdir)/src/osx/iphone/settings.mm +coredll_iphone_statbmp.o: $(srcdir)/src/osx/iphone/statbmp.mm $(COREDLL_ODEP) + $(CXXC) -c -o $@ $(COREDLL_OBJCXXFLAGS) $(srcdir)/src/osx/iphone/statbmp.mm + coredll_qt_accel.o: $(srcdir)/src/qt/accel.cpp $(COREDLL_ODEP) $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/qt/accel.cpp @@ -28066,6 +28148,12 @@ coredll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(COREDLL_ODEP) @COND_TOOLKIT_DFB_USE_GUI_1@coredll_generic_caret.o: $(srcdir)/src/generic/caret.cpp $(COREDLL_ODEP) @COND_TOOLKIT_DFB_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/caret.cpp +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@coredll_generic_imaglist.o: $(srcdir)/src/generic/imaglist.cpp $(COREDLL_ODEP) +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/imaglist.cpp + +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@coredll_generic_imaglist.o: $(srcdir)/src/generic/imaglist.cpp $(COREDLL_ODEP) +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/imaglist.cpp + @COND_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@coredll_generic_imaglist.o: $(srcdir)/src/generic/imaglist.cpp $(COREDLL_ODEP) @COND_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/imaglist.cpp @@ -28135,33 +28223,6 @@ coredll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(COREDLL_ODEP) @COND_TOOLKIT_X11_USE_GUI_1@coredll_unix_dialup.o: $(srcdir)/src/unix/dialup.cpp $(COREDLL_ODEP) @COND_TOOLKIT_X11_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/unix/dialup.cpp -@COND_PLATFORM_UNIX_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@coredll_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(COREDLL_ODEP) -@COND_PLATFORM_UNIX_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp - -@COND_PLATFORM_MACOSX_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@coredll_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(COREDLL_ODEP) -@COND_PLATFORM_MACOSX_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp - -@COND_PLATFORM_UNIX_1_TOOLKIT_GTK_TOOLKIT_VERSION_3_USE_GUI_1@coredll_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(COREDLL_ODEP) -@COND_PLATFORM_UNIX_1_TOOLKIT_GTK_TOOLKIT_VERSION_3_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp - -@COND_PLATFORM_MACOSX_1_TOOLKIT_GTK_TOOLKIT_VERSION_3_USE_GUI_1@coredll_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(COREDLL_ODEP) -@COND_PLATFORM_MACOSX_1_TOOLKIT_GTK_TOOLKIT_VERSION_3_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp - -@COND_PLATFORM_UNIX_1_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@coredll_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(COREDLL_ODEP) -@COND_PLATFORM_UNIX_1_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp - -@COND_PLATFORM_MACOSX_1_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@coredll_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(COREDLL_ODEP) -@COND_PLATFORM_MACOSX_1_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp - -@COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1@coredll_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(COREDLL_ODEP) -@COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp - -@COND_TOOLKIT_MOTIF_USE_GUI_1@coredll_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(COREDLL_ODEP) -@COND_TOOLKIT_MOTIF_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp - -@COND_TOOLKIT_X11_USE_GUI_1@coredll_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(COREDLL_ODEP) -@COND_TOOLKIT_X11_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp - @COND_PLATFORM_UNIX_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@coredll_unix_fontenum.o: $(srcdir)/src/unix/fontenum.cpp $(COREDLL_ODEP) @COND_PLATFORM_UNIX_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/unix/fontenum.cpp @@ -28414,6 +28475,9 @@ coredll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(COREDLL_ODEP) @COND_TOOLKIT_X11_USE_GUI_1@coredll_taskbarx11.o: $(srcdir)/src/unix/taskbarx11.cpp $(COREDLL_ODEP) @COND_TOOLKIT_X11_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/unix/taskbarx11.cpp +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@coredll_automtn.o: $(srcdir)/src/msw/ole/automtn.cpp $(COREDLL_ODEP) +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/ole/automtn.cpp + @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@coredll_automtn.o: $(srcdir)/src/msw/ole/automtn.cpp $(COREDLL_ODEP) @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/ole/automtn.cpp @@ -28426,6 +28490,9 @@ coredll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(COREDLL_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@coredll_automtn.o: $(srcdir)/src/msw/ole/automtn.cpp $(COREDLL_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/ole/automtn.cpp +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@coredll_comimpl.o: $(srcdir)/src/msw/ole/comimpl.cpp $(COREDLL_ODEP) +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/ole/comimpl.cpp + @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@coredll_comimpl.o: $(srcdir)/src/msw/ole/comimpl.cpp $(COREDLL_ODEP) @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/ole/comimpl.cpp @@ -28438,6 +28505,9 @@ coredll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(COREDLL_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@coredll_comimpl.o: $(srcdir)/src/msw/ole/comimpl.cpp $(COREDLL_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/ole/comimpl.cpp +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@coredll_oleutils.o: $(srcdir)/src/msw/ole/oleutils.cpp $(COREDLL_ODEP) +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/ole/oleutils.cpp + @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@coredll_oleutils.o: $(srcdir)/src/msw/ole/oleutils.cpp $(COREDLL_ODEP) @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/ole/oleutils.cpp @@ -28450,6 +28520,9 @@ coredll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(COREDLL_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@coredll_oleutils.o: $(srcdir)/src/msw/ole/oleutils.cpp $(COREDLL_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/ole/oleutils.cpp +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@coredll_safearray.o: $(srcdir)/src/msw/ole/safearray.cpp $(COREDLL_ODEP) +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/ole/safearray.cpp + @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@coredll_safearray.o: $(srcdir)/src/msw/ole/safearray.cpp $(COREDLL_ODEP) @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/ole/safearray.cpp @@ -28462,6 +28535,9 @@ coredll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(COREDLL_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@coredll_safearray.o: $(srcdir)/src/msw/ole/safearray.cpp $(COREDLL_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/ole/safearray.cpp +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@coredll_uuid.o: $(srcdir)/src/msw/ole/uuid.cpp $(COREDLL_ODEP) +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/ole/uuid.cpp + @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@coredll_uuid.o: $(srcdir)/src/msw/ole/uuid.cpp $(COREDLL_ODEP) @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/ole/uuid.cpp @@ -28474,6 +28550,9 @@ coredll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(COREDLL_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@coredll_uuid.o: $(srcdir)/src/msw/ole/uuid.cpp $(COREDLL_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/ole/uuid.cpp +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@coredll_msw_dialup.o: $(srcdir)/src/msw/dialup.cpp $(COREDLL_ODEP) +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/dialup.cpp + @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@coredll_msw_dialup.o: $(srcdir)/src/msw/dialup.cpp $(COREDLL_ODEP) @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/dialup.cpp @@ -28486,6 +28565,9 @@ coredll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(COREDLL_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@coredll_msw_dialup.o: $(srcdir)/src/msw/dialup.cpp $(COREDLL_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/dialup.cpp +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@coredll_dib.o: $(srcdir)/src/msw/dib.cpp $(COREDLL_ODEP) +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/dib.cpp + @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@coredll_dib.o: $(srcdir)/src/msw/dib.cpp $(COREDLL_ODEP) @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/dib.cpp @@ -28522,6 +28604,9 @@ coredll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(COREDLL_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@coredll_utilswin.o: $(srcdir)/src/msw/utilswin.cpp $(COREDLL_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/utilswin.cpp +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@coredll_msw_sound.o: $(srcdir)/src/msw/sound.cpp $(COREDLL_ODEP) +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/sound.cpp + @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@coredll_msw_sound.o: $(srcdir)/src/msw/sound.cpp $(COREDLL_ODEP) @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/sound.cpp @@ -28534,6 +28619,9 @@ coredll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(COREDLL_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@coredll_msw_sound.o: $(srcdir)/src/msw/sound.cpp $(COREDLL_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/sound.cpp +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@coredll_msw_joystick.o: $(srcdir)/src/msw/joystick.cpp $(COREDLL_ODEP) +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/joystick.cpp + @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@coredll_msw_joystick.o: $(srcdir)/src/msw/joystick.cpp $(COREDLL_ODEP) @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/joystick.cpp @@ -28990,6 +29078,15 @@ coredll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(COREDLL_ODEP) @COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1@coredll_gtk1_window.o: $(srcdir)/src/gtk1/window.cpp $(COREDLL_ODEP) @COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/gtk1/window.cpp +@COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1@coredll_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(COREDLL_ODEP) +@COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp + +@COND_TOOLKIT_MOTIF_USE_GUI_1@coredll_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(COREDLL_ODEP) +@COND_TOOLKIT_MOTIF_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp + +@COND_TOOLKIT_X11_USE_GUI_1@coredll_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(COREDLL_ODEP) +@COND_TOOLKIT_X11_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp + @COND_TOOLKIT_MOTIF_USE_GUI_1@coredll_x11_bitmap.o: $(srcdir)/src/x11/bitmap.cpp $(COREDLL_ODEP) @COND_TOOLKIT_MOTIF_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/x11/bitmap.cpp @@ -29185,23 +29282,8 @@ coredll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(COREDLL_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@coredll_notifmsgrt.o: $(srcdir)/src/msw/rt/notifmsgrt.cpp $(COREDLL_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/rt/notifmsgrt.cpp -@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1_WXUNIV_0@coredll_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(COREDLL_ODEP) -@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp - -@COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1_WXUNIV_0@coredll_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(COREDLL_ODEP) -@COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp - -@COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@coredll_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(COREDLL_ODEP) -@COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp - -@COND_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@coredll_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(COREDLL_ODEP) -@COND_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp - -@COND_TOOLKIT_MSW_USE_GUI_1@coredll_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(COREDLL_ODEP) -@COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp - -@COND_USE_GUI_1_WXUNIV_1@coredll_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(COREDLL_ODEP) -@COND_USE_GUI_1_WXUNIV_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp +@COND_TOOLKIT_MSW_USE_GUI_1@coredll_msw_evtloop.o: $(srcdir)/src/msw/evtloop.cpp $(COREDLL_ODEP) +@COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/evtloop.cpp @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@coredll_artmac.o: $(srcdir)/src/osx/artmac.cpp $(COREDLL_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/osx/artmac.cpp @@ -29227,12 +29309,6 @@ coredll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(COREDLL_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@coredll_osx_fontutil.o: $(srcdir)/src/osx/fontutil.cpp $(COREDLL_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/osx/fontutil.cpp -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@coredll_osx_imaglist.o: $(srcdir)/src/osx/imaglist.cpp $(COREDLL_ODEP) -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/osx/imaglist.cpp - -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@coredll_osx_imaglist.o: $(srcdir)/src/osx/imaglist.cpp $(COREDLL_ODEP) -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/osx/imaglist.cpp - @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@coredll_osx_minifram.o: $(srcdir)/src/osx/minifram.cpp $(COREDLL_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/osx/minifram.cpp @@ -29299,12 +29375,6 @@ coredll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(COREDLL_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@coredll_core_dcmemory.o: $(srcdir)/src/osx/core/dcmemory.cpp $(COREDLL_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/osx/core/dcmemory.cpp -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@coredll_core_display.o: $(srcdir)/src/osx/core/display.cpp $(COREDLL_ODEP) -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/osx/core/display.cpp - -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@coredll_core_display.o: $(srcdir)/src/osx/core/display.cpp $(COREDLL_ODEP) -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/osx/core/display.cpp - @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@coredll_core_fontenum.o: $(srcdir)/src/osx/core/fontenum.cpp $(COREDLL_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/osx/core/fontenum.cpp @@ -30166,6 +30236,24 @@ coredll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(COREDLL_ODEP) @COND_USE_GUI_1_WXUNIV_1@coredll_fontdlgg.o: $(srcdir)/src/generic/fontdlgg.cpp $(COREDLL_ODEP) @COND_USE_GUI_1_WXUNIV_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/fontdlgg.cpp +@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1_WXUNIV_0@coredll_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(COREDLL_ODEP) +@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp + +@COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1_WXUNIV_0@coredll_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(COREDLL_ODEP) +@COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp + +@COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@coredll_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(COREDLL_ODEP) +@COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp + +@COND_TOOLKIT_MSW_USE_GUI_1_WXUNIV_0@coredll_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(COREDLL_ODEP) +@COND_TOOLKIT_MSW_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp + +@COND_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@coredll_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(COREDLL_ODEP) +@COND_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp + +@COND_USE_GUI_1_WXUNIV_1@coredll_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(COREDLL_ODEP) +@COND_USE_GUI_1_WXUNIV_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp + @COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1_WXUNIV_0@coredll_clrpickerg.o: $(srcdir)/src/generic/clrpickerg.cpp $(COREDLL_ODEP) @COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/clrpickerg.cpp @@ -30277,9 +30365,6 @@ coredll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(COREDLL_ODEP) @COND_USE_GUI_1_WXUNIV_1@coredll_mdig.o: $(srcdir)/src/generic/mdig.cpp $(COREDLL_ODEP) @COND_USE_GUI_1_WXUNIV_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/mdig.cpp -@COND_TOOLKIT_MSW_USE_GUI_1@coredll_msw_evtloop.o: $(srcdir)/src/msw/evtloop.cpp $(COREDLL_ODEP) -@COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/evtloop.cpp - @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@coredll_anybutton_osx.o: $(srcdir)/src/osx/anybutton_osx.cpp $(COREDLL_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/osx/anybutton_osx.cpp @@ -30586,6 +30671,12 @@ coredll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(COREDLL_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@coredll_utilscocoa.o: $(srcdir)/src/osx/carbon/utilscocoa.mm $(COREDLL_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_OBJCXXFLAGS) $(srcdir)/src/osx/carbon/utilscocoa.mm +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@coredll_statbmp_osx.o: $(srcdir)/src/osx/statbmp_osx.cpp $(COREDLL_ODEP) +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/osx/statbmp_osx.cpp + +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@coredll_statbmp_osx.o: $(srcdir)/src/osx/statbmp_osx.cpp $(COREDLL_ODEP) +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/osx/statbmp_osx.cpp + @COND_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@coredll_core_sound.o: $(srcdir)/src/osx/core/sound.cpp $(COREDLL_ODEP) @COND_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/osx/core/sound.cpp @@ -31828,6 +31919,12 @@ corelib_timectrl_osx.o: $(srcdir)/src/osx/timectrl_osx.cpp $(CORELIB_ODEP) corelib_cocoa_activityindicator.o: $(srcdir)/src/osx/cocoa/activityindicator.mm $(CORELIB_ODEP) $(CXXC) -c -o $@ $(CORELIB_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/activityindicator.mm +corelib_cocoa_statbmp.o: $(srcdir)/src/osx/cocoa/statbmp.mm $(CORELIB_ODEP) + $(CXXC) -c -o $@ $(CORELIB_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/statbmp.mm + +corelib_core_display.o: $(srcdir)/src/osx/core/display.cpp $(CORELIB_ODEP) + $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/osx/core/display.cpp + corelib_regiong.o: $(srcdir)/src/generic/regiong.cpp $(CORELIB_ODEP) $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/regiong.cpp @@ -31876,12 +31973,12 @@ corelib_iphone_utils.o: $(srcdir)/src/osx/iphone/utils.mm $(CORELIB_ODEP) corelib_iphone_window.o: $(srcdir)/src/osx/iphone/window.mm $(CORELIB_ODEP) $(CXXC) -c -o $@ $(CORELIB_OBJCXXFLAGS) $(srcdir)/src/osx/iphone/window.mm -corelib_stdpaths.o: $(srcdir)/src/osx/cocoa/stdpaths.mm $(CORELIB_ODEP) - $(CXXC) -c -o $@ $(CORELIB_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/stdpaths.mm - corelib_iphone_settings.o: $(srcdir)/src/osx/iphone/settings.mm $(CORELIB_ODEP) $(CXXC) -c -o $@ $(CORELIB_OBJCXXFLAGS) $(srcdir)/src/osx/iphone/settings.mm +corelib_iphone_statbmp.o: $(srcdir)/src/osx/iphone/statbmp.mm $(CORELIB_ODEP) + $(CXXC) -c -o $@ $(CORELIB_OBJCXXFLAGS) $(srcdir)/src/osx/iphone/statbmp.mm + corelib_qt_accel.o: $(srcdir)/src/qt/accel.cpp $(CORELIB_ODEP) $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/qt/accel.cpp @@ -32299,6 +32396,12 @@ corelib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(CORELIB_ODEP) @COND_TOOLKIT_DFB_USE_GUI_1@corelib_generic_caret.o: $(srcdir)/src/generic/caret.cpp $(CORELIB_ODEP) @COND_TOOLKIT_DFB_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/caret.cpp +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@corelib_generic_imaglist.o: $(srcdir)/src/generic/imaglist.cpp $(CORELIB_ODEP) +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/imaglist.cpp + +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@corelib_generic_imaglist.o: $(srcdir)/src/generic/imaglist.cpp $(CORELIB_ODEP) +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/imaglist.cpp + @COND_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@corelib_generic_imaglist.o: $(srcdir)/src/generic/imaglist.cpp $(CORELIB_ODEP) @COND_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/imaglist.cpp @@ -32368,33 +32471,6 @@ corelib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(CORELIB_ODEP) @COND_TOOLKIT_X11_USE_GUI_1@corelib_unix_dialup.o: $(srcdir)/src/unix/dialup.cpp $(CORELIB_ODEP) @COND_TOOLKIT_X11_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/unix/dialup.cpp -@COND_PLATFORM_UNIX_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@corelib_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(CORELIB_ODEP) -@COND_PLATFORM_UNIX_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp - -@COND_PLATFORM_MACOSX_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@corelib_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(CORELIB_ODEP) -@COND_PLATFORM_MACOSX_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp - -@COND_PLATFORM_UNIX_1_TOOLKIT_GTK_TOOLKIT_VERSION_3_USE_GUI_1@corelib_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(CORELIB_ODEP) -@COND_PLATFORM_UNIX_1_TOOLKIT_GTK_TOOLKIT_VERSION_3_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp - -@COND_PLATFORM_MACOSX_1_TOOLKIT_GTK_TOOLKIT_VERSION_3_USE_GUI_1@corelib_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(CORELIB_ODEP) -@COND_PLATFORM_MACOSX_1_TOOLKIT_GTK_TOOLKIT_VERSION_3_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp - -@COND_PLATFORM_UNIX_1_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@corelib_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(CORELIB_ODEP) -@COND_PLATFORM_UNIX_1_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp - -@COND_PLATFORM_MACOSX_1_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@corelib_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(CORELIB_ODEP) -@COND_PLATFORM_MACOSX_1_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp - -@COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1@corelib_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(CORELIB_ODEP) -@COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp - -@COND_TOOLKIT_MOTIF_USE_GUI_1@corelib_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(CORELIB_ODEP) -@COND_TOOLKIT_MOTIF_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp - -@COND_TOOLKIT_X11_USE_GUI_1@corelib_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(CORELIB_ODEP) -@COND_TOOLKIT_X11_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp - @COND_PLATFORM_UNIX_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@corelib_unix_fontenum.o: $(srcdir)/src/unix/fontenum.cpp $(CORELIB_ODEP) @COND_PLATFORM_UNIX_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/unix/fontenum.cpp @@ -32647,6 +32723,9 @@ corelib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(CORELIB_ODEP) @COND_TOOLKIT_X11_USE_GUI_1@corelib_taskbarx11.o: $(srcdir)/src/unix/taskbarx11.cpp $(CORELIB_ODEP) @COND_TOOLKIT_X11_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/unix/taskbarx11.cpp +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@corelib_automtn.o: $(srcdir)/src/msw/ole/automtn.cpp $(CORELIB_ODEP) +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/ole/automtn.cpp + @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@corelib_automtn.o: $(srcdir)/src/msw/ole/automtn.cpp $(CORELIB_ODEP) @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/ole/automtn.cpp @@ -32659,6 +32738,9 @@ corelib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(CORELIB_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@corelib_automtn.o: $(srcdir)/src/msw/ole/automtn.cpp $(CORELIB_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/ole/automtn.cpp +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@corelib_comimpl.o: $(srcdir)/src/msw/ole/comimpl.cpp $(CORELIB_ODEP) +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/ole/comimpl.cpp + @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@corelib_comimpl.o: $(srcdir)/src/msw/ole/comimpl.cpp $(CORELIB_ODEP) @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/ole/comimpl.cpp @@ -32671,6 +32753,9 @@ corelib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(CORELIB_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@corelib_comimpl.o: $(srcdir)/src/msw/ole/comimpl.cpp $(CORELIB_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/ole/comimpl.cpp +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@corelib_oleutils.o: $(srcdir)/src/msw/ole/oleutils.cpp $(CORELIB_ODEP) +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/ole/oleutils.cpp + @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@corelib_oleutils.o: $(srcdir)/src/msw/ole/oleutils.cpp $(CORELIB_ODEP) @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/ole/oleutils.cpp @@ -32683,6 +32768,9 @@ corelib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(CORELIB_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@corelib_oleutils.o: $(srcdir)/src/msw/ole/oleutils.cpp $(CORELIB_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/ole/oleutils.cpp +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@corelib_safearray.o: $(srcdir)/src/msw/ole/safearray.cpp $(CORELIB_ODEP) +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/ole/safearray.cpp + @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@corelib_safearray.o: $(srcdir)/src/msw/ole/safearray.cpp $(CORELIB_ODEP) @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/ole/safearray.cpp @@ -32695,6 +32783,9 @@ corelib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(CORELIB_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@corelib_safearray.o: $(srcdir)/src/msw/ole/safearray.cpp $(CORELIB_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/ole/safearray.cpp +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@corelib_uuid.o: $(srcdir)/src/msw/ole/uuid.cpp $(CORELIB_ODEP) +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/ole/uuid.cpp + @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@corelib_uuid.o: $(srcdir)/src/msw/ole/uuid.cpp $(CORELIB_ODEP) @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/ole/uuid.cpp @@ -32707,6 +32798,9 @@ corelib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(CORELIB_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@corelib_uuid.o: $(srcdir)/src/msw/ole/uuid.cpp $(CORELIB_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/ole/uuid.cpp +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@corelib_msw_dialup.o: $(srcdir)/src/msw/dialup.cpp $(CORELIB_ODEP) +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/dialup.cpp + @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@corelib_msw_dialup.o: $(srcdir)/src/msw/dialup.cpp $(CORELIB_ODEP) @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/dialup.cpp @@ -32719,6 +32813,9 @@ corelib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(CORELIB_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@corelib_msw_dialup.o: $(srcdir)/src/msw/dialup.cpp $(CORELIB_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/dialup.cpp +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@corelib_dib.o: $(srcdir)/src/msw/dib.cpp $(CORELIB_ODEP) +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/dib.cpp + @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@corelib_dib.o: $(srcdir)/src/msw/dib.cpp $(CORELIB_ODEP) @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/dib.cpp @@ -32755,6 +32852,9 @@ corelib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(CORELIB_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@corelib_utilswin.o: $(srcdir)/src/msw/utilswin.cpp $(CORELIB_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/utilswin.cpp +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@corelib_msw_sound.o: $(srcdir)/src/msw/sound.cpp $(CORELIB_ODEP) +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/sound.cpp + @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@corelib_msw_sound.o: $(srcdir)/src/msw/sound.cpp $(CORELIB_ODEP) @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/sound.cpp @@ -32767,6 +32867,9 @@ corelib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(CORELIB_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@corelib_msw_sound.o: $(srcdir)/src/msw/sound.cpp $(CORELIB_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/sound.cpp +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@corelib_msw_joystick.o: $(srcdir)/src/msw/joystick.cpp $(CORELIB_ODEP) +@COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/joystick.cpp + @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@corelib_msw_joystick.o: $(srcdir)/src/msw/joystick.cpp $(CORELIB_ODEP) @COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/joystick.cpp @@ -33223,6 +33326,15 @@ corelib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(CORELIB_ODEP) @COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1@corelib_gtk1_window.o: $(srcdir)/src/gtk1/window.cpp $(CORELIB_ODEP) @COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/gtk1/window.cpp +@COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1@corelib_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(CORELIB_ODEP) +@COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp + +@COND_TOOLKIT_MOTIF_USE_GUI_1@corelib_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(CORELIB_ODEP) +@COND_TOOLKIT_MOTIF_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp + +@COND_TOOLKIT_X11_USE_GUI_1@corelib_displayx11.o: $(srcdir)/src/unix/displayx11.cpp $(CORELIB_ODEP) +@COND_TOOLKIT_X11_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/unix/displayx11.cpp + @COND_TOOLKIT_MOTIF_USE_GUI_1@corelib_x11_bitmap.o: $(srcdir)/src/x11/bitmap.cpp $(CORELIB_ODEP) @COND_TOOLKIT_MOTIF_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/x11/bitmap.cpp @@ -33418,23 +33530,8 @@ corelib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(CORELIB_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@corelib_notifmsgrt.o: $(srcdir)/src/msw/rt/notifmsgrt.cpp $(CORELIB_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/rt/notifmsgrt.cpp -@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1_WXUNIV_0@corelib_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(CORELIB_ODEP) -@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp - -@COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1_WXUNIV_0@corelib_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(CORELIB_ODEP) -@COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp - -@COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@corelib_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(CORELIB_ODEP) -@COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp - -@COND_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@corelib_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(CORELIB_ODEP) -@COND_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp - -@COND_TOOLKIT_MSW_USE_GUI_1@corelib_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(CORELIB_ODEP) -@COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp - -@COND_USE_GUI_1_WXUNIV_1@corelib_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(CORELIB_ODEP) -@COND_USE_GUI_1_WXUNIV_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp +@COND_TOOLKIT_MSW_USE_GUI_1@corelib_msw_evtloop.o: $(srcdir)/src/msw/evtloop.cpp $(CORELIB_ODEP) +@COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/evtloop.cpp @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@corelib_artmac.o: $(srcdir)/src/osx/artmac.cpp $(CORELIB_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/osx/artmac.cpp @@ -33460,12 +33557,6 @@ corelib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(CORELIB_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@corelib_osx_fontutil.o: $(srcdir)/src/osx/fontutil.cpp $(CORELIB_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/osx/fontutil.cpp -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@corelib_osx_imaglist.o: $(srcdir)/src/osx/imaglist.cpp $(CORELIB_ODEP) -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/osx/imaglist.cpp - -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@corelib_osx_imaglist.o: $(srcdir)/src/osx/imaglist.cpp $(CORELIB_ODEP) -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/osx/imaglist.cpp - @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@corelib_osx_minifram.o: $(srcdir)/src/osx/minifram.cpp $(CORELIB_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/osx/minifram.cpp @@ -33532,12 +33623,6 @@ corelib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(CORELIB_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@corelib_core_dcmemory.o: $(srcdir)/src/osx/core/dcmemory.cpp $(CORELIB_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/osx/core/dcmemory.cpp -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@corelib_core_display.o: $(srcdir)/src/osx/core/display.cpp $(CORELIB_ODEP) -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/osx/core/display.cpp - -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@corelib_core_display.o: $(srcdir)/src/osx/core/display.cpp $(CORELIB_ODEP) -@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/osx/core/display.cpp - @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@corelib_core_fontenum.o: $(srcdir)/src/osx/core/fontenum.cpp $(CORELIB_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/osx/core/fontenum.cpp @@ -34399,6 +34484,24 @@ corelib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(CORELIB_ODEP) @COND_USE_GUI_1_WXUNIV_1@corelib_fontdlgg.o: $(srcdir)/src/generic/fontdlgg.cpp $(CORELIB_ODEP) @COND_USE_GUI_1_WXUNIV_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/fontdlgg.cpp +@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1_WXUNIV_0@corelib_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(CORELIB_ODEP) +@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp + +@COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1_WXUNIV_0@corelib_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(CORELIB_ODEP) +@COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp + +@COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@corelib_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(CORELIB_ODEP) +@COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp + +@COND_TOOLKIT_MSW_USE_GUI_1_WXUNIV_0@corelib_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(CORELIB_ODEP) +@COND_TOOLKIT_MSW_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp + +@COND_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@corelib_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(CORELIB_ODEP) +@COND_TOOLKIT_QT_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp + +@COND_USE_GUI_1_WXUNIV_1@corelib_generic_activityindicator.o: $(srcdir)/src/generic/activityindicator.cpp $(CORELIB_ODEP) +@COND_USE_GUI_1_WXUNIV_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/activityindicator.cpp + @COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1_WXUNIV_0@corelib_clrpickerg.o: $(srcdir)/src/generic/clrpickerg.cpp $(CORELIB_ODEP) @COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/clrpickerg.cpp @@ -34510,9 +34613,6 @@ corelib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(CORELIB_ODEP) @COND_USE_GUI_1_WXUNIV_1@corelib_mdig.o: $(srcdir)/src/generic/mdig.cpp $(CORELIB_ODEP) @COND_USE_GUI_1_WXUNIV_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/mdig.cpp -@COND_TOOLKIT_MSW_USE_GUI_1@corelib_msw_evtloop.o: $(srcdir)/src/msw/evtloop.cpp $(CORELIB_ODEP) -@COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/evtloop.cpp - @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@corelib_anybutton_osx.o: $(srcdir)/src/osx/anybutton_osx.cpp $(CORELIB_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/osx/anybutton_osx.cpp @@ -34819,6 +34919,12 @@ corelib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(CORELIB_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@corelib_utilscocoa.o: $(srcdir)/src/osx/carbon/utilscocoa.mm $(CORELIB_ODEP) @COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_OBJCXXFLAGS) $(srcdir)/src/osx/carbon/utilscocoa.mm +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@corelib_statbmp_osx.o: $(srcdir)/src/osx/statbmp_osx.cpp $(CORELIB_ODEP) +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/osx/statbmp_osx.cpp + +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@corelib_statbmp_osx.o: $(srcdir)/src/osx/statbmp_osx.cpp $(CORELIB_ODEP) +@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/osx/statbmp_osx.cpp + @COND_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@corelib_core_sound.o: $(srcdir)/src/osx/core/sound.cpp $(CORELIB_ODEP) @COND_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/osx/core/sound.cpp diff --git a/appveyor.yml b/appveyor.yml index 5b3d335e05..6737b09320 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -36,11 +36,22 @@ environment: GENERATOR: 'Visual Studio 12' SHARED: ON CONFIGURATION: Release + - TOOLSET: cmake_qt + GENERATOR: 'Visual Studio 14 2015 Win64' + SHARED: ON + CONFIGURATION: Release clone_depth: 50 install: git submodule update --init +init: +- ps: | + if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod ` + https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | ` + Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { ` + throw "There are newer queued builds for this pull request, failing early." } + before_build: - ps: | $env:PATH = $env:PATH -replace "C:\\Program Files\\Git\\usr\\bin","" @@ -49,10 +60,6 @@ before_build: %{$_ -replace "define wxUSE_STL 0", "define wxUSE_STL $env:wxUSE_STL"} | sc include\wx\msw\setup.h } - if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod ` - https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | ` - Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { ` - throw "There are newer queued builds for this pull request, failing early." } build_script: c:\projects\wxwidgets\build\tools\appveyor.bat diff --git a/autoconf_inc.m4 b/autoconf_inc.m4 index f3156ae24a..8d9e122a8a 100644 --- a/autoconf_inc.m4 +++ b/autoconf_inc.m4 @@ -512,6 +512,12 @@ dnl ### begin block 20_COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_G COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1="" fi AC_SUBST(COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1) +dnl ### begin block 20_COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0[wx.bkl] ### + COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0="#" + if test "x$PLATFORM_WIN32" = "x1" -a "x$TOOLKIT" = "xQT" -a "x$USE_GUI" = "x1" -a "x$WXUNIV" = "x0" ; then + COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0="" + fi + AC_SUBST(COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0) dnl ### begin block 20_COND_SHARED_0[wx.bkl] ### COND_SHARED_0="#" if test "x$SHARED" = "x0" ; then @@ -530,12 +536,6 @@ dnl ### begin block 20_COND_SHARED_0_TOOLKIT_MSW_WXUNIV_0[../../samples/dialogs/ COND_SHARED_0_TOOLKIT_MSW_WXUNIV_0="" fi AC_SUBST(COND_SHARED_0_TOOLKIT_MSW_WXUNIV_0) -dnl ### begin block 20_COND_SHARED_0_TOOLKIT_PM_WXUNIV_0[../../samples/dialogs/dialogs.bkl] ### - COND_SHARED_0_TOOLKIT_PM_WXUNIV_0="#" - if test "x$SHARED" = "x0" -a "x$TOOLKIT" = "xPM" -a "x$WXUNIV" = "x0" ; then - COND_SHARED_0_TOOLKIT_PM_WXUNIV_0="" - fi - AC_SUBST(COND_SHARED_0_TOOLKIT_PM_WXUNIV_0) dnl ### begin block 20_COND_SHARED_0_USE_GUI_1_USE_OPENGL_1[wx.bkl] ### COND_SHARED_0_USE_GUI_1_USE_OPENGL_1="#" if test "x$SHARED" = "x0" -a "x$USE_GUI" = "x1" -a "x$USE_OPENGL" = "x1" ; then diff --git a/build/bakefiles/files.bkl b/build/bakefiles/files.bkl index 5dc4572ee7..863a733a94 100644 --- a/build/bakefiles/files.bkl +++ b/build/bakefiles/files.bkl @@ -242,11 +242,40 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! + + src/msw/ole/comimpl.cpp + src/msw/dialup.cpp + src/msw/dib.cpp + src/msw/joystick.cpp + src/msw/ole/oleutils.cpp + src/msw/ole/uuid.cpp + src/msw/ole/safearray.cpp + src/msw/sound.cpp + src/msw/ole/automtn.cpp + + + + wx/msw/dib.h + wx/msw/ole/automtn.h + wx/msw/joystick.h + wx/msw/sound.h + wx/msw/ole/safearray.h + wx/msw/ole/oleutils.h + wx/msw/ole/comimpl.h + wx/msw/ole/uuid.h + + + + $(QT_WIN32_SRC) + + + + $(QT_WIN32_HDR) + + wx/qt/accel.h wx/qt/app.h - wx/qt/apptbase.h - wx/qt/apptrait.h wx/qt/bitmap.h wx/qt/bmpbuttn.h wx/qt/brush.h @@ -262,7 +291,6 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! wx/qt/colour.h wx/qt/combobox.h wx/qt/control.h - wx/qt/converter.h wx/qt/ctrlsub.h wx/qt/cursor.h wx/qt/dataform.h @@ -313,17 +341,13 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! wx/qt/statusbar.h wx/qt/stattext.h wx/qt/textctrl.h - wx/qt/textdlg.h wx/qt/textentry.h wx/qt/tglbtn.h - wx/qt/timer.h wx/qt/toolbar.h wx/qt/tooltip.h wx/qt/toplevel.h - wx/qt/utils.h wx/qt/window.h - wx/qt/private/winevent.h wx/generic/fdrepdlg.h wx/generic/filepickerg.h wx/generic/clrpickerg.h @@ -336,6 +360,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! wx/generic/activityindicator.h wx/qt/dataview.h wx/qt/dvrenderers.h + $(QT_PLATFORM_HDR) @@ -433,6 +458,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! src/qt/uiaction.cpp src/qt/utils.cpp src/qt/window.cpp + $(QT_PLATFORM_SRC) @@ -1124,7 +1150,6 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! wx/dialup.h wx/dirctrl.h wx/display.h - wx/display_impl.h wx/dnd.h wx/docmdi.h wx/docview.h @@ -1286,7 +1311,6 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! src/generic/caret.cpp src/generic/imaglist.cpp src/unix/dialup.cpp - src/unix/displayx11.cpp src/unix/fontenum.cpp src/unix/fontutil.cpp src/unix/uiactionx11.cpp @@ -1604,6 +1628,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! src/gtk1/utilsgtk.cpp src/gtk1/win_gtk.c src/gtk1/window.cpp + src/unix/displayx11.cpp $(XWIN_LOWLEVEL_HDR) @@ -1749,6 +1774,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! src/x11/pen.cpp src/x11/region.cpp src/x11/utilsx.cpp + src/unix/displayx11.cpp $(XWIN_LOWLEVEL_HDR) @@ -1940,6 +1966,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! src/x11/utils.cpp src/x11/utilsx.cpp src/x11/window.cpp + src/unix/displayx11.cpp $(XWIN_LOWLEVEL_HDR) @@ -2046,8 +2073,8 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! src/msw/sound.cpp src/msw/ole/automtn.cpp src/msw/rt/notifmsgrt.cpp - src/generic/activityindicator.cpp src/msw/ole/uuid.cpp + src/msw/evtloop.cpp wx/msw/nonownedwnd.h @@ -2055,12 +2082,12 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! wx/msw/popupwin.h wx/msw/uxtheme.h wx/msw/htmlhelp.h - wx/generic/activityindicator.h wx/msw/helpwin.h wx/msw/taskbar.h wx/msw/helpchm.h wx/msw/sound.h wx/msw/joystick.h + wx/msw/evtloop.h @@ -2085,7 +2112,6 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! src/msw/dialog.cpp src/msw/dirdlg.cpp src/msw/dragimag.cpp - src/msw/evtloop.cpp src/msw/filedlg.cpp src/msw/frame.cpp src/msw/gauge.cpp @@ -2133,6 +2159,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! src/msw/datetimectrl.cpp src/msw/timectrl.cpp src/msw/datecontrols.cpp + src/generic/activityindicator.cpp wx/generic/clrpickerg.h @@ -2169,7 +2196,6 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! wx/msw/dirdlg.h wx/msw/dragimag.h wx/msw/enhmeta.h - wx/msw/evtloop.h wx/msw/filedlg.h wx/msw/font.h wx/msw/frame.h @@ -2240,6 +2266,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! wx/msw/timectrl.h wx/msw/datectrl.h wx/msw/calctrl.h + wx/generic/activityindicator.h @@ -2368,7 +2395,6 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! src/osx/brush.cpp src/osx/dialog_osx.cpp src/osx/fontutil.cpp - src/osx/imaglist.cpp src/osx/minifram.cpp src/osx/nonownedwnd_osx.cpp src/osx/palette.cpp @@ -2382,7 +2408,6 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! src/osx/core/bitmap.cpp src/osx/core/colour.cpp src/osx/core/dcmemory.cpp - src/osx/core/display.cpp src/osx/core/fontenum.cpp src/osx/core/hid.cpp src/osx/core/printmac.cpp @@ -2468,6 +2493,8 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! src/generic/statusbr.cpp src/generic/textmeasure.cpp src/generic/icon.cpp + src/osx/statbmp_osx.cpp + src/generic/imaglist.cpp @@ -2511,7 +2538,6 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! wx/osx/fontdlg.h wx/osx/frame.h wx/osx/gauge.h - wx/osx/imaglist.h wx/osx/listbox.h wx/osx/listctrl.h wx/osx/mdi.h @@ -2566,6 +2592,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! wx/generic/statusbr.h wx/osx/appprogress.h wx/generic/icon.h + wx/generic/imaglist.h @@ -2627,6 +2654,8 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! src/osx/timectrl_osx.cpp src/common/taskbarcmn.cpp src/osx/cocoa/activityindicator.mm + src/osx/cocoa/statbmp.mm + src/osx/core/display.cpp wx/osx/cocoa/chkconf.h @@ -2672,11 +2701,11 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! src/osx/iphone/toolbar.mm src/osx/iphone/utils.mm src/osx/iphone/window.mm - src/osx/cocoa/stdpaths.mm src/osx/iphone/settings.mm src/osx/sound_osx.cpp src/osx/core/sound.cpp src/generic/animateg.cpp + src/osx/iphone/statbmp.mm @@ -2701,9 +2730,6 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! - - src/msw/evtloop.cpp - + $([Microsoft.Build.Utilities.ToolLocationHelper]::GetLatestSDKTargetPlatformVersion('Windows', '10.0')) + $(LatestTargetPlatformVersion) + $(WindowsTargetPlatformVersion) + diff --git a/build/msw/wx_core.vcxproj b/build/msw/wx_core.vcxproj index 6c83436a0b..bf3ea86b5a 100644 --- a/build/msw/wx_core.vcxproj +++ b/build/msw/wx_core.vcxproj @@ -1280,7 +1280,6 @@ - diff --git a/build/msw/wx_core.vcxproj.filters b/build/msw/wx_core.vcxproj.filters index d83e645ce5..7e17bd7ad0 100644 --- a/build/msw/wx_core.vcxproj.filters +++ b/build/msw/wx_core.vcxproj.filters @@ -1267,9 +1267,6 @@ Common Headers - - Common Headers - Common Headers diff --git a/build/msw/wx_vc7_core.vcproj b/build/msw/wx_vc7_core.vcproj index 558ebba9fc..f64feb56e0 100644 --- a/build/msw/wx_vc7_core.vcproj +++ b/build/msw/wx_vc7_core.vcproj @@ -2270,9 +2270,6 @@ - - diff --git a/build/msw/wx_vc8_core.vcproj b/build/msw/wx_vc8_core.vcproj index 59890d3916..b734aa02bd 100644 --- a/build/msw/wx_vc8_core.vcproj +++ b/build/msw/wx_vc8_core.vcproj @@ -3528,10 +3528,6 @@ RelativePath="..\..\include\wx\display.h" > - - diff --git a/build/msw/wx_vc9_core.vcproj b/build/msw/wx_vc9_core.vcproj index 0443a4194b..0b33c64c19 100644 --- a/build/msw/wx_vc9_core.vcproj +++ b/build/msw/wx_vc9_core.vcproj @@ -3524,10 +3524,6 @@ RelativePath="..\..\include\wx\display.h" > - - diff --git a/build/osx/wxcocoa.xcodeproj/project.pbxproj b/build/osx/wxcocoa.xcodeproj/project.pbxproj index dc990c893a..b713560798 100644 --- a/build/osx/wxcocoa.xcodeproj/project.pbxproj +++ b/build/osx/wxcocoa.xcodeproj/project.pbxproj @@ -823,6 +823,12 @@ 4040AE89BF9F34668091064A /* dragimgg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2A67053D16D63C588E555C84 /* dragimgg.cpp */; }; 4040AE89BF9F34668091064B /* dragimgg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2A67053D16D63C588E555C84 /* dragimgg.cpp */; }; 4040AE89BF9F34668091064C /* dragimgg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2A67053D16D63C588E555C84 /* dragimgg.cpp */; }; + 750C716389AD3ADBABC9D689 /* statbmp_osx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F582C6B3A5AA3367BB4DBE97 /* statbmp_osx.cpp */; }; + 750C716389AD3ADBABC9D68A /* statbmp_osx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F582C6B3A5AA3367BB4DBE97 /* statbmp_osx.cpp */; }; + 750C716389AD3ADBABC9D68B /* statbmp_osx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F582C6B3A5AA3367BB4DBE97 /* statbmp_osx.cpp */; }; + 215958201947310B88BBEDB3 /* statbmp.mm in Sources */ = {isa = PBXBuildFile; fileRef = FD6B26B5A6A733A89EF5AB9C /* statbmp.mm */; }; + 215958201947310B88BBEDB4 /* statbmp.mm in Sources */ = {isa = PBXBuildFile; fileRef = FD6B26B5A6A733A89EF5AB9C /* statbmp.mm */; }; + 215958201947310B88BBEDB5 /* statbmp.mm in Sources */ = {isa = PBXBuildFile; fileRef = FD6B26B5A6A733A89EF5AB9C /* statbmp.mm */; }; 4156FDB73D0A397A870E4302 /* overlay.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FBD8031E28A3C9CB7C45784 /* overlay.mm */; }; 4156FDB73D0A397A870E4303 /* overlay.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FBD8031E28A3C9CB7C45784 /* overlay.mm */; }; 4156FDB73D0A397A870E4304 /* overlay.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FBD8031E28A3C9CB7C45784 /* overlay.mm */; }; @@ -4754,6 +4760,7 @@ F4B85051B7C835A8BF4E3EE1 /* xh_panel.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = xh_panel.cpp; path = ../../src/xrc/xh_panel.cpp; sourceTree = ""; }; F4C72C5C61A6335C8B418BA1 /* LexMetapost.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = LexMetapost.cxx; path = ../../src/stc/scintilla/lexers/LexMetapost.cxx; sourceTree = ""; }; F52DCBC0442233738B39138E /* CaseFolder.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = CaseFolder.cxx; path = ../../src/stc/scintilla/src/CaseFolder.cxx; sourceTree = ""; }; + F582C6B3A5AA3367BB4DBE97 /* statbmp_osx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = statbmp_osx.cpp; path = ../../src/osx/statbmp_osx.cpp; sourceTree = ""; }; F5DAF1F49F0F3F41A427A21D /* icon.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = icon.cpp; path = ../../src/generic/icon.cpp; sourceTree = ""; }; F6EA240B3DB93D398A990FAD /* tif_dirread.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = tif_dirread.c; path = ../../src/tiff/libtiff/tif_dirread.c; sourceTree = ""; }; F6F01A84F4DE3C9FB9849004 /* tif_jbig.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = tif_jbig.c; path = ../../src/tiff/libtiff/tif_jbig.c; sourceTree = ""; }; @@ -4779,6 +4786,7 @@ FD0C7FCA25A3312E8F2FCF3C /* LexTeX.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = LexTeX.cxx; path = ../../src/stc/scintilla/lexers/LexTeX.cxx; sourceTree = ""; }; FD55F391CD1032DFACA88CFD /* xh_srchctrl.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = xh_srchctrl.cpp; path = ../../src/xrc/xh_srchctrl.cpp; sourceTree = ""; }; FD5F11A3646F397BA62EB037 /* htmllbox.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = htmllbox.cpp; path = ../../src/generic/htmllbox.cpp; sourceTree = ""; }; + FD6B26B5A6A733A89EF5AB9C /* statbmp.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = statbmp.mm; path = ../../src/osx/cocoa/statbmp.mm; sourceTree = ""; }; FD6D2664C05131C3A06E98B4 /* ExternalLexer.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = ExternalLexer.cxx; path = ../../src/stc/scintilla/src/ExternalLexer.cxx; sourceTree = ""; }; FDAEFCE0ED9D30DA94340A3B /* xtistrm.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = xtistrm.cpp; path = ../../src/common/xtistrm.cpp; sourceTree = ""; }; FDB0E2D0966C3E408C4A2D3D /* infback.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = infback.c; path = ../../src/zlib/infback.c; sourceTree = ""; }; @@ -5301,6 +5309,8 @@ 2E7B4F88F81E37B4A9FF6C0F /* core */ = { isa = PBXGroup; children = ( + F582C6B3A5AA3367BB4DBE97 /* statbmp_osx.cpp */, + FD6B26B5A6A733A89EF5AB9C /* statbmp.mm */, B0665A40F3FC3F218074C63C /* artmac.cpp */, 302A13BC64C238A297F4399F /* brush.cpp */, BDE76674C0F5391BAD2AFA2F /* dialog_osx.cpp */, @@ -7537,6 +7547,7 @@ 0FFFFA2F762B3160955D1D8A /* gauge_osx.cpp in Sources */, E4B826CE70283D999CB591F5 /* listbox_osx.cpp in Sources */, B198DA8239E9358A9D56B98A /* menu_osx.cpp in Sources */, + 750C716389AD3ADBABC9D68B /* statbmp_osx.cpp in Sources */, 1DF3A4F85FCB3BA79A552F3F /* menuitem_osx.cpp in Sources */, A3321FE2A87D3BD69E0BB00B /* notebook_osx.cpp in Sources */, 0C9A379D97B133FA831175A9 /* printdlg_osx.cpp in Sources */, @@ -7554,6 +7565,7 @@ 664A54F914443110B7BB692A /* tglbtn_osx.cpp in Sources */, A569A33A2097316D8110C2C3 /* toolbar_osx.cpp in Sources */, 0AEBA7389E223781A7A257A3 /* webkit.mm in Sources */, + 215958201947310B88BBEDB5 /* statbmp.mm in Sources */, F5FF98C231B33E3EB7902C66 /* colordlgosx.mm in Sources */, 2386B575BC3931D2AF86CB35 /* fontdlgosx.mm in Sources */, 2EECB3C2F9523D0B95847A81 /* accel.cpp in Sources */, @@ -8119,6 +8131,7 @@ E882402BEE0330A080A65170 /* strconv.cpp in Sources */, 30493B486DFF35AF80D12C4A /* stream.cpp in Sources */, 795613831EC8332A83FF26E8 /* string.cpp in Sources */, + 750C716389AD3ADBABC9D68A /* statbmp_osx.cpp in Sources */, 55F0D287F60F3EDEA16CCB65 /* stringimpl.cpp in Sources */, 88E1AE56FD393C8BA5CF8546 /* stringops.cpp in Sources */, 056E30EA43753A7CB1AF8C9F /* strvararg.cpp in Sources */, @@ -8577,6 +8590,7 @@ 5F2C2A46781739D897CF293E /* xh_chckl.cpp in Sources */, CE17002B5B7E37558274763A /* xh_choic.cpp in Sources */, 26E4813A97DE323E88119164 /* xh_choicbk.cpp in Sources */, + 215958201947310B88BBEDB4 /* statbmp.mm in Sources */, E7AF3BF2B3473AD9BE66D1A2 /* xh_clrpicker.cpp in Sources */, 1AB50C98FF473B33A3CA4D3A /* xh_cmdlinkbn.cpp in Sources */, E7921B0472B63E4091F4F518 /* xh_collpane.cpp in Sources */, @@ -9342,6 +9356,7 @@ E882402BEE0330A080A6516F /* strconv.cpp in Sources */, 30493B486DFF35AF80D12C49 /* stream.cpp in Sources */, 795613831EC8332A83FF26E7 /* string.cpp in Sources */, + 750C716389AD3ADBABC9D689 /* statbmp_osx.cpp in Sources */, 55F0D287F60F3EDEA16CCB64 /* stringimpl.cpp in Sources */, 88E1AE56FD393C8BA5CF8545 /* stringops.cpp in Sources */, 056E30EA43753A7CB1AF8C9E /* strvararg.cpp in Sources */, @@ -9800,6 +9815,7 @@ 5F2C2A46781739D897CF293D /* xh_chckl.cpp in Sources */, CE17002B5B7E375582747639 /* xh_choic.cpp in Sources */, 26E4813A97DE323E88119163 /* xh_choicbk.cpp in Sources */, + 215958201947310B88BBEDB3 /* statbmp.mm in Sources */, E7AF3BF2B3473AD9BE66D1A1 /* xh_clrpicker.cpp in Sources */, 1AB50C98FF473B33A3CA4D39 /* xh_cmdlinkbn.cpp in Sources */, E7921B0472B63E4091F4F517 /* xh_collpane.cpp in Sources */, diff --git a/build/osx/wxiphone.xcodeproj/project.pbxproj b/build/osx/wxiphone.xcodeproj/project.pbxproj index 422f721df1..0b90d8c331 100644 --- a/build/osx/wxiphone.xcodeproj/project.pbxproj +++ b/build/osx/wxiphone.xcodeproj/project.pbxproj @@ -803,7 +803,6 @@ F0B3F484C38C3BA0B9927CD9 /* docmdi.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ECC9F5C21ACB31A0B24AEE35 /* docmdi.cpp */; }; F0D892C2618130FEAD46BB86 /* panel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 00969CBE3B8F32C78C195619 /* panel.cpp */; }; F1E4D7CA634E33808AE3B522 /* fontenumcmn.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 373242CD08F330208A7CF438 /* fontenumcmn.cpp */; }; - F1F484DD591337399FCD0463 /* display.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5617D10CB7136EC9A4194EF /* display.cpp */; }; F22C401903993639AE05A295 /* xh_stbox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 147800BBCB80346798B35D75 /* xh_stbox.cpp */; }; F24F637D59F637CA9A7E23C9 /* xh_filectrl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 60EE4448A28D38F5ADE17B5A /* xh_filectrl.cpp */; }; F2813BF297C73A3ABD02EC98 /* glcanvas_osx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA59091E3ED83FB781FB9659 /* glcanvas_osx.cpp */; }; @@ -1402,7 +1401,6 @@ A46D50BEBF523B3F88831086 /* LexAsn1.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = LexAsn1.cxx; path = ../../src/stc/scintilla/lexers/LexAsn1.cxx; sourceTree = ""; }; A4A745D1821A32D591D76650 /* imagiff.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = imagiff.cpp; path = ../../src/common/imagiff.cpp; sourceTree = ""; }; A54B80C17F823CB5900AD2E8 /* framecmn.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = framecmn.cpp; path = ../../src/common/framecmn.cpp; sourceTree = ""; }; - A5617D10CB7136EC9A4194EF /* display.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = display.cpp; path = ../../src/osx/core/display.cpp; sourceTree = ""; }; A5794CD687013AF8A20A691A /* headerctrlcmn.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = headerctrlcmn.cpp; path = ../../src/common/headerctrlcmn.cpp; sourceTree = ""; }; A57CF60203F53459A03951A9 /* arrstr.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = arrstr.cpp; path = ../../src/common/arrstr.cpp; sourceTree = ""; }; A5BBC1E494D33D028CA547FF /* jddctmgr.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = jddctmgr.c; path = ../../src/jpeg/jddctmgr.c; sourceTree = ""; }; @@ -1953,7 +1951,6 @@ A1A53EC3A3463EFDB7614E93 /* bitmap.cpp */, 9D1F14339D1C331087650931 /* colour.cpp */, 343D4FDD5CC030618EF24729 /* dcmemory.cpp */, - A5617D10CB7136EC9A4194EF /* display.cpp */, 36E1DBA275AD325DB759C180 /* fontenum.cpp */, 160EB9744CB63A0B81DC651F /* hid.cpp */, 5CC5C13F8AA1387BADB7E60C /* printmac.cpp */, @@ -3008,7 +3005,6 @@ 03BF1610E2FC3BD5ACB754F0 /* bitmap.cpp in Sources */, FF50EC0EC5F23DF890C6E95F /* colour.cpp in Sources */, BD2B17EB72E73A6EB6E0B26F /* dcmemory.cpp in Sources */, - F1F484DD591337399FCD0463 /* display.cpp in Sources */, 371809DA4AD1382F8B532878 /* fontenum.cpp in Sources */, 86BE5213D3F131D8A6862679 /* hid.cpp in Sources */, AB58406CEBA13BC4A2A83B66 /* printmac.cpp in Sources */, diff --git a/build/tools/appveyor-test.bat b/build/tools/appveyor-test.bat index 3149c807eb..d9eb84dad4 100755 --- a/build/tools/appveyor-test.bat +++ b/build/tools/appveyor-test.bat @@ -42,10 +42,15 @@ echo --- Note: ignoring possible test failures under Cygwin echo. exit /b 0 +:cmake_qt +set CMAKE_TEST_REGEX="test_base" +goto :cmake + :cmake if "%CONFIGURATION%"=="" set CONFIGURATION=Release +if "%CMAKE_TEST_REGEX%"=="" set CMAKE_TEST_REGEX="test_[base|gui]" cd ..\build_cmake -ctest -V -C %CONFIGURATION% -R "test_[base|gui]" --output-on-failure --interactive-debug-mode 0 . +ctest -V -C %CONFIGURATION% -R %CMAKE_TEST_REGEX% --output-on-failure --interactive-debug-mode 0 . if %errorlevel% NEQ 0 goto :error goto :eof diff --git a/build/tools/appveyor.bat b/build/tools/appveyor.bat index c2bc21f345..17a14d0369 100644 --- a/build/tools/appveyor.bat +++ b/build/tools/appveyor.bat @@ -78,6 +78,12 @@ set SKIPTESTS=1 set CMAKE_NATIVE_FLAGS=-j3 goto cmake +:cmake_qt +set SKIPINSTALL=1 +set QT5DIR="C:\Qt\5.11\msvc2015_64" +set CMAKE_CONFIGURE_FLAGS=-DCMAKE_PREFIX_PATH=%QT5DIR% -DwxBUILD_TOOLKIT="qt" -DCMAKE_CXX_STANDARD=11 +goto cmake + :cmake echo --- Tools versions: cmake --version diff --git a/build/tools/before_install.sh b/build/tools/before_install.sh index acd36027dc..40b72ee7d7 100755 --- a/build/tools/before_install.sh +++ b/build/tools/before_install.sh @@ -21,7 +21,18 @@ case $(uname -s) in *--with-qt*) libtoolkit_dev='qtdeclarative5-dev' ;; esac - $SUDO apt-get install -y $libgtk_dev $libtoolkit_dev libnotify-dev + pgk_check="libgstreamermm-1.0-dev libgstreamermm-0.10-dev \ + libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \ + libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev \ + libwebkitgtk-dev libglu1-mesa-dev libsecret-1-dev libnotify-dev" + + for pkg in $pgk_check; do + if $(apt-cache pkgnames | grep -q $pkg) ; then + pkg_install="$pkg_install $pkg" + fi + done + + $SUDO apt-get install -y $libgtk_dev $libtoolkit_dev $pkg_install fi ;; diff --git a/build/update-setup-h b/build/update-setup-h index 5f8b05c3dd..924cde642c 100755 --- a/build/update-setup-h +++ b/build/update-setup-h @@ -116,7 +116,6 @@ update_msw_setup_h setup.h.in update_msw_setup_h build/cmake/setup.h.in update_osx_setup_h include/wx/osx/setup0.h -update_msw_setup_h setup.h.in update_single_setup_h wxUniv include/wx/univ/setup_inc.h include/wx/univ/setup0.h diff --git a/configure b/configure index 47205af945..2378cc74fd 100755 --- a/configure +++ b/configure @@ -745,10 +745,10 @@ COND_SHARED_0_USE_GUI_1_wxUSE_LIBTIFF_builtin COND_SHARED_0_USE_GUI_1_wxUSE_LIBPNG_builtin COND_SHARED_0_USE_GUI_1_wxUSE_LIBJPEG_builtin COND_SHARED_0_USE_GUI_1_USE_OPENGL_1 -COND_SHARED_0_TOOLKIT_PM_WXUNIV_0 COND_SHARED_0_TOOLKIT_MSW_WXUNIV_0 COND_SHARED_0_TOOLKIT_MAC_WXUNIV_0 COND_SHARED_0 +COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0 COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1 COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_3_USE_GUI_1 COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1 @@ -1285,6 +1285,7 @@ enable_statusbar enable_taskbaricon enable_tbarnative enable_textctrl +enable_timepick enable_tipwindow enable_togglebtn enable_toolbar @@ -10905,23 +10906,23 @@ fi fi fi - # Check whether --enable-datepick was given. -if test "${enable_datepick+set}" = set; then : - enableval=$enable_datepick; + # Check whether --enable-timepick was given. +if test "${enable_timepick+set}" = set; then : + enableval=$enable_timepick; if test "$enableval" = yes; then - wx_cv_use_datepick='wxUSE_TIMEPICKCTRL=yes' + wx_cv_use_timepick='wxUSE_TIMEPICKCTRL=yes' else - wx_cv_use_datepick='wxUSE_TIMEPICKCTRL=no' + wx_cv_use_timepick='wxUSE_TIMEPICKCTRL=no' fi else - wx_cv_use_datepick='wxUSE_TIMEPICKCTRL=${'DEFAULT_wxUSE_TIMEPICKCTRL":-$defaultval}" + wx_cv_use_timepick='wxUSE_TIMEPICKCTRL=${'DEFAULT_wxUSE_TIMEPICKCTRL":-$defaultval}" fi - eval "$wx_cv_use_datepick" + eval "$wx_cv_use_timepick" enablestring= @@ -20193,6 +20194,7 @@ elif test "x$wxUSE_MACOSX_VERSION_MIN" = "x"; then fi if test "x$MACOSX_SDK_OPTS" != "x"; then + eval "CPP=\"$CPP $MACOSX_SDK_OPTS\"" eval "CC=\"$CC $MACOSX_SDK_OPTS\"" eval "CXX=\"$CXX $MACOSX_SDK_OPTS\"" eval "LD=\"$LD $MACOSX_SDK_OPTS\"" @@ -20205,6 +20207,7 @@ if test "x$wxUSE_MACOSX_VERSION_MIN" != "x"; then else MACOSX_VERSION_MIN_OPTS="-mmacosx-version-min=$wxUSE_MACOSX_VERSION_MIN" fi + eval "CPP=\"$CPP $MACOSX_VERSION_MIN_OPTS\"" eval "CC=\"$CC $MACOSX_VERSION_MIN_OPTS\"" eval "CXX=\"$CXX $MACOSX_VERSION_MIN_OPTS\"" eval "LD=\"$LD $MACOSX_VERSION_MIN_OPTS\"" @@ -20491,6 +20494,8 @@ if test "$USE_UNIX" = 1 ; then fi +export CC CFLAGS CPP CPPFLAGS CXX CXXFLAGS LDD LDFLAGS OBJCFLAGS OBJCXXFLAGS + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } @@ -23368,7 +23373,7 @@ fi fi fi -if test "$HAVE_LZMA" = "no" -o "$wxUSE_LIBTIFF" = "builtin"; then +if test "$wxUSE_LIBLZMA" = "no" -a "$wxUSE_LIBTIFF" = "builtin"; then ac_configure_args="$ac_configure_args --disable-lzma" fi @@ -27521,14 +27526,6 @@ fi $as_echo "$as_me: WARNING: Xinerama not found; disabling wxDisplay" >&2;} wxUSE_DISPLAY="no" fi - elif test "$wxUSE_MSW" = 1; then - ac_fn_c_check_header_compile "$LINENO" "ddraw.h" "ac_cv_header_ddraw_h" "#include -" -if test "x$ac_cv_header_ddraw_h" = xyes; then : - -fi - - fi fi @@ -38991,7 +38988,7 @@ EXTRALIBS_HTML="$MSPACK_LINK" EXTRALIBS_MEDIA="$GST_LIBS" EXTRALIBS_STC="-lwxscintilla${WX_LIB_FLAVOUR}-${WX_RELEASE}${HOST_SUFFIX}" if test "$wxUSE_GUI" = "yes"; then - EXTRALIBS_GUI=`echo $GUI_TK_LIBRARY $PNG_LINK $JPEG_LINK $TIFF_LINK $LZMA_LINK $JBIG_LINK $WEBKIT_LINK` + EXTRALIBS_GUI=`echo $GUI_TK_LIBRARY $SDL_LIBS $PNG_LINK $JPEG_LINK $TIFF_LINK $LZMA_LINK $JBIG_LINK $WEBKIT_LINK` fi if test "$wxUSE_OPENGL" = "yes"; then EXTRALIBS_OPENGL="$LDFLAGS_GL $OPENGL_LIBS" @@ -41092,6 +41089,11 @@ EOF COND_PLATFORM_WIN32_1_TOOLKIT_GTK_TOOLKIT_VERSION_4_USE_GUI_1="" fi + COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0="#" + if test "x$PLATFORM_WIN32" = "x1" -a "x$TOOLKIT" = "xQT" -a "x$USE_GUI" = "x1" -a "x$WXUNIV" = "x0" ; then + COND_PLATFORM_WIN32_1_TOOLKIT_QT_USE_GUI_1_WXUNIV_0="" + fi + COND_SHARED_0="#" if test "x$SHARED" = "x0" ; then COND_SHARED_0="" @@ -41107,11 +41109,6 @@ EOF COND_SHARED_0_TOOLKIT_MSW_WXUNIV_0="" fi - COND_SHARED_0_TOOLKIT_PM_WXUNIV_0="#" - if test "x$SHARED" = "x0" -a "x$TOOLKIT" = "xPM" -a "x$WXUNIV" = "x0" ; then - COND_SHARED_0_TOOLKIT_PM_WXUNIV_0="" - fi - COND_SHARED_0_USE_GUI_1_USE_OPENGL_1="#" if test "x$SHARED" = "x0" -a "x$USE_GUI" = "x1" -a "x$USE_OPENGL" = "x1" ; then COND_SHARED_0_USE_GUI_1_USE_OPENGL_1="" diff --git a/configure.in b/configure.in index 4ffb373d47..1159b013c6 100644 --- a/configure.in +++ b/configure.in @@ -952,7 +952,7 @@ WX_ARG_FEATURE(statusbar, [ --enable-statusbar use wxStatusBar class], w WX_ARG_FEATURE(taskbaricon, [ --enable-taskbaricon use wxTaskBarIcon class], wxUSE_TASKBARICON) WX_ARG_FEATURE(tbarnative, [ --enable-tbarnative use native wxToolBar class], wxUSE_TOOLBAR_NATIVE) WX_ARG_FEATURE(textctrl, [ --enable-textctrl use wxTextCtrl class], wxUSE_TEXTCTRL) -WX_ARG_FEATURE(datepick, [ --enable-timepick use wxTimePickerCtrl class], wxUSE_TIMEPICKCTRL) +WX_ARG_FEATURE(timepick, [ --enable-timepick use wxTimePickerCtrl class], wxUSE_TIMEPICKCTRL) WX_ARG_FEATURE(tipwindow, [ --enable-tipwindow use wxTipWindow class], wxUSE_TIPWINDOW) WX_ARG_FEATURE(togglebtn, [ --enable-togglebtn use wxToggleButton class], wxUSE_TOGGLEBTN) WX_ARG_FEATURE(toolbar, [ --enable-toolbar use wxToolBar class], wxUSE_TOOLBAR) @@ -1279,6 +1279,7 @@ elif test "x$wxUSE_MACOSX_VERSION_MIN" = "x"; then fi if test "x$MACOSX_SDK_OPTS" != "x"; then + eval "CPP=\"$CPP $MACOSX_SDK_OPTS\"" eval "CC=\"$CC $MACOSX_SDK_OPTS\"" eval "CXX=\"$CXX $MACOSX_SDK_OPTS\"" eval "LD=\"$LD $MACOSX_SDK_OPTS\"" @@ -1291,6 +1292,7 @@ if test "x$wxUSE_MACOSX_VERSION_MIN" != "x"; then else MACOSX_VERSION_MIN_OPTS="-mmacosx-version-min=$wxUSE_MACOSX_VERSION_MIN" fi + eval "CPP=\"$CPP $MACOSX_VERSION_MIN_OPTS\"" eval "CC=\"$CC $MACOSX_VERSION_MIN_OPTS\"" eval "CXX=\"$CXX $MACOSX_VERSION_MIN_OPTS\"" eval "LD=\"$LD $MACOSX_VERSION_MIN_OPTS\"" @@ -1475,6 +1477,10 @@ if test "$USE_UNIX" = 1 ; then AC_DEFINE(__UNIX__) fi +dnl Values of these variables shouldn't change any longer from now on, we +dnl export them to ensure they're picked up by sub-configure scripts. +export CC CFLAGS CPP CPPFLAGS CXX CXXFLAGS LDD LDFLAGS OBJCFLAGS OBJCXXFLAGS + dnl ------------------------------------------------------------------------ dnl Check for headers dnl ------------------------------------------------------------------------ @@ -2583,7 +2589,7 @@ dnl We need to disable the use of lzma in built-in libtiff explicitly, as dnl otherwise we'd depend on the system lzma library, which is typically dnl undesirable when using builtin libraries. We also disable the use of lzma dnl if it's not available anyhow, just to speed up libtiff configure a little. -if test "$HAVE_LZMA" = "no" -o "$wxUSE_LIBTIFF" = "builtin"; then +if test "$wxUSE_LIBLZMA" = "no" -a "$wxUSE_LIBTIFF" = "builtin"; then ac_configure_args="$ac_configure_args --disable-lzma" fi @@ -3472,9 +3478,6 @@ if test "$wxUSE_DISPLAY" = "yes"; then AC_MSG_WARN([Xinerama not found; disabling wxDisplay]) wxUSE_DISPLAY="no" fi - elif test "$wxUSE_MSW" = 1; then - dnl DirectDraw for MSW - optionally used by WxDisplay. - AC_CHECK_HEADER([ddraw.h], [], [], [#include ]) fi fi @@ -7935,7 +7938,7 @@ EXTRALIBS_HTML="$MSPACK_LINK" EXTRALIBS_MEDIA="$GST_LIBS" EXTRALIBS_STC="-lwxscintilla${WX_LIB_FLAVOUR}-${WX_RELEASE}${HOST_SUFFIX}" if test "$wxUSE_GUI" = "yes"; then - EXTRALIBS_GUI=`echo $GUI_TK_LIBRARY $PNG_LINK $JPEG_LINK $TIFF_LINK $LZMA_LINK $JBIG_LINK $WEBKIT_LINK` + EXTRALIBS_GUI=`echo $GUI_TK_LIBRARY $SDL_LIBS $PNG_LINK $JPEG_LINK $TIFF_LINK $LZMA_LINK $JBIG_LINK $WEBKIT_LINK` fi if test "$wxUSE_OPENGL" = "yes"; then EXTRALIBS_OPENGL="$LDFLAGS_GL $OPENGL_LIBS" diff --git a/demos/poem/wxpoem.cpp b/demos/poem/wxpoem.cpp index cfca656f6e..36206c8753 100644 --- a/demos/poem/wxpoem.cpp +++ b/demos/poem/wxpoem.cpp @@ -163,7 +163,7 @@ void MainWindow::ScanBuffer(wxDC *dc, bool DrawIt, int *max_x, int *max_y) height = *max_y; } - if (DrawIt && wxColourDisplay()) + if (DrawIt) { dc->SetBrush(*wxLIGHT_GREY_BRUSH); dc->SetPen(*wxGREY_PEN); @@ -347,20 +347,18 @@ void MainWindow::ScanBuffer(wxDC *dc, bool DrawIt, int *max_x, int *max_y) if (DrawIt) { // Draw dark grey thick border - if (wxColourDisplay()) - { - dc->SetBrush(*wxGREY_BRUSH); - dc->SetPen(*wxGREY_PEN); + dc->SetBrush(*wxGREY_BRUSH); + dc->SetPen(*wxGREY_PEN); + + // Left side + dc->DrawRectangle(0, 0, THIN_LINE_BORDER, height); + // Top side + dc->DrawRectangle(THIN_LINE_BORDER, 0, width-THIN_LINE_BORDER, THIN_LINE_BORDER); + // Right side + dc->DrawRectangle(width-THIN_LINE_BORDER, THIN_LINE_BORDER, width, height-THIN_LINE_BORDER); + // Bottom side + dc->DrawRectangle(THIN_LINE_BORDER, height-THIN_LINE_BORDER, width-THIN_LINE_BORDER, height); - // Left side - dc->DrawRectangle(0, 0, THIN_LINE_BORDER, height); - // Top side - dc->DrawRectangle(THIN_LINE_BORDER, 0, width-THIN_LINE_BORDER, THIN_LINE_BORDER); - // Right side - dc->DrawRectangle(width-THIN_LINE_BORDER, THIN_LINE_BORDER, width, height-THIN_LINE_BORDER); - // Bottom side - dc->DrawRectangle(THIN_LINE_BORDER, height-THIN_LINE_BORDER, width-THIN_LINE_BORDER, height); - } // Draw border // Have grey background, plus 3-d border - // One black rectangle. @@ -376,10 +374,7 @@ void MainWindow::ScanBuffer(wxDC *dc, bool DrawIt, int *max_x, int *max_y) // Right and bottom white lines - 'grey' (black!) if // we're running on a mono display. - if (wxColourDisplay()) - dc->SetPen(*wxWHITE_PEN); - else - dc->SetPen(*wxBLACK_PEN); + dc->SetPen(*wxWHITE_PEN); dc->DrawLine(width-THICK_LINE_BORDER, THICK_LINE_BORDER, width-THICK_LINE_BORDER, height-THICK_LINE_BORDER); diff --git a/docs/changes.txt b/docs/changes.txt index 3d97b8f6db..25d36877e0 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -51,6 +51,8 @@ Changes in behaviour not resulting in compilation errors consistency with the other ports. You now need to call SetMargins(0, 0) explicitly if you really don't want to have any margins in your buttons. +- wxEVT_AUINOTEBOOK_PAGE_CHANGED event is now sent after changing the page, + as expected, and not before doing it. Changes in behaviour which may result in build errors ----------------------------------------------------- @@ -106,6 +108,7 @@ All: - Fix problem with wx-config installation and use under NetBSD (wiz). - Avoid spurious errors on thread creation under NetBSD. - Improve high DPI support in wxAui (Simon Rozman). +- Fix a bug with parsing time zones in wxDateTime::ParseFormat() (evileye). All (GUI): @@ -127,14 +130,17 @@ All (GUI): - Allow binding to events generated by their items in submenus too. - Add wxGrid::SetCornerLabelValue() (Pavel Kalugin). - Add strikethrough support for fonts defined in XRC. +- Add wxDisplay::GetPPI(). wxGTK: - Implement wxTextCtrl::HitTest() for single line controls. +- Fix bug with wxTextCtrl::ChangeValue("") sending an unwanted event. - Implement wxDataViewColumn::UnsetAsSortKey(). - Fix not showing wxInfoBar with GTK+ 3 < 3.22.29. - Fix the build with glib < 2.32 (e.g. CentOS 6). - Fix field widths in wxStatusBar showing a size grip. +- Fill column value in wxEVT_DATAVIEW_ITEM_ACTIVATED events. wxMSW: @@ -157,10 +163,14 @@ wxOSX: - Fix dispatching pending events (and CallAfter()) in console applications. - Implement wxDataViewColumn::UnsetAsSortKey() (Daniel Kulp). +- supporting native image formst like NSImage and UIImage in wxBitmap +- native implementation for wxStaticBitmap for correct rendering of template images +- Fill column value in wxEVT_DATAVIEW_ITEM_ACTIVATED events (Igor Korot). wxQt: - Fix menu bar background colour (Naser Buhamad). +- Add support for bitmaps in menu items (Igor Korot). 3.1.1: (released 2018-02-19) diff --git a/docs/contributing/how-to-add-new-sample.md b/docs/contributing/how-to-add-new-sample.md index aeaafe5705..ae1c933c73 100644 --- a/docs/contributing/how-to-add-new-sample.md +++ b/docs/contributing/how-to-add-new-sample.md @@ -43,12 +43,20 @@ samples/ with demos/ where needed). After this, regenerate configure from configure.in by running "autoconf" on a Unix system in the corresponding directory. -5. Add a short description of what the sample does and how does it work +5. Modify `build/cmake/samples/CMakeLists.txt` to include the sample in + CMake. Add a new line like this: + + wx_add_sample(foo DEPENDS wxUSE_FOO) + + For a complete list of parameters to the `wx_add_sample()` function see + the description in `build/cmake/functions.cmake`. + +6. Add a short description of what the sample does and how does it work to the "samples overview" section in the wxWidgets manual. That section lives in docs/doxygen/mainpages/samples.h; look at the descriptions for other samples, if you are not familiar with Doxygen. -6. Add any non-standard sample's files to build/bakefiles/make_dist.mk (the +7. Add any non-standard sample's files to build/bakefiles/make_dist.mk (the makefiles copies all bmp, cpp, h, ico, png, rc, xpm and makefiles by default, you only need to update it if the sample uses some other files) and run the ./update-manifests.sh script in distrib/scripts (don't forget diff --git a/docs/contributing/how-to-add-new-wxUSE_XXX.md b/docs/contributing/how-to-add-new-wxUSE_XXX.md index 8d99eb1536..19807eafd4 100644 --- a/docs/contributing/how-to-add-new-wxUSE_XXX.md +++ b/docs/contributing/how-to-add-new-wxUSE_XXX.md @@ -72,6 +72,16 @@ c) configure.in If you have a sample/foo which should be only built when `wxUSE_FOO==1`, then only add it to the SAMPLES_SUBDIRS if `wxUSE_FOO=yes` in configure. -d) docs/doxygen/mainpages/const_wxusedef.h +d) build/cmake/options.cmake + + To include the option in CMake, add a new line in the appropriate + section of options.cmake. + + wx_option(wxUSE_FOO "enable FOO") + + As an optional third parameter you may specify `OFF` when the option + should be disabled by default. + +e) docs/doxygen/mainpages/const_wxusedef.h Add a brief description of the new constant. diff --git a/docs/contributing/how-to-release.md b/docs/contributing/how-to-release.md index 1e7b1a74f2..18d59664f8 100644 --- a/docs/contributing/how-to-release.md +++ b/docs/contributing/how-to-release.md @@ -117,11 +117,15 @@ Create https://docs.wxwidgets.org/x.y.z/ (ask Bryan to do it if not done yet). ## Announcement -Update https://www.wxwidgets.org, usually a news item is enough but something -more can be called for for major releases. +Update https://www.wxwidgets.org: +* Update release information (at least `version` and `released`) in `_data/relases.yml`. +* Download information can then be updated by running `update_release_info.rb`. + This will update the asset information from GitHub. +* Add a news item. Usually a news item is enough but something + more can be called for for major releases Post `docs/publicity/announce.txt` at least to wx-announce@googlegroups.com and -to wx-users for the important releases. +to wx-users. Submit a link to https://www.reddit.com/r/programming diff --git a/docs/doxygen/Doxyfile b/docs/doxygen/Doxyfile index bef0fc9a9d..e6e63965c5 100644 --- a/docs/doxygen/Doxyfile +++ b/docs/doxygen/Doxyfile @@ -100,7 +100,7 @@ ALIASES += appearance_brief{2}="\htmlonly
\endhtmlonly\n\1\htmlonly\endhtmlonly\n\image html generic/\2.png\n\htmlonly
\endhtmlonly" # aliases for the creation of "named member groups" -# USAGE: the first argument must not contain spaces and be a unique identifier +# USAGE: the first argument must not contain spaces and be a unique identifier # of the member group for the class being documented; # the second argument is the member group name and can contain spaces # See wxString as an usage example. @@ -292,6 +292,13 @@ WARN_LOGFILE = doxygen.log INPUT = mainpages \ groups \ overviews \ + ../gtk \ + ../ios \ + ../motif \ + ../msw \ + ../osx \ + ../qt \ + ../x11 \ ../../interface INPUT_ENCODING = UTF-8 FILE_PATTERNS = *.h *.md diff --git a/docs/doxygen/mainpages/platdetails.h b/docs/doxygen/mainpages/platdetails.h index f4beee8625..4330322178 100644 --- a/docs/doxygen/mainpages/platdetails.h +++ b/docs/doxygen/mainpages/platdetails.h @@ -52,8 +52,9 @@ GTK+ 1.2 can still be used, albeit discouraged. For that you can pass Support for GTK+ 3 is available starting with wxWidgets 2.9.4, use @c configure option @c \--with-gtk=3 to enable it. -For further information, please see the files in @c docs/gtk in the -distribution. +@subpage plat_gtk_install "Build and Install Instructions" + +@subpage plat_gtk_overview "wxWidgets on the GNOME Desktop" @@ -62,8 +63,7 @@ distribution. wxOSX/Cocoa is the port of wxWidgets for the OS X platform. It requires OS X 10.7 or later and fully supports 64 bit builds. -For further information, please see the files in @c docs/osx in the -distribution. +@subpage plat_osx_install "Build and Install Instructions" @@ -80,8 +80,9 @@ In order to configure wxWidgets to compile wxX11 you will need to type: @verbatim configure --with-x11 --with-universal @endverbatim -For further information, please see the files in @c docs/x11 in the -distribution. There is also a page on the use of wxWidgets for embedded +@subpage plat_x11_install "Build Instructions" + +There is also a page on the use of wxWidgets for embedded applications on the wxWidgets web site. @@ -92,8 +93,8 @@ wxMotif is a port of wxWidgets for X11 systems using Motif libraries. Motif libraries provide a clean and fast user interface at the expense of the beauty and candy of newer interfaces like GTK. -For further information, please see the files in @c docs/motif in the -distribution. +@subpage plat_motif_install "Build Instructions" + @@ -105,7 +106,9 @@ This port can be compiled with several compilers including Microsoft Studio VC++ 2003 or later, Borland 5.5, MinGW32, Cygwin as well as cross-compilation with a Linux-hosted MinGW32 tool chain. -For further information, please see the files in docs/msw in the distribution. +@subpage plat_msw_install "Build and Install Instructions" + +@subpage plat_msw_binaries "Using pre-built binaries" @subsection page_port_wxmsw_resources Resources and Application Icon @@ -167,7 +170,9 @@ wxWindowBase::GetDefaultBorder(), returning wxBORDER_NONE. wxQt is a port of wxWidgets using Qt libraries. It requires Qt 5 or later. -For further information, please see the files in docs/qt in the distribution. +@subpage plat_qt_install "Build Instructions" + +@subpage plat_qt_architecture "Architecture Overview" @section page_port_wxiOS wxiOS @@ -175,7 +180,7 @@ wxiOS is a port of wxWidgets using Cocoa touch libraries for iOS. It is very basic in it current form, but is included for further improvements and very simple applications. It requires iOS 9 or later and fully supports 64 bit builds. -For further information, please see the files in docs/ios in the distribution. +@subpage plat_ios_install "Build Instructions" @section page_port_nativedocs Native Toolkit Documentation diff --git a/docs/doxygen/overviews/html.h b/docs/doxygen/overviews/html.h index 623f98064f..6f12e32c35 100644 --- a/docs/doxygen/overviews/html.h +++ b/docs/doxygen/overviews/html.h @@ -505,6 +505,7 @@ DL DT EM FONT COLOR=[color] + BGCOLOR=[color] SIZE=[fontsize] FACE=[comma-separated list of facenames] HR ALIGN=[alignment] diff --git a/docs/gtk/install.txt b/docs/gtk/install.md similarity index 83% rename from docs/gtk/install.txt rename to docs/gtk/install.md index 965822c89a..11e37bc11a 100644 --- a/docs/gtk/install.txt +++ b/docs/gtk/install.md @@ -1,6 +1,8 @@ -wxWidgets for GTK+ installation +wxWidgets for GTK+ installation {#plat_gtk_install} ------------------------------- +[TOC] + IMPORTANT NOTE: If you experience problems installing, please re-read these @@ -13,19 +15,24 @@ IMPORTANT NOTE: using (including the beta) and what compiler on what system. One example: wxGTK 3.0.0, GCC 4.8.1, Fedora 19 -* The simplest case +Installation {#gtk_install} +============ + + +The simplest case {#gtk_simple} ------------------- If you compile wxWidgets on Linux for the first time and don't like to read install instructions just do (in the base dir): -> mkdir buildgtk -> cd buildgtk -> ../configure --with-gtk -> make -> su -> make install -> ldconfig + > mkdir buildgtk + > cd buildgtk + > ../configure --with-gtk + > make + > su + > make install + > ldconfig + [if you get "ldconfig: command not found", try using "/sbin/ldconfig"] If you don't do the 'make install' part, you can still use the libraries from @@ -33,14 +40,14 @@ the buildgtk directory, but they may not be available to other users. If you want to remove wxWidgets on Unix you can do this: -> su -> make uninstall -> ldconfig + > su + > make uninstall + > ldconfig Note that by default, GTK+ 2.x is used. GTK+ 3 can be specified with --with-gtk=3. -* The expert case +The expert case {#gtk_expert} ----------------- If you want to do some more serious cross-platform programming with wxWidgets, @@ -53,28 +60,28 @@ with --enable-debug and one without. For building three versions (one GTK+, one Motif and a debug version of the GTK source) you'd do this: -mkdir buildmotif -cd buildmotif -../configure --with-motif -make -cd .. + mkdir buildmotif + cd buildmotif + ../configure --with-motif + make + cd .. -mkdir buildgtk -cd buildgtk -../configure --with-gtk -make -cd .. + mkdir buildgtk + cd buildgtk + ../configure --with-gtk + make + cd .. -mkdir buildgtkd -cd buildgtkd -../configure --with-gtk --enable-debug -make -cd .. + mkdir buildgtkd + cd buildgtkd + ../configure --with-gtk --enable-debug + make + cd .. Note that you can install all those libraries concurrently, you just need to pass the appropriate flags when using them. -* The simplest errors +The simplest errors {#gtk_errors_simple} --------------------- For any configure errors: please look at config.log file which was generated @@ -101,18 +108,18 @@ GCC 2.95 or later. You get immediate segfault when starting any sample or application: This is either due to having compiled the library with different flags or options than -your program - typically you might have the __WXDEBUG__ option set for the +your program - typically you might have the `__WXDEBUG__` option set for the library but not for your program - or due to using a compiler with optimisation bugs. -* The simplest program +The simplest program {#gtk_simple_app} ---------------------- Now create your super-application myfoo.cpp and compile anywhere with -g++ myfoo.cpp `wx-config --libs --cxxflags` -o myfoo + g++ myfoo.cpp `wx-config --libs --cxxflags` -o myfoo -* GUI libraries +GUI libraries {#gtk_libs_gui} --------------- wxWidgets/GTK+ requires the GTK+ library to be installed on your system. It has @@ -127,7 +134,7 @@ You can get the newest version of the GTK+ from the GTK+ homepage at: We also mirror GTK+ at my ftp site. You'll find information about downloading at my homepage. -* Additional libraries +Additional libraries {#gtk_libs_misc} ---------------------- wxWidgets/Gtk requires a thread library and X libraries known to work with @@ -138,14 +145,14 @@ correct glibc 2 support. You can disable thread support by running -./configure --disable-threads -make -su -make install -ldconfig -exit + ./configure --disable-threads + make + su + make install + ldconfig + exit -* Building wxGTK on Cygwin +Building wxGTK on Cygwin {#gtk_cygwin} -------------------------- The normal build instructions should work fine on Cygwin. The one difference @@ -159,10 +166,11 @@ will see linking errors. If this happens then you can work around the problem by setting LDFLAGS=-Wl,--export-all-symbols. Please also let us know about it on the wx-dev mailing list. -* Create your configuration +Create your configuration {#gtk_config} --------------------------- Usage: + ./configure options If you want to use system's C and C++ compiler, @@ -182,7 +190,7 @@ have multiple configurations (for example, debug and release or GTK and Motif) simultaneously. -* General options +General options {#gtk_options} ----------------- Given below are the commands to change the default behaviour, @@ -259,7 +267,7 @@ The following options handle the kind of library you want to build. option instead of --enable-debug_info/flag ones separately. -* Feature Options +Feature Options {#gtk_feature_options} ----------------- When producing an executable that is linked statically with wxGTK @@ -316,7 +324,7 @@ Please see the output of "./configure --help" for comprehensive list of all configurable options. -* Compiling +Compiling {#gtk_compling} ----------- The following must be done in the base directory (e.g. ~/wxGTK @@ -352,43 +360,36 @@ make clean in the various directories will do the work for you. -* Creating a new Project +Creating a new Project {#gtk_new_project} -------------------------- -1) The first way uses the installed libraries and header files -automatically using wx-config +1. The first way uses the installed libraries and header files + automatically using wx-config -g++ myfoo.cpp `wx-config --cxxflags --libs` -o myfoo + g++ myfoo.cpp `wx-config --cxxflags --libs` -o myfoo -Using this way, a make file for the minimal sample would look -like this + Using this way, a make file for the minimal sample would look + like this -CXX = g++ + CXX = g++ -minimal: minimal.o - $(CXX) -o minimal minimal.o `wx-config --libs` + minimal: minimal.o + $(CXX) -o minimal minimal.o `wx-config --libs` -minimal.o: minimal.cpp - $(CXX) `wx-config --cxxflags` -c minimal.cpp -o minimal.o + minimal.o: minimal.cpp + $(CXX) `wx-config --cxxflags` -c minimal.cpp -o minimal.o -clean: - rm -f *.o minimal + clean: + rm -f *.o minimal -If your application uses only some of wxWidgets libraries, you can -specify required libraries when running wx-config. For example, -`wx-config --libs=html,core` will only output link command to link -with libraries required by core GUI classes and wxHTML classes. See -the manual for more information on the libraries. + If your application uses only some of wxWidgets libraries, you can + specify required libraries when running wx-config. For example, + `wx-config --libs=html,core` will only output link command to link + with libraries required by core GUI classes and wxHTML classes. See + the manual for more information on the libraries. -2) The other way creates a project within the source code +2. The other way creates a project within the source code directories of wxWidgets. For this endeavour, you'll need GNU autoconf version 2.14 and add an entry to your Makefile.in to the bottom of the configure.in script and run autoconf and configure before you can type make. - ----------------------- - -In the hope that it will be useful, - - Robert Roebling - diff --git a/docs/gtk/overview.md b/docs/gtk/overview.md index 0ae6a19157..60d5265670 100644 --- a/docs/gtk/overview.md +++ b/docs/gtk/overview.md @@ -1,4 +1,4 @@ -# wxWidgets on the GNOME Desktop +# wxWidgets on the GNOME Desktop {#plat_gtk_overview} wxWidgets is a C++ cross-platform GUI library, whose distintive feature is the use of native calls and native widgets on the respective platform, i.e. an diff --git a/docs/ios/install.md b/docs/ios/install.md new file mode 100644 index 0000000000..9892c59e4d --- /dev/null +++ b/docs/ios/install.md @@ -0,0 +1,27 @@ +Building wxWidgets for iOS {#plat_ios_install} +---------------------------- + +wxiOS is far from a full supported port, but can be used +as base for simple applications and future improvements. + +It requires Xcode with iOS SDK 9.0 or later. Xcode is available +for free in the OS X app store. + +To build wxiOS you should use Xcode to open the minimal samples +Xcode project file located at: + + samples/minimal/minimal_iphone.xcodeproj + +That project files includes wxiphone.xcodeproj so you just need +to hit run in order to see the minimal sample running in the +simulator. + +The library can also be build via configure/make: + + mkdir build_ios + cd build_ios + ../configure --with-osx_iphone --enable-monolithic \ + --with-macosx-version-min=8.0 --disable-shared \ + --enable-macosx_arch=i386 \ + --with-macosx-sdk=$(xcrun --sdk iphonesimulator --show-sdk-path) + make diff --git a/docs/ios/readme.txt b/docs/ios/readme.txt index 573db30676..928ef715ef 100644 --- a/docs/ios/readme.txt +++ b/docs/ios/readme.txt @@ -4,35 +4,6 @@ wxiOS is far from a full supported port, but can be used as base for simple applications and future improvements. -It requires Xcode with iOS SDK 9.0 or later. Xcode is available -for free in the OS X app store. - -More info about the wxWidgets project (including all the -other ports and version of wxWidgets) can be found at the -main wxWidgets homepage at: - - https://www.wxwidgets.org/ - -To build wxiOS you should use Xcode to open the minimal samples -Xcode project file located at: - - samples/minimal/minimal_iphone.xcodeproj - -That project files includes wxiphone.xcodeproj so you just need -to hit run in order to see the minimal sample running in the -simulator. - -The library can also be build via configure/make: - - mkdir build_ios - cd build_ios - ../configure --with-osx_iphone --enable-monolithic \ - --with-macosx-version-min=8.0 --disable-shared \ - --enable-macosx_arch=i386 \ - --with-macosx-sdk=$(xcrun --sdk iphonesimulator --show-sdk-path) - make - - Please send problems concerning installation, feature requests, bug reports or comments to the wxWidgets users list. These can be found at https://www.wxwidgets.org/support/mailing-lists/ diff --git a/docs/motif/install.txt b/docs/motif/install.md similarity index 79% rename from docs/motif/install.txt rename to docs/motif/install.md index 1b937c304a..322aa0096c 100644 --- a/docs/motif/install.txt +++ b/docs/motif/install.md @@ -1,6 +1,8 @@ -wxWidgets for Motif installation +wxWidgets for Motif installation {#plat_motif_install} -------------------------------- +[TOC] + IMPORTANT NOTE: If you experience problems installing, please re-read these @@ -40,38 +42,38 @@ First steps config.log file). -COMPILING USING CONFIGURE +Compiling using configure {#motif_configure} ========================= -* The simplest case +The simplest case {#motif_simple} ------------------- If you compile wxWidgets on Linux for the first time and don't like to read install instructions just do (in the base dir): -> ./configure --with-motif -> make -> su -> make install -> ldconfig -> exit + > ./configure --with-motif + > make + > su + > make install + > ldconfig + > exit Afterwards you can continue with -> make -> su -> make install -> ldconfig -> exit + > make + > su + > make install + > ldconfig + > exit If you want to remove wxWidgets on Unix you can do this: -> su -> make uninstall -> ldconfig -> exit + > su + > make uninstall + > ldconfig + > exit -* The expert case +The expert case {#motif_expert} ----------------- If you want to do some more serious cross-platform programming with wxWidgets, @@ -84,28 +86,28 @@ with --enable-debug and one without. For building three versions (one GTK, one Motif and a debug version of the GTK source) you'd do this: -mkdir buildmotif -cd buildmotif -../configure --with-motif -make -cd .. + mkdir buildmotif + cd buildmotif + ../configure --with-motif + make + cd .. -mkdir buildgtk -cd buildgtk -../configure --with-gtk -make -cd .. + mkdir buildgtk + cd buildgtk + ../configure --with-gtk + make + cd .. -mkdir buildgtkd -cd buildgtkd -../configure --with-gtk --enable-debug -make -cd .. + mkdir buildgtkd + cd buildgtkd + ../configure --with-gtk --enable-debug + make + cd .. Note that since wxWidgets-2.6.0 you can install all those libraries concurrently, you just need to pass the appropriate flags when using them. -* The simplest errors +The simplest errors {#motif_error_simple} --------------------- You get errors during compilation: The reason is that you probably have a @@ -115,18 +117,18 @@ GCC 2.95 or later. You get immediate segfault when starting any sample or application: This is either due to having compiled the library with different flags or options than -your program - typically you might have the __WXDEBUG__ option set for the +your program - typically you might have the `__WXDEBUG__` option set for the library but not for your program - or due to using a compiler with optimisation bugs. -* The simplest program +The simplest program {#motif_simple_app} ---------------------- Now create your super-application myfoo.app and compile anywhere with -g++ myfoo.cpp `wx-config --libs --cxxflags` -o myfoo + g++ myfoo.cpp `wx-config --libs --cxxflags` -o myfoo -* General +General {#motif_general} --------- The Unix variants of wxWidgets use GNU configure. If you have problems with @@ -134,7 +136,7 @@ your make use GNU make instead. If you have general problems with installation, see the wxWidgets website at - https://www.wxwidgets.org/ +https://www.wxwidgets.org/ for newest information. If you still don't have any success, please send a bug report to one of our mailing lists (see my homepage) INCLUDING A DESCRIPTION OF @@ -142,7 +144,7 @@ YOUR SYSTEM AND YOUR PROBLEM, SUCH AS YOUR VERSION OF MOTIF, WXMOTIF, WHAT DISTRIBUTION YOU USE AND WHAT ERROR WAS REPORTED. I know this has no effect, but I tried... -* GUI libraries +GUI libraries {#motif_libs_gui} --------------- wxWidgets/Motif requires the Motif library to be installed on your system. As @@ -151,9 +153,9 @@ most of the Motif API without the licence restrictions of Motif. You can get the newest version of the Lesstif from the lesstif homepage at: - http://lesstif.sourceforge.net/ +http://lesstif.sourceforge.net/ -* Additional libraries +Additional libraries {#motif_libs_misc} ---------------------- wxWidgets/Motif requires a thread library and X libraries known to work with @@ -164,14 +166,14 @@ correct glibc 2 support. You can disable thread support by running -./configure --disable-threads -make -su -make install -ldconfig -exit + ./configure --disable-threads + make + su + make install + ldconfig + exit -* Building wxMotif on Cygwin +Building wxMotif on Cygwin {#motif_cygwin} ---------------------------- The normal build instructions should work fine on Cygwin. The one difference @@ -185,10 +187,11 @@ will see linking errors. If this happens then you can work around the problem by setting LDFLAGS=-Wl,--export-all-symbols. Please also let us know about it on the wx-dev mailing list. -* Create your configuration +Create your configuration {#motif_config} --------------------------- Usage: + ./configure [options] If you want to use system's C and C++ compiler, @@ -216,7 +219,7 @@ Configure will complain if the system variable OSTYPE has not been defined. And Make in some circumstances as well... -* General options +General options {#motif_options} ------------------- Given below are the commands to change the default behaviour, @@ -289,7 +292,7 @@ The following options handle the kind of library you want to build. must be compiled with the same debug options. -* Feature Options +Feature Options {#motif_feature_options} ----------------- Many of the configure options have been thoroughly tested @@ -338,7 +341,7 @@ Please see the output of "./configure --help" for comprehensive list of all configurable options. -* Compiling +Compiling {#motif_compile} ----------- The following must be done in the base directory (e.g. ~/wxMotif @@ -374,41 +377,41 @@ object-files: in the various directories will do the work for you. -* Creating a new Project +Creating a new Project {#motif_new_project} ------------------------ -1) The first way uses the installed libraries and header files +1. The first way uses the installed libraries and header files automatically using wx-config -g++ myfoo.cpp `wx-config --libs` `wx-config --cxxflags` -o myfoo + g++ myfoo.cpp `wx-config --libs` `wx-config --cxxflags` -o myfoo -Using this way, a make file for the minimal sample would look -like this + Using this way, a make file for the minimal sample would look + like this -CXX = g++ + CXX = g++ -minimal: minimal.o - $(CXX) -o minimal minimal.o `wx-config --libs` + minimal: minimal.o + $(CXX) -o minimal minimal.o `wx-config --libs` -minimal.o: minimal.cpp - $(CXX) `wx-config --cxxflags` -c minimal.cpp -o minimal.o + minimal.o: minimal.cpp + $(CXX) `wx-config --cxxflags` -c minimal.cpp -o minimal.o -clean: - rm -f *.o minimal + clean: + rm -f *.o minimal -If your application uses only some of wxWidgets libraries, you can -specify required libraries when running wx-config. For example, -`wx-config --libs=html,core` will only output link command to link -with libraries required by core GUI classes and wxHTML classes. See -the manual for more information on the libraries. + If your application uses only some of wxWidgets libraries, you can + specify required libraries when running wx-config. For example, + `wx-config --libs=html,core` will only output link command to link + with libraries required by core GUI classes and wxHTML classes. See + the manual for more information on the libraries. -2) The other way creates a project within the source code +2. The other way creates a project within the source code directories of wxWidgets. For this endeavour, you'll need GNU autoconf version 2.14 and add an entry to your Makefile.in to the bottom of the configure.in script and run autoconf and configure before you can type make. -* Further notes by Julian Smart +Further notes by Julian Smart {#motif_notes} --------------------------------- - You may find the following script useful for compiling wxMotif, @@ -416,25 +419,23 @@ and configure before you can type make. permissions). Make this script executable with the command chmod a+x makewxmotif. - -------:x-----Cut here-----:x----- - # makewxmotif - # Sets permissions (in case we extracted wxMotif from zip files) - # and makes wxMotif. - # Call from top-level wxWidgets directory. - # Note that this uses standard (but commonly-used) configure options; - # if you're feeling brave, you may wish to compile with threads: - # if they're not supported by the target platform, they will be disabled - # anyhow - # -- Julian Smart - chmod a+x configure config.sub config.guess - ./configure --with-shared --with-motif --with-debug_flag --with-debug_info --enable-debug --without-threads --without-sockets --without-odbc - make - -------:x-----Cut here-----:x----- + # makewxmotif + # Sets permissions (in case we extracted wxMotif from zip files) + # and makes wxMotif. + # Call from top-level wxWidgets directory. + # Note that this uses standard (but commonly-used) configure options; + # if you're feeling brave, you may wish to compile with threads: + # if they're not supported by the target platform, they will be disabled + # anyhow + # -- Julian Smart + chmod a+x configure config.sub config.guess + ./configure --with-shared --with-motif --with-debug_flag --with-debug_info --enable-debug --without-threads --without-sockets --without-odbc + make This script will build wxMotif using shared libraries. If you want to build a static wxWidgets library, use --disable-shared. -Troubleshooting +Troubleshooting {#motif_troubleshoot} --------------- - Solaris compilation with gcc: if the compiler has problems with the variable @@ -458,20 +459,10 @@ Troubleshooting If you find any incorrect instances, though, such as a missing 'const' in an overridden function, please let us know. -Other Notes +Other Notes {#motif_misc} ----------- - Using configure will create a release build of the library by default: it's recommended to use --enable-debug configure switch while developing your application. To compile in non-debug mode, use --disable-debug configure switch. - -Bug reports ------------ - -Please send bug reports with a description of your environment, -compiler and the error message(s) to the developers mailing list at: - - https://www.wxwidgets.org/support/mailing-lists/ - -Julian Smart, Robert Roebling and Vadim Zeitlin, November 1999. diff --git a/docs/msw/binaries.md b/docs/msw/binaries.md new file mode 100644 index 0000000000..e5aceba9c3 --- /dev/null +++ b/docs/msw/binaries.md @@ -0,0 +1,90 @@ +How to use wxMSW binaries {#plat_msw_binaries} +========================= + +[TOC] + +Supported Compilers +------------------- +We provide pre-built binary files for the following compilers: + +* Microsoft Visual C++ compiler versions 9.0, 10.0, 11.0, 12.0, 14.0 and 14.1 + (corresponding to marketing product names of Microsoft Visual Studio 2008, 2010, 2012, 2013, 2015 and 2017 respectively). +* TDM-GCC version 5.1 and MinGW-w64 version 7.2 (with the default SJLJ + exceptions propagation method, using C++11). Please note that you need to use + the very latest MinGW-w64 7.2 compiler release with this version of the + compiler which can be downloaded from + [here for 32 bits](https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/7.2.0/threads-win32/sjlj/i686-7.2.0-release-win32-sjlj-rt_v5-rev1.7z/download) + and + [here for 64 bits](https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/7.2.0/threads-win32/seh/x86_64-7.2.0-release-win32-seh-rt_v5-rev1.7z/download), + the older "rev0" release has a known bug affecting building wxWidgets in + some scenarios. + + +Getting the files +----------------- + +First, you need to get the correct files. You will always need the +`wxWidgets-3.1.1-headers.7z` one but the rest depends on your compiler version +and architecture: as different versions of MSVC compiler are not binary +compatible, you should select the files with the correct +`vc80`, `vc90`, `vc100`, `vc110`, `vc120`, `vc140` or `vc141` +suffix depending on whether you use +Visual Studio 2005, 2008, 2010, 2012, 2013, 2015 or 2017 respectively. +You also need to decide whether you use the `x64` files for 64-bit development +or the ones without this suffix for the still more common 32-bit builds. After +determining the combination of suffixes you need, you should download the +"Dev" and the "ReleaseDLL" files in addition to the "Headers" one above, +e.g. for 32-bit MSVS 2017 development you need +`wxMSW-3.1.1_vc141_Dev.7z` and `wxMSW-3.1.1_vc141_ReleaseDLL.7z`. + +All binaries are available at: + +https://github.com/wxWidgets/wxWidgets/releases/v3.1.1 + +Once you have the files you need, unzip all of them into the same directory, for +example `c:\wx\3.1.1`. You should have only include and lib subdirectories under +it, nothing else. To avoid hard-coding this path into your projects, define +`wxwin` environment variable containing it: although it's a little known fact, +all versions of MSVC support environment variable expansion in the C++ projects +(but not, unfortunately, in the solution files). + +Using Binaries with Visual Studio +--------------------------------- + +Next step is to set up your project to use these files. You need to do the +following: + +* In the compiler options, i.e. "C/C++" properties: + * Add `$(wxwin)/include/msvc;$(wxwin)/include` to the "Additional Include + Directories". Notice that the order is important here, putting the + MSVC-specific directory first ensures that you use `wx/setup.h` + automatically linking in wxWidgets libraries. + * Add `WXUSINGDLL` and `wxMSVC_VERSION_AUTO` to the list of defined + symbols in "Preprocessor Definitions". The first should be + self-explanatory (we only provide DLLs, not static libraries) while the + second one is necessary to use the libraries from e.g. `lib\vc100_dll` + directory and not the default `lib\vc_dll`. + * Also check that `_UNICODE` and `UNICODE` symbols are defined in the same + "Preprocessor Definitions" section. This should already be the case for + the newly created projects but it might be necessary to add them if + you're upgrading an existing one. + * Check that you use "Multi-threaded \[Debug\] DLL" in the "Run-time + library" option under "Code Generation" to ensure that your build uses + the same CRT version as our binaries. +* In the linker options you only need to add `$(wxwin)\lib\vc141_dll` (with + the compiler-version-dependent suffix, of course) to "Additional Library + Directories" under "Linker\\General" in the options. Thanks to the use of + MSVC-specific `setup.h` you don't need to list wxWidgets libraries manually, + i.e. you do **not** need to put anything in the list of "Additional + Dependencies". + +Now you should be able to build your project successfully, both in "Debug" and +"Release" configurations. With MSVS 10 or newer it can also be done from the +command line using `msbuild.exe`. Of course, to run the generated executable +you will need to either add the directory containing wxWidgets DLLs to your PATH +or copy the DLL files to a directory already on it. Finally, if you want to +distribute the binaries created using these options, you will need to install +Microsoft Visual C++ run-time DLLs. Again, MSVC 10 or newer has an advantage +here as you can simply copy `msvcp100.dll` and `msvcr100.dll` as any other DLL, +while you need to install specially for the previous compiler versions that +use WinSxS ("side-by-side") for them. diff --git a/docs/msw/gtk.txt b/docs/msw/gtk.md similarity index 91% rename from docs/msw/gtk.txt rename to docs/msw/gtk.md index 6756ea61ec..631884bb18 100644 --- a/docs/msw/gtk.txt +++ b/docs/msw/gtk.md @@ -1,4 +1,4 @@ -Building wxGTK port with Win32 GDK backend +Building wxGTK port with Win32 GDK backend {#plat_msw_gtk} ------------------------------------------ GTK+ widget toolkit has multiple GDK backends and one of them is Win32. @@ -11,14 +11,15 @@ These notes don't consider building wxGTK with X11 backend under Windows. Building steps: 1. wxGTK/Win32 build is similar to wxMSW one and you should have configured -and be able to build wxWidgets as described in docs/msw/install.txt +and be able to build wxWidgets as described in @ref plat_msw_install 2. wxGTK/Win32 is disabled by default in wxWidgets, you need to enable it in bakefiles manually. Apply following patch manually or using Cygwin: - patch -p0 < docs/msw/gtkfix.patch + patch -p0 < docs/msw/gtkfix.patch Regenerate required make/project files: + cd build\bakefiles bakefile_gen @@ -31,6 +32,7 @@ in the C:\gtk directory. 4. Building 4.1 If you are using Visual C++ project files you need to setup GTK+ 2 include directories + C:\gtk\lib\include\gtk-2.0 C:\gtk\lib\include\glib-2.0 C:\gtk\lib\include\cairo @@ -44,7 +46,7 @@ and library directory C:\gtk\lib\ - See http://msdn.microsoft.com/en-us/library/t9az1d21(v=vs.90).aspx +See http://msdn.microsoft.com/en-us/library/t9az1d21(v=vs.90).aspx Open solution file in build\msw directory, select "GTK+ Debug" solution configuration and build the solution. To be sure that everything is as expected diff --git a/docs/msw/install.txt b/docs/msw/install.md similarity index 83% rename from docs/msw/install.txt rename to docs/msw/install.md index d3a69b8302..2399ffbbe2 100644 --- a/docs/msw/install.txt +++ b/docs/msw/install.md @@ -1,37 +1,26 @@ - Installing wxWidgets for Windows - -------------------------------- +Installing wxWidgets for Windows {#plat_msw_install} +-------------------------------- This is wxWidgets for Microsoft Windows (XP, Vista, 7, 8, 10, etc) including both 32 bit and 64 bit versions. +[TOC] -Table of Contents: - - Installation - - Building wxWidgets - - Configuring the Build - - Building Applications Using wxWidgets - - -Installation +Installation {#msw_install} ============ -If you are using one of the supported compilers, you can download the -pre-built in binaries from - - https://github.com/wxWidgets/wxWidgets/releases/v3.1.1 +If you are using one of the supported compilers, you can use +[pre-built binaries](@ref plat_msw_binaries). In this case, just uncompress the binaries archive under any directory -and skip to "Building Applications Using wxWidgets" part. +and skip to [Building Applications Using wxWidgets](#msw_build_apps) part. Otherwise, or if you want to build a configuration of the library different from the default one, you need to build the library from sources before using it. -If you use CMake, please see - - https://docs.wxwidgets.org/trunk/overview_cmake.html - -for building wxWidgets using it. +If you use CMake, please see @ref overview_cmake for +building wxWidgets using it. The first step, which you may have already performed, unless you are reading this file online, is to download the source archive and @@ -46,22 +35,22 @@ actually required, this makes using the library more convenient and this environment variable is used in the examples below. NB: If you checked your sources from version control repository and - didn't obtain them from a release file, you also need to copy - include/wx/msw/setup0.h to include/wx/msw/setup.h and to remember - to update the latter whenever the former changes, otherwise you - will get compilation errors if any new symbols are added to - setup0.h file in the repository. +didn't obtain them from a release file, you also need to copy +`include/wx/msw/setup0.h` to `include/wx/msw/setup.h` and to remember +to update the latter whenever the former changes, otherwise you +will get compilation errors if any new symbols are added to +setup0.h file in the repository. - If you have no intention of modifying setup.h, you may avoid this - problem by creating a symbolic link to setup0.h instead of making - a copy of it using mklink, from an admin command prompt: +If you have no intention of modifying setup.h, you may avoid this +problem by creating a symbolic link to setup0.h instead of making +a copy of it using mklink, from an admin command prompt: - cd %WXWIN%\include\wx\msw\ - mklink setup.h setup0.h + cd %WXWIN%\include\wx\msw\ + mklink setup.h setup0.h -Building wxWidgets +Building wxWidgets {#msw_build} ================== The following sections explain how to compile wxWidgets with each supported @@ -70,7 +59,7 @@ building your application using wxWidgets. All makefiles and project are located in build\msw directory. -Microsoft Visual C++ Compilation +Microsoft Visual C++ Compilation {#msw_build_msvs} ---------------------------------------------------------------- * From command line using the provided makefiles: @@ -79,7 +68,7 @@ Microsoft Visual C++ Compilation must have been installed to the "Start" menu or the "Start" screen by MSVS installation. -1. Change directory to %WXWIN%\build\msw and type +1. Change directory to \%WXWIN\%\build\msw and type > nmake /f makefile.vc @@ -99,7 +88,7 @@ Microsoft Visual C++ Compilation See "Configuring the Build" for more information about the additional parameters that can be specified on the command line. -2. To verify your build, change the directory to %WXWIN%\samples\minimal and +2. To verify your build, change the directory to \%WXWIN\%\samples\minimal and run the same nmake command (with the same parameters there), this should create a working minimal wxWidgets sample. @@ -120,7 +109,7 @@ are not always built in the correct order, and this may result in link errors. Simply do the build again, up to 3 times, to fix this. -Special notes for Visual Studio 2010+: +### Special notes for Visual Studio 2010+ For Visual Studio 2010+ solutions it is possible to customize the build by creating a wx_local.props file in the build\msw directory which is used, if it @@ -132,8 +121,8 @@ make the file is to copy wx_setup.props to wx_local.props and then edit local. For example, if you are building wxWidgets libraries using multiple versions of Visual Studio you could change wxCompilerPrefix to include the toolset: -- vc -+ vc$(PlatformToolsetVersion) + - vc + + vc$(PlatformToolsetVersion) Following that example if you are using Visual Studio 2013 and open wx_vc12.sln it will build using the "vc120" prefix for the build directories @@ -147,28 +136,31 @@ updated with it. For example the version information in wx_setup.props could change and the information in your wx_local.props would be outdated. It is your responsibility to monitor for such situations. -Improve debugging for Visual Studio 2012+: +### Improve debugging for Visual Studio 2012+ Debug visualizers for Visual Studio 2012+ are provided which makes inspecting various wxWidgets classes easier to view while debugging. To use them: -1. Open the folder %WXWIN%\misc\msvc -2. Open the folder %USERPROFILE%\My Documents\Visual Studio 2012\Visualizers\ +1. Open the folder \%WXWIN\%\misc\msvc +2. Open the folder \%USERPROFILE\%\My Documents\Visual Studio 2012\Visualizers\ (or the corresponding location for newer versions, e.g. ...2013\Visualizers) 3. Copy wxWidgets.natvis and autoexp.inc 4. For Visual Studio 2013+ additionally copy wxWidgets.2013.natvis -Cygwin/MinGW Compilation +Cygwin/MinGW Compilation {#msw_build_cygwin} ---------------------------------------------------------------- wxWidgets supports Cygwin, MinGW, MinGW-w64 and TDM-GCC tool chains under Windows. They can be downloaded from: - http://www.cygwin.com/ - http://www.mingw.org/ - http://mingw-w64.sourceforge.net/ - http://tdm-gcc.tdragon.net/ +http://www.cygwin.com/ + +http://www.mingw.org/ + +http://mingw-w64.sourceforge.net/ + +http://tdm-gcc.tdragon.net/ respectively. Please retrieve and install the latest version of your preferred tool chain by following the instructions provided by these packages. Notice @@ -189,7 +181,7 @@ All of these tool chains can be used either with Unix-like configure+make build process (preferred) or with the provided makefile.gcc makefiles without using configure: -* Using configure +### Using configure This method works in exactly the same way as under Unix systems, including OS X, and requires a Unix-like environment to work, i.e. @@ -231,7 +223,7 @@ either MSYS or Cygwin. so this step can usually be omitted. -* Using plain makefiles: +### Using plain makefiles: NOTE: The makefile.gcc makefiles are for compilation under MinGW using Windows command interpreter (command.com/cmd.exe), they won't work @@ -240,7 +232,7 @@ NOTE: The makefile.gcc makefiles are for compilation under MinGW using 0. Open DOS command line window (cmd.exe, *not* Bash sh.exe). -1. Change directory to %WXWIN%\build\msw and type +1. Change directory to \%WXWIN\%\build\msw and type > mingw32-make -f makefile.gcc @@ -263,7 +255,7 @@ NOTE: The makefile.gcc makefiles are for compilation under MinGW using -Borland C++ Compilation +Borland C++ Compilation {#msw_build_borland} ---------------------------------------------------------------- WARNING: Borland instructions are out of date, please send us your @@ -278,7 +270,7 @@ debugger is very good. To avoid linker errors you will need to add -DSHARED=1 to the makefile line for the library The version 5.6 included in Borland C++ Builder 2006 works as well after the -following small change: please remove the test for __WINDOWS__ from line 88 +following small change: please remove the test for `__WINDOWS__` from line 88 of the file BCCDIR\include\stl\_threads.h. Compiling using the makefiles: @@ -302,7 +294,7 @@ debug mode, edit makefile.bcc and change /aa to /Tpe in link commands. Using the Debugger and IDE in BDS or Turbo Explorer --------------------------------------------------- -Doubleclick / open %WXWIN%\samples\minimal\borland.bdsproj. The current version +Doubleclick / open \%WXWIN\%\samples\minimal\borland.bdsproj. The current version is to be used with a dynamic build of wxWidgets-made by running make -f Makefile.bcc -DBUILD=debug -DSHARED=1 in wxWidgets\build\msw. You also need the wxWidgets\lib\bcc_dll @@ -324,16 +316,16 @@ Compiling using the IDE files for Borland C++ 5.0 and using CBuilder IDE In all of your wxWidgets applications, your source code should include the following preprocessor directive: -#ifdef __BORLANDC__ -#pragma hdrstop -#endif + #ifdef __BORLANDC__ + #pragma hdrstop + #endif (check the samples -- e.g., \wx2\samples\minimal\minimal.cpp -- for more details) -Configuring the Build +Configuring the Build {#msw_build_config} ================================================================ NOTE: If you use configure to build the library with Cygwin/MinGW, the @@ -344,7 +336,7 @@ Library configuration ---------------------------------------------------------------- While it is never necessary to do it, you may want to change some of -the options in the %WXWIN%\include\wx\msw\setup.h file before building +the options in the \%WXWIN\%\\include\\wx\\msw\\setup.h file before building wxWidgets. This file is heavily commented, please read it and enable or disable the features you would like to compile wxWidgets with[out]. @@ -381,17 +373,20 @@ depending on the compiler used. The full list of the build settings follows: -BUILD=release +* BUILD=release + Builds release version of the library. It differs from default 'debug' in lack of appended 'd' in name of library and uses the release CRT libraries instead of debug ones. Notice that even release builds do include debug information by default, see DEBUG_FLAG for more information about it. -SHARED=1 +* SHARED=1 + Build shared libraries (DLLs). By default, DLLs are not built (SHARED=0). -UNICODE=0 +* UNICODE=0 + To completely disable Unicode support (default is UNICODE=1). It should not be necessary to do this. @@ -399,54 +394,62 @@ UNICODE=0 Unicode build) and the directory where the library and setup.h are stored (ditto). -WXUNIV=1 +* WXUNIV=1 + Build wxUniversal instead of native wxMSW -MONOLITHIC=1 +* MONOLITHIC=1 + Starting with version 2.5.1, wxWidgets has the ability to be built as several smaller libraries instead of single big one as used to be the case in 2.4 and older versions. This is called "multilib build" and is the default behaviour of makefiles. You can still build single library ("monolithic build") by setting MONOLITHIC variable to 1. -USE_GUI=0 +* USE_GUI=0 + Disable building GUI parts of the library, build only wxBase components used by console applications. Note that if you leave USE_GUI=1 then both wxBase and GUI libraries are built. -USE_$(LIBRARY)=0 +* USE_$(LIBRARY)=0 + Do not build the corresponding library (all libraries are built by default). Library which can be disabled in this way are: AUI, HTML, MEDIA, GL (the option name is USE_OPENGL for this one), PROPGRID, QA, RIBBON, RICHTEXT, STC, WEBVIEW, XRC. -RUNTIME_LIBS=static +* RUNTIME_LIBS=static + Links static version of C and C++ runtime libraries into the executable, so that the program does not depend on DLLs provided with the compiler (e.g. Visual C++'s msvcrt.dll or Borland's cc3250mt.dll). Caution: Do not use static runtime libraries when building DLL (SHARED=1)! -DEBUG_FLAG=0 -DEBUG_FLAG=1 -DEBUG_FLAG=2 +* DEBUG_FLAG=0 +* DEBUG_FLAG=1 +* DEBUG_FLAG=2 + Specifies the level of debug support in wxWidgets. Notice that this is independent from both BUILD and DEBUG_INFO options. By default always set to 1 meaning that debug support is enabled: asserts are compiled into the code (they are inactive by default in release builds of the application but can be enabled), wxLogDebug() and wxLogTrace() are available - and __WXDEBUG__ is defined. Setting it to 0 completely disables all + and `__WXDEBUG__` is defined. Setting it to 0 completely disables all debugging code in wxWidgets while setting it to 2 enables even the time consuming assertions and checks which are deemed to be unsuitable for production environment. -DEBUG_INFO=0 -DEBUG_INFO=1 +* DEBUG_INFO=0 +* DEBUG_INFO=1 + This option affects whether debugging information is generated. If omitted or set to 'default' its value is determined the value of the BUILD option. -DEBUG_RUNTIME_LIBS=0 -DEBUG_RUNTIME_LIBS=1 +* DEBUG_RUNTIME_LIBS=0 +* DEBUG_RUNTIME_LIBS=1 + (VC++ only.) If set to 1, msvcrtd.dll is used, if to 0, msvcrt.dll is used. By default msvcrtd.dll is used only if the executable contains debug info and msvcrt.dll if it doesn't. It is sometimes @@ -455,11 +458,13 @@ DEBUG_RUNTIME_LIBS=1 usable .pdb files with debug information) and this setting makes it possible. -TARGET_CPU=X64|ARM64|IA64 +* TARGET_CPU=X64|ARM64|IA64 + (VC++ only.) Set this variable to build for x86_64 systems. If unset, x86 build is performed. -VENDOR= +* VENDOR=\ + Set this to a short string identifying your company if you are planning to distribute wxWidgets DLLs with your application. Default value is 'custom'. This string is included as part of DLL name. wxWidgets DLLs contain compiler @@ -468,72 +473,74 @@ VENDOR= default settings. If you set VENDOR=mycorp, the name will change to wxmsw311u_core_vc_mycorp.dll. -CFG= +* CFG=\ + Sets configuration name so that you can have multiple wxWidgets builds with different setup.h settings coexisting in same tree. The value of this option is appended to the build directories names. This is useful for building the library in some non-default configuration, - e.g. you could change wxUSE_STL to 1 in %WXWIN%\include\wx\msw\setup.h and + e.g. you could change wxUSE_STL to 1 in \%WXWIN\%\include\wx\msw\setup.h and then build with "CFG=-stl". Alternatively, you could build with e.g. "RUNTIME_LIBS=static CFG=-mt" when using MSVC. -COMPILER_PREFIX= +* COMPILER_PREFIX=\ + If you build with multiple versions of the same compiler, you can put their outputs into directories like "vc6_lib", "vc8_lib" etc. instead of "vc_lib" by setting this variable to e.g. "vc6". This is merely a convenience variable, you can achieve the same effect (but different directory names) with the CFG option. -CFLAGS -CXXFLAGS -CPPFLAGS -LDFLAGS +* CFLAGS +* CXXFLAGS +* CPPFLAGS +* LDFLAGS + Additional flags to be used with C compiler, C++ compiler, C preprocessor (used for both C and C++ compilation) and linker, respectively. -Building Applications Using wxWidgets +Building Applications Using wxWidgets {#msw_build_apps} ===================================== If you want to use CMake for building your project, please see - - https://docs.wxwidgets.org/trunk/overview_cmake.html#cmake_apps +@ref overview_cmake. Otherwise follow the instructions below for "manual" setup of your project. We suppose that wxWidgets sources are under the directory $WXWIN (notice that different tool chains refer to environment variables such as WXWIN in different ways, e.g. MSVC users should use $(WXWIN) instead of just -$WXWIN). And we will use as a shortcut for the subdirectory of +$WXWIN). And we will use \ as a shortcut for the subdirectory of $WXWIN\lib which is composed from several parts separated by underscore: first, a compiler-specific prefix (e.g. "vc" for MSVC, "gcc" for g++ or the value of COMPILER_PREFIX if you set it explicitly), then optional "x64" if building in 64 bits and finally either "lib" or "dll" depending on whether static or dynamic wx libraries are being used. -For example, WXWIN could be "c:\wxWidgets\3.4.5" and could be +For example, WXWIN could be "c:\wxWidgets\3.4.5" and \ could be "c:\wxWidgets\3.4.5\lib\vc_x64_lib" for 64-bit static libraries built with MSVC. Here is what you need to do: -* Add $WXWIN\include to the +* Add $WXWIN\\include to the - compiler - resource compiler include paths. * If using MSVC, prepend $WXWIN\include\msvc to the include paths too. - Otherwise, append \mswu[d] to the include paths, where "d" should + Otherwise, append \\mswu[d] to the include paths, where "d" should be used for debug builds only. * Define the following symbols for the preprocessor: - - __WXMSW__ to ensure you use the correct wxWidgets port. + - `__WXMSW__` to ensure you use the correct wxWidgets port. - _UNICODE unless you want to use deprecated ANSI build of wxWidgets. - NDEBUG if you want to build in release mode, i.e. disable asserts. - WXUSINGDLL if you are using DLL build of wxWidgets. * If using MSVC 7 only (i.e. not for later versions), also define wxUSE_RC_MANIFEST=1 and WX_CPU_X86. -* Add directory described above to the libraries path. +* Add \ directory described above to the libraries path. When using MSVC, the libraries are linked automatically using "#pragma comment(lib)" feature of this compiler. With all the other compilers you also @@ -554,3 +561,18 @@ using wxWidgets and always work, so in case of a problem, e.g. if the instructions here are out of date, you can always simply copy a makefile or project file from $WXWIN\samples\minimal or some other sample and adapt it to your application. + +If you are not using Visual Studio 2010 or newer please see +@subpage plat_msw_winxp "Windows XP Support" to enable visual styles in your +application. + +Advanced Library Configurations {#msw_advanced} +=============================== +Build instructions to less common library configuartions using different UI +backends are avaiable here. + +@subpage plat_msw_msys2 "Building with Win32 MSys2 backend" + +@subpage plat_msw_msys2_gtk "Building with Win32 MSys2 GDK backend" + +@subpage plat_msw_gtk "Building wxGTK port with Win32 GDK backend" diff --git a/docs/msw/msys2-gtk.md b/docs/msw/msys2-gtk.md new file mode 100644 index 0000000000..e6cb03567a --- /dev/null +++ b/docs/msw/msys2-gtk.md @@ -0,0 +1,124 @@ +Building wxGTK port with Win32 MSys2 GDK backend {#plat_msw_msys2_gtk} +------------------------------------------------ + +GTK+ widget toolkit has multiple GDK backends and one of them is Win32. +It is a wrapper around Windows API. + +These notes don't consider building wxGTK with X11 backend under Windows. + +The MSys2 website is http://www.msys2.org/ + +These building steps are NOT the normal way to build MSys2 MinGW packages. +But, they are a way the wxWidgets developers can test that wxWidgets +can build the wxGTK/Win32 libraries under MSys2 MinGW. + +For the MSys2 way please see + https://github.com/Alexpux/MINGW-packages and + https://github.com/msys2/msys2/wiki/Creating-packages + +Building steps: + +**Warning**: At the time these directions were written the GTK version 3 + was NOT able to create wxGTK/Win32 libraries that were usable. + +1. Install the mingw32 packages needed to build wxGTK/Win32 using the + configure/make build method. + From the MSys2 prompt or MSys2 MinGW prompt: + + The 32 bit Mingw packages are prefixed with "mingw-w64-i686-"; + Change the prefix to "mingw-w64-x86_64-" if you wish to do 64 bit. + + pacman -S --needed --noconfirm make + pacman -S --needed --noconfirm mingw-w64-i686-libjpeg-turbo + pacman -S --needed --noconfirm mingw-w64-i686-libpng + pacman -S --needed --noconfirm mingw-w64-i686-libtiff + pacman -S --needed --noconfirm mingw-w64-i686-gcc + pacman -S --needed --noconfirm mingw-w64-i686-pkg-config + ## gtk2 can take a long time to update/find fonts + pacman -S --needed --noconfirm mingw-w64-i686-gtk2 + + + Packages that are needed but are normally installed already. + + pacman -S --needed --noconfirm mingw-w64-i686-gcc-libs + pacman -S --needed --noconfirm mingw-w64-i686-expat + pacman -S --needed --noconfirm mingw-w64-i686-xz + pacman -S --needed --noconfirm mingw-w64-i686-zlib + pacman -S --needed --noconfirm mingw-w64-i686-gdk-pixbuf2 + + +2. Build the wxGTK/Win32 static library + 1. Open MSys2 MinGW Prompt + (These steps were tested on MinGW32; but, should work under MinGW64) + 2. Use the cd command to change directory to the wxWidgets top folder. + + 3. Create the "build-gtk2-static" folder to build the static libraries + + mkdir -p build-gtk2-static + + 4. Configure wxWidgets + Option "--disable-precomp-headers" is NOT needed. + It is being used to test for compile issues. + + Remove configure option "--disable-wxdib" to set wxUSE_WXDIB to 1. + The directions docs/msw/gtk.txt results in wxUSE_WXDIB set to 1. + + cd build-gtk2-static && \ + ../configure --with-gtk=2 \ + --disable-wxdib \ + --disable-shared \ + --disable-precomp-headers \ + && cd .. + + 5. clean the wxGTK static libraries + + cd build-gtk2-static && make clean && cd .. + + 6. make the wxGTK static libraries + + cd build-gtk2-static && make && cd .. + + +3. Build and run the minimal static sample + 1. Clean the minimal sample + + cd build-gtk2-static/samples/minimal && make clean && cd ../../.. + + 2. Build the minimal sample + + cd build-gtk2-static/samples/minimal && make && cd ../../.. + + 3. Run the minimal sample + + ./build-gtk2-static/samples/minimal/minimal.exe + + +4. Build most of the static samples + 1. Clean most of the static samples + + cd build-gtk2-static/samples && make clean && cd ../.. + + 2. Build most of the static samples + + cd build-gtk2-static/samples && make && cd ../.. + + +5. Run the drawing static sample + + cd samples/drawing && ../../build-gtk2-static/samples/drawing/drawing.exe && cd ../.. + +6. Run the splash static sample + + cd samples/splash && ../../build-gtk2-static/samples/splash/splash.exe && cd ../.. + +7. Run the widgets static sample + + cd samples/widgets && ../../build-gtk2-static/samples/widgets/widgets.exe && cd ../.. + +8. Run the toolbar static sample + + cd samples/toolbar && ../../build-gtk2-static/samples/toolbar/toolbar.exe && cd ../.. + +9. Run the image static sample + + cd samples/image && ../../build-gtk2-static/samples/image/image.exe && cd ../.. diff --git a/docs/msw/msys2-gtk.txt b/docs/msw/msys2-gtk.txt deleted file mode 100644 index bc7a08a9a5..0000000000 --- a/docs/msw/msys2-gtk.txt +++ /dev/null @@ -1,111 +0,0 @@ -Building wxGTK port with Win32 MSys2 GDK backend ------------------------------------------------- - -GTK+ widget toolkit has multiple GDK backends and one of them is Win32. -It is a wrapper around Windows API. - -These notes don't consider building wxGTK with X11 backend under Windows. - -The MSys2 website is http://www.msys2.org/ - -These building steps are NOT the normal way to build MSys2 MinGW packages. -But, they are a way the wxWidgets developers can test that wxWidgets -can build the wxGTK/Win32 libraries under MSys2 MinGW. - -For the MSys2 way please see - https://github.com/Alexpux/MINGW-packages and - https://github.com/msys2/msys2/wiki/Creating-packages - -Building steps: - -#Note: The "#" is used in front of a comment to help the people who cut -# and paste these directions. -#Warning: At the time these directions were written the GTK version 3 -# was NOT able to create wxGTK/Win32 libraries that were usable. - -#1. Install the mingw32 packages needed to build wxGTK/Win32 using the -# configure/make build method. -# From the MSys2 prompt or MSys2 MinGW prompt: - -# The 32 bit Mingw packages are prefixed with "mingw-w64-i686-"; -# Change the prefix to "mingw-w64-x86_64-" if you wish to do 64 bit. - -pacman -S --needed --noconfirm make -pacman -S --needed --noconfirm mingw-w64-i686-libjpeg-turbo -pacman -S --needed --noconfirm mingw-w64-i686-libpng -pacman -S --needed --noconfirm mingw-w64-i686-libtiff -pacman -S --needed --noconfirm mingw-w64-i686-gcc -pacman -S --needed --noconfirm mingw-w64-i686-pkg-config -## gtk2 can take a long time to update/find fonts -pacman -S --needed --noconfirm mingw-w64-i686-gtk2 - - -# Packages that are needed but are normally installed already. -pacman -S --needed --noconfirm mingw-w64-i686-gcc-libs -pacman -S --needed --noconfirm mingw-w64-i686-expat -pacman -S --needed --noconfirm mingw-w64-i686-xz -pacman -S --needed --noconfirm mingw-w64-i686-zlib -pacman -S --needed --noconfirm mingw-w64-i686-gdk-pixbuf2 - - -#2. Build the wxGTK/Win32 static library -#2a.Open MSys2 MinGW Prompt -# (These steps were tested on MinGW32; but, should work under MinGW64) -#2b.Use the cd command to change directory to the wxWidgets top folder. - - -#2c.Create the "build-gtk2-static" folder to build the static libraries -mkdir -p build-gtk2-static - -#2d.Configure wxWidgets -# Option "--disable-precomp-headers" is NOT needed. -# It is being used to test for compile issues. -# -# Remove configure option "--disable-wxdib" to set wxUSE_WXDIB to 1. -# The directions docs/msw/gtk.txt results in wxUSE_WXDIB set to 1. -cd build-gtk2-static && \ - ../configure --with-gtk=2 \ - --disable-wxdib \ - --disable-shared \ - --disable-precomp-headers \ - && cd .. - -#2e.clean the wxGTK static libraries -cd build-gtk2-static && make clean && cd .. - -#2f.make the wxGTK static libraries -cd build-gtk2-static && make && cd .. - - -#3 Build and run the minimal static sample -#3a.Clean the minimal sample -cd build-gtk2-static/samples/minimal && make clean && cd ../../.. - -#3b.Build the minimal sample -cd build-gtk2-static/samples/minimal && make && cd ../../.. - -#3c.Run the minimal sample -./build-gtk2-static/samples/minimal/minimal.exe - - -#4 Build most of the static samples -#4a.Clean most of the static samples -cd build-gtk2-static/samples && make clean && cd ../.. -#4b.Build most of the static samples -cd build-gtk2-static/samples && make && cd ../.. - - -#5 Run the drawing static sample -cd samples/drawing && ../../build-gtk2-static/samples/drawing/drawing.exe && cd ../.. - -#6 Run the splash static sample -cd samples/splash && ../../build-gtk2-static/samples/splash/splash.exe && cd ../.. - -#7 Run the widgets static sample -cd samples/widgets && ../../build-gtk2-static/samples/widgets/widgets.exe && cd ../.. - -#8 Run the toolbar static sample -cd samples/toolbar && ../../build-gtk2-static/samples/toolbar/toolbar.exe && cd ../.. - -#9 Run the image static sample -cd samples/image && ../../build-gtk2-static/samples/image/image.exe && cd ../.. diff --git a/docs/msw/msys2-msw.md b/docs/msw/msys2-msw.md new file mode 100644 index 0000000000..a0bdedd853 --- /dev/null +++ b/docs/msw/msys2-msw.md @@ -0,0 +1,101 @@ +Building wxMSW port with Win32 MSys2 backend {#plat_msw_msys2} +------------------------------------------------ + +The MSys2 website is http://www.msys2.org/ + +These building steps are NOT the normal way to build MSys2 MinGW packages. +But, they are a way the wxWidgets developers can test that wxWidgets +can build the wxMSW libraries under MSys2 MinGW. + +For the MSys2 way please see https://github.com/Alexpux/MINGW-packages + +Building steps: + +1. Install the mingw32 packages needed to build wxMSW using the + configure/make build method. + From the MSys2 prompt or MSys2 MinGW prompt: + + The 32 bit Mingw packages are prefixed with "mingw-w64-i686-"; + Change the prefix to "mingw-w64-x86_64-" if you wish to do 64 bit. + + pacman -S --needed --noconfirm make + pacman -S --needed --noconfirm mingw-w64-i686-libjpeg-turbo + pacman -S --needed --noconfirm mingw-w64-i686-libpng + pacman -S --needed --noconfirm mingw-w64-i686-libtiff + pacman -S --needed --noconfirm mingw-w64-i686-gcc + + Packages that are needed but are normally installed already. + + pacman -S --needed --noconfirm mingw-w64-i686-gcc-libs + pacman -S --needed --noconfirm mingw-w64-i686-expat + pacman -S --needed --noconfirm mingw-w64-i686-xz + pacman -S --needed --noconfirm mingw-w64-i686-zlib + + +2. Build the wxMSW static library + 1. Open MSys2 MinGW Prompt + (These steps were tested on MinGW32; but, should work under MinGW64) + 2. Use the cd command to change directory to the wxWidgets top folder. + + 3. Create the "build-msw-static" folder to build the static libraries + + mkdir -p build-msw-static + + 4. Configure wxWidgets + + Option "--disable-precomp-headers" is NOT needed. + I am doing it to check for compile issues; + And, I think my old 32 bit Windows machine + works best with it disabled. + + cd build-msw-static && \ + ../configure --with-msw \ + --disable-shared \ + --disable-precomp-headers \ + && cd .. + + 5. make the wxMSW static libraries + + cd build-msw-static && make && cd .. + +3. Build and run the minimal static sample + + 1. Clean the minimal sample + + cd build-msw-static/samples/minimal && make clean && cd ../../.. + + 2. Build the minimal sample + + cd build-msw-static/samples/minimal && make && cd ../../.. + + 3. Run the minimal sample + + ./build-msw-static/samples/minimal/minimal.exe + +4. Clean the static samples + + cd build-msw-static/samples && make clean && cd ../.. + +5. Build and run the typetest static sample to verify MIME database works + + cd build-msw-static/samples/typetest && make && cd ../../.. + ./build-msw-static/samples/typetest/typetest.exe + +6. Build and run the drawing static sample + + cd build-msw-static/samples/drawing && make && cd ../../.. + cd samples/drawing && ../../build-msw-static/samples/drawing/drawing.exe && cd ../.. + +7. Build and run the splash static sample + + cd build-msw-static/samples/splash && make && cd ../../.. + cd samples/splash && ../../build-msw-static/samples/splash/splash.exe && cd ../.. + +8. Build and run the widgets static sample + + cd build-msw-static/samples/widgets && make && cd ../../.. + cd samples/widgets && ../../build-msw-static/samples/widgets/widgets.exe && cd ../.. + +9. Build all the rest of the static samples + + cd build-msw-static/samples && make && cd ../.. diff --git a/docs/msw/msys2-msw.txt b/docs/msw/msys2-msw.txt deleted file mode 100644 index a88366b2aa..0000000000 --- a/docs/msw/msys2-msw.txt +++ /dev/null @@ -1,92 +0,0 @@ -Building wxMSW port with Win32 MSys2 backend ------------------------------------------------- - -The MSys2 website is http://www.msys2.org/ - -These building steps are NOT the normal way to build MSys2 MinGW packages. -But, they are a way the wxWidgets developers can test that wxWidgets -can build the wxMSW libraries under MSys2 MinGW. - -For the MSys2 way please see https://github.com/Alexpux/MINGW-packages - -Building steps: - -#Note: The "#" is used in front of a comment to help the people who cut -# and paste these directions. - -#1. Install the mingw32 packages needed to build wxMSW using the -# configure/make build method. -# From the MSys2 prompt or MSys2 MinGW prompt: - -# The 32 bit Mingw packages are prefixed with "mingw-w64-i686-"; -# Change the prefix to "mingw-w64-x86_64-" if you wish to do 64 bit. - -pacman -S --needed --noconfirm make -pacman -S --needed --noconfirm mingw-w64-i686-libjpeg-turbo -pacman -S --needed --noconfirm mingw-w64-i686-libpng -pacman -S --needed --noconfirm mingw-w64-i686-libtiff -pacman -S --needed --noconfirm mingw-w64-i686-gcc - -# Packages that are needed but are normally installed already. -pacman -S --needed --noconfirm mingw-w64-i686-gcc-libs -pacman -S --needed --noconfirm mingw-w64-i686-expat -pacman -S --needed --noconfirm mingw-w64-i686-xz -pacman -S --needed --noconfirm mingw-w64-i686-zlib - - -#2. Build the wxMSW static library -#2a.Open MSys2 MinGW Prompt -# (These steps were tested on MinGW32; but, should work under MinGW64) -#2b.Use the cd command to change directory to the wxWidgets top folder. - - -#2c.Create the "build-msw-static" folder to build the static libraries -mkdir -p build-msw-static - -#2d.Configure wxWidgets -# Option "--disable-precomp-headers" is NOT needed. -# I am doing it to check for compile issues; -# And, I think my old 32 bit Windows machine -# works best with it disabled. -cd build-msw-static && \ - ../configure --with-msw \ - --disable-shared \ - --disable-precomp-headers \ - && cd .. - -#2e.make the wxMSW static libraries -cd build-msw-static && make && cd .. - - -#3 Build and run the minimal static sample -#3a.Clean the minimal sample -cd build-msw-static/samples/minimal && make clean && cd ../../.. - -#3b.Build the minimal sample -cd build-msw-static/samples/minimal && make && cd ../../.. - -#3c.Run the minimal sample -./build-msw-static/samples/minimal/minimal.exe - - -#4 Clean the static samples -cd build-msw-static/samples && make clean && cd ../.. - -#5 Build and run the typetest static sample to verify MIME database works -cd build-msw-static/samples/typetest && make && cd ../../.. -./build-msw-static/samples/typetest/typetest.exe - -#6 Build and run the drawing static sample -cd build-msw-static/samples/drawing && make && cd ../../.. -cd samples/drawing && ../../build-msw-static/samples/drawing/drawing.exe && cd ../.. - -#7 Build and run the splash static sample -cd build-msw-static/samples/splash && make && cd ../../.. -cd samples/splash && ../../build-msw-static/samples/splash/splash.exe && cd ../.. - -#8 Build and run the widgets static sample -cd build-msw-static/samples/widgets && make && cd ../../.. -cd samples/widgets && ../../build-msw-static/samples/widgets/widgets.exe && cd ../.. - -#9 Build all the rest of the static samples -cd build-msw-static/samples && make && cd ../.. diff --git a/docs/msw/readme.txt b/docs/msw/readme.txt index 75c619c10b..00511b290a 100644 --- a/docs/msw/readme.txt +++ b/docs/msw/readme.txt @@ -1,7 +1,7 @@ This is wxWidgets for Windows (wxMSW) ------------------------------------- -For information on installing wxWidgets, please see install.txt. +For information on installing wxWidgets, please see install.md. For further information, please see docs/html/index.htm and the wxWidgets reference manual. diff --git a/docs/msw/winxp.txt b/docs/msw/winxp.md similarity index 66% rename from docs/msw/winxp.txt rename to docs/msw/winxp.md index 6c03f97760..a690ced463 100644 --- a/docs/msw/winxp.txt +++ b/docs/msw/winxp.md @@ -1,4 +1,4 @@ -Microsoft Windows XP Support from wxWidgets +Microsoft Windows XP Support from wxWidgets {#plat_msw_winxp} ------------------------------------------- Windows XP introduces the themes (called "visual styles" in the Microsoft @@ -30,27 +30,25 @@ for more details. Here is the example manifest which you can put into controls.exe.manifest file to test theme support using the controls sample: ---- cut here --- - - - -Controls: wxWidgets sample application - - - - - - ---- cut here --- + + + + Controls: wxWidgets sample application + + + + + + diff --git a/docs/osx/install.txt b/docs/osx/install.md similarity index 70% rename from docs/osx/install.txt rename to docs/osx/install.md index 57157981ac..9313a6f737 100644 --- a/docs/osx/install.txt +++ b/docs/osx/install.md @@ -1,58 +1,57 @@ -wxWidgets for OS X installation +wxWidgets for OS X installation {#plat_osx_install} ----------------------------------- +[TOC] + wxWidgets can be compiled using Apple's Cocoa library. -Most OS X developers should start by downloading and installing Xcode +Most OS X developers should start by downloading and installing Xcode from the App Store. It is a free IDE from Apple that provides all of the tools you need for working with wxWidgets. -After Xcode is installed, download wxWidgets-{version}.tar.bz2 and then +After Xcode is installed, download wxWidgets-{version}.tar.bz2 and then double-click on it to unpack it to create a wxWidgets directory. -Next use Terminal (under Applications, Utilities, Terminal) to access a command -prompt. Use cd to change directories to your wxWidgets directory and execute +Next use Terminal (under Applications, Utilities, Terminal) to access a command +prompt. Use cd to change directories to your wxWidgets directory and execute the following sets of commands from the wxWidgets directory. ---------- + mkdir build-cocoa-debug + cd build-cocoa-debug + ../configure --enable-debug + make -mkdir build-cocoa-debug -cd build-cocoa-debug -../configure --enable-debug -make -# Build the samples and demos -cd samples; make;cd .. -cd demos; make;cd .. +Build the samples and demos ---------- + cd samples; make;cd .. + cd demos; make;cd .. After the compilation completes, use Finder to run the samples and demos - Go to build-cocoa-debug/samples to experiment with the Cocoa samples. - Go to build-cocoa-debug/demos to experiment with the Cocoa demos. -Double-click on the executables which have an icon showing three small squares. -The source code for the samples is in wxWidgets/samples -The source code for the demos is in wxWidgets/demos - ---------- +* Go to build-cocoa-debug/samples to experiment with the Cocoa samples. +* Go to build-cocoa-debug/demos to experiment with the Cocoa demos. +* Double-click on the executables which have an icon showing three small squares. +* The source code for the samples is in wxWidgets/samples +* The source code for the demos is in wxWidgets/demos More information about building on OS X is available in the wxWiki. Here are two useful links - https://wiki.wxwidgets.org/Guides_%26_Tutorials - https://wiki.wxwidgets.org/Development:_wxMac + * https://wiki.wxwidgets.org/Guides_%26_Tutorials + * https://wiki.wxwidgets.org/Development:_wxMac ---------- -More advanced topics are covered below. +Advanced topics {#osx_advanced} +=============== ---------- +Installing library {#osx_install} +------------------ If you want to install the library into the system directories you'll need to do this as root. The accepted way of running commands as root is to use the built-in sudo mechanism. First of all, you must be using an account marked as a "Computer Administrator". Then -6) sudo make install -7) type + sudo make install + type \ Note that while using this method is okay for development, it is not recommended that you require endusers to install wxWidgets into their @@ -61,13 +60,13 @@ is to configure wxWidgets with --disable-shared. Another way to avoid it is to make a framework for wxWidgets. Making frameworks is beyond the scope of this document. -Note: +**Note:** It is rarely desirable to install non-Apple software into system directories. By configuring the library with --disable-shared and using the full path to wx-config with the --in-place option you can avoid installing the library. -Apple Developer Tools: Xcode +Apple Developer Tools: Xcode {#osx_xcode} ---------------------------- You can use the project in build/osx/wxcocoa.xcodeproj to build the Cocoa @@ -79,10 +78,10 @@ also wxrc tool which doesn't have its own Xcode project. If you need this tool, the simplest possibility is to build it from the command line after installing the libraries using commands like this: -$ cd utils/wxrc -$ g++ -o wxrc wxrc.cpp `wx-config --cxxflags --libs base,xml` + $ cd utils/wxrc + $ g++ -o wxrc wxrc.cpp `wx-config --cxxflags --libs base,xml` -Creating universal binaries +Creating universal binaries {#osx_universal_bin} --------------------------- The Xcode projects for the wxWidgets library and minimal project are set up @@ -108,11 +107,11 @@ binaries together. Assuming building on a PPC system: 2. Then, build for Intel, in a different folder. This time use: -export CFLAGS="-g -isysroot /Developer/SDKs/MacOSX10.7.sdk -arch i386" -export LDFLAGS="-syslibroot,/Developer/SDKs/MacOSX10.7.sdk" + export CFLAGS="-g -isysroot /Developer/SDKs/MacOSX10.7.sdk -arch i386" + export LDFLAGS="-syslibroot,/Developer/SDKs/MacOSX10.7.sdk" -./configure --disable-dependency-tracking --enable-static=yes --enable-shared=no \ - --target=i386-apple-darwin8 --host=powerpc-apple-darwin8 --build=i386-apple-darwin8 + ./configure --disable-dependency-tracking --enable-static=yes --enable-shared=no \ + --target=i386-apple-darwin8 --host=powerpc-apple-darwin8 --build=i386-apple-darwin8 You will need to reverse the powerpc and i386 parameters everywhere to build PPC on an Intel machine. diff --git a/docs/osx/readme.txt b/docs/osx/readme.txt index 766c099a10..28c11e87a0 100644 --- a/docs/osx/readme.txt +++ b/docs/osx/readme.txt @@ -2,9 +2,9 @@ Welcome to wxWidgets/Mac More Information is available from the wxWidgets project home page at -https://www.wxwidgets.org +https://www.wxwidgets.org -For more information, please see install.txt and the manuals. +For more information, please see install.md and the manuals. Please send problems concerning installation, feature requests, bug reports or comments to the wxWidgets users list. Information diff --git a/docs/qt/architecture.md b/docs/qt/architecture.md index 557de91312..5804db42ac 100644 --- a/docs/qt/architecture.md +++ b/docs/qt/architecture.md @@ -1,4 +1,4 @@ -# wxQt Architecture +# wxQt Architecture {#plat_qt_architecture} ## Internals @@ -7,11 +7,11 @@ wxQT uses the same techniques like other ports to wrap the Qt toolkit classes in ### Current (original) Approach An '''internal pointer m_qtWindow''' in wxWindow holds the reference to the QWidget (or derived) counterpart, and is accesible through the virtual method '''GetHandle'''. -This pointer and other window styles are set up in the '''PostCreation''' method that must be called by the derived classes (mostly controls) to initialize the widget correctly. +This pointer and other window styles are set up in the '''PostCreation''' method that must be called by the derived classes (mostly controls) to initialize the widget correctly. Not doing so will cause painting and deletion issues, as the base class will not know how to handle the Qt widget. wxControl even provides a protected method '''QtCreateControl''' that will do the common initialization (including post creation step, moving, sizing, etc., and calling the base to add the child to the parent). -'''Warning:''' Take care of not calling any function that can raise an assertion before `PostCreation`, for example wxFAIL_MSG, as it will interrupt the normal initialization, hence the later cleanup will crash. +'''Warning:''' Take care of not calling any function that can raise an assertion before `PostCreation`, for example wxFAIL_MSG, as it will interrupt the normal initialization, hence the later cleanup will crash. For example, this issue was caused by WXValidateStyle in wxCheckBox::Create, that was "failing silently" in unit tests, and then raising segmentation faults when the object was later deleted (as Qt checkbox counterpart was never being deleted due the aborted initialization). Many controls have also other pointers to allow to map different sub-widgets and other features. @@ -28,9 +28,9 @@ Note that some special cases are '''not real windows''' like the `wxTabFrame` (A ### Scroll Areas In both approaches, special care should be taken with scrolling areas, as Qt manages this ones slightly different to wxWidgets. -'''QtGetScrollBarsContainer''' should be reimplemented to return the QScrollArea widget or similar (where the scroll bars are places). +'''QtGetScrollBarsContainer''' should be reimplemented to return the QScrollArea widget or similar (where the scroll bars are places). -That widget should implement a '''viewport()''' (Qt idiom to differentiate the draw-able area). +That widget should implement a '''viewport()''' (Qt idiom to differentiate the draw-able area). Attempts to paint directly to the scroll area itself will fail. This is already handled in the QtHandlePaintEvent wxWindowQt method. @@ -54,19 +54,19 @@ Qt objects needs to be sub-classed to '''re-implement events''' and '''connect s The approach chosen was to use templates to help inherit QObject's (QWidget), providing a common base to handle events and signal infrastructure: -* '''wxQtSignalHandler< wxWindow >:''' allows emitting wx events for Qt events & signals. This should be used used for all QObjects derivatives that are not widgets, for example QAction (used for shortcut / accelerators). +* '''wxQtSignalHandler< wxWindow >:''' allows emitting wx events for Qt events & signals. This should be used used for all QObjects derivatives that are not widgets, for example QAction (used for shortcut / accelerators). * '''wxQtEventSignalHandler< QWidget, wxWindow >:''' derived from `wxQtSignalHandler`, also handles basic events (change, focus, mouse, keyboard, paint, close, etc.). This should be used for all QWidget derivatives (controls, top level windows, etc.) ### Delete later -Both templates also have some safety checks to avoid invalid spurious access to deleted wx objects (using a special pointer to the wx instance stored in the Qt object, that is reseted to NULL when the wx counterpart is marked to deletion). +Both templates also have some safety checks to avoid invalid spurious access to deleted wx objects (using a special pointer to the wx instance stored in the Qt object, that is reseted to NULL when the wx counterpart is marked to deletion). This is due that in some situations, Qt object could still be referenced in the Qt event queue, so it cannot be removed immediately. -'''Important:''' Currently wxQT is using Qt's '''deleteLater''' method to avoid this kind of issues. +'''Important:''' Currently wxQT is using Qt's '''deleteLater''' method to avoid this kind of issues. Please, don't use delete directly except you're confident it will not cause faults or other issues. -Note that no public wxWidget class should be derived directly from QWidget as they could have different lifespans and other implications to run time type systems (RTTI). +Note that no public wxWidget class should be derived directly from QWidget as they could have different lifespans and other implications to run time type systems (RTTI). Some QObjects are even owned by Qt (for example: menubar, statusbar) and some parents (ie. `QTabWidget`) cannot be deleted immediately in some circumstances (they would cause segmentation faults due spurious events / signals caused by the children destruction if not correctly handled as explained previously) For more information about the deletion issues, see [deleteLater](https://github.com/reingart/wxWidgets/wiki/WxQtDeleteLaterNotes ) notes and [wx-dev thread](https://groups.google.com/d/msg/wx-dev/H0Xc9aQzaH4/crjFDPsEA0cJ) discussion. diff --git a/docs/qt/install.txt b/docs/qt/install.md similarity index 67% rename from docs/qt/install.txt rename to docs/qt/install.md index f53c602b8c..293999385a 100644 --- a/docs/qt/install.txt +++ b/docs/qt/install.md @@ -1,6 +1,8 @@ -wxWidgets for Qt installation +wxWidgets for Qt installation {#plat_qt_install} ----------------------------- +[TOC] + IMPORTANT NOTE: If you experience problems installing, please re-read these @@ -13,19 +15,23 @@ IMPORTANT NOTE: using (including the beta) and what compiler on what system. One example: wxQt 3.1.0, GCC 4.8.1, Ubuntu 14.04 -* The simplest case +Installation {#qt_install} +============ + +The simplest case {#qt_simple} ------------------- If you compile wxWidgets on Linux for the first time and don't like to read install instructions just do (in the base dir): -> mkdir buildqt -> cd buildqt -> ../configure --with-qt -> make -> su -> make install -> ldconfig + > mkdir buildqt + > cd buildqt + > ../configure --with-qt + > make + > su + > make install + > ldconfig + [if you get "ldconfig: command not found", try using "/sbin/ldconfig"] If you don't do the 'make install' part, you can still use the libraries from @@ -33,65 +39,65 @@ the buildgtk directory, but they may not be available to other users. If you want to remove wxWidgets on Unix you can do this: -> su -> make uninstall -> ldconfig + > su + > make uninstall + > ldconfig -* The simplest errors +The simplest errors {#qt_error_simple} --------------------- For any configure errors: please look at config.log file which was generated during configure run, it usually contains some useful information. -configure reports, that you don't have Qt installed although you are very +configure reports, that you don't have Qt installed although you are very sure you have. Well, you have installed it, but you also have another -version of the Qt installed, which you may need to remove. Or maybe you -installed it in a non-default location and configure can't find it there, -so please check that your PATH variable includes the path to the correct -qtconfig/pkg-config. Also check that your LD_LIBRARY_PATH or equivalent -variable contains the path to Qt libraries if they were installed in a +version of the Qt installed, which you may need to remove. Or maybe you +installed it in a non-default location and configure can't find it there, +so please check that your PATH variable includes the path to the correct +qtconfig/pkg-config. Also check that your LD_LIBRARY_PATH or equivalent +variable contains the path to Qt libraries if they were installed in a non-default location. -* The simplest program +The simplest program {#qt_simple_app} ---------------------- Now create your super-application myfoo.cpp and compile anywhere with -g++ myfoo.cpp `wx-config --libs --cxxflags` -o myfoo + g++ myfoo.cpp `wx-config --libs --cxxflags` -o myfoo -* GUI libraries +GUI libraries {#qt_libs_ui} --------------- wxWidgets/Qt requires the Qt library to be installed on your system. It has to be a stable version, preferably Qt 5.2.1 or later. -* Building wxQT on Ubuntu +Building wxQT on Ubuntu {#qt_build_ubuntu} ------------------------- Install latest Qt5 packages (qt5-default). To build unit tests, libcppunit-dev is required. You will need to install other dependencies to compile wxWidgets -depending on the features you'll want to use (build-essential libjpeg-dev +depending on the features you'll want to use (build-essential libjpeg-dev libtiff5-dev ubuntu-restricted-extras freeglut3 freeglut3-dev libsdl1.2-dev libgstreamer-plugins-base0.10-dev) Then create a build directory, configure and compile: -mkdir bldqt5 -cd bldqt5 -../configure --with-qt --enable-debug -make -make samples + mkdir bldqt5 + cd bldqt5 + ../configure --with-qt --enable-debug + make + make samples If everything is ok, you can do the make install as specified before. Optionally, you can build and run Unit Tests: -cd tests -make -./test_gui + cd tests + make + ./test_gui -* Building wxQT, using qt-unified-XXX-online installer +Building wxQT, using qt-unified-XXX-online installer {#qt_build} ------------------------------------------------------ Download qt-unified-XXX-online installer from the qt website. @@ -100,56 +106,59 @@ restriction as above). The same build instructions apply, except that you need to explicitly pass to configure the Qt dir of the build intended to use as QT5_CUSTOM_DIR, i.e. -# for Linux: -../configure --with-qt --enable-debug QT5_CUSTOM_DIR=~/Qt/5.11.0/gcc_64 +for Linux: -# for Windows (ran from Git Bash, or any other Unix-like shell): -# (the syntax for the drive in the path is required by ar and ld) -../configure --with-qt --enable-debug QT5_CUSTOM_DIR=c:/Qt/5.11.0/mingw53_32 + ../configure --with-qt --enable-debug QT5_CUSTOM_DIR=~/Qt/5.11.0/gcc_64 -* Building wxGT on Android +for Windows (ran from Git Bash, or any other Unix-like shell): +(the syntax for the drive in the path is required by ar and ld) + + ../configure --with-qt --enable-debug QT5_CUSTOM_DIR=c:/Qt/5.11.0/mingw53_32 + +Building wxGT on Android {#qt_android} -------------------------- Download Android Native Development Kit (NDK), tandalone Android Software Development Kit (SDK), install them and perform the following instructions to prepare the cross-compilation tool-chain to (change NDK and other paths): -NDK=~/src/android-ndk-r9d -SDK=~/src/android-sdk-linux -export ANDROID_NDK_ROOT=$NDK -$NDK/build/tools/make-standalone-toolchain.sh \ - --toolchain=arm-linux-androideabi-4.8 --platform=android-9 \ - --install-dir=/tmp/ndk + NDK=~/src/android-ndk-r9d + SDK=~/src/android-sdk-linux + export ANDROID_NDK_ROOT=$NDK + $NDK/build/tools/make-standalone-toolchain.sh \ + --toolchain=arm-linux-androideabi-4.8 --platform=android-9 \ + --install-dir=/tmp/ndk -export PATH=/tmp/ndk/bin:$PATH -export CC=arm-linux-androideabi-gcc -export CXX=arm-linux-androideabi-g++ + export PATH=/tmp/ndk/bin:$PATH + export CC=arm-linux-androideabi-gcc + export CXX=arm-linux-androideabi-g++ Also, you'll need to download the Qt library bundle that matches your operating -system installed package (5.2.1 in this case installed in ~/src/qt, you'll need +system installed package (5.2.1 in this case installed in ~/src/qt, you'll need the android_armv5/ android_armv7/ android_x86/ pre-compiled folders to cross-compile for that architectures) -Then, create a build directory (under the wxWidgets folder), configure for +Then, create a build directory (under the wxWidgets folder), configure for Andrid (disable currently unsupported/uneeded features) and run make: -cd ~/src/wxWidgets -mkdir bldqt5droid -cd bldqt5droid -../configure --with-qt --enable-debug --build=x86_64-unknown-linux-gnu \ - --host=arm-linux-androideabi --disable-compat28 --disable-shared \ - --disable-arttango --enable-image --disable-dragimage --disable-sockets \ - --with-libtiff=no --without-opengl --disable-baseevtloop --disable-utf8 -make + cd ~/src/wxWidgets + mkdir bldqt5droid + cd bldqt5droid + ../configure --with-qt --enable-debug --build=x86_64-unknown-linux-gnu \ + --host=arm-linux-androideabi --disable-compat28 --disable-shared \ + --disable-arttango --enable-image --disable-dragimage --disable-sockets \ + --with-libtiff=no --without-opengl --disable-baseevtloop --disable-utf8 + make You can now compile and link your app against this build, and finally package it for Android using standard APK tools. -* Create your configuration +Create your configuration {#qt_config} --------------------------- Usage: + ./configure options If you want to use system's C and C++ compiler, @@ -168,13 +177,13 @@ subdirectory of your wxWidgets installation) as this allows you to have multiple configurations (for example, debug and release or GTK and Motif) simultaneously. -* Feature Options +Feature Options {#qt_feature_options} ----------------- When producing an executable that is linked statically with wxQt you'll be surprised at its immense size. This can sometimes be drastically reduced by removing features from wxWidgets that -are not used in your program. +are not used in your program. Please see the output of "./configure --help" for comprehensive list of all configurable options. @@ -182,10 +191,3 @@ of all configurable options. Apart from disabling certain features you can very often "strip" the program of its debugging information resulting in a significant reduction in size. - ----------------------- - -In the hope that it will be useful, - - The wxWidgets Team - diff --git a/docs/x11/install.txt b/docs/x11/install.md similarity index 77% rename from docs/x11/install.txt rename to docs/x11/install.md index 61d252b010..579bd88fc8 100644 --- a/docs/x11/install.txt +++ b/docs/x11/install.md @@ -1,6 +1,8 @@ -wxWidgets for X11 installation +wxWidgets for X11 installation {#plat_x11_install} ------------------------------ +[TOC] + IMPORTANT NOTE: If you experience problems installing, please re-read these @@ -13,7 +15,7 @@ IMPORTANT NOTE: using (including the beta) and what compiler on what system. One example: wxX11 2.8.0, gcc 2.95.4, Redhat 6.2 -First steps +First steps {#x11_first_steps} ----------- - Download wxX11-x.y.z.tgz, where x.y.z is the version number. @@ -34,38 +36,38 @@ First steps information about your platform and the (relevant part of) contents of config.log file). -COMPILING USING CONFIGURE +Compiling using configure {#x11_configure} ========================= -* The simplest case +The simplest case {#x11_simple} ------------------- If you compile wxWidgets on Linux for the first time and don't like to read install instructions just do (in the base dir): -> ./configure --with-x11 -> make -> su -> make install -> ldconfig -> exit + > ./configure --with-x11 + > make + > su + > make install + > ldconfig + > exit Afterwards you can continue with -> make -> su -> make install -> ldconfig -> exit + > make + > su + > make install + > ldconfig + > exit If you want to remove wxWidgets on Unix you can do this: -> su -> make uninstall -> ldconfig -> exit + > su + > make uninstall + > ldconfig + > exit -* The expert case +The expert case {#x11_expert} ----------------- If you want to do some more serious cross-platform programming with wxWidgets, @@ -80,25 +82,25 @@ that purpose. For building three versions (one GTK, one X11 and a debug version of the GTK source) you'd do this: -md buildx11 -cd buildx11 -../configure --with-x11 -make -cd .. + md buildx11 + cd buildx11 + ../configure --with-x11 + make + cd .. -md buildgtk -cd buildgtk -../configure --with-gtk -make -cd .. + md buildgtk + cd buildgtk + ../configure --with-gtk + make + cd .. -md buildgtkd -cd buildgtkd -../configure --with-gtk --enable-debug_flag -make -cd .. + md buildgtkd + cd buildgtkd + ../configure --with-gtk --enable-debug_flag + make + cd .. -* The simplest errors +The simplest errors {#x11_errors} --------------------- You get errors during compilation: The reason is that you probably have a @@ -108,18 +110,18 @@ GCC 2.95 or later. You get immediate segfault when starting any sample or application: This is either due to having compiled the library with different flags or options than -your program - typically you might have the __WXDEBUG__ option set for the +your program - typically you might have the `__WXDEBUG__` option set for the library but not for your program - or due to using a compiler with optimisation bugs. -* The simplest program +The simplest program {#x11_simple_app} ---------------------- Now create your super-application myfoo.cpp and compile anywhere with -g++ myfoo.cpp `wx-config --libs --cxxflags` -o myfoo + g++ myfoo.cpp `wx-config --libs --cxxflags` -o myfoo -* General +General {#x11_general} --------- The Unix variants of wxWidgets use GNU configure. If you have problems with @@ -127,19 +129,19 @@ your make use GNU make instead. If you have general problems with installation, see the wxWidgets website at - https://www.wxwidgets.org/ +https://www.wxwidgets.org/ for newest information. If you still don't have any success, please send a bug report to one of our mailing lists (see my homepage) INCLUDING A DESCRIPTION OF YOUR SYSTEM AND YOUR PROBLEM, SUCH AS YOUR VERSION OF X, WHAT DISTRIBUTION YOU USE AND WHAT ERROR WAS REPORTED. I know this has no effect, but I tried... -* GUI libraries +GUI libraries {#x11_libs_gui} --------------- wxWidgets/X11 requires the X11 library to be installed on your system. -* Additional libraries +Additional libraries {#x11_libs_misc} ---------------------- wxWidgets/X11 requires a thread library and X libraries known to work with @@ -150,14 +152,14 @@ many aspects. As of writing this, virtually all Linux distributions have You can disable thread support by running -./configure --disable-threads -make -su -make install -ldconfig -exit + ./configure --disable-threads + make + su + make install + ldconfig + exit -* Building wxX11 on Cygwin +Building wxX11 on Cygwin {#x11_cygwin} -------------------------- The normal build instructions should work fine on Cygwin. The one difference @@ -171,10 +173,11 @@ will see linking errors. If this happens then you can work around the problem by setting LDFLAGS=-Wl,--export-all-symbols. Please also let us know about it on the wx-dev mailing list. -* Create your configuration +Create your configuration {#x11_config} --------------------------- Usage: + ./configure [options] If you want to use system's C and C++ compiler, @@ -202,7 +205,7 @@ Configure will complain if the system variable OSTYPE has not been defined. And Make in some circumstances as well... -* General options +General options {#x11_options} ----------------- Given below are the commands to change the default behaviour, @@ -268,7 +271,7 @@ The following options handle the kind of library you want to build. must be compiled with the same debug options. -* Feature Options +Feature Options {#x11_feature_options} ----------------- Many of the configure options have been thoroughly tested @@ -320,7 +323,7 @@ Please see the output of "./configure --help" for comprehensive list of all configurable options. -* Compiling +Compiling {#x11_compiling} ----------- The following must be done in the base directory (e.g. ~/wxX11 @@ -356,44 +359,44 @@ object-files: in the various directories will do the work for you. -* Creating a new Project +Creating a new Project {#x11_new_app} ------------------------ -1) The first way uses the installed libraries and header files +1. The first way uses the installed libraries and header files automatically using wx-config -g++ myfoo.cpp `wx-config --libs` `wx-config --cxxflags` -o myfoo + g++ myfoo.cpp `wx-config --libs` `wx-config --cxxflags` -o myfoo -Using this way, a make file for the minimal sample would look -like this + Using this way, a make file for the minimal sample would look + like this -CXX = g++ + CXX = g++ -minimal: minimal.o - $(CXX) -o minimal minimal.o `wx-config --libs` + minimal: minimal.o + $(CXX) -o minimal minimal.o `wx-config --libs` -minimal.o: minimal.cpp - $(CXX) `wx-config --cxxflags` -c minimal.cpp -o minimal.o + minimal.o: minimal.cpp + $(CXX) `wx-config --cxxflags` -c minimal.cpp -o minimal.o -clean: - rm -f *.o minimal + clean: + rm -f *.o minimal -This is certain to become the standard way unless we decide -to stick to tmake. + This is certain to become the standard way unless we decide + to stick to tmake. -If your application uses only some of wxWidgets libraries, you can -specify required libraries when running wx-config. For example, -`wx-config --libs=html,core` will only output link command to link -with libraries required by core GUI classes and wxHTML classes. See -the manual for more information on the libraries. + If your application uses only some of wxWidgets libraries, you can + specify required libraries when running wx-config. For example, + `wx-config --libs=html,core` will only output link command to link + with libraries required by core GUI classes and wxHTML classes. See + the manual for more information on the libraries. -2) The other way creates a project within the source code +2. The other way creates a project within the source code directories of wxWidgets. For this endeavour, you'll need GNU autoconf version 2.14 and add an entry to your Makefile.in to the bottom of the configure.in script and run autoconf and configure before you can type make. -* Further notes by Julian Smart +Further notes by Julian Smart {#x11_notes} ------------------------------- - You may find the following script useful for compiling wxX11, @@ -401,25 +404,23 @@ and configure before you can type make. permissions). Make this script executable with the command chmod a+x makewxx11. - -------:x-----Cut here-----:x----- - # makewxx11 - # Sets permissions (in case we extracted wxX11 from zip files) - # and makes wxX11. - # Call from top-level wxWidgets directory. - # Note that this uses standard (but commonly-used) configure options; - # if you're feeling brave, you may wish to compile with threads: - # if they're not supported by the target platform, they will be disabled - # anyhow - # -- Julian Smart - chmod a+x configure config.sub config.guess - ./configure --with-x11 --with-shared --with-debug_flag --with-debug_info --enable-debug --without-threads --without-sockets --without-odbc - make - -------:x-----Cut here-----:x----- + # makewxx11 + # Sets permissions (in case we extracted wxX11 from zip files) + # and makes wxX11. + # Call from top-level wxWidgets directory. + # Note that this uses standard (but commonly-used) configure options; + # if you're feeling brave, you may wish to compile with threads: + # if they're not supported by the target platform, they will be disabled + # anyhow + # -- Julian Smart + chmod a+x configure config.sub config.guess + ./configure --with-x11 --with-shared --with-debug_flag --with-debug_info --enable-debug --without-threads --without-sockets --without-odbc + make This script will build wxX11 using shared libraries. If you want to build a static wxWidgets library, use --disable-shared. -Troubleshooting +Troubleshooting {#x11_troubleshooting} --------------- - Solaris compilation with gcc: if the compiler has problems with the variable @@ -437,7 +438,7 @@ Troubleshooting If you find any incorrect instances, though, such as a missing 'const' in an overridden function, please let us know. -Other Notes +Other Notes {#x11_misc_notes} ----------- - Debugging mode is switched on by default in the makefiles, but using @@ -448,11 +449,3 @@ Other Notes configure system, change --with-debug_flag to --without-debug_flag and --with-debug_info to --without-debug_info in the makewxx11 script). - -Bug reports ------------ - -Please send bug reports with a description of your environment, -compiler and the error message(s) to the developers mailing list at: - - https://www.wxwidgets.org/support/mailing-lists/ diff --git a/include/wx/chkconf.h b/include/wx/chkconf.h index 586680b307..82bb132b8a 100644 --- a/include/wx/chkconf.h +++ b/include/wx/chkconf.h @@ -2345,6 +2345,15 @@ # define wxUSE_STC 0 # endif # endif + +# if !wxUSE_SCROLLBAR +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxStyledTextCtrl requires wxUSE_SCROLLBAR" +# else +# undef wxUSE_STC +# define wxUSE_STC 0 +# endif +# endif #endif /* wxUSE_STC */ #if wxUSE_RICHTEXT diff --git a/include/wx/collpane.h b/include/wx/collpane.h index 54ccd73650..168dc7c06e 100644 --- a/include/wx/collpane.h +++ b/include/wx/collpane.h @@ -43,6 +43,23 @@ public: virtual wxString GetLabel() const wxOVERRIDE = 0; virtual void SetLabel(const wxString& label) wxOVERRIDE = 0; + + virtual bool + InformFirstDirection(int direction, + int size, + int availableOtherDir) wxOVERRIDE + { + wxWindow* const p = GetPane(); + if ( !p ) + return false; + + if ( !p->InformFirstDirection(direction, size, availableOtherDir) ) + return false; + + InvalidateBestSize(); + + return true; + } }; diff --git a/include/wx/colour.h b/include/wx/colour.h index aa50b349ec..7565f09162 100644 --- a/include/wx/colour.h +++ b/include/wx/colour.h @@ -118,6 +118,9 @@ public: virtual ChannelType Blue() const = 0; virtual ChannelType Alpha() const { return wxALPHA_OPAQUE ; } + + virtual bool IsSolid() const + { return true; } // implemented in colourcmn.cpp virtual wxString GetAsString(long flags = wxC2S_NAME | wxC2S_CSS_SYNTAX) const; diff --git a/include/wx/dcsvg.h b/include/wx/dcsvg.h index 488d0c3057..0c4fdd575a 100644 --- a/include/wx/dcsvg.h +++ b/include/wx/dcsvg.h @@ -86,10 +86,12 @@ public: virtual wxCoord GetCharHeight() const wxOVERRIDE; virtual wxCoord GetCharWidth() const wxOVERRIDE; +#if wxUSE_PALETTE virtual void SetPalette(const wxPalette& WXUNUSED(palette)) wxOVERRIDE { wxFAIL_MSG(wxT("wxSVGFILEDC::SetPalette not implemented")); } +#endif virtual void SetLogicalFunction(wxRasterOperationMode WXUNUSED(function)) wxOVERRIDE { diff --git a/include/wx/defs.h b/include/wx/defs.h index c47e26ad79..27b175f910 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -2607,12 +2607,14 @@ typedef void* WXDisplay; typedef const void * CFTypeRef; -/* typedef const struct __CFString * CFStringRef; */ - +DECLARE_WXOSX_OPAQUE_CONST_CFREF( CFData ) DECLARE_WXOSX_OPAQUE_CONST_CFREF( CFString ) typedef struct __CFString * CFMutableStringRef; DECLARE_WXOSX_OPAQUE_CONST_CFREF( CFDictionary ) +DECLARE_WXOSX_OPAQUE_CONST_CFREF( CFArray ) +typedef struct __CFArray * CFMutableArrayRef; + DECLARE_WXOSX_OPAQUE_CFREF( CFRunLoopSource ) DECLARE_WXOSX_OPAQUE_CONST_CFREF( CTFont ) DECLARE_WXOSX_OPAQUE_CONST_CFREF( CTFontDescriptor ) @@ -2645,7 +2647,7 @@ DECLARE_WXMAC_OPAQUE_REF( MenuRef ) typedef IconRef WXHICON ; typedef HIShapeRef WXHRGN; -#endif +#endif // __WXMAC__ #if defined(__WXMAC__) @@ -2712,6 +2714,13 @@ typedef struct objc_object *WX_##klass #endif /* (defined(__GNUC__) && defined(__APPLE__)) */ +DECLARE_WXCOCOA_OBJC_CLASS(NSArray); +DECLARE_WXCOCOA_OBJC_CLASS(NSData); +DECLARE_WXCOCOA_OBJC_CLASS(NSMutableArray); +DECLARE_WXCOCOA_OBJC_CLASS(NSString); + +#if wxOSX_USE_COCOA + DECLARE_WXCOCOA_OBJC_CLASS(NSApplication); DECLARE_WXCOCOA_OBJC_CLASS(NSBitmapImageRep); DECLARE_WXCOCOA_OBJC_CLASS(NSBox); @@ -2729,7 +2738,6 @@ DECLARE_WXCOCOA_OBJC_CLASS(NSLayoutManager); DECLARE_WXCOCOA_OBJC_CLASS(NSMenu); DECLARE_WXCOCOA_OBJC_CLASS(NSMenuExtra); DECLARE_WXCOCOA_OBJC_CLASS(NSMenuItem); -DECLARE_WXCOCOA_OBJC_CLASS(NSMutableArray); DECLARE_WXCOCOA_OBJC_CLASS(NSNotification); DECLARE_WXCOCOA_OBJC_CLASS(NSObject); DECLARE_WXCOCOA_OBJC_CLASS(NSPanel); @@ -2747,20 +2755,14 @@ DECLARE_WXCOCOA_OBJC_CLASS(NSWindow); DECLARE_WXCOCOA_OBJC_CLASS(NSView); DECLARE_WXCOCOA_OBJC_CLASS(NSOpenGLContext); DECLARE_WXCOCOA_OBJC_CLASS(NSOpenGLPixelFormat); -DECLARE_WXCOCOA_OBJC_CLASS( NSPrintInfo ); +DECLARE_WXCOCOA_OBJC_CLASS(NSPrintInfo); DECLARE_WXCOCOA_OBJC_CLASS(NSGestureRecognizer); DECLARE_WXCOCOA_OBJC_CLASS(NSPanGestureRecognizer); DECLARE_WXCOCOA_OBJC_CLASS(NSMagnificationGestureRecognizer); DECLARE_WXCOCOA_OBJC_CLASS(NSRotationGestureRecognizer); DECLARE_WXCOCOA_OBJC_CLASS(NSPressGestureRecognizer); DECLARE_WXCOCOA_OBJC_CLASS(NSTouch); -#endif /* __WXMAC__ &__DARWIN__ */ - -#ifdef __WXMAC__ - -DECLARE_WXCOCOA_OBJC_CLASS(NSString); - -#if wxOSX_USE_COCOA +DECLARE_WXCOCOA_OBJC_CLASS(NSPasteboard); typedef WX_NSWindow WXWindow; typedef WX_NSView WXWidget; @@ -2768,6 +2770,7 @@ typedef WX_NSImage WXImage; typedef WX_NSMenu WXHMENU; typedef WX_NSOpenGLPixelFormat WXGLPixelFormat; typedef WX_NSOpenGLContext WXGLContext; +typedef WX_NSPasteboard OSXPasteboard; #elif wxOSX_USE_IPHONE @@ -2780,6 +2783,7 @@ DECLARE_WXCOCOA_OBJC_CLASS(UIEvent); DECLARE_WXCOCOA_OBJC_CLASS(NSSet); DECLARE_WXCOCOA_OBJC_CLASS(EAGLContext); DECLARE_WXCOCOA_OBJC_CLASS(UIWebView); +DECLARE_WXCOCOA_OBJC_CLASS(UIPasteboard); typedef WX_UIWindow WXWindow; typedef WX_UIView WXWidget; @@ -2787,6 +2791,7 @@ typedef WX_UIImage WXImage; typedef WX_EAGLContext WXGLContext; typedef WX_NSString WXGLPixelFormat; typedef WX_UIWebView OSXWebViewPtr; +typedef WX_UIPasteboard OSXPasteboard; #endif diff --git a/include/wx/display.h b/include/wx/display.h index 4678672138..af299a74e0 100644 --- a/include/wx/display.h +++ b/include/wx/display.h @@ -10,6 +10,9 @@ #ifndef _WX_DISPLAY_H_BASE_ #define _WX_DISPLAY_H_BASE_ +#include "wx/defs.h" +#include "wx/gdicmn.h" // wxSize + // NB: no #if wxUSE_DISPLAY here, the display geometry part of this class (but // not the video mode stuff) is always available but if wxUSE_DISPLAY == 0 // it becomes just a trivial wrapper around the old wxDisplayXXX() functions @@ -48,7 +51,6 @@ public: // dtor is not virtual as this is a concrete class not meant to be derived // from - ~wxDisplay(); // return the number of available displays, valid parameters to @@ -73,6 +75,12 @@ public: // get the client area of the display, i.e. without taskbars and such wxRect GetClientArea() const; + // get the depth, i.e. number of bits per pixel (0 if unknown) + int GetDepth() const; + + // get the resolution of this monitor in pixels per inch + wxSize GetPPI() const; + // name may be empty wxString GetName() const; diff --git a/include/wx/gdicmn.h b/include/wx/gdicmn.h index f7d39c017b..e415f1c115 100644 --- a/include/wx/gdicmn.h +++ b/include/wx/gdicmn.h @@ -1080,6 +1080,9 @@ extern WXDLLIMPEXP_DATA_CORE(const wxPoint) wxDefaultPosition; extern void WXDLLIMPEXP_CORE wxInitializeStockLists(); extern void WXDLLIMPEXP_CORE wxDeleteStockLists(); +// Note: all the display-related functions here exist for compatibility only, +// please use wxDisplay class in the new code + // is the display colour (or monochrome)? extern bool WXDLLIMPEXP_CORE wxColourDisplay(); diff --git a/include/wx/generic/dcpsg.h b/include/wx/generic/dcpsg.h index 972f533475..84f9e6690e 100644 --- a/include/wx/generic/dcpsg.h +++ b/include/wx/generic/dcpsg.h @@ -79,7 +79,9 @@ public: virtual void ComputeScaleAndOrigin() wxOVERRIDE; void SetBackgroundMode(int WXUNUSED(mode)) wxOVERRIDE { } +#if wxUSE_PALETTE void SetPalette(const wxPalette& WXUNUSED(palette)) wxOVERRIDE { } +#endif void SetPrintData(const wxPrintData& data); wxPrintData& GetPrintData() { return m_printData; } diff --git a/include/wx/generic/imaglist.h b/include/wx/generic/imaglist.h index f87e19b43c..a3189e4b5a 100644 --- a/include/wx/generic/imaglist.h +++ b/include/wx/generic/imaglist.h @@ -10,10 +10,11 @@ #ifndef _WX_IMAGLISTG_H_ #define _WX_IMAGLISTG_H_ +#include "wx/bitmap.h" #include "wx/gdicmn.h" +#include "wx/vector.h" class WXDLLIMPEXP_FWD_CORE wxDC; -class WXDLLIMPEXP_FWD_CORE wxBitmap; class WXDLLIMPEXP_FWD_CORE wxIcon; class WXDLLIMPEXP_FWD_CORE wxColour; @@ -21,23 +22,23 @@ class WXDLLIMPEXP_FWD_CORE wxColour; class WXDLLIMPEXP_CORE wxGenericImageList: public wxObject { public: - wxGenericImageList() { m_width = m_height = 0; } + wxGenericImageList() { } wxGenericImageList( int width, int height, bool mask = true, int initialCount = 1 ); virtual ~wxGenericImageList(); bool Create( int width, int height, bool mask = true, int initialCount = 1 ); - bool Create(); virtual int GetImageCount() const; virtual bool GetSize( int index, int &width, int &height ) const; - virtual wxSize GetSize() const { return wxSize(m_width, m_height); } + virtual wxSize GetSize() const { return m_size; } int Add( const wxBitmap& bitmap ); int Add( const wxBitmap& bitmap, const wxBitmap& mask ); int Add( const wxBitmap& bitmap, const wxColour& maskColour ); wxBitmap GetBitmap(int index) const; wxIcon GetIcon(int index) const; - bool Replace( int index, const wxBitmap &bitmap ); - bool Replace( int index, const wxBitmap &bitmap, const wxBitmap& mask ); + bool Replace( int index, + const wxBitmap& bitmap, + const wxBitmap& mask = wxNullBitmap ); bool Remove( int index ); bool RemoveAll(); @@ -45,13 +46,21 @@ public: int flags = wxIMAGELIST_DRAW_NORMAL, bool solidBackground = false); - // Internal use only - const wxBitmap *GetBitmapPtr(int index) const; -private: - wxObjectList m_images; +#if WXWIN_COMPATIBILITY_3_0 + wxDEPRECATED_MSG("Don't use this overload: it's not portable and does nothing") + bool Create() { return true; } - int m_width; - int m_height; + wxDEPRECATED_MSG("Use GetBitmap() instead") + const wxBitmap *GetBitmapPtr(int index) const { return DoGetPtr(index); } +#endif // WXWIN_COMPATIBILITY_3_0 + +private: + const wxBitmap *DoGetPtr(int index) const; + + wxVector m_images; + + // Size of a single bitmap in the list. + wxSize m_size; wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxGenericImageList); }; diff --git a/include/wx/generic/wizard.h b/include/wx/generic/wizard.h index 7b820a4f26..2b512ec5e3 100644 --- a/include/wx/generic/wizard.h +++ b/include/wx/generic/wizard.h @@ -132,6 +132,10 @@ protected: *m_btnNext; // the "Next>" or "Finish" button wxStaticBitmap *m_statbmp; // the control for the bitmap + // cached labels so their translations stay consistent + wxString m_nextLabel, + m_finishLabel; + // Border around page area sizer requested using SetBorder() int m_border; diff --git a/include/wx/gtk/dataview.h b/include/wx/gtk/dataview.h index c6724e7e97..77a06dc6e6 100644 --- a/include/wx/gtk/dataview.h +++ b/include/wx/gtk/dataview.h @@ -185,6 +185,12 @@ public: // failed. wxDataViewItem GTKPathToItem(struct _GtkTreePath *path) const; + // Return wxDataViewColumn matching the given GtkTreeViewColumn. + // + // If the input argument is NULL, return NULL too. Otherwise we must find + // the matching column and assert if we didn't. + wxDataViewColumn* GTKColumnToWX(GtkTreeViewColumn *gtk_col) const; + virtual void OnInternalIdle() wxOVERRIDE; int GTKGetUniformRowHeight() const { return m_uniformRowHeight; } @@ -222,12 +228,6 @@ private: virtual wxDataViewItem DoGetCurrentItem() const wxOVERRIDE; virtual void DoSetCurrentItem(const wxDataViewItem& item) wxOVERRIDE; - // Return wxDataViewColumn matching the given GtkTreeViewColumn. - // - // If the input argument is NULL, return NULL too. Otherwise we must find - // the matching column and assert if we didn't. - wxDataViewColumn* FromGTKColumn(GtkTreeViewColumn *gtk_col) const; - friend class wxDataViewCtrlDCImpl; friend class wxDataViewColumn; friend class wxDataViewCtrlInternal; diff --git a/include/wx/gtk/print.h b/include/wx/gtk/print.h index 66e42100f3..5c54286eb3 100644 --- a/include/wx/gtk/print.h +++ b/include/wx/gtk/print.h @@ -245,7 +245,9 @@ public: wxSize GetPPI() const wxOVERRIDE; virtual int GetDepth() const wxOVERRIDE { return 24; } void SetBackgroundMode(int mode) wxOVERRIDE; +#if wxUSE_PALETTE void SetPalette(const wxPalette& WXUNUSED(palette)) wxOVERRIDE { } +#endif void SetResolution(int ppi); // overridden for wxPrinterDC Impl diff --git a/include/wx/gtk/private/stylecontext.h b/include/wx/gtk/private/stylecontext.h index a81ac3823e..229b4f29a8 100644 --- a/include/wx/gtk/private/stylecontext.h +++ b/include/wx/gtk/private/stylecontext.h @@ -15,7 +15,7 @@ class wxGtkStyleContext { public: - wxGtkStyleContext(); + explicit wxGtkStyleContext(double scale = 1); ~wxGtkStyleContext(); wxGtkStyleContext& Add(GType type, const char* objectName, ...) G_GNUC_NULL_TERMINATED; wxGtkStyleContext& Add(const char* objectName); @@ -38,6 +38,7 @@ public: private: GtkStyleContext* m_context; GtkWidgetPath* const m_path; + const int m_scale; wxDECLARE_NO_COPY_CLASS(wxGtkStyleContext); }; diff --git a/include/wx/gtk/textentry.h b/include/wx/gtk/textentry.h index e55fad8d4c..757917e5a8 100644 --- a/include/wx/gtk/textentry.h +++ b/include/wx/gtk/textentry.h @@ -84,7 +84,7 @@ protected: // Override the base class method to use GtkEntry IM context. virtual int GTKIMFilterKeypress(GdkEventKey* event) const; - static unsigned int GTKGetEntryTextLength(GtkEntry* entry); + static int GTKGetEntryTextLength(GtkEntry* entry); private: // implement this to return the associated GtkEntry or another widget diff --git a/include/wx/hyperlink.h b/include/wx/hyperlink.h index 237dadca85..072c05efd3 100644 --- a/include/wx/hyperlink.h +++ b/include/wx/hyperlink.h @@ -76,6 +76,9 @@ protected: void CheckParams(const wxString& label, const wxString& url, long style); public: + // Send wxHyperlinkEvent and open our link in the default browser if it + // wasn't handled. + // // not part of the public API but needs to be public as used by // GTK+ callbacks: void SendEvent(); diff --git a/include/wx/imaglist.h b/include/wx/imaglist.h index d625eff324..5fd6a9f9a3 100644 --- a/include/wx/imaglist.h +++ b/include/wx/imaglist.h @@ -41,16 +41,11 @@ enum #define wxIMAGELIST_DRAW_SELECTED 0x0004 #define wxIMAGELIST_DRAW_FOCUSED 0x0008 -#if defined(__WXMSW__) || defined(__WXMAC__) - #define wxHAS_NATIVE_IMAGELIST -#endif - -#if !defined(wxHAS_NATIVE_IMAGELIST) - #include "wx/generic/imaglist.h" -#elif defined(__WXMSW__) +#if defined(__WXMSW__) #include "wx/msw/imaglist.h" -#elif defined(__WXMAC__) - #include "wx/osx/imaglist.h" + #define wxHAS_NATIVE_IMAGELIST +#else + #include "wx/generic/imaglist.h" #endif #endif // _WX_IMAGLIST_H_BASE_ diff --git a/include/wx/msw/enhmeta.h b/include/wx/msw/enhmeta.h index 74c65ddb2c..bd6c5f729e 100644 --- a/include/wx/msw/enhmeta.h +++ b/include/wx/msw/enhmeta.h @@ -11,6 +11,10 @@ #ifndef _WX_MSW_ENHMETA_H_ #define _WX_MSW_ENHMETA_H_ +#include "wx/defs.h" + +#if wxUSE_ENH_METAFILE + #include "wx/dc.h" #include "wx/gdiobj.h" @@ -192,4 +196,6 @@ protected: #endif // wxUSE_DATAOBJ +#endif // wxUSE_ENH_METAFILE + #endif // _WX_MSW_ENHMETA_H_ diff --git a/include/wx/msw/popupwin.h b/include/wx/msw/popupwin.h index 5ac4a09c03..d41dda58e5 100644 --- a/include/wx/msw/popupwin.h +++ b/include/wx/msw/popupwin.h @@ -18,25 +18,28 @@ class WXDLLIMPEXP_CORE wxPopupWindow : public wxPopupWindowBase { public: - wxPopupWindow() { } + wxPopupWindow() { m_owner = NULL; } wxPopupWindow(wxWindow *parent, int flags = wxBORDER_NONE) { (void)Create(parent, flags); } bool Create(wxWindow *parent, int flags = wxBORDER_NONE); - virtual void SetFocus() wxOVERRIDE; virtual bool Show(bool show = true) wxOVERRIDE; // return the style to be used for the popup windows virtual WXDWORD MSWGetStyle(long flags, WXDWORD *exstyle) const wxOVERRIDE; - // get the HWND to be used as parent of this window with CreateWindow() - virtual WXHWND MSWGetParent() const wxOVERRIDE; -protected: + // Implementation only from now on. + + // Return the top level window parent of this popup or null. + wxWindow* MSWGetOwner() const { return m_owner; } + +private: + wxWindow* m_owner; + wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxPopupWindow); }; #endif // _WX_MSW_POPUPWIN_H_ - diff --git a/include/wx/osx/choice.h b/include/wx/osx/choice.h index e261782ef6..4ef0b6b3aa 100644 --- a/include/wx/osx/choice.h +++ b/include/wx/osx/choice.h @@ -91,7 +91,6 @@ protected: wxArrayString m_strings; wxChoiceDataArray m_datas ; - wxMenu* m_popUpMenu ; private: // This should be called when the number of items in the control changes. diff --git a/include/wx/osx/cocoa/chkconf.h b/include/wx/osx/cocoa/chkconf.h index aac5d4925e..5cc104b02d 100644 --- a/include/wx/osx/cocoa/chkconf.h +++ b/include/wx/osx/cocoa/chkconf.h @@ -40,6 +40,13 @@ */ #define wxHAVE_FSEVENTS_FILE_NOTIFICATIONS 1 +/* + * turn off old style icon format if not asked for + */ +#ifndef wxOSX_USE_ICONREF + #define wxOSX_USE_ICONREF 0 +#endif + /* * turning off capabilities that don't work under cocoa yet */ diff --git a/include/wx/osx/cocoa/private.h b/include/wx/osx/cocoa/private.h index de91d02245..18267fda31 100644 --- a/include/wx/osx/cocoa/private.h +++ b/include/wx/osx/cocoa/private.h @@ -41,7 +41,6 @@ WX_NSImage WXDLLIMPEXP_CORE wxOSXGetNSImageFromCGImage( CGImageRef image, double WX_NSImage WXDLLIMPEXP_CORE wxOSXGetNSImageFromIconRef( WXHICON iconref ); WX_NSImage WXDLLIMPEXP_CORE wxOSXGetIconForType(OSType type ); void WXDLLIMPEXP_CORE wxOSXSetImageSize(WX_NSImage image, CGFloat width, CGFloat height); -double WXDLLIMPEXP_CORE wxOSXGetImageScaleFactor(WXImage image); wxBitmap WXDLLIMPEXP_CORE wxOSXCreateSystemBitmap(const wxString& id, const wxString &client, const wxSize& size); WXWindow WXDLLIMPEXP_CORE wxOSXGetMainWindow(); WXWindow WXDLLIMPEXP_CORE wxOSXGetKeyWindow(); diff --git a/include/wx/osx/core/cfarray.h b/include/wx/osx/core/cfarray.h index 1b58597bf0..2a5e215904 100644 --- a/include/wx/osx/core/cfarray.h +++ b/include/wx/osx/core/cfarray.h @@ -53,6 +53,8 @@ public: return wxCFRefFromGet((E)CFArrayGetValueAtIndex(this->m_ptr, idx)); } + operator WX_NSArray() { return (WX_NSArray) this->get(); } + wxCFRef operator[](size_type idx) { return at(idx); } wxCFRef front() { return at(0); } wxCFRef back() { return at(size() - 1); } diff --git a/include/wx/osx/core/cfdictionary.h b/include/wx/osx/core/cfdictionary.h index fddbb52654..d27c0f5891 100644 --- a/include/wx/osx/core/cfdictionary.h +++ b/include/wx/osx/core/cfdictionary.h @@ -90,6 +90,11 @@ public: { return CFDictionaryCreateCopy(kCFAllocatorDefault, this->m_ptr); } + + CFMutableDictionaryRef CreateMutableCopy() const + { + return CFDictionaryCreateMutableCopy(kCFAllocatorDefault, 0, this->m_ptr); + } }; class wxCFMutableDictionaryRef : public wxCFDictionaryRefCommon diff --git a/include/wx/osx/core/colour.h b/include/wx/osx/core/colour.h index b862332173..d3b6ec4eb6 100644 --- a/include/wx/osx/core/colour.h +++ b/include/wx/osx/core/colour.h @@ -34,6 +34,8 @@ public: virtual ChannelType Blue() const wxOVERRIDE; virtual ChannelType Alpha() const wxOVERRIDE; + virtual bool IsSolid() const wxOVERRIDE; + wxColour& operator=(const wxColour& col); // comparison @@ -90,7 +92,10 @@ public: virtual CGFloat Green() const = 0; virtual CGFloat Blue() const = 0; virtual CGFloat Alpha() const = 0; - + + virtual bool IsSolid() const + { return true; } + virtual CGColorRef GetCGColor() const = 0; virtual wxColourRefData* Clone() const = 0; diff --git a/include/wx/osx/core/private.h b/include/wx/osx/core/private.h index b9cffaa443..af0657ce8f 100644 --- a/include/wx/osx/core/private.h +++ b/include/wx/osx/core/private.h @@ -119,6 +119,7 @@ CGImageRef WXDLLIMPEXP_CORE wxOSXCreateCGImageFromImage( WXImage nsimage, double CGImageRef WXDLLIMPEXP_CORE wxOSXGetCGImageFromImage( WXImage nsimage, CGRect* r, CGContextRef cg); CGContextRef WXDLLIMPEXP_CORE wxOSXCreateBitmapContextFromImage( WXImage nsimage, bool *isTemplate = NULL); WXImage WXDLLIMPEXP_CORE wxOSXGetImageFromCGImage( CGImageRef image, double scale = 1.0, bool isTemplate = false); +double WXDLLIMPEXP_CORE wxOSXGetImageScaleFactor(WXImage image); class wxWindowMac; @@ -557,6 +558,15 @@ public : long extraStyle); #endif + static wxWidgetImplType* CreateStaticBitmap( wxWindowMac* wxpeer, + wxWindowMac* parent, + wxWindowID id, + const wxBitmap& bitmap, + const wxPoint& pos, + const wxSize& size, + long style, + long extraStyle); + // converts from Toplevel-Content relative to local static void Convert( wxPoint *pt , wxWidgetImpl *from , wxWidgetImpl *to ); protected : @@ -716,7 +726,7 @@ private: wxDECLARE_NO_COPY_CLASS(wxTextWidgetImpl); }; -// common interface for all implementations +// common interface for all combobox implementations class WXDLLIMPEXP_CORE wxComboWidgetImpl { @@ -743,6 +753,41 @@ public : virtual int FindString(const wxString& WXUNUSED(text)) const { return -1; } }; +// +// common interface for choice +// + +class WXDLLIMPEXP_CORE wxChoiceWidgetImpl + +{ +public : + wxChoiceWidgetImpl() {} + + virtual ~wxChoiceWidgetImpl() {} + + virtual int GetSelectedItem() const { return -1; } + + virtual void SetSelectedItem(int WXUNUSED(item)) {} + + virtual size_t GetNumberOfItems() const = 0; + + virtual void InsertItem(size_t pos, int itemid, const wxString& text) = 0; + + virtual void RemoveItem(size_t pos) = 0; + + virtual void Clear() + { + size_t count = GetNumberOfItems(); + for ( size_t i = 0 ; i < count ; i++ ) + { + RemoveItem( 0 ); + } + } + + virtual void SetItem(int pos, const wxString& item) = 0; +}; + + // // common interface for buttons // diff --git a/include/wx/osx/icon.h b/include/wx/osx/icon.h deleted file mode 100644 index bc493392db..0000000000 --- a/include/wx/osx/icon.h +++ /dev/null @@ -1,106 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/osx/icon.h -// Purpose: wxIcon class -// Author: Stefan Csomor -// Modified by: -// Created: 1998-01-01 -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_ICON_H_ -#define _WX_ICON_H_ - -#include "wx/bitmap.h" - -// Icon -class WXDLLIMPEXP_CORE wxIcon : public wxGDIObject -{ -public: - wxIcon(); - - wxIcon(const char* const* data); - wxIcon(const char bits[], int width , int height ); - wxIcon(const wxString& name, wxBitmapType flags = wxICON_DEFAULT_TYPE, - int desiredWidth = -1, int desiredHeight = -1); - wxIcon(const wxIconLocation& loc) - { - LoadFile(loc.GetFileName(), wxBITMAP_TYPE_ICON); - } - - wxIcon(WXHICON icon, const wxSize& size); - - virtual ~wxIcon(); - - bool LoadFile(const wxString& name, wxBitmapType flags = wxICON_DEFAULT_TYPE, - int desiredWidth = -1, int desiredHeight = -1); - - - // create from bitmap (which should have a mask unless it's monochrome): - // there shouldn't be any implicit bitmap -> icon conversion (i.e. no - // ctors, assignment operators...), but it's ok to have such function - void CopyFromBitmap(const wxBitmap& bmp); - - int GetWidth() const; - int GetHeight() const; - int GetDepth() const; -#if WXWIN_COMPATIBILITY_3_0 - wxDEPRECATED_MSG("this value is determined during creation, this method could lead to inconsistencies") - void SetWidth(int width); - wxDEPRECATED_MSG("this value is determined during creation, this method could lead to inconsistencies") - void SetHeight(int height); - wxDEPRECATED_MSG("this value is determined during creation, this method could lead to inconsistencies") - void SetDepth(int depth); -#endif - - wxSize GetSize() const { return wxSize(GetWidth(), GetHeight()); } - -#if wxOSX_USE_ICONREF - WXHICON GetHICON() const; -#endif - -#if wxOSX_USE_COCOA - WX_NSImage GetNSImage() const ; -#endif - -protected: - virtual wxGDIRefData *CreateGDIRefData() const; - virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const; - -private: - wxDECLARE_DYNAMIC_CLASS(wxIcon); - - bool LoadIconFromSystemResource(const wxString& resourceName, int desiredWidth, int desiredHeight); - bool LoadIconFromBundleResource(const wxString& resourceName, int desiredWidth, int desiredHeight); - bool LoadIconFromFile(const wxString& filename, int desiredWidth, int desiredHeight); - bool LoadIconAsBitmap(const wxString& filename, wxBitmapType flags = wxICON_DEFAULT_TYPE, int desiredWidth = -1, int desiredHeight = -1); -}; - -class WXDLLIMPEXP_CORE wxICONResourceHandler: public wxBitmapHandler -{ -public: - wxICONResourceHandler() - { - SetName(wxT("ICON resource")); - SetExtension(wxEmptyString); - SetType(wxBITMAP_TYPE_ICON_RESOURCE); - } - - virtual bool LoadFile(wxBitmap *bitmap, - const wxString& name, - wxBitmapType flags, - int desiredWidth = -1, - int desiredHeight = -1); - - // unhide the base class virtual - virtual bool LoadFile(wxBitmap *bitmap, - const wxString& name, - wxBitmapType flags) - { return LoadFile(bitmap, name, flags, -1, -1); } - -private: - wxDECLARE_DYNAMIC_CLASS(wxICONResourceHandler); -}; - -#endif - // _WX_ICON_H_ diff --git a/include/wx/osx/imaglist.h b/include/wx/osx/imaglist.h deleted file mode 100644 index 0173832e75..0000000000 --- a/include/wx/osx/imaglist.h +++ /dev/null @@ -1,61 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/osx/imaglist.h -// Purpose: -// Author: Robert Roebling, Stefan Csomor -// Created: 01/02/97 -// Id: -// Copyright: (c) 1998 Robert Roebling and Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_IMAGLIST_H_ -#define _WX_IMAGLIST_H_ - -#include "wx/defs.h" -#include "wx/list.h" -#include "wx/icon.h" - -class WXDLLIMPEXP_FWD_CORE wxDC; -class WXDLLIMPEXP_FWD_CORE wxBitmap; -class WXDLLIMPEXP_FWD_CORE wxColour; - -class WXDLLIMPEXP_CORE wxImageList: public wxObject -{ -public: - wxImageList() { m_width = m_height = 0; } - wxImageList( int width, int height, bool mask = true, int initialCount = 1 ); - virtual ~wxImageList(); - bool Create( int width, int height, bool mask = true, int initialCount = 1 ); - bool Create(); - - virtual int GetImageCount() const; - virtual bool GetSize( int index, int &width, int &height ) const; - virtual wxSize GetSize() const { return wxSize(m_width, m_height); } - - int Add( const wxIcon& bitmap ); - int Add( const wxBitmap& bitmap ); - int Add( const wxBitmap& bitmap, const wxBitmap& mask ); - int Add( const wxBitmap& bitmap, const wxColour& maskColour ); - wxBitmap GetBitmap(int index) const; - wxIcon GetIcon(int index) const; - bool Replace( int index, const wxIcon &bitmap ); - bool Replace( int index, const wxBitmap &bitmap ); - bool Replace( int index, const wxBitmap &bitmap, const wxBitmap &mask ); - bool Remove( int index ); - bool RemoveAll(); - - virtual bool Draw(int index, wxDC& dc, int x, int y, - int flags = wxIMAGELIST_DRAW_NORMAL, - bool solidBackground = false); - -private: - wxList m_images; - - int m_width; - int m_height; - - wxDECLARE_DYNAMIC_CLASS(wxImageList); -}; - -#endif // _WX_IMAGLIST_H_ - diff --git a/include/wx/osx/iphone/chkconf.h b/include/wx/osx/iphone/chkconf.h index a87d8e876f..9f313759d9 100644 --- a/include/wx/osx/iphone/chkconf.h +++ b/include/wx/osx/iphone/chkconf.h @@ -377,6 +377,11 @@ #define wxUSE_SECRETSTORE 0 #endif +// IconRef datatype does not exist on iOS + +#undef wxOSX_USE_ICONREF +#define wxOSX_USE_ICONREF 0 + #endif /* _WX_OSX_IPHONE_CHKCONF_H_ */ diff --git a/include/wx/osx/setup_inc.h b/include/wx/osx/setup_inc.h index 45dad65ca7..f1ad88dd74 100644 --- a/include/wx/osx/setup_inc.h +++ b/include/wx/osx/setup_inc.h @@ -60,3 +60,10 @@ // make sure we have the proper dispatcher for the console event loop #define wxUSE_SELECT_DISPATCHER 1 #define wxUSE_EPOLL_DISPATCHER 0 + +// set to 1 if you have older code that still needs icon refs +#define wxOSX_USE_ICONREF 0 + +// set to 0 if you have code that has problems with the new bitmap implementation +#define wxOSX_BITMAP_NATIVE_ACCESS 1 + diff --git a/include/wx/osx/statbmp.h b/include/wx/osx/statbmp.h index 45d1f3c9d5..4ba4e069d0 100644 --- a/include/wx/osx/statbmp.h +++ b/include/wx/osx/statbmp.h @@ -1,2 +1,64 @@ -#define wxGenericStaticBitmap wxStaticBitmap -#include "wx/generic/statbmpg.h" +#ifndef _WX_STATBMP_H_ +#define _WX_STATBMP_H_ + +#include "wx/statbmp.h" + +class WXDLLIMPEXP_CORE wxStaticBitmap : public wxStaticBitmapBase +{ +public: + wxStaticBitmap() {} + wxStaticBitmap(wxWindow *parent, + wxWindowID id, + const wxBitmap& bitmap, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = 0, + const wxString& name = wxStaticBitmapNameStr) + { + Create(parent, id, bitmap, pos, size, style, name); + } + + bool Create(wxWindow *parent, + wxWindowID id, + const wxBitmap& bitmap, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = 0, + const wxString& name = wxStaticBitmapNameStr); + + virtual void SetBitmap(const wxBitmap& bitmap) wxOVERRIDE; + + virtual wxBitmap GetBitmap() const wxOVERRIDE { return m_bitmap; } + + virtual void SetIcon(const wxIcon& icon) wxOVERRIDE + { + wxBitmap bmp; + bmp.CopyFromIcon(icon); + SetBitmap(bmp); + } + +#if defined(__WXGTK20__) || defined(__WXMAC__) + // icons and bitmaps are really the same thing in wxGTK and wxMac + wxIcon GetIcon() const wxOVERRIDE { return (const wxIcon &)m_bitmap; } +#endif + + virtual void SetScaleMode(ScaleMode scaleMode) wxOVERRIDE; + + virtual ScaleMode GetScaleMode() const wxOVERRIDE { return m_scaleMode; } + +private: + wxSize GetBitmapSize() + { + return m_bitmap.IsOk() ? m_bitmap.GetScaledSize() + : wxSize(16, 16); // this is completely arbitrary + } + + void OnPaint(wxPaintEvent& event); + + wxBitmap m_bitmap; + ScaleMode m_scaleMode; + + wxDECLARE_DYNAMIC_CLASS(wxStaticBitmap); +}; + +#endif diff --git a/include/wx/osx/window.h b/include/wx/osx/window.h index caee9c1659..b192b44b47 100644 --- a/include/wx/osx/window.h +++ b/include/wx/osx/window.h @@ -91,7 +91,8 @@ public: virtual bool SetForegroundColour( const wxColour &colour ) wxOVERRIDE; virtual bool SetBackgroundStyle(wxBackgroundStyle style) wxOVERRIDE; - + virtual bool IsTransparentBackgroundSupported(wxString* reason = NULL) const wxOVERRIDE; + virtual int GetCharHeight() const wxOVERRIDE; virtual int GetCharWidth() const wxOVERRIDE; diff --git a/include/wx/popupwin.h b/include/wx/popupwin.h index ea6a4427a4..3d20bf4a7b 100644 --- a/include/wx/popupwin.h +++ b/include/wx/popupwin.h @@ -76,24 +76,16 @@ public: // when the user clicks mouse outside it or if it loses focus in any other way // ---------------------------------------------------------------------------- -class WXDLLIMPEXP_FWD_CORE wxPopupWindowHandler; -class WXDLLIMPEXP_FWD_CORE wxPopupFocusHandler; - -class WXDLLIMPEXP_CORE wxPopupTransientWindow : public wxPopupWindow +// Define the public API of wxPopupTransientWindow: +class WXDLLIMPEXP_CORE wxPopupTransientWindowBase : public wxPopupWindow { public: - // ctors - wxPopupTransientWindow() { Init(); } - wxPopupTransientWindow(wxWindow *parent, int style = wxBORDER_NONE); - - virtual ~wxPopupTransientWindow(); - // popup the window (this will show it too) and keep focus at winFocus // (or itself if it's NULL), dismiss the popup if we lose focus - virtual void Popup(wxWindow *focus = NULL); + virtual void Popup(wxWindow *focus = NULL) = 0; // hide the window - virtual void Dismiss(); + virtual void Dismiss() = 0; // can the window be dismissed now? // @@ -104,24 +96,74 @@ public: // called when a mouse is pressed while the popup is shown: return true // from here to prevent its normal processing by the popup (which consists // in dismissing it if the mouse is clicked outside it) - virtual bool ProcessLeftDown(wxMouseEvent& event); - - // Overridden to grab the input on some plaforms - virtual bool Show( bool show = true ) wxOVERRIDE; + virtual bool ProcessLeftDown(wxMouseEvent& WXUNUSED(event)) + { return false; } // Override to implement delayed destruction of this window. virtual bool Destroy() wxOVERRIDE; protected: - // common part of all ctors - void Init(); - // this is called when the popup is disappeared because of anything // else but direct call to Dismiss() - virtual void OnDismiss(); + virtual void OnDismiss() { } // dismiss and notify the derived class - void DismissAndNotify(); + void DismissAndNotify() + { + Dismiss(); + OnDismiss(); + } +}; + +#ifdef __WXMSW__ + +class WXDLLIMPEXP_CORE wxPopupTransientWindow : public wxPopupTransientWindowBase +{ +public: + // ctors + wxPopupTransientWindow() { } + wxPopupTransientWindow(wxWindow *parent, int style = wxBORDER_NONE) + { Create(parent, style); } + + // Implement base class pure virtuals. + virtual void Popup(wxWindow *focus = NULL) wxOVERRIDE; + virtual void Dismiss() wxOVERRIDE; + + // Override to handle WM_NCACTIVATE. + virtual bool MSWHandleMessage(WXLRESULT *result, + WXUINT message, + WXWPARAM wParam, + WXLPARAM lParam) wxOVERRIDE; + +private: + wxDECLARE_DYNAMIC_CLASS(wxPopupTransientWindow); + wxDECLARE_NO_COPY_CLASS(wxPopupTransientWindow); +}; + +#else // !__WXMSW__ + +class WXDLLIMPEXP_FWD_CORE wxPopupWindowHandler; +class WXDLLIMPEXP_FWD_CORE wxPopupFocusHandler; + +class WXDLLIMPEXP_CORE wxPopupTransientWindow : public wxPopupTransientWindowBase +{ +public: + // ctors + wxPopupTransientWindow() { Init(); } + wxPopupTransientWindow(wxWindow *parent, int style = wxBORDER_NONE); + + virtual ~wxPopupTransientWindow(); + + // Implement base class pure virtuals. + virtual void Popup(wxWindow *focus = NULL) wxOVERRIDE; + virtual void Dismiss() wxOVERRIDE; + + // Overridden to grab the input on some plaforms + virtual bool Show( bool show = true ) wxOVERRIDE; + +protected: + // common part of all ctors + void Init(); // remove our event handlers void PopHandlers(); @@ -129,7 +171,7 @@ protected: // get alerted when child gets deleted from under us void OnDestroy(wxWindowDestroyEvent& event); -#if defined(__WXMSW__) ||(defined(__WXMAC__) && wxOSX_USE_COCOA_OR_CARBON) +#if defined(__WXMAC__) && wxOSX_USE_COCOA_OR_CARBON // Check if the mouse needs to be captured or released: we must release // when it's inside our window if we want the embedded controls to work. void OnIdle(wxIdleEvent& event); @@ -154,6 +196,8 @@ protected: wxDECLARE_NO_COPY_CLASS(wxPopupTransientWindow); }; +#endif // __WXMSW__/!__WXMSW__ + #if wxUSE_COMBOBOX && defined(__WXUNIVERSAL__) // ---------------------------------------------------------------------------- diff --git a/include/wx/display_impl.h b/include/wx/private/display.h similarity index 52% rename from include/wx/display_impl.h rename to include/wx/private/display.h index 40b4827885..1cd7bae8d0 100644 --- a/include/wx/display_impl.h +++ b/include/wx/private/display.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: wx/display_impl.h +// Name: wx/private/display.h // Purpose: wxDisplayImpl class declaration // Author: Vadim Zeitlin // Created: 2006-03-15 @@ -7,25 +7,35 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef _WX_DISPLAY_IMPL_H_BASE_ -#define _WX_DISPLAY_IMPL_H_BASE_ +#ifndef _WX_PRIVATE_DISPLAY_H_ +#define _WX_PRIVATE_DISPLAY_H_ +#include "wx/display.h" #include "wx/gdicmn.h" // for wxRect +#include "wx/vector.h" // ---------------------------------------------------------------------------- // wxDisplayFactory: allows to create wxDisplay objects // ---------------------------------------------------------------------------- -class WXDLLIMPEXP_CORE wxDisplayFactory +class wxDisplayFactory { public: wxDisplayFactory() { } - virtual ~wxDisplayFactory() { } + virtual ~wxDisplayFactory(); - // create a new display object - // - // it can return a NULL pointer if the display creation failed - virtual wxDisplayImpl *CreateDisplay(unsigned n) = 0; + // Create the display if necessary using CreateDisplay(), otherwise just + // get it from cache. + wxDisplayImpl* GetDisplay(unsigned n) + { + if ( m_impls.empty() ) + m_impls.resize(GetCount()); + else if ( m_impls[n] ) + return m_impls[n]; + + m_impls[n] = CreateDisplay(n); + return m_impls[n]; + } // get the total number of displays virtual unsigned GetCount() = 0; @@ -37,13 +47,25 @@ public: // // the window pointer must not be NULL (i.e. caller should check it) virtual int GetFromWindow(const wxWindow *window); + +protected: + // create a new display object + // + // it can return a NULL pointer if the display creation failed + virtual wxDisplayImpl *CreateDisplay(unsigned n) = 0; + +private: + // On-demand populated vector of wxDisplayImpl objects. + wxVector m_impls; + + wxDECLARE_NO_COPY_CLASS(wxDisplayFactory); }; // ---------------------------------------------------------------------------- // wxDisplayImpl: base class for all wxDisplay implementations // ---------------------------------------------------------------------------- -class WXDLLIMPEXP_CORE wxDisplayImpl +class wxDisplayImpl { public: // virtual dtor for this base class @@ -56,8 +78,20 @@ public: // return the area of the display available for normal windows virtual wxRect GetClientArea() const { return GetGeometry(); } + // return the depth or 0 if unknown + virtual int GetDepth() const = 0; + + // return the resolution of the display, uses GetSizeMM() by default but + // can be also overridden directly + virtual wxSize GetPPI() const; + + // return the physical size of the display or (0, 0) if unknown: this is + // only used by GetPPI() implementation in the base class, so if GetPPI() + // is overridden, this one doesn't have to be implemented + virtual wxSize GetSizeMM() const { return wxSize(0, 0); } + // return the name (may be empty) - virtual wxString GetName() const = 0; + virtual wxString GetName() const { return wxString(); } // return the index of this display unsigned GetIndex() const { return m_index; } @@ -91,19 +125,61 @@ protected: wxDECLARE_NO_COPY_CLASS(wxDisplayImpl); }; +// ---------------------------------------------------------------------------- +// wxDisplayImplSingle: the simplest possible impl for the main display only +// ---------------------------------------------------------------------------- + +// Note that this is still an ABC and GetGeometry() and GetClientArea() methods +// must be implemented in the derived classes. + +class WXDLLEXPORT wxDisplayImplSingle : public wxDisplayImpl +{ +public: + wxDisplayImplSingle() : wxDisplayImpl(0) { } + +#if wxUSE_DISPLAY + // no video modes support for us, provide just the stubs + virtual wxArrayVideoModes + GetModes(const wxVideoMode& WXUNUSED(mode)) const wxOVERRIDE + { + return wxArrayVideoModes(); + } + + virtual wxVideoMode GetCurrentMode() const wxOVERRIDE + { + return wxVideoMode(); + } + + virtual bool ChangeMode(const wxVideoMode& WXUNUSED(mode)) wxOVERRIDE + { + return false; + } +#endif // wxUSE_DISPLAY + + wxDECLARE_NO_COPY_CLASS(wxDisplayImplSingle); +}; + // ---------------------------------------------------------------------------- // wxDisplayFactorySingle // ---------------------------------------------------------------------------- -// this is a stub implementation using single/main display only, it is -// available even if wxUSE_DISPLAY == 0 -class WXDLLIMPEXP_CORE wxDisplayFactorySingle : public wxDisplayFactory +// This is the simplest implementation of wxDisplayFactory using single/main +// display only. It is used when wxUSE_DISPLAY == 0 because getting the size of +// the main display is always needed. +// +// Note that this is still an ABC and derived classes must implement +// CreateSingleDisplay(). + +class wxDisplayFactorySingle : public wxDisplayFactory { public: - virtual wxDisplayImpl *CreateDisplay(unsigned n) wxOVERRIDE; virtual unsigned GetCount() wxOVERRIDE { return 1; } virtual int GetFromPoint(const wxPoint& pt) wxOVERRIDE; + +protected: + virtual wxDisplayImpl *CreateDisplay(unsigned n) wxOVERRIDE; + + virtual wxDisplayImpl *CreateSingleDisplay() = 0; }; -#endif // _WX_DISPLAY_IMPL_H_BASE_ - +#endif // _WX_PRIVATE_DISPLAY_H_ diff --git a/include/wx/propgrid/property.h b/include/wx/propgrid/property.h index 46591191d6..d93595cf0e 100644 --- a/include/wx/propgrid/property.h +++ b/include/wx/propgrid/property.h @@ -719,12 +719,23 @@ public: } // Constructor. - // labels - Labels for choices. + // count - Number of labels. + // labels - Labels themselves. + // values - Values for choices. If NULL, indexes are used. + wxPGChoices(size_t count, const wxString* labels, const long* values = NULL) + { + Init(); + Add(count, labels, values); + } + + // Constructor overload taking wxChar strings, provided mostly for + // compatibility. + // labels - Labels for choices, NULL-terminated. // values - Values for choices. If NULL, indexes are used. wxPGChoices( const wxChar* const* labels, const long* values = NULL ) { Init(); - Set(labels,values); + Add(labels,values); } // Constructor. @@ -734,7 +745,7 @@ public: const wxArrayInt& values = wxArrayInt() ) { Init(); - Set(labels,values); + Add(labels,values); } // Simple interface constructor. @@ -754,7 +765,10 @@ public: // Adds to current. // If did not have own copies, creates them now. If was empty, identical // to set except that creates copies. - // labels - Labels for added choices. + void Add(size_t count, const wxString* labels, const long* values = NULL); + + // Overload taking wxChar strings, provided mostly for compatibility. + // labels - Labels for added choices, NULL-terminated. // values - Values for added choices. If empty, relevant entry indexes are used. void Add( const wxChar* const* labels, const ValArrItem* values = NULL ); @@ -879,6 +893,12 @@ public: // Sets contents from lists of strings and values. // Does not create copies for itself. // TODO: Deprecate. + void Set(size_t count, const wxString* labels, const long* values = NULL) + { + Free(); + Add(count, labels, values); + } + void Set( const wxChar* const* labels, const long* values = NULL ) { Free(); @@ -1772,8 +1792,7 @@ public: // (i.e. cancel 'true' returned by StringToValue() or IntToValue()). void SetWasModified( bool set = true ) { - if ( set ) m_flags |= wxPG_PROP_WAS_MODIFIED; - else m_flags &= ~wxPG_PROP_WAS_MODIFIED; + ChangeFlag(wxPG_PROP_WAS_MODIFIED, set); } // Returns property's help or description text. diff --git a/include/wx/propgrid/propgrid.h b/include/wx/propgrid/propgrid.h index 99f899a0ed..9239043908 100644 --- a/include/wx/propgrid/propgrid.h +++ b/include/wx/propgrid/propgrid.h @@ -1572,8 +1572,8 @@ protected: wxPGCell m_unspecifiedAppearance; // List of properties to be deleted/removed in idle event handler. - wxArrayPGProperty m_deletedProperties; - wxArrayPGProperty m_removedProperties; + wxVector m_deletedProperties; + wxVector m_removedProperties; #if !WXWIN_COMPATIBILITY_3_0 // List of editors and their event handlers to be deleted in idle event handler. @@ -2280,7 +2280,7 @@ public: // added. wxPGProperty* GetCurParent() const { - return (wxPGProperty*) m_propHierarchy[m_propHierarchy.size()-1]; + return m_propHierarchy.back(); } wxPropertyGridPageState* GetState() { return m_state; } @@ -2309,7 +2309,7 @@ protected: wxPropertyGridPageState* m_state; // Tree-hierarchy of added properties (that can have children). - wxArrayPGProperty m_propHierarchy; + wxVector m_propHierarchy; // Hashmap for string-id to wxPGChoicesData mapping. wxPGHashMapS2P m_dictIdChoices; diff --git a/include/wx/propgrid/propgridpagestate.h b/include/wx/propgrid/propgridpagestate.h index 2dc6d1eb27..246f23dec0 100644 --- a/include/wx/propgrid/propgridpagestate.h +++ b/include/wx/propgrid/propgridpagestate.h @@ -642,13 +642,13 @@ protected: wxPGHashMapS2P m_dictName; // List of column widths (first column does not include margin). - wxArrayInt m_colWidths; + wxVector m_colWidths; // List of indices of columns the user can edit by clicking it. - wxArrayInt m_editableColumns; + wxVector m_editableColumns; // Column proportions. - wxArrayInt m_columnProportions; + wxVector m_columnProportions; double m_fSplitterX; diff --git a/include/wx/qt/combobox.h b/include/wx/qt/combobox.h index b2fe23d305..490e2cb117 100644 --- a/include/wx/qt/combobox.h +++ b/include/wx/qt/combobox.h @@ -63,16 +63,14 @@ public: return wxItemContainer::GetStringSelection(); } - virtual void Clear() wxOVERRIDE - { - wxTextEntry::Clear(); - wxItemContainer::Clear(); - } + virtual void Clear() wxOVERRIDE; // See wxComboBoxBase discussion of IsEmpty(). bool IsListEmpty() const { return wxItemContainer::IsEmpty(); } bool IsTextEmpty() const { return wxTextEntry::IsEmpty(); } + virtual void SetValue(const wxString& value) wxOVERRIDE; + virtual void Popup(); virtual void Dismiss(); diff --git a/include/wx/qt/evtloop.h b/include/wx/qt/evtloop.h index 6034a808a7..25ea24a8dc 100644 --- a/include/wx/qt/evtloop.h +++ b/include/wx/qt/evtloop.h @@ -10,7 +10,7 @@ class QTimer; -class WXDLLIMPEXP_BASE wxQtEventLoopBase : public wxEventLoopBase +class WXDLLIMPEXP_CORE wxQtEventLoopBase : public wxEventLoopBase { public: wxQtEventLoopBase(); @@ -44,18 +44,6 @@ public: wxGUIEventLoop(); }; -#else // !wxUSE_GUI - -#if wxUSE_CONSOLE_EVENTLOOP - -class WXDLLIMPEXP_BASE wxConsoleEventLoop : public wxQtEventLoopBase -{ -public: - wxConsoleEventLoop(); -}; - -#endif // wxUSE_CONSOLE_EVENTLOOP - #endif // wxUSE_GUI #endif // _WX_QT_EVTLOOP_H_ diff --git a/include/wx/qt/glcanvas.h b/include/wx/qt/glcanvas.h index a67efa09b0..0e872e343f 100644 --- a/include/wx/qt/glcanvas.h +++ b/include/wx/qt/glcanvas.h @@ -17,7 +17,9 @@ class QGLFormat; class WXDLLIMPEXP_GL wxGLContext : public wxGLContextBase { public: - wxGLContext(wxGLCanvas *win, const wxGLContext* other = NULL); + wxGLContext(wxGLCanvas *win, + const wxGLContext *other = NULL, + const wxGLContextAttrs *ctxAttrs = NULL); /// virtual ~wxGLContext(); virtual bool SetCurrent(const wxGLCanvas& win) const wxOVERRIDE; @@ -36,6 +38,16 @@ class WXDLLIMPEXP_GL wxGLCanvas : public wxGLCanvasBase { public: explicit // avoid implicitly converting a wxWindow* to wxGLCanvas + wxGLCanvas(wxWindow *parent, + const wxGLAttributes& dispAttrs, + wxWindowID id = wxID_ANY, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = 0, + const wxString& name = wxGLCanvasName, + const wxPalette& palette = wxNullPalette); + + explicit wxGLCanvas(wxWindow *parent, wxWindowID id = wxID_ANY, const int *attribList = NULL, @@ -45,6 +57,15 @@ public: const wxString& name = wxGLCanvasName, const wxPalette& palette = wxNullPalette); + bool Create(wxWindow *parent, + const wxGLAttributes& dispAttrs, + wxWindowID id = wxID_ANY, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = 0, + const wxString& name = wxGLCanvasName, + const wxPalette& palette = wxNullPalette); + bool Create(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, diff --git a/include/wx/qt/menuitem.h b/include/wx/qt/menuitem.h index 158007fc4e..769f4a9e8e 100644 --- a/include/wx/qt/menuitem.h +++ b/include/wx/qt/menuitem.h @@ -9,6 +9,8 @@ #define _WX_QT_MENUITEM_H_ #include "wx/menuitem.h" +#include "wx/bitmap.h" + class QAction; class WXDLLIMPEXP_FWD_CORE wxBitmap; @@ -33,14 +35,15 @@ public: virtual void Check(bool check = true); virtual bool IsChecked() const; - void SetBitmap(const wxBitmap& bitmap); - const wxBitmap& GetBitmap() const; + virtual void SetBitmap(const wxBitmap& bitmap); + virtual const wxBitmap& GetBitmap() const { return m_bitmap; }; virtual QAction *GetHandle() const; private: // Qt is using an action instead of a menu item. QAction *m_qtAction; + wxBitmap m_bitmap; wxDECLARE_DYNAMIC_CLASS( wxMenuItem ); }; diff --git a/include/wx/qt/toolbar.h b/include/wx/qt/toolbar.h index 850ef5eb67..6e9822b7c1 100644 --- a/include/wx/qt/toolbar.h +++ b/include/wx/qt/toolbar.h @@ -32,7 +32,6 @@ public: virtual ~wxToolBar(); - void Init(); bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, @@ -44,23 +43,27 @@ public: virtual QToolBar *GetQToolBar() const { return m_qtToolBar; } virtual void SetWindowStyleFlag( long style ) wxOVERRIDE; + + virtual void SetToolShortHelp(int id, const wxString& helpString) wxOVERRIDE; + virtual void SetToolNormalBitmap(int id, const wxBitmap& bitmap) wxOVERRIDE; + virtual void SetToolDisabledBitmap(int id, const wxBitmap& bitmap) wxOVERRIDE; + virtual bool Realize() wxOVERRIDE; virtual wxToolBarToolBase *CreateTool(int toolid, const wxString& label, const wxBitmap& bmpNormal, - const wxBitmap& bmpDisabled, - wxItemKind kind, - wxObject *clientData, - const wxString& shortHelp, - const wxString& longHelp) wxOVERRIDE; + const wxBitmap& bmpDisabled = wxNullBitmap, + wxItemKind kind = wxITEM_NORMAL, + wxObject *clientData = NULL, + const wxString& shortHelp = wxEmptyString, + const wxString& longHelp = wxEmptyString) wxOVERRIDE; virtual wxToolBarToolBase *CreateTool(wxControl *control, const wxString& label) wxOVERRIDE; QWidget *GetHandle() const wxOVERRIDE; protected: - QActionGroup* GetActionGroup(size_t pos); virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool) wxOVERRIDE; virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool) wxOVERRIDE; @@ -69,6 +72,8 @@ protected: virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle) wxOVERRIDE; private: + void Init(); + long GetButtonStyle(); QToolBar *m_qtToolBar; diff --git a/include/wx/qt/window.h b/include/wx/qt/window.h index 192ae2b54a..3a07aed4c4 100644 --- a/include/wx/qt/window.h +++ b/include/wx/qt/window.h @@ -11,6 +11,9 @@ #include +class QShortcut; +template < class T > class QList; + class QWidget; class QScrollWindow; class QAbstractScrollArea; @@ -133,7 +136,9 @@ public: QWidget *GetHandle() const wxOVERRIDE; +#if wxUSE_DRAG_AND_DROP virtual void SetDropTarget( wxDropTarget *dropTarget ) wxOVERRIDE; +#endif #if wxUSE_ACCEL // accelerators diff --git a/include/wx/sizer.h b/include/wx/sizer.h index 14b446a71a..16c86222a1 100644 --- a/include/wx/sizer.h +++ b/include/wx/sizer.h @@ -619,6 +619,10 @@ public: // Inform sizer about the first direction that has been decided (by parent item) // Returns true if it made use of the information (and recalculated min size) + // + // Note that while this method doesn't do anything by default, it should + // almost always be overridden in the derived classes and should have been + // pure virtual if not for backwards compatibility constraints. virtual bool InformFirstDirection( int WXUNUSED(direction), int WXUNUSED(size), int WXUNUSED(availableOtherDir) ) { return false; } @@ -958,6 +962,10 @@ public: virtual wxSize CalcMin() wxOVERRIDE; virtual void RecalcSizes() wxOVERRIDE; + virtual bool InformFirstDirection(int direction, + int size, + int availableOtherDir) wxOVERRIDE; + protected: // Only overridden to perform extra debugging checks. virtual wxSizerItem *DoInsert(size_t index, wxSizerItem *item) wxOVERRIDE; diff --git a/include/wx/univ/scrarrow.h b/include/wx/univ/scrarrow.h index 6e6997c687..5746c7607a 100644 --- a/include/wx/univ/scrarrow.h +++ b/include/wx/univ/scrarrow.h @@ -11,6 +11,7 @@ #ifndef _WX_UNIV_SCRARROW_H_ #define _WX_UNIV_SCRARROW_H_ +#if wxUSE_SCROLLBAR // ---------------------------------------------------------------------------- // wxScrollArrows is not a control but just a class containing the common // functionality of scroll arrows, whether part of scrollbars, spin ctrls or @@ -107,5 +108,6 @@ public: // false to stop it virtual bool OnArrow(wxScrollArrows::Arrow arrow) = 0; }; +#endif // wxUSE_SCROLLBAR #endif // _WX_UNIV_SCRARROW_H_ diff --git a/include/wx/unix/apptbase.h b/include/wx/unix/apptbase.h index ff41981407..5ce97d6837 100644 --- a/include/wx/unix/apptbase.h +++ b/include/wx/unix/apptbase.h @@ -48,11 +48,11 @@ public: virtual wxFDIOManager *GetFDIOManager(); #endif // wxUSE_SOCKETS -#if wxUSE_EVENTLOOP_SOURCE +#if wxUSE_CONSOLE_EVENTLOOP && wxUSE_EVENTLOOP_SOURCE // Return a non-NULL pointer to the object responsible for managing the // event loop sources in this kind of application. virtual wxEventLoopSourcesManagerBase* GetEventLoopSourcesManager(); -#endif // wxUSE_CONSOLE_EVENTLOOP +#endif // wxUSE_CONSOLE_EVENTLOOP && wxUSE_CONSOLE_EVENTLOOP protected: // Wait for the process termination by running the given event loop until diff --git a/include/wx/unix/private/displayx11.h b/include/wx/unix/private/displayx11.h new file mode 100644 index 0000000000..c78b213b09 --- /dev/null +++ b/include/wx/unix/private/displayx11.h @@ -0,0 +1,183 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: wx/unix/private/displayx11.h +// Purpose: Helper functions used by wxX11 and wxGTK ports +// Author: Vadim Zeitlin +// Created: 2018-10-04 (extracted from src/unix/displayx11.cpp) +// Copyright: (c) 2002-2018 wxWindows team +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_UNIX_PRIVATE_DISPLAYX11_H_ +#define _WX_UNIX_PRIVATE_DISPLAYX11_H_ + +#include "wx/defs.h" + +#include +#include + +#if wxUSE_DISPLAY + +#include "wx/log.h" +#include "wx/translation.h" + +#ifdef HAVE_X11_EXTENSIONS_XF86VMODE_H + +#include + +// +// See (http://www.xfree86.org/4.2.0/XF86VidModeDeleteModeLine.3.html) for more +// info about xf86 video mode extensions +// + +//free private data common to x (usually s3) servers +#define wxClearXVM(vm) if(vm.privsize) XFree(vm.c_private) + +// Correct res rate from GLFW +#define wxCRR2(v,dc) (int) (((1000.0f * (float) dc) /*PIXELS PER SECOND */) / ((float) v.htotal * v.vtotal /*PIXELS PER FRAME*/) + 0.5f) +#define wxCRR(v) wxCRR2(v,v.dotclock) +#define wxCVM2(v, dc, display, nScreen) wxVideoMode(v.hdisplay, v.vdisplay, DefaultDepth(display, nScreen), wxCRR2(v,dc)) +#define wxCVM(v, display, nScreen) wxCVM2(v, v.dotclock, display, nScreen) + +wxArrayVideoModes wxXF86VidMode_GetModes(const wxVideoMode& mode, Display* display, int nScreen) +{ + XF86VidModeModeInfo** ppXModes; //Enumerated Modes (Don't forget XFree() :)) + int nNumModes; //Number of modes enumerated.... + + wxArrayVideoModes Modes; //modes to return... + + if (XF86VidModeGetAllModeLines(display, nScreen, &nNumModes, &ppXModes)) + { + for (int i = 0; i < nNumModes; ++i) + { + XF86VidModeModeInfo& info = *ppXModes[i]; + const wxVideoMode vm = wxCVM(info, display, nScreen); + if (vm.Matches(mode)) + { + Modes.Add(vm); + } + wxClearXVM(info); + // XFree(ppXModes[i]); //supposed to free? + } + XFree(ppXModes); + } + else //OOPS! + { + wxLogSysError(_("Failed to enumerate video modes")); + } + + return Modes; +} + +wxVideoMode wxXF86VidMode_GetCurrentMode(Display* display, int nScreen) +{ + XF86VidModeModeLine VM; + int nDotClock; + if ( !XF86VidModeGetModeLine(display, nScreen, &nDotClock, &VM) ) + return wxVideoMode(); + + wxClearXVM(VM); + return wxCVM2(VM, nDotClock, display, nScreen); +} + +bool wxXF86VidMode_ChangeMode(const wxVideoMode& mode, Display* display, int nScreen) +{ + XF86VidModeModeInfo** ppXModes; //Enumerated Modes (Don't forget XFree() :)) + int nNumModes; //Number of modes enumerated.... + + if(!XF86VidModeGetAllModeLines(display, nScreen, &nNumModes, &ppXModes)) + { + wxLogSysError(_("Failed to change video mode")); + return false; + } + + bool bRet = false; + if (mode == wxDefaultVideoMode) + { + bRet = XF86VidModeSwitchToMode(display, nScreen, ppXModes[0]) != 0; + + for (int i = 0; i < nNumModes; ++i) + { + wxClearXVM((*ppXModes[i])); + // XFree(ppXModes[i]); //supposed to free? + } + } + else + { + for (int i = 0; i < nNumModes; ++i) + { + if (!bRet && + ppXModes[i]->hdisplay == mode.GetWidth() && + ppXModes[i]->vdisplay == mode.GetHeight() && + wxCRR((*ppXModes[i])) == mode.GetRefresh()) + { + //switch! + bRet = XF86VidModeSwitchToMode(display, nScreen, ppXModes[i]) != 0; + } + wxClearXVM((*ppXModes[i])); + // XFree(ppXModes[i]); //supposed to free? + } + } + + XFree(ppXModes); + + return bRet; +} + +#else // !HAVE_X11_EXTENSIONS_XF86VMODE_H + +wxArrayVideoModes wxX11_GetModes(const wxDisplayImpl* impl, const wxVideoMode& modeMatch, Display* display) +{ + int count_return; + int* depths = XListDepths(display, 0, &count_return); + wxArrayVideoModes modes; + if ( depths ) + { + const wxRect rect = impl->GetGeometry(); + for ( int x = 0; x < count_return; ++x ) + { + wxVideoMode mode(rect.width, rect.height, depths[x]); + if ( mode.Matches(modeMatch) ) + { + modes.Add(mode); + } + } + + XFree(depths); + } + return modes; +} + +#endif // !HAVE_X11_EXTENSIONS_XF86VMODE_H + +#endif // wxUSE_DISPLAY + +void wxGetWorkAreaX11(Screen* screen, int& x, int& y, int& width, int& height) +{ + Display* display = DisplayOfScreen(screen); + Atom property = XInternAtom(display, "_NET_WORKAREA", true); + if (property) + { + Atom actual_type; + int actual_format; + unsigned long nitems; + unsigned long bytes_after; + unsigned char* data = NULL; + Status status = XGetWindowProperty( + display, RootWindowOfScreen(screen), property, + 0, 4, false, XA_CARDINAL, + &actual_type, &actual_format, &nitems, &bytes_after, &data); + if (status == Success && actual_type == XA_CARDINAL && + actual_format == 32 && nitems == 4) + { + const long* p = (long*)data; + x = p[0]; + y = p[1]; + width = p[2]; + height = p[3]; + } + if (data) + XFree(data); + } +} + +#endif // _WX_UNIX_PRIVATE_DISPLAYX11_H_ diff --git a/interface/wx/access.h b/interface/wx/access.h index 53284b525d..068f76e057 100644 --- a/interface/wx/access.h +++ b/interface/wx/access.h @@ -25,6 +25,11 @@ enum wxAccStatus }; +/** Child ids are integer identifiers from 1 up. + So zero represents 'this' object. +*/ +#define wxACC_SELF 0 + /** This enum represents directions of navigation used in wxAccessible::Navigate(). @@ -495,7 +500,7 @@ public: */ static void NotifyEvent(int eventType, wxWindow* window, wxAccObject objectType, - int objectType); + int objectId); /** Selects the object or child. See wxAccSelectionFlags for a list diff --git a/interface/wx/colour.h b/interface/wx/colour.h index 09c1c242a6..cd217d853a 100644 --- a/interface/wx/colour.h +++ b/interface/wx/colour.h @@ -182,6 +182,11 @@ public: */ virtual unsigned char Red() const; + /** + Returns @true if the color can be described using RGB values, ie is solid, + @false if it is a pattern (currently only possible on macOS) + */ + virtual bool IsSolid() const; //@{ /** Sets the RGB intensity values using the given values (first overload), diff --git a/interface/wx/dataview.h b/interface/wx/dataview.h index e3e10e25fc..84c7479df8 100644 --- a/interface/wx/dataview.h +++ b/interface/wx/dataview.h @@ -3746,10 +3746,9 @@ public: */ wxDataViewEvent(const wxDataViewEvent& event); - /** Returns the position of the column in the control or -1 - if no column field was set by the event emitter. + if column field is unavailable for this event. For wxEVT_DATAVIEW_COLUMN_REORDERED, this is the new position of the column. diff --git a/interface/wx/display.h b/interface/wx/display.h index 1566d21df6..1a3ca71450 100644 --- a/interface/wx/display.h +++ b/interface/wx/display.h @@ -12,8 +12,6 @@ @library{wxcore} @category{cfg} - - @see wxClientDisplayRect(), wxDisplaySize(), wxDisplaySizeMM() */ class wxDisplay { @@ -102,10 +100,26 @@ public: wxArrayVideoModes GetModes(const wxVideoMode& mode = wxDefaultVideoMode) const; /** - Returns the display's name. A name is not available on all platforms. + Returns the display's name. + + The returned value is currently an empty string under all platforms + except MSW. */ wxString GetName() const; + /** + Returns display resolution in pixels per inch. + + Horizontal and vertical resolution are returned in @c x and @c y + components of the wxSize object respectively. + + If the resolution information is not available, returns @code wxSize(0, + 0) @endcode. + + @since 3.1.2 + */ + wxSize GetPPI() const; + /** Returns @true if the display is the primary display. The primary display is the one whose index is 0. diff --git a/interface/wx/filefn.h b/interface/wx/filefn.h index a9392c3db2..45a94d22f7 100644 --- a/interface/wx/filefn.h +++ b/interface/wx/filefn.h @@ -129,26 +129,6 @@ typedef off_t wxFileOffset; */ #define wxCHANGE_UMASK(mask) -/** - This function returns the total number of bytes and number of free bytes on - the disk containing the directory @a path (it should exist). Both @a total - and @a free parameters may be @NULL if the corresponding information is not - needed. - - @since 2.3.2 - - @note The generic Unix implementation depends on the system having the - @c statfs() or @c statvfs() function. - - @return @true on success, @false if an error occurred (for example, the - directory doesn’t exist). - - @header{wx/filefn.h} -*/ -bool wxGetDiskSpace(const wxString& path, - wxLongLong total = NULL, - wxLongLong free = NULL); - /** Returns the Windows directory under Windows; other platforms return an empty string. diff --git a/interface/wx/gdicmn.h b/interface/wx/gdicmn.h index 6e98d29d88..0e8ffd53c8 100644 --- a/interface/wx/gdicmn.h +++ b/interface/wx/gdicmn.h @@ -1183,6 +1183,10 @@ const wxSize wxDefaultSize; /** Returns @true if the display is colour, @false otherwise. + @note Use of this function is not recommended in the new code as it only + works for the primary display. Use wxDisplay::GetDepth() to retrieve + the depth of the appropriate display and compare it with 1 instead. + @header{wx/gdicmn.h} */ bool wxColourDisplay(); @@ -1191,6 +1195,10 @@ bool wxColourDisplay(); Returns the depth of the display (a value of 1 denotes a monochrome display). + @note Use of this function is not recommended in the new code as it only + works for the primary display. Use wxDisplay::GetDepth() to retrieve + the depth of the appropriate display instead. + @header{wx/gdicmn.h} */ int wxDisplayDepth(); @@ -1248,6 +1256,10 @@ wxRect wxGetClientDisplayRect(); The @c x component of the returned wxSize object contains the horizontal resolution and the @c y one -- the vertical resolution. + @note Use of this function is not recommended in the new code as it only + works for the primary display. Use wxDisplay::GetPPI() to retrieve + the resolution of the appropriate display instead. + @header{wx/gdicmn.h} @see wxDisplay @@ -1262,6 +1274,10 @@ wxSize wxGetDisplayPPI(); /** Returns the display size in pixels. + @note Use of this function is not recommended in the new code as it only + works for the primary display. Use wxDisplay::GetGeometry() to retrieve + the size of the appropriate display instead. + Either of output pointers can be @NULL if the caller is not interested in the corresponding value. @@ -1277,6 +1293,10 @@ void wxDisplaySize(int* width, int* height); /** Returns the display size in pixels. + @note Use of this function is not recommended in the new code as it only + works for the primary display. Use wxDisplay::GetGeometry() to retrieve + the size of the appropriate display instead. + @see wxDisplay @header{wx/gdicmn.h} diff --git a/interface/wx/popupwin.h b/interface/wx/popupwin.h index fb1030b171..01af6cfa63 100644 --- a/interface/wx/popupwin.h +++ b/interface/wx/popupwin.h @@ -84,10 +84,10 @@ public: /** Popup the window (this will show it too). - If @a winFocus is non-@NULL, it will be kept focused while this window - is shown, otherwise this window itself will receive focus. In any case, - the popup will disappear automatically if it loses focus because of a - user action. + If @a focus is non-@NULL, it will be kept focused while this window + is shown if supported by the current platform, otherwise the popup + itself will receive focus. In any case, the popup will disappear + automatically if it loses focus because of a user action. @see Dismiss() */ diff --git a/interface/wx/propgrid/property.h b/interface/wx/propgrid/property.h index e12ad51e3f..e60002a638 100644 --- a/interface/wx/propgrid/property.h +++ b/interface/wx/propgrid/property.h @@ -2487,11 +2487,30 @@ public: /** Constructor. + @param count + Number of the strings in @a labels array. @param labels Labels for choices. + @param values + Values for choices. If @NULL, indexes are used. Otherwise must have + at least @a count elements. + + @since 3.1.2 + */ + wxPGChoices(size_t count, const wxString* labels, const long* values = NULL); + + /** + Constructor overload taking wxChar strings. + + This constructor is provided mostly for compatibility, prefer to use + one of the other constructor overloads in the new code. + + @param labels + Labels for choices, @NULL-terminated. @param values - Values for choices. If @NULL, indexes are used. + Values for choices. If @NULL, indexes are used. Otherwise must have + at least the same size as @a labels. */ wxPGChoices( const wxChar** labels, const long* values = NULL ); @@ -2502,7 +2521,8 @@ public: Labels for choices. @param values - Values for choices. If empty, indexes are used. + Values for choices. If empty, indexes are used. Otherwise must have + at least the same size as @a labels. */ wxPGChoices( const wxArrayString& labels, const wxArrayInt& values = wxArrayInt() ); @@ -2520,16 +2540,35 @@ public: Adds to current. If did not have own copies, creates them now. If was empty, identical to set except that creates copies. + @param count + Number of the strings in @a labels array. @param labels - Labels for added choices. - + Labels for choices. @param values - Values for added choices. If empty, relevant entry indexes are used. - */ - void Add( const wxChar** labels, const ValArrItem* values = NULL ); + Values for choices. If @NULL, indexes are used. Otherwise must have + at least @a count elements. + + @since 3.1.2 + */ + void Add(size_t count, const wxString* labels, const long* values = NULL); /** - Adds to current. Version that works with wxArrayString and wxArrayInt. + Adds to current. + + This overload is provided mostly for compatibility, prefer to use one + of the other ones in the new code. + + @param labels + Labels for added choices, @NULL-terminated. + + @param values + Values for added choices. If empty, relevant entry indexes are + used. Otherwise must have at least the same size as @a labels. + */ + void Add( const wxChar** labels, const long* values = NULL ); + + /** + @overload */ void Add( const wxArrayString& arr, const wxArrayInt& arrint ); @@ -2659,12 +2698,19 @@ public: /** Sets contents from lists of strings and values. + + This is similar to calling Clear() and the corresponding overload of Add(). */ + void Set(size_t count, const wxString* labels, const long* values = NULL); + + /** + @overload + */ void Set( const wxChar** labels, const long* values = NULL ); /** - Sets contents from lists of strings and values. - */ + @overload + */ void Set( const wxArrayString& labels, const wxArrayInt& values = wxArrayInt() ); /** diff --git a/interface/wx/rearrangectrl.h b/interface/wx/rearrangectrl.h index c6cceaded1..fa4d40eb5e 100644 --- a/interface/wx/rearrangectrl.h +++ b/interface/wx/rearrangectrl.h @@ -41,6 +41,12 @@ is to use wxRearrangeCtrl which combines it with two standard buttons to move the current item up or down. + Note that while most of the methods for items manipulation such as + Append(), Insert() or Delete(), inherited from wxItemContainer work as + expected for this class, Set() somewhat unexpectedly resets the order of + the items as it clears the control first, also clearing the order as a side + effect, before adding the new items. + @since 2.9.0 @library{wxcore} diff --git a/interface/wx/renderer.h b/interface/wx/renderer.h index 2a3772b78a..ddd4d3a1f8 100644 --- a/interface/wx/renderer.h +++ b/interface/wx/renderer.h @@ -552,7 +552,9 @@ public: /** Returns the size of a check box. - The @a win parameter is not used currently and can be @NULL. + + @param win A valid, i.e. non-null, window pointer which is used to get + the theme defining the checkbox size under some platforms. */ virtual wxSize GetCheckBoxSize(wxWindow* win) = 0; diff --git a/interface/wx/sysopt.h b/interface/wx/sysopt.h index cb789b3c04..47ac09624d 100644 --- a/interface/wx/sysopt.h +++ b/interface/wx/sysopt.h @@ -66,9 +66,6 @@ Setting this to 0 causes more flicker, but allows applications to paint graphics on the parent of a static box (the optimized refresh causes any such drawing to disappear). - @flag{msw.display.directdraw} - If set to 1, use DirectDraw-based implementation of wxDisplay. - By default the standard Win32 functions are used. @flag{msw.font.no-proof-quality} If set to 1, use default fonts quality instead of proof quality when creating fonts. With proof quality the fonts have slightly better diff --git a/interface/wx/utils.h b/interface/wx/utils.h index 990920ab77..c981365e37 100644 --- a/interface/wx/utils.h +++ b/interface/wx/utils.h @@ -365,6 +365,26 @@ wxPowerType wxGetPowerType(); */ wxString wxGetDisplayName(); +/** + This function returns the total number of bytes and number of free bytes on + the disk containing the directory @a path (it should exist). Both @a total + and @a free parameters may be @NULL if the corresponding information is not + needed. + + @since 2.3.2 + + @note The generic Unix implementation depends on the system having the + @c statfs() or @c statvfs() function. + + @return @true on success, @false if an error occurred (for example, the + directory doesn’t exist). + + @header{wx/utils.h} +*/ +bool wxGetDiskSpace(const wxString& path, + wxLongLong total = NULL, + wxLongLong free = NULL); + /** For normal keys, returns @true if the specified key is currently down. diff --git a/interface/wx/vidmode.h b/interface/wx/vidmode.h index b8a1bcf7ff..9097e67b23 100644 --- a/interface/wx/vidmode.h +++ b/interface/wx/vidmode.h @@ -15,8 +15,6 @@ @stdobjects ::wxDefaultVideoMode - - @see wxClientDisplayRect(), wxDisplaySize(), wxDisplaySizeMM() */ struct wxVideoMode { diff --git a/lib/vms_gtk2.opt b/lib/vms_gtk2.opt index 490b2440cb..4edff31f42 100644 --- a/lib/vms_gtk2.opt +++ b/lib/vms_gtk2.opt @@ -15,5 +15,6 @@ sys$share:libglib2.exe/share sys$share:freetype2shr/share sys$share:libfontconfig/share sys$share:pthread$rtl.exe/share +sys$share:libXrender.exe/share sys$library:decw$xextlibshr.exe/share sys$library:decw$xlibshr.exe/share diff --git a/samples/access/accesstest.cpp b/samples/access/accesstest.cpp index 4bd8a63209..e73fdee3ee 100644 --- a/samples/access/accesstest.cpp +++ b/samples/access/accesstest.cpp @@ -455,7 +455,7 @@ void MyFrame::OnQuery(wxCommandEvent& WXUNUSED(event)) wxString name, role; GetInfo(childAccessible, 0, name, role); wxString str; - str.Printf("Found child %s/%s", name.c_str(), role.c_str()); + str.Printf("Found child %s/%s", name, role); Log(str); childAccessible->Release(); } @@ -499,7 +499,7 @@ void MyFrame::LogObject(int indent, IAccessible* obj) GetInfo(obj, 0, name, role); wxString str; - str.Printf("Name = %s; Role = %s", name.c_str(), role.c_str()); + str.Printf("Name = %s; Role = %s", name, role); str.Pad(indent, ' ', false); Log(str); } @@ -520,7 +520,7 @@ void MyFrame::LogObject(int indent, IAccessible* obj) GetInfo(obj, i, name, role); wxString str; - str.Printf("%d) Name = %s; Role = %s", i, name.c_str(), role.c_str()); + str.Printf("%d) Name = %s; Role = %s", i, name, role); str.Pad(indent, ' ', false); Log(str); diff --git a/samples/artprov/artbrows.cpp b/samples/artprov/artbrows.cpp index 2b13ac4632..93e0f9f638 100644 --- a/samples/artprov/artbrows.cpp +++ b/samples/artprov/artbrows.cpp @@ -28,7 +28,7 @@ #include "artbrows.h" #define ART_CLIENT(id) \ - choice->Append(wxT(#id), (void*)id); + choice->Append(#id, (void*)id); #define ART_ICON(id) \ { \ int ind; \ @@ -37,7 +37,7 @@ ind = images->Add(icon); \ else \ ind = 0; \ - list->InsertItem(index, wxT(#id), ind); \ + list->InsertItem(index, #id, ind); \ list->SetItemPtrData(index, wxPtrToUInt(id)); \ index++; \ } diff --git a/samples/calendar/calendar.cpp b/samples/calendar/calendar.cpp index 047736f057..14e1f616bd 100644 --- a/samples/calendar/calendar.cpp +++ b/samples/calendar/calendar.cpp @@ -735,7 +735,7 @@ MyPanel::MyPanel(wxWindow *parent) wxString date; date.Printf("Selected date: %s", - wxDateTime::Today().FormatISODate().c_str()); + wxDateTime::Today().FormatISODate()); m_date = new wxStaticText(this, wxID_ANY, date); m_calendar = DoCreateCalendar(wxDefaultDateTime, wxCAL_SHOW_HOLIDAYS); @@ -761,13 +761,13 @@ void MyPanel::OnCalendar(wxCalendarEvent& event) m_calendar->Mark(event.GetDate().GetDay(), mark); wxLogMessage("Selected (and %smarked) %s from calendar.", - mark ? "" : "un", s_dateLast.FormatISODate().c_str()); + mark ? "" : "un", s_dateLast.FormatISODate()); } void MyPanel::OnCalendarChange(wxCalendarEvent& event) { wxString s; - s.Printf("Selected date: %s", event.GetDate().FormatISODate().c_str()); + s.Printf("Selected date: %s", event.GetDate().FormatISODate()); m_date->SetLabel(s); wxLogStatus(s); @@ -783,7 +783,7 @@ void MyPanel::OnCalMonthChange(wxCalendarEvent& event) void MyPanel::OnCalendarWeekDayClick(wxCalendarEvent& event) { wxLogMessage("Clicked on %s", - wxDateTime::GetWeekDayName(event.GetWeekDay()).c_str()); + wxDateTime::GetWeekDayName(event.GetWeekDay())); } void MyPanel::OnCalendarWeekClick(wxCalendarEvent& event) diff --git a/samples/combo/combo.cpp b/samples/combo/combo.cpp index 944e65a85e..c489504194 100644 --- a/samples/combo/combo.cpp +++ b/samples/combo/combo.cpp @@ -944,12 +944,12 @@ void MyFrame::OnComboBoxUpdate( wxCommandEvent& event ) } else if ( event.GetEventType() == wxEVT_TEXT ) { - wxLogDebug(wxT("EVT_TEXT(id=%i,string=\"%s\")"),event.GetId(),event.GetString().c_str()); + wxLogDebug("EVT_TEXT(id=%i,string=\"%s\")",event.GetId(),event.GetString()); } else if ( event.GetEventType() == wxEVT_TEXT_ENTER ) { wxLogDebug("EVT_TEXT_ENTER(id=%i,string=\"%s\")", - event.GetId(), event.GetString().c_str()); + event.GetId(), event.GetString()); } } @@ -1123,7 +1123,7 @@ void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) "This is the wxWidgets wxComboCtrl and wxOwnerDrawnComboBox sample\n" "running under %s.", wxVERSION_STRING, - wxGetOsDescription().c_str() + wxGetOsDescription() ), "About wxComboCtrl sample", wxOK | wxICON_INFORMATION, diff --git a/samples/config/conftest.cpp b/samples/config/conftest.cpp index 941da4dda8..7b05918175 100644 --- a/samples/config/conftest.cpp +++ b/samples/config/conftest.cpp @@ -210,7 +210,7 @@ MyFrame::MyFrame() wxString s; if ( pConfig->Read("TestValue", &s) ) { - wxLogStatus(this, "TestValue from config is '%s'", s.c_str()); + wxLogStatus(this, "TestValue from config is '%s'", s); } else { diff --git a/samples/dataview/dataview.cpp b/samples/dataview/dataview.cpp index 852be2f15f..51273a6106 100644 --- a/samples/dataview/dataview.cpp +++ b/samples/dataview/dataview.cpp @@ -1214,7 +1214,8 @@ void MyFrame::OnValueChanged( wxDataViewEvent &event ) void MyFrame::OnActivated( wxDataViewEvent &event ) { wxString title = m_music_model->GetTitle( event.GetItem() ); - wxLogMessage( "wxEVT_DATAVIEW_ITEM_ACTIVATED, Item: %s", title ); + wxLogMessage( "wxEVT_DATAVIEW_ITEM_ACTIVATED, Item: %s; Column: %d", + title, event.GetColumn() ); if (m_ctrl[0]->IsExpanded( event.GetItem() )) { diff --git a/samples/dataview/mymodels.h b/samples/dataview/mymodels.h index 6366250b87..59d3c984a7 100644 --- a/samples/dataview/mymodels.h +++ b/samples/dataview/mymodels.h @@ -226,7 +226,7 @@ public: virtual wxString GetColumnType( unsigned int col ) const wxOVERRIDE { if (col == Col_Toggle) - return wxT( "bool" ); + return "bool"; if (col == Col_IconText) return "wxDataViewIconText"; diff --git a/samples/debugrpt/debugrpt.cpp b/samples/debugrpt/debugrpt.cpp index faa0fe4862..730504cab6 100644 --- a/samples/debugrpt/debugrpt.cpp +++ b/samples/debugrpt/debugrpt.cpp @@ -80,7 +80,7 @@ protected: s << '\t' << reply[n] << '\n'; } - wxLogMessage("%s", s.c_str()); + wxLogMessage("%s", s); return true; } @@ -466,8 +466,8 @@ void MyApp::GenerateReport(wxDebugReport::Context ctx) } else { - wxLogMessage(wxT("Report generated in \"%s\"."), - report->GetCompressedFileName().c_str()); + wxLogMessage("Report generated in \"%s\".", + report->GetCompressedFileName()); report->Reset(); } } diff --git a/samples/dialogs/Makefile.in b/samples/dialogs/Makefile.in index 83eea46a3c..f9e618bff3 100644 --- a/samples/dialogs/Makefile.in +++ b/samples/dialogs/Makefile.in @@ -106,8 +106,6 @@ COND_PLATFORM_OS2_1___dialogs___os2_emxbindcmd = $(NM) dialogs$(EXEEXT) | if \ @COND_SHARED_0_TOOLKIT_MAC_WXUNIV_0@ dialogs_filedlgg.o @COND_TOOLKIT_GTK_TOOLKIT_VERSION_2@__GENERIC_DIALOGS_IN_NATIVE_BUILDS_OBJECTS \ @COND_TOOLKIT_GTK_TOOLKIT_VERSION_2@ = dialogs_filedlgg.o -@COND_SHARED_0_TOOLKIT_PM_WXUNIV_0@__GENERIC_DIALOGS_IN_NATIVE_BUILDS_OBJECTS \ -@COND_SHARED_0_TOOLKIT_PM_WXUNIV_0@ = dialogs_fontdlgg.o dialogs_filedlgg.o COND_MONOLITHIC_0___WXLIB_CORE_p = \ -lwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_core-$(WX_RELEASE)$(HOST_SUFFIX) @COND_MONOLITHIC_0@__WXLIB_CORE_p = $(COND_MONOLITHIC_0___WXLIB_CORE_p) @@ -221,16 +219,10 @@ dialogs_dialogs.o: $(srcdir)/dialogs.cpp @COND_TOOLKIT_GTK_TOOLKIT_VERSION_2@dialogs_filedlgg.o: $(srcdir)/../../src/generic/filedlgg.cpp @COND_TOOLKIT_GTK_TOOLKIT_VERSION_2@ $(CXXC) -c -o $@ $(DIALOGS_CXXFLAGS) $(srcdir)/../../src/generic/filedlgg.cpp -@COND_SHARED_0_TOOLKIT_PM_WXUNIV_0@dialogs_filedlgg.o: $(srcdir)/../../src/generic/filedlgg.cpp -@COND_SHARED_0_TOOLKIT_PM_WXUNIV_0@ $(CXXC) -c -o $@ $(DIALOGS_CXXFLAGS) $(srcdir)/../../src/generic/filedlgg.cpp @COND_SHARED_0_TOOLKIT_MSW_WXUNIV_0@dialogs_fontdlgg.o: $(srcdir)/../../src/generic/fontdlgg.cpp @COND_SHARED_0_TOOLKIT_MSW_WXUNIV_0@ $(CXXC) -c -o $@ $(DIALOGS_CXXFLAGS) $(srcdir)/../../src/generic/fontdlgg.cpp -@COND_SHARED_0_TOOLKIT_PM_WXUNIV_0@dialogs_fontdlgg.o: $(srcdir)/../../src/generic/fontdlgg.cpp -@COND_SHARED_0_TOOLKIT_PM_WXUNIV_0@ $(CXXC) -c -o $@ $(DIALOGS_CXXFLAGS) $(srcdir)/../../src/generic/fontdlgg.cpp - - # Include dependency info, if present: @IF_GNU_MAKE@-include ./.deps/*.d diff --git a/samples/dialogs/dialogs.cpp b/samples/dialogs/dialogs.cpp index 303ff8d9b8..011ca273c9 100644 --- a/samples/dialogs/dialogs.cpp +++ b/samples/dialogs/dialogs.cpp @@ -1049,7 +1049,7 @@ void MyFrame::PasswordEntry(wxCommandEvent& WXUNUSED(event)) this); if ( !pwd.empty() ) { - wxMessageBox(wxString::Format("Your password is '%s'", pwd.c_str()), + wxMessageBox(wxString::Format("Your password is '%s'", pwd), "Got password", wxOK | wxICON_INFORMATION, this); } } @@ -1133,7 +1133,7 @@ void MyFrame::MultiChoice(wxCommandEvent& WXUNUSED(event) ) { msg += wxString::Format("\t%u: %u (%s)\n", (unsigned)n, (unsigned)selections[n], - choices[selections[n]].c_str()); + choices[selections[n]]); } } wxLogMessage(msg); @@ -1568,9 +1568,9 @@ void MyFrame::FileOpen(wxCommandEvent& WXUNUSED(event) ) "Path: %s\n" "Name: %s\n" "Custom window: %s", - dialog.GetPath().c_str(), - dialog.GetDirectory().c_str(), - dialog.GetFilename().c_str(), + dialog.GetPath(), + dialog.GetDirectory(), + dialog.GetFilename(), extra ? static_cast(extra)->GetInfo() : wxString("None")); wxMessageDialog dialog2(this, info, "Selected file"); @@ -1637,7 +1637,7 @@ void MyFrame::FilesOpen(wxCommandEvent& WXUNUSED(event) ) for ( size_t n = 0; n < count; n++ ) { s.Printf("File %d: %s (%s)\n", - (int)n, paths[n].c_str(), filenames[n].c_str()); + (int)n, paths[n], filenames[n]); msg += s; } @@ -1663,7 +1663,7 @@ void MyFrame::FileSave(wxCommandEvent& WXUNUSED(event) ) if (dialog.ShowModal() == wxID_OK) { wxLogMessage("%s, filter %d", - dialog.GetPath().c_str(), dialog.GetFilterIndex()); + dialog.GetPath(), dialog.GetFilterIndex()); } } #endif // wxUSE_FILEDLG @@ -1689,9 +1689,9 @@ void MyFrame::FileOpenGeneric(wxCommandEvent& WXUNUSED(event) ) info.Printf("Full file name: %s\n" "Path: %s\n" "Name: %s", - dialog.GetPath().c_str(), - dialog.GetDirectory().c_str(), - dialog.GetFilename().c_str()); + dialog.GetPath(), + dialog.GetDirectory(), + dialog.GetFilename()); wxMessageDialog dialog2(this, info, "Selected file"); dialog2.ShowModal(); } @@ -1716,7 +1716,7 @@ void MyFrame::FilesOpenGeneric(wxCommandEvent& WXUNUSED(event) ) for ( size_t n = 0; n < count; n++ ) { s.Printf("File %d: %s (%s)\n", - (int)n, paths[n].c_str(), filenames[n].c_str()); + (int)n, paths[n], filenames[n]); msg += s; } @@ -1742,7 +1742,7 @@ void MyFrame::FileSaveGeneric(wxCommandEvent& WXUNUSED(event) ) if (dialog.ShowModal() == wxID_OK) { wxLogMessage("%s, filter %d", - dialog.GetPath().c_str(), dialog.GetFilterIndex()); + dialog.GetPath(), dialog.GetFilterIndex()); } } #endif // USE_FILEDLG_GENERIC @@ -1758,7 +1758,7 @@ void MyFrame::DoDirChoose(int style) if (dialog.ShowModal() == wxID_OK) { - wxLogMessage("Selected path: %s", dialog.GetPath().c_str()); + wxLogMessage("Selected path: %s", dialog.GetPath()); } } @@ -3018,17 +3018,17 @@ void MyFrame::OnFindDialog(wxFindDialogEvent& event) { wxLogMessage("Find %s'%s' (flags: %s)", type == wxEVT_FIND_NEXT ? "next " : "", - event.GetFindString().c_str(), - DecodeFindDialogEventFlags(event.GetFlags()).c_str()); + event.GetFindString(), + DecodeFindDialogEventFlags(event.GetFlags())); } else if ( type == wxEVT_FIND_REPLACE || type == wxEVT_FIND_REPLACE_ALL ) { wxLogMessage("Replace %s'%s' with '%s' (flags: %s)", type == wxEVT_FIND_REPLACE_ALL ? "all " : "", - event.GetFindString().c_str(), - event.GetReplaceString().c_str(), - DecodeFindDialogEventFlags(event.GetFlags()).c_str()); + event.GetFindString(), + event.GetReplaceString(), + DecodeFindDialogEventFlags(event.GetFlags())); } else if ( type == wxEVT_FIND_CLOSE ) { diff --git a/samples/display/display.cpp b/samples/display/display.cpp index 4f4be39b64..7996eac945 100644 --- a/samples/display/display.cpp +++ b/samples/display/display.cpp @@ -170,13 +170,6 @@ bool MyApp::OnInit() if ( !wxApp::OnInit() ) return false; -#ifdef __WXMSW__ - if ( argc == 2 && !wxStricmp(argv[1], "/dx") ) - { - wxSystemOptions::SetOption("msw.display.directdraw", 1); - } -#endif // __WXMSW__ - // create the main application window MyFrame *frame = new MyFrame(_("Display wxWidgets Sample"), wxDefaultPosition, wxDefaultSize); @@ -242,8 +235,8 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size, wxPanel *panel = new wxPanel(this, wxID_ANY); m_book = new wxBookCtrl(panel, wxID_ANY); - const size_t count = wxDisplay::GetCount(); - for ( size_t nDpy = 0; nDpy < count; nDpy++ ) + const size_t countDpy = wxDisplay::GetCount(); + for ( size_t nDpy = 0; nDpy < countDpy; nDpy++ ) { wxDisplay display(nDpy); @@ -282,17 +275,30 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size, rc.x, rc.y, rc.width, rc.height) )); + sizer->Add(new wxStaticText(page, wxID_ANY, "Resolution: ")); + const wxSize ppi = display.GetPPI(); + sizer->Add(new wxStaticText(page, wxID_ANY, + wxString::Format("%d*%d", ppi.x, ppi.y))); + + sizer->Add(new wxStaticText(page, wxID_ANY, "Depth: ")); + sizer->Add(new wxStaticText(page, wxID_ANY, + wxString::Format("%d", display.GetDepth()))); + sizer->Add(new wxStaticText(page, wxID_ANY, "Name: ")); sizer->Add(new wxStaticText(page, wxID_ANY, display.GetName())); + sizer->Add(new wxStaticText(page, wxID_ANY, "Primary: ")); + sizer->Add(new wxStaticText(page, wxID_ANY, + display.IsPrimary() ? "yes" : "no")); + wxSizer *sizerTop = new wxBoxSizer(wxVERTICAL); sizerTop->Add(sizer, 1, wxALL | wxEXPAND, 10); #if wxUSE_DISPLAY wxChoice *choiceModes = new wxChoice(page, Display_ChangeMode); const wxArrayVideoModes modes = display.GetModes(); - const size_t count = modes.GetCount(); - for ( size_t nMode = 0; nMode < count; nMode++ ) + const size_t countModes = modes.GetCount(); + for ( size_t nMode = 0; nMode < countModes; nMode++ ) { const wxVideoMode& mode = modes[nMode]; diff --git a/samples/dnd/dnd.cpp b/samples/dnd/dnd.cpp index e5184a3ca5..daa78a4a25 100644 --- a/samples/dnd/dnd.cpp +++ b/samples/dnd/dnd.cpp @@ -631,7 +631,7 @@ public: size_t WXUNUSED(len), const void *buf) wxOVERRIDE { wxCHECK_MSG( format == m_formatShape, false, - wxT( "unsupported format") ); + "unsupported format"); delete m_shape; m_shape = DnDShape::New(buf); @@ -1150,7 +1150,7 @@ void DnDFrame::OnDragMoveAllow(wxCommandEvent& event) void DnDFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { wxMessageBox("Drag-&-Drop Demo\n" - wxT("Please see \"Help|Help...\" for details\n") + "Please see \"Help|Help...\" for details\n" "Copyright (c) 1998 Vadim Zeitlin", "About wxDnD", wxICON_INFORMATION | wxOK, @@ -1175,11 +1175,11 @@ void DnDFrame::OnHelp(wxCommandEvent& /* event */) "it to wordpad or any other droptarget accepting text (and of course you can just drag it\n" "to the right pane). Due to a lot of trace messages, the cursor might take some time to \n" "change, don't release the mouse button until it does. You can change the string being\n" - wxT("dragged in \"File|Test drag...\" dialog.\n") + "dragged in \"File|Test drag...\" dialog.\n" "\n" "\n" "Please send all questions/bug reports/suggestions &c to \n" - wxT("Vadim Zeitlin "), + "Vadim Zeitlin ", "wxDnD Help"); dialog.ShowModal(); @@ -1199,18 +1199,18 @@ void DnDFrame::OnLogClear(wxCommandEvent& /* event */ ) void DnDFrame::LogDragResult(wxDragResult result) { #if wxUSE_STATUSBAR - wxString pc; + wxString msg; switch ( result ) { - case wxDragError: pc = "Error!"; break; - case wxDragNone: pc = "Nothing"; break; - case wxDragCopy: pc = "Copied"; break; - case wxDragMove: pc = "Moved"; break; - case wxDragCancel: pc = "Cancelled"; break; - default: pc = "Huh?"; break; + case wxDragError: msg = "Error!"; break; + case wxDragNone: msg = "Nothing"; break; + case wxDragCopy: msg = "Copied"; break; + case wxDragMove: msg = "Moved"; break; + case wxDragCancel: msg = "Cancelled"; break; + default: msg = "Huh?"; break; } - SetStatusText(wxString("Drag result: ") + pc); + SetStatusText(wxString("Drag result: ") + msg); #else wxUnusedVar(result); #endif // wxUSE_STATUSBAR @@ -1294,9 +1294,9 @@ void DnDFrame::OnCopyBitmap(wxCommandEvent& WXUNUSED(event)) { // PNG support is not always compiled in under Windows, so use BMP there #if wxUSE_LIBPNG - wxFileDialog dialog(this, "Open a PNG file", wxEmptyString, wxEmptyString, wxT("PNG files (*.png)|*.png"), 0); + wxFileDialog dialog(this, "Open a PNG file", wxEmptyString, wxEmptyString, "PNG files (*.png)|*.png", 0); #else - wxFileDialog dialog(this, "Open a BMP file", wxEmptyString, wxEmptyString, wxT("BMP files (*.bmp)|*.bmp"), 0); + wxFileDialog dialog(this, "Open a BMP file", wxEmptyString, wxEmptyString, "BMP files (*.bmp)|*.bmp", 0); #endif if (dialog.ShowModal() != wxID_OK) @@ -1439,7 +1439,7 @@ void DnDFrame::OnCopyFiles(wxCommandEvent& WXUNUSED(event)) { #ifdef __WXMSW__ wxFileDialog dialog(this, "Select a file to copy", wxEmptyString, wxEmptyString, - wxT("All files (*.*)|*.*"), 0); + "All files (*.*)|*.*", 0); wxArrayString filenames; while ( dialog.ShowModal() == wxID_OK ) @@ -1523,7 +1523,7 @@ void DnDFrame::OnCopy(wxCommandEvent& WXUNUSED(event)) } else { - wxLogMessage("Text '%s' put on the clipboard", m_strText.c_str()); + wxLogMessage("Text '%s' put on the clipboard", m_strText); } wxTheClipboard->Close(); @@ -1554,7 +1554,7 @@ void DnDFrame::OnPaste(wxCommandEvent& WXUNUSED(event)) else { wxLogMessage("Text '%s' pasted from the clipboard", - text.GetText().c_str()); + text.GetText()); } wxTheClipboard->Close(); @@ -1802,7 +1802,7 @@ void DnDShapeFrame::OnDrag(wxMouseEvent& event) DnDShapeDataObject shapeData(m_shape); wxDropSource source(shapeData, this); - wxString pc; + wxString msg; switch ( source.DoDragDrop(true) ) { default: @@ -1817,11 +1817,11 @@ void DnDShapeFrame::OnDrag(wxMouseEvent& event) break; case wxDragCopy: - pc = "copied"; + msg = "copied"; break; case wxDragMove: - pc = "moved"; + msg = "moved"; if ( ms_lastDropTarget != this ) { // don't delete the shape if we dropped it on ourselves! @@ -1836,10 +1836,10 @@ void DnDShapeFrame::OnDrag(wxMouseEvent& event) break; } - if ( pc.length() ) + if (msg.length() ) { #if wxUSE_STATUSBAR - SetStatusText(wxString("Shape successfully ") + pc); + SetStatusText(wxString("Shape successfully ") + msg); #endif // wxUSE_STATUSBAR } //else: status text already set diff --git a/samples/drawing/drawing.cpp b/samples/drawing/drawing.cpp index cedf62803a..b9da4ce65a 100644 --- a/samples/drawing/drawing.cpp +++ b/samples/drawing/drawing.cpp @@ -227,7 +227,7 @@ public: void OnGraphicContextCairoUpdateUI(wxUpdateUIEvent& event) { - event.Check(m_canvas->IsRendererName(wxS("cairo"))); + event.Check(m_canvas->IsRendererName("cairo")); } #endif // wxUSE_CAIRO #ifdef __WXMSW__ @@ -239,7 +239,7 @@ public: void OnGraphicContextGDIPlusUpdateUI(wxUpdateUIEvent& event) { - event.Check(m_canvas->IsRendererName(wxS("gdiplus"))); + event.Check(m_canvas->IsRendererName("gdiplus")); } #endif #if wxUSE_GRAPHICS_DIRECT2D @@ -250,7 +250,7 @@ public: void OnGraphicContextDirect2DUpdateUI(wxUpdateUIEvent& event) { - event.Check(m_canvas->IsRendererName(wxS("direct2d"))); + event.Check(m_canvas->IsRendererName("direct2d")); } #endif #endif // __WXMSW__ @@ -1190,7 +1190,7 @@ void MyCanvas::DrawGraphics(wxGraphicsContext* gc) gc->PushState(); gc->Translate(60, 400); - const wxString labelText(wxS("Scaled smiley inside a square")); + const wxString labelText("Scaled smiley inside a square"); gc->DrawText(labelText, 0, 0); // Center a bitmap horizontally wxDouble textWidth; @@ -1204,7 +1204,7 @@ void MyCanvas::DrawGraphics(wxGraphicsContext* gc) // Draw graphics bitmap and its subbitmap gc->PushState(); gc->Translate(300, 400); - gc->DrawText(wxS("Smiley as a graphics bitmap"), 0, 0); + gc->DrawText("Smiley as a graphics bitmap", 0, 0); wxGraphicsBitmap gbmp1 = gc->CreateBitmap(m_smile_bmp); gc->DrawBitmap(gbmp1, 0, BASE2, 50, 50); @@ -1616,7 +1616,7 @@ void MyCanvas::DrawSystemColours(wxDC& dc) wxSize textSize; { wxDCFontChanger setMono(dc, mono); - textSize = dc.GetTextExtent(wxS("#01234567")); + textSize = dc.GetTextExtent("#01234567"); } int lineHeight = textSize.GetHeight(); @@ -2018,7 +2018,7 @@ void MyCanvas::UseGraphicRenderer(wxGraphicsRenderer* renderer) int major, minor, micro; renderer->GetVersion(&major, &minor, µ); wxString str = wxString::Format("Graphics renderer: %s %i.%i.%i", - renderer->GetName().c_str(), major, minor, micro); + renderer->GetName(), major, minor, micro); m_owner->SetStatusText(str, 1); } else @@ -2120,8 +2120,8 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) #endif // __WXMSW__ #endif // wxUSE_GRAPHICS_CONTEXT menuFile->AppendSeparator(); - menuFile->AppendCheckItem(File_BBox, wxS("Show bounding box\tCtrl-E"), - wxS("Show extents used in drawing operations")); + menuFile->AppendCheckItem(File_BBox, "Show bounding box\tCtrl-E", + "Show extents used in drawing operations"); menuFile->AppendCheckItem(File_Clip, "&Clip\tCtrl-C", "Clip/unclip drawing"); menuFile->AppendCheckItem(File_Buffer, "&Use wx&BufferedPaintDC\tCtrl-Z", "Buffer painting"); menuFile->AppendSeparator(); @@ -2252,15 +2252,15 @@ void MyFrame::OnCopy(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnSave(wxCommandEvent& WXUNUSED(event)) { - wxString wildCard = wxS("Bitmap image (*.bmp)|*.bmp;*.BMP"); + wxString wildCard = "Bitmap image (*.bmp)|*.bmp;*.BMP"; #if wxUSE_LIBPNG - wildCard.Append(wxS("|PNG image (*.png)|*.png;*.PNG")); + wildCard.Append("|PNG image (*.png)|*.png;*.PNG"); #endif #if wxUSE_SVG - wildCard.Append(wxS("|SVG image (*.svg)|*.svg;*.SVG")); + wildCard.Append("|SVG image (*.svg)|*.svg;*.SVG"); #endif #if wxUSE_POSTSCRIPT - wildCard.Append(wxS("|PostScript file (*.ps)|*.ps;*.PS")); + wildCard.Append("|PostScript file (*.ps)|*.ps;*.PS"); #endif wxFileDialog dlg(this, "Save as bitmap", wxEmptyString, wxEmptyString, @@ -2294,7 +2294,7 @@ void MyFrame::OnSave(wxCommandEvent& WXUNUSED(event)) else #endif #if wxUSE_POSTSCRIPT - if ( ext == wxS("ps") ) + if ( ext == "ps" ) { #if wxUSE_GRAPHICS_CONTEXT // Graphics screen can only be drawn using wxGraphicsContext @@ -2321,7 +2321,7 @@ void MyFrame::OnSave(wxCommandEvent& WXUNUSED(event)) double sc = wxMin((double)w / width, (double)h / height); m_xUserScale *= sc; m_yUserScale *= sc; - psdc.StartDoc(wxS("Drawing sample")); + psdc.StartDoc("Drawing sample"); // Define default font. psdc.SetFont( wxFontInfo(10).Family(wxFONTFAMILY_MODERN) ); psdc.StartPage(); diff --git a/samples/except/except.cpp b/samples/except/except.cpp index 30173d8e47..c10e374623 100644 --- a/samples/except/except.cpp +++ b/samples/except/except.cpp @@ -464,7 +464,7 @@ bool MyFrame::ProcessEvent(wxEvent& event) } catch ( const wxChar *msg ) { - wxLogMessage(wxT("Caught a string \"%s\" in MyFrame"), msg); + wxLogMessage("Caught a string \"%s\" in MyFrame", msg); return true; } diff --git a/samples/exec/exec.cpp b/samples/exec/exec.cpp index 860a7011e0..ae5ed8f8ed 100644 --- a/samples/exec/exec.cpp +++ b/samples/exec/exec.cpp @@ -343,7 +343,7 @@ enum Exec_Btn_Close }; -static wxString DIALOG_TITLE() +static wxString GetDialogTitle() { return "Exec sample"; } @@ -675,12 +675,11 @@ void MyFrame::OnKill(wxCommandEvent& WXUNUSED(event)) } else { - wxArrayString errorText; - errorText.push_back(""); // no error - errorText.push_back("signal not supported"); - errorText.push_back("permission denied"); - errorText.push_back("no such process"); - errorText.push_back("unspecified error"); + const wxString errorText[] = { "", // no error + "signal not supported", + "permission denied", + "no such process", + "unspecified error" }; wxLogStatus("Failed to kill process %ld with signal %d: %s", pid, sig, errorText[rc]); @@ -742,7 +741,7 @@ wxBEGIN_EVENT_TABLE(ExecQueryDialog, wxDialog) wxEND_EVENT_TABLE() ExecQueryDialog::ExecQueryDialog(const wxString& cmd) - : wxDialog(NULL, wxID_ANY, DIALOG_TITLE(), + : wxDialog(NULL, wxID_ANY, GetDialogTitle(), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) { @@ -855,13 +854,13 @@ void MyFrame::DoAsyncExec(const wxString& cmd) m_pidLast = wxExecute(cmd, wxEXEC_ASYNC | GetExecFlags(), process); if ( !m_pidLast ) { - wxLogError("Execution of '%s' failed.", cmd.c_str()); + wxLogError("Execution of '%s' failed.", cmd); delete process; } else { - wxLogStatus("Process %ld (%s) launched.", m_pidLast, cmd.c_str()); + wxLogStatus("Process %ld (%s) launched.", m_pidLast, cmd); m_cmdLast = cmd; @@ -878,12 +877,12 @@ void MyFrame::OnSyncExec(wxCommandEvent& WXUNUSED(event)) if ( !QueryExec(cmd, env) ) return; - wxLogStatus( "'%s' is running please wait...", cmd.c_str() ); + wxLogStatus( "'%s' is running please wait...", cmd ); int code = wxExecute(cmd, wxEXEC_SYNC | GetExecFlags(), NULL, &env); wxLogStatus("Process '%s' terminated with exit code %d.", - cmd.c_str(), code); + cmd, code); m_cmdLast = cmd; } @@ -891,7 +890,7 @@ void MyFrame::OnSyncExec(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAsyncExec(wxCommandEvent& WXUNUSED(event)) { wxString cmd = wxGetTextFromUser("Enter the command: ", - DIALOG_TITLE(), + GetDialogTitle(), m_cmdLast); if ( !cmd ) @@ -903,7 +902,7 @@ void MyFrame::OnAsyncExec(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnShell(wxCommandEvent& WXUNUSED(event)) { wxString cmd = wxGetTextFromUser("Enter the command: ", - DIALOG_TITLE(), + GetDialogTitle(), m_cmdLast); if ( !cmd ) @@ -911,7 +910,7 @@ void MyFrame::OnShell(wxCommandEvent& WXUNUSED(event)) int code = wxShell(cmd); wxLogStatus("Shell command '%s' terminated with exit code %d.", - cmd.c_str(), code); + cmd, code); m_cmdLast = cmd; } @@ -927,7 +926,7 @@ void MyFrame::OnExecWithRedirect(wxCommandEvent& WXUNUSED(event)) } wxString cmd = wxGetTextFromUser("Enter the command: ", - DIALOG_TITLE(), + GetDialogTitle(), m_cmdLast); if ( !cmd ) @@ -970,7 +969,7 @@ void MyFrame::OnExecWithRedirect(wxCommandEvent& WXUNUSED(event)) MyPipedProcess *process = new MyPipedProcess(this, cmd); if ( !wxExecute(cmd, wxEXEC_ASYNC, process) ) { - wxLogError("Execution of '%s' failed.", cmd.c_str()); + wxLogError("Execution of '%s' failed.", cmd); delete process; } @@ -989,14 +988,14 @@ void MyFrame::OnExecWithPipe(wxCommandEvent& WXUNUSED(event)) m_cmdLast = "tr [a-z] [A-Z]"; wxString cmd = wxGetTextFromUser("Enter the command: ", - DIALOG_TITLE(), + GetDialogTitle(), m_cmdLast); if ( !cmd ) return; wxString input = wxGetTextFromUser("Enter the string to send to it: ", - DIALOG_TITLE()); + GetDialogTitle()); if ( !input ) return; @@ -1005,13 +1004,13 @@ void MyFrame::OnExecWithPipe(wxCommandEvent& WXUNUSED(event)) long pid = wxExecute(cmd, wxEXEC_ASYNC, process); if ( pid ) { - wxLogStatus("Process %ld (%s) launched.", pid, cmd.c_str()); + wxLogStatus("Process %ld (%s) launched.", pid, cmd); AddPipedProcess(process); } else { - wxLogError("Execution of '%s' failed.", cmd.c_str()); + wxLogError("Execution of '%s' failed.", cmd); delete process; } @@ -1022,7 +1021,7 @@ void MyFrame::OnExecWithPipe(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnPOpen(wxCommandEvent& WXUNUSED(event)) { wxString cmd = wxGetTextFromUser("Enter the command to launch: ", - DIALOG_TITLE(), + GetDialogTitle(), m_cmdLast); if ( cmd.empty() ) return; @@ -1084,7 +1083,7 @@ void MyFrame::OnFileExec(wxCommandEvent& WXUNUSED(event)) if ( !ft ) { wxLogError("Impossible to determine the file type for extension '%s'", - ext.c_str()); + ext); return; } @@ -1102,7 +1101,7 @@ void MyFrame::OnFileExec(wxCommandEvent& WXUNUSED(event)) if ( !ok ) { wxLogError("Impossible to find out how to open files of extension '%s'", - ext.c_str()); + ext); return; } @@ -1174,7 +1173,7 @@ void MyFrame::OnOpenURL(wxCommandEvent& WXUNUSED(event)) if ( !wxLaunchDefaultBrowser(s_url) ) { - wxLogError(wxT("Failed to open URL \"%s\""), s_url.c_str()); + wxLogError("Failed to open URL \"%s\"", s_url); } } @@ -1187,19 +1186,19 @@ void MyFrame::OnOpenURL(wxCommandEvent& WXUNUSED(event)) bool MyFrame::GetDDEServer() { wxString server = wxGetTextFromUser("Server to connect to:", - DIALOG_TITLE(), m_server); + GetDialogTitle(), m_server); if ( !server ) return false; m_server = server; - wxString topic = wxGetTextFromUser("DDE topic:", DIALOG_TITLE(), m_topic); + wxString topic = wxGetTextFromUser("DDE topic:", GetDialogTitle(), m_topic); if ( !topic ) return false; m_topic = topic; - wxString cmd = wxGetTextFromUser("DDE command:", DIALOG_TITLE(), m_cmdDde); + wxString cmd = wxGetTextFromUser("DDE command:", GetDialogTitle(), m_cmdDde); if ( !cmd ) return false; @@ -1218,14 +1217,14 @@ void MyFrame::OnDDEExec(wxCommandEvent& WXUNUSED(event)) if ( !conn ) { wxLogError("Failed to connect to the DDE server '%s'.", - m_server.c_str()); + m_server); } else { if ( !conn->Execute(m_cmdDde) ) { wxLogError("Failed to execute command '%s' via DDE.", - m_cmdDde.c_str()); + m_cmdDde); } else { @@ -1244,14 +1243,14 @@ void MyFrame::OnDDERequest(wxCommandEvent& WXUNUSED(event)) if ( !conn ) { wxLogError("Failed to connect to the DDE server '%s'.", - m_server.c_str()); + m_server); } else { if ( !conn->Request(m_cmdDde) ) { wxLogError("Failed to send request '%s' via DDE.", - m_cmdDde.c_str()); + m_cmdDde); } else { @@ -1337,7 +1336,7 @@ void MyFrame::ShowOutput(const wxString& cmd, return; m_lbox->Append(wxString::Format("--- %s of '%s' ---", - title.c_str(), cmd.c_str())); + title, cmd)); for ( size_t n = 0; n < count; n++ ) { @@ -1345,7 +1344,7 @@ void MyFrame::ShowOutput(const wxString& cmd, } m_lbox->Append(wxString::Format("--- End of %s ---", - title.Lower().c_str())); + title.Lower())); } // ---------------------------------------------------------------------------- @@ -1355,7 +1354,7 @@ void MyFrame::ShowOutput(const wxString& cmd, void MyProcess::OnTerminate(int pid, int status) { wxLogStatus(m_parent, "Process %u ('%s') terminated with exit code %d.", - pid, m_cmd.c_str(), status); + pid, m_cmd, status); m_parent->OnAsyncTermination(this); } diff --git a/samples/font/font.cpp b/samples/font/font.cpp index 112e705da5..56fe9829c6 100644 --- a/samples/font/font.cpp +++ b/samples/font/font.cpp @@ -45,7 +45,7 @@ #endif // used as title for several dialog boxes -static wxString SAMPLE_TITLE() +static wxString GetSampleTitle() { return "wxWidgets Font Sample"; } @@ -582,7 +582,7 @@ protected: { wxString text; text.Printf("Encoding %u: %s (available in facename '%s')\n", - (unsigned int) ++m_n, encoding.c_str(), facename.c_str()); + (unsigned int) ++m_n, encoding, facename); m_text += text; return true; } @@ -599,7 +599,7 @@ void MyFrame::OnEnumerateEncodings(wxCommandEvent& WXUNUSED(event)) fontEnumerator.EnumerateEncodings(); wxLogMessage("Enumerating all available encodings:\n%s", - fontEnumerator.GetText().c_str()); + fontEnumerator.GetText()); } // ------------------------------------------------------------- @@ -659,7 +659,7 @@ bool MyFrame::DoEnumerateFamilies(bool fixedWidthOnly, n = wxGetSingleChoiceIndex ( "Choose a facename", - SAMPLE_TITLE(), + GetSampleTitle(), nFacenames, facenames, this @@ -713,8 +713,8 @@ void MyFrame::OnSetNativeDesc(wxCommandEvent& WXUNUSED(event)) font.SetNativeFontInfo(fontInfo); if ( !font.IsOk() ) { - wxLogError(wxT("Font info string \"%s\" is invalid."), - fontInfo.c_str()); + wxLogError("Font info string \"%s\" is invalid.", + fontInfo); return; } @@ -807,7 +807,7 @@ wxFontEncoding MyFrame::GetEncodingFromUser() int i = wxGetSingleChoiceIndex ( "Choose the encoding", - SAMPLE_TITLE(), + GetSampleTitle(), names, this ); @@ -837,7 +837,7 @@ wxFontFamily MyFrame::GetFamilyFromUser() int i = wxGetSingleChoiceIndex ( "Choose the family", - SAMPLE_TITLE(), + GetSampleTitle(), names, this ); @@ -1088,10 +1088,10 @@ void MyFrame::OnViewMsg(wxCommandEvent& WXUNUSED(event)) { // found! const wxChar *pc = line.c_str() + len; - if ( *pc == wxT('"') ) + if ( *pc == '"') pc++; - while ( *pc && *pc != wxT('"') ) + while ( *pc && *pc != '"') { charset += *pc++; } @@ -1103,7 +1103,7 @@ void MyFrame::OnViewMsg(wxCommandEvent& WXUNUSED(event)) if ( !charset ) { wxLogError("The file '%s' doesn't contain charset information.", - filename.c_str()); + filename); return; } @@ -1112,7 +1112,7 @@ void MyFrame::OnViewMsg(wxCommandEvent& WXUNUSED(event)) wxFontEncoding fontenc = wxFontMapper::Get()->CharsetToEncoding(charset); if ( fontenc == wxFONTENCODING_SYSTEM ) { - wxLogError("Charset '%s' is unsupported.", charset.c_str()); + wxLogError("Charset '%s' is unsupported.", charset); return; } @@ -1135,13 +1135,13 @@ void MyFrame::OnViewMsg(wxCommandEvent& WXUNUSED(event)) else { wxLogWarning("Cannot convert from '%s' to '%s'.", - wxFontMapper::GetEncodingDescription(fontenc).c_str(), - wxFontMapper::GetEncodingDescription(encAlt).c_str()); + wxFontMapper::GetEncodingDescription(fontenc), + wxFontMapper::GetEncodingDescription(encAlt)); } } else wxLogWarning("No fonts for encoding '%s' on this system.", - wxFontMapper::GetEncodingDescription(fontenc).c_str()); + wxFontMapper::GetEncodingDescription(fontenc)); } // and now create the correct font @@ -1155,7 +1155,7 @@ void MyFrame::OnViewMsg(wxCommandEvent& WXUNUSED(event)) else { wxLogWarning("No fonts for encoding '%s' on this system.", - wxFontMapper::GetEncodingDescription(fontenc).c_str()); + wxFontMapper::GetEncodingDescription(fontenc)); } } #endif // wxUSE_FILEDLG @@ -1165,7 +1165,7 @@ void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { wxMessageBox("wxWidgets font sample\n" "(c) 1999-2006 Vadim Zeitlin", - wxString("About ") + SAMPLE_TITLE(), + wxString("About ") + GetSampleTitle(), wxOK | wxICON_INFORMATION, this); } diff --git a/samples/grid/griddemo.cpp b/samples/grid/griddemo.cpp index 1439fef65c..38da7193b9 100644 --- a/samples/grid/griddemo.cpp +++ b/samples/grid/griddemo.cpp @@ -1275,7 +1275,7 @@ void GridFrame::OnLabelLeftClick( wxGridEvent& ev ) logBuf << " (shift down)"; if ( ev.ControlDown() ) logBuf << " (control down)"; - wxLogMessage( "%s", logBuf.c_str() ); + wxLogMessage( "%s", logBuf ); // you must call event skip if you want default grid processing // @@ -1349,7 +1349,7 @@ void GridFrame::OnSelectCell( wxGridEvent& ev ) if ( ((wxGrid *)ev.GetEventObject())->GetColPos( ev.GetCol() ) != ev.GetCol() ) logBuf << " *** Column moved, current position: " << ((wxGrid *)ev.GetEventObject())->GetColPos( ev.GetCol() ); - wxLogMessage( "%s", logBuf.c_str() ); + wxLogMessage( "%s", logBuf ); // you must call Skip() if you want the default processing // to occur in wxGrid @@ -1371,7 +1371,7 @@ void GridFrame::OnRangeSelected( wxGridRangeSelectEvent& ev ) << ", ShiftDown: "<< (ev.ShiftDown() ? 'T':'F') << ", AltDown: "<< (ev.AltDown() ? 'T':'F') << ", MetaDown: "<< (ev.MetaDown() ? 'T':'F') << " )"; - wxLogMessage( "%s", logBuf.c_str() ); + wxLogMessage( "%s", logBuf ); ev.Skip(); } @@ -1742,7 +1742,7 @@ void BugsGridTable::SetValue( int row, int col, const wxString& value ) if ( n == WXSIZEOF(severities) ) { wxLogWarning("Invalid severity value '%s'.", - value.c_str()); + value); gd.severity = Sev_Normal; } } @@ -1850,13 +1850,12 @@ void BugsGridTable::SetValueAsBool( int row, int col, bool value ) wxString BugsGridTable::GetColLabelValue( int col ) { - static wxArrayString headers; - headers.push_back("Id"); - headers.push_back("Summary"); - headers.push_back("Severity"); - headers.push_back("Priority"); - headers.push_back("Platform"); - headers.push_back("Opened?"); + static const wxString headers[] = { "Id", + "Summary", + "Severity", + "Priority", + "Platform", + "Opened?" }; return headers[col]; } diff --git a/samples/htlbox/htlbox.cpp b/samples/htlbox/htlbox.cpp index 26c3f73545..7df8069439 100644 --- a/samples/htlbox/htlbox.cpp +++ b/samples/htlbox/htlbox.cpp @@ -348,7 +348,7 @@ void MyFrame::CreateBox() "Item %lu" "", level, - clr.GetAsString(wxC2S_HTML_SYNTAX).c_str(), + clr.GetAsString(wxC2S_HTML_SYNTAX), (unsigned long)n, level); arr.Add(label); } @@ -489,7 +489,7 @@ void MyFrame::OnClear(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnHtmlLinkClicked(wxHtmlLinkEvent &event) { - wxLogMessage("The url '%s' has been clicked!", event.GetLinkInfo().GetHref().c_str()); + wxLogMessage("The url '%s' has been clicked!", event.GetLinkInfo().GetHref()); if (GetMyBox()) { @@ -541,7 +541,7 @@ void MyFrame::OnLboxSelect(wxCommandEvent& event) if ( !s.empty() ) { - wxLogMessage("Selected items: %s", s.c_str()); + wxLogMessage("Selected items: %s", s); } } @@ -621,7 +621,7 @@ wxString MyHtmlListBox::OnGetItem(size_t n) const "Item %lu" "", level, - clr.GetAsString(wxC2S_HTML_SYNTAX).c_str(), + clr.GetAsString(wxC2S_HTML_SYNTAX), (unsigned long)n, level); if ( n == 1 ) { diff --git a/samples/html/test/test.cpp b/samples/html/test/test.cpp index bff7d31dd7..33db2207d1 100644 --- a/samples/html/test/test.cpp +++ b/samples/html/test/test.cpp @@ -347,7 +347,7 @@ void MyFrame::OnDrawCustomBg(wxCommandEvent& event) void MyFrame::OnHtmlLinkClicked(wxHtmlLinkEvent &event) { - wxLogMessage("The url '%s' has been clicked!", event.GetLinkInfo().GetHref().c_str()); + wxLogMessage("The url '%s' has been clicked!", event.GetLinkInfo().GetHref()); // skipping this event the default behaviour (load the clicked URL) // will happen... @@ -398,7 +398,7 @@ void MyHtmlWindow::OnClipboardEvent(wxClipboardTextEvent& WXUNUSED(event)) const size_t maxTextLength = 100; wxLogStatus(wxString::Format("Clipboard: '%s%s'", - wxString(text, maxTextLength).c_str(), + wxString(text, maxTextLength), (text.length() > maxTextLength) ? "..." : "")); wxTheClipboard->Close(); diff --git a/samples/image/canvas.cpp b/samples/image/canvas.cpp index 31e2bfc268..60b70e624f 100644 --- a/samples/image/canvas.cpp +++ b/samples/image/canvas.cpp @@ -62,7 +62,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id, wxMemoryDC dc; dc.SelectObject( bitmap ); - dc.SetBrush( wxBrush( wxS("orange") ) ); + dc.SetBrush( wxBrush( "orange" ) ); dc.SetPen( *wxBLACK_PEN ); dc.DrawRectangle( 0, 0, 100, 100 ); dc.SetBrush( *wxWHITE_BRUSH ); @@ -153,7 +153,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id, #if wxUSE_GIF image.Destroy(); - if ( !image.LoadFile( dir + wxT("horse.gif" )) ) + if ( !image.LoadFile( dir + "horse.gif" ) ) { wxLogError("Can't load GIF image"); } @@ -406,7 +406,7 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) ) dc.DrawBitmap( my_square, 30, 30 ); dc.DrawText( "Drawn directly", 150, 10 ); - dc.SetBrush( wxBrush( wxS("orange") ) ); + dc.SetBrush( wxBrush( "orange" ) ); dc.SetPen( *wxBLACK_PEN ); dc.DrawRectangle( 150, 30, 100, 100 ); dc.SetBrush( *wxWHITE_BRUSH ); diff --git a/samples/image/image.cpp b/samples/image/image.cpp index ea59675422..949619960e 100644 --- a/samples/image/image.cpp +++ b/samples/image/image.cpp @@ -663,7 +663,7 @@ MyFrame::MyFrame() wxMenu *menuImage = new wxMenu; menuImage->Append( ID_NEW, "&Show any image...\tCtrl-O"); - menuImage->Append(ID_NEW_HIDPI, wxS("Show any image as &HiDPI...\tCtrl-H")); + menuImage->Append(ID_NEW_HIDPI, "Show any image as &HiDPI...\tCtrl-H"); menuImage->Append( ID_INFO, "Show image &information...\tCtrl-I"); #ifdef wxHAVE_RAW_BITMAP menuImage->AppendSeparator(); @@ -752,7 +752,7 @@ wxString MyFrame::LoadUserImage(wxImage& image) { if ( !image.LoadFile(filename) ) { - wxLogError("Couldn't load image from '%s'.", filename.c_str()); + wxLogError("Couldn't load image from '%s'.", filename); return wxEmptyString; } @@ -962,7 +962,7 @@ void MyFrame::OnThumbnail( wxCommandEvent &WXUNUSED(event) ) wxStopWatch sw; if ( !image.LoadFile(filename) ) { - wxLogError("Couldn't load image from '%s'.", filename.c_str()); + wxLogError("Couldn't load image from '%s'.", filename); return; } diff --git a/samples/internat/internat.cpp b/samples/internat/internat.cpp index e0b27439f7..44dd60862f 100644 --- a/samples/internat/internat.cpp +++ b/samples/internat/internat.cpp @@ -361,7 +361,7 @@ void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) wxString canname = m_locale.GetCanonicalName(); localeInfo.Printf(_("Language: %s\nSystem locale name: %s\nCanonical locale name: %s\n"), - locale.c_str(), sysname.c_str(), canname.c_str() ); + locale, sysname, canname ); wxMessageDialog dlg( this, @@ -397,8 +397,8 @@ void MyFrame::OnPlay(wxCommandEvent& WXUNUSED(event)) } else if ( num == 9 ) { - // this message is not translated (not in catalog) because we used wxT() - // and not _() around it + // this message is not translated (not in catalog) because we + // did not put _() around it str = "You've found a bug in this program!"; } else if ( num == 17 ) @@ -445,17 +445,17 @@ void MyFrame::OnTestLocaleAvail(wxCommandEvent& WXUNUSED(event)) const wxLanguageInfo * const info = wxLocale::FindLanguageInfo(s_locale); if ( !info ) { - wxLogError(_("Locale \"%s\" is unknown."), s_locale.c_str()); + wxLogError(_("Locale \"%s\" is unknown."), s_locale); return; } if ( wxLocale::IsAvailable(info->Language) ) { - wxLogMessage(_("Locale \"%s\" is available."), s_locale.c_str()); + wxLogMessage(_("Locale \"%s\" is available."), s_locale); } else { - wxLogWarning(_("Locale \"%s\" is not available."), s_locale.c_str()); + wxLogWarning(_("Locale \"%s\" is not available."), s_locale); } } diff --git a/samples/ipc/client.cpp b/samples/ipc/client.cpp index cea7e80e80..3ce598f487 100644 --- a/samples/ipc/client.cpp +++ b/samples/ipc/client.cpp @@ -251,8 +251,8 @@ void MyFrame::OnStart(wxCommandEvent& WXUNUSED(event)) m_client = new MyClient; bool retval = m_client->Connect(hostname, servername, topic); - wxLogMessage(wxT("Client host=\"%s\" port=\"%s\" topic=\"%s\" %s"), - hostname.c_str(), servername.c_str(), topic.c_str(), + wxLogMessage("Client host=\"%s\" port=\"%s\" topic=\"%s\" %s", + hostname, servername, topic, retval ? "connected" : "failed to connect"); if (!retval) diff --git a/samples/ipc/connection.h b/samples/ipc/connection.h index 81ff6e7b12..2a59e21edb 100644 --- a/samples/ipc/connection.h +++ b/samples/ipc/connection.h @@ -24,13 +24,13 @@ protected: { wxString s; if (topic.IsEmpty() && item.IsEmpty()) - s.Printf("%s(", command.c_str()); + s.Printf("%s(", command); else if (topic.IsEmpty()) - s.Printf("%s(item=\"%s\",", command.c_str(), item.c_str()); + s.Printf("%s(item=\"%s\",", command, item); else if (item.IsEmpty()) - s.Printf("%s(topic=\"%s\",", command.c_str(), topic.c_str()); + s.Printf("%s(topic=\"%s\",", command, topic); else - s.Printf("%s(topic=\"%s\",item=\"%s\",", command.c_str(), topic.c_str(), item.c_str()); + s.Printf("%s(topic=\"%s\",item=\"%s\",", command, topic, item); switch (format) { diff --git a/samples/joytest/joytest.cpp b/samples/joytest/joytest.cpp index 1a79c121c2..dd62713eec 100644 --- a/samples/joytest/joytest.cpp +++ b/samples/joytest/joytest.cpp @@ -88,7 +88,7 @@ bool MyApp::OnInit() #if wxUSE_STATUSBAR frame->CreateStatusBar(); - frame->SetStatusText(wxString::Format("Device [%s] (PID:[%i] MID:[%i]) Ready... # of joysticks:[%i]", stick.GetProductName().c_str(), stick.GetProductId(), stick.GetManufacturerId(), wxJoystick::GetNumberJoysticks())); + frame->SetStatusText(wxString::Format("Device [%s] (PID:[%i] MID:[%i]) Ready... # of joysticks:[%i]", stick.GetProductName(), stick.GetProductId(), stick.GetManufacturerId(), wxJoystick::GetNumberJoysticks())); #endif // wxUSE_STATUSBAR frame->CenterOnScreen(); diff --git a/samples/layout/layout.cpp b/samples/layout/layout.cpp index 04c9be5587..290fee2afe 100644 --- a/samples/layout/layout.cpp +++ b/samples/layout/layout.cpp @@ -368,7 +368,7 @@ MyFlexSizerFrame::MyFlexSizerFrame(wxFrame* parent) sizerFlex->SetFlexibleDirection(wxHORIZONTAL); sizerCol2->Add(sizerFlex, 1, wxALL | wxEXPAND, 10); - sizerCol2->Add(new wxStaticText(p, wxID_ANY, wxT("Same with grow mode == \"none\"")), 0, wxCENTER | wxTOP, 20); + sizerCol2->Add(new wxStaticText(p, wxID_ANY, "Same with grow mode == \"none\""), 0, wxCENTER | wxTOP, 20); sizerFlex = new wxFlexGridSizer(3, 3, wxSize(5, 5)); InitFlexSizer(sizerFlex, p); sizerFlex->AddGrowableCol(1); @@ -377,7 +377,7 @@ MyFlexSizerFrame::MyFlexSizerFrame(wxFrame* parent) sizerFlex->SetNonFlexibleGrowMode(wxFLEX_GROWMODE_NONE); sizerCol2->Add(sizerFlex, 1, wxALL | wxEXPAND, 10); - sizerCol2->Add(new wxStaticText(p, wxID_ANY, wxT("Same with grow mode == \"all\"")), 0, wxCENTER | wxTOP, 20); + sizerCol2->Add(new wxStaticText(p, wxID_ANY, "Same with grow mode == \"all\""), 0, wxCENTER | wxTOP, 20); sizerFlex = new wxFlexGridSizer(3, 3, wxSize(5, 5)); InitFlexSizer(sizerFlex, p); sizerFlex->AddGrowableCol(1); @@ -441,15 +441,18 @@ MySizerDialog::MySizerDialog(wxWindow *parent, const wxString &title) // ---------------------------------------------------------------------------- // some simple macros to help make the sample code below more clear -#define TEXTCTRL(text) new wxTextCtrl(p, wxID_ANY, wxT(text)) -#define MLTEXTCTRL(text) new wxTextCtrl(p, wxID_ANY, wxT(text), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE) +#define TEXTCTRL(text) new wxTextCtrl(p, wxID_ANY, text) +#define MLTEXTCTRL(text) new wxTextCtrl(p, wxID_ANY, text, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE) #define POS(r, c) wxGBPosition(r,c) #define SPAN(r, c) wxGBSpan(r,c) -const wxChar gbsDescription[] =wxT("\ -The wxGridBagSizer is similar to the wxFlexGridSizer except the items are explicitly positioned\n\ -in a virtual cell of the layout grid, and column or row spanning is allowed. For example, this\n\ -static text is positioned at (0,0) and it spans 7 columns."); +wxString GetGbsDescription() +{ + return "\ + The wxGridBagSizer is similar to the wxFlexGridSizer except the items are explicitly positioned\n\ + in a virtual cell of the layout grid, and column or row spanning is allowed. For example, this\n\ + static text is positioned at (0,0) and it spans 7 columns."; +} // Some IDs @@ -479,7 +482,7 @@ MyGridBagSizerFrame::MyGridBagSizerFrame(wxFrame* parent) m_gbs = new wxGridBagSizer(); - m_gbs->Add( new wxStaticText(p, wxID_ANY, gbsDescription), + m_gbs->Add( new wxStaticText(p, wxID_ANY, GetGbsDescription()), POS(0,0), SPAN(1, 7), wxALIGN_CENTER | wxALL, 5); @@ -557,9 +560,9 @@ void MyGridBagSizerFrame::OnMoveBtn(wxCommandEvent& event) { if ( m_gbs->CheckForIntersection(wxGBPosition(3,6), wxGBSpan(1,1)) ) wxMessageBox( -wxT("wxGridBagSizer will not allow items to be in the same cell as\n\ +"wxGridBagSizer will not allow items to be in the same cell as\n\ another item, so this operation will fail. You will also get an assert\n\ -when compiled in debug mode."), "Warning", wxOK | wxICON_INFORMATION); +when compiled in debug mode.", "Warning", wxOK | wxICON_INFORMATION); if ( m_gbs->SetItemPosition(btn, wxGBPosition(3,6)) ) { diff --git a/samples/listctrl/listtest.cpp b/samples/listctrl/listtest.cpp index 84d6898b04..a8d38f6520 100644 --- a/samples/listctrl/listtest.cpp +++ b/samples/listctrl/listtest.cpp @@ -95,7 +95,7 @@ bool MyApp::OnInit() return false; // Create the main frame window - MyFrame *frame = new MyFrame(wxT("wxListCtrl Test")); + MyFrame *frame = new MyFrame("wxListCtrl Test"); // Show the frame frame->Show(true); @@ -169,7 +169,7 @@ wxBEGIN_EVENT_TABLE(MyFrame, wxFrame) wxEND_EVENT_TABLE() // My frame constructor -MyFrame::MyFrame(const wxChar *title) +MyFrame::MyFrame(const wxString& title) : wxFrame(NULL, wxID_ANY, title, wxDefaultPosition, wxSize(600, 500)) { m_listCtrl = NULL; @@ -185,17 +185,17 @@ MyFrame::MyFrame(const wxChar *title) m_imageListSmall = new wxImageList(16, 16, true); #ifdef wxHAS_IMAGES_IN_RESOURCES - m_imageListNormal->Add( wxIcon(wxT("icon1"), wxBITMAP_TYPE_ICO_RESOURCE) ); - m_imageListNormal->Add( wxIcon(wxT("icon2"), wxBITMAP_TYPE_ICO_RESOURCE) ); - m_imageListNormal->Add( wxIcon(wxT("icon3"), wxBITMAP_TYPE_ICO_RESOURCE) ); - m_imageListNormal->Add( wxIcon(wxT("icon4"), wxBITMAP_TYPE_ICO_RESOURCE) ); - m_imageListNormal->Add( wxIcon(wxT("icon5"), wxBITMAP_TYPE_ICO_RESOURCE) ); - m_imageListNormal->Add( wxIcon(wxT("icon6"), wxBITMAP_TYPE_ICO_RESOURCE) ); - m_imageListNormal->Add( wxIcon(wxT("icon7"), wxBITMAP_TYPE_ICO_RESOURCE) ); - m_imageListNormal->Add( wxIcon(wxT("icon8"), wxBITMAP_TYPE_ICO_RESOURCE) ); - m_imageListNormal->Add( wxIcon(wxT("icon9"), wxBITMAP_TYPE_ICO_RESOURCE) ); + m_imageListNormal->Add( wxIcon("icon1", wxBITMAP_TYPE_ICO_RESOURCE) ); + m_imageListNormal->Add( wxIcon("icon2", wxBITMAP_TYPE_ICO_RESOURCE) ); + m_imageListNormal->Add( wxIcon("icon3", wxBITMAP_TYPE_ICO_RESOURCE) ); + m_imageListNormal->Add( wxIcon("icon4", wxBITMAP_TYPE_ICO_RESOURCE) ); + m_imageListNormal->Add( wxIcon("icon5", wxBITMAP_TYPE_ICO_RESOURCE) ); + m_imageListNormal->Add( wxIcon("icon6", wxBITMAP_TYPE_ICO_RESOURCE) ); + m_imageListNormal->Add( wxIcon("icon7", wxBITMAP_TYPE_ICO_RESOURCE) ); + m_imageListNormal->Add( wxIcon("icon8", wxBITMAP_TYPE_ICO_RESOURCE) ); + m_imageListNormal->Add( wxIcon("icon9", wxBITMAP_TYPE_ICO_RESOURCE) ); - m_imageListSmall->Add( wxIcon(wxT("iconsmall"), wxBITMAP_TYPE_ICO_RESOURCE) ); + m_imageListSmall->Add( wxIcon("iconsmall", wxBITMAP_TYPE_ICO_RESOURCE) ); #else m_imageListNormal->Add( wxIcon( toolbrai_xpm ) ); @@ -213,77 +213,77 @@ MyFrame::MyFrame(const wxChar *title) // Make a menubar wxMenu *menuFile = new wxMenu; - menuFile->Append(LIST_ABOUT, wxT("&About")); + menuFile->Append(LIST_ABOUT, "&About"); menuFile->AppendSeparator(); - menuFile->Append(LIST_QUIT, wxT("E&xit\tAlt-X")); + menuFile->Append(LIST_QUIT, "E&xit\tAlt-X"); wxMenu *menuView = new wxMenu; - menuView->Append(LIST_LIST_VIEW, wxT("&List view\tF1")); - menuView->Append(LIST_REPORT_VIEW, wxT("&Report view\tF2")); - menuView->Append(LIST_ICON_VIEW, wxT("&Icon view\tF3")); - menuView->Append(LIST_ICON_TEXT_VIEW, wxT("Icon view with &text\tF4")); - menuView->Append(LIST_SMALL_ICON_VIEW, wxT("&Small icon view\tF5")); - menuView->Append(LIST_SMALL_ICON_TEXT_VIEW, wxT("Small icon &view with text\tF6")); - menuView->Append(LIST_VIRTUAL_VIEW, wxT("&Virtual view\tF7")); - menuView->Append(LIST_SMALL_VIRTUAL_VIEW, wxT("Small virtual vie&w\tF8")); + menuView->Append(LIST_LIST_VIEW, "&List view\tF1"); + menuView->Append(LIST_REPORT_VIEW, "&Report view\tF2"); + menuView->Append(LIST_ICON_VIEW, "&Icon view\tF3"); + menuView->Append(LIST_ICON_TEXT_VIEW, "Icon view with &text\tF4"); + menuView->Append(LIST_SMALL_ICON_VIEW, "&Small icon view\tF5"); + menuView->Append(LIST_SMALL_ICON_TEXT_VIEW, "Small icon &view with text\tF6"); + menuView->Append(LIST_VIRTUAL_VIEW, "&Virtual view\tF7"); + menuView->Append(LIST_SMALL_VIRTUAL_VIEW, "Small virtual vie&w\tF8"); menuView->AppendSeparator(); menuView->Append(LIST_SET_ITEMS_COUNT, "Set &number of items"); #ifdef __WXOSX__ menuView->AppendSeparator(); - menuView->AppendCheckItem(LIST_MAC_USE_GENERIC, wxT("Mac: Use Generic Control")); + menuView->AppendCheckItem(LIST_MAC_USE_GENERIC, "Mac: Use Generic Control"); #endif wxMenu *menuList = new wxMenu; - menuList->Append(LIST_GOTO, wxT("&Go to item #3\tCtrl-3")); - menuList->Append(LIST_FOCUS_LAST, wxT("&Make last item current\tCtrl-L")); - menuList->Append(LIST_TOGGLE_FIRST, wxT("To&ggle first item\tCtrl-G")); - menuList->Append(LIST_DESELECT_ALL, wxT("&Deselect All\tCtrl-D")); - menuList->Append(LIST_SELECT_ALL, wxT("S&elect All\tCtrl-A")); + menuList->Append(LIST_GOTO, "&Go to item #3\tCtrl-3"); + menuList->Append(LIST_FOCUS_LAST, "&Make last item current\tCtrl-L"); + menuList->Append(LIST_TOGGLE_FIRST, "To&ggle first item\tCtrl-G"); + menuList->Append(LIST_DESELECT_ALL, "&Deselect All\tCtrl-D"); + menuList->Append(LIST_SELECT_ALL, "S&elect All\tCtrl-A"); menuList->AppendSeparator(); - menuList->Append(LIST_SHOW_COL_INFO, wxT("Show &column info\tCtrl-C")); - menuList->Append(LIST_SHOW_SEL_INFO, wxT("Show &selected items\tCtrl-S")); - menuList->Append(LIST_SHOW_VIEW_RECT, wxT("Show &view rect")); + menuList->Append(LIST_SHOW_COL_INFO, "Show &column info\tCtrl-C"); + menuList->Append(LIST_SHOW_SEL_INFO, "Show &selected items\tCtrl-S"); + menuList->Append(LIST_SHOW_VIEW_RECT, "Show &view rect"); #ifdef wxHAS_LISTCTRL_COLUMN_ORDER - menuList->Append(LIST_SET_COL_ORDER, wxT("Se&t columns order\tShift-Ctrl-O")); - menuList->Append(LIST_GET_COL_ORDER, wxT("Sho&w columns order\tCtrl-O")); + menuList->Append(LIST_SET_COL_ORDER, "Se&t columns order\tShift-Ctrl-O"); + menuList->Append(LIST_GET_COL_ORDER, "Sho&w columns order\tCtrl-O"); #endif // wxHAS_LISTCTRL_COLUMN_ORDER menuList->AppendSeparator(); - menuList->Append(LIST_SORT, wxT("Sor&t\tCtrl-T")); + menuList->Append(LIST_SORT, "Sor&t\tCtrl-T"); menuList->Append(LIST_FIND, "Test Find() performance"); menuList->AppendSeparator(); - menuList->Append(LIST_ADD, wxT("&Append an item\tCtrl-P")); - menuList->Append(LIST_EDIT, wxT("&Edit the item\tCtrl-E")); - menuList->Append(LIST_DELETE, wxT("&Delete first item\tCtrl-X")); - menuList->Append(LIST_DELETE_ALL, wxT("Delete &all items")); + menuList->Append(LIST_ADD, "&Append an item\tCtrl-P"); + menuList->Append(LIST_EDIT, "&Edit the item\tCtrl-E"); + menuList->Append(LIST_DELETE, "&Delete first item\tCtrl-X"); + menuList->Append(LIST_DELETE_ALL, "Delete &all items"); menuList->AppendSeparator(); - menuList->Append(LIST_FREEZE, wxT("Free&ze\tCtrl-Z")); - menuList->Append(LIST_THAW, wxT("Tha&w\tCtrl-W")); + menuList->Append(LIST_FREEZE, "Free&ze\tCtrl-Z"); + menuList->Append(LIST_THAW, "Tha&w\tCtrl-W"); menuList->AppendSeparator(); - menuList->AppendCheckItem(LIST_TOGGLE_LINES, wxT("Toggle &lines\tCtrl-I")); + menuList->AppendCheckItem(LIST_TOGGLE_LINES, "Toggle &lines\tCtrl-I"); menuList->AppendCheckItem(LIST_TOGGLE_MULTI_SEL, - wxT("&Multiple selection\tCtrl-M")); + "&Multiple selection\tCtrl-M"); menuList->Check(LIST_TOGGLE_MULTI_SEL, true); menuList->AppendCheckItem(LIST_TOGGLE_HEADER, "Toggle &header\tCtrl-H"); menuList->Check(LIST_TOGGLE_HEADER, true); menuList->AppendCheckItem(LIST_TOGGLE_BELL, "Toggle &bell on no match"); menuList->AppendSeparator(); menuList->AppendCheckItem(LIST_TOGGLE_CHECKBOXES, - wxT("&Enable Checkboxes")); + "&Enable Checkboxes"); menuList->Check(LIST_TOGGLE_CHECKBOXES, true); - menuList->Append(LIST_TOGGLE_CHECKBOX, wxT("Toggle the item checkbox state")); - menuList->Append(LIST_GET_CHECKBOX, wxT("Get the item checkbox state")); + menuList->Append(LIST_TOGGLE_CHECKBOX, "Toggle the item checkbox state"); + menuList->Append(LIST_GET_CHECKBOX, "Get the item checkbox state"); wxMenu *menuCol = new wxMenu; - menuCol->Append(LIST_SET_FG_COL, wxT("&Foreground colour...")); - menuCol->Append(LIST_SET_BG_COL, wxT("&Background colour...")); - menuCol->AppendCheckItem(LIST_ROW_LINES, wxT("Alternating colours")); + menuCol->Append(LIST_SET_FG_COL, "&Foreground colour..."); + menuCol->Append(LIST_SET_BG_COL, "&Background colour..."); + menuCol->AppendCheckItem(LIST_ROW_LINES, "Alternating colours"); menuCol->AppendCheckItem(LIST_CUSTOM_HEADER_ATTR, "&Custom header attributes"); wxMenuBar *menubar = new wxMenuBar; - menubar->Append(menuFile, wxT("&File")); - menubar->Append(menuView, wxT("&View")); - menubar->Append(menuList, wxT("&List")); - menubar->Append(menuCol, wxT("&Colour")); + menubar->Append(menuFile, "&File"); + menubar->Append(menuView, "&View"); + menubar->Append(menuList, "&List"); + menubar->Append(menuCol, "&Colour"); SetMenuBar(menubar); m_panel = new wxPanel(this, wxID_ANY); @@ -327,7 +327,7 @@ bool MyFrame::CheckNonVirtual() const return true; // "this" == whatever - wxLogWarning(wxT("Can't do this in virtual view, sorry.")); + wxLogWarning("Can't do this in virtual view, sorry."); return false; } @@ -339,22 +339,22 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { - wxMessageDialog dialog(this, wxT("List test sample\nJulian Smart (c) 1997"), - wxT("About list test")); + wxMessageDialog dialog(this, "List test sample\nJulian Smart (c) 1997", + "About list test"); dialog.ShowModal(); } void MyFrame::OnFreeze(wxCommandEvent& WXUNUSED(event)) { - wxLogMessage(wxT("Freezing the control")); + wxLogMessage("Freezing the control"); m_listCtrl->Freeze(); } void MyFrame::OnThaw(wxCommandEvent& WXUNUSED(event)) { - wxLogMessage(wxT("Thawing the control")); + wxLogMessage("Thawing the control"); m_listCtrl->Thaw(); } @@ -380,7 +380,7 @@ void MyFrame::OnToggleBell(wxCommandEvent& event) void MyFrame::OnToggleMacUseGeneric(wxCommandEvent& event) { - wxSystemOptions::SetOption(wxT("mac.listctrl.always_use_generic"), event.IsChecked()); + wxSystemOptions::SetOption("mac.listctrl.always_use_generic", event.IsChecked()); } #endif // __WXOSX__ @@ -486,7 +486,7 @@ void MyFrame::RecreateList(long flags, bool withText) break; default: - wxFAIL_MSG( wxT("unknown listctrl mode") ); + wxFAIL_MSG( "unknown listctrl mode" ); } wxMenuBar* const mb = GetMenuBar(); @@ -508,7 +508,7 @@ void MyFrame::InitWithListItems() { for ( int i = 0; i < m_numListItems; i++ ) { - m_listCtrl->InsertItem(i, wxString::Format(wxT("Item %d"), i)); + m_listCtrl->InsertItem(i, wxString::Format("Item %d", i)); } } @@ -524,15 +524,15 @@ void MyFrame::InitWithReportItems() // note that under MSW for SetColumnWidth() to work we need to create the // items with images initially even if we specify dummy image id wxListItem itemCol; - itemCol.SetText(wxT("Column 1")); + itemCol.SetText("Column 1"); itemCol.SetImage(-1); m_listCtrl->InsertColumn(0, itemCol); - itemCol.SetText(wxT("Column 2 (auto size excluding header)")); + itemCol.SetText("Column 2 (auto size excluding header)"); itemCol.SetAlign(wxLIST_FORMAT_CENTRE); m_listCtrl->InsertColumn(1, itemCol); - itemCol.SetText(wxT("Column 3 (auto size including header)")); + itemCol.SetText("Column 3 (auto size including header)"); itemCol.SetAlign(wxLIST_FORMAT_RIGHT); m_listCtrl->InsertColumn(2, itemCol); @@ -546,7 +546,7 @@ void MyFrame::InitWithReportItems() m_listCtrl->InsertItemInReportView(i); } - m_logWindow->WriteText(wxString::Format(wxT("%d items inserted in %ldms\n"), + m_logWindow->WriteText(wxString::Format("%d items inserted in %ldms\n", m_numListItems, sw.Time())); m_listCtrl->Show(); @@ -674,14 +674,14 @@ void MyFrame::InitWithVirtualItems() if ( m_smallVirtual ) { - m_listCtrl->AppendColumn(wxT("Animal")); - m_listCtrl->AppendColumn(wxT("Sound")); + m_listCtrl->AppendColumn("Animal"); + m_listCtrl->AppendColumn("Sound"); m_listCtrl->SetItemCount(WXSIZEOF(SMALL_VIRTUAL_VIEW_ITEMS)); } else { - m_listCtrl->AppendColumn(wxT("First Column (size auto)")); - m_listCtrl->AppendColumn(wxT("Second Column (150px)")); + m_listCtrl->AppendColumn("First Column (size auto)"); + m_listCtrl->AppendColumn("Second Column (150px)"); m_listCtrl->SetItemCount(1000000); m_listCtrl->SetColumnWidth(0, wxLIST_AUTOSIZE_USEHEADER); m_listCtrl->SetColumnWidth(1, 150); @@ -694,7 +694,7 @@ void MyFrame::OnSort(wxCommandEvent& WXUNUSED(event)) m_listCtrl->SortItems(MyCompareFunction, 0); - m_logWindow->WriteText(wxString::Format(wxT("Sorting %d items took %ld ms\n"), + m_logWindow->WriteText(wxString::Format("Sorting %d items took %ld ms\n", m_listCtrl->GetItemCount(), sw.Time())); } @@ -714,7 +714,7 @@ void MyFrame::OnFind(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnShowSelInfo(wxCommandEvent& WXUNUSED(event)) { int selCount = m_listCtrl->GetSelectedItemCount(); - wxLogMessage(wxT("%d items selected:"), selCount); + wxLogMessage("%d items selected:", selCount); // don't show too many items size_t shownCount = 0; @@ -723,12 +723,12 @@ void MyFrame::OnShowSelInfo(wxCommandEvent& WXUNUSED(event)) wxLIST_STATE_SELECTED); while ( item != -1 ) { - wxLogMessage(wxT("\t%ld (%s)"), - item, m_listCtrl->GetItemText(item).c_str()); + wxLogMessage("\t%ld (%s)", + item, m_listCtrl->GetItemText(item)); if ( ++shownCount > 10 ) { - wxLogMessage(wxT("\t... more selected items snipped...")); + wxLogMessage("\t... more selected items snipped..."); break; } @@ -812,10 +812,10 @@ void MyFrame::OnGetColOrder(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnShowColInfo(wxCommandEvent& WXUNUSED(event)) { int count = m_listCtrl->GetColumnCount(); - wxLogMessage(wxT("%d columns:"), count); + wxLogMessage("%d columns:", count); for ( int c = 0; c < count; c++ ) { - wxLogMessage(wxT("\tcolumn %d has width %d"), c, + wxLogMessage("\tcolumn %d has width %d", c, m_listCtrl->GetColumnWidth(c)); } } @@ -833,8 +833,8 @@ void MyFrame::OnToggleMultiSel(wxCommandEvent& WXUNUSED(event)) else flags |= wxLC_SINGLE_SEL; - m_logWindow->WriteText(wxString::Format(wxT("Current selection mode: %sle\n"), - (flags & wxLC_SINGLE_SEL) ? wxT("sing") : wxT("multip"))); + m_logWindow->WriteText(wxString::Format("Current selection mode: %sle\n", + (flags & wxLC_SINGLE_SEL) ? "sing" : "multip")); RecreateList(flags); } @@ -909,7 +909,7 @@ void MyFrame::OnCustomHeaderAttr(wxCommandEvent& event) void MyFrame::OnAdd(wxCommandEvent& WXUNUSED(event)) { - m_listCtrl->InsertItem(m_listCtrl->GetItemCount(), wxT("Appended item")); + m_listCtrl->InsertItem(m_listCtrl->GetItemCount(), "Appended item"); } void MyFrame::OnEdit(wxCommandEvent& WXUNUSED(event)) @@ -932,7 +932,7 @@ void MyFrame::OnEdit(wxCommandEvent& WXUNUSED(event)) } else { - m_logWindow->WriteText(wxT("No item to edit")); + m_logWindow->WriteText("No item to edit"); } } } @@ -957,7 +957,7 @@ void MyFrame::OnGetItemCheckBox(wxCommandEvent& WXUNUSED(event)) { bool checked = m_listCtrl->IsItemChecked(item); - wxLogMessage(wxT("Item %ld is %s"), item, checked ? wxT("checked") : wxT("unchecked")); + wxLogMessage("Item %ld is %s", item, checked ? "checked" : "unchecked"); item = m_listCtrl->GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); @@ -972,7 +972,7 @@ void MyFrame::OnDelete(wxCommandEvent& WXUNUSED(event)) } else { - m_logWindow->WriteText(wxT("Nothing to delete")); + m_logWindow->WriteText("Nothing to delete"); } } @@ -984,7 +984,7 @@ void MyFrame::OnDeleteAll(wxCommandEvent& WXUNUSED(event)) m_listCtrl->DeleteAllItems(); - m_logWindow->WriteText(wxString::Format(wxT("Deleting %d items took %ld ms\n"), + m_logWindow->WriteText(wxString::Format("Deleting %d items took %ld ms\n", itemCount, sw.Time())); } @@ -1029,7 +1029,7 @@ wxEND_EVENT_TABLE() void MyListCtrl::OnCacheHint(wxListEvent& event) { - wxLogMessage( wxT("OnCacheHint: cache items %ld..%ld"), + wxLogMessage( "OnCacheHint: cache items %ld..%ld", event.GetCacheFrom(), event.GetCacheTo() ); } @@ -1050,7 +1050,7 @@ void MyListCtrl::OnColClick(wxListEvent& event) x = !x; SetColumnImage(col, x ? 0 : -1); - wxLogMessage( wxT("OnColumnClick at %d."), col ); + wxLogMessage( "OnColumnClick at %d.", col ); } void MyListCtrl::OnColRightClick(wxListEvent& event) @@ -1062,18 +1062,18 @@ void MyListCtrl::OnColRightClick(wxListEvent& event) } // Show popupmenu at position - wxMenu menu(wxT("Test")); - menu.Append(LIST_ABOUT, wxT("&About")); + wxMenu menu("Test"); + menu.Append(LIST_ABOUT, "&About"); PopupMenu(&menu, event.GetPoint()); - wxLogMessage( wxT("OnColumnRightClick at %d."), event.GetColumn() ); + wxLogMessage( "OnColumnRightClick at %d.", event.GetColumn() ); } -void MyListCtrl::LogColEvent(const wxListEvent& event, const wxChar *name) +void MyListCtrl::LogColEvent(const wxListEvent& event, const wxString& name) { const int col = event.GetColumn(); - wxLogMessage(wxT("%s: column %d (width = %d or %d)."), + wxLogMessage("%s: column %d (width = %d or %d).", name, col, event.GetItem().GetWidth(), @@ -1082,11 +1082,11 @@ void MyListCtrl::LogColEvent(const wxListEvent& event, const wxChar *name) void MyListCtrl::OnColBeginDrag(wxListEvent& event) { - LogColEvent( event, wxT("OnColBeginDrag") ); + LogColEvent( event, "OnColBeginDrag" ); if ( event.GetColumn() == 0 ) { - wxLogMessage(wxT("Resizing this column shouldn't work.")); + wxLogMessage("Resizing this column shouldn't work."); event.Veto(); } @@ -1094,12 +1094,12 @@ void MyListCtrl::OnColBeginDrag(wxListEvent& event) void MyListCtrl::OnColDragging(wxListEvent& event) { - LogColEvent( event, wxT("OnColDragging") ); + LogColEvent( event, "OnColDragging" ); } void MyListCtrl::OnColEndDrag(wxListEvent& event) { - LogColEvent( event, wxT("OnColEndDrag") ); + LogColEvent( event, "OnColEndDrag" ); } void MyListCtrl::OnBeginDrag(wxListEvent& event) @@ -1107,19 +1107,19 @@ void MyListCtrl::OnBeginDrag(wxListEvent& event) const wxPoint& pt = event.m_pointDrag; int flags; - wxLogMessage( wxT("OnBeginDrag at (%d, %d), item %ld."), + wxLogMessage( "OnBeginDrag at (%d, %d), item %ld.", pt.x, pt.y, HitTest(pt, flags) ); } void MyListCtrl::OnBeginRDrag(wxListEvent& event) { - wxLogMessage( wxT("OnBeginRDrag at %d,%d."), + wxLogMessage( "OnBeginRDrag at %d,%d.", event.m_pointDrag.x, event.m_pointDrag.y ); } void MyListCtrl::OnBeginLabelEdit(wxListEvent& event) { - wxLogMessage( wxT("OnBeginLabelEdit: %s"), event.m_item.m_text.c_str()); + wxLogMessage( "OnBeginLabelEdit: %s", event.m_item.m_text); wxTextCtrl * const text = GetEditControl(); if ( !text ) @@ -1134,29 +1134,29 @@ void MyListCtrl::OnBeginLabelEdit(wxListEvent& event) void MyListCtrl::OnEndLabelEdit(wxListEvent& event) { - wxLogMessage( wxT("OnEndLabelEdit: %s"), + wxLogMessage( "OnEndLabelEdit: %s", ( event.IsEditCancelled() ? wxString("[cancelled]") : event.m_item.m_text - ).c_str() + ) ); } void MyListCtrl::OnDeleteItem(wxListEvent& event) { - LogEvent(event, wxT("OnDeleteItem")); - wxLogMessage( wxT("Number of items when delete event is sent: %d"), GetItemCount() ); + LogEvent(event, "OnDeleteItem"); + wxLogMessage( "Number of items when delete event is sent: %d", GetItemCount() ); } void MyListCtrl::OnDeleteAllItems(wxListEvent& event) { - LogEvent(event, wxT("OnDeleteAllItems")); + LogEvent(event, "OnDeleteAllItems"); } void MyListCtrl::OnSelected(wxListEvent& event) { - LogEvent(event, wxT("OnSelected")); + LogEvent(event, "OnSelected"); if ( GetWindowStyle() & wxLC_REPORT ) { @@ -1166,50 +1166,50 @@ void MyListCtrl::OnSelected(wxListEvent& event) info.m_mask = wxLIST_MASK_TEXT; if ( GetItem(info) ) { - wxLogMessage(wxT("Value of the 2nd field of the selected item: %s"), - info.m_text.c_str()); + wxLogMessage("Value of the 2nd field of the selected item: %s", + info.m_text); } else { - wxFAIL_MSG(wxT("wxListCtrl::GetItem() failed")); + wxFAIL_MSG("wxListCtrl::GetItem() failed"); } } } void MyListCtrl::OnDeselected(wxListEvent& event) { - LogEvent(event, wxT("OnDeselected")); + LogEvent(event, "OnDeselected"); } void MyListCtrl::OnActivated(wxListEvent& event) { - LogEvent(event, wxT("OnActivated")); + LogEvent(event, "OnActivated"); } void MyListCtrl::OnFocused(wxListEvent& event) { - LogEvent(event, wxT("OnFocused")); + LogEvent(event, "OnFocused"); event.Skip(); } void MyListCtrl::OnItemRightClick(wxListEvent& event) { - LogEvent(event, wxT("OnItemRightClick")); + LogEvent(event, "OnItemRightClick"); event.Skip(); } void MyListCtrl::OnChecked(wxListEvent& event) { - LogEvent(event, wxT("OnChecked")); + LogEvent(event, "OnChecked"); event.Skip(); } void MyListCtrl::OnUnChecked(wxListEvent& event) { - LogEvent(event, wxT("OnUnChecked")); + LogEvent(event, "OnUnChecked"); event.Skip(); } @@ -1220,7 +1220,7 @@ void MyListCtrl::OnListKeyDown(wxListEvent& event) if ( !wxGetKeyState(WXK_SHIFT) ) { - LogEvent(event, wxT("OnListKeyDown")); + LogEvent(event, "OnListKeyDown"); event.Skip(); return; } @@ -1258,7 +1258,7 @@ void MyListCtrl::OnListKeyDown(wxListEvent& event) item = 0; } - wxLogMessage(wxT("Focusing item %ld"), item); + wxLogMessage("Focusing item %ld", item); SetItemState(item, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED); EnsureVisible(item); @@ -1270,11 +1270,11 @@ void MyListCtrl::OnListKeyDown(wxListEvent& event) wxRect r; if ( !GetItemRect(item, r) ) { - wxLogError(wxT("Failed to retrieve rect of item %ld"), item); + wxLogError("Failed to retrieve rect of item %ld", item); break; } - wxLogMessage(wxT("Bounding rect of item %ld is (%d, %d)-(%d, %d)"), + wxLogMessage("Bounding rect of item %ld is (%d, %d)-(%d, %d)", item, r.x, r.y, r.x + r.width, r.y + r.height); } break; @@ -1297,11 +1297,11 @@ void MyListCtrl::OnListKeyDown(wxListEvent& event) if ( !GetSubItemRect(item, subItem, r, code) ) { - wxLogError(wxT("Failed to retrieve rect of item %ld column %d"), item, subItem + 1); + wxLogError("Failed to retrieve rect of item %ld column %d", item, subItem + 1); break; } - wxLogMessage(wxT("Bounding rect of item %ld column %d is (%d, %d)-(%d, %d)"), + wxLogMessage("Bounding rect of item %ld column %d is (%d, %d)-(%d, %d)", item, subItem + 1, r.x, r.y, r.x + r.width, r.y + r.height); } @@ -1333,7 +1333,7 @@ void MyListCtrl::OnListKeyDown(wxListEvent& event) { DeleteItem(item); - wxLogMessage(wxT("Item %ld deleted"), item); + wxLogMessage("Item %ld deleted", item); // -1 because the indices were shifted by DeleteItem() item = GetNextItem(item - 1, @@ -1357,7 +1357,7 @@ void MyListCtrl::OnListKeyDown(wxListEvent& event) wxFALLTHROUGH; default: - LogEvent(event, wxT("OnListKeyDown")); + LogEvent(event, "OnListKeyDown"); event.Skip(); } @@ -1365,7 +1365,7 @@ void MyListCtrl::OnListKeyDown(wxListEvent& event) void MyListCtrl::OnChar(wxKeyEvent& event) { - wxLogMessage(wxT("Got char event.")); + wxLogMessage("Got char event."); event.Skip(); } @@ -1385,24 +1385,24 @@ void MyListCtrl::OnRightClick(wxMouseEvent& event) wxString where; switch ( flags ) { - case wxLIST_HITTEST_ABOVE: where = wxT("above"); break; - case wxLIST_HITTEST_BELOW: where = wxT("below"); break; - case wxLIST_HITTEST_NOWHERE: where = wxT("nowhere near"); break; - case wxLIST_HITTEST_ONITEMICON: where = wxT("on icon of"); break; - case wxLIST_HITTEST_ONITEMLABEL: where = wxT("on label of"); break; - case wxLIST_HITTEST_ONITEMRIGHT: where = wxT("right on"); break; - case wxLIST_HITTEST_TOLEFT: where = wxT("to the left of"); break; - case wxLIST_HITTEST_TORIGHT: where = wxT("to the right of"); break; - default: where = wxT("not clear exactly where on"); break; + case wxLIST_HITTEST_ABOVE: where = "above"; break; + case wxLIST_HITTEST_BELOW: where = "below"; break; + case wxLIST_HITTEST_NOWHERE: where = "nowhere near"; break; + case wxLIST_HITTEST_ONITEMICON: where = "on icon of"; break; + case wxLIST_HITTEST_ONITEMLABEL: where = "on label of"; break; + case wxLIST_HITTEST_ONITEMRIGHT: where = "right on"; break; + case wxLIST_HITTEST_TOLEFT: where = "to the left of"; break; + case wxLIST_HITTEST_TORIGHT: where = "to the right of"; break; + default: where = "not clear exactly where on"; break; } - wxLogMessage(wxT("Right double click %s item %ld, subitem %ld"), - where.c_str(), item, subitem); + wxLogMessage("Right double click %s item %ld, subitem %ld", + where, item, subitem); } -void MyListCtrl::LogEvent(const wxListEvent& event, const wxChar *eventName) +void MyListCtrl::LogEvent(const wxListEvent& event, const wxString& eventName) { - wxLogMessage(wxT("Item %ld: %s (item text = %s, data = %ld)"), + wxLogMessage("Item %ld: %s (item text = %s, data = %ld)", event.GetIndex(), eventName, event.GetText(), static_cast(event.GetData())); } @@ -1415,7 +1415,7 @@ wxString MyListCtrl::OnGetItemText(long item, long column) const } else // "big" virtual control { - return wxString::Format(wxT("Column %ld of item %ld"), column, item); + return wxString::Format("Column %ld of item %ld", column, item); } } @@ -1446,14 +1446,14 @@ wxItemAttr *MyListCtrl::OnGetItemAttr(long item) const void MyListCtrl::InsertItemInReportView(int i) { wxString buf; - buf.Printf(wxT("This is item %d"), i); + buf.Printf("This is item %d", i); long tmp = InsertItem(i, buf, 0); SetItemData(tmp, i); - buf.Printf(wxT("Col 1, item %d"), i); + buf.Printf("Col 1, item %d", i); SetItem(tmp, 1, buf); - buf.Printf(wxT("Item %d in column 2"), i); + buf.Printf("Item %d in column 2", i); SetItem(tmp, 2, buf); } @@ -1490,9 +1490,9 @@ void MyListCtrl::ShowContextMenu(const wxPoint& pos) { wxMenu menu; - menu.Append(wxID_ABOUT, wxT("&About")); + menu.Append(wxID_ABOUT, "&About"); menu.AppendSeparator(); - menu.Append(wxID_EXIT, wxT("E&xit")); + menu.Append(wxID_EXIT, "E&xit"); PopupMenu(&menu, pos.x, pos.y); } diff --git a/samples/listctrl/listtest.h b/samples/listctrl/listtest.h index 4f4b8a13f4..e48b5292ef 100644 --- a/samples/listctrl/listtest.h +++ b/samples/listctrl/listtest.h @@ -79,8 +79,8 @@ private: wxLog *m_logOld; void SetColumnImage(int col, int image); - void LogEvent(const wxListEvent& event, const wxChar *eventName); - void LogColEvent(const wxListEvent& event, const wxChar *eventName); + void LogEvent(const wxListEvent& event, const wxString& eventName); + void LogColEvent(const wxListEvent& event, const wxString& eventName); virtual wxString OnGetItemText(long item, long column) const wxOVERRIDE; virtual int OnGetItemColumnImage(long item, long column) const wxOVERRIDE; @@ -97,7 +97,7 @@ private: class MyFrame: public wxFrame { public: - MyFrame(const wxChar *title); + MyFrame(const wxString& title); virtual ~MyFrame(); protected: diff --git a/samples/mediaplayer/mediaplayer.cpp b/samples/mediaplayer/mediaplayer.cpp index 3beb0e5c94..9774adbe29 100644 --- a/samples/mediaplayer/mediaplayer.cpp +++ b/samples/mediaplayer/mediaplayer.cpp @@ -1438,8 +1438,8 @@ void wxMediaPlayerTimer::Notify() "State:%s Loops:%i D/T:[%i]/[%i] V:%i%%", videoSize.x, videoSize.y, - sPosition.c_str(), - sDuration.c_str(), + sPosition, + sDuration, currentMediaCtrl->GetPlaybackRate(), wxGetMediaStateText(currentpage->m_mediactrl->GetState()), currentpage->m_nLoops, diff --git a/samples/menu/menu.cpp b/samples/menu/menu.cpp index 3501d2a243..2302bbbf88 100644 --- a/samples/menu/menu.cpp +++ b/samples/menu/menu.cpp @@ -674,9 +674,9 @@ MyFrame::MyFrame() wxLog::DisableTimestamp(); m_logOld = wxLog::SetActiveTarget(new wxLogTextCtrl(m_textctrl)); - wxLogMessage(wxT("Brief explanations: the commands in the \"Menu\" menu ") - wxT("append/insert/delete items to/from the \"Test\" menu.\n") - wxT("The commands in the \"Menubar\" menu work with the ") + wxLogMessage("Brief explanations: the commands in the \"Menu\" menu " + "append/insert/delete items to/from the \"Test\" menu.\n" + "The commands in the \"Menubar\" menu work with the " "menubar itself.\n\n" "Right click the band below to test popup menus.\n"); #endif @@ -850,7 +850,7 @@ void MyFrame::OnGetLabelMenu(wxCommandEvent& WXUNUSED(event)) wxCHECK_RET( count, "no last menu?" ); wxLogMessage("The label of the last menu item is '%s'", - mbar->GetMenuLabel(count - 1).c_str()); + mbar->GetMenuLabel(count - 1)); } #if wxUSE_TEXTDLG @@ -896,11 +896,11 @@ void MyFrame::OnFindMenu(wxCommandEvent& WXUNUSED(event)) if (index == wxNOT_FOUND) { - wxLogWarning("No menu with label '%s'", label.c_str()); + wxLogWarning("No menu with label '%s'", label); } else { - wxLogMessage("Menu %d has label '%s'", index, label.c_str()); + wxLogMessage("Menu %d has label '%s'", index, label); } } } @@ -1016,7 +1016,7 @@ void MyFrame::OnGetLabelMenuItem(wxCommandEvent& WXUNUSED(event)) { wxString label = item->GetItemLabel(); wxLogMessage("The label of the last menu item is '%s'", - label.c_str()); + label); } } @@ -1146,12 +1146,12 @@ void MyFrame::OnFindMenuItem(wxCommandEvent& WXUNUSED(event)) } if (index == wxNOT_FOUND) { - wxLogWarning("No menu item with label '%s'", label.c_str()); + wxLogWarning("No menu item with label '%s'", label); } else { wxLogMessage("Menu item %d in menu %lu has label '%s'", - index, (unsigned long)menuindex, label.c_str()); + index, (unsigned long)menuindex, label); } } } @@ -1252,7 +1252,7 @@ void MyFrame::LogMenuOpenCloseOrHighlight(const wxMenuEvent& event, const wxStri msg << "."; - wxLogStatus(this, msg.c_str()); + wxLogStatus(this, msg); } #endif diff --git a/samples/notebook/notebook.cpp b/samples/notebook/notebook.cpp index 9d53b15d94..8ccfe60d9e 100644 --- a/samples/notebook/notebook.cpp +++ b/samples/notebook/notebook.cpp @@ -70,7 +70,7 @@ wxPanel *CreateUserCreatedPage(wxBookCtrlBase *parent) wxPanel *panel = new wxPanel(parent); #if wxUSE_HELP - panel->SetHelpText( wxT( "Panel with a Button" ) ); + panel->SetHelpText("Panel with a Button"); #endif (void) new wxButton( panel, wxID_ANY, "Button", @@ -84,7 +84,7 @@ wxPanel *CreateRadioButtonsPage(wxBookCtrlBase *parent) wxPanel *panel = new wxPanel(parent); #if wxUSE_HELP - panel->SetHelpText( wxT( "Panel with some Radio Buttons" ) ); + panel->SetHelpText("Panel with some Radio Buttons"); #endif wxString animals[] = @@ -115,7 +115,7 @@ wxPanel *CreateVetoPage(wxBookCtrlBase *parent) wxPanel *panel = new wxPanel(parent); #if wxUSE_HELP - panel->SetHelpText( wxT( "An empty panel" ) ); + panel->SetHelpText("An empty panel"); #endif (void) new wxStaticText( panel, wxID_ANY, @@ -130,7 +130,7 @@ wxPanel *CreateBigButtonPage(wxBookCtrlBase *parent) wxPanel *panel = new wxPanel(parent); #if wxUSE_HELP - panel->SetHelpText( wxT( "Panel with a maximized button" ) ); + panel->SetHelpText("Panel with a maximized button"); #endif wxButton *buttonBig = new wxButton(panel, wxID_ANY, "Maximized button"); @@ -147,7 +147,7 @@ wxPanel *CreateInsertPage(wxBookCtrlBase *parent) wxPanel *panel = new wxPanel(parent); #if wxUSE_HELP - panel->SetHelpText( wxT( "Maroon panel" ) ); + panel->SetHelpText("Maroon panel"); #endif panel->SetBackgroundColour( wxColour( "MAROON" ) ); @@ -642,7 +642,7 @@ wxPanel *MyFrame::CreateNewPage() const wxPanel *panel = new wxPanel(m_bookCtrl, wxID_ANY ); #if wxUSE_HELP - panel->SetHelpText( wxT( "Panel with \"First\" and \"Second\" buttons" ) ); + panel->SetHelpText("Panel with \"First\" and \"Second\" buttons"); #endif (void) new wxButton(panel, wxID_ANY, "First button", wxPoint(10, 30)); @@ -686,7 +686,7 @@ void MyFrame::OnHitTest(wxCommandEvent& WXUNUSED(event)) pt.x, pt.y, pagePos, - flagsStr.c_str()); + flagsStr); } void MyFrame::OnType(wxCommandEvent& event) @@ -960,7 +960,7 @@ void MyFrame::OnIdle( wxIdleEvent& WXUNUSED(event) ) selection << nSel; wxString title; - title.Printf("Notebook and friends (%d pages, selection: %s)", nPages, selection.c_str()); + title.Printf("Notebook and friends (%d pages, selection: %s)", nPages, selection); SetTitle(title); } @@ -1073,13 +1073,13 @@ void MyFrame::OnBookCtrl(wxBookCtrlBaseEvent& event) wxLogMessage("Event #%d: %s: %s (%d) new sel %d, old %d, current %d%s", ++s_num, - nameControl.c_str(), - nameEvent.c_str(), + nameControl, + nameEvent, eventType, event.GetSelection(), event.GetOldSelection(), book->GetSelection(), - veto.c_str()); + veto); #if USE_LOG m_text->SetInsertionPointEnd(); diff --git a/samples/opengl/isosurf/isosurf.cpp b/samples/opengl/isosurf/isosurf.cpp index e5e40fcb23..46e02d055c 100644 --- a/samples/opengl/isosurf/isosurf.cpp +++ b/samples/opengl/isosurf/isosurf.cpp @@ -198,7 +198,7 @@ void TestGLCanvas::LoadSurface(const wxString& filename) new wxZlibInputStream(new wxFFileInputStream(filename)); if (!stream || !stream->IsOk()) { - wxLogError("Cannot load '%s' type of files!", filename.c_str()); + wxLogError("Cannot load '%s' type of files!", filename); delete stream; return; } @@ -226,7 +226,7 @@ void TestGLCanvas::LoadSurface(const wxString& filename) delete stream; wxLogMessage("Loaded %d vertices, %d triangles from '%s'", - m_numverts, m_numverts-2, filename.c_str()); + m_numverts, m_numverts-2, filename); // NOTE: for some reason under wxGTK the following is required to avoid that // the surface gets rendered in a small rectangle in the top-left corner of the frame diff --git a/samples/popup/popup.cpp b/samples/popup/popup.cpp index 0d1bc729e2..1e0cf61912 100644 --- a/samples/popup/popup.cpp +++ b/samples/popup/popup.cpp @@ -135,6 +135,8 @@ SimpleTransientPopup::SimpleTransientPopup( wxWindow *parent, bool scrolled ) topSizer->Add( text, 0, wxALL, 5 ); topSizer->Add( m_button, 0, wxALL, 5 ); topSizer->Add( m_spinCtrl, 0, wxALL, 5 ); + topSizer->Add( new wxTextCtrl(m_panel, wxID_ANY, "Try to type here"), + 0, wxEXPAND|wxALL, 5 ); topSizer->Add( m_mouseText, 0, wxCENTRE|wxALL, 5 ); if ( scrolled ) diff --git a/samples/power/power.cpp b/samples/power/power.cpp index d6c66c701e..6c0f6454f0 100644 --- a/samples/power/power.cpp +++ b/samples/power/power.cpp @@ -179,8 +179,8 @@ private: SetStatusText(wxString::Format( "System is on %s power, battery state is %s", - powerStr.c_str(), - batteryStr.c_str())); + powerStr, + batteryStr)); } void OnStartTaskClicked( wxCommandEvent& WXUNUSED(event) ) diff --git a/samples/printing/printing.cpp b/samples/printing/printing.cpp index 719ccb63bc..bfac9abd3a 100644 --- a/samples/printing/printing.cpp +++ b/samples/printing/printing.cpp @@ -106,7 +106,7 @@ bool MyApp::OnInit(void) m_bitmap = image; #endif m_angle = 30; - m_testFont.Create(10, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL); + m_testFont = wxFontInfo(10).Family(wxFONTFAMILY_SWISS); // Create the main frame window @@ -162,7 +162,7 @@ void MyApp::Draw(wxDC&dc) dc.DrawText( "Test message: this is in 10 point text", 10, 180); - dc.DrawRotatedText( wxS("This\nis\na multi-line\ntext"), 170, 100, -m_angle/1.5); + dc.DrawRotatedText( "This\nis\na multi-line\ntext", 170, 100, -m_angle/1.5); #if wxUSE_UNICODE const char *test = "Hebrew שלום -- Japanese (日本語)"; diff --git a/samples/propgrid/propgrid.cpp b/samples/propgrid/propgrid.cpp index 5112f5a7e3..d323873cf1 100644 --- a/samples/propgrid/propgrid.cpp +++ b/samples/propgrid/propgrid.cpp @@ -107,8 +107,8 @@ wxPGWindowList wxSampleMultiButtonEditor::CreateControls( wxPropertyGrid* propGr wxPGMultiButton* buttons = new wxPGMultiButton( propGrid, sz ); // Add two regular buttons - buttons->Add( wxT("...") ); - buttons->Add( wxT("A") ); + buttons->Add( "..." ); + buttons->Add( "A" ); // Add a bitmap button buttons->Add( wxArtProvider::GetBitmap(wxART_FOLDER) ); @@ -137,19 +137,19 @@ bool wxSampleMultiButtonEditor::OnEvent( wxPropertyGrid* propGrid, if ( event.GetId() == buttons->GetButtonId(0) ) { // Do something when the first button is pressed - wxLogDebug(wxT("First button pressed")); + wxLogDebug("First button pressed"); return false; // Return false since value did not change } if ( event.GetId() == buttons->GetButtonId(1) ) { // Do something when the second button is pressed - wxMessageBox(wxT("Second button pressed")); + wxMessageBox("Second button pressed"); return false; // Return false since value did not change } if ( event.GetId() == buttons->GetButtonId(2) ) { // Do something when the third button is pressed - wxMessageBox(wxT("Third button pressed")); + wxMessageBox("Third button pressed"); return false; // Return false since value did not change } } @@ -181,15 +181,15 @@ public: virtual bool Validate(wxWindow* WXUNUSED(parent)) wxOVERRIDE { wxTextCtrl* tc = wxDynamicCast(GetWindow(), wxTextCtrl); - wxCHECK_MSG(tc, true, wxT("validator window must be wxTextCtrl")); + wxCHECK_MSG(tc, true, "validator window must be wxTextCtrl"); wxString val = tc->GetValue(); if ( val.find(m_invalidWord) == wxString::npos ) return true; - ::wxMessageBox(wxString::Format(wxT("%s is not allowed word"),m_invalidWord.c_str()), - wxT("Validation Failure")); + ::wxMessageBox(wxString::Format("%s is not allowed word",m_invalidWord), + "Validation Failure"); return false; } @@ -217,9 +217,9 @@ wxVectorProperty::wxVectorProperty( const wxString& label, : wxPGProperty(label,name) { SetValue( WXVARIANT(value) ); - AddPrivateChild( new wxFloatProperty(wxT("X"),wxPG_LABEL,value.x) ); - AddPrivateChild( new wxFloatProperty(wxT("Y"),wxPG_LABEL,value.y) ); - AddPrivateChild( new wxFloatProperty(wxT("Z"),wxPG_LABEL,value.z) ); + AddPrivateChild( new wxFloatProperty("X",wxPG_LABEL,value.x) ); + AddPrivateChild( new wxFloatProperty("Y",wxPG_LABEL,value.y) ); + AddPrivateChild( new wxFloatProperty("Z",wxPG_LABEL,value.z) ); } wxVectorProperty::~wxVectorProperty() { } @@ -268,9 +268,9 @@ wxTriangleProperty::wxTriangleProperty( const wxString& label, : wxPGProperty(label,name) { SetValue( WXVARIANT(value) ); - AddPrivateChild( new wxVectorProperty(wxT("A"),wxPG_LABEL,value.a) ); - AddPrivateChild( new wxVectorProperty(wxT("B"),wxPG_LABEL,value.b) ); - AddPrivateChild( new wxVectorProperty(wxT("C"),wxPG_LABEL,value.c) ); + AddPrivateChild( new wxVectorProperty("A",wxPG_LABEL,value.a) ); + AddPrivateChild( new wxVectorProperty("B",wxPG_LABEL,value.b) ); + AddPrivateChild( new wxVectorProperty("C",wxPG_LABEL,value.c) ); } wxTriangleProperty::~wxTriangleProperty() { } @@ -319,8 +319,8 @@ public: virtual bool DoShowDialog( wxPropertyGrid* WXUNUSED(propGrid), wxPGProperty* WXUNUSED(property) ) wxOVERRIDE { - wxString s = ::wxGetSingleChoice(wxT("Message"), - wxT("Caption"), + wxString s = ::wxGetSingleChoice("Message", + "Caption", m_choices.GetLabels()); if ( !s.empty() ) { @@ -346,10 +346,10 @@ public: : wxStringProperty(label, name, value) { // Prepare choices - m_choices.Add(wxT("Cat")); - m_choices.Add(wxT("Dog")); - m_choices.Add(wxT("Gibbon")); - m_choices.Add(wxT("Otter")); + m_choices.Add("Cat"); + m_choices.Add("Dog"); + m_choices.Add("Gibbon"); + m_choices.Add("Otter"); } // Set editor to have button @@ -586,15 +586,15 @@ void FormMain::OnMove( wxMoveEvent& event ) // Must check if properties exist (as they may be deleted). // Using m_pPropGridManager, we can scan all pages automatically. - id = m_pPropGridManager->GetPropertyByName( wxT("X") ); + id = m_pPropGridManager->GetPropertyByName( "X" ); if ( id ) m_pPropGridManager->SetPropertyValue( id, x ); - id = m_pPropGridManager->GetPropertyByName( wxT("Y") ); + id = m_pPropGridManager->GetPropertyByName( "Y" ); if ( id ) m_pPropGridManager->SetPropertyValue( id, y ); - id = m_pPropGridManager->GetPropertyByName( wxT("Position") ); + id = m_pPropGridManager->GetPropertyByName( "Position" ); if ( id ) m_pPropGridManager->SetPropertyValue( id, WXVARIANT(wxPoint(x,y)) ); @@ -624,15 +624,15 @@ void FormMain::OnResize( wxSizeEvent& event ) // Must check if properties exist (as they may be deleted). // Using m_pPropGridManager, we can scan all pages automatically. - p = m_pPropGridManager->GetPropertyByName( wxT("Width") ); + p = m_pPropGridManager->GetPropertyByName( "Width" ); if ( p && !p->IsValueUnspecified() ) m_pPropGridManager->SetPropertyValue( p, w ); - p = m_pPropGridManager->GetPropertyByName( wxT("Height") ); + p = m_pPropGridManager->GetPropertyByName( "Height" ); if ( p && !p->IsValueUnspecified() ) m_pPropGridManager->SetPropertyValue( p, h ); - id = m_pPropGridManager->GetPropertyByName ( wxT("Size") ); + id = m_pPropGridManager->GetPropertyByName ( "Size" ); if ( id ) m_pPropGridManager->SetPropertyValue( id, WXVARIANT(wxSize(w,h)) ); @@ -646,12 +646,12 @@ void FormMain::OnPropertyGridChanging( wxPropertyGridEvent& event ) { wxPGProperty* p = event.GetProperty(); - if ( p->GetName() == wxT("Font") ) + if ( p->GetName() == "Font" ) { int res = - wxMessageBox(wxString::Format(wxT("'%s' is about to change (to variant of type '%s')\n\nAllow or deny?"), - p->GetName().c_str(),event.GetValue().GetType().c_str()), - wxT("Testing wxEVT_PG_CHANGING"), wxYES_NO, m_pPropGridManager); + wxMessageBox(wxString::Format("'%s' is about to change (to variant of type '%s')\n\nAllow or deny?", + p->GetName(),event.GetValue().GetType()), + "Testing wxEVT_PG_CHANGING", wxYES_NO, m_pPropGridManager); if ( res == wxNO ) { @@ -687,20 +687,20 @@ void FormMain::OnPropertyGridChange( wxPropertyGridEvent& event ) return; // Some settings are disabled outside Windows platform - if ( name == wxT("X") ) + if ( name == "X" ) SetSize( value.As(), -1, -1, -1, wxSIZE_USE_EXISTING ); - else if ( name == wxT("Y") ) + else if ( name == "Y" ) // wxPGVariantToInt is safe long int value getter SetSize ( -1, value.As(), -1, -1, wxSIZE_USE_EXISTING ); - else if ( name == wxT("Width") ) + else if ( name == "Width" ) SetSize ( -1, -1, value.As(), -1, wxSIZE_USE_EXISTING ); - else if ( name == wxT("Height") ) + else if ( name == "Height" ) SetSize ( -1, -1, -1, value.As(), wxSIZE_USE_EXISTING ); - else if ( name == wxT("Label") ) + else if ( name == "Label" ) { SetTitle( value.As() ); } - else if ( name == wxT("Password") ) + else if ( name == "Password" ) { static int pwdMode = 0; @@ -710,7 +710,7 @@ void FormMain::OnPropertyGridChange( wxPropertyGridEvent& event ) pwdMode &= 1; } else - if ( name == wxT("Font") ) + if ( name == "Font" ) { wxFont font = value.As(); wxASSERT( font.IsOk() ); @@ -718,22 +718,22 @@ void FormMain::OnPropertyGridChange( wxPropertyGridEvent& event ) m_pPropGridManager->SetFont( font ); } else - if ( name == wxT("Margin Colour") ) + if ( name == "Margin Colour" ) { wxColourPropertyValue cpv = value.As(); m_pPropGridManager->GetGrid()->SetMarginColour( cpv.m_colour ); } - else if ( name == wxT("Cell Colour") ) + else if ( name == "Cell Colour" ) { wxColourPropertyValue cpv = value.As(); m_pPropGridManager->GetGrid()->SetCellBackgroundColour( cpv.m_colour ); } - else if ( name == wxT("Line Colour") ) + else if ( name == "Line Colour" ) { wxColourPropertyValue cpv = value.As(); m_pPropGridManager->GetGrid()->SetLineColour( cpv.m_colour ); } - else if ( name == wxT("Cell Text Colour") ) + else if ( name == "Cell Text Colour" ) { wxColourPropertyValue cpv = value.As(); m_pPropGridManager->GetGrid()->SetCellTextColour( cpv.m_colour ); @@ -749,9 +749,9 @@ void FormMain::OnPropertyGridSelect( wxPropertyGridEvent& event ) { m_itemEnable->Enable( true ); if ( property->IsEnabled() ) - m_itemEnable->SetItemLabel( wxT("Disable") ); + m_itemEnable->SetItemLabel( "Disable" ); else - m_itemEnable->SetItemLabel( wxT("Enable") ); + m_itemEnable->SetItemLabel( "Enable" ); } else { @@ -763,7 +763,7 @@ void FormMain::OnPropertyGridSelect( wxPropertyGridEvent& event ) wxStatusBar* sb = GetStatusBar(); if ( prop ) { - wxString text(wxT("Selected: ")); + wxString text("Selected: "); text += m_pPropGridManager->GetPropertyLabel( prop ); sb->SetStatusText ( text ); } @@ -776,7 +776,7 @@ void FormMain::OnPropertyGridPageChange( wxPropertyGridEvent& WXUNUSED(event) ) { #if wxUSE_STATUSBAR wxStatusBar* sb = GetStatusBar(); - wxString text(wxT("Page Changed: ")); + wxString text("Page Changed: "); text += m_pPropGridManager->GetPageName(m_pPropGridManager->GetSelectedPage()); sb->SetStatusText( text ); #endif @@ -786,16 +786,16 @@ void FormMain::OnPropertyGridPageChange( wxPropertyGridEvent& WXUNUSED(event) ) void FormMain::OnPropertyGridLabelEditBegin( wxPropertyGridEvent& event ) { - wxLogMessage(wxT("wxPG_EVT_LABEL_EDIT_BEGIN(%s)"), - event.GetProperty()->GetLabel().c_str()); + wxLogMessage("wxPG_EVT_LABEL_EDIT_BEGIN(%s)", + event.GetProperty()->GetLabel()); } // ----------------------------------------------------------------------- void FormMain::OnPropertyGridLabelEditEnding( wxPropertyGridEvent& event ) { - wxLogMessage(wxT("wxPG_EVT_LABEL_EDIT_ENDING(%s)"), - event.GetProperty()->GetLabel().c_str()); + wxLogMessage("wxPG_EVT_LABEL_EDIT_ENDING(%s)", + event.GetProperty()->GetLabel()); } // ----------------------------------------------------------------------- @@ -813,9 +813,9 @@ void FormMain::OnPropertyGridItemRightClick( wxPropertyGridEvent& event ) wxStatusBar* sb = GetStatusBar(); if ( prop ) { - wxString text(wxT("Right-clicked: ")); + wxString text("Right-clicked: "); text += prop->GetLabel(); - text += wxT(", name="); + text += ", name="; text += m_pPropGridManager->GetPropertyName(prop); sb->SetStatusText( text ); } @@ -835,9 +835,9 @@ void FormMain::OnPropertyGridItemDoubleClick( wxPropertyGridEvent& event ) wxStatusBar* sb = GetStatusBar(); if ( prop ) { - wxString text(wxT("Double-clicked: ")); + wxString text("Double-clicked: "); text += prop->GetLabel(); - text += wxT(", name="); + text += ", name="; text += m_pPropGridManager->GetPropertyName(prop); sb->SetStatusText ( text ); } @@ -857,15 +857,15 @@ void FormMain::OnPropertyGridButtonClick ( wxCommandEvent& ) wxStatusBar* sb = GetStatusBar(); if ( prop ) { - wxString text(wxT("Button clicked: ")); + wxString text("Button clicked: "); text += m_pPropGridManager->GetPropertyLabel(prop); - text += wxT(", name="); + text += ", name="; text += m_pPropGridManager->GetPropertyName(prop); sb->SetStatusText( text ); } else { - ::wxMessageBox(wxT("SHOULD NOT HAPPEN!!!")); + ::wxMessageBox("SHOULD NOT HAPPEN!!!"); } #endif } @@ -874,14 +874,14 @@ void FormMain::OnPropertyGridButtonClick ( wxCommandEvent& ) void FormMain::OnPropertyGridItemCollapse( wxPropertyGridEvent& ) { - wxLogMessage(wxT("Item was Collapsed")); + wxLogMessage("Item was Collapsed"); } // ----------------------------------------------------------------------- void FormMain::OnPropertyGridItemExpand( wxPropertyGridEvent& ) { - wxLogMessage(wxT("Item was Expanded")); + wxLogMessage("Item was Expanded"); } // ----------------------------------------------------------------------- @@ -890,12 +890,12 @@ void FormMain::OnPropertyGridColBeginDrag( wxPropertyGridEvent& event ) { if ( m_itemVetoDragging->IsChecked() ) { - wxLogMessage(wxT("Splitter %i resize was vetoed"), event.GetColumn()); + wxLogMessage("Splitter %i resize was vetoed", event.GetColumn()); event.Veto(); } else { - wxLogDebug(wxT("Splitter %i resize began"), event.GetColumn()); + wxLogDebug("Splitter %i resize began", event.GetColumn()); } } @@ -905,7 +905,7 @@ void FormMain::OnPropertyGridColDragging( wxPropertyGridEvent& event ) { wxUnusedVar(event); // For now, let's not spam the log output - //wxLogDebug(wxT("Splitter %i is being resized"), event.GetColumn()); + //wxLogDebug("Splitter %i is being resized", event.GetColumn()); } // ----------------------------------------------------------------------- @@ -913,7 +913,7 @@ void FormMain::OnPropertyGridColDragging( wxPropertyGridEvent& event ) void FormMain::OnPropertyGridColEndDrag( wxPropertyGridEvent& event ) { wxUnusedVar(event); - wxLogDebug(wxT("Splitter %i resize ended"), event.GetColumn()); + wxLogDebug("Splitter %i resize ended", event.GetColumn()); } // ----------------------------------------------------------------------- @@ -943,26 +943,25 @@ void FormMain::OnLabelTextChange( wxCommandEvent& WXUNUSED(event) ) // ----------------------------------------------------------------------- -static const wxChar* _fs_windowstyle_labels[] = { - wxT("wxSIMPLE_BORDER"), - wxT("wxDOUBLE_BORDER"), - wxT("wxSUNKEN_BORDER"), - wxT("wxRAISED_BORDER"), - wxT("wxNO_BORDER"), - wxT("wxTRANSPARENT_WINDOW"), - wxT("wxTAB_TRAVERSAL"), - wxT("wxWANTS_CHARS"), +static const wxString _fs_windowstyle_labels[] = { + "wxSIMPLE_BORDER", + "wxDOUBLE_BORDER", + "wxSUNKEN_BORDER", + "wxRAISED_BORDER", + "wxNO_BORDER", + "wxTRANSPARENT_WINDOW", + "wxTAB_TRAVERSAL", + "wxWANTS_CHARS", #if wxNO_FULL_REPAINT_ON_RESIZE - wxT("wxNO_FULL_REPAINT_ON_RESIZE"), + "wxNO_FULL_REPAINT_ON_RESIZE", #endif - wxT("wxVSCROLL"), - wxT("wxALWAYS_SHOW_SB"), - wxT("wxCLIP_CHILDREN"), + "wxVSCROLL", + "wxALWAYS_SHOW_SB", + "wxCLIP_CHILDREN", #if wxFULL_REPAINT_ON_RESIZE - wxT("wxFULL_REPAINT_ON_RESIZE"), + "wxFULL_REPAINT_ON_RESIZE", #endif - (const wxChar*) NULL // terminator is always needed -}; + }; static const long _fs_windowstyle_values[] = { wxSIMPLE_BORDER, @@ -984,19 +983,18 @@ static const long _fs_windowstyle_values[] = { #endif }; -static const wxChar* _fs_framestyle_labels[] = { - wxT("wxCAPTION"), - wxT("wxMINIMIZE"), - wxT("wxMAXIMIZE"), - wxT("wxCLOSE_BOX"), - wxT("wxSTAY_ON_TOP"), - wxT("wxSYSTEM_MENU"), - wxT("wxRESIZE_BORDER"), - wxT("wxFRAME_TOOL_WINDOW"), - wxT("wxFRAME_NO_TASKBAR"), - wxT("wxFRAME_FLOAT_ON_PARENT"), - wxT("wxFRAME_SHAPED"), - (const wxChar*) NULL +static const wxString _fs_framestyle_labels[] = { + "wxCAPTION", + "wxMINIMIZE", + "wxMAXIMIZE", + "wxCLOSE_BOX", + "wxSTAY_ON_TOP", + "wxSYSTEM_MENU", + "wxRESIZE_BORDER", + "wxFRAME_TOOL_WINDOW", + "wxFRAME_NO_TASKBAR", + "wxFRAME_FLOAT_ON_PARENT", + "wxFRAME_SHAPED" }; static const long _fs_framestyle_values[] = { @@ -1012,12 +1010,9 @@ static const long _fs_framestyle_values[] = { wxFRAME_FLOAT_ON_PARENT, wxFRAME_SHAPED }; - -// ----------------------------------------------------------------------- - void FormMain::OnTestXRC(wxCommandEvent& WXUNUSED(event)) { - wxMessageBox(wxT("Sorry, not yet implemented")); + wxMessageBox("Sorry, not yet implemented"); } void FormMain::OnEnableCommonValues(wxCommandEvent& WXUNUSED(event)) @@ -1026,113 +1021,113 @@ void FormMain::OnEnableCommonValues(wxCommandEvent& WXUNUSED(event)) if ( prop ) prop->EnableCommonValue(); else - wxMessageBox(wxT("First select a property")); + wxMessageBox("First select a property"); } void FormMain::PopulateWithStandardItems () { wxPropertyGridManager* pgman = m_pPropGridManager; - wxPropertyGridPage* pg = pgman->GetPage(wxT("Standard Items")); + wxPropertyGridPage* pg = pgman->GetPage("Standard Items"); // Append is ideal way to add items to wxPropertyGrid. - pg->Append( new wxPropertyCategory(wxT("Appearance"),wxPG_LABEL) ); + pg->Append( new wxPropertyCategory("Appearance",wxPG_LABEL) ); - pg->Append( new wxStringProperty(wxT("Label"),wxPG_LABEL,GetTitle()) ); - pg->Append( new wxFontProperty(wxT("Font"),wxPG_LABEL) ); - pg->SetPropertyHelpString ( wxT("Font"), wxT("Editing this will change font used in the property grid.") ); + pg->Append( new wxStringProperty("Label",wxPG_LABEL,GetTitle()) ); + pg->Append( new wxFontProperty("Font",wxPG_LABEL) ); + pg->SetPropertyHelpString ( "Font", "Editing this will change font used in the property grid." ); - pg->Append( new wxSystemColourProperty(wxT("Margin Colour"),wxPG_LABEL, + pg->Append( new wxSystemColourProperty("Margin Colour",wxPG_LABEL, pg->GetGrid()->GetMarginColour()) ); - pg->Append( new wxSystemColourProperty(wxT("Cell Colour"),wxPG_LABEL, + pg->Append( new wxSystemColourProperty("Cell Colour",wxPG_LABEL, pg->GetGrid()->GetCellBackgroundColour()) ); - pg->Append( new wxSystemColourProperty(wxT("Cell Text Colour"),wxPG_LABEL, + pg->Append( new wxSystemColourProperty("Cell Text Colour",wxPG_LABEL, pg->GetGrid()->GetCellTextColour()) ); - pg->Append( new wxSystemColourProperty(wxT("Line Colour"),wxPG_LABEL, + pg->Append( new wxSystemColourProperty("Line Colour",wxPG_LABEL, pg->GetGrid()->GetLineColour()) ); - pg->Append( new wxFlagsProperty(wxT("Window Styles"),wxPG_LABEL, + pg->Append( new wxFlagsProperty("Window Styles",wxPG_LABEL, m_combinedFlags, GetWindowStyle()) ); - //pg->SetPropertyAttribute(wxT("Window Styles"),wxPG_BOOL_USE_CHECKBOX,true,wxPG_RECURSE); + //pg->SetPropertyAttribute("Window Styles",wxPG_BOOL_USE_CHECKBOX,true,wxPG_RECURSE); - pg->Append( new wxCursorProperty(wxT("Cursor"),wxPG_LABEL) ); + pg->Append( new wxCursorProperty("Cursor",wxPG_LABEL) ); - pg->Append( new wxPropertyCategory(wxT("Position"),wxT("PositionCategory")) ); - pg->SetPropertyHelpString( wxT("PositionCategory"), wxT("Change in items in this category will cause respective changes in frame.") ); + pg->Append( new wxPropertyCategory("Position","PositionCategory") ); + pg->SetPropertyHelpString( "PositionCategory", "Change in items in this category will cause respective changes in frame." ); // Let's demonstrate 'Units' attribute here // Note that we use many attribute constants instead of strings here - // (for instance, wxPG_ATTR_MIN, instead of wxT("min")). + // (for instance, wxPG_ATTR_MIN, instead of "min"). // Using constant may reduce binary size. - pg->Append( new wxIntProperty(wxT("Height"),wxPG_LABEL,480) ); - pg->SetPropertyAttribute(wxT("Height"), wxPG_ATTR_MIN, (long)10 ); - pg->SetPropertyAttribute(wxT("Height"), wxPG_ATTR_MAX, (long)2048 ); - pg->SetPropertyAttribute(wxT("Height"), wxPG_ATTR_UNITS, wxT("Pixels") ); + pg->Append( new wxIntProperty("Height",wxPG_LABEL,480) ); + pg->SetPropertyAttribute("Height", wxPG_ATTR_MIN, (long)10 ); + pg->SetPropertyAttribute("Height", wxPG_ATTR_MAX, (long)2048 ); + pg->SetPropertyAttribute("Height", wxPG_ATTR_UNITS, "Pixels" ); // Set value to unspecified so that Hint attribute will be demonstrated - pg->SetPropertyValueUnspecified(wxT("Height")); - pg->SetPropertyAttribute(wxT("Height"), wxPG_ATTR_HINT, - wxT("Enter new height for window") ); + pg->SetPropertyValueUnspecified("Height"); + pg->SetPropertyAttribute("Height", wxPG_ATTR_HINT, + "Enter new height for window" ); // Difference between hint and help string is that the hint is shown in // an empty value cell, while help string is shown either in the // description text box, as a tool tip, or on the status bar. - pg->SetPropertyHelpString(wxT("Height"), - wxT("This property uses attributes \"Units\" and \"Hint\".") ); + pg->SetPropertyHelpString("Height", + "This property uses attributes \"Units\" and \"Hint\"."); - pg->Append( new wxIntProperty(wxT("Width"),wxPG_LABEL,640) ); - pg->SetPropertyAttribute(wxT("Width"), wxPG_ATTR_MIN, (long)10 ); - pg->SetPropertyAttribute(wxT("Width"), wxPG_ATTR_MAX, (long)2048 ); - pg->SetPropertyAttribute(wxT("Width"), wxPG_ATTR_UNITS, wxT("Pixels") ); + pg->Append( new wxIntProperty("Width",wxPG_LABEL,640) ); + pg->SetPropertyAttribute("Width", wxPG_ATTR_MIN, (long)10 ); + pg->SetPropertyAttribute("Width", wxPG_ATTR_MAX, (long)2048 ); + pg->SetPropertyAttribute("Width", wxPG_ATTR_UNITS, "Pixels" ); - pg->SetPropertyValueUnspecified(wxT("Width")); - pg->SetPropertyAttribute(wxT("Width"), wxPG_ATTR_HINT, - wxT("Enter new width for window") ); - pg->SetPropertyHelpString(wxT("Width"), - wxT("This property uses attributes \"Units\" and \"Hint\".") ); + pg->SetPropertyValueUnspecified("Width"); + pg->SetPropertyAttribute("Width", wxPG_ATTR_HINT, + "Enter new width for window" ); + pg->SetPropertyHelpString("Width", + "This property uses attributes \"Units\" and \"Hint\"."); - pg->Append( new wxIntProperty(wxT("X"),wxPG_LABEL,10) ); - pg->SetPropertyAttribute(wxT("X"), wxPG_ATTR_UNITS, wxT("Pixels") ); - pg->SetPropertyHelpString(wxT("X"), wxT("This property uses \"Units\" attribute.") ); + pg->Append( new wxIntProperty("X",wxPG_LABEL,10) ); + pg->SetPropertyAttribute("X", wxPG_ATTR_UNITS, "Pixels" ); + pg->SetPropertyHelpString("X", "This property uses \"Units\" attribute."); - pg->Append( new wxIntProperty(wxT("Y"),wxPG_LABEL,10) ); - pg->SetPropertyAttribute(wxT("Y"), wxPG_ATTR_UNITS, wxT("Pixels") ); - pg->SetPropertyHelpString(wxT("Y"), wxT("This property uses \"Units\" attribute.") ); + pg->Append( new wxIntProperty("Y",wxPG_LABEL,10) ); + pg->SetPropertyAttribute("Y", wxPG_ATTR_UNITS, "Pixels" ); + pg->SetPropertyHelpString("Y", "This property uses \"Units\" attribute."); - const wxChar* disabledHelpString = wxT("This property is simply disabled. In order to have label disabled as well, ") - wxT("you need to set wxPG_EX_GREY_LABEL_WHEN_DISABLED using SetExtraStyle."); + const wxString disabledHelpString = "This property is simply disabled. In order to have label disabled as well, " + "you need to set wxPG_EX_GREY_LABEL_WHEN_DISABLED using SetExtraStyle."; - pg->Append( new wxPropertyCategory(wxT("Environment"),wxPG_LABEL) ); - pg->Append( new wxStringProperty(wxT("Operating System"),wxPG_LABEL,::wxGetOsDescription()) ); + pg->Append( new wxPropertyCategory("Environment",wxPG_LABEL) ); + pg->Append( new wxStringProperty("Operating System",wxPG_LABEL,::wxGetOsDescription()) ); - pg->Append( new wxStringProperty(wxT("User Id"),wxPG_LABEL,::wxGetUserId()) ); - pg->Append( new wxDirProperty(wxT("User Home"),wxPG_LABEL,::wxGetUserHome()) ); - pg->Append( new wxStringProperty(wxT("User Name"),wxPG_LABEL,::wxGetUserName()) ); + pg->Append( new wxStringProperty("User Id",wxPG_LABEL,::wxGetUserId()) ); + pg->Append( new wxDirProperty("User Home",wxPG_LABEL,::wxGetUserHome()) ); + pg->Append( new wxStringProperty("User Name",wxPG_LABEL,::wxGetUserName()) ); // Disable some of them - pg->DisableProperty( wxT("Operating System") ); - pg->DisableProperty( wxT("User Id") ); - pg->DisableProperty( wxT("User Name") ); + pg->DisableProperty( "Operating System" ); + pg->DisableProperty( "User Id" ); + pg->DisableProperty( "User Name" ); - pg->SetPropertyHelpString( wxT("Operating System"), disabledHelpString ); - pg->SetPropertyHelpString( wxT("User Id"), disabledHelpString ); - pg->SetPropertyHelpString( wxT("User Name"), disabledHelpString ); + pg->SetPropertyHelpString( "Operating System", disabledHelpString ); + pg->SetPropertyHelpString( "User Id", disabledHelpString ); + pg->SetPropertyHelpString( "User Name", disabledHelpString ); - pg->Append( new wxPropertyCategory(wxT("More Examples"),wxPG_LABEL) ); + pg->Append( new wxPropertyCategory("More Examples",wxPG_LABEL) ); - pg->Append( new wxFontDataProperty( wxT("FontDataProperty"), wxPG_LABEL) ); - pg->SetPropertyHelpString( wxT("FontDataProperty"), - wxT("This demonstrates wxFontDataProperty class defined in this sample app. ") - wxT("It is exactly like wxFontProperty from the library, but also has colour sub-property.") + pg->Append( new wxFontDataProperty( "FontDataProperty", wxPG_LABEL) ); + pg->SetPropertyHelpString( "FontDataProperty", + "This demonstrates wxFontDataProperty class defined in this sample app. " + "It is exactly like wxFontProperty from the library, but also has colour sub-property." ); - pg->Append( new wxDirsProperty(wxT("DirsProperty"),wxPG_LABEL) ); - pg->SetPropertyHelpString( wxT("DirsProperty"), - wxT("This demonstrates wxDirsProperty class defined in this sample app. ") - wxT("It is built with WX_PG_IMPLEMENT_ARRAYSTRING_PROPERTY_WITH_VALIDATOR macro, ") - wxT("with custom action (dir dialog popup) defined.") + pg->Append( new wxDirsProperty("DirsProperty",wxPG_LABEL) ); + pg->SetPropertyHelpString( "DirsProperty", + "This demonstrates wxDirsProperty class defined in this sample app. " + "It is built with WX_PG_IMPLEMENT_ARRAYSTRING_PROPERTY_WITH_VALIDATOR macro, " + "with custom action (dir dialog popup) defined." ); wxArrayDouble arrdbl; @@ -1142,21 +1137,21 @@ void FormMain::PopulateWithStandardItems () arrdbl.Add(0.5); arrdbl.Add(1.0); - pg->Append( new wxArrayDoubleProperty(wxT("ArrayDoubleProperty"),wxPG_LABEL,arrdbl) ); - //pg->SetPropertyAttribute(wxT("ArrayDoubleProperty"),wxPG_FLOAT_PRECISION,(long)2); - pg->SetPropertyHelpString( wxT("ArrayDoubleProperty"), - wxT("This demonstrates wxArrayDoubleProperty class defined in this sample app. ") - wxT("It is an example of a custom list editor property.") + pg->Append( new wxArrayDoubleProperty("ArrayDoubleProperty",wxPG_LABEL,arrdbl) ); + //pg->SetPropertyAttribute("ArrayDoubleProperty",wxPG_FLOAT_PRECISION,(long)2); + pg->SetPropertyHelpString( "ArrayDoubleProperty", + "This demonstrates wxArrayDoubleProperty class defined in this sample app. " + "It is an example of a custom list editor property." ); - pg->Append( new wxLongStringProperty(wxT("Information"),wxPG_LABEL, - wxT("Editing properties will have immediate effect on this window, ") - wxT("and vice versa (at least in most cases, that is).") + pg->Append( new wxLongStringProperty("Information",wxPG_LABEL, + "Editing properties will have immediate effect on this window, " + "and vice versa (at least in most cases, that is)." ) ); - pg->SetPropertyHelpString( wxT("Information"), - wxT("This property is read-only.") ); + pg->SetPropertyHelpString( "Information", + "This property is read-only." ); - pg->SetPropertyReadOnly( wxT("Information"), true ); + pg->SetPropertyReadOnly( "Information", true ); // // Set test information for cells in columns 3 and 4 @@ -1172,8 +1167,8 @@ void FormMain::PopulateWithStandardItems () if ( p->IsCategory() ) continue; - pg->SetPropertyCell( p, 3, wxT("Cell 3"), bmp ); - pg->SetPropertyCell( p, 4, wxT("Cell 4"), wxNullBitmap, *wxWHITE, *wxBLACK ); + pg->SetPropertyCell( p, 3, "Cell 3", bmp ); + pg->SetPropertyCell( p, 4, "Cell 4", wxNullBitmap, *wxWHITE, *wxBLACK ); } } @@ -1182,75 +1177,75 @@ void FormMain::PopulateWithStandardItems () void FormMain::PopulateWithExamples () { wxPropertyGridManager* pgman = m_pPropGridManager; - wxPropertyGridPage* pg = pgman->GetPage(wxT("Examples")); + wxPropertyGridPage* pg = pgman->GetPage("Examples"); wxPGProperty* pid; wxPGProperty* prop; - //pg->Append( new wxPropertyCategory(wxT("Examples (low priority)"),wxT("Examples")) ); - //pg->SetPropertyHelpString ( wxT("Examples"), wxT("This category has example of (almost) every built-in property class.") ); + //pg->Append( new wxPropertyCategory("Examples (low priority)","Examples") ); + //pg->SetPropertyHelpString ( "Examples", "This category has example of (almost) every built-in property class." ); #if wxUSE_SPINBTN - pg->Append( new wxIntProperty ( wxT("SpinCtrl"), wxPG_LABEL, 0 ) ); + pg->Append( new wxIntProperty ( "SpinCtrl", wxPG_LABEL, 0 ) ); - pg->SetPropertyEditor( wxT("SpinCtrl"), wxPGEditor_SpinCtrl ); - pg->SetPropertyAttribute( wxT("SpinCtrl"), wxPG_ATTR_MIN, (long)-10 ); // Use constants instead of string - pg->SetPropertyAttribute( wxT("SpinCtrl"), wxPG_ATTR_MAX, (long)16384 ); // for reduced binary size. - pg->SetPropertyAttribute( wxT("SpinCtrl"), wxPG_ATTR_SPINCTRL_STEP, (long)2 ); - pg->SetPropertyAttribute( wxT("SpinCtrl"), wxPG_ATTR_SPINCTRL_MOTION, true ); - //pg->SetPropertyAttribute( wxT("SpinCtrl"), wxPG_ATTR_SPINCTRL_WRAP, true ); + pg->SetPropertyEditor( "SpinCtrl", wxPGEditor_SpinCtrl ); + pg->SetPropertyAttribute( "SpinCtrl", wxPG_ATTR_MIN, (long)-10 ); // Use constants instead of string + pg->SetPropertyAttribute( "SpinCtrl", wxPG_ATTR_MAX, (long)16384 ); // for reduced binary size. + pg->SetPropertyAttribute( "SpinCtrl", wxPG_ATTR_SPINCTRL_STEP, (long)2 ); + pg->SetPropertyAttribute( "SpinCtrl", wxPG_ATTR_SPINCTRL_MOTION, true ); + //pg->SetPropertyAttribute( "SpinCtrl", wxPG_ATTR_SPINCTRL_WRAP, true ); - pg->SetPropertyHelpString( wxT("SpinCtrl"), - wxT("This is regular wxIntProperty, which editor has been ") - wxT("changed to wxPGEditor_SpinCtrl. Note however that ") - wxT("static wxPropertyGrid::RegisterAdditionalEditors() ") - wxT("needs to be called prior to using it.")); + pg->SetPropertyHelpString( "SpinCtrl", + "This is regular wxIntProperty, which editor has been " + "changed to wxPGEditor_SpinCtrl. Note however that " + "static wxPropertyGrid::RegisterAdditionalEditors() " + "needs to be called prior to using it."); #endif // Add bool property - pg->Append( new wxBoolProperty( wxT("BoolProperty"), wxPG_LABEL, false ) ); + pg->Append( new wxBoolProperty( "BoolProperty", wxPG_LABEL, false ) ); // Add bool property with check box - pg->Append( new wxBoolProperty( wxT("BoolProperty with CheckBox"), wxPG_LABEL, false ) ); - pg->SetPropertyAttribute( wxT("BoolProperty with CheckBox"), + pg->Append( new wxBoolProperty( "BoolProperty with CheckBox", wxPG_LABEL, false ) ); + pg->SetPropertyAttribute( "BoolProperty with CheckBox", wxPG_BOOL_USE_CHECKBOX, true ); - pg->SetPropertyHelpString( wxT("BoolProperty with CheckBox"), - wxT("Property attribute wxPG_BOOL_USE_CHECKBOX has been set to true.") ); + pg->SetPropertyHelpString( "BoolProperty with CheckBox", + "Property attribute wxPG_BOOL_USE_CHECKBOX has been set to true." ); - prop = pg->Append( new wxFloatProperty(wxT("FloatProperty"), + prop = pg->Append( new wxFloatProperty("FloatProperty", wxPG_LABEL, 1234500.23) ); prop->SetAttribute(wxPG_ATTR_MIN, -100.12); // A string property that can be edited in a separate editor dialog. - pg->Append( new wxLongStringProperty( wxT("LongStringProperty"), wxT("LongStringProp"), - wxT("This is much longer string than the first one. Edit it by clicking the button.") ) ); + pg->Append( new wxLongStringProperty( "LongStringProperty", "LongStringProp", + "This is much longer string than the first one. Edit it by clicking the button." ) ); // A property that edits a wxArrayString. wxArrayString example_array; - example_array.Add( wxT("String 1")); - example_array.Add( wxT("String 2")); - example_array.Add( wxT("String 3")); - pg->Append( new wxArrayStringProperty( wxT("ArrayStringProperty"), wxPG_LABEL, + example_array.Add( "String 1"); + example_array.Add( "String 2"); + example_array.Add( "String 3"); + pg->Append( new wxArrayStringProperty( "ArrayStringProperty", wxPG_LABEL, example_array) ); // Test adding same category multiple times ( should not actually create a new one ) - //pg->Append( new wxPropertyCategory(wxT("Examples (low priority)"),wxT("Examples")) ); + //pg->Append( new wxPropertyCategory("Examples (low priority)","Examples") ); // A file selector property. Note that argument between name // and initial value is wildcard (format same as in wxFileDialog). - prop = new wxFileProperty( wxT("FileProperty"), wxT("TextFile") ); + prop = new wxFileProperty( "FileProperty", "TextFile" ); pg->Append( prop ); - prop->SetAttribute(wxPG_FILE_WILDCARD,wxT("Text Files (*.txt)|*.txt")); - prop->SetAttribute(wxPG_FILE_DIALOG_TITLE,wxT("Custom File Dialog Title")); + prop->SetAttribute(wxPG_FILE_WILDCARD,"Text Files (*.txt)|*.txt"); + prop->SetAttribute(wxPG_FILE_DIALOG_TITLE,"Custom File Dialog Title"); prop->SetAttribute(wxPG_FILE_SHOW_FULL_PATH,false); #ifdef __WXMSW__ - prop->SetAttribute(wxPG_FILE_SHOW_RELATIVE_PATH,wxT("C:\\Windows")); - pg->SetPropertyValue(prop,wxT("C:\\Windows\\System32\\msvcrt71.dll")); + prop->SetAttribute(wxPG_FILE_SHOW_RELATIVE_PATH,"C:\\Windows"); + pg->SetPropertyValue(prop,"C:\\Windows\\System32\\msvcrt71.dll"); #endif #if wxUSE_IMAGE @@ -1258,58 +1253,56 @@ void FormMain::PopulateWithExamples () // wildcard is missing (it is autogenerated from supported image formats). // If you really need to override it, create property separately, and call // its SetWildcard method. - pg->Append( new wxImageFileProperty( wxT("ImageFile"), wxPG_LABEL ) ); + pg->Append( new wxImageFileProperty( "ImageFile", wxPG_LABEL ) ); #endif - pid = pg->Append( new wxColourProperty(wxT("ColourProperty"),wxPG_LABEL,*wxRED) ); - pg->SetPropertyEditor( wxT("ColourProperty"), wxPGEditor_ComboBox ); - pg->GetProperty(wxT("ColourProperty"))->SetAutoUnspecified(true); - pg->SetPropertyHelpString( wxT("ColourProperty"), - wxT("wxPropertyGrid::SetPropertyEditor method has been used to change ") - wxT("editor of this property to wxPGEditor_ComboBox)")); + pid = pg->Append( new wxColourProperty("ColourProperty",wxPG_LABEL,*wxRED) ); + pg->SetPropertyEditor( "ColourProperty", wxPGEditor_ComboBox ); + pg->GetProperty("ColourProperty")->SetAutoUnspecified(true); + pg->SetPropertyHelpString( "ColourProperty", + "wxPropertyGrid::SetPropertyEditor method has been used to change " + "editor of this property to wxPGEditor_ComboBox)"); - pid = pg->Append( new wxColourProperty(wxT("ColourPropertyWithAlpha"), + pid = pg->Append( new wxColourProperty("ColourPropertyWithAlpha", wxPG_LABEL, wxColour(15, 200, 95, 128)) ); - pg->SetPropertyAttribute(wxT("ColourPropertyWithAlpha"), wxPG_COLOUR_HAS_ALPHA, true); - pg->SetPropertyHelpString(wxT("ColourPropertyWithAlpha"), - wxT("Attribute \"HasAlpha\" is set to true for this property.")); + pg->SetPropertyAttribute("ColourPropertyWithAlpha", wxPG_COLOUR_HAS_ALPHA, true); + pg->SetPropertyHelpString("ColourPropertyWithAlpha", + "Attribute \"HasAlpha\" is set to true for this property."); // // This demonstrates using alternative editor for colour property // to trigger colour dialog directly from button. - pg->Append( new wxColourProperty(wxT("ColourProperty2"),wxPG_LABEL,*wxGREEN) ); + pg->Append( new wxColourProperty("ColourProperty2",wxPG_LABEL,*wxGREEN) ); // // wxEnumProperty does not store strings or even list of strings // ( so that's why they are static in function ). - static const wxChar* enum_prop_labels[] = { wxT("One Item"), - wxT("Another Item"), wxT("One More"), wxT("This Is Last"), NULL }; + static const wxString enum_prop_labels[] = { "One Item", + "Another Item", "One More", "This Is Last" }; // this value array would be optional if values matched string indexes static long enum_prop_values[] = { 40, 80, 120, 160 }; // note that the initial value (the last argument) is the actual value, // not index or anything like that. Thus, our value selects "Another Item". - // - // 0 before value is number of items. If it is 0, like in our example, - // number of items is calculated, and this requires that the string pointer - // array is terminated with NULL. - pg->Append( new wxEnumProperty(wxT("EnumProperty"),wxPG_LABEL, - enum_prop_labels, enum_prop_values, 80 ) ); + pg->Append( new wxEnumProperty("EnumProperty",wxPG_LABEL, + wxArrayString(WXSIZEOF(enum_prop_labels), enum_prop_labels), + wxArrayInt(enum_prop_values, enum_prop_values+ WXSIZEOF(enum_prop_values)), 80 ) ); wxPGChoices soc; // use basic table from our previous example // can also set/add wxArrayStrings and wxArrayInts directly. - soc.Set( enum_prop_labels, enum_prop_values ); + soc.Set(wxArrayString(WXSIZEOF(enum_prop_labels), enum_prop_labels), + wxArrayInt(enum_prop_values, enum_prop_values + WXSIZEOF(enum_prop_values))); // add extra items - soc.Add( wxT("Look, it continues"), 200 ); - soc.Add( wxT("Even More"), 240 ); - soc.Add( wxT("And More"), 280 ); + soc.Add( "Look, it continues", 200 ); + soc.Add( "Even More", 240 ); + soc.Add( "And More", 280 ); soc.Add( wxEmptyString, 300 ); - soc.Add( wxT("True End of the List"), 320 ); + soc.Add( "True End of the List", 320 ); // Test custom colours ([] operator of wxPGChoices returns // references to wxPGChoiceEntry). @@ -1321,85 +1314,85 @@ void FormMain::PopulateWithExamples () soc[3].SetBgCol(*wxLIGHT_GREY); soc[4].SetBitmap(wxArtProvider::GetBitmap(wxART_FOLDER)); - pg->Append( new wxEnumProperty(wxT("EnumProperty 2"), + pg->Append( new wxEnumProperty("EnumProperty 2", wxPG_LABEL, soc, 240) ); - pg->GetProperty(wxT("EnumProperty 2"))->AddChoice(wxT("Testing Extra"), 360); + pg->GetProperty("EnumProperty 2")->AddChoice("Testing Extra", 360); // Here we only display the original 'soc' choices - pg->Append( new wxEnumProperty(wxT("EnumProperty 3"),wxPG_LABEL, + pg->Append( new wxEnumProperty("EnumProperty 3",wxPG_LABEL, soc, 240 ) ); // Test Hint attribute in EnumProperty - pg->GetProperty(wxT("EnumProperty 3"))->SetAttribute(wxPG_ATTR_HINT, wxT("Dummy Hint")); + pg->GetProperty("EnumProperty 3")->SetAttribute(wxPG_ATTR_HINT, "Dummy Hint"); - pg->SetPropertyHelpString(wxT("EnumProperty 3"), - wxT("This property uses \"Hint\" attribute.")); + pg->SetPropertyHelpString("EnumProperty 3", + "This property uses \"Hint\" attribute."); // 'soc' plus one exclusive extra choice "4th only" - pg->Append( new wxEnumProperty(wxT("EnumProperty 4"),wxPG_LABEL, + pg->Append( new wxEnumProperty("EnumProperty 4",wxPG_LABEL, soc, 240 ) ); - pg->GetProperty(wxT("EnumProperty 4"))->AddChoice(wxT("4th only"), 360); + pg->GetProperty("EnumProperty 4")->AddChoice("4th only", 360); - pg->SetPropertyHelpString(wxT("EnumProperty 4"), - wxT("Should have one extra item when compared to EnumProperty 3")); + pg->SetPropertyHelpString("EnumProperty 4", + "Should have one extra item when compared to EnumProperty 3"); // Plus property value bitmap - pg->Append( new wxEnumProperty(wxS("EnumProperty With Bitmap"), wxS("EnumProperty 5"), + pg->Append( new wxEnumProperty("EnumProperty With Bitmap", "EnumProperty 5", soc, 280) ); - pg->SetPropertyHelpString(wxS("EnumProperty 5"), - wxS("Should have bitmap in front of the displayed value")); + pg->SetPropertyHelpString("EnumProperty 5", + "Should have bitmap in front of the displayed value"); wxBitmap bmpVal = wxArtProvider::GetBitmap(wxART_REMOVABLE); - pg->SetPropertyImage(wxS("EnumProperty 5"), bmpVal); + pg->SetPropertyImage("EnumProperty 5", bmpVal); // Password property example. - pg->Append( new wxStringProperty(wxT("Password"),wxPG_LABEL, wxT("password")) ); - pg->SetPropertyAttribute( wxT("Password"), wxPG_STRING_PASSWORD, true ); - pg->SetPropertyHelpString( wxT("Password"), - wxT("Has attribute wxPG_STRING_PASSWORD set to true") ); + pg->Append( new wxStringProperty("Password",wxPG_LABEL, "password") ); + pg->SetPropertyAttribute( "Password", wxPG_STRING_PASSWORD, true ); + pg->SetPropertyHelpString( "Password", + "Has attribute wxPG_STRING_PASSWORD set to true" ); // String editor with dir selector button. Uses wxEmptyString as name, which // is allowed (naturally, in this case property cannot be accessed by name). - pg->Append( new wxDirProperty( wxT("DirProperty"), wxPG_LABEL, ::wxGetUserHome()) ); - pg->SetPropertyAttribute( wxT("DirProperty"), + pg->Append( new wxDirProperty( "DirProperty", wxPG_LABEL, ::wxGetUserHome()) ); + pg->SetPropertyAttribute( "DirProperty", wxPG_DIR_DIALOG_MESSAGE, - wxT("This is a custom dir dialog message") ); + "This is a custom dir dialog message" ); // Add string property - first arg is label, second name, and third initial value - pg->Append( new wxStringProperty ( wxT("StringProperty"), wxPG_LABEL ) ); - pg->SetPropertyMaxLength( wxT("StringProperty"), 6 ); - pg->SetPropertyHelpString( wxT("StringProperty"), - wxT("Max length of this text has been limited to 6, using wxPropertyGrid::SetPropertyMaxLength.") ); + pg->Append( new wxStringProperty ( "StringProperty", wxPG_LABEL ) ); + pg->SetPropertyMaxLength( "StringProperty", 6 ); + pg->SetPropertyHelpString( "StringProperty", + "Max length of this text has been limited to 6, using wxPropertyGrid::SetPropertyMaxLength." ); // Set value after limiting so that it will be applied - pg->SetPropertyValue( wxT("StringProperty"), wxT("some text") ); + pg->SetPropertyValue( "StringProperty", "some text" ); // // Demonstrate "AutoComplete" attribute - pg->Append( new wxStringProperty( wxT("StringProperty AutoComplete"), + pg->Append( new wxStringProperty( "StringProperty AutoComplete", wxPG_LABEL ) ); wxArrayString autoCompleteStrings; - autoCompleteStrings.Add(wxT("One choice")); - autoCompleteStrings.Add(wxT("Another choice")); - autoCompleteStrings.Add(wxT("Another choice, yeah")); - autoCompleteStrings.Add(wxT("Yet another choice")); - autoCompleteStrings.Add(wxT("Yet another choice, bear with me")); - pg->SetPropertyAttribute( wxT("StringProperty AutoComplete"), + autoCompleteStrings.Add("One choice"); + autoCompleteStrings.Add("Another choice"); + autoCompleteStrings.Add("Another choice, yeah"); + autoCompleteStrings.Add("Yet another choice"); + autoCompleteStrings.Add("Yet another choice, bear with me"); + pg->SetPropertyAttribute( "StringProperty AutoComplete", wxPG_ATTR_AUTOCOMPLETE, autoCompleteStrings ); - pg->SetPropertyHelpString( wxT("StringProperty AutoComplete"), - wxT("AutoComplete attribute has been set for this property ") - wxT("(try writing something beginning with 'a', 'o' or 'y').")); + pg->SetPropertyHelpString( "StringProperty AutoComplete", + "AutoComplete attribute has been set for this property " + "(try writing something beginning with 'a', 'o' or 'y')."); // Add string property with arbitrarily wide bitmap in front of it. We // intentionally lower-than-typical row height here so that the ugly // scaling code won't be run. - pg->Append( new wxStringProperty( wxT("StringPropertyWithBitmap"), + pg->Append( new wxStringProperty( "StringPropertyWithBitmap", wxPG_LABEL, - wxT("Test Text")) ); + "Test Text") ); wxBitmap myTestBitmap(60, 15, 32); wxMemoryDC mdc; mdc.SelectObject(myTestBitmap); @@ -1407,80 +1400,80 @@ void FormMain::PopulateWithExamples () mdc.SetPen(*wxBLACK); mdc.DrawLine(0, 0, 60, 15); mdc.SelectObject(wxNullBitmap); - pg->SetPropertyImage( wxT("StringPropertyWithBitmap"), myTestBitmap ); + pg->SetPropertyImage( "StringPropertyWithBitmap", myTestBitmap ); // this value array would be optional if values matched string indexes //long flags_prop_values[] = { wxICONIZE, wxCAPTION, wxMINIMIZE_BOX, wxMAXIMIZE_BOX }; - //pg->Append( wxFlagsProperty(wxT("Example of FlagsProperty"),wxT("FlagsProp"), + //pg->Append( wxFlagsProperty("Example of FlagsProperty","FlagsProp", // flags_prop_labels, flags_prop_values, 0, GetWindowStyle() ) ); // Multi choice dialog. wxArrayString tchoices; - tchoices.Add(wxT("Cabbage")); - tchoices.Add(wxT("Carrot")); - tchoices.Add(wxT("Onion")); - tchoices.Add(wxT("Potato")); - tchoices.Add(wxT("Strawberry")); + tchoices.Add("Cabbage"); + tchoices.Add("Carrot"); + tchoices.Add("Onion"); + tchoices.Add("Potato"); + tchoices.Add("Strawberry"); wxArrayString tchoicesValues; - tchoicesValues.Add(wxT("Carrot")); - tchoicesValues.Add(wxT("Potato")); + tchoicesValues.Add("Carrot"); + tchoicesValues.Add("Potato"); - pg->Append( new wxEnumProperty(wxT("EnumProperty X"),wxPG_LABEL, tchoices ) ); + pg->Append( new wxEnumProperty("EnumProperty X",wxPG_LABEL, tchoices ) ); - pg->Append( new wxMultiChoiceProperty( wxT("MultiChoiceProperty"), wxPG_LABEL, + pg->Append( new wxMultiChoiceProperty( "MultiChoiceProperty", wxPG_LABEL, tchoices, tchoicesValues ) ); - pg->SetPropertyAttribute( wxT("MultiChoiceProperty"), wxPG_ATTR_MULTICHOICE_USERSTRINGMODE, true ); + pg->SetPropertyAttribute( "MultiChoiceProperty", wxPG_ATTR_MULTICHOICE_USERSTRINGMODE, true ); - pg->Append( new wxSizeProperty( wxT("SizeProperty"), wxT("Size"), GetSize() ) ); - pg->Append( new wxPointProperty( wxT("PointProperty"), wxT("Position"), GetPosition() ) ); + pg->Append( new wxSizeProperty( "SizeProperty", "Size", GetSize() ) ); + pg->Append( new wxPointProperty( "PointProperty", "Position", GetPosition() ) ); // UInt samples #if wxUSE_LONGLONG - pg->Append( new wxUIntProperty( wxT("UIntProperty"), wxPG_LABEL, wxULongLong(wxULL(0xFEEEFEEEFEEE)))); + pg->Append( new wxUIntProperty( "UIntProperty", wxPG_LABEL, wxULongLong(wxULL(0xFEEEFEEEFEEE)))); #else - pg->Append( new wxUIntProperty( wxT("UIntProperty"), wxPG_LABEL, 0xFEEEFEEE)); + pg->Append( new wxUIntProperty( "UIntProperty", wxPG_LABEL, 0xFEEEFEEE)); #endif - pg->SetPropertyAttribute( wxT("UIntProperty"), wxPG_UINT_PREFIX, wxPG_PREFIX_NONE ); - pg->SetPropertyAttribute( wxT("UIntProperty"), wxPG_UINT_BASE, wxPG_BASE_HEX ); - //pg->SetPropertyAttribute( wxT("UIntProperty"), wxPG_UINT_PREFIX, wxPG_PREFIX_NONE ); - //pg->SetPropertyAttribute( wxT("UIntProperty"), wxPG_UINT_BASE, wxPG_BASE_OCT ); + pg->SetPropertyAttribute( "UIntProperty", wxPG_UINT_PREFIX, wxPG_PREFIX_NONE ); + pg->SetPropertyAttribute( "UIntProperty", wxPG_UINT_BASE, wxPG_BASE_HEX ); + //pg->SetPropertyAttribute( "UIntProperty", wxPG_UINT_PREFIX, wxPG_PREFIX_NONE ); + //pg->SetPropertyAttribute( "UIntProperty", wxPG_UINT_BASE, wxPG_BASE_OCT ); // // wxEditEnumProperty wxPGChoices eech; - eech.Add(wxT("Choice 1")); - eech.Add(wxT("Choice 2")); - eech.Add(wxT("Choice 3")); - pg->Append( new wxEditEnumProperty(wxT("EditEnumProperty"), + eech.Add("Choice 1"); + eech.Add("Choice 2"); + eech.Add("Choice 3"); + pg->Append( new wxEditEnumProperty("EditEnumProperty", wxPG_LABEL, eech, - wxT("Choice not in the list")) ); + "Choice not in the list") ); // Test Hint attribute in EditEnumProperty - pg->GetProperty(wxT("EditEnumProperty"))->SetAttribute(wxPG_ATTR_HINT, wxT("Dummy Hint")); + pg->GetProperty("EditEnumProperty")->SetAttribute(wxPG_ATTR_HINT, "Dummy Hint"); //wxString v_; //wxTextValidator validator1(wxFILTER_NUMERIC,&v_); - //pg->SetPropertyValidator( wxT("EditEnumProperty"), validator1 ); + //pg->SetPropertyValidator( "EditEnumProperty", validator1 ); #if wxUSE_DATETIME // // wxDateTimeProperty - pg->Append( new wxDateProperty(wxT("DateProperty"), wxPG_LABEL, wxDateTime::Now() ) ); + pg->Append( new wxDateProperty("DateProperty", wxPG_LABEL, wxDateTime::Now() ) ); #if wxUSE_DATEPICKCTRL - pg->SetPropertyAttribute( wxT("DateProperty"), wxPG_DATE_PICKER_STYLE, + pg->SetPropertyAttribute( "DateProperty", wxPG_DATE_PICKER_STYLE, (long)(wxDP_DROPDOWN | wxDP_SHOWCENTURY | wxDP_ALLOWNONE) ); - pg->SetPropertyHelpString( wxT("DateProperty"), - wxT("Attribute wxPG_DATE_PICKER_STYLE has been set to (long)") - wxT("(wxDP_DROPDOWN | wxDP_SHOWCENTURY | wxDP_ALLOWNONE).") ); + pg->SetPropertyHelpString( "DateProperty", + "Attribute wxPG_DATE_PICKER_STYLE has been set to (long)" + "(wxDP_DROPDOWN | wxDP_SHOWCENTURY | wxDP_ALLOWNONE)." ); #endif #endif @@ -1489,61 +1482,61 @@ void FormMain::PopulateWithExamples () // Add Triangle properties as both wxTriangleProperty and // a generic parent property (using wxStringProperty). // - wxPGProperty* topId = pg->Append( new wxStringProperty(wxT("3D Object"), wxPG_LABEL, wxT("")) ); + wxPGProperty* topId = pg->Append( new wxStringProperty("3D Object", wxPG_LABEL, "") ); - pid = pg->AppendIn( topId, new wxStringProperty(wxT("Triangle 1"), wxT("Triangle 1"), wxT("")) ); - pg->AppendIn( pid, new wxVectorProperty( wxT("A"), wxPG_LABEL ) ); - pg->AppendIn( pid, new wxVectorProperty( wxT("B"), wxPG_LABEL ) ); - pg->AppendIn( pid, new wxVectorProperty( wxT("C"), wxPG_LABEL ) ); + pid = pg->AppendIn( topId, new wxStringProperty("Triangle 1", "Triangle 1", "") ); + pg->AppendIn( pid, new wxVectorProperty( "A", wxPG_LABEL ) ); + pg->AppendIn( pid, new wxVectorProperty( "B", wxPG_LABEL ) ); + pg->AppendIn( pid, new wxVectorProperty( "C", wxPG_LABEL ) ); - pg->AppendIn( topId, new wxTriangleProperty( wxT("Triangle 2"), wxT("Triangle 2") ) ); + pg->AppendIn( topId, new wxTriangleProperty( "Triangle 2", "Triangle 2" ) ); - pg->SetPropertyHelpString( wxT("3D Object"), - wxT("3D Object is wxStringProperty with value \"\". Two of its children are similar wxStringProperties with ") - wxT("three wxVectorProperty children, and other two are custom wxTriangleProperties.") ); + pg->SetPropertyHelpString( "3D Object", + "3D Object is wxStringProperty with value \"\". Two of its children are similar wxStringProperties with " + "three wxVectorProperty children, and other two are custom wxTriangleProperties." ); - pid = pg->AppendIn( topId, new wxStringProperty(wxT("Triangle 3"), wxT("Triangle 3"), wxT("")) ); - pg->AppendIn( pid, new wxVectorProperty( wxT("A"), wxPG_LABEL ) ); - pg->AppendIn( pid, new wxVectorProperty( wxT("B"), wxPG_LABEL ) ); - pg->AppendIn( pid, new wxVectorProperty( wxT("C"), wxPG_LABEL ) ); + pid = pg->AppendIn( topId, new wxStringProperty("Triangle 3", "Triangle 3", "") ); + pg->AppendIn( pid, new wxVectorProperty( "A", wxPG_LABEL ) ); + pg->AppendIn( pid, new wxVectorProperty( "B", wxPG_LABEL ) ); + pg->AppendIn( pid, new wxVectorProperty( "C", wxPG_LABEL ) ); - pg->AppendIn( topId, new wxTriangleProperty( wxT("Triangle 4"), wxT("Triangle 4") ) ); + pg->AppendIn( topId, new wxTriangleProperty( "Triangle 4", "Triangle 4" ) ); // // This snippet is a doc sample test // - wxPGProperty* carProp = pg->Append(new wxStringProperty(wxT("Car"), + wxPGProperty* carProp = pg->Append(new wxStringProperty("Car", wxPG_LABEL, - wxT(""))); + "")); - pg->AppendIn(carProp, new wxStringProperty(wxT("Model"), + pg->AppendIn(carProp, new wxStringProperty("Model", wxPG_LABEL, - wxT("Lamborghini Diablo SV"))); + "Lamborghini Diablo SV")); - pg->AppendIn(carProp, new wxIntProperty(wxT("Engine Size (cc)"), + pg->AppendIn(carProp, new wxIntProperty("Engine Size (cc)", wxPG_LABEL, 5707) ); wxPGProperty* speedsProp = pg->AppendIn(carProp, - new wxStringProperty(wxT("Speeds"), + new wxStringProperty("Speeds", wxPG_LABEL, - wxT(""))); + "")); - pg->AppendIn( speedsProp, new wxIntProperty(wxT("Max. Speed (mph)"), + pg->AppendIn( speedsProp, new wxIntProperty("Max. Speed (mph)", wxPG_LABEL,290) ); - pg->AppendIn( speedsProp, new wxFloatProperty(wxT("0-100 mph (sec)"), + pg->AppendIn( speedsProp, new wxFloatProperty("0-100 mph (sec)", wxPG_LABEL,3.9) ); - pg->AppendIn( speedsProp, new wxFloatProperty(wxT("1/4 mile (sec)"), + pg->AppendIn( speedsProp, new wxFloatProperty("1/4 mile (sec)", wxPG_LABEL,8.6) ); // This is how child property can be referred to by name - pg->SetPropertyValue( wxT("Car.Speeds.Max. Speed (mph)"), 300 ); + pg->SetPropertyValue( "Car.Speeds.Max. Speed (mph)", 300 ); - pg->AppendIn(carProp, new wxIntProperty(wxT("Price ($)"), + pg->AppendIn(carProp, new wxIntProperty("Price ($)", wxPG_LABEL, 300000) ); - pg->AppendIn(carProp, new wxBoolProperty(wxT("Convertible"), + pg->AppendIn(carProp, new wxBoolProperty("Convertible", wxPG_LABEL, false) ); @@ -1552,53 +1545,53 @@ void FormMain::PopulateWithExamples () // // Test wxSampleMultiButtonEditor - pg->Append( new wxLongStringProperty(wxT("MultipleButtons"), wxPG_LABEL) ); - pg->SetPropertyEditor(wxT("MultipleButtons"), m_pSampleMultiButtonEditor ); + pg->Append( new wxLongStringProperty("MultipleButtons", wxPG_LABEL) ); + pg->SetPropertyEditor("MultipleButtons", m_pSampleMultiButtonEditor ); // Test SingleChoiceProperty - pg->Append( new SingleChoiceProperty(wxT("SingleChoiceProperty")) ); + pg->Append( new SingleChoiceProperty("SingleChoiceProperty") ); // // Test adding variable height bitmaps in wxPGChoices wxPGChoices bc; - bc.Add(wxT("Wee"), + bc.Add("Wee", wxArtProvider::GetBitmap(wxART_CDROM, wxART_OTHER, wxSize(16, 16))); - bc.Add(wxT("Not so wee"), + bc.Add("Not so wee", wxArtProvider::GetBitmap(wxART_FLOPPY, wxART_OTHER, wxSize(32, 32))); - bc.Add(wxT("Friggin' huge"), + bc.Add("Friggin' huge", wxArtProvider::GetBitmap(wxART_HARDDISK, wxART_OTHER, wxSize(64, 64))); - pg->Append( new wxEnumProperty(wxT("Variable Height Bitmaps"), + pg->Append( new wxEnumProperty("Variable Height Bitmaps", wxPG_LABEL, bc, 0) ); // // Test how non-editable composite strings appear - pid = new wxStringProperty(wxT("wxWidgets Traits"), wxPG_LABEL, wxT("")); + pid = new wxStringProperty("wxWidgets Traits", wxPG_LABEL, ""); pg->SetPropertyReadOnly(pid); // // For testing purposes, combine two methods of adding children // - pid->AppendChild( new wxStringProperty(wxT("Latest Release"), + pid->AppendChild( new wxStringProperty("Latest Release", wxPG_LABEL, - wxT("3.0.2"))); - pid->AppendChild( new wxBoolProperty(wxT("Win API"), + "3.0.2")); + pid->AppendChild( new wxBoolProperty("Win API", wxPG_LABEL, true) ); pg->Append( pid ); - pg->AppendIn(pid, new wxBoolProperty(wxT("QT"), wxPG_LABEL, true) ); - pg->AppendIn(pid, new wxBoolProperty(wxT("Cocoa"), wxPG_LABEL, true) ); - pg->AppendIn(pid, new wxBoolProperty(wxT("BeOS"), wxPG_LABEL, false) ); - pg->AppendIn(pid, new wxStringProperty(wxT("Trunk Version"), wxPG_LABEL, wxT("3.1.0")) ); - pg->AppendIn(pid, new wxBoolProperty(wxT("GTK+"), wxPG_LABEL, true) ); - pg->AppendIn(pid, new wxBoolProperty(wxT("Sky OS"), wxPG_LABEL, false) ); - pg->AppendIn(pid, new wxBoolProperty(wxT("Android"), wxPG_LABEL, false) ); + pg->AppendIn(pid, new wxBoolProperty("QT", wxPG_LABEL, true) ); + pg->AppendIn(pid, new wxBoolProperty("Cocoa", wxPG_LABEL, true) ); + pg->AppendIn(pid, new wxBoolProperty("BeOS", wxPG_LABEL, false) ); + pg->AppendIn(pid, new wxStringProperty("Trunk Version", wxPG_LABEL, "3.1.0") ); + pg->AppendIn(pid, new wxBoolProperty("GTK+", wxPG_LABEL, true) ); + pg->AppendIn(pid, new wxBoolProperty("Sky OS", wxPG_LABEL, false) ); + pg->AppendIn(pid, new wxBoolProperty("Android", wxPG_LABEL, false) ); AddTestProperties(pg); } @@ -1608,7 +1601,7 @@ void FormMain::PopulateWithExamples () void FormMain::PopulateWithLibraryConfig () { wxPropertyGridManager* pgman = m_pPropGridManager; - wxPropertyGridPage* pg = pgman->GetPage(wxT("wxWidgets Library Config")); + wxPropertyGridPage* pg = pgman->GetPage("wxWidgets Library Config"); // Set custom column proportions (here in the sample app we need // to check if the grid has wxPG_SPLITTER_AUTO_CENTER style. You usually @@ -1628,10 +1621,10 @@ void FormMain::PopulateWithLibraryConfig () wxFont italicFont = pgman->GetGrid()->GetCaptionFont(); italicFont.SetStyle(wxFONTSTYLE_ITALIC); - wxString italicFontHelp = wxT("Font of this property's wxPGCell has ") - wxT("been modified. Obtain property's cell ") - wxT("with wxPGProperty::") - wxT("GetOrCreateCell(column)."); + wxString italicFontHelp = "Font of this property's wxPGCell has " + "been modified. Obtain property's cell " + "with wxPGProperty::" + "GetOrCreateCell(column)."; #define ADD_WX_LIB_CONF_GROUP(A) \ cat = pg->AppendIn( pid, new wxPropertyCategory(A) ); \ @@ -1639,21 +1632,21 @@ void FormMain::PopulateWithLibraryConfig () cat->GetCell(0).SetFont(italicFont); \ cat->SetHelpString(italicFontHelp); -#define ADD_WX_LIB_CONF(A) pg->Append( new wxBoolProperty(wxT(#A),wxPG_LABEL,(bool)((A>0)?true:false))); -#define ADD_WX_LIB_CONF_NODEF(A) pg->Append( new wxBoolProperty(wxT(#A),wxPG_LABEL,(bool)false) ); \ - pg->DisableProperty(wxT(#A)); +#define ADD_WX_LIB_CONF(A) pg->Append( new wxBoolProperty(#A,wxPG_LABEL,(bool)((A>0)?true:false))); +#define ADD_WX_LIB_CONF_NODEF(A) pg->Append( new wxBoolProperty(#A,wxPG_LABEL,(bool)false) ); \ + pg->DisableProperty(#A); - pid = pg->Append( new wxPropertyCategory( wxT("wxWidgets Library Configuration") ) ); + pid = pg->Append( new wxPropertyCategory( "wxWidgets Library Configuration" ) ); pg->SetPropertyCell( pid, 0, wxPG_LABEL, bmp ); // Both of following lines would set a label for the second column - pg->SetPropertyCell( pid, 1, wxT("Is Enabled") ); - pid->SetValue(wxT("Is Enabled")); + pg->SetPropertyCell( pid, 1, "Is Enabled" ); + pid->SetValue("Is Enabled"); - ADD_WX_LIB_CONF_GROUP(wxT("Global Settings")) + ADD_WX_LIB_CONF_GROUP("Global Settings") ADD_WX_LIB_CONF( wxUSE_GUI ) - ADD_WX_LIB_CONF_GROUP(wxT("Compatibility Settings")) + ADD_WX_LIB_CONF_GROUP("Compatibility Settings") #if defined(WXWIN_COMPATIBILITY_2_8) ADD_WX_LIB_CONF( WXWIN_COMPATIBILITY_2_8 ) #endif @@ -1671,17 +1664,17 @@ void FormMain::PopulateWithLibraryConfig () ADD_WX_LIB_CONF_NODEF ( wxDIALOG_UNIT_COMPATIBILITY ) #endif - ADD_WX_LIB_CONF_GROUP(wxT("Debugging Settings")) + ADD_WX_LIB_CONF_GROUP("Debugging Settings") ADD_WX_LIB_CONF( wxUSE_DEBUG_CONTEXT ) ADD_WX_LIB_CONF( wxUSE_MEMORY_TRACING ) ADD_WX_LIB_CONF( wxUSE_GLOBAL_MEMORY_OPERATORS ) ADD_WX_LIB_CONF( wxUSE_DEBUG_NEW_ALWAYS ) ADD_WX_LIB_CONF( wxUSE_ON_FATAL_EXCEPTION ) - ADD_WX_LIB_CONF_GROUP(wxT("Unicode Support")) + ADD_WX_LIB_CONF_GROUP("Unicode Support") ADD_WX_LIB_CONF( wxUSE_UNICODE ) - ADD_WX_LIB_CONF_GROUP(wxT("Global Features")) + ADD_WX_LIB_CONF_GROUP("Global Features") ADD_WX_LIB_CONF( wxUSE_EXCEPTIONS ) ADD_WX_LIB_CONF( wxUSE_EXTENDED_RTTI ) ADD_WX_LIB_CONF( wxUSE_STL ) @@ -1694,7 +1687,7 @@ void FormMain::PopulateWithLibraryConfig () ADD_WX_LIB_CONF( wxUSE_STREAMS ) ADD_WX_LIB_CONF( wxUSE_STD_IOSTREAM ) - ADD_WX_LIB_CONF_GROUP(wxT("Non-GUI Features")) + ADD_WX_LIB_CONF_GROUP("Non-GUI Features") ADD_WX_LIB_CONF( wxUSE_LONGLONG ) ADD_WX_LIB_CONF( wxUSE_FILE ) ADD_WX_LIB_CONF( wxUSE_FFILE ) @@ -1790,30 +1783,30 @@ void wxMyPropertyGridPage::OnPropertySelect( wxPropertyGridEvent& event ) { wxPGProperty* p = event.GetProperty(); wxUnusedVar(p); - wxLogDebug(wxT("wxMyPropertyGridPage::OnPropertySelect('%s' is %s"), - p->GetName().c_str(), - IsPropertySelected(p)? wxT("selected"): wxT("unselected")); + wxLogDebug("wxMyPropertyGridPage::OnPropertySelect('%s' is %s", + p->GetName(), + IsPropertySelected(p)? "selected": "unselected"); } void wxMyPropertyGridPage::OnPropertyChange( wxPropertyGridEvent& event ) { wxPGProperty* p = event.GetProperty(); - wxLogVerbose(wxT("wxMyPropertyGridPage::OnPropertyChange('%s', to value '%s')"), - p->GetName().c_str(), - p->GetDisplayedString().c_str()); + wxLogVerbose("wxMyPropertyGridPage::OnPropertyChange('%s', to value '%s')", + p->GetName(), + p->GetDisplayedString()); } void wxMyPropertyGridPage::OnPropertyChanging( wxPropertyGridEvent& event ) { wxPGProperty* p = event.GetProperty(); - wxLogVerbose(wxT("wxMyPropertyGridPage::OnPropertyChanging('%s', to value '%s')"), - p->GetName().c_str(), - event.GetValue().GetString().c_str()); + wxLogVerbose("wxMyPropertyGridPage::OnPropertyChanging('%s', to value '%s')", + p->GetName(), + event.GetValue().GetString()); } void wxMyPropertyGridPage::OnPageChange( wxPropertyGridEvent& WXUNUSED(event) ) { - wxLogDebug(wxT("wxMyPropertyGridPage::OnPageChange()")); + wxLogDebug("wxMyPropertyGridPage::OnPageChange()"); } @@ -1823,7 +1816,7 @@ public: void OnKeyEvent( wxKeyEvent& event ) { - wxMessageBox(wxString::Format(wxT("%i"),event.GetKeyCode())); + wxMessageBox(wxString::Format("%i",event.GetKeyCode())); event.Skip(); } private: @@ -1857,10 +1850,10 @@ void FormMain::FinalizePanel( bool wasCreated ) { // Button for tab traversal testing m_topSizer->Add( new wxButton(m_panel, wxID_ANY, - wxT("Should be able to move here with Tab")), + "Should be able to move here with Tab"), wxSizerFlags(0).Expand()); m_topSizer->Add( new wxButton(m_panel, ID_SHOWPOPUP, - wxT("Show Popup")), + "Show Popup"), wxSizerFlags(0).Expand()); m_panel->SetSizer( m_topSizer ); @@ -1879,20 +1872,20 @@ void FormMain::FinalizePanel( bool wasCreated ) void FormMain::PopulateGrid() { wxPropertyGridManager* pgman = m_pPropGridManager; - pgman->AddPage(wxT("Standard Items")); + pgman->AddPage("Standard Items"); PopulateWithStandardItems(); - pgman->AddPage(wxT("wxWidgets Library Config")); + pgman->AddPage("wxWidgets Library Config"); PopulateWithLibraryConfig(); wxPropertyGridPage* myPage = new wxMyPropertyGridPage(); - myPage->Append( new wxIntProperty ( wxT("IntProperty"), wxPG_LABEL, 12345678 ) ); + myPage->Append( new wxIntProperty ( "IntProperty", wxPG_LABEL, 12345678 ) ); // Use wxMyPropertyGridPage (see above) to test the // custom wxPropertyGridPage feature. - pgman->AddPage(wxT("Examples"),wxNullBitmap,myPage); + pgman->AddPage("Examples",wxNullBitmap,myPage); PopulateWithExamples(); } @@ -1932,8 +1925,8 @@ void FormMain::CreateGrid( int style, int extraStyle ) // // This shows how to combine two static choice descriptors - m_combinedFlags.Add( _fs_windowstyle_labels, _fs_windowstyle_values ); - m_combinedFlags.Add( _fs_framestyle_labels, _fs_framestyle_values ); + m_combinedFlags.Add( WXSIZEOF(_fs_windowstyle_labels), _fs_windowstyle_labels, _fs_windowstyle_values ); + m_combinedFlags.Add( WXSIZEOF(_fs_framestyle_labels), _fs_framestyle_labels, _fs_framestyle_values ); wxPropertyGridManager* pgman = m_pPropGridManager = new wxPropertyGridManager(m_panel, @@ -1957,7 +1950,7 @@ void FormMain::CreateGrid( int style, int extraStyle ) // // Set somewhat different unspecified value appearance wxPGCell cell; - cell.SetText(wxT("Unspecified")); + cell.SetText("Unspecified"); cell.SetFgCol(*wxLIGHT_GREY); m_propGrid->SetUnspecifiedValueAppearance(cell); @@ -2033,116 +2026,116 @@ FormMain::FormMain(const wxString& title, const wxPoint& pos, const wxSize& size wxMenu *menuTools2 = new wxMenu; wxMenu *menuHelp = new wxMenu; - menuHelp->Append(ID_ABOUT, wxT("&About"), wxT("Show about dialog") ); + menuHelp->Append(ID_ABOUT, "&About", "Show about dialog" ); - menuTools1->Append(ID_APPENDPROP, wxT("Append New Property") ); - menuTools1->Append(ID_APPENDCAT, wxT("Append New Category\tCtrl-S") ); + menuTools1->Append(ID_APPENDPROP, "Append New Property" ); + menuTools1->Append(ID_APPENDCAT, "Append New Category\tCtrl-S" ); menuTools1->AppendSeparator(); - menuTools1->Append(ID_INSERTPROP, wxT("Insert New Property\tCtrl-I") ); - menuTools1->Append(ID_INSERTCAT, wxT("Insert New Category\tCtrl-W") ); + menuTools1->Append(ID_INSERTPROP, "Insert New Property\tCtrl-I" ); + menuTools1->Append(ID_INSERTCAT, "Insert New Category\tCtrl-W" ); menuTools1->AppendSeparator(); - menuTools1->Append(ID_DELETE, wxT("Delete Selected") ); - menuTools1->Append(ID_DELETER, wxT("Delete Random") ); - menuTools1->Append(ID_DELETEALL, wxT("Delete All") ); + menuTools1->Append(ID_DELETE, "Delete Selected" ); + menuTools1->Append(ID_DELETER, "Delete Random" ); + menuTools1->Append(ID_DELETEALL, "Delete All" ); menuTools1->AppendSeparator(); - menuTools1->Append(ID_SETBGCOLOUR, wxT("Set Bg Colour") ); - menuTools1->Append(ID_SETBGCOLOURRECUR, wxT("Set Bg Colour (Recursively)") ); - menuTools1->Append(ID_UNSPECIFY, wxT("Set Value to Unspecified")); + menuTools1->Append(ID_SETBGCOLOUR, "Set Bg Colour" ); + menuTools1->Append(ID_SETBGCOLOURRECUR, "Set Bg Colour (Recursively)" ); + menuTools1->Append(ID_UNSPECIFY, "Set Value to Unspecified"); menuTools1->AppendSeparator(); - m_itemEnable = menuTools1->Append(ID_ENABLE, wxT("Enable"), - wxT("Toggles item's enabled state.") ); + m_itemEnable = menuTools1->Append(ID_ENABLE, "Enable", + "Toggles item's enabled state." ); m_itemEnable->Enable( false ); - menuTools1->Append(ID_HIDE, wxT("Hide"), wxT("Hides a property") ); - menuTools1->Append(ID_SETREADONLY, wxT("Set as Read-Only"), - wxT("Set property as read-only") ); + menuTools1->Append(ID_HIDE, "Hide", "Hides a property" ); + menuTools1->Append(ID_SETREADONLY, "Set as Read-Only", + "Set property as read-only" ); - menuTools2->Append(ID_ITERATE1, wxT("Iterate Over Properties") ); - menuTools2->Append(ID_ITERATE2, wxT("Iterate Over Visible Items") ); - menuTools2->Append(ID_ITERATE3, wxT("Reverse Iterate Over Properties") ); - menuTools2->Append(ID_ITERATE4, wxT("Iterate Over Categories") ); + menuTools2->Append(ID_ITERATE1, "Iterate Over Properties" ); + menuTools2->Append(ID_ITERATE2, "Iterate Over Visible Items" ); + menuTools2->Append(ID_ITERATE3, "Reverse Iterate Over Properties" ); + menuTools2->Append(ID_ITERATE4, "Iterate Over Categories" ); menuTools2->AppendSeparator(); - menuTools2->Append(ID_ONEXTENDEDKEYNAV, wxT("Extend Keyboard Navigation"), - wxT("This will set Enter to navigate to next property, ") - wxT("and allows arrow keys to navigate even when in ") - wxT("editor control.")); + menuTools2->Append(ID_ONEXTENDEDKEYNAV, "Extend Keyboard Navigation", + "This will set Enter to navigate to next property, " + "and allows arrow keys to navigate even when in " + "editor control."); menuTools2->AppendSeparator(); - menuTools2->Append(ID_SETPROPERTYVALUE, wxT("Set Property Value") ); - menuTools2->Append(ID_CLEARMODIF, wxT("Clear Modified Status"), wxT("Clears wxPG_MODIFIED flag from all properties.") ); + menuTools2->Append(ID_SETPROPERTYVALUE, "Set Property Value" ); + menuTools2->Append(ID_CLEARMODIF, "Clear Modified Status", "Clears wxPG_MODIFIED flag from all properties." ); menuTools2->AppendSeparator(); - m_itemFreeze = menuTools2->AppendCheckItem(ID_FREEZE, wxT("Freeze"), - wxT("Disables painting, auto-sorting, etc.") ); + m_itemFreeze = menuTools2->AppendCheckItem(ID_FREEZE, "Freeze", + "Disables painting, auto-sorting, etc." ); menuTools2->AppendSeparator(); - menuTools2->Append(ID_DUMPLIST, wxT("Display Values as wxVariant List"), wxT("Tests GetAllValues method and wxVariant conversion.") ); + menuTools2->Append(ID_DUMPLIST, "Display Values as wxVariant List", "Tests GetAllValues method and wxVariant conversion." ); menuTools2->AppendSeparator(); - menuTools2->Append(ID_GETVALUES, wxT("Get Property Values"), wxT("Stores all property values.") ); - menuTools2->Append(ID_SETVALUES, wxT("Set Property Values"), wxT("Reverts property values to those last stored.") ); - menuTools2->Append(ID_SETVALUES2, wxT("Set Property Values 2"), wxT("Adds property values that should not initially be as items (so new items are created).") ); + menuTools2->Append(ID_GETVALUES, "Get Property Values", "Stores all property values." ); + menuTools2->Append(ID_SETVALUES, "Set Property Values", "Reverts property values to those last stored." ); + menuTools2->Append(ID_SETVALUES2, "Set Property Values 2", "Adds property values that should not initially be as items (so new items are created)." ); menuTools2->AppendSeparator(); - menuTools2->Append(ID_SAVESTATE, wxT("Save Editable State") ); - menuTools2->Append(ID_RESTORESTATE, wxT("Restore Editable State") ); + menuTools2->Append(ID_SAVESTATE, "Save Editable State" ); + menuTools2->Append(ID_RESTORESTATE, "Restore Editable State" ); menuTools2->AppendSeparator(); - menuTools2->Append(ID_ENABLECOMMONVALUES, wxT("Enable Common Value"), - wxT("Enable values that are common to all properties, for selected property.")); + menuTools2->Append(ID_ENABLECOMMONVALUES, "Enable Common Value", + "Enable values that are common to all properties, for selected property."); menuTools2->AppendSeparator(); - menuTools2->Append(ID_COLLAPSE, wxT("Collapse Selected") ); - menuTools2->Append(ID_COLLAPSEALL, wxT("Collapse All") ); + menuTools2->Append(ID_COLLAPSE, "Collapse Selected" ); + menuTools2->Append(ID_COLLAPSEALL, "Collapse All" ); menuTools2->AppendSeparator(); - menuTools2->Append(ID_INSERTPAGE, wxT("Add Page") ); - menuTools2->Append(ID_REMOVEPAGE, wxT("Remove Page") ); + menuTools2->Append(ID_INSERTPAGE, "Add Page" ); + menuTools2->Append(ID_REMOVEPAGE, "Remove Page" ); menuTools2->AppendSeparator(); - menuTools2->Append(ID_FITCOLUMNS, wxT("Fit Columns") ); + menuTools2->Append(ID_FITCOLUMNS, "Fit Columns" ); m_itemVetoDragging = menuTools2->AppendCheckItem(ID_VETOCOLDRAG, - wxT("Veto Column Dragging")); + "Veto Column Dragging"); menuTools2->AppendSeparator(); - menuTools2->Append(ID_CHANGEFLAGSITEMS, wxT("Change Children of FlagsProp") ); + menuTools2->Append(ID_CHANGEFLAGSITEMS, "Change Children of FlagsProp" ); menuTools2->AppendSeparator(); - menuTools2->Append(ID_TESTINSERTCHOICE, wxT("Test InsertPropertyChoice") ); - menuTools2->Append(ID_TESTDELETECHOICE, wxT("Test DeletePropertyChoice") ); + menuTools2->Append(ID_TESTINSERTCHOICE, "Test InsertPropertyChoice" ); + menuTools2->Append(ID_TESTDELETECHOICE, "Test DeletePropertyChoice" ); menuTools2->AppendSeparator(); - menuTools2->Append(ID_SETSPINCTRLEDITOR, wxT("Use SpinCtrl Editor") ); - menuTools2->Append(ID_TESTREPLACE, wxT("Test ReplaceProperty") ); + menuTools2->Append(ID_SETSPINCTRLEDITOR, "Use SpinCtrl Editor" ); + menuTools2->Append(ID_TESTREPLACE, "Test ReplaceProperty" ); - menuTry->Append(ID_SELECTSTYLE, wxT("Set Window Style"), - wxT("Select window style flags used by the grid.")); - menuTry->AppendCheckItem(ID_ENABLELABELEDITING, wxT("Enable label editing"), - wxT("This calls wxPropertyGrid::MakeColumnEditable(0)")); + menuTry->Append(ID_SELECTSTYLE, "Set Window Style", + "Select window style flags used by the grid."); + menuTry->AppendCheckItem(ID_ENABLELABELEDITING, "Enable label editing", + "This calls wxPropertyGrid::MakeColumnEditable(0)"); #if wxUSE_HEADERCTRL menuTry->AppendCheckItem(ID_SHOWHEADER, - wxT("Enable header"), - wxT("This calls wxPropertyGridManager::ShowHeader()")); + "Enable header", + "This calls wxPropertyGridManager::ShowHeader()"); #endif // wxUSE_HEADERCTRL menuTry->AppendSeparator(); - menuTry->AppendRadioItem( ID_COLOURSCHEME1, wxT("Standard Colour Scheme") ); - menuTry->AppendRadioItem( ID_COLOURSCHEME2, wxT("White Colour Scheme") ); - menuTry->AppendRadioItem( ID_COLOURSCHEME3, wxT(".NET Colour Scheme") ); - menuTry->AppendRadioItem( ID_COLOURSCHEME4, wxT("Cream Colour Scheme") ); + menuTry->AppendRadioItem( ID_COLOURSCHEME1, "Standard Colour Scheme" ); + menuTry->AppendRadioItem( ID_COLOURSCHEME2, "White Colour Scheme" ); + menuTry->AppendRadioItem( ID_COLOURSCHEME3, ".NET Colour Scheme" ); + menuTry->AppendRadioItem( ID_COLOURSCHEME4, "Cream Colour Scheme" ); menuTry->AppendSeparator(); - m_itemCatColours = menuTry->AppendCheckItem(ID_CATCOLOURS, wxT("Category Specific Colours"), - wxT("Switches between category-specific cell colours and default scheme (actually done using SetPropertyTextColour and SetPropertyBackgroundColour).") ); + m_itemCatColours = menuTry->AppendCheckItem(ID_CATCOLOURS, "Category Specific Colours", + "Switches between category-specific cell colours and default scheme (actually done using SetPropertyTextColour and SetPropertyBackgroundColour)." ); menuTry->AppendSeparator(); - menuTry->AppendCheckItem(ID_STATICLAYOUT, wxT("Static Layout"), - wxT("Switches between user-modifiable and static layouts.") ); - menuTry->AppendCheckItem(ID_BOOL_CHECKBOX, wxT("Render Boolean values as checkboxes"), - wxT("Renders Boolean values as checkboxes")); - menuTry->Append(ID_SETCOLUMNS, wxT("Set Number of Columns") ); + menuTry->AppendCheckItem(ID_STATICLAYOUT, "Static Layout", + "Switches between user-modifiable and static layouts." ); + menuTry->AppendCheckItem(ID_BOOL_CHECKBOX, "Render Boolean values as checkboxes", + "Renders Boolean values as checkboxes"); + menuTry->Append(ID_SETCOLUMNS, "Set Number of Columns" ); menuTry->AppendSeparator(); - menuTry->Append(ID_TESTXRC, wxT("Display XRC sample") ); + menuTry->Append(ID_TESTXRC, "Display XRC sample" ); - menuFile->Append(ID_RUNMINIMAL, wxT("Run Minimal Sample") ); + menuFile->Append(ID_RUNMINIMAL, "Run Minimal Sample" ); menuFile->AppendSeparator(); - menuFile->Append(ID_RUNTESTFULL, wxT("Run Tests (full)") ); - menuFile->Append(ID_RUNTESTPARTIAL, wxT("Run Tests (fast)") ); + menuFile->Append(ID_RUNTESTFULL, "Run Tests (full)" ); + menuFile->Append(ID_RUNTESTPARTIAL, "Run Tests (fast)" ); menuFile->AppendSeparator(); - menuFile->Append(ID_QUIT, wxT("E&xit\tAlt-X"), wxT("Quit this program") ); + menuFile->Append(ID_QUIT, "E&xit\tAlt-X", "Quit this program" ); // Now append the freshly created menu to the menu bar... wxMenuBar *menuBar = new wxMenuBar(); - menuBar->Append(menuFile, wxT("&File") ); - menuBar->Append(menuTry, wxT("&Try These!") ); - menuBar->Append(menuTools1, wxT("&Basic") ); - menuBar->Append(menuTools2, wxT("&Advanced") ); - menuBar->Append(menuHelp, wxT("&Help") ); + menuBar->Append(menuFile, "&File" ); + menuBar->Append(menuTry, "&Try These!" ); + menuBar->Append(menuTools1, "&Basic" ); + menuBar->Append(menuTools2, "&Advanced" ); + menuBar->Append(menuHelp, "&Help" ); // ... and attach this menu bar to the frame SetMenuBar(menuBar); @@ -2157,7 +2150,7 @@ FormMain::FormMain(const wxString& title, const wxPoint& pos, const wxSize& size #if wxUSE_LOGWINDOW // Create log window - m_logWindow = new wxLogWindow(this, wxT("Log Messages"), false); + m_logWindow = new wxLogWindow(this, "Log Messages", false); m_logWindow->GetFrame()->Move(GetPosition().x + GetSize().x + 10, GetPosition().y); m_logWindow->Show(); @@ -2193,7 +2186,7 @@ void GenerateUniquePropertyLabel( wxPropertyGridManager* pg, wxString& baselabel for (;;) { count++; - newlabel.Printf(wxT("%s%i"),baselabel.c_str(),count); + newlabel.Printf("%s%i",baselabel,count); if ( !pg->GetPropertyByLabel( newlabel ) ) break; } } @@ -2212,17 +2205,17 @@ void FormMain::OnInsertPropClick( wxCommandEvent& WXUNUSED(event) ) if ( !m_pPropGridManager->GetGrid()->GetRoot()->GetChildCount() ) { - wxMessageBox(wxT("No items to relate - first add some with Append.")); + wxMessageBox("No items to relate - first add some with Append."); return; } wxPGProperty* id = m_pPropGridManager->GetGrid()->GetSelection(); if ( !id ) { - wxMessageBox(wxT("First select a property - new one will be inserted right before that.")); + wxMessageBox("First select a property - new one will be inserted right before that."); return; } - if ( propLabel.Len() < 1 ) propLabel = wxT("Property"); + if ( propLabel.Len() < 1 ) propLabel = "Property"; GenerateUniquePropertyLabel( m_pPropGridManager, propLabel ); @@ -2238,7 +2231,7 @@ void FormMain::OnAppendPropClick( wxCommandEvent& WXUNUSED(event) ) { wxString propLabel; - if ( propLabel.Len() < 1 ) propLabel = wxT("Property"); + if ( propLabel.Len() < 1 ) propLabel = "Property"; GenerateUniquePropertyLabel( m_pPropGridManager, propLabel ); @@ -2260,7 +2253,7 @@ void FormMain::OnAppendCatClick( wxCommandEvent& WXUNUSED(event) ) { wxString propLabel; - if ( propLabel.Len() < 1 ) propLabel = wxT("Category"); + if ( propLabel.Len() < 1 ) propLabel = "Category"; GenerateUniquePropertyLabel( m_pPropGridManager, propLabel ); @@ -2278,18 +2271,18 @@ void FormMain::OnInsertCatClick( wxCommandEvent& WXUNUSED(event) ) if ( !m_pPropGridManager->GetGrid()->GetRoot()->GetChildCount() ) { - wxMessageBox(wxT("No items to relate - first add some with Append.")); + wxMessageBox("No items to relate - first add some with Append."); return; } wxPGProperty* id = m_pPropGridManager->GetGrid()->GetSelection(); if ( !id ) { - wxMessageBox(wxT("First select a property - new one will be inserted right before that.")); + wxMessageBox("First select a property - new one will be inserted right before that."); return; } - if ( propLabel.Len() < 1 ) propLabel = wxT("Category"); + if ( propLabel.Len() < 1 ) propLabel = "Category"; GenerateUniquePropertyLabel( m_pPropGridManager, propLabel ); @@ -2305,7 +2298,7 @@ void FormMain::OnDelPropClick( wxCommandEvent& WXUNUSED(event) ) wxPGProperty* id = m_pPropGridManager->GetGrid()->GetSelection(); if ( !id ) { - wxMessageBox(wxT("First select a property.")); + wxMessageBox("First select a property."); return; } @@ -2340,7 +2333,7 @@ void FormMain::OnDelPropRClick( wxCommandEvent& WXUNUSED(event) ) void FormMain::OnContextMenu( wxContextMenuEvent& event ) { - wxLogDebug(wxT("FormMain::OnContextMenu(%i,%i)"), + wxLogDebug("FormMain::OnContextMenu(%i,%i)", event.GetPosition().x,event.GetPosition().y); wxUnusedVar(event); @@ -2354,7 +2347,7 @@ void FormMain::OnCloseClick( wxCommandEvent& WXUNUSED(event) ) { /*#ifdef __WXDEBUG__ m_pPropGridManager->GetGrid()->DumpAllocatedChoiceSets(); - wxLogDebug(wxT("\\-> Don't worry, this is perfectly normal in this sample.")); + wxLogDebug("\\-> Don't worry, this is perfectly normal in this sample."); #endif*/ Close(false); @@ -2366,10 +2359,10 @@ int IterateMessage( wxPGProperty* prop ) { wxString s; - s.Printf( wxT("\"%s\" class = %s, valuetype = %s"), prop->GetLabel().c_str(), - prop->GetClassInfo()->GetClassName(), prop->GetValueType().c_str() ); + s.Printf( "\"%s\" class = %s, valuetype = %s", prop->GetLabel(), + prop->GetClassInfo()->GetClassName(), prop->GetValueType() ); - return wxMessageBox( s, wxT("Iterating... (press CANCEL to end)"), wxOK|wxCANCEL ); + return wxMessageBox( s, "Iterating... (press CANCEL to end)", wxOK|wxCANCEL ); } // ----------------------------------------------------------------------- @@ -2492,14 +2485,14 @@ void FormMain::OnFitColumnsClick( wxCommandEvent& WXUNUSED(event) ) void FormMain::OnChangeFlagsPropItemsClick( wxCommandEvent& WXUNUSED(event) ) { - wxPGProperty* p = m_pPropGridManager->GetPropertyByName(wxT("Window Styles")); + wxPGProperty* p = m_pPropGridManager->GetPropertyByName("Window Styles"); wxPGChoices newChoices; - newChoices.Add(wxT("Fast"),0x1); - newChoices.Add(wxT("Powerful"),0x2); - newChoices.Add(wxT("Safe"),0x4); - newChoices.Add(wxT("Sleek"),0x8); + newChoices.Add("Fast",0x1); + newChoices.Add("Powerful",0x2); + newChoices.Add("Safe",0x4); + newChoices.Add("Sleek",0x8); p->SetChoices(newChoices); } @@ -2511,19 +2504,19 @@ void FormMain::OnEnableDisable( wxCommandEvent& ) wxPGProperty* id = m_pPropGridManager->GetGrid()->GetSelection(); if ( !id ) { - wxMessageBox(wxT("First select a property.")); + wxMessageBox("First select a property."); return; } if ( m_pPropGridManager->IsPropertyEnabled( id ) ) { m_pPropGridManager->DisableProperty ( id ); - m_itemEnable->SetItemLabel( wxT("Enable") ); + m_itemEnable->SetItemLabel( "Enable" ); } else { m_pPropGridManager->EnableProperty ( id ); - m_itemEnable->SetItemLabel( wxT("Disable") ); + m_itemEnable->SetItemLabel( "Disable" ); } } @@ -2534,7 +2527,7 @@ void FormMain::OnSetReadOnly( wxCommandEvent& WXUNUSED(event) ) wxPGProperty* p = m_pPropGridManager->GetGrid()->GetSelection(); if ( !p ) { - wxMessageBox(wxT("First select a property.")); + wxMessageBox("First select a property."); return; } m_pPropGridManager->SetPropertyReadOnly(p); @@ -2547,7 +2540,7 @@ void FormMain::OnHide( wxCommandEvent& WXUNUSED(event) ) wxPGProperty* id = m_pPropGridManager->GetGrid()->GetSelection(); if ( !id ) { - wxMessageBox(wxT("First select a property.")); + wxMessageBox("First select a property."); return; } @@ -2570,11 +2563,11 @@ FormMain::OnSetBackgroundColour( wxCommandEvent& event ) wxPGProperty* prop = pg->GetSelection(); if ( !prop ) { - wxMessageBox(wxT("First select a property.")); + wxMessageBox("First select a property."); return; } - wxColour col = ::wxGetColourFromUser(this, *wxWHITE, wxT("Choose colour")); + wxColour col = ::wxGetColourFromUser(this, *wxWHITE, "Choose colour"); if ( col.IsOk() ) { @@ -2587,7 +2580,7 @@ FormMain::OnSetBackgroundColour( wxCommandEvent& event ) void FormMain::OnInsertPage( wxCommandEvent& WXUNUSED(event) ) { - m_pPropGridManager->AddPage(wxT("New Page")); + m_pPropGridManager->AddPage("New Page"); } // ----------------------------------------------------------------------- @@ -2602,7 +2595,7 @@ void FormMain::OnRemovePage( wxCommandEvent& WXUNUSED(event) ) void FormMain::OnSaveState( wxCommandEvent& WXUNUSED(event) ) { m_savedState = m_pPropGridManager->SaveEditableState(); - wxLogDebug(wxT("Saved editable state string: \"%s\""), m_savedState.c_str()); + wxLogDebug("Saved editable state string: \"%s\"", m_savedState); } // ----------------------------------------------------------------------- @@ -2621,7 +2614,7 @@ void FormMain::OnSetSpinCtrlEditorClick( wxCommandEvent& WXUNUSED(event) ) if ( pgId ) m_pPropGridManager->SetPropertyEditor( pgId, wxPGEditor_SpinCtrl ); else - wxMessageBox(wxT("First select a property")); + wxMessageBox("First select a property"); #endif } @@ -2633,17 +2626,17 @@ void FormMain::OnTestReplaceClick( wxCommandEvent& WXUNUSED(event) ) if ( pgId ) { wxPGChoices choices; - choices.Add(wxT("Flag 0"),0x0001); - choices.Add(wxT("Flag 1"),0x0002); - choices.Add(wxT("Flag 2"),0x0004); - choices.Add(wxT("Flag 3"),0x0008); + choices.Add("Flag 0",0x0001); + choices.Add("Flag 1",0x0002); + choices.Add("Flag 2",0x0004); + choices.Add("Flag 3",0x0008); const long maxVal = 0x000F; // Look for unused property name - wxString propName = wxT("ReplaceFlagsProperty"); + wxString propName = "ReplaceFlagsProperty"; int idx = 0; while ( m_pPropGridManager->GetPropertyByName(propName) ) { - propName = wxString::Format(wxT("ReplaceFlagsProperty %i"), ++idx); + propName = wxString::Format("ReplaceFlagsProperty %i", ++idx); } // Replace property and select new one // with random value in range [1..maxVal] @@ -2657,7 +2650,7 @@ void FormMain::OnTestReplaceClick( wxCommandEvent& WXUNUSED(event) ) m_pPropGridManager->SelectProperty(newId); } else - wxMessageBox(wxT("First select a property")); + wxMessageBox("First select a property"); } // ----------------------------------------------------------------------- @@ -2665,6 +2658,7 @@ void FormMain::OnTestReplaceClick( wxCommandEvent& WXUNUSED(event) ) void FormMain::OnClearModifyStatusClick( wxCommandEvent& WXUNUSED(event) ) { m_pPropGridManager->ClearModifiedStatus(); + m_pPropGridManager->Refresh(); } // ----------------------------------------------------------------------- @@ -2707,7 +2701,7 @@ void FormMain::OnShowHeader( wxCommandEvent& event ) m_pPropGridManager->ShowHeader(show); if ( show ) { - m_pPropGridManager->SetColumnTitle(2, wxT("Units")); + m_pPropGridManager->SetColumnTitle(2, "Units"); } } #endif // wxUSE_HEADERCTRL @@ -2717,28 +2711,28 @@ void FormMain::OnShowHeader( wxCommandEvent& event ) void FormMain::OnAbout(wxCommandEvent& WXUNUSED(event)) { wxString msg; - msg.Printf( wxT("wxPropertyGrid Sample") + msg.Printf( "wxPropertyGrid Sample" #if wxUSE_UNICODE #if defined(wxUSE_UNICODE_UTF8) && wxUSE_UNICODE_UTF8 - wxT(" ") + " " #else - wxT(" ") + " " #endif #else - wxT(" ") + " " #endif #ifdef __WXDEBUG__ - wxT(" ") + " " #else - wxT(" ") + " " #endif - wxT("\n\n") - wxT("Programmed by %s\n\n") - wxT("Using %s\n\n"), - wxT("Jaakko Salli"), wxVERSION_STRING + "\n\n" + "Programmed by %s\n\n" + "Using %s\n\n", + "Jaakko Salli", wxVERSION_STRING ); - wxMessageBox(msg, wxT("About"), wxOK | wxICON_INFORMATION, this); + wxMessageBox(msg, "About", wxOK | wxICON_INFORMATION, this); } // ----------------------------------------------------------------------- @@ -2823,28 +2817,28 @@ void FormMain::OnCatColours( wxCommandEvent& event ) if ( event.IsChecked() ) { // Set custom colours. - pg->SetPropertyTextColour( wxT("Appearance"), wxColour(255,0,0), wxPG_DONT_RECURSE ); - pg->SetPropertyBackgroundColour( wxT("Appearance"), wxColour(255,255,183) ); - pg->SetPropertyTextColour( wxT("Appearance"), wxColour(255,0,183) ); - pg->SetPropertyTextColour( wxT("PositionCategory"), wxColour(0,255,0), wxPG_DONT_RECURSE ); - pg->SetPropertyBackgroundColour( wxT("PositionCategory"), wxColour(255,226,190) ); - pg->SetPropertyTextColour( wxT("PositionCategory"), wxColour(255,0,190) ); - pg->SetPropertyTextColour( wxT("Environment"), wxColour(0,0,255), wxPG_DONT_RECURSE ); - pg->SetPropertyBackgroundColour( wxT("Environment"), wxColour(208,240,175) ); - pg->SetPropertyTextColour( wxT("Environment"), wxColour(255,255,255) ); - pg->SetPropertyBackgroundColour( wxT("More Examples"), wxColour(172,237,255) ); - pg->SetPropertyTextColour( wxT("More Examples"), wxColour(172,0,255) ); + pg->SetPropertyTextColour( "Appearance", wxColour(255,0,0), wxPG_DONT_RECURSE ); + pg->SetPropertyBackgroundColour( "Appearance", wxColour(255,255,183) ); + pg->SetPropertyTextColour( "Appearance", wxColour(255,0,183) ); + pg->SetPropertyTextColour( "PositionCategory", wxColour(0,255,0), wxPG_DONT_RECURSE ); + pg->SetPropertyBackgroundColour( "PositionCategory", wxColour(255,226,190) ); + pg->SetPropertyTextColour( "PositionCategory", wxColour(255,0,190) ); + pg->SetPropertyTextColour( "Environment", wxColour(0,0,255), wxPG_DONT_RECURSE ); + pg->SetPropertyBackgroundColour( "Environment", wxColour(208,240,175) ); + pg->SetPropertyTextColour( "Environment", wxColour(255,255,255) ); + pg->SetPropertyBackgroundColour( "More Examples", wxColour(172,237,255) ); + pg->SetPropertyTextColour( "More Examples", wxColour(172,0,255) ); } else { // Revert to original. - pg->SetPropertyColoursToDefault( wxT("Appearance") ); - pg->SetPropertyColoursToDefault( wxT("Appearance"), wxPG_RECURSE ); - pg->SetPropertyColoursToDefault( wxT("PositionCategory") ); - pg->SetPropertyColoursToDefault( wxT("PositionCategory"), wxPG_RECURSE ); - pg->SetPropertyColoursToDefault( wxT("Environment") ); - pg->SetPropertyColoursToDefault( wxT("Environment"), wxPG_RECURSE ); - pg->SetPropertyColoursToDefault( wxT("More Examples"), wxPG_RECURSE ); + pg->SetPropertyColoursToDefault( "Appearance" ); + pg->SetPropertyColoursToDefault( "Appearance", wxPG_RECURSE ); + pg->SetPropertyColoursToDefault( "PositionCategory" ); + pg->SetPropertyColoursToDefault( "PositionCategory", wxPG_RECURSE ); + pg->SetPropertyColoursToDefault( "Environment" ); + pg->SetPropertyColoursToDefault( "Environment", wxPG_RECURSE ); + pg->SetPropertyColoursToDefault( "More Examples", wxPG_RECURSE ); } m_pPropGridManager->Thaw(); m_pPropGridManager->Refresh(); @@ -2853,7 +2847,7 @@ void FormMain::OnCatColours( wxCommandEvent& event ) // ----------------------------------------------------------------------- #define ADD_FLAG(FLAG) \ - chs.Add(wxT(#FLAG)); \ + chs.Add(#FLAG); \ vls.Add(FLAG); \ if ( (flags & FLAG) == FLAG ) sel.Add(ind); \ ind++; @@ -2880,8 +2874,8 @@ void FormMain::OnSelectStyle( wxCommandEvent& WXUNUSED(event) ) ADD_FLAG(wxPG_TOOLBAR) ADD_FLAG(wxPG_DESCRIPTION) ADD_FLAG(wxPG_NO_INTERNAL_BORDER) - wxMultiChoiceDialog dlg( this, wxT("Select window styles to use"), - wxT("wxPropertyGrid Window Style"), chs ); + wxMultiChoiceDialog dlg( this, "Select window styles to use", + "wxPropertyGrid Window Style", chs ); dlg.SetSelections(sel); if ( dlg.ShowModal() == wxID_CANCEL ) return; @@ -2913,8 +2907,8 @@ void FormMain::OnSelectStyle( wxCommandEvent& WXUNUSED(event) ) ADD_FLAG(wxPG_EX_NO_TOOLBAR_DIVIDER) ADD_FLAG(wxPG_EX_TOOLBAR_SEPARATOR) ADD_FLAG(wxPG_EX_ALWAYS_ALLOW_FOCUS) - wxMultiChoiceDialog dlg( this, wxT("Select extra window styles to use"), - wxT("wxPropertyGrid Extra Style"), chs ); + wxMultiChoiceDialog dlg( this, "Select extra window styles to use", + "wxPropertyGrid Extra Style", chs ); dlg.SetSelections(sel); if ( dlg.ShowModal() == wxID_CANCEL ) return; @@ -2936,8 +2930,8 @@ void FormMain::OnSelectStyle( wxCommandEvent& WXUNUSED(event) ) void FormMain::OnSetColumns( wxCommandEvent& WXUNUSED(event) ) { - long colCount = ::wxGetNumberFromUser(wxT("Enter number of columns (2-20)."),wxT("Columns:"), - wxT("Change Columns"),m_pPropGridManager->GetColumnCount(), + long colCount = ::wxGetNumberFromUser("Enter number of columns (2-20).","Columns:", + "Change Columns",m_pPropGridManager->GetColumnCount(), 2,20); if ( colCount >= 2 ) @@ -2955,7 +2949,7 @@ void FormMain::OnSetPropertyValue( wxCommandEvent& WXUNUSED(event) ) if ( selected ) { - wxString value = ::wxGetTextFromUser( wxT("Enter new value:") ); + wxString value = ::wxGetTextFromUser( "Enter new value:" ); pg->SetPropertyValue( selected, value ); } } @@ -2974,11 +2968,11 @@ void FormMain::OnInsertChoice( wxCommandEvent& WXUNUSED(event) ) if ( choices.IsOk() ) { int pos = choices.GetCount() / 2; - selected->InsertChoice(wxT("New Choice"), pos); + selected->InsertChoice("New Choice", pos); } else { - ::wxMessageBox(wxT("First select a property with some choices.")); + ::wxMessageBox("First select a property with some choices."); } } @@ -3000,7 +2994,7 @@ void FormMain::OnDeleteChoice( wxCommandEvent& WXUNUSED(event) ) } else { - ::wxMessageBox(wxT("First select a property with some choices.")); + ::wxMessageBox("First select a property with some choices."); } } @@ -3029,26 +3023,26 @@ void FormMain::OnMisc ( wxCommandEvent& event ) } else if ( id == ID_GETVALUES ) { - m_storedValues = m_pPropGridManager->GetGrid()->GetPropertyValues(wxT("Test"), + m_storedValues = m_pPropGridManager->GetGrid()->GetPropertyValues("Test", m_pPropGridManager->GetGrid()->GetRoot(), wxPG_KEEP_STRUCTURE|wxPG_INC_ATTRIBUTES); } else if ( id == ID_SETVALUES ) { - if ( m_storedValues.IsType(wxT("list")) ) + if ( m_storedValues.IsType("list") ) { m_pPropGridManager->GetGrid()->SetPropertyValues(m_storedValues); } else - wxMessageBox(wxT("First use Get Property Values.")); + wxMessageBox("First use Get Property Values."); } else if ( id == ID_SETVALUES2 ) { wxVariant list; list.NullList(); - list.Append( wxVariant((long)1234,wxT("VariantLong")) ); - list.Append( wxVariant(true,wxT("VariantBool")) ); - list.Append( wxVariant(wxT("Test Text"),wxT("VariantString")) ); + list.Append( wxVariant((long)1234,"VariantLong") ); + list.Append( wxVariant(true,"VariantBool") ); + list.Append( wxVariant("Test Text","VariantString") ); m_pPropGridManager->GetGrid()->SetPropertyValues(list); } else if ( id == ID_COLLAPSE ) @@ -3123,7 +3117,7 @@ bool cxApplication::OnInit() //wxLocale Locale; //Locale.Init(wxLANGUAGE_FINNISH); - FormMain* frame = Form1 = new FormMain( wxT("wxPropertyGrid Sample"), wxPoint(0,0), wxSize(300,500) ); + FormMain* frame = Form1 = new FormMain( "wxPropertyGrid Sample", wxPoint(0,0), wxSize(300,500) ); frame->Show(true); // @@ -3132,7 +3126,7 @@ bool cxApplication::OnInit() if ( app.argc > 1 ) { wxString s = app.argv[1]; - if ( s == wxT("--run-tests") ) + if ( s == "--run-tests" ) { // // Run tests @@ -3158,11 +3152,11 @@ void FormMain::OnIdle( wxIdleEvent& event ) if ( cur_focus != last_focus ) { - const wxChar* class_name = wxT(""); + const wxChar* class_name = ""; if ( cur_focus ) class_name = cur_focus->GetClassInfo()->GetClassName(); last_focus = cur_focus; - wxLogDebug( wxT("FOCUSED: %s %X"), + wxLogDebug( "FOCUSED: %s %X", class_name, (unsigned int)cur_focus); } @@ -3269,20 +3263,20 @@ struct PropertyGridPopup : wxPopupWindow m_grid = new wxPropertyGrid(m_panel, ID_POPUPGRID, wxDefaultPosition, wxSize(400,400), wxPG_SPLITTER_AUTO_CENTER); m_grid->SetColumnCount(3); - wxPGProperty *prop=m_grid->Append(new wxStringProperty(wxT("test_name"), wxPG_LABEL, wxT("test_value"))); - m_grid->SetPropertyAttribute(prop, wxPG_ATTR_UNITS, wxT("type")); - wxPGProperty *prop1 = m_grid->AppendIn(prop, new wxStringProperty(wxT("sub_name1"), wxPG_LABEL, wxT("sub_value1"))); + wxPGProperty *prop=m_grid->Append(new wxStringProperty("test_name", wxPG_LABEL, "test_value")); + m_grid->SetPropertyAttribute(prop, wxPG_ATTR_UNITS, "type"); + wxPGProperty *prop1 = m_grid->AppendIn(prop, new wxStringProperty("sub_name1", wxPG_LABEL, "sub_value1")); - m_grid->AppendIn(prop1, new wxSystemColourProperty(wxT("Cell Colour"),wxPG_LABEL, m_grid->GetGrid()->GetCellBackgroundColour())); - wxPGProperty *prop2 = m_grid->AppendIn(prop, new wxStringProperty(wxT("sub_name2"), wxPG_LABEL, wxT("sub_value2"))); - m_grid->AppendIn(prop2, new wxStringProperty(wxT("sub_name21"), wxPG_LABEL, wxT("sub_value21"))); + m_grid->AppendIn(prop1, new wxSystemColourProperty("Cell Colour",wxPG_LABEL, m_grid->GetGrid()->GetCellBackgroundColour())); + wxPGProperty *prop2 = m_grid->AppendIn(prop, new wxStringProperty("sub_name2", wxPG_LABEL, "sub_value2")); + m_grid->AppendIn(prop2, new wxStringProperty("sub_name21", wxPG_LABEL, "sub_value21")); wxArrayDouble arrdbl; arrdbl.Add(-1.0); arrdbl.Add(-0.5); arrdbl.Add(0.0); arrdbl.Add(0.5); arrdbl.Add(1.0); - m_grid->AppendIn(prop, new wxArrayDoubleProperty(wxT("ArrayDoubleProperty"),wxPG_LABEL,arrdbl) ); - m_grid->AppendIn(prop, new wxFontProperty(wxT("Font"),wxPG_LABEL)); - m_grid->AppendIn(prop2, new wxStringProperty(wxT("sub_name22"), wxPG_LABEL, wxT("sub_value22"))); - m_grid->AppendIn(prop2, new wxStringProperty(wxT("sub_name23"), wxPG_LABEL, wxT("sub_value23"))); + m_grid->AppendIn(prop, new wxArrayDoubleProperty("ArrayDoubleProperty",wxPG_LABEL,arrdbl) ); + m_grid->AppendIn(prop, new wxFontProperty("Font",wxPG_LABEL)); + m_grid->AppendIn(prop2, new wxStringProperty("sub_name22", wxPG_LABEL, "sub_value22")); + m_grid->AppendIn(prop2, new wxStringProperty("sub_name23", wxPG_LABEL, "sub_value23")); prop2->SetExpanded(false); ::SetMinSize(m_grid); @@ -3297,13 +3291,13 @@ struct PropertyGridPopup : wxPopupWindow void OnCollapse(wxPropertyGridEvent& WXUNUSED(event)) { - wxLogMessage(wxT("OnCollapse")); + wxLogMessage("OnCollapse"); Fit(); } void OnExpand(wxPropertyGridEvent& WXUNUSED(event)) { - wxLogMessage(wxT("OnExpand")); + wxLogMessage("OnExpand"); Fit(); } diff --git a/samples/propgrid/propgrid_minimal.cpp b/samples/propgrid/propgrid_minimal.cpp index 355ad7a19a..ee9bbafe97 100644 --- a/samples/propgrid/propgrid_minimal.cpp +++ b/samples/propgrid/propgrid_minimal.cpp @@ -38,12 +38,12 @@ wxBEGIN_EVENT_TABLE(MyFrame, wxFrame) wxEND_EVENT_TABLE() MyFrame::MyFrame(wxWindow* parent) - : wxFrame(parent, wxID_ANY, wxT("PropertyGrid Test")) + : wxFrame(parent, wxID_ANY, "PropertyGrid Test") { wxMenu *Menu = new wxMenu; - Menu->Append(ID_ACTION, wxT("Action")); + Menu->Append(ID_ACTION, "Action"); wxMenuBar *MenuBar = new wxMenuBar(); - MenuBar->Append(Menu, wxT("Action")); + MenuBar->Append(Menu, "Action"); SetMenuBar(MenuBar); wxPropertyGrid *pg = new wxPropertyGrid(this,wxID_ANY,wxDefaultPosition,wxSize(400,400), @@ -51,9 +51,9 @@ MyFrame::MyFrame(wxWindow* parent) wxPG_BOLD_MODIFIED ); m_pg = pg; - pg->Append( new wxStringProperty(wxT("String Property"), wxPG_LABEL) ); - pg->Append( new wxIntProperty(wxT("Int Property"), wxPG_LABEL) ); - pg->Append( new wxBoolProperty(wxT("Bool Property"), wxPG_LABEL) ); + pg->Append( new wxStringProperty("String Property", wxPG_LABEL) ); + pg->Append( new wxIntProperty("Int Property", wxPG_LABEL) ); + pg->Append( new wxBoolProperty("Bool Property", wxPG_LABEL) ); SetSize(400, 600); } @@ -64,12 +64,12 @@ void MyFrame::OnPropertyGridChange(wxPropertyGridEvent &event) if ( p ) { - wxLogVerbose(wxT("OnPropertyGridChange(%s, value=%s)"), - p->GetName().c_str(), p->GetValueAsString().c_str()); + wxLogVerbose("OnPropertyGridChange(%s, value=%s)", + p->GetName(), p->GetValueAsString()); } else { - wxLogVerbose(wxT("OnPropertyGridChange(NULL)")); + wxLogVerbose("OnPropertyGridChange(NULL)"); } } @@ -77,7 +77,7 @@ void MyFrame::OnPropertyGridChanging(wxPropertyGridEvent &event) { wxPGProperty* p = event.GetProperty(); - wxLogVerbose(wxT("OnPropertyGridChanging(%s)"), p->GetName().c_str()); + wxLogVerbose("OnPropertyGridChanging(%s)", p->GetName()); } void MyFrame::OnAction(wxCommandEvent &) diff --git a/samples/propgrid/sampleprops.cpp b/samples/propgrid/sampleprops.cpp index 788b414767..9a3b7a1b41 100644 --- a/samples/propgrid/sampleprops.cpp +++ b/samples/propgrid/sampleprops.cpp @@ -69,7 +69,7 @@ wxFontDataProperty::wxFontDataProperty( const wxString& label, const wxString& n m_value_wxFontData << fontData; // Add extra children. - AddPrivateChild( new wxColourProperty(wxT("Colour"), wxPG_LABEL, + AddPrivateChild( new wxColourProperty("Colour", wxPG_LABEL, fontData.GetColour() ) ); } @@ -77,9 +77,9 @@ wxFontDataProperty::~wxFontDataProperty () { } void wxFontDataProperty::OnSetValue() { - if ( !m_value.IsType(wxT("wxFontData")) ) + if ( !m_value.IsType("wxFontData") ) { - if ( m_value.IsType(wxT("wxFont")) ) + if ( m_value.IsType("wxFont") ) { wxFont font; font << m_value; @@ -101,7 +101,7 @@ void wxFontDataProperty::OnSetValue() } else { - wxFAIL_MSG(wxT("Value to wxFontDataProperty must be either wxFontData or wxFont")); + wxFAIL_MSG("Value to wxFontDataProperty must be either wxFontData or wxFont"); } } else @@ -201,8 +201,8 @@ wxSizeProperty::wxSizeProperty( const wxString& label, const wxString& name, const wxSize& value) : wxPGProperty(label,name) { SetValueI(value); - AddPrivateChild( new wxIntProperty(wxT("Width"),wxPG_LABEL,value.x) ); - AddPrivateChild( new wxIntProperty(wxT("Height"),wxPG_LABEL,value.y) ); + AddPrivateChild( new wxIntProperty("Width",wxPG_LABEL,value.x) ); + AddPrivateChild( new wxIntProperty("Height",wxPG_LABEL,value.y) ); } wxSizeProperty::~wxSizeProperty() { } @@ -241,8 +241,8 @@ wxPointProperty::wxPointProperty( const wxString& label, const wxString& name, const wxPoint& value) : wxPGProperty(label,name) { SetValueI(value); - AddPrivateChild( new wxIntProperty(wxT("X"),wxPG_LABEL,value.x) ); - AddPrivateChild( new wxIntProperty(wxT("Y"),wxPG_LABEL,value.y) ); + AddPrivateChild( new wxIntProperty("X",wxPG_LABEL,value.x) ); + AddPrivateChild( new wxIntProperty("Y",wxPG_LABEL,value.y) ); } wxPointProperty::~wxPointProperty() { } @@ -277,7 +277,7 @@ wxVariant wxPointProperty::ChildChanged( wxVariant& thisValue, // ----------------------------------------------------------------------- WX_PG_IMPLEMENT_ARRAYSTRING_PROPERTY_WITH_VALIDATOR(wxDirsProperty, ',', - wxT("Browse")) + "Browse") #if wxUSE_VALIDATORS @@ -292,7 +292,7 @@ wxValidator* wxDirsProperty::DoGetValidator() const bool wxDirsProperty::OnCustomStringEdit( wxWindow* parent, wxString& value ) { wxDirDialog dlg(parent, - wxT("Select a directory to be added to the list:"), + "Select a directory to be added to the list:", value, 0); @@ -474,7 +474,7 @@ bool operator == (const wxArrayDouble& a, const wxArrayDouble& b) // Can't do direct equality comparison with floating point numbers. if ( fabs(a[i] - b[i]) > 0.0000000001 ) { - //wxLogDebug(wxT("%f != %f"),a[i],b[i]); + //wxLogDebug("%f != %f",a[i],b[i]); return false; } } @@ -498,10 +498,10 @@ wxArrayDoubleProperty::wxArrayDoubleProperty (const wxString& label, // // Need to figure out delimiter needed for this locale // (i.e. can't use comma when comma acts as decimal point in float). - wxChar use_delimiter = wxT(','); + wxChar use_delimiter = ','; - if (wxString::Format(wxT("%.2f"),12.34).Find(use_delimiter) >= 0) - use_delimiter = wxT(';'); + if (wxString::Format("%.2f",12.34).Find(use_delimiter) >= 0) + use_delimiter = ';'; m_delimiter = use_delimiter; @@ -540,7 +540,7 @@ wxString wxArrayDoubleProperty::ValueToString( wxVariant& value, void wxArrayDoubleProperty::GenerateValueAsString( wxString& target, int prec, bool removeZeroes ) const { - wxChar between[3] = wxT(", "); + wxString between = ", "; size_t i; between[0] = m_delimiter; @@ -657,7 +657,7 @@ wxValidator* wxArrayDoubleProperty::DoGetValidator() const wxArrayString incChars(numValidator.GetIncludes()); // Accept also a delimiter and space character incChars.Add(m_delimiter); - incChars.Add(wxT(" ")); + incChars.Add(" "); validator->SetIncludes(incChars); @@ -670,9 +670,9 @@ wxValidator* wxArrayDoubleProperty::DoGetValidator() const bool wxArrayDoubleProperty::ValidateValue(wxVariant& value, wxPGValidationInfo& validationInfo) const { - if (!value.IsType(wxT("wxArrayDouble"))) + if (!value.IsType("wxArrayDouble")) { - validationInfo.SetFailureMessage(wxT("At least one element is not a valid floating-point number.")); + validationInfo.SetFailureMessage("At least one element is not a valid floating-point number."); return false; } diff --git a/samples/propgrid/tests.cpp b/samples/propgrid/tests.cpp index 3a48785286..1a9516b332 100644 --- a/samples/propgrid/tests.cpp +++ b/samples/propgrid/tests.cpp @@ -45,13 +45,13 @@ public: : wxColourProperty(label, name, value) { wxPGChoices colours; - colours.Add(wxT("White")); - colours.Add(wxT("Black")); - colours.Add(wxT("Red")); - colours.Add(wxT("Green")); - colours.Add(wxT("Blue")); - colours.Add(wxT("Custom")); - colours.Add(wxT("None")); + colours.Add("White"); + colours.Add("Black"); + colours.Add("Red"); + colours.Add("Green"); + colours.Add("Blue"); + colours.Add("Custom"); + colours.Add("None"); m_choices = colours; SetIndex(0); wxVariant variant; @@ -106,24 +106,24 @@ public: void FormMain::AddTestProperties( wxPropertyGridPage* pg ) { - pg->Append( new MyColourProperty(wxT("CustomColourProperty"), wxPG_LABEL, *wxGREEN) ); - pg->GetProperty(wxT("CustomColourProperty"))->SetAutoUnspecified(true); - pg->SetPropertyEditor( wxT("CustomColourProperty"), wxPGEditor_ComboBox ); + pg->Append( new MyColourProperty("CustomColourProperty", wxPG_LABEL, *wxGREEN) ); + pg->GetProperty("CustomColourProperty")->SetAutoUnspecified(true); + pg->SetPropertyEditor( "CustomColourProperty", wxPGEditor_ComboBox ); - pg->SetPropertyHelpString(wxT("CustomColourProperty"), - wxT("This is a MyColourProperty from the sample app. ") - wxT("It is built by subclassing wxColourProperty.")); + pg->SetPropertyHelpString("CustomColourProperty", + "This is a MyColourProperty from the sample app. " + "It is built by subclassing wxColourProperty."); } // ----------------------------------------------------------------------- void FormMain::OnDumpList( wxCommandEvent& WXUNUSED(event) ) { - wxVariant values = m_pPropGridManager->GetPropertyValues(wxT("list"), wxNullProperty, wxPG_INC_ATTRIBUTES); - wxString text = wxT("This only tests that wxVariant related routines do not crash."); + wxVariant values = m_pPropGridManager->GetPropertyValues("list", wxNullProperty, wxPG_INC_ATTRIBUTES); + wxString text = "This only tests that wxVariant related routines do not crash."; wxString t; - wxDialog* dlg = new wxDialog(this,wxID_ANY,wxT("wxVariant Test"), + wxDialog* dlg = new wxDialog(this,wxID_ANY,"wxVariant Test", wxDefaultPosition,wxDefaultSize,wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER); unsigned int i; @@ -134,27 +134,27 @@ void FormMain::OnDumpList( wxCommandEvent& WXUNUSED(event) ) wxString strValue = v.GetString(); #if wxCHECK_VERSION(2,8,0) - if ( v.GetName().EndsWith(wxT("@attr")) ) + if ( v.GetName().EndsWith("@attr") ) #else - if ( v.GetName().Right(5) == wxT("@attr") ) + if ( v.GetName().Right(5) == "@attr" ) #endif { - text += wxString::Format(wxT("Attributes:\n")); + text += wxString::Format("Attributes:\n"); unsigned int n; for ( n = 0; n < (unsigned int)v.GetCount(); n++ ) { wxVariant& a = v[n]; - t.Printf(wxT(" attribute %i: name=\"%s\" (type=\"%s\" value=\"%s\")\n"),(int)n, - a.GetName().c_str(),a.GetType().c_str(),a.GetString().c_str()); + t.Printf(" attribute %i: name=\"%s\" (type=\"%s\" value=\"%s\")\n",(int)n, + a.GetName(),a.GetType(),a.GetString()); text += t; } } else { - t.Printf(wxT("%i: name=\"%s\" type=\"%s\" value=\"%s\"\n"),(int)i, - v.GetName().c_str(),v.GetType().c_str(),strValue.c_str()); + t.Printf("%i: name=\"%s\" type=\"%s\" value=\"%s\"\n",(int)i, + v.GetName(),v.GetType(),strValue); text += t; } } @@ -169,7 +169,7 @@ void FormMain::OnDumpList( wxCommandEvent& WXUNUSED(event) ) rowsizer->Add( ed, wxSizerFlags(1).Expand().Border(wxALL, spacing)); topsizer->Add( rowsizer, wxSizerFlags(1).Expand()); rowsizer = new wxBoxSizer( wxHORIZONTAL ); - rowsizer->Add( new wxButton(dlg,wxID_OK,wxT("Ok")), + rowsizer->Add( new wxButton(dlg,wxID_OK,"Ok"), wxSizerFlags(0).CentreHorizontal().CentreVertical().Border(wxBOTTOM|wxLEFT|wxRIGHT, spacing)); topsizer->Add( rowsizer, wxSizerFlags().Right() ); @@ -197,8 +197,8 @@ public: m_preWarnings = wxPGGlobalVars->m_warnings; #endif - if ( name != wxT("none") ) - Msg(name+wxT("\n")); + if ( name != "none" ) + Msg(name+"\n"); } ~TestRunner() @@ -207,7 +207,7 @@ public: int warningsOccurred = wxPGGlobalVars->m_warnings - m_preWarnings; if ( warningsOccurred ) { - wxString s = wxString::Format(wxT("%i warnings occurred during test '%s'"), warningsOccurred, m_name.c_str()); + wxString s = wxString::Format("%i warnings occurred during test '%s'", warningsOccurred, m_name); m_errorMessages->push_back(s); Msg(s); } @@ -219,7 +219,7 @@ public: if ( m_ed ) { m_ed->AppendText(text); - m_ed->AppendText(wxT("\n")); + m_ed->AppendText("\n"); } wxLogDebug(text); } @@ -236,14 +236,14 @@ protected: #define RT_START_TEST(TESTNAME) \ - TestRunner tr(wxT(#TESTNAME), pgman, ed, &errorMessages); + TestRunner tr(#TESTNAME, pgman, ed, &errorMessages); #define RT_MSG(S) \ tr.Msg(S); #define RT_FAILURE() \ { \ - wxString s1 = wxString::Format(wxT("Test failure in tests.cpp, line %i."),__LINE__-1); \ + wxString s1 = wxString::Format("Test failure in tests.cpp, line %i.",__LINE__-1); \ errorMessages.push_back(s1); \ wxLogDebug(s1); \ failures++; \ @@ -255,10 +255,10 @@ protected: #define RT_FAILURE_MSG(MSG) \ { \ - wxString s1 = wxString::Format(wxT("Test failure in tests.cpp, line %i."),__LINE__-1); \ + wxString s1 = wxString::Format("Test failure in tests.cpp, line %i.",__LINE__-1); \ errorMessages.push_back(s1); \ wxLogDebug(s1); \ - wxString s2 = wxString::Format(wxT("Message: %s"),MSG.c_str()); \ + wxString s2 = wxString::Format("Message: %s",MSG); \ errorMessages.push_back(s2); \ wxLogDebug(s2); \ failures++; \ @@ -270,7 +270,7 @@ protected: unsigned int h2_ = PROPS->GetActualVirtualHeight(); \ if ( h1_ != h2_ ) \ { \ - wxString s_ = wxString::Format(wxT("VirtualHeight = %i, should be %i (%s)"), h1_, h2_, EXTRATEXT.c_str()); \ + wxString s_ = wxString::Format("VirtualHeight = %i, should be %i (%s)", h1_, h2_, EXTRATEXT); \ RT_FAILURE_MSG(s_); \ _failed_ = true; \ } \ @@ -342,7 +342,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) wxArrayString errorMessages; wxDialog* dlg = NULL; - dlg = new wxDialog(this,wxID_ANY,wxT("wxPropertyGrid Regression Tests"), + dlg = new wxDialog(this,wxID_ANY,"wxPropertyGrid Regression Tests", wxDefaultPosition,wxDefaultSize,wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER); // multi-line text editor dialog @@ -355,7 +355,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) rowsizer->Add( ed, wxSizerFlags(1).Expand().Border(wxALL, spacing)); topsizer->Add( rowsizer, wxSizerFlags(1).Expand()); rowsizer = new wxBoxSizer( wxHORIZONTAL ); - rowsizer->Add( new wxButton(dlg,wxID_OK,wxT("Ok")), + rowsizer->Add( new wxButton(dlg,wxID_OK,"Ok"), wxSizerFlags(0).CentreHorizontal().CentreVertical().Border(wxBOTTOM|wxLEFT|wxRIGHT, spacing)); topsizer->Add( rowsizer, wxSizerFlags().Right() ); @@ -382,13 +382,13 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) { wxPGProperty* p = it.GetProperty(); if ( p->IsCategory() ) - RT_FAILURE_MSG(wxString::Format(wxT("'%s' is a category (non-private child property expected)"),p->GetLabel().c_str())) + RT_FAILURE_MSG(wxString::Format("'%s' is a category (non-private child property expected)",p->GetLabel())) else if ( p->GetParent()->HasFlag(wxPG_PROP_AGGREGATE) ) - RT_FAILURE_MSG(wxString::Format(wxT("'%s' is a private child (non-private child property expected)"),p->GetLabel().c_str())) + RT_FAILURE_MSG(wxString::Format("'%s' is a private child (non-private child property expected)",p->GetLabel())) count++; } - RT_MSG(wxString::Format(wxT("GetVIterator(wxPG_ITERATE_PROPERTIES) -> %i entries"), count)); + RT_MSG(wxString::Format("GetVIterator(wxPG_ITERATE_PROPERTIES) -> %i entries", count)); count = 0; for ( it = pgman->GetVIterator(wxPG_ITERATE_CATEGORIES); @@ -397,11 +397,11 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) { wxPGProperty* p = it.GetProperty(); if ( !p->IsCategory() ) - RT_FAILURE_MSG(wxString::Format(wxT("'%s' is not a category (only category was expected)"),p->GetLabel().c_str())) + RT_FAILURE_MSG(wxString::Format("'%s' is not a category (only category was expected)",p->GetLabel())) count++; } - RT_MSG(wxString::Format(wxT("GetVIterator(wxPG_ITERATE_CATEGORIES) -> %i entries"), count)); + RT_MSG(wxString::Format("GetVIterator(wxPG_ITERATE_CATEGORIES) -> %i entries", count)); count = 0; for ( it = pgman->GetVIterator(wxPG_ITERATE_PROPERTIES|wxPG_ITERATE_CATEGORIES); @@ -410,11 +410,11 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) { wxPGProperty* p = it.GetProperty(); if ( p->GetParent()->HasFlag(wxPG_PROP_AGGREGATE) ) - RT_FAILURE_MSG(wxString::Format(wxT("'%s' is a private child (non-private child property or category expected)"),p->GetLabel().c_str())) + RT_FAILURE_MSG(wxString::Format("'%s' is a private child (non-private child property or category expected)",p->GetLabel())) count++; } - RT_MSG(wxString::Format(wxT("GetVIterator(wxPG_ITERATE_PROPERTIES|wxPG_ITERATE_CATEGORIES) -> %i entries"), count)); + RT_MSG(wxString::Format("GetVIterator(wxPG_ITERATE_PROPERTIES|wxPG_ITERATE_CATEGORIES) -> %i entries", count)); count = 0; for ( it = pgman->GetVIterator(wxPG_ITERATE_VISIBLE); @@ -423,13 +423,13 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) { wxPGProperty* p = it.GetProperty(); if ( (p->GetParent() != p->GetParentState()->DoGetRoot() && !p->GetParent()->IsExpanded()) ) - RT_FAILURE_MSG(wxString::Format(wxT("'%s' had collapsed parent (only visible properties expected)"),p->GetLabel().c_str())) + RT_FAILURE_MSG(wxString::Format("'%s' had collapsed parent (only visible properties expected)",p->GetLabel())) else if ( p->HasFlag(wxPG_PROP_HIDDEN) ) - RT_FAILURE_MSG(wxString::Format(wxT("'%s' was hidden (only visible properties expected)"),p->GetLabel().c_str())) + RT_FAILURE_MSG(wxString::Format("'%s' was hidden (only visible properties expected)",p->GetLabel())) count++; } - RT_MSG(wxString::Format(wxT("GetVIterator(wxPG_ITERATE_VISIBLE) -> %i entries"), count)); + RT_MSG(wxString::Format("GetVIterator(wxPG_ITERATE_VISIBLE) -> %i entries", count)); } if ( fullTest ) @@ -476,7 +476,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) for ( it2 = array.rbegin(); it2 != array.rend(); ++it2 ) { wxPGProperty* p = (wxPGProperty*)*it2; - RT_MSG(wxString::Format(wxT("Deleting '%s' ('%s')"),p->GetLabel().c_str(),p->GetName().c_str())); + RT_MSG(wxString::Format("Deleting '%s' ('%s')",p->GetLabel(),p->GetName())); pgman->DeleteProperty(p); } @@ -484,7 +484,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) it = pgman->GetVIterator(wxPG_ITERATE_ALL&~(wxPG_IT_CHILDREN(wxPG_PROP_AGGREGATE))); if ( !it.AtEnd() ) { - RT_FAILURE_MSG(wxString(wxS("Not all properties are deleted"))); + RT_FAILURE_MSG(wxString("Not all properties are deleted")); } // Recreate grid @@ -521,7 +521,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) wxAny any; #if wxUSE_DATETIME - prop = pgman->GetProperty(wxT("DateProperty")); + prop = pgman->GetProperty("DateProperty"); wxDateTime testTime = wxDateTime::Now(); any = testTime; prop->SetValue(any); @@ -529,7 +529,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) RT_FAILURE(); #endif - prop = pgman->GetProperty(wxT("IntProperty")); + prop = pgman->GetProperty("IntProperty"); int testInt = 25537983; any = testInt; prop->SetValue(any); @@ -540,15 +540,15 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) RT_FAILURE(); #endif - prop = pgman->GetProperty(wxT("StringProperty")); - wxString testString = wxT("asd934jfyn3"); + prop = pgman->GetProperty("StringProperty"); + wxString testString = "asd934jfyn3"; any = testString; prop->SetValue(any); if ( prop->GetValue().GetAny().As() != testString ) RT_FAILURE(); // Test with a type generated with IMPLEMENT_VARIANT_OBJECT() - prop = pgman->GetProperty(wxT("ColourProperty")); + prop = pgman->GetProperty("ColourProperty"); wxColour testCol = *wxCYAN; any = testCol; prop->SetValue(any); @@ -557,7 +557,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) // Test with a type with custom wxVariantData defined by // wxPG headers. - prop = pgman->GetProperty(wxT("Position")); + prop = pgman->GetProperty("Position"); wxPoint testPoint(199, 199); any = testPoint; prop->SetValue(any); @@ -580,8 +580,8 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) { wxVariant& v = values[j]; - t.Printf(wxT("%i: name=\"%s\" type=\"%s\"\n"),(int)j, - v.GetName().c_str(),v.GetType().c_str()); + t.Printf("%i: name=\"%s\" type=\"%s\"\n",(int)j, + v.GetName(),v.GetType()); text += t; } @@ -592,21 +592,21 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) { RT_START_TEST(SetPropertyValue_and_GetPropertyValue) - // In this section, mixed up usage of wxT("propname") and "propname" + // In this section, mixed up usage of "propname" and "propname" // in wxPropertyGridInterface functions is intentional. // Purpose is to test wxPGPropArgCls ctors. //pg = (wxPropertyGrid*) NULL; wxArrayString test_arrstr_1; - test_arrstr_1.Add(wxT("Apple")); - test_arrstr_1.Add(wxT("Orange")); - test_arrstr_1.Add(wxT("Lemon")); + test_arrstr_1.Add("Apple"); + test_arrstr_1.Add("Orange"); + test_arrstr_1.Add("Lemon"); wxArrayString test_arrstr_2; - test_arrstr_2.Add(wxT("Potato")); - test_arrstr_2.Add(wxT("Cabbage")); - test_arrstr_2.Add(wxT("Cucumber")); + test_arrstr_2.Add("Potato"); + test_arrstr_2.Add("Cabbage"); + test_arrstr_2.Add("Cucumber"); wxArrayInt test_arrint_1; test_arrint_1.Add(1); @@ -632,117 +632,117 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) #define FLAG_TEST_SET1 (wxCAPTION|wxCLOSE_BOX|wxSYSTEM_MENU|wxRESIZE_BORDER) #define FLAG_TEST_SET2 (wxSTAY_ON_TOP|wxCAPTION|wxICONIZE|wxSYSTEM_MENU) - pgman->SetPropertyValue(wxT("StringProperty"),wxT("Text1")); - pgman->SetPropertyValue(wxT("IntProperty"),1024); - pgman->SetPropertyValue(wxT("FloatProperty"),1024.0000000001); - pgman->SetPropertyValue(wxT("BoolProperty"),false); - pgman->SetPropertyValue(wxT("EnumProperty"),120); - pgman->SetPropertyValue(wxT("ArrayStringProperty"),test_arrstr_1); + pgman->SetPropertyValue("StringProperty","Text1"); + pgman->SetPropertyValue("IntProperty",1024); + pgman->SetPropertyValue("FloatProperty",1024.0000000001); + pgman->SetPropertyValue("BoolProperty",false); + pgman->SetPropertyValue("EnumProperty",120); + pgman->SetPropertyValue("ArrayStringProperty",test_arrstr_1); wxColour emptyCol; - pgman->SetPropertyValue(wxT("ColourProperty"),emptyCol); - pgman->SetPropertyValue(wxT("ColourProperty"),(wxObject*)wxBLACK); - pgman->SetPropertyValue(wxT("Size"),WXVARIANT(wxSize(150,150))); - pgman->SetPropertyValue(wxT("Position"),WXVARIANT(wxPoint(150,150))); - pgman->SetPropertyValue(wxT("MultiChoiceProperty"),test_arrint_1); + pgman->SetPropertyValue("ColourProperty",emptyCol); + pgman->SetPropertyValue("ColourProperty",(wxObject*)wxBLACK); + pgman->SetPropertyValue("Size",WXVARIANT(wxSize(150,150))); + pgman->SetPropertyValue("Position",WXVARIANT(wxPoint(150,150))); + pgman->SetPropertyValue("MultiChoiceProperty",test_arrint_1); #if wxUSE_DATETIME - pgman->SetPropertyValue(wxT("DateProperty"),dt1); + pgman->SetPropertyValue("DateProperty",dt1); #endif pgman->SelectPage(2); pg = pgman->GetGrid(); - if ( pg->GetPropertyValueAsString(wxT("StringProperty")) != wxT("Text1") ) + if ( pg->GetPropertyValueAsString("StringProperty") != "Text1" ) RT_FAILURE(); - if ( pg->GetPropertyValueAsInt(wxT("IntProperty")) != 1024 ) + if ( pg->GetPropertyValueAsInt("IntProperty") != 1024 ) RT_FAILURE(); - if ( pg->GetPropertyValueAsDouble(wxT("FloatProperty")) != 1024.0000000001 ) + if ( pg->GetPropertyValueAsDouble("FloatProperty") != 1024.0000000001 ) RT_FAILURE(); - if ( pg->GetPropertyValueAsBool(wxT("BoolProperty")) != false ) + if ( pg->GetPropertyValueAsBool("BoolProperty") != false ) RT_FAILURE(); - if ( pg->GetPropertyValueAsLong(wxT("EnumProperty")) != 120 ) + if ( pg->GetPropertyValueAsLong("EnumProperty") != 120 ) RT_FAILURE(); - if ( pg->GetPropertyValueAsArrayString(wxT("ArrayStringProperty")) != test_arrstr_1 ) + if ( pg->GetPropertyValueAsArrayString("ArrayStringProperty") != test_arrstr_1 ) RT_FAILURE(); wxColour col; - col << pgman->GetPropertyValue(wxT("ColourProperty")); + col << pgman->GetPropertyValue("ColourProperty"); if ( col != *wxBLACK ) RT_FAILURE(); - wxVariant varSize(pg->GetPropertyValue(wxT("Size"))); + wxVariant varSize(pg->GetPropertyValue("Size")); if ( wxSizeRefFromVariant(varSize) != wxSize(150,150) ) RT_FAILURE(); - wxVariant varPos(pg->GetPropertyValue(wxT("Position"))); + wxVariant varPos(pg->GetPropertyValue("Position")); if ( wxPointRefFromVariant(varPos) != wxPoint(150,150) ) RT_FAILURE(); - if ( !(pg->GetPropertyValueAsArrayInt(wxT("MultiChoiceProperty")) == test_arrint_1) ) + if ( !(pg->GetPropertyValueAsArrayInt("MultiChoiceProperty") == test_arrint_1) ) RT_FAILURE(); #if wxUSE_DATETIME - if ( !(pg->GetPropertyValueAsDateTime(wxT("DateProperty")) == dt1) ) + if ( !(pg->GetPropertyValueAsDateTime("DateProperty") == dt1) ) RT_FAILURE(); #endif #if wxUSE_LONGLONG && defined(wxLongLong_t) - pgman->SetPropertyValue(wxT("IntProperty"),wxLL(10000000000)); - if ( pg->GetPropertyValueAsLongLong(wxT("IntProperty")) != wxLL(10000000000) ) + pgman->SetPropertyValue("IntProperty",wxLL(10000000000)); + if ( pg->GetPropertyValueAsLongLong("IntProperty") != wxLL(10000000000) ) RT_FAILURE(); #else - pgman->SetPropertyValue(wxT("IntProperty"),1000000000); - if ( pg->GetPropertyValueAsLong(wxT("IntProperty")) != 1000000000 ) + pgman->SetPropertyValue("IntProperty",1000000000); + if ( pg->GetPropertyValueAsLong("IntProperty") != 1000000000 ) RT_FAILURE(); #endif - pg->SetPropertyValue(wxT("StringProperty"),wxT("Text2")); - pg->SetPropertyValue(wxT("IntProperty"),512); - pg->SetPropertyValue(wxT("FloatProperty"),512.0); - pg->SetPropertyValue(wxT("BoolProperty"),true); - pg->SetPropertyValue(wxT("EnumProperty"),80); - pg->SetPropertyValue(wxT("ArrayStringProperty"),test_arrstr_2); - pg->SetPropertyValue(wxT("ColourProperty"),(wxObject*)wxWHITE); - pg->SetPropertyValue(wxT("Size"),WXVARIANT(wxSize(300,300))); - pg->SetPropertyValue(wxT("Position"),WXVARIANT(wxPoint(300,300))); - pg->SetPropertyValue(wxT("MultiChoiceProperty"),test_arrint_2); + pg->SetPropertyValue("StringProperty","Text2"); + pg->SetPropertyValue("IntProperty",512); + pg->SetPropertyValue("FloatProperty",512.0); + pg->SetPropertyValue("BoolProperty",true); + pg->SetPropertyValue("EnumProperty",80); + pg->SetPropertyValue("ArrayStringProperty",test_arrstr_2); + pg->SetPropertyValue("ColourProperty",(wxObject*)wxWHITE); + pg->SetPropertyValue("Size",WXVARIANT(wxSize(300,300))); + pg->SetPropertyValue("Position",WXVARIANT(wxPoint(300,300))); + pg->SetPropertyValue("MultiChoiceProperty",test_arrint_2); #if wxUSE_DATETIME - pg->SetPropertyValue(wxT("DateProperty"),dt2); + pg->SetPropertyValue("DateProperty",dt2); #endif //pg = (wxPropertyGrid*) NULL; pgman->SelectPage(0); - if ( pgman->GetPropertyValueAsString(wxT("StringProperty")) != wxT("Text2") ) + if ( pgman->GetPropertyValueAsString("StringProperty") != "Text2" ) RT_FAILURE(); - if ( pgman->GetPropertyValueAsInt(wxT("IntProperty")) != 512 ) + if ( pgman->GetPropertyValueAsInt("IntProperty") != 512 ) RT_FAILURE(); - if ( pgman->GetPropertyValueAsDouble(wxT("FloatProperty")) != 512.0 ) + if ( pgman->GetPropertyValueAsDouble("FloatProperty") != 512.0 ) RT_FAILURE(); - if ( pgman->GetPropertyValueAsBool(wxT("BoolProperty")) != true ) + if ( pgman->GetPropertyValueAsBool("BoolProperty") != true ) RT_FAILURE(); - if ( pgman->GetPropertyValueAsLong(wxT("EnumProperty")) != 80 ) + if ( pgman->GetPropertyValueAsLong("EnumProperty") != 80 ) RT_FAILURE(); - if ( pgman->GetPropertyValueAsArrayString(wxT("ArrayStringProperty")) != test_arrstr_2 ) + if ( pgman->GetPropertyValueAsArrayString("ArrayStringProperty") != test_arrstr_2 ) RT_FAILURE(); - col << pgman->GetPropertyValue(wxT("ColourProperty")); + col << pgman->GetPropertyValue("ColourProperty"); if ( col != *wxWHITE ) RT_FAILURE(); - varSize = pgman->GetPropertyValue(wxT("Size")); + varSize = pgman->GetPropertyValue("Size"); if ( wxSizeRefFromVariant(varSize) != wxSize(300,300) ) RT_FAILURE(); - varPos = pgman->GetPropertyValue(wxT("Position")); + varPos = pgman->GetPropertyValue("Position"); if ( wxPointRefFromVariant(varPos) != wxPoint(300,300) ) RT_FAILURE(); - if ( !(pgman->GetPropertyValueAsArrayInt(wxT("MultiChoiceProperty")) == test_arrint_2) ) + if ( !(pgman->GetPropertyValueAsArrayInt("MultiChoiceProperty") == test_arrint_2) ) RT_FAILURE(); #if wxUSE_DATETIME - if ( !(pgman->GetPropertyValueAsDateTime(wxT("DateProperty")) == dt2) ) + if ( !(pgman->GetPropertyValueAsDateTime("DateProperty") == dt2) ) RT_FAILURE(); #endif #if wxUSE_LONGLONG && defined(wxLongLong_t) - pgman->SetPropertyValue(wxT("IntProperty"),wxLL(-80000000000)); - if ( pgman->GetPropertyValueAsLongLong(wxT("IntProperty")) != wxLL(-80000000000) ) + pgman->SetPropertyValue("IntProperty",wxLL(-80000000000)); + if ( pgman->GetPropertyValueAsLongLong("IntProperty") != wxLL(-80000000000) ) RT_FAILURE(); #else - pgman->SetPropertyValue(wxT("IntProperty"),-1000000000); - if ( pgman->GetPropertyValueAsLong(wxT("IntProperty")) != -1000000000 ) + pgman->SetPropertyValue("IntProperty",-1000000000); + if ( pgman->GetPropertyValueAsLong("IntProperty") != -1000000000 ) RT_FAILURE(); #endif @@ -751,46 +751,46 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) // // This updates children as well - wxString nvs = wxT("Lamborghini Diablo XYZ; 5707; [100; 3.9; 8.6] 3000002; Convertible"); + wxString nvs = "Lamborghini Diablo XYZ; 5707; [100; 3.9; 8.6] 3000002; Convertible"; pgman->SetPropertyValue("Car", nvs); - if ( pgman->GetPropertyValueAsString(wxT("Car.Model")) != wxT("Lamborghini Diablo XYZ") ) + if ( pgman->GetPropertyValueAsString("Car.Model") != "Lamborghini Diablo XYZ" ) { - RT_FAILURE_MSG(wxString::Format(wxS("Did not match: Car.Model=%s"), pgman->GetPropertyValueAsString(wxS("Car.Model")).c_str())); + RT_FAILURE_MSG(wxString::Format("Did not match: Car.Model=%s", pgman->GetPropertyValueAsString("Car.Model"))); } - if ( pgman->GetPropertyValueAsInt(wxT("Car.Speeds.Max. Speed (mph)")) != 100 ) + if ( pgman->GetPropertyValueAsInt("Car.Speeds.Max. Speed (mph)") != 100 ) { - RT_FAILURE_MSG(wxString::Format(wxS("Did not match: Car.Speeds.Max. Speed (mph)=%s"), pgman->GetPropertyValueAsString(wxS("Car.Speeds.Max. Speed (mph)")).c_str())); + RT_FAILURE_MSG(wxString::Format("Did not match: Car.Speeds.Max. Speed (mph)=%s", pgman->GetPropertyValueAsString("Car.Speeds.Max. Speed (mph)"))); } - if ( pgman->GetPropertyValueAsInt(wxT("Car.Price ($)")) != 3000002 ) + if ( pgman->GetPropertyValueAsInt("Car.Price ($)") != 3000002 ) { - RT_FAILURE_MSG(wxString::Format(wxS("Did not match: Car.Price ($)=%s"), pgman->GetPropertyValueAsString(wxS("Car.Price ($)")).c_str())); + RT_FAILURE_MSG(wxString::Format(wxS("Did not match: Car.Price ($)=%s"), pgman->GetPropertyValueAsString(wxS("Car.Price ($)")))); } - if ( !pgman->GetPropertyValueAsBool(wxT("Car.Convertible")) ) + if ( !pgman->GetPropertyValueAsBool("Car.Convertible") ) { - RT_FAILURE_MSG(wxString::Format(wxS("Did not match: Car.Convertible=%s"), pgman->GetPropertyValueAsString(wxS("Car.Convertible")).c_str())); + RT_FAILURE_MSG(wxString::Format("Did not match: Car.Convertible=%s", pgman->GetPropertyValueAsString("Car.Convertible"))); } // SetPropertyValueString for special cases such as wxColour - pgman->SetPropertyValueString(wxT("ColourProperty"), wxT("(123,4,255)")); - col << pgman->GetPropertyValue(wxT("ColourProperty")); + pgman->SetPropertyValueString("ColourProperty", "(123,4,255)"); + col << pgman->GetPropertyValue("ColourProperty"); if ( col != wxColour(123, 4, 255) ) RT_FAILURE(); - pgman->SetPropertyValueString(wxT("ColourProperty"), wxT("#FE860B")); - col << pgman->GetPropertyValue(wxT("ColourProperty")); + pgman->SetPropertyValueString("ColourProperty", "#FE860B"); + col << pgman->GetPropertyValue("ColourProperty"); if ( col != wxColour(254, 134, 11) ) RT_FAILURE(); - pgman->SetPropertyValueString(wxT("ColourPropertyWithAlpha"), - wxT("(10, 20, 30, 128)")); - col << pgman->GetPropertyValue(wxT("ColourPropertyWithAlpha")); + pgman->SetPropertyValueString("ColourPropertyWithAlpha", + "(10, 20, 30, 128)"); + col << pgman->GetPropertyValue("ColourPropertyWithAlpha"); if ( col != wxColour(10, 20, 30, 128) ) RT_FAILURE(); - if ( pgman->GetPropertyValueAsString(wxT("ColourPropertyWithAlpha")) - != wxT("(10,20,30,128)") ) + if ( pgman->GetPropertyValueAsString("ColourPropertyWithAlpha") + != "(10,20,30,128)" ) RT_FAILURE(); } @@ -798,18 +798,18 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) RT_START_TEST(SetPropertyValueUnspecified) // Null variant setter tests - pgman->SetPropertyValueUnspecified(wxT("StringProperty")); - pgman->SetPropertyValueUnspecified(wxT("IntProperty")); - pgman->SetPropertyValueUnspecified(wxT("FloatProperty")); - pgman->SetPropertyValueUnspecified(wxT("BoolProperty")); - pgman->SetPropertyValueUnspecified(wxT("EnumProperty")); - pgman->SetPropertyValueUnspecified(wxT("ArrayStringProperty")); - pgman->SetPropertyValueUnspecified(wxT("ColourProperty")); - pgman->SetPropertyValueUnspecified(wxT("Size")); - pgman->SetPropertyValueUnspecified(wxT("Position")); - pgman->SetPropertyValueUnspecified(wxT("MultiChoiceProperty")); + pgman->SetPropertyValueUnspecified("StringProperty"); + pgman->SetPropertyValueUnspecified("IntProperty"); + pgman->SetPropertyValueUnspecified("FloatProperty"); + pgman->SetPropertyValueUnspecified("BoolProperty"); + pgman->SetPropertyValueUnspecified("EnumProperty"); + pgman->SetPropertyValueUnspecified("ArrayStringProperty"); + pgman->SetPropertyValueUnspecified("ColourProperty"); + pgman->SetPropertyValueUnspecified("Size"); + pgman->SetPropertyValueUnspecified("Position"); + pgman->SetPropertyValueUnspecified("MultiChoiceProperty"); #if wxUSE_DATETIME - pgman->SetPropertyValueUnspecified(wxT("DateProperty")); + pgman->SetPropertyValueUnspecified("DateProperty"); #endif } @@ -823,10 +823,10 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) pg = pgman->GetGrid(); - wxPGProperty* prop1 = pg->GetProperty(wxT("Label")); - wxPGProperty* prop2 = pg->GetProperty(wxT("Cell Text Colour")); - wxPGProperty* prop3 = pg->GetProperty(wxT("Height")); - wxPGProperty* catProp = pg->GetProperty(wxT("Appearance")); + wxPGProperty* prop1 = pg->GetProperty("Label"); + wxPGProperty* prop2 = pg->GetProperty("Cell Text Colour"); + wxPGProperty* prop3 = pg->GetProperty("Height"); + wxPGProperty* catProp = pg->GetProperty("Appearance"); RT_ASSERT( prop1 && prop2 && prop3 ); @@ -870,6 +870,65 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) RT_ASSERT( !pg->IsPropertySelected(prop3) ) } + { + // + // Test retrieving main parent of the property + RT_START_TEST(GetMainParent) + pgman = m_pPropGridManager; + + // Simple properties + wxPGProperty* prop = pgman->GetProperty("DateProperty"); + wxPGProperty* parent = prop->GetMainParent(); + RT_ASSERT(parent->GetName() == "DateProperty"); + + prop = pgman->GetProperty("Label"); + parent = prop->GetMainParent(); + RT_ASSERT(parent->GetName() == "Label"); + + // Properties with children + prop = pgman->GetProperty("Font"); + RT_ASSERT(prop); + parent = prop->GetMainParent(); + RT_ASSERT(parent); + RT_ASSERT(parent->GetName() == "Font"); + + prop = pgman->GetProperty("Font.Style"); + RT_ASSERT(prop); + parent = prop->GetMainParent(); + RT_ASSERT(parent); + RT_ASSERT(parent->GetName() == "Font"); + + prop = pgman->GetProperty("Car"); + RT_ASSERT(prop); + parent = prop->GetMainParent(); + RT_ASSERT(parent); + RT_ASSERT(parent->GetName() == "Car"); + + prop = pgman->GetProperty("Car.Model"); + RT_ASSERT(prop); + parent = prop->GetMainParent(); + RT_ASSERT(parent); + RT_ASSERT(parent->GetName() == "Car"); + + prop = pgman->GetProperty("Car.Speeds"); + RT_ASSERT(prop); + parent = prop->GetMainParent(); + RT_ASSERT(parent); + RT_ASSERT(parent->GetName() == "Car"); + + prop = pgman->GetProperty("3D Object.Triangle 3.A"); + RT_ASSERT(prop); + parent = prop->GetMainParent(); + RT_ASSERT(parent); + RT_ASSERT(parent->GetName() == "3D Object"); + + prop = pgman->GetProperty("3D Object.Triangle 3.A.Z"); + RT_ASSERT(prop); + parent = prop->GetMainParent(); + RT_ASSERT(parent); + RT_ASSERT(parent->GetName() == "3D Object"); + } + { // // Test label editing @@ -882,7 +941,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) pg->MakeColumnEditable(2, true); pg->MakeColumnEditable(0, false); pg->MakeColumnEditable(2, false); - pg->SelectProperty(wxT("Height")); + pg->SelectProperty("Height"); pg->BeginLabelEdit(0); pg->BeginLabelEdit(0); pg->EndLabelEdit(0); @@ -896,15 +955,15 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) { RT_START_TEST(Attributes) - wxPGProperty* prop = pgman->GetProperty(wxT("StringProperty")); - prop->SetAttribute(wxT("Dummy Attribute"), (long)15); + wxPGProperty* prop = pgman->GetProperty("StringProperty"); + prop->SetAttribute("Dummy Attribute", (long)15); - if ( prop->GetAttribute(wxT("Dummy Attribute")).GetLong() != 15 ) + if ( prop->GetAttribute("Dummy Attribute").GetLong() != 15 ) RT_FAILURE(); - prop->SetAttribute(wxT("Dummy Attribute"), wxVariant()); + prop->SetAttribute("Dummy Attribute", wxVariant()); - if ( !prop->GetAttribute(wxT("Dummy Attribute")).IsNull() ) + if ( !prop->GetAttribute("Dummy Attribute").IsNull() ) RT_FAILURE(); } @@ -913,20 +972,20 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) RT_START_TEST(DoubleToString) // Locale-specific decimal separator - wxString sep = wxString::Format(wxT("%g"), 1.1)[1]; + wxString sep = wxString::Format("%g", 1.1)[1]; wxString s; if ( wxPropertyGrid::DoubleToString(s, 123.123, 2, true) != - wxString::Format(wxT("123%s12"), sep.c_str()) ) + wxString::Format("123%s12", sep) ) RT_FAILURE(); if ( wxPropertyGrid::DoubleToString(s, -123.123, 4, false) != - wxString::Format(wxT("-123%s1230"), sep.c_str()) ) + wxString::Format("-123%s1230", sep) ) RT_FAILURE(); if ( wxPropertyGrid::DoubleToString(s, -0.02, 1, false) != - wxString::Format(wxT("0%s0"), sep) ) + wxString::Format("0%s0", sep) ) RT_FAILURE(); - if ( wxPropertyGrid::DoubleToString(s, -0.000123, 3, true) != wxT("0") ) + if ( wxPropertyGrid::DoubleToString(s, -0.000123, 3, true) != "0" ) RT_FAILURE(); } #endif @@ -943,11 +1002,11 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) RT_START_TEST(GetPropertyValues) page1 = pgman->GetPage(0); - pg1_values = page1->GetPropertyValues(wxT("Page1"),NULL,wxPG_KEEP_STRUCTURE); + pg1_values = page1->GetPropertyValues("Page1",NULL,wxPG_KEEP_STRUCTURE); page2 = pgman->GetPage(1); - pg2_values = page2->GetPropertyValues(wxT("Page2"),NULL,wxPG_KEEP_STRUCTURE); + pg2_values = page2->GetPropertyValues("Page2",NULL,wxPG_KEEP_STRUCTURE); page3 = pgman->GetPage(2); - pg3_values = page3->GetPropertyValues(wxT("Page3"),NULL,wxPG_KEEP_STRUCTURE); + pg3_values = page3->GetPropertyValues("Page3",NULL,wxPG_KEEP_STRUCTURE); } { @@ -980,7 +1039,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) page->Collapse( p ); - t.Printf(wxT("Collapsing: %s\n"),page->GetPropertyLabel(p).c_str()); + t.Printf("Collapsing: %s\n",page->GetPropertyLabel(p)); ed->AppendText(t); } } @@ -1021,7 +1080,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) page->Expand( p ); - t.Printf(wxT("Expand: %s\n"),page->GetPropertyLabel(p).c_str()); + t.Printf("Expand: %s\n",page->GetPropertyLabel(p)); ed->AppendText(t); } } @@ -1030,14 +1089,14 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) { RT_START_TEST(Choice_Manipulation) - wxPGProperty* enumProp = pgman->GetProperty(wxT("EnumProperty")); + wxPGProperty* enumProp = pgman->GetProperty("EnumProperty"); pgman->SelectPage(2); pgman->SelectProperty(enumProp); wxASSERT(pgman->GetGrid()->GetSelection() == enumProp); const wxPGChoices& choices = enumProp->GetChoices(); - int ind = enumProp->InsertChoice(wxT("New Choice"), choices.GetCount()/2); + int ind = enumProp->InsertChoice("New Choice", choices.GetCount()/2); enumProp->DeleteChoice(ind); // Recreate the original grid @@ -1084,7 +1143,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) { RT_START_TEST(EnsureVisible) - pgman->EnsureVisible(wxT("Cell Colour")); + pgman->EnsureVisible("Cell Colour"); } { @@ -1093,17 +1152,17 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) wxPGProperty* p; wxPGProperty* origParent = - pgman->GetProperty(wxT("Window Styles"))->GetParent(); + pgman->GetProperty("Window Styles")->GetParent(); // For testing purposes, let's set some custom cell colours - p = pgman->GetProperty(wxT("Window Styles")); + p = pgman->GetProperty("Window Styles"); p->SetCell(2, wxPGCell("style")); - p = pgman->RemoveProperty(wxT("Window Styles")); + p = pgman->RemoveProperty("Window Styles"); pgman->Refresh(); pgman->Update(); pgman->AppendIn(origParent, p); - wxASSERT( p->GetCell(2).GetText() == wxT("style")); + wxASSERT( p->GetCell(2).GetText() == "style"); pgman->Refresh(); pgman->Update(); } @@ -1115,40 +1174,40 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) // Make sure indexes are as supposed - p = pgman->GetProperty(wxT("User Name")); + p = pgman->GetProperty("User Name"); if ( p->GetIndexInParent() != 3 ) RT_FAILURE(); - p = pgman->GetProperty(wxT("User Id")); + p = pgman->GetProperty("User Id"); if ( p->GetIndexInParent() != 2 ) RT_FAILURE(); - p = pgman->GetProperty(wxT("User Home")); + p = pgman->GetProperty("User Home"); if ( p->GetIndexInParent() != 1 ) RT_FAILURE(); - p = pgman->GetProperty(wxT("Operating System")); + p = pgman->GetProperty("Operating System"); if ( p->GetIndexInParent() != 0 ) RT_FAILURE(); pgman->GetGrid()->SetSortFunction(MyPropertySortFunction); - pgman->GetGrid()->SortChildren(wxT("Environment")); + pgman->GetGrid()->SortChildren("Environment"); // Make sure indexes have been reversed - p = pgman->GetProperty(wxT("User Name")); + p = pgman->GetProperty("User Name"); if ( p->GetIndexInParent() != 0 ) RT_FAILURE(); - p = pgman->GetProperty(wxT("User Id")); + p = pgman->GetProperty("User Id"); if ( p->GetIndexInParent() != 1 ) RT_FAILURE(); - p = pgman->GetProperty(wxT("User Home")); + p = pgman->GetProperty("User Home"); if ( p->GetIndexInParent() != 2 ) RT_FAILURE(); - p = pgman->GetProperty(wxT("Operating System")); + p = pgman->GetProperty("Operating System"); if ( p->GetIndexInParent() != 3 ) RT_FAILURE(); } @@ -1166,7 +1225,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) RT_START_TEST(Clear) // Manager clear - pgman->SelectProperty(wxT("Label")); + pgman->SelectProperty("Label"); pgman->Clear(); if ( pgman->GetPageCount() ) @@ -1180,7 +1239,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) pgman = m_pPropGridManager; // Grid clear - pgman->SelectProperty(wxT("Label")); + pgman->SelectProperty("Label"); pgman->GetGrid()->Clear(); if ( pgman->GetGrid()->GetRoot()->GetChildCount() ) @@ -1209,7 +1268,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) pgman->SetSplitterPosition(trySplitterPos); if ( pgman->GetGrid()->GetSplitterPosition() != trySplitterPos ) - RT_FAILURE_MSG(wxString::Format(wxT("Splitter position was %i (should have been %i)"),(int)pgman->GetGrid()->GetSplitterPosition(),trySplitterPos)); + RT_FAILURE_MSG(wxString::Format("Splitter position was %i (should have been %i)",(int)pgman->GetGrid()->GetSplitterPosition(),trySplitterPos)); m_topSizer->Add( m_pPropGridManager, wxSizerFlags(1).Expand()); FinalizePanel(); @@ -1221,7 +1280,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) SetSize(sz); if ( pgman->GetGrid()->GetSplitterPosition() != trySplitterPos ) - RT_FAILURE_MSG(wxString::Format(wxT("Splitter position was %i (should have been %i)"),(int)pgman->GetGrid()->GetSplitterPosition(),trySplitterPos)); + RT_FAILURE_MSG(wxString::Format("Splitter position was %i (should have been %i)",(int)pgman->GetGrid()->GetSplitterPosition(),trySplitterPos)); SetSize(origSz); @@ -1246,7 +1305,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) wxPGProperty* p = arr1[i]; page->HideProperty(p, true); - wxString s = wxString::Format(wxT("HideProperty(%i, %s)"), (int)i, p->GetLabel().c_str()); + wxString s = wxString::Format("HideProperty(%i, %s)", (int)i, p->GetLabel()); RT_VALIDATE_VIRTUAL_HEIGHT(page, s) if ( _failed_ ) break; @@ -1262,7 +1321,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) wxPGProperty* p = arr2[i]; page->HideProperty(p, false); - wxString s = wxString::Format(wxT("ShowProperty(%i, %s)"), (int)i, p->GetLabel().c_str()); + wxString s = wxString::Format("ShowProperty(%i, %s)", (int)i, p->GetLabel()); RT_VALIDATE_VIRTUAL_HEIGHT(page, s) if ( _failed_ ) break; @@ -1280,7 +1339,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) wxPGProperty* p = arr1[i]; page->HideProperty(p, true); - wxString s = wxString::Format(wxT("HideProperty(%i, %s)"), (int)i, p->GetLabel().c_str()); + wxString s = wxString::Format("HideProperty(%i, %s)", (int)i, p->GetLabel()); RT_VALIDATE_VIRTUAL_HEIGHT(page, s) if ( _failed_ ) break; @@ -1296,7 +1355,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) wxPGProperty* p = arr2[i]; page->HideProperty(p, false); - wxString s = wxString::Format(wxT("ShowProperty(%i, %s)"), (int)i, p->GetLabel().c_str()); + wxString s = wxString::Format("ShowProperty(%i, %s)", (int)i, p->GetLabel()); RT_VALIDATE_VIRTUAL_HEIGHT(page, s) if ( _failed_ ) break; @@ -1315,7 +1374,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) wxPGProperty* p = arr1[i]; page->HideProperty(p, true); - wxString s = wxString::Format(wxT("HideProperty(%i, %s)"), (int)i, p->GetLabel().c_str()); + wxString s = wxString::Format("HideProperty(%i, %s)", (int)i, p->GetLabel()); RT_VALIDATE_VIRTUAL_HEIGHT(page, s) if ( _failed_ ) break; @@ -1331,7 +1390,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) wxPGProperty* p = arr2[i]; page->HideProperty(p, false); - wxString s = wxString::Format(wxT("ShowProperty(%i, %s)"), (int)i, p->GetLabel().c_str()); + wxString s = wxString::Format("ShowProperty(%i, %s)", (int)i, p->GetLabel()); RT_VALIDATE_VIRTUAL_HEIGHT(page, s) if ( _failed_ ) break; @@ -1387,9 +1446,9 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) { if ( !flags.empty() ) { - flags.append(wxS("|")); + flags.append("|"); } - flags.append(wxS("COLLAPSED")); + flags.append("COLLAPSED"); } } @@ -1397,59 +1456,59 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) { if ( !flags.empty() ) { - flags.append(wxS("|")); + flags.append("|"); } - flags.append(wxS("DISABLED")); + flags.append("DISABLED"); } if ( GetRandomBooleanVal() ) { if ( !flags.empty() ) { - flags.append(wxS("|")); + flags.append("|"); } - flags.append(wxS("HIDDEN")); + flags.append("HIDDEN"); } // Set flags p->SetFlagsFromString(flags); // Verify if flags have been properly set - if ( flags.Find(wxS("COLLAPSED")) != wxNOT_FOUND && + if ( flags.Find("COLLAPSED") != wxNOT_FOUND && !p->HasFlag(wxPG_PROP_COLLAPSED) ) { - RT_FAILURE_MSG(wxString::Format(wxS("Error setting flag from string 'COLLAPSED' for property '%s'"), - p->GetName().c_str())); + RT_FAILURE_MSG(wxString::Format("Error setting flag from string 'COLLAPSED' for property '%s'", + p->GetName())); } - if ( flags.Find(wxS("COLLAPSED")) == wxNOT_FOUND && + if ( flags.Find("COLLAPSED") == wxNOT_FOUND && p->HasFlag(wxPG_PROP_COLLAPSED) ) { - RT_FAILURE_MSG(wxString::Format(wxS("Error resetting flag from string 'COLLAPSED'for property '%s'"), - p->GetName().c_str())); + RT_FAILURE_MSG(wxString::Format("Error resetting flag from string 'COLLAPSED'for property '%s'", + p->GetName())); } - if ( flags.Find(wxS("DISABLED")) != wxNOT_FOUND && + if ( flags.Find("DISABLED") != wxNOT_FOUND && !p->HasFlag(wxPG_PROP_DISABLED) ) { - RT_FAILURE_MSG(wxString::Format(wxS("Error setting flag from string 'DISABLED' for property '%s'"), - p->GetName().c_str())); + RT_FAILURE_MSG(wxString::Format("Error setting flag from string 'DISABLED' for property '%s'", + p->GetName())); } - if ( flags.Find(wxS("DISABLED")) == wxNOT_FOUND && + if ( flags.Find("DISABLED") == wxNOT_FOUND && p->HasFlag(wxPG_PROP_DISABLED) ) { - RT_FAILURE_MSG(wxString::Format(wxS("Error resetting flag from string 'DISABLED' for property '%s'"), - p->GetName().c_str())); + RT_FAILURE_MSG(wxString::Format("Error resetting flag from string 'DISABLED' for property '%s'", + p->GetName())); } - if ( flags.Find(wxS("HIDDEN")) != wxNOT_FOUND && + if ( flags.Find("HIDDEN") != wxNOT_FOUND && !p->HasFlag(wxPG_PROP_HIDDEN) ) { - RT_FAILURE_MSG(wxString::Format(wxS("Error setting flag from string 'HIDDEN' for property '%s'"), - p->GetName().c_str())); + RT_FAILURE_MSG(wxString::Format("Error setting flag from string 'HIDDEN' for property '%s'", + p->GetName())); } - if ( flags.Find(wxS("HIDDEN")) == wxNOT_FOUND && + if ( flags.Find("HIDDEN") == wxNOT_FOUND && p->HasFlag(wxPG_PROP_HIDDEN) ) { - RT_FAILURE_MSG(wxString::Format(wxS("Error resetting flag from string 'HIDDEN' for property '%s'"), - p->GetName().c_str())); + RT_FAILURE_MSG(wxString::Format("Error resetting flag from string 'HIDDEN' for property '%s'", + p->GetName())); } // Get individual flags @@ -1458,7 +1517,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) flags = p->GetFlagsAsString(wxPG_PROP_COLLAPSED); if ( p->HasFlag(wxPG_PROP_COLLAPSED) ) { - ok = (flags == wxS("COLLAPSED")); + ok = (flags == "COLLAPSED"); } else { @@ -1466,14 +1525,14 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) } if ( !ok ) { - RT_FAILURE_MSG(wxString::Format(wxS("Invalid string for wxPG_PROP_COLLAPSED flag for property '%s'"), - p->GetName().c_str())); + RT_FAILURE_MSG(wxString::Format("Invalid string for wxPG_PROP_COLLAPSED flag for property '%s'", + p->GetName())); } flags = p->GetFlagsAsString(wxPG_PROP_DISABLED); if ( p->HasFlag(wxPG_PROP_DISABLED) ) { - ok = (flags == wxS("DISABLED")); + ok = (flags == "DISABLED"); } else { @@ -1481,14 +1540,14 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) } if ( !ok ) { - RT_FAILURE_MSG(wxString::Format(wxS("Invalid string for wxPG_PROP_DISABLED flag for property '%s'"), - p->GetName().c_str())); + RT_FAILURE_MSG(wxString::Format("Invalid string for wxPG_PROP_DISABLED flag for property '%s'", + p->GetName())); } flags = p->GetFlagsAsString(wxPG_PROP_HIDDEN); if ( p->HasFlag(wxPG_PROP_HIDDEN) ) { - ok = (flags == wxS("HIDDEN")); + ok = (flags == "HIDDEN"); } else { @@ -1496,14 +1555,14 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) } if ( !ok ) { - RT_FAILURE_MSG(wxString::Format(wxS("Invalid string for wxPG_PROP_HIDDEN flag for property '%s'"), - p->GetName().c_str())); + RT_FAILURE_MSG(wxString::Format("Invalid string for wxPG_PROP_HIDDEN flag for property '%s'", + p->GetName())); } flags = p->GetFlagsAsString(wxPG_PROP_NOEDITOR); if ( p->HasFlag(wxPG_PROP_NOEDITOR) ) { - ok = (flags == wxS("NOEDITOR")); + ok = (flags == "NOEDITOR"); } else { @@ -1511,66 +1570,66 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) } if ( !ok ) { - RT_FAILURE_MSG(wxString::Format(wxS("Invalid string for wxPG_PROP_NOEDITOR flag for property '%s'"), - p->GetName().c_str())); + RT_FAILURE_MSG(wxString::Format("Invalid string for wxPG_PROP_NOEDITOR flag for property '%s'", + p->GetName())); } // Get all flags flags = p->GetFlagsAsString(wxPG_STRING_STORED_FLAGS); if ( p->HasFlag(wxPG_PROP_COLLAPSED) ) { - ok = (flags.Find(wxS("COLLAPSED")) != wxNOT_FOUND); + ok = (flags.Find("COLLAPSED") != wxNOT_FOUND); } else { - ok = (flags.Find(wxS("COLLAPSED")) == wxNOT_FOUND); + ok = (flags.Find("COLLAPSED") == wxNOT_FOUND); } if ( !ok ) { - RT_FAILURE_MSG(wxString::Format(wxS("Invalid string for wxPG_PROP_COLLAPSED flag for property '%s'"), - p->GetName().c_str())); + RT_FAILURE_MSG(wxString::Format("Invalid string for wxPG_PROP_COLLAPSED flag for property '%s'", + p->GetName())); } if ( p->HasFlag(wxPG_PROP_DISABLED) ) { - ok = (flags.Find(wxS("DISABLED")) != wxNOT_FOUND); + ok = (flags.Find("DISABLED") != wxNOT_FOUND); } else { - ok = (flags.Find(wxS("DISABLED")) == wxNOT_FOUND); + ok = (flags.Find("DISABLED") == wxNOT_FOUND); } if ( !ok ) { - RT_FAILURE_MSG(wxString::Format(wxS("Invalid string for wxPG_PROP_DISBALED flag for property '%s'"), - p->GetName().c_str())); + RT_FAILURE_MSG(wxString::Format("Invalid string for wxPG_PROP_DISBALED flag for property '%s'", + p->GetName())); } if ( p->HasFlag(wxPG_PROP_HIDDEN) ) { - ok = (flags.Find(wxS("HIDDEN")) != wxNOT_FOUND); + ok = (flags.Find("HIDDEN") != wxNOT_FOUND); } else { - ok = (flags.Find(wxS("HIDDEN")) == wxNOT_FOUND); + ok = (flags.Find("HIDDEN") == wxNOT_FOUND); } if ( !ok ) { - RT_FAILURE_MSG(wxString::Format(wxS("Invalid string for wxPG_PROP_HIDDEN flag for property '%s'"), - p->GetName().c_str())); + RT_FAILURE_MSG(wxString::Format("Invalid string for wxPG_PROP_HIDDEN flag for property '%s'", + p->GetName())); } if ( p->HasFlag(wxPG_PROP_NOEDITOR) ) { - ok = (flags.Find(wxS("NOEDITOR")) != wxNOT_FOUND); + ok = (flags.Find("NOEDITOR") != wxNOT_FOUND); } else { - ok = (flags.Find(wxS("NOEDITOR")) == wxNOT_FOUND); + ok = (flags.Find("NOEDITOR") == wxNOT_FOUND); } if ( !ok ) { - RT_FAILURE_MSG(wxString::Format(wxS("Invalid string for wxPG_PROP_NOEDITOR flag for property '%s'"), - p->GetName().c_str())); + RT_FAILURE_MSG(wxString::Format("Invalid string for wxPG_PROP_NOEDITOR flag for property '%s'", + p->GetName())); } // Restore original flags @@ -1592,7 +1651,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) pgman = m_pPropGridManager; for ( i=3; i<12; i+=2 ) { - RT_MSG(wxString::Format(wxT("%i columns"),(int)i)); + RT_MSG(wxString::Format("%i columns",(int)i)); pgman->SetColumnCount(i); Refresh(); Update(); @@ -1610,7 +1669,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) for ( i=4; i<16; i++ ) { int flag = 1<m_warnings); + s = wxString::Format("All tests were successful, but there were %i warnings!", wxPGGlobalVars->m_warnings); #endif RT_MSG(s) for ( i=0; im_strName.c_str(), + parent->m_strName, key.GetValueType(value), key.IsNumericValue(value) ? "numeric" : "string"); diff --git a/samples/render/render.cpp b/samples/render/render.cpp index b9951d1437..158e16d5ba 100644 --- a/samples/render/render.cpp +++ b/samples/render/render.cpp @@ -571,7 +571,7 @@ void MyFrame::OnLoad(wxCommandEvent& WXUNUSED(event)) wxRendererNative *renderer = wxRendererNative::Load(name); if ( !renderer ) { - wxLogError(wxT("Failed to load renderer \"%s\"."), name.c_str()); + wxLogError("Failed to load renderer \"%s\".", name); } else // loaded ok { @@ -579,8 +579,8 @@ void MyFrame::OnLoad(wxCommandEvent& WXUNUSED(event)) m_panel->Refresh(); - wxLogStatus(this, wxT("Successfully loaded the renderer \"%s\"."), - name.c_str()); + wxLogStatus(this, "Successfully loaded the renderer \"%s\".", + name); } } diff --git a/samples/ribbon/ribbondemo.cpp b/samples/ribbon/ribbondemo.cpp index 9f74eac9c6..3ea2150c5a 100644 --- a/samples/ribbon/ribbondemo.cpp +++ b/samples/ribbon/ribbondemo.cpp @@ -651,7 +651,7 @@ void MyFrame::OnPrimaryColourSelect(wxRibbonGalleryEvent& evt) { wxString name; wxColour colour = GetGalleryColour(evt.GetGallery(), evt.GetGalleryItem(), &name); - AddText(wxT("Colour \"") + name + wxT("\" selected as primary.")); + AddText("Colour \"" + name + "\" selected as primary."); wxColour secondary, tertiary; m_ribbon->GetArtProvider()->GetColourScheme(NULL, &secondary, &tertiary); m_ribbon->GetArtProvider()->SetColourScheme(colour, secondary, tertiary); @@ -663,7 +663,7 @@ void MyFrame::OnSecondaryColourSelect(wxRibbonGalleryEvent& evt) { wxString name; wxColour colour = GetGalleryColour(evt.GetGallery(), evt.GetGalleryItem(), &name); - AddText(wxT("Colour \"") + name + wxT("\" selected as secondary.")); + AddText("Colour \"" + name + "\" selected as secondary."); wxColour primary, tertiary; m_ribbon->GetArtProvider()->GetColourScheme(&primary, NULL, &tertiary); m_ribbon->GetArtProvider()->SetColourScheme(primary, colour, tertiary); diff --git a/samples/richtext/richtext.cpp b/samples/richtext/richtext.cpp index 612535b885..aed233df76 100644 --- a/samples/richtext/richtext.cpp +++ b/samples/richtext/richtext.cpp @@ -98,7 +98,7 @@ public: virtual bool EditProperties(wxRichTextField* WXUNUSED(obj), wxWindow* WXUNUSED(parent), wxRichTextBuffer* WXUNUSED(buffer)) wxOVERRIDE { wxString label = GetLabel(); - wxMessageBox(wxString::Format("Editing %s", label.c_str())); + wxMessageBox(wxString::Format("Editing %s", label)); return true; } diff --git a/samples/shaped/shaped.cpp b/samples/shaped/shaped.cpp index 14036a5bcd..25c6b6e83c 100644 --- a/samples/shaped/shaped.cpp +++ b/samples/shaped/shaped.cpp @@ -278,14 +278,17 @@ void MainFrame::OnShowShaped(wxCommandEvent& WXUNUSED(event)) void MainFrame::OnShowTransparent(wxCommandEvent& WXUNUSED(event)) { - if (IsTransparentBackgroundSupported()) + wxString reason; + if (IsTransparentBackgroundSupported(&reason)) { SeeThroughFrame *seeThroughFrame = new SeeThroughFrame; seeThroughFrame->Create(); seeThroughFrame->Show(true); } else - wxMessageBox(wxS("transparent window requires a composited screen")); + { + wxLogError("%s, can't create transparent window.", reason); + } } void MainFrame::OnShowEffect(wxCommandEvent& event) diff --git a/samples/sockets/baseclient.cpp b/samples/sockets/baseclient.cpp index 14f06efbbc..e389148772 100644 --- a/samples/sockets/baseclient.cpp +++ b/samples/sockets/baseclient.cpp @@ -173,7 +173,7 @@ WX_DEFINE_LIST(EList); wxString CreateIdent(const wxIPV4address& addr) { - return wxString::Format("%s:%d",addr.IPAddress().c_str(),addr.Service()); + return wxString::Format("%s:%d",addr.IPAddress(),addr.Service()); } void @@ -216,11 +216,11 @@ Client::OnCmdLineParsed(wxCmdLineParser& pParser) { wxFFile file(fname); if (!file.IsOpened()) { - wxLogError("Cannot open file %s",fname.c_str()); + wxLogError("Cannot open file %s",fname); return false; }; if (!file.ReadAll(&m_message)) { - wxLogError("Cannot read content of file %s",fname.c_str()); + wxLogError("Cannot read content of file %s",fname); return false; }; m_sendType = SEND_MESSAGE; @@ -496,7 +496,7 @@ Client::dumpStatistics() { m_statFailed )); - wxLogMessage("Current status:\n%s\n",msg.c_str()); + wxLogMessage("Current status:\n%s\n",msg); } void @@ -550,7 +550,7 @@ EventWorker::OnSocketEvent(wxSocketEvent& pEvent) { { if (m_clientSocket->LastError() != wxSOCKET_WOULDBLOCK) { - wxLogError("%s: read error",CreateIdent(m_localaddr).c_str()); + wxLogError("%s: read error",CreateIdent(m_localaddr)); SendEvent(true); } } @@ -560,18 +560,18 @@ EventWorker::OnSocketEvent(wxSocketEvent& pEvent) { if (m_readed == m_insize) { if (!memcmp(m_inbuf,m_outbuf,m_insize)) { - wxLogError("%s: data mismatch",CreateIdent(m_localaddr).c_str()); + wxLogError("%s: data mismatch",CreateIdent(m_localaddr)); SendEvent(true); } m_currentType = WorkerEvent::DISCONNECTING; - wxLogDebug("%s: DISCONNECTING",CreateIdent(m_localaddr).c_str()); + wxLogDebug("%s: DISCONNECTING",CreateIdent(m_localaddr)); SendEvent(false); //wxLogDebug("EventWorker %p closing",this); m_clientSocket->Close(); m_currentType = WorkerEvent::DONE; - wxLogDebug("%s: DONE",CreateIdent(m_localaddr).c_str()); + wxLogDebug("%s: DONE",CreateIdent(m_localaddr)); SendEvent(false); } } while (!m_clientSocket->Error()); @@ -584,13 +584,13 @@ EventWorker::OnSocketEvent(wxSocketEvent& pEvent) { if (m_written == 0) { m_currentType = WorkerEvent::SENDING; - wxLogDebug("%s: SENDING",CreateIdent(m_localaddr).c_str()); + wxLogDebug("%s: SENDING",CreateIdent(m_localaddr)); } m_clientSocket->Write(m_outbuf + m_written, m_outsize - m_written); if (m_clientSocket->Error()) { if (m_clientSocket->LastError() != wxSOCKET_WOULDBLOCK) { - wxLogError("%s: Write error",CreateIdent(m_localaddr).c_str()); + wxLogError("%s: Write error",CreateIdent(m_localaddr)); SendEvent(true); } } @@ -603,7 +603,7 @@ EventWorker::OnSocketEvent(wxSocketEvent& pEvent) { { //wxLogDebug("EventWorker %p SENDING->RECEIVING",this); m_currentType = WorkerEvent::RECEIVING; - wxLogDebug("%s: RECEIVING",CreateIdent(m_localaddr).c_str()); + wxLogDebug("%s: RECEIVING",CreateIdent(m_localaddr)); SendEvent(false); } } while(!m_clientSocket->Error()); @@ -611,19 +611,19 @@ EventWorker::OnSocketEvent(wxSocketEvent& pEvent) { case wxSOCKET_CONNECTION: { //wxLogMessage("EventWorker: got connection"); - wxLogMessage("%s: starting writing message (2 bytes for signature and %d bytes of data to write)",CreateIdent(m_localaddr).c_str(),m_outsize-2); + wxLogMessage("%s: starting writing message (2 bytes for signature and %d bytes of data to write)",CreateIdent(m_localaddr),m_outsize-2); if (!m_clientSocket->GetLocal(m_localaddr)) { wxLogError(_("Cannot get peer data for socket %p"),m_clientSocket); } m_currentType = WorkerEvent::SENDING; - wxLogDebug("%s: CONNECTING",CreateIdent(m_localaddr).c_str()); + wxLogDebug("%s: CONNECTING",CreateIdent(m_localaddr)); SendEvent(false); } break; case wxSOCKET_LOST: { - wxLogError(_("%s: connection lost"),CreateIdent(m_localaddr).c_str()); + wxLogError(_("%s: connection lost"),CreateIdent(m_localaddr)); SendEvent(true); } break; @@ -672,7 +672,7 @@ wxThread::ExitCode ThreadWorker::Entry() bool failed = false; WorkerEvent::evt_type etype = WorkerEvent::CONNECTING; if (!m_clientSocket->Connect(ca)) { - wxLogError("Cannot connect to %s:%d",ca.IPAddress().c_str(), ca.Service()); + wxLogError("Cannot connect to %s:%d",ca.IPAddress(), ca.Service()); failed = true; } else { //wxLogMessage("ThreadWorker: Connected. Sending %d bytes of data",m_outsize); diff --git a/samples/sockets/baseserver.cpp b/samples/sockets/baseserver.cpp index 89b1cdedef..a2969d66ff 100644 --- a/samples/sockets/baseserver.cpp +++ b/samples/sockets/baseserver.cpp @@ -385,7 +385,7 @@ void Server::OnSocketEvent(wxSocketEvent& pEvent) { wxLogError("Server: cannot get peer info"); } else { - wxLogMessage("Got connection from %s:%d",addr.IPAddress().c_str(), addr.Service()); + wxLogMessage("Got connection from %s:%d",addr.IPAddress(), addr.Service()); } bool createThread; diff --git a/samples/splash/splash.cpp b/samples/splash/splash.cpp index 3721e0ed57..af7036446e 100644 --- a/samples/splash/splash.cpp +++ b/samples/splash/splash.cpp @@ -62,6 +62,8 @@ public: // initialization (doing it here and not in the ctor allows to have an error // return: if OnInit() returns false, the application terminates) virtual bool OnInit() wxOVERRIDE; + + void DecorateSplashScreen(wxBitmap& bmp); }; // Define a new frame type: this is going to be our main frame @@ -141,6 +143,10 @@ bool MyApp::OnInit() if (ok) { + // we can even draw dynamic artwork onto our splashscreen + DecorateSplashScreen(bitmap); + + // show the splashscreen new wxSplashScreen(bitmap, wxSPLASH_CENTRE_ON_SCREEN|wxSPLASH_TIMEOUT, 6000, frame, wxID_ANY, wxDefaultPosition, wxDefaultSize, @@ -162,6 +168,41 @@ bool MyApp::OnInit() return true; } +// Draws artwork onto our splashscreen at runtime +void MyApp::DecorateSplashScreen(wxBitmap& bmp) +{ + // use a memory DC to draw directly onto the bitmap + wxMemoryDC memDc(bmp); + + // draw an orange box (with black outline) at the bottom of the splashscreen. + // this box will be 10% of the height of the bitmap, and be at the bottom. + const wxRect bannerRect(wxPoint(0, (bmp.GetHeight() / 10)*9), + wxPoint(bmp.GetWidth(), bmp.GetHeight())); + wxDCBrushChanger bc(memDc, wxBrush(wxColour(255, 102, 0))); + memDc.DrawRectangle(bannerRect); + memDc.DrawLine(bannerRect.GetTopLeft(), bannerRect.GetTopRight()); + + // dynamically get the wxWidgets version to display + wxString description = wxString::Format("wxWidgets %s", wxVERSION_NUM_DOT_STRING); + // create a copyright notice that uses the year that this file was compiled + wxString year(__DATE__); + wxString copyrightLabel = wxString::Format("%s%s wxWidgets. %s", + wxString::FromUTF8("\xc2\xa9"), year.Mid(year.Length() - 4), + "All rights reserved."); + + // draw the (white) labels inside of our orange box (at the bottom of the splashscreen) + memDc.SetTextForeground(*wxWHITE); + // draw the "wxWidget" label on the left side, vertically centered. + // note that we deflate the banner rect a little bit horizontally + // so that the text has some padding to its left. + memDc.DrawLabel(description, bannerRect.Deflate(5, 0), wxALIGN_CENTRE_VERTICAL|wxALIGN_LEFT); + + // draw the copyright label on the right side + memDc.SetFont(wxFontInfo(8)); + memDc.DrawLabel(copyrightLabel, bannerRect.Deflate(5, 0), wxALIGN_CENTRE_VERTICAL | wxALIGN_RIGHT); +} + + // ---------------------------------------------------------------------------- // main frame // ---------------------------------------------------------------------------- diff --git a/samples/stc/edit.cpp b/samples/stc/edit.cpp index 7d9b970ea1..7e7f412ec2 100644 --- a/samples/stc/edit.cpp +++ b/samples/stc/edit.cpp @@ -149,9 +149,9 @@ Edit::Edit (wxWindow *parent, wxWindowID id, StyleSetFont (wxSTC_STYLE_DEFAULT, font); StyleSetForeground (wxSTC_STYLE_DEFAULT, *wxBLACK); StyleSetBackground (wxSTC_STYLE_DEFAULT, *wxWHITE); - StyleSetForeground (wxSTC_STYLE_LINENUMBER, wxColour (wxT("DARK GREY"))); + StyleSetForeground (wxSTC_STYLE_LINENUMBER, wxColour ("DARK GREY")); StyleSetBackground (wxSTC_STYLE_LINENUMBER, *wxWHITE); - StyleSetForeground(wxSTC_STYLE_INDENTGUIDE, wxColour (wxT("DARK GREY"))); + StyleSetForeground(wxSTC_STYLE_INDENTGUIDE, wxColour ("DARK GREY")); InitializePrefs (DEFAULT_LANGUAGE); // set visibility @@ -160,19 +160,19 @@ Edit::Edit (wxWindow *parent, wxWindowID id, SetYCaretPolicy (wxSTC_CARET_EVEN|wxSTC_VISIBLE_STRICT|wxSTC_CARET_SLOP, 1); // markers - MarkerDefine (wxSTC_MARKNUM_FOLDER, wxSTC_MARK_DOTDOTDOT, wxT("BLACK"), wxT("BLACK")); - MarkerDefine (wxSTC_MARKNUM_FOLDEROPEN, wxSTC_MARK_ARROWDOWN, wxT("BLACK"), wxT("BLACK")); - MarkerDefine (wxSTC_MARKNUM_FOLDERSUB, wxSTC_MARK_EMPTY, wxT("BLACK"), wxT("BLACK")); - MarkerDefine (wxSTC_MARKNUM_FOLDEREND, wxSTC_MARK_DOTDOTDOT, wxT("BLACK"), wxT("WHITE")); - MarkerDefine (wxSTC_MARKNUM_FOLDEROPENMID, wxSTC_MARK_ARROWDOWN, wxT("BLACK"), wxT("WHITE")); - MarkerDefine (wxSTC_MARKNUM_FOLDERMIDTAIL, wxSTC_MARK_EMPTY, wxT("BLACK"), wxT("BLACK")); - MarkerDefine (wxSTC_MARKNUM_FOLDERTAIL, wxSTC_MARK_EMPTY, wxT("BLACK"), wxT("BLACK")); + MarkerDefine (wxSTC_MARKNUM_FOLDER, wxSTC_MARK_DOTDOTDOT, "BLACK", "BLACK"); + MarkerDefine (wxSTC_MARKNUM_FOLDEROPEN, wxSTC_MARK_ARROWDOWN, "BLACK", "BLACK"); + MarkerDefine (wxSTC_MARKNUM_FOLDERSUB, wxSTC_MARK_EMPTY, "BLACK", "BLACK"); + MarkerDefine (wxSTC_MARKNUM_FOLDEREND, wxSTC_MARK_DOTDOTDOT, "BLACK", "WHITE"); + MarkerDefine (wxSTC_MARKNUM_FOLDEROPENMID, wxSTC_MARK_ARROWDOWN, "BLACK", "WHITE"); + MarkerDefine (wxSTC_MARKNUM_FOLDERMIDTAIL, wxSTC_MARK_EMPTY, "BLACK", "BLACK"); + MarkerDefine (wxSTC_MARKNUM_FOLDERTAIL, wxSTC_MARK_EMPTY, "BLACK", "BLACK"); // annotations AnnotationSetVisible(wxSTC_ANNOTATION_BOXED); // miscellaneous - m_LineNrMargin = TextWidth (wxSTC_STYLE_LINENUMBER, wxT("_999999")); + m_LineNrMargin = TextWidth (wxSTC_STYLE_LINENUMBER, "_999999"); m_FoldingMargin = 16; CmdKeyClear (wxSTC_KEY_TAB, 0); // this is done by the menu accelerator key SetLayoutCache (wxSTC_CACHE_PAGE); @@ -501,8 +501,8 @@ wxString Edit::DeterminePrefs (const wxString &filename) { while (!filepattern.empty()) { wxString cur = filepattern.BeforeFirst (';'); if ((cur == filename) || - (cur == (filename.BeforeLast ('.') + wxT(".*"))) || - (cur == (wxT("*.") + filename.AfterLast ('.')))) { + (cur == (filename.BeforeLast ('.') + ".*")) || + (cur == ("*." + filename.AfterLast ('.')))) { return curInfo->name; } filepattern = filepattern.AfterFirst (';'); @@ -536,7 +536,7 @@ bool Edit::InitializePrefs (const wxString &name) { // set margin for line numbers SetMarginType (m_LineNrID, wxSTC_MARGIN_NUMBER); - StyleSetForeground (wxSTC_STYLE_LINENUMBER, wxColour (wxT("DARK GREY"))); + StyleSetForeground (wxSTC_STYLE_LINENUMBER, wxColour ("DARK GREY")); StyleSetBackground (wxSTC_STYLE_LINENUMBER, *wxWHITE); SetMarginWidth (m_LineNrID, 0); // start out not visible @@ -554,8 +554,8 @@ bool Edit::InitializePrefs (const wxString &name) { } // set common styles - StyleSetForeground (wxSTC_STYLE_DEFAULT, wxColour (wxT("DARK GREY"))); - StyleSetForeground (wxSTC_STYLE_INDENTGUIDE, wxColour (wxT("DARK GREY"))); + StyleSetForeground (wxSTC_STYLE_DEFAULT, wxColour ("DARK GREY")); + StyleSetForeground (wxSTC_STYLE_INDENTGUIDE, wxColour ("DARK GREY")); // initialize settings if (g_CommonPrefs.syntaxEnable) { @@ -567,10 +567,10 @@ bool Edit::InitializePrefs (const wxString &name) { .Family(wxFONTFAMILY_MODERN) .FaceName(curType.fontname)); StyleSetFont (Nr, font); - if (curType.foreground) { + if (curType.foreground.length()) { StyleSetForeground (Nr, wxColour (curType.foreground)); } - if (curType.background) { + if (curType.background.length()) { StyleSetBackground (Nr, wxColour (curType.background)); } StyleSetBold (Nr, (curType.fontstyle & mySTC_STYLE_BOLD) > 0); @@ -600,21 +600,21 @@ bool Edit::InitializePrefs (const wxString &name) { if (g_CommonPrefs.foldEnable) { SetMarginWidth (m_FoldingID, curInfo->folds != 0? m_FoldingMargin: 0); SetMarginSensitive (m_FoldingID, curInfo->folds != 0); - SetProperty (wxT("fold"), curInfo->folds != 0? wxT("1"): wxT("0")); - SetProperty (wxT("fold.comment"), - (curInfo->folds & mySTC_FOLD_COMMENT) > 0? wxT("1"): wxT("0")); - SetProperty (wxT("fold.compact"), - (curInfo->folds & mySTC_FOLD_COMPACT) > 0? wxT("1"): wxT("0")); - SetProperty (wxT("fold.preprocessor"), - (curInfo->folds & mySTC_FOLD_PREPROC) > 0? wxT("1"): wxT("0")); - SetProperty (wxT("fold.html"), - (curInfo->folds & mySTC_FOLD_HTML) > 0? wxT("1"): wxT("0")); - SetProperty (wxT("fold.html.preprocessor"), - (curInfo->folds & mySTC_FOLD_HTMLPREP) > 0? wxT("1"): wxT("0")); - SetProperty (wxT("fold.comment.python"), - (curInfo->folds & mySTC_FOLD_COMMENTPY) > 0? wxT("1"): wxT("0")); - SetProperty (wxT("fold.quotes.python"), - (curInfo->folds & mySTC_FOLD_QUOTESPY) > 0? wxT("1"): wxT("0")); + SetProperty ("fold", curInfo->folds != 0? "1": "0"); + SetProperty ("fold.comment", + (curInfo->folds & mySTC_FOLD_COMMENT) > 0? "1": "0"); + SetProperty ("fold.compact", + (curInfo->folds & mySTC_FOLD_COMPACT) > 0? "1": "0"); + SetProperty ("fold.preprocessor", + (curInfo->folds & mySTC_FOLD_PREPROC) > 0? "1": "0"); + SetProperty ("fold.html", + (curInfo->folds & mySTC_FOLD_HTML) > 0? "1": "0"); + SetProperty ("fold.html.preprocessor", + (curInfo->folds & mySTC_FOLD_HTMLPREP) > 0? "1": "0"); + SetProperty ("fold.comment.python", + (curInfo->folds & mySTC_FOLD_COMMENTPY) > 0? "1": "0"); + SetProperty ("fold.quotes.python", + (curInfo->folds & mySTC_FOLD_QUOTESPY) > 0? "1": "0"); } SetFoldFlags (wxSTC_FOLDFLAG_LINEBEFORE_CONTRACTED | wxSTC_FOLDFLAG_LINEAFTER_CONTRACTED); @@ -646,8 +646,8 @@ bool Edit::LoadFile () #if wxUSE_FILEDLG // get filename if (!m_filename) { - wxFileDialog dlg (this, wxT("Open file"), wxEmptyString, wxEmptyString, - wxT("Any file (*)|*"), wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_CHANGE_DIR); + wxFileDialog dlg (this, "Open file", wxEmptyString, wxEmptyString, + "Any file (*)|*", wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_CHANGE_DIR); if (dlg.ShowModal() != wxID_OK) return false; m_filename = dlg.GetPath(); } @@ -683,7 +683,7 @@ bool Edit::SaveFile () // get filename if (!m_filename) { - wxFileDialog dlg (this, wxT("Save file"), wxEmptyString, wxEmptyString, wxT("Any file (*)|*"), + wxFileDialog dlg (this, "Save file", wxEmptyString, wxEmptyString, "Any file (*)|*", wxFD_SAVE | wxFD_OVERWRITE_PROMPT); if (dlg.ShowModal() != wxID_OK) return false; m_filename = dlg.GetPath(); @@ -757,14 +757,14 @@ EditProperties::EditProperties (Edit *edit, textinfo->Add (new wxStaticText (this, wxID_ANY, _("Lexer-ID: "), wxDefaultPosition, wxSize(80, wxDefaultCoord)), 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4); - text = wxString::Format (wxT("%d"), edit->GetLexer()); + text = wxString::Format ("%d", edit->GetLexer()); textinfo->Add (new wxStaticText (this, wxID_ANY, text), 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4); wxString EOLtype = wxEmptyString; switch (edit->GetEOLMode()) { - case wxSTC_EOL_CR: {EOLtype = wxT("CR (Unix)"); break; } - case wxSTC_EOL_CRLF: {EOLtype = wxT("CRLF (Windows)"); break; } - case wxSTC_EOL_LF: {EOLtype = wxT("CR (Macintosh)"); break; } + case wxSTC_EOL_CR: {EOLtype = "CR (Unix)"; break; } + case wxSTC_EOL_CRLF: {EOLtype = "CRLF (Windows)"; break; } + case wxSTC_EOL_LF: {EOLtype = "CR (Macintosh)"; break; } } textinfo->Add (new wxStaticText (this, wxID_ANY, _("Line endings"), wxDefaultPosition, wxSize(80, wxDefaultCoord)), @@ -774,7 +774,7 @@ EditProperties::EditProperties (Edit *edit, // text info box wxStaticBoxSizer *textinfos = new wxStaticBoxSizer ( - new wxStaticBox (this, wxID_ANY, _("Informations")), + new wxStaticBox (this, wxID_ANY, _("Information")), wxVERTICAL); textinfos->Add (textinfo, 0, wxEXPAND); textinfos->Add (0, 6); @@ -784,25 +784,25 @@ EditProperties::EditProperties (Edit *edit, statistic->Add (new wxStaticText (this, wxID_ANY, _("Total lines"), wxDefaultPosition, wxSize(80, wxDefaultCoord)), 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4); - text = wxString::Format (wxT("%d"), edit->GetLineCount()); + text = wxString::Format ("%d", edit->GetLineCount()); statistic->Add (new wxStaticText (this, wxID_ANY, text), 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4); statistic->Add (new wxStaticText (this, wxID_ANY, _("Total chars"), wxDefaultPosition, wxSize(80, wxDefaultCoord)), 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4); - text = wxString::Format (wxT("%d"), edit->GetTextLength()); + text = wxString::Format ("%d", edit->GetTextLength()); statistic->Add (new wxStaticText (this, wxID_ANY, text), 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4); statistic->Add (new wxStaticText (this, wxID_ANY, _("Current line"), wxDefaultPosition, wxSize(80, wxDefaultCoord)), 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4); - text = wxString::Format (wxT("%d"), edit->GetCurrentLine()); + text = wxString::Format ("%d", edit->GetCurrentLine()); statistic->Add (new wxStaticText (this, wxID_ANY, text), 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4); statistic->Add (new wxStaticText (this, wxID_ANY, _("Current pos"), wxDefaultPosition, wxSize(80, wxDefaultCoord)), 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4); - text = wxString::Format (wxT("%d"), edit->GetCurrentPos()); + text = wxString::Format ("%d", edit->GetCurrentPos()); statistic->Add (new wxStaticText (this, wxID_ANY, text), 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4); @@ -836,7 +836,7 @@ EditProperties::EditProperties (Edit *edit, // EditPrint //---------------------------------------------------------------------------- -EditPrint::EditPrint (Edit *edit, const wxChar *title) +EditPrint::EditPrint (Edit *edit, const wxString& title) : wxPrintout(title) , m_edit(edit) { diff --git a/samples/stc/edit.h b/samples/stc/edit.h index 10f4e39c56..908990e757 100644 --- a/samples/stc/edit.h +++ b/samples/stc/edit.h @@ -162,7 +162,7 @@ class EditPrint: public wxPrintout { public: //! constructor - EditPrint (Edit *edit, const wxChar *title = wxT("")); + EditPrint (Edit *edit, const wxString& title = ""); //! event handlers bool OnPrintPage (int page) wxOVERRIDE; diff --git a/samples/stc/prefs.cpp b/samples/stc/prefs.cpp index 0e98bcf95a..e2f6bb88f9 100644 --- a/samples/stc/prefs.cpp +++ b/samples/stc/prefs.cpp @@ -218,159 +218,159 @@ const int g_LanguagePrefsSize = WXSIZEOF(g_LanguagePrefs); //! style types const StyleInfo g_StylePrefs [] = { // mySTC_TYPE_DEFAULT - {wxT("Default"), - wxT("BLACK"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"Default", + "BLACK", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_WORD1 - {wxT("Keyword1"), - wxT("BLUE"), wxT("WHITE"), - wxT(""), 10, mySTC_STYLE_BOLD, 0}, + {"Keyword1", + "BLUE", "WHITE", + "", 10, mySTC_STYLE_BOLD, 0}, // mySTC_TYPE_WORD2 - {wxT("Keyword2"), - wxT("MIDNIGHT BLUE"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"Keyword2", + "MIDNIGHT BLUE", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_WORD3 - {wxT("Keyword3"), - wxT("CORNFLOWER BLUE"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"Keyword3", + "CORNFLOWER BLUE", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_WORD4 - {wxT("Keyword4"), - wxT("CYAN"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"Keyword4", + "CYAN", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_WORD5 - {wxT("Keyword5"), - wxT("DARK GREY"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"Keyword5", + "DARK GREY", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_WORD6 - {wxT("Keyword6"), - wxT("GREY"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"Keyword6", + "GREY", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_COMMENT - {wxT("Comment"), - wxT("FOREST GREEN"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"Comment", + "FOREST GREEN", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_COMMENT_DOC - {wxT("Comment (Doc)"), - wxT("FOREST GREEN"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"Comment (Doc)", + "FOREST GREEN", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_COMMENT_LINE - {wxT("Comment line"), - wxT("FOREST GREEN"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"Comment line", + "FOREST GREEN", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_COMMENT_SPECIAL - {wxT("Special comment"), - wxT("FOREST GREEN"), wxT("WHITE"), - wxT(""), 10, mySTC_STYLE_ITALIC, 0}, + {"Special comment", + "FOREST GREEN", "WHITE", + "", 10, mySTC_STYLE_ITALIC, 0}, // mySTC_TYPE_CHARACTER - {wxT("Character"), - wxT("KHAKI"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"Character", + "KHAKI", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_CHARACTER_EOL - {wxT("Character (EOL)"), - wxT("KHAKI"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"Character (EOL)", + "KHAKI", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_STRING - {wxT("String"), - wxT("BROWN"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"String", + "BROWN", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_STRING_EOL - {wxT("String (EOL)"), - wxT("BROWN"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"String (EOL)", + "BROWN", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_DELIMITER - {wxT("Delimiter"), - wxT("ORANGE"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"Delimiter", + "ORANGE", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_PUNCTUATION - {wxT("Punctuation"), - wxT("ORANGE"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"Punctuation", + "ORANGE", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_OPERATOR - {wxT("Operator"), - wxT("BLACK"), wxT("WHITE"), - wxT(""), 10, mySTC_STYLE_BOLD, 0}, + {"Operator", + "BLACK", "WHITE", + "", 10, mySTC_STYLE_BOLD, 0}, // mySTC_TYPE_BRACE - {wxT("Label"), - wxT("VIOLET"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"Label", + "VIOLET", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_COMMAND - {wxT("Command"), - wxT("BLUE"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"Command", + "BLUE", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_IDENTIFIER - {wxT("Identifier"), - wxT("BLACK"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"Identifier", + "BLACK", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_LABEL - {wxT("Label"), - wxT("VIOLET"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"Label", + "VIOLET", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_NUMBER - {wxT("Number"), - wxT("SIENNA"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"Number", + "SIENNA", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_PARAMETER - {wxT("Parameter"), - wxT("VIOLET"), wxT("WHITE"), - wxT(""), 10, mySTC_STYLE_ITALIC, 0}, + {"Parameter", + "VIOLET", "WHITE", + "", 10, mySTC_STYLE_ITALIC, 0}, // mySTC_TYPE_REGEX - {wxT("Regular expression"), - wxT("ORCHID"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"Regular expression", + "ORCHID", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_UUID - {wxT("UUID"), - wxT("ORCHID"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"UUID", + "ORCHID", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_VALUE - {wxT("Value"), - wxT("ORCHID"), wxT("WHITE"), - wxT(""), 10, mySTC_STYLE_ITALIC, 0}, + {"Value", + "ORCHID", "WHITE", + "", 10, mySTC_STYLE_ITALIC, 0}, // mySTC_TYPE_PREPROCESSOR - {wxT("Preprocessor"), - wxT("GREY"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"Preprocessor", + "GREY", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_SCRIPT - {wxT("Script"), - wxT("DARK GREY"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"Script", + "DARK GREY", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_ERROR - {wxT("Error"), - wxT("RED"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"Error", + "RED", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_UNDEFINED - {wxT("Undefined"), - wxT("ORANGE"), wxT("WHITE"), - wxT(""), 10, 0, 0} + {"Undefined", + "ORANGE", "WHITE", + "", 10, 0, 0} }; diff --git a/samples/stc/prefs.h b/samples/stc/prefs.h index 74db4de9ce..5c8fd7e472 100644 --- a/samples/stc/prefs.h +++ b/samples/stc/prefs.h @@ -136,10 +136,10 @@ extern const int g_LanguagePrefsSize; //---------------------------------------------------------------------------- // StyleInfo struct StyleInfo { - const wxChar *name; - const wxChar *foreground; - const wxChar *background; - const wxChar *fontname; + const wxString name; + const wxString foreground; + const wxString background; + const wxString fontname; int fontsize; int fontstyle; int lettercase; diff --git a/samples/stc/stctest.cpp b/samples/stc/stctest.cpp index e60c04cd97..122626f4fe 100644 --- a/samples/stc/stctest.cpp +++ b/samples/stc/stctest.cpp @@ -54,19 +54,19 @@ // declarations //============================================================================ -#define APP_NAME wxT("STC-Test") -#define APP_DESCR _("See http://wxguide.sourceforge.net/") +#define APP_NAME "STC-Test" +#define APP_DESCR "See http://wxguide.sourceforge.net/" -#define APP_MAINT wxT("Otto Wyss") -#define APP_VENDOR wxT("wxWidgets") -#define APP_COPYRIGTH wxT("(C) 2003 Otto Wyss") -#define APP_LICENCE wxT("wxWidgets") +#define APP_MAINT "Otto Wyss" +#define APP_VENDOR "wxWidgets" +#define APP_COPYRIGTH "(C) 2003 Otto Wyss" +#define APP_LICENCE "wxWidgets" -#define APP_VERSION wxT("0.1.alpha") +#define APP_VERSION "0.1.alpha" #define APP_BUILD __DATE__ -#define APP_WEBSITE wxT("http://www.wxWidgets.org") -#define APP_MAIL wxT("mailto://???") +#define APP_WEBSITE "http://www.wxWidgets.org" +#define APP_MAIL "mailto://???" #define NONAME _("") @@ -214,7 +214,7 @@ bool App::OnInit () { SetVendorName (APP_VENDOR); g_appname = new wxString (); g_appname->Append (APP_VENDOR); - g_appname->Append (wxT("-")); + g_appname->Append ("-"); g_appname->Append (APP_NAME); #if wxUSE_PRINTING_ARCHITECTURE @@ -301,7 +301,7 @@ AppFrame::AppFrame (const wxString &title) // set icon and background SetTitle (*g_appname); - SetBackgroundColour (wxT("WHITE")); + SetBackgroundColour ("WHITE"); // create menu m_menuBar = new wxMenuBar; @@ -311,7 +311,7 @@ AppFrame::AppFrame (const wxString &title) m_edit = new Edit (this, wxID_ANY); m_edit->SetFocus(); - FileOpen (wxT("stctest.cpp")); + FileOpen ("stctest.cpp"); } AppFrame::~AppFrame () { @@ -341,7 +341,7 @@ void AppFrame::OnFileOpen (wxCommandEvent &WXUNUSED(event)) { if (!m_edit) return; #if wxUSE_FILEDLG wxString fname; - wxFileDialog dlg (this, wxT("Open file"), wxEmptyString, wxEmptyString, wxT("Any file (*)|*"), + wxFileDialog dlg (this, "Open file", wxEmptyString, wxEmptyString, "Any file (*)|*", wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_CHANGE_DIR); if (dlg.ShowModal() != wxID_OK) return; fname = dlg.GetPath (); @@ -363,7 +363,7 @@ void AppFrame::OnFileSaveAs (wxCommandEvent &WXUNUSED(event)) { if (!m_edit) return; #if wxUSE_FILEDLG wxString filename = wxEmptyString; - wxFileDialog dlg (this, wxT("Save file"), wxEmptyString, wxEmptyString, wxT("Any file (*)|*"), wxFD_SAVE|wxFD_OVERWRITE_PROMPT); + wxFileDialog dlg (this, "Save file", wxEmptyString, wxEmptyString, "Any file (*)|*", wxFD_SAVE|wxFD_OVERWRITE_PROMPT); if (dlg.ShowModal() != wxID_OK) return; filename = dlg.GetPath(); m_edit->SaveFile (filename); @@ -466,8 +466,8 @@ void AppFrame::OnContextMenu(wxContextMenuEvent& evt) } wxMenu menu; - menu.Append(wxID_ABOUT, wxT("&About")); - menu.Append(wxID_EXIT, wxT("E&xit")); + menu.Append(wxID_ABOUT, "&About"); + menu.Append(wxID_EXIT, "E&xit"); PopupMenu(&menu, point); } @@ -733,23 +733,23 @@ public: { SetLexerXml(); - SetProperty(wxT("fold"), wxT("1")); - SetProperty(wxT("fold.comment"), wxT("1")); - SetProperty(wxT("fold.compact"), wxT("1")); - SetProperty(wxT("fold.preprocessor"), wxT("1")); - SetProperty(wxT("fold.html"), wxT("1")); - SetProperty(wxT("fold.html.preprocessor"), wxT("1")); + SetProperty("fold", "1"); + SetProperty("fold.comment", "1"); + SetProperty("fold.compact", "1"); + SetProperty("fold.preprocessor", "1"); + SetProperty("fold.html", "1"); + SetProperty("fold.html.preprocessor", "1"); SetMarginType(margin_id_lineno, wxSTC_MARGIN_NUMBER); SetMarginWidth(margin_id_lineno, 32); - MarkerDefine(wxSTC_MARKNUM_FOLDER, wxSTC_MARK_BOXPLUS, wxT("WHITE"), wxT("BLACK")); - MarkerDefine(wxSTC_MARKNUM_FOLDEROPEN, wxSTC_MARK_BOXMINUS, wxT("WHITE"), wxT("BLACK")); - MarkerDefine(wxSTC_MARKNUM_FOLDERSUB, wxSTC_MARK_VLINE, wxT("WHITE"), wxT("BLACK")); - MarkerDefine(wxSTC_MARKNUM_FOLDEREND, wxSTC_MARK_BOXPLUSCONNECTED, wxT("WHITE"), wxT("BLACK")); - MarkerDefine(wxSTC_MARKNUM_FOLDEROPENMID, wxSTC_MARK_BOXMINUSCONNECTED, wxT("WHITE"), wxT("BLACK")); - MarkerDefine(wxSTC_MARKNUM_FOLDERMIDTAIL, wxSTC_MARK_TCORNER, wxT("WHITE"), wxT("BLACK")); - MarkerDefine(wxSTC_MARKNUM_FOLDERTAIL, wxSTC_MARK_LCORNER, wxT("WHITE"), wxT("BLACK")); + MarkerDefine(wxSTC_MARKNUM_FOLDER, wxSTC_MARK_BOXPLUS, "WHITE", "BLACK"); + MarkerDefine(wxSTC_MARKNUM_FOLDEROPEN, wxSTC_MARK_BOXMINUS, "WHITE", "BLACK"); + MarkerDefine(wxSTC_MARKNUM_FOLDERSUB, wxSTC_MARK_VLINE, "WHITE", "BLACK"); + MarkerDefine(wxSTC_MARKNUM_FOLDEREND, wxSTC_MARK_BOXPLUSCONNECTED, "WHITE", "BLACK"); + MarkerDefine(wxSTC_MARKNUM_FOLDEROPENMID, wxSTC_MARK_BOXMINUSCONNECTED, "WHITE", "BLACK"); + MarkerDefine(wxSTC_MARKNUM_FOLDERMIDTAIL, wxSTC_MARK_TCORNER, "WHITE", "BLACK"); + MarkerDefine(wxSTC_MARKNUM_FOLDERTAIL, wxSTC_MARK_LCORNER, "WHITE", "BLACK"); SetMarginMask(margin_id_fold, wxSTC_MASK_FOLDERS); SetMarginWidth(margin_id_fold, 32); @@ -780,7 +780,7 @@ public: StyleSetForeground(wxSTC_H_DOUBLESTRING, *wxBLACK); StyleSetForeground(wxSTC_H_SINGLESTRING, *wxBLACK); StyleSetForeground(wxSTC_H_OTHER, *wxBLUE); - StyleSetForeground(wxSTC_H_COMMENT, wxTheColourDatabase->Find(wxT("GREY"))); + StyleSetForeground(wxSTC_H_COMMENT, wxTheColourDatabase->Find("GREY")); StyleSetForeground(wxSTC_H_ENTITY, *wxRED); StyleSetBold(wxSTC_H_ENTITY, true); StyleSetForeground(wxSTC_H_TAGEND, *wxBLUE); @@ -814,7 +814,7 @@ void MinimalEditor::OnMarginClick(wxStyledTextEvent &event) void MinimalEditor::OnText(wxStyledTextEvent& event) { - wxLogDebug(wxT("Modified")); + wxLogDebug("Modified"); event.Skip(); } diff --git a/samples/taborder/taborder.cpp b/samples/taborder/taborder.cpp index 8bed08368f..0ed2881516 100644 --- a/samples/taborder/taborder.cpp +++ b/samples/taborder/taborder.cpp @@ -254,7 +254,7 @@ void MyFrame::OnIdle( wxIdleEvent& WXUNUSED(event) ) wxString msg; if ( focus ) { - msg.Printf("Focus is at %s", s_windowFocus->GetName().c_str()); + msg.Printf("Focus is at %s", s_windowFocus->GetName()); } else { diff --git a/samples/text/text.cpp b/samples/text/text.cpp index c95c949498..a057dbaee4 100644 --- a/samples/text/text.cpp +++ b/samples/text/text.cpp @@ -455,7 +455,7 @@ bool MyApp::OnInit() return false; // Create the main frame window - MyFrame *frame = new MyFrame(wxS("Text wxWidgets sample"), 50, 50); + MyFrame *frame = new MyFrame("Text wxWidgets sample", 50, 50); wxMenu *file_menu = new wxMenu; file_menu->Append(TEXT_SAVE, "&Save file\tCtrl-S", @@ -726,7 +726,7 @@ void MyTextCtrl::LogKeyEvent(const wxString& name, wxKeyEvent& event) const wxLogMessage( "%s event: %s (flags = %c%c%c%c)", name, - key.c_str(), + key, GetChar( event.ControlDown(), 'C' ), GetChar( event.AltDown(), 'A' ), GetChar( event.ShiftDown(), 'S' ), @@ -781,7 +781,7 @@ static wxString GetMouseEventDesc(const wxMouseEvent& ev) wxASSERT(!(dbl && up)); return wxString::Format("%s mouse button %s", - button.c_str(), + button, dbl ? "double clicked" : up ? "released" : "clicked"); } @@ -898,7 +898,7 @@ void MyTextCtrl::OnText(wxCommandEvent& event) const wxChar *data = (const wxChar *)(win->GetClientData()); if ( data ) { - wxLogMessage(wxT("Text %s in control \"%s\""), changeVerb, data); + wxLogMessage("Text %s in control \"%s\"", changeVerb, data); } else { @@ -973,8 +973,8 @@ void MyTextCtrl::OnTextURL(wxTextUrlEvent& event) end = event.GetURLEnd(); wxLogMessage("Mouse event over URL '%s': %s", - GetValue().Mid(start, end - start).c_str(), - GetMouseEventDesc(ev).c_str()); + GetValue().Mid(start, end - start), + GetMouseEventDesc(ev)); } void MyTextCtrl::OnChar(wxKeyEvent& event) @@ -1018,12 +1018,12 @@ void MyTextCtrl::OnKeyDown(wxKeyEvent& event) wxLogMessage("Selection: from %ld to %ld.", from, to); wxLogMessage("Selection = '%s' (len = %u)", - sel.c_str(), + sel, (unsigned int) sel.length()); const wxString text = GetLineText(line); - wxLogMessage(wxT("Current line: \"%s\"; length = %lu"), - text.c_str(), text.length()); + wxLogMessage("Current line: \"%s\"; length = %lu", + text, text.length()); } break; @@ -1212,7 +1212,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) "very very very long line to test " "wxHSCROLL style\n" "\nAnd here is a link in quotation marks to " - wxT("test wxTE_AUTO_URL: \"http://www.wxwidgets.org\""), + "test wxTE_AUTO_URL: \"http://www.wxwidgets.org\"", wxPoint(450, 10), wxSize(200, 230), wxTE_RICH | wxTE_MULTILINE | wxTE_AUTO_URL); m_textrich->SetStyle(0, 10, *wxRED); diff --git a/samples/toolbar/toolbar.cpp b/samples/toolbar/toolbar.cpp index 0b442bf8c3..63ba471f6d 100644 --- a/samples/toolbar/toolbar.cpp +++ b/samples/toolbar/toolbar.cpp @@ -605,7 +605,7 @@ MyFrame::MyFrame(wxFrame* parent, toolMenu->Append(IDM_TOOLBAR_TOGGLERADIOBTN2, "Toggle &2nd radio button\tCtrl-2"); toolMenu->Append(IDM_TOOLBAR_TOGGLERADIOBTN3, "Toggle &3rd radio button\tCtrl-3"); toolMenu->AppendSeparator(); - toolMenu->Append(IDM_TOOLBAR_CHANGE_TOOLTIP, wxT("Change tooltip of \"New\"")); + toolMenu->Append(IDM_TOOLBAR_CHANGE_TOOLTIP, "Change tooltip of \"New\""); toolMenu->AppendSeparator(); toolMenu->Append(IDM_TOOLBAR_INC_TOOL_SPACING, "Increase spacing\tCtrl-+"); toolMenu->Append(IDM_TOOLBAR_DEC_TOOL_SPACING, "Decrease spacing\tCtrl--"); @@ -853,7 +853,7 @@ void MyFrame::OnToolRightClick(wxCommandEvent& event) void MyFrame::OnCombo(wxCommandEvent& event) { - wxLogStatus("Combobox string '%s' selected", event.GetString().c_str()); + wxLogStatus("Combobox string '%s' selected", event.GetString()); } void MyFrame::DoEnablePrint() diff --git a/samples/treectrl/treetest.cpp b/samples/treectrl/treetest.cpp index 4543073660..24a4186efd 100644 --- a/samples/treectrl/treetest.cpp +++ b/samples/treectrl/treetest.cpp @@ -588,7 +588,7 @@ void MyFrame::OnDumpSelected(wxCommandEvent& WXUNUSED(event)) for ( size_t n = 0; n < count; n++ ) { - wxLogMessage("\t%s", m_treeCtrl->GetItemText(array.Item(n)).c_str()); + wxLogMessage("\t%s", m_treeCtrl->GetItemText(array.Item(n))); } } @@ -1298,22 +1298,22 @@ void MyTreeCtrl::DoResetBrokenStateImages(const wxTreeItemId& idParent, DoResetBrokenStateImages(idParent, cookie, state); } -void MyTreeCtrl::LogEvent(const wxChar *name, const wxTreeEvent& event) +void MyTreeCtrl::LogEvent(const wxString& name, const wxTreeEvent& event) { wxTreeItemId item = event.GetItem(); wxString text; if ( item.IsOk() ) - text << wxT('"') << GetItemText(item).c_str() << wxT('"'); + text << '"' << GetItemText(item).c_str() << '"'; else text = "invalid item"; - wxLogMessage("%s(%s)", name, text.c_str()); + wxLogMessage("%s(%s)", name, text); } // avoid repetition #define TREE_EVENT_HANDLER(name) \ void MyTreeCtrl::name(wxTreeEvent& event) \ { \ - LogEvent(wxT(#name), event); \ + LogEvent(#name, event); \ event.Skip(); \ } @@ -1466,7 +1466,7 @@ void LogKeyEvent(const wxString& name, const wxKeyEvent& event) wxLogMessage( "%s event: %s (flags = %c%c%c%c)", name, - key.c_str(), + key, event.ControlDown() ? 'C' : '-', event.AltDown() ? 'A' : '-', event.ShiftDown() ? 'S' : '-', @@ -1491,7 +1491,7 @@ void MyTreeCtrl::OnBeginDrag(wxTreeEvent& event) wxPoint screenpt = ClientToScreen(clientpt); wxLogMessage("OnBeginDrag: started dragging %s at screen coords (%i,%i)", - GetItemText(m_draggedItem).c_str(), + GetItemText(m_draggedItem), screenpt.x, screenpt.y); event.Allow(); @@ -1524,7 +1524,7 @@ void MyTreeCtrl::OnEndDrag(wxTreeEvent& event) wxString text = GetItemText(itemSrc); wxLogMessage("OnEndDrag: '%s' copied to '%s'.", - text.c_str(), GetItemText(itemDst).c_str()); + text, GetItemText(itemDst)); // just do append here - we could also insert it just before/after the item // on which it was dropped, but this requires slightly more work... we also @@ -1606,7 +1606,7 @@ void MyTreeCtrl::OnItemStateClick(wxTreeEvent& event) wxTreeItemId itemId = event.GetItem(); DoToggleState(itemId); - wxLogMessage(wxT("Item \"%s\" state changed to %d"), + wxLogMessage("Item \"%s\" state changed to %d", GetItemText(itemId), GetItemState(itemId)); } @@ -1619,8 +1619,8 @@ void MyTreeCtrl::OnItemMenu(wxTreeEvent& event) wxPoint clientpt = event.GetPoint(); wxPoint screenpt = ClientToScreen(clientpt); - wxLogMessage(wxT("OnItemMenu for item \"%s\" at screen coords (%i, %i)"), - item ? item->GetDesc() : wxString(wxS("unknown")), screenpt.x, screenpt.y); + wxLogMessage("OnItemMenu for item \"%s\" at screen coords (%i, %i)", + item ? item->GetDesc() : wxString("unknown"), screenpt.x, screenpt.y); ShowMenu(itemId, clientpt); event.Skip(); @@ -1665,7 +1665,7 @@ void MyTreeCtrl::OnItemRClick(wxTreeEvent& event) MyTreeItemData *item = (MyTreeItemData *)GetItemData(itemId); - wxLogMessage(wxT("Item \"%s\" right clicked"), item ? item->GetDesc() : wxString(wxS("unknown"))); + wxLogMessage("Item \"%s\" right clicked", item ? item->GetDesc() : wxString("unknown")); event.Skip(); } @@ -1712,7 +1712,7 @@ void MyTreeItemData::ShowInfo(wxTreeCtrl *tree) { wxLogMessage("Item '%s': %sselected, %sexpanded, %sbold,\n" "%u children (%u immediately under this item).", - m_desc.c_str(), + m_desc, Bool2String(tree->IsSelected(GetId())), Bool2String(tree->IsExpanded(GetId())), Bool2String(tree->IsBold(GetId())), diff --git a/samples/treectrl/treetest.h b/samples/treectrl/treetest.h index 971b745cc1..c615a483bc 100644 --- a/samples/treectrl/treetest.h +++ b/samples/treectrl/treetest.h @@ -147,7 +147,7 @@ private: void DoResetBrokenStateImages(const wxTreeItemId& idParent, wxTreeItemIdValue cookie, int state); - void LogEvent(const wxChar *name, const wxTreeEvent& event); + void LogEvent(const wxString& name, const wxTreeEvent& event); int m_imageSize; // current size of images bool m_reverseSort; // flag for OnCompareItems diff --git a/samples/typetest/typetest.cpp b/samples/typetest/typetest.cpp index a703c0ca89..d365ed589f 100644 --- a/samples/typetest/typetest.cpp +++ b/samples/typetest/typetest.cpp @@ -158,7 +158,7 @@ void MyApp::DoStreamDemo(wxCommandEvent& WXUNUSED(event)) std_file_output << f << "\n"; wxString str( "Hello!" ); - tmp.Printf( "String: %s\n", str.c_str() ); + tmp.Printf( "String: %s\n", str ); textCtrl.WriteText( tmp ); text_output << str << "\n"; std_file_output << str.ToAscii() << "\n"; @@ -188,7 +188,7 @@ void MyApp::DoStreamDemo(wxCommandEvent& WXUNUSED(event)) char std_buf[200]; std_file_input >> std_buf; str = wxString::FromAscii(std_buf); - tmp.Printf( "String: %s\n", str.c_str() ); + tmp.Printf( "String: %s\n", str ); textCtrl.WriteText( tmp ); textCtrl.WriteText( "\nReading from wxFileInputStream:\n" ); @@ -216,7 +216,7 @@ void MyApp::DoStreamDemo(wxCommandEvent& WXUNUSED(event)) textCtrl.WriteText( tmp ); text_input >> str; - tmp.Printf( "String: %s\n", str.c_str() ); + tmp.Printf( "String: %s\n", str ); textCtrl.WriteText( tmp ); @@ -244,7 +244,7 @@ void MyApp::DoStreamDemo(wxCommandEvent& WXUNUSED(event)) data_output.WriteDouble( d ); str = "Hello!"; - tmp.Printf( "String: %s\n", str.c_str() ); + tmp.Printf( "String: %s\n", str ); textCtrl.WriteText( tmp ); data_output.WriteString( str ); @@ -268,7 +268,7 @@ void MyApp::DoStreamDemo(wxCommandEvent& WXUNUSED(event)) textCtrl.WriteText( tmp ); str = data_input.ReadString(); - tmp.Printf( "String: %s\n", str.c_str() ); + tmp.Printf( "String: %s\n", str ); textCtrl.WriteText( tmp ); } @@ -1051,15 +1051,15 @@ void MyApp::DoVariantDemo(wxCommandEvent& WXUNUSED(event) ) wxFont* sysFont = new wxFont(wxSystemSettings::GetFont(wxSYS_OEM_FIXED_FONT)); var1 = wxVariant(sysFont); - textCtrl << wxT("var1 = (wxfont)\""); + textCtrl << "var1 = (wxfont)\""; wxFont* font = wxGetVariantCast(var1,wxFont); if (font) { - textCtrl << font->GetNativeFontInfoDesc() << wxT("\"\n"); + textCtrl << font->GetNativeFontInfoDesc() << "\"\n"; } else { - textCtrl << wxT("(null)\"\n"); + textCtrl << "(null)\"\n"; } delete sysFont; diff --git a/samples/webview/webview.cpp b/samples/webview/webview.cpp index feec5f02a4..98d0fea071 100644 --- a/samples/webview/webview.cpp +++ b/samples/webview/webview.cpp @@ -769,7 +769,7 @@ void WebFrame::OnFindText(wxCommandEvent& evt) { count++; } - wxLogMessage("Searching for:%s current match:%li/%i", m_findText.c_str(), count, m_findCount); + wxLogMessage("Searching for:%s current match:%li/%i", m_findText, count, m_findCount); } /** diff --git a/samples/widgets/activityindicator.cpp b/samples/widgets/activityindicator.cpp index 78e43bf6c6..b0f2354cab 100644 --- a/samples/widgets/activityindicator.cpp +++ b/samples/widgets/activityindicator.cpp @@ -109,7 +109,7 @@ wxEND_EVENT_TABLE() // ============================================================================ IMPLEMENT_WIDGETS_PAGE(ActivityIndicatorWidgetsPage, - wxT("ActivityIndicator"), NATIVE_CTRLS); + "ActivityIndicator", NATIVE_CTRLS); void ActivityIndicatorWidgetsPage::CreateContent() { diff --git a/samples/widgets/bmpcombobox.cpp b/samples/widgets/bmpcombobox.cpp index f73feb8978..56dd331fd8 100644 --- a/samples/widgets/bmpcombobox.cpp +++ b/samples/widgets/bmpcombobox.cpp @@ -242,7 +242,7 @@ wxEND_EVENT_TABLE() #define NATIVE_OR_GENERIC_CTRLS GENERIC_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(BitmapComboBoxWidgetsPage, wxT("BitmapCombobox"), +IMPLEMENT_WIDGETS_PAGE(BitmapComboBoxWidgetsPage, "BitmapCombobox", NATIVE_OR_GENERIC_CTRLS | WITH_ITEMS_CTRLS | COMBO_CTRLS ); @@ -298,39 +298,39 @@ void BitmapComboBoxWidgetsPage::CreateContent() wxSizer *sizerLeft = new wxBoxSizer(wxVERTICAL); // left pane - style box - wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style")); + wxStaticBox *box = new wxStaticBox(this, wxID_ANY, "&Set style"); // should be in sync with ComboKind_XXX values static const wxString kinds[] = { - wxT("default"), - wxT("simple"), - wxT("drop down"), + "default", + "simple", + "drop down", }; - m_radioKind = new wxRadioBox(this, wxID_ANY, wxT("Combobox &kind:"), + m_radioKind = new wxRadioBox(this, wxID_ANY, "Combobox &kind:", wxDefaultPosition, wxDefaultSize, WXSIZEOF(kinds), kinds, 1, wxRA_SPECIFY_COLS); wxSizer *sizerStyle = new wxStaticBoxSizer(box, wxVERTICAL); - m_chkSort = CreateCheckBoxAndAddToSizer(sizerStyle, wxT("&Sort items")); - m_chkReadonly = CreateCheckBoxAndAddToSizer(sizerStyle, wxT("&Read only")); + m_chkSort = CreateCheckBoxAndAddToSizer(sizerStyle, "&Sort items"); + m_chkReadonly = CreateCheckBoxAndAddToSizer(sizerStyle, "&Read only"); - wxButton *btn = new wxButton(this, BitmapComboBoxPage_Reset, wxT("&Reset")); + wxButton *btn = new wxButton(this, BitmapComboBoxPage_Reset, "&Reset"); sizerStyle->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 3); sizerLeft->Add(sizerStyle, wxSizerFlags().Expand()); sizerLeft->Add(m_radioKind, 0, wxGROW | wxALL, 5); // left pane - other options box - box = new wxStaticBox(this, wxID_ANY, wxT("Demo options")); + box = new wxStaticBox(this, wxID_ANY, "Demo options"); wxSizer *sizerOptions = new wxStaticBoxSizer(box, wxVERTICAL); - sizerRow = CreateSizerWithSmallTextAndLabel(wxT("Control &height:"), + sizerRow = CreateSizerWithSmallTextAndLabel("Control &height:", BitmapComboBoxPage_ChangeHeight, &m_textChangeHeight); m_textChangeHeight->SetSize(20, wxDefaultCoord); @@ -340,42 +340,42 @@ void BitmapComboBoxWidgetsPage::CreateContent() // middle pane wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, - wxT("&Change wxBitmapComboBox contents")); + "&Change wxBitmapComboBox contents"); wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL); - btn = new wxButton(this, BitmapComboBoxPage_ContainerTests, wxT("Run &tests")); + btn = new wxButton(this, BitmapComboBoxPage_ContainerTests, "Run &tests"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); #if wxUSE_IMAGE - btn = new wxButton(this, BitmapComboBoxPage_AddWidgetIcons, wxT("Add &widget icons")); + btn = new wxButton(this, BitmapComboBoxPage_AddWidgetIcons, "Add &widget icons"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, BitmapComboBoxPage_LoadFromFile, wxT("Insert image from &file")); + btn = new wxButton(this, BitmapComboBoxPage_LoadFromFile, "Insert image from &file"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, BitmapComboBoxPage_SetFromFile, wxT("&Set image from file")); + btn = new wxButton(this, BitmapComboBoxPage_SetFromFile, "&Set image from file"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); #endif - btn = new wxButton(this, BitmapComboBoxPage_AddSeveralWithImages, wxT("A&ppend a few strings with images")); + btn = new wxButton(this, BitmapComboBoxPage_AddSeveralWithImages, "A&ppend a few strings with images"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, BitmapComboBoxPage_AddSeveral, wxT("Append a &few strings")); + btn = new wxButton(this, BitmapComboBoxPage_AddSeveral, "Append a &few strings"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, BitmapComboBoxPage_AddMany, wxT("Append &many strings")); + btn = new wxButton(this, BitmapComboBoxPage_AddMany, "Append &many strings"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(BitmapComboBoxPage_Delete, - wxT("&Delete this item"), + "&Delete this item", BitmapComboBoxPage_DeleteText, &m_textDelete); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, BitmapComboBoxPage_DeleteSel, wxT("Delete &selection")); + btn = new wxButton(this, BitmapComboBoxPage_DeleteSel, "Delete &selection"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, BitmapComboBoxPage_Clear, wxT("&Clear")); + btn = new wxButton(this, BitmapComboBoxPage_Clear, "&Clear"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); #if wxUSE_IMAGE @@ -432,7 +432,7 @@ void BitmapComboBoxWidgetsPage::CreateCombo() switch ( m_radioKind->GetSelection() ) { default: - wxFAIL_MSG( wxT("unknown combo kind") ); + wxFAIL_MSG( "unknown combo kind" ); // fall through case ComboKind_Default: @@ -512,7 +512,7 @@ void BitmapComboBoxWidgetsPage::OnButtonChange(wxCommandEvent& WXUNUSED(event)) #ifndef __WXGTK__ m_combobox->SetString(sel, m_textChange->GetValue()); #else - wxLogMessage(wxT("Not implemented in wxGTK")); + wxLogMessage("Not implemented in wxGTK"); #endif } } @@ -551,7 +551,7 @@ void BitmapComboBoxWidgetsPage::OnButtonInsert(wxCommandEvent& WXUNUSED(event)) if ( !m_textInsert->IsModified() ) { // update the default string - m_textInsert->SetValue(wxString::Format(wxT("test item %u"), ++s_item)); + m_textInsert->SetValue(wxString::Format("test item %u", ++s_item)); } int sel = m_combobox->GetSelection(); @@ -595,15 +595,15 @@ void BitmapComboBoxWidgetsPage::OnButtonAddMany(wxCommandEvent& WXUNUSED(event)) // "many" means 1000 here for ( unsigned int n = 0; n < 1000; n++ ) { - m_combobox->Append(wxString::Format(wxT("item #%u"), n)); + m_combobox->Append(wxString::Format("item #%u", n)); } } void BitmapComboBoxWidgetsPage::OnButtonAddSeveral(wxCommandEvent& WXUNUSED(event)) { - m_combobox->Append(wxT("First")); - m_combobox->Append(wxT("another one")); - m_combobox->Append(wxT("and the last (very very very very very very very very very very long) one")); + m_combobox->Append("First"); + m_combobox->Append("another one"); + m_combobox->Append("and the last (very very very very very very very very very very long) one"); } void BitmapComboBoxWidgetsPage::OnButtonAddSeveralWithImages(wxCommandEvent& WXUNUSED(event)) @@ -640,10 +640,10 @@ void BitmapComboBoxWidgetsPage::RescaleImage(wxImage& image, int w, int h) if ( isFirstScale && m_combobox->GetCount() > 0 ) { - wxMessageBox( wxT("wxBitmapComboBox normally only supports images of one size. ") - wxT("However, for demonstration purposes, loaded bitmaps are scaled to fit ") - wxT("using wxImage::Rescale."), - wxT("Notice"), + wxMessageBox( "wxBitmapComboBox normally only supports images of one size. " + "However, for demonstration purposes, loaded bitmaps are scaled to fit " + "using wxImage::Rescale.", + "Notice", wxOK, this ); @@ -658,32 +658,32 @@ void BitmapComboBoxWidgetsPage::LoadWidgetImages( wxArrayString* strings, wxImag { wxFileName fn; fn.AssignCwd(); - fn.AppendDir(wxT("icons")); + fn.AppendDir("icons"); wxSetCursor(*wxHOURGLASS_CURSOR); if ( !wxDir::Exists(fn.GetFullPath()) || - !wxDir::GetAllFiles(fn.GetFullPath(),strings,wxT("*.xpm")) ) + !wxDir::GetAllFiles(fn.GetFullPath(),strings,"*.xpm") ) { // Try ../../samples/widgets/icons fn.RemoveLastDir(); fn.RemoveLastDir(); - fn.AppendDir(wxT("icons")); + fn.AppendDir("icons"); if ( !wxDir::Exists(fn.GetFullPath()) || - !wxDir::GetAllFiles(fn.GetFullPath(),strings,wxT("*.xpm")) ) + !wxDir::GetAllFiles(fn.GetFullPath(),strings,"*.xpm") ) { // Try ../../../samples/widgets/icons fn.AssignCwd(); fn.RemoveLastDir(); fn.RemoveLastDir(); fn.RemoveLastDir(); - fn.AppendDir(wxT("samples")); - fn.AppendDir(wxT("widgets")); - fn.AppendDir(wxT("icons")); + fn.AppendDir("samples"); + fn.AppendDir("widgets"); + fn.AppendDir("icons"); if ( !wxDir::Exists(fn.GetFullPath()) || - !wxDir::GetAllFiles(fn.GetFullPath(),strings,wxT("*.xpm")) ) + !wxDir::GetAllFiles(fn.GetFullPath(),strings,"*.xpm") ) { - wxLogWarning(wxT("Could not load widget icons.")); + wxLogWarning("Could not load widget icons."); wxSetCursor(*wxSTANDARD_CURSOR); return; } @@ -703,7 +703,7 @@ void BitmapComboBoxWidgetsPage::LoadWidgetImages( wxArrayString* strings, wxImag wxString name = fn.GetName(); // Handle few exceptions - if ( name == wxT("bmpbtn") ) + if ( name == "bmpbtn" ) { strings->RemoveAt(i); i--; @@ -802,26 +802,26 @@ void BitmapComboBoxWidgetsPage::OnComboText(wxCommandEvent& event) wxString s = event.GetString(); wxASSERT_MSG( s == m_combobox->GetValue(), - wxT("event and combobox values should be the same") ); + "event and combobox values should be the same" ); if (event.GetEventType() == wxEVT_TEXT_ENTER) { - wxLogMessage(wxT("BitmapCombobox enter pressed (now '%s')"), s.c_str()); + wxLogMessage("BitmapCombobox enter pressed (now '%s')", s); } else { - wxLogMessage(wxT("BitmapCombobox text changed (now '%s')"), s.c_str()); + wxLogMessage("BitmapCombobox text changed (now '%s')", s); } } void BitmapComboBoxWidgetsPage::OnComboBox(wxCommandEvent& event) { long sel = event.GetInt(); - m_textDelete->SetValue(wxString::Format(wxT("%ld"), sel)); + m_textDelete->SetValue(wxString::Format("%ld", sel)); - wxLogMessage(wxT("BitmapCombobox item %ld selected"), sel); + wxLogMessage("BitmapCombobox item %ld selected", sel); - wxLogMessage(wxT("BitmapCombobox GetValue(): %s"), m_combobox->GetValue().c_str() ); + wxLogMessage("BitmapCombobox GetValue(): %s", m_combobox->GetValue() ); } void BitmapComboBoxWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event)) @@ -876,7 +876,7 @@ wxBitmap BitmapComboBoxWidgetsPage::LoadBitmap(const wxString& WXUNUSED(filepath wxBitmap BitmapComboBoxWidgetsPage::QueryBitmap(wxString* pStr) { - wxString filepath = wxLoadFileSelector(wxT("image"), + wxString filepath = wxLoadFileSelector("image", wxEmptyString, wxEmptyString, this); @@ -897,7 +897,7 @@ wxBitmap BitmapComboBoxWidgetsPage::QueryBitmap(wxString* pStr) if (bitmap.IsOk()) { - wxLogDebug(wxT("%i, %i"),bitmap.GetWidth(), bitmap.GetHeight()); + wxLogDebug("%i, %i",bitmap.GetWidth(), bitmap.GetHeight()); } ::wxSetCursor( *wxSTANDARD_CURSOR ); @@ -936,12 +936,12 @@ wxBitmap BitmapComboBoxWidgetsPage::CreateBitmap(const wxColour& colour) void BitmapComboBoxWidgetsPage::OnDropDown(wxCommandEvent& WXUNUSED(event)) { - wxLogMessage(wxT("Combobox dropped down")); + wxLogMessage("Combobox dropped down"); } void BitmapComboBoxWidgetsPage::OnCloseUp(wxCommandEvent& WXUNUSED(event)) { - wxLogMessage(wxT("Combobox closed up")); + wxLogMessage("Combobox closed up"); } #endif // wxUSE_BITMAPCOMBOBOX diff --git a/samples/widgets/button.cpp b/samples/widgets/button.cpp index 54bb5db6e5..1275372a6d 100644 --- a/samples/widgets/button.cpp +++ b/samples/widgets/button.cpp @@ -197,7 +197,7 @@ wxEND_EVENT_TABLE() #define FAMILY_CTRLS NATIVE_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(ButtonWidgetsPage, wxT("Button"), FAMILY_CTRLS ); +IMPLEMENT_WIDGETS_PAGE(ButtonWidgetsPage, "Button", FAMILY_CTRLS ); ButtonWidgetsPage::ButtonWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist) @@ -236,21 +236,21 @@ void ButtonWidgetsPage::CreateContent() wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL); // left pane - wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style")); + wxStaticBox *box = new wxStaticBox(this, wxID_ANY, "&Set style"); wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL); m_chkBitmapOnly = CreateCheckBoxAndAddToSizer(sizerLeft, "&Bitmap only"); m_chkTextAndBitmap = CreateCheckBoxAndAddToSizer(sizerLeft, "Text &and bitmap"); - m_chkFit = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Fit exactly")); - m_chkAuthNeeded = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("Require a&uth")); + m_chkFit = CreateCheckBoxAndAddToSizer(sizerLeft, "&Fit exactly"); + m_chkAuthNeeded = CreateCheckBoxAndAddToSizer(sizerLeft, "Require a&uth"); #if wxUSE_COMMANDLINKBUTTON - m_chkCommandLink = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("Use command &link button")); + m_chkCommandLink = CreateCheckBoxAndAddToSizer(sizerLeft, "Use command &link button"); #endif #if wxUSE_MARKUP m_chkUseMarkup = CreateCheckBoxAndAddToSizer(sizerLeft, "Interpret &markup"); #endif // wxUSE_MARKUP - m_chkDefault = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Default")); + m_chkDefault = CreateCheckBoxAndAddToSizer(sizerLeft, "&Default"); m_chkUseBitmapClass = CreateCheckBoxAndAddToSizer(sizerLeft, "Use wxBitmapButton"); @@ -286,22 +286,22 @@ void ButtonWidgetsPage::CreateContent() // should be in sync with enums Button[HV]Align! static const wxString halign[] = { - wxT("left"), - wxT("centre"), - wxT("right"), + "left", + "centre", + "right", }; static const wxString valign[] = { - wxT("top"), - wxT("centre"), - wxT("bottom"), + "top", + "centre", + "bottom", }; - m_radioHAlign = new wxRadioBox(this, wxID_ANY, wxT("&Horz alignment"), + m_radioHAlign = new wxRadioBox(this, wxID_ANY, "&Horz alignment", wxDefaultPosition, wxDefaultSize, WXSIZEOF(halign), halign); - m_radioVAlign = new wxRadioBox(this, wxID_ANY, wxT("&Vert alignment"), + m_radioVAlign = new wxRadioBox(this, wxID_ANY, "&Vert alignment", wxDefaultPosition, wxDefaultSize, WXSIZEOF(valign), valign); @@ -310,26 +310,26 @@ void ButtonWidgetsPage::CreateContent() sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer - wxButton *btn = new wxButton(this, ButtonPage_Reset, wxT("&Reset")); + wxButton *btn = new wxButton(this, ButtonPage_Reset, "&Reset"); sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // middle pane - wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, wxT("&Operations")); + wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, "&Operations"); wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL); wxSizer *sizerRow = CreateSizerWithTextAndButton(ButtonPage_ChangeLabel, - wxT("Change label"), + "Change label", wxID_ANY, &m_textLabel); - m_textLabel->SetValue(wxT("&Press me!")); + m_textLabel->SetValue("&Press me!"); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); #if wxUSE_COMMANDLINKBUTTON m_sizerNote = CreateSizerWithTextAndButton(ButtonPage_ChangeNote, - wxT("Change note"), + "Change note", wxID_ANY, &m_textNote); - m_textNote->SetValue(wxT("Writes down button clicks in the log.")); + m_textNote->SetValue("Writes down button clicks in the log."); sizerMiddle->Add(m_sizerNote, 0, wxALL | wxGROW, 5); #endif @@ -415,7 +415,7 @@ void ButtonWidgetsPage::CreateButton() break; default: - wxFAIL_MSG(wxT("unexpected radiobox selection")); + wxFAIL_MSG("unexpected radiobox selection"); // fall through case ButtonHAlign_Centre: @@ -433,7 +433,7 @@ void ButtonWidgetsPage::CreateButton() break; default: - wxFAIL_MSG(wxT("unexpected radiobox selection")); + wxFAIL_MSG("unexpected radiobox selection"); // fall through case ButtonVAlign_Centre: @@ -456,22 +456,22 @@ void ButtonWidgetsPage::CreateButton() if ( m_chkUseBitmapClass->GetValue() ) { bbtn = new wxBitmapButton(this, ButtonPage_Button, - CreateBitmap(wxT("normal")), + CreateBitmap("normal"), wxDefaultPosition, wxDefaultSize, flags); } else { bbtn = new wxButton(this, ButtonPage_Button); - bbtn->SetBitmapLabel(CreateBitmap(wxT("normal"))); + bbtn->SetBitmapLabel(CreateBitmap("normal")); } if ( m_chkUsePressed->GetValue() ) - bbtn->SetBitmapPressed(CreateBitmap(wxT("pushed"))); + bbtn->SetBitmapPressed(CreateBitmap("pushed")); if ( m_chkUseFocused->GetValue() ) - bbtn->SetBitmapFocus(CreateBitmap(wxT("focused"))); + bbtn->SetBitmapFocus(CreateBitmap("focused")); if ( m_chkUseCurrent->GetValue() ) - bbtn->SetBitmapCurrent(CreateBitmap(wxT("hover"))); + bbtn->SetBitmapCurrent(CreateBitmap("hover")); if ( m_chkUseDisabled->GetValue() ) - bbtn->SetBitmapDisabled(CreateBitmap(wxT("disabled"))); + bbtn->SetBitmapDisabled(CreateBitmap("disabled")); m_button = bbtn; #if wxUSE_COMMANDLINKBUTTON m_cmdLnkButton = NULL; @@ -611,7 +611,7 @@ void ButtonWidgetsPage::OnButtonChangeNote(wxCommandEvent& WXUNUSED(event)) void ButtonWidgetsPage::OnButton(wxCommandEvent& WXUNUSED(event)) { - wxLogMessage(wxT("Test button clicked.")); + wxLogMessage("Test button clicked."); } // ---------------------------------------------------------------------------- @@ -626,8 +626,8 @@ wxBitmap ButtonWidgetsPage::CreateBitmap(const wxString& label) dc.SetBackground(*wxCYAN_BRUSH); dc.Clear(); dc.SetTextForeground(*wxBLACK); - dc.DrawLabel(wxStripMenuCodes(m_textLabel->GetValue()) + wxT("\n") - wxT("(") + label + wxT(" state)"), + dc.DrawLabel(wxStripMenuCodes(m_textLabel->GetValue()) + "\n" + "(" + label + " state)", wxArtProvider::GetBitmap(wxART_INFORMATION), wxRect(10, 10, bmp.GetWidth() - 20, bmp.GetHeight() - 20), wxALIGN_CENTRE); diff --git a/samples/widgets/checkbox.cpp b/samples/widgets/checkbox.cpp index 09b21b6238..09893f3029 100644 --- a/samples/widgets/checkbox.cpp +++ b/samples/widgets/checkbox.cpp @@ -155,7 +155,7 @@ wxEND_EVENT_TABLE() #define FAMILY_CTRLS NATIVE_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(CheckBoxWidgetsPage, wxT("CheckBox"), FAMILY_CTRLS ); +IMPLEMENT_WIDGETS_PAGE(CheckBoxWidgetsPage, "CheckBox", FAMILY_CTRLS ); CheckBoxWidgetsPage::CheckBoxWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist) @@ -168,14 +168,14 @@ void CheckBoxWidgetsPage::CreateContent() wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL); // left pane - wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style")); + wxStaticBox *box = new wxStaticBox(this, wxID_ANY, "&Set style"); wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL); m_chkRight = CreateCheckBoxAndAddToSizer ( sizerLeft, - wxT("&Right aligned"), + "&Right aligned", CheckboxPage_ChkRight ); @@ -183,39 +183,39 @@ void CheckBoxWidgetsPage::CreateContent() static const wxString kinds[] = { - wxT("usual &2-state checkbox"), - wxT("&3rd state settable by program"), - wxT("&user-settable 3rd state"), + "usual &2-state checkbox", + "&3rd state settable by program", + "&user-settable 3rd state", }; - m_radioKind = new wxRadioBox(this, wxID_ANY, wxT("&Kind"), + m_radioKind = new wxRadioBox(this, wxID_ANY, "&Kind", wxDefaultPosition, wxDefaultSize, WXSIZEOF(kinds), kinds, 1); sizerLeft->Add(m_radioKind, 0, wxGROW | wxALL, 5); - wxButton *btn = new wxButton(this, CheckboxPage_Reset, wxT("&Reset")); + wxButton *btn = new wxButton(this, CheckboxPage_Reset, "&Reset"); sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // middle pane - wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, wxT("&Operations")); + wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, "&Operations"); wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL); sizerMiddle->Add(CreateSizerWithTextAndButton(CheckboxPage_ChangeLabel, - wxT("Change label"), + "Change label", wxID_ANY, &m_textLabel), 0, wxALL | wxGROW, 5); - sizerMiddle->Add(new wxButton(this, CheckboxPage_Check, wxT("&Check it")), + sizerMiddle->Add(new wxButton(this, CheckboxPage_Check, "&Check it"), 0, wxALL | wxGROW, 5); - sizerMiddle->Add(new wxButton(this, CheckboxPage_Uncheck, wxT("&Uncheck it")), + sizerMiddle->Add(new wxButton(this, CheckboxPage_Uncheck, "&Uncheck it"), 0, wxALL | wxGROW, 5); sizerMiddle->Add(new wxButton(this, CheckboxPage_PartCheck, - wxT("Put in &3rd state")), + "Put in &3rd state"), 0, wxALL | wxGROW, 5); // right pane wxSizer *sizerRight = new wxBoxSizer(wxHORIZONTAL); - m_checkbox = new wxCheckBox(this, CheckboxPage_Checkbox, wxT("&Check me!")); + m_checkbox = new wxCheckBox(this, CheckboxPage_Checkbox, "&Check me!"); sizerRight->Add(0, 0, 1, wxCENTRE); sizerRight->Add(m_checkbox, 1, wxCENTRE); sizerRight->Add(0, 0, 1, wxCENTRE); @@ -258,7 +258,7 @@ void CheckBoxWidgetsPage::CreateCheckbox() switch ( m_radioKind->GetSelection() ) { default: - wxFAIL_MSG(wxT("unexpected radiobox selection")); + wxFAIL_MSG("unexpected radiobox selection"); // fall through case CheckboxKind_2State: @@ -307,8 +307,8 @@ void CheckBoxWidgetsPage::OnButtonChangeLabel(wxCommandEvent& WXUNUSED(event)) void CheckBoxWidgetsPage::OnCheckBox(wxCommandEvent& event) { - wxLogMessage(wxT("Test checkbox %schecked (value = %d)."), - event.IsChecked() ? wxT("") : wxT("un"), + wxLogMessage("Test checkbox %schecked (value = %d).", + event.IsChecked() ? "" : "un", (int)m_checkbox->Get3StateValue()); } diff --git a/samples/widgets/choice.cpp b/samples/widgets/choice.cpp index 32153588fd..04005a1749 100644 --- a/samples/widgets/choice.cpp +++ b/samples/widgets/choice.cpp @@ -178,7 +178,7 @@ wxEND_EVENT_TABLE() #define FAMILY_CTRLS NATIVE_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(ChoiceWidgetsPage, wxT("Choice"), +IMPLEMENT_WIDGETS_PAGE(ChoiceWidgetsPage, "Choice", FAMILY_CTRLS | WITH_ITEMS_CTRLS ); @@ -207,53 +207,53 @@ void ChoiceWidgetsPage::CreateContent() // left pane wxStaticBox *box = new wxStaticBox(this, wxID_ANY, - wxT("&Set choice parameters")); + "&Set choice parameters"); wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL); - m_chkSort = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Sort items")); + m_chkSort = CreateCheckBoxAndAddToSizer(sizerLeft, "&Sort items"); - wxButton *btn = new wxButton(this, ChoicePage_Reset, wxT("&Reset")); + wxButton *btn = new wxButton(this, ChoicePage_Reset, "&Reset"); sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // middle pane wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, - wxT("&Change choice contents")); + "&Change choice contents"); wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL); wxSizer *sizerRow = new wxBoxSizer(wxHORIZONTAL); - btn = new wxButton(this, ChoicePage_Add, wxT("&Add this string")); - m_textAdd = new wxTextCtrl(this, ChoicePage_AddText, wxT("test item 0")); + btn = new wxButton(this, ChoicePage_Add, "&Add this string"); + m_textAdd = new wxTextCtrl(this, ChoicePage_AddText, "test item 0"); sizerRow->Add(btn, 0, wxRIGHT, 5); sizerRow->Add(m_textAdd, 1, wxLEFT, 5); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ChoicePage_AddSeveral, wxT("&Insert a few strings")); + btn = new wxButton(this, ChoicePage_AddSeveral, "&Insert a few strings"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ChoicePage_AddMany, wxT("Add &many strings")); + btn = new wxButton(this, ChoicePage_AddMany, "Add &many strings"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); sizerRow = new wxBoxSizer(wxHORIZONTAL); - btn = new wxButton(this, ChoicePage_Change, wxT("C&hange current")); + btn = new wxButton(this, ChoicePage_Change, "C&hange current"); m_textChange = new wxTextCtrl(this, ChoicePage_ChangeText, wxEmptyString); sizerRow->Add(btn, 0, wxRIGHT, 5); sizerRow->Add(m_textChange, 1, wxLEFT, 5); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = new wxBoxSizer(wxHORIZONTAL); - btn = new wxButton(this, ChoicePage_Delete, wxT("&Delete this item")); + btn = new wxButton(this, ChoicePage_Delete, "&Delete this item"); m_textDelete = new wxTextCtrl(this, ChoicePage_DeleteText, wxEmptyString); sizerRow->Add(btn, 0, wxRIGHT, 5); sizerRow->Add(m_textDelete, 1, wxLEFT, 5); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ChoicePage_DeleteSel, wxT("Delete &selection")); + btn = new wxButton(this, ChoicePage_DeleteSel, "Delete &selection"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ChoicePage_Clear, wxT("&Clear")); + btn = new wxButton(this, ChoicePage_Clear, "&Clear"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ChoicePage_ContainerTests, wxT("Run &tests")); + btn = new wxButton(this, ChoicePage_ContainerTests, "Run &tests"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); // right pane @@ -367,7 +367,7 @@ void ChoiceWidgetsPage::OnButtonAdd(wxCommandEvent& WXUNUSED(event)) if ( !m_textAdd->IsModified() ) { // update the default string - m_textAdd->SetValue(wxString::Format(wxT("test item %u"), ++s_item)); + m_textAdd->SetValue(wxString::Format("test item %u", ++s_item)); } m_choice->Append(s); @@ -379,7 +379,7 @@ void ChoiceWidgetsPage::OnButtonAddMany(wxCommandEvent& WXUNUSED(event)) wxArrayString strings; for ( unsigned int n = 0; n < 1000; n++ ) { - strings.Add(wxString::Format(wxT("item #%u"), n)); + strings.Add(wxString::Format("item #%u", n)); } m_choice->Append(strings); } @@ -387,9 +387,9 @@ void ChoiceWidgetsPage::OnButtonAddMany(wxCommandEvent& WXUNUSED(event)) void ChoiceWidgetsPage::OnButtonAddSeveral(wxCommandEvent& WXUNUSED(event)) { wxArrayString items; - items.Add(wxT("First")); - items.Add(wxT("another one")); - items.Add(wxT("and the last (very very very very very very very very very very long) one")); + items.Add("First"); + items.Add("another one"); + items.Add("and the last (very very very very very very very very very very long) one"); m_choice->Insert(items, 0); } @@ -424,9 +424,9 @@ void ChoiceWidgetsPage::OnUpdateUIAddSeveral(wxUpdateUIEvent& event) void ChoiceWidgetsPage::OnChoice(wxCommandEvent& event) { long sel = event.GetSelection(); - m_textDelete->SetValue(wxString::Format(wxT("%ld"), sel)); + m_textDelete->SetValue(wxString::Format("%ld", sel)); - wxLogMessage(wxT("Choice item %ld selected"), sel); + wxLogMessage("Choice item %ld selected", sel); } void ChoiceWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event)) diff --git a/samples/widgets/clrpicker.cpp b/samples/widgets/clrpicker.cpp index 1c428a0db4..5f166ee61e 100644 --- a/samples/widgets/clrpicker.cpp +++ b/samples/widgets/clrpicker.cpp @@ -125,7 +125,7 @@ wxEND_EVENT_TABLE() #define FAMILY_CTRLS GENERIC_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(ColourPickerWidgetsPage, wxT("ColourPicker"), +IMPLEMENT_WIDGETS_PAGE(ColourPickerWidgetsPage, "ColourPicker", PICKER_CTRLS | FAMILY_CTRLS); ColourPickerWidgetsPage::ColourPickerWidgetsPage(WidgetsBookCtrl *book, @@ -139,13 +139,13 @@ void ColourPickerWidgetsPage::CreateContent() // left pane wxSizer *boxleft = new wxBoxSizer(wxVERTICAL); - wxStaticBoxSizer *clrbox = new wxStaticBoxSizer(wxVERTICAL, this, wxT("&ColourPicker style")); - m_chkColourTextCtrl = CreateCheckBoxAndAddToSizer(clrbox, wxT("With textctrl")); - m_chkColourShowLabel = CreateCheckBoxAndAddToSizer(clrbox, wxT("With label")); - m_chkColourShowAlpha = CreateCheckBoxAndAddToSizer(clrbox, wxT("With opacity")); + wxStaticBoxSizer *clrbox = new wxStaticBoxSizer(wxVERTICAL, this, "&ColourPicker style"); + m_chkColourTextCtrl = CreateCheckBoxAndAddToSizer(clrbox, "With textctrl"); + m_chkColourShowLabel = CreateCheckBoxAndAddToSizer(clrbox, "With label"); + m_chkColourShowAlpha = CreateCheckBoxAndAddToSizer(clrbox, "With opacity"); boxleft->Add(clrbox, 0, wxALL|wxGROW, 5); - boxleft->Add(new wxButton(this, PickerPage_Reset, wxT("&Reset")), + boxleft->Add(new wxButton(this, PickerPage_Reset, "&Reset"), 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); Reset(); // set checkboxes state @@ -217,8 +217,8 @@ void ColourPickerWidgetsPage::OnButtonReset(wxCommandEvent& WXUNUSED(event)) void ColourPickerWidgetsPage::OnColourChange(wxColourPickerEvent& event) { - wxLogMessage(wxT("The colour changed to '%s' !"), - event.GetColour().GetAsString(wxC2S_CSS_SYNTAX).c_str()); + wxLogMessage("The colour changed to '%s' !", + event.GetColour().GetAsString(wxC2S_CSS_SYNTAX)); } void ColourPickerWidgetsPage::OnCheckBox(wxCommandEvent &event) diff --git a/samples/widgets/combobox.cpp b/samples/widgets/combobox.cpp index e0f0312334..57c031802b 100644 --- a/samples/widgets/combobox.cpp +++ b/samples/widgets/combobox.cpp @@ -234,7 +234,7 @@ wxEND_EVENT_TABLE() #define FAMILY_CTRLS NATIVE_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(ComboboxWidgetsPage, wxT("Combobox"), +IMPLEMENT_WIDGETS_PAGE(ComboboxWidgetsPage, "Combobox", FAMILY_CTRLS | WITH_ITEMS_CTRLS | COMBO_CTRLS ); @@ -266,26 +266,26 @@ void ComboboxWidgetsPage::CreateContent() // should be in sync with ComboKind_XXX values static const wxString kinds[] = { - wxT("default"), - wxT("simple"), - wxT("drop down"), + "default", + "simple", + "drop down", }; - m_radioKind = new wxRadioBox(this, wxID_ANY, wxT("Combobox &kind:"), + m_radioKind = new wxRadioBox(this, wxID_ANY, "Combobox &kind:", wxDefaultPosition, wxDefaultSize, WXSIZEOF(kinds), kinds, 1, wxRA_SPECIFY_COLS); wxSizer *sizerLeftTop = new wxStaticBoxSizer(wxVERTICAL, this, "&Set style"); - m_chkSort = CreateCheckBoxAndAddToSizer(sizerLeftTop, wxT("&Sort items")); - m_chkReadonly = CreateCheckBoxAndAddToSizer(sizerLeftTop, wxT("&Read only")); - m_chkProcessEnter = CreateCheckBoxAndAddToSizer(sizerLeftTop, wxT("Process &Enter")); + m_chkSort = CreateCheckBoxAndAddToSizer(sizerLeftTop, "&Sort items"); + m_chkReadonly = CreateCheckBoxAndAddToSizer(sizerLeftTop, "&Read only"); + m_chkProcessEnter = CreateCheckBoxAndAddToSizer(sizerLeftTop, "Process &Enter"); sizerLeftTop->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer sizerLeftTop->Add(m_radioKind, 0, wxGROW | wxALL, 5); - wxButton *btn = new wxButton(this, ComboPage_Reset, wxT("&Reset")); + wxButton *btn = new wxButton(this, ComboPage_Reset, "&Reset"); sizerLeftTop->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // lower left pane @@ -303,20 +303,20 @@ void ComboboxWidgetsPage::CreateContent() // middle pane wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, - wxT("&Change combobox contents")); + "&Change combobox contents"); wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL); wxSizer *sizerRow; sizerRow = CreateSizerWithTextAndButton(ComboPage_SetCurrent, - wxT("Current &selection"), + "Current &selection", ComboPage_CurText, &m_textCur); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); wxTextCtrl *text; - sizerRow = CreateSizerWithTextAndLabel(wxT("Insertion Point"), + sizerRow = CreateSizerWithTextAndLabel("Insertion Point", ComboPage_InsertionPointText, &text); text->SetEditable(false); @@ -324,54 +324,54 @@ void ComboboxWidgetsPage::CreateContent() sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(ComboPage_Insert, - wxT("&Insert this string"), + "&Insert this string", ComboPage_InsertText, &m_textInsert); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(ComboPage_Add, - wxT("&Add this string"), + "&Add this string", ComboPage_AddText, &m_textAdd); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(ComboPage_SetFirst, - wxT("Change &1st string"), + "Change &1st string", ComboPage_SetFirstText, &m_textSetFirst); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ComboPage_AddSeveral, wxT("&Append a few strings")); + btn = new wxButton(this, ComboPage_AddSeveral, "&Append a few strings"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ComboPage_AddMany, wxT("Append &many strings")); + btn = new wxButton(this, ComboPage_AddMany, "Append &many strings"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(ComboPage_Change, - wxT("C&hange current"), + "C&hange current", ComboPage_ChangeText, &m_textChange); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(ComboPage_Delete, - wxT("&Delete this item"), + "&Delete this item", ComboPage_DeleteText, &m_textDelete); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ComboPage_DeleteSel, wxT("Delete &selection")); + btn = new wxButton(this, ComboPage_DeleteSel, "Delete &selection"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ComboPage_Clear, wxT("&Clear")); + btn = new wxButton(this, ComboPage_Clear, "&Clear"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(ComboPage_SetValue, - wxT("SetValue"), + "SetValue", ComboPage_SetValueText, &m_textSetValue); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ComboPage_ContainerTests, wxT("Run &tests")); + btn = new wxButton(this, ComboPage_ContainerTests, "Run &tests"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); @@ -430,7 +430,7 @@ void ComboboxWidgetsPage::CreateCombo() switch ( m_radioKind->GetSelection() ) { default: - wxFAIL_MSG( wxT("unknown combo kind") ); + wxFAIL_MSG( "unknown combo kind" ); // fall through case ComboKind_Default: @@ -533,7 +533,7 @@ void ComboboxWidgetsPage::OnButtonInsert(wxCommandEvent& WXUNUSED(event)) if ( !m_textInsert->IsModified() ) { // update the default string - m_textInsert->SetValue(wxString::Format(wxT("test item %u"), ++s_item)); + m_textInsert->SetValue(wxString::Format("test item %u", ++s_item)); } if (m_combobox->GetSelection() >= 0) @@ -548,7 +548,7 @@ void ComboboxWidgetsPage::OnButtonAdd(wxCommandEvent& WXUNUSED(event)) if ( !m_textAdd->IsModified() ) { // update the default string - m_textAdd->SetValue(wxString::Format(wxT("test item %u"), ++s_item)); + m_textAdd->SetValue(wxString::Format("test item %u", ++s_item)); } m_combobox->Append(s); @@ -570,7 +570,7 @@ void ComboboxWidgetsPage::OnButtonAddMany(wxCommandEvent& WXUNUSED(event)) // "many" means 1000 here for ( unsigned int n = 0; n < 1000; n++ ) { - m_combobox->Append(wxString::Format(wxT("item #%u"), n)); + m_combobox->Append(wxString::Format("item #%u", n)); } } @@ -585,15 +585,15 @@ void ComboboxWidgetsPage::OnButtonSetCurrent(wxCommandEvent& WXUNUSED(event)) void ComboboxWidgetsPage::OnButtonAddSeveral(wxCommandEvent& WXUNUSED(event)) { - m_combobox->Append(wxT("First")); - m_combobox->Append(wxT("another one")); - m_combobox->Append(wxT("and the last (very very very very very very very very very very long) one")); + m_combobox->Append("First"); + m_combobox->Append("another one"); + m_combobox->Append("and the last (very very very very very very very very very very long) one"); } void ComboboxWidgetsPage::OnUpdateUIInsertionPointText(wxUpdateUIEvent& event) { if (m_combobox) - event.SetText( wxString::Format(wxT("%ld"), m_combobox->GetInsertionPoint()) ); + event.SetText( wxString::Format("%ld", m_combobox->GetInsertionPoint()) ); } void ComboboxWidgetsPage::OnUpdateUIResetButton(wxUpdateUIEvent& event) @@ -658,15 +658,15 @@ void ComboboxWidgetsPage::OnComboText(wxCommandEvent& event) wxString s = event.GetString(); wxASSERT_MSG( s == m_combobox->GetValue(), - wxT("event and combobox values should be the same") ); + "event and combobox values should be the same" ); if (event.GetEventType() == wxEVT_TEXT_ENTER) { - wxLogMessage(wxT("Combobox enter pressed (now '%s')"), s.c_str()); + wxLogMessage("Combobox enter pressed (now '%s')", s); } else { - wxLogMessage(wxT("Combobox text changed (now '%s')"), s.c_str()); + wxLogMessage("Combobox text changed (now '%s')", s); } } @@ -679,13 +679,13 @@ void ComboboxWidgetsPage::OnComboTextPasted(wxClipboardTextEvent& event) void ComboboxWidgetsPage::OnComboBox(wxCommandEvent& event) { long sel = event.GetInt(); - const wxString selstr = wxString::Format(wxT("%ld"), sel); + const wxString selstr = wxString::Format("%ld", sel); m_textDelete->SetValue(selstr); m_textCur->SetValue(selstr); - wxLogMessage(wxT("Combobox item %ld selected"), sel); + wxLogMessage("Combobox item %ld selected", sel); - wxLogMessage(wxT("Combobox GetValue(): %s"), m_combobox->GetValue().c_str() ); + wxLogMessage("Combobox GetValue(): %s", m_combobox->GetValue() ); if ( event.GetString() != m_combobox->GetValue() ) { @@ -701,12 +701,12 @@ void ComboboxWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event)) void ComboboxWidgetsPage::OnDropdown(wxCommandEvent& WXUNUSED(event)) { - wxLogMessage(wxT("Combobox dropped down")); + wxLogMessage("Combobox dropped down"); } void ComboboxWidgetsPage::OnCloseup(wxCommandEvent& WXUNUSED(event)) { - wxLogMessage(wxT("Combobox closed up")); + wxLogMessage("Combobox closed up"); } void ComboboxWidgetsPage::OnPopup(wxCommandEvent &WXUNUSED(event)) diff --git a/samples/widgets/datepick.cpp b/samples/widgets/datepick.cpp index 88dd3c8bea..9815f40919 100644 --- a/samples/widgets/datepick.cpp +++ b/samples/widgets/datepick.cpp @@ -134,7 +134,7 @@ wxEND_EVENT_TABLE() #define FAMILY_CTRLS GENERIC_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(DatePickerWidgetsPage, wxT("DatePicker"), +IMPLEMENT_WIDGETS_PAGE(DatePickerWidgetsPage, "DatePicker", FAMILY_CTRLS | PICKER_CTRLS ); diff --git a/samples/widgets/dirctrl.cpp b/samples/widgets/dirctrl.cpp index 5944a62ff0..7a2c60f717 100644 --- a/samples/widgets/dirctrl.cpp +++ b/samples/widgets/dirctrl.cpp @@ -61,16 +61,16 @@ enum static const wxString stdPaths[] = { - wxT("&none"), - wxT("&config"), - wxT("&data"), - wxT("&documents"), - wxT("&local data"), - wxT("&plugins"), - wxT("&resources"), - wxT("&user config"), - wxT("&user data"), - wxT("&user local data") + "&none", + "&config", + "&data", + "&documents", + "&local data", + "&plugins", + "&resources", + "&user config", + "&user data", + "&user local data" }; enum @@ -164,7 +164,7 @@ wxEND_EVENT_TABLE() // implementation // ============================================================================ -IMPLEMENT_WIDGETS_PAGE(DirCtrlWidgetsPage, wxT("DirCtrl"), +IMPLEMENT_WIDGETS_PAGE(DirCtrlWidgetsPage, "DirCtrl", GENERIC_CTRLS ); @@ -180,39 +180,39 @@ void DirCtrlWidgetsPage::CreateContent() wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL); // left pane - wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("Dir control details")); + wxStaticBox *box = new wxStaticBox(this, wxID_ANY, "Dir control details"); wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL); - sizerLeft->Add( CreateSizerWithTextAndButton( DirCtrlPage_SetPath , wxT("Set &path"), wxID_ANY, &m_path ), + sizerLeft->Add( CreateSizerWithTextAndButton( DirCtrlPage_SetPath , "Set &path", wxID_ANY, &m_path ), 0, wxALL | wxALIGN_RIGHT , 5 ); wxSizer *sizerUseFlags = - new wxStaticBoxSizer(wxVERTICAL, this, wxT("&Flags")); - m_chkDirOnly = CreateCheckBoxAndAddToSizer(sizerUseFlags, wxT("wxDIRCTRL_DIR_ONLY")); - m_chk3D = CreateCheckBoxAndAddToSizer(sizerUseFlags, wxT("wxDIRCTRL_3D_INTERNAL")); - m_chkFirst = CreateCheckBoxAndAddToSizer(sizerUseFlags, wxT("wxDIRCTRL_SELECT_FIRST")); - m_chkFilters = CreateCheckBoxAndAddToSizer(sizerUseFlags, wxT("wxDIRCTRL_SHOW_FILTERS")); - m_chkLabels = CreateCheckBoxAndAddToSizer(sizerUseFlags, wxT("wxDIRCTRL_EDIT_LABELS")); - m_chkMulti = CreateCheckBoxAndAddToSizer(sizerUseFlags, wxT("wxDIRCTRL_MULTIPLE")); + new wxStaticBoxSizer(wxVERTICAL, this, "&Flags"); + m_chkDirOnly = CreateCheckBoxAndAddToSizer(sizerUseFlags, "wxDIRCTRL_DIR_ONLY"); + m_chk3D = CreateCheckBoxAndAddToSizer(sizerUseFlags, "wxDIRCTRL_3D_INTERNAL"); + m_chkFirst = CreateCheckBoxAndAddToSizer(sizerUseFlags, "wxDIRCTRL_SELECT_FIRST"); + m_chkFilters = CreateCheckBoxAndAddToSizer(sizerUseFlags, "wxDIRCTRL_SHOW_FILTERS"); + m_chkLabels = CreateCheckBoxAndAddToSizer(sizerUseFlags, "wxDIRCTRL_EDIT_LABELS"); + m_chkMulti = CreateCheckBoxAndAddToSizer(sizerUseFlags, "wxDIRCTRL_MULTIPLE"); sizerLeft->Add(sizerUseFlags, wxSizerFlags().Expand().Border()); wxSizer *sizerFilters = - new wxStaticBoxSizer(wxVERTICAL, this, wxT("&Filters")); - m_fltr[0] = CreateCheckBoxAndAddToSizer(sizerFilters, wxString::Format(wxT("all files (%s)|%s"), + new wxStaticBoxSizer(wxVERTICAL, this, "&Filters"); + m_fltr[0] = CreateCheckBoxAndAddToSizer(sizerFilters, wxString::Format("all files (%s)|%s", wxFileSelectorDefaultWildcardStr, wxFileSelectorDefaultWildcardStr)); - m_fltr[1] = CreateCheckBoxAndAddToSizer(sizerFilters, wxT("C++ files (*.cpp; *.h)|*.cpp;*.h")); - m_fltr[2] = CreateCheckBoxAndAddToSizer(sizerFilters, wxT("PNG images (*.png)|*.png")); + m_fltr[1] = CreateCheckBoxAndAddToSizer(sizerFilters, "C++ files (*.cpp; *.h)|*.cpp;*.h"); + m_fltr[2] = CreateCheckBoxAndAddToSizer(sizerFilters, "PNG images (*.png)|*.png"); sizerLeft->Add(sizerFilters, wxSizerFlags().Expand().Border()); - wxButton *btn = new wxButton(this, DirCtrlPage_Reset, wxT("&Reset")); + wxButton *btn = new wxButton(this, DirCtrlPage_Reset, "&Reset"); sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // keep consistency between enum and labels of radiobox wxCOMPILE_TIME_ASSERT( stdPathMax == WXSIZEOF(stdPaths), EnumForRadioBoxMismatch); // middle pane - m_radioStdPath = new wxRadioBox(this, wxID_ANY, wxT("Standard path"), + m_radioStdPath = new wxRadioBox(this, wxID_ANY, "Standard path", wxDefaultPosition, wxDefaultSize, WXSIZEOF(stdPaths), stdPaths, 1); @@ -275,7 +275,7 @@ void DirCtrlWidgetsPage::CreateDirCtrl() if (m_fltr[i]->IsChecked()) { if (!filter.IsEmpty()) - filter += wxT("|"); + filter += "|"; filter += m_fltr[i]->GetLabel(); } } @@ -317,7 +317,7 @@ void DirCtrlWidgetsPage::OnRadioBox(wxCommandEvent& WXUNUSED(event)) { wxString path; - wxTheApp->SetAppName(wxT("widgets")); + wxTheApp->SetAppName("widgets"); wxStandardPathsBase& stdp = wxStandardPaths::Get(); switch ( m_radioStdPath->GetSelection() ) diff --git a/samples/widgets/dirpicker.cpp b/samples/widgets/dirpicker.cpp index 003f3b51ad..b6308b3595 100644 --- a/samples/widgets/dirpicker.cpp +++ b/samples/widgets/dirpicker.cpp @@ -133,7 +133,7 @@ wxEND_EVENT_TABLE() #define FAMILY_CTRLS GENERIC_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(DirPickerWidgetsPage, wxT("DirPicker"), +IMPLEMENT_WIDGETS_PAGE(DirPickerWidgetsPage, "DirPicker", PICKER_CTRLS | FAMILY_CTRLS); DirPickerWidgetsPage::DirPickerWidgetsPage(WidgetsBookCtrl *book, @@ -147,10 +147,10 @@ void DirPickerWidgetsPage::CreateContent() // left pane wxSizer *boxleft = new wxBoxSizer(wxVERTICAL); - wxStaticBoxSizer *dirbox = new wxStaticBoxSizer(wxVERTICAL, this, wxT("&DirPicker style")); - m_chkDirTextCtrl = CreateCheckBoxAndAddToSizer(dirbox, wxT("With textctrl")); - m_chkDirMustExist = CreateCheckBoxAndAddToSizer(dirbox, wxT("Dir must exist")); - m_chkDirChangeDir = CreateCheckBoxAndAddToSizer(dirbox, wxT("Change working dir")); + wxStaticBoxSizer *dirbox = new wxStaticBoxSizer(wxVERTICAL, this, "&DirPicker style"); + m_chkDirTextCtrl = CreateCheckBoxAndAddToSizer(dirbox, "With textctrl"); + m_chkDirMustExist = CreateCheckBoxAndAddToSizer(dirbox, "Dir must exist"); + m_chkDirChangeDir = CreateCheckBoxAndAddToSizer(dirbox, "Change working dir"); m_chkSmall = CreateCheckBoxAndAddToSizer(dirbox, "&Small version"); boxleft->Add(dirbox, 0, wxALL|wxGROW, 5); @@ -164,7 +164,7 @@ void DirPickerWidgetsPage::CreateContent() boxleft->AddSpacer(10); - boxleft->Add(new wxButton(this, PickerPage_Reset, wxT("&Reset")), + boxleft->Add(new wxButton(this, PickerPage_Reset, "&Reset"), 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); Reset(); // set checkboxes state @@ -206,7 +206,7 @@ void DirPickerWidgetsPage::CreatePicker() style |= wxDIRP_SMALL; m_dirPicker = new wxDirPickerCtrl(this, PickerPage_Dir, - wxGetHomeDir(), wxT("Hello!"), + wxGetHomeDir(), "Hello!", wxDefaultPosition, wxDefaultSize, style); } @@ -246,8 +246,8 @@ void DirPickerWidgetsPage::OnButtonReset(wxCommandEvent& WXUNUSED(event)) void DirPickerWidgetsPage::OnDirChange(wxFileDirPickerEvent& event) { - wxLogMessage(wxT("The directory changed to '%s' ! The current working directory is '%s'"), - event.GetPath().c_str(), wxGetCwd().c_str()); + wxLogMessage("The directory changed to '%s' ! The current working directory is '%s'", + event.GetPath(), wxGetCwd()); } void DirPickerWidgetsPage::OnCheckBox(wxCommandEvent &event) diff --git a/samples/widgets/editlbox.cpp b/samples/widgets/editlbox.cpp index 383fb981aa..bcd45d9eaf 100644 --- a/samples/widgets/editlbox.cpp +++ b/samples/widgets/editlbox.cpp @@ -115,7 +115,7 @@ wxEND_EVENT_TABLE() // implementation // ============================================================================ -IMPLEMENT_WIDGETS_PAGE(EditableListboxWidgetsPage, wxT("EditableListbox"), GENERIC_CTRLS); +IMPLEMENT_WIDGETS_PAGE(EditableListboxWidgetsPage, "EditableListbox", GENERIC_CTRLS); EditableListboxWidgetsPage::EditableListboxWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist) @@ -134,15 +134,15 @@ void EditableListboxWidgetsPage::CreateContent() // left pane wxStaticBox *box = new wxStaticBox(this, wxID_ANY, - wxT("&Set listbox parameters")); + "&Set listbox parameters"); wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL); - m_chkAllowNew = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("Allow new items")); - m_chkAllowEdit = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("Allow editing items")); - m_chkAllowDelete = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("Allow deleting items")); - m_chkAllowNoReorder = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("Block user reordering")); + m_chkAllowNew = CreateCheckBoxAndAddToSizer(sizerLeft, "Allow new items"); + m_chkAllowEdit = CreateCheckBoxAndAddToSizer(sizerLeft, "Allow editing items"); + m_chkAllowDelete = CreateCheckBoxAndAddToSizer(sizerLeft, "Allow deleting items"); + m_chkAllowNoReorder = CreateCheckBoxAndAddToSizer(sizerLeft, "Block user reordering"); - wxButton *btn = new wxButton(this, EditableListboxPage_Reset, wxT("&Reset")); + wxButton *btn = new wxButton(this, EditableListboxPage_Reset, "&Reset"); sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // right pane diff --git a/samples/widgets/filectrl.cpp b/samples/widgets/filectrl.cpp index 9790fd78dd..1ec56bd8ff 100644 --- a/samples/widgets/filectrl.cpp +++ b/samples/widgets/filectrl.cpp @@ -145,7 +145,7 @@ wxEND_EVENT_TABLE() #define FAMILY_CTRLS GENERIC_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE( FileCtrlWidgetsPage, wxT( "FileCtrl" ), +IMPLEMENT_WIDGETS_PAGE( FileCtrlWidgetsPage, "FileCtrl", FAMILY_CTRLS ); FileCtrlWidgetsPage::FileCtrlWidgetsPage( WidgetsBookCtrl *book, @@ -161,37 +161,37 @@ void FileCtrlWidgetsPage::CreateContent() // left pane wxSizer *sizerLeft = new wxBoxSizer( wxVERTICAL ); - static const wxString mode[] = { wxT( "open" ), wxT( "save" ) }; - m_radioFileCtrlMode = new wxRadioBox( this, wxID_ANY, wxT( "wxFileCtrl mode" ), + static const wxString mode[] = { "open", "save" }; + m_radioFileCtrlMode = new wxRadioBox( this, wxID_ANY, "wxFileCtrl mode", wxDefaultPosition, wxDefaultSize, WXSIZEOF( mode ), mode ); sizerLeft->Add( m_radioFileCtrlMode, 0, wxALL | wxEXPAND , 5 ); - sizerLeft->Add( CreateSizerWithTextAndButton( FileCtrlPage_SetDirectory , wxT( "Set &directory" ), wxID_ANY, &m_dir ), + sizerLeft->Add( CreateSizerWithTextAndButton( FileCtrlPage_SetDirectory , "Set &directory", wxID_ANY, &m_dir ), 0, wxALL | wxEXPAND , 5 ); - sizerLeft->Add( CreateSizerWithTextAndButton( FileCtrlPage_SetPath , wxT( "Set &path" ), wxID_ANY, &m_path ), + sizerLeft->Add( CreateSizerWithTextAndButton( FileCtrlPage_SetPath , "Set &path", wxID_ANY, &m_path ), 0, wxALL | wxEXPAND , 5 ); - sizerLeft->Add( CreateSizerWithTextAndButton( FileCtrlPage_SetFilename , wxT( "Set &filename" ), wxID_ANY, &m_filename ), + sizerLeft->Add( CreateSizerWithTextAndButton( FileCtrlPage_SetFilename , "Set &filename", wxID_ANY, &m_filename ), 0, wxALL | wxEXPAND , 5 ); wxSizer *sizerUseFlags = - new wxStaticBoxSizer( wxVERTICAL, this, wxT( "&Flags" ) ); + new wxStaticBoxSizer( wxVERTICAL, this, "&Flags"); - m_chkMultiple = CreateCheckBoxAndAddToSizer( sizerUseFlags, wxT( "wxFC_MULTIPLE" ) ); - m_chkNoShowHidden = CreateCheckBoxAndAddToSizer( sizerUseFlags, wxT( "wxFC_NOSHOWHIDDEN" ) ); + m_chkMultiple = CreateCheckBoxAndAddToSizer( sizerUseFlags, "wxFC_MULTIPLE"); + m_chkNoShowHidden = CreateCheckBoxAndAddToSizer( sizerUseFlags, "wxFC_NOSHOWHIDDEN"); sizerLeft->Add( sizerUseFlags, wxSizerFlags().Expand().Border() ); wxSizer *sizerFilters = - new wxStaticBoxSizer( wxVERTICAL, this, wxT( "&Filters" ) ); - m_fltr[0] = CreateCheckBoxAndAddToSizer( sizerFilters, wxString::Format( wxT( "all files (%s)|%s" ), + new wxStaticBoxSizer( wxVERTICAL, this, "&Filters"); + m_fltr[0] = CreateCheckBoxAndAddToSizer( sizerFilters, wxString::Format("all files (%s)|%s", wxFileSelectorDefaultWildcardStr, wxFileSelectorDefaultWildcardStr ) ); - m_fltr[1] = CreateCheckBoxAndAddToSizer( sizerFilters, wxT( "C++ files (*.cpp; *.h)|*.cpp;*.h" ) ); - m_fltr[2] = CreateCheckBoxAndAddToSizer( sizerFilters, wxT( "PNG images (*.png)|*.png" ) ); + m_fltr[1] = CreateCheckBoxAndAddToSizer( sizerFilters, "C++ files (*.cpp; *.h)|*.cpp;*.h" ); + m_fltr[2] = CreateCheckBoxAndAddToSizer( sizerFilters, "PNG images (*.png)|*.png"); sizerLeft->Add( sizerFilters, wxSizerFlags().Expand().Border() ); - wxButton *btn = new wxButton( this, FileCtrlPage_Reset, wxT( "&Reset" ) ); + wxButton *btn = new wxButton( this, FileCtrlPage_Reset, "&Reset" ); sizerLeft->Add( btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15 ); // right pane @@ -253,7 +253,7 @@ void FileCtrlWidgetsPage::CreateFileCtrl() if ( m_fltr[i]->IsChecked() ) { if ( !wildcard.IsEmpty() ) - wildcard += wxT( "|" ); + wildcard += "|"; wildcard += m_fltr[i]->GetLabel(); } } diff --git a/samples/widgets/filepicker.cpp b/samples/widgets/filepicker.cpp index 14236781ad..af80f6c2ee 100644 --- a/samples/widgets/filepicker.cpp +++ b/samples/widgets/filepicker.cpp @@ -150,7 +150,7 @@ wxEND_EVENT_TABLE() #define FAMILY_CTRLS GENERIC_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(FilePickerWidgetsPage, wxT("FilePicker"), +IMPLEMENT_WIDGETS_PAGE(FilePickerWidgetsPage, "FilePicker", PICKER_CTRLS | FAMILY_CTRLS); FilePickerWidgetsPage::FilePickerWidgetsPage(WidgetsBookCtrl *book, @@ -164,17 +164,17 @@ void FilePickerWidgetsPage::CreateContent() // left pane wxSizer *boxleft = new wxBoxSizer(wxVERTICAL); - static const wxString mode[] = { wxT("open"), wxT("save") }; - m_radioFilePickerMode = new wxRadioBox(this, wxID_ANY, wxT("wxFilePicker mode"), + static const wxString mode[] = { "open", "save" }; + m_radioFilePickerMode = new wxRadioBox(this, wxID_ANY, "wxFilePicker mode", wxDefaultPosition, wxDefaultSize, WXSIZEOF(mode), mode); boxleft->Add(m_radioFilePickerMode, 0, wxALL|wxGROW, 5); - wxStaticBoxSizer *filebox = new wxStaticBoxSizer(wxVERTICAL, this, wxT("&FilePicker style")); - m_chkFileTextCtrl = CreateCheckBoxAndAddToSizer(filebox, wxT("With textctrl")); - m_chkFileOverwritePrompt = CreateCheckBoxAndAddToSizer(filebox, wxT("Overwrite prompt")); - m_chkFileMustExist = CreateCheckBoxAndAddToSizer(filebox, wxT("File must exist")); - m_chkFileChangeDir = CreateCheckBoxAndAddToSizer(filebox, wxT("Change working dir")); + wxStaticBoxSizer *filebox = new wxStaticBoxSizer(wxVERTICAL, this, "&FilePicker style"); + m_chkFileTextCtrl = CreateCheckBoxAndAddToSizer(filebox, "With textctrl"); + m_chkFileOverwritePrompt = CreateCheckBoxAndAddToSizer(filebox, "Overwrite prompt"); + m_chkFileMustExist = CreateCheckBoxAndAddToSizer(filebox, "File must exist"); + m_chkFileChangeDir = CreateCheckBoxAndAddToSizer(filebox, "Change working dir"); m_chkSmall = CreateCheckBoxAndAddToSizer(filebox, "&Small version"); boxleft->Add(filebox, 0, wxALL|wxGROW, 5); @@ -189,7 +189,7 @@ void FilePickerWidgetsPage::CreateContent() boxleft->AddSpacer(10); - boxleft->Add(new wxButton(this, PickerPage_Reset, wxT("&Reset")), + boxleft->Add(new wxButton(this, PickerPage_Reset, "&Reset"), 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); Reset(); // set checkboxes state @@ -245,7 +245,7 @@ void FilePickerWidgetsPage::CreatePicker() // pass an empty string as initial file m_filePicker = new wxFilePickerCtrl(this, PickerPage_File, wxEmptyString, - wxT("Hello!"), wxT("*"), + "Hello!", "*", wxDefaultPosition, wxDefaultSize, style); } @@ -310,8 +310,8 @@ void FilePickerWidgetsPage::OnButtonReset(wxCommandEvent& WXUNUSED(event)) void FilePickerWidgetsPage::OnFileChange(wxFileDirPickerEvent& event) { - wxLogMessage(wxT("The file changed to '%s' ! The current working directory is '%s'"), - event.GetPath().c_str(), wxGetCwd().c_str()); + wxLogMessage("The file changed to '%s' ! The current working directory is '%s'", + event.GetPath(), wxGetCwd()); } void FilePickerWidgetsPage::OnCheckBox(wxCommandEvent &event) diff --git a/samples/widgets/fontpicker.cpp b/samples/widgets/fontpicker.cpp index d753592796..b9a717cf10 100644 --- a/samples/widgets/fontpicker.cpp +++ b/samples/widgets/fontpicker.cpp @@ -125,7 +125,7 @@ wxEND_EVENT_TABLE() #define FAMILY_CTRLS GENERIC_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(FontPickerWidgetsPage, wxT("FontPicker"), +IMPLEMENT_WIDGETS_PAGE(FontPickerWidgetsPage, "FontPicker", PICKER_CTRLS | FAMILY_CTRLS); FontPickerWidgetsPage::FontPickerWidgetsPage(WidgetsBookCtrl *book, @@ -139,13 +139,13 @@ void FontPickerWidgetsPage::CreateContent() // left pane wxSizer *boxleft = new wxBoxSizer(wxVERTICAL); - wxStaticBoxSizer *fontbox = new wxStaticBoxSizer(wxVERTICAL, this, wxT("&FontPicker style")); - m_chkFontTextCtrl = CreateCheckBoxAndAddToSizer(fontbox, wxT("With textctrl")); - m_chkFontDescAsLabel = CreateCheckBoxAndAddToSizer(fontbox, wxT("Font desc as btn label")); - m_chkFontUseFontForLabel = CreateCheckBoxAndAddToSizer(fontbox, wxT("Use font for label")); + wxStaticBoxSizer *fontbox = new wxStaticBoxSizer(wxVERTICAL, this, "&FontPicker style"); + m_chkFontTextCtrl = CreateCheckBoxAndAddToSizer(fontbox, "With textctrl"); + m_chkFontDescAsLabel = CreateCheckBoxAndAddToSizer(fontbox, "Font desc as btn label"); + m_chkFontUseFontForLabel = CreateCheckBoxAndAddToSizer(fontbox, "Use font for label"); boxleft->Add(fontbox, 0, wxALL|wxGROW, 5); - boxleft->Add(new wxButton(this, PickerPage_Reset, wxT("&Reset")), + boxleft->Add(new wxButton(this, PickerPage_Reset, "&Reset"), 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); Reset(); // set checkboxes state @@ -218,8 +218,8 @@ void FontPickerWidgetsPage::OnButtonReset(wxCommandEvent& WXUNUSED(event)) void FontPickerWidgetsPage::OnFontChange(wxFontPickerEvent& event) { - wxLogMessage(wxT("The font changed to '%s' with size %d !"), - event.GetFont().GetFaceName().c_str(), event.GetFont().GetPointSize()); + wxLogMessage("The font changed to '%s' with size %d !", + event.GetFont().GetFaceName(), event.GetFont().GetPointSize()); } void FontPickerWidgetsPage::OnCheckBox(wxCommandEvent &event) diff --git a/samples/widgets/gauge.cpp b/samples/widgets/gauge.cpp index 87ad1b547d..457fb4aa77 100644 --- a/samples/widgets/gauge.cpp +++ b/samples/widgets/gauge.cpp @@ -175,7 +175,7 @@ wxEND_EVENT_TABLE() #define FAMILY_CTRLS NATIVE_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(GaugeWidgetsPage, wxT("Gauge"), FAMILY_CTRLS ); +IMPLEMENT_WIDGETS_PAGE(GaugeWidgetsPage, "Gauge", FAMILY_CTRLS ); GaugeWidgetsPage::GaugeWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist) @@ -199,25 +199,25 @@ void GaugeWidgetsPage::CreateContent() wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL); // left pane - wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style")); + wxStaticBox *box = new wxStaticBox(this, wxID_ANY, "&Set style"); wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL); - m_chkVert = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Vertical")); - m_chkSmooth = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Smooth")); - m_chkProgress = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Progress")); + m_chkVert = CreateCheckBoxAndAddToSizer(sizerLeft, "&Vertical"); + m_chkSmooth = CreateCheckBoxAndAddToSizer(sizerLeft, "&Smooth"); + m_chkProgress = CreateCheckBoxAndAddToSizer(sizerLeft, "&Progress"); sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer - wxButton *btn = new wxButton(this, GaugePage_Reset, wxT("&Reset")); + wxButton *btn = new wxButton(this, GaugePage_Reset, "&Reset"); sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // middle pane - wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, wxT("&Change gauge value")); + wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, "&Change gauge value"); wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL); wxTextCtrl *text; - wxSizer *sizerRow = CreateSizerWithTextAndLabel(wxT("Current value"), + wxSizer *sizerRow = CreateSizerWithTextAndLabel("Current value", GaugePage_CurValueText, &text); text->SetEditable(false); @@ -225,26 +225,26 @@ void GaugeWidgetsPage::CreateContent() sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(GaugePage_SetValue, - wxT("Set &value"), + "Set &value", GaugePage_ValueText, &m_textValue); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(GaugePage_SetRange, - wxT("Set &range"), + "Set &range", GaugePage_RangeText, &m_textRange); - m_textRange->SetValue( wxString::Format(wxT("%lu"), m_range) ); + m_textRange->SetValue( wxString::Format("%lu", m_range) ); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, GaugePage_Progress, wxT("Simulate &progress")); + btn = new wxButton(this, GaugePage_Progress, "Simulate &progress"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); btn = new wxButton(this, GaugePage_IndeterminateProgress, - wxT("Simulate &indeterminate job")); + "Simulate &indeterminate job"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, GaugePage_Clear, wxT("&Clear")); + btn = new wxButton(this, GaugePage_Clear, "&Clear"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); // right pane @@ -322,13 +322,13 @@ void GaugeWidgetsPage::StartTimer(wxButton *clicked) { static const int INTERVAL = 300; - wxLogMessage(wxT("Launched progress timer (interval = %d ms)"), INTERVAL); + wxLogMessage("Launched progress timer (interval = %d ms)", INTERVAL); m_timer = new wxTimer(this, clicked->GetId() == GaugePage_Progress ? GaugePage_Timer : GaugePage_IndeterminateTimer); m_timer->Start(INTERVAL); - clicked->SetLabel(wxT("&Stop timer")); + clicked->SetLabel("&Stop timer"); if (clicked->GetId() == GaugePage_Progress) FindWindow(GaugePage_IndeterminateProgress)->Disable(); @@ -338,23 +338,23 @@ void GaugeWidgetsPage::StartTimer(wxButton *clicked) void GaugeWidgetsPage::StopTimer(wxButton *clicked) { - wxCHECK_RET( m_timer, wxT("shouldn't be called") ); + wxCHECK_RET( m_timer, "shouldn't be called" ); m_timer->Stop(); wxDELETE(m_timer); if (clicked->GetId() == GaugePage_Progress) { - clicked->SetLabel(wxT("Simulate &progress")); + clicked->SetLabel("Simulate &progress"); FindWindow(GaugePage_IndeterminateProgress)->Enable(); } else { - clicked->SetLabel(wxT("Simulate indeterminate job")); + clicked->SetLabel("Simulate indeterminate job"); FindWindow(GaugePage_Progress)->Enable(); } - wxLogMessage(wxT("Progress finished.")); + wxLogMessage("Progress finished."); } // ---------------------------------------------------------------------------- @@ -379,7 +379,7 @@ void GaugeWidgetsPage::OnButtonProgress(wxCommandEvent& event) { StopTimer(b); - wxLogMessage(wxT("Stopped the timer.")); + wxLogMessage("Stopped the timer."); } } @@ -396,7 +396,7 @@ void GaugeWidgetsPage::OnButtonIndeterminateProgress(wxCommandEvent& event) m_gauge->SetValue(0); - wxLogMessage(wxT("Stopped the timer.")); + wxLogMessage("Stopped the timer."); } } @@ -457,7 +457,7 @@ void GaugeWidgetsPage::OnProgressTimer(wxTimerEvent& WXUNUSED(event)) else // reached the end { wxButton *btn = (wxButton *)FindWindow(GaugePage_Progress); - wxCHECK_RET( btn, wxT("no progress button?") ); + wxCHECK_RET( btn, "no progress button?" ); StopTimer(btn); } @@ -470,7 +470,7 @@ void GaugeWidgetsPage::OnIndeterminateProgressTimer(wxTimerEvent& WXUNUSED(event void GaugeWidgetsPage::OnUpdateUICurValueText(wxUpdateUIEvent& event) { - event.SetText( wxString::Format(wxT("%d"), m_gauge->GetValue())); + event.SetText( wxString::Format("%d", m_gauge->GetValue())); } #endif diff --git a/samples/widgets/headerctrl.cpp b/samples/widgets/headerctrl.cpp index 92979e49a0..17c28de6e3 100644 --- a/samples/widgets/headerctrl.cpp +++ b/samples/widgets/headerctrl.cpp @@ -78,7 +78,7 @@ private: #endif IMPLEMENT_WIDGETS_PAGE(HeaderCtrlWidgetsPage, - wxT("Header"), HEADER_CTRL_FAMILY); + "Header", HEADER_CTRL_FAMILY); void HeaderCtrlWidgetsPage::CreateContent() { diff --git a/samples/widgets/hyperlnk.cpp b/samples/widgets/hyperlnk.cpp index d3d7baba44..fb110f5a71 100644 --- a/samples/widgets/hyperlnk.cpp +++ b/samples/widgets/hyperlnk.cpp @@ -142,7 +142,7 @@ wxEND_EVENT_TABLE() // implementation // ============================================================================ -IMPLEMENT_WIDGETS_PAGE(HyperlinkWidgetsPage, wxT("Hyperlink"), +IMPLEMENT_WIDGETS_PAGE(HyperlinkWidgetsPage, "Hyperlink", GENERIC_CTRLS ); @@ -157,33 +157,33 @@ void HyperlinkWidgetsPage::CreateContent() wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL); // left pane - wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("Hyperlink details")); + wxStaticBox *box = new wxStaticBox(this, wxID_ANY, "Hyperlink details"); wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL); - sizerLeft->Add( CreateSizerWithTextAndButton( HyperlinkPage_SetLabel , wxT("Set &Label"), wxID_ANY, &m_label ), + sizerLeft->Add( CreateSizerWithTextAndButton( HyperlinkPage_SetLabel , "Set &Label", wxID_ANY, &m_label ), 0, wxALL | wxALIGN_RIGHT , 5 ); - sizerLeft->Add( CreateSizerWithTextAndButton( HyperlinkPage_SetURL , wxT("Set &URL"), wxID_ANY, &m_url ), + sizerLeft->Add( CreateSizerWithTextAndButton( HyperlinkPage_SetURL , "Set &URL", wxID_ANY, &m_url ), 0, wxALL | wxALIGN_RIGHT , 5 ); static const wxString alignments[] = { - wxT("&left"), - wxT("¢re"), - wxT("&right") + "&left", + "¢re", + "&right" }; wxCOMPILE_TIME_ASSERT( WXSIZEOF(alignments) == Align_Max, AlignMismatch ); - m_radioAlignMode = new wxRadioBox(this, wxID_ANY, wxT("alignment"), + m_radioAlignMode = new wxRadioBox(this, wxID_ANY, "alignment", wxDefaultPosition, wxDefaultSize, WXSIZEOF(alignments), alignments); m_radioAlignMode->SetSelection(1); // start with "centre" selected since // wxHL_DEFAULT_STYLE contains wxHL_ALIGN_CENTRE sizerLeft->Add(m_radioAlignMode, 0, wxALL|wxGROW, 5); - m_checkGeneric = new wxCheckBox(this, wxID_ANY, wxT("Use generic version"), + m_checkGeneric = new wxCheckBox(this, wxID_ANY, "Use generic version", wxDefaultPosition, wxDefaultSize); sizerLeft->Add(m_checkGeneric, 0, wxALL|wxGROW, 5); @@ -191,24 +191,24 @@ void HyperlinkWidgetsPage::CreateContent() wxSizer *szHyperlinkLong = new wxBoxSizer(wxVERTICAL); wxSizer *szHyperlink = new wxBoxSizer(wxHORIZONTAL); - m_visit = new wxStaticText(this, wxID_ANY, wxT("Visit ")); + m_visit = new wxStaticText(this, wxID_ANY, "Visit "); if (m_checkGeneric->IsChecked()) { m_hyperlink = new wxGenericHyperlinkCtrl(this, HyperlinkPage_Ctrl, - wxT("wxWidgets website"), - wxT("www.wxwidgets.org")); + "wxWidgets website", + "www.wxwidgets.org"); } else { m_hyperlink = new wxHyperlinkCtrl(this, HyperlinkPage_Ctrl, - wxT("wxWidgets website"), - wxT("www.wxwidgets.org")); + "wxWidgets website", + "www.wxwidgets.org"); } - m_fun = new wxStaticText(this, wxID_ANY, wxT(" for fun!")); + m_fun = new wxStaticText(this, wxID_ANY, " for fun!"); szHyperlink->Add(0, 0, 1, wxCENTRE); szHyperlink->Add(m_visit, 0, wxCENTRE); @@ -221,15 +221,15 @@ void HyperlinkWidgetsPage::CreateContent() { m_hyperlinkLong = new wxGenericHyperlinkCtrl(this, wxID_ANY, - wxT("This is a long hyperlink"), - wxT("www.wxwidgets.org")); + "This is a long hyperlink", + "www.wxwidgets.org"); } else { m_hyperlinkLong = new wxHyperlinkCtrl(this, wxID_ANY, - wxT("This is a long hyperlink"), - wxT("www.wxwidgets.org")); + "This is a long hyperlink", + "www.wxwidgets.org"); } szHyperlinkLong->Add(0, 0, 1, wxCENTRE); @@ -307,8 +307,8 @@ void HyperlinkWidgetsPage::CreateHyperlinkLong(long align) { hyp = new wxGenericHyperlinkCtrl(this, wxID_ANY, - wxT("This is a long hyperlink"), - wxT("www.wxwidgets.org"), + "This is a long hyperlink", + "www.wxwidgets.org", wxDefaultPosition, wxDefaultSize, style); @@ -317,8 +317,8 @@ void HyperlinkWidgetsPage::CreateHyperlinkLong(long align) { hyp = new wxHyperlinkCtrl(this, wxID_ANY, - wxT("This is a long hyperlink"), - wxT("www.wxwidgets.org"), + "This is a long hyperlink", + "www.wxwidgets.org", wxDefaultPosition, wxDefaultSize, style); @@ -365,7 +365,7 @@ void HyperlinkWidgetsPage::OnAlignment(wxCommandEvent& WXUNUSED(event)) { default: case Align_Max: - wxFAIL_MSG( wxT("unknown alignment") ); + wxFAIL_MSG( "unknown alignment" ); // fall through case Align_Left: diff --git a/samples/widgets/itemcontainer.cpp b/samples/widgets/itemcontainer.cpp index bb081c8419..86b13f12c7 100644 --- a/samples/widgets/itemcontainer.cpp +++ b/samples/widgets/itemcontainer.cpp @@ -76,12 +76,12 @@ ItemContainerWidgetsPage::ItemContainerWidgetsPage(WidgetsBookCtrl *book, #endif // __WXMSW__ || __WXGTK__ , m_trackedDataObjects(0) { - m_items.Add(wxT("This")); - m_items.Add(wxT("is")); - m_items.Add(wxT("a")); - m_items.Add(wxT("List")); - m_items.Add(wxT("of")); - m_items.Add(wxT("strings")); + m_items.Add("This"); + m_items.Add("is"); + m_items.Add("a"); + m_items.Add("List"); + m_items.Add("of"); + m_items.Add("strings"); m_itemsSorted = m_items; } @@ -108,11 +108,11 @@ bool ItemContainerWidgetsPage::VerifyAllClientDataDestroyed() { if ( m_trackedDataObjects ) { - wxString message = wxT("Bug in managing wxClientData: "); + wxString message = "Bug in managing wxClientData: "; if ( m_trackedDataObjects > 0 ) - message << m_trackedDataObjects << wxT(" lost objects"); + message << m_trackedDataObjects << " lost objects"; else - message << (-m_trackedDataObjects) << wxT(" extra deletes"); + message << (-m_trackedDataObjects) << " extra deletes"; wxFAIL_MSG(message); return false; } @@ -123,7 +123,7 @@ bool ItemContainerWidgetsPage::VerifyAllClientDataDestroyed() void ItemContainerWidgetsPage::StartTest(const wxString& label) { m_container->Clear(); - wxLogMessage(wxT("Test - %s:"), label.c_str()); + wxLogMessage("Test - %s:", label); } void ItemContainerWidgetsPage::EndTest(const wxArrayString& items) @@ -133,7 +133,7 @@ void ItemContainerWidgetsPage::EndTest(const wxArrayString& items) bool ok = count == items.GetCount(); if ( !ok ) { - wxFAIL_MSG(wxT("Item count does not match.")); + wxFAIL_MSG("Item count does not match."); } else { @@ -143,8 +143,8 @@ void ItemContainerWidgetsPage::EndTest(const wxArrayString& items) if ( str != items[i] ) { wxFAIL_MSG(wxString::Format( - wxT("Wrong string \"%s\" at position %d (expected \"%s\")"), - str.c_str(), i, items[i].c_str())); + "Wrong string \"%s\" at position %d (expected \"%s\")", + str, i, items[i])); ok = false; break; } @@ -178,19 +178,19 @@ void ItemContainerWidgetsPage::EndTest(const wxArrayString& items) m_container->Clear(); ok &= VerifyAllClientDataDestroyed(); - wxLogMessage(wxT("...%s"), ok ? wxT("passed") : wxT("failed")); + wxLogMessage("...%s", ok ? "passed" : "failed"); } wxString ItemContainerWidgetsPage::DumpContainerData(const wxArrayString& expected) const { wxString str; - str << wxT("Current content:\n"); + str << "Current content:\n"; unsigned i; for ( i = 0; i < m_container->GetCount(); ++i ) { - str << wxT(" - ") << m_container->GetString(i) << wxT(" ["); + str << " - " << m_container->GetString(i) << " ["; if ( m_container->HasClientObjectData() ) { TrackedClientData * @@ -204,20 +204,20 @@ ItemContainerWidgetsPage::DumpContainerData(const wxArrayString& expected) const if ( data ) str << (wxUIntPtr)data; } - str << wxT("]\n"); + str << "]\n"; } - str << wxT("Expected content:\n"); + str << "Expected content:\n"; for ( i = 0; i < expected.GetCount(); ++i ) { const wxString& item = expected[i]; - str << wxT(" - ") << item << wxT("["); + str << " - " << item << "["; for( unsigned j = 0; j < m_items.GetCount(); ++j ) { if ( m_items[j] == item ) str << j; } - str << wxT("]\n"); + str << "]\n"; } return str; @@ -227,7 +227,7 @@ bool ItemContainerWidgetsPage::VerifyClientData(wxUIntPtr i, const wxString& str { if ( i > m_items.GetCount() || m_items[i] != str ) { - wxLogMessage(wxT("Client data for '%s' does not match."), str.c_str()); + wxLogMessage("Client data for '%s' does not match.", str); return false; } @@ -251,9 +251,9 @@ ItemContainerWidgetsPage::MakeArray(const wxSortedArrayString& sorted) void ItemContainerWidgetsPage::OnButtonTestItemContainer(wxCommandEvent&) { m_container = GetContainer(); - wxASSERT_MSG(m_container, wxT("Widget must have a test widget")); + wxASSERT_MSG(m_container, "Widget must have a test widget"); - wxLogMessage(wxT("wxItemContainer test for %s, %s:"), + wxLogMessage("wxItemContainer test for %s, %s:", GetWidget()->GetClassInfo()->GetClassName(), (m_container->IsSorted() ? "Sorted" : "Unsorted")); @@ -261,16 +261,16 @@ void ItemContainerWidgetsPage::OnButtonTestItemContainer(wxCommandEvent&) expected_result = m_container->IsSorted() ? MakeArray(m_itemsSorted) : m_items; - StartTest(wxT("Append one item")); + StartTest("Append one item"); wxString item = m_items[0]; m_container->Append(item); EndTest(wxArrayString(1, &item)); - StartTest(wxT("Append some items")); + StartTest("Append some items"); m_container->Append(m_items); EndTest(expected_result); - StartTest(wxT("Append some items with data objects")); + StartTest("Append some items with data objects"); wxClientData **objects = new wxClientData *[m_items.GetCount()]; for ( unsigned i = 0; i < m_items.GetCount(); ++i ) objects[i] = CreateClientData(i); @@ -278,7 +278,7 @@ void ItemContainerWidgetsPage::OnButtonTestItemContainer(wxCommandEvent&) EndTest(expected_result); delete[] objects; - StartTest(wxT("Append some items with data")); + StartTest("Append some items with data"); void **data = new void *[m_items.GetCount()]; for ( unsigned i = 0; i < m_items.GetCount(); ++i ) data[i] = wxUIntToPtr(i); @@ -286,19 +286,19 @@ void ItemContainerWidgetsPage::OnButtonTestItemContainer(wxCommandEvent&) EndTest(expected_result); delete[] data; - StartTest(wxT("Append some items with data, one by one")); + StartTest("Append some items with data, one by one"); for ( unsigned i = 0; i < m_items.GetCount(); ++i ) m_container->Append(m_items[i], wxUIntToPtr(i)); EndTest(expected_result); - StartTest(wxT("Append some items with data objects, one by one")); + StartTest("Append some items with data objects, one by one"); for ( unsigned i = 0; i < m_items.GetCount(); ++i ) m_container->Append(m_items[i], CreateClientData(i)); EndTest(expected_result); if ( !m_container->IsSorted() ) { - StartTest(wxT("Insert in reverse order with data, one by one")); + StartTest("Insert in reverse order with data, one by one"); for ( unsigned i = m_items.GetCount(); i; --i ) m_container->Insert(m_items[i - 1], 0, wxUIntToPtr(i - 1)); EndTest(expected_result); diff --git a/samples/widgets/listbox.cpp b/samples/widgets/listbox.cpp index 22da0c9b4e..19ca1db964 100644 --- a/samples/widgets/listbox.cpp +++ b/samples/widgets/listbox.cpp @@ -244,7 +244,7 @@ wxEND_EVENT_TABLE() #define FAMILY_CTRLS NATIVE_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(ListboxWidgetsPage, wxT("Listbox"), +IMPLEMENT_WIDGETS_PAGE(ListboxWidgetsPage, "Listbox", FAMILY_CTRLS | WITH_ITEMS_CTRLS ); @@ -278,32 +278,32 @@ void ListboxWidgetsPage::CreateContent() // left pane wxStaticBox *box = new wxStaticBox(this, wxID_ANY, - wxT("&Set listbox parameters")); + "&Set listbox parameters"); wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL); static const wxString modes[] = { - wxT("single"), - wxT("extended"), - wxT("multiple"), + "single", + "extended", + "multiple", }; - m_radioSelMode = new wxRadioBox(this, wxID_ANY, wxT("Selection &mode:"), + m_radioSelMode = new wxRadioBox(this, wxID_ANY, "Selection &mode:", wxDefaultPosition, wxDefaultSize, WXSIZEOF(modes), modes, 1, wxRA_SPECIFY_COLS); static const wxString listTypes[] = { - wxS("list box") + "list box" #if wxUSE_CHECKLISTBOX - , wxS("check list box") + , "check list box" #endif // wxUSE_CHECKLISTBOX #if wxUSE_REARRANGECTRL - , wxS("rearrange list") + , "rearrange list" #endif // wxUSE_REARRANGECTRL }; - m_radioListType = new wxRadioBox(this, wxID_ANY, wxS("&List type:"), + m_radioListType = new wxRadioBox(this, wxID_ANY, "&List type:", wxDefaultPosition, wxDefaultSize, WXSIZEOF(listTypes), listTypes, 1, wxRA_SPECIFY_COLS); @@ -311,15 +311,15 @@ void ListboxWidgetsPage::CreateContent() m_chkVScroll = CreateCheckBoxAndAddToSizer ( sizerLeft, - wxT("Always show &vertical scrollbar") + "Always show &vertical scrollbar" ); m_chkHScroll = CreateCheckBoxAndAddToSizer ( sizerLeft, - wxT("Show &horizontal scrollbar") + "Show &horizontal scrollbar" ); - m_chkSort = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Sort items")); - m_chkOwnerDraw = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Owner drawn")); + m_chkSort = CreateCheckBoxAndAddToSizer(sizerLeft, "&Sort items"); + m_chkOwnerDraw = CreateCheckBoxAndAddToSizer(sizerLeft, "&Owner drawn"); sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer sizerLeft->Add(m_radioSelMode, 0, wxGROW | wxALL, 5); @@ -327,67 +327,67 @@ void ListboxWidgetsPage::CreateContent() sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer sizerLeft->Add(m_radioListType, 0, wxGROW | wxALL, 5); - wxButton *btn = new wxButton(this, ListboxPage_Reset, wxT("&Reset")); + wxButton *btn = new wxButton(this, ListboxPage_Reset, "&Reset"); sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // middle pane wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, - wxT("&Change listbox contents")); + "&Change listbox contents"); wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL); wxSizer *sizerRow = new wxBoxSizer(wxHORIZONTAL); - btn = new wxButton(this, ListboxPage_Add, wxT("&Add this string")); - m_textAdd = new wxTextCtrl(this, ListboxPage_AddText, wxT("test item 0")); + btn = new wxButton(this, ListboxPage_Add, "&Add this string"); + m_textAdd = new wxTextCtrl(this, ListboxPage_AddText, "test item 0"); sizerRow->Add(btn, 0, wxRIGHT, 5); sizerRow->Add(m_textAdd, 1, wxLEFT, 5); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ListboxPage_AddSeveral, wxT("&Insert a few strings")); + btn = new wxButton(this, ListboxPage_AddSeveral, "&Insert a few strings"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ListboxPage_AddMany, wxT("Add &many strings")); + btn = new wxButton(this, ListboxPage_AddMany, "Add &many strings"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); sizerRow = new wxBoxSizer(wxHORIZONTAL); - btn = new wxButton(this, ListboxPage_Change, wxT("C&hange current")); + btn = new wxButton(this, ListboxPage_Change, "C&hange current"); m_textChange = new wxTextCtrl(this, ListboxPage_ChangeText, wxEmptyString); sizerRow->Add(btn, 0, wxRIGHT, 5); sizerRow->Add(m_textChange, 1, wxLEFT, 5); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = new wxBoxSizer(wxHORIZONTAL); - btn = new wxButton(this, ListboxPage_EnsureVisible, wxT("Make item &visible")); + btn = new wxButton(this, ListboxPage_EnsureVisible, "Make item &visible"); m_textEnsureVisible = new wxTextCtrl(this, ListboxPage_EnsureVisibleText, wxEmptyString); sizerRow->Add(btn, 0, wxRIGHT, 5); sizerRow->Add(m_textEnsureVisible, 1, wxLEFT, 5); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = new wxBoxSizer(wxHORIZONTAL); - btn = new wxButton(this, ListboxPage_Delete, wxT("&Delete this item")); + btn = new wxButton(this, ListboxPage_Delete, "&Delete this item"); m_textDelete = new wxTextCtrl(this, ListboxPage_DeleteText, wxEmptyString); sizerRow->Add(btn, 0, wxRIGHT, 5); sizerRow->Add(m_textDelete, 1, wxLEFT, 5); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ListboxPage_DeleteSel, wxT("Delete &selection")); + btn = new wxButton(this, ListboxPage_DeleteSel, "Delete &selection"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ListboxPage_Clear, wxT("&Clear")); + btn = new wxButton(this, ListboxPage_Clear, "&Clear"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ListboxPage_MoveUp, wxT("Move item &up")); + btn = new wxButton(this, ListboxPage_MoveUp, "Move item &up"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ListboxPage_MoveDown, wxT("Move item &down")); + btn = new wxButton(this, ListboxPage_MoveDown, "Move item &down"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ListboxPage_GetTopItem, wxT("Get top item")); + btn = new wxButton(this, ListboxPage_GetTopItem, "Get top item"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ListboxPage_GetCountPerPage, wxT("Get count per page")); + btn = new wxButton(this, ListboxPage_GetCountPerPage, "Get count per page"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ListboxPage_ContainerTests, wxT("Run &tests")); + btn = new wxButton(this, ListboxPage_ContainerTests, "Run &tests"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); // right pane @@ -431,7 +431,7 @@ void ListboxWidgetsPage::CreateLbox() switch ( m_radioSelMode->GetSelection() ) { default: - wxFAIL_MSG( wxT("unexpected radio box selection") ); + wxFAIL_MSG( "unexpected radio box selection" ); wxFALLTHROUGH; case LboxSel_Single: flags |= wxLB_SINGLE; break; @@ -617,7 +617,7 @@ void ListboxWidgetsPage::OnButtonAdd(wxCommandEvent& WXUNUSED(event)) if ( !m_textAdd->IsModified() ) { // update the default string - m_textAdd->SetValue(wxString::Format(wxT("test item %u"), ++s_item)); + m_textAdd->SetValue(wxString::Format("test item %u", ++s_item)); } m_lbox->Append(s); @@ -628,16 +628,16 @@ void ListboxWidgetsPage::OnButtonAddMany(wxCommandEvent& WXUNUSED(event)) // "many" means 1000 here for ( unsigned int n = 0; n < 1000; n++ ) { - m_lbox->Append(wxString::Format(wxT("item #%u"), n)); + m_lbox->Append(wxString::Format("item #%u", n)); } } void ListboxWidgetsPage::OnButtonAddSeveral(wxCommandEvent& WXUNUSED(event)) { wxArrayString items; - items.Add(wxT("First")); - items.Add(wxT("another one")); - items.Add(wxT("and the last (very very very very very very very very very very long) one")); + items.Add("First"); + items.Add("another one"); + items.Add("and the last (very very very very very very very very very very long) one"); m_lbox->InsertItems(items, 0); } @@ -700,26 +700,26 @@ void ListboxWidgetsPage::OnUpdateUIMoveButtons(wxUpdateUIEvent& evt) void ListboxWidgetsPage::OnListbox(wxCommandEvent& event) { long sel = event.GetSelection(); - m_textDelete->SetValue(wxString::Format(wxT("%ld"), sel)); + m_textDelete->SetValue(wxString::Format("%ld", sel)); if (event.IsSelection()) { - wxLogMessage(wxT("Listbox item %ld selected"), sel); + wxLogMessage("Listbox item %ld selected", sel); } else { - wxLogMessage(wxT("Listbox item %ld deselected"), sel); + wxLogMessage("Listbox item %ld deselected", sel); } } void ListboxWidgetsPage::OnListboxDClick(wxCommandEvent& event) { - wxLogMessage( wxT("Listbox item %d double clicked"), event.GetInt() ); + wxLogMessage( "Listbox item %d double clicked", event.GetInt() ); } void ListboxWidgetsPage::OnCheckListbox(wxCommandEvent& event) { - wxLogMessage( wxT("Listbox item %d toggled"), event.GetInt() ); + wxLogMessage( "Listbox item %d toggled", event.GetInt() ); } void ListboxWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event)) diff --git a/samples/widgets/native.cpp b/samples/widgets/native.cpp index ba2cbd6b5f..d355a85251 100644 --- a/samples/widgets/native.cpp +++ b/samples/widgets/native.cpp @@ -272,7 +272,7 @@ private: // implementation // ============================================================================ -IMPLEMENT_WIDGETS_PAGE(NativeWidgetsPage, wxT("Native"), NATIVE_CTRLS); +IMPLEMENT_WIDGETS_PAGE(NativeWidgetsPage, "Native", NATIVE_CTRLS); NativeWidgetsPage::NativeWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist) : WidgetsPage(book, imaglist, native_xpm) diff --git a/samples/widgets/notebook.cpp b/samples/widgets/notebook.cpp index c8d94e86ed..08c51f1f3c 100644 --- a/samples/widgets/notebook.cpp +++ b/samples/widgets/notebook.cpp @@ -204,20 +204,20 @@ void BookWidgetsPage::CreateContent() wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL); // left pane - wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style")); + wxStaticBox *box = new wxStaticBox(this, wxID_ANY, "&Set style"); // must be in sync with Orient enum wxArrayString orientations; - orientations.Add(wxT("&top")); - orientations.Add(wxT("&bottom")); - orientations.Add(wxT("&left")); - orientations.Add(wxT("&right")); + orientations.Add("&top"); + orientations.Add("&bottom"); + orientations.Add("&left"); + orientations.Add("&right"); wxASSERT_MSG( orientations.GetCount() == Orient_Max, - wxT("forgot to update something") ); + "forgot to update something" ); - m_chkImages = new wxCheckBox(this, wxID_ANY, wxT("Show &images")); - m_radioOrient = new wxRadioBox(this, wxID_ANY, wxT("&Tab orientation"), + m_chkImages = new wxCheckBox(this, wxID_ANY, "Show &images"); + m_radioOrient = new wxRadioBox(this, wxID_ANY, "&Tab orientation", wxDefaultPosition, wxDefaultSize, orientations, 1, wxRA_SPECIFY_COLS); @@ -227,48 +227,48 @@ void BookWidgetsPage::CreateContent() sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer sizerLeft->Add(m_radioOrient, 0, wxALL, 5); - wxButton *btn = new wxButton(this, BookPage_Reset, wxT("&Reset")); + wxButton *btn = new wxButton(this, BookPage_Reset, "&Reset"); sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // middle pane - wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, wxT("&Contents")); + wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, "&Contents"); wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL); wxTextCtrl *text; - wxSizer *sizerRow = CreateSizerWithTextAndLabel(wxT("Number of pages: "), + wxSizer *sizerRow = CreateSizerWithTextAndLabel("Number of pages: ", BookPage_NumPagesText, &text); text->SetEditable(false); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - sizerRow = CreateSizerWithTextAndLabel(wxT("Current selection: "), + sizerRow = CreateSizerWithTextAndLabel("Current selection: ", BookPage_CurSelectText, &text); text->SetEditable(false); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(BookPage_SelectPage, - wxT("&Select page"), + "&Select page", BookPage_SelectText, &m_textSelect); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, BookPage_AddPage, wxT("&Add page")); + btn = new wxButton(this, BookPage_AddPage, "&Add page"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(BookPage_InsertPage, - wxT("&Insert page at"), + "&Insert page at", BookPage_InsertText, &m_textInsert); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(BookPage_RemovePage, - wxT("&Remove page"), + "&Remove page", BookPage_RemoveText, &m_textRemove); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, BookPage_DeleteAll, wxT("&Delete All")); + btn = new wxButton(this, BookPage_DeleteAll, "&Delete All"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); // right pane @@ -342,7 +342,7 @@ void BookWidgetsPage::RecreateBook() switch ( m_radioOrient->GetSelection() ) { default: - wxFAIL_MSG( wxT("unknown orientation") ); + wxFAIL_MSG( "unknown orientation" ); // fall through case Orient_Top: @@ -429,7 +429,7 @@ int BookWidgetsPage::GetIconIndex() const wxWindow *BookWidgetsPage::CreateNewPage() { - return new wxTextCtrl(m_book, wxID_ANY, wxT("I'm a book page")); + return new wxTextCtrl(m_book, wxID_ANY, "I'm a book page"); } // ---------------------------------------------------------------------------- @@ -451,30 +451,30 @@ void BookWidgetsPage::OnButtonDeleteAll(wxCommandEvent& WXUNUSED(event)) void BookWidgetsPage::OnButtonSelectPage(wxCommandEvent& WXUNUSED(event)) { int pos = GetTextValue(m_textSelect); - wxCHECK_RET( IsValidValue(pos), wxT("button should be disabled") ); + wxCHECK_RET( IsValidValue(pos), "button should be disabled" ); m_book->SetSelection(pos); } void BookWidgetsPage::OnButtonAddPage(wxCommandEvent& WXUNUSED(event)) { - m_book->AddPage(CreateNewPage(), wxT("Added page"), false, + m_book->AddPage(CreateNewPage(), "Added page", false, GetIconIndex()); } void BookWidgetsPage::OnButtonInsertPage(wxCommandEvent& WXUNUSED(event)) { int pos = GetTextValue(m_textInsert); - wxCHECK_RET( IsValidValue(pos), wxT("button should be disabled") ); + wxCHECK_RET( IsValidValue(pos), "button should be disabled" ); - m_book->InsertPage(pos, CreateNewPage(), wxT("Inserted page"), false, + m_book->InsertPage(pos, CreateNewPage(), "Inserted page", false, GetIconIndex()); } void BookWidgetsPage::OnButtonRemovePage(wxCommandEvent& WXUNUSED(event)) { int pos = GetTextValue(m_textRemove); - wxCHECK_RET( IsValidValue(pos), wxT("button should be disabled") ); + wxCHECK_RET( IsValidValue(pos), "button should be disabled" ); m_book->DeletePage(pos); } @@ -504,13 +504,13 @@ void BookWidgetsPage::OnUpdateUIResetButton(wxUpdateUIEvent& event) void BookWidgetsPage::OnUpdateUINumPagesText(wxUpdateUIEvent& event) { if(m_book) - event.SetText( wxString::Format(wxT("%u"), unsigned(m_book->GetPageCount())) ); + event.SetText( wxString::Format("%u", unsigned(m_book->GetPageCount())) ); } void BookWidgetsPage::OnUpdateUICurSelectText(wxUpdateUIEvent& event) { if(m_book) - event.SetText( wxString::Format(wxT("%d"), m_book->GetSelection()) ); + event.SetText( wxString::Format("%d", m_book->GetSelection()) ); } void BookWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event)) @@ -573,13 +573,13 @@ wxEND_EVENT_TABLE() #define FAMILY_CTRLS NATIVE_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(NotebookWidgetsPage, wxT("Notebook"), +IMPLEMENT_WIDGETS_PAGE(NotebookWidgetsPage, "Notebook", FAMILY_CTRLS | BOOK_CTRLS ); void NotebookWidgetsPage::OnPageChanging(wxNotebookEvent& event) { - wxLogMessage(wxT("Notebook page changing from %d to %d (currently %d)."), + wxLogMessage("Notebook page changing from %d to %d (currently %d).", event.GetOldSelection(), event.GetSelection(), m_book->GetSelection()); @@ -589,7 +589,7 @@ void NotebookWidgetsPage::OnPageChanging(wxNotebookEvent& event) void NotebookWidgetsPage::OnPageChanged(wxNotebookEvent& event) { - wxLogMessage(wxT("Notebook page changed from %d to %d (currently %d)."), + wxLogMessage("Notebook page changed from %d to %d (currently %d).", event.GetOldSelection(), event.GetSelection(), m_book->GetSelection()); @@ -646,13 +646,13 @@ wxBEGIN_EVENT_TABLE(ListbookWidgetsPage, BookWidgetsPage) EVT_LISTBOOK_PAGE_CHANGED(wxID_ANY, ListbookWidgetsPage::OnPageChanged) wxEND_EVENT_TABLE() -IMPLEMENT_WIDGETS_PAGE(ListbookWidgetsPage, wxT("Listbook"), +IMPLEMENT_WIDGETS_PAGE(ListbookWidgetsPage, "Listbook", GENERIC_CTRLS | BOOK_CTRLS ); void ListbookWidgetsPage::OnPageChanging(wxListbookEvent& event) { - wxLogMessage(wxT("Listbook page changing from %d to %d (currently %d)."), + wxLogMessage("Listbook page changing from %d to %d (currently %d).", event.GetOldSelection(), event.GetSelection(), m_book->GetSelection()); @@ -662,7 +662,7 @@ void ListbookWidgetsPage::OnPageChanging(wxListbookEvent& event) void ListbookWidgetsPage::OnPageChanged(wxListbookEvent& event) { - wxLogMessage(wxT("Listbook page changed from %d to %d (currently %d)."), + wxLogMessage("Listbook page changed from %d to %d (currently %d).", event.GetOldSelection(), event.GetSelection(), m_book->GetSelection()); @@ -719,13 +719,13 @@ wxBEGIN_EVENT_TABLE(ChoicebookWidgetsPage, BookWidgetsPage) EVT_CHOICEBOOK_PAGE_CHANGED(wxID_ANY, ChoicebookWidgetsPage::OnPageChanged) wxEND_EVENT_TABLE() -IMPLEMENT_WIDGETS_PAGE(ChoicebookWidgetsPage, wxT("Choicebook"), +IMPLEMENT_WIDGETS_PAGE(ChoicebookWidgetsPage, "Choicebook", GENERIC_CTRLS | BOOK_CTRLS ); void ChoicebookWidgetsPage::OnPageChanging(wxChoicebookEvent& event) { - wxLogMessage(wxT("Choicebook page changing from %d to %d (currently %d)."), + wxLogMessage("Choicebook page changing from %d to %d (currently %d).", event.GetOldSelection(), event.GetSelection(), m_book->GetSelection()); @@ -735,7 +735,7 @@ void ChoicebookWidgetsPage::OnPageChanging(wxChoicebookEvent& event) void ChoicebookWidgetsPage::OnPageChanged(wxChoicebookEvent& event) { - wxLogMessage(wxT("Choicebook page changed from %d to %d (currently %d)."), + wxLogMessage("Choicebook page changed from %d to %d (currently %d).", event.GetOldSelection(), event.GetSelection(), m_book->GetSelection()); diff --git a/samples/widgets/odcombobox.cpp b/samples/widgets/odcombobox.cpp index e3e9486def..326bd15826 100644 --- a/samples/widgets/odcombobox.cpp +++ b/samples/widgets/odcombobox.cpp @@ -299,7 +299,7 @@ public: }; -IMPLEMENT_WIDGETS_PAGE(ODComboboxWidgetsPage, wxT("OwnerDrawnCombobox"), +IMPLEMENT_WIDGETS_PAGE(ODComboboxWidgetsPage, "OwnerDrawnCombobox", GENERIC_CTRLS | WITH_ITEMS_CTRLS | COMBO_CTRLS ); @@ -332,88 +332,88 @@ void ODComboboxWidgetsPage::CreateContent() wxSizer *sizerLeft = new wxBoxSizer(wxVERTICAL); // left pane - style box - wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style")); + wxStaticBox *box = new wxStaticBox(this, wxID_ANY, "&Set style"); wxSizer *sizerStyle = new wxStaticBoxSizer(box, wxVERTICAL); - m_chkSort = CreateCheckBoxAndAddToSizer(sizerStyle, wxT("&Sort items")); - m_chkReadonly = CreateCheckBoxAndAddToSizer(sizerStyle, wxT("&Read only")); - m_chkDclickcycles = CreateCheckBoxAndAddToSizer(sizerStyle, wxT("&Double-click Cycles")); + m_chkSort = CreateCheckBoxAndAddToSizer(sizerStyle, "&Sort items"); + m_chkReadonly = CreateCheckBoxAndAddToSizer(sizerStyle, "&Read only"); + m_chkDclickcycles = CreateCheckBoxAndAddToSizer(sizerStyle, "&Double-click Cycles"); sizerStyle->AddSpacer(4); - m_chkBitmapbutton = CreateCheckBoxAndAddToSizer(sizerStyle, wxT("&Bitmap button")); - m_chkStdbutton = CreateCheckBoxAndAddToSizer(sizerStyle, wxT("B&lank button background")); + m_chkBitmapbutton = CreateCheckBoxAndAddToSizer(sizerStyle, "&Bitmap button"); + m_chkStdbutton = CreateCheckBoxAndAddToSizer(sizerStyle, "B&lank button background"); - wxButton *btn = new wxButton(this, ODComboPage_Reset, wxT("&Reset")); + wxButton *btn = new wxButton(this, ODComboPage_Reset, "&Reset"); sizerStyle->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 3); sizerLeft->Add(sizerStyle, wxSizerFlags().Expand()); // left pane - popup adjustment box - box = new wxStaticBox(this, wxID_ANY, wxT("Adjust &popup")); + box = new wxStaticBox(this, wxID_ANY, "Adjust &popup"); wxSizer *sizerPopupPos = new wxStaticBoxSizer(box, wxVERTICAL); - sizerRow = CreateSizerWithTextAndLabel(wxT("Min. Width:"), + sizerRow = CreateSizerWithTextAndLabel("Min. Width:", ODComboPage_PopupMinWidth, &m_textPopupMinWidth); - m_textPopupMinWidth->SetValue(wxT("-1")); + m_textPopupMinWidth->SetValue("-1"); sizerPopupPos->Add(sizerRow, 0, wxALL | wxGROW, 5); - sizerRow = CreateSizerWithTextAndLabel(wxT("Max. Height:"), + sizerRow = CreateSizerWithTextAndLabel("Max. Height:", ODComboPage_PopupHeight, &m_textPopupHeight); - m_textPopupHeight->SetValue(wxT("-1")); + m_textPopupHeight->SetValue("-1"); sizerPopupPos->Add(sizerRow, 0, wxALL | wxGROW, 5); - m_chkAlignpopupright = CreateCheckBoxAndAddToSizer(sizerPopupPos, wxT("Align Right")); + m_chkAlignpopupright = CreateCheckBoxAndAddToSizer(sizerPopupPos, "Align Right"); sizerLeft->Add(sizerPopupPos, wxSizerFlags().Expand().Border(wxTOP, 2)); // left pane - button adjustment box - box = new wxStaticBox(this, wxID_ANY, wxT("Adjust &button")); + box = new wxStaticBox(this, wxID_ANY, "Adjust &button"); wxSizer *sizerButtonPos = new wxStaticBoxSizer(box, wxVERTICAL); - sizerRow = CreateSizerWithTextAndLabel(wxT("Width:"), + sizerRow = CreateSizerWithTextAndLabel("Width:", ODComboPage_ButtonWidth, &m_textButtonWidth); - m_textButtonWidth->SetValue(wxT("-1")); + m_textButtonWidth->SetValue("-1"); sizerButtonPos->Add(sizerRow, 0, wxALL | wxGROW, 5); - sizerRow = CreateSizerWithTextAndLabel(wxT("VSpacing:"), + sizerRow = CreateSizerWithTextAndLabel("VSpacing:", ODComboPage_ButtonSpacing, &m_textButtonSpacing); - m_textButtonSpacing->SetValue(wxT("0")); + m_textButtonSpacing->SetValue("0"); sizerButtonPos->Add(sizerRow, 0, wxALL | wxGROW, 5); - sizerRow = CreateSizerWithTextAndLabel(wxT("Height:"), + sizerRow = CreateSizerWithTextAndLabel("Height:", ODComboPage_ButtonHeight, &m_textButtonHeight); - m_textButtonHeight->SetValue(wxT("-1")); + m_textButtonHeight->SetValue("-1"); sizerButtonPos->Add(sizerRow, 0, wxALL | wxGROW, 5); - m_chkAlignbutleft = CreateCheckBoxAndAddToSizer(sizerButtonPos, wxT("Align Left")); + m_chkAlignbutleft = CreateCheckBoxAndAddToSizer(sizerButtonPos, "Align Left"); sizerLeft->Add(sizerButtonPos, wxSizerFlags().Expand().Border(wxTOP, 2)); // middle pane wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, - wxT("&Change combobox contents")); + "&Change combobox contents"); wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL); - btn = new wxButton(this, ODComboPage_ContainerTests, wxT("Run &tests")); + btn = new wxButton(this, ODComboPage_ContainerTests, "Run &tests"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - sizerRow = CreateSizerWithTextAndLabel(wxT("Current selection"), + sizerRow = CreateSizerWithTextAndLabel("Current selection", ODComboPage_CurText, &text); text->SetEditable(false); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - sizerRow = CreateSizerWithTextAndLabel(wxT("Insertion Point"), + sizerRow = CreateSizerWithTextAndLabel("Insertion Point", ODComboPage_InsertionPointText, &text); text->SetEditable(false); @@ -421,39 +421,39 @@ void ODComboboxWidgetsPage::CreateContent() sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(ODComboPage_Insert, - wxT("&Insert this string"), + "&Insert this string", ODComboPage_InsertText, &m_textInsert); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(ODComboPage_Add, - wxT("&Add this string"), + "&Add this string", ODComboPage_AddText, &m_textAdd); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ODComboPage_AddSeveral, wxT("&Append a few strings")); + btn = new wxButton(this, ODComboPage_AddSeveral, "&Append a few strings"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ODComboPage_AddMany, wxT("Append &many strings")); + btn = new wxButton(this, ODComboPage_AddMany, "Append &many strings"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(ODComboPage_Change, - wxT("C&hange current"), + "C&hange current", ODComboPage_ChangeText, &m_textChange); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(ODComboPage_Delete, - wxT("&Delete this item"), + "&Delete this item", ODComboPage_DeleteText, &m_textDelete); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ODComboPage_DeleteSel, wxT("Delete &selection")); + btn = new wxButton(this, ODComboPage_DeleteSel, "Delete &selection"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ODComboPage_Clear, wxT("&Clear")); + btn = new wxButton(this, ODComboPage_Clear, "&Clear"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); // right pane @@ -569,7 +569,7 @@ void ODComboboxWidgetsPage::OnButtonChange(wxCommandEvent& WXUNUSED(event)) #ifndef __WXGTK__ m_combobox->SetString(sel, m_textChange->GetValue()); #else - wxLogMessage(wxT("Not implemented in wxGTK")); + wxLogMessage("Not implemented in wxGTK"); #endif } } @@ -608,7 +608,7 @@ void ODComboboxWidgetsPage::OnButtonInsert(wxCommandEvent& WXUNUSED(event)) if ( !m_textInsert->IsModified() ) { // update the default string - m_textInsert->SetValue(wxString::Format(wxT("test item %u"), ++s_item)); + m_textInsert->SetValue(wxString::Format("test item %u", ++s_item)); } if (m_combobox->GetSelection() >= 0) @@ -623,7 +623,7 @@ void ODComboboxWidgetsPage::OnButtonAdd(wxCommandEvent& WXUNUSED(event)) if ( !m_textAdd->IsModified() ) { // update the default string - m_textAdd->SetValue(wxString::Format(wxT("test item %u"), ++s_item)); + m_textAdd->SetValue(wxString::Format("test item %u", ++s_item)); } m_combobox->Append(s); @@ -634,15 +634,15 @@ void ODComboboxWidgetsPage::OnButtonAddMany(wxCommandEvent& WXUNUSED(event)) // "many" means 1000 here for ( unsigned int n = 0; n < 1000; n++ ) { - m_combobox->Append(wxString::Format(wxT("item #%u"), n)); + m_combobox->Append(wxString::Format("item #%u", n)); } } void ODComboboxWidgetsPage::OnButtonAddSeveral(wxCommandEvent& WXUNUSED(event)) { - m_combobox->Append(wxT("First")); - m_combobox->Append(wxT("another one")); - m_combobox->Append(wxT("and the last (very very very very very very very very very very long) one")); + m_combobox->Append("First"); + m_combobox->Append("another one"); + m_combobox->Append("and the last (very very very very very very very very very very long) one"); } void ODComboboxWidgetsPage::OnTextPopupWidth(wxCommandEvent& WXUNUSED(event)) @@ -698,13 +698,13 @@ void ODComboboxWidgetsPage::OnTextButtonAll(wxCommandEvent& WXUNUSED(event)) void ODComboboxWidgetsPage::OnUpdateUICurText(wxUpdateUIEvent& event) { if (m_combobox) - event.SetText( wxString::Format(wxT("%d"), m_combobox->GetSelection()) ); + event.SetText( wxString::Format("%d", m_combobox->GetSelection()) ); } void ODComboboxWidgetsPage::OnUpdateUIInsertionPointText(wxUpdateUIEvent& event) { if (m_combobox) - event.SetText( wxString::Format(wxT("%ld"), m_combobox->GetInsertionPoint()) ); + event.SetText( wxString::Format("%ld", m_combobox->GetInsertionPoint()) ); } void ODComboboxWidgetsPage::OnUpdateUIResetButton(wxUpdateUIEvent& event) @@ -761,26 +761,26 @@ void ODComboboxWidgetsPage::OnComboText(wxCommandEvent& event) wxString s = event.GetString(); wxASSERT_MSG( s == m_combobox->GetValue(), - wxT("event and combobox values should be the same") ); + "event and combobox values should be the same" ); if (event.GetEventType() == wxEVT_TEXT_ENTER) { - wxLogMessage(wxT("OwnerDrawnCombobox enter pressed (now '%s')"), s.c_str()); + wxLogMessage("OwnerDrawnCombobox enter pressed (now '%s')", s); } else { - wxLogMessage(wxT("OwnerDrawnCombobox text changed (now '%s')"), s.c_str()); + wxLogMessage("OwnerDrawnCombobox text changed (now '%s')", s); } } void ODComboboxWidgetsPage::OnComboBox(wxCommandEvent& event) { long sel = event.GetInt(); - m_textDelete->SetValue(wxString::Format(wxT("%ld"), sel)); + m_textDelete->SetValue(wxString::Format("%ld", sel)); - wxLogMessage(wxT("OwnerDrawnCombobox item %ld selected"), sel); + wxLogMessage("OwnerDrawnCombobox item %ld selected", sel); - wxLogMessage(wxT("OwnerDrawnCombobox GetValue(): %s"), m_combobox->GetValue().c_str() ); + wxLogMessage("OwnerDrawnCombobox GetValue(): %s", m_combobox->GetValue() ); } void ODComboboxWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& event) @@ -849,12 +849,12 @@ wxBitmap ODComboboxWidgetsPage::CreateBitmap(const wxColour& colour) void ODComboboxWidgetsPage::OnDropDown(wxCommandEvent& WXUNUSED(event)) { - wxLogMessage(wxT("Combobox dropped down")); + wxLogMessage("Combobox dropped down"); } void ODComboboxWidgetsPage::OnCloseUp(wxCommandEvent& WXUNUSED(event)) { - wxLogMessage(wxT("Combobox closed up")); + wxLogMessage("Combobox closed up"); } #endif //wxUSE_ODCOMBOBOX diff --git a/samples/widgets/radiobox.cpp b/samples/widgets/radiobox.cpp index 04d5721009..2745422475 100644 --- a/samples/widgets/radiobox.cpp +++ b/samples/widgets/radiobox.cpp @@ -180,7 +180,7 @@ wxEND_EVENT_TABLE() #define FAMILY_CTRLS NATIVE_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(RadioWidgetsPage, wxT("Radio"), +IMPLEMENT_WIDGETS_PAGE(RadioWidgetsPage, "Radio", FAMILY_CTRLS | WITH_ITEMS_CTRLS ); @@ -207,7 +207,7 @@ void RadioWidgetsPage::CreateContent() wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL); // left pane - wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style")); + wxStaticBox *box = new wxStaticBox(this, wxID_ANY, "&Set style"); wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL); @@ -219,12 +219,12 @@ void RadioWidgetsPage::CreateContent() static const wxString layoutDir[] = { - wxT("default"), - wxT("left to right"), - wxT("top to bottom") + "default", + "left to right", + "top to bottom" }; - m_radioDir = new wxRadioBox(this, wxID_ANY, wxT("Numbering:"), + m_radioDir = new wxRadioBox(this, wxID_ANY, "Numbering:", wxDefaultPosition, wxDefaultSize, WXSIZEOF(layoutDir), layoutDir, 1, wxRA_SPECIFY_COLS); @@ -236,57 +236,57 @@ void RadioWidgetsPage::CreateContent() #endif // wxRA_LEFTTORIGHT wxSizer *sizerRow; - sizerRow = CreateSizerWithTextAndLabel(wxT("&Major dimension:"), + sizerRow = CreateSizerWithTextAndLabel("&Major dimension:", wxID_ANY, &m_textMajorDim); sizerLeft->Add(sizerRow, 0, wxGROW | wxALL, 5); - sizerRow = CreateSizerWithTextAndLabel(wxT("&Number of buttons:"), + sizerRow = CreateSizerWithTextAndLabel("&Number of buttons:", wxID_ANY, &m_textNumBtns); sizerLeft->Add(sizerRow, 0, wxGROW | wxALL, 5); wxButton *btn; - btn = new wxButton(this, RadioPage_Update, wxT("&Update")); + btn = new wxButton(this, RadioPage_Update, "&Update"); sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 5); sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer - btn = new wxButton(this, RadioPage_Reset, wxT("&Reset")); + btn = new wxButton(this, RadioPage_Reset, "&Reset"); sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // middle pane - wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, wxT("&Change parameters")); + wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, "&Change parameters"); wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL); - sizerRow = CreateSizerWithTextAndLabel(wxT("Current selection:"), + sizerRow = CreateSizerWithTextAndLabel("Current selection:", wxID_ANY, &m_textCurSel); sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5); sizerRow = CreateSizerWithTextAndButton(RadioPage_Selection, - wxT("&Change selection:"), + "&Change selection:", wxID_ANY, &m_textSel); sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5); sizerRow = CreateSizerWithTextAndButton(RadioPage_Label, - wxT("&Label for box:"), + "&Label for box:", wxID_ANY, &m_textLabel); sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5); sizerRow = CreateSizerWithTextAndButton(RadioPage_LabelBtn, - wxT("&Label for buttons:"), + "&Label for buttons:", wxID_ANY, &m_textLabelBtns); sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5); m_chkEnableItem = CreateCheckBoxAndAddToSizer(sizerMiddle, - wxT("Disable &2nd item"), + "Disable &2nd item", RadioPage_EnableItem); m_chkShowItem = CreateCheckBoxAndAddToSizer(sizerMiddle, - wxT("Hide 2nd &item"), + "Hide 2nd &item", RadioPage_ShowItem); // right pane @@ -312,10 +312,10 @@ void RadioWidgetsPage::CreateContent() void RadioWidgetsPage::Reset() { - m_textMajorDim->SetValue(wxString::Format(wxT("%u"), DEFAULT_MAJOR_DIM)); - m_textNumBtns->SetValue(wxString::Format(wxT("%u"), DEFAULT_NUM_ENTRIES)); - m_textLabel->SetValue(wxT("I'm a radiobox")); - m_textLabelBtns->SetValue(wxT("item")); + m_textMajorDim->SetValue(wxString::Format("%u", DEFAULT_MAJOR_DIM)); + m_textNumBtns->SetValue(wxString::Format("%u", DEFAULT_NUM_ENTRIES)); + m_textLabel->SetValue("I'm a radiobox"); + m_textLabelBtns->SetValue("item"); m_chkSpecifyRows->SetValue(false); m_chkEnableItem->SetValue(true); @@ -342,7 +342,7 @@ void RadioWidgetsPage::CreateRadio() unsigned long count; if ( !m_textNumBtns->GetValue().ToULong(&count) ) { - wxLogWarning(wxT("Should have a valid number for number of items.")); + wxLogWarning("Should have a valid number for number of items."); // fall back to default count = DEFAULT_NUM_ENTRIES; @@ -351,7 +351,7 @@ void RadioWidgetsPage::CreateRadio() unsigned long majorDim; if ( !m_textMajorDim->GetValue().ToULong(&majorDim) ) { - wxLogWarning(wxT("Should have a valid major dimension number.")); + wxLogWarning("Should have a valid major dimension number."); // fall back to default majorDim = DEFAULT_MAJOR_DIM; @@ -362,8 +362,8 @@ void RadioWidgetsPage::CreateRadio() wxString labelBtn = m_textLabelBtns->GetValue(); for ( size_t n = 0; n < count; n++ ) { - items[n] = wxString::Format(wxT("%s %lu"), - labelBtn.c_str(), (unsigned long)n + 1); + items[n] = wxString::Format("%s %lu", + labelBtn, (unsigned long)n + 1); } int flags = m_chkSpecifyRows->GetValue() ? wxRA_SPECIFY_ROWS @@ -375,7 +375,7 @@ void RadioWidgetsPage::CreateRadio() switch ( m_radioDir->GetSelection() ) { default: - wxFAIL_MSG( wxT("unexpected wxRadioBox layout direction") ); + wxFAIL_MSG( "unexpected wxRadioBox layout direction" ); // fall through case RadioDir_Default: @@ -434,12 +434,12 @@ void RadioWidgetsPage::OnRadioBox(wxCommandEvent& event) int event_sel = event.GetSelection(); wxUnusedVar(event_sel); - wxLogMessage(wxT("Radiobox selection changed, now %d"), sel); + wxLogMessage("Radiobox selection changed, now %d", sel); wxASSERT_MSG( sel == event_sel, - wxT("selection should be the same in event and radiobox") ); + "selection should be the same in event and radiobox" ); - m_textCurSel->SetValue(wxString::Format(wxT("%d"), sel)); + m_textCurSel->SetValue(wxString::Format("%d", sel)); } void RadioWidgetsPage::OnButtonRecreate(wxCommandEvent& WXUNUSED(event)) @@ -458,7 +458,7 @@ void RadioWidgetsPage::OnButtonSelection(wxCommandEvent& WXUNUSED(event)) if ( !m_textSel->GetValue().ToULong(&sel) || (sel >= (size_t)m_radio->GetCount()) ) { - wxLogWarning(wxT("Invalid number specified as new selection.")); + wxLogWarning("Invalid number specified as new selection."); } else { @@ -516,14 +516,14 @@ void RadioWidgetsPage::OnUpdateUIReset(wxUpdateUIEvent& event) void RadioWidgetsPage::OnUpdateUIEnableItem(wxUpdateUIEvent& event) { - event.SetText(m_radio->IsItemEnabled(TEST_BUTTON) ? wxT("Disable &2nd item") - : wxT("Enable &2nd item")); + event.SetText(m_radio->IsItemEnabled(TEST_BUTTON) ? "Disable &2nd item" + : "Enable &2nd item"); } void RadioWidgetsPage::OnUpdateUIShowItem(wxUpdateUIEvent& event) { - event.SetText(m_radio->IsItemShown(TEST_BUTTON) ? wxT("Hide 2nd &item") - : wxT("Show 2nd &item")); + event.SetText(m_radio->IsItemShown(TEST_BUTTON) ? "Hide 2nd &item" + : "Show 2nd &item"); } #endif // wxUSE_RADIOBOX diff --git a/samples/widgets/searchctrl.cpp b/samples/widgets/searchctrl.cpp index ec295e87e9..91e45c64f0 100644 --- a/samples/widgets/searchctrl.cpp +++ b/samples/widgets/searchctrl.cpp @@ -130,7 +130,7 @@ wxEND_EVENT_TABLE() #define FAMILY_CTRLS GENERIC_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(SearchCtrlWidgetsPage, wxT("SearchCtrl"), +IMPLEMENT_WIDGETS_PAGE(SearchCtrlWidgetsPage, "SearchCtrl", FAMILY_CTRLS | EDITABLE_CTRLS | ALL_CTRLS); SearchCtrlWidgetsPage::SearchCtrlWidgetsPage(WidgetsBookCtrl *book, @@ -147,12 +147,12 @@ void SearchCtrlWidgetsPage::CreateContent() wxSizer* box = new wxStaticBoxSizer( - new wxStaticBox(this, -1, wxT("Options")), + new wxStaticBox(this, -1, "Options"), wxVERTICAL); - m_searchBtnCheck = new wxCheckBox(this, ID_SEARCH_CB, wxT("Search button")); - m_cancelBtnCheck = new wxCheckBox(this, ID_CANCEL_CB, wxT("Cancel button")); - m_menuBtnCheck = new wxCheckBox(this, ID_MENU_CB, wxT("Search menu")); + m_searchBtnCheck = new wxCheckBox(this, ID_SEARCH_CB, "Search button"); + m_cancelBtnCheck = new wxCheckBox(this, ID_CANCEL_CB, "Cancel button"); + m_menuBtnCheck = new wxCheckBox(this, ID_MENU_CB, "Search menu"); m_searchBtnCheck->SetValue(true); @@ -191,12 +191,12 @@ wxMenu* SearchCtrlWidgetsPage::CreateTestMenu() { wxMenu* menu = new wxMenu; const int SEARCH_MENU_SIZE = 5; - wxMenuItem* menuItem = menu->Append(wxID_ANY, wxT("Recent Searches"), wxT(""), wxITEM_NORMAL); + wxMenuItem* menuItem = menu->Append(wxID_ANY, "Recent Searches", "", wxITEM_NORMAL); menuItem->Enable(false); for ( int i = 0; i < SEARCH_MENU_SIZE; i++ ) { - wxString itemText = wxString::Format(wxT("item %i"),i); - wxString tipText = wxString::Format(wxT("tip %i"),i); + wxString itemText = wxString::Format("item %i",i); + wxString tipText = wxString::Format("tip %i",i); menu->Append(ID_SEARCHMENU+i, itemText, tipText, wxITEM_NORMAL); } return menu; diff --git a/samples/widgets/slider.cpp b/samples/widgets/slider.cpp index e5a3b454d6..33edea188d 100644 --- a/samples/widgets/slider.cpp +++ b/samples/widgets/slider.cpp @@ -226,7 +226,7 @@ wxEND_EVENT_TABLE() #define FAMILY_CTRLS NATIVE_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(SliderWidgetsPage, wxT("Slider"), FAMILY_CTRLS ); +IMPLEMENT_WIDGETS_PAGE(SliderWidgetsPage, "Slider", FAMILY_CTRLS ); SliderWidgetsPage::SliderWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist) @@ -253,43 +253,43 @@ void SliderWidgetsPage::CreateContent() wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL); // left pane - wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style")); + wxStaticBox *box = new wxStaticBox(this, wxID_ANY, "&Set style"); wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL); - m_chkInverse = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Inverse")); - m_chkTicks = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("Show &ticks")); - m_chkMinMaxLabels = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("Show min/max &labels")); - m_chkValueLabel = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("Show &value label")); + m_chkInverse = CreateCheckBoxAndAddToSizer(sizerLeft, "&Inverse"); + m_chkTicks = CreateCheckBoxAndAddToSizer(sizerLeft, "Show &ticks"); + m_chkMinMaxLabels = CreateCheckBoxAndAddToSizer(sizerLeft, "Show min/max &labels"); + m_chkValueLabel = CreateCheckBoxAndAddToSizer(sizerLeft, "Show &value label"); static const wxString sides[] = { - wxT("default"), - wxT("top"), - wxT("bottom"), - wxT("left"), - wxT("right"), + "default", + "top", + "bottom", + "left", + "right", }; - m_radioSides = new wxRadioBox(this, SliderPage_RadioSides, wxT("&Label position"), + m_radioSides = new wxRadioBox(this, SliderPage_RadioSides, "&Label position", wxDefaultPosition, wxDefaultSize, WXSIZEOF(sides), sides, 1, wxRA_SPECIFY_COLS); sizerLeft->Add(m_radioSides, 0, wxGROW | wxALL, 5); m_chkBothSides = CreateCheckBoxAndAddToSizer - (sizerLeft, wxT("&Both sides"), SliderPage_BothSides); + (sizerLeft, "&Both sides", SliderPage_BothSides); #if wxUSE_TOOLTIPS - m_chkBothSides->SetToolTip( wxT("\"Both sides\" is only supported \nin Universal") ); + m_chkBothSides->SetToolTip("\"Both sides\" is only supported \nin Universal"); #endif // wxUSE_TOOLTIPS sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer - wxButton *btn = new wxButton(this, SliderPage_Reset, wxT("&Reset")); + wxButton *btn = new wxButton(this, SliderPage_Reset, "&Reset"); sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // middle pane - wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, wxT("&Change slider value")); + wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, "&Change slider value"); wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL); wxTextCtrl *text; - wxSizer *sizerRow = CreateSizerWithTextAndLabel(wxT("Current value"), + wxSizer *sizerRow = CreateSizerWithTextAndLabel("Current value", SliderPage_CurValueText, &text); text->SetEditable(false); @@ -297,49 +297,49 @@ void SliderWidgetsPage::CreateContent() sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(SliderPage_SetValue, - wxT("Set &value"), + "Set &value", SliderPage_ValueText, &m_textValue); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(SliderPage_SetMinAndMax, - wxT("&Min and max"), + "&Min and max", SliderPage_MinText, &m_textMin); m_textMax = new wxTextCtrl(this, SliderPage_MaxText, wxEmptyString); sizerRow->Add(m_textMax, 1, wxLEFT | wxALIGN_CENTRE_VERTICAL, 5); - m_textMin->SetValue( wxString::Format(wxT("%d"), m_min) ); - m_textMax->SetValue( wxString::Format(wxT("%d"), m_max) ); + m_textMin->SetValue( wxString::Format("%d", m_min) ); + m_textMax->SetValue( wxString::Format("%d", m_max) ); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(SliderPage_SetLineSize, - wxT("Li&ne size"), + "Li&ne size", SliderPage_LineSizeText, &m_textLineSize); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(SliderPage_SetPageSize, - wxT("P&age size"), + "P&age size", SliderPage_PageSizeText, &m_textPageSize); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(SliderPage_SetTickFreq, - wxT("Tick &frequency"), + "Tick &frequency", SliderPage_TickFreqText, &m_textTickFreq); - m_textTickFreq->SetValue(wxT("10")); + m_textTickFreq->SetValue("10"); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(SliderPage_SetThumbLen, - wxT("Thumb &length"), + "Thumb &length", SliderPage_ThumbLenText, &m_textThumbLen); @@ -353,8 +353,8 @@ void SliderWidgetsPage::CreateContent() Reset(); CreateSlider(); - m_textLineSize->SetValue(wxString::Format(wxT("%d"), m_slider->GetLineSize())); - m_textPageSize->SetValue(wxString::Format(wxT("%d"), m_slider->GetPageSize())); + m_textLineSize->SetValue(wxString::Format("%d", m_slider->GetLineSize())); + m_textPageSize->SetValue(wxString::Format("%d", m_slider->GetPageSize())); // the 3 panes panes compose the window sizerTop->Add(sizerLeft, 0, wxGROW | (wxALL & ~wxLEFT), 10); @@ -429,7 +429,7 @@ void SliderWidgetsPage::CreateSlider() break; default: - wxFAIL_MSG(wxT("unexpected radiobox selection")); + wxFAIL_MSG("unexpected radiobox selection"); // fall through } @@ -488,7 +488,7 @@ void SliderWidgetsPage::DoSetLineSize() long lineSize; if ( !m_textLineSize->GetValue().ToLong(&lineSize) ) { - wxLogWarning(wxT("Invalid slider line size")); + wxLogWarning("Invalid slider line size"); return; } @@ -497,7 +497,7 @@ void SliderWidgetsPage::DoSetLineSize() if ( m_slider->GetLineSize() != lineSize ) { - wxLogWarning(wxT("Invalid line size in slider.")); + wxLogWarning("Invalid line size in slider."); } } @@ -506,7 +506,7 @@ void SliderWidgetsPage::DoSetPageSize() long pageSize; if ( !m_textPageSize->GetValue().ToLong(&pageSize) ) { - wxLogWarning(wxT("Invalid slider page size")); + wxLogWarning("Invalid slider page size"); return; } @@ -515,7 +515,7 @@ void SliderWidgetsPage::DoSetPageSize() if ( m_slider->GetPageSize() != pageSize ) { - wxLogWarning(wxT("Invalid page size in slider.")); + wxLogWarning("Invalid page size in slider."); } } @@ -524,7 +524,7 @@ void SliderWidgetsPage::DoSetTickFreq() long freq; if ( !m_textTickFreq->GetValue().ToLong(&freq) ) { - wxLogWarning(wxT("Invalid slider tick frequency")); + wxLogWarning("Invalid slider tick frequency"); return; } @@ -537,7 +537,7 @@ void SliderWidgetsPage::DoSetThumbLen() long len; if ( !m_textThumbLen->GetValue().ToLong(&len) ) { - wxLogWarning(wxT("Invalid slider thumb length")); + wxLogWarning("Invalid slider thumb length"); return; } @@ -584,7 +584,7 @@ void SliderWidgetsPage::OnButtonSetMinAndMax(wxCommandEvent& WXUNUSED(event)) !m_textMax->GetValue().ToLong(&maxNew) || minNew >= maxNew ) { - wxLogWarning(wxT("Invalid min/max values for the slider.")); + wxLogWarning("Invalid min/max values for the slider."); return; } @@ -597,7 +597,7 @@ void SliderWidgetsPage::OnButtonSetMinAndMax(wxCommandEvent& WXUNUSED(event)) if ( m_slider->GetMin() != m_min || m_slider->GetMax() != m_max ) { - wxLogWarning(wxT("Invalid range in slider.")); + wxLogWarning("Invalid range in slider."); } } @@ -606,7 +606,7 @@ void SliderWidgetsPage::OnButtonSetValue(wxCommandEvent& WXUNUSED(event)) long val; if ( !m_textValue->GetValue().ToLong(&val) || !IsValidValue(val) ) { - wxLogWarning(wxT("Invalid slider value.")); + wxLogWarning("Invalid slider value."); return; } @@ -673,7 +673,7 @@ void SliderWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event)) void SliderWidgetsPage::OnUpdateUICurValueText(wxUpdateUIEvent& event) { - event.SetText( wxString::Format(wxT("%d"), m_slider->GetValue()) ); + event.SetText( wxString::Format("%d", m_slider->GetValue()) ); } void SliderWidgetsPage::OnUpdateUIRadioSides(wxUpdateUIEvent& event) @@ -693,7 +693,7 @@ void SliderWidgetsPage::OnUpdateUIBothSides(wxUpdateUIEvent& event) void SliderWidgetsPage::OnSlider(wxScrollEvent& event) { wxASSERT_MSG( event.GetInt() == m_slider->GetValue(), - wxT("slider value should be the same") ); + "slider value should be the same" ); wxEventType eventType = event.GetEventType(); @@ -702,17 +702,17 @@ void SliderWidgetsPage::OnSlider(wxScrollEvent& event) include/wx/event.h (section "wxScrollBar and wxSlider event identifiers") */ - static const wxChar *eventNames[] = + static const wxString eventNames[] = { - wxT("wxEVT_SCROLL_TOP"), - wxT("wxEVT_SCROLL_BOTTOM"), - wxT("wxEVT_SCROLL_LINEUP"), - wxT("wxEVT_SCROLL_LINEDOWN"), - wxT("wxEVT_SCROLL_PAGEUP"), - wxT("wxEVT_SCROLL_PAGEDOWN"), - wxT("wxEVT_SCROLL_THUMBTRACK"), - wxT("wxEVT_SCROLL_THUMBRELEASE"), - wxT("wxEVT_SCROLL_CHANGED") + "wxEVT_SCROLL_TOP", + "wxEVT_SCROLL_BOTTOM", + "wxEVT_SCROLL_LINEUP", + "wxEVT_SCROLL_LINEDOWN", + "wxEVT_SCROLL_PAGEUP", + "wxEVT_SCROLL_PAGEDOWN", + "wxEVT_SCROLL_THUMBTRACK", + "wxEVT_SCROLL_THUMBRELEASE", + "wxEVT_SCROLL_CHANGED" }; int index = eventType - wxEVT_SCROLL_TOP; @@ -722,12 +722,12 @@ void SliderWidgetsPage::OnSlider(wxScrollEvent& event) should be added to the above eventNames array. */ wxASSERT_MSG(index >= 0 && (size_t)index < WXSIZEOF(eventNames), - wxT("Unknown slider event") ); + "Unknown slider event" ); static int s_numSliderEvents = 0; - wxLogMessage(wxT("Slider event #%d: %s (pos = %d, int value = %d)"), + wxLogMessage("Slider event #%d: %s (pos = %d, int value = %d)", s_numSliderEvents++, eventNames[index], event.GetPosition(), diff --git a/samples/widgets/spinbtn.cpp b/samples/widgets/spinbtn.cpp index 391160fff6..4bda25ffef 100644 --- a/samples/widgets/spinbtn.cpp +++ b/samples/widgets/spinbtn.cpp @@ -211,7 +211,7 @@ wxEND_EVENT_TABLE() #define FAMILY_CTRLS NATIVE_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(SpinBtnWidgetsPage, wxT("Spin"), +IMPLEMENT_WIDGETS_PAGE(SpinBtnWidgetsPage, "Spin", FAMILY_CTRLS | EDITABLE_CTRLS ); @@ -245,25 +245,25 @@ void SpinBtnWidgetsPage::CreateContent() wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL); // left pane - wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style")); + wxStaticBox *box = new wxStaticBox(this, wxID_ANY, "&Set style"); wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL); - m_chkVert = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Vertical")); - m_chkArrowKeys = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Arrow Keys")); - m_chkWrap = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Wrap")); + m_chkVert = CreateCheckBoxAndAddToSizer(sizerLeft, "&Vertical"); + m_chkArrowKeys = CreateCheckBoxAndAddToSizer(sizerLeft, "&Arrow Keys"); + m_chkWrap = CreateCheckBoxAndAddToSizer(sizerLeft, "&Wrap"); m_chkProcessEnter = CreateCheckBoxAndAddToSizer(sizerLeft, - wxT("Process &Enter")); + "Process &Enter"); sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer static const wxString halign[] = { - wxT("left"), - wxT("centre"), - wxT("right"), + "left", + "centre", + "right", }; - m_radioAlign = new wxRadioBox(this, wxID_ANY, wxT("&Text alignment"), + m_radioAlign = new wxRadioBox(this, wxID_ANY, "&Text alignment", wxDefaultPosition, wxDefaultSize, WXSIZEOF(halign), halign, 1); @@ -271,17 +271,17 @@ void SpinBtnWidgetsPage::CreateContent() sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer - wxButton *btn = new wxButton(this, SpinBtnPage_Reset, wxT("&Reset")); + wxButton *btn = new wxButton(this, SpinBtnPage_Reset, "&Reset"); sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // middle pane wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, - wxT("&Change spinbtn value")); + "&Change spinbtn value"); wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL); wxTextCtrl *text; - wxSizer *sizerRow = CreateSizerWithTextAndLabel(wxT("Current value"), + wxSizer *sizerRow = CreateSizerWithTextAndLabel("Current value", SpinBtnPage_CurValueText, &text); text->SetEditable(false); @@ -289,21 +289,21 @@ void SpinBtnWidgetsPage::CreateContent() sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(SpinBtnPage_SetValue, - wxT("Set &value"), + "Set &value", SpinBtnPage_ValueText, &m_textValue); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(SpinBtnPage_SetMinAndMax, - wxT("&Min and max"), + "&Min and max", SpinBtnPage_MinText, &m_textMin); m_textMax = new wxTextCtrl(this, SpinBtnPage_MaxText, wxEmptyString); sizerRow->Add(m_textMax, 1, wxLEFT | wxALIGN_CENTRE_VERTICAL, 5); - m_textMin->SetValue( wxString::Format(wxT("%d"), m_min) ); - m_textMax->SetValue( wxString::Format(wxT("%d"), m_max) ); + m_textMin->SetValue( wxString::Format("%d", m_min) ); + m_textMax->SetValue( wxString::Format("%d", m_max) ); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); @@ -367,7 +367,7 @@ void SpinBtnWidgetsPage::CreateSpin() switch ( m_radioAlign->GetSelection() ) { default: - wxFAIL_MSG(wxT("unexpected radiobox selection")); + wxFAIL_MSG("unexpected radiobox selection"); // fall through case Align_Left: @@ -403,28 +403,28 @@ void SpinBtnWidgetsPage::CreateSpin() m_spinbtn->SetRange(m_min, m_max); m_spinctrl = new wxSpinCtrl(this, SpinBtnPage_SpinCtrl, - wxString::Format(wxT("%d"), val), + wxString::Format("%d", val), wxDefaultPosition, wxDefaultSize, flags | textFlags, m_min, m_max, val); m_spinctrldbl = new wxSpinCtrlDouble(this, SpinBtnPage_SpinCtrlDouble, - wxString::Format(wxT("%d"), val), + wxString::Format("%d", val), wxDefaultPosition, wxDefaultSize, flags | textFlags, m_min, m_max, val, 0.1); // Add spacers, labels and spin controls to the sizer. m_sizerSpin->Add(0, 0, 1); - m_sizerSpin->Add(new wxStaticText(this, wxID_ANY, wxT("wxSpinButton")), + m_sizerSpin->Add(new wxStaticText(this, wxID_ANY, "wxSpinButton"), 0, wxALIGN_CENTRE | wxALL, 5); m_sizerSpin->Add(m_spinbtn, 0, wxALIGN_CENTRE | wxALL, 5); m_sizerSpin->Add(0, 0, 1); - m_sizerSpin->Add(new wxStaticText(this, wxID_ANY, wxT("wxSpinCtrl")), + m_sizerSpin->Add(new wxStaticText(this, wxID_ANY, "wxSpinCtrl"), 0, wxALIGN_CENTRE | wxALL, 5); m_sizerSpin->Add(m_spinctrl, 0, wxALIGN_CENTRE | wxALL, 5); m_sizerSpin->Add(0, 0, 1); - m_sizerSpin->Add(new wxStaticText(this, wxID_ANY, wxT("wxSpinCtrlDouble")), + m_sizerSpin->Add(new wxStaticText(this, wxID_ANY, "wxSpinCtrlDouble"), 0, wxALIGN_CENTRE | wxALL, 5); m_sizerSpin->Add(m_spinctrldbl, 0, wxALIGN_CENTRE | wxALL, 5); m_sizerSpin->Add(0, 0, 1); @@ -451,7 +451,7 @@ void SpinBtnWidgetsPage::OnButtonSetMinAndMax(wxCommandEvent& WXUNUSED(event)) !m_textMax->GetValue().ToLong(&maxNew) || minNew > maxNew ) { - wxLogWarning(wxT("Invalid min/max values for the spinbtn.")); + wxLogWarning("Invalid min/max values for the spinbtn."); return; } @@ -498,7 +498,7 @@ void SpinBtnWidgetsPage::OnButtonSetValue(wxCommandEvent& WXUNUSED(event)) long val; if ( !m_textValue->GetValue().ToLong(&val) || !IsValidValue(val) ) { - wxLogWarning(wxT("Invalid spinbtn value.")); + wxLogWarning("Invalid spinbtn value."); return; } @@ -542,7 +542,7 @@ void SpinBtnWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event)) void SpinBtnWidgetsPage::OnUpdateUICurValueText(wxUpdateUIEvent& event) { - event.SetText( wxString::Format(wxT("%d"), m_spinbtn->GetValue())); + event.SetText( wxString::Format("%d", m_spinbtn->GetValue())); } void SpinBtnWidgetsPage::OnSpinBtn(wxSpinEvent& event) @@ -550,20 +550,20 @@ void SpinBtnWidgetsPage::OnSpinBtn(wxSpinEvent& event) int value = event.GetInt(); wxASSERT_MSG( value == m_spinbtn->GetValue(), - wxT("spinbtn value should be the same") ); + "spinbtn value should be the same" ); - wxLogMessage(wxT("Spin button value changed, now %d"), value); + wxLogMessage("Spin button value changed, now %d", value); } void SpinBtnWidgetsPage::OnSpinBtnUp(wxSpinEvent& event) { - wxLogMessage( wxT("Spin button value incremented, will be %d (was %d)"), + wxLogMessage( "Spin button value incremented, will be %d (was %d)", event.GetInt(), m_spinbtn->GetValue() ); } void SpinBtnWidgetsPage::OnSpinBtnDown(wxSpinEvent& event) { - wxLogMessage( wxT("Spin button value decremented, will be %d (was %d)"), + wxLogMessage( "Spin button value decremented, will be %d (was %d)", event.GetInt(), m_spinbtn->GetValue() ); } @@ -572,22 +572,22 @@ void SpinBtnWidgetsPage::OnSpinCtrl(wxSpinEvent& event) int value = event.GetInt(); wxASSERT_MSG( value == m_spinctrl->GetValue(), - wxT("spinctrl value should be the same") ); + "spinctrl value should be the same" ); - wxLogMessage(wxT("Spin control value changed, now %d"), value); + wxLogMessage("Spin control value changed, now %d", value); } void SpinBtnWidgetsPage::OnSpinCtrlDouble(wxSpinDoubleEvent& event) { double value = event.GetValue(); - wxLogMessage(wxT("Spin control value changed, now %g"), value); + wxLogMessage("Spin control value changed, now %g", value); } void SpinBtnWidgetsPage::OnSpinText(wxCommandEvent& event) { - wxLogMessage(wxT("Text changed in spin control, now \"%s\""), - event.GetString().c_str()); + wxLogMessage("Text changed in spin control, now \"%s\"", + event.GetString()); } void SpinBtnWidgetsPage::OnSpinTextEnter(wxCommandEvent& event) diff --git a/samples/widgets/statbmp.cpp b/samples/widgets/statbmp.cpp index 97ebb97030..42369aaa4c 100644 --- a/samples/widgets/statbmp.cpp +++ b/samples/widgets/statbmp.cpp @@ -62,7 +62,7 @@ private: void OnMouseEvent(wxMouseEvent& WXUNUSED(event)) { - wxLogMessage(wxT("wxStaticBitmap clicked.")); + wxLogMessage("wxStaticBitmap clicked."); } wxStaticBitmapBase *m_statbmp; @@ -74,7 +74,7 @@ private: DECLARE_WIDGETS_PAGE(StatBmpWidgetsPage) }; -IMPLEMENT_WIDGETS_PAGE(StatBmpWidgetsPage, wxT("StaticBitmap"), +IMPLEMENT_WIDGETS_PAGE(StatBmpWidgetsPage, "StaticBitmap", ALL_CTRLS); void StatBmpWidgetsPage::CreateContent() @@ -92,12 +92,12 @@ void StatBmpWidgetsPage::CreateContent() wxString testImage; #if wxUSE_LIBPNG wxPathList pathlist; - pathlist.Add(wxT(".")); - pathlist.Add(wxT("..")); - pathlist.Add(wxT("../image")); - pathlist.Add(wxT("../../../samples/image")); + pathlist.Add("."); + pathlist.Add(".."); + pathlist.Add("../image"); + pathlist.Add("../../../samples/image"); - wxFileName fn(pathlist.FindValidPath(wxT("toucan.png"))); + wxFileName fn(pathlist.FindValidPath("toucan.png")); if ( fn.FileExists() ) testImage = fn.GetFullPath(); #endif // wxUSE_LIBPNG @@ -139,7 +139,7 @@ void StatBmpWidgetsPage::RecreateWidget() } else { - wxLogMessage("Reading image from file '%s' failed.", filepath.c_str()); + wxLogMessage("Reading image from file '%s' failed.", filepath); } } diff --git a/samples/widgets/static.cpp b/samples/widgets/static.cpp index 143205238d..5ae946b9f8 100644 --- a/samples/widgets/static.cpp +++ b/samples/widgets/static.cpp @@ -200,7 +200,7 @@ wxEND_EVENT_TABLE() // implementation // ============================================================================ -IMPLEMENT_WIDGETS_PAGE(StaticWidgetsPage, wxT("Static"), +IMPLEMENT_WIDGETS_PAGE(StaticWidgetsPage, "Static", (int)wxPlatform(GENERIC_CTRLS).If(wxOS_WINDOWS,NATIVE_CTRLS) ); @@ -260,22 +260,22 @@ void StaticWidgetsPage::CreateContent() static const wxString halign[] = { - wxT("left"), - wxT("centre"), - wxT("right"), + "left", + "centre", + "right", }; static const wxString valign[] = { - wxT("top"), - wxT("centre"), - wxT("bottom"), + "top", + "centre", + "bottom", }; - m_radioHAlign = new wxRadioBox(this, wxID_ANY, wxT("&Horz alignment"), + m_radioHAlign = new wxRadioBox(this, wxID_ANY, "&Horz alignment", wxDefaultPosition, wxDefaultSize, WXSIZEOF(halign), halign, 3); - m_radioVAlign = new wxRadioBox(this, wxID_ANY, wxT("&Vert alignment"), + m_radioVAlign = new wxRadioBox(this, wxID_ANY, "&Vert alignment", wxDefaultPosition, wxDefaultSize, WXSIZEOF(valign), valign, 3); @@ -285,23 +285,23 @@ void StaticWidgetsPage::CreateContent() sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer - m_chkEllipsize = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Ellipsize")); + m_chkEllipsize = CreateCheckBoxAndAddToSizer(sizerLeft, "&Ellipsize"); static const wxString ellipsizeMode[] = { - wxT("&start"), - wxT("&middle"), - wxT("&end"), + "&start", + "&middle", + "&end", }; - m_radioEllipsize = new wxRadioBox(this, wxID_ANY, wxT("&Ellipsize mode"), + m_radioEllipsize = new wxRadioBox(this, wxID_ANY, "&Ellipsize mode", wxDefaultPosition, wxDefaultSize, WXSIZEOF(ellipsizeMode), ellipsizeMode, 3); sizerLeft->Add(m_radioEllipsize, 0, wxGROW | wxALL, 5); - wxButton *btn = new wxButton(this, StaticPage_Reset, wxT("&Reset")); + wxButton *btn = new wxButton(this, StaticPage_Reset, "&Reset"); sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // middle pane @@ -340,14 +340,14 @@ void StaticWidgetsPage::CreateContent() // NB: must be done _before_ calling CreateStatic() Reset(); - m_textBox->SetValue(wxT("This is a &box")); - m_textLabel->SetValue(wxT("And this is a\n\tlabel inside the box with a &mnemonic.\n") - wxT("Only this text is affected by the ellipsize settings.")); + m_textBox->SetValue("This is a &box"); + m_textLabel->SetValue("And this is a\n\tlabel inside the box with a &mnemonic.\n" + "Only this text is affected by the ellipsize settings."); #if wxUSE_MARKUP - m_textLabelWithMarkup->SetValue(wxT("Another label, this time decorated ") - wxT("with markup; here you need entities ") - wxT("for the symbols: < > & ' " ") - wxT(" but you can still place &mnemonics...")); + m_textLabelWithMarkup->SetValue("Another label, this time decorated " + "with markup; here you need entities " + "for the symbols: < > & ' " " + " but you can still place &mnemonics..."); #endif // wxUSE_MARKUP // right pane @@ -416,7 +416,7 @@ void StaticWidgetsPage::CreateStatic() switch ( m_radioHAlign->GetSelection() ) { default: - wxFAIL_MSG(wxT("unexpected radiobox selection")); + wxFAIL_MSG("unexpected radiobox selection"); // fall through case StaticHAlign_Left: @@ -435,7 +435,7 @@ void StaticWidgetsPage::CreateStatic() switch ( m_radioVAlign->GetSelection() ) { default: - wxFAIL_MSG(wxT("unexpected radiobox selection")); + wxFAIL_MSG("unexpected radiobox selection"); // fall through case StaticVAlign_Top: @@ -456,7 +456,7 @@ void StaticWidgetsPage::CreateStatic() switch ( m_radioEllipsize->GetSelection() ) { default: - wxFAIL_MSG(wxT("unexpected radiobox selection")); + wxFAIL_MSG("unexpected radiobox selection"); // fall through case StaticEllipsize_Start: @@ -603,9 +603,9 @@ void StaticWidgetsPage::OnButtonLabelText(wxCommandEvent& WXUNUSED(event)) // test GetLabel() and GetLabelText(); the first should return the // label as it is written in the relative text control; the second should // return the label as it's shown in the wxStaticText - wxLogMessage(wxT("The original label should be '%s'"), + wxLogMessage("The original label should be '%s'", m_statText->GetLabel()); - wxLogMessage(wxT("The label text is '%s'"), + wxLogMessage("The label text is '%s'", m_statText->GetLabelText()); } @@ -617,9 +617,9 @@ void StaticWidgetsPage::OnButtonLabelWithMarkupText(wxCommandEvent& WXUNUSED(eve // test GetLabel() and GetLabelText(); the first should return the // label as it is written in the relative text control; the second should // return the label as it's shown in the wxStaticText - wxLogMessage(wxT("The original label should be '%s'"), + wxLogMessage("The original label should be '%s'", m_statMarkup->GetLabel()); - wxLogMessage(wxT("The label text is '%s'"), + wxLogMessage("The label text is '%s'", m_statMarkup->GetLabelText()); } #endif // wxUSE_MARKUP diff --git a/samples/widgets/textctrl.cpp b/samples/widgets/textctrl.cpp index 96e5074954..8bd91ce042 100644 --- a/samples/widgets/textctrl.cpp +++ b/samples/widgets/textctrl.cpp @@ -292,32 +292,32 @@ private: switch ( HitTest(event.GetPosition(), &x, &y) ) { default: - wxFAIL_MSG( wxT("unexpected HitTest() result") ); + wxFAIL_MSG( "unexpected HitTest() result" ); // fall through case wxTE_HT_UNKNOWN: x = y = -1; - where = wxT("nowhere near"); + where = "nowhere near"; break; case wxTE_HT_BEFORE: - where = wxT("before"); + where = "before"; break; case wxTE_HT_BELOW: - where = wxT("below"); + where = "below"; break; case wxTE_HT_BEYOND: - where = wxT("beyond"); + where = "beyond"; break; case wxTE_HT_ON_TEXT: - where = wxT("at"); + where = "at"; break; } - wxLogMessage(wxT("Mouse is %s (%ld, %ld)"), where.c_str(), x, y); + wxLogMessage("Mouse is %s (%ld, %ld)", where, x, y); } }; @@ -366,7 +366,7 @@ wxEND_EVENT_TABLE() #define FAMILY_CTRLS NATIVE_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(TextWidgetsPage, wxT("Text"), +IMPLEMENT_WIDGETS_PAGE(TextWidgetsPage, "Text", FAMILY_CTRLS | EDITABLE_CTRLS ); @@ -415,12 +415,12 @@ void TextWidgetsPage::CreateContent() // left pane static const wxString modes[] = { - wxT("single line"), - wxT("multi line"), + "single line", + "multi line", }; - wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set textctrl parameters")); - m_radioTextLines = new wxRadioBox(this, wxID_ANY, wxT("&Number of lines:"), + wxStaticBox *box = new wxStaticBox(this, wxID_ANY, "&Set textctrl parameters"); + m_radioTextLines = new wxRadioBox(this, wxID_ANY, "&Number of lines:", wxDefaultPosition, wxDefaultSize, WXSIZEOF(modes), modes, 1, wxRA_SPECIFY_COLS); @@ -431,22 +431,22 @@ void TextWidgetsPage::CreateContent() sizerLeft->AddSpacer(5); m_chkPassword = CreateCheckBoxAndAddToSizer( - sizerLeft, wxT("&Password control"), TextPage_Password + sizerLeft, "&Password control", TextPage_Password ); m_chkReadonly = CreateCheckBoxAndAddToSizer( - sizerLeft, wxT("&Read-only mode") + sizerLeft, "&Read-only mode" ); m_chkProcessEnter = CreateCheckBoxAndAddToSizer( - sizerLeft, wxT("Process &Enter") + sizerLeft, "Process &Enter" ); m_chkProcessTab = CreateCheckBoxAndAddToSizer( - sizerLeft, wxT("Process &Tab") + sizerLeft, "Process &Tab" ); m_chkFilename = CreateCheckBoxAndAddToSizer( - sizerLeft, wxT("&Filename control") + sizerLeft, "&Filename control" ); m_chkNoVertScrollbar = CreateCheckBoxAndAddToSizer( - sizerLeft, wxT("No &vertical scrollbar"), + sizerLeft, "No &vertical scrollbar", TextPage_NoVertScrollbar ); m_chkFilename->Disable(); // not implemented yet @@ -454,13 +454,13 @@ void TextWidgetsPage::CreateContent() static const wxString wrap[] = { - wxT("no wrap"), - wxT("word wrap"), - wxT("char wrap"), - wxT("best wrap"), + "no wrap", + "word wrap", + "char wrap", + "best wrap", }; - m_radioWrap = new wxRadioBox(this, TextPage_WrapLines, wxT("&Wrap style:"), + m_radioWrap = new wxRadioBox(this, TextPage_WrapLines, "&Wrap style:", wxDefaultPosition, wxDefaultSize, WXSIZEOF(wrap), wrap, 1, wxRA_SPECIFY_COLS); @@ -468,12 +468,12 @@ void TextWidgetsPage::CreateContent() static const wxString halign[] = { - wxS("left"), - wxS("centre"), - wxS("right"), + "left", + "centre", + "right", }; - m_radioAlign = new wxRadioBox(this, wxID_ANY, wxS("&Text alignment"), + m_radioAlign = new wxRadioBox(this, wxID_ANY, "&Text alignment", wxDefaultPosition, wxDefaultSize, WXSIZEOF(halign), halign, 1); sizerLeft->Add(m_radioAlign, 0, wxGROW | wxALL, 5); @@ -481,12 +481,12 @@ void TextWidgetsPage::CreateContent() #ifdef __WXMSW__ static const wxString kinds[] = { - wxT("plain edit"), - wxT("rich edit"), - wxT("rich edit 2.0"), + "plain edit", + "rich edit", + "rich edit 2.0", }; - m_radioKind = new wxRadioBox(this, wxID_ANY, wxT("Control &kind"), + m_radioKind = new wxRadioBox(this, wxID_ANY, "Control &kind", wxDefaultPosition, wxDefaultSize, WXSIZEOF(kinds), kinds, 1, wxRA_SPECIFY_COLS); @@ -495,33 +495,33 @@ void TextWidgetsPage::CreateContent() sizerLeft->Add(m_radioKind, 0, wxGROW | wxALL, 5); #endif // __WXMSW__ - wxButton *btn = new wxButton(this, TextPage_Reset, wxT("&Reset")); + wxButton *btn = new wxButton(this, TextPage_Reset, "&Reset"); sizerLeft->Add(2, 2, 0, wxGROW | wxALL, 1); // spacer sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // middle pane - wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, wxT("&Change contents:")); + wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, "&Change contents:"); wxSizer *sizerMiddleUp = new wxStaticBoxSizer(box2, wxVERTICAL); - btn = new wxButton(this, TextPage_Set, wxT("&Set text value")); + btn = new wxButton(this, TextPage_Set, "&Set text value"); sizerMiddleUp->Add(btn, 0, wxALL | wxGROW, 1); - btn = new wxButton(this, TextPage_Add, wxT("&Append text")); + btn = new wxButton(this, TextPage_Add, "&Append text"); sizerMiddleUp->Add(btn, 0, wxALL | wxGROW, 1); - btn = new wxButton(this, TextPage_Insert, wxT("&Insert text")); + btn = new wxButton(this, TextPage_Insert, "&Insert text"); sizerMiddleUp->Add(btn, 0, wxALL | wxGROW, 1); - btn = new wxButton(this, TextPage_Load, wxT("&Load file")); + btn = new wxButton(this, TextPage_Load, "&Load file"); sizerMiddleUp->Add(btn, 0, wxALL | wxGROW, 1); - btn = new wxButton(this, TextPage_Clear, wxT("&Clear")); + btn = new wxButton(this, TextPage_Clear, "&Clear"); sizerMiddleUp->Add(btn, 0, wxALL | wxGROW, 1); - btn = new wxButton(this, TextPage_StreamRedirector, wxT("St&ream redirection")); + btn = new wxButton(this, TextPage_StreamRedirector, "St&ream redirection"); sizerMiddleUp->Add(btn, 0, wxALL | wxGROW, 1); - wxStaticBox *box4 = new wxStaticBox(this, wxID_ANY, wxT("&Info:")); + wxStaticBox *box4 = new wxStaticBox(this, wxID_ANY, "&Info:"); wxSizer *sizerMiddleDown = new wxStaticBoxSizer(box4, wxVERTICAL); m_textPosCur = CreateInfoText(); @@ -531,19 +531,19 @@ void TextWidgetsPage::CreateContent() wxSizer *sizerRow = new wxBoxSizer(wxHORIZONTAL); sizerRow->Add(CreateTextWithLabelSizer ( - wxT("Current pos:"), + "Current pos:", m_textPosCur ), 0, wxRIGHT, 5); sizerRow->Add(CreateTextWithLabelSizer ( - wxT("Col:"), + "Col:", m_textColCur ), 0, wxLEFT | wxRIGHT, 5); sizerRow->Add(CreateTextWithLabelSizer ( - wxT("Row:"), + "Row:", m_textRowCur ), 0, wxLEFT, 5); @@ -555,9 +555,9 @@ void TextWidgetsPage::CreateContent() ( CreateTextWithLabelSizer ( - wxT("Number of lines:"), + "Number of lines:", m_textLineLast, - wxT("Last position:"), + "Last position:", m_textPosLast ), 0, wxALL, 5 @@ -569,9 +569,9 @@ void TextWidgetsPage::CreateContent() ( CreateTextWithLabelSizer ( - wxT("Selection: from"), + "Selection: from", m_textSelFrom, - wxT("to"), + "to", m_textSelTo ), 0, wxALL, 5 @@ -584,7 +584,7 @@ void TextWidgetsPage::CreateContent() ( CreateTextWithLabelSizer ( - wxT("Range 10..20:"), + "Range 10..20:", m_textRange ), 0, wxALL, 5 @@ -606,7 +606,7 @@ void TextWidgetsPage::CreateContent() sizerMiddle->Add(sizerMiddleDown, 1, wxGROW | wxTOP, 5); // right pane - wxStaticBox *box3 = new wxStaticBox(this, wxID_ANY, wxT("&Text:")); + wxStaticBox *box3 = new wxStaticBox(this, wxID_ANY, "&Text:"); m_sizerText = new wxStaticBoxSizer(box3, wxHORIZONTAL); Reset(); CreateText(); @@ -631,7 +631,7 @@ wxTextCtrl *TextWidgetsPage::CreateInfoText() if ( !s_maxWidth ) { // calc it once only - GetTextExtent(wxT("9999999"), &s_maxWidth, NULL); + GetTextExtent("9999999", &s_maxWidth, NULL); } wxTextCtrl *text = new wxTextCtrl(this, wxID_ANY, wxEmptyString, @@ -689,7 +689,7 @@ void TextWidgetsPage::CreateText() switch ( m_radioTextLines->GetSelection() ) { default: - wxFAIL_MSG( wxT("unexpected lines radio box selection") ); + wxFAIL_MSG( "unexpected lines radio box selection" ); case TextLines_Single: break; @@ -714,7 +714,7 @@ void TextWidgetsPage::CreateText() switch ( m_radioWrap->GetSelection() ) { default: - wxFAIL_MSG( wxT("unexpected wrap style radio box selection") ); + wxFAIL_MSG( "unexpected wrap style radio box selection" ); wxFALLTHROUGH; case WrapStyle_None: @@ -747,14 +747,14 @@ void TextWidgetsPage::CreateText() flags |= wxTE_RIGHT; break; default: - wxFAIL_MSG( wxS("unexpected alignment style radio box selection") ); + wxFAIL_MSG( "unexpected alignment style radio box selection" ); } #ifdef __WXMSW__ switch ( m_radioKind->GetSelection() ) { default: - wxFAIL_MSG( wxT("unexpected kind radio box selection") ); + wxFAIL_MSG( "unexpected kind radio box selection" ); case TextKind_Plain: break; @@ -779,7 +779,7 @@ void TextWidgetsPage::CreateText() } else { - valueOld = wxT("Hello, Universe!"); + valueOld = "Hello, Universe!"; } m_text = new WidgetsTextCtrl(this, TextPage_Textctrl, valueOld, flags); @@ -839,7 +839,7 @@ void TextWidgetsPage::OnIdle(wxIdleEvent& WXUNUSED(event)) if ( m_textLineLast ) { m_textLineLast->SetValue( - wxString::Format(wxT("%d"), m_text->GetNumberOfLines()) ); + wxString::Format("%d", m_text->GetNumberOfLines()) ); } if ( m_textSelFrom && m_textSelTo ) @@ -884,8 +884,8 @@ void TextWidgetsPage::OnButtonReset(wxCommandEvent& WXUNUSED(event)) void TextWidgetsPage::OnButtonSet(wxCommandEvent& WXUNUSED(event)) { m_text->SetValue(m_text->GetWindowStyle() & wxTE_MULTILINE - ? wxT("Here,\nthere and\neverywhere") - : wxT("Yellow submarine")); + ? "Here,\nthere and\neverywhere" + : "Yellow submarine"); m_text->SetFocus(); } @@ -894,18 +894,18 @@ void TextWidgetsPage::OnButtonAdd(wxCommandEvent& WXUNUSED(event)) { if ( m_text->GetWindowStyle() & wxTE_MULTILINE ) { - m_text->AppendText(wxT("We all live in a\n")); + m_text->AppendText("We all live in a\n"); } - m_text->AppendText(wxT("Yellow submarine")); + m_text->AppendText("Yellow submarine"); } void TextWidgetsPage::OnButtonInsert(wxCommandEvent& WXUNUSED(event)) { - m_text->WriteText(wxT("Is there anybody going to listen to my story")); + m_text->WriteText("Is there anybody going to listen to my story"); if ( m_text->GetWindowStyle() & wxTE_MULTILINE ) { - m_text->WriteText(wxT("\nall about the girl who came to stay")); + m_text->WriteText("\nall about the girl who came to stay"); } } @@ -919,15 +919,15 @@ void TextWidgetsPage::OnButtonLoad(wxCommandEvent& WXUNUSED(event)) { // search for the file in several dirs where it's likely to be wxPathList pathlist; - pathlist.Add(wxT(".")); - pathlist.Add(wxT("..")); - pathlist.Add(wxT("../widgets")); - pathlist.Add(wxT("../../../samples/widgets")); + pathlist.Add("."); + pathlist.Add(".."); + pathlist.Add("../widgets"); + pathlist.Add("../../../samples/widgets"); - wxString filename = pathlist.FindValidPath(wxT("textctrl.cpp")); + wxString filename = pathlist.FindValidPath("textctrl.cpp"); if ( !filename ) { - wxLogError(wxT("File textctrl.cpp not found.")); + wxLogError("File textctrl.cpp not found."); } else // load it { @@ -935,13 +935,13 @@ void TextWidgetsPage::OnButtonLoad(wxCommandEvent& WXUNUSED(event)) if ( !m_text->LoadFile(filename) ) { // this is not supposed to happen ... - wxLogError(wxT("Error loading file.")); + wxLogError("Error loading file."); } else { long elapsed = sw.Time(); - wxLogMessage(wxT("Loaded file '%s' in %lu.%us"), - filename.c_str(), elapsed / 1000, + wxLogMessage("Loaded file '%s' in %lu.%us", + filename, elapsed / 1000, (unsigned int) elapsed % 1000); } } @@ -996,12 +996,12 @@ void TextWidgetsPage::OnText(wxCommandEvent& WXUNUSED(event)) return; } - wxLogMessage(wxT("Text ctrl value changed")); + wxLogMessage("Text ctrl value changed"); } void TextWidgetsPage::OnTextEnter(wxCommandEvent& event) { - wxLogMessage(wxT("Text entered: '%s'"), event.GetString().c_str()); + wxLogMessage("Text entered: '%s'", event.GetString()); event.Skip(); } @@ -1033,7 +1033,7 @@ void TextWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& event) flags |= wxTE_RIGHT; break; default: - wxFAIL_MSG( wxS("unexpected alignment style radio box selection") ); + wxFAIL_MSG( "unexpected alignment style radio box selection" ); return; } @@ -1058,9 +1058,9 @@ void TextWidgetsPage::OnStreamRedirector(wxCommandEvent& WXUNUSED(event)) { #if wxHAS_TEXT_WINDOW_STREAM wxStreamToTextRedirector redirect(m_text); - wxString str( wxT("Outputed to cout, appears in wxTextCtrl!") ); + wxString str( "Outputed to cout, appears in wxTextCtrl!" ); wxSTD cout << str << wxSTD endl; #else - wxMessageBox(wxT("This wxWidgets build does not support wxStreamToTextRedirector")); + wxMessageBox("This wxWidgets build does not support wxStreamToTextRedirector"); #endif } diff --git a/samples/widgets/timepick.cpp b/samples/widgets/timepick.cpp index b8c0572b9a..303aee3f5d 100644 --- a/samples/widgets/timepick.cpp +++ b/samples/widgets/timepick.cpp @@ -119,7 +119,7 @@ wxEND_EVENT_TABLE() #define FAMILY_CTRLS GENERIC_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(TimePickerWidgetsPage, wxT("TimePicker"), +IMPLEMENT_WIDGETS_PAGE(TimePickerWidgetsPage, "TimePicker", FAMILY_CTRLS | PICKER_CTRLS ); diff --git a/samples/widgets/toggle.cpp b/samples/widgets/toggle.cpp index 1bbdcab0ef..83289037bc 100644 --- a/samples/widgets/toggle.cpp +++ b/samples/widgets/toggle.cpp @@ -175,7 +175,7 @@ wxEND_EVENT_TABLE() #define FAMILY_CTRLS NATIVE_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(ToggleWidgetsPage, wxT("ToggleButton"), +IMPLEMENT_WIDGETS_PAGE(ToggleWidgetsPage, "ToggleButton", FAMILY_CTRLS ); @@ -213,14 +213,14 @@ void ToggleWidgetsPage::CreateContent() wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL); // left pane - wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("Styles")); + wxStaticBox *box = new wxStaticBox(this, wxID_ANY, "Styles"); wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL); #ifdef wxHAS_BITMAPTOGGLEBUTTON m_chkBitmapOnly = CreateCheckBoxAndAddToSizer(sizerLeft, "&Bitmap only"); m_chkTextAndBitmap = CreateCheckBoxAndAddToSizer(sizerLeft, "Text &and bitmap"); - m_chkFit = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Fit exactly")); + m_chkFit = CreateCheckBoxAndAddToSizer(sizerLeft, "&Fit exactly"); #endif // wxHAS_BITMAPTOGGLEBUTTON #if wxUSE_MARKUP m_chkUseMarkup = CreateCheckBoxAndAddToSizer(sizerLeft, "Interpret &markup"); @@ -261,22 +261,22 @@ void ToggleWidgetsPage::CreateContent() // should be in sync with enums Toggle[HV]Align! static const wxString halign[] = { - wxT("left"), - wxT("centre"), - wxT("right"), + "left", + "centre", + "right", }; static const wxString valign[] = { - wxT("top"), - wxT("centre"), - wxT("bottom"), + "top", + "centre", + "bottom", }; - m_radioHAlign = new wxRadioBox(this, wxID_ANY, wxT("&Horz alignment"), + m_radioHAlign = new wxRadioBox(this, wxID_ANY, "&Horz alignment", wxDefaultPosition, wxDefaultSize, WXSIZEOF(halign), halign); - m_radioVAlign = new wxRadioBox(this, wxID_ANY, wxT("&Vert alignment"), + m_radioVAlign = new wxRadioBox(this, wxID_ANY, "&Vert alignment", wxDefaultPosition, wxDefaultSize, WXSIZEOF(valign), valign); @@ -286,18 +286,18 @@ void ToggleWidgetsPage::CreateContent() sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer - wxButton *btn = new wxButton(this, TogglePage_Reset, wxT("&Reset")); + wxButton *btn = new wxButton(this, TogglePage_Reset, "&Reset"); sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // middle pane - wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, wxT("&Operations")); + wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, "&Operations"); wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL); wxSizer *sizerRow = CreateSizerWithTextAndButton(TogglePage_ChangeLabel, - wxT("Change label"), + "Change label", wxID_ANY, &m_textLabel); - m_textLabel->SetValue(wxT("&Toggle me!")); + m_textLabel->SetValue("&Toggle me!"); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); @@ -378,7 +378,7 @@ void ToggleWidgetsPage::CreateToggle() break; default: - wxFAIL_MSG(wxT("unexpected radiobox selection")); + wxFAIL_MSG("unexpected radiobox selection"); // fall through case ToggleHAlign_Centre: @@ -396,7 +396,7 @@ void ToggleWidgetsPage::CreateToggle() break; default: - wxFAIL_MSG(wxT("unexpected radiobox selection")); + wxFAIL_MSG("unexpected radiobox selection"); // fall through case ToggleVAlign_Centre: @@ -419,22 +419,22 @@ void ToggleWidgetsPage::CreateToggle() if ( m_chkUseBitmapClass->GetValue() ) { btgl = new wxBitmapToggleButton(this, TogglePage_Picker, - CreateBitmap(wxT("normal"))); + CreateBitmap("normal")); } else { - btgl = new wxToggleButton(this, TogglePage_Picker, wxT("")); - btgl->SetBitmapLabel(CreateBitmap(wxT("normal"))); + btgl = new wxToggleButton(this, TogglePage_Picker, ""); + btgl->SetBitmapLabel(CreateBitmap("normal")); } #ifdef wxHAS_ANY_BUTTON if ( m_chkUsePressed->GetValue() ) - btgl->SetBitmapPressed(CreateBitmap(wxT("pushed"))); + btgl->SetBitmapPressed(CreateBitmap("pushed")); if ( m_chkUseFocused->GetValue() ) - btgl->SetBitmapFocus(CreateBitmap(wxT("focused"))); + btgl->SetBitmapFocus(CreateBitmap("focused")); if ( m_chkUseCurrent->GetValue() ) - btgl->SetBitmapCurrent(CreateBitmap(wxT("hover"))); + btgl->SetBitmapCurrent(CreateBitmap("hover")); if ( m_chkUseDisabled->GetValue() ) - btgl->SetBitmapDisabled(CreateBitmap(wxT("disabled"))); + btgl->SetBitmapDisabled(CreateBitmap("disabled")); #endif // wxHAS_ANY_BUTTON m_toggle = btgl; } @@ -527,8 +527,8 @@ wxBitmap ToggleWidgetsPage::CreateBitmap(const wxString& label) dc.SetBackground(*wxCYAN_BRUSH); dc.Clear(); dc.SetTextForeground(*wxBLACK); - dc.DrawLabel(wxStripMenuCodes(m_textLabel->GetValue()) + wxT("\n") - wxT("(") + label + wxT(" state)"), + dc.DrawLabel(wxStripMenuCodes(m_textLabel->GetValue()) + "\n" + "(" + label + " state)", wxArtProvider::GetBitmap(wxART_INFORMATION), wxRect(10, 10, bmp.GetWidth() - 20, bmp.GetHeight() - 20), wxALIGN_CENTRE); diff --git a/samples/widgets/widgets.cpp b/samples/widgets/widgets.cpp index c14cadcc26..63eee2c2f8 100644 --- a/samples/widgets/widgets.cpp +++ b/samples/widgets/widgets.cpp @@ -357,22 +357,22 @@ bool WidgetsApp::OnInit() // this sample side by side and it is useful to see which one is which wxString title; #if defined(__WXUNIVERSAL__) - title = wxT("wxUniv/"); + title = "wxUniv/"; #endif #if defined(__WXMSW__) - title += wxT("wxMSW"); + title += "wxMSW"; #elif defined(__WXGTK__) - title += wxT("wxGTK"); + title += "wxGTK"; #elif defined(__WXMAC__) - title += wxT("wxMAC"); + title += "wxMAC"; #elif defined(__WXMOTIF__) - title += wxT("wxMOTIF"); + title += "wxMOTIF"; #else - title += wxT("wxWidgets"); + title += "wxWidgets"; #endif - wxFrame *frame = new WidgetsFrame(title + wxT(" widgets demo")); + wxFrame *frame = new WidgetsFrame(title + " widgets demo"); frame->Show(); return true; @@ -400,25 +400,25 @@ WidgetsFrame::WidgetsFrame(const wxString& title) wxMenuBar *mbar = new wxMenuBar; wxMenu *menuWidget = new wxMenu; #if wxUSE_TOOLTIPS - menuWidget->Append(Widgets_SetTooltip, wxT("Set &tooltip...\tCtrl-T")); + menuWidget->Append(Widgets_SetTooltip, "Set &tooltip...\tCtrl-T"); menuWidget->AppendSeparator(); #endif // wxUSE_TOOLTIPS - menuWidget->Append(Widgets_SetFgColour, wxT("Set &foreground...\tCtrl-F")); - menuWidget->Append(Widgets_SetBgColour, wxT("Set &background...\tCtrl-B")); - menuWidget->Append(Widgets_SetPageBg, wxT("Set &page background...\tShift-Ctrl-B")); - menuWidget->Append(Widgets_SetFont, wxT("Set f&ont...\tCtrl-O")); - menuWidget->AppendCheckItem(Widgets_Enable, wxT("&Enable/disable\tCtrl-E")); - menuWidget->AppendCheckItem(Widgets_Show, wxT("Show/Hide")); + menuWidget->Append(Widgets_SetFgColour, "Set &foreground...\tCtrl-F"); + menuWidget->Append(Widgets_SetBgColour, "Set &background...\tCtrl-B"); + menuWidget->Append(Widgets_SetPageBg, "Set &page background...\tShift-Ctrl-B"); + menuWidget->Append(Widgets_SetFont, "Set f&ont...\tCtrl-O"); + menuWidget->AppendCheckItem(Widgets_Enable, "&Enable/disable\tCtrl-E"); + menuWidget->AppendCheckItem(Widgets_Show, "Show/Hide"); wxMenu *menuBorders = new wxMenu; - menuBorders->AppendRadioItem(Widgets_BorderDefault, wxT("De&fault\tCtrl-Shift-9")); - menuBorders->AppendRadioItem(Widgets_BorderNone, wxT("&None\tCtrl-Shift-0")); - menuBorders->AppendRadioItem(Widgets_BorderSimple, wxT("&Simple\tCtrl-Shift-1")); - menuBorders->AppendRadioItem(Widgets_BorderDouble, wxT("&Double\tCtrl-Shift-2")); - menuBorders->AppendRadioItem(Widgets_BorderStatic, wxT("Stati&c\tCtrl-Shift-3")); - menuBorders->AppendRadioItem(Widgets_BorderRaised, wxT("&Raised\tCtrl-Shift-4")); - menuBorders->AppendRadioItem(Widgets_BorderSunken, wxT("S&unken\tCtrl-Shift-5")); - menuWidget->AppendSubMenu(menuBorders, wxT("Set &border")); + menuBorders->AppendRadioItem(Widgets_BorderDefault, "De&fault\tCtrl-Shift-9"); + menuBorders->AppendRadioItem(Widgets_BorderNone, "&None\tCtrl-Shift-0"); + menuBorders->AppendRadioItem(Widgets_BorderSimple, "&Simple\tCtrl-Shift-1"); + menuBorders->AppendRadioItem(Widgets_BorderDouble, "&Double\tCtrl-Shift-2"); + menuBorders->AppendRadioItem(Widgets_BorderStatic, "Stati&c\tCtrl-Shift-3"); + menuBorders->AppendRadioItem(Widgets_BorderRaised, "&Raised\tCtrl-Shift-4"); + menuBorders->AppendRadioItem(Widgets_BorderSunken, "S&unken\tCtrl-Shift-5"); + menuWidget->AppendSubMenu(menuBorders, "Set &border"); wxMenu* const menuVariants = new wxMenu; menuVariants->AppendRadioItem(Widgets_VariantMini, "&Mini\tCtrl-Shift-6"); @@ -433,31 +433,31 @@ WidgetsFrame::WidgetsFrame(const wxString& title) menuWidget->AppendSeparator(); menuWidget->AppendCheckItem(Widgets_GlobalBusyCursor, - wxT("Toggle &global busy cursor\tCtrl-Shift-U")); + "Toggle &global busy cursor\tCtrl-Shift-U"); menuWidget->AppendCheckItem(Widgets_BusyCursor, - wxT("Toggle b&usy cursor\tCtrl-U")); + "Toggle b&usy cursor\tCtrl-U"); menuWidget->AppendSeparator(); - menuWidget->Append(wxID_EXIT, wxT("&Quit\tCtrl-Q")); - mbar->Append(menuWidget, wxT("&Widget")); + menuWidget->Append(wxID_EXIT, "&Quit\tCtrl-Q"); + mbar->Append(menuWidget, "&Widget"); wxMenu *menuTextEntry = new wxMenu; menuTextEntry->AppendRadioItem(TextEntry_DisableAutoComplete, - wxT("&Disable auto-completion")); + "&Disable auto-completion"); menuTextEntry->AppendRadioItem(TextEntry_AutoCompleteFixed, - wxT("Fixed-&list auto-completion")); + "Fixed-&list auto-completion"); menuTextEntry->AppendRadioItem(TextEntry_AutoCompleteFilenames, - wxT("&Files names auto-completion")); + "&Files names auto-completion"); menuTextEntry->AppendRadioItem(TextEntry_AutoCompleteDirectories, - wxT("&Directories names auto-completion")); + "&Directories names auto-completion"); menuTextEntry->AppendRadioItem(TextEntry_AutoCompleteCustom, - wxT("&Custom auto-completion")); + "&Custom auto-completion"); menuTextEntry->AppendRadioItem(TextEntry_AutoCompleteKeyLength, - wxT("Custom with &min length")); + "Custom with &min length"); menuTextEntry->AppendSeparator(); menuTextEntry->Append(TextEntry_SetHint, "Set help &hint"); - mbar->Append(menuTextEntry, wxT("&Text")); + mbar->Append(menuTextEntry, "&Text"); SetMenuBar(mbar); @@ -488,7 +488,7 @@ WidgetsFrame::WidgetsFrame(const wxString& title) // the lower one only has the log listbox and a button to clear it #if USE_LOG wxSizer *sizerDown = new wxStaticBoxSizer( - new wxStaticBox( m_panel, wxID_ANY, wxT("&Log window") ), + new wxStaticBox( m_panel, wxID_ANY, "&Log window" ), wxVERTICAL); m_lboxLog = new wxListBox(m_panel, wxID_ANY); @@ -501,11 +501,11 @@ WidgetsFrame::WidgetsFrame(const wxString& title) wxBoxSizer *sizerBtns = new wxBoxSizer(wxHORIZONTAL); wxButton *btn; #if USE_LOG - btn = new wxButton(m_panel, Widgets_ClearLog, wxT("Clear &log")); + btn = new wxButton(m_panel, Widgets_ClearLog, "Clear &log"); sizerBtns->Add(btn); sizerBtns->Add(10, 0); // spacer #endif // USE_LOG - btn = new wxButton(m_panel, Widgets_Quit, wxT("E&xit")); + btn = new wxButton(m_panel, Widgets_Quit, "E&xit"); sizerBtns->Add(btn); sizerDown->Add(sizerBtns, 0, wxALL | wxALIGN_RIGHT, 5); @@ -601,7 +601,7 @@ void WidgetsFrame::InitBook() } } - GetMenuBar()->Append(menuPages, wxT("&Page")); + GetMenuBar()->Append(menuPages, "&Page"); m_book->AssignImageList(imageList); @@ -664,7 +664,7 @@ WidgetsPage *WidgetsFrame::CurrentPage() #if !USE_TREEBOOK WidgetsBookCtrl *subBook = wxStaticCast(page, WidgetsBookCtrl); - wxCHECK_MSG( subBook, NULL, wxT("no WidgetsBookCtrl?") ); + wxCHECK_MSG( subBook, NULL, "no WidgetsBookCtrl?" ); page = subBook->GetCurrentPage(); #endif // !USE_TREEBOOK @@ -771,8 +771,8 @@ void WidgetsFrame::OnSetTooltip(wxCommandEvent& WXUNUSED(event)) wxTextEntryDialog dialog ( this, - wxT("Tooltip text (may use \\n, leave empty to remove): "), - wxT("Widgets sample"), + "Tooltip text (may use \\n, leave empty to remove): ", + "Widgets sample", WidgetsPage::GetAttrs().m_tooltip ); @@ -780,7 +780,7 @@ void WidgetsFrame::OnSetTooltip(wxCommandEvent& WXUNUSED(event)) return; WidgetsPage::GetAttrs().m_tooltip = dialog.GetValue(); - WidgetsPage::GetAttrs().m_tooltip.Replace(wxT("\\n"), wxT("\n")); + WidgetsPage::GetAttrs().m_tooltip.Replace("\\n", "\n"); CurrentPage()->SetUpWidget(); } @@ -870,7 +870,7 @@ void WidgetsFrame::OnSetFont(wxCommandEvent& WXUNUSED(event)) // so re-layout to show it correctly. page->Layout(); #else - wxLogMessage(wxT("Font selection dialog not available in current build.")); + wxLogMessage("Font selection dialog not available in current build."); #endif } @@ -901,7 +901,7 @@ void WidgetsFrame::OnSetBorder(wxCommandEvent& event) case Widgets_BorderDouble: border = wxBORDER_DOUBLE; break; default: - wxFAIL_MSG( wxT("unknown border style") ); + wxFAIL_MSG( "unknown border style" ); // fall through case Widgets_BorderDefault: border = wxBORDER_DEFAULT; break; @@ -1210,7 +1210,7 @@ void WidgetsFrame::OnWidgetFocus(wxFocusEvent& event) // WidgetsPageInfo // ---------------------------------------------------------------------------- -WidgetsPageInfo::WidgetsPageInfo(Constructor ctor, const wxChar *label, int categories) +WidgetsPageInfo::WidgetsPageInfo(Constructor ctor, const wxString& label, int categories) : m_label(label) , m_categories(categories) { diff --git a/samples/widgets/widgets.h b/samples/widgets/widgets.h index 65d7708133..c632fffe6c 100644 --- a/samples/widgets/widgets.h +++ b/samples/widgets/widgets.h @@ -197,7 +197,7 @@ public: wxImageList *imaglist); // our ctor - WidgetsPageInfo(Constructor ctor, const wxChar *label, int categories); + WidgetsPageInfo(Constructor ctor, const wxString& label, int categories); // accessors const wxString& GetLabel() const { return m_label; } diff --git a/samples/xrc/myframe.cpp b/samples/xrc/myframe.cpp index 579111a92d..f09eea2fdc 100644 --- a/samples/xrc/myframe.cpp +++ b/samples/xrc/myframe.cpp @@ -281,7 +281,7 @@ void MyFrame::OnAuiDemoToolOrMenuCommand(wxCommandEvent& WXUNUSED(event)) { #if wxUSE_AUI wxDialog dlg; - wxXmlResource::Get()->LoadDialog(&dlg, this, wxS("aui_dialog")); + wxXmlResource::Get()->LoadDialog(&dlg, this, "aui_dialog"); dlg.ShowModal(); #else wxLogWarning("wxUSE_AUI must be set to 1 in 'setup.h' to view the AUI demo."); diff --git a/samples/xti/codereadercallback.cpp b/samples/xti/codereadercallback.cpp index e2a1d187b4..9ed6e423f4 100644 --- a/samples/xti/codereadercallback.cpp +++ b/samples/xti/codereadercallback.cpp @@ -90,7 +90,7 @@ void wxObjectCodeReaderCallback::AllocateObject(int objectID, wxClassInfo *class { // add corresponding header if not already included wxString include; - include.Printf(wxT("#include \"%s\"\n"),classInfo->GetIncludeName()); + include.Printf("#include \"%s\"\n",classInfo->GetIncludeName()); if ( m_headerincludes.Find(include) == wxNOT_FOUND) m_headerincludes += include; } @@ -98,7 +98,7 @@ void wxObjectCodeReaderCallback::AllocateObject(int objectID, wxClassInfo *class wxString objectName = wxString::Format( "LocalObject_%d", objectID ); m_source += ( wxString::Format( "\t%s *%s = new %s;\n", classInfo->GetClassName(), - objectName.c_str(), + objectName, classInfo->GetClassName()) ); m_data->SetObjectName( objectID, objectName ); } @@ -106,7 +106,7 @@ void wxObjectCodeReaderCallback::AllocateObject(int objectID, wxClassInfo *class void wxObjectCodeReaderCallback::DestroyObject(int objectID, wxClassInfo *WXUNUSED(classInfo)) { m_source += ( wxString::Format( "\tdelete %s;\n", - m_data->GetObjectName( objectID).c_str() ) ); + m_data->GetObjectName( objectID) ) ); } class WXDLLIMPEXP_BASE wxObjectConstructorWriter: public wxObjectWriterFunctor @@ -150,17 +150,17 @@ wxString wxObjectCodeReaderCallback::ValueAsCode( const wxAny ¶m ) const wxCustomTypeInfo* cti = wx_dynamic_cast(const wxCustomTypeInfo*, type); if ( cti ) { - value.Printf( "%s(%s)", cti->GetTypeName().c_str(), - wxAnyGetAsString(param).c_str() ); + value.Printf( "%s(%s)", cti->GetTypeName(), + wxAnyGetAsString(param) ); } else { - wxLogError ( _("Internal error, illegal wxCustomTypeInfo") ); + wxLogError ( "Internal error, illegal wxCustomTypeInfo" ); } } else if ( type->GetKind() == wxT_STRING ) { - value.Printf( wxT("\"%s\""), wxAnyGetAsString(param).c_str() ); + value.Printf( "\"%s\"", wxAnyGetAsString(param) ); } else if ( type->GetKind() == wxT_OBJECT ) { @@ -178,7 +178,7 @@ wxString wxObjectCodeReaderCallback::ValueAsCode( const wxAny ¶m ) } else { - value.Printf( "%s", wxAnyGetAsString(param).c_str() ); + value.Printf( "%s", wxAnyGetAsString(param) ); } return value; @@ -195,20 +195,20 @@ void wxObjectCodeReaderCallback::CreateObject(int objectID, { int i; m_source += ( wxString::Format( "\t%s->Create(", - m_data->GetObjectName(objectID).c_str() ) ); + m_data->GetObjectName(objectID) ) ); for (i = 0; i < paramCount; i++) { if ( objectIDValues[i] != wxInvalidObjectID ) { wxString str = wxString::Format( "%s", - m_data->GetObjectName( objectIDValues[i] ).c_str() ); + m_data->GetObjectName( objectIDValues[i] ) ); m_source += ( str ); } else { m_source += ( - wxString::Format( "%s", ValueAsCode(params[i]).c_str() ) ); + wxString::Format( "%s", ValueAsCode(params[i]) ) ); } if (i < paramCount - 1) m_source += ( ", "); @@ -228,7 +228,7 @@ void wxObjectCodeReaderCallback::ConstructObject(int objectID, wxString objectName = wxString::Format( "LocalObject_%d", objectID ); m_source += ( wxString::Format( "\t%s *%s = new %s(", classInfo->GetClassName(), - objectName.c_str(), + objectName, classInfo->GetClassName()) ); m_data->SetObjectName( objectID, objectName ); @@ -237,11 +237,11 @@ void wxObjectCodeReaderCallback::ConstructObject(int objectID, { if ( objectIDValues[i] != wxInvalidObjectID ) m_source += ( wxString::Format( "%s", - m_data->GetObjectName( objectIDValues[i] ).c_str() ) ); + m_data->GetObjectName( objectIDValues[i] ) ) ); else { m_source += ( - wxString::Format( "%s", ValueAsCode(params[i]).c_str() ) ); + wxString::Format( "%s", ValueAsCode(params[i]) ) ); } if (i < paramCount - 1) m_source += ( ", " ); @@ -255,9 +255,9 @@ void wxObjectCodeReaderCallback::SetProperty(int objectID, const wxAny &value) { m_source += ( wxString::Format( "\t%s->%s(%s);\n", - m_data->GetObjectName(objectID).c_str(), - propertyInfo->GetAccessor()->GetSetterName().c_str(), - ValueAsCode(value).c_str()) ); + m_data->GetObjectName(objectID), + propertyInfo->GetAccessor()->GetSetterName(), + ValueAsCode(value)) ); } void wxObjectCodeReaderCallback::SetPropertyAsObject(int objectID, @@ -267,14 +267,14 @@ void wxObjectCodeReaderCallback::SetPropertyAsObject(int objectID, { if ( propertyInfo->GetTypeInfo()->GetKind() == wxT_OBJECT ) m_source += ( wxString::Format( "\t%s->%s(*%s);\n", - m_data->GetObjectName(objectID).c_str(), - propertyInfo->GetAccessor()->GetSetterName().c_str(), - m_data->GetObjectName( valueObjectId).c_str() ) ); + m_data->GetObjectName(objectID), + propertyInfo->GetAccessor()->GetSetterName(), + m_data->GetObjectName( valueObjectId) ) ); else m_source += ( wxString::Format( "\t%s->%s(%s);\n", - m_data->GetObjectName(objectID).c_str(), - propertyInfo->GetAccessor()->GetSetterName().c_str(), - m_data->GetObjectName( valueObjectId).c_str() ) ); + m_data->GetObjectName(objectID), + propertyInfo->GetAccessor()->GetSetterName(), + m_data->GetObjectName( valueObjectId) ) ); } void wxObjectCodeReaderCallback::AddToPropertyCollection( int objectID, @@ -283,9 +283,9 @@ void wxObjectCodeReaderCallback::AddToPropertyCollection( int objectID, const wxAny &value) { m_source += ( wxString::Format( "\t%s->%s(%s);\n", - m_data->GetObjectName(objectID).c_str(), - propertyInfo->GetAccessor()->GetAdderName().c_str(), - ValueAsCode(value).c_str()) ); + m_data->GetObjectName(objectID), + propertyInfo->GetAccessor()->GetAdderName(), + ValueAsCode(value)) ); } // sets the corresponding property (value is an object) @@ -319,8 +319,8 @@ void wxObjectCodeReaderCallback::SetConnect(int eventSourceObjectID, wxString::Format( "\t%s->Connect( %s->GetId(), %d, " "(wxObjectEventFunction)(wxEventFunction) & %s::%s, NULL, %s );", - ehsource.c_str(), ehsource.c_str(), eventType, ehsinkClass.c_str(), - handlerName.c_str(), ehsink.c_str() ); + ehsource, ehsource, eventType, ehsinkClass, + handlerName, ehsink ); m_source += ( code ); } diff --git a/src/aui/auibar.cpp b/src/aui/auibar.cpp index e4027d7d5c..b2dc732a66 100644 --- a/src/aui/auibar.cpp +++ b/src/aui/auibar.cpp @@ -293,15 +293,21 @@ void wxAuiGenericToolBarArt::DrawButton( int bmpX = 0, bmpY = 0; int textX = 0, textY = 0; + const wxBitmap& bmp = item.GetState() & wxAUI_BUTTON_STATE_DISABLED + ? item.GetDisabledBitmap() + : item.GetBitmap(); + + const wxSize bmpSize = bmp.IsOk() ? bmp.GetScaledSize() : wxSize(0, 0); + if (m_textOrientation == wxAUI_TBTOOL_TEXT_BOTTOM) { bmpX = rect.x + (rect.width/2) - - (item.GetBitmap().GetScaledWidth()/2); + (bmpSize.x/2); bmpY = rect.y + ((rect.height-textHeight)/2) - - (item.GetBitmap().GetScaledHeight()/2); + (bmpSize.y/2); textX = rect.x + (rect.width/2) - (textWidth/2) + 1; textY = rect.y + rect.height - textHeight - 1; @@ -312,9 +318,9 @@ void wxAuiGenericToolBarArt::DrawButton( bmpY = rect.y + (rect.height/2) - - (item.GetBitmap().GetScaledHeight()/2); + (bmpSize.y/2); - textX = bmpX + wnd->FromDIP(3) + item.GetBitmap().GetScaledWidth(); + textX = bmpX + wnd->FromDIP(3) + bmpSize.x; textY = rect.y + (rect.height/2) - (textHeight/2); @@ -351,12 +357,6 @@ void wxAuiGenericToolBarArt::DrawButton( } } - wxBitmap bmp; - if (item.GetState() & wxAUI_BUTTON_STATE_DISABLED) - bmp = item.GetDisabledBitmap(); - else - bmp = item.GetBitmap(); - if ( bmp.IsOk() ) dc.DrawBitmap(bmp, bmpX, bmpY, true); @@ -596,8 +596,9 @@ wxSize wxAuiGenericToolBarArt::GetToolSize( if (!item.GetBitmap().IsOk() && !(m_flags & wxAUI_TB_TEXT)) return wnd->FromDIP(wxSize(16,16)); - int width = item.GetBitmap().GetScaledWidth(); - int height = item.GetBitmap().GetScaledHeight(); + const wxBitmap& bmp = item.GetBitmap(); + int width = bmp.IsOk() ? bmp.GetScaledWidth() : 0; + int height = bmp.IsOk() ? bmp.GetScaledHeight() : 0; if (m_flags & wxAUI_TB_TEXT) { diff --git a/src/aui/auibook.cpp b/src/aui/auibook.cpp index ae8ae603d0..f1298c9997 100644 --- a/src/aui/auibook.cpp +++ b/src/aui/auibook.cpp @@ -3423,14 +3423,6 @@ int wxAuiNotebook::DoModifySelection(size_t n, bool events) int old_curpage = m_curPage; m_curPage = n; - // program allows the page change - if(events) - { - evt.SetEventType(wxEVT_AUINOTEBOOK_PAGE_CHANGED); - (void)GetEventHandler()->ProcessEvent(evt); - } - - wxAuiTabCtrl* ctrl; int ctrl_idx; if (FindTab(wnd, &ctrl, &ctrl_idx)) @@ -3464,6 +3456,13 @@ int wxAuiNotebook::DoModifySelection(size_t n, bool events) if (wnd->IsShownOnScreen() && FindFocus() != ctrl) wnd->SetFocus(); + // program allows the page change + if(events) + { + evt.SetEventType(wxEVT_AUINOTEBOOK_PAGE_CHANGED); + (void)GetEventHandler()->ProcessEvent(evt); + } + return old_curpage; } } diff --git a/src/aui/tabartmsw.cpp b/src/aui/tabartmsw.cpp index 2ba5961a63..9f17fa27fe 100644 --- a/src/aui/tabartmsw.cpp +++ b/src/aui/tabartmsw.cpp @@ -1,6 +1,6 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: wx/aui/tabartmsw.h -// Purpose: wxAuiMSWTabArt declaration +// Name: src/aui/tabartmsw.cpp +// Purpose: wxAuiMSWTabArt implementation // Author: Tobias Taschner // Created: 2015-09-26 // Copyright: (c) 2015 wxWidgets development team @@ -23,7 +23,7 @@ #include "wx/msw/private.h" #include "wx/renderer.h" -#if wxUSE_AUI +#if wxUSE_AUI && !defined(__WXUNIVERSAL__) wxAuiMSWTabArt::wxAuiMSWTabArt() { diff --git a/src/common/datetimefmt.cpp b/src/common/datetimefmt.cpp index 721a149da0..d1454c28d1 100644 --- a/src/common/datetimefmt.cpp +++ b/src/common/datetimefmt.cpp @@ -1647,12 +1647,7 @@ wxDateTime::ParseFormat(const wxString& date, Set(tm); - // If a time zone was specified and it is not the local time zone, we need - // to shift the time accordingly. - // - // Note that avoiding the call to MakeFromTimeZone is necessary to avoid - // DST problems. - if ( haveTimeZone && timeZone != -wxGetTimeZone() ) + if ( haveTimeZone ) MakeFromTimezone(timeZone); // finally check that the week day is consistent -- if we had it diff --git a/src/common/dcbase.cpp b/src/common/dcbase.cpp index 1363984b7e..8b070995d8 100644 --- a/src/common/dcbase.cpp +++ b/src/common/dcbase.cpp @@ -318,7 +318,7 @@ wxIMPLEMENT_ABSTRACT_CLASS(wxDCImpl, wxObject); wxDCImpl::wxDCImpl( wxDC *owner ) : m_window(NULL) - , m_colour(wxColourDisplay()) + , m_colour(true) , m_ok(true) , m_clipping(false) , m_isInteractive(0) diff --git a/src/common/dcsvg.cpp b/src/common/dcsvg.cpp index 7a02bebb4f..2913548a12 100644 --- a/src/common/dcsvg.cpp +++ b/src/common/dcsvg.cpp @@ -402,7 +402,6 @@ void wxSVGFileDCImpl::Init(const wxString &filename, int Width, int Height, m_backgroundBrush = *wxTRANSPARENT_BRUSH; m_textForegroundColour = *wxBLACK; m_textBackgroundColour = *wxWHITE; - m_colour = wxColourDisplay(); m_pen = *wxBLACK_PEN; m_font = *wxNORMAL_FONT; diff --git a/src/common/debugrpt.cpp b/src/common/debugrpt.cpp index 7bc0ed32cb..b271547974 100644 --- a/src/common/debugrpt.cpp +++ b/src/common/debugrpt.cpp @@ -29,6 +29,8 @@ #include "wx/utils.h" #endif // WX_PRECOMP +WX_CHECK_BUILD_OPTIONS("wxQA") + #if wxUSE_DEBUGREPORT && wxUSE_XML #include "wx/debugrpt.h" @@ -57,8 +59,6 @@ #include "wx/zipstrm.h" #endif // wxUSE_ZIPSTREAM -WX_CHECK_BUILD_OPTIONS("wxQA") - // ---------------------------------------------------------------------------- // XmlStackWalker: stack walker specialization which dumps stack in XML // ---------------------------------------------------------------------------- diff --git a/src/common/dlgcmn.cpp b/src/common/dlgcmn.cpp index 9914266c05..55e37cc2e6 100644 --- a/src/common/dlgcmn.cpp +++ b/src/common/dlgcmn.cpp @@ -44,9 +44,7 @@ #include "wx/textwrapper.h" #include "wx/modalhook.h" -#if wxUSE_DISPLAY #include "wx/display.h" -#endif extern WXDLLEXPORT_DATA(const char) wxDialogNameStr[] = "dialog"; @@ -873,11 +871,7 @@ int wxStandardDialogLayoutAdapter::DoMustScroll(wxDialog* dialog, wxSize& window wxSize minWindowSize = dialog->GetSizer()->GetMinSize(); windowSize = dialog->GetSize(); windowSize = wxSize(wxMax(windowSize.x, minWindowSize.x), wxMax(windowSize.y, minWindowSize.y)); -#if wxUSE_DISPLAY displaySize = wxDisplay(wxDisplay::GetFromWindow(dialog)).GetClientArea().GetSize(); -#else - displaySize = wxGetClientDisplayRect().GetSize(); -#endif int flags = 0; diff --git a/src/common/dpycmn.cpp b/src/common/dpycmn.cpp index ecc744d4aa..d0073ee32c 100644 --- a/src/common/dpycmn.cpp +++ b/src/common/dpycmn.cpp @@ -29,8 +29,9 @@ #include "wx/module.h" #endif //WX_PRECOMP -#include "wx/display.h" -#include "wx/display_impl.h" +#include "wx/math.h" + +#include "wx/private/display.h" #if wxUSE_DISPLAY @@ -50,43 +51,6 @@ const wxVideoMode wxDefaultVideoMode; // created on demand and destroyed by wxDisplayModule static wxDisplayFactory *gs_factory = NULL; -// ---------------------------------------------------------------------------- -// wxDisplayImplSingle: trivial implementation working for main display only -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxDisplayImplSingle : public wxDisplayImpl -{ -public: - wxDisplayImplSingle() : wxDisplayImpl(0) { } - - virtual wxRect GetGeometry() const wxOVERRIDE - { - wxRect r; - wxDisplaySize(&r.width, &r.height); - return r; - } - - virtual wxRect GetClientArea() const wxOVERRIDE { return wxGetClientDisplayRect(); } - - virtual wxString GetName() const wxOVERRIDE { return wxString(); } - -#if wxUSE_DISPLAY - // no video modes support for us, provide just the stubs - - virtual wxArrayVideoModes GetModes(const wxVideoMode& WXUNUSED(mode)) const wxOVERRIDE - { - return wxArrayVideoModes(); - } - - virtual wxVideoMode GetCurrentMode() const wxOVERRIDE { return wxVideoMode(); } - - virtual bool ChangeMode(const wxVideoMode& WXUNUSED(mode)) wxOVERRIDE { return false; } -#endif // wxUSE_DISPLAY - - - wxDECLARE_NO_COPY_CLASS(wxDisplayImplSingle); -}; - // ---------------------------------------------------------------------------- // wxDisplayModule is used to cleanup gs_factory // ---------------------------------------------------------------------------- @@ -115,15 +79,10 @@ wxIMPLEMENT_DYNAMIC_CLASS(wxDisplayModule, wxModule); wxDisplay::wxDisplay(unsigned n) { - wxASSERT_MSG( n < GetCount(), + wxASSERT_MSG( n == 0 || n < GetCount(), wxT("An invalid index was passed to wxDisplay") ); - m_impl = Factory().CreateDisplay(n); -} - -wxDisplay::~wxDisplay() -{ - delete m_impl; + m_impl = Factory().GetDisplay(n); } // ---------------------------------------------------------------------------- @@ -165,6 +124,20 @@ wxRect wxDisplay::GetClientArea() const return m_impl->GetClientArea(); } +wxSize wxDisplay::GetPPI() const +{ + wxCHECK_MSG( IsOk(), wxSize(), wxT("invalid wxDisplay object") ); + + return m_impl->GetPPI(); +} + +int wxDisplay::GetDepth() const +{ + wxCHECK_MSG( IsOk(), 0, wxT("invalid wxDisplay object") ); + + return m_impl->GetDepth(); +} + wxString wxDisplay::GetName() const { wxCHECK_MSG( IsOk(), wxString(), wxT("invalid wxDisplay object") ); @@ -206,16 +179,6 @@ bool wxDisplay::ChangeMode(const wxVideoMode& mode) // static functions implementation // ---------------------------------------------------------------------------- -// if wxUSE_DISPLAY == 1 this is implemented in port-specific code -#if !wxUSE_DISPLAY - -/* static */ wxDisplayFactory *wxDisplay::CreateFactory() -{ - return new wxDisplayFactorySingle; -} - -#endif // !wxUSE_DISPLAY - /* static */ wxDisplayFactory& wxDisplay::Factory() { if ( !gs_factory ) @@ -226,10 +189,39 @@ bool wxDisplay::ChangeMode(const wxVideoMode& mode) return *gs_factory; } +// ============================================================================ +// wxDisplayImpl implementation +// ============================================================================ + +wxSize wxDisplayImpl::GetPPI() const +{ + const wxSize pixels = GetGeometry().GetSize(); + const wxSize mm = GetSizeMM(); + + if ( !mm.x || !mm.y ) + { + // Physical size is unknown, return a special value indicating that we + // can't compute the resolution -- what else can we do? + return wxSize(0, 0); + } + + return wxSize(wxRound((pixels.x * inches2mm) / mm.x), + wxRound((pixels.y * inches2mm) / mm.y)); +} + // ============================================================================ // wxDisplayFactory implementation // ============================================================================ +wxDisplayFactory::~wxDisplayFactory() +{ + for ( size_t n = 0; n < m_impls.size(); ++n ) + { + // It can be null, that's ok. + delete m_impls[n]; + } +} + int wxDisplayFactory::GetFromWindow(const wxWindow *window) { // consider that the window belongs to the display containing its centre @@ -241,24 +233,13 @@ int wxDisplayFactory::GetFromWindow(const wxWindow *window) // wxDisplayFactorySingle implementation // ============================================================================ -/* static */ wxDisplayImpl *wxDisplayFactorySingle::CreateDisplay(unsigned n) { // we recognize the main display only - return n != 0 ? NULL : new wxDisplayImplSingle; + return n != 0 ? NULL : CreateSingleDisplay(); } int wxDisplayFactorySingle::GetFromPoint(const wxPoint& pt) { - if ( pt.x >= 0 && pt.y >= 0 ) - { - int w, h; - wxDisplaySize(&w, &h); - - if ( pt.x < w && pt.y < h ) - return 0; - } - - // the point is outside of the screen - return wxNOT_FOUND; + return wxDisplay().GetGeometry().Contains(pt) ? 0 : wxNOT_FOUND; } diff --git a/src/common/fontcmn.cpp b/src/common/fontcmn.cpp index f5c47bd001..74f105e2a2 100644 --- a/src/common/fontcmn.cpp +++ b/src/common/fontcmn.cpp @@ -812,9 +812,9 @@ wxString wxNativeFontInfo::ToString() const { wxString s; - s.Printf(wxT("%d;%f;%d;%d;%d;%d;%d;%s;%d"), + s.Printf(wxT("%d;%s;%d;%d;%d;%d;%d;%s;%d"), 1, // version - GetFractionalPointSize(), + wxString::FromCDouble(GetFractionalPointSize()), family, (int)style, weight, diff --git a/src/common/gdicmn.cpp b/src/common/gdicmn.cpp index 6d16a12d60..0b2d514408 100644 --- a/src/common/gdicmn.cpp +++ b/src/common/gdicmn.cpp @@ -16,6 +16,8 @@ #endif #include "wx/gdicmn.h" + +#include "wx/display.h" #include "wx/gdiobj.h" #ifndef WX_PRECOMP @@ -843,34 +845,73 @@ wxFont *wxFontList::FindOrCreateFont(int pointSize, return font; } +int wxDisplayDepth() +{ + return wxDisplay().GetDepth(); +} + +bool wxColourDisplay() +{ + // If GetDepth() returns 0, meaning unknown, we assume it's a colour + // display, hence the use of "!=" rather than ">" here. + return wxDisplay().GetDepth() != 1; +} + +void wxDisplaySize(int *width, int *height) +{ + const wxSize size = wxGetDisplaySize(); + if ( width ) + *width = size.x; + if ( height ) + *height = size.y; +} + wxSize wxGetDisplaySize() { - int x, y; - wxDisplaySize(& x, & y); - return wxSize(x, y); + return wxDisplay().GetGeometry().GetSize(); +} + +void wxClientDisplayRect(int *x, int *y, int *width, int *height) +{ + const wxRect rect = wxGetClientDisplayRect(); + if ( x ) + *x = rect.x; + if ( y ) + *y = rect.y; + if ( width ) + *width = rect.width; + if ( height ) + *height = rect.height; } wxRect wxGetClientDisplayRect() { - int x, y, width, height; - wxClientDisplayRect(&x, &y, &width, &height); // call plat-specific version - return wxRect(x, y, width, height); + return wxDisplay().GetClientArea(); +} + +void wxDisplaySizeMM(int *width, int *height) +{ + const wxSize size = wxGetDisplaySizeMM(); + if ( width ) + *width = size.x; + if ( height ) + *height = size.y; } wxSize wxGetDisplaySizeMM() { - int x, y; - wxDisplaySizeMM(& x, & y); - return wxSize(x, y); + const wxSize ppi = wxGetDisplayPPI(); + if ( !ppi.x || !ppi.y ) + return wxSize(0, 0); + + const wxSize pixels = wxGetDisplaySize(); + return wxSize(wxRound(pixels.x * inches2mm / ppi.x), + wxRound(pixels.y * inches2mm / ppi.y)); } wxSize wxGetDisplayPPI() { - const wxSize pixels = wxGetDisplaySize(); - const wxSize mm = wxGetDisplaySizeMM(); - - return wxSize((int)((pixels.x * inches2mm) / mm.x), - (int)((pixels.y * inches2mm) / mm.y)); + return wxDisplay().GetPPI(); } wxResourceCache::~wxResourceCache () diff --git a/src/common/hyperlnkcmn.cpp b/src/common/hyperlnkcmn.cpp index aacbec2149..ff83c4bdc4 100644 --- a/src/common/hyperlnkcmn.cpp +++ b/src/common/hyperlnkcmn.cpp @@ -127,13 +127,13 @@ wxHyperlinkCtrlBase::CheckParams(const wxString& label, void wxHyperlinkCtrlBase::SendEvent() { - wxString url = GetURL(); + const wxString& url = GetURL(); wxHyperlinkEvent linkEvent(this, GetId(), url); if (!GetEventHandler()->ProcessEvent(linkEvent)) // was the event skipped ? { if (!wxLaunchDefaultBrowser(url)) { - wxLogWarning(wxT("Could not launch the default browser with url '%s' !"), url.c_str()); + wxLogWarning(_("Failed to open URL \"%s\" in the default browser"), url); } } } diff --git a/src/common/log.cpp b/src/common/log.cpp index d5a59ff502..653c35cc3b 100644 --- a/src/common/log.cpp +++ b/src/common/log.cpp @@ -1108,7 +1108,7 @@ static const wxChar* GetSysErrorMsg(wxChar* szBuf, size_t sizeBuf, unsigned long char buffer[1024]; char *errorMsg = buffer; -#ifdef _GNU_SOURCE // GNU-specific strerror_r +#if defined(__GLIBC__) && defined(_GNU_SOURCE) // GNU-specific strerror_r // GNU's strerror_r has a weird interface -- it doesn't // necessarily copy anything to the buffer given; use return // value instead. diff --git a/src/common/ownerdrwcmn.cpp b/src/common/ownerdrwcmn.cpp index 967a5a285b..faa6b4240a 100644 --- a/src/common/ownerdrwcmn.cpp +++ b/src/common/ownerdrwcmn.cpp @@ -36,6 +36,12 @@ #include "wx/utils.h" #endif +// ---------------------------------------------------------------------------- +// constants for base class +// ---------------------------------------------------------------------------- + +int wxOwnerDrawnBase::ms_defaultMargin = 3; + // ============================================================================ // implementation // ============================================================================ diff --git a/src/common/popupcmn.cpp b/src/common/popupcmn.cpp index e69ad0d2ad..f3ebf49c90 100644 --- a/src/common/popupcmn.cpp +++ b/src/common/popupcmn.cpp @@ -46,8 +46,6 @@ #elif defined(__WXGTK__) #include #define gtk_widget_get_window(x) x->window -#elif defined(__WXMSW__) - #include "wx/msw/private.h" #elif defined(__WXX11__) #include "wx/x11/private.h" #endif @@ -59,6 +57,8 @@ wxIMPLEMENT_DYNAMIC_CLASS(wxPopupTransientWindow, wxPopupWindow); wxIMPLEMENT_DYNAMIC_CLASS(wxPopupComboWindow, wxPopupTransientWindow); #endif +#ifndef __WXMSW__ + // ---------------------------------------------------------------------------- // private classes // ---------------------------------------------------------------------------- @@ -113,11 +113,13 @@ wxBEGIN_EVENT_TABLE(wxPopupFocusHandler, wxEvtHandler) wxEND_EVENT_TABLE() wxBEGIN_EVENT_TABLE(wxPopupTransientWindow, wxPopupWindow) -#if defined(__WXMSW__) || (defined(__WXMAC__) && wxOSX_USE_COCOA_OR_CARBON) +#if defined(__WXMAC__) && wxOSX_USE_COCOA_OR_CARBON EVT_IDLE(wxPopupTransientWindow::OnIdle) #endif wxEND_EVENT_TABLE() +#endif // !__WXMSW__ + // ============================================================================ // implementation // ============================================================================ @@ -133,6 +135,12 @@ wxPopupWindowBase::~wxPopupWindowBase() bool wxPopupWindowBase::Create(wxWindow* WXUNUSED(parent), int WXUNUSED(flags)) { + // By default, block event propagation at this window as it usually + // doesn't make sense. This notably prevents wxScrolledWindow from trying + // to scroll popup contents into view if a popup is shown from it but + // extends beyond its window boundaries. + SetExtraStyle(GetExtraStyle() | wxWS_EX_BLOCK_EVENTS); + return true; } @@ -201,6 +209,27 @@ void wxPopupWindowBase::Position(const wxPoint& ptOrigin, Move(x, y, wxSIZE_NO_ADJUSTMENTS); } +// ---------------------------------------------------------------------------- +// wxPopupTransientWindowBase +// ---------------------------------------------------------------------------- + +bool wxPopupTransientWindowBase::Destroy() +{ + // The popup window can be deleted at any moment, even while some events + // are still being processed for it, so delay its real destruction until + // the next idle time when we're sure that it's safe to really destroy it. + + wxCHECK_MSG( !wxPendingDelete.Member(this), false, + wxS("Shouldn't destroy the popup twice.") ); + + wxPendingDelete.Append(this); + + return true; +} + +// MSW implementation is in platform-specific src/msw/popupwin.cpp. +#ifndef __WXMSW__ + // ---------------------------------------------------------------------------- // wxPopupTransientWindow // ---------------------------------------------------------------------------- @@ -292,18 +321,10 @@ void wxPopupTransientWindow::Popup(wxWindow *winFocus) m_child->PushEventHandler(m_handlerPopup); -#if defined(__WXMSW__) - // Focusing on child of popup window does not work on MSW unless WS_POPUP - // style is set. We do not even want to try to set the focus, as it may - // provoke errors on some Windows versions (Vista and later). - if ( ::GetWindowLong(GetHwnd(), GWL_STYLE) & WS_POPUP ) -#endif - { - m_focus = winFocus ? winFocus : this; - m_focus->SetFocus(); - } + m_focus = winFocus ? winFocus : this; + m_focus->SetFocus(); -#if defined( __WXMSW__ ) || (defined( __WXMAC__) && wxOSX_USE_COCOA_OR_CARBON) +#if defined( __WXMAC__) && wxOSX_USE_COCOA_OR_CARBON // MSW doesn't allow to set focus to the popup window, but we need to // subclass the window which has the focus, and not winFocus passed in or // otherwise everything else breaks down @@ -354,7 +375,7 @@ bool wxPopupTransientWindow::Show( bool show ) } #endif -#if defined( __WXMSW__ ) || defined( __WXMAC__) +#if defined( __WXMAC__) if (!show && m_child && m_child->HasCapture()) { m_child->ReleaseMouse(); @@ -414,7 +435,7 @@ bool wxPopupTransientWindow::Show( bool show ) } #endif -#if defined( __WXMSW__ ) || defined( __WXMAC__) +#if defined( __WXMAC__) if (show && m_child) { // Assume that the mouse is outside the popup to begin with @@ -425,44 +446,13 @@ bool wxPopupTransientWindow::Show( bool show ) return ret; } -bool wxPopupTransientWindow::Destroy() -{ - // The popup window can be deleted at any moment, even while some events - // are still being processed for it, so delay its real destruction until - // the next idle time when we're sure that it's safe to really destroy it. - - wxCHECK_MSG( !wxPendingDelete.Member(this), false, - wxS("Shouldn't destroy the popup twice.") ); - - wxPendingDelete.Append(this); - - return true; -} - void wxPopupTransientWindow::Dismiss() { Hide(); PopHandlers(); } -void wxPopupTransientWindow::DismissAndNotify() -{ - Dismiss(); - OnDismiss(); -} - -void wxPopupTransientWindow::OnDismiss() -{ - // nothing to do here - but it may be interesting for derived class -} - -bool wxPopupTransientWindow::ProcessLeftDown(wxMouseEvent& WXUNUSED(event)) -{ - // no special processing here - return false; -} - -#if defined(__WXMSW__) ||(defined(__WXMAC__) && wxOSX_USE_COCOA_OR_CARBON) +#if defined(__WXMAC__) && wxOSX_USE_COCOA_OR_CARBON void wxPopupTransientWindow::OnIdle(wxIdleEvent& event) { event.Skip(); @@ -500,6 +490,7 @@ void wxPopupTransientWindow::OnIdle(wxIdleEvent& event) } #endif // wxOSX/Carbon +#endif // !__WXMSW__ #if wxUSE_COMBOBOX && defined(__WXUNIVERSAL__) @@ -555,6 +546,8 @@ void wxPopupComboWindow::OnKeyDown(wxKeyEvent& event) #endif // wxUSE_COMBOBOX && defined(__WXUNIVERSAL__) +#ifndef __WXMSW__ + // ---------------------------------------------------------------------------- // wxPopupWindowHandler // ---------------------------------------------------------------------------- @@ -696,4 +689,6 @@ void wxPopupFocusHandler::OnChar(wxKeyEvent& event) } } +#endif // !__WXMSW__ + #endif // wxUSE_POPUPWIN diff --git a/src/common/sizer.cpp b/src/common/sizer.cpp index ba50b6c9c0..fa42c07497 100644 --- a/src/common/sizer.cpp +++ b/src/common/sizer.cpp @@ -2544,6 +2544,31 @@ wxSize wxBoxSizer::CalcMin() return m_calculatedMinSize; } +bool +wxBoxSizer::InformFirstDirection(int direction, int size, int availableOtherDir) +{ + // In principle, we could propagate the information about the size in the + // sizer major direction too, but this would require refactoring CalcMin() + // to determine the actual sizes all our items would have with the given + // size and we don't do this yet, so for now handle only the simpler case + // of informing all our items about their size in the orthogonal direction. + if ( direction == GetOrientation() ) + return false; + + bool didUse = false; + + for ( wxSizerItemList::compatibility_iterator node = m_children.GetFirst(); + node; + node = node->GetNext() ) + { + didUse |= node->GetData()->InformFirstDirection(direction, + size, + availableOtherDir); + } + + return didUse; +} + //--------------------------------------------------------------------------- // wxStaticBoxSizer //--------------------------------------------------------------------------- diff --git a/src/common/translation.cpp b/src/common/translation.cpp index b092eaa9f9..bf92ed2942 100644 --- a/src/common/translation.cpp +++ b/src/common/translation.cpp @@ -248,9 +248,53 @@ wxString GetPreferredUILanguage(const wxArrayString& available) #else -// On Unix, there's just one language=locale setting, so we should always -// use that. -#define GetPreferredUILanguage GetPreferredUILanguageFallback +// When the preferred UI language is determined, the LANGUAGE environment +// variable is the primary source of preference. +// http://www.gnu.org/software/gettext/manual/html_node/Locale-Environment-Variables.html +// +// The LANGUAGE variable may contain a colon separated list of language +// codes in the order of preference. +// http://www.gnu.org/software/gettext/manual/html_node/The-LANGUAGE-variable.html +wxString GetPreferredUILanguage(const wxArrayString& available) +{ + wxString languageFromEnv; + wxArrayString preferred; + if ( wxGetEnv("LANGUAGE", &languageFromEnv) ) + { + wxStringTokenizer tknzr(languageFromEnv, ":"); + while ( tknzr.HasMoreTokens() ) + { + const wxString tok = tknzr.GetNextToken(); + if ( const wxLanguageInfo *li = wxLocale::FindLanguageInfo(tok) ) + { + preferred.push_back(li->CanonicalName); + } + } + if ( preferred.empty() ) + { + wxLogTrace(TRACE_I18N, " - LANGUAGE was set, but it didn't contain any languages recognized by the system"); + } + } + + LogTraceArray(" - preferred languages from environment", preferred); + for ( wxArrayString::const_iterator j = preferred.begin(); + j != preferred.end(); + ++j ) + { + wxString lang(*j); + if ( available.Index(lang) != wxNOT_FOUND ) + return lang; + size_t pos = lang.find('_'); + if ( pos != wxString::npos ) + { + lang = lang.substr(0, pos); + if ( available.Index(lang) != wxNOT_FOUND ) + return lang; + } + } + + return GetPreferredUILanguageFallback(available); +} #endif diff --git a/src/dfb/utils.cpp b/src/dfb/utils.cpp index 57e9a3d1a1..4cbd60253f 100644 --- a/src/dfb/utils.cpp +++ b/src/dfb/utils.cpp @@ -17,6 +17,7 @@ #include "wx/utils.h" #include "wx/evtloop.h" #include "wx/apptrait.h" +#include "wx/private/display.h" #include "wx/unix/private/timer.h" #ifndef WX_PRECOMP @@ -56,48 +57,45 @@ wxTimerImpl *wxGUIAppTraits::CreateTimerImpl(wxTimer *timer) // display characteristics // ---------------------------------------------------------------------------- -bool wxColourDisplay() +// TODO: move into a separate src/dfb/display.cpp + +class wxDisplayImplSingleDFB : public wxDisplayImplSingle { - #warning "FIXME: wxColourDisplay" - return true; -} +public: + virtual wxRect GetGeometry() const wxOVERRIDE + { + const wxVideoMode mode(wxTheApp->GetDisplayMode()); -int wxDisplayDepth() + return wxRect(0, 0, mode.w, mode.h); + } + + virtual int GetDepth() const wxOVERRIDE + { + return wxTheApp->GetDisplayMode().bpp; + } + + virtual wxSize GetPPI() const wxOVERRIDE + { + // FIXME: there's no way to get physical resolution using the DirectDB + // API, we hardcode a commonly used value of 72dpi + return wxSize(72, 72); + } +}; + +class wxDisplayFactorySingleDFB : public wxDisplayFactorySingle { - return wxTheApp->GetDisplayMode().bpp; -} +protected: + virtual wxDisplayImpl *CreateSingleDisplay() + { + return new wxDisplayImplSingleDFB; + } +}; -void wxDisplaySize(int *width, int *height) +wxDisplayFactory* wxDisplay::CreateFactory() { - wxVideoMode mode(wxTheApp->GetDisplayMode()); - if ( width ) *width = mode.w; - if ( height ) *height = mode.h; + return new wxDisplayFactorySingleDFB; } -void wxDisplaySizeMM(int *width, int *height) -{ - // FIXME: there's no way to get physical resolution using the DirectDB - // API, we hardcode a commonly used value of 72dpi - #define DPI 72.0 - #define PX_TO_MM(x) (int(((x) / DPI) * inches2mm)) - - wxDisplaySize(width, height); - if ( width ) *width = PX_TO_MM(*width); - if ( height ) *height = PX_TO_MM(*height); - - #undef DPI - #undef PX_TO_MM -} - -void wxClientDisplayRect(int *x, int *y, int *width, int *height) -{ - // return desktop dimensions minus any panels, menus, trays: - if (x) *x = 0; - if (y) *y = 0; - wxDisplaySize(width, height); -} - - //----------------------------------------------------------------------------- // mouse //----------------------------------------------------------------------------- diff --git a/src/generic/bannerwindow.cpp b/src/generic/bannerwindow.cpp index 15c2719b67..6c0b234747 100644 --- a/src/generic/bannerwindow.cpp +++ b/src/generic/bannerwindow.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: wx/bannerwindow.h +// Name: src/generic/bannerwindow.cpp // Purpose: wxBannerWindow class implementation // Author: Vadim Zeitlin // Created: 2011-08-16 diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 719f6ee122..2e1d1887e1 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -806,7 +806,7 @@ public: bool IsRowSelected( unsigned int row ); void SendSelectionChangedEvent( const wxDataViewItem& item); - void RefreshRow( unsigned int row ); + void RefreshRow( unsigned int row ) { RefreshRows(row, row); } void RefreshRows( unsigned int from, unsigned int to ); void RefreshRowsAfter( unsigned int firstRow ); @@ -816,7 +816,7 @@ public: return wxSystemSettings::GetColour(wxSYS_COLOUR_3DLIGHT); } - wxRect GetLineRect( unsigned int row ) const; + wxRect GetLinesRect( unsigned int rowFrom, unsigned int rowTo ) const; int GetLineStart( unsigned int row ) const; // row * m_lineHeight in fixed mode int GetLineHeight( unsigned int row ) const; // m_lineHeight in fixed mode @@ -3275,34 +3275,16 @@ void wxDataViewMainWindow::SendSelectionChangedEvent( const wxDataViewItem& item m_owner->ProcessWindowEvent(le); } -void wxDataViewMainWindow::RefreshRow( unsigned int row ) -{ - wxRect rect( 0, GetLineStart( row ), GetEndOfLastCol(), GetLineHeight( row ) ); - m_owner->CalcScrolledPosition( rect.x, rect.y, &rect.x, &rect.y ); - - wxSize client_size = GetClientSize(); - wxRect client_rect( 0, 0, client_size.x, client_size.y ); - wxRect intersect_rect = client_rect.Intersect( rect ); - if (intersect_rect.width > 0) - Refresh( true, &intersect_rect ); -} - void wxDataViewMainWindow::RefreshRows( unsigned int from, unsigned int to ) { - if (from > to) - { - unsigned int tmp = to; - to = from; - from = tmp; - } + wxRect rect = GetLinesRect(from, to); - wxRect rect( 0, GetLineStart( from ), GetEndOfLastCol(), GetLineStart( (to-from+1) ) ); - m_owner->CalcScrolledPosition( rect.x, rect.y, &rect.x, &rect.y ); + m_owner->CalcScrolledPosition(rect.x, rect.y, &rect.x, &rect.y); wxSize client_size = GetClientSize(); wxRect client_rect( 0, 0, client_size.x, client_size.y ); wxRect intersect_rect = client_rect.Intersect( rect ); - if (intersect_rect.width > 0) + if (!intersect_rect.IsEmpty()) Refresh( true, &intersect_rect ); } @@ -3318,14 +3300,22 @@ void wxDataViewMainWindow::RefreshRowsAfter( unsigned int firstRow ) Refresh( true, &rect ); } -wxRect wxDataViewMainWindow::GetLineRect( unsigned int row ) const +wxRect wxDataViewMainWindow::GetLinesRect( unsigned int rowFrom, unsigned int rowTo ) const { + if (rowFrom > rowTo) + wxSwap(rowFrom, rowTo); + wxRect rect; rect.x = 0; - rect.y = GetLineStart( row ); - rect.width = GetEndOfLastCol(); - rect.height = GetLineHeight( row ); - + rect.y = GetLineStart(rowFrom); + // Don't calculate exact width of the row, because GetEndOfLastCol() is + // expensive to call, and controls with rows not spanning entire width rare. + // It is more efficient to e.g. repaint empty parts of the window needlessly. + rect.width = INT_MAX; + if (rowFrom == rowTo) + rect.height = GetLineHeight(rowFrom); + else + rect.height = GetLineStart(rowTo) - rect.y + GetLineHeight(rowTo); return rect; } diff --git a/src/generic/editlbox.cpp b/src/generic/editlbox.cpp index 074fa5fac2..f472e79ec9 100644 --- a/src/generic/editlbox.cpp +++ b/src/generic/editlbox.cpp @@ -121,61 +121,53 @@ bool wxEditableListBox::Create(wxWindow *parent, wxWindowID id, wxPanel *subp = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER | wxTAB_TRAVERSAL); wxSizer *subsizer = new wxBoxSizer(wxHORIZONTAL); - subsizer->Add(new wxStaticText(subp, wxID_ANY, label), 1, wxALIGN_CENTRE_VERTICAL | wxLEFT, 4); -#ifdef __WXMSW__ - #define BTN_BORDER 4 - // FIXME - why is this needed? There's some reason why sunken border is - // ignored by sizers in wxMSW but not in wxGTK that I can't - // figure out... -#else - #define BTN_BORDER 0 -#endif + subsizer->Add(new wxStaticText(subp, wxID_ANY, label), + wxSizerFlags(1).Center().Border(wxLEFT)); + + const wxSizerFlags flagsCentered = wxSizerFlags().Center(); if ( m_style & wxEL_ALLOW_EDIT ) { m_bEdit = new wxBitmapButton(subp, wxID_ELB_EDIT, wxArtProvider::GetBitmap(wxART_EDIT, wxART_BUTTON)); - subsizer->Add(m_bEdit, 0, wxALIGN_CENTRE_VERTICAL | wxTOP | wxBOTTOM, BTN_BORDER); + m_bEdit->SetToolTip(_("Edit item")); + subsizer->Add(m_bEdit, flagsCentered); } if ( m_style & wxEL_ALLOW_NEW ) { m_bNew = new wxBitmapButton(subp, wxID_ELB_NEW, wxArtProvider::GetBitmap(wxART_NEW, wxART_BUTTON)); - subsizer->Add(m_bNew, 0, wxALIGN_CENTRE_VERTICAL | wxTOP | wxBOTTOM, BTN_BORDER); + m_bNew->SetToolTip(_("New item")); + subsizer->Add(m_bNew, flagsCentered); } if ( m_style & wxEL_ALLOW_DELETE ) { m_bDel = new wxBitmapButton(subp, wxID_ELB_DELETE, wxArtProvider::GetBitmap(wxART_DELETE, wxART_BUTTON)); - subsizer->Add(m_bDel, 0, wxALIGN_CENTRE_VERTICAL | wxTOP | wxBOTTOM, BTN_BORDER); + m_bDel->SetToolTip(_("Delete item")); + subsizer->Add(m_bDel, flagsCentered); } if (!(m_style & wxEL_NO_REORDER)) { m_bUp = new wxBitmapButton(subp, wxID_ELB_UP, wxArtProvider::GetBitmap(wxART_GO_UP, wxART_BUTTON)); - subsizer->Add(m_bUp, 0, wxALIGN_CENTRE_VERTICAL | wxTOP | wxBOTTOM, BTN_BORDER); + m_bUp->SetToolTip(_("Move up")); + subsizer->Add(m_bUp, flagsCentered); m_bDown = new wxBitmapButton(subp, wxID_ELB_DOWN, wxArtProvider::GetBitmap(wxART_GO_DOWN, wxART_BUTTON)); - subsizer->Add(m_bDown, 0, wxALIGN_CENTRE_VERTICAL | wxTOP | wxBOTTOM, BTN_BORDER); + m_bDown->SetToolTip(_("Move down")); + subsizer->Add(m_bDown, flagsCentered); } -#if wxUSE_TOOLTIPS - if ( m_bEdit ) m_bEdit->SetToolTip(_("Edit item")); - if ( m_bNew ) m_bNew->SetToolTip(_("New item")); - if ( m_bDel ) m_bDel->SetToolTip(_("Delete item")); - if ( m_bUp ) m_bUp->SetToolTip(_("Move up")); - if ( m_bDown ) m_bDown->SetToolTip(_("Move down")); -#endif - subp->SetSizer(subsizer); subsizer->Fit(subp); - sizer->Add(subp, 0, wxEXPAND); + sizer->Add(subp, wxSizerFlags().Expand()); long st = wxLC_REPORT | wxLC_NO_HEADER | wxLC_SINGLE_SEL | wxSUNKEN_BORDER; if ( style & wxEL_ALLOW_EDIT ) @@ -185,7 +177,7 @@ bool wxEditableListBox::Create(wxWindow *parent, wxWindowID id, wxArrayString empty_ar; SetStrings(empty_ar); - sizer->Add(m_listCtrl, 1, wxEXPAND); + sizer->Add(m_listCtrl, wxSizerFlags(1).Expand()); SetSizer(sizer); Layout(); diff --git a/src/generic/graphicc.cpp b/src/generic/graphicc.cpp index ce232060ad..7ed04b4bd4 100644 --- a/src/generic/graphicc.cpp +++ b/src/generic/graphicc.cpp @@ -41,7 +41,7 @@ bool wxCairoInit(); #include "wx/private/graphics.h" #include "wx/rawbmp.h" #include "wx/vector.h" -#if defined(__WXMSW__) && wxUSE_ENH_METAFILE +#ifdef __WXMSW__ #include "wx/msw/enhmeta.h" #endif diff --git a/src/generic/imaglist.cpp b/src/generic/imaglist.cpp index 14c8127a80..771373ce00 100644 --- a/src/generic/imaglist.cpp +++ b/src/generic/imaglist.cpp @@ -42,62 +42,52 @@ wxGenericImageList::~wxGenericImageList() int wxGenericImageList::GetImageCount() const { - return m_images.GetCount(); + return static_cast(m_images.size()); } bool wxGenericImageList::Create( int width, int height, bool WXUNUSED(mask), int WXUNUSED(initialCount) ) { - m_width = width; - m_height = height; + m_size = wxSize(width, height); - return Create(); -} - -bool wxGenericImageList::Create() -{ return true; } int wxGenericImageList::Add( const wxBitmap &bitmap ) { - wxASSERT_MSG( (bitmap.GetWidth() >= m_width && bitmap.GetHeight() == m_height) - || (m_width == 0 && m_height == 0), - wxT("invalid bitmap size in wxImageList: this might work ") - wxT("on this platform but definitely won't under Windows.") ); + // We use the scaled, i.e. logical, size here as image list images size is + // specified in logical pixels, just as window coordinates and sizes are. + const wxSize bitmapSize = bitmap.GetScaledSize(); - const int index = int(m_images.GetCount()); - - if (bitmap.IsKindOf(wxCLASSINFO(wxIcon))) + if ( m_size == wxSize(0, 0) ) { - m_images.Append( new wxIcon( (const wxIcon&) bitmap ) ); + // This is the first time Add() is called and we hadn't had any fixed + // size: adopt the size of our first bitmap as image size. + m_size = bitmapSize; } - else + else // We already have a fixed size, check that the bitmap conforms to it. { - // Mimic behaviour of Windows ImageList_Add that automatically breaks up the added - // bitmap into sub-images of the correct size - if (m_width > 0 && bitmap.GetWidth() > m_width && bitmap.GetHeight() >= m_height) + // There is a special case: a bitmap may contain more than one image, + // in which case we're supposed to chop it in parts, just as Windows + // ImageList_Add() does. + if ( bitmapSize.x > m_size.x && (bitmapSize.x % m_size.x == 0) ) { - int numImages = bitmap.GetWidth() / m_width; + const int numImages = bitmapSize.x / m_size.x; for (int subIndex = 0; subIndex < numImages; subIndex++) { - wxRect rect(m_width * subIndex, 0, m_width, m_height); - wxBitmap tmpBmp = bitmap.GetSubBitmap(rect); - m_images.Append( new wxBitmap(tmpBmp) ); + wxRect rect(m_size.x * subIndex, 0, m_size.x, m_size.y); + Add(bitmap.GetSubBitmap(rect)); } + + return GetImageCount() - 1; } - else - { - m_images.Append( new wxBitmap(bitmap) ); - } + + wxASSERT_MSG( bitmapSize == m_size, + "All bitmaps in wxImageList must have the same size" ); } - if (m_width == 0 && m_height == 0) - { - m_width = bitmap.GetWidth(); - m_height = bitmap.GetHeight(); - } + m_images.push_back(bitmap); - return index; + return GetImageCount() - 1; } int wxGenericImageList::Add( const wxBitmap& bitmap, const wxBitmap& mask ) @@ -115,128 +105,79 @@ int wxGenericImageList::Add( const wxBitmap& bitmap, const wxColour& maskColour return Add(wxBitmap(img)); } -const wxBitmap *wxGenericImageList::GetBitmapPtr( int index ) const +const wxBitmap *wxGenericImageList::DoGetPtr( int index ) const { - wxObjectList::compatibility_iterator node = m_images.Item( index ); + wxCHECK_MSG( index >= 0 && (size_t)index < m_images.size(), + NULL, wxT("wrong index in image list") ); - wxCHECK_MSG( node, NULL, wxT("wrong index in image list") ); - - return (wxBitmap*)node->GetData(); + return &m_images[index]; } // Get the bitmap wxBitmap wxGenericImageList::GetBitmap(int index) const { - const wxBitmap* bmp = GetBitmapPtr(index); - if (bmp) - return *bmp; - else + const wxBitmap* bmp = DoGetPtr(index); + if (!bmp) return wxNullBitmap; + + return *bmp; } // Get the icon wxIcon wxGenericImageList::GetIcon(int index) const { - const wxBitmap* bmp = GetBitmapPtr(index); - if (bmp) - { - wxIcon icon; - icon.CopyFromBitmap(*bmp); - return icon; - } - else + const wxBitmap* bmp = DoGetPtr(index); + if (!bmp) return wxNullIcon; + + wxIcon icon; + icon.CopyFromBitmap(*bmp); + return icon; } -bool wxGenericImageList::Replace( int index, const wxBitmap &bitmap ) +bool +wxGenericImageList::Replace(int index, + const wxBitmap& bitmap, + const wxBitmap& mask) { - wxObjectList::compatibility_iterator node = m_images.Item( index ); + // Call DoGetPtr() just to check the index validity. + if ( !DoGetPtr(index) ) + return false; - wxCHECK_MSG( node, false, wxT("wrong index in image list") ); + m_images[index] = bitmap; - wxBitmap* newBitmap = (bitmap.IsKindOf(wxCLASSINFO(wxIcon))) ? - new wxBitmap( (const wxIcon&) bitmap ) - : new wxBitmap(bitmap) ; - - if (index == (int) m_images.GetCount() - 1) - { - delete node->GetData(); - m_images.Erase( node ); - m_images.Append( newBitmap ); - } - else - { - wxObjectList::compatibility_iterator next = node->GetNext(); - delete node->GetData(); - m_images.Erase( node ); - m_images.Insert( next, newBitmap ); - } - - return true; -} - -bool wxGenericImageList::Replace( int index, const wxBitmap &bitmap, const wxBitmap &mask ) -{ - wxObjectList::compatibility_iterator node = m_images.Item( index ); - - wxCHECK_MSG( node, false, wxT("wrong index in image list") ); - - wxBitmap* newBitmap = (bitmap.IsKindOf(wxCLASSINFO(wxIcon))) ? - new wxBitmap( (const wxIcon&) bitmap ) - : new wxBitmap(bitmap) ; - - if (index == (int) m_images.GetCount() - 1) - { - delete node->GetData(); - m_images.Erase( node ); - m_images.Append( newBitmap ); - } - else - { - wxObjectList::compatibility_iterator next = node->GetNext(); - delete node->GetData(); - m_images.Erase( node ); - m_images.Insert( next, newBitmap ); - } - - if (mask.IsOk()) - newBitmap->SetMask(new wxMask(mask)); + if ( mask.IsOk() ) + m_images[index].SetMask(new wxMask(mask)); return true; } bool wxGenericImageList::Remove( int index ) { - wxObjectList::compatibility_iterator node = m_images.Item( index ); - - wxCHECK_MSG( node, false, wxT("wrong index in image list") ); - - delete node->GetData(); - m_images.Erase( node ); + m_images.erase(m_images.begin() + index); return true; } bool wxGenericImageList::RemoveAll() { - WX_CLEAR_LIST(wxObjectList, m_images); - m_images.Clear(); + m_images.clear(); return true; } bool wxGenericImageList::GetSize( int index, int &width, int &height ) const { - width = 0; - height = 0; + const wxBitmap* bmp = DoGetPtr(index); + if ( !bmp ) + { + width = 0; + height = 0; + return false; + } - wxObjectList::compatibility_iterator node = m_images.Item( index ); - - wxCHECK_MSG( node, false, wxT("wrong index in image list") ); - - wxBitmap *bm = (wxBitmap*)node->GetData(); - width = bm->GetWidth(); - height = bm->GetHeight(); + width = bmp->GetScaledWidth(); + height = bmp->GetScaledHeight(); return true; } @@ -244,16 +185,11 @@ bool wxGenericImageList::GetSize( int index, int &width, int &height ) const bool wxGenericImageList::Draw( int index, wxDC &dc, int x, int y, int flags, bool WXUNUSED(solidBackground) ) { - wxObjectList::compatibility_iterator node = m_images.Item( index ); + const wxBitmap* bmp = DoGetPtr(index); + if ( !bmp ) + return false; - wxCHECK_MSG( node, false, wxT("wrong index in image list") ); - - wxBitmap *bm = (wxBitmap*)node->GetData(); - - if (bm->IsKindOf(wxCLASSINFO(wxIcon))) - dc.DrawIcon( * ((wxIcon*) bm), x, y); - else - dc.DrawBitmap( *bm, x, y, (flags & wxIMAGELIST_DRAW_TRANSPARENT) > 0 ); + dc.DrawBitmap(*bmp, x, y, (flags & wxIMAGELIST_DRAW_TRANSPARENT) != 0); return true; } diff --git a/src/generic/numdlgg.cpp b/src/generic/numdlgg.cpp index 17c15f8788..0c0262384a 100644 --- a/src/generic/numdlgg.cpp +++ b/src/generic/numdlgg.cpp @@ -35,6 +35,7 @@ #include "wx/textctrl.h" #include "wx/intl.h" #include "wx/sizer.h" + #include "wx/wxcrtvararg.h" #endif #if wxUSE_STATLINE diff --git a/src/generic/renderg.cpp b/src/generic/renderg.cpp index fc2f39645d..eb5e1442c4 100644 --- a/src/generic/renderg.cpp +++ b/src/generic/renderg.cpp @@ -714,6 +714,8 @@ wxRendererGeneric::DrawCheckBox(wxWindow *WXUNUSED(win), wxSize wxRendererGeneric::GetCheckBoxSize(wxWindow *win) { + wxCHECK_MSG( win, wxSize(0, 0), "Must have a valid window" ); + return win->FromDIP(wxSize(16, 16)); } diff --git a/src/generic/scrlwing.cpp b/src/generic/scrlwing.cpp index c8256d61ca..a55f832d94 100644 --- a/src/generic/scrlwing.cpp +++ b/src/generic/scrlwing.cpp @@ -767,10 +767,18 @@ bool wxScrollHelperBase::ScrollLayout() // If we're the scroll target, take into account the // virtual size and scrolled position of the window. - int x = 0, y = 0, w = 0, h = 0; - CalcScrolledPosition(0,0, &x,&y); - m_win->GetVirtualSize(&w, &h); - m_win->GetSizer()->SetDimension(x, y, w, h); + wxSize size = m_win->GetVirtualSize(); + + // However we should use the real window size in the direction in which + // scrolling is disabled, if any. + const wxSize clientSize = m_win->GetClientSize(); + if ( !IsScrollbarShown(wxHORIZONTAL) ) + size.x = clientSize.x; + if ( !IsScrollbarShown(wxVERTICAL) ) + size.y = clientSize.y; + + m_win->GetSizer()->SetDimension(CalcScrolledPosition(wxPoint(0, 0)), + size); return true; } diff --git a/src/generic/wizard.cpp b/src/generic/wizard.cpp index 666ab84f47..3960216686 100644 --- a/src/generic/wizard.cpp +++ b/src/generic/wizard.cpp @@ -429,7 +429,10 @@ void wxWizard::AddButtonRow(wxBoxSizer *mainColumn) btnHelp=new wxButton(this, wxID_HELP, wxEmptyString, wxDefaultPosition, wxDefaultSize, buttonStyle); #endif - m_btnNext = new wxButton(this, wxID_FORWARD, _("&Next >")); + m_nextLabel = _("&Next >"); + m_finishLabel = _("&Finish"); + + m_btnNext = new wxButton(this, wxID_FORWARD, m_nextLabel); // Avoid Cmd+C closing dialog on Mac. wxString cancelLabel(_("&Cancel")); #ifdef __WXMAC__ @@ -629,7 +632,7 @@ bool wxWizard::ShowPage(wxWizardPage *page, bool goingForward) m_btnPrev->Enable(m_page != m_firstpage); const bool hasNext = HasNextPage(m_page); - const wxString label = hasNext ? _("&Next >") : _("&Finish"); + const wxString& label = hasNext ? m_nextLabel : m_finishLabel; if ( label != m_btnNext->GetLabel() ) m_btnNext->SetLabel(label); diff --git a/src/gtk/bitmap.cpp b/src/gtk/bitmap.cpp index 40f04c0b3c..cfd87549d9 100644 --- a/src/gtk/bitmap.cpp +++ b/src/gtk/bitmap.cpp @@ -981,6 +981,8 @@ bool wxBitmap::CreateScaled(int w, int h, int depth, double scale) double wxBitmap::GetScaleFactor() const { + wxCHECK_MSG(m_refData, -1, "invalid bitmap"); + return M_BMPDATA->m_scaleFactor; } diff --git a/src/gtk/dataview.cpp b/src/gtk/dataview.cpp index 97476600e1..8e1a6503a3 100644 --- a/src/gtk/dataview.cpp +++ b/src/gtk/dataview.cpp @@ -4461,10 +4461,11 @@ wxdataview_selection_changed_callback( GtkTreeSelection* WXUNUSED(selection), wx static void wxdataview_row_activated_callback( GtkTreeView* WXUNUSED(treeview), GtkTreePath *path, - GtkTreeViewColumn *WXUNUSED(column), wxDataViewCtrl *dv ) + GtkTreeViewColumn *column, wxDataViewCtrl *dv ) { wxDataViewItem item(dv->GTKPathToItem(path)); - wxDataViewEvent event(wxEVT_DATAVIEW_ITEM_ACTIVATED, dv, item); + wxDataViewEvent + event(wxEVT_DATAVIEW_ITEM_ACTIVATED, dv, dv->GTKColumnToWX(column), item); dv->HandleWindowEvent( event ); } @@ -4617,7 +4618,7 @@ wxDataViewCtrl::~wxDataViewCtrl() GtkTreeViewColumn *col; gtk_tree_view_get_cursor(GTK_TREE_VIEW(m_treeview), NULL, &col); - wxDataViewColumn * const wxcol = FromGTKColumn(col); + wxDataViewColumn * const wxcol = GTKColumnToWX(col); if ( wxcol ) { // This won't do anything if we're not editing it @@ -4862,7 +4863,7 @@ unsigned int wxDataViewCtrl::GetColumnCount() const return m_cols.GetCount(); } -wxDataViewColumn* wxDataViewCtrl::FromGTKColumn(GtkTreeViewColumn *gtk_col) const +wxDataViewColumn* wxDataViewCtrl::GTKColumnToWX(GtkTreeViewColumn *gtk_col) const { if ( !gtk_col ) return NULL; @@ -4886,7 +4887,7 @@ wxDataViewColumn* wxDataViewCtrl::GetColumn( unsigned int pos ) const { GtkTreeViewColumn *gtk_col = gtk_tree_view_get_column( GTK_TREE_VIEW(m_treeview), pos ); - return FromGTKColumn(gtk_col); + return GTKColumnToWX(gtk_col); } bool wxDataViewCtrl::DeleteColumn( wxDataViewColumn *column ) @@ -5058,7 +5059,7 @@ wxDataViewColumn *wxDataViewCtrl::GetCurrentColumn() const GtkTreeViewColumn *col; gtk_tree_view_get_cursor(GTK_TREE_VIEW(m_treeview), NULL, &col); - return FromGTKColumn(col); + return GTKColumnToWX(col); } void wxDataViewCtrl::EditItem(const wxDataViewItem& item, const wxDataViewColumn *column) diff --git a/src/gtk/display.cpp b/src/gtk/display.cpp index d3fc6e465c..07e1fc45f3 100644 --- a/src/gtk/display.cpp +++ b/src/gtk/display.cpp @@ -8,30 +8,162 @@ #include "wx/wxprec.h" -#if wxUSE_DISPLAY - #include "wx/display.h" - #include "wx/display_impl.h" -#endif -#include "wx/utils.h" // wxClientDisplayRect +#include "wx/private/display.h" #include "wx/gtk/private/wrapgtk.h" #ifdef GDK_WINDOWING_X11 + #ifndef __WXGTK4__ + #include "wx/unix/private/displayx11.h" + + #define wxGTK_HAVE_X11_DISPLAY + #endif + #include #endif +// This file is not used at all when using Win32. #if !defined(GDK_WINDOWING_WIN32) GdkWindow* wxGetTopLevelGDK(); -//----------------------------------------------------------------------------- +// There are 2 quite different implementations here: one for GTK+ 4 and the +// other one for the previous versions. -#ifndef __WXGTK4__ +#ifdef __WXGTK4__ -#ifdef GDK_WINDOWING_X11 -void wxGetWorkAreaX11(Screen* screen, int& x, int& y, int& width, int& height); -#endif +static inline GdkDisplay* GetDisplay() +{ + return gdk_window_get_display(wxGetTopLevelGDK()); +} + +// This class is always defined as it's used for the main display even when +// wxUSE_DISPLAY == 0. +class wxDisplayImplGTK : public wxDisplayImpl +{ + typedef wxDisplayImpl base_type; +public: + wxDisplayImplGTK(unsigned i); + virtual wxRect GetGeometry() const wxOVERRIDE; + virtual wxRect GetClientArea() const wxOVERRIDE; + virtual int GetDepth() const wxOVERRIDE; + virtual wxSize GetSizeMM() const wxOVERRIDE; + +#if wxUSE_DISPLAY + virtual bool IsPrimary() const wxOVERRIDE; + virtual wxArrayVideoModes GetModes(const wxVideoMode& mode) const wxOVERRIDE; + virtual wxVideoMode GetCurrentMode() const wxOVERRIDE; + virtual bool ChangeMode(const wxVideoMode& mode) wxOVERRIDE; +#endif // wxUSE_DISPLAY + + GdkMonitor* const m_monitor; +}; + +// This class is only defined when we're built with full display support. +#if wxUSE_DISPLAY +class wxDisplayFactoryGTK: public wxDisplayFactory +{ +public: + virtual wxDisplayImpl* CreateDisplay(unsigned n) wxOVERRIDE; + virtual unsigned GetCount() wxOVERRIDE; + virtual int GetFromPoint(const wxPoint& pt) wxOVERRIDE; +}; + +wxDisplayImpl* wxDisplayFactoryGTK::CreateDisplay(unsigned n) +{ + return new wxDisplayImplGTK(n); +} + +unsigned wxDisplayFactoryGTK::GetCount() +{ + return gdk_display_get_n_monitors(::GetDisplay()); +} + +int wxDisplayFactoryGTK::GetFromPoint(const wxPoint& pt) +{ + GdkRectangle rect; + GdkDisplay* display = ::GetDisplay(); + GdkMonitor* monitor = gdk_display_get_monitor_at_point(display, pt.x, pt.y); + gdk_monitor_get_geometry(monitor, &rect); + if (wxRect(rect.x, rect.y, rect.width, rect.height).Contains(pt)) + { + for (unsigned i = gdk_display_get_n_monitors(display); i--;) + { + if (gdk_display_get_monitor(display, i) == monitor) + return i; + } + } + return wxNOT_FOUND; +} +#endif // wxUSE_DISPLAY + +wxDisplayImplGTK::wxDisplayImplGTK(unsigned i) + : base_type(i) + , m_monitor(gdk_display_get_monitor(GetDisplay(), i)) +{ +} + +wxRect wxDisplayImplGTK::GetGeometry() const +{ + GdkRectangle rect; + gdk_monitor_get_geometry(m_monitor, &rect); + return wxRect(rect.x, rect.y, rect.width, rect.height); +} + +wxRect wxDisplayImplGTK::GetClientArea() const +{ + GdkRectangle rect; + gdk_monitor_get_workarea(m_monitor, &rect); + return wxRect(rect.x, rect.y, rect.width, rect.height); +} + +int wxDisplayImplGTK::GetDepth() const +{ + return 24; +} + +wxSize wxDisplayImplGTK::GetSizeMM() const +{ + return wxSize + ( + gdk_monitor_get_width_mm(m_monitor), + gdk_monitor_get_height_mm(m_monitor) + ); +} + +#if wxUSE_DISPLAY +bool wxDisplayImplGTK::IsPrimary() const +{ + return gdk_monitor_is_primary(m_monitor) != 0; +} + +wxArrayVideoModes +wxDisplayImplGTK::GetModes(const wxVideoMode& WXUNUSED(mode)) const +{ + return wxArrayVideoModes(); +} + +wxVideoMode wxDisplayImplGTK::GetCurrentMode() const +{ + return wxVideoMode(); +} + +bool wxDisplayImplGTK::ChangeMode(const wxVideoMode& WXUNUSED(mode)) +{ + return false; +} +#endif // wxUSE_DISPLAY + +#else // !__WXGTK4__ + +#ifdef __WXGTK3__ + +static inline bool wxIsX11GDKScreen(GdkScreen* screen) +{ + return GDK_IS_X11_SCREEN(screen); +} + +#else // !__WXGTK3__ -#ifndef __WXGTK3__ static inline int wx_gdk_screen_get_primary_monitor(GdkScreen* screen) { int monitor = 0; @@ -42,7 +174,13 @@ static inline int wx_gdk_screen_get_primary_monitor(GdkScreen* screen) return monitor; } #define gdk_screen_get_primary_monitor wx_gdk_screen_get_primary_monitor -#endif // !__WXGTK3__ + +static inline bool wxIsX11GDKScreen(GdkScreen* WXUNUSED(screen)) +{ + return true; +} + +#endif // __WXGTK3__/!__WXGTK3__ static inline void wx_gdk_screen_get_monitor_workarea(GdkScreen* screen, int monitor, GdkRectangle* dest) @@ -55,10 +193,8 @@ wx_gdk_screen_get_monitor_workarea(GdkScreen* screen, int monitor, GdkRectangle* #endif { gdk_screen_get_monitor_geometry(screen, monitor, dest); -#ifdef GDK_WINDOWING_X11 -#ifdef __WXGTK3__ - if (GDK_IS_X11_SCREEN(screen)) -#endif +#ifdef wxGTK_HAVE_X11_DISPLAY + if ( wxIsX11GDKScreen(screen) ) { GdkRectangle rect = { 0, 0, 0, 0 }; wxGetWorkAreaX11(GDK_SCREEN_XSCREEN(screen), @@ -67,39 +203,36 @@ wx_gdk_screen_get_monitor_workarea(GdkScreen* screen, int monitor, GdkRectangle* if (rect.width && rect.height) gdk_rectangle_intersect(dest, &rect, dest); } -#endif // GDK_WINDOWING_X11 +#endif // wxGTK_HAVE_X11_DISPLAY } wxGCC_WARNING_RESTORE() } #define gdk_screen_get_monitor_workarea wx_gdk_screen_get_monitor_workarea -#endif // !__WXGTK4__ - -void wxClientDisplayRect(int* x, int* y, int* width, int* height) +static inline GdkScreen* GetScreen() { - GdkRectangle rect; - GdkWindow* window = wxGetTopLevelGDK(); -#ifdef __WXGTK4__ - GdkMonitor* monitor = - gdk_display_get_monitor_at_window(gdk_window_get_display(window), window); - gdk_monitor_get_workarea(monitor, &rect); -#else - GdkScreen* screen = gdk_window_get_screen(window); - wxGCC_WARNING_SUPPRESS(deprecated-declarations) - int monitor = gdk_screen_get_monitor_at_window(screen, window); - gdk_screen_get_monitor_workarea(screen, monitor, &rect); - wxGCC_WARNING_RESTORE() -#endif - if (x) - *x = rect.x; - if (y) - *y = rect.y; - if (width) - *width = rect.width; - if (height) - *height = rect.height; + return gdk_window_get_screen(wxGetTopLevelGDK()); } -//----------------------------------------------------------------------------- + +class wxDisplayImplGTK : public wxDisplayImpl +{ + typedef wxDisplayImpl base_type; +public: + wxDisplayImplGTK(unsigned i); + virtual wxRect GetGeometry() const wxOVERRIDE; + virtual wxRect GetClientArea() const wxOVERRIDE; + virtual int GetDepth() const wxOVERRIDE; + virtual wxSize GetSizeMM() const wxOVERRIDE; + +#if wxUSE_DISPLAY + virtual bool IsPrimary() const wxOVERRIDE; + virtual wxArrayVideoModes GetModes(const wxVideoMode& mode) const wxOVERRIDE; + virtual wxVideoMode GetCurrentMode() const wxOVERRIDE; + virtual bool ChangeMode(const wxVideoMode& mode) wxOVERRIDE; +#endif // wxUSE_DISPLAY + + GdkScreen* const m_screen; +}; #if wxUSE_DISPLAY class wxDisplayFactoryGTK: public wxDisplayFactory @@ -110,37 +243,7 @@ public: virtual int GetFromPoint(const wxPoint& pt) wxOVERRIDE; }; -class wxDisplayImplGTK: public wxDisplayImpl -{ - typedef wxDisplayImpl base_type; -public: - wxDisplayImplGTK(unsigned i); - virtual wxRect GetGeometry() const wxOVERRIDE; - virtual wxRect GetClientArea() const wxOVERRIDE; - virtual wxString GetName() const wxOVERRIDE; - virtual bool IsPrimary() const wxOVERRIDE; - virtual wxArrayVideoModes GetModes(const wxVideoMode& mode) const wxOVERRIDE; - virtual wxVideoMode GetCurrentMode() const wxOVERRIDE; - virtual bool ChangeMode(const wxVideoMode& mode) wxOVERRIDE; -#ifdef __WXGTK4__ - GdkMonitor* const m_monitor; -#else - GdkScreen* const m_screen; -#endif -}; -//----------------------------------------------------------------------------- - -#ifdef __WXGTK4__ -static inline GdkDisplay* GetDisplay() -{ - return gdk_window_get_display(wxGetTopLevelGDK()); -} -#else -static inline GdkScreen* GetScreen() -{ - return gdk_window_get_screen(wxGetTopLevelGDK()); -} -#endif +wxGCC_WARNING_SUPPRESS(deprecated-declarations) wxDisplayImpl* wxDisplayFactoryGTK::CreateDisplay(unsigned n) { @@ -149,110 +252,86 @@ wxDisplayImpl* wxDisplayFactoryGTK::CreateDisplay(unsigned n) unsigned wxDisplayFactoryGTK::GetCount() { -#ifdef __WXGTK4__ - return gdk_display_get_n_monitors(GetDisplay()); -#else - wxGCC_WARNING_SUPPRESS(deprecated-declarations) return gdk_screen_get_n_monitors(GetScreen()); - wxGCC_WARNING_RESTORE() -#endif } int wxDisplayFactoryGTK::GetFromPoint(const wxPoint& pt) { GdkRectangle rect; -#ifdef __WXGTK4__ - GdkDisplay* display = GetDisplay(); - GdkMonitor* monitor = gdk_display_get_monitor_at_point(display, pt.x, pt.y); - gdk_monitor_get_geometry(monitor, &rect); - if (wxRect(rect.x, rect.y, rect.width, rect.height).Contains(pt)) - { - for (unsigned i = gdk_display_get_n_monitors(display); i--;) - { - if (gdk_display_get_monitor(display, i) == monitor) - return i; - } - } - return wxNOT_FOUND; -#else GdkScreen* screen = GetScreen(); - wxGCC_WARNING_SUPPRESS(deprecated-declarations) int monitor = gdk_screen_get_monitor_at_point(screen, pt.x, pt.y); gdk_screen_get_monitor_geometry(screen, monitor, &rect); - wxGCC_WARNING_RESTORE() if (!wxRect(rect.x, rect.y, rect.width, rect.height).Contains(pt)) monitor = wxNOT_FOUND; return monitor; -#endif } -//----------------------------------------------------------------------------- +#endif // wxUSE_DISPLAY wxDisplayImplGTK::wxDisplayImplGTK(unsigned i) : base_type(i) -#ifdef __WXGTK4__ - , m_monitor(gdk_display_get_monitor(GetDisplay(), i)) -#else , m_screen(GetScreen()) -#endif { } wxRect wxDisplayImplGTK::GetGeometry() const { GdkRectangle rect; -#ifdef __WXGTK4__ - gdk_monitor_get_geometry(m_monitor, &rect); -#else - wxGCC_WARNING_SUPPRESS(deprecated-declarations) gdk_screen_get_monitor_geometry(m_screen, m_index, &rect); - wxGCC_WARNING_RESTORE() -#endif return wxRect(rect.x, rect.y, rect.width, rect.height); } wxRect wxDisplayImplGTK::GetClientArea() const { GdkRectangle rect; -#ifdef __WXGTK4__ - gdk_monitor_get_workarea(m_monitor, &rect); -#else - wxGCC_WARNING_SUPPRESS(deprecated-declarations) gdk_screen_get_monitor_workarea(m_screen, m_index, &rect); - wxGCC_WARNING_RESTORE() -#endif return wxRect(rect.x, rect.y, rect.width, rect.height); } -wxString wxDisplayImplGTK::GetName() const +int wxDisplayImplGTK::GetDepth() const { - return wxString(); + // TODO: How to get the depth of the specific display? + return gdk_visual_get_depth(gdk_window_get_visual(wxGetTopLevelGDK())); } +wxSize wxDisplayImplGTK::GetSizeMM() const +{ + // At least in some configurations, gdk_screen_xxx_mm() functions return + // valid values when gdk_screen_get_monitor_xxx_mm() only return -1, so + // handle this case specially. + if ( IsPrimary() ) + { + return wxSize(gdk_screen_width_mm(), gdk_screen_height_mm()); + } + + wxSize sizeMM; +#if GTK_CHECK_VERSION(2,14,0) + if ( wx_is_at_least_gtk2(14) ) + { + // Take care not to return (-1, -1) from here, the caller expects us to + // return (0, 0) if we can't retrieve this information. + int rc = gdk_screen_get_monitor_width_mm(m_screen, m_index); + if ( rc != -1 ) + sizeMM.x = rc; + + rc = gdk_screen_get_monitor_height_mm(m_screen, m_index); + if ( rc != -1 ) + sizeMM.y = rc; + } +#endif // GTK+ 2.14 + return sizeMM; +} + +#if wxUSE_DISPLAY bool wxDisplayImplGTK::IsPrimary() const { -#ifdef __WXGTK4__ - return gdk_monitor_is_primary(m_monitor) != 0; -#else - wxGCC_WARNING_SUPPRESS(deprecated-declarations) return gdk_screen_get_primary_monitor(m_screen) == int(m_index); - wxGCC_WARNING_RESTORE() -#endif } -#if defined(GDK_WINDOWING_X11) && !defined(__WXGTK4__) -wxArrayVideoModes wxXF86VidMode_GetModes(const wxVideoMode& mode, Display* pDisplay, int nScreen); -wxVideoMode wxXF86VidMode_GetCurrentMode(Display* display, int nScreen); -bool wxXF86VidMode_ChangeMode(const wxVideoMode& mode, Display* display, int nScreen); -wxArrayVideoModes wxX11_GetModes(const wxDisplayImpl* impl, const wxVideoMode& modeMatch, Display* display); -#endif - wxArrayVideoModes wxDisplayImplGTK::GetModes(const wxVideoMode& mode) const { wxArrayVideoModes modes; -#if defined(GDK_WINDOWING_X11) && !defined(__WXGTK4__) -#ifdef __WXGTK3__ - if (GDK_IS_X11_SCREEN(m_screen)) -#endif +#ifdef wxGTK_HAVE_X11_DISPLAY + if ( wxIsX11GDKScreen(m_screen) ) { Display* display = GDK_DISPLAY_XDISPLAY(gdk_screen_get_display(m_screen)); #ifdef HAVE_X11_EXTENSIONS_XF86VMODE_H @@ -271,10 +350,8 @@ wxArrayVideoModes wxDisplayImplGTK::GetModes(const wxVideoMode& mode) const wxVideoMode wxDisplayImplGTK::GetCurrentMode() const { wxVideoMode mode; -#if defined(GDK_WINDOWING_X11) && defined(HAVE_X11_EXTENSIONS_XF86VMODE_H) && !defined(__WXGTK4__) -#ifdef __WXGTK3__ - if (GDK_IS_X11_SCREEN(m_screen)) -#endif +#if defined(wxGTK_HAVE_X11_DISPLAY) && defined(HAVE_X11_EXTENSIONS_XF86VMODE_H) + if ( wxIsX11GDKScreen(m_screen) ) { Display* display = GDK_DISPLAY_XDISPLAY(gdk_screen_get_display(m_screen)); int nScreen = gdk_x11_screen_get_screen_number(m_screen); @@ -287,10 +364,8 @@ wxVideoMode wxDisplayImplGTK::GetCurrentMode() const bool wxDisplayImplGTK::ChangeMode(const wxVideoMode& mode) { bool success = false; -#if defined(GDK_WINDOWING_X11) && defined(HAVE_X11_EXTENSIONS_XF86VMODE_H) && !defined(__WXGTK4__) -#ifdef __WXGTK3__ - if (GDK_IS_X11_SCREEN(m_screen)) -#endif +#if defined(wxGTK_HAVE_X11_DISPLAY) && defined(HAVE_X11_EXTENSIONS_XF86VMODE_H) + if ( wxIsX11GDKScreen(m_screen) ) { Display* display = GDK_DISPLAY_XDISPLAY(gdk_screen_get_display(m_screen)); int nScreen = gdk_x11_screen_get_screen_number(m_screen); @@ -301,12 +376,36 @@ bool wxDisplayImplGTK::ChangeMode(const wxVideoMode& mode) #endif return success; } -//----------------------------------------------------------------------------- + +wxGCC_WARNING_RESTORE() + +#endif // wxUSE_DISPLAY + +#endif // __WXGTK4__/!__WXGTK4__ + +#if wxUSE_DISPLAY wxDisplayFactory* wxDisplay::CreateFactory() { return new wxDisplayFactoryGTK; } -#endif // wxUSE_DISPLAY + +#else // !wxUSE_DISPLAY + +class wxDisplayFactorySingleGTK : public wxDisplayFactorySingle +{ +protected: + virtual wxDisplayImpl *CreateSingleDisplay() + { + return new wxDisplayImplGTK(0); + } +}; + +wxDisplayFactory* wxDisplay::CreateFactory() +{ + return new wxDisplayFactorySingleGTK; +} + +#endif // wxUSE_DISPLAY/!wxUSE_DISPLAY #endif // !defined(GDK_WINDOWING_WIN32) diff --git a/src/gtk/infobar.cpp b/src/gtk/infobar.cpp index ea7be9274b..55859bca32 100644 --- a/src/gtk/infobar.cpp +++ b/src/gtk/infobar.cpp @@ -139,7 +139,6 @@ bool wxInfoBar::Create(wxWindow *parent, wxWindowID winid) // finish creation and connect to all the signals we're interested in m_parent->DoAddChild(this); - PostCreation(wxDefaultSize); GTKConnectWidget("response", G_CALLBACK(wxgtk_infobar_response)); @@ -232,18 +231,13 @@ GtkWidget *wxInfoBar::GTKAddButton(wxWindowID btnid, const wxString& label) // our best size (at least in vertical direction) InvalidateBestSize(); - GtkWidget *button = gtk_info_bar_add_button - ( - GTK_INFO_BAR(m_widget), - label.empty() ? -#if defined(__WXGTK3__) && GTK_CHECK_VERSION(3,10,0) - wxGTK_CONV(wxConvertMnemonicsToGTK(wxGetStockLabel(btnid))) + GtkWidget* button = gtk_info_bar_add_button(GTK_INFO_BAR(m_widget), +#ifdef __WXGTK4__ + wxGTK_CONV(label.empty() ? wxConvertMnemonicsToGTK(wxGetStockLabel(btnid)) : label), #else - wxGetStockGtkID(btnid) -#endif // GTK >= 3.10 / < 3.10 - : wxGTK_CONV(label), - btnid - ); + label.empty() ? wxGetStockGtkID(btnid) : static_cast(wxGTK_CONV(label)), +#endif + btnid); wxASSERT_MSG( button, "unexpectedly failed to add button to info bar" ); diff --git a/src/gtk/notebook.cpp b/src/gtk/notebook.cpp index 93878cceb6..31978cb2b0 100644 --- a/src/gtk/notebook.cpp +++ b/src/gtk/notebook.cpp @@ -284,17 +284,15 @@ bool wxNotebook::SetPageImage( size_t page, int image ) if (image >= 0) { wxCHECK_MSG(HasImageList(), false, "invalid notebook imagelist"); - const wxBitmap* bitmap = GetImageList()->GetBitmapPtr(image); - if (bitmap == NULL) - return false; + const wxBitmap bitmap = GetImageList()->GetBitmap(image); if (pageData->m_image) { gtk_image_set_from_pixbuf( - GTK_IMAGE(pageData->m_image), bitmap->GetPixbuf()); + GTK_IMAGE(pageData->m_image), bitmap.GetPixbuf()); } else { - pageData->m_image = gtk_image_new_from_pixbuf(bitmap->GetPixbuf()); + pageData->m_image = gtk_image_new_from_pixbuf(bitmap.GetPixbuf()); gtk_widget_show(pageData->m_image); gtk_box_pack_start(GTK_BOX(pageData->m_box), pageData->m_image, false, false, m_padding); @@ -443,8 +441,8 @@ bool wxNotebook::InsertPage( size_t position, { if (HasImageList()) { - const wxBitmap* bitmap = GetImageList()->GetBitmapPtr(imageId); - pageData->m_image = gtk_image_new_from_pixbuf(bitmap->GetPixbuf()); + const wxBitmap bitmap = GetImageList()->GetBitmap(imageId); + pageData->m_image = gtk_image_new_from_pixbuf(bitmap.GetPixbuf()); gtk_box_pack_start(GTK_BOX(pageData->m_box), pageData->m_image, false, false, m_padding); } diff --git a/src/gtk/renderer.cpp b/src/gtk/renderer.cpp index 55ad311725..cac350e8cb 100644 --- a/src/gtk/renderer.cpp +++ b/src/gtk/renderer.cpp @@ -34,7 +34,12 @@ #include "wx/dcgraph.h" #ifndef __WXGTK3__ -#include "wx/gtk/dc.h" + #include "wx/gtk/dc.h" + #include "wx/gtk/private/wrapgtk.h" + #if wxUSE_GRAPHICS_CONTEXT && defined(GDK_WINDOWING_X11) + #include + #include + #endif #endif #include "wx/gtk/private.h" @@ -149,7 +154,7 @@ wxRendererNative& wxRendererNative::GetDefault() #define NULL_RECT typedef cairo_t wxGTKDrawable; -static cairo_t* wxGetGTKDrawable(wxWindow*, const wxDC& dc) +static cairo_t* wxGetGTKDrawable(const wxDC& dc) { wxGraphicsContext* gc = dc.GetGraphicsContext(); wxCHECK_MSG(gc, NULL, "cannot use wxRendererNative on wxDC of this type"); @@ -166,14 +171,25 @@ static const GtkStateFlags stateTypeToFlags[] = { #define NULL_RECT NULL, typedef GdkWindow wxGTKDrawable; -static GdkWindow* wxGetGTKDrawable(wxWindow* win, wxDC& dc) +static GdkWindow* wxGetGTKDrawable(wxDC& dc) { GdkWindow* gdk_window = NULL; -#if wxUSE_GRAPHICS_CONTEXT - if ( wxDynamicCast(&dc, wxGCDC) ) - gdk_window = win->GTKGetDrawingWindow(); - else +#if wxUSE_GRAPHICS_CONTEXT && defined(GDK_WINDOWING_X11) + cairo_t* cr = NULL; + wxGraphicsContext* gc = dc.GetGraphicsContext(); + if (gc) + cr = static_cast(gc->GetNativeContext()); + if (cr) + { + cairo_surface_t* surf = cairo_get_target(cr); + if (cairo_surface_get_type(surf) == CAIRO_SURFACE_TYPE_XLIB) + { + gdk_window = static_cast( + gdk_xid_table_lookup(cairo_xlib_surface_get_drawable(surf))); + } + } + if (gdk_window == NULL) #endif { wxDCImpl *impl = dc.GetImpl(); @@ -184,10 +200,6 @@ static GdkWindow* wxGetGTKDrawable(wxWindow* win, wxDC& dc) wxFAIL_MSG("cannot use wxRendererNative on wxDC of this type"); } -#if !wxUSE_GRAPHICS_CONTEXT - wxUnusedVar(win); -#endif - return gdk_window; } #endif @@ -224,7 +236,7 @@ wxRendererGTK::DrawHeaderButton(wxWindow *win, } #ifdef __WXGTK3__ - cairo_t* cr = wxGetGTKDrawable(win, dc); + cairo_t* cr = wxGetGTKDrawable(dc); if (cr == NULL) return 0; @@ -237,7 +249,7 @@ wxRendererGTK::DrawHeaderButton(wxWindow *win, if (flags & wxCONTROL_DIRTY) pos = 2; - wxGtkStyleContext sc; + wxGtkStyleContext sc(dc.GetContentScaleFactor()); sc.AddTreeviewHeaderButton(pos); gtk_style_context_set_state(sc, stateTypeToFlags[state]); @@ -255,7 +267,7 @@ wxRendererGTK::DrawHeaderButton(wxWindow *win, gtk_style_context_restore(sc); } #else - GdkWindow* gdk_window = wxGetGTKDrawable(win, dc); + GdkWindow* gdk_window = wxGetGTKDrawable(dc); gtk_paint_box ( gtk_widget_get_style(button), @@ -297,7 +309,7 @@ void wxRendererGTK::DrawTreeItemButton(wxWindow* win, wxDC& dc, const wxRect& rect, int flags) { - wxGTKDrawable* drawable = wxGetGTKDrawable(win, dc); + wxGTKDrawable* drawable = wxGetGTKDrawable(dc); if (drawable == NULL) return; @@ -406,7 +418,7 @@ wxRendererGTK::DrawSplitterSash(wxWindow* win, return; } - wxGTKDrawable* drawable = wxGetGTKDrawable(win, dc); + wxGTKDrawable* drawable = wxGetGTKDrawable(dc); if (drawable == NULL) return; @@ -438,7 +450,7 @@ wxRendererGTK::DrawSplitterSash(wxWindow* win, x_diff = rect.width; #ifdef __WXGTK3__ - wxGtkStyleContext sc; + wxGtkStyleContext sc(dc.GetContentScaleFactor()); sc.Add(GTK_TYPE_PANED, "paned", "pane-separator", NULL); if (gtk_check_version(3,20,0) == NULL) sc.Add("separator"); @@ -447,7 +459,7 @@ wxRendererGTK::DrawSplitterSash(wxWindow* win, flags & wxCONTROL_CURRENT ? GTK_STATE_FLAG_PRELIGHT : GTK_STATE_FLAG_NORMAL); gtk_render_handle(sc, drawable, rect.x - x_diff, rect.y, rect.width, rect.height); #else - GdkWindow* gdk_window = wxGetGTKDrawable(win, dc); + GdkWindow* gdk_window = wxGetGTKDrawable(dc); if (gdk_window == NULL) return; gtk_paint_handle @@ -469,7 +481,7 @@ wxRendererGTK::DrawSplitterSash(wxWindow* win, } void -wxRendererGTK::DrawDropArrow(wxWindow* win, +wxRendererGTK::DrawDropArrow(wxWindow*, wxDC& dc, const wxRect& rect, int flags) @@ -500,7 +512,7 @@ wxRendererGTK::DrawDropArrow(wxWindow* win, state = GTK_STATE_NORMAL; #ifdef __WXGTK3__ - cairo_t* cr = wxGetGTKDrawable(win, dc); + cairo_t* cr = wxGetGTKDrawable(dc); if (cr) { gtk_widget_set_state_flags(button, stateTypeToFlags[state], true); @@ -508,7 +520,7 @@ wxRendererGTK::DrawDropArrow(wxWindow* win, gtk_render_arrow(sc, cr, G_PI, x, y, size); } #else - GdkWindow* gdk_window = wxGetGTKDrawable(win, dc); + GdkWindow* gdk_window = wxGetGTKDrawable(dc); if (gdk_window == NULL) return; // draw arrow on button @@ -540,11 +552,16 @@ wxRendererGTK::DrawComboBoxDropButton(wxWindow *win, } wxSize -wxRendererGTK::GetCheckBoxSize(wxWindow *WXUNUSED(win)) +wxRendererGTK::GetCheckBoxSize(wxWindow* win) { + // Even though we don't use the window in this implementation, still check + // that it's valid to avoid surprises when running the same code under the + // other platforms. + wxCHECK_MSG( win, wxSize(0, 0), "Must have a valid window" ); + #ifdef __WXGTK3__ int min_width, min_height; - wxGtkStyleContext sc; + wxGtkStyleContext sc(win->GetContentScaleFactor()); sc.AddCheckButton(); if (gtk_check_version(3,20,0) == NULL) { @@ -582,7 +599,7 @@ wxRendererGTK::GetCheckBoxSize(wxWindow *WXUNUSED(win)) } void -wxRendererGTK::DrawCheckBox(wxWindow* win, +wxRendererGTK::DrawCheckBox(wxWindow*, wxDC& dc, const wxRect& rect, int flags ) @@ -618,7 +635,7 @@ wxRendererGTK::DrawCheckBox(wxWindow* win, #endif #ifdef __WXGTK3__ - cairo_t* cr = wxGetGTKDrawable(win, dc); + cairo_t* cr = wxGetGTKDrawable(dc); if (cr == NULL) return; @@ -637,7 +654,7 @@ wxRendererGTK::DrawCheckBox(wxWindow* win, state |= GTK_STATE_FLAG_PRELIGHT; int min_width, min_height; - wxGtkStyleContext sc; + wxGtkStyleContext sc(dc.GetContentScaleFactor()); sc.AddCheckButton(); if (gtk_check_version(3,20,0) == NULL) { @@ -666,7 +683,7 @@ wxRendererGTK::DrawCheckBox(wxWindow* win, gtk_render_check(sc, cr, x, y, min_width, min_height); gtk_style_context_restore(sc); #else - GdkWindow* gdk_window = wxGetGTKDrawable(win, dc); + GdkWindow* gdk_window = wxGetGTKDrawable(dc); if (gdk_window == NULL) return; @@ -687,7 +704,7 @@ wxRendererGTK::DrawCheckBox(wxWindow* win, } void -wxRendererGTK::DrawPushButton(wxWindow* win, +wxRendererGTK::DrawPushButton(wxWindow*, wxDC& dc, const wxRect& rect, int flags) @@ -707,7 +724,7 @@ wxRendererGTK::DrawPushButton(wxWindow* win, state = GTK_STATE_NORMAL; #ifdef __WXGTK3__ - cairo_t* cr = wxGetGTKDrawable(win, dc); + cairo_t* cr = wxGetGTKDrawable(dc); if (cr) { GtkStyleContext* sc = gtk_widget_get_style_context(button); @@ -718,7 +735,7 @@ wxRendererGTK::DrawPushButton(wxWindow* win, gtk_style_context_restore(sc); } #else - GdkWindow* gdk_window = wxGetGTKDrawable(win, dc); + GdkWindow* gdk_window = wxGetGTKDrawable(dc); if (gdk_window == NULL) return; @@ -745,7 +762,7 @@ wxRendererGTK::DrawItemSelectionRect(wxWindow* win, const wxRect& rect, int flags ) { - wxGTKDrawable* drawable = wxGetGTKDrawable(win, dc); + wxGTKDrawable* drawable = wxGetGTKDrawable(dc); if (drawable == NULL) return; @@ -790,7 +807,7 @@ wxRendererGTK::DrawItemSelectionRect(wxWindow* win, void wxRendererGTK::DrawFocusRect(wxWindow* win, wxDC& dc, const wxRect& rect, int flags) { - wxGTKDrawable* drawable = wxGetGTKDrawable(win, dc); + wxGTKDrawable* drawable = wxGetGTKDrawable(dc); if (drawable == NULL) return; @@ -821,9 +838,9 @@ void wxRendererGTK::DrawFocusRect(wxWindow* win, wxDC& dc, const wxRect& rect, i } // Uses the theme to draw the border and fill for something like a wxTextCtrl -void wxRendererGTK::DrawTextCtrl(wxWindow* win, wxDC& dc, const wxRect& rect, int flags) +void wxRendererGTK::DrawTextCtrl(wxWindow*, wxDC& dc, const wxRect& rect, int flags) { - wxGTKDrawable* drawable = wxGetGTKDrawable(win, dc); + wxGTKDrawable* drawable = wxGetGTKDrawable(dc); if (drawable == NULL) return; @@ -834,7 +851,7 @@ void wxRendererGTK::DrawTextCtrl(wxWindow* win, wxDC& dc, const wxRect& rect, in if (flags & wxCONTROL_DISABLED) state = GTK_STATE_FLAG_INSENSITIVE; - wxGtkStyleContext sc; + wxGtkStyleContext sc(dc.GetContentScaleFactor()); sc.Add(GTK_TYPE_ENTRY, "entry", "entry", NULL); gtk_style_context_set_state(sc, GtkStateFlags(state)); @@ -869,7 +886,7 @@ void wxRendererGTK::DrawTextCtrl(wxWindow* win, wxDC& dc, const wxRect& rect, in // Draw the equivalent of a wxComboBox void wxRendererGTK::DrawComboBox(wxWindow* win, wxDC& dc, const wxRect& rect, int flags) { - wxGTKDrawable* drawable = wxGetGTKDrawable(win, dc); + wxGTKDrawable* drawable = wxGetGTKDrawable(dc); if (drawable == NULL) return; @@ -893,6 +910,7 @@ void wxRendererGTK::DrawComboBox(wxWindow* win, wxDC& dc, const wxRect& rect, in r.width = r.height; DrawComboBoxDropButton(win, dc, r, flags); #else + wxUnusedVar(win); gtk_paint_shadow ( gtk_widget_get_style(combo), @@ -961,9 +979,9 @@ void wxRendererGTK::DrawChoice(wxWindow* win, wxDC& dc, // Draw a themed radio button -void wxRendererGTK::DrawRadioBitmap(wxWindow* win, wxDC& dc, const wxRect& rect, int flags) +void wxRendererGTK::DrawRadioBitmap(wxWindow*, wxDC& dc, const wxRect& rect, int flags) { - wxGTKDrawable* drawable = wxGetGTKDrawable(win, dc); + wxGTKDrawable* drawable = wxGetGTKDrawable(dc); if (drawable == NULL) return; @@ -983,7 +1001,7 @@ void wxRendererGTK::DrawRadioBitmap(wxWindow* win, wxDC& dc, const wxRect& rect, state |= GTK_STATE_FLAG_PRELIGHT; int min_width, min_height; - wxGtkStyleContext sc; + wxGtkStyleContext sc(dc.GetContentScaleFactor()); sc.Add(GTK_TYPE_RADIO_BUTTON, "radiobutton", NULL); #if GTK_CHECK_VERSION(3,20,0) if (gtk_check_version(3,20,0) == NULL) diff --git a/src/gtk/settings.cpp b/src/gtk/settings.cpp index 2c8132cbbe..fbbe942ab8 100644 --- a/src/gtk/settings.cpp +++ b/src/gtk/settings.cpp @@ -209,8 +209,9 @@ private: // wxGtkStyleContext //----------------------------------------------------------------------------- -wxGtkStyleContext::wxGtkStyleContext() +wxGtkStyleContext::wxGtkStyleContext(double scale) : m_path(gtk_widget_path_new()) + , m_scale(int(scale)) { m_context = NULL; } @@ -233,6 +234,10 @@ wxGtkStyleContext& wxGtkStyleContext::Add(GType type, const char* objectName, .. va_end(args); GtkStyleContext* sc = gtk_style_context_new(); +#if GTK_CHECK_VERSION(3,10,0) + if (gtk_check_version(3,10,0) == NULL) + gtk_style_context_set_scale(sc, m_scale); +#endif gtk_style_context_set_path(sc, m_path); if (m_context) { @@ -785,7 +790,13 @@ wxFont wxSystemSettingsNative::GetFont( wxSystemFont index ) g_signal_connect(gtk_settings_get_default(), "notify::gtk-font-name", G_CALLBACK(notify_gtk_font_name), NULL); } - wxGtkStyleContext sc; + ContainerWidget(); + int scale = 1; +#if GTK_CHECK_VERSION(3,10,0) + if (wx_is_at_least_gtk3(10)) + scale = gtk_widget_get_scale_factor(gs_tlw_parent); +#endif + wxGtkStyleContext sc(scale); sc.AddButton().AddLabel(); gtk_style_context_get(sc, GTK_STATE_FLAG_NORMAL, GTK_STYLE_PROPERTY_FONT, &info.description, NULL); @@ -869,7 +880,11 @@ static int GetScrollbarWidth() if (wx_is_at_least_gtk3(20)) { GtkBorder border; +#if GTK_CHECK_VERSION(3,10,0) + wxGtkStyleContext sc(gtk_widget_get_scale_factor(ScrollBarWidget())); +#else wxGtkStyleContext sc; +#endif sc.Add(GTK_TYPE_SCROLLBAR, "scrollbar", "scrollbar", "vertical", "right", NULL); gtk_style_context_get_border(sc, GTK_STATE_FLAG_NORMAL, &border); diff --git a/src/gtk/textentry.cpp b/src/gtk/textentry.cpp index bc4735a8a7..824514fed6 100644 --- a/src/gtk/textentry.cpp +++ b/src/gtk/textentry.cpp @@ -41,7 +41,7 @@ // helper function to get the length of the text //----------------------------------------------------------------------------- -static unsigned int GetEntryTextLength(GtkEntry* entry) +static int GetEntryTextLength(GtkEntry* entry) { #if GTK_CHECK_VERSION(2, 14, 0) if ( wx_is_at_least_gtk2(14) ) @@ -559,10 +559,20 @@ void wxTextEntry::DoSetValue(const wxString& value, int flags) EventsSuppressor noevents(this); Remove(0, -1); } - EventsSuppressor noeventsIf(this, !(flags & SetValue_SendEvent)); - WriteText(value); + + // Testing whether value is empty here is more than just an + // optimization: WriteText() always generates an explicit event in + // wxGTK, which we need to avoid unless SetValue_SendEvent is given. + if ( !value.empty() ) + { + // Suppress events from here even if we do need them, it's simpler + // to send the event below in all cases. + EventsSuppressor noevents(this); + WriteText(value); + } } - else if (flags & SetValue_SendEvent) + + if ( flags & SetValue_SendEvent ) SendTextUpdatedEvent(GetEditableWindow()); SetInsertionPoint(0); @@ -582,7 +592,7 @@ void wxTextEntry::Remove(long from, long to) } // static -unsigned int wxTextEntry::GTKGetEntryTextLength(GtkEntry* entry) +int wxTextEntry::GTKGetEntryTextLength(GtkEntry* entry) { return GetEntryTextLength(entry); } diff --git a/src/gtk/toolbar.cpp b/src/gtk/toolbar.cpp index d857972eff..d6d399b4a7 100644 --- a/src/gtk/toolbar.cpp +++ b/src/gtk/toolbar.cpp @@ -180,16 +180,23 @@ image_draw(GtkWidget* widget, cairo_t* cr, wxToolBarTool* tool) image_expose_event(GtkWidget* widget, GdkEventExpose*, wxToolBarTool* tool) #endif { +#ifdef __WXGTK3__ + const wxBitmap& bitmap = tool->GetBitmap(); + if (!bitmap.IsOk() || (tool->IsEnabled() && bitmap.GetScaleFactor() <= 1)) + return false; +#else const wxBitmap& bitmap = tool->GetDisabledBitmap(); if (tool->IsEnabled() || !bitmap.IsOk()) return false; +#endif - // draw disabled bitmap ourselves, GtkImage has no way to specify it GtkAllocation alloc; gtk_widget_get_allocation(widget, &alloc); - int x = (alloc.width - bitmap.GetWidth()) / 2; - int y = (alloc.height - bitmap.GetHeight()) / 2; + int x = (alloc.width - bitmap.GetScaledWidth()) / 2; + int y = (alloc.height - bitmap.GetScaledHeight()) / 2; #ifdef __WXGTK3__ + gtk_render_background(gtk_widget_get_style_context(widget), + cr, alloc.x, alloc.y, alloc.width, alloc.height); bitmap.Draw(cr, x, y); #else x += alloc.x; @@ -266,9 +273,24 @@ void wxToolBarTool::SetImage() wxCHECK_RET(bitmap.IsOk(), "invalid bitmap for wxToolBar icon"); GtkWidget* image = gtk_tool_button_get_icon_widget(GTK_TOOL_BUTTON(m_item)); - // always use pixbuf, because pixmap mask does not - // work with disabled images in some themes - gtk_image_set_from_pixbuf(GTK_IMAGE(image), bitmap.GetPixbuf()); +#ifdef __WXGTK3__ + if (bitmap.GetScaleFactor() > 1) + { + // Use a scaled pixbuf with the correct logical size. It will be used + // for the disabled state if no disabled bitmap is specifed, otherwise + // the original will be used by our "draw" signal handler. + GdkPixbuf* pixbuf = gdk_pixbuf_scale_simple(bitmap.GetPixbuf(), + bitmap.GetScaledWidth(), bitmap.GetScaledHeight(), GDK_INTERP_BILINEAR); + gtk_image_set_from_pixbuf(GTK_IMAGE(image), pixbuf); + g_object_unref(pixbuf); + } + else +#endif + { + // always use pixbuf, because pixmap mask does not + // work with disabled images in some themes + gtk_image_set_from_pixbuf(GTK_IMAGE(image), bitmap.GetPixbuf()); + } } // helper to create a dropdown menu item diff --git a/src/gtk/utilsgtk.cpp b/src/gtk/utilsgtk.cpp index 7cdbd871c8..137fb2cf16 100644 --- a/src/gtk/utilsgtk.cpp +++ b/src/gtk/utilsgtk.cpp @@ -76,50 +76,6 @@ void *wxGetDisplay() } #endif -void wxDisplaySize( int *width, int *height ) -{ -#ifdef __WXGTK4__ - GdkMonitor* monitor = gdk_display_get_primary_monitor(gdk_display_get_default()); - GdkRectangle rect; - gdk_monitor_get_geometry(monitor, &rect); - if (width) *width = rect.width; - if (height) *height = rect.height; -#else - wxGCC_WARNING_SUPPRESS(deprecated-declarations) - if (width) *width = gdk_screen_width(); - if (height) *height = gdk_screen_height(); - wxGCC_WARNING_RESTORE() -#endif -} - -void wxDisplaySizeMM( int *width, int *height ) -{ -#ifdef __WXGTK4__ - GdkMonitor* monitor = gdk_display_get_primary_monitor(gdk_display_get_default()); - if (width) *width = gdk_monitor_get_width_mm(monitor); - if (height) *height = gdk_monitor_get_height_mm(monitor); -#else - wxGCC_WARNING_SUPPRESS(deprecated-declarations) - if (width) *width = gdk_screen_width_mm(); - if (height) *height = gdk_screen_height_mm(); - wxGCC_WARNING_RESTORE() -#endif -} - -bool wxColourDisplay() -{ - return true; -} - -int wxDisplayDepth() -{ -#ifdef __WXGTK4__ - return 24; -#else - return gdk_visual_get_depth(gdk_window_get_visual(wxGetTopLevelGDK())); -#endif -} - wxWindow* wxFindWindowAtPoint(const wxPoint& pt) { return wxGenericFindWindowAtPoint(pt); diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 99fc8eebfa..e440422ab7 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -310,7 +310,7 @@ static wxPoint gs_lastGesturePoint; // Function used to dump a brief description of a window. static -wxString wxDumpWindow(wxWindow* win) +wxString wxDumpWindow(wxWindowGTK* win) { if ( !win ) return "(no window)"; @@ -4314,9 +4314,7 @@ double wxWindowGTK::GetContentScaleFactor() const #if GTK_CHECK_VERSION(3,10,0) if (m_widget && gtk_check_version(3,10,0) == NULL) { - GdkWindow* window = gtk_widget_get_window(m_widget); - if (window) - scaleFactor = gdk_window_get_scale_factor(window); + scaleFactor = gtk_widget_get_scale_factor(m_widget); } #endif return scaleFactor; diff --git a/src/gtk1/notebook.cpp b/src/gtk1/notebook.cpp index 6dc0752862..cb17186a51 100644 --- a/src/gtk1/notebook.cpp +++ b/src/gtk1/notebook.cpp @@ -512,12 +512,12 @@ bool wxNotebook::SetPageImage( size_t page, int image ) wxASSERT( HasImageList() ); /* Just in case */ /* Construct the new pixmap */ - const wxBitmap *bmp = GetImageList()->GetBitmapPtr(image); - GdkPixmap *pixmap = bmp->GetPixmap(); + const wxBitmap bmp = GetImageList()->GetBitmap(image); + GdkPixmap *pixmap = bmp.GetPixmap(); GdkBitmap *mask = NULL; - if ( bmp->GetMask() ) + if ( bmp.GetMask() ) { - mask = bmp->GetMask()->GetBitmap(); + mask = bmp.GetMask()->GetBitmap(); } if (pixmapwid == NULL) @@ -679,12 +679,12 @@ bool wxNotebook::InsertPage( size_t position, { wxASSERT( HasImageList() ); - const wxBitmap *bmp = GetImageList()->GetBitmapPtr(imageId); - GdkPixmap *pixmap = bmp->GetPixmap(); + const wxBitmap bmp = GetImageList()->GetBitmap(imageId); + GdkPixmap *pixmap = bmp.GetPixmap(); GdkBitmap *mask = NULL; - if ( bmp->GetMask() ) + if ( bmp.GetMask() ) { - mask = bmp->GetMask()->GetBitmap(); + mask = bmp.GetMask()->GetBitmap(); } GtkWidget *pixmapwid = gtk_pixmap_new (pixmap, mask ); diff --git a/src/gtk1/utilsgtk.cpp b/src/gtk1/utilsgtk.cpp index c912fc9a9a..b84627535e 100644 --- a/src/gtk1/utilsgtk.cpp +++ b/src/gtk1/utilsgtk.cpp @@ -86,33 +86,11 @@ void *wxGetDisplay() return GDK_DISPLAY(); } -void wxDisplaySize( int *width, int *height ) -{ - if (width) *width = gdk_screen_width(); - if (height) *height = gdk_screen_height(); -} - -void wxDisplaySizeMM( int *width, int *height ) -{ - if (width) *width = gdk_screen_width_mm(); - if (height) *height = gdk_screen_height_mm(); -} - void wxGetMousePosition( int* x, int* y ) { gdk_window_get_pointer( NULL, x, y, NULL ); } -bool wxColourDisplay() -{ - return true; -} - -int wxDisplayDepth() -{ - return gdk_window_get_visual( wxGetRootWindow()->window )->depth; -} - wxWindow* wxFindWindowAtPoint(const wxPoint& pt) { return wxGenericFindWindowAtPoint(pt); diff --git a/src/motif/dcclient.cpp b/src/motif/dcclient.cpp index 6bf809572f..a85f36bfc2 100644 --- a/src/motif/dcclient.cpp +++ b/src/motif/dcclient.cpp @@ -139,7 +139,6 @@ void wxWindowDCImpl::Init() m_currentPenDash = NULL; m_currentStyle = -1; m_currentFill = -1; - m_colour = wxColourDisplay(); m_display = NULL; m_pixmap = (WXPixmap) 0; m_autoSetting = 0; diff --git a/src/motif/utils.cpp b/src/motif/utils.cpp index d440bb0887..480faad86e 100644 --- a/src/motif/utils.cpp +++ b/src/motif/utils.cpp @@ -225,41 +225,6 @@ void wxGetMousePosition( int* x, int* y ) #endif } -// Return true if we have a colour display -bool wxColourDisplay() -{ - return wxDisplayDepth() > 1; -} - -// Returns depth of screen -int wxDisplayDepth() -{ - Display *dpy = wxGlobalDisplay(); - - return DefaultDepth (dpy, DefaultScreen (dpy)); -} - -// Get size of display -void wxDisplaySize(int *width, int *height) -{ - Display *dpy = wxGlobalDisplay(); - - if ( width ) - *width = DisplayWidth (dpy, DefaultScreen (dpy)); - if ( height ) - *height = DisplayHeight (dpy, DefaultScreen (dpy)); -} - -void wxDisplaySizeMM(int *width, int *height) -{ - Display *dpy = wxGlobalDisplay(); - - if ( width ) - *width = DisplayWidthMM(dpy, DefaultScreen (dpy)); - if ( height ) - *height = DisplayHeightMM(dpy, DefaultScreen (dpy)); -} - // Configurable display in wxX11 and wxMotif static WXDisplay *gs_currentDisplay = NULL; static wxString gs_displayName; diff --git a/src/msw/button.cpp b/src/msw/button.cpp index 8211259dcb..ae3cf19601 100644 --- a/src/msw/button.cpp +++ b/src/msw/button.cpp @@ -252,28 +252,14 @@ wxWindow *wxButton::SetDefault() // return NULL static wxTopLevelWindow *GetTLWParentIfNotBeingDeleted(wxWindow *win) { - for ( ;; ) - { - // IsTopLevel() will return false for a wxTLW being deleted, so we also - // need the parent test for this case - wxWindow * const parent = win->GetParent(); - if ( !parent || win->IsTopLevel() ) - { - if ( win->IsBeingDeleted() ) - return NULL; + wxWindow* const parent = wxGetTopLevelParent(win); + wxASSERT_MSG( parent, wxT("button without top level parent?") ); - break; - } + if ( parent->IsBeingDeleted() ) + return NULL; - win = parent; - } - - wxASSERT_MSG( win, wxT("button without top level parent?") ); - - wxTopLevelWindow * const tlw = wxDynamicCast(win, wxTopLevelWindow); - wxASSERT_MSG( tlw, wxT("logic error in GetTLWParentIfNotBeingDeleted()") ); - - return tlw; + // Note that this may still return null for a button inside wxPopupWindow. + return wxDynamicCast(parent, wxTopLevelWindow); } // set this button as being currently default diff --git a/src/msw/display.cpp b/src/msw/display.cpp index 3256c65cbc..6fd48acd44 100644 --- a/src/msw/display.cpp +++ b/src/msw/display.cpp @@ -24,11 +24,70 @@ #pragma hdrstop #endif +#include "wx/private/display.h" + +#include "wx/dynlib.h" + +#include "wx/msw/private.h" #include "wx/msw/wrapwin.h" -#if wxUSE_DISPLAY +namespace +{ -#include "wx/display.h" +int wxGetHDCDepth(HDC hdc) +{ + return ::GetDeviceCaps(hdc, PLANES) * GetDeviceCaps(hdc, BITSPIXEL); +} + +// This implementation is always available, whether wxUSE_DISPLAY is 1 or not, +// as we fall back to it in case of error. +class wxDisplayImplSingleMSW : public wxDisplayImplSingle +{ +public: + virtual wxRect GetGeometry() const wxOVERRIDE + { + ScreenHDC dc; + + return wxRect(0, 0, + ::GetDeviceCaps(dc, HORZRES), + ::GetDeviceCaps(dc, VERTRES)); + } + + virtual wxRect GetClientArea() const wxOVERRIDE + { + RECT rc; + SystemParametersInfo(SPI_GETWORKAREA, 0, &rc, 0); + + wxRect rectClient; + wxCopyRECTToRect(rc, rectClient); + return rectClient; + } + + virtual int GetDepth() const wxOVERRIDE + { + return wxGetHDCDepth(ScreenHDC()); + } + + virtual wxSize GetSizeMM() const wxOVERRIDE + { + ScreenHDC dc; + + return wxSize(::GetDeviceCaps(dc, HORZSIZE), ::GetDeviceCaps(dc, VERTSIZE)); + } +}; + +class wxDisplayFactorySingleMSW : public wxDisplayFactorySingle +{ +protected: + virtual wxDisplayImpl *CreateSingleDisplay() wxOVERRIDE + { + return new wxDisplayImplSingleMSW; + } +}; + +} // anonymous namespace + +#if wxUSE_DISPLAY #ifndef WX_PRECOMP #include "wx/dynarray.h" @@ -39,13 +98,29 @@ #include "wx/dynlib.h" #include "wx/sysopt.h" -#include "wx/display_impl.h" #include "wx/msw/missing.h" -#include "wx/msw/private.h" #include "wx/msw/private/hiddenwin.h" +#ifndef DPI_ENUMS_DECLARED + #define MDT_EFFECTIVE_DPI 0 +#endif + static const wxChar displayDllName[] = wxT("user32.dll"); +namespace +{ + +// Simple struct storing the information needed by wxDisplayMSW. +struct wxDisplayInfo +{ + wxDisplayInfo(HMONITOR hmon_, int depth_) : hmon(hmon_), depth(depth_) {} + + HMONITOR hmon; + int depth; +}; + +} // anonymous namespace + // ---------------------------------------------------------------------------- // wxDisplayMSW declaration // ---------------------------------------------------------------------------- @@ -53,14 +128,17 @@ static const wxChar displayDllName[] = wxT("user32.dll"); class wxDisplayMSW : public wxDisplayImpl { public: - wxDisplayMSW(unsigned n, HMONITOR hmon) + wxDisplayMSW(unsigned n, const wxDisplayInfo& info) : wxDisplayImpl(n), - m_hmon(hmon) + m_info(info) { } virtual wxRect GetGeometry() const wxOVERRIDE; virtual wxRect GetClientArea() const wxOVERRIDE; + virtual int GetDepth() const wxOVERRIDE; + virtual wxSize GetPPI() const wxOVERRIDE; + virtual wxString GetName() const wxOVERRIDE; virtual bool IsPrimary() const wxOVERRIDE; @@ -85,7 +163,7 @@ protected: // it succeeded, otherwise return false. bool GetMonInfo(MONITORINFOEX& monInfo) const; - HMONITOR m_hmon; + wxDisplayInfo m_info; private: wxDECLARE_NO_COPY_CLASS(wxDisplayMSW); @@ -96,8 +174,6 @@ private: // wxDisplayFactoryMSW declaration // ---------------------------------------------------------------------------- -WX_DEFINE_ARRAY(HMONITOR, wxMonitorHandleArray); - class wxDisplayFactoryMSW : public wxDisplayFactory { public: @@ -120,6 +196,13 @@ public: // handles. static void RefreshMonitors() { ms_factory->DoRefreshMonitors(); } + // Declare the second argument as int to avoid problems with older SDKs not + // declaring MONITOR_DPI_TYPE enum. + typedef HRESULT (WINAPI *GetDpiForMonitor_t)(HMONITOR, int, UINT*, UINT*); + + // Return the pointer to GetDpiForMonitor() function which may be null if + // not running under new enough Windows version. + static GetDpiForMonitor_t GetDpiForMonitorPtr(); private: // EnumDisplayMonitors() callback @@ -141,10 +224,52 @@ private: // variable (also making it of correct type for us) here). static wxDisplayFactoryMSW* ms_factory; + // The pointer to GetDpiForMonitorPtr(), retrieved on demand, and the + // related data, including the DLL containing the function that we must + // keep loaded. + struct GetDpiForMonitorData + { + GetDpiForMonitorData() + { + m_pfnGetDpiForMonitor = NULL; + m_initialized = false; + } + + bool TryLoad() + { + if ( !m_dllShcore.Load("shcore.dll", wxDL_VERBATIM | wxDL_QUIET) ) + return false; + + wxDL_INIT_FUNC(m_pfn, GetDpiForMonitor, m_dllShcore); + + if ( !m_pfnGetDpiForMonitor ) + { + m_dllShcore.Unload(); + return false; + } + + return true; + } + + void UnloadIfNecessary() + { + if ( m_dllShcore.IsLoaded() ) + { + m_dllShcore.Unload(); + m_pfnGetDpiForMonitor = NULL; + } + } + + wxDynamicLibrary m_dllShcore; + GetDpiForMonitor_t m_pfnGetDpiForMonitor; + bool m_initialized; + }; + static GetDpiForMonitorData ms_getDpiForMonitorData; + // the array containing information about all available displays, filled by // MultimonEnumProc() - wxMonitorHandleArray m_displays; + wxVector m_displays; // The hidden window we use for receiving WM_SETTINGCHANGE and its class // name. @@ -155,6 +280,8 @@ private: }; wxDisplayFactoryMSW* wxDisplayFactoryMSW::ms_factory = NULL; +wxDisplayFactoryMSW::GetDpiForMonitorData + wxDisplayFactoryMSW::ms_getDpiForMonitorData; // ---------------------------------------------------------------------------- // wxDisplay implementation @@ -170,7 +297,7 @@ wxDisplayFactoryMSW* wxDisplayFactoryMSW::ms_factory = NULL; delete factoryMM; // fall back to a stub implementation if no multimon support (Win95?) - return new wxDisplayFactorySingle; + return new wxDisplayFactorySingleMSW; } @@ -180,7 +307,7 @@ wxDisplayFactoryMSW* wxDisplayFactoryMSW::ms_factory = NULL; bool wxDisplayMSW::GetMonInfo(MONITORINFOEX& monInfo) const { - if ( !::GetMonitorInfo(m_hmon, &monInfo) ) + if ( !::GetMonitorInfo(m_info.hmon, &monInfo) ) { wxLogLastError(wxT("GetMonitorInfo")); return false; @@ -211,6 +338,29 @@ wxRect wxDisplayMSW::GetClientArea() const return rectClient; } +int wxDisplayMSW::GetDepth() const +{ + return m_info.depth; +} + +wxSize wxDisplayMSW::GetPPI() const +{ + if ( const wxDisplayFactoryMSW::GetDpiForMonitor_t + getFunc = wxDisplayFactoryMSW::GetDpiForMonitorPtr() ) + { + UINT dpiX = 0, + dpiY = 0; + const HRESULT + hr = (*getFunc)(m_info.hmon, MDT_EFFECTIVE_DPI, &dpiX, &dpiY); + if ( SUCCEEDED(hr) ) + return wxSize(dpiX, dpiY); + + wxLogApiError("GetDpiForMonitor", hr); + } + + return IsPrimary() ? wxDisplayImplSingleMSW().GetPPI() : wxSize(0, 0); +} + wxString wxDisplayMSW::GetName() const { WinStruct monInfo; @@ -431,14 +581,36 @@ wxDisplayFactoryMSW::~wxDisplayFactoryMSW() } } + if ( ms_getDpiForMonitorData.m_initialized ) + { + ms_getDpiForMonitorData.UnloadIfNecessary(); + ms_getDpiForMonitorData.m_initialized = false; + } + ms_factory = NULL; } +/* static */ +wxDisplayFactoryMSW::GetDpiForMonitor_t +wxDisplayFactoryMSW::GetDpiForMonitorPtr() +{ + if ( !ms_getDpiForMonitorData.m_initialized ) + { + ms_getDpiForMonitorData.m_initialized = true; + ms_getDpiForMonitorData.TryLoad(); + } + + return ms_getDpiForMonitorData.m_pfnGetDpiForMonitor; +} + void wxDisplayFactoryMSW::DoRefreshMonitors() { - m_displays.Clear(); + m_displays.clear(); - if ( !::EnumDisplayMonitors(NULL, NULL, MultimonEnumProc, (LPARAM)this) ) + // We need to pass a valid HDC here in order to get valid hdcMonitor in our + // callback. + ScreenHDC dc; + if ( !::EnumDisplayMonitors(dc, NULL, MultimonEnumProc, (LPARAM)this) ) { wxLogLastError(wxT("EnumDisplayMonitors")); } @@ -448,13 +620,13 @@ void wxDisplayFactoryMSW::DoRefreshMonitors() BOOL CALLBACK wxDisplayFactoryMSW::MultimonEnumProc( HMONITOR hMonitor, // handle to display monitor - HDC WXUNUSED(hdcMonitor), // handle to monitor-appropriate device context + HDC hdcMonitor, // handle to monitor-appropriate device context LPRECT WXUNUSED(lprcMonitor), // pointer to monitor intersection rectangle LPARAM dwData) // data passed from EnumDisplayMonitors (this) { wxDisplayFactoryMSW *const self = (wxDisplayFactoryMSW *)dwData; - self->m_displays.Add(hMonitor); + self->m_displays.push_back(wxDisplayInfo(hMonitor, wxGetHDCDepth(hdcMonitor))); // continue the enumeration return TRUE; @@ -475,7 +647,7 @@ int wxDisplayFactoryMSW::FindDisplayFromHMONITOR(HMONITOR hmon) const const size_t count = m_displays.size(); for ( size_t n = 0; n < count; n++ ) { - if ( hmon == m_displays[n] ) + if ( hmon == m_displays[n].hmon ) return n; } } @@ -507,17 +679,12 @@ int wxDisplayFactoryMSW::GetFromWindow(const wxWindow *window) #endif } -#endif // wxUSE_DISPLAY +#else // !wxUSE_DISPLAY -void wxClientDisplayRect(int *x, int *y, int *width, int *height) +// In this case, wxDisplayFactorySingleMSW is the only implementation. +wxDisplayFactory* wxDisplay::CreateFactory() { - // Determine the desktop dimensions minus the taskbar and any other - // special decorations... - RECT r; - - SystemParametersInfo(SPI_GETWORKAREA, 0, &r, 0); - if (x) *x = r.left; - if (y) *y = r.top; - if (width) *width = r.right - r.left; - if (height) *height = r.bottom - r.top; + return new wxDisplayFactorySingleMSW; } + +#endif // wxUSE_DISPLAY/!wxUSE_DISPLAY diff --git a/src/msw/font.cpp b/src/msw/font.cpp index 76a2cc3c35..ed9840e0e6 100644 --- a/src/msw/font.cpp +++ b/src/msw/font.cpp @@ -739,9 +739,9 @@ wxString wxNativeFontInfo::ToString() const { wxString s; - s.Printf(wxS("%d;%f;%ld;%ld;%ld;%ld;%ld;%d;%d;%d;%d;%d;%d;%d;%d;%s"), + s.Printf(wxS("%d;%s;%ld;%ld;%ld;%ld;%ld;%d;%d;%d;%d;%d;%d;%d;%d;%s"), 1, // version - pointSize, + wxString::FromCDouble(pointSize), lf.lfHeight, lf.lfWidth, lf.lfEscapement, diff --git a/src/msw/graphics.cpp b/src/msw/graphics.cpp index 78d4a36e68..04cca9d732 100644 --- a/src/msw/graphics.cpp +++ b/src/msw/graphics.cpp @@ -42,9 +42,7 @@ #include "wx/private/graphics.h" #include "wx/msw/wrapgdip.h" #include "wx/msw/dc.h" -#if wxUSE_ENH_METAFILE - #include "wx/msw/enhmeta.h" -#endif +#include "wx/msw/enhmeta.h" #include "wx/dcgraph.h" #include "wx/rawbmp.h" diff --git a/src/msw/graphicsd2d.cpp b/src/msw/graphicsd2d.cpp index 00eb65dde3..983372502c 100644 --- a/src/msw/graphicsd2d.cpp +++ b/src/msw/graphicsd2d.cpp @@ -23,6 +23,9 @@ #define D2D1MakeSkewMatrix wxD2D1MakeSkewMatrix #define D2D1IsMatrixInvertible wxD2D1IsMatrixInvertible #define D2D1InvertMatrix wxD2D1InvertMatrix +#if wxD2D_DEVICE_CONTEXT_SUPPORTED +#define D3D11CreateDevice wxD3D11CreateDevice +#endif // There are clashes between the names of the member fields and parameters // in the standard d2d1helper.h header resulting in C4458 with VC14, @@ -42,9 +45,9 @@ #endif #if wxD2D_DEVICE_CONTEXT_SUPPORTED -#include -#include -#include +#include +#include +#include #endif #ifdef __VISUALC__ @@ -155,6 +158,11 @@ private: if ( !m_dllDirectWrite.Load(wxT("dwrite.dll"), wxDL_VERBATIM | wxDL_QUIET) ) return false; +#if wxD2D_DEVICE_CONTEXT_SUPPORTED + if (!m_dllDirect3d.Load(wxT("d3d11.dll"), wxDL_VERBATIM | wxDL_QUIET)) + return false; +#endif + #define wxLOAD_FUNC(dll, name) \ name = (name##_t)dll.RawGetSymbol(#name); \ if ( !name ) \ @@ -167,6 +175,10 @@ private: wxLOAD_FUNC(m_dllDirect2d, D2D1InvertMatrix); wxLOAD_FUNC(m_dllDirectWrite, DWriteCreateFactory); +#if wxD2D_DEVICE_CONTEXT_SUPPORTED + wxLOAD_FUNC(m_dllDirect3d, D3D11CreateDevice); +#endif + m_D2DRuntimeVersion = wxD2D_VERSION_1_0; return true; @@ -191,6 +203,11 @@ public: typedef HRESULT (WINAPI *DWriteCreateFactory_t)(DWRITE_FACTORY_TYPE, REFIID, IUnknown**); static DWriteCreateFactory_t DWriteCreateFactory; +#if wxD2D_DEVICE_CONTEXT_SUPPORTED + typedef HRESULT (WINAPI *D3D11CreateDevice_t)(IDXGIAdapter*, D3D_DRIVER_TYPE, HMODULE, UINT, CONST D3D_FEATURE_LEVEL*, UINT, UINT, ID3D11Device**, D3D_FEATURE_LEVEL*, ID3D11DeviceContext**); + static D3D11CreateDevice_t D3D11CreateDevice; +#endif + private: static bool m_initialized; static bool m_hasDirect2DSupport; @@ -198,6 +215,9 @@ private: static wxDynamicLibrary m_dllDirect2d; static wxDynamicLibrary m_dllDirectWrite; +#if wxD2D_DEVICE_CONTEXT_SUPPORTED + static wxDynamicLibrary m_dllDirect3d; +#endif }; // define the members @@ -207,6 +227,9 @@ wxDirect2D::wxD2DVersion wxDirect2D::m_D2DRuntimeVersion = wxD2D_VERSION_NONE; wxDynamicLibrary wxDirect2D::m_dllDirect2d; wxDynamicLibrary wxDirect2D::m_dllDirectWrite; +#if wxD2D_DEVICE_CONTEXT_SUPPORTED +wxDynamicLibrary wxDirect2D::m_dllDirect3d; +#endif // define the (not yet imported) functions wxDirect2D::D2D1CreateFactory_t wxDirect2D::D2D1CreateFactory = NULL; @@ -216,6 +239,10 @@ wxDirect2D::D2D1IsMatrixInvertible_t wxDirect2D::D2D1IsMatrixInvertible = NULL; wxDirect2D::D2D1InvertMatrix_t wxDirect2D::D2D1InvertMatrix = NULL; wxDirect2D::DWriteCreateFactory_t wxDirect2D::DWriteCreateFactory = NULL; +#if wxD2D_DEVICE_CONTEXT_SUPPORTED +wxDirect2D::D3D11CreateDevice_t wxDirect2D::D3D11CreateDevice = NULL; +#endif + // define the interface GUIDs DEFINE_GUID(wxIID_IWICImagingFactory, 0xec5ec8a9, 0xc395, 0x4314, 0x9c, 0x77, 0x54, 0xd7, 0xa9, 0x35, 0xff, 0x70); @@ -235,6 +262,11 @@ DEFINE_GUID(GUID_WICPixelFormat32bppPBGRA, DEFINE_GUID(GUID_WICPixelFormat32bppBGR, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x0e); +#if wxD2D_DEVICE_CONTEXT_SUPPORTED +DEFINE_GUID(IID_IDXGIDevice, + 0x54ec77fa, 0x1377, 0x44e6, 0x8c, 0x32, 0x88, 0xfd, 0x5f, 0x44, 0xc8, 0x4c); +#endif + #ifndef CLSID_WICImagingFactory DEFINE_GUID(CLSID_WICImagingFactory, 0xcacaf262, 0x9370, 0x4615, 0xa1, 0x3b, 0x9f, 0x55, 0x39, 0xda, 0x4c, 0xa); @@ -298,6 +330,36 @@ BOOL WINAPI wxD2D1InvertMatrix( return wxDirect2D::D2D1InvertMatrix(matrix); } +#if wxD2D_DEVICE_CONTEXT_SUPPORTED +HRESULT WINAPI wxD3D11CreateDevice( + IDXGIAdapter* pAdapter, + D3D_DRIVER_TYPE DriverType, + HMODULE Software, + UINT Flags, + CONST D3D_FEATURE_LEVEL* pFeatureLevels, + UINT FeatureLevels, + UINT SDKVersion, + ID3D11Device** ppDevice, + D3D_FEATURE_LEVEL* pFeatureLevel, + ID3D11DeviceContext** ppImmediateContext) +{ + if (!wxDirect2D::Initialize()) + return S_FALSE; + + return wxDirect2D::D3D11CreateDevice( + pAdapter, + DriverType, + Software, + Flags, + pFeatureLevels, + FeatureLevels, + SDKVersion, + ppDevice, + pFeatureLevel, + ppImmediateContext); +} +#endif + static IWICImagingFactory* gs_WICImagingFactory = NULL; IWICImagingFactory* wxWICImagingFactory() @@ -401,7 +463,7 @@ public: // was not previously acquired virtual void* GetResource() = 0; - virtual ~wxResourceHolder(){}; + virtual ~wxResourceHolder() {} }; class wxD2DResourceManager; @@ -414,13 +476,13 @@ public: virtual bool IsBound() = 0; virtual wxD2DResourceManager* GetManager() = 0; - virtual ~wxD2DManagedObject() {}; + virtual ~wxD2DManagedObject() {} }; class wxManagedResourceHolder : public wxResourceHolder, public wxD2DManagedObject { public: - virtual ~wxManagedResourceHolder() {}; + virtual ~wxManagedResourceHolder() {} }; // A Direct2D resource manager handles the device-dependent @@ -594,7 +656,7 @@ public: virtual wxD2DManagedObject* GetManagedObject() = 0; - ~wxD2DManagedGraphicsData() {}; + ~wxD2DManagedGraphicsData() {} }; D2D1_CAP_STYLE wxD2DConvertPenCap(wxPenCap cap) @@ -1115,7 +1177,7 @@ public : void* GetNativePath() const wxOVERRIDE; // give the native path returned by GetNativePath() back (there might be some deallocations necessary) - void UnGetNativePath(void* WXUNUSED(p)) const wxOVERRIDE {}; + void UnGetNativePath(void* WXUNUSED(p)) const wxOVERRIDE {} // transforms each point of this path by the matrix void Transform(const wxGraphicsMatrixData* matrix) wxOVERRIDE; @@ -2199,7 +2261,7 @@ public: wxGraphicsBitmapData(renderer), m_bitmapHolder(bitmap) {} wxD2DBitmapData(wxGraphicsRenderer* renderer, const void* pseudoNativeBitmap) : - wxGraphicsBitmapData(renderer), m_bitmapHolder(*static_cast(pseudoNativeBitmap)) {}; + wxGraphicsBitmapData(renderer), m_bitmapHolder(*static_cast(pseudoNativeBitmap)) {} // returns the native representation void* GetNativeBitmap() const wxOVERRIDE; @@ -2268,8 +2330,8 @@ template class wxD2DBrushResourceHolder : public wxD2DResourceHolder { public: - wxD2DBrushResourceHolder(const wxBrush& brush) : m_sourceBrush(brush) {}; - virtual ~wxD2DBrushResourceHolder() {}; + wxD2DBrushResourceHolder(const wxBrush& brush) : m_sourceBrush(brush) {} + virtual ~wxD2DBrushResourceHolder() {} protected: const wxBrush m_sourceBrush; }; @@ -2645,7 +2707,7 @@ public: wxCOMPtr GetTextFormat() const { return m_textFormat; } - wxCOMPtr GetFont() { return m_font; }; + wxCOMPtr GetFont() { return m_font; } private: // The native, device-independent font object diff --git a/src/msw/hyperlink.cpp b/src/msw/hyperlink.cpp index f39d94ae17..adb922de74 100644 --- a/src/msw/hyperlink.cpp +++ b/src/msw/hyperlink.cpp @@ -174,7 +174,12 @@ bool wxHyperlinkCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) case NM_RETURN: SetVisited(); SendEvent(); - return 0; + + // SendEvent() launches the browser by default, so we consider + // that the event was processed in any case, either by user + // code or by wx itself, hence we always return true to + // indicate that the default processing shouldn't take place. + return true; } } diff --git a/src/msw/iniconf.cpp b/src/msw/iniconf.cpp index 34748ac826..565b6b8c15 100644 --- a/src/msw/iniconf.cpp +++ b/src/msw/iniconf.cpp @@ -288,8 +288,8 @@ bool wxIniConfig::DoReadString(const wxString& szKey, wxString *pstr) const m_strLocalFilename.t_str()); if ( wxIsEmpty(szBuf) ) { // now look in win.ini - wxString strKey = GetKeyName(path.Name()); - GetProfileString(m_strGroup.t_str(), strKey.t_str(), + wxString strWinKey = GetKeyName(path.Name()); + GetProfileString(m_strGroup.t_str(), strWinKey.t_str(), wxT(""), szBuf, WXSIZEOF(szBuf)); } diff --git a/src/msw/menu.cpp b/src/msw/menu.cpp index 4705b802c9..5647690c01 100644 --- a/src/msw/menu.cpp +++ b/src/msw/menu.cpp @@ -793,9 +793,13 @@ bool wxMenu::MSWCommand(WXUINT WXUNUSED(param), WXWORD id_) UINT menuState = ::GetMenuState(GetHmenu(), id_, MF_BYCOMMAND); checked = (menuState & MF_CHECKED) != 0; } - } - item->GetMenu()->SendEvent(id, checked); + item->GetMenu()->SendEvent(id, checked); + } + else + { + SendEvent(id, checked); + } } return true; diff --git a/src/msw/ownerdrw.cpp b/src/msw/ownerdrw.cpp index 166e84542d..fa3ef819b7 100644 --- a/src/msw/ownerdrw.cpp +++ b/src/msw/ownerdrw.cpp @@ -23,12 +23,6 @@ #include "wx/msw/private/dc.h" #include "wx/msw/wrapcctl.h" // for HIMAGELIST -// ---------------------------------------------------------------------------- -// constants for base class -// ---------------------------------------------------------------------------- - -int wxOwnerDrawnBase::ms_defaultMargin = 3; - // ============================================================================ // implementation of wxOwnerDrawn class // ============================================================================ diff --git a/src/msw/popupwin.cpp b/src/msw/popupwin.cpp index f1ed6258ba..3784c52a98 100644 --- a/src/msw/popupwin.cpp +++ b/src/msw/popupwin.cpp @@ -32,19 +32,31 @@ #include "wx/msw/private.h" // for GetDesktopWindow() +// Set to the popup window currently being shown, if any. +// +// Note that this global variable is used in src/msw/window.cpp and so must be +// extern. +wxPopupWindow* wxCurrentPopupWindow = NULL; + // ============================================================================ // implementation // ============================================================================ +// ---------------------------------------------------------------------------- +// wxPopupWindow +// ---------------------------------------------------------------------------- + bool wxPopupWindow::Create(wxWindow *parent, int flags) { // popup windows are created hidden by default Hide(); + m_owner = wxGetTopLevelParent(parent); + return wxPopupWindowBase::Create(parent) && wxWindow::Create(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, - flags | wxPOPUP_WINDOW); + flags); } WXDWORD wxPopupWindow::MSWGetStyle(long flags, WXDWORD *exstyle) const @@ -52,6 +64,14 @@ WXDWORD wxPopupWindow::MSWGetStyle(long flags, WXDWORD *exstyle) const // we only honour the border flags, the others don't make sense for us WXDWORD style = wxWindow::MSWGetStyle(flags & wxBORDER_MASK, exstyle); + // We need to be a popup (i.e. not a child) window in order to not be + // confined to the parent window area, as is required for a drop down, for + // example. Old implementation used WS_CHILD and made this window a child + // of the desktop window, but this resulted in problems with handling input + // in the popup children, and so was changed to the current version. + style &= ~WS_CHILD; + style |= WS_POPUP; + if ( exstyle ) { // a popup window floats on top of everything @@ -61,45 +81,68 @@ WXDWORD wxPopupWindow::MSWGetStyle(long flags, WXDWORD *exstyle) const return style; } -WXHWND wxPopupWindow::MSWGetParent() const -{ - // we must be a child of the desktop to be able to extend beyond the parent - // window client area (like the comboboxes drop downs do) - // - // NB: alternative implementation would be to use WS_POPUP instead of - // WS_CHILD but then showing a popup would deactivate the parent which - // is ugly and working around this, although possible, is even more - // ugly - return (WXHWND)::GetDesktopWindow(); -} - -void wxPopupWindow::SetFocus() -{ - // Focusing on a popup window does not work on MSW unless WS_POPUP style is - // set (which is never the case currently, see the note in MSWGetParent()). - // We do not even want to try to set the focus, as it returns an error from - // SetFocus() on recent Windows versions (since Vista) and the resulting - // debug message is annoying. -} - bool wxPopupWindow::Show(bool show) { - if ( !wxWindowMSW::Show(show) ) - return false; + // It's important to update wxCurrentPopupWindow before showing the window, + // to ensure that it already set by the time the owner gets WM_NCACTIVATE + // from inside Show() so that it knows to remain [appearing] active. + wxCurrentPopupWindow = show ? this : NULL; - if ( show ) + return wxPopupWindowBase::Show(show); +} + +// ---------------------------------------------------------------------------- +// wxPopupTransientWindow +// ---------------------------------------------------------------------------- + +void wxPopupTransientWindow::Popup(wxWindow* focus) +{ + Show(); + + // We can only set focus to one of our children as setting it to another + // window would result in an immediate loss of activation and popup + // disappearance. + if ( focus && IsDescendant(focus) ) + focus->SetFocus(); +} + +void wxPopupTransientWindow::Dismiss() +{ + Hide(); +} + +bool +wxPopupTransientWindow::MSWHandleMessage(WXLRESULT *result, + WXUINT message, + WXWPARAM wParam, + WXLPARAM lParam) +{ + switch ( message ) { - // raise to top of z order - if (!::SetWindowPos(GetHwnd(), HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE)) - { - wxLogLastError(wxT("SetWindowPos")); - } + case WM_NCACTIVATE: + if ( !wParam ) + { + // Hide the window automatically when it loses activation. + Dismiss(); - // and set it as the foreground window so the mouse can be captured - ::SetForegroundWindow(GetHwnd()); + // Activation might have gone to a different window or maybe + // even a different application, don't let our owner continue + // to appear active in this case. + wxWindow* const owner = MSWGetOwner(); + if ( owner ) + { + const HWND hwndActive = ::GetActiveWindow(); + if ( hwndActive != GetHwndOf(owner) ) + { + ::SendMessage(GetHwndOf(owner), WM_NCACTIVATE, FALSE, 0); + } + } + } + break; } - return true; + return wxPopupTransientWindowBase::MSWHandleMessage(result, message, + wParam, lParam); } #endif // #if wxUSE_POPUPWIN diff --git a/src/msw/printwin.cpp b/src/msw/printwin.cpp index 48e61003c1..b608aeacec 100644 --- a/src/msw/printwin.cpp +++ b/src/msw/printwin.cpp @@ -48,9 +48,8 @@ #include "wx/msw/printdlg.h" #include "wx/msw/private.h" #include "wx/msw/dcprint.h" -#if wxUSE_ENH_METAFILE - #include "wx/msw/enhmeta.h" -#endif +#include "wx/msw/enhmeta.h" + #include // --------------------------------------------------------------------------- diff --git a/src/msw/renderer.cpp b/src/msw/renderer.cpp index d94f0c582f..6d529a1946 100644 --- a/src/msw/renderer.cpp +++ b/src/msw/renderer.cpp @@ -521,8 +521,12 @@ wxRendererMSW::DrawTitleBarBitmap(wxWindow *win, DoDrawFrameControl(DFC_CAPTION, kind, win, dc, rect, flags); } -wxSize wxRendererMSW::GetCheckBoxSize(wxWindow * WXUNUSED(win)) +wxSize wxRendererMSW::GetCheckBoxSize(wxWindow* win) { + // Even though we don't use the window in this implementation, still check + // that it's valid to avoid surprises when using themes. + wxCHECK_MSG( win, wxSize(0, 0), "Must have a valid window" ); + return wxSize(::GetSystemMetrics(SM_CXMENUCHECK), ::GetSystemMetrics(SM_CYMENUCHECK)); } @@ -830,6 +834,8 @@ wxRendererXP::DrawTitleBarBitmap(wxWindow *win, wxSize wxRendererXP::GetCheckBoxSize(wxWindow* win) { + wxCHECK_MSG( win, wxSize(0, 0), "Must have a valid window" ); + wxUxThemeHandle hTheme(win, L"BUTTON"); if (hTheme) { diff --git a/src/msw/thread.cpp b/src/msw/thread.cpp index 0805e1e19a..5c94613f46 100644 --- a/src/msw/thread.cpp +++ b/src/msw/thread.cpp @@ -875,6 +875,20 @@ bool wxThreadInternal::Suspend() return false; } + // Calling GetThreadContext() forces the thread to actually be suspended: + // just calling SuspendThread() is not enough, it just asks the scheduler + // to suspend the thread at the next opportunity and by then we may already + // exit wxThread::Pause() and leave m_critsect, meaning that the thread + // could enter it and end up suspended inside a CS, which will inevitably + // result in a deadlock later. + CONTEXT ctx; + // We don't really need the context, but we still must initialize it. + ctx.ContextFlags = CONTEXT_FULL; + if ( !::GetThreadContext(m_hThread, &ctx) ) + { + wxLogLastError(wxS("GetThreadContext")); + } + m_state = STATE_PAUSED; return true; diff --git a/src/msw/timectrl.cpp b/src/msw/timectrl.cpp index 7469e12c3c..e02af0d273 100644 --- a/src/msw/timectrl.cpp +++ b/src/msw/timectrl.cpp @@ -21,7 +21,7 @@ #pragma hdrstop #endif -#if wxUSE_DATEPICKCTRL +#if wxUSE_TIMEPICKCTRL #ifndef WX_PRECOMP #include "wx/msw/wrapcctl.h" @@ -61,4 +61,4 @@ bool wxTimePickerCtrl::MSWOnDateTimeChange(const NMDATETIMECHANGE& dtch) wxDateEvent event(this, m_date, wxEVT_TIME_CHANGED); return HandleWindowEvent(event); } -#endif // wxUSE_DATEPICKCTRL +#endif // wxUSE_TIMEPICKCTRL diff --git a/src/msw/toplevel.cpp b/src/msw/toplevel.cpp index a7d4bac9b6..df9e001c93 100644 --- a/src/msw/toplevel.cpp +++ b/src/msw/toplevel.cpp @@ -579,6 +579,15 @@ bool wxTopLevelWindowMSW::Show(bool show) } else // hide { + // When hiding the window, remember if it was maximized or iconized in + // order to return the correct value from Is{Maximized,Iconized}(). + if ( ::IsZoomed(GetHwnd()) ) + m_showCmd = SW_MAXIMIZE; + else if ( ::IsIconic(GetHwnd()) ) + m_showCmd = SW_MINIMIZE; + else + m_showCmd = SW_SHOW; + nShowCmd = SW_HIDE; } @@ -905,20 +914,13 @@ bool wxTopLevelWindowMSW::ShowFullScreen(bool show, long style) // change our window style to be compatible with full-screen mode updateStyle.Apply(); - wxRect rect; -#if wxUSE_DISPLAY - // resize to the size of the display containing us + // resize to the size of the display containing us, falling back to the + // primary one int dpy = wxDisplay::GetFromWindow(this); - if ( dpy != wxNOT_FOUND ) - { - rect = wxDisplay(dpy).GetGeometry(); - } - else // fall back to the main desktop -#endif // wxUSE_DISPLAY - { - // resize to the size of the desktop - wxCopyRECTToRect(wxGetWindowRect(::GetDesktopWindow()), rect); - } + if ( dpy == wxNOT_FOUND ) + dpy = 0; + + const wxRect rect = wxDisplay(dpy).GetGeometry(); SetSize(rect); diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index 90708c2b04..2fc500a202 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -1225,24 +1225,12 @@ wxOperatingSystemId wxGetOsVersion(int *verMaj, int *verMin, int *verMicro) bool wxCheckOsVersion(int majorVsn, int minorVsn, int microVsn) { - OSVERSIONINFOEX osvi; - wxZeroMemory(osvi); - osvi.dwOSVersionInfoSize = sizeof(osvi); + int majorCur, minorCur, microCur; + wxGetOsVersion(&majorCur, &minorCur, µCur); - DWORDLONG const dwlConditionMask = - ::VerSetConditionMask( - ::VerSetConditionMask( - ::VerSetConditionMask( - 0, VER_MAJORVERSION, VER_GREATER_EQUAL), - VER_MINORVERSION, VER_GREATER_EQUAL), - VER_BUILDNUMBER, VER_GREATER_EQUAL); - - osvi.dwMajorVersion = majorVsn; - osvi.dwMinorVersion = minorVsn; - osvi.dwBuildNumber = microVsn; - - return ::VerifyVersionInfo(&osvi, - VER_MAJORVERSION | VER_MINORVERSION | VER_BUILDNUMBER, dwlConditionMask) != FALSE; + return majorCur > majorVsn + || (majorCur == majorVsn && minorCur > minorVsn) + || (majorCur == majorVsn && minorCur == minorVsn && microCur >= microVsn); } wxWinVersion wxGetWinVersion() diff --git a/src/msw/utilsgui.cpp b/src/msw/utilsgui.cpp index 98e985d6e1..7c7bfcf07c 100644 --- a/src/msw/utilsgui.cpp +++ b/src/msw/utilsgui.cpp @@ -117,55 +117,6 @@ void wxGetMousePosition( int* x, int* y ) if ( y ) *y = pt.y; } -// Return true if we have a colour display -bool wxColourDisplay() -{ - // this function is called from wxDC ctor so it is called a *lot* of times - // hence we optimize it a bit but doing the check only once - // - // this should be MT safe as only the GUI thread (holding the GUI mutex) - // can call us - static int s_isColour = -1; - - if ( s_isColour == -1 ) - { - ScreenHDC dc; - int noCols = ::GetDeviceCaps(dc, NUMCOLORS); - - s_isColour = (noCols == -1) || (noCols > 2); - } - - return s_isColour != 0; -} - -// Returns depth of screen -int wxDisplayDepth() -{ - ScreenHDC dc; - return GetDeviceCaps(dc, PLANES) * GetDeviceCaps(dc, BITSPIXEL); -} - -// Get size of display -void wxDisplaySize(int *width, int *height) -{ - ScreenHDC dc; - - if ( width ) - *width = ::GetDeviceCaps(dc, HORZRES); - if ( height ) - *height = ::GetDeviceCaps(dc, VERTRES); -} - -void wxDisplaySizeMM(int *width, int *height) -{ - ScreenHDC dc; - - if ( width ) - *width = ::GetDeviceCaps(dc, HORZSIZE); - if ( height ) - *height = ::GetDeviceCaps(dc, VERTSIZE); -} - // --------------------------------------------------------------------------- // window information functions // --------------------------------------------------------------------------- diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 83add1d1d8..d17cf3f39e 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -60,6 +60,7 @@ #include "wx/hashmap.h" #include "wx/evtloop.h" +#include "wx/popupwin.h" #include "wx/power.h" #include "wx/scopeguard.h" #include "wx/sysopt.h" @@ -134,6 +135,10 @@ extern wxMenu *wxCurrentPopupMenu; #endif +#if wxUSE_POPUPWIN +extern wxPopupWindow* wxCurrentPopupWindow; +#endif // wxUSE_POPUPWIN + #if wxUSE_UXTHEME // This is a hack used by the owner-drawn wxButton implementation to ensure // that the brush used for erasing its background is correctly aligned with the @@ -3677,6 +3682,23 @@ wxWindowMSW::MSWHandleMessage(WXLRESULT *result, } break; + case WM_NCACTIVATE: + // When we're losing activation to our own popup window, we want to + // retain the "active" appearance of the title bar, as dropping + // down a combobox popup shouldn't deactivate the window containing + // the combobox, for example. Explicitly calling DefWindowProc() to + // draw the window as active seems to be the only way of achieving + // this (thanks to Barmak Shemirani for suggesting it at + // https://stackoverflow.com/a/52808753/15275). + if ( !wParam && + wxCurrentPopupWindow && + wxCurrentPopupWindow->MSWGetOwner() == this ) + { + rc.result = MSWDefWindowProc(message, TRUE, lParam); + processed = true; + } + break; + #if wxUSE_UXTHEME // If we want the default themed border then we need to draw it ourselves case WM_NCCALCSIZE: diff --git a/src/osx/carbon/font.cpp b/src/osx/carbon/font.cpp index 53775b16b3..73f22a35fb 100644 --- a/src/osx/carbon/font.cpp +++ b/src/osx/carbon/font.cpp @@ -971,9 +971,9 @@ wxString wxNativeFontInfo::ToString() const { wxString s; - s.Printf(wxT("%d;%f;%d;%d;%d;%d;%d;%s;%d"), + s.Printf(wxT("%d;%s;%d;%d;%d;%d;%d;%s;%d"), 1, // version - GetFractionalPointSize(), + wxString::FromCDouble(GetFractionalPointSize()), GetFamily(), (int)GetStyle(), GetNumericWeight(), diff --git a/src/osx/carbon/graphics.cpp b/src/osx/carbon/graphics.cpp index c2fc7523b6..16f58329da 100644 --- a/src/osx/carbon/graphics.cpp +++ b/src/osx/carbon/graphics.cpp @@ -39,6 +39,7 @@ #include "wx/osx/dcclient.h" #include "wx/osx/dcmemory.h" #include "wx/osx/private.h" + #include "wx/osx/core/cfdictionary.h" #else #include "CoreServices/CoreServices.h" #include "ApplicationServices/ApplicationServices.h" @@ -1430,6 +1431,9 @@ public: private: bool EnsureIsValid(); void CheckInvariants() const; + bool DoSetAntialiasMode(wxAntialiasMode antialias); + bool DoSetInterpolationQuality(wxInterpolationQuality interpolation); + bool DoSetCompositionMode(wxCompositionMode op); virtual void DoDrawText( const wxString &str, wxDouble x, wxDouble y ) wxOVERRIDE; virtual void DoDrawRotatedText( const wxString &str, wxDouble x, wxDouble y, wxDouble angle ) wxOVERRIDE; @@ -1678,6 +1682,16 @@ bool wxMacCoreGraphicsContext::SetAntialiasMode(wxAntialiasMode antialias) m_antialias = antialias; + if ( !DoSetAntialiasMode(antialias) ) + { + return false; + } + CheckInvariants(); + return true; +} + +bool wxMacCoreGraphicsContext::DoSetAntialiasMode(wxAntialiasMode antialias) +{ bool antialiasMode; switch (antialias) { @@ -1691,7 +1705,6 @@ bool wxMacCoreGraphicsContext::SetAntialiasMode(wxAntialiasMode antialias) return false; } CGContextSetShouldAntialias(m_cgContext, antialiasMode); - CheckInvariants(); return true; } @@ -1704,9 +1717,20 @@ bool wxMacCoreGraphicsContext::SetInterpolationQuality(wxInterpolationQuality in return true; m_interpolation = interpolation; + + if ( !DoSetInterpolationQuality(interpolation) ) + { + return false; + } + CheckInvariants(); + return true; +} + +bool wxMacCoreGraphicsContext::DoSetInterpolationQuality(wxInterpolationQuality interpolation) +{ CGInterpolationQuality quality; - - switch (interpolation) + + switch (interpolation) { case wxINTERPOLATION_DEFAULT: quality = kCGInterpolationDefault; @@ -1727,7 +1751,6 @@ bool wxMacCoreGraphicsContext::SetInterpolationQuality(wxInterpolationQuality in return false; } CGContextSetInterpolationQuality(m_cgContext, quality); - CheckInvariants(); return true; } @@ -1741,7 +1764,17 @@ bool wxMacCoreGraphicsContext::SetCompositionMode(wxCompositionMode op) m_composition = op; - if (m_composition == wxCOMPOSITION_DEST) + if ( !DoSetCompositionMode(op) ) + { + return false; + } + CheckInvariants(); + return true; +} + +bool wxMacCoreGraphicsContext::DoSetCompositionMode(wxCompositionMode op) +{ + if (op == wxCOMPOSITION_DEST) return true; // TODO REMOVE if we don't need it because of bugs in 10.5 @@ -1751,44 +1784,44 @@ bool wxMacCoreGraphicsContext::SetCompositionMode(wxCompositionMode op) CGBlendMode mode = kCGBlendModeNormal; switch( op ) { - case wxCOMPOSITION_CLEAR: - cop = kCGCompositeOperationClear; - break; - case wxCOMPOSITION_SOURCE: - cop = kCGCompositeOperationCopy; - break; - case wxCOMPOSITION_OVER: - mode = kCGBlendModeNormal; - break; - case wxCOMPOSITION_IN: - cop = kCGCompositeOperationSourceIn; - break; - case wxCOMPOSITION_OUT: - cop = kCGCompositeOperationSourceOut; - break; - case wxCOMPOSITION_ATOP: - cop = kCGCompositeOperationSourceAtop; - break; - case wxCOMPOSITION_DEST_OVER: - cop = kCGCompositeOperationDestinationOver; - break; - case wxCOMPOSITION_DEST_IN: - cop = kCGCompositeOperationDestinationIn; - break; - case wxCOMPOSITION_DEST_OUT: - cop = kCGCompositeOperationDestinationOut; - break; - case wxCOMPOSITION_DEST_ATOP: - cop = kCGCompositeOperationDestinationAtop; - break; - case wxCOMPOSITION_XOR: - cop = kCGCompositeOperationXOR; - break; - case wxCOMPOSITION_ADD: - mode = kCGBlendModePlusLighter ; - break; - default: - return false; + case wxCOMPOSITION_CLEAR: + cop = kCGCompositeOperationClear; + break; + case wxCOMPOSITION_SOURCE: + cop = kCGCompositeOperationCopy; + break; + case wxCOMPOSITION_OVER: + mode = kCGBlendModeNormal; + break; + case wxCOMPOSITION_IN: + cop = kCGCompositeOperationSourceIn; + break; + case wxCOMPOSITION_OUT: + cop = kCGCompositeOperationSourceOut; + break; + case wxCOMPOSITION_ATOP: + cop = kCGCompositeOperationSourceAtop; + break; + case wxCOMPOSITION_DEST_OVER: + cop = kCGCompositeOperationDestinationOver; + break; + case wxCOMPOSITION_DEST_IN: + cop = kCGCompositeOperationDestinationIn; + break; + case wxCOMPOSITION_DEST_OUT: + cop = kCGCompositeOperationDestinationOut; + break; + case wxCOMPOSITION_DEST_ATOP: + cop = kCGCompositeOperationDestinationAtop; + break; + case wxCOMPOSITION_XOR: + cop = kCGCompositeOperationXOR; + break; + case wxCOMPOSITION_ADD: + mode = kCGBlendModePlusLighter ; + break; + default: + return false; } if ( cop != kCGCompositeOperationSourceOver ) CGContextSetCompositeOperation(m_cgContext, cop); @@ -1800,50 +1833,47 @@ bool wxMacCoreGraphicsContext::SetCompositionMode(wxCompositionMode op) CGBlendMode mode = kCGBlendModeNormal; switch( op ) { - case wxCOMPOSITION_CLEAR: - mode = kCGBlendModeClear; - break; - case wxCOMPOSITION_SOURCE: - mode = kCGBlendModeCopy; - break; - case wxCOMPOSITION_OVER: - mode = kCGBlendModeNormal; - break; - case wxCOMPOSITION_IN: - mode = kCGBlendModeSourceIn; - break; - case wxCOMPOSITION_OUT: - mode = kCGBlendModeSourceOut; - break; - case wxCOMPOSITION_ATOP: - mode = kCGBlendModeSourceAtop; - break; - case wxCOMPOSITION_DEST_OVER: - mode = kCGBlendModeDestinationOver; - break; - case wxCOMPOSITION_DEST_IN: - mode = kCGBlendModeDestinationIn; - break; - case wxCOMPOSITION_DEST_OUT: - mode = kCGBlendModeDestinationOut; - break; - case wxCOMPOSITION_DEST_ATOP: - mode = kCGBlendModeDestinationAtop; - break; - case wxCOMPOSITION_XOR: - mode = kCGBlendModeExclusion; // Not kCGBlendModeXOR! - break; - - case wxCOMPOSITION_ADD: - mode = kCGBlendModePlusLighter ; - break; - default: - return false; + case wxCOMPOSITION_CLEAR: + mode = kCGBlendModeClear; + break; + case wxCOMPOSITION_SOURCE: + mode = kCGBlendModeCopy; + break; + case wxCOMPOSITION_OVER: + mode = kCGBlendModeNormal; + break; + case wxCOMPOSITION_IN: + mode = kCGBlendModeSourceIn; + break; + case wxCOMPOSITION_OUT: + mode = kCGBlendModeSourceOut; + break; + case wxCOMPOSITION_ATOP: + mode = kCGBlendModeSourceAtop; + break; + case wxCOMPOSITION_DEST_OVER: + mode = kCGBlendModeDestinationOver; + break; + case wxCOMPOSITION_DEST_IN: + mode = kCGBlendModeDestinationIn; + break; + case wxCOMPOSITION_DEST_OUT: + mode = kCGBlendModeDestinationOut; + break; + case wxCOMPOSITION_DEST_ATOP: + mode = kCGBlendModeDestinationAtop; + break; + case wxCOMPOSITION_XOR: + mode = kCGBlendModeExclusion; // Not kCGBlendModeXOR! + break; + case wxCOMPOSITION_ADD: + mode = kCGBlendModePlusLighter ; + break; + default: + return false; } CGContextSetBlendMode(m_cgContext, mode); } - - CheckInvariants(); return true; } @@ -1939,6 +1969,12 @@ void wxMacCoreGraphicsContext::ResetClip() transformNew = CGAffineTransformInvert( transformNew ) ; CGContextConcatCTM( m_cgContext, transformNew); CGContextConcatCTM( m_cgContext, transform); + // Retain antialiasing mode + DoSetAntialiasMode(m_antialias); + // Retain interpolation quality + DoSetInterpolationQuality(m_interpolation); + // Retain composition mode + DoSetCompositionMode(m_composition); } else { @@ -2263,7 +2299,23 @@ void wxMacCoreGraphicsContext::DoDrawText( const wxString &str, wxDouble x, wxDo CGColorRef col = wxMacCreateCGColor( fref->GetColour() ); CTFontRef font = fref->OSXGetCTFont(); - wxCFRef attrtext( CFAttributedStringCreate(kCFAllocatorDefault, text, fref->OSXGetCTFontAttributes()) ); + wxCFDictionaryRef fontattr(wxCFRetain(fref->OSXGetCTFontAttributes())); + wxCFMutableDictionaryRef inlinefontattr; + + bool setColorsInLine = false; + + // if we emulate boldness the stroke color is not taken from the current context + // therefore we have to set it explicitly + if ( fontattr.GetValue(kCTStrokeWidthAttributeName) != NULL) + { + setColorsInLine = true; + inlinefontattr = fontattr.CreateMutableCopy(); + inlinefontattr.SetValue(kCTForegroundColorFromContextAttributeName, kCFBooleanFalse); + inlinefontattr.SetValue(kCTForegroundColorAttributeName,col); + inlinefontattr.SetValue(kCTStrokeColorAttributeName,col); + } + + wxCFRef attrtext( CFAttributedStringCreate(kCFAllocatorDefault, text, setColorsInLine ? inlinefontattr : fontattr ) ); wxCFRef line( CTLineCreateWithAttributedString(attrtext) ); y += CTFontGetAscent(font); diff --git a/src/osx/carbon/region.cpp b/src/osx/carbon/region.cpp index a881b0996a..907b0f33fd 100644 --- a/src/osx/carbon/region.cpp +++ b/src/osx/carbon/region.cpp @@ -77,6 +77,21 @@ wxRegion::wxRegion(WXHRGN hRegion ) wxRegion::wxRegion(long x, long y, long w, long h) { + // Rectangle needs to be given in the canonical form, + // with (x,y) pointing to the top-left corner + // and with non-negative width and height + // (for compatibility with wxMSW anf wxGTK). + if ( w < 0 ) + { + w = -w; + x -= (w - 1); + } + if ( h < 0 ) + { + h = -h; + y -= (h - 1); + } + m_refData = new wxRegionRefData(x , y , w , h ); } diff --git a/src/osx/carbon/renderer.cpp b/src/osx/carbon/renderer.cpp index 0f777377ac..aa124a816d 100644 --- a/src/osx/carbon/renderer.cpp +++ b/src/osx/carbon/renderer.cpp @@ -484,8 +484,13 @@ wxRendererMac::DrawCheckBox(wxWindow *win, kind, kThemeAdornmentNone); } -wxSize wxRendererMac::GetCheckBoxSize(wxWindow* WXUNUSED(win)) +wxSize wxRendererMac::GetCheckBoxSize(wxWindow* win) { + // Even though we don't use the window in this implementation, still check + // that it's valid to avoid surprises when running the same code under the + // other platforms. + wxCHECK_MSG( win, wxSize(0, 0), "Must have a valid window" ); + wxSize size; SInt32 width, height; OSStatus errStatus; diff --git a/src/osx/carbon/utilscocoa.mm b/src/osx/carbon/utilscocoa.mm index 6c5ace2279..b134feb8e9 100644 --- a/src/osx/carbon/utilscocoa.mm +++ b/src/osx/carbon/utilscocoa.mm @@ -218,7 +218,7 @@ WXImage wxOSXGetImageFromCGImage( CGImageRef image, double scaleFactor, bool is #endif } -#if wxOSX_USE_ICONREF +#if wxOSX_USE_COCOA WXImage WXDLLIMPEXP_CORE wxOSXGetNSImageFromIconRef( WXHICON iconref ) { NSImage *newImage = [[NSImage alloc] initWithIconRef:iconref]; diff --git a/src/osx/choice_osx.cpp b/src/osx/choice_osx.cpp index 72449ab64d..fac0ccb173 100644 --- a/src/osx/choice_osx.cpp +++ b/src/osx/choice_osx.cpp @@ -30,7 +30,6 @@ wxChoice::~wxChoice() for ( i = 0; i < max; ++i ) delete GetClientObject( i ); } - delete m_popUpMenu; } bool wxChoice::Create(wxWindow *parent, @@ -70,10 +69,7 @@ bool wxChoice::Create(wxWindow *parent, if ( !wxChoiceBase::Create( parent, id, pos, size, style, validator, name ) ) return false; - m_popUpMenu = new wxMenu(); - m_popUpMenu->SetNoEventsMode(true); - - SetPeer(wxWidgetImpl::CreateChoice( this, parent, id, m_popUpMenu, pos, size, style, GetExtraStyle() )); + SetPeer(wxWidgetImpl::CreateChoice( this, parent, id, NULL, pos, size, style, GetExtraStyle() )); MacPostControlCreate( pos, size ); @@ -133,7 +129,7 @@ int wxChoice::DoInsertItems(const wxArrayStringsAdapter & items, wxString text = items[i]; if (text.empty()) text = " "; // menu items can't have empty labels - m_popUpMenu->Insert( idx, i+1, text ); + dynamic_cast(GetPeer())->InsertItem( idx, i+1, text ); m_datas.Insert( NULL, idx ); AssignNewItemClientData(idx, clientData, i, type); } @@ -150,8 +146,7 @@ void wxChoice::DoDeleteOneItem(unsigned int n) if ( HasClientObjectData() ) delete GetClientObject( n ); - m_popUpMenu->Delete( m_popUpMenu->FindItemByPosition( n ) ); - + dynamic_cast(GetPeer())->RemoveItem(n); m_strings.RemoveAt( n ) ; m_datas.RemoveAt( n ) ; @@ -160,10 +155,7 @@ void wxChoice::DoDeleteOneItem(unsigned int n) void wxChoice::DoClear() { - for ( unsigned int i = 0 ; i < GetCount() ; i++ ) - { - m_popUpMenu->Delete( m_popUpMenu->FindItemByPosition( 0 ) ); - } + dynamic_cast(GetPeer())->Clear(); m_strings.Empty() ; m_datas.Empty() ; @@ -210,7 +202,7 @@ void wxChoice::SetString(unsigned int n, const wxString& s) m_strings[n] = s ; - m_popUpMenu->FindItemByPosition( n )->SetItemLabel( s ) ; + dynamic_cast(GetPeer())->SetItem(n,s); } wxString wxChoice::GetString(unsigned int n) const diff --git a/src/osx/cocoa/choice.mm b/src/osx/cocoa/choice.mm index 26dccc9d4b..bcad4b29b3 100644 --- a/src/osx/cocoa/choice.mm +++ b/src/osx/cocoa/choice.mm @@ -55,12 +55,22 @@ - (NSControlSize)controlSize; @end -class wxChoiceCocoaImpl : public wxWidgetCocoaImpl +class wxChoiceCocoaImpl : public wxWidgetCocoaImpl, public wxChoiceWidgetImpl { public: wxChoiceCocoaImpl(wxWindowMac *wxpeer, wxNSPopUpButton *v) : wxWidgetCocoaImpl(wxpeer, v) { + m_popUpMenu = new wxMenu(); + m_popUpMenu->SetNoEventsMode(true); + [v setMenu: m_popUpMenu->GetHMenu()]; + [v setAutoenablesItems:NO]; + + } + + ~wxChoiceCocoaImpl() + { + delete m_popUpMenu; } void GetLayoutInset(int &left , int &top , int &right, int &bottom) const wxOVERRIDE @@ -96,6 +106,29 @@ public: break; } } + + void InsertItem( size_t pos, int itemid, const wxString& text) wxOVERRIDE + { + m_popUpMenu->Insert( pos, itemid, text ); + } + + size_t GetNumberOfItems() const wxOVERRIDE + { + return m_popUpMenu->GetMenuItemCount(); + } + + void RemoveItem( size_t pos ) wxOVERRIDE + { + m_popUpMenu->Delete( m_popUpMenu->FindItemByPosition( pos ) ); + } + + void SetItem(int pos, const wxString& s) wxOVERRIDE + { + m_popUpMenu->FindItemByPosition( pos )->SetItemLabel( s ) ; + } + +private: + wxMenu* m_popUpMenu; }; wxWidgetImplType* wxWidgetImpl::CreateChoice( wxWindowMac* wxpeer, @@ -109,8 +142,6 @@ wxWidgetImplType* wxWidgetImpl::CreateChoice( wxWindowMac* wxpeer, { NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ; wxNSPopUpButton* v = [[wxNSPopUpButton alloc] initWithFrame:r pullsDown:NO]; - [v setMenu: menu->GetHMenu()]; - [v setAutoenablesItems:NO]; wxWidgetCocoaImpl* c = new wxChoiceCocoaImpl( wxpeer, v ); return c; } diff --git a/src/osx/cocoa/colour.mm b/src/osx/cocoa/colour.mm index d7fc6ec81d..32d6ae8c8c 100644 --- a/src/osx/cocoa/colour.mm +++ b/src/osx/cocoa/colour.mm @@ -27,6 +27,8 @@ public: virtual CGFloat Blue() const wxOVERRIDE; virtual CGFloat Alpha() const wxOVERRIDE; + virtual bool IsSolid() const wxOVERRIDE; + CGColorRef GetCGColor() const wxOVERRIDE; virtual wxColourRefData* Clone() const wxOVERRIDE { return new wxNSColorRefData(*this); } @@ -94,6 +96,11 @@ CGFloat wxNSColorRefData::Alpha() const return 0.0; } +bool wxNSColorRefData::IsSolid() const +{ + return [m_nsColour colorUsingColorSpaceName:NSCalibratedRGBColorSpace] != nil; +} + CGColorRef wxNSColorRefData::GetCGColor() const { #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_8 diff --git a/src/osx/cocoa/dataview.mm b/src/osx/cocoa/dataview.mm index eefabd7ed1..09a532dbef 100644 --- a/src/osx/cocoa/dataview.mm +++ b/src/osx/cocoa/dataview.mm @@ -14,7 +14,7 @@ #include "wx/dataview.h" -#if !defined(wxUSE_GENERICDATAVIEWCTRL) +#if !defined(wxHAS_GENERIC_DATAVIEWCTRL) #ifndef WX_PRECOMP #include "wx/app.h" @@ -1657,6 +1657,7 @@ outlineView:(NSOutlineView*)outlineView const wxDataViewItem item = wxDataViewItemFromItem([self itemAtRow:[self clickedRow]]); wxDataViewEvent event(wxEVT_DATAVIEW_ITEM_ACTIVATED, dvc, item); + event.SetColumn( [self clickedColumn] ); dvc->GetEventHandler()->ProcessEvent(event); } @@ -3555,6 +3556,6 @@ void wxDataViewColumn::SetNativeData(wxDataViewColumnNativeData* newNativeDataPt m_NativeDataPtr = newNativeDataPtr; } -#endif // !wxUSE_GENERICDATAVIEWCTRL +#endif // !defined(wxHAS_GENERIC_DATAVIEWCTRL) #endif // wxUSE_DATAVIEWCTRL diff --git a/src/osx/cocoa/glcanvas.mm b/src/osx/cocoa/glcanvas.mm index cc889507e7..de9ff18901 100644 --- a/src/osx/cocoa/glcanvas.mm +++ b/src/osx/cocoa/glcanvas.mm @@ -135,6 +135,11 @@ WXGLPixelFormat WXGLChoosePixelFormat(const int *GLAttrs, return YES; } +- (BOOL) acceptsFirstResponder +{ + return YES; +} + @end bool wxGLCanvas::DoCreate(wxWindow *parent, @@ -154,7 +159,7 @@ bool wxGLCanvas::DoCreate(wxWindow *parent, NSRect r = wxOSXGetFrameForControl( this, pos , size ) ; wxNSCustomOpenGLView* v = [[wxNSCustomOpenGLView alloc] initWithFrame:r]; - wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( this, v, false, true ); + wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( this, v ); SetPeer(c); MacPostControlCreate(pos, size) ; return true; diff --git a/src/osx/cocoa/nonownedwnd.mm b/src/osx/cocoa/nonownedwnd.mm index 9a7bb661e6..a1084ccc15 100644 --- a/src/osx/cocoa/nonownedwnd.mm +++ b/src/osx/cocoa/nonownedwnd.mm @@ -769,15 +769,16 @@ long style, long extraStyle, const wxString& WXUNUSED(name) ) [m_macWindow setDelegate:controller]; [controller addObservers:m_macWindow]; - - if ( ( style & wxFRAME_SHAPED) ) - { - [m_macWindow setOpaque:NO]; - [m_macWindow setAlphaValue:1.0]; - } if ( !(style & wxFRAME_TOOL_WINDOW) ) [m_macWindow setHidesOnDeactivate:NO]; + + if ( GetWXPeer()->GetBackgroundStyle() == wxBG_STYLE_TRANSPARENT ) + { + [m_macWindow setOpaque:NO]; + [m_macWindow setAlphaValue:1.0]; + [m_macWindow setBackgroundColor:[NSColor clearColor]]; + } } void wxNonOwnedWindowCocoaImpl::Create( wxWindow* WXUNUSED(parent), WXWindow nativeWindow ) diff --git a/src/osx/cocoa/statbmp.mm b/src/osx/cocoa/statbmp.mm new file mode 100644 index 0000000000..a1833634ff --- /dev/null +++ b/src/osx/cocoa/statbmp.mm @@ -0,0 +1,101 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: src/osx/cocoa/statbmp.mm +// Purpose: wxStaticBitmap +// Author: Stefan Csomor +// Created: 28.06.99 +// Copyright: (c) 2008 Stefan Csomor +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +// ============================================================================ +// declarations +// ============================================================================ + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ +#pragma hdrstop +#endif + +#if wxUSE_STATBMP + +#include "wx/statline.h" + +#ifndef WX_PRECOMP +#include "wx/statbmp.h" +#endif + +#include "wx/osx/private.h" + +class wxStaticBitmapCocoaImpl : public wxWidgetCocoaImpl +{ +public : + wxStaticBitmapCocoaImpl(wxWindowMac* peer , WXWidget w) : + wxWidgetCocoaImpl(peer, w) + { + } + + ~wxStaticBitmapCocoaImpl() + { + } + + void SetLabel( const wxString& title, wxFontEncoding encoding ) wxOVERRIDE + { + // although NSControl has this method, NSImageView throws an exception if it is called + } + + void SetScaleMode(wxStaticBitmap::ScaleMode scaleMode) + { + NSImageView* v = (NSImageView*) m_osxView; + + NSImageScaling scaling = NSImageScaleNone; + switch ( scaleMode ) + { + case wxStaticBitmap::Scale_Fill: + scaling = NSImageScaleAxesIndependently; + break; + case wxStaticBitmap::Scale_AspectFill: + scaling = NSImageScaleProportionallyUpOrDown; + break; + case wxStaticBitmap::Scale_AspectFit: + scaling = NSImageScaleProportionallyUpOrDown; + break; + default: + break; + } + [v setImageScaling:scaling]; + } +}; + +void wxStaticBitmap::SetScaleMode(ScaleMode scaleMode) +{ + m_scaleMode = scaleMode; + + dynamic_cast(GetPeer())->SetScaleMode(scaleMode); + + Refresh(); +} + + +wxWidgetImplType* wxWidgetImpl::CreateStaticBitmap( wxWindowMac* wxpeer, + wxWindowMac* WXUNUSED(parent), + wxWindowID WXUNUSED(id), + const wxBitmap& bitmap, + const wxPoint& pos, + const wxSize& size, + long WXUNUSED(style), + long WXUNUSED(extraStyle)) +{ + NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ; + NSImageView* v = [[NSImageView alloc] initWithFrame:r]; + + wxWidgetCocoaImpl* c = new wxStaticBitmapCocoaImpl( wxpeer, v ); + return c; +} + +#endif //wxUSE_STATBMP diff --git a/src/osx/cocoa/utils.mm b/src/osx/cocoa/utils.mm index 4e83ce9036..d41809fd1a 100644 --- a/src/osx/cocoa/utils.mm +++ b/src/osx/cocoa/utils.mm @@ -484,19 +484,11 @@ void wxApp::DoCleanUp() } } -void wxClientDisplayRect(int *x, int *y, int *width, int *height) +extern // used from src/osx/core/display.cpp +wxRect wxOSXGetMainDisplayClientArea() { NSRect displayRect = [wxOSXGetMenuScreen() visibleFrame]; - wxRect r = wxFromNSRect( NULL, displayRect ); - if ( x ) - *x = r.x; - if ( y ) - *y = r.y; - if ( width ) - *width = r.GetWidth(); - if ( height ) - *height = r.GetHeight(); - + return wxFromNSRect( NULL, displayRect ); } void wxGetMousePosition( int* x, int* y ) diff --git a/src/osx/cocoa/window.mm b/src/osx/cocoa/window.mm index eaddbc7cad..3695a1b185 100644 --- a/src/osx/cocoa/window.mm +++ b/src/osx/cocoa/window.mm @@ -2573,6 +2573,10 @@ bool wxWidgetCocoaImpl::IsVisible() const void wxWidgetCocoaImpl::SetVisibility( bool visible ) { [m_osxView setHidden:(visible ? NO:YES)]; + + // trigger redraw upon shown for layer-backed views + if( m_osxView.layer && !m_osxView.isHiddenOrHasHiddenAncestor ) + SetNeedsDisplay(NULL); } double wxWidgetCocoaImpl::GetContentScaleFactor() const @@ -3028,7 +3032,7 @@ static void SetSubviewsNeedDisplay( NSView *view ) { for ( NSView *sub in view.subviews ) { - if ( !sub.layer ) + if ( sub.isHidden || !sub.layer ) continue; [sub setNeedsDisplay:YES]; @@ -3136,7 +3140,14 @@ void wxWidgetCocoaImpl::SetBackgroundColour( const wxColour &col ) if ( [targetView respondsToSelector:@selector(setBackgroundColor:) ] ) { - [targetView setBackgroundColor: col.OSXGetNSColor()]; + wxWindow* peer = GetWXPeer(); + if ( peer->GetBackgroundStyle() != wxBG_STYLE_TRANSPARENT ) + { + wxTopLevelWindow* toplevel = wxDynamicCast(peer,wxTopLevelWindow); + + if ( toplevel == NULL || toplevel->GetShape().IsEmpty() ) + [targetView setBackgroundColor: col.OSXGetNSColor()]; + } } } @@ -3147,6 +3158,8 @@ bool wxWidgetCocoaImpl::SetBackgroundStyle( wxBackgroundStyle style ) if ( [m_osxView respondsToSelector:@selector(setOpaque:) ] ) { [m_osxView setOpaque: opaque]; + if ( style == wxBG_STYLE_TRANSPARENT ) + [m_osxView setBackgroundColor:[NSColor clearColor]]; } return true ; diff --git a/src/osx/core/bitmap.cpp b/src/osx/core/bitmap.cpp index 41162af49d..5170f3f53b 100644 --- a/src/osx/core/bitmap.cpp +++ b/src/osx/core/bitmap.cpp @@ -272,7 +272,7 @@ bool wxBitmapRefData::Create(CGContextRef context) return IsOk() ; } -bool wxBitmapRefData::Create(int w, int h, int d, double logicalscale) +bool wxBitmapRefData::Create(int w, int h, int WXUNUSED(d), double logicalscale) { size_t m_width = wxMax(1, w); size_t m_height = wxMax(1, h); @@ -1778,6 +1778,8 @@ public: wxIMPLEMENT_DYNAMIC_CLASS(wxJPEGResourceHandler, wxBundleResourceHandler); +#if wxOSX_USE_COCOA + class WXDLLEXPORT wxICNSResourceHandler: public wxBundleResourceHandler { wxDECLARE_DYNAMIC_CLASS(wxICNSResourceHandler); @@ -1789,10 +1791,123 @@ public: SetExtension("icns"); SetType(wxBITMAP_TYPE_ICON_RESOURCE); } + + virtual bool LoadFile(wxBitmap *bitmap, + const wxString& name, + wxBitmapType type, + int desiredWidth, + int desiredHeight) wxOVERRIDE; + }; wxIMPLEMENT_DYNAMIC_CLASS(wxICNSResourceHandler, wxBundleResourceHandler); +bool wxICNSResourceHandler::LoadFile(wxBitmap *bitmap, + const wxString& resourceName, + wxBitmapType type, + int desiredWidth, + int desiredHeight) +{ + OSType theId = 0 ; + + if ( resourceName == wxT("wxICON_INFORMATION") ) + { + theId = kAlertNoteIcon ; + } + else if ( resourceName == wxT("wxICON_QUESTION") ) + { + theId = kAlertCautionIcon ; + } + else if ( resourceName == wxT("wxICON_WARNING") ) + { + theId = kAlertCautionIcon ; + } + else if ( resourceName == wxT("wxICON_ERROR") ) + { + theId = kAlertStopIcon ; + } + else if ( resourceName == wxT("wxICON_FOLDER") ) + { + theId = kGenericFolderIcon ; + } + else if ( resourceName == wxT("wxICON_FOLDER_OPEN") ) + { + theId = kOpenFolderIcon ; + } + else if ( resourceName == wxT("wxICON_NORMAL_FILE") ) + { + theId = kGenericDocumentIcon ; + } + else if ( resourceName == wxT("wxICON_EXECUTABLE_FILE") ) + { + theId = kGenericApplicationIcon ; + } + else if ( resourceName == wxT("wxICON_CDROM") ) + { + theId = kGenericCDROMIcon ; + } + else if ( resourceName == wxT("wxICON_FLOPPY") ) + { + theId = kGenericFloppyIcon ; + } + else if ( resourceName == wxT("wxICON_HARDDISK") ) + { + theId = kGenericHardDiskIcon ; + } + else if ( resourceName == wxT("wxICON_REMOVABLE") ) + { + theId = kGenericRemovableMediaIcon ; + } + else if ( resourceName == wxT("wxICON_DELETE") ) + { + theId = kToolbarDeleteIcon ; + } + else if ( resourceName == wxT("wxICON_GO_BACK") ) + { + theId = kBackwardArrowIcon ; + } + else if ( resourceName == wxT("wxICON_GO_FORWARD") ) + { + theId = kForwardArrowIcon ; + } + else if ( resourceName == wxT("wxICON_GO_HOME") ) + { + theId = kToolbarHomeIcon ; + } + else if ( resourceName == wxT("wxICON_HELP_SETTINGS") ) + { + theId = kGenericFontIcon ; + } + else if ( resourceName == wxT("wxICON_HELP_PAGE") ) + { + theId = kGenericDocumentIcon ; + } + else if ( resourceName == wxT( "wxICON_PRINT" ) ) + { + theId = kPrintMonitorFolderIcon; + } + else if ( resourceName == wxT( "wxICON_HELP_FOLDER" ) ) + { + theId = kHelpFolderIcon; + } + + if ( theId != 0 ) + { + IconRef iconRef = NULL ; + __Verify_noErr(GetIconRef( kOnSystemDisk, kSystemIconsCreator, theId, &iconRef )) ; + if ( iconRef ) + { + WXImage img = wxOSXGetNSImageFromIconRef(iconRef); + bitmap->Create(img); + return true; + } + } + + return wxBundleResourceHandler::LoadFile( bitmap, resourceName, type, desiredWidth, desiredHeight); +} + +#endif // wxOSX_USE_COCOA + bool wxBundleResourceHandler::LoadFile(wxBitmap *bitmap, const wxString& name, wxBitmapType WXUNUSED(type), diff --git a/src/osx/core/colour.cpp b/src/osx/core/colour.cpp index 8edb7f0669..3f15e6edeb 100644 --- a/src/osx/core/colour.cpp +++ b/src/osx/core/colour.cpp @@ -189,6 +189,13 @@ wxColour::ChannelType wxColour::Alpha() const return wxRound(M_COLDATA->Alpha() * 255.0); } +bool wxColour::IsSolid() const +{ + wxCHECK_MSG( IsOk(), false, "invalid colour" ); + + return M_COLDATA->IsSolid(); +} + #if wxOSX_USE_COCOA_OR_CARBON void wxColour::GetRGBColor(RGBColor* col) const { diff --git a/src/osx/core/display.cpp b/src/osx/core/display.cpp index fa4fec60a8..395ef7a8c2 100644 --- a/src/osx/core/display.cpp +++ b/src/osx/core/display.cpp @@ -22,9 +22,7 @@ #pragma hdrstop #endif -#if wxUSE_DISPLAY - -#include "wx/display.h" +#include "wx/private/display.h" #ifndef WX_PRECOMP #include "wx/dynarray.h" @@ -33,11 +31,61 @@ #include "wx/gdicmn.h" #endif -#include "wx/display_impl.h" -#include "wx/scopedarray.h" #include "wx/osx/private.h" -#if wxOSX_USE_COCOA_OR_CARBON +// ---------------------------------------------------------------------------- +// common helpers compiled even in wxUSE_DISPLAY==0 case +// ---------------------------------------------------------------------------- + +// This one is defined in Objective C++ code. +extern wxRect wxOSXGetMainDisplayClientArea(); + +namespace +{ + +wxRect wxGetDisplayGeometry(CGDirectDisplayID id) +{ + CGRect theRect = CGDisplayBounds(id); + return wxRect( (int)theRect.origin.x, + (int)theRect.origin.y, + (int)theRect.size.width, + (int)theRect.size.height ); //floats +} + +int wxGetDisplayDepth(CGDirectDisplayID id) +{ + CGDisplayModeRef currentMode = CGDisplayCopyDisplayMode(id); + CFStringRef encoding = CGDisplayModeCopyPixelEncoding(currentMode); + + int theDepth = 32; // some reasonable default + if(encoding) + { + if(CFStringCompare(encoding, CFSTR(IO32BitDirectPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo) + theDepth = 32; + else if(CFStringCompare(encoding, CFSTR(IO16BitDirectPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo) + theDepth = 16; + else if(CFStringCompare(encoding, CFSTR(IO8BitIndexedPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo) + theDepth = 8; + + CFRelease(encoding); + } + + CGDisplayModeRelease(currentMode); + + return theDepth; +} + +wxSize wxGetDisplaySizeMM(CGDirectDisplayID id) +{ + const CGSize size = CGDisplayScreenSize(id); + return wxSize(wxRound(size.width), wxRound(size.height)); +} + +} // anonymous namespace + +#if wxUSE_DISPLAY + +#include "wx/scopedarray.h" // ---------------------------------------------------------------------------- // display classes implementation @@ -54,7 +102,8 @@ public: virtual wxRect GetGeometry() const wxOVERRIDE; virtual wxRect GetClientArea() const wxOVERRIDE; - virtual wxString GetName() const wxOVERRIDE { return wxString(); } + virtual int GetDepth() const wxOVERRIDE; + virtual wxSize GetSizeMM() const wxOVERRIDE; virtual wxArrayVideoModes GetModes(const wxVideoMode& mode) const wxOVERRIDE; virtual wxVideoMode GetCurrentMode() const wxOVERRIDE; @@ -197,11 +246,7 @@ bool wxDisplayImplMacOSX::IsPrimary() const wxRect wxDisplayImplMacOSX::GetGeometry() const { - CGRect theRect = CGDisplayBounds(m_id); - return wxRect( (int)theRect.origin.x, - (int)theRect.origin.y, - (int)theRect.size.width, - (int)theRect.size.height ); //floats + return wxGetDisplayGeometry(m_id); } wxRect wxDisplayImplMacOSX::GetClientArea() const @@ -210,11 +255,21 @@ wxRect wxDisplayImplMacOSX::GetClientArea() const // wxGetClientDisplayRect() does work correctly for at least the main // one (TODO: do it correctly for the other displays too) if ( IsPrimary() ) - return wxGetClientDisplayRect(); + return wxOSXGetMainDisplayClientArea(); return wxDisplayImpl::GetClientArea(); } +int wxDisplayImplMacOSX::GetDepth() const +{ + return wxGetDisplayDepth(m_id); +} + +wxSize wxDisplayImplMacOSX::GetSizeMM() const +{ + return wxGetDisplaySizeMM(m_id); +} + static int wxOSXCGDisplayModeGetBitsPerPixel( CGDisplayModeRef theValue ) { wxCFRef pixelEncoding( CGDisplayModeCopyPixelEncoding(theValue) ); @@ -311,13 +366,44 @@ bool wxDisplayImplMacOSX::ChangeMode( const wxVideoMode& mode ) return new wxDisplayFactoryMacOSX; } -#else +#else // !wxUSE_DISPLAY + +class wxDisplayImplSingleMacOSX : public wxDisplayImplSingle +{ +public: + virtual wxRect GetGeometry() const wxOVERRIDE + { + return wxGetDisplayGeometry(CGMainDisplayID()); + } + + virtual wxRect GetClientArea() const wxOVERRIDE + { + return wxOSXGetMainDisplayClientArea(); + } + + virtual int GetDepth() const wxOVERRIDE + { + return wxGetDisplayDepth(CGMainDisplayID()); + } + + virtual wxSize GetSizeMM() const wxOVERRIDE + { + return wxGetDisplaySizeMM(CGMainDisplayID()); + } +}; + +class wxDisplayFactorySingleMacOSX : public wxDisplayFactorySingle +{ +protected: + virtual wxDisplayImpl *CreateSingleDisplay() wxOVERRIDE + { + return new wxDisplayImplSingleMacOSX; + } +}; /* static */ wxDisplayFactory *wxDisplay::CreateFactory() { - return new wxDisplayFactorySingle; + return new wxDisplayFactorySingleMacOSX; } -#endif - #endif // wxUSE_DISPLAY diff --git a/src/osx/imaglist.cpp b/src/osx/imaglist.cpp deleted file mode 100644 index 32f12fb4ee..0000000000 --- a/src/osx/imaglist.cpp +++ /dev/null @@ -1,308 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/osx/imaglist.cpp -// Purpose: -// Author: Robert Roebling -// Copyright: (c) 1998 Robert Roebling -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_IMAGLIST - -#include "wx/imaglist.h" - -#ifndef WX_PRECOMP - #include "wx/dc.h" - #include "wx/icon.h" - #include "wx/image.h" -#endif - -wxIMPLEMENT_DYNAMIC_CLASS(wxImageList, wxObject); - - -wxImageList::wxImageList( int width, int height, bool mask, int initialCount ) -{ - (void)Create(width, height, mask, initialCount); -} - -wxImageList::~wxImageList() -{ - (void)RemoveAll(); -} - -int wxImageList::GetImageCount() const -{ - return m_images.GetCount(); -} - -bool wxImageList::Create( int width, int height, bool WXUNUSED(mask), int WXUNUSED(initialCount) ) -{ - m_width = width; - m_height = height; - - return Create(); -} - -bool wxImageList::Create() -{ - return true; -} - -int wxImageList::Add( const wxIcon &bitmap ) -{ - wxASSERT_MSG( (bitmap.GetWidth() == m_width && bitmap.GetHeight() == m_height) - || (m_width == 0 && m_height == 0), - wxT("invalid bitmap size in wxImageList: this might work ") - wxT("on this platform but definitely won't under Windows.") ); - - m_images.Append( new wxIcon( bitmap ) ); - - if (m_width == 0 && m_height == 0) - { - m_width = bitmap.GetWidth(); - m_height = bitmap.GetHeight(); - } - - return m_images.GetCount() - 1; -} - -int wxImageList::Add( const wxBitmap &bitmap ) -{ - wxASSERT_MSG( (bitmap.GetScaledWidth() >= m_width && bitmap.GetScaledHeight() == m_height) - || (m_width == 0 && m_height == 0), - wxT("invalid bitmap size in wxImageList: this might work ") - wxT("on this platform but definitely won't under Windows.") ); - - // Mimic behaviour of Windows ImageList_Add that automatically breaks up the added - // bitmap into sub-images of the correct size - if (m_width > 0 && bitmap.GetScaledWidth() > m_width && bitmap.GetScaledHeight() >= m_height) - { - int numImages = bitmap.GetScaledWidth() / m_width; - for (int subIndex = 0; subIndex < numImages; subIndex++) - { - wxRect rect(m_width * subIndex, 0, m_width, m_height); - wxBitmap tmpBmp = bitmap.GetSubBitmap(rect); - m_images.Append( new wxBitmap(tmpBmp) ); - } - } - else - { - m_images.Append( new wxBitmap(bitmap) ); - } - - if (m_width == 0 && m_height == 0) - { - m_width = bitmap.GetScaledWidth(); - m_height = bitmap.GetScaledHeight(); - } - - return m_images.GetCount() - 1; -} - -int wxImageList::Add( const wxBitmap& bitmap, const wxBitmap& mask ) -{ - wxBitmap bmp( bitmap ); - if (mask.IsOk()) - bmp.SetMask( new wxMask( mask ) ); - - return Add( bmp ); -} - -int wxImageList::Add( const wxBitmap& bitmap, const wxColour& maskColour ) -{ - wxImage img = bitmap.ConvertToImage(); - img.SetMaskColour( maskColour.Red(), maskColour.Green(), maskColour.Blue() ); - - return Add( wxBitmap( img ) ); -} - -// Get the bitmap -wxBitmap wxImageList::GetBitmap(int index) const -{ - wxList::compatibility_iterator node = m_images.Item( index ); - - wxCHECK_MSG( node, wxNullBitmap , wxT("wrong index in image list") ); - - wxObject* obj = (wxObject*) node->GetData(); - if ( obj == NULL ) - return wxNullBitmap ; - else if ( obj->IsKindOf(CLASSINFO(wxIcon)) ) - return wxBitmap( *(static_cast(obj)) ) ; - else - return *(static_cast(obj)) ; -} - -// Get the icon -wxIcon wxImageList::GetIcon(int index) const -{ - wxList::compatibility_iterator node = m_images.Item( index ); - - wxCHECK_MSG( node, wxNullIcon , wxT("wrong index in image list") ); - - wxObject* obj = (wxObject*) node->GetData(); - if ( obj == NULL ) - return wxNullIcon ; - if ( obj->IsKindOf(CLASSINFO(wxBitmap)) ) - { - wxIcon icon; - icon.CopyFromBitmap(*static_cast(obj)); - return icon; - } - return *(static_cast(obj)) ; -} - -bool wxImageList::Replace( int index, const wxBitmap &bitmap ) -{ - wxList::compatibility_iterator node = m_images.Item( index ); - - wxCHECK_MSG( node, false, wxT("wrong index in image list") ); - - wxBitmap* newBitmap = new wxBitmap( bitmap ); - - if (index == (int) m_images.GetCount() - 1) - { - delete node->GetData(); - - m_images.Erase( node ); - m_images.Append( newBitmap ); - } - else - { - wxList::compatibility_iterator next = node->GetNext(); - delete node->GetData(); - - m_images.Erase( node ); - m_images.Insert( next, newBitmap ); - } - - return true; -} - -bool wxImageList::Replace( int index, const wxIcon &bitmap ) -{ - wxList::compatibility_iterator node = m_images.Item( index ); - - wxCHECK_MSG( node, false, wxT("wrong index in image list") ); - - wxIcon* newBitmap = new wxIcon( bitmap ); - - if (index == (int) m_images.GetCount() - 1) - { - delete node->GetData(); - m_images.Erase( node ); - m_images.Append( newBitmap ); - } - else - { - wxList::compatibility_iterator next = node->GetNext(); - delete node->GetData(); - m_images.Erase( node ); - m_images.Insert( next, newBitmap ); - } - - return true; -} - -bool wxImageList::Replace( int index, const wxBitmap &bitmap, const wxBitmap &mask ) -{ - wxList::compatibility_iterator node = m_images.Item( index ); - - wxCHECK_MSG( node, false, wxT("wrong index in image list") ); - - wxBitmap* newBitmap = new wxBitmap(bitmap); - - if (index == (int) m_images.GetCount() - 1) - { - delete node->GetData(); - m_images.Erase( node ); - m_images.Append( newBitmap ); - } - else - { - wxList::compatibility_iterator next = node->GetNext(); - delete node->GetData(); - m_images.Erase( node ); - m_images.Insert( next, newBitmap ); - } - - if (mask.IsOk()) - newBitmap->SetMask(new wxMask(mask)); - - return true; -} - -bool wxImageList::Remove( int index ) -{ - wxList::compatibility_iterator node = m_images.Item( index ); - - wxCHECK_MSG( node, false, wxT("wrong index in image list") ); - - delete node->GetData(); - m_images.Erase( node ); - - return true; -} - -bool wxImageList::RemoveAll() -{ - WX_CLEAR_LIST(wxList, m_images); - m_images.Clear(); - - return true; -} - -bool wxImageList::GetSize( int index, int &width, int &height ) const -{ - width = 0; - height = 0; - - wxList::compatibility_iterator node = m_images.Item( index ); - - wxCHECK_MSG( node, false, wxT("wrong index in image list") ); - - wxObject *obj = (wxObject*)node->GetData(); - if (obj->IsKindOf(CLASSINFO(wxIcon))) - { - wxIcon *bm = static_cast< wxIcon* >(obj ) ; - width = bm->GetWidth(); - height = bm->GetHeight(); - } - else - { - wxBitmap *bm = static_cast< wxBitmap* >(obj ) ; - width = bm->GetScaledWidth(); - height = bm->GetScaledHeight(); - } - - return true; -} - -bool wxImageList::Draw( - int index, wxDC &dc, int x, int y, - int flags, bool WXUNUSED(solidBackground) ) -{ - wxList::compatibility_iterator node = m_images.Item( index ); - - wxCHECK_MSG( node, false, wxT("wrong index in image list") ); - - wxObject *obj = (wxObject*)node->GetData(); - if (obj->IsKindOf(CLASSINFO(wxIcon))) - { - wxIcon *bm = static_cast< wxIcon* >(obj ) ; - dc.DrawIcon( *bm , x, y ); - } - else - { - wxBitmap *bm = static_cast< wxBitmap* >(obj ) ; - dc.DrawBitmap( *bm, x, y, (flags & wxIMAGELIST_DRAW_TRANSPARENT) > 0 ); - } - - return true; -} - -#endif // wxUSE_IMAGLIST diff --git a/src/osx/iphone/choice.mm b/src/osx/iphone/choice.mm new file mode 100644 index 0000000000..931fd14509 --- /dev/null +++ b/src/osx/iphone/choice.mm @@ -0,0 +1,142 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: src/osx/cocoa/choice.mm +// Purpose: wxChoice +// Author: Stefan Csomor +// Modified by: +// Created: 1998-01-01 +// Copyright: (c) Stefan Csomor +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#include "wx/wxprec.h" + +#if wxUSE_CHOICE + +#include "wx/choice.h" + +#ifndef WX_PRECOMP + #include "wx/menu.h" + #include "wx/dcclient.h" +#endif + +#include "wx/osx/private.h" + +@interface wxUIPickerView : UIPickerView +{ +} + +@property (readonly) NSMutableArray *rows; + +@end + +@implementation wxUIPickerView + ++ (void)initialize +{ + static BOOL initialized = NO; + if (!initialized) + { + initialized = YES; + wxOSXIPhoneClassAddWXMethods( self ); + } +} + +- (id)initWithFrame:(CGRect)rectBox +{ + if ( self = [super initWithFrame:rectBox] ) + { + _rows = [[NSMutableArray alloc] init]; + } + return self; +} + +- (void)dealloc +{ + [_rows dealloc]; + [super dealloc]; +} + +- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView +{ + return 1; +} + +- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component +{ + if ( component == 0 ) + return [_rows count]; + + return 0; +} + +- (nullable NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component +{ + return [_rows objectAtIndex:row]; +} + +- (int) intValue +{ + return (int) [self selectedRowInComponent:0]; +} + +- (void) setIntValue: (int) v +{ + [self selectRow:v inComponent:0 animated:NO]; +} + + + +@end + +class wxChoiceIPhoneImpl : public wxWidgetIPhoneImpl, public wxChoiceWidgetImpl +{ +public: + wxChoiceIPhoneImpl(wxWindowMac *wxpeer, wxUIPickerView *v) + : wxWidgetIPhoneImpl(wxpeer, v) + { + [v setDelegate:v]; + [v setDataSource:v]; + } + + void InsertItem( size_t pos, int itemid, const wxString& text) wxOVERRIDE + { + wxCFStringRef cftext(text); + [((wxUIPickerView*)m_osxView).rows insertObject:cftext.AsNSString() atIndex:pos]; + } + + size_t GetNumberOfItems() const wxOVERRIDE + { + return [((wxUIPickerView*)m_osxView).rows count]; + } + + void RemoveItem( size_t pos ) wxOVERRIDE + { + [((wxUIPickerView*)m_osxView).rows removeObjectAtIndex:pos]; + } + + void SetItem(int pos, const wxString& text) wxOVERRIDE + { + wxCFStringRef cftext(text); + [((wxUIPickerView*)m_osxView).rows replaceObjectAtIndex:pos withObject:cftext.AsNSString()]; + } + +private: +}; + +wxWidgetImplType* wxWidgetImpl::CreateChoice( wxWindowMac* wxpeer, + wxWindowMac* WXUNUSED(parent), + wxWindowID WXUNUSED(id), + wxMenu* menu, + const wxPoint& pos, + const wxSize& size, + long WXUNUSED(style), + long WXUNUSED(extraStyle)) +{ + CGRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ; + wxUIPickerView* v = [[wxUIPickerView alloc] initWithFrame:r]; + + wxChoiceIPhoneImpl* c = new wxChoiceIPhoneImpl( wxpeer, v ); + return c; +} + +#endif // wxUSE_CHOICE diff --git a/src/osx/iphone/statbmp.mm b/src/osx/iphone/statbmp.mm new file mode 100644 index 0000000000..a1095a04a9 --- /dev/null +++ b/src/osx/iphone/statbmp.mm @@ -0,0 +1,101 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: src/osx/cocoa/statbmp.mm +// Purpose: wxStaticBitmap +// Author: Stefan Csomor +// Created: 28.06.99 +// Copyright: (c) 2008 Stefan Csomor +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +// ============================================================================ +// declarations +// ============================================================================ + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ +#pragma hdrstop +#endif + +#if wxUSE_STATBMP + +#include "wx/statline.h" + +#ifndef WX_PRECOMP +#include "wx/statbmp.h" +#endif + +#include "wx/osx/private.h" + +class wxStaticBitmapIPhoneImpl : public wxWidgetIPhoneImpl +{ +public : + wxStaticBitmapIPhoneImpl(wxWindowMac* peer , WXWidget w) : + wxWidgetIPhoneImpl(peer, w) + { + } + + ~wxStaticBitmapIPhoneImpl() + { + } + + void SetLabel( const wxString& title, wxFontEncoding encoding ) wxOVERRIDE + { + // although NSControl has this method, NSImageView throws an exception if it is called + } + + void SetScaleMode(wxStaticBitmap::ScaleMode scaleMode) + { + UIImageView* v = (UIImageView*) m_osxView; + + UIViewContentMode scaling = UIViewContentModeRedraw; + switch ( scaleMode ) + { + case wxStaticBitmap::Scale_Fill: + scaling = UIViewContentModeScaleToFill; + break; + case wxStaticBitmap::Scale_AspectFill: + scaling = UIViewContentModeScaleAspectFill; + break; + case wxStaticBitmap::Scale_AspectFit: + scaling = UIViewContentModeScaleAspectFit; + break; + default: + break; + } + [v setContentMode:scaling]; + } +}; + +void wxStaticBitmap::SetScaleMode(ScaleMode scaleMode) +{ + m_scaleMode = scaleMode; + + dynamic_cast(GetPeer())->SetScaleMode(scaleMode); + + Refresh(); +} + + +wxWidgetImplType* wxWidgetImpl::CreateStaticBitmap( wxWindowMac* wxpeer, + wxWindowMac* WXUNUSED(parent), + wxWindowID WXUNUSED(id), + const wxBitmap& bitmap, + const wxPoint& pos, + const wxSize& size, + long WXUNUSED(style), + long WXUNUSED(extraStyle)) +{ + CGRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ; + UIImageView* v = [[UIImageView alloc] initWithFrame:r]; + + wxWidgetIPhoneImpl* c = new wxStaticBitmapIPhoneImpl( wxpeer, v ); + return c; +} + +#endif //wxUSE_STATBMP diff --git a/src/osx/iphone/utils.mm b/src/osx/iphone/utils.mm index 92b2540149..af0239e939 100644 --- a/src/osx/iphone/utils.mm +++ b/src/osx/iphone/utils.mm @@ -10,8 +10,6 @@ #include "wx/wxprec.h" -#include "wx/wxprec.h" - #include "wx/utils.h" #ifndef WX_PRECOMP @@ -25,6 +23,8 @@ #include "wx/apptrait.h" +#include "wx/private/display.h" + #include "wx/osx/private.h" #if wxUSE_GUI @@ -116,46 +116,6 @@ CFArrayRef CopyAvailableFontFamilyNames() return (CFArrayRef) [[UIFont familyNames] retain]; } -void wxClientDisplayRect(int *x, int *y, int *width, int *height) -{ -#if 0 - CGRect r = [[UIScreen mainScreen] applicationFrame]; - CGRect bounds = [[UIScreen mainScreen] bounds]; - if ( bounds.size.height > r.size.height ) - { - // portrait - if ( x ) - *x = r.origin.x; - if ( y ) - *y = r.origin.y; - if ( width ) - *width = r.size.width; - if ( height ) - *height = r.size.height; - } - else - { - // landscape - if ( x ) - *x = r.origin.y; - if ( y ) - *y = r.origin.x; - if ( width ) - *width = r.size.height; - if ( height ) - *height = r.size.width; - } -#else - // it's easier to treat the status bar as an element of the toplevel window - // instead of the desktop in order to support easy rotation - if ( x ) - *x = 0; - if ( y ) - *y = 0; - wxDisplaySize(width, height); -#endif -} - void wxGetMousePosition( int* x, int* y ) { if ( x ) @@ -170,33 +130,55 @@ wxMouseState wxGetMouseState() return ms; } -// Returns depth of screen -int wxDisplayDepth() -{ - return 32; // TODO can we determine this ? -} - // Get size of display -void wxDisplaySize(int *width, int *height) -{ - CGRect bounds = [[UIScreen mainScreen] bounds]; - if ( UIInterfaceOrientationIsPortrait([[UIApplication sharedApplication] statusBarOrientation]) ) +class wxDisplayImplSingleiOS : public wxDisplayImplSingle +{ +public: + virtual wxRect GetGeometry() const wxOVERRIDE { - // portrait - if ( width ) - *width = (int)bounds.size.width ; - if ( height ) - *height = (int)bounds.size.height; + CGRect bounds = [[UIScreen mainScreen] bounds]; + + int width, height; + if ( UIInterfaceOrientationIsPortrait([[UIApplication sharedApplication] statusBarOrientation]) ) + { + // portrait + width = (int)bounds.size.width ; + height = (int)bounds.size.height; + } + else + { + // landscape + width = (int)bounds.size.height ; + height = (int)bounds.size.width; + } + + return wxRect(0, 0, width, height); } - else + + virtual int GetDepth() const wxOVERRIDE { - // landscape - if ( width ) - *width = (int)bounds.size.height ; - if ( height ) - *height = (int)bounds.size.width; + return 32; // TODO can we determine this ? } + + virtual wxSize GetPPI() const wxOVERRIDE + { + return wxSize(72, 72); + } +}; + +class wxDisplayFactorySingleiOS : public wxDisplayFactorySingle +{ +protected: + virtual wxDisplayImpl *CreateSingleDisplay() wxOVERRIDE + { + return new wxDisplayImplSingleiOS; + } +}; + +/* static */ wxDisplayFactory *wxDisplay::CreateFactory() +{ + return new wxDisplayFactorySingleiOS; } wxTimerImpl* wxGUIAppTraits::CreateTimerImpl(wxTimer *timer) diff --git a/src/osx/nonownedwnd_osx.cpp b/src/osx/nonownedwnd_osx.cpp index 3f46bca9e2..cbc20eda73 100644 --- a/src/osx/nonownedwnd_osx.cpp +++ b/src/osx/nonownedwnd_osx.cpp @@ -256,8 +256,11 @@ bool wxNonOwnedWindow::SetBackgroundColour(const wxColour& c ) { if ( !wxWindow::SetBackgroundColour(c) && m_hasBgCol ) return false ; - - if ( GetBackgroundStyle() != wxBG_STYLE_CUSTOM ) + + // only set the native background color if the toplevel window's + // background is not supposed to be transparent, otherwise the + // transparency is lost + if ( GetBackgroundStyle() != wxBG_STYLE_PAINT && GetBackgroundStyle() != wxBG_STYLE_TRANSPARENT) { if ( m_nowpeer ) return m_nowpeer->SetBackgroundColour(c); @@ -515,6 +518,10 @@ bool wxNonOwnedWindow::DoSetRegionShape(const wxRegion& region) { m_shape = region; + // set the native content view to transparency, this is an implementation detail + // no reflected in the wx BackgroundStyle + GetPeer()->SetBackgroundStyle(wxBG_STYLE_TRANSPARENT); + return m_nowpeer->SetShape(region); } diff --git a/src/osx/statbmp_osx.cpp b/src/osx/statbmp_osx.cpp new file mode 100644 index 0000000000..94332a571f --- /dev/null +++ b/src/osx/statbmp_osx.cpp @@ -0,0 +1,66 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: src/osx/statbmp_osx.cpp +// Purpose: wxStaticBitmap +// Author: Stefan Csomor +// Modified by: +// Created: 04/01/98 +// Copyright: (c) Stefan Csomor +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#include "wx/wxprec.h" + +#if wxUSE_STATBMP + +#include "wx/statbmp.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" + #include "wx/utils.h" + #include "wx/dc.h" + #include "wx/dcclient.h" + #include "wx/settings.h" +#endif // WX_PRECOMP + +#include "wx/osx/private.h" + +#include + + +bool wxStaticBitmap::Create(wxWindow *parent, + wxWindowID id, + const wxBitmap& bitmap, + const wxPoint& pos, + const wxSize& size, + long style, + const wxString& name ) +{ + m_scaleMode = Scale_None; + + DontCreatePeer(); + + if (! wxControl::Create(parent, id, pos, size, style, + wxDefaultValidator, name)) + return false; + + SetPeer(wxWidgetImpl::CreateStaticBitmap( this, parent, id, bitmap , pos, size, style, GetExtraStyle() )); + + MacPostControlCreate( pos, size ); + + SetBitmap(bitmap); + + return true; +} + + +void wxStaticBitmap::SetBitmap(const wxBitmap& bitmap) +{ + m_bitmap = bitmap; + SetInitialSize(GetBitmapSize()); + + GetPeer()->SetBitmap(bitmap); + + Refresh(); +} + +#endif //if wxUSE_STATBMP diff --git a/src/osx/utils_osx.cpp b/src/osx/utils_osx.cpp index bccc71b132..2350f16cb6 100644 --- a/src/osx/utils_osx.cpp +++ b/src/osx/utils_osx.cpp @@ -53,51 +53,8 @@ bool wxCheckForInterrupt(wxWindow *WXUNUSED(wnd)) return false; } -// Return true if we have a colour display -bool wxColourDisplay() -{ - // always the case on OS X - return true; -} - - #if wxOSX_USE_COCOA_OR_CARBON -// Returns depth of screen -int wxDisplayDepth() -{ - CGDisplayModeRef currentMode = CGDisplayCopyDisplayMode(kCGDirectMainDisplay); - CFStringRef encoding = CGDisplayModeCopyPixelEncoding(currentMode); - - int theDepth = 32; // some reasonable default - if(encoding) - { - if(CFStringCompare(encoding, CFSTR(IO32BitDirectPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo) - theDepth = 32; - else if(CFStringCompare(encoding, CFSTR(IO16BitDirectPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo) - theDepth = 16; - else if(CFStringCompare(encoding, CFSTR(IO8BitIndexedPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo) - theDepth = 8; - - CFRelease(encoding); - } - - CGDisplayModeRelease(currentMode); - - return theDepth; -} - -// Get size of display -void wxDisplaySize(int *width, int *height) -{ - // TODO adapt for multi-displays - CGRect bounds = CGDisplayBounds(CGMainDisplayID()); - if ( width ) - *width = (int)bounds.size.width ; - if ( height ) - *height = (int)bounds.size.height; -} - #if wxUSE_GUI // ---------------------------------------------------------------------------- @@ -149,28 +106,6 @@ bool wxDoLaunchDefaultBrowser(const wxLaunchBrowserParams& params) #endif -void wxDisplaySizeMM(int *width, int *height) -{ -#if wxOSX_USE_IPHONE - wxDisplaySize(width, height); - // on mac 72 is fixed (at least now;-) - double cvPt2Mm = 25.4 / 72; - - if (width != NULL) - *width = int( *width * cvPt2Mm ); - - if (height != NULL) - *height = int( *height * cvPt2Mm ); -#else - CGSize size = CGDisplayScreenSize(CGMainDisplayID()); - if ( width ) - *width = (int)size.width ; - if ( height ) - *height = (int)size.height; -#endif -} - - wxPortId wxGUIAppTraits::GetToolkitVersion(int *verMaj, int *verMin, int *verMicro) const diff --git a/src/osx/window_osx.cpp b/src/osx/window_osx.cpp index 8ec3e2500a..a8242fc83c 100644 --- a/src/osx/window_osx.cpp +++ b/src/osx/window_osx.cpp @@ -518,6 +518,11 @@ bool wxWindowMac::SetBackgroundStyle(wxBackgroundStyle style) return true; } +bool wxWindowMac::IsTransparentBackgroundSupported(wxString* WXUNUSED(reason)) const +{ + return true; +} + bool wxWindowMac::SetBackgroundColour(const wxColour& col ) { if (m_growBox) diff --git a/src/propgrid/editors.cpp b/src/propgrid/editors.cpp index 0b8e439faa..99ec7ed02f 100644 --- a/src/propgrid/editors.cpp +++ b/src/propgrid/editors.cpp @@ -645,10 +645,11 @@ public: // Enabling double-click processor makes sense // only for wxBoolProperty. - wxPGProperty* selProp = GetGrid()->GetSelection(); - if (wxDynamicCast(selProp, wxBoolProperty)) + m_selProp = GetGrid()->GetSelection(); + wxASSERT(m_selProp); + if (wxDynamicCast(m_selProp, wxBoolProperty)) { - m_dclickProcessor = new wxPGDoubleClickProcessor(this, selProp); + m_dclickProcessor = new wxPGDoubleClickProcessor(this, m_selProp); PushEventHandler(m_dclickProcessor); } @@ -729,9 +730,12 @@ public: ); } + wxPGProperty* GetProperty() const { return m_selProp; } + private: wxPGDoubleClickProcessor* m_dclickProcessor; bool m_sizeEventCalled; + wxPGProperty* m_selProp; }; @@ -741,7 +745,8 @@ void wxPropertyGrid::OnComboItemPaint( const wxPGComboBox* pCb, wxRect& rect, int flags ) { - wxPGProperty* p = GetSelection(); + wxPGProperty* p = pCb->GetProperty(); + wxString text; const wxPGChoices& choices = p->GetChoices(); diff --git a/src/propgrid/manager.cpp b/src/propgrid/manager.cpp index 67edffed93..9437e48c89 100644 --- a/src/propgrid/manager.cpp +++ b/src/propgrid/manager.cpp @@ -1283,12 +1283,13 @@ void wxPropertyGridManager::RepaintDescBoxDecorations( wxDC& dc, void wxPropertyGridManager::UpdateDescriptionBox( int new_splittery, int new_width, int new_height ) { - int use_hei = new_height; - use_hei--; + int use_hei = new_height-1; + int use_width = new_width-6; // Fix help control positions. - int cap_hei = m_pPropGrid->GetFontHeight(); int cap_y = new_splittery+m_splitterHeight+5; + m_pTxtHelpCaption->SetSize(3, cap_y, use_width, wxDefaultCoord, wxSIZE_AUTO_HEIGHT); + int cap_hei = m_pTxtHelpCaption->GetSize().GetHeight(); int cnt_y = cap_y+cap_hei+3; int sub_cap_hei = cap_y+cap_hei-use_hei; int cnt_hei = use_hei-cnt_y; @@ -1304,7 +1305,6 @@ void wxPropertyGridManager::UpdateDescriptionBox( int new_splittery, int new_wid } else { - m_pTxtHelpCaption->SetSize(3,cap_y,new_width-6,cap_hei); m_pTxtHelpCaption->Wrap(-1); m_pTxtHelpCaption->Show( true ); if ( cnt_hei <= 2 ) @@ -1313,7 +1313,8 @@ void wxPropertyGridManager::UpdateDescriptionBox( int new_splittery, int new_wid } else { - m_pTxtHelpContent->SetSize(3,cnt_y,new_width-6,cnt_hei); + m_pTxtHelpContent->SetSize(3,cnt_y,use_width,cnt_hei); + m_pTxtHelpContent->Wrap(use_width); m_pTxtHelpContent->Show( true ); } } @@ -1454,8 +1455,7 @@ void wxPropertyGridManager::OnPaint( wxPaintEvent& WXUNUSED(event) ) void wxPropertyGridManager::Refresh(bool eraseBackground, const wxRect* rect ) { - m_pPropGrid->Refresh(eraseBackground); - wxWindow::Refresh(eraseBackground,rect); + wxPanel::Refresh(eraseBackground, rect); } // ----------------------------------------------------------------------- diff --git a/src/propgrid/property.cpp b/src/propgrid/property.cpp index 281ed15d23..a09beb72e1 100644 --- a/src/propgrid/property.cpp +++ b/src/propgrid/property.cpp @@ -2254,7 +2254,7 @@ wxPGProperty* wxPGProperty::GetMainParent() const const wxPGProperty* curChild = this; const wxPGProperty* curParent = m_parent; - while ( curParent && !curParent->IsCategory() ) + while ( !curParent->IsRoot() && !curParent->IsCategory() ) { curChild = curParent; curParent = curParent->m_parent; @@ -3013,6 +3013,20 @@ wxPGChoiceEntry& wxPGChoices::AddAsSorted( const wxString& label, int value ) // ----------------------------------------------------------------------- +void wxPGChoices::Add(size_t count, const wxString* labels, const long* values) +{ + AllocExclusive(); + + for ( size_t i = 0; i < count; ++i ) + { + const int value = values ? values[i] : i; + wxPGChoiceEntry entry(labels[i], value); + m_data->Insert( i, entry ); + } +} + +// ----------------------------------------------------------------------- + void wxPGChoices::Add( const wxChar* const* labels, const ValArrItem* values ) { AllocExclusive(); diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 0c00b79ee1..9ea2aeba5f 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -137,6 +137,22 @@ DeletedObjects gs_deletedEditorObjects; } // anonymous namespace #endif + // Utility to check if specific item is in a vector. +template +static bool wxPGItemExistsInVector(const wxVector& vector, const T& item) +{ +#if wxUSE_STL + return std::find(vector.begin(), vector.end(), item) != vector.end(); +#else + for (typename wxVector::const_iterator it = vector.begin(); it != vector.end(); ++it) + { + if ( *it == item ) + return true; + } + return false; +#endif // wxUSE_STL/!wxUSE_STL +} + // ----------------------------------------------------------------------- #if wxUSE_INTL @@ -802,7 +818,7 @@ bool wxPropertyGrid::DoSelectAndEdit( wxPGProperty* prop, // send event DoClearSelection(false, wxPG_SEL_NO_REFRESH); - if ( m_pState->m_editableColumns.Index(colIndex) == wxNOT_FOUND ) + if ( !wxPGItemExistsInVector(m_pState->m_editableColumns, colIndex) ) { res = DoAddToSelection(prop, selFlags); } @@ -972,7 +988,7 @@ void wxPropertyGrid::MakeColumnEditable( unsigned int column, wxS("Set wxPG_PROP_READONLY property flag instead") ); - wxArrayInt& cols = m_pState->m_editableColumns; + wxVector& cols = m_pState->m_editableColumns; if ( editable ) { @@ -1861,8 +1877,8 @@ void wxPropertyGrid::OnPaint( wxPaintEvent& WXUNUSED(event) ) } // Find out where the window is scrolled to - int vx,vy; // Top left corner of client - GetViewStart(&vx,&vy); + int vy; // Top of the client + GetViewStart(NULL, &vy); vy *= wxPG_PIXELS_PER_UNIT; // Update everything inside the box @@ -1875,11 +1891,8 @@ void wxPropertyGrid::OnPaint( wxPaintEvent& WXUNUSED(event) ) r.x = 0; r.width = GetClientSize().x; - r.y = vy; - r.height = GetClientSize().y; - // Repaint this rectangle - DrawItems(*dcPtr, r.y, r.y + r.height, &r); + DrawItems(*dcPtr, r.y, r.y + r.height-1, &r); // This blits the buffer (if used) to the window DC. delete dcPtr; @@ -1985,7 +1998,7 @@ void wxPropertyGrid::DrawItems( wxDC& dc, { tempItemsRect = wxRect(0, topItemY, m_pState->GetVirtualWidth(), - bottomItemY); + bottomItemY - topItemY + 1); itemsRect = &tempItemsRect; } @@ -1999,9 +2012,8 @@ void wxPropertyGrid::DrawItems( wxDC& dc, if ( m_pState->DoGetRoot()->GetChildCount() > 0 ) { - // paintFinishY and drawBottomY are in buffer/physical space - int paintFinishY = DoDrawItems(dc, itemsRect); - int drawBottomY = itemsRect->y + itemsRect->height - vy; + int paintFinishY = DoDrawItems(dc, itemsRect) + 1 - vy; + int drawBottomY = itemsRect->y + itemsRect->height - 1 - vy; // Clear area beyond last painted property if ( paintFinishY < drawBottomY ) @@ -2010,7 +2022,7 @@ void wxPropertyGrid::DrawItems( wxDC& dc, dc.SetBrush(m_colEmptySpace); dc.DrawRectangle(0, paintFinishY, m_width, - drawBottomY ); + drawBottomY-paintFinishY+1); } } else @@ -2047,10 +2059,14 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc, if ( !lastItem ) lastItem = GetLastItem( wxPG_ITERATE_VISIBLE ); - if ( IsFrozen() || m_height < 1 || firstItem == NULL ) - return itemsRect->y; + int vy; + GetViewStart(NULL, &vy); + vy *= wxPG_PIXELS_PER_UNIT; - wxCHECK_MSG( !m_pState->m_itemsAdded, itemsRect->y, + if ( IsFrozen() || m_height < 1 || firstItem == NULL ) + return vy - 1; + + wxCHECK_MSG( !m_pState->m_itemsAdded, vy - 1, wxS("no items added") ); wxASSERT( m_pState->DoGetRoot()->GetChildCount() ); @@ -2060,7 +2076,7 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc, int lastItemBottomY; firstItemTopY = itemsRect->y; - lastItemBottomY = itemsRect->y + itemsRect->height; + lastItemBottomY = itemsRect->y + itemsRect->height - 1; // Align y coordinates to item boundaries firstItemTopY -= firstItemTopY % lh; @@ -2093,20 +2109,18 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc, #if WXWIN_COMPATIBILITY_3_0 int xRelMod = 0; - // Buffer's y = 0, so align itemsRect and coordinates to that if ( isBuffered ) { xRelMod = itemsRect->x; // itemsRect conversion - firstItemTopY -= itemsRect->y; - lastItemBottomY -= itemsRect->y; + firstItemTopY -= vy; + lastItemBottomY -= vy; } #else - // Buffer's y = 0, so align itemsRect and coordinates to that int xRelMod = itemsRect->x; // itemsRect conversion - firstItemTopY -= itemsRect->y; - lastItemBottomY -= itemsRect->y; + firstItemTopY -= vy; + lastItemBottomY -= vy; #endif int x = m_marginWidth - xRelMod; @@ -2147,7 +2161,7 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc, const wxPGProperty* firstSelected = GetSelection(); const wxPropertyGridPageState* state = m_pState; - const wxArrayInt& colWidths = state->m_colWidths; + const wxVector& colWidths = state->m_colWidths; const unsigned int colCount = state->GetColumnCount(); // TODO: Only render columns that are within clipping region. @@ -2160,7 +2174,7 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc, // // Pre-generate list of visible properties. - wxArrayPGProperty visPropArray; + wxVector visPropArray; visPropArray.reserve((m_height/m_lineHeight)+6); for ( ; !it.AtEnd(); it.Next() ) @@ -2512,7 +2526,7 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc, y += rowHeight; } - return y; + return y - 1 + vy; } // ----------------------------------------------------------------------- @@ -2580,6 +2594,7 @@ void wxPropertyGrid::DrawItems( const wxPGProperty* p1, const wxPGProperty* p2 ) r.x -= vx; r.y -= vy; RefreshRect(r); + Update(); } } @@ -2608,8 +2623,7 @@ void wxPropertyGrid::DrawItemAndValueRelated( wxPGProperty* p ) wxPGProperty* parent = p->GetParent(); while ( parent && - !parent->IsCategory() && - parent->GetParent() ) + !parent->IsCategory() && !parent->IsRoot() ) { DrawItem(parent); parent = parent->GetParent(); @@ -3370,14 +3384,6 @@ bool wxPropertyGrid::DoPropertyChanged( wxPGProperty* p, unsigned int selFlags ) // If property's value is being changed, assume it is valid OnValidationFailureReset(selected); - wxPGProperty* topPaintedProperty = changedProperty; - - while ( !topPaintedProperty->IsCategory() && - !topPaintedProperty->IsRoot() ) - { - topPaintedProperty = topPaintedProperty->GetParent(); - } - changedProperty->SetValue(value, &m_chgInfo_valueList, wxPG_SETVAL_BY_USER); // NB: Call GetEditorControl() as late as possible, because OnSetValue() @@ -3395,10 +3401,9 @@ bool wxPropertyGrid::DoPropertyChanged( wxPGProperty* p, unsigned int selFlags ) } } - wxPGProperty* pwc; - // Propagate updates to parent(s) - pwc = p; + wxPGProperty* topPaintedProperty = changedProperty->GetMainParent(); + wxPGProperty* pwc = p; wxPGProperty* prevPwc = NULL; while ( prevPwc != topPaintedProperty ) @@ -3678,7 +3683,7 @@ bool wxPropertyGrid::HandleCustomEditorEvent( wxEvent &event ) // SetValueInEvent(), as called in one of the functions referred above // overrides editor's value. - if ( m_iFlags & wxPG_FL_VALUE_CHANGE_IN_EVENT ) + if ( WasValueChangedInEvent() ) { valueIsPending = true; pendingValue = m_changeInEventValue; @@ -5598,21 +5603,6 @@ void wxPropertyGrid::ClearActionTriggers( int action ) while ( didSomething ); } -#if WXWIN_COMPATIBILITY_3_0 -// Utility to find if specific item is in a vector. Returns index to -// the item, or wxNOT_FOUND if not present. -template -int wxPGFindInVector( CONTAINER vector, const T& item ) -{ - for ( unsigned int i=0; i(m_dedicatedKeys, keycode) ) #else m_dedicatedKeys.find(keycode) == m_dedicatedKeys.end() ) #endif @@ -5972,6 +5962,11 @@ void wxPropertyGrid::HandleFocusChange( wxWindow* newFocused ) { if ( parent == wndEditor ) { + // If editor is active consider focus set on its components + // as a focus set on the editor itself (to prevent doing actions + // when focus is switched between subcontrols of a compound + // editor like e.g. wxComboCtrl). + newFocused = wndEditor; wasEditorFocused = true; } // Use m_eventObject, which is either wxPropertyGrid or @@ -6608,11 +6603,10 @@ bool wxPropertyGridPopulator::AddAttribute( const wxString& name, const wxString& type, const wxString& value ) { - int l = m_propHierarchy.size(); - if ( !l ) + if ( m_propHierarchy.empty() ) return false; - wxPGProperty* p = m_propHierarchy[l-1]; + wxPGProperty* p = m_propHierarchy.back(); wxString valuel = value.Lower(); wxVariant variant; diff --git a/src/propgrid/propgridiface.cpp b/src/propgrid/propgridiface.cpp index 9d2e86c45c..d5083ecac5 100644 --- a/src/propgrid/propgridiface.cpp +++ b/src/propgrid/propgridiface.cpp @@ -942,7 +942,6 @@ wxString wxPropertyGridInterface::SaveEditableState( int includedStates ) const } if ( includedStates & ExpandedState ) { - wxArrayPGProperty ptrs; wxPropertyGridConstIterator it = wxPropertyGridConstIterator( pageState, wxPG_ITERATE_ALL_PARENTS_RECURSIVELY|wxPG_ITERATE_HIDDEN, diff --git a/src/propgrid/propgridpagestate.cpp b/src/propgrid/propgridpagestate.cpp index 870354a27f..be18422604 100644 --- a/src/propgrid/propgridpagestate.cpp +++ b/src/propgrid/propgridpagestate.cpp @@ -43,6 +43,43 @@ #define wxPG_DEFAULT_SPLITTERX 110 +// Utility to remove given item from the vector. +template +static void wxPGRemoveItemFromVector(wxVector& vector, const T& item) +{ +#if wxUSE_STL + typename wxVector::iterator it = std::find(vector.begin(), vector.end(), item); + if ( it != vector.end() ) + { + vector.erase(it); + } +#else + for (typename wxVector::iterator it = vector.begin(); it != vector.end(); ++it) + { + if ( *it == item ) + { + vector.erase(it); + return; + } + } +#endif // wxUSE_STL/!wxUSE_STL +} + +// Utility to check if specific item is in a vector. +template +static bool wxPGItemExistsInVector(const wxVector& vector, const T& item) +{ +#if wxUSE_STL + return std::find(vector.begin(), vector.end(), item) != vector.end(); +#else + for (typename wxVector::const_iterator it = vector.begin(); it != vector.end(); ++it) + { + if ( *it == item ) + return true; + } + return false; +#endif // wxUSE_STL/!wxUSE_STL +} // ----------------------------------------------------------------------- // wxPropertyGridIterator @@ -303,16 +340,8 @@ void wxPropertyGridPageState::DoClear() for (unsigned int i = 0; i < m_regularArray.GetChildCount(); i++) { wxPGProperty* p = m_regularArray.Item(i); - int index = m_pPropGrid->m_deletedProperties.Index(p); - if (index != wxNOT_FOUND) - { - m_pPropGrid->m_deletedProperties.RemoveAt(index); - } - index = m_pPropGrid->m_removedProperties.Index(p); - if (index != wxNOT_FOUND) - { - m_pPropGrid->m_removedProperties.RemoveAt(index); - } + wxPGRemoveItemFromVector(m_pPropGrid->m_deletedProperties, p); + wxPGRemoveItemFromVector(m_pPropGrid->m_removedProperties, p); } m_regularArray.Empty(); @@ -1190,11 +1219,8 @@ void wxPropertyGridPageState::ResetColumnSizes( int setSplitterFlags ) void wxPropertyGridPageState::SetColumnCount( int colCount ) { wxASSERT( colCount >= 2 ); - m_colWidths.SetCount( colCount, wxPG_DRAG_MARGIN ); - m_columnProportions.SetCount( colCount, 1 ); - if ( m_colWidths.size() > (unsigned int)colCount ) - m_colWidths.RemoveAt( m_colWidths.size()-1, - m_colWidths.size() - colCount ); + m_colWidths.resize(colCount, wxPG_DRAG_MARGIN); + m_columnProportions.resize(colCount, 1); if ( m_pPropGrid->GetState() == this ) m_pPropGrid->RecalculateVirtualSize(); @@ -2004,14 +2030,14 @@ void wxPropertyGridPageState::DoDelete( wxPGProperty* item, bool doDelete ) // Prevent adding duplicates to the lists. if ( doDelete ) { - if ( pg->m_deletedProperties.Index(item) != wxNOT_FOUND ) + if ( wxPGItemExistsInVector(pg->m_deletedProperties, item) ) return; pg->m_deletedProperties.push_back(item); } else { - if ( pg->m_removedProperties.Index(item) != wxNOT_FOUND ) + if ( wxPGItemExistsInVector(pg->m_removedProperties, item) ) return; pg->m_removedProperties.push_back(item); @@ -2112,20 +2138,12 @@ void wxPropertyGridPageState::DoDelete( wxPGProperty* item, bool doDelete ) { // Remove the item from both lists of pending operations. // (Deleted item cannot be also the subject of further removal.) - int index = pg->m_deletedProperties.Index(item); - if ( index != wxNOT_FOUND ) - { - pg->m_deletedProperties.RemoveAt(index); - } - wxASSERT_MSG( pg->m_deletedProperties.Index(item) == wxNOT_FOUND, + wxPGRemoveItemFromVector(pg->m_deletedProperties, item); + wxASSERT_MSG( !wxPGItemExistsInVector(pg->m_deletedProperties, item), wxS("Too many occurrences of the item")); - index = pg->m_removedProperties.Index(item); - if ( index != wxNOT_FOUND ) - { - pg->m_removedProperties.RemoveAt(index); - } - wxASSERT_MSG( pg->m_removedProperties.Index(item) == wxNOT_FOUND, + wxPGRemoveItemFromVector(pg->m_removedProperties, item); + wxASSERT_MSG( !wxPGItemExistsInVector(pg->m_removedProperties, item), wxS("Too many occurrences of the item")); delete item; @@ -2133,12 +2151,8 @@ void wxPropertyGridPageState::DoDelete( wxPGProperty* item, bool doDelete ) else { // Remove the item from the list of pending removals. - int index = pg->m_removedProperties.Index(item); - if ( index != wxNOT_FOUND ) - { - pg->m_removedProperties.RemoveAt(index); - } - wxASSERT_MSG( pg->m_removedProperties.Index(item) == wxNOT_FOUND, + wxPGRemoveItemFromVector(pg->m_removedProperties, item); + wxASSERT_MSG( !wxPGItemExistsInVector(pg->m_removedProperties, item), wxS("Too many occurrences of the item")); item->OnDetached(this, pg); diff --git a/src/qt/accel.cpp b/src/qt/accel.cpp index 1ecb0c85fb..046c504a20 100644 --- a/src/qt/accel.cpp +++ b/src/qt/accel.cpp @@ -86,7 +86,7 @@ QList< QShortcut* > *wxAcceleratorTable::ConvertShortcutTable( QWidget *parent ) { QList< QShortcut* > *qtList = new QList< QShortcut* >; - for ( wxAccelList::Node *node = M_ACCELDATA->m_accels.GetFirst(); node; node = node->GetNext() ) + for ( wxAccelList::compatibility_iterator node = M_ACCELDATA->m_accels.GetFirst(); node; node = node->GetNext() ) { qtList->push_back(ConvertAccelerator( node->GetData(), parent )); } diff --git a/src/qt/clipbrd.cpp b/src/qt/clipbrd.cpp index 5a39a623c2..5479fe3109 100644 --- a/src/qt/clipbrd.cpp +++ b/src/qt/clipbrd.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: wx/qt/toolbar.h +// Name: src/qt/clipbrd.cpp // Author: Sean D'Epagnier // Copyright: (c) Sean D'Epagnier 2014 // Licence: wxWindows licence diff --git a/src/qt/colour.cpp b/src/qt/colour.cpp index 4192179d7b..e851d00caf 100644 --- a/src/qt/colour.cpp +++ b/src/qt/colour.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: wx/qt/colour.h +// Name: src/qt/colour.cpp // Purpose: wxColour class implementation for wxQt // Author: Kolya Kosenko // Created: 2010-05-12 diff --git a/src/qt/combobox.cpp b/src/qt/combobox.cpp index 67757fd2ee..14af9eb2d9 100644 --- a/src/qt/combobox.cpp +++ b/src/qt/combobox.cpp @@ -118,6 +118,14 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id, return QtCreateControl( parent, id, pos, size, style, validator, name ); } +void wxComboBox::SetValue(const wxString& value) +{ + if ( HasFlag(wxCB_READONLY) ) + SetStringSelection(value); + else + wxTextEntry::SetValue(value); +} + wxString wxComboBox::DoGetValue() const { return wxQtConvertString( m_qtComboBox->currentText() ); @@ -133,6 +141,12 @@ void wxComboBox::Dismiss() static_cast(GetHandle())->hidePopup(); } +void wxComboBox::Clear() +{ + wxTextEntry::Clear(); + wxItemContainer::Clear(); +} + void wxComboBox::SetSelection( long from, long to ) { // SelectAll uses -1 to -1, adjust for qt: diff --git a/src/qt/dataobj.cpp b/src/qt/dataobj.cpp index 040ad0a419..27108b1a46 100644 --- a/src/qt/dataobj.cpp +++ b/src/qt/dataobj.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: wx/qt/dataform.h +// Name: src/qt/dataobj.cpp // Author: Peter Most // Copyright: (c) Peter Most // Licence: wxWindows licence diff --git a/src/qt/display.cpp b/src/qt/display.cpp index 28cc87358f..18eb47e286 100644 --- a/src/qt/display.cpp +++ b/src/qt/display.cpp @@ -9,7 +9,7 @@ #include "wx/wxprec.h" #include "wx/display.h" -#include "wx/display_impl.h" +#include "wx/private/display.h" #include #include #include "wx/qt/private/converter.h" @@ -19,12 +19,16 @@ class wxDisplayImplQt : public wxDisplayImpl public: wxDisplayImplQt( unsigned n ); - virtual wxRect GetGeometry() const; - virtual wxString GetName() const; + virtual wxRect GetGeometry() const wxOVERRIDE; + virtual wxRect GetClientArea() const wxOVERRIDE; + virtual int GetDepth() const wxOVERRIDE; + virtual wxSize GetSizeMM() const wxOVERRIDE; - virtual wxArrayVideoModes GetModes(const wxVideoMode& mode) const; - virtual wxVideoMode GetCurrentMode() const; - virtual bool ChangeMode(const wxVideoMode& mode); +#if wxUSE_DISPLAY + virtual wxArrayVideoModes GetModes(const wxVideoMode& mode) const wxOVERRIDE; + virtual wxVideoMode GetCurrentMode() const wxOVERRIDE; + virtual bool ChangeMode(const wxVideoMode& mode) wxOVERRIDE; +#endif // wxUSE_DISPLAY }; wxDisplayImplQt::wxDisplayImplQt( unsigned n ) @@ -37,11 +41,24 @@ wxRect wxDisplayImplQt::GetGeometry() const return wxQtConvertRect( QApplication::desktop()->screenGeometry( GetIndex() )); } -wxString wxDisplayImplQt::GetName() const +wxRect wxDisplayImplQt::GetClientArea() const { - return wxString(); + return wxQtConvertRect( QApplication::desktop()->availableGeometry( GetIndex() )); } +int wxDisplayImplQt::GetDepth() const +{ + return IsPrimary() ? QApplication::desktop()->depth() : 0; +} + +wxSize wxDisplayImplQt::GetSizeMM() const +{ + return IsPrimary() ? wxSize(QApplication::desktop()->widthMM(), + QApplication::desktop()->heightMM()) + : wxSize(0, 0); +} + +#if wxUSE_DISPLAY wxArrayVideoModes wxDisplayImplQt::GetModes(const wxVideoMode& WXUNUSED(mode)) const { return wxArrayVideoModes(); @@ -60,25 +77,21 @@ bool wxDisplayImplQt::ChangeMode(const wxVideoMode& WXUNUSED(mode)) { return false; } +#endif // wxUSE_DISPLAY //############################################################################## +#if wxUSE_DISPLAY + class wxDisplayFactoryQt : public wxDisplayFactory { public: - wxDisplayFactoryQt(); - - virtual wxDisplayImpl *CreateDisplay(unsigned n); - virtual unsigned GetCount(); - virtual int GetFromPoint(const wxPoint& pt); + virtual wxDisplayImpl *CreateDisplay(unsigned n) wxOVERRIDE; + virtual unsigned GetCount() wxOVERRIDE; + virtual int GetFromPoint(const wxPoint& pt) wxOVERRIDE; }; - -wxDisplayFactoryQt::wxDisplayFactoryQt() -{ -} - wxDisplayImpl *wxDisplayFactoryQt::CreateDisplay(unsigned n) { return new wxDisplayImplQt( n ); @@ -100,3 +113,21 @@ int wxDisplayFactoryQt::GetFromPoint(const wxPoint& pt) { return new wxDisplayFactoryQt; } + +#else // wxUSE_DISPLAY + +class wxDisplayFactorySingleQt : public wxDisplayFactorySingleQt +{ +protected: + virtual wxDisplayImpl *CreateSingleDisplay() wxOVERRIDE + { + return new wxDisplayImplQt(0); + } +}; + +/* static */ wxDisplayFactory *wxDisplay::CreateFactory() +{ + return new wxDisplayFactorySingleQt; +} + +#endif // wxUSE_DISPLAY/!wxUSE_DISPLAY diff --git a/src/qt/dnd.cpp b/src/qt/dnd.cpp index 3b7fda37b8..7e99e94ec2 100644 --- a/src/qt/dnd.cpp +++ b/src/qt/dnd.cpp @@ -8,6 +8,8 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" +#if wxUSE_DRAG_AND_DROP + #include "wx/dnd.h" wxDropTarget::wxDropTarget(wxDataObject *WXUNUSED(dataObject)) @@ -58,3 +60,4 @@ wxDragResult wxDropSource::DoDragDrop(int WXUNUSED(flags)) return wxDragResult(); } +#endif // wxUSE_DRAG_AND_DROP diff --git a/src/qt/evtloop.cpp b/src/qt/evtloop.cpp index a0f1d549f9..2cb13ba0f6 100644 --- a/src/qt/evtloop.cpp +++ b/src/qt/evtloop.cpp @@ -259,16 +259,4 @@ wxGUIEventLoop::wxGUIEventLoop() { } -#else // !wxUSE_GUI - -//############################################################################# - -#if wxUSE_CONSOLE_EVENTLOOP - -wxConsoleEventLoop::wxConsoleEventLoop() -{ -} - -#endif // wxUSE_CONSOLE_EVENTLOOP - #endif // wxUSE_GUI diff --git a/src/qt/glcanvas.cpp b/src/qt/glcanvas.cpp index ba8b49678b..2430d84384 100644 --- a/src/qt/glcanvas.cpp +++ b/src/qt/glcanvas.cpp @@ -329,7 +329,7 @@ void wxGLAttributes::AddDefaultsForWXBefore31() wxIMPLEMENT_CLASS(wxGLContext, wxWindow); -wxGLContext::wxGLContext(wxGLCanvas *WXUNUSED(win), const wxGLContext* WXUNUSED(other)) +wxGLContext::wxGLContext(wxGLCanvas *WXUNUSED(win), const wxGLContext* WXUNUSED(other), const wxGLContextAttrs *WXUNUSED(ctxAttrs)) { // m_glContext = win->GetHandle()->context(); } @@ -347,6 +347,18 @@ bool wxGLContext::SetCurrent(const wxGLCanvas&) const wxIMPLEMENT_CLASS(wxGLCanvas, wxWindow); +wxGLCanvas::wxGLCanvas(wxWindow *parent, + const wxGLAttributes& dispAttrs, + wxWindowID id, + const wxPoint& pos, + const wxSize& size, + long style, + const wxString& name, + const wxPalette& palette) +{ + Create(parent, dispAttrs, id, pos, size, style, name, palette); +} + wxGLCanvas::wxGLCanvas(wxWindow *parent, wxWindowID id, const int *attribList, @@ -359,6 +371,19 @@ wxGLCanvas::wxGLCanvas(wxWindow *parent, Create(parent, id, pos, size, style, name, attribList, palette); } +bool wxGLCanvas::Create(wxWindow *parent, + const wxGLAttributes& dispAttrs, + wxWindowID id, + const wxPoint& pos, + const wxSize& size, + long style, + const wxString& name, + const wxPalette& palette) +{ + wxLogError("Missing implementation of " + wxString(__FUNCTION__)); + return false; +} + bool wxGLCanvas::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, @@ -509,4 +534,22 @@ wxGLCanvasBase::IsDisplaySupported(const int *attribList) return QGLWidget(format).isValid(); } +/* static */ +bool +wxGLCanvasBase::IsDisplaySupported(const wxGLAttributes& dispAttrs) +{ + wxLogError("Missing implementation of " + wxString(__FUNCTION__)); + return false; +} + +// ---------------------------------------------------------------------------- +// wxGLApp +// ---------------------------------------------------------------------------- + +bool wxGLApp::InitGLVisual(const int *attribList) +{ + wxLogError("Missing implementation of " + wxString(__FUNCTION__)); + return false; +} + #endif // wxUSE_GLCANVAS diff --git a/src/qt/listctrl.cpp b/src/qt/listctrl.cpp index 7ddd3b8d79..8a087ef07d 100644 --- a/src/qt/listctrl.cpp +++ b/src/qt/listctrl.cpp @@ -329,12 +329,9 @@ bool wxListCtrl::SetItem(wxListItem& info) { wxImageList *imglst = GetImageList(InReportView() ? wxIMAGE_LIST_SMALL : wxIMAGE_LIST_NORMAL); wxCHECK_MSG(imglst, false, "invalid listctrl imagelist"); - const wxBitmap* bitmap = imglst->GetBitmapPtr(info.m_image); - if (bitmap != NULL) - { - // set the new image: - qitem->setIcon( info.GetColumn(), QIcon( *bitmap->GetHandle() )); - } + const wxBitmap bitmap = imglst->GetBitmap(info.m_image); + // set the new image: + qitem->setIcon( info.GetColumn(), QIcon( *bitmap.GetHandle() )); } else { diff --git a/src/qt/menuitem.cpp b/src/qt/menuitem.cpp index eab049e342..6ce89dc5be 100644 --- a/src/qt/menuitem.cpp +++ b/src/qt/menuitem.cpp @@ -106,18 +106,17 @@ bool wxMenuItem::IsChecked() const } -void wxMenuItem::SetBitmap(const wxBitmap& WXUNUSED(bitmap)) +void wxMenuItem::SetBitmap(const wxBitmap& bitmap) { - wxMISSING_FUNCTION(); -} - -const wxBitmap &wxMenuItem::GetBitmap() const -{ - wxMISSING_FUNCTION(); - - static wxBitmap s_bitmap; - - return s_bitmap; + if ( m_kind == wxITEM_NORMAL ) + { + m_bitmap = bitmap; + m_qtAction->setIcon( QIcon( *m_bitmap.GetHandle() ) ); + } + else + { + wxFAIL_MSG("only normal menu items can have bitmaps"); + } } QAction *wxMenuItem::GetHandle() const diff --git a/src/qt/nonownedwnd.cpp b/src/qt/nonownedwnd.cpp index 91ed44e740..dfb48fbb6f 100644 --- a/src/qt/nonownedwnd.cpp +++ b/src/qt/nonownedwnd.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: wx/qt/nonownedwnd.h +// Name: src/qt/nonownedwnd.cpp // Author: Sean D'Epagnier // Copyright: (c) 2016 wxWidgets dev team // Licence: wxWindows licence diff --git a/src/qt/notebook.cpp b/src/qt/notebook.cpp index 8fd294f1f5..3730c67782 100644 --- a/src/qt/notebook.cpp +++ b/src/qt/notebook.cpp @@ -112,11 +112,9 @@ bool wxNotebook::SetPageImage(size_t n, int imageId) if (imageId >= 0) { wxCHECK_MSG(HasImageList(), false, "invalid notebook imagelist"); - const wxBitmap* bitmap = GetImageList()->GetBitmapPtr(imageId); - if (bitmap == NULL) - return false; + const wxBitmap bitmap = GetImageList()->GetBitmap(imageId); // set the new image: - m_qtTabWidget->setTabIcon( n, QIcon( *bitmap->GetHandle() )); + m_qtTabWidget->setTabIcon( n, QIcon( *bitmap.GetHandle() )); } else { @@ -137,8 +135,8 @@ bool wxNotebook::InsertPage(size_t n, wxWindow *page, const wxString& text, { if (HasImageList()) { - const wxBitmap* bitmap = GetImageList()->GetBitmapPtr(imageId); - m_qtTabWidget->insertTab( n, page->GetHandle(), QIcon( *bitmap->GetHandle() ), wxQtConvertString( text )); + const wxBitmap bitmap = GetImageList()->GetBitmap(imageId); + m_qtTabWidget->insertTab( n, page->GetHandle(), QIcon( *bitmap.GetHandle() ), wxQtConvertString( text )); } else { diff --git a/src/qt/radiobox.cpp b/src/qt/radiobox.cpp index da8c90baa6..32ccb686b1 100644 --- a/src/qt/radiobox.cpp +++ b/src/qt/radiobox.cpp @@ -135,9 +135,13 @@ bool wxRadioBox::Create(wxWindow *parent, m_qtGroupBox->setTitle( wxQtConvertString( title ) ); m_qtButtonGroup = new wxQtButtonGroup( m_qtGroupBox, this ); - if ( style & wxRA_SPECIFY_ROWS ) + // wxRA_SPECIFY_COLS means that we arrange buttons in + // left to right order and GetMajorDim() is the number of columns while + // wxRA_SPECIFY_ROWS means that the buttons are arranged top to bottom and + // GetMajorDim() is the number of rows. + if ( style & wxRA_SPECIFY_COLS ) m_qtBoxLayout = new QHBoxLayout; - else if ( style & wxRA_SPECIFY_COLS ) + else if ( style & wxRA_SPECIFY_ROWS ) m_qtBoxLayout = new QVBoxLayout; AddChoices< QRadioButton >( m_qtButtonGroup, m_qtBoxLayout, n, choices ); diff --git a/src/qt/region.cpp b/src/qt/region.cpp index ad6551d3ea..45936ab577 100644 --- a/src/qt/region.cpp +++ b/src/qt/region.cpp @@ -10,6 +10,7 @@ #include "wx/region.h" #include "wx/bitmap.h" +#include "wx/scopedarray.h" #include "wx/qt/private/converter.h" #include "wx/qt/private/utils.h" @@ -106,8 +107,8 @@ wxRegion::wxRegion(const wxBitmap& bmp, const wxColour& transp, int tolerance) return; } - unsigned char raw[bmp.GetWidth()*bmp.GetHeight()]; - memset(raw, 0, bmp.GetWidth()*bmp.GetHeight()); + wxScopedArray raw(bmp.GetWidth()*bmp.GetHeight()); + memset(raw.get(), 0, bmp.GetWidth()*bmp.GetHeight()); QImage img(bmp.GetHandle()->toImage()); int r = transp.Red(), g = transp.Green(), b = transp.Blue(); @@ -125,7 +126,7 @@ wxRegion::wxRegion(const wxBitmap& bmp, const wxColour& transp, int tolerance) } } - m_refData = new wxRegionRefData(QBitmap::fromData(bmp.GetHandle()->size(), raw)); + m_refData = new wxRegionRefData(QBitmap::fromData(bmp.GetHandle()->size(), raw.get())); } bool wxRegion::IsEmpty() const diff --git a/src/qt/toolbar.cpp b/src/qt/toolbar.cpp index c6ec8adc5c..dc307e086b 100644 --- a/src/qt/toolbar.cpp +++ b/src/qt/toolbar.cpp @@ -185,6 +185,41 @@ wxToolBarToolBase *wxToolBar::FindToolForPosition(wxCoord WXUNUSED(x), return NULL; } +void wxToolBar::SetToolShortHelp( int id, const wxString& helpString ) +{ + wxToolBarTool* tool = static_cast(FindById(id)); + if ( tool ) + { + (void)tool->SetShortHelp(helpString); + //TODO - other qt actions for tool tip string +// if (tool->m_item) +// {} + } +} + +void wxToolBar::SetToolNormalBitmap( int id, const wxBitmap& bitmap ) +{ + wxToolBarTool* tool = static_cast(FindById(id)); + if ( tool ) + { + wxCHECK_RET( tool->IsButton(), wxT("Can only set bitmap on button tools.")); + + tool->SetNormalBitmap(bitmap); + tool->SetIcon(); + } +} + +void wxToolBar::SetToolDisabledBitmap( int id, const wxBitmap& bitmap ) +{ + wxToolBarTool* tool = static_cast(FindById(id)); + if ( tool ) + { + wxCHECK_RET( tool->IsButton(), wxT("Can only set bitmap on button tools.")); + + tool->SetDisabledBitmap(bitmap); + } +} + void wxToolBar::SetWindowStyleFlag( long style ) { wxToolBarBase::SetWindowStyleFlag(style); @@ -249,7 +284,7 @@ bool wxToolBar::DoInsertTool(size_t pos, wxToolBarToolBase *toolBase) { wxToolBarTool* tool = static_cast(toolBase); QAction *before = NULL; - if (pos >= 0 && pos < (size_t)m_qtToolBar->actions().size()) + if (pos < (size_t)m_qtToolBar->actions().size()) before = m_qtToolBar->actions().at(pos); QAction *action; diff --git a/src/qt/uiaction.cpp b/src/qt/uiaction.cpp index 1ac40a3916..5ca92385b8 100644 --- a/src/qt/uiaction.cpp +++ b/src/qt/uiaction.cpp @@ -12,6 +12,8 @@ #pragma hdrstop #endif +#if wxUSE_UIACTIONSIMULATOR + #include "wx/uiaction.h" #include "wx/private/uiaction.h" @@ -24,8 +26,6 @@ #include "wx/qt/private/converter.h" -#if wxUSE_UIACTIONSIMULATOR - using namespace Qt; using namespace QTest; diff --git a/src/qt/utils.cpp b/src/qt/utils.cpp index f1e9db341b..428e9e3dd5 100644 --- a/src/qt/utils.cpp +++ b/src/qt/utils.cpp @@ -110,42 +110,11 @@ bool wxGetKeyState(wxKeyCode key) } } -int wxDisplayDepth() -{ - return QApplication::desktop()->depth(); -} - -void wxDisplaySize(int *width, int *height) -{ - if ( width != NULL ) - *width = QApplication::desktop()->width(); - if ( height != NULL ) - *height = QApplication::desktop()->height(); -} - -void wxDisplaySizeMM(int *width, int *height) -{ - if ( width != NULL ) - *width = QApplication::desktop()->widthMM(); - if ( height != NULL ) - *height = QApplication::desktop()->heightMM(); -} - void wxBell() { QApplication::beep(); } -void wxClientDisplayRect(int *x, int *y, int *width, int *height) -{ - QRect r = QApplication::desktop()->availableGeometry(); - - *x = r.x(); - *y = r.y(); - *width = r.width(); - *height = r.height(); -} - wxWindow *wxGetActiveWindow() { QWidget *w = QApplication::activeWindow(); @@ -163,11 +132,6 @@ wxWindow *wxGetActiveWindow() return NULL; } -bool wxColourDisplay() -{ - return QApplication::desktop()->depth() > 1; -} - bool wxLaunchDefaultApplication(const wxString& path, int WXUNUSED( flags ) ) { return QDesktopServices::openUrl( QUrl::fromLocalFile( wxQtConvertString( path ) ) ); diff --git a/src/qt/window.cpp b/src/qt/window.cpp index b82a4e3054..87feb5ecb7 100644 --- a/src/qt/window.cpp +++ b/src/qt/window.cpp @@ -194,8 +194,7 @@ wxWindowQt::~wxWindowQt() // Delete only if the qt widget was created or assigned to this base class if (m_qtWindow) { - wxLogTrace(TRACE_QT_WINDOW, wxT("wxWindow::~wxWindow %s m_qtWindow=%p"), - (const char*)GetName(), m_qtWindow); + wxLogTrace(TRACE_QT_WINDOW, wxT("wxWindow::~wxWindow %s m_qtWindow=%p"), GetName(), m_qtWindow); // Avoid sending further signals (i.e. if deleting the current page) m_qtWindow->blockSignals(true); // Reset the pointer to avoid handling pending event and signals @@ -206,8 +205,7 @@ wxWindowQt::~wxWindowQt() } else { - wxLogTrace(TRACE_QT_WINDOW, wxT("wxWindow::~wxWindow %s m_qtWindow is NULL"), - (const char*)GetName()); + wxLogTrace(TRACE_QT_WINDOW, wxT("wxWindow::~wxWindow %s m_qtWindow is NULL"), GetName()); } } @@ -260,8 +258,7 @@ void wxWindowQt::PostCreation(bool generic) // store pointer to the QWidget subclass (to be used in the destructor) m_qtWindow = GetHandle(); } - wxLogTrace(TRACE_QT_WINDOW, wxT("wxWindow::Create %s m_qtWindow=%p"), - (const char*)GetName(), m_qtWindow); + wxLogTrace(TRACE_QT_WINDOW, wxT("wxWindow::Create %s m_qtWindow=%p"), GetName(), m_qtWindow); // set the background style after creation (not before like in wxGTK) // (only for generic controls, to use qt defaults elsewere) @@ -395,7 +392,7 @@ void wxWindowQt::WarpPointer(int x, int y) void wxWindowQt::Update() { - wxLogTrace(TRACE_QT_WINDOW, wxT("wxWindow::Update %s"), (const char*)GetName()); + wxLogTrace(TRACE_QT_WINDOW, wxT("wxWindow::Update %s"), GetName()); // send the paint event to the inner widget in scroll areas: if ( QtGetScrollBarsContainer() ) { @@ -422,14 +419,13 @@ void wxWindowQt::Refresh( bool WXUNUSED( eraseBackground ), const wxRect *rect ) if ( rect != NULL ) { wxLogTrace(TRACE_QT_WINDOW, wxT("wxWindow::Refresh %s rect %d %d %d %d"), - (const char*)GetName(), + GetName(), rect->x, rect->y, rect->width, rect->height); widget->update( wxQtConvertRect( *rect )); } else { - wxLogTrace(TRACE_QT_WINDOW, wxT("wxWindow::Refresh %s"), - (const char*)GetName()); + wxLogTrace(TRACE_QT_WINDOW, wxT("wxWindow::Refresh %s"), GetName()); widget->update(); } } @@ -650,10 +646,12 @@ void wxWindowQt::ScrollWindow( int dx, int dy, const wxRect *rect ) } +#if wxUSE_DRAG_AND_DROP void wxWindowQt::SetDropTarget( wxDropTarget * WXUNUSED( dropTarget ) ) { wxMISSING_IMPLEMENTATION( __FUNCTION__ ); } +#endif void wxWindowQt::SetWindowStyleFlag( long style ) { @@ -1081,7 +1079,7 @@ bool wxWindowQt::QtHandlePaintEvent ( QWidget *handler, QPaintEvent *event ) if ( UseBgCol() && !GetHandle()->autoFillBackground() ) { wxLogTrace(TRACE_QT_WINDOW, wxT("wxWindow::QtHandlePaintEvent %s clearing DC to %s"), - (const char*)GetName(), GetBackgroundColour().GetAsString() + GetName(), GetBackgroundColour().GetAsString() ); dc.SetBackground(GetBackgroundColour()); dc.Clear(); @@ -1130,8 +1128,7 @@ bool wxWindowQt::QtHandlePaintEvent ( QWidget *handler, QPaintEvent *event ) else { // Painter didn't begun, not handled by wxWidgets: - wxLogTrace(TRACE_QT_WINDOW, wxT("wxWindow::QtHandlePaintEvent %s Qt widget painter begin failed"), - (const char*)GetName() ); + wxLogTrace(TRACE_QT_WINDOW, wxT("wxWindow::QtHandlePaintEvent %s Qt widget painter begin failed"), GetName() ); return false; } } diff --git a/src/stc/PlatWX.cpp b/src/stc/PlatWX.cpp index 1efb9d9de0..4fd42772bb 100644 --- a/src/stc/PlatWX.cpp +++ b/src/stc/PlatWX.cpp @@ -44,7 +44,11 @@ #include "wx/stc/stc.h" #include "wx/stc/private.h" -#if wxUSE_GRAPHICS_DIRECT2D +#if defined(__WXMSW__) && wxUSE_GRAPHICS_DIRECT2D +#define HAVE_DIRECTWRITE_TECHNOLOGY +#endif + +#ifdef HAVE_DIRECTWRITE_TECHNOLOGY #include "ScintillaWX.h" #include #include "wx/dcscreen.h" @@ -165,11 +169,11 @@ void Font::Create(const FontParameters &fp) { wxFontWithAscent* newFont = new wxFontWithAscent(font); fid = newFont; -#if wxUSE_GRAPHICS_DIRECT2D +#ifdef HAVE_DIRECTWRITE_TECHNOLOGY if ( fp.technology == wxSTC_TECHNOLOGY_DIRECTWRITE ) { newFont->SetSurfaceFontData(new SurfaceFontDataD2D(fp)); } -#endif // wxUSE_GRAPHICS_DIRECT2D +#endif // HAVE_DIRECTWRITE_TECHNOLOGY } @@ -694,7 +698,7 @@ void SurfaceImpl::SetDBCSMode(int WXUNUSED(codePage)) { // dbcsMode = codePage == SC_CP_DBCS; } -#if wxUSE_GRAPHICS_DIRECT2D +#ifdef HAVE_DIRECTWRITE_TECHNOLOGY //---------------------------------------------------------------------- // SurfaceFontDataD2D @@ -1805,16 +1809,16 @@ void SurfaceD2D::DrawTextCommon(PRectangle rc, Font &font_, XYPOSITION ybase, } } -#endif // wxUSE_GRAPHICS_DIRECT2D +#endif // HAVE_DIRECTWRITE_TECHNOLOGY Surface *Surface::Allocate(int technology) { wxUnusedVar(technology); -#if wxUSE_GRAPHICS_DIRECT2D +#ifdef HAVE_DIRECTWRITE_TECHNOLOGY if ( technology == wxSTC_TECHNOLOGY_DIRECTWRITE ) { return new SurfaceD2D; } -#endif // wxUSE_GRAPHICS_DIRECT2D +#endif // HAVE_DIRECTWRITE_TECHNOLOGY return new SurfaceImpl; } @@ -1953,17 +1957,11 @@ void Window::SetTitle(const char *s) { // Returns rectangle of monitor pt is on PRectangle Window::GetMonitorRect(Point pt) { - wxRect rect; if (! wid) return PRectangle(); -#if wxUSE_DISPLAY // Get the display the point is found on int n = wxDisplay::GetFromPoint(wxPoint(wxRound(pt.x), wxRound(pt.y))); wxDisplay dpy(n == wxNOT_FOUND ? 0 : n); - rect = dpy.GetGeometry(); -#else - wxUnusedVar(pt); -#endif - return PRectangleFromwxRect(rect); + return PRectangleFromwxRect(dpy.GetGeometry()); } //---------------------------------------------------------------------- diff --git a/src/stc/ScintillaWX.cpp b/src/stc/ScintillaWX.cpp index ad5f506c35..dc65fcedf9 100644 --- a/src/stc/ScintillaWX.cpp +++ b/src/stc/ScintillaWX.cpp @@ -825,7 +825,7 @@ sptr_t ScintillaWX::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) } #endif -#if wxUSE_GRAPHICS_DIRECT2D +#if defined(__WXMSW__) && wxUSE_GRAPHICS_DIRECT2D case SCI_SETTECHNOLOGY: if ((wParam == SC_TECHNOLOGY_DEFAULT) || (wParam == SC_TECHNOLOGY_DIRECTWRITE)) { if (technology != static_cast(wParam)) { diff --git a/src/univ/scrarrow.cpp b/src/univ/scrarrow.cpp index a540046aea..f693b8bbff 100644 --- a/src/univ/scrarrow.cpp +++ b/src/univ/scrarrow.cpp @@ -33,6 +33,7 @@ #include "wx/univ/inphand.h" #include "wx/univ/theme.h" +#if wxUSE_SCROLLBAR // ---------------------------------------------------------------------------- // wxScrollArrowCaptureData: contains the data used while the arrow is being // pressed by the user @@ -298,3 +299,4 @@ bool wxScrollArrows::HandleMouse(const wxMouseEvent& event) const return true; } +#endif // wxUSE_SCROLLBAR diff --git a/src/univ/scrolbar.cpp b/src/univ/scrolbar.cpp index 61da0cf772..0f63eabd08 100644 --- a/src/univ/scrolbar.cpp +++ b/src/univ/scrolbar.cpp @@ -1153,7 +1153,7 @@ bool wxStdScrollBarInputHandler::HandleMouseMove(wxInputConsumer *consumer, #endif // wxUSE_SCROLLBAR -#if wxUSE_TIMER +#if wxUSE_TIMER && wxUSE_SCROLLBAR // ---------------------------------------------------------------------------- // wxScrollTimer @@ -1198,4 +1198,4 @@ void wxScrollTimer::Notify() } } -#endif // wxUSE_TIMER +#endif // wxUSE_TIMER && wxUSE_SCROLLBAR diff --git a/src/univ/scrthumb.cpp b/src/univ/scrthumb.cpp index 604c4044b5..33b7806d31 100644 --- a/src/univ/scrthumb.cpp +++ b/src/univ/scrthumb.cpp @@ -30,6 +30,7 @@ #include "wx/univ/scrtimer.h" #include "wx/univ/scrthumb.h" +#if wxUSE_SCROLLBAR // ---------------------------------------------------------------------------- // wxScrollThumbCaptureData: the struct used while dragging the scroll thumb // ---------------------------------------------------------------------------- @@ -290,3 +291,4 @@ int wxScrollThumb::GetThumbPos(const wxMouseEvent& event) const int x = GetMouseCoord(event) - m_captureData->m_ofsMouse; return m_control->PixelToThumbPos(x); } +#endif // wxUSE_SCROLLBAR diff --git a/src/univ/winuniv.cpp b/src/univ/winuniv.cpp index 553d9cb151..ac4b4bfc92 100644 --- a/src/univ/winuniv.cpp +++ b/src/univ/winuniv.cpp @@ -59,6 +59,7 @@ // implementation // ============================================================================ +#if wxUSE_SCROLLBAR // ---------------------------------------------------------------------------- // scrollbars class // ---------------------------------------------------------------------------- @@ -80,6 +81,7 @@ public: virtual bool CanBeOutsideClientArea() const { return true; } }; +#endif // wxUSE_SCROLLBAR // ---------------------------------------------------------------------------- diff --git a/src/unix/descrip.mms b/src/unix/descrip.mms index 5681043bc8..93adf416c4 100644 --- a/src/unix/descrip.mms +++ b/src/unix/descrip.mms @@ -2,7 +2,7 @@ # * # Make file for VMS * # Author : J.Jansen (joukj@hrem.nano.tudelft.nl) * -# Date : 22 May 2018 * +# Date : 16 October 2018 * # * #***************************************************************************** .first @@ -46,7 +46,6 @@ CC_DEFINE = OBJECTS = appunix.obj,apptraits.obj,\ dialup.obj,\ dir.obj,\ - displayx11.obj,\ dlunix.obj,\ fontenum.obj,\ fontutil.obj,\ @@ -64,6 +63,9 @@ OBJECTS = appunix.obj,apptraits.obj,\ timerunx.obj,evtloopunix.obj,fdiounix.obj,uiactionx11.obj,\ mediactrl.obj,wakeuppipe.obj,mimetype.obj +OBJECTS2=displayx11.obj + + SOURCES = appunix.cpp,apptraits.cpp,\ dialup.cpp,\ dir.cpp,\ @@ -89,21 +91,28 @@ all : $(SOURCES) $(MMS)$(MMSQUALIFIERS) $(OBJECTS) .ifdef __WXMOTIF__ library [--.lib]libwx_motif.olb $(OBJECTS) + $(MMS)$(MMSQUALIFIERS) $(OBJECTS2) + library [--.lib]libwx_motif.olb $(OBJECTS2) .else .ifdef __WXGTK__ library [--.lib]libwx_gtk.olb $(OBJECTS) + $(MMS)$(MMSQUALIFIERS) $(OBJECTS2) + library [--.lib]libwx_gtk.olb $(OBJECTS2) .else .ifdef __WXGTK2__ library [--.lib]libwx_gtk2.olb $(OBJECTS) .else .ifdef __WXX11__ library [--.lib]libwx_x11_univ.olb $(OBJECTS) + $(MMS)$(MMSQUALIFIERS) $(OBJECTS2) + library [--.lib]libwx_x11_univ.olb $(OBJECTS2) .endif .endif .endif .endif $(OBJECTS) : [--.include.wx]setup.h +$(OBJECTS2) : [--.include.wx]setup.h appunix.obj : appunix.cpp apptraits.obj : apptraits.cpp diff --git a/src/unix/displayx11.cpp b/src/unix/displayx11.cpp index 5b709ca0ff..e2e67970c0 100644 --- a/src/unix/displayx11.cpp +++ b/src/unix/displayx11.cpp @@ -29,24 +29,76 @@ #include "wx/log.h" #endif /* WX_PRECOMP */ -#ifdef __WXGTK20__ - #include // GDK_WINDOWING_X11 -#endif -#if !defined(__WXGTK20__) || defined(GDK_WINDOWING_X11) - #include - #include -#endif +#include "wx/private/display.h" +#include "wx/unix/private/displayx11.h" + +static wxRect wxGetMainScreenWorkArea(); + +namespace +{ + +inline int wxGetMainScreenDepth() +{ + Display* const dpy = wxGetX11Display(); + + return DefaultDepth(dpy, DefaultScreen (dpy)); +} + +inline wxSize wxGetMainScreenSizeMM() +{ + Display* const dpy = wxGetX11Display(); + + return wxSize + ( + DisplayWidthMM(dpy, DefaultScreen(dpy)), + DisplayHeightMM(dpy, DefaultScreen(dpy)) + ); +} + +class wxDisplayImplSingleX11 : public wxDisplayImplSingle +{ +public: + virtual wxRect GetGeometry() const wxOVERRIDE + { + Display* const dpy = wxGetX11Display(); + + return wxRect(0, 0, + DisplayWidth(dpy, DefaultScreen (dpy)), + DisplayHeight(dpy, DefaultScreen (dpy))); + } + + virtual wxRect GetClientArea() const wxOVERRIDE + { + return wxGetMainScreenWorkArea(); + } + + virtual int GetDepth() const wxOVERRIDE + { + return wxGetMainScreenDepth(); + } + + virtual wxSize GetSizeMM() const wxOVERRIDE + { + return wxGetMainScreenSizeMM(); + } +}; + +class wxDisplayFactorySingleX11 : public wxDisplayFactorySingle +{ +protected: + virtual wxDisplayImpl *CreateSingleDisplay() + { + return new wxDisplayImplSingleX11; + } +}; + +} // anonymous namespace #if wxUSE_DISPLAY -#include "wx/display.h" -#include "wx/display_impl.h" +#include -#ifndef __WXGTK20__ - - #include - - typedef XineramaScreenInfo ScreenInfo; +typedef XineramaScreenInfo ScreenInfo; // ---------------------------------------------------------------------------- // helper class storing information about all screens @@ -97,10 +149,21 @@ public: // we intentionally don't cache the result here because the client // display area may change (e.g. the user resized or hid a panel) and // we don't currently react to its changes - return IsPrimary() ? wxGetClientDisplayRect() : m_rect; + return IsPrimary() ? wxGetMainScreenWorkArea() : m_rect; } + virtual int GetDepth() const wxOVERRIDE + { + const wxVideoMode& mode = GetCurrentMode(); + if ( mode.bpp ) + return mode.bpp; - virtual wxString GetName() const wxOVERRIDE { return wxString(); } + return wxGetMainScreenDepth(); + } + virtual wxSize GetSizeMM() const wxOVERRIDE + { + // TODO: how to get physical size or resolution of the other monitors? + return IsPrimary() ? wxGetMainScreenSizeMM() : wxSize(0, 0); + } virtual wxArrayVideoModes GetModes(const wxVideoMode& mode) const wxOVERRIDE; virtual wxVideoMode GetCurrentMode() const wxOVERRIDE; @@ -108,7 +171,6 @@ public: private: wxRect m_rect; - int m_depth; wxDECLARE_NO_COPY_CLASS(wxDisplayImplX11); }; @@ -159,118 +221,13 @@ wxDisplayImpl *wxDisplayFactoryX11::CreateDisplay(unsigned n) return n < screens.GetCount() ? new wxDisplayImplX11(n, screens[n]) : NULL; } -#endif // !__WXGTK20__ // ============================================================================ // wxDisplayImplX11 implementation // ============================================================================ -#if !defined(__WXGTK20__) || defined(GDK_WINDOWING_X11) - #ifdef HAVE_X11_EXTENSIONS_XF86VMODE_H -#include - -// -// See (http://www.xfree86.org/4.2.0/XF86VidModeDeleteModeLine.3.html) for more -// info about xf86 video mode extensions -// - -//free private data common to x (usually s3) servers -#define wxClearXVM(vm) if(vm.privsize) XFree(vm.c_private) - -// Correct res rate from GLFW -#define wxCRR2(v,dc) (int) (((1000.0f * (float) dc) /*PIXELS PER SECOND */) / ((float) v.htotal * v.vtotal /*PIXELS PER FRAME*/) + 0.5f) -#define wxCRR(v) wxCRR2(v,v.dotclock) -#define wxCVM2(v, dc, display, nScreen) wxVideoMode(v.hdisplay, v.vdisplay, DefaultDepth(display, nScreen), wxCRR2(v,dc)) -#define wxCVM(v, display, nScreen) wxCVM2(v, v.dotclock, display, nScreen) - -wxArrayVideoModes wxXF86VidMode_GetModes(const wxVideoMode& mode, Display* display, int nScreen) -{ - XF86VidModeModeInfo** ppXModes; //Enumerated Modes (Don't forget XFree() :)) - int nNumModes; //Number of modes enumerated.... - - wxArrayVideoModes Modes; //modes to return... - - if (XF86VidModeGetAllModeLines(display, nScreen, &nNumModes, &ppXModes)) - { - for (int i = 0; i < nNumModes; ++i) - { - XF86VidModeModeInfo& info = *ppXModes[i]; - const wxVideoMode vm = wxCVM(info, display, nScreen); - if (vm.Matches(mode)) - { - Modes.Add(vm); - } - wxClearXVM(info); - // XFree(ppXModes[i]); //supposed to free? - } - XFree(ppXModes); - } - else //OOPS! - { - wxLogSysError(_("Failed to enumerate video modes")); - } - - return Modes; -} - -wxVideoMode wxXF86VidMode_GetCurrentMode(Display* display, int nScreen) -{ - XF86VidModeModeLine VM; - int nDotClock; - if ( !XF86VidModeGetModeLine(display, nScreen, &nDotClock, &VM) ) - return wxVideoMode(); - - wxClearXVM(VM); - return wxCVM2(VM, nDotClock, display, nScreen); -} - -bool wxXF86VidMode_ChangeMode(const wxVideoMode& mode, Display* display, int nScreen) -{ - XF86VidModeModeInfo** ppXModes; //Enumerated Modes (Don't forget XFree() :)) - int nNumModes; //Number of modes enumerated.... - - if(!XF86VidModeGetAllModeLines(display, nScreen, &nNumModes, &ppXModes)) - { - wxLogSysError(_("Failed to change video mode")); - return false; - } - - bool bRet = false; - if (mode == wxDefaultVideoMode) - { - bRet = XF86VidModeSwitchToMode(display, nScreen, ppXModes[0]) != 0; - - for (int i = 0; i < nNumModes; ++i) - { - wxClearXVM((*ppXModes[i])); - // XFree(ppXModes[i]); //supposed to free? - } - } - else - { - for (int i = 0; i < nNumModes; ++i) - { - if (!bRet && - ppXModes[i]->hdisplay == mode.GetWidth() && - ppXModes[i]->vdisplay == mode.GetHeight() && - wxCRR((*ppXModes[i])) == mode.GetRefresh()) - { - //switch! - bRet = XF86VidModeSwitchToMode(display, nScreen, ppXModes[i]) != 0; - } - wxClearXVM((*ppXModes[i])); - // XFree(ppXModes[i]); //supposed to free? - } - } - - XFree(ppXModes); - - return bRet; -} - -#ifndef __WXGTK20__ wxArrayVideoModes wxDisplayImplX11::GetModes(const wxVideoMode& modeMatch) const { Display* display = static_cast(wxGetDisplay()); @@ -291,33 +248,9 @@ bool wxDisplayImplX11::ChangeMode(const wxVideoMode& mode) int nScreen = DefaultScreen(display); return wxXF86VidMode_ChangeMode(mode, display, nScreen); } -#endif // !__WXGTK20__ #else // !HAVE_X11_EXTENSIONS_XF86VMODE_H -wxArrayVideoModes wxX11_GetModes(const wxDisplayImpl* impl, const wxVideoMode& modeMatch, Display* display) -{ - int count_return; - int* depths = XListDepths(display, 0, &count_return); - wxArrayVideoModes modes; - if ( depths ) - { - const wxRect rect = impl->GetGeometry(); - for ( int x = 0; x < count_return; ++x ) - { - wxVideoMode mode(rect.width, rect.height, depths[x]); - if ( mode.Matches(modeMatch) ) - { - modes.Add(mode); - } - } - - XFree(depths); - } - return modes; -} - -#ifndef __WXGTK20__ wxArrayVideoModes wxDisplayImplX11::GetModes(const wxVideoMode& modeMatch) const { Display* display = static_cast(wxGetDisplay()); @@ -335,98 +268,50 @@ bool wxDisplayImplX11::ChangeMode(const wxVideoMode& WXUNUSED(mode)) // Not implemented return false; } -#endif // !__WXGTK20__ + #endif // !HAVE_X11_EXTENSIONS_XF86VMODE_H -#endif // !defined(__WXGTK20__) || defined(GDK_WINDOWING_X11) + +#endif // wxUSE_DISPLAY // ============================================================================ // wxDisplay::CreateFactory() // ============================================================================ -#ifndef __WXGTK20__ /* static */ wxDisplayFactory *wxDisplay::CreateFactory() { - if ( !XineramaIsActive((Display*)wxGetDisplay()) ) - return new wxDisplayFactorySingle; - - return new wxDisplayFactoryX11; -} -#endif - -#endif /* wxUSE_DISPLAY */ - -#if !defined(__WXGTK20__) || defined(GDK_WINDOWING_X11) -void wxGetWorkAreaX11(Screen* screen, int& x, int& y, int& width, int& height) -{ - Display* display = DisplayOfScreen(screen); - Atom property = XInternAtom(display, "_NET_WORKAREA", true); - if (property) - { - Atom actual_type; - int actual_format; - unsigned long nitems; - unsigned long bytes_after; - unsigned char* data = NULL; - Status status = XGetWindowProperty( - display, RootWindowOfScreen(screen), property, - 0, 4, false, XA_CARDINAL, - &actual_type, &actual_format, &nitems, &bytes_after, &data); - if (status == Success && actual_type == XA_CARDINAL && - actual_format == 32 && nitems == 4) - { - const long* p = (long*)data; - x = p[0]; - y = p[1]; - width = p[2]; - height = p[3]; - } - if (data) - XFree(data); - } -} -#endif // !defined(__WXGTK20__) || defined(GDK_WINDOWING_X11) - -#ifndef __WXGTK20__ - -void wxClientDisplayRect(int *x, int *y, int *width, int *height) -{ - Display * const dpy = wxGetX11Display(); - wxCHECK_RET( dpy, wxT("can't be called before initializing the GUI") ); - - wxRect rectClient; - wxGetWorkAreaX11(DefaultScreenOfDisplay(dpy), - rectClient.x, rectClient.y, rectClient.width, rectClient.height); - - // Although _NET_WORKAREA is supposed to return the client size of the - // screen, not all implementations are conforming, apparently, see #14419, - // so make sure we return a subset of the primary display. - wxRect rectFull; #if wxUSE_DISPLAY - ScreensInfo screens; - const ScreenInfo& info = screens[0]; - rectFull = wxRect(info.x_org, info.y_org, info.width, info.height); -#else - wxDisplaySize(&rectFull.width, &rectFull.height); -#endif + if ( XineramaIsActive((Display*)wxGetDisplay()) ) + return new wxDisplayFactoryX11; +#endif // wxUSE_DISPLAY - if ( !rectClient.width || !rectClient.height ) + return new wxDisplayFactorySingleX11; +} + +wxRect wxGetMainScreenWorkArea() +{ + wxRect rect; + + Display * const dpy = wxGetX11Display(); + wxCHECK_MSG( dpy, rect, "can't be called before initializing the GUI" ); + + wxGetWorkAreaX11(DefaultScreenOfDisplay(dpy), + rect.x, rect.y, rect.width, rect.height); + + const wxRect rectFull = wxDisplay().GetGeometry(); + + if ( !rect.width || !rect.height ) { // _NET_WORKAREA not available or didn't work, fall back to the total // display size. - rectClient = rectFull; + rect = rectFull; } else { - rectClient = rectClient.Intersect(rectFull); + // Although _NET_WORKAREA is supposed to return the client size of the + // screen, not all implementations are conforming, apparently, see + // #14419, so make sure we return a subset of the primary display. + rect = rect.Intersect(rectFull); } - if ( x ) - *x = rectClient.x; - if ( y ) - *y = rectClient.y; - if ( width ) - *width = rectClient.width; - if ( height ) - *height = rectClient.height; + return rect; } -#endif // !__WXGTK20__ diff --git a/src/x11/utils.cpp b/src/x11/utils.cpp index bd80ba5769..16e7995eba 100644 --- a/src/x11/utils.cpp +++ b/src/x11/utils.cpp @@ -148,41 +148,6 @@ void wxGetMousePosition( int* x, int* y ) #endif }; -// Return true if we have a colour display -bool wxColourDisplay() -{ - return wxDisplayDepth() > 1; -} - -// Returns depth of screen -int wxDisplayDepth() -{ - Display *dpy = (Display*) wxGetDisplay(); - - return DefaultDepth (dpy, DefaultScreen (dpy)); -} - -// Get size of display -void wxDisplaySize(int *width, int *height) -{ - Display *dpy = (Display*) wxGetDisplay(); - - if ( width ) - *width = DisplayWidth (dpy, DefaultScreen (dpy)); - if ( height ) - *height = DisplayHeight (dpy, DefaultScreen (dpy)); -} - -void wxDisplaySizeMM(int *width, int *height) -{ - Display *dpy = (Display*) wxGetDisplay(); - - if ( width ) - *width = DisplayWidthMM(dpy, DefaultScreen (dpy)); - if ( height ) - *height = DisplayHeightMM(dpy, DefaultScreen (dpy)); -} - wxWindow* wxFindWindowAtPoint(const wxPoint& pt) { return wxGenericFindWindowAtPoint(pt); diff --git a/tests/benchmarks/Makefile.in b/tests/benchmarks/Makefile.in index 401b6e54b8..ab8a00ec9d 100644 --- a/tests/benchmarks/Makefile.in +++ b/tests/benchmarks/Makefile.in @@ -64,6 +64,7 @@ BENCH_GUI_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \ BENCH_GUI_OBJECTS = \ $(__bench_gui___win32rc) \ bench_gui_bench.o \ + bench_gui_display.o \ bench_gui_image.o BENCH_GRAPHICS_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \ $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \ @@ -306,6 +307,9 @@ bench_gui_sample_rc.o: $(srcdir)/../../samples/sample.rc bench_gui_bench.o: $(srcdir)/bench.cpp $(CXXC) -c -o $@ $(BENCH_GUI_CXXFLAGS) $(srcdir)/bench.cpp +bench_gui_display.o: $(srcdir)/display.cpp + $(CXXC) -c -o $@ $(BENCH_GUI_CXXFLAGS) $(srcdir)/display.cpp + bench_gui_image.o: $(srcdir)/image.cpp $(CXXC) -c -o $@ $(BENCH_GUI_CXXFLAGS) $(srcdir)/image.cpp diff --git a/tests/benchmarks/bench.bkl b/tests/benchmarks/bench.bkl index acf774a861..f3efa94295 100644 --- a/tests/benchmarks/bench.bkl +++ b/tests/benchmarks/bench.bkl @@ -36,6 +36,7 @@ bench.cpp + display.cpp image.cpp core diff --git a/tests/benchmarks/bench_vc7_bench_gui.vcproj b/tests/benchmarks/bench_vc7_bench_gui.vcproj index 6556d7d2cf..d5393ca7ff 100644 --- a/tests/benchmarks/bench_vc7_bench_gui.vcproj +++ b/tests/benchmarks/bench_vc7_bench_gui.vcproj @@ -286,6 +286,9 @@ + + diff --git a/tests/benchmarks/bench_vc8_bench_gui.vcproj b/tests/benchmarks/bench_vc8_bench_gui.vcproj index 323f786d9f..fe30ed5fd1 100644 --- a/tests/benchmarks/bench_vc8_bench_gui.vcproj +++ b/tests/benchmarks/bench_vc8_bench_gui.vcproj @@ -810,6 +810,10 @@ RelativePath=".\bench.cpp" >
+ + diff --git a/tests/benchmarks/bench_vc9_bench_gui.vcproj b/tests/benchmarks/bench_vc9_bench_gui.vcproj index 45fc9f54ac..6f9f17cf00 100644 --- a/tests/benchmarks/bench_vc9_bench_gui.vcproj +++ b/tests/benchmarks/bench_vc9_bench_gui.vcproj @@ -782,6 +782,10 @@ RelativePath=".\bench.cpp" > + + diff --git a/tests/benchmarks/display.cpp b/tests/benchmarks/display.cpp new file mode 100644 index 0000000000..d9ad2cb7d5 --- /dev/null +++ b/tests/benchmarks/display.cpp @@ -0,0 +1,30 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: tests/benchmarks/display.cpp +// Purpose: wxDisplay benchmarks +// Author: Vadim Zeitlin +// Created: 2018-09-30 +// Copyright: (c) 2018 Vadim Zeitlin +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#include "wx/display.h" +#include "wx/gdicmn.h" + +#include "bench.h" + +BENCHMARK_FUNC(DisplaySize) +{ + int w, h; + wxDisplaySize(&w, &h); + return w > 0; +} + +BENCHMARK_FUNC(GetDisplaySize) +{ + return wxGetDisplaySize().x > 0; +} + +BENCHMARK_FUNC(DisplayGetGeometry) +{ + return wxDisplay().GetGeometry().GetSize().x > 0; +} diff --git a/tests/benchmarks/graphics.cpp b/tests/benchmarks/graphics.cpp index fd361bbffa..dd8aa48fca 100644 --- a/tests/benchmarks/graphics.cpp +++ b/tests/benchmarks/graphics.cpp @@ -99,11 +99,11 @@ struct GraphicsBenchmarkOptions useGL; #ifdef __WXMSW__ - enum GraphRenderer { Default, GDIPlus, Direct2D, Cairo }; + enum GraphicsRenderer { Default, GDIPlus, Direct2D, Cairo }; #else enum GraphicsRenderer { Default }; #endif // __WXMSW__ / !__WXMSW__ - GraphRenderer renderer; + GraphicsRenderer renderer; } opts; class GraphicsBenchmarkFrame : public wxFrame @@ -152,7 +152,9 @@ public: Connect(wxEVT_SIZE, wxSizeEventHandler(GraphicsBenchmarkFrame::OnSize)); m_bitmapARGB.Create(64, 64, 32); +#ifdef __WXMSW__ m_bitmapARGB.UseAlpha(true); +#endif // __WXMSW__ m_bitmapRGB.Create(64, 64, 24); m_renderer = NULL; @@ -320,8 +322,12 @@ private: BenchmarkDCAndGC("RGB memory", dc, gcdc); } { +#ifdef __WXMSW__ wxBitmap bmp(opts.width, opts.height, 32); bmp.UseAlpha(false); +#else // !__WXMSW__ + wxBitmap bmp(opts.width, opts.height, 24); +#endif // __WXMSW__/!__WXMSW__ wxMemoryDC dc(bmp); wxGCDC gcdc; if ( m_renderer ) @@ -333,7 +339,9 @@ private: } { wxBitmap bmp(opts.width, opts.height, 32); +#ifdef __WXMSW__ bmp.UseAlpha(true); +#endif // __WXMSW__ wxMemoryDC dc(bmp); wxGCDC gcdc; if ( m_renderer ) diff --git a/tests/benchmarks/htmlparser/htmlpars.cpp b/tests/benchmarks/htmlparser/htmlpars.cpp index 7a259a593d..5e0b2dc798 100644 --- a/tests/benchmarks/htmlparser/htmlpars.cpp +++ b/tests/benchmarks/htmlparser/htmlpars.cpp @@ -21,6 +21,7 @@ #include "wx/app.h" #endif +#include "wx/crt.h" #include "wx/tokenzr.h" #include "wx/wfstream.h" #include "wx/url.h" diff --git a/tests/benchmarks/htmlparser/htmltag.cpp b/tests/benchmarks/htmlparser/htmltag.cpp index 485e37fa58..7a76bff3e9 100644 --- a/tests/benchmarks/htmlparser/htmltag.cpp +++ b/tests/benchmarks/htmlparser/htmltag.cpp @@ -15,9 +15,8 @@ #include "htmltag.h" #include "htmlpars.h" -#include // for vsscanf -#include +#include "wx/crt.h" //----------------------------------------------------------------------------- // wx28HtmlTagsCache diff --git a/tests/benchmarks/makefile.bcc b/tests/benchmarks/makefile.bcc index b34d95adee..be62ce066f 100644 --- a/tests/benchmarks/makefile.bcc +++ b/tests/benchmarks/makefile.bcc @@ -54,6 +54,7 @@ BENCH_GUI_CXXFLAGS = $(__RUNTIME_LIBS) -I$(BCCDIR)\include $(__DEBUGINFO) \ $(__DLLFLAG_p) -I.\..\..\samples -DNOPCH $(CPPFLAGS) $(CXXFLAGS) BENCH_GUI_OBJECTS = \ $(OBJS)\bench_gui_bench.obj \ + $(OBJS)\bench_gui_display.obj \ $(OBJS)\bench_gui_image.obj BENCH_GRAPHICS_CXXFLAGS = $(__RUNTIME_LIBS) -I$(BCCDIR)\include $(__DEBUGINFO) \ $(__OPTIMIZEFLAG) $(__THREADSFLAG_1) -D__WXMSW__ $(__WXUNIV_DEFINE_p) \ @@ -340,6 +341,9 @@ $(OBJS)\bench_gui_sample.res: .\..\..\samples\sample.rc $(OBJS)\bench_gui_bench.obj: .\bench.cpp $(CXX) -q -c -P -o$@ $(BENCH_GUI_CXXFLAGS) .\bench.cpp +$(OBJS)\bench_gui_display.obj: .\display.cpp + $(CXX) -q -c -P -o$@ $(BENCH_GUI_CXXFLAGS) .\display.cpp + $(OBJS)\bench_gui_image.obj: .\image.cpp $(CXX) -q -c -P -o$@ $(BENCH_GUI_CXXFLAGS) .\image.cpp diff --git a/tests/benchmarks/makefile.gcc b/tests/benchmarks/makefile.gcc index 54948a8494..6546847f3f 100644 --- a/tests/benchmarks/makefile.gcc +++ b/tests/benchmarks/makefile.gcc @@ -49,6 +49,7 @@ BENCH_GUI_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZEFLAG) $(__THREADSFLAG) \ BENCH_GUI_OBJECTS = \ $(OBJS)\bench_gui_sample_rc.o \ $(OBJS)\bench_gui_bench.o \ + $(OBJS)\bench_gui_display.o \ $(OBJS)\bench_gui_image.o BENCH_GRAPHICS_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZEFLAG) $(__THREADSFLAG) \ $(GCCFLAGS) -DHAVE_W32API_H -D__WXMSW__ $(__WXUNIV_DEFINE_p) \ @@ -318,6 +319,9 @@ $(OBJS)\bench_gui_sample_rc.o: ./../../samples/sample.rc $(OBJS)\bench_gui_bench.o: ./bench.cpp $(CXX) -c -o $@ $(BENCH_GUI_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\bench_gui_display.o: ./display.cpp + $(CXX) -c -o $@ $(BENCH_GUI_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\bench_gui_image.o: ./image.cpp $(CXX) -c -o $@ $(BENCH_GUI_CXXFLAGS) $(CPPDEPS) $< diff --git a/tests/benchmarks/makefile.vc b/tests/benchmarks/makefile.vc index 784e045c6c..3dbf2a2da8 100644 --- a/tests/benchmarks/makefile.vc +++ b/tests/benchmarks/makefile.vc @@ -51,6 +51,7 @@ BENCH_GUI_CXXFLAGS = /M$(__RUNTIME_LIBS_26)$(__DEBUGRUNTIME) /DWIN32 \ /DNOPCH /D_CONSOLE $(__RTTIFLAG) $(__EXCEPTIONSFLAG) $(CPPFLAGS) $(CXXFLAGS) BENCH_GUI_OBJECTS = \ $(OBJS)\bench_gui_bench.obj \ + $(OBJS)\bench_gui_display.obj \ $(OBJS)\bench_gui_image.obj BENCH_GUI_RESOURCES = \ $(OBJS)\bench_gui_sample.res @@ -512,6 +513,9 @@ $(OBJS)\bench_gui_sample.res: .\..\..\samples\sample.rc $(OBJS)\bench_gui_bench.obj: .\bench.cpp $(CXX) /c /nologo /TP /Fo$@ $(BENCH_GUI_CXXFLAGS) .\bench.cpp +$(OBJS)\bench_gui_display.obj: .\display.cpp + $(CXX) /c /nologo /TP /Fo$@ $(BENCH_GUI_CXXFLAGS) .\display.cpp + $(OBJS)\bench_gui_image.obj: .\image.cpp $(CXX) /c /nologo /TP /Fo$@ $(BENCH_GUI_CXXFLAGS) .\image.cpp diff --git a/tests/controls/textctrltest.cpp b/tests/controls/textctrltest.cpp index 753890f85c..7d594ca77a 100644 --- a/tests/controls/textctrltest.cpp +++ b/tests/controls/textctrltest.cpp @@ -65,19 +65,9 @@ private: // Now switch to the multi-line text controls. CPPUNIT_TEST( PseudoTestSwitchToMultiLineStyle ); - // Rerun some of the tests above. Notice that not all of them pass, so - // we can't just use wxTEXT_ENTRY_TESTS() here. For some of them it's - // normal, e.g. Hint() test isn't supposed to work for multi-line - // controls. Others, such as InsertionPoint() and TextChangeEvents() - // don't pass neither but this could be a bug. - CPPUNIT_TEST( SetValue ); - CPPUNIT_TEST( Selection ); - CPPUNIT_TEST( InsertionPoint ); - CPPUNIT_TEST( Replace ); - WXUISIM_TEST( Editable ); - CPPUNIT_TEST( CopyPaste ); - CPPUNIT_TEST( UndoRedo ); - + // Rerun the text entry tests not specific to single line controls for + // multiline ones now. + wxTEXT_ENTRY_TESTS(); SINGLE_AND_MULTI_TESTS(); diff --git a/tests/controls/textentrytest.cpp b/tests/controls/textentrytest.cpp index 96b121de84..8bf279c2fc 100644 --- a/tests/controls/textentrytest.cpp +++ b/tests/controls/textentrytest.cpp @@ -83,6 +83,18 @@ void TextEntryTestCase::TextChangeEvents() entry->Clear(); CPPUNIT_ASSERT_EQUAL( 1, updated.GetCount() ); updated.Clear(); + + entry->ChangeValue(""); + CPPUNIT_ASSERT_EQUAL( 0, updated.GetCount() ); + updated.Clear(); + + entry->ChangeValue("non-empty"); + CPPUNIT_ASSERT_EQUAL( 0, updated.GetCount() ); + updated.Clear(); + + entry->ChangeValue(""); + CPPUNIT_ASSERT_EQUAL( 0, updated.GetCount() ); + updated.Clear(); } void TextEntryTestCase::CheckStringSelection(const char *sel) diff --git a/wx-config.in b/wx-config.in index 3b347fa85b..d132e3182f 100755 --- a/wx-config.in +++ b/wx-config.in @@ -1029,6 +1029,7 @@ ldlibs_base="@WXCONFIG_LIBS@" ldlibs_core="@EXTRALIBS_GUI@ @EXTRALIBS_SDL@" ldlibs_gl="@OPENGL_LIBS@" ldlibs_html="@EXTRALIBS_HTML@" +ldlibs_media="@EXTRALIBS_MEDIA@" ldlibs_xml="@EXTRALIBS_XML@" ldlibs_stc="@EXTRALIBS_STC@" ldlibs_webview="@EXTRALIBS_WEBVIEW@" @@ -1241,6 +1242,10 @@ else # MONOLITHIC = 0 fi fi + # Existing scripts may use "wx-config --libs std,adv" or similar, but "adv" + # library is not used any longer. + wx_libs=`remove_field adv $wx_libs` + if [ -n "$output_option_libs" ]; then using_gui=no for i in $wx_libs ; do