From fceac6bbfe23180d460ef62dac83c591d9e0f941 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 20 Dec 2011 21:27:14 +0000 Subject: [PATCH] Provide native implementation of wx{Date,Time}PickerCtrl for wxOSX/Cocoa. Use NSDatePicker to implement both of these controls. Almost all of wxDatePickerCtrl styles are not supported in the native version but the basic functionality does work and looks much better than the generic version (which is still available as wxDatePickerCtrlGeneric if needed) under Mac. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70071 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- Makefile.in | 99 ++++++++-- build/bakefiles/files.bkl | 7 + docs/changes.txt | 4 + docs/doxygen/images/wxmac/datepickerctrl.png | Bin 2927 -> 1791 bytes docs/doxygen/images/wxmac/timepickerctrl.png | Bin 0 -> 2292 bytes include/wx/datectrl.h | 4 + include/wx/datetimectrl.h | 4 +- include/wx/osx/core/private/datetimectrl.h | 71 ++++++++ include/wx/osx/datectrl.h | 55 ++++++ include/wx/osx/datetimectrl.h | 34 ++++ include/wx/osx/timectrl.h | 51 ++++++ include/wx/timectrl.h | 4 + interface/wx/datectrl.h | 18 +- src/osx/cocoa/datetimectrl.mm | 179 +++++++++++++++++++ src/osx/datectrl_osx.cpp | 90 ++++++++++ src/osx/datetimectrl_osx.cpp | 55 ++++++ src/osx/timectrl_osx.cpp | 80 +++++++++ 17 files changed, 732 insertions(+), 23 deletions(-) create mode 100644 docs/doxygen/images/wxmac/timepickerctrl.png create mode 100644 include/wx/osx/core/private/datetimectrl.h create mode 100644 include/wx/osx/datectrl.h create mode 100644 include/wx/osx/datetimectrl.h create mode 100644 include/wx/osx/timectrl.h create mode 100644 src/osx/cocoa/datetimectrl.mm create mode 100644 src/osx/datectrl_osx.cpp create mode 100644 src/osx/datetimectrl_osx.cpp create mode 100644 src/osx/timectrl_osx.cpp diff --git a/Makefile.in b/Makefile.in index e26323cdec..cfc19f622e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -3691,11 +3691,14 @@ COND_TOOLKIT_OSX_CARBON_ADVANCED_PLATFORM_HDR = \ COND_TOOLKIT_OSX_COCOA_ADVANCED_PLATFORM_HDR = \ wx/generic/animate.h \ wx/osx/dataview.h \ + wx/osx/datectrl.h \ + wx/osx/datetimectrl.h \ wx/osx/dvrenderer.h \ wx/osx/dvrenderers.h \ wx/osx/joystick.h \ wx/osx/sound.h \ wx/osx/taskbarosx.h \ + wx/osx/timectrl.h \ wx/osx/core/joystick.h \ wx/osx/cocoa/dataview.h @COND_TOOLKIT_OSX_COCOA@ADVANCED_PLATFORM_HDR = $(COND_TOOLKIT_OSX_COCOA_ADVANCED_PLATFORM_HDR) @@ -6247,7 +6250,7 @@ COND_TOOLKIT_MSW___ADVANCED_PLATFORM_NATIVE_SRC_OBJECTS = \ monodll_commandlinkbutton.o \ monodll_datecontrols.o \ monodll_datectrl.o \ - monodll_datetimectrl.o \ + monodll_msw_datetimectrl.o \ monodll_msw_hyperlink.o \ monodll_timectrl.o @COND_TOOLKIT_MSW@__ADVANCED_PLATFORM_NATIVE_SRC_OBJECTS = $(COND_TOOLKIT_MSW___ADVANCED_PLATFORM_NATIVE_SRC_OBJECTS) @@ -6258,7 +6261,7 @@ COND_TOOLKIT_WINCE___ADVANCED_PLATFORM_NATIVE_SRC_OBJECTS = \ monodll_commandlinkbutton.o \ monodll_datecontrols.o \ monodll_datectrl.o \ - monodll_datetimectrl.o \ + monodll_msw_datetimectrl.o \ monodll_msw_hyperlink.o \ monodll_timectrl.o @COND_TOOLKIT_WINCE@__ADVANCED_PLATFORM_NATIVE_SRC_OBJECTS = $(COND_TOOLKIT_WINCE___ADVANCED_PLATFORM_NATIVE_SRC_OBJECTS) @@ -8205,7 +8208,7 @@ COND_TOOLKIT_MSW___ADVANCED_PLATFORM_NATIVE_SRC_OBJECTS_1 = \ monolib_commandlinkbutton.o \ monolib_datecontrols.o \ monolib_datectrl.o \ - monolib_datetimectrl.o \ + monolib_msw_datetimectrl.o \ monolib_msw_hyperlink.o \ monolib_timectrl.o @COND_TOOLKIT_MSW@__ADVANCED_PLATFORM_NATIVE_SRC_OBJECTS_1 = $(COND_TOOLKIT_MSW___ADVANCED_PLATFORM_NATIVE_SRC_OBJECTS_1) @@ -8216,7 +8219,7 @@ COND_TOOLKIT_WINCE___ADVANCED_PLATFORM_NATIVE_SRC_OBJECTS_1 = \ monolib_commandlinkbutton.o \ monolib_datecontrols.o \ monolib_datectrl.o \ - monolib_datetimectrl.o \ + monolib_msw_datetimectrl.o \ monolib_msw_hyperlink.o \ monolib_timectrl.o @COND_TOOLKIT_WINCE@__ADVANCED_PLATFORM_NATIVE_SRC_OBJECTS_1 = $(COND_TOOLKIT_WINCE___ADVANCED_PLATFORM_NATIVE_SRC_OBJECTS_1) @@ -12005,7 +12008,7 @@ COND_TOOLKIT_MSW___ADVANCED_PLATFORM_NATIVE_SRC_OBJECTS_2 = \ advdll_commandlinkbutton.o \ advdll_datecontrols.o \ advdll_datectrl.o \ - advdll_datetimectrl.o \ + advdll_msw_datetimectrl.o \ advdll_msw_hyperlink.o \ advdll_timectrl.o @COND_TOOLKIT_MSW@__ADVANCED_PLATFORM_NATIVE_SRC_OBJECTS_2 = $(COND_TOOLKIT_MSW___ADVANCED_PLATFORM_NATIVE_SRC_OBJECTS_2) @@ -12016,7 +12019,7 @@ COND_TOOLKIT_WINCE___ADVANCED_PLATFORM_NATIVE_SRC_OBJECTS_2 = \ advdll_commandlinkbutton.o \ advdll_datecontrols.o \ advdll_datectrl.o \ - advdll_datetimectrl.o \ + advdll_msw_datetimectrl.o \ advdll_msw_hyperlink.o \ advdll_timectrl.o @COND_TOOLKIT_WINCE@__ADVANCED_PLATFORM_NATIVE_SRC_OBJECTS_2 = $(COND_TOOLKIT_WINCE___ADVANCED_PLATFORM_NATIVE_SRC_OBJECTS_2) @@ -12123,7 +12126,7 @@ COND_TOOLKIT_MSW___ADVANCED_PLATFORM_NATIVE_SRC_OBJECTS_3 = \ advlib_commandlinkbutton.o \ advlib_datecontrols.o \ advlib_datectrl.o \ - advlib_datetimectrl.o \ + advlib_msw_datetimectrl.o \ advlib_msw_hyperlink.o \ advlib_timectrl.o @COND_TOOLKIT_MSW@__ADVANCED_PLATFORM_NATIVE_SRC_OBJECTS_3 = $(COND_TOOLKIT_MSW___ADVANCED_PLATFORM_NATIVE_SRC_OBJECTS_3) @@ -12134,7 +12137,7 @@ COND_TOOLKIT_WINCE___ADVANCED_PLATFORM_NATIVE_SRC_OBJECTS_3 = \ advlib_commandlinkbutton.o \ advlib_datecontrols.o \ advlib_datectrl.o \ - advlib_datetimectrl.o \ + advlib_msw_datetimectrl.o \ advlib_msw_hyperlink.o \ advlib_timectrl.o @COND_TOOLKIT_WINCE@__ADVANCED_PLATFORM_NATIVE_SRC_OBJECTS_3 = $(COND_TOOLKIT_WINCE___ADVANCED_PLATFORM_NATIVE_SRC_OBJECTS_3) @@ -13407,12 +13410,16 @@ COND_TOOLKIT_OSX_CARBON___ADVANCED_PLATFORM_SRC_OBJECTS = \ COND_TOOLKIT_OSX_COCOA___ADVANCED_PLATFORM_SRC_OBJECTS = \ monodll_taskbarcmn.o \ monodll_animateg.o \ + monodll_datetimectrl_osx.o \ + monodll_datectrl_osx.o \ monodll_sound_osx.o \ + monodll_timectrl_osx.o \ monodll_carbon_sound.o \ monodll_core_sound.o \ monodll_cocoa_aboutdlg.o \ monodll_dataview_osx.o \ monodll_cocoa_dataview.o \ + monodll_cocoa_datetimectrl.o \ monodll_osx_cocoa_taskbar.o \ monodll_hidjoystick.o @COND_TOOLKIT_OSX_COCOA@__ADVANCED_PLATFORM_SRC_OBJECTS = $(COND_TOOLKIT_OSX_COCOA___ADVANCED_PLATFORM_SRC_OBJECTS) @@ -13595,12 +13602,16 @@ COND_TOOLKIT_OSX_CARBON___ADVANCED_PLATFORM_SRC_OBJECTS_0 = \ COND_TOOLKIT_OSX_COCOA___ADVANCED_PLATFORM_SRC_OBJECTS_0 = \ monolib_taskbarcmn.o \ monolib_animateg.o \ + monolib_datetimectrl_osx.o \ + monolib_datectrl_osx.o \ monolib_sound_osx.o \ + monolib_timectrl_osx.o \ monolib_carbon_sound.o \ monolib_core_sound.o \ monolib_cocoa_aboutdlg.o \ monolib_dataview_osx.o \ monolib_cocoa_dataview.o \ + monolib_cocoa_datetimectrl.o \ monolib_osx_cocoa_taskbar.o \ monolib_hidjoystick.o @COND_TOOLKIT_OSX_COCOA@__ADVANCED_PLATFORM_SRC_OBJECTS_0 = $(COND_TOOLKIT_OSX_COCOA___ADVANCED_PLATFORM_SRC_OBJECTS_0) @@ -13881,12 +13892,16 @@ COND_TOOLKIT_OSX_CARBON___ADVANCED_PLATFORM_SRC_OBJECTS_8 = \ COND_TOOLKIT_OSX_COCOA___ADVANCED_PLATFORM_SRC_OBJECTS_8 = \ advdll_taskbarcmn.o \ advdll_animateg.o \ + advdll_datetimectrl_osx.o \ + advdll_datectrl_osx.o \ advdll_sound_osx.o \ + advdll_timectrl_osx.o \ advdll_carbon_sound.o \ advdll_core_sound.o \ advdll_cocoa_aboutdlg.o \ advdll_dataview_osx.o \ advdll_cocoa_dataview.o \ + advdll_cocoa_datetimectrl.o \ advdll_osx_cocoa_taskbar.o \ advdll_hidjoystick.o @COND_TOOLKIT_OSX_COCOA@__ADVANCED_PLATFORM_SRC_OBJECTS_8 = $(COND_TOOLKIT_OSX_COCOA___ADVANCED_PLATFORM_SRC_OBJECTS_8) @@ -13971,12 +13986,16 @@ COND_TOOLKIT_OSX_CARBON___ADVANCED_PLATFORM_SRC_OBJECTS_9 = \ COND_TOOLKIT_OSX_COCOA___ADVANCED_PLATFORM_SRC_OBJECTS_9 = \ advlib_taskbarcmn.o \ advlib_animateg.o \ + advlib_datetimectrl_osx.o \ + advlib_datectrl_osx.o \ advlib_sound_osx.o \ + advlib_timectrl_osx.o \ advlib_carbon_sound.o \ advlib_core_sound.o \ advlib_cocoa_aboutdlg.o \ advlib_dataview_osx.o \ advlib_cocoa_dataview.o \ + advlib_cocoa_datetimectrl.o \ advlib_osx_cocoa_taskbar.o \ advlib_hidjoystick.o @COND_TOOLKIT_OSX_COCOA@__ADVANCED_PLATFORM_SRC_OBJECTS_9 = $(COND_TOOLKIT_OSX_COCOA___ADVANCED_PLATFORM_SRC_OBJECTS_9) @@ -20906,6 +20925,15 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP) @COND_TOOLKIT_COCOA_USE_GUI_1@monodll_hidjoystick.o: $(srcdir)/src/osx/core/hidjoystick.cpp $(MONODLL_ODEP) @COND_TOOLKIT_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/osx/core/hidjoystick.cpp +@COND_TOOLKIT_OSX_COCOA_USE_GUI_1@monodll_datetimectrl_osx.o: $(srcdir)/src/osx/datetimectrl_osx.cpp $(MONODLL_ODEP) +@COND_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/osx/datetimectrl_osx.cpp + +@COND_TOOLKIT_OSX_COCOA_USE_GUI_1@monodll_datectrl_osx.o: $(srcdir)/src/osx/datectrl_osx.cpp $(MONODLL_ODEP) +@COND_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/osx/datectrl_osx.cpp + +@COND_TOOLKIT_OSX_COCOA_USE_GUI_1@monodll_timectrl_osx.o: $(srcdir)/src/osx/timectrl_osx.cpp $(MONODLL_ODEP) +@COND_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/osx/timectrl_osx.cpp + @COND_TOOLKIT_OSX_COCOA_USE_GUI_1@monodll_core_sound.o: $(srcdir)/src/osx/core/sound.cpp $(MONODLL_ODEP) @COND_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/osx/core/sound.cpp @@ -20918,6 +20946,9 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP) @COND_TOOLKIT_OSX_COCOA_USE_GUI_1@monodll_cocoa_dataview.o: $(srcdir)/src/osx/cocoa/dataview.mm $(MONODLL_ODEP) @COND_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/dataview.mm +@COND_TOOLKIT_OSX_COCOA_USE_GUI_1@monodll_cocoa_datetimectrl.o: $(srcdir)/src/osx/cocoa/datetimectrl.mm $(MONODLL_ODEP) +@COND_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/datetimectrl.mm + @COND_TOOLKIT_OSX_COCOA_USE_GUI_1@monodll_osx_cocoa_taskbar.o: $(srcdir)/src/osx/cocoa/taskbar.mm $(MONODLL_ODEP) @COND_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/taskbar.mm @@ -21020,10 +21051,10 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP) @COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@monodll_datectrl.o: $(srcdir)/src/msw/datectrl.cpp $(MONODLL_ODEP) @COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/datectrl.cpp -@COND_TOOLKIT_MSW_USE_GUI_1_WXUNIV_0@monodll_datetimectrl.o: $(srcdir)/src/msw/datetimectrl.cpp $(MONODLL_ODEP) +@COND_TOOLKIT_MSW_USE_GUI_1_WXUNIV_0@monodll_msw_datetimectrl.o: $(srcdir)/src/msw/datetimectrl.cpp $(MONODLL_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/datetimectrl.cpp -@COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@monodll_datetimectrl.o: $(srcdir)/src/msw/datetimectrl.cpp $(MONODLL_ODEP) +@COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@monodll_msw_datetimectrl.o: $(srcdir)/src/msw/datetimectrl.cpp $(MONODLL_ODEP) @COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/datetimectrl.cpp @COND_TOOLKIT_MSW_USE_GUI_1_WXUNIV_0@monodll_msw_hyperlink.o: $(srcdir)/src/msw/hyperlink.cpp $(MONODLL_ODEP) @@ -26294,6 +26325,15 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_COCOA_USE_GUI_1@monolib_hidjoystick.o: $(srcdir)/src/osx/core/hidjoystick.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/osx/core/hidjoystick.cpp +@COND_TOOLKIT_OSX_COCOA_USE_GUI_1@monolib_datetimectrl_osx.o: $(srcdir)/src/osx/datetimectrl_osx.cpp $(MONOLIB_ODEP) +@COND_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/osx/datetimectrl_osx.cpp + +@COND_TOOLKIT_OSX_COCOA_USE_GUI_1@monolib_datectrl_osx.o: $(srcdir)/src/osx/datectrl_osx.cpp $(MONOLIB_ODEP) +@COND_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/osx/datectrl_osx.cpp + +@COND_TOOLKIT_OSX_COCOA_USE_GUI_1@monolib_timectrl_osx.o: $(srcdir)/src/osx/timectrl_osx.cpp $(MONOLIB_ODEP) +@COND_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/osx/timectrl_osx.cpp + @COND_TOOLKIT_OSX_COCOA_USE_GUI_1@monolib_core_sound.o: $(srcdir)/src/osx/core/sound.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/osx/core/sound.cpp @@ -26306,6 +26346,9 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_OSX_COCOA_USE_GUI_1@monolib_cocoa_dataview.o: $(srcdir)/src/osx/cocoa/dataview.mm $(MONOLIB_ODEP) @COND_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/dataview.mm +@COND_TOOLKIT_OSX_COCOA_USE_GUI_1@monolib_cocoa_datetimectrl.o: $(srcdir)/src/osx/cocoa/datetimectrl.mm $(MONOLIB_ODEP) +@COND_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/datetimectrl.mm + @COND_TOOLKIT_OSX_COCOA_USE_GUI_1@monolib_osx_cocoa_taskbar.o: $(srcdir)/src/osx/cocoa/taskbar.mm $(MONOLIB_ODEP) @COND_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/taskbar.mm @@ -26408,10 +26451,10 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@monolib_datectrl.o: $(srcdir)/src/msw/datectrl.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/datectrl.cpp -@COND_TOOLKIT_MSW_USE_GUI_1_WXUNIV_0@monolib_datetimectrl.o: $(srcdir)/src/msw/datetimectrl.cpp $(MONOLIB_ODEP) +@COND_TOOLKIT_MSW_USE_GUI_1_WXUNIV_0@monolib_msw_datetimectrl.o: $(srcdir)/src/msw/datetimectrl.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/datetimectrl.cpp -@COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@monolib_datetimectrl.o: $(srcdir)/src/msw/datetimectrl.cpp $(MONOLIB_ODEP) +@COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@monolib_msw_datetimectrl.o: $(srcdir)/src/msw/datetimectrl.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/datetimectrl.cpp @COND_TOOLKIT_MSW_USE_GUI_1_WXUNIV_0@monolib_msw_hyperlink.o: $(srcdir)/src/msw/hyperlink.cpp $(MONOLIB_ODEP) @@ -35882,6 +35925,15 @@ advdll_wizard.o: $(srcdir)/src/generic/wizard.cpp $(ADVDLL_ODEP) @COND_TOOLKIT_COCOA@advdll_hidjoystick.o: $(srcdir)/src/osx/core/hidjoystick.cpp $(ADVDLL_ODEP) @COND_TOOLKIT_COCOA@ $(CXXC) -c -o $@ $(ADVDLL_CXXFLAGS) $(srcdir)/src/osx/core/hidjoystick.cpp +@COND_TOOLKIT_OSX_COCOA@advdll_datetimectrl_osx.o: $(srcdir)/src/osx/datetimectrl_osx.cpp $(ADVDLL_ODEP) +@COND_TOOLKIT_OSX_COCOA@ $(CXXC) -c -o $@ $(ADVDLL_CXXFLAGS) $(srcdir)/src/osx/datetimectrl_osx.cpp + +@COND_TOOLKIT_OSX_COCOA@advdll_datectrl_osx.o: $(srcdir)/src/osx/datectrl_osx.cpp $(ADVDLL_ODEP) +@COND_TOOLKIT_OSX_COCOA@ $(CXXC) -c -o $@ $(ADVDLL_CXXFLAGS) $(srcdir)/src/osx/datectrl_osx.cpp + +@COND_TOOLKIT_OSX_COCOA@advdll_timectrl_osx.o: $(srcdir)/src/osx/timectrl_osx.cpp $(ADVDLL_ODEP) +@COND_TOOLKIT_OSX_COCOA@ $(CXXC) -c -o $@ $(ADVDLL_CXXFLAGS) $(srcdir)/src/osx/timectrl_osx.cpp + @COND_TOOLKIT_OSX_COCOA@advdll_core_sound.o: $(srcdir)/src/osx/core/sound.cpp $(ADVDLL_ODEP) @COND_TOOLKIT_OSX_COCOA@ $(CXXC) -c -o $@ $(ADVDLL_CXXFLAGS) $(srcdir)/src/osx/core/sound.cpp @@ -35894,6 +35946,9 @@ advdll_wizard.o: $(srcdir)/src/generic/wizard.cpp $(ADVDLL_ODEP) @COND_TOOLKIT_OSX_COCOA@advdll_cocoa_dataview.o: $(srcdir)/src/osx/cocoa/dataview.mm $(ADVDLL_ODEP) @COND_TOOLKIT_OSX_COCOA@ $(CXXC) -c -o $@ $(ADVDLL_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/dataview.mm +@COND_TOOLKIT_OSX_COCOA@advdll_cocoa_datetimectrl.o: $(srcdir)/src/osx/cocoa/datetimectrl.mm $(ADVDLL_ODEP) +@COND_TOOLKIT_OSX_COCOA@ $(CXXC) -c -o $@ $(ADVDLL_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/datetimectrl.mm + @COND_TOOLKIT_OSX_COCOA@advdll_osx_cocoa_taskbar.o: $(srcdir)/src/osx/cocoa/taskbar.mm $(ADVDLL_ODEP) @COND_TOOLKIT_OSX_COCOA@ $(CXXC) -c -o $@ $(ADVDLL_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/taskbar.mm @@ -35996,10 +36051,10 @@ advdll_wizard.o: $(srcdir)/src/generic/wizard.cpp $(ADVDLL_ODEP) @COND_TOOLKIT_WINCE_WXUNIV_0@advdll_datectrl.o: $(srcdir)/src/msw/datectrl.cpp $(ADVDLL_ODEP) @COND_TOOLKIT_WINCE_WXUNIV_0@ $(CXXC) -c -o $@ $(ADVDLL_CXXFLAGS) $(srcdir)/src/msw/datectrl.cpp -@COND_TOOLKIT_MSW_WXUNIV_0@advdll_datetimectrl.o: $(srcdir)/src/msw/datetimectrl.cpp $(ADVDLL_ODEP) +@COND_TOOLKIT_MSW_WXUNIV_0@advdll_msw_datetimectrl.o: $(srcdir)/src/msw/datetimectrl.cpp $(ADVDLL_ODEP) @COND_TOOLKIT_MSW_WXUNIV_0@ $(CXXC) -c -o $@ $(ADVDLL_CXXFLAGS) $(srcdir)/src/msw/datetimectrl.cpp -@COND_TOOLKIT_WINCE_WXUNIV_0@advdll_datetimectrl.o: $(srcdir)/src/msw/datetimectrl.cpp $(ADVDLL_ODEP) +@COND_TOOLKIT_WINCE_WXUNIV_0@advdll_msw_datetimectrl.o: $(srcdir)/src/msw/datetimectrl.cpp $(ADVDLL_ODEP) @COND_TOOLKIT_WINCE_WXUNIV_0@ $(CXXC) -c -o $@ $(ADVDLL_CXXFLAGS) $(srcdir)/src/msw/datetimectrl.cpp @COND_TOOLKIT_MSW_WXUNIV_0@advdll_msw_hyperlink.o: $(srcdir)/src/msw/hyperlink.cpp $(ADVDLL_ODEP) @@ -36269,6 +36324,15 @@ advlib_wizard.o: $(srcdir)/src/generic/wizard.cpp $(ADVLIB_ODEP) @COND_TOOLKIT_COCOA@advlib_hidjoystick.o: $(srcdir)/src/osx/core/hidjoystick.cpp $(ADVLIB_ODEP) @COND_TOOLKIT_COCOA@ $(CXXC) -c -o $@ $(ADVLIB_CXXFLAGS) $(srcdir)/src/osx/core/hidjoystick.cpp +@COND_TOOLKIT_OSX_COCOA@advlib_datetimectrl_osx.o: $(srcdir)/src/osx/datetimectrl_osx.cpp $(ADVLIB_ODEP) +@COND_TOOLKIT_OSX_COCOA@ $(CXXC) -c -o $@ $(ADVLIB_CXXFLAGS) $(srcdir)/src/osx/datetimectrl_osx.cpp + +@COND_TOOLKIT_OSX_COCOA@advlib_datectrl_osx.o: $(srcdir)/src/osx/datectrl_osx.cpp $(ADVLIB_ODEP) +@COND_TOOLKIT_OSX_COCOA@ $(CXXC) -c -o $@ $(ADVLIB_CXXFLAGS) $(srcdir)/src/osx/datectrl_osx.cpp + +@COND_TOOLKIT_OSX_COCOA@advlib_timectrl_osx.o: $(srcdir)/src/osx/timectrl_osx.cpp $(ADVLIB_ODEP) +@COND_TOOLKIT_OSX_COCOA@ $(CXXC) -c -o $@ $(ADVLIB_CXXFLAGS) $(srcdir)/src/osx/timectrl_osx.cpp + @COND_TOOLKIT_OSX_COCOA@advlib_core_sound.o: $(srcdir)/src/osx/core/sound.cpp $(ADVLIB_ODEP) @COND_TOOLKIT_OSX_COCOA@ $(CXXC) -c -o $@ $(ADVLIB_CXXFLAGS) $(srcdir)/src/osx/core/sound.cpp @@ -36281,6 +36345,9 @@ advlib_wizard.o: $(srcdir)/src/generic/wizard.cpp $(ADVLIB_ODEP) @COND_TOOLKIT_OSX_COCOA@advlib_cocoa_dataview.o: $(srcdir)/src/osx/cocoa/dataview.mm $(ADVLIB_ODEP) @COND_TOOLKIT_OSX_COCOA@ $(CXXC) -c -o $@ $(ADVLIB_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/dataview.mm +@COND_TOOLKIT_OSX_COCOA@advlib_cocoa_datetimectrl.o: $(srcdir)/src/osx/cocoa/datetimectrl.mm $(ADVLIB_ODEP) +@COND_TOOLKIT_OSX_COCOA@ $(CXXC) -c -o $@ $(ADVLIB_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/datetimectrl.mm + @COND_TOOLKIT_OSX_COCOA@advlib_osx_cocoa_taskbar.o: $(srcdir)/src/osx/cocoa/taskbar.mm $(ADVLIB_ODEP) @COND_TOOLKIT_OSX_COCOA@ $(CXXC) -c -o $@ $(ADVLIB_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/taskbar.mm @@ -36383,10 +36450,10 @@ advlib_wizard.o: $(srcdir)/src/generic/wizard.cpp $(ADVLIB_ODEP) @COND_TOOLKIT_WINCE_WXUNIV_0@advlib_datectrl.o: $(srcdir)/src/msw/datectrl.cpp $(ADVLIB_ODEP) @COND_TOOLKIT_WINCE_WXUNIV_0@ $(CXXC) -c -o $@ $(ADVLIB_CXXFLAGS) $(srcdir)/src/msw/datectrl.cpp -@COND_TOOLKIT_MSW_WXUNIV_0@advlib_datetimectrl.o: $(srcdir)/src/msw/datetimectrl.cpp $(ADVLIB_ODEP) +@COND_TOOLKIT_MSW_WXUNIV_0@advlib_msw_datetimectrl.o: $(srcdir)/src/msw/datetimectrl.cpp $(ADVLIB_ODEP) @COND_TOOLKIT_MSW_WXUNIV_0@ $(CXXC) -c -o $@ $(ADVLIB_CXXFLAGS) $(srcdir)/src/msw/datetimectrl.cpp -@COND_TOOLKIT_WINCE_WXUNIV_0@advlib_datetimectrl.o: $(srcdir)/src/msw/datetimectrl.cpp $(ADVLIB_ODEP) +@COND_TOOLKIT_WINCE_WXUNIV_0@advlib_msw_datetimectrl.o: $(srcdir)/src/msw/datetimectrl.cpp $(ADVLIB_ODEP) @COND_TOOLKIT_WINCE_WXUNIV_0@ $(CXXC) -c -o $@ $(ADVLIB_CXXFLAGS) $(srcdir)/src/msw/datetimectrl.cpp @COND_TOOLKIT_MSW_WXUNIV_0@advlib_msw_hyperlink.o: $(srcdir)/src/msw/hyperlink.cpp $(ADVLIB_ODEP) diff --git a/build/bakefiles/files.bkl b/build/bakefiles/files.bkl index 327fa2e606..f27574f37e 100644 --- a/build/bakefiles/files.bkl +++ b/build/bakefiles/files.bkl @@ -3118,12 +3118,16 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! src/common/taskbarcmn.cpp src/generic/animateg.cpp + src/osx/datetimectrl_osx.cpp + src/osx/datectrl_osx.cpp src/osx/sound_osx.cpp + src/osx/timectrl_osx.cpp src/osx/carbon/sound.cpp src/osx/core/sound.cpp src/osx/cocoa/aboutdlg.mm src/osx/dataview_osx.cpp src/osx/cocoa/dataview.mm + src/osx/cocoa/datetimectrl.mm src/osx/cocoa/taskbar.mm src/osx/core/hidjoystick.cpp @@ -3131,11 +3135,14 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! wx/generic/animate.h wx/osx/dataview.h + wx/osx/datectrl.h + wx/osx/datetimectrl.h wx/osx/dvrenderer.h wx/osx/dvrenderers.h wx/osx/joystick.h wx/osx/sound.h wx/osx/taskbarosx.h + wx/osx/timectrl.h wx/osx/core/joystick.h wx/osx/cocoa/dataview.h diff --git a/docs/changes.txt b/docs/changes.txt index 36f74dd1f6..4dfbd21c21 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -460,6 +460,10 @@ MSW: - Fixed regression with initial focus in the dialogs in 2.9.3. - Added support for wxEXEC_MAKE_GROUP_LEADER to wxExecute (tteras). +OSX: + +- Provide native implementations of wxDatePickerCtrl and wxTimePickerCtrl. + 2.9.3: (released 2011-12-14) ------ diff --git a/docs/doxygen/images/wxmac/datepickerctrl.png b/docs/doxygen/images/wxmac/datepickerctrl.png index 51c989c78ca5f29ac4a601c439e75bd310671dfc..41b1e4aacde5e3f783aa0f477258f702d8306ec4 100644 GIT binary patch literal 1791 zcmVw)8{KAqS>o|{XJ@C!R{PMr|BoO^QX~>ty?Qlk#$vIirl#WJ;vGA76c!dLgBT13 zFI>3b^?DB@&Ubbu*#+YDCF!l!mot>SO(sSp|1p$CHK}38kzgb;)f#<;z`U6y4`2nEpV^^{WOL{$*+Xiw|D@&d*?tvz8y-{|>InSI}}^I=dk zcIMcJXGW7PacrpX+ty>1-7L2%Q7LP zuCDHjBz1LlM3xC5C^<$6pV^G|?fn3be%b%kdVf#T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Jfx~^OOl_i7_Lf7?YL_ zs&T*0auh|GHEULNb@hP*2Qo4;CQX_YJIdvpU%Pg#wzk%0vt?yv^*{2YwBLDgVq)Sw zEazTvkI#-qqt*qLiK@^fS5j71me1!qd-iM~5a66!R#}!^F4yGAlV{ABk(89w|G1lK zs^nCNVHjOqU4!cFHw)2d)G!RELNrxUDWQ~lJf3mm#?75O*Q%x#jSxa9wcG6uha;9g z0NAKRCpx7Rx2^JXBcum`-~(F7{eks=WTI2j>=FP;lAKOw?4)~SsFcv8ag-3a6XgG; z|7I$^5asbiwJK0w%H@@?I literal 0 HcmV?d00001 diff --git a/include/wx/datectrl.h b/include/wx/datectrl.h index d666a59a10..c579b81d98 100644 --- a/include/wx/datectrl.h +++ b/include/wx/datectrl.h @@ -83,6 +83,10 @@ public: #elif defined(__WXMSW__) && !defined(__WXUNIVERSAL__) #include "wx/msw/datectrl.h" + #define wxHAS_NATIVE_DATEPICKCTRL +#elif defined(__WXOSX_COCOA__) && !defined(__WXUNIVERSAL__) + #include "wx/osx/datectrl.h" + #define wxHAS_NATIVE_DATEPICKCTRL #else #include "wx/generic/datectrl.h" diff --git a/include/wx/datetimectrl.h b/include/wx/datetimectrl.h index 453c9174b5..a3bdac2d47 100644 --- a/include/wx/datetimectrl.h +++ b/include/wx/datetimectrl.h @@ -35,10 +35,10 @@ public: virtual wxDateTime GetValue() const = 0; }; -// Only MSW currently has any code to share between wxDatePickerCtrl and -// wxTimePickerCtrl, under the other platforms this class is trivial. #if defined(__WXMSW__) && !defined(__WXUNIVERSAL__) #include "wx/msw/datetimectrl.h" +#elif defined(__WXOSX_COCOA__) && !defined(__WXUNIVERSAL__) + #include "wx/osx/datetimectrl.h" #else typedef wxDateTimePickerCtrlBase wxDateTimePickerCtrl; #endif diff --git a/include/wx/osx/core/private/datetimectrl.h b/include/wx/osx/core/private/datetimectrl.h new file mode 100644 index 0000000000..ecb7b6531c --- /dev/null +++ b/include/wx/osx/core/private/datetimectrl.h @@ -0,0 +1,71 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: wx/osx/core/private/datetime.h +// Purpose: +// Author: Vadim Zeitlin +// Created: 2011-12-19 +// RCS-ID: $Id: wxhead.h,v 1.12 2010-04-22 12:44:51 zeitlin Exp $ +// Copyright: (c) 2011 Vadim Zeitlin +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_OSX_CORE_PRIVATE_DATETIMECTRL_H_ +#define _WX_OSX_CORE_PRIVATE_DATETIMECTRL_H_ + +#if wxUSE_DATEPICKCTRL + +#include "wx/osx/private.h" + +#include "wx/datetime.h" + +enum wxDateTimeWidgetKind +{ + wxDateTimeWidget_YearMonthDay, + wxDateTimeWidget_HourMinuteSecond +}; + +// ---------------------------------------------------------------------------- +// wxDateTimeWidgetImpl: peer class for wxDateTimePickerCtrl. +// ---------------------------------------------------------------------------- + +class wxDateTimeWidgetImpl +#if wxOSX_USE_COCOA + : public wxWidgetCocoaImpl +#elif wxOSX_USE_CARBON + : public wxMacControl +#else + #error "Unsupported platform" +#endif +{ +public: + static wxDateTimeWidgetImpl* + CreateDateTimePicker(wxDateTimePickerCtrl* wxpeer, + const wxDateTime& dt, + const wxPoint& pos, + const wxSize& size, + long style, + wxDateTimeWidgetKind kind); + + virtual void SetDateTime(const wxDateTime& dt) = 0; + virtual wxDateTime GetDateTime() const = 0; + + virtual void SetDateRange(const wxDateTime& dt1, const wxDateTime& dt2) = 0; + virtual bool GetDateRange(wxDateTime* dt1, wxDateTime* dt2) = 0; + + virtual ~wxDateTimeWidgetImpl() { } + +protected: +#if wxOSX_USE_COCOA + wxDateTimeWidgetImpl(wxDateTimePickerCtrl* wxpeer, WXWidget view) + : wxWidgetCocoaImpl(wxpeer, view) + { + } +#elif wxOSX_USE_CARBON + // There is no Carbon implementation of this control yet so we don't need + // any ctor for it yet but it should be added here if Carbon version is + // written later. +#endif +}; + +#endif // wxUSE_DATEPICKCTRL + +#endif // _WX_OSX_CORE_PRIVATE_DATETIMECTRL_H_ diff --git a/include/wx/osx/datectrl.h b/include/wx/osx/datectrl.h new file mode 100644 index 0000000000..e31ebc52a8 --- /dev/null +++ b/include/wx/osx/datectrl.h @@ -0,0 +1,55 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: wx/osx/datectrl.h +// Purpose: Declaration of wxOSX-specific wxDatePickerCtrl class. +// Author: Vadim Zeitlin +// Created: 2011-12-18 +// RCS-ID: $Id: wxhead.h,v 1.12 2010-04-22 12:44:51 zeitlin Exp $ +// Copyright: (c) 2011 Vadim Zeitlin +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_OSX_DATECTRL_H_ +#define _WX_OSX_DATECTRL_H_ + +// ---------------------------------------------------------------------------- +// wxDatePickerCtrl +// ---------------------------------------------------------------------------- + +class WXDLLIMPEXP_ADV wxDatePickerCtrl : public wxDatePickerCtrlBase +{ +public: + // Constructors. + wxDatePickerCtrl() { } + + wxDatePickerCtrl(wxWindow *parent, + wxWindowID id, + const wxDateTime& dt = wxDefaultDateTime, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxDP_DEFAULT | wxDP_SHOWCENTURY, + const wxValidator& validator = wxDefaultValidator, + const wxString& name = wxDatePickerCtrlNameStr) + { + Create(parent, id, dt, pos, size, style, validator, name); + } + + bool Create(wxWindow *parent, + wxWindowID id, + const wxDateTime& dt = wxDefaultDateTime, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxDP_DEFAULT | wxDP_SHOWCENTURY, + const wxValidator& validator = wxDefaultValidator, + const wxString& name = wxDatePickerCtrlNameStr); + + // Implement the base class pure virtuals. + virtual void SetRange(const wxDateTime& dt1, const wxDateTime& dt2); + virtual bool GetRange(wxDateTime *dt1, wxDateTime *dt2) const; + + virtual void OSXGenerateEvent(const wxDateTime& dt); + +private: + wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxDatePickerCtrl); +}; + +#endif // _WX_OSX_DATECTRL_H_ diff --git a/include/wx/osx/datetimectrl.h b/include/wx/osx/datetimectrl.h new file mode 100644 index 0000000000..d69e53ddf8 --- /dev/null +++ b/include/wx/osx/datetimectrl.h @@ -0,0 +1,34 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: wx/osx/datetimectrl.h +// Purpose: Declaration of wxOSX-specific wxDateTimePickerCtrl class. +// Author: Vadim Zeitlin +// Created: 2011-12-18 +// RCS-ID: $Id: wxhead.h,v 1.12 2010-04-22 12:44:51 zeitlin Exp $ +// Copyright: (c) 2011 Vadim Zeitlin +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_OSX_DATETIMECTRL_H_ +#define _WX_OSX_DATETIMECTRL_H_ + +class wxDateTimeWidgetImpl; + +// ---------------------------------------------------------------------------- +// wxDateTimePickerCtrl +// ---------------------------------------------------------------------------- + +class WXDLLIMPEXP_ADV wxDateTimePickerCtrl : public wxDateTimePickerCtrlBase +{ +public: + // Implement the base class pure virtuals. + virtual void SetValue(const wxDateTime& dt); + virtual wxDateTime GetValue() const; + + // Implementation only. + virtual void OSXGenerateEvent(const wxDateTime& dt) = 0; + +protected: + wxDateTimeWidgetImpl* GetDateTimePeer() const; +}; + +#endif // _WX_OSX_DATETIMECTRL_H_ diff --git a/include/wx/osx/timectrl.h b/include/wx/osx/timectrl.h new file mode 100644 index 0000000000..58d053c354 --- /dev/null +++ b/include/wx/osx/timectrl.h @@ -0,0 +1,51 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: wx/osx/timectrl.h +// Purpose: Declaration of wxOSX-specific wxTimePickerCtrl class. +// Author: Vadim Zeitlin +// Created: 2011-12-18 +// RCS-ID: $Id: wxhead.h,v 1.12 2010-04-22 12:44:51 zeitlin Exp $ +// Copyright: (c) 2011 Vadim Zeitlin +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_OSX_TIMECTRL_H_ +#define _WX_OSX_TIMECTRL_H_ + +// ---------------------------------------------------------------------------- +// wxTimePickerCtrl +// ---------------------------------------------------------------------------- + +class WXDLLIMPEXP_ADV wxTimePickerCtrl : public wxTimePickerCtrlBase +{ +public: + // Constructors. + wxTimePickerCtrl() { } + + wxTimePickerCtrl(wxWindow *parent, + wxWindowID id, + const wxDateTime& dt = wxDefaultDateTime, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxTP_DEFAULT, + const wxValidator& validator = wxDefaultValidator, + const wxString& name = wxTimePickerCtrlNameStr) + { + Create(parent, id, dt, pos, size, style, validator, name); + } + + bool Create(wxWindow *parent, + wxWindowID id, + const wxDateTime& dt = wxDefaultDateTime, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxTP_DEFAULT, + const wxValidator& validator = wxDefaultValidator, + const wxString& name = wxTimePickerCtrlNameStr); + + virtual void OSXGenerateEvent(const wxDateTime& dt); + +private: + wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxTimePickerCtrl); +}; + +#endif // _WX_OSX_TIMECTRL_H_ diff --git a/include/wx/timectrl.h b/include/wx/timectrl.h index 0bc9db79ca..4672675cee 100644 --- a/include/wx/timectrl.h +++ b/include/wx/timectrl.h @@ -58,6 +58,10 @@ public: #if defined(__WXMSW__) && !defined(__WXUNIVERSAL__) #include "wx/msw/timectrl.h" + #define wxHAS_NATIVE_TIMEPICKERCTRL +#elif defined(__WXOSX_COCOA__) && !defined(__WXUNIVERSAL__) + #include "wx/osx/timectrl.h" + #define wxHAS_NATIVE_TIMEPICKERCTRL #else #include "wx/generic/timectrl.h" diff --git a/interface/wx/datectrl.h b/interface/wx/datectrl.h index 32829e081a..feb241cd4e 100644 --- a/interface/wx/datectrl.h +++ b/interface/wx/datectrl.h @@ -25,21 +25,29 @@ style is not supported by the generic version. @style{wxDP_DROPDOWN} Creates a control with a month calendar drop-down part from which - the user can select a date. + the user can select a date. This style is not supported in OSX/Cocoa + native version. @style{wxDP_DEFAULT} Creates a control with the style that is best supported for the - current platform (currently wxDP_SPIN under Windows and - wxDP_DROPDOWN elsewhere). + current platform (currently wxDP_SPIN under Windows and OSX/Cocoa + and wxDP_DROPDOWN elsewhere). @style{wxDP_ALLOWNONE} With this style, the control allows the user to not enter any valid date at all. Without it - the default - the control always has some - valid date. + valid date. This style is not supported in OSX/Cocoa native version. @style{wxDP_SHOWCENTURY} Forces display of the century in the default date format. Without this style the century could be displayed, or not, depending on the - default date representation in the system. + default date representation in the system. This style is not + supported in OSX/Cocoa native version currently. @endStyleTable + As can be seen from the remarks above, most of the control style are only + supported in the native MSW implementation. In portable code it's + recommended to use @c wxDP_DEFAULT style only, possibly combined with @c + wxDP_SHOWCENTURY (this is also the style used by default if none is + specified). + @beginEventEmissionTable{wxDateEvent} @event{EVT_DATE_CHANGED(id, func)} This event fires when the user changes the current selection in the diff --git a/src/osx/cocoa/datetimectrl.mm b/src/osx/cocoa/datetimectrl.mm new file mode 100644 index 0000000000..4e8a44e894 --- /dev/null +++ b/src/osx/cocoa/datetimectrl.mm @@ -0,0 +1,179 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: src/osx/cocoa/datetimectrl.mm +// Purpose: Implementation of wxDateTimePickerCtrl for Cocoa. +// Author: Vadim Zeitlin +// Created: 2011-12-18 +// Version: $Id$ +// Copyright: (c) 2011 Vadim Zeitlin +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +// ============================================================================ +// declarations +// ============================================================================ + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#if wxUSE_DATEPICKCTRL + +#include "wx/datetimectrl.h" +#include "wx/datectrl.h" + +#include "wx/osx/core/private/datetimectrl.h" +#include "wx/osx/cocoa/private/date.h" + +using namespace wxOSXImpl; + +// ============================================================================ +// implementation +// ============================================================================ + +// ---------------------------------------------------------------------------- +// Cocoa wrappers +// ---------------------------------------------------------------------------- + +@interface wxNSDatePicker : NSDatePicker +{ +} + +@end + +@implementation wxNSDatePicker + ++ (void)initialize +{ + static BOOL initialized = NO; + if (!initialized) + { + initialized = YES; + wxOSXCocoaClassAddWXMethods( self ); + } +} + +@end + +// ---------------------------------------------------------------------------- +// Peer-specific subclass +// ---------------------------------------------------------------------------- + +namespace +{ + +class wxDateTimeWidgetCocoaImpl : public wxDateTimeWidgetImpl +{ +public: + wxDateTimeWidgetCocoaImpl(wxDateTimePickerCtrl* peer, wxNSDatePicker* w) + : wxDateTimeWidgetImpl(peer, w) + { + } + + virtual void SetDateTime(const wxDateTime& dt) + { + [View() setDateValue: NSDateFromWX(dt)]; + } + + virtual wxDateTime GetDateTime() const + { + return NSDateToWX([View() dateValue]); + } + + virtual void SetDateRange(const wxDateTime& dt1, const wxDateTime& dt2) + { + // Note that passing nil is ok here so we don't need to test for the + // dates validity. + [View() setMinDate: NSDateFromWX(dt1)]; + [View() setMaxDate: NSDateFromWX(dt2)]; + } + + virtual bool GetDateRange(wxDateTime* dt1, wxDateTime* dt2) + { + bool hasLimits = false; + if ( dt1 ) + { + *dt1 = NSDateToWX([View() minDate]); + hasLimits = true; + } + + if ( dt2 ) + { + *dt2 = NSDateToWX([View() maxDate]); + hasLimits = true; + } + + return hasLimits; + } + + virtual void controlAction(WXWidget WXUNUSED(slf), + void* WXUNUSED(cmd), + void* WXUNUSED(sender)) + { + wxWindow* const wxpeer = GetWXPeer(); + if ( wxpeer ) + { + static_cast(wxpeer)-> + OSXGenerateEvent(GetDateTime()); + } + } + +private: + wxNSDatePicker* View() const + { + return static_cast(m_osxView); + } +}; + +} // anonymous namespace + +// ---------------------------------------------------------------------------- +// CreateDateTimePicker() implementation +// ---------------------------------------------------------------------------- + +/* static */ +wxDateTimeWidgetImpl* +wxDateTimeWidgetImpl::CreateDateTimePicker(wxDateTimePickerCtrl* wxpeer, + const wxDateTime& dt, + const wxPoint& pos, + const wxSize& size, + long style, + wxDateTimeWidgetKind kind) +{ + NSRect r = wxOSXGetFrameForControl(wxpeer, pos, size); + wxNSDatePicker* v = [[wxNSDatePicker alloc] initWithFrame:r]; + + NSDatePickerElementFlags elements = 0; + switch ( kind ) + { + case wxDateTimeWidget_YearMonthDay: + elements = NSYearMonthDayDatePickerElementFlag; + break; + + case wxDateTimeWidget_HourMinuteSecond: + elements = NSHourMinuteSecondDatePickerElementFlag; + break; + } + + wxASSERT_MSG( elements, "Unknown date time widget kind" ); + [v setDatePickerElements: elements]; + + [v setDatePickerStyle: NSTextFieldAndStepperDatePickerStyle]; + + if ( dt.IsValid() ) + { + [v setDateValue: NSDateFromWX(dt)]; + } + + wxDateTimeWidgetImpl* c = new wxDateTimeWidgetCocoaImpl(wxpeer, v); + c->SetFlipped(false); + return c; +} + +#endif // wxUSE_DATEPICKCTRL diff --git a/src/osx/datectrl_osx.cpp b/src/osx/datectrl_osx.cpp new file mode 100644 index 0000000000..c353c0af14 --- /dev/null +++ b/src/osx/datectrl_osx.cpp @@ -0,0 +1,90 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: src/osx/datectrl_osx.cpp +// Purpose: Implementation of wxDatePickerCtrl for OS X. +// Author: Vadim Zeitlin +// Created: 2011-12-18 +// RCS-ID: $Id: wxhead.cpp,v 1.11 2010-04-22 12:44:51 zeitlin Exp $ +// Copyright: (c) 2011 Vadim Zeitlin +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +// ============================================================================ +// declarations +// ============================================================================ + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- + +// for compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#if wxUSE_DATEPICKCTRL && wxOSX_USE_COCOA + +#include "wx/datectrl.h" +#include "wx/dateevt.h" + +#include "wx/osx/core/private/datetimectrl.h" + +// ============================================================================ +// wxDatePickerCtrl implementation +// ============================================================================ + +wxIMPLEMENT_DYNAMIC_CLASS(wxDatePickerCtrl, wxControl); + +bool +wxDatePickerCtrl::Create(wxWindow *parent, + wxWindowID id, + const wxDateTime& dt, + const wxPoint& pos, + const wxSize& size, + long style, + const wxValidator& validator, + const wxString& name) +{ + DontCreatePeer(); + + if ( !wxDatePickerCtrlBase::Create(parent, id, pos, size, + style, validator, name) ) + return false; + + wxOSXWidgetImpl* const peer = wxDateTimeWidgetImpl::CreateDateTimePicker + ( + this, + dt, + pos, + size, + style, + wxDateTimeWidget_YearMonthDay + ); + if ( !peer ) + return false; + + SetPeer(peer); + + MacPostControlCreate(pos, size); + + return true; +} + +void wxDatePickerCtrl::SetRange(const wxDateTime& dt1, const wxDateTime& dt2) +{ + GetDateTimePeer()->SetDateRange(dt1, dt2); +} + +bool wxDatePickerCtrl::GetRange(wxDateTime *dt1, wxDateTime *dt2) const +{ + return GetDateTimePeer()->GetDateRange(dt1, dt2); +} + +void wxDatePickerCtrl::OSXGenerateEvent(const wxDateTime& dt) +{ + wxDateEvent event(this, dt, wxEVT_DATE_CHANGED); + HandleWindowEvent(event); +} + +#endif // wxUSE_DATEPICKCTRL && wxOSX_USE_COCOA diff --git a/src/osx/datetimectrl_osx.cpp b/src/osx/datetimectrl_osx.cpp new file mode 100644 index 0000000000..45a49659ff --- /dev/null +++ b/src/osx/datetimectrl_osx.cpp @@ -0,0 +1,55 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: src/osx/datetimectrl_osx.cpp +// Purpose: Implementation of wxDateTimePickerCtrl for OS X. +// Author: Vadim Zeitlin +// Created: 2011-12-18 +// RCS-ID: $Id: wxhead.cpp,v 1.11 2010-04-22 12:44:51 zeitlin Exp $ +// Copyright: (c) 2011 Vadim Zeitlin +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +// ============================================================================ +// declarations +// ============================================================================ + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- + +// for compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#if wxUSE_DATEPICKCTRL || wxUSE_TIMEPICKCTRL + +#ifndef WX_PRECOMP +#endif // WX_PRECOMP + +#include "wx/datetimectrl.h" + +#include "wx/osx/core/private/datetimectrl.h" + +// ============================================================================ +// wxDateTimePickerCtrl implementation +// ============================================================================ + +wxDateTimeWidgetImpl* wxDateTimePickerCtrl::GetDateTimePeer() const +{ + return static_cast(GetPeer()); +} + +void wxDateTimePickerCtrl::SetValue(const wxDateTime& dt) +{ + GetDateTimePeer()->SetDateTime(dt); +} + +wxDateTime wxDateTimePickerCtrl::GetValue() const +{ + return GetDateTimePeer()->GetDateTime(); +} + + +#endif // wxUSE_DATEPICKCTRL || wxUSE_TIMEPICKCTRL diff --git a/src/osx/timectrl_osx.cpp b/src/osx/timectrl_osx.cpp new file mode 100644 index 0000000000..ca60080be7 --- /dev/null +++ b/src/osx/timectrl_osx.cpp @@ -0,0 +1,80 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: src/osx/timectrl_osx.cpp +// Purpose: Implementation of wxTimePickerCtrl for OS X. +// Author: Vadim Zeitlin +// Created: 2011-12-18 +// RCS-ID: $Id: wxhead.cpp,v 1.11 2010-04-22 12:44:51 zeitlin Exp $ +// Copyright: (c) 2011 Vadim Zeitlin +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +// ============================================================================ +// declarations +// ============================================================================ + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- + +// for compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#if wxUSE_TIMEPICKCTRL && wxOSX_USE_COCOA + +#include "wx/timectrl.h" +#include "wx/dateevt.h" + +#include "wx/osx/core/private/datetimectrl.h" + +// ============================================================================ +// wxTimePickerCtrl implementation +// ============================================================================ + +wxIMPLEMENT_DYNAMIC_CLASS(wxTimePickerCtrl, wxControl); + +bool +wxTimePickerCtrl::Create(wxWindow *parent, + wxWindowID id, + const wxDateTime& dt, + const wxPoint& pos, + const wxSize& size, + long style, + const wxValidator& validator, + const wxString& name) +{ + DontCreatePeer(); + + if ( !wxTimePickerCtrlBase::Create(parent, id, pos, size, + style, validator, name) ) + return false; + + wxOSXWidgetImpl* const peer = wxDateTimeWidgetImpl::CreateDateTimePicker + ( + this, + dt, + pos, + size, + style, + wxDateTimeWidget_HourMinuteSecond + ); + if ( !peer ) + return false; + + SetPeer(peer); + + MacPostControlCreate(pos, size); + + return true; +} + +void wxTimePickerCtrl::OSXGenerateEvent(const wxDateTime& dt) +{ + wxDateEvent event(this, dt, wxEVT_TIME_CHANGED); + HandleWindowEvent(event); +} + +#endif // wxUSE_TIMEPICKCTRL && wxOSX_USE_COCOA -- 2.45.2