diff --git a/build/codeblocks/nana.depend b/build/codeblocks/nana.depend deleted file mode 100644 index 8d95a36f..00000000 --- a/build/codeblocks/nana.depend +++ /dev/null @@ -1,1873 +0,0 @@ -# depslib dependency file v1.0 -1363362719 source:d:\privates\nana\release\nana.cpp11\source\any.cpp - - -1362509572 source:d:\privates\nana\release\nana.cpp11\source\audio\detail\audio_device.cpp - - - - - - - -1353115288 source:d:\privates\nana\release\nana.cpp11\source\audio\detail\audio_stream.cpp - - - -1362509721 source:d:\privates\nana\release\nana.cpp11\source\audio\detail\buffer_preparation.cpp - - - -1353253406 source:d:\privates\nana\release\nana.cpp11\source\audio\player.cpp - - - - - - -1380829816 source:d:\privates\nana\release\nana.cpp11\source\basic_types.cpp - - -1376407818 source:d:\privates\nana\release\nana.cpp11\source\charset.cpp - - - - - - - - -1365203880 source:d:\privates\nana\release\nana.cpp11\source\datetime.cpp - - - - -1368515624 source:d:\privates\nana\release\nana.cpp11\source\deploy.cpp - - - - -1356273963 source:d:\privates\nana\release\nana.cpp11\source\detail\win32\platform_spec.cpp - - - - - -1365203880 source:d:\privates\nana\release\nana.cpp11\source\exceptions.cpp - - -1365203878 source:d:\privates\nana\release\nana.cpp11\source\filesystem\file_iterator.cpp - - -1365203878 source:d:\privates\nana\release\nana.cpp11\source\filesystem\fs_utility.cpp - - - - - - - - - - - - - - - - -1365203879 source:d:\privates\nana\release\nana.cpp11\source\gui\basis.cpp - - -1394945360 source:d:\privates\nana\release\nana.cpp11\source\gui\detail\basic_window.cpp - - - -1394949372 source:d:\privates\nana\release\nana.cpp11\source\gui\detail\drawer.cpp - - - - - - - - -1395848366 source:d:\privates\nana\release\nana.cpp11\source\gui\detail\event_manager.cpp - - - - - -1390762141 source:d:\privates\nana\release\nana.cpp11\source\gui\detail\native_window_interface.cpp - - - - - - - - -1390850442 source:d:\privates\nana\release\nana.cpp11\source\gui\detail\timer_trigger.cpp - - - - - - -1356028060 source:d:\privates\nana\release\nana.cpp11\source\gui\detail\win32\bedrock.cpp - - - - - - -1394946162 source:d:\privates\nana\release\nana.cpp11\source\gui\detail\window_manager.cpp - - - - - - - - -1391060709 source:d:\privates\nana\release\nana.cpp11\source\gui\dragger.cpp - - -1391341193 source:d:\privates\nana\release\nana.cpp11\source\gui\drawing.cpp - - - - -1396881268 source:d:\privates\nana\release\nana.cpp11\source\gui\filebox.cpp - - - - - - - - - - - - - - - - -1342280997 source:d:\privates\nana\release\nana.cpp11\source\gui\functional.cpp - - - -1365203879 source:d:\privates\nana\release\nana.cpp11\source\gui\layout.cpp - - - -1397227563 source:d:\privates\nana\release\nana.cpp11\source\gui\layout_utility.cpp - - -1389116447 source:d:\privates\nana\release\nana.cpp11\source\gui\msgbox.cpp - - - - - - - - - - -1394981871 source:d:\privates\nana\release\nana.cpp11\source\gui\programming_interface.cpp - - - - - - - -1398012918 source:d:\privates\nana\release\nana.cpp11\source\gui\timer.cpp - - -1398101619 source:d:\privates\nana\release\nana.cpp11\source\gui\tooltip.cpp - - - - - -1399003520 source:d:\privates\nana\release\nana.cpp11\source\gui\widgets\button.cpp - - - -1397406400 source:d:\privates\nana\release\nana.cpp11\source\gui\widgets\categorize.cpp - - - - - - - -1395850855 source:d:\privates\nana\release\nana.cpp11\source\gui\widgets\checkbox.cpp - - - - - - -1398356540 source:d:\privates\nana\release\nana.cpp11\source\gui\widgets\combox.cpp - - - - - - - -1394949372 source:d:\privates\nana\release\nana.cpp11\source\gui\widgets\date_chooser.cpp - - - - - -1397406413 source:d:\privates\nana\release\nana.cpp11\source\gui\widgets\float_listbox.cpp - - - -1394949372 source:d:\privates\nana\release\nana.cpp11\source\gui\widgets\form.cpp - - -1365203878 source:d:\privates\nana\release\nana.cpp11\source\gui\widgets\frame.cpp - - -1398365621 source:d:\privates\nana\release\nana.cpp11\source\gui\widgets\label.cpp - - - - - - - -1399000256 source:d:\privates\nana\release\nana.cpp11\source\gui\widgets\listbox.cpp - - - - - - - - - -1398016208 source:d:\privates\nana\release\nana.cpp11\source\gui\widgets\login.cpp - - - - - - - - - -1394949372 source:d:\privates\nana\release\nana.cpp11\source\gui\widgets\menu.cpp - - - - - - - -1394948882 source:d:\privates\nana\release\nana.cpp11\source\gui\widgets\menubar.cpp - - - -1394949372 source:d:\privates\nana\release\nana.cpp11\source\gui\widgets\panel.cpp - - -1394949372 source:d:\privates\nana\release\nana.cpp11\source\gui\widgets\picture.cpp - - - -1394949372 source:d:\privates\nana\release\nana.cpp11\source\gui\widgets\progress.cpp - - -1382857419 source:d:\privates\nana\release\nana.cpp11\source\gui\widgets\scroll.cpp - - -1397670961 source:d:\privates\nana\release\nana.cpp11\source\gui\widgets\skeletons\text_editor.cpp - - - - -1394949372 source:d:\privates\nana\release\nana.cpp11\source\gui\widgets\slider.cpp - - -1394949372 source:d:\privates\nana\release\nana.cpp11\source\gui\widgets\tabbar.cpp - - - - - - -1398365225 source:d:\privates\nana\release\nana.cpp11\source\gui\widgets\textbox.cpp - - - - - -1397936811 source:d:\privates\nana\release\nana.cpp11\source\gui\widgets\toolbar.cpp - - - - - -1390938560 source:d:\privates\nana\release\nana.cpp11\source\gui\widgets\tray.cpp - - -1398364760 source:d:\privates\nana\release\nana.cpp11\source\gui\widgets\treebox.cpp - - - - - - - -1398365335 source:d:\privates\nana\release\nana.cpp11\source\gui\widgets\widget.cpp - - - -1365203879 source:d:\privates\nana\release\nana.cpp11\source\gui\wvl.cpp - - -1382451741 source:d:\privates\nana\release\nana.cpp11\source\paint\detail\image_process_provider.cpp - - - -1383444362 source:d:\privates\nana\release\nana.cpp11\source\paint\detail\native_paint_interface.cpp - - - - - - - -1379767040 source:d:\privates\nana\release\nana.cpp11\source\paint\gadget.cpp - - - -1390741327 source:d:\privates\nana\release\nana.cpp11\source\paint\graphics.cpp - - - - - - - - - - -1383145765 source:d:\privates\nana\release\nana.cpp11\source\paint\image.cpp - - - - - - - - - - - -1376313789 source:d:\privates\nana\release\nana.cpp11\source\paint\image_process_selector.cpp - - -1398195475 source:d:\privates\nana\release\nana.cpp11\source\paint\pixel_buffer.cpp - - - - - - - -1362504379 source:d:\privates\nana\release\nana.cpp11\source\paint\text_renderer.cpp - - - - - -1391437647 source:d:\privates\nana\release\nana.cpp11\source\system\dataexch.cpp - - - - - -1387007333 source:d:\privates\nana\release\nana.cpp11\source\system\platform.cpp - - - - - - - - -1365203879 source:d:\privates\nana\release\nana.cpp11\source\system\shared_wrapper.cpp - - - - - - -1342280997 source:d:\privates\nana\release\nana.cpp11\source\system\timepiece.cpp - - - - - -1386165989 source:d:\privates\nana\release\nana.cpp11\source\threads\pool.cpp - - - - - - - - - - - - - -1365203748 source:d:\privates\nana\release\nana.cpp11\source\traits.cpp - - -1385897272 source:d:\privates\nana\release\nana.cpp11\source\unicode_bidi.cpp - - -1358528462 source:d:\privates\nana\release\nana.cpp11\source\detail\platform_spec_selector.cpp - - "win32/platform_spec.cpp" - "linux_X11/platform_spec.cpp" - -1391342312 d:\privates\nana\release\nana.cpp11\source\detail\win32\platform_spec.cpp - - - - - -1391435023 d:\privates\nana\release\nana.cpp11\source\detail\linux_x11\platform_spec.cpp - - - - - - - - - - - - - -1358528584 source:d:\privates\nana\release\nana.cpp11\source\gui\detail\bedrock_selector.cpp - - "win32/bedrock.cpp" - "linux_X11/bedrock.cpp" - -1399001800 d:\privates\nana\release\nana.cpp11\source\gui\detail\win32\bedrock.cpp - - - - - - - - - - - -1399001985 d:\privates\nana\release\nana.cpp11\source\gui\detail\linux_x11\bedrock.cpp - - - - - - - - - -1398365709 source:d:\privates\nana\release\nana.cpp11\source\gui\place.cpp - - - - - - - - -1391435611 source:d:\privates\nana\release\nana.cpp11\source\gui\animation.cpp - - - - - - - - - - - - - - -1373211308 source:d:\privates\nana\release\nana.cpp11\source\gui\effects.cpp - - - -1386164590 source:d:\privates\nana\release\nana.cpp11\source\gui\element.cpp - - - - - - - -1391342458 source:d:\privates\nana\release\nana.cpp11\source\gui\detail\window_layout.cpp - - - - - - -1399002439 source:d:\privates\nana\release\nana.cpp11\source\gui\detail\element_store.cpp - - -1363362719 source:d:\git.repo\nana\source\any.cpp - - -1362509572 source:d:\git.repo\nana\source\audio\detail\audio_device.cpp - - - - - - - -1452100459 source:d:\git.repo\nana\source\audio\detail\audio_stream.cpp - - - -1362509721 source:d:\git.repo\nana\source\audio\detail\buffer_preparation.cpp - - - -1452100459 source:d:\git.repo\nana\source\audio\player.cpp - - - - - - -1439496157 source:d:\git.repo\nana\source\basic_types.cpp - - - - - - -1452100459 source:d:\git.repo\nana\source\charset.cpp - - - - - - - - - -1439496157 source:d:\git.repo\nana\source\datetime.cpp - - - - - -1452100459 source:d:\git.repo\nana\source\deploy.cpp - - - - - - - - - - - -1439496157 source:d:\git.repo\nana\source\detail\platform_spec_selector.cpp - - "win32/platform_spec.cpp" - "linux_X11/platform_spec.cpp" - -1443581342 d:\git.repo\nana\source\detail\win32\platform_spec.cpp - - - - - -1443581342 d:\git.repo\nana\source\detail\linux_x11\platform_spec.cpp - - - - - - - - - - - - - "msg_dispatcher.hpp" - -1439496157 d:\git.repo\nana\source\detail\linux_x11\msg_dispatcher.hpp - - - - - - - - - - -1365203880 source:d:\git.repo\nana\source\exceptions.cpp - - -1365203878 source:d:\git.repo\nana\source\filesystem\file_iterator.cpp - - -1453128389 source:d:\git.repo\nana\source\filesystem\fs_utility.cpp - - - - - - - - - - - - - - - - -1449510853 source:d:\git.repo\nana\source\gui\animation.cpp - - - - - - - - - - - - - - - -1423350892 source:d:\git.repo\nana\source\gui\basis.cpp - - -1439496157 source:d:\git.repo\nana\source\gui\detail\basic_window.cpp - - - -1447167067 source:d:\git.repo\nana\source\gui\detail\bedrock_pi.cpp - - - - - - - - - - - - - -1439496157 source:d:\git.repo\nana\source\gui\detail\bedrock_selector.cpp - - "win32/bedrock.cpp" - "linux_X11/bedrock.cpp" - -1444657608 d:\git.repo\nana\source\gui\detail\win32\bedrock.cpp - - - - - - - - - - - - - - -1444647171 d:\git.repo\nana\source\gui\detail\linux_x11\bedrock.cpp - - - - - - - - - - -1447167067 source:d:\git.repo\nana\source\gui\detail\color_schemes.cpp - - - -1439496157 source:d:\git.repo\nana\source\gui\detail\drawer.cpp - - - - - - - - -1408986718 source:d:\git.repo\nana\source\gui\detail\element_store.cpp - - -1447167067 source:d:\git.repo\nana\source\gui\detail\events_operation.cpp - - -1453137865 source:d:\git.repo\nana\source\gui\detail\native_window_interface.cpp - - - - - - - "../../paint/detail/image_ico.hpp" - - - - -1453189013 d:\git.repo\nana\source\paint\detail\image_ico.hpp - - - -1451801884 source:d:\git.repo\nana\source\gui\detail\window_layout.cpp - - - - - - -1451801884 source:d:\git.repo\nana\source\gui\detail\window_manager.cpp - - - - - - - - - - - - -1452100459 source:d:\git.repo\nana\source\gui\dragger.cpp - - - -1447167067 source:d:\git.repo\nana\source\gui\drawing.cpp - - - - -1439496157 source:d:\git.repo\nana\source\gui\effects.cpp - - - -1452100459 source:d:\git.repo\nana\source\gui\element.cpp - - - - - - - - - -1453222083 source:d:\git.repo\nana\source\gui\filebox.cpp - - - - - - - - - - - - - - - - -1439496157 source:d:\git.repo\nana\source\gui\layout_utility.cpp - - -1452100459 source:d:\git.repo\nana\source\gui\msgbox.cpp - - - - - - - - - - - - - - - - - - -1452100459 source:d:\git.repo\nana\source\gui\notifier.cpp - - - - - - - - - - - - -1453128389 source:d:\git.repo\nana\source\gui\programming_interface.cpp - - - - - - - - - -1439496158 source:d:\git.repo\nana\source\gui\screen.cpp - - - - - - - -1447167068 source:d:\git.repo\nana\source\gui\state_cursor.cpp - - - - - -1449510853 source:d:\git.repo\nana\source\gui\timer.cpp - - - - - - - - - - -1452100459 source:d:\git.repo\nana\source\gui\tooltip.cpp - - - - - - -1452100459 source:d:\git.repo\nana\source\gui\widgets\button.cpp - - - -1452100459 source:d:\git.repo\nana\source\gui\widgets\categorize.cpp - - - - - - - -1453214888 source:d:\git.repo\nana\source\gui\widgets\checkbox.cpp - - - - - -1452100459 source:d:\git.repo\nana\source\gui\widgets\combox.cpp - - - - - - - - - -1452100459 source:d:\git.repo\nana\source\gui\widgets\date_chooser.cpp - - - - - -1452100459 source:d:\git.repo\nana\source\gui\widgets\float_listbox.cpp - - - -1439496158 source:d:\git.repo\nana\source\gui\widgets\form.cpp - - -1408985395 source:d:\git.repo\nana\source\gui\widgets\frame.cpp - - -1452100459 source:d:\git.repo\nana\source\gui\widgets\group.cpp - - - - - -1452100459 source:d:\git.repo\nana\source\gui\widgets\label.cpp - - - - - - - -1452100459 source:d:\git.repo\nana\source\gui\widgets\listbox.cpp - - - - - - - - - - - - -1452100459 source:d:\git.repo\nana\source\gui\widgets\menu.cpp - - - - - - - -1452100459 source:d:\git.repo\nana\source\gui\widgets\menubar.cpp - - - -1452100459 source:d:\git.repo\nana\source\gui\widgets\panel.cpp - - -1439496158 source:d:\git.repo\nana\source\gui\widgets\picture.cpp - - - - - -1439496158 source:d:\git.repo\nana\source\gui\widgets\progress.cpp - - -1452100459 source:d:\git.repo\nana\source\gui\widgets\scroll.cpp - - - -1452536705 source:d:\git.repo\nana\source\gui\widgets\skeletons\text_editor.cpp - - - - - - - - - - - -1452100459 source:d:\git.repo\nana\source\gui\widgets\slider.cpp - - -1452100459 source:d:\git.repo\nana\source\gui\widgets\spinbox.cpp - - - - - - -1452100459 source:d:\git.repo\nana\source\gui\widgets\textbox.cpp - - - - - - - -1452100459 source:d:\git.repo\nana\source\gui\widgets\toolbar.cpp - - - - -1452100459 source:d:\git.repo\nana\source\gui\widgets\treebox.cpp - - - - - - - -1452100459 source:d:\git.repo\nana\source\gui\widgets\widget.cpp - - - - -1447167068 source:d:\git.repo\nana\source\gui\wvl.cpp - - - -1452100459 source:d:\git.repo\nana\source\internationalization.cpp - - - - - - - - -1423350893 source:d:\git.repo\nana\source\paint\detail\image_process_provider.cpp - - - -1452100459 source:d:\git.repo\nana\source\paint\detail\native_paint_interface.cpp - - - - - - - -1452100459 source:d:\git.repo\nana\source\paint\graphics.cpp - - - - - - - - - - - -1452100460 source:d:\git.repo\nana\source\paint\image.cpp - - - - - - - - - "detail/image_jpeg.hpp" - "detail/image_png.hpp" - "detail/image_bmp.hpp" - "detail/image_ico.hpp" - -1447167068 d:\git.repo\nana\source\paint\detail\image_png.hpp - "image_pixbuf.hpp" - - - - -1452100459 d:\git.repo\nana\source\paint\detail\image_bmp.hpp - "image_pixbuf.hpp" - - -1376313789 source:d:\git.repo\nana\source\paint\image_process_selector.cpp - - -1447167068 source:d:\git.repo\nana\source\paint\pixel_buffer.cpp - - - - - - - - -1452100460 source:d:\git.repo\nana\source\paint\text_renderer.cpp - - - - - -1452100460 source:d:\git.repo\nana\source\system\dataexch.cpp - - - - - - - - - - -1452100460 source:d:\git.repo\nana\source\system\platform.cpp - - - - - - - - - -1447169804 source:d:\git.repo\nana\source\system\shared_wrapper.cpp - - - - - - -1447168921 source:d:\git.repo\nana\source\system\timepiece.cpp - - - - - -1449510853 source:d:\git.repo\nana\source\threads\pool.cpp - - - - - - - - - - - - - -1365203748 source:d:\git.repo\nana\source\traits.cpp - - -1439496158 source:d:\git.repo\nana\source\unicode_bidi.cpp - - -1452100459 source:d:\git.repo\nana\source\gui\widgets\tabbar.cpp - - - - - - - - -1452100459 source:d:\git.repo\nana\source\gui\place.cpp - - - - - - - - - - - - - - - - "place_parts.hpp" - -1452100459 d:\git.repo\nana\source\gui\place_parts.hpp - - - - - - - -1418083945 d:\git.repo\nana\include\nana\any.hpp - - - -1345180256 d:\git.repo\nana\include\nana\audio\detail\audio_device.hpp - - - - - - -1453135618 d:\git.repo\nana\include\nana\deploy.hpp - - - - - - - - - -1453135601 d:\git.repo\nana\include\nana\config.hpp - - - -1451801884 d:\git.repo\nana\include\nana\verbose_preprocessor.hpp - -1452100458 d:\git.repo\nana\include\nana\charset.hpp - - -1449510853 d:\git.repo\nana\include\nana\audio\detail\buffer_preparation.hpp - - - - - - - - - - - - -1452100458 d:\git.repo\nana\include\nana\audio\detail\audio_stream.hpp - - - -1449510853 d:\git.repo\nana\include\nana\std_thread.hpp - - - - -1449510853 d:\git.repo\nana\include\nana\std_mutex.hpp - - - - - - - - - - - - - - -1449510853 d:\git.repo\nana\include\nana\std_condition_variable.hpp - - - - -1452100458 d:\git.repo\nana\include\nana\system\platform.hpp - - -1452100458 d:\git.repo\nana\include\nana\audio\player.hpp - - - -1452100458 d:\git.repo\nana\include\nana\traits.hpp - - -1452100458 d:\git.repo\nana\include\nana\basic_types.hpp - - - -1439496155 d:\git.repo\nana\include\nana\datetime.hpp - - -1447169930 d:\git.repo\nana\include\nana\detail\platform_spec_selector.hpp - - - - -1452100458 d:\git.repo\nana\include\nana\detail\win32\platform_spec.hpp - - - - - - - - -1447694839 d:\git.repo\nana\include\nana\gui\basis.hpp - "../basic_types.hpp" - "../traits.hpp" - -1453215024 d:\git.repo\nana\include\nana\paint\image.hpp - "graphics.hpp" - -1452100458 d:\git.repo\nana\include\nana\paint\graphics.hpp - "../basic_types.hpp" - "../gui/basis.hpp" - "pixel_buffer.hpp" - - -1447167067 d:\git.repo\nana\include\nana\paint\pixel_buffer.hpp - - - -1453221913 d:\git.repo\nana\include\nana\filesystem\filesystem.hpp - - - - - - - - - -1409500994 d:\git.repo\nana\include\nana\gui\detail\event_code.hpp - -1452100458 d:\git.repo\nana\include\nana\detail\linux_x11\platform_spec.hpp - - - - - - - - - - - - - - - "msg_packet.hpp" - - - - -1452100458 d:\git.repo\nana\include\nana\detail\linux_x11\msg_packet.hpp - - - - -1452100459 source:d:\git.repo\nana\source\detail\platform_spec_posix.cpp - - - - - - - - - - - - - - "x11/msg_dispatcher.hpp" - -1447167067 d:\git.repo\nana\include\nana\gui\detail\bedrock.hpp - "general_events.hpp" - "color_schemes.hpp" - "internal_scope_guard.hpp" - -1453221339 d:\git.repo\nana\include\nana\gui\detail\general_events.hpp - - "event_code.hpp" - "internal_scope_guard.hpp" - - - - - -1410789890 d:\git.repo\nana\include\nana\gui\detail\internal_scope_guard.hpp - -1447167067 d:\git.repo\nana\include\nana\gui\detail\color_schemes.hpp - "widget_colors.hpp" - -1423350891 d:\git.repo\nana\include\nana\gui\detail\widget_colors.hpp - - - -1452100458 d:\git.repo\nana\include\nana\gui\detail\basic_window.hpp - "drawer.hpp" - "events_holder.hpp" - "widget_colors.hpp" - "widget_notifier_interface.hpp" - - - - -1447167067 d:\git.repo\nana\include\nana\gui\detail\drawer.hpp - - "general_events.hpp" - - - -1409768997 d:\git.repo\nana\include\nana\gui\detail\events_holder.hpp - - -1452100458 d:\git.repo\nana\include\nana\gui\detail\widget_notifier_interface.hpp - - - -1447167067 d:\git.repo\nana\include\nana\gui\effects.hpp - - - -1449510853 d:\git.repo\nana\include\nana\gui\detail\window_manager.hpp - - "window_layout.hpp" - "event_code.hpp" - "inner_fwd.hpp" - - - - -1413471439 d:\git.repo\nana\include\nana\gui\detail\window_layout.hpp - - - -1439496155 d:\git.repo\nana\include\nana\gui\detail\inner_fwd.hpp - - -1449510999 d:\git.repo\nana\source\detail\x11\msg_dispatcher.hpp - - - - - - - - - - -1452100459 source:d:\git.repo\nana\source\detail\platform_spec_windows.cpp - - - - - -1453128389 d:\git.repo\nana\include\nana\filesystem\fs_utility.hpp - - - -1447167067 d:\git.repo\nana\include\nana\gui\animation.hpp - - - - -1413449218 d:\git.repo\nana\include\nana\gui\drawing.hpp - "widgets/widget.hpp" - "../traits.hpp" - -1452100458 d:\git.repo\nana\include\nana\gui\widgets\widget.hpp - "../basis.hpp" - "../programming_interface.hpp" - - - - -1453128389 d:\git.repo\nana\include\nana\gui\programming_interface.hpp - - "effects.hpp" - "detail/general_events.hpp" - "detail/color_schemes.hpp" - - - -1453116049 d:\git.repo\nana\include\nana\internationalization.hpp - "basic_types.hpp" - - - - - -1398298742 d:\git.repo\nana\include\nana\system\timepiece.hpp - -1452100458 d:\git.repo\nana\include\nana\gui\detail\native_window_interface.hpp - "../basis.hpp" - - -1447167067 d:\git.repo\nana\include\nana\gui\detail\bedrock_pi_data.hpp - - "color_schemes.hpp" - "events_operation.hpp" - "window_manager.hpp" - - -1449510853 d:\git.repo\nana\include\nana\gui\detail\events_operation.hpp - - - - - - -1447167067 d:\git.repo\nana\include\nana\gui\wvl.hpp - "programming_interface.hpp" - "screen.hpp" - "widgets/form.hpp" - "drawing.hpp" - "msgbox.hpp" - "place.hpp" - -1439496156 d:\git.repo\nana\include\nana\gui\screen.hpp - "basis.hpp" - - - -1439496156 d:\git.repo\nana\include\nana\gui\widgets\form.hpp - "widget.hpp" - -1452100458 d:\git.repo\nana\include\nana\gui\msgbox.hpp - - -1452100458 d:\git.repo\nana\include\nana\gui\place.hpp - - - - - -1439496155 d:\git.repo\nana\include\nana\gui\detail\inner_fwd_implement.hpp - "inner_fwd.hpp" - "basic_window.hpp" - "../../paint/graphics.hpp" - - -1439496155 d:\git.repo\nana\include\nana\gui\layout_utility.hpp - "basis.hpp" - -1412237320 d:\git.repo\nana\include\nana\gui\detail\element_store.hpp - - - - - -1447167067 d:\git.repo\nana\include\nana\gui\element.hpp - - - - - -1447167067 d:\git.repo\nana\include\nana\pat\cloneable.hpp - - - - -1452100459 source:d:\git.repo\nana\source\gui\detail\bedrock_posix.cpp - - - - - - - - - - - -1452100459 source:d:\git.repo\nana\source\gui\detail\bedrock_windows.cpp - - - - - - - - - - - - - - -1411474310 d:\git.repo\nana\include\nana\gui.hpp - "gui/wvl.hpp" - -1408991732 d:\git.repo\nana\include\nana\gui\detail\dynamic_drawing_object.hpp - - - -1447167067 d:\git.repo\nana\include\nana\gui\detail\effects_renderer.hpp - - - - - - -1453221942 source:d:\git.repo\nana\source\filesystem\filesystem.cpp - - - - - - - - - - - - - - - -1449510853 d:\git.repo\nana\include\nana\gui\detail\handle_manager.hpp - - - - - - - -1452100458 d:\git.repo\nana\include\nana\gui\dragger.hpp - "basis.hpp" - "../basic_types.hpp" - "../traits.hpp" - -1453128800 d:\git.repo\nana\include\nana\gui\filebox.hpp - - - - -1452100458 d:\git.repo\nana\include\nana\gui\widgets\label.hpp - "widget.hpp" - -1452100458 d:\git.repo\nana\include\nana\gui\widgets\button.hpp - "widget.hpp" - - -1452100458 d:\git.repo\nana\include\nana\gui\widgets\listbox.hpp - "widget.hpp" - "detail/inline_widget.hpp" - - - - - - -1439496156 d:\git.repo\nana\include\nana\gui\widgets\detail\inline_widget.hpp - "../../basis.hpp" - -1447167067 d:\git.repo\nana\include\nana\pat\abstract_factory.hpp - "cloneable.hpp" - - -1398298742 d:\git.repo\nana\include\nana\concepts.hpp - - -1439496157 d:\git.repo\nana\include\nana\key_type.hpp - -1452100458 d:\git.repo\nana\include\nana\gui\widgets\categorize.hpp - - - - -1452100458 d:\git.repo\nana\include\nana\gui\widgets\textbox.hpp - - "skeletons/textbase_export_interface.hpp" - "skeletons/text_editor_part.hpp" - -1423350891 d:\git.repo\nana\include\nana\gui\widgets\skeletons\textbase_export_interface.hpp - -1447167068 d:\git.repo\nana\include\nana\gui\widgets\skeletons\text_editor_part.hpp - "../../detail/widget_colors.hpp" - - -1452100458 d:\git.repo\nana\include\nana\gui\widgets\treebox.hpp - "widget.hpp" - "detail/compset.hpp" - "detail/tree_cont.hpp" - - - - - -1408985780 d:\git.repo\nana\include\nana\gui\widgets\detail\compset.hpp - - -1452100603 d:\git.repo\nana\include\nana\gui\widgets\detail\tree_cont.hpp - - -1423350891 d:\git.repo\nana\include\nana\gui\timer.hpp - - -1452100458 d:\git.repo\nana\include\nana\gui\widgets\combox.hpp - "widget.hpp" - "float_listbox.hpp" - "skeletons/text_editor_part.hpp" - - - - -1452100458 d:\git.repo\nana\include\nana\gui\widgets\float_listbox.hpp - "widget.hpp" - - - -1452100458 d:\git.repo\nana\include\nana\gui\widgets\spinbox.hpp - "widget.hpp" - "skeletons/text_editor_part.hpp" - -1439496156 d:\git.repo\nana\include\nana\gui\widgets\panel.hpp - "widget.hpp" - - -1439496156 d:\git.repo\nana\include\nana\gui\widgets\picture.hpp - "widget.hpp" - -1452100458 d:\git.repo\nana\include\nana\gui\notifier.hpp - - - -1452100458 d:\git.repo\nana\include\nana\gui\widgets\tabbar.hpp - "widget.hpp" - - - -1452100458 d:\git.repo\nana\include\nana\paint\text_renderer.hpp - - -1415011754 d:\git.repo\nana\include\nana\gui\state_cursor.hpp - - -1452100757 d:\git.repo\nana\include\nana\gui\tooltip.hpp - "widgets/widget.hpp" - -1453214821 d:\git.repo\nana\include\nana\gui\widgets\checkbox.hpp - "widget.hpp" - - - -1452100458 d:\git.repo\nana\include\nana\system\dataexch.hpp - - -1452100621 d:\git.repo\nana\include\nana\gui\widgets\skeletons\text_editor.hpp - "textbase.hpp" - "text_editor_part.hpp" - - - -1452536138 d:\git.repo\nana\include\nana\gui\widgets\skeletons\textbase.hpp - - - - "textbase_export_interface.hpp" - - - - - -1452100458 d:\git.repo\nana\include\nana\gui\widgets\scroll.hpp - "widget.hpp" - - -1385896991 d:\git.repo\nana\include\nana\unicode_bidi.hpp - - -1452100458 d:\git.repo\nana\include\nana\gui\widgets\date_chooser.hpp - "widget.hpp" - - -1439496156 d:\git.repo\nana\include\nana\gui\widgets\frame.hpp - "widget.hpp" - -1452100458 d:\git.repo\nana\include\nana\gui\widgets\group.hpp - - - -1452100631 d:\git.repo\nana\include\nana\gui\widgets\skeletons\text_token_stream.hpp - - - - - - - - -1452100458 d:\git.repo\nana\include\nana\gui\widgets\menu.hpp - "widget.hpp" - - - - -1452100458 d:\git.repo\nana\include\nana\gui\widgets\menubar.hpp - "widget.hpp" - "menu.hpp" - -1439496156 d:\git.repo\nana\include\nana\gui\widgets\progress.hpp - "widget.hpp" - -1452100458 d:\git.repo\nana\include\nana\gui\widgets\slider.hpp - "widget.hpp" - - -1452100458 d:\git.repo\nana\include\nana\gui\widgets\toolbar.hpp - "widget.hpp" - -1382463882 d:\git.repo\nana\include\nana\paint\detail\image_process_provider.hpp - - - - - -1423350892 d:\git.repo\nana\include\nana\paint\image_process_interface.hpp - - - -1447167067 d:\git.repo\nana\include\nana\paint\detail\image_processor.hpp - "../image_process_interface.hpp" - - - - -1452100458 d:\git.repo\nana\include\nana\paint\detail\native_paint_interface.hpp - - -1453189097 d:\git.repo\nana\include\nana\paint\detail\image_impl_interface.hpp - "../image.hpp" - - -1447167068 d:\git.repo\nana\source\paint\detail\image_jpeg.hpp - "image_pixbuf.hpp" - - - - - -1447167068 d:\git.repo\nana\source\paint\detail\image_pixbuf.hpp - - - -1398298742 d:\git.repo\nana\include\nana\paint\image_process_selector.hpp - "detail/image_process_provider.hpp" - -1453136647 d:\git.repo\nana\include\nana\system\shared_wrapper.hpp - - - - -1399048525 d:\git.repo\nana\include\nana\threads\pool.hpp - - - - diff --git a/build/vc2017/nana.vcxproj b/build/vc2017/nana.vcxproj index b1e450b8..818d6cf8 100644 --- a/build/vc2017/nana.vcxproj +++ b/build/vc2017/nana.vcxproj @@ -23,7 +23,7 @@ {42D0520F-EFA5-4831-84FE-2B9085301C5D} Win32Proj nana - 10.0.15063.0 + 8.1 @@ -163,6 +163,8 @@ + + @@ -173,6 +175,20 @@ + + + + + + + + + + + + + + @@ -199,6 +215,7 @@ + diff --git a/build/vc2017/nana.vcxproj.filters b/build/vc2017/nana.vcxproj.filters index 13f8c102..ef973d0c 100644 --- a/build/vc2017/nana.vcxproj.filters +++ b/build/vc2017/nana.vcxproj.filters @@ -1,244 +1,287 @@  - + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - + {81850bad-7436-405a-beb5-357c5e34f039} - + {44582b36-4575-4663-ac02-e80417f95d05} - + {b7e3cdb7-99ac-473d-86c8-53dddce70480} - + {02fa693c-edc1-4e04-bf1d-ec3c2a89182a} - + {cffe7506-b96c-42aa-a747-41b5115d9580} - + {b6b2c032-c6a4-4884-8c14-eca4aa69ef0c} - + {58f2e0f8-4d63-40db-807d-d7adf71c4ebe} - + {f288a25d-3ce8-4c2e-a86f-9aeda44bc557} - + {90b2da01-605d-489b-b6c5-2af8d3c2d8a6} - + {430feed0-e1d9-45cb-8d59-e1a48a04d19f} - + {dcf62634-a658-453b-a58d-f1a96a12a8b8} - + {c1cdf46a-519f-422a-947f-39e173045414} - 源文件 + Sources - 源文件 + Sources - 源文件 + Sources - 源文件 + Sources - 源文件 + Sources - 源文件 + Sources - 源文件 + Sources - 源文件 + Sources - 源文件\audio\detail + Sources\audio\detail - 源文件\audio\detail + Sources\audio\detail - 源文件\audio\detail + Sources\audio\detail - 源文件\audio + Sources\audio - 源文件\detail + Sources\detail - 源文件\filesystem + Sources\filesystem - 源文件\gui\detail + Sources\gui\detail - 源文件\gui\detail + Sources\gui\detail - 源文件\gui\detail + Sources\gui\detail - 源文件\gui\detail + Sources\gui\detail - 源文件\gui\detail + Sources\gui\detail - 源文件\gui\detail + Sources\gui\detail - 源文件\gui\detail + Sources\gui\detail - 源文件\gui\detail + Sources\gui\detail - 源文件\gui\detail + Sources\gui\detail - 源文件\gui\detail + Sources\gui\detail - 源文件\gui\widgets\skeletons + Sources\gui\widgets\skeletons - 源文件\gui\widgets\skeletons + Sources\gui\widgets\skeletons - 源文件\gui\widgets + Sources\gui\widgets - 源文件\gui\widgets + Sources\gui\widgets - 源文件\gui\widgets + Sources\gui\widgets - 源文件\gui\widgets + Sources\gui\widgets - 源文件\gui\widgets + Sources\gui\widgets - 源文件\gui\widgets + Sources\gui\widgets - 源文件\gui\widgets + Sources\gui\widgets - 源文件\gui\widgets + Sources\gui\widgets - 源文件\gui\widgets + Sources\gui\widgets - 源文件\gui\widgets + Sources\gui\widgets - 源文件\gui\widgets + Sources\gui\widgets - 源文件\gui\widgets + Sources\gui\widgets - 源文件\gui\widgets + Sources\gui\widgets - 源文件\gui\widgets + Sources\gui\widgets - 源文件\gui\widgets + Sources\gui\widgets - 源文件\gui\widgets + Sources\gui\widgets - 源文件\gui\widgets + Sources\gui\widgets - 源文件\gui\widgets + Sources\gui\widgets - 源文件\gui\widgets + Sources\gui\widgets - 源文件\gui\widgets + Sources\gui\widgets - 源文件\gui\widgets + Sources\gui\widgets - 源文件\gui\widgets + Sources\gui\widgets - 源文件\gui\widgets + Sources\gui\widgets - 源文件\gui\widgets + Sources\gui\widgets - 源文件\paint\detail + Sources\paint\detail - 源文件\paint\detail + Sources\paint\detail - 源文件\paint + Sources\paint - 源文件\paint + Sources\paint - 源文件\paint + Sources\paint - 源文件\paint + Sources\paint - 源文件\paint + Sources\paint - 源文件\system + Sources\system - 源文件\system + Sources\system - 源文件\system + Sources\system - 源文件\system + Sources\system - 源文件\threads + Sources\threads - 源文件\detail + Sources\detail + + + Sources\gui + + + Sources\gui + + + Sources\gui + + + Sources\gui + + + Sources\gui + + + Sources\gui + + + Sources\gui + + + Sources\gui + + + Sources\gui + + + Sources\gui + + + Sources\gui + + + Sources\gui + + + Sources\gui + + + Sources\gui + + + Sources\gui + + + Sources\gui + + + Sources\gui \ No newline at end of file diff --git a/include/nana/c++defines.hpp b/include/nana/c++defines.hpp index a849dfaa..4c7a244e 100644 --- a/include/nana/c++defines.hpp +++ b/include/nana/c++defines.hpp @@ -36,7 +36,7 @@ * - STD_TO_STRING_NOT_SUPPORTED (MinGW with GCC < 4.8) * - STD_FILESYSTEM_NOT_SUPPORTED (GCC < 5.3) .... * - CXX_NO_INLINE_NAMESPACE (Visual C++ < 2015) - * - _enable_std_make_unique (GCC < 4.9) + * - _enable_std_make_unique (__cpluscplus < 201402) * - _enable_std_put_time (GCC < 5) * - _enable_std_clamp (Visual C++ < 2017) */ @@ -118,13 +118,6 @@ #if defined(__GLIBCPP__) || defined(__GLIBCXX__) // is a known issue on libstdc++, it works on libc++ #define STD_CODECVT_NOT_SUPPORTED - - #if !defined(__cpp_lib_make_unique) || (__cpp_lib_make_unique != 201304) - #ifndef _enable_std_make_unique - #define _enable_std_make_unique - #endif - #endif - #endif #elif defined(__GNUC__) //GCC @@ -149,20 +142,15 @@ # define _enable_std_put_time # endif - #if ((__GNUC__ > 5) || ((__GNUC__ == 5) && (__GNUC_MINOR__ >= 3 ) ) ) - # undef STD_FILESYSTEM_NOT_SUPPORTED - /// \todo define the namespace ???? - #endif +# if ((__GNUC__ > 5) || ((__GNUC__ == 5) && (__GNUC_MINOR__ >= 3 ) ) ) +# undef STD_FILESYSTEM_NOT_SUPPORTED +# endif #if (__GNUC__ == 4) #if ((__GNUC_MINOR__ < 8) || (__GNUC_MINOR__ == 8 && __GNUC_PATCHLEVEL__ < 1)) #define STD_THREAD_NOT_SUPPORTED #endif - #if (__GNUC_MINOR__ < 9) - #define _enable_std_make_unique - #endif - #if defined(NANA_MINGW) #ifndef __MINGW64_VERSION_MAJOR //It's a knonwn issue under MinGW(except MinGW-W64) @@ -191,20 +179,23 @@ # endif #endif + +//Detects the feature std::make_unique +//std::make_unique has been provided by Visual C++ 2013 and later +#undef _enable_std_make_unique +#if (defined(__clang__) && (__cplusplus < 201305L || (__cplusplus == 201305L && (__clang_major__ * 100 + __clang_minor__ < 304 )))) \ + || ((!defined(__clang__)) && defined(__GNUC__) && __cplusplus < 201300L) +# define _enable_std_make_unique +#endif + + //Detects the feature std::clamp - //Visual C++ 2017 with /std:c++latest provides the std::clamp -#if !defined(_MSVC_LANG) || (_MSVC_LANG < 201403L) - -// std::clamp's feature test macro is defined inside -// But nana still avoids introducing on MSVC. -# ifndef _MSC_VER -# include -# endif - -# if ((!defined(__cpp_lib_clamp)) || (__cpp_lib_clamp < 201603)) && (!defined(_enable_std_clamp)) -# define _enable_std_clamp -# endif +#undef _enable_std_clamp +#if (defined(_MSC_VER) && ((!defined(_MSVC_LANG)) || _MSVC_LANG < 201403L)) \ + || (defined(__clang__) && (__cplusplus < 201406L)) \ + || (defined(__GNUC__) && (!defined(__clang__)) && (__cplusplus < 201703)) +# define _enable_std_clamp #endif diff --git a/include/nana/filesystem/filesystem.hpp b/include/nana/filesystem/filesystem.hpp index 836b7778..59020d68 100644 --- a/include/nana/filesystem/filesystem.hpp +++ b/include/nana/filesystem/filesystem.hpp @@ -22,9 +22,9 @@ // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4099.html --- in html format // http://article.gmane.org/gmane.comp.lib.boost.devel/256220 --- The filesystem TS unanimously approved by ISO. // http://theboostcpplibraries.com/boost.filesystem --- Boost docs -// http://www.boost.org/doc/libs/1_58_0/libs/filesystem/doc/index.htm --- +// http://www.boost.org/doc/libs/1_58_0/libs/filesystem/doc/index.htm --- // http://www.boost.org/doc/libs/1_34_0/libs/filesystem/doc/index.htm -// http://www.boost.org/doc/libs/1_58_0/boost/filesystem.hpp +// http://www.boost.org/doc/libs/1_58_0/boost/filesystem.hpp // https://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#status.iso.200x --- Table 1.4. g++ C++ Technical Specifications Implementation Status #ifndef NANA_FILESYSTEM_HPP @@ -46,10 +46,10 @@ #if (defined(NANA_FILESYSTEM_FORCE) || ( (defined(STD_FILESYSTEM_NOT_SUPPORTED) && !defined(BOOST_FILESYSTEM_AVAILABLE)) && !(defined(BOOST_FILESYSTEM_FORCE) || defined(STD_FILESYSTEM_FORCE)) ) ) -#undef NANA_USING_NANA_FILESYSTEM +#undef NANA_USING_NANA_FILESYSTEM #define NANA_USING_NANA_FILESYSTEM 1 -#elif (defined(BOOST_FILESYSTEM_AVAILABLE) && ( defined(BOOST_FILESYSTEM_FORCE) || ( defined(STD_FILESYSTEM_NOT_SUPPORTED) && !defined(STD_FILESYSTEM_FORCE) ) )) +#elif (defined(BOOST_FILESYSTEM_AVAILABLE) && ( defined(BOOST_FILESYSTEM_FORCE) || ( defined(STD_FILESYSTEM_NOT_SUPPORTED) && !defined(STD_FILESYSTEM_FORCE) ) )) #undef NANA_USING_BOOST_FILESYSTEM #define NANA_USING_BOOST_FILESYSTEM 1 @@ -65,14 +65,14 @@ namespace std { } // std #else - -#undef NANA_USING_STD_FILESYSTEM -#define NANA_USING_STD_FILESYSTEM 1 -# include +# undef NANA_USING_STD_FILESYSTEM +# define NANA_USING_STD_FILESYSTEM 1 +# include #endif + #ifndef __cpp_lib_experimental_filesystem -# define __cpp_lib_experimental_filesystem 1 +# define __cpp_lib_experimental_filesystem 201406 #endif #if NANA_USING_NANA_FILESYSTEM @@ -96,7 +96,7 @@ namespace nana { namespace experimental { namespace filesystem #endif enum class file_type - { + { none = 0, ///< has not been determined or an error occurred while trying to determine not_found = -1, ///< Pseudo-type: file was not found. Is not considered an error regular = 1, @@ -108,11 +108,11 @@ namespace nana { namespace experimental { namespace filesystem socket =7, unknown= 8 ///< The file does exist, but is of an operating system dependent type not covered by any of the other }; - - enum class perms + + enum class perms { none = 0, ///< There are no permissions set for the file. - all = 0x1FF, ///< owner_all | group_all | others_all + all = 0x1FF, ///< owner_all | group_all | others_all mask = 0xFFF, ///< all | set_uid | set_gid | sticky_bit. unknown = 0xFFFF ///< not known, such as when a file_status object is created without specifying the permissions }; @@ -147,13 +147,13 @@ namespace nana { namespace experimental { namespace filesystem file_type value_; perms perms_; }; - + /// concerned only with lexical and syntactic aspects and does not necessarily exist in - /// external storage, and the pathname is not necessarily valid for the current operating system - /// or for a particular file system - /// A sequence of elements that identify the location of a file within a filesystem. + /// external storage, and the pathname is not necessarily valid for the current operating system + /// or for a particular file system + /// A sequence of elements that identify the location of a file within a filesystem. /// The elements are the: - /// rootname (opt), root-directory (opt), and an optional sequence of filenames. + /// rootname (opt), root-directory (opt), and an optional sequence of filenames. /// The maximum number of elements in the sequence is operating system dependent. class path { @@ -177,7 +177,7 @@ namespace nana { namespace experimental { namespace filesystem // modifiers //void clear() noexcept; - path& make_preferred(); + path& make_preferred(); path& remove_filename(); //path& replace_filename(const path& replacement); //path& replace_extension(const path& replacement = path()); @@ -188,13 +188,13 @@ namespace nana { namespace experimental { namespace filesystem //path root_directory() const; //path root_path() const; //path relative_path() const; - path parent_path() const; - path filename() const; + path parent_path() const; + path filename() const; //path stem() const; - path extension() const; + path extension() const; // query - bool empty() const noexcept; + bool empty() const noexcept; //bool has_root_name() const; //bool has_root_directory() const; //bool has_root_path() const; @@ -228,7 +228,7 @@ namespace nana { namespace experimental { namespace filesystem //appends path& operator/=(const path& other); - + template path& operator/=(const Source& source) { @@ -265,8 +265,8 @@ namespace nana { namespace experimental { namespace filesystem filesystem_error(const std::string& msg, const path& path1, std::error_code err); filesystem_error(const std::string& msg, const path& path1, const path& path2, std::error_code err); - const path& path1() const noexcept; - const path& path2() const noexcept; + const path& path1() const noexcept; + const path& path2() const noexcept; // const char* what() const noexcept; private: path path1_; @@ -307,8 +307,8 @@ namespace nana { namespace experimental { namespace filesystem directory_iterator& operator++(); directory_iterator operator++(int); ///< extention - bool equal(const directory_iterator& x) const; - + bool equal(const directory_iterator& x) const; + private: template static bool _m_ignore(const Char * p) @@ -330,12 +330,12 @@ namespace nana { namespace experimental { namespace filesystem }; /// enable directory_iterator range-based for statements inline directory_iterator begin( directory_iterator iter) noexcept - { + { return iter; } inline directory_iterator end( const directory_iterator&) noexcept - { + { return {}; } @@ -388,7 +388,7 @@ namespace nana { namespace experimental { namespace filesystem if (is_directory(fs)) return (directory_iterator() == directory_iterator(p)); - + return (file_size(p) == 0); } // bool is_empty(const path& p, error_code& ec) noexcept; @@ -400,7 +400,7 @@ namespace nana { namespace experimental { namespace filesystem //bool create_directory(const path& p, error_code& ec) noexcept; bool create_directory(const path& p, const path& attributes); //bool create_directory(const path& p, const path& attributes, error_code& ec) noexcept; - + /// The time of last data modification of p, determined as if by the value of the POSIX /// stat structure member st_mtime obtained as if by POSIX stat(). @@ -412,7 +412,7 @@ namespace nana { namespace experimental { namespace filesystem path current_path(); //path current_path(error_code& ec); void current_path(const path& p); ///< chdir - //void current_path(const path& p, error_code& ec) noexcept; + //void current_path(const path& p, error_code& ec) noexcept; bool remove(const path& p); bool remove(const path& p, std::error_code& ec); // noexcept; @@ -422,7 +422,7 @@ namespace nana { namespace experimental { namespace filesystem template std::basic_string parent_path(const std::basic_string& path) - { + { auto index = path.size(); if (index) diff --git a/include/nana/gui/detail/window_layout.hpp b/include/nana/gui/detail/window_layout.hpp index da099cf5..9d628946 100644 --- a/include/nana/gui/detail/window_layout.hpp +++ b/include/nana/gui/detail/window_layout.hpp @@ -1,6 +1,6 @@ /* * Window Layout Implementation - * Copyright(C) 2003-2016 Jinhao(cnjinhao@hotmail.com) + * Copyright(C) 2003-2017 Jinhao(cnjinhao@hotmail.com) * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at @@ -72,9 +72,17 @@ namespace detail static void make_bground(core_window_t* const); private: - //_m_paste_children - //@brief:paste children window to the root graphics directly. just paste the visual rectangle - static void _m_paste_children(core_window_t*, bool have_refreshed, bool request_refresh_children, const nana::rectangle& parent_rect, nana::paint::graphics& graph, const nana::point& graph_rpos); + /// _m_paste_children + /** + * Pastes children window to the root graphics directly. just paste the visual rectangle + * @param window A handle to the window whose child windows will be pasted to the graph. + * @param has_refreshed Indicates whethere the window has been refreshed. + * @param request_refresh_children A flag indicates whether to refresh its child windows. + * @param parent_rect The child windows which are overlapped with the rectangle will be pasted + * @param graph A graphics object to which the child windows are pasted. + * @param graph_rpos The reference point to the graph. + */ + static void _m_paste_children(core_window_t* window, bool has_refreshed, bool request_refresh_children, const nana::rectangle& parent_rect, nana::paint::graphics& graph, const nana::point& graph_rpos); static void _m_paint_glass_window(core_window_t*, bool is_redraw, bool is_child_refreshed, bool called_by_notify, bool notify_other); diff --git a/include/nana/gui/msgbox.hpp b/include/nana/gui/msgbox.hpp index bb17c448..a53e2264 100644 --- a/include/nana/gui/msgbox.hpp +++ b/include/nana/gui/msgbox.hpp @@ -1,7 +1,7 @@ /* * A Message Box Class * Nana C++ Library(http://www.nanapro.org) -* Copyright(C) 2003-2015 Jinhao(cnjinhao@hotmail.com) +* Copyright(C) 2003-2017 Jinhao(cnjinhao@hotmail.com) * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at @@ -109,6 +109,24 @@ namespace nana virtual unsigned fixed_pixels() const; }; public: + class boolean + : public abstract_content + { + struct implement; + public: + boolean(::std::string label, bool initial_value); + ~boolean(); + + bool value() const; + private: + //Implementation of abstract_content + const ::std::string& label() const override; + window create(window, unsigned label_px) override; + unsigned fixed_pixels() const override; + private: + std::unique_ptr impl_; + }; + class integer : public abstract_content { @@ -122,6 +140,7 @@ namespace nana //Implementation of abstract_content const ::std::string& label() const override; window create(window, unsigned label_px) override; + unsigned fixed_pixels() const override; private: std::unique_ptr impl_; }; @@ -139,6 +158,7 @@ namespace nana //Implementation of abstract_content const ::std::string& label() const override; window create(window, unsigned label_px) override; + unsigned fixed_pixels() const override; private: std::unique_ptr impl_; }; @@ -166,6 +186,7 @@ namespace nana //Implementation of abstract_content const ::std::string& label() const override; window create(window, unsigned label_px) override; + unsigned fixed_pixels() const override; private: std::unique_ptr impl_; }; diff --git a/include/nana/gui/widgets/listbox.hpp b/include/nana/gui/widgets/listbox.hpp index 6215d276..212be2f7 100644 --- a/include/nana/gui/widgets/listbox.hpp +++ b/include/nana/gui/widgets/listbox.hpp @@ -1052,6 +1052,19 @@ namespace nana cat_proxy & select(bool); bool selected() const; + /// Enables/disables the number of items in the category to be displayed behind the category title + cat_proxy& display_number(bool display); + + /// Determines whether the category is expanded. + bool expanded() const; + + /// Expands/collapses the category + /** + * @param expand Indicates whether to expand or collapse the category. If this parameter is true, it expands the category. If the parameter is false, it collapses the category. + * @return the reference of *this. + */ + cat_proxy& expanded(bool expand); + /// Behavior of a container void push_back(std::string text_utf8); @@ -1484,6 +1497,22 @@ the nana::detail::basic_window member pointer scheme void enable_single(bool for_selection, bool category_limited); void disable_single(bool for_selection); export_options& def_export_options(); + + + /// Sets a renderer for category icon + /** + * @param icon_renderer The renderer of category icon + * @return the reference of *this. + */ + listbox& category_icon(std::function icon_renderer); + + /// Sets category icons + /** + * @param img_expanded An icon displayed in front of category title when the category is expanded. + * @param img_collapsed An icon displayed in front of category title when the category is collapsed. + * @return the reference of *this. + */ + listbox& category_icon(const paint::image& img_expanded, const paint::image&& img_collapsed); private: drawerbase::listbox::essence & _m_ess() const; nana::any* _m_anyobj(size_type cat, size_type index, bool allocate_if_empty) const override; diff --git a/include/nana/gui/widgets/skeletons/text_editor.hpp b/include/nana/gui/widgets/skeletons/text_editor.hpp index cf8ee302..a2ab3ea7 100644 --- a/include/nana/gui/widgets/skeletons/text_editor.hpp +++ b/include/nana/gui/widgets/skeletons/text_editor.hpp @@ -86,6 +86,7 @@ namespace nana{ namespace widgets ~text_editor(); size caret_size() const; + const point& content_origin() const; void set_highlight(const ::std::string& name, const ::nana::color&, const ::nana::color&); void erase_highlight(const ::std::string& name); @@ -149,12 +150,13 @@ namespace nana{ namespace widgets void text(std::wstring, bool end_caret); std::wstring text() const; - /// Sets caret position through text coordinate. + /// Moves the caret at specified position /** * @param pos the text position - * @param reset indicates whether to reset the text position by the pos. If this parameter is true, the text position is set by pos. If the parameter is false, it only moves the UI caret to the specified position. + * @param stay_in_view Indicates whether to adjust the view to make the caret in view. This parameter is ignored if the caret is already in view. + * @return true indicates a refresh is required. */ - bool move_caret(const upoint& pos, bool reset = false); + bool move_caret(upoint pos, bool stay_in_view = false); void move_caret_end(bool update); void reset_caret_pixels() const; void reset_caret(bool stay_in_view = false); @@ -211,6 +213,7 @@ namespace nana{ namespace widgets bool mouse_enter(bool entering); bool mouse_move(bool left_button, const point& screen_pos); void mouse_pressed(const arg_mouse& arg); + bool select_word(const arg_mouse& arg); skeletons::textbase& textbase(); const skeletons::textbase& textbase() const; diff --git a/include/nana/gui/widgets/textbox.hpp b/include/nana/gui/widgets/textbox.hpp index 591b4e7e..d0ac2f67 100644 --- a/include/nana/gui/widgets/textbox.hpp +++ b/include/nana/gui/widgets/textbox.hpp @@ -80,6 +80,7 @@ namespace nana void mouse_up(graph_reference, const arg_mouse&) override; void mouse_enter(graph_reference, const arg_mouse&) override; void mouse_leave(graph_reference, const arg_mouse&) override; + void dbl_click(graph_reference, const arg_mouse&) override; void key_press(graph_reference, const arg_keyboard&)override; void key_char(graph_reference, const arg_keyboard&) override; void mouse_wheel(graph_reference, const arg_wheel&) override; @@ -139,6 +140,8 @@ namespace nana colored_area_access_interface* colored_area_access(); + point content_origin() const; + /// Enables/disables the textbox to indent a line. Idents a new line when it is created by pressing enter. /// @param generator generates text for identing a line. If it is empty, textbox indents the line according to last line. textbox& indention(bool, std::function generator = {}); @@ -174,6 +177,9 @@ namespace nana /// Returns true if the caret is in the area of display, false otherwise. bool caret_pos(point& pos, bool text_coordinate) const; + /// Gets the caret position, in text coordinate + upoint caret_pos() const; + /// Sets the caret position with a text position textbox& caret_pos(const upoint&); diff --git a/include/nana/gui/widgets/toolbar.hpp b/include/nana/gui/widgets/toolbar.hpp index 24f27b32..d92c7f8a 100644 --- a/include/nana/gui/widgets/toolbar.hpp +++ b/include/nana/gui/widgets/toolbar.hpp @@ -94,6 +94,7 @@ namespace nana void enable(size_type index, bool enable_state); void scale(unsigned s); ///< Sets the scale of control button. + /// Enable to place buttons at right part. After calling it, every new button is right aligned. void go_right(); bool detached() { return detached_; }; diff --git a/include/nana/gui/widgets/treebox.hpp b/include/nana/gui/widgets/treebox.hpp index a05f52f3..1ddb448d 100644 --- a/include/nana/gui/widgets/treebox.hpp +++ b/include/nana/gui/widgets/treebox.hpp @@ -140,6 +140,7 @@ namespace nana private: //Overrides drawer_trigger methods void attached(widget_reference, graph_reference) override; + void detached() override; void refresh(graph_reference) override; void dbl_click(graph_reference, const arg_mouse&) override; void mouse_down(graph_reference, const arg_mouse&) override; diff --git a/include/nana/paint/graphics.hpp b/include/nana/paint/graphics.hpp index 4eafffa2..8843a03f 100644 --- a/include/nana/paint/graphics.hpp +++ b/include/nana/paint/graphics.hpp @@ -91,7 +91,11 @@ namespace nana const void* pixmap() const; const void* context() const; - void make(const ::nana::size&); ///< Creates a bitmap resource that size is width by height in pixel + /// Creates a graphics/drawable resource + /** + * @param sz The dimension of the graphics to be requested. If sz is empty, it performs as release(). + */ + void make(const ::nana::size& sz); void resize(const ::nana::size&); void typeface(const font&); ///< Selects a specified font type into the graphics object. font typeface() const; diff --git a/source/detail/platform_abstraction.cpp b/source/detail/platform_abstraction.cpp index 40d12d46..6490045c 100644 --- a/source/detail/platform_abstraction.cpp +++ b/source/detail/platform_abstraction.cpp @@ -3,6 +3,11 @@ #include "../paint/truetype.hpp" #ifdef NANA_WINDOWS + +# ifndef _WIN32_WINNT +# define _WIN32_WINNT 0x0501 +# endif + # include /////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -50,6 +55,19 @@ IsWindowsVersionOrGreater(WORD wMajorVersion, WORD wMinorVersion, WORD wServiceP return VerifyVersionInfoW(&osvi, VER_MAJORVERSION | VER_MINORVERSION | VER_SERVICEPACKMAJOR, dwlConditionMask) != FALSE; } +#ifndef _WIN32_WINNT_WINXP +# define _WIN32_WINNT_WINXP 0x0501 +#endif // _WIN32_WINNT_WINXP + +#ifndef _WIN32_WINNT_VISTA +# define _WIN32_WINNT_VISTA 0x0600 +#endif // _WIN32_WINNT_VISTA + +#ifndef _WIN32_WINNT_WIN7 +# define _WIN32_WINNT_WIN7 0x0601 +#endif // _WIN32_WINNT_WIN7 + + VERSIONHELPERAPI IsWindowsXPOrGreater() { @@ -115,24 +133,10 @@ IsWindows8OrGreater() return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN8), LOBYTE(_WIN32_WINNT_WIN8), 0); } -#ifndef _WIN32_WINNT_WINBLUE // (0x0602) +#ifndef _WIN32_WINNT_WINBLUE // (0x0602) #define _WIN32_WINNT_WINBLUE (0x0602) #endif // _WIN32_WINNT_WINBLUE (0x0602) -VERSIONHELPERAPI -IsWindows8Point1OrGreater() -{ - return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINBLUE), LOBYTE(_WIN32_WINNT_WINBLUE), 0); -} - -VERSIONHELPERAPI -IsWindowsServer() -{ - OSVERSIONINFOEXW osvi = { sizeof(osvi), 0, 0, 0, 0, { 0 }, 0, 0, 0, VER_NT_WORKSTATION }; - DWORDLONG const dwlConditionMask = VerSetConditionMask(0, VER_PRODUCT_TYPE, VER_EQUAL); - - return !VerifyVersionInfoW(&osvi, VER_PRODUCT_TYPE, dwlConditionMask); -} #endif // NTDDI_VERSION @@ -398,11 +402,11 @@ namespace nana { if(0 == --(i->second)) fc.erase(i); - + if(0 == fc.size()) ::FcConfigAppFontClear(nullptr); } } #endif } -} \ No newline at end of file +} diff --git a/source/detail/platform_spec_windows.cpp b/source/detail/platform_spec_windows.cpp index eb58c603..4bc09546 100644 --- a/source/detail/platform_spec_windows.cpp +++ b/source/detail/platform_spec_windows.cpp @@ -24,170 +24,6 @@ #include -/////////////////////////////////////////////////////////////////////////////////////////////////////// - -/****************************************************************** -* * -* VersionHelpers.h -- This module defines helper functions to * -* promote version check with proper * -* comparisons. * -* * -* Copyright (c) Microsoft Corp. All rights reserved. * -* * -******************************************************************/ - -#include // for _In_, etc. - -#if !defined(__midl) && !defined(SORTPP_PASS) - -#if (NTDDI_VERSION >= NTDDI_WINXP) - -#ifdef __cplusplus - -#define VERSIONHELPERAPI inline bool - -#else // __cplusplus - -#define VERSIONHELPERAPI FORCEINLINE BOOL - -#endif // __cplusplus - -VERSIONHELPERAPI -IsWindowsVersionOrGreater(WORD wMajorVersion, WORD wMinorVersion, WORD wServicePackMajor) -{ - OSVERSIONINFOEXW osvi = { sizeof(osvi), 0, 0, 0, 0,{ 0 }, 0, 0 }; - DWORDLONG const dwlConditionMask = VerSetConditionMask( - VerSetConditionMask( - VerSetConditionMask( - 0, VER_MAJORVERSION, VER_GREATER_EQUAL), - VER_MINORVERSION, VER_GREATER_EQUAL), - VER_SERVICEPACKMAJOR, VER_GREATER_EQUAL); - - osvi.dwMajorVersion = wMajorVersion; - osvi.dwMinorVersion = wMinorVersion; - osvi.wServicePackMajor = wServicePackMajor; - - return VerifyVersionInfoW(&osvi, VER_MAJORVERSION | VER_MINORVERSION | VER_SERVICEPACKMAJOR, dwlConditionMask) != FALSE; -} - -VERSIONHELPERAPI -IsWindowsXPOrGreater() -{ - return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), LOBYTE(_WIN32_WINNT_WINXP), 0); -} - -VERSIONHELPERAPI -IsWindowsXPSP1OrGreater() -{ - return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), LOBYTE(_WIN32_WINNT_WINXP), 1); -} - -VERSIONHELPERAPI -IsWindowsXPSP2OrGreater() -{ - return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), LOBYTE(_WIN32_WINNT_WINXP), 2); -} - -VERSIONHELPERAPI -IsWindowsXPSP3OrGreater() -{ - return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), LOBYTE(_WIN32_WINNT_WINXP), 3); -} - -VERSIONHELPERAPI -IsWindowsVistaOrGreater() -{ - return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_VISTA), LOBYTE(_WIN32_WINNT_VISTA), 0); -} - -VERSIONHELPERAPI -IsWindowsVistaSP1OrGreater() -{ - return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_VISTA), LOBYTE(_WIN32_WINNT_VISTA), 1); -} - -VERSIONHELPERAPI -IsWindowsVistaSP2OrGreater() -{ - return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_VISTA), LOBYTE(_WIN32_WINNT_VISTA), 2); -} - -VERSIONHELPERAPI -IsWindows7OrGreater() -{ - return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN7), LOBYTE(_WIN32_WINNT_WIN7), 0); -} - -VERSIONHELPERAPI -IsWindows7SP1OrGreater() -{ - return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN7), LOBYTE(_WIN32_WINNT_WIN7), 1); -} - -#ifndef _WIN32_WINNT_WIN8 // (0x0602) - #define _WIN32_WINNT_WIN8 (0x0602) -#endif // _WIN32_WINNT_WIN8(0x0602) - -VERSIONHELPERAPI -IsWindows8OrGreater() -{ - - return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN8), LOBYTE(_WIN32_WINNT_WIN8), 0); -} - -#ifndef _WIN32_WINNT_WINBLUE // (0x0602) - #define _WIN32_WINNT_WINBLUE (0x0602) -#endif // _WIN32_WINNT_WINBLUE (0x0602) - -VERSIONHELPERAPI -IsWindows8Point1OrGreater() -{ - return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINBLUE), LOBYTE(_WIN32_WINNT_WINBLUE), 0); -} - -VERSIONHELPERAPI -IsWindowsServer() -{ - OSVERSIONINFOEXW osvi = { sizeof(osvi), 0, 0, 0, 0,{ 0 }, 0, 0, 0, VER_NT_WORKSTATION }; - DWORDLONG const dwlConditionMask = VerSetConditionMask(0, VER_PRODUCT_TYPE, VER_EQUAL); - - return !VerifyVersionInfoW(&osvi, VER_PRODUCT_TYPE, dwlConditionMask); -} - -#endif // NTDDI_VERSION - -#endif // defined(__midl) - - - -//////////////////////////////////////////////////////////////////////////////////////////////////// - - - -//#if defined(_MSC_VER) -////#include -//bool IsWindowsVistaOrGreater() { return false; } -//bool //VERSIONHELPERAPI -//IsWindowsVersionOrGreater(WORD wMajorVersion, WORD wMinorVersion, WORD wServicePackMajor) -//{ -// OSVERSIONINFOEXW osvi = { sizeof(osvi), 0, 0, 0, 0,{ 0 }, 0, 0 }; -// DWORDLONG const dwlConditionMask = VerSetConditionMask( -// VerSetConditionMask( -// VerSetConditionMask( -// 0, VER_MAJORVERSION, VER_GREATER_EQUAL), -// VER_MINORVERSION, VER_GREATER_EQUAL), -// VER_SERVICEPACKMAJOR, VER_GREATER_EQUAL); -// -// osvi.dwMajorVersion = wMajorVersion; -// osvi.dwMinorVersion = wMinorVersion; -// osvi.wServicePackMajor = wServicePackMajor; -// -// return VerifyVersionInfoW(&osvi, VER_MAJORVERSION | VER_MINORVERSION | VER_SERVICEPACKMAJOR, dwlConditionMask) != FALSE; -//} -// -// -// -//#endif // _MSVC namespace nana { diff --git a/source/gui/detail/window_layout.cpp b/source/gui/detail/window_layout.cpp index 2596f67e..72195e66 100644 --- a/source/gui/detail/window_layout.cpp +++ b/source/gui/detail/window_layout.cpp @@ -1,7 +1,7 @@ /* * Window Layout Implementation * Nana C++ Library(http://www.nanapro.org) -* Copyright(C) 2003-2016 Jinhao(cnjinhao@hotmail.com) +* Copyright(C) 2003-2017 Jinhao(cnjinhao@hotmail.com) * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at @@ -266,8 +266,6 @@ namespace nana wd->effect.bground->take_effect(reinterpret_cast(wd), glass_buffer); } - //_m_paste_children - //@brief:paste children window to the root graphics directly. just paste the visual rectangle void window_layout::_m_paste_children(core_window_t* wd, bool have_refreshed, bool req_refresh_children, const nana::rectangle& parent_rect, nana::paint::graphics& graph, const nana::point& graph_rpos) { nana::rectangle rect; @@ -287,12 +285,10 @@ namespace nana { if (overlap(nana::rectangle{ child->pos_root, child->dimension }, parent_rect, rect)) { - bool have_child_refreshed = false; if (category::flags::lite_widget != child->other.category) { if (req_refresh_children && (false == child->flags.refreshing)) { - have_child_refreshed = true; child->flags.refreshing = true; child->drawer.refresh(); child->flags.refreshing = false; @@ -301,7 +297,9 @@ namespace nana graph.bitblt(nana::rectangle(rect.x - graph_rpos.x, rect.y - graph_rpos.y, rect.width, rect.height), child->drawer.graphics, nana::point(rect.x - child->pos_root.x, rect.y - child->pos_root.y)); } - _m_paste_children(child, req_refresh_children, have_child_refreshed, rect, graph, graph_rpos); + //req_refresh_children determines whether the child has been refreshed, and also determines whether + //the children of child to be refreshed. + _m_paste_children(child, req_refresh_children, req_refresh_children, rect, graph, graph_rpos); } } else diff --git a/source/gui/msgbox.cpp b/source/gui/msgbox.cpp index 6560fe93..f978bf1a 100644 --- a/source/gui/msgbox.cpp +++ b/source/gui/msgbox.cpp @@ -1,7 +1,7 @@ /* * A Message Box Class * Nana C++ Library(http://www.nanapro.org) - * Copyright(C) 2003-2016 Jinhao(cnjinhao@hotmail.com) + * Copyright(C) 2003-2017 Jinhao(cnjinhao@hotmail.com) * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at @@ -14,11 +14,11 @@ #include #include #include +#include #include #include #include #include -#include #include #include #include @@ -511,7 +511,6 @@ namespace nana unsigned height = 20 + desc_extent.height + 10 + 38; - place_.bind(*this); std::stringstream ss_content; ss_content << " 27) px = each_height[i]; - ss_content << ""; + ss_content << ""; height += px + 1; } ss_content << ">>>"; - if (desc_extent.width < 170) - desc_extent.width = 170; + if (desc_extent.width < 200) + desc_extent.width = 200; //Make sure the complete display of input extent if (desc_extent.width < fixed_pixels) @@ -598,9 +597,10 @@ namespace nana std::stringstream ss; ss << "vert<"<>"; - place_.div(ss.str().data()); - place_["desc"] << desc_; - place_["buttons"] << btn_ok_ << btn_cancel_; + auto& place = this->get_place(); + place.div(ss.str().c_str()); + place["desc"] << desc_; + place["buttons"] << btn_ok_ << btn_cancel_; const char * img_fields[4] = {"img_top", "img_bottom", "img_left", "img_right"}; @@ -611,11 +611,10 @@ namespace nana images_[i].create(*this, true); images_[i].load(imgs[i], valid_areas[i]); images_[i].stretchable(0, 0, 0, 0); - place_[img_fields[i]] << images_[i]; - place_.field_display(img_fields[i], true); + place[img_fields[i]] << images_[i]; } - else - place_.field_display(img_fields[i], false); + + place.field_display(img_fields[i], imgs[i]); } move(API::make_center(this->owner(), desc_extent.width, height)); @@ -626,14 +625,14 @@ namespace nana { verifier_ = std::move(verifier); - std::size_t index = 0; + unsigned index = 0; for (auto wd : inputs) { std::stringstream ss; ss << "input_" << index++; - place_[ss.str().data()] << wd; + this->operator[](ss.str().data()) << wd; } - place_.collocate(); + this->collocate(); show(); } @@ -646,7 +645,6 @@ namespace nana ::nana::button btn_ok_; ::nana::button btn_cancel_; bool valid_input_{ false }; - ::nana::place place_; std::function verifier_; ::nana::picture images_[4]; }; @@ -656,6 +654,70 @@ namespace nana return 0; } + //class boolean + struct inputbox::boolean::implement + { + bool value; + ::std::string empty_label_text; + ::std::string label_text; + ::nana::panel dock; + ::nana::checkbox checkbox; + }; + + inputbox::boolean::boolean(::std::string label, bool initial_value) + : impl_(new implement) + { + impl_->value = initial_value; + impl_->label_text = std::move(label); + impl_->empty_label_text = " "; + } + + inputbox::boolean::~boolean() + {} + + bool inputbox::boolean::value() const + { + return (impl_->checkbox.empty() ? impl_->value : impl_->checkbox.checked()); + } + + //Implementation of abstract_content + const ::std::string& inputbox::boolean::label() const + { + return impl_->empty_label_text; + } + + window inputbox::boolean::create(window owner, unsigned label_px) + { + auto impl = impl_.get(); + + impl->dock.create(owner); + + paint::graphics graph{ ::nana::size{ 10, 10 } }; + auto value_px = graph.text_extent_size(impl->label_text).width + 20; + + impl->checkbox.create(impl->dock, rectangle{ (std::max)(static_cast(label_px) - 18, 0), 0, value_px, 0 }); + impl->checkbox.check(impl->value); + impl->checkbox.caption(impl->label_text); + + impl->dock.events().resized.connect_unignorable([impl, value_px](const ::nana::arg_resized&) + { + impl->checkbox.size({ value_px, 24 }); + }); + + impl->checkbox.events().destroy.connect_unignorable([impl](const arg_destroy&) + { + impl->value = impl->checkbox.checked(); + }); + + return impl->dock; + } + + unsigned inputbox::boolean::fixed_pixels() const + { + paint::graphics graph{ ::nana::size{ 10, 10 } }; + return graph.text_extent_size(impl_->label_text).width; + } + //class integer struct inputbox::integer::implement { @@ -708,20 +770,17 @@ namespace nana impl->label.caption(impl->label_text); impl->label.format(true); - //get the longest value - int longest = (std::abs(static_cast(impl->begin < 0 ? impl->begin * 10 : impl->begin)) < std::abs(static_cast(impl->last < 0 ? impl->last * 10 : impl->last)) ? impl->last : impl->begin); - paint::graphics graph{ ::nana::size{ 10, 10 } }; - auto value_px = graph.text_extent_size(std::to_wstring(longest)).width + 34; + auto const value_px = fixed_pixels(); impl->spinbox.create(impl->dock, rectangle{ static_cast(label_px + 10), 0, value_px, 0 }); impl->spinbox.range(impl->begin, impl->last, impl->step); impl->spinbox.value(std::to_string(impl->value)); - impl->dock.events().resized.connect_unignorable([impl, label_px, value_px](const ::nana::arg_resized&) + impl->dock.events().resized.connect_unignorable([impl, label_px, value_px](const ::nana::arg_resized& arg) { - impl->label.size({ label_px, 24 }); - impl->spinbox.size({ value_px, 24 }); + impl->label.size({ label_px, arg.height }); + impl->spinbox.move({static_cast(label_px + 10), (static_cast(arg.height) - 25) / 2, value_px, 24 }); }); impl->spinbox.events().destroy.connect_unignorable([impl](const arg_destroy&) @@ -731,6 +790,14 @@ namespace nana return impl->dock; } + + unsigned inputbox::integer::fixed_pixels() const + { + //get the longest value + int longest = (std::abs(static_cast(impl_->begin < 0 ? impl_->begin * 10 : impl_->begin)) < std::abs(static_cast(impl_->last < 0 ? impl_->last * 10 : impl_->last)) ? impl_->last : impl_->begin); + paint::graphics graph{ ::nana::size{ 10, 10 } }; + return graph.text_extent_size(std::to_wstring(longest)).width + 34; + } //end class integer @@ -786,20 +853,17 @@ namespace nana impl->label.caption(impl->label_text); impl->label.format(true); - //get the longest value - auto longest = (std::abs(static_cast(impl->begin < 0 ? impl->begin * 10 : impl->begin)) < std::abs(static_cast(impl->last < 0 ? impl->last * 10 : impl->last)) ? impl->last : impl->begin); - paint::graphics graph{ ::nana::size{ 10, 10 } }; - auto value_px = graph.text_extent_size(std::to_wstring(longest)).width + 34; + auto value_px = fixed_pixels(); impl->spinbox.create(impl->dock, rectangle{ static_cast(label_px + 10), 0, value_px, 0 }); impl->spinbox.range(impl->begin, impl->last, impl->step); impl->spinbox.value(std::to_string(impl->value)); - impl->dock.events().resized.connect_unignorable([impl, label_px, value_px](const ::nana::arg_resized&) + impl->dock.events().resized.connect_unignorable([impl, label_px, value_px](const ::nana::arg_resized& arg) { - impl->label.size(::nana::size{ label_px, 24 }); - impl->spinbox.size(::nana::size{ value_px, 24 }); + impl->label.size({ label_px, arg.height }); + impl->spinbox.move({ static_cast(label_px + 10), (static_cast(arg.height) - 25) / 2, value_px, 24 }); }); impl->spinbox.events().destroy.connect_unignorable([impl](const arg_destroy&) @@ -809,6 +873,14 @@ namespace nana return impl->dock; } + + unsigned inputbox::real::fixed_pixels() const + { + //get the longest value + auto longest = (std::abs(static_cast(impl_->begin < 0 ? impl_->begin * 10 : impl_->begin)) < std::abs(static_cast(impl_->last < 0 ? impl_->last * 10 : impl_->last)) ? impl_->last : impl_->begin); + paint::graphics graph{ ::nana::size{ 10, 10 } }; + return graph.text_extent_size(std::to_wstring(longest)).width + 34; + } //end class real @@ -890,7 +962,7 @@ namespace nana impl->label.caption(impl->label_text); impl->label.format(true); - unsigned value_px = 0; + unsigned const value_px = fixed_pixels(); if (impl->options.empty()) { impl->textbox.create(impl->dock, rectangle{ static_cast(label_px + 10), 0, 0, 0 }); @@ -901,16 +973,6 @@ namespace nana } else { - //get the longest value - paint::graphics graph{ ::nana::size{ 10, 10 } }; - for (auto & s : impl->options) - { - auto px = graph.text_extent_size(s).width; - if (px > value_px) - value_px = px; - } - value_px += 34; - impl->combox.create(impl->dock, rectangle{ static_cast(label_px + 10), 0, value_px, 0 }); for (auto & s : impl->options) @@ -922,10 +984,10 @@ namespace nana impl->dock.events().resized.connect_unignorable([impl, label_px, value_px](const ::nana::arg_resized& arg) { impl->label.size({ label_px, arg.height }); - if (value_px) - impl->combox.size({ value_px, 24 }); + if (impl->textbox.empty()) + impl->combox.move({static_cast(label_px + 10), (static_cast(arg.height) - 25) / 2, value_px, 24 }); else - impl->textbox.size({arg.width - label_px - 10, 24}); + impl->textbox.move({ static_cast(label_px + 10), (static_cast(arg.height) - 25) / 2, arg.width - label_px - 10, 24 }); }); auto & wdg = (value_px ? static_cast(impl->combox) : static_cast(impl->textbox)); @@ -935,6 +997,24 @@ namespace nana }); return impl->dock; } + + unsigned inputbox::text::fixed_pixels() const + { + if (impl_->options.empty()) + return 0; + + paint::graphics graph{ ::nana::size{ 10, 10 } }; + unsigned long_px = 0; + //get the longest value + for (auto & s : impl_->options) + { + auto px = graph.text_extent_size(s).width; + if (px > long_px) + long_px = px; + } + + return long_px + 34; + } //end class text @@ -1031,17 +1111,18 @@ namespace nana impl->dock.events().resized.connect_unignorable([impl, label_px](const ::nana::arg_resized& arg) { impl->label.size({ label_px, arg.height }); - auto sz = impl->wdg_month.size(); - sz.height = 24; - impl->wdg_month.size(sz); - sz = impl->wdg_day.size(); - sz.height = 24; - impl->wdg_day.size(sz); + rectangle rt{static_cast(label_px + 10), (static_cast(arg.height) - 25) / 2, 94, 24}; - sz = impl->wdg_year.size(); - sz.height = 24; - impl->wdg_year.size(sz); + impl->wdg_month.move(rt); + + rt.x += 104; + rt.width = 38; + impl->wdg_day.move(rt); + + rt.x += 48; + rt.width = 50; + impl->wdg_year.move(rt); }); auto destroy_fn = [impl](const arg_destroy& arg) @@ -1155,8 +1236,13 @@ namespace nana impl->dock.events().resized.connect_unignorable([impl, label_px](const ::nana::arg_resized& arg) { impl->label.size({ label_px, arg.height }); - impl->path_edit.size({arg.width - label_px - 75, arg.height}); - impl->browse.move({static_cast(arg.width - 60), 0, 60, arg.height}); + + rectangle rt{ static_cast(label_px)+10, (static_cast(arg.height) - 25), arg.width - label_px - 75, 24}; + impl->path_edit.move(rt); + + rt.x = static_cast(arg.width - 60); + rt.width = 60; + impl->browse.move(rt); }); impl->path_edit.events().destroy.connect_unignorable([impl](const arg_destroy&) @@ -1202,6 +1288,8 @@ namespace nana std::vector each_pixels; unsigned label_px = 0, fixed_px = 0; paint::graphics graph({ 5, 5 }); + + bool has_0_fixed_px = false; for (auto p : contents) { auto px = label::measure(graph, p->label(), 150, true, align::right, align_v::center); @@ -1209,12 +1297,17 @@ namespace nana label_px = px.width; px.width = p->fixed_pixels(); + has_0_fixed_px |= (px.width == 0); if (px.width > fixed_px) fixed_px = px.width; each_pixels.push_back(px.height); } + //Adjust the fixed_px for good looking + if (has_0_fixed_px && (fixed_px < 100)) + fixed_px = 100; + inputbox_window input_wd(owner_, images_, valid_areas_, description_, title_, contents.size(), label_px + 10 + fixed_px, each_pixels); std::vector inputs; diff --git a/source/gui/place_parts.hpp b/source/gui/place_parts.hpp index 3dde6ca9..4511dc95 100644 --- a/source/gui/place_parts.hpp +++ b/source/gui/place_parts.hpp @@ -557,7 +557,10 @@ namespace nana }value_; };//end class number_t - + /// Margin attribute + /** + * Definition at https://github.com/cnjinhao/nana/wiki/Div-Text#margin + */ class margin { public: @@ -598,7 +601,7 @@ namespace nana { case 0: break; case 1: //top - il = ir = it = ib = 0; + it = 0; break; case 2://top,bottom and left,right it = ib = 0; @@ -624,7 +627,7 @@ namespace nana case 3: //left pos = il; break; default: - return number_t{}; + return {}; } return (-1 == pos ? number_t{} : margins_[pos]); @@ -652,7 +655,7 @@ namespace nana { case 0: break; case 1: //top - il = ir = it = ib = 0; + it = 0; break; case 2://top,bottom and left,right it = ib = 0; diff --git a/source/gui/screen.cpp b/source/gui/screen.cpp index da390bda..d66629d3 100644 --- a/source/gui/screen.cpp +++ b/source/gui/screen.cpp @@ -100,14 +100,14 @@ namespace nana tmp.swap(displays); } - static BOOL __stdcall enum_proc(HMONITOR handle, HDC context, LPRECT r, LPARAM self_ptr) + static BOOL __stdcall enum_proc(HMONITOR handle, HDC /*context*/, LPRECT /*r*/, LPARAM self_ptr) { auto disp_cont = reinterpret_cast*>(self_ptr); MONITORINFOEX mi; mi.cbSize = sizeof(MONITORINFOEX); if (::GetMonitorInfo(handle, &mi)) disp_cont->emplace_back(disp_cont->size(), mi); - + return TRUE; } #else diff --git a/source/gui/timer.cpp b/source/gui/timer.cpp index e961f6e9..e5ea14e3 100644 --- a/source/gui/timer.cpp +++ b/source/gui/timer.cpp @@ -142,7 +142,7 @@ namespace nana }; //end class timer_core #if defined(NANA_WINDOWS) - void __stdcall timer_driver::_m_timer_proc(HWND hwnd, UINT uMsg, UINT_PTR id, DWORD dwTime) + void __stdcall timer_driver::_m_timer_proc(HWND /*hwnd*/, UINT /*uMsg*/, UINT_PTR id, DWORD /*dwTime*/) #else void timer_driver::_m_timer_proc(std::size_t id) #endif diff --git a/source/gui/widgets/listbox.cpp b/source/gui/widgets/listbox.cpp index 078cd6c8..5bb523a9 100644 --- a/source/gui/widgets/listbox.cpp +++ b/source/gui/widgets/listbox.cpp @@ -659,7 +659,8 @@ namespace nana std::unique_ptr model_ptr; - bool expand{true}; + bool expand{ true }; + bool display_number{ true }; //A cat may have a key object to identify the category std::shared_ptr key_ptr; @@ -1434,7 +1435,8 @@ namespace nana bool expand(size_type cat, bool exp) noexcept { - if(good(cat) && cat) + //It is allowed to expand the 1st category. + if(good(cat) && (cat || exp)) { auto & expanded = get(cat)->expand; if(expanded != exp) @@ -1937,6 +1939,8 @@ namespace nana std::unique_ptr content_view; + std::function ctg_icon_renderer; ///< Renderer for the category icon + struct mouse_selection_part { bool started{ false }; @@ -2848,8 +2852,37 @@ namespace nana this->expand(pos.cat, true); ess_->calc_content_size(); } + else if (!ess_->auto_draw) + { + //force a update of content size and scrollbar status when auto_draw is false to make + //sure that the scroll function works fine. + ess_->calc_content_size(); + } - ess_->content_view->turn_page(to_bottom, false); + auto origin = ess_->content_view->origin(); + origin.y = 0; + + auto off = this->distance(this->first(), pos) * ess_->item_height(); + + auto screen_px = ess_->content_view->view_area().height; + + if (to_bottom) + { + off += ess_->item_height(); + if (off >= screen_px) + origin.y = static_cast(off - screen_px); + } + else + { + auto last_off = this->distance(this->first(), this->last()) * ess_->item_height(); + if (last_off - off >= screen_px) + origin.y = static_cast(off); + else if (last_off >= screen_px) + origin.y = static_cast(last_off - screen_px); + } + + if(ess_->content_view->move_origin(origin - ess_->content_view->origin())) + ess_->content_view->sync(false); } void es_lister::erase(const index_pair& pos) @@ -3514,27 +3547,36 @@ namespace nana color txt_color{ static_cast(0x3399) }; - facade arrow("double"); - arrow.direction(categ.expand ? ::nana::direction::north : ::nana::direction::south); - arrow.draw( *graph, {}, txt_color, - { x + 5, y + static_cast(item_height - 16) / 2, 16, 16 }, - element_state::normal); + //Area of category icon + rectangle rt_ctg_icon{ x + 5, y + static_cast(item_height - 16) / 2, 16, 16 }; + + if (essence_->ctg_icon_renderer) + { + essence_->ctg_icon_renderer(*graph, rt_ctg_icon, categ.expand); + } + else + { + facade arrow("double"); + arrow.direction(categ.expand ? ::nana::direction::south : ::nana::direction::east); + arrow.draw(*graph, {}, txt_color, rt_ctg_icon, element_state::normal); + } graph->string({ x + 20, y + txtoff }, categ.text, txt_color); - native_string_type str = to_nstring('(' + std::to_string(categ.items.size()) + ')'); - - auto text_s = graph->text_extent_size(categ.text).width; - auto extend_text_w = text_s + graph->text_extent_size(str).width; - - graph->string({ x + 25 + static_cast(text_s), y + txtoff }, str); - - if (35 + extend_text_w < width) + auto text_px = graph->text_extent_size(categ.text).width; + if (categ.display_number) { - ::nana::point pos{ x + 30 + static_cast(extend_text_w), y + static_cast(item_height) / 2 }; + //Display the number of items in the category + native_string_type str = to_nstring('(' + std::to_string(categ.items.size()) + ')'); + graph->string({ x + 25 + static_cast(text_px), y + txtoff }, str); + text_px += graph->text_extent_size(str).width; + } - graph->line(pos, { x + static_cast(width) - 5, pos.y }, - txt_color); + if (35 + text_px < width) + { + ::nana::point pos{ x + 30 + static_cast(text_px), y + static_cast(item_height) / 2 }; + + graph->line(pos, { x + static_cast(width) - 5, pos.y }, txt_color); } //Draw selecting inner rectangle @@ -4488,8 +4530,10 @@ namespace nana //pos_ never represents a category if this item_proxy is available. auto & m = cat_->items.at(pos_.item); // a ref to the real item + + //ignore if no change if(m.flags.selected == s) - return *this; // ignore if no change + return *this; m.flags.selected = s; // actually change selection @@ -4503,14 +4547,8 @@ namespace nana else if (ess_->lister.latest_selected_abs == pos_) ess_->lister.latest_selected_abs.set_both(npos); - if (scroll_view) - { - if (ess_->lister.get(pos_.cat)->expand) - ess_->lister.get(pos_.cat)->expand = false; - - if (!this->displayed()) - ess_->lister.scroll(pos_, !(ess_->first_display() > this->to_display())); - } + if (scroll_view && (!this->displayed())) + ess_->lister.scroll(pos_, !(ess_->first_display() > this->to_display())); ess_->update(); return *this; @@ -4788,6 +4826,32 @@ namespace nana return true; } + cat_proxy& cat_proxy::display_number(bool display) + { + if (cat_->display_number != display) + { + cat_->display_number = display; + ess_->update(); + } + return *this; + } + + bool cat_proxy::expanded() const + { + return cat_->expand; + } + + cat_proxy& cat_proxy::expanded(bool expand) + { + //The first category isn't allowed to be collapsed + if ((expand != cat_->expand) && pos_) + { + cat_->expand = expand; + ess_->update(); + } + return *this; + } + auto cat_proxy::columns() const -> size_type { return ess_->header.cont().size(); @@ -5559,6 +5623,32 @@ namespace nana return _m_ess().def_exp_options; } + listbox& listbox::category_icon(std::function icon_renderer) + { + _m_ess().ctg_icon_renderer.swap(icon_renderer); + _m_ess().update(); + return *this; + } + + listbox& listbox::category_icon(const paint::image& img_expanded, const paint::image&& img_collapsed) + { + _m_ess().ctg_icon_renderer = [img_expanded, img_collapsed](paint::graphics& graph, const rectangle& rt_icon, bool expanded) + { + if (expanded) + { + img_expanded.stretch(rectangle{ img_expanded.size() }, graph, rt_icon); + } + else + { + img_collapsed.stretch(rectangle{ img_collapsed.size() }, graph, rt_icon); + } + }; + + _m_ess().update(); + return *this; + } + + drawerbase::listbox::essence & listbox::_m_ess() const { return get_drawer_trigger().ess(); diff --git a/source/gui/widgets/skeletons/content_view.cpp b/source/gui/widgets/skeletons/content_view.cpp index 8995944a..b279dc21 100644 --- a/source/gui/widgets/skeletons/content_view.cpp +++ b/source/gui/widgets/skeletons/content_view.cpp @@ -35,6 +35,7 @@ namespace nana { bool drag_started{ false }; point origin; + scrolls enabled_scrolls{scrolls::both}; nana::scroll horz; nana::scroll vert; @@ -193,7 +194,10 @@ namespace nana { this->passive = passive; - if (imd_area.width != disp_area.width) + bool const vert_allowed = (enabled_scrolls == scrolls::vert || enabled_scrolls == scrolls::both); + bool const horz_allowed = (enabled_scrolls == scrolls::horz || enabled_scrolls == scrolls::both); + + if ((imd_area.width != disp_area.width) && vert_allowed) { if (vert.empty()) { @@ -217,10 +221,14 @@ namespace nana { else { vert.close(); - origin.y = 0; + + //If vert is allowed, it indicates the vertical origin is not moved + //Make sure the v origin is zero + if (vert_allowed) + origin.y = 0; } - if (imd_area.height != disp_area.height) + if ((imd_area.height != disp_area.height) && horz_allowed) { if (horz.empty()) { @@ -244,7 +252,10 @@ namespace nana { else { horz.close(); - origin.x = 0; + //If horz is allowed, it indicates the horzontal origin is not moved + //Make sure the x origin is zero + if (horz_allowed) + origin.x = 0; } this->passive = true; @@ -266,6 +277,16 @@ namespace nana { return impl_->events; } + bool content_view::enable_scrolls(scrolls which) + { + if (impl_->enabled_scrolls == which) + return false; + + impl_->enabled_scrolls = which; + impl_->size_changed(false); + return true; + } + void content_view::step(unsigned step_value, bool horz) { if (horz) @@ -383,7 +404,7 @@ namespace nana { void content_view::draw_corner(graph_reference graph) { auto r = corner(); - if(!r.empty()) + if ((!r.empty()) && (scrolls::both == impl_->enabled_scrolls)) graph.rectangle(r, true, colors::button_face); } @@ -394,8 +415,11 @@ namespace nana { rectangle content_view::view_area(const size& alt_content_size) const { - unsigned extra_horz = (impl_->disp_area.width < alt_content_size.width ? space() : 0); - unsigned extra_vert = (impl_->disp_area.height < alt_content_size.height + extra_horz ? space() : 0); + bool const vert_allowed = (impl_->enabled_scrolls == scrolls::vert || impl_->enabled_scrolls == scrolls::both); + bool const horz_allowed = (impl_->enabled_scrolls == scrolls::horz || impl_->enabled_scrolls == scrolls::both); + + unsigned extra_horz = (horz_allowed && (impl_->disp_area.width < alt_content_size.width) ? space() : 0); + unsigned extra_vert = (vert_allowed && (impl_->disp_area.height < alt_content_size.height + extra_horz) ? space() : 0); if ((0 == extra_horz) && extra_vert) extra_horz = (impl_->disp_area.width < alt_content_size.width + extra_vert ? space() : 0); diff --git a/source/gui/widgets/skeletons/content_view.hpp b/source/gui/widgets/skeletons/content_view.hpp index 9abd59a4..c5bcc3da 100644 --- a/source/gui/widgets/skeletons/content_view.hpp +++ b/source/gui/widgets/skeletons/content_view.hpp @@ -40,6 +40,11 @@ namespace skeletons public: using graph_reference = paint::graphics&; + enum class scrolls + { + none, horz, vert, both + }; + struct events_type { ::std::function hover_outside; @@ -51,6 +56,8 @@ namespace skeletons events_type& events(); + bool enable_scrolls(scrolls which); + void step(unsigned step_value, bool horz); bool scroll(bool forwards, bool horz); bool turn_page(bool forwards, bool horz); diff --git a/source/gui/widgets/skeletons/text_editor.cpp b/source/gui/widgets/skeletons/text_editor.cpp index a461137e..bbfed031 100644 --- a/source/gui/widgets/skeletons/text_editor.cpp +++ b/source/gui/widgets/skeletons/text_editor.cpp @@ -8,7 +8,7 @@ * http://www.boost.org/LICENSE_1_0.txt) * * @file: nana/gui/widgets/skeletons/text_editor.cpp - * @contributors: Ariel Vina-Rodriguez + * @contributors: Ariel Vina-Rodriguez, Oleg Smolsky */ #include #include @@ -234,7 +234,7 @@ namespace nana{ namespace widgets } } - editor_.move_caret(editor_.points_.caret); + editor_.reset_caret(); } }; @@ -302,7 +302,7 @@ namespace nana{ namespace widgets editor_.select_.b = sel_b_; } } - editor_.move_caret(editor_.points_.caret); + editor_.reset_caret(); } private: std::wstring text_; @@ -440,7 +440,7 @@ namespace nana{ namespace widgets break; } - return *colored_areas_.emplace(i, + return *colored_areas_.emplace(i, std::make_shared(colored_area_type{line_pos, 1, color{}, color{}}) ); } @@ -497,6 +497,7 @@ namespace nana{ namespace widgets undoable undo; //undo command renderers customized_renderers; std::vector text_position; //positions of text since last rendering. + int text_position_origin{ -1 }; //origin when last text_exposed skeletons::textbase textbase; @@ -1083,6 +1084,11 @@ namespace nana{ namespace widgets return { 1, line_height() }; } + const point& text_editor::content_origin() const + { + return impl_->cview->origin(); + } + void text_editor::set_highlight(const std::string& name, const ::nana::color& fgcolor, const ::nana::color& bgcolor) { if (fgcolor.invisible() && bgcolor.invisible()) @@ -1129,7 +1135,7 @@ namespace nana{ namespace widgets } } } - + colored_area_access_interface& text_editor::colored_area() { return impl_->colored_area; @@ -1273,7 +1279,7 @@ namespace nana{ namespace widgets if (impl_->cview->content_size().empty() || this->attributes_.line_wrapped) _m_reset_content_size(true); - move_caret(points_.caret); + reset_caret(); return true; } @@ -1337,6 +1343,10 @@ namespace nana{ namespace widgets line_wrapped(false); _m_reset_content_size(); + impl_->cview->enable_scrolls(ml ? content_view::scrolls::both : content_view::scrolls::none); + impl_->cview->move_origin(point{} -impl_->cview->origin()); + + impl_->try_refresh = sync_graph::refresh; return true; } @@ -1564,7 +1574,6 @@ namespace nana{ namespace widgets { //no move occurs select(false); - move_caret(_m_coordinate_to_caret(arg.pos)); } @@ -1580,6 +1589,45 @@ namespace nana{ namespace widgets } } + //Added Windows-style mouse double-click to the textbox(https://github.com/cnjinhao/nana/pull/229) + //Oleg Smolsky + bool text_editor::select_word(const arg_mouse& arg) + { + if(!attributes_.enable_caret) + return false; + + auto is_whitespace = [](wchar_t c) { + switch (c) { + case L' ': + case L'\t': + case L'\n': + case L'\r': + return true; + default: + return false; + } + }; + + // Set caret pos by screen point and get the caret pos. + mouse_caret(arg.pos, true); + + // Set the initial selection: it is an empty range. + select_.a = select_.b = points_.caret; + const auto& line = impl_->textbase.getline(select_.b.y); + + // Expand the selection forward to the word's end. + while (select_.b.x < line.size() && !is_whitespace(line[select_.b.x])) + ++select_.b.x; + + // Expand the selection backward to the word's start. + while (select_.a.x > 0 && !is_whitespace(line[select_.a.x - 1])) + --select_.a.x; + + select_.mode_selection = selection::mode::method_selected; + impl_->try_refresh = sync_graph::refresh; + return true; + } + textbase & text_editor::textbase() { return impl_->textbase; @@ -1638,6 +1686,7 @@ namespace nana{ namespace widgets //_m_put calcs the lines _m_reset_content_size(false); + impl_->cview->sync(false); } } else @@ -1660,10 +1709,29 @@ namespace nana{ namespace widgets return str; } - bool text_editor::move_caret(const upoint& crtpos, bool reset_caret) - { + bool text_editor::move_caret(upoint crtpos, bool stay_in_view) + { const unsigned line_pixels = line_height(); + if (crtpos != points_.caret) + { + //Check and make the crtpos available + if (crtpos.y < impl_->textbase.lines()) + { + crtpos.x = (std::min)(static_cast(impl_->textbase.getline(crtpos.y).size()), crtpos.x); + } + else + { + crtpos.y = static_cast(impl_->textbase.lines()); + if (crtpos.y > 0) + --crtpos.y; + + crtpos.x = static_cast(impl_->textbase.getline(crtpos.y).size()); + } + + points_.caret = crtpos; + } + //The coordinate of caret auto coord = _m_caret_to_coordinate(crtpos); @@ -1694,9 +1762,11 @@ namespace nana{ namespace widgets caret->position(coord); //Adjust the caret into screen when the caret position is modified by this function - if (reset_caret && (!hit_text_area(coord))) + if (stay_in_view && (!hit_text_area(coord))) { - this->_m_adjust_view(); + if (_m_adjust_view()) + impl_->cview->sync(false); + impl_->try_refresh = sync_graph::refresh; caret->visible(true); return true; @@ -1711,7 +1781,7 @@ namespace nana{ namespace widgets points_.caret.x = static_cast(impl_->textbase.getline(points_.caret.y).size()); if (update) - this->move_caret(points_.caret, false); + this->reset_caret(); } void text_editor::reset_caret_pixels() const @@ -1766,7 +1836,7 @@ namespace nana{ namespace widgets impl_->try_refresh = sync_graph::refresh; return true; } - + select_.mode_selection = selection::mode::no_selected; if (_m_cancel_select(0)) { @@ -1914,12 +1984,13 @@ namespace nana{ namespace widgets if ((false == textbase().empty()) || has_focus) { auto text_pos = _m_render_text(fgcolor); - + if (text_pos.empty()) text_pos.emplace_back(upoint{}); - - if (text_pos != impl_->text_position) + + if ((impl_->text_position_origin != impl_->cview->origin().y) || (text_pos != impl_->text_position)) { + impl_->text_position_origin = impl_->cview->origin().y; impl_->text_position.swap(text_pos); if (event_handler_) event_handler_->text_exposed(impl_->text_position); @@ -1959,7 +2030,8 @@ namespace nana{ namespace widgets if(graph_) { - this->_m_adjust_view(); + if(this->_m_adjust_view()) + impl_->cview->sync(false); reset_caret(); impl_->try_refresh = sync_graph::refresh; @@ -2276,7 +2348,7 @@ namespace nana{ namespace widgets //The number of charecters in the line of caret auto const text_length = textbase().getline(points_.caret.y).size(); - + switch (key) { case keyboard::os_arrow_left: if (select_.move_to_end && (select_.a != select_.b) && (!arg.shift)) @@ -2424,7 +2496,7 @@ namespace nana{ namespace widgets if (stay_in_view && this->_m_adjust_view()) impl_->try_refresh = sync_graph::refresh; - move_caret(points_.caret); + reset_caret(); return points_.caret; } @@ -2460,7 +2532,7 @@ namespace nana{ namespace widgets lines = impl_->capacities.behavior->take_lines(row.first); else top += static_cast(height * row.second); - + const rectangle area_r = { text_area_.area.x, top, width_pixels(), static_cast(height * lines) }; if (API::is_transparent_background(this->window_)) @@ -2757,7 +2829,7 @@ namespace nana{ namespace widgets const unsigned pixels = line_height(); const rectangle update_area = { text_area_.area.x, top, width_pixels(), static_cast(pixels * secondary_count_before) }; - + if (!API::dev::copy_transparent_background(window_, update_area, graph_, update_area.position())) { _m_draw_colored_area(graph_, { pos, 0 }, true); @@ -3047,7 +3119,7 @@ namespace nana{ namespace widgets this->points_.caret = (1 == align ? a : b); this->_m_adjust_view(); } - + select_.a = select_.b = points_.caret; reset_caret(); return true; @@ -3195,7 +3267,7 @@ namespace nana{ namespace widgets auto px = static_cast(line_height()); return (px ? (impl_->cview->origin().y / px) : px); } - + int text_editor::_m_text_x(const text_section& sct) const { auto const behavior = impl_->capacities.behavior; @@ -3289,26 +3361,37 @@ namespace nana{ namespace widgets line_px_( editor.line_height() ) {} + color selection_color(bool fgcolor, bool focused) const + { + if (fgcolor) + return (focused ? editor_.scheme_->selection_text : editor_.scheme_->foreground).get_color(); + + return (focused ? editor_.scheme_->selection : editor_.scheme_->selection_unfocused).get_color(); + } + void write_selection(const point& text_pos, unsigned text_px, const wchar_t* text, std::size_t len, bool has_focused) { - graph_.palette(true, editor_.scheme_->selection_text.get_color()); - graph_.rectangle(::nana::rectangle{ text_pos, { text_px, line_px_ } }, true, - has_focused ? editor_.scheme_->selection.get_color() : editor_.scheme_->selection_unfocused.get_color()); + graph_.palette(true, selection_color(true, has_focused)); + + graph_.rectangle(::nana::rectangle{ text_pos, { text_px, line_px_ } }, true, + selection_color(false, has_focused)); + graph_.string(text_pos, text, len); } void rtl_string(point strpos, const wchar_t* str, std::size_t len, std::size_t str_px, unsigned glyph_front, unsigned glyph_selected, bool has_focused) { - editor_._m_draw_parse_string(parser_, true, strpos, editor_.scheme_->selection_text.get_color(), str, len); + editor_._m_draw_parse_string(parser_, true, strpos, selection_color(true, has_focused), str, len); //Draw selected part paint::graphics graph({ glyph_selected, line_px_ }); graph.typeface(this->graph_.typeface()); - graph.rectangle(true, (has_focused ? editor_.scheme_->selection.get_color() : editor_.scheme_->selection_unfocused.get_color())); + graph.rectangle(true, selection_color(false, has_focused)); int sel_xpos = static_cast(str_px - (glyph_front + glyph_selected)); - graph.palette(true, editor_.scheme_->selection_text.get_color()); + graph.palette(true, selection_color(true, has_focused)); + graph.string({ -sel_xpos, 0 }, str, len); graph_.bitblt(nana::rectangle(strpos.x + sel_xpos, strpos.y, glyph_selected, line_px_), graph); }; @@ -3345,7 +3428,7 @@ namespace nana{ namespace widgets const auto line_h_pixels = line_height(); helper_pencil pencil(graph_, *this, parser); - + graph_.palette(true, clr); graph_.palette(false, scheme_->selection.get_color()); @@ -3396,9 +3479,11 @@ namespace nana{ namespace widgets //A text editor feature, it draws an extra block at end of line if the end of line is in range of selection. bool extra_space = false; + //Create a flag for indicating whether the whole line is selected const bool text_selected = (sbegin == text_ptr && send == text_ptr+ text_len); + //The text is not selected or the whole line text is selected - if (!focused || (!sbegin || !send) || text_selected || !attributes_.enable_caret) + if ((!sbegin || !send) || text_selected) { for (auto & ent : reordered) { @@ -3567,7 +3652,7 @@ namespace nana{ namespace widgets return 0; auto const reordered = unicode_reorder(lnstr.c_str(), lnstr.size()); - + auto target = lnstr.c_str() + pos; unsigned text_w = 0; diff --git a/source/gui/widgets/spinbox.cpp b/source/gui/widgets/spinbox.cpp index 2cb89870..2fad022f 100644 --- a/source/gui/widgets/spinbox.cpp +++ b/source/gui/widgets/spinbox.cpp @@ -282,8 +282,10 @@ namespace nana reset_text(); + //Spinbox doesn't process the tabstop unlike other text editors. + //Otherwise it would bring a weird user experience. + //Issued by jk. API::tabstop(wd); - API::eat_tabstop(wd, true); API::effects_edge_nimbus(wd, effects::edge_nimbus::active); API::effects_edge_nimbus(wd, effects::edge_nimbus::over); reset_text_area(); diff --git a/source/gui/widgets/textbox.cpp b/source/gui/widgets/textbox.cpp index 1be973ea..e29b0d88 100644 --- a/source/gui/widgets/textbox.cpp +++ b/source/gui/widgets/textbox.cpp @@ -8,6 +8,7 @@ * http://www.boost.org/LICENSE_1_0.txt) * * @file: nana/gui/widgets/textbox.hpp + * @contributors: Oleg Smolsky */ #include @@ -143,6 +144,14 @@ namespace drawerbase { API::dev::lazy_refresh(); } + //Added Windows-style mouse double-click to the textbox(https://github.com/cnjinhao/nana/pull/229) + //Oleg Smolsky + void drawer::dbl_click(graph_reference, const arg_mouse& arg) + { + if(editor_->select_word(arg)) + API::dev::lazy_refresh(); + } + void drawer::key_press(graph_reference, const arg_keyboard& arg) { editor_->respond_key(arg); @@ -260,6 +269,15 @@ namespace drawerbase { return nullptr; } + point textbox::content_origin() const + { + auto editor = get_drawer_trigger().editor(); + if (editor) + return editor->content_origin(); + + return{}; + } + /// Enables/disables the textbox to indent a line. Idents a new line when it is created by pressing enter. /// @param generator generates text for identing a line. If it is empty, textbox indents the line according to last line. textbox& textbox::indention(bool enb, std::function generator) @@ -381,6 +399,16 @@ namespace drawerbase { return editor->hit_text_area(scr_pos); } + upoint textbox::caret_pos() const + { + auto editor = get_drawer_trigger().editor(); + internal_scope_guard lock; + if (editor) + return editor->caret(); + + return{}; + } + textbox& textbox::caret_pos(const upoint& pos) { auto editor = get_drawer_trigger().editor(); diff --git a/source/gui/widgets/treebox.cpp b/source/gui/widgets/treebox.cpp index c84e66d2..906bd969 100644 --- a/source/gui/widgets/treebox.cpp +++ b/source/gui/widgets/treebox.cpp @@ -1781,6 +1781,11 @@ namespace nana widget.caption("nana treebox"); } + void trigger::detached() + { + impl_->data.graph = nullptr; + } + void trigger::refresh(graph_reference) { //Don't reset the scroll and update the window diff --git a/source/paint/graphics.cpp b/source/paint/graphics.cpp index 62940369..7fdadcea 100644 --- a/source/paint/graphics.cpp +++ b/source/paint/graphics.cpp @@ -291,6 +291,12 @@ namespace paint { if(impl_->handle == nullptr || impl_->size != sz) { + if (sz.empty()) + { + release(); + return; + } + //The object will be delete while dwptr_ is performing a release. drawable_type dw = new nana::detail::drawable_impl_type; //Reuse the old font @@ -342,7 +348,7 @@ namespace paint Display* disp = spec.open_display(); int screen = DefaultScreen(disp); Window root = ::XRootWindow(disp, screen); - dw->pixmap = ::XCreatePixmap(disp, root, (sz.width ? sz.width : 1), (sz.height ? sz.height : 1), DefaultDepth(disp, screen)); + dw->pixmap = ::XCreatePixmap(disp, root, sz.width, sz.height, DefaultDepth(disp, screen)); dw->context = ::XCreateGC(disp, dw->pixmap, 0, 0); #if defined(NANA_USE_XFT) dw->xftdraw = ::XftDrawCreate(disp, dw->pixmap, spec.screen_visual(), spec.colormap()); diff --git a/source/stdc++.cpp b/source/stdc++.cpp index 3796cba8..593ec334 100644 --- a/source/stdc++.cpp +++ b/source/stdc++.cpp @@ -15,6 +15,8 @@ //Implement workarounds for GCC/MinGW which version is below 4.8.2 #if defined(STD_NUMERIC_CONVERSIONS_NOT_SUPPORTED) #include +#include +#include namespace std { int stoi(const std::string& str, std::size_t * pos, int base) @@ -449,14 +451,14 @@ namespace std //{ // unsigned sz = 200; // std::wstring str(sz, L'\0'); - // sz = std::wcsftime(&str[0], str.size() - 1, fmt, tmb); + // sz = std::wcsftime(&str[0], str.size() - 1, fmt, tmb); // str.resize(sz); // return str; //} // http://en.cppreference.com/w/cpp/chrono/c/wcsftime // Defined in header // std::size_t wcsftime(wchar_t* str, std::size_t count, const wchar_t* format, const std::tm* time); - // Converts the date and time information from a given calendar time time to a null - terminated + // Converts the date and time information from a given calendar time time to a null - terminated // wide character string str according to format string format.Up to count bytes are written. // Parameters // str - pointer to the first element of the wchar_t array for output @@ -464,4 +466,4 @@ namespace std // format - pointer to a null - terminated wide character string specifying the format of conversion. } -#endif // _enable_std_put_time \ No newline at end of file +#endif // _enable_std_put_time