code reviews
This commit is contained in:
		
							parent
							
								
									500aa030ae
								
							
						
					
					
						commit
						1b5aed2e5f
					
				| @ -44,7 +44,6 @@ | |||||||
| 		<Unit filename="../../source/datetime.cpp" /> | 		<Unit filename="../../source/datetime.cpp" /> | ||||||
| 		<Unit filename="../../source/deploy.cpp" /> | 		<Unit filename="../../source/deploy.cpp" /> | ||||||
| 		<Unit filename="../../source/detail/platform_spec_selector.cpp" /> | 		<Unit filename="../../source/detail/platform_spec_selector.cpp" /> | ||||||
| 		<Unit filename="../../source/exceptions.cpp" /> |  | ||||||
| 		<Unit filename="../../source/filesystem/file_iterator.cpp" /> | 		<Unit filename="../../source/filesystem/file_iterator.cpp" /> | ||||||
| 		<Unit filename="../../source/filesystem/fs_utility.cpp" /> | 		<Unit filename="../../source/filesystem/fs_utility.cpp" /> | ||||||
| 		<Unit filename="../../source/gui/animation.cpp" /> | 		<Unit filename="../../source/gui/animation.cpp" /> | ||||||
|  | |||||||
| @ -598,13 +598,13 @@ | |||||||
| 	"win32/platform_spec.cpp" | 	"win32/platform_spec.cpp" | ||||||
| 	"linux_X11/platform_spec.cpp" | 	"linux_X11/platform_spec.cpp" | ||||||
| 
 | 
 | ||||||
| 1439496157 d:\git.repo\nana\source\detail\win32\platform_spec.cpp | 1443581342 d:\git.repo\nana\source\detail\win32\platform_spec.cpp | ||||||
| 	<nana/config.hpp> | 	<nana/config.hpp> | ||||||
| 	<shellapi.h> | 	<shellapi.h> | ||||||
| 	<stdexcept> | 	<stdexcept> | ||||||
| 	<VersionHelpers.h> | 	<VersionHelpers.h> | ||||||
| 
 | 
 | ||||||
| 1439496157 d:\git.repo\nana\source\detail\linux_x11\platform_spec.cpp | 1443581342 d:\git.repo\nana\source\detail\linux_x11\platform_spec.cpp | ||||||
| 	<nana/config.hpp> | 	<nana/config.hpp> | ||||||
| 	<X11/Xlocale.h> | 	<X11/Xlocale.h> | ||||||
| 	<locale> | 	<locale> | ||||||
| @ -653,13 +653,14 @@ | |||||||
| 	<unistd.h> | 	<unistd.h> | ||||||
| 	<stdlib.h> | 	<stdlib.h> | ||||||
| 
 | 
 | ||||||
| 1439496157 source:d:\git.repo\nana\source\gui\animation.cpp | 1444647306 source:d:\git.repo\nana\source\gui\animation.cpp | ||||||
| 	<nana/gui/animation.hpp> | 	<nana/gui/animation.hpp> | ||||||
| 	<nana/gui/drawing.hpp> | 	<nana/gui/drawing.hpp> | ||||||
| 	<nana/system/timepiece.hpp> | 	<nana/system/timepiece.hpp> | ||||||
| 	<nana/system/platform.hpp> | 	<nana/system/platform.hpp> | ||||||
| 	<vector> | 	<vector> | ||||||
| 	<list> | 	<list> | ||||||
|  | 	<map> | ||||||
| 	<algorithm> | 	<algorithm> | ||||||
| 	<nana/std_thread.hpp> | 	<nana/std_thread.hpp> | ||||||
| 	<nana/std_mutex.hpp> | 	<nana/std_mutex.hpp> | ||||||
| @ -675,7 +676,7 @@ | |||||||
| 	<nana/gui/detail/basic_window.hpp> | 	<nana/gui/detail/basic_window.hpp> | ||||||
| 	<nana/gui/detail/native_window_interface.hpp> | 	<nana/gui/detail/native_window_interface.hpp> | ||||||
| 
 | 
 | ||||||
| 1439496157 source:d:\git.repo\nana\source\gui\detail\bedrock_pi.cpp | 1444585389 source:d:\git.repo\nana\source\gui\detail\bedrock_pi.cpp | ||||||
| 	<nana/config.hpp> | 	<nana/config.hpp> | ||||||
| 	<nana/gui/detail/bedrock_pi_data.hpp> | 	<nana/gui/detail/bedrock_pi_data.hpp> | ||||||
| 	<nana/gui/detail/event_code.hpp> | 	<nana/gui/detail/event_code.hpp> | ||||||
| @ -694,7 +695,7 @@ | |||||||
| 	"win32/bedrock.cpp" | 	"win32/bedrock.cpp" | ||||||
| 	"linux_X11/bedrock.cpp" | 	"linux_X11/bedrock.cpp" | ||||||
| 
 | 
 | ||||||
| 1439496157 d:\git.repo\nana\source\gui\detail\win32\bedrock.cpp | 1444657608 d:\git.repo\nana\source\gui\detail\win32\bedrock.cpp | ||||||
| 	<nana/config.hpp> | 	<nana/config.hpp> | ||||||
| 	<nana/gui/detail/bedrock.hpp> | 	<nana/gui/detail/bedrock.hpp> | ||||||
| 	<nana/gui/detail/bedrock_pi_data.hpp> | 	<nana/gui/detail/bedrock_pi_data.hpp> | ||||||
| @ -709,7 +710,7 @@ | |||||||
| 	<nana/gui/detail/element_store.hpp> | 	<nana/gui/detail/element_store.hpp> | ||||||
| 	<nana/gui/detail/color_schemes.hpp> | 	<nana/gui/detail/color_schemes.hpp> | ||||||
| 
 | 
 | ||||||
| 1439496157 d:\git.repo\nana\source\gui\detail\linux_x11\bedrock.cpp | 1444647171 d:\git.repo\nana\source\gui\detail\linux_x11\bedrock.cpp | ||||||
| 	<nana/config.hpp> | 	<nana/config.hpp> | ||||||
| 	<nana/gui/detail/bedrock_pi_data.hpp> | 	<nana/gui/detail/bedrock_pi_data.hpp> | ||||||
| 	<nana/gui/detail/event_code.hpp> | 	<nana/gui/detail/event_code.hpp> | ||||||
| @ -720,7 +721,7 @@ | |||||||
| 	<nana/gui/detail/element_store.hpp> | 	<nana/gui/detail/element_store.hpp> | ||||||
| 	<errno.h> | 	<errno.h> | ||||||
| 
 | 
 | ||||||
| 1423350892 source:d:\git.repo\nana\source\gui\detail\color_schemes.cpp | 1444567878 source:d:\git.repo\nana\source\gui\detail\color_schemes.cpp | ||||||
| 	<nana/gui/detail/color_schemes.hpp> | 	<nana/gui/detail/color_schemes.hpp> | ||||||
| 	<map> | 	<map> | ||||||
| 
 | 
 | ||||||
| @ -736,10 +737,10 @@ | |||||||
| 1408986718 source:d:\git.repo\nana\source\gui\detail\element_store.cpp | 1408986718 source:d:\git.repo\nana\source\gui\detail\element_store.cpp | ||||||
| 	<nana/gui/detail/element_store.hpp> | 	<nana/gui/detail/element_store.hpp> | ||||||
| 
 | 
 | ||||||
| 1439496157 source:d:\git.repo\nana\source\gui\detail\events_operation.cpp | 1444470665 source:d:\git.repo\nana\source\gui\detail\events_operation.cpp | ||||||
| 	<nana/gui/detail/events_operation.hpp> | 	<nana/gui/detail/events_operation.hpp> | ||||||
| 
 | 
 | ||||||
| 1439828940 source:d:\git.repo\nana\source\gui\detail\native_window_interface.cpp | 1444647213 source:d:\git.repo\nana\source\gui\detail\native_window_interface.cpp | ||||||
| 	<nana/config.hpp> | 	<nana/config.hpp> | ||||||
| 	<nana/gui/detail/native_window_interface.hpp> | 	<nana/gui/detail/native_window_interface.hpp> | ||||||
| 	<nana/gui/screen.hpp> | 	<nana/gui/screen.hpp> | ||||||
| @ -760,9 +761,10 @@ | |||||||
| 	<nana/gui/layout_utility.hpp> | 	<nana/gui/layout_utility.hpp> | ||||||
| 	<algorithm> | 	<algorithm> | ||||||
| 
 | 
 | ||||||
| 1439496157 source:d:\git.repo\nana\source\gui\detail\window_manager.cpp | 1444657627 source:d:\git.repo\nana\source\gui\detail\window_manager.cpp | ||||||
| 	<nana/config.hpp> | 	<nana/config.hpp> | ||||||
| 	<nana/gui/detail/bedrock.hpp> | 	<nana/gui/detail/bedrock.hpp> | ||||||
|  | 	<nana/gui/detail/events_operation.hpp> | ||||||
| 	<nana/gui/detail/handle_manager.hpp> | 	<nana/gui/detail/handle_manager.hpp> | ||||||
| 	<nana/gui/detail/window_manager.hpp> | 	<nana/gui/detail/window_manager.hpp> | ||||||
| 	<nana/gui/detail/native_window_interface.hpp> | 	<nana/gui/detail/native_window_interface.hpp> | ||||||
| @ -772,10 +774,10 @@ | |||||||
| 	<stdexcept> | 	<stdexcept> | ||||||
| 	<algorithm> | 	<algorithm> | ||||||
| 
 | 
 | ||||||
| 1439746409 source:d:\git.repo\nana\source\gui\dragger.cpp | 1444585885 source:d:\git.repo\nana\source\gui\dragger.cpp | ||||||
| 	<nana/gui/dragger.hpp> | 	<nana/gui/dragger.hpp> | ||||||
| 
 | 
 | ||||||
| 1423350892 source:d:\git.repo\nana\source\gui\drawing.cpp | 1444647322 source:d:\git.repo\nana\source\gui\drawing.cpp | ||||||
| 	<nana/gui/drawing.hpp> | 	<nana/gui/drawing.hpp> | ||||||
| 	<nana/gui/programming_interface.hpp> | 	<nana/gui/programming_interface.hpp> | ||||||
| 	<nana/gui/detail/basic_window.hpp> | 	<nana/gui/detail/basic_window.hpp> | ||||||
| @ -784,7 +786,7 @@ | |||||||
| 	<nana/gui/effects.hpp> | 	<nana/gui/effects.hpp> | ||||||
| 	<nana/gui/programming_interface.hpp> | 	<nana/gui/programming_interface.hpp> | ||||||
| 
 | 
 | ||||||
| 1439829040 source:d:\git.repo\nana\source\gui\element.cpp | 1444585885 source:d:\git.repo\nana\source\gui\element.cpp | ||||||
| 	<nana/gui/element.hpp> | 	<nana/gui/element.hpp> | ||||||
| 	<nana/gui/detail/bedrock.hpp> | 	<nana/gui/detail/bedrock.hpp> | ||||||
| 	<nana/gui/detail/element_store.hpp> | 	<nana/gui/detail/element_store.hpp> | ||||||
| @ -814,7 +816,7 @@ | |||||||
| 1439496157 source:d:\git.repo\nana\source\gui\layout_utility.cpp | 1439496157 source:d:\git.repo\nana\source\gui\layout_utility.cpp | ||||||
| 	<nana/gui/layout_utility.hpp> | 	<nana/gui/layout_utility.hpp> | ||||||
| 
 | 
 | ||||||
| 1439496157 source:d:\git.repo\nana\source\gui\msgbox.cpp | 1444585885 source:d:\git.repo\nana\source\gui\msgbox.cpp | ||||||
| 	<nana/gui.hpp> | 	<nana/gui.hpp> | ||||||
| 	<nana/gui/widgets/label.hpp> | 	<nana/gui/widgets/label.hpp> | ||||||
| 	<nana/gui/widgets/button.hpp> | 	<nana/gui/widgets/button.hpp> | ||||||
| @ -833,7 +835,7 @@ | |||||||
| 	<nana/gui/widgets/picture.hpp> | 	<nana/gui/widgets/picture.hpp> | ||||||
| 	<nana/paint/pixel_buffer.hpp> | 	<nana/paint/pixel_buffer.hpp> | ||||||
| 
 | 
 | ||||||
| 1439496157 source:d:\git.repo\nana\source\gui\notifier.cpp | 1444647352 source:d:\git.repo\nana\source\gui\notifier.cpp | ||||||
| 	<nana/deploy.hpp> | 	<nana/deploy.hpp> | ||||||
| 	<nana/gui/programming_interface.hpp> | 	<nana/gui/programming_interface.hpp> | ||||||
| 	<nana/gui/notifier.hpp> | 	<nana/gui/notifier.hpp> | ||||||
| @ -846,12 +848,15 @@ | |||||||
| 	<nana/system/platform.hpp> | 	<nana/system/platform.hpp> | ||||||
| 	<iostream> | 	<iostream> | ||||||
| 
 | 
 | ||||||
| 1439746410 source:d:\git.repo\nana\source\gui\programming_interface.cpp | 1444657299 source:d:\git.repo\nana\source\gui\programming_interface.cpp | ||||||
| 	<nana/gui/programming_interface.hpp> | 	<nana/gui/programming_interface.hpp> | ||||||
|  | 	<nana/gui/detail/bedrock.hpp> | ||||||
| 	<nana/gui/detail/basic_window.hpp> | 	<nana/gui/detail/basic_window.hpp> | ||||||
|  | 	<nana/gui/detail/window_manager.hpp> | ||||||
| 	<nana/system/platform.hpp> | 	<nana/system/platform.hpp> | ||||||
| 	<nana/gui/detail/native_window_interface.hpp> | 	<nana/gui/detail/native_window_interface.hpp> | ||||||
| 	<nana/gui/widgets/widget.hpp> | 	<nana/gui/widgets/widget.hpp> | ||||||
|  | 	<nana/gui/detail/events_operation.hpp> | ||||||
| 
 | 
 | ||||||
| 1439496158 source:d:\git.repo\nana\source\gui\screen.cpp | 1439496158 source:d:\git.repo\nana\source\gui\screen.cpp | ||||||
| 	<nana/gui/screen.hpp> | 	<nana/gui/screen.hpp> | ||||||
| @ -861,10 +866,11 @@ | |||||||
| 	<nana/gui/programming_interface.hpp> | 	<nana/gui/programming_interface.hpp> | ||||||
| 	<windows.h> | 	<windows.h> | ||||||
| 
 | 
 | ||||||
| 1415011766 source:d:\git.repo\nana\source\gui\state_cursor.cpp | 1444647437 source:d:\git.repo\nana\source\gui\state_cursor.cpp | ||||||
| 	<nana/gui/state_cursor.hpp> | 	<nana/gui/state_cursor.hpp> | ||||||
| 	<nana/gui/detail/bedrock.hpp> | 	<nana/gui/detail/bedrock.hpp> | ||||||
| 	<nana/gui/detail/basic_window.hpp> | 	<nana/gui/detail/basic_window.hpp> | ||||||
|  | 	<nana/gui/detail/window_manager.hpp> | ||||||
| 
 | 
 | ||||||
| 1439496158 source:d:\git.repo\nana\source\gui\timer.cpp | 1439496158 source:d:\git.repo\nana\source\gui\timer.cpp | ||||||
| 	<nana/deploy.hpp> | 	<nana/deploy.hpp> | ||||||
| @ -876,7 +882,7 @@ | |||||||
| 	<windows.h> | 	<windows.h> | ||||||
| 	<nana/system/platform.hpp> | 	<nana/system/platform.hpp> | ||||||
| 
 | 
 | ||||||
| 1439496158 source:d:\git.repo\nana\source\gui\tooltip.cpp | 1444585886 source:d:\git.repo\nana\source\gui\tooltip.cpp | ||||||
| 	<nana/gui/tooltip.hpp> | 	<nana/gui/tooltip.hpp> | ||||||
| 	<nana/gui/widgets/label.hpp> | 	<nana/gui/widgets/label.hpp> | ||||||
| 	<nana/gui/timer.hpp> | 	<nana/gui/timer.hpp> | ||||||
| @ -1167,3 +1173,28 @@ | |||||||
| 	<list> | 	<list> | ||||||
| 	<forward_list> | 	<forward_list> | ||||||
| 
 | 
 | ||||||
|  | 1444658359 source:d:\git.repo\nana\source\gui\place.cpp | ||||||
|  | 	<cfloat> | ||||||
|  | 	<cmath> | ||||||
|  | 	<map> | ||||||
|  | 	<deque> | ||||||
|  | 	<nana/gui/place.hpp> | ||||||
|  | 	<nana/gui/programming_interface.hpp> | ||||||
|  | 	<nana/gui/widgets/label.hpp> | ||||||
|  | 	<nana/gui/widgets/panel.hpp> | ||||||
|  | 	<nana/gui/dragger.hpp> | ||||||
|  | 	<nana/gui/drawing.hpp> | ||||||
|  | 	<memory> | ||||||
|  | 	<limits> | ||||||
|  | 	<cstdlib> | ||||||
|  | 	<cstring> | ||||||
|  | 	"place_parts.hpp" | ||||||
|  | 
 | ||||||
|  | 1444585885 d:\git.repo\nana\source\gui\place_parts.hpp | ||||||
|  | 	<nana/gui/widgets/form.hpp> | ||||||
|  | 	<nana/gui/widgets/tabbar.hpp> | ||||||
|  | 	<nana/gui/element.hpp> | ||||||
|  | 	<nana/paint/text_renderer.hpp> | ||||||
|  | 	<stdexcept> | ||||||
|  | 	<deque> | ||||||
|  | 
 | ||||||
|  | |||||||
| @ -1,74 +1,39 @@ | |||||||
| <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> | <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> | ||||||
| <CodeBlocks_layout_file> | <CodeBlocks_layout_file> | ||||||
| 	<ActiveTarget name="Debug" /> | 	<ActiveTarget name="Debug" /> | ||||||
| 	<File name="..\..\source\paint\graphics.cpp" open="0" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> |  | ||||||
| 		<Cursor> |  | ||||||
| 			<Cursor1 position="30961" topLine="1020" /> |  | ||||||
| 		</Cursor> |  | ||||||
| 	</File> |  | ||||||
| 	<File name="..\..\source\gui\detail\window_layout.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | 	<File name="..\..\source\gui\detail\window_layout.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | ||||||
| 		<Cursor> | 		<Cursor> | ||||||
| 			<Cursor1 position="5198" topLine="161" /> | 			<Cursor1 position="5198" topLine="161" /> | ||||||
| 		</Cursor> | 		</Cursor> | ||||||
| 	</File> | 	</File> | ||||||
|  | 	<File name="..\..\source\paint\graphics.cpp" open="0" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | ||||||
|  | 		<Cursor> | ||||||
|  | 			<Cursor1 position="30961" topLine="1020" /> | ||||||
|  | 		</Cursor> | ||||||
|  | 	</File> | ||||||
| 	<File name="..\..\source\paint\image.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | 	<File name="..\..\source\paint\image.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | ||||||
| 		<Cursor> | 		<Cursor> | ||||||
| 			<Cursor1 position="3714" topLine="168" /> | 			<Cursor1 position="3714" topLine="168" /> | ||||||
| 		</Cursor> | 		</Cursor> | ||||||
| 	</File> | 	</File> | ||||||
| 	<File name="..\..\source\gui\widgets\categorize.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | 	<File name="..\..\source\gui\tooltip.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | ||||||
| 		<Cursor> | 		<Cursor> | ||||||
| 			<Cursor1 position="6160" topLine="196" /> | 			<Cursor1 position="4739" topLine="194" /> | ||||||
| 		</Cursor> | 		</Cursor> | ||||||
| 	</File> | 	</File> | ||||||
| 	<File name="..\..\source\paint\text_renderer.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | 	<File name="..\..\source\threads\pool.cpp" open="0" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | ||||||
| 		<Cursor> | 		<Cursor> | ||||||
| 			<Cursor1 position="5894" topLine="205" /> | 			<Cursor1 position="5569" topLine="249" /> | ||||||
| 		</Cursor> | 		</Cursor> | ||||||
| 	</File> | 	</File> | ||||||
| 	<File name="..\..\source\gui\widgets\button.cpp" open="0" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | 	<File name="..\..\source\gui\dragger.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | ||||||
| 		<Cursor> | 		<Cursor> | ||||||
| 			<Cursor1 position="7080" topLine="291" /> | 			<Cursor1 position="1316" topLine="59" /> | ||||||
| 		</Cursor> | 		</Cursor> | ||||||
| 	</File> | 	</File> | ||||||
| 	<File name="..\..\source\gui\widgets\listbox.cpp" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | 	<File name="..\..\source\gui\msgbox.cpp" open="0" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | ||||||
| 		<Cursor> | 		<Cursor> | ||||||
| 			<Cursor1 position="12428" topLine="532" /> | 			<Cursor1 position="48249" topLine="407" /> | ||||||
| 		</Cursor> |  | ||||||
| 	</File> |  | ||||||
| 	<File name="..\..\source\gui\widgets\checkbox.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> |  | ||||||
| 		<Cursor> |  | ||||||
| 			<Cursor1 position="6998" topLine="275" /> |  | ||||||
| 		</Cursor> |  | ||||||
| 	</File> |  | ||||||
| 	<File name="..\..\source\gui\widgets\menu.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> |  | ||||||
| 		<Cursor> |  | ||||||
| 			<Cursor1 position="27717" topLine="1044" /> |  | ||||||
| 		</Cursor> |  | ||||||
| 	</File> |  | ||||||
| 	<File name="..\..\source\charset.cpp" open="0" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> |  | ||||||
| 		<Cursor> |  | ||||||
| 			<Cursor1 position="412" topLine="15" /> |  | ||||||
| 		</Cursor> |  | ||||||
| 	</File> |  | ||||||
| 	<File name="..\..\source\gui\widgets\combox.cpp" open="0" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> |  | ||||||
| 		<Cursor> |  | ||||||
| 			<Cursor1 position="16572" topLine="610" /> |  | ||||||
| 		</Cursor> |  | ||||||
| 	</File> |  | ||||||
| 	<File name="..\..\source\gui\widgets\date_chooser.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> |  | ||||||
| 		<Cursor> |  | ||||||
| 			<Cursor1 position="457" topLine="3" /> |  | ||||||
| 		</Cursor> |  | ||||||
| 	</File> |  | ||||||
| 	<File name="..\..\source\gui\widgets\toolbar.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> |  | ||||||
| 		<Cursor> |  | ||||||
| 			<Cursor1 position="2244" topLine="84" /> |  | ||||||
| 		</Cursor> |  | ||||||
| 	</File> |  | ||||||
| 	<File name="..\..\source\filesystem\fs_utility.cpp" open="0" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> |  | ||||||
| 		<Cursor> |  | ||||||
| 			<Cursor1 position="1562" topLine="57" /> |  | ||||||
| 		</Cursor> | 		</Cursor> | ||||||
| 	</File> | 	</File> | ||||||
| 	<File name="..\..\source\gui\widgets\tabbar.cpp" open="0" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | 	<File name="..\..\source\gui\widgets\tabbar.cpp" open="0" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | ||||||
| @ -76,11 +41,41 @@ | |||||||
| 			<Cursor1 position="37420" topLine="1435" /> | 			<Cursor1 position="37420" topLine="1435" /> | ||||||
| 		</Cursor> | 		</Cursor> | ||||||
| 	</File> | 	</File> | ||||||
|  | 	<File name="..\..\source\gui\widgets\listbox.cpp" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | ||||||
|  | 		<Cursor> | ||||||
|  | 			<Cursor1 position="67946" topLine="2580" /> | ||||||
|  | 		</Cursor> | ||||||
|  | 	</File> | ||||||
|  | 	<File name="..\..\source\gui\place.cpp" open="0" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | ||||||
|  | 		<Cursor> | ||||||
|  | 			<Cursor1 position="49985" topLine="1908" /> | ||||||
|  | 		</Cursor> | ||||||
|  | 	</File> | ||||||
|  | 	<File name="..\..\source\gui\widgets\toolbar.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | ||||||
|  | 		<Cursor> | ||||||
|  | 			<Cursor1 position="2244" topLine="84" /> | ||||||
|  | 		</Cursor> | ||||||
|  | 	</File> | ||||||
| 	<File name="..\..\source\gui\programming_interface.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | 	<File name="..\..\source\gui\programming_interface.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | ||||||
| 		<Cursor> | 		<Cursor> | ||||||
| 			<Cursor1 position="5022" topLine="159" /> | 			<Cursor1 position="5022" topLine="159" /> | ||||||
| 		</Cursor> | 		</Cursor> | ||||||
| 	</File> | 	</File> | ||||||
|  | 	<File name="..\..\source\gui\widgets\button.cpp" open="0" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | ||||||
|  | 		<Cursor> | ||||||
|  | 			<Cursor1 position="7080" topLine="291" /> | ||||||
|  | 		</Cursor> | ||||||
|  | 	</File> | ||||||
|  | 	<File name="..\..\source\charset.cpp" open="0" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | ||||||
|  | 		<Cursor> | ||||||
|  | 			<Cursor1 position="412" topLine="15" /> | ||||||
|  | 		</Cursor> | ||||||
|  | 	</File> | ||||||
|  | 	<File name="..\..\source\gui\animation.cpp" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | ||||||
|  | 		<Cursor> | ||||||
|  | 			<Cursor1 position="1164" topLine="43" /> | ||||||
|  | 		</Cursor> | ||||||
|  | 	</File> | ||||||
| 	<File name="..\..\source\gui\detail\window_manager.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | 	<File name="..\..\source\gui\detail\window_manager.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | ||||||
| 		<Cursor> | 		<Cursor> | ||||||
| 			<Cursor1 position="30124" topLine="1046" /> | 			<Cursor1 position="30124" topLine="1046" /> | ||||||
| @ -91,29 +86,14 @@ | |||||||
| 			<Cursor1 position="15535" topLine="539" /> | 			<Cursor1 position="15535" topLine="539" /> | ||||||
| 		</Cursor> | 		</Cursor> | ||||||
| 	</File> | 	</File> | ||||||
| 	<File name="..\..\source\gui\animation.cpp" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> |  | ||||||
| 		<Cursor> |  | ||||||
| 			<Cursor1 position="1164" topLine="43" /> |  | ||||||
| 		</Cursor> |  | ||||||
| 	</File> |  | ||||||
| 	<File name="..\..\source\gui\detail\native_window_interface.cpp" open="0" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> |  | ||||||
| 		<Cursor> |  | ||||||
| 			<Cursor1 position="4901" topLine="171" /> |  | ||||||
| 		</Cursor> |  | ||||||
| 	</File> |  | ||||||
| 	<File name="..\..\source\gui\dragger.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> |  | ||||||
| 		<Cursor> |  | ||||||
| 			<Cursor1 position="1316" topLine="59" /> |  | ||||||
| 		</Cursor> |  | ||||||
| 	</File> |  | ||||||
| 	<File name="..\..\source\audio\detail\buffer_preparation.cpp" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | 	<File name="..\..\source\audio\detail\buffer_preparation.cpp" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | ||||||
| 		<Cursor> | 		<Cursor> | ||||||
| 			<Cursor1 position="1924" topLine="62" /> | 			<Cursor1 position="1924" topLine="62" /> | ||||||
| 		</Cursor> | 		</Cursor> | ||||||
| 	</File> | 	</File> | ||||||
| 	<File name="..\..\source\gui\widgets\textbox.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | 	<File name="..\..\source\gui\widgets\combox.cpp" open="0" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | ||||||
| 		<Cursor> | 		<Cursor> | ||||||
| 			<Cursor1 position="11188" topLine="459" /> | 			<Cursor1 position="16572" topLine="610" /> | ||||||
| 		</Cursor> | 		</Cursor> | ||||||
| 	</File> | 	</File> | ||||||
| 	<File name="..\..\source\gui\element.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | 	<File name="..\..\source\gui\element.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | ||||||
| @ -121,34 +101,29 @@ | |||||||
| 			<Cursor1 position="20890" topLine="542" /> | 			<Cursor1 position="20890" topLine="542" /> | ||||||
| 		</Cursor> | 		</Cursor> | ||||||
| 	</File> | 	</File> | ||||||
| 	<File name="..\..\source\threads\pool.cpp" open="0" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | 	<File name="..\..\source\gui\widgets\textbox.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | ||||||
| 		<Cursor> | 		<Cursor> | ||||||
| 			<Cursor1 position="5569" topLine="249" /> | 			<Cursor1 position="11188" topLine="459" /> | ||||||
| 		</Cursor> | 		</Cursor> | ||||||
| 	</File> | 	</File> | ||||||
| 	<File name="..\..\source\audio\detail\audio_device.cpp" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | 	<File name="..\..\source\gui\widgets\date_chooser.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | ||||||
| 		<Cursor> | 		<Cursor> | ||||||
| 			<Cursor1 position="6256" topLine="215" /> | 			<Cursor1 position="457" topLine="3" /> | ||||||
| 		</Cursor> | 		</Cursor> | ||||||
| 	</File> | 	</File> | ||||||
| 	<File name="..\..\source\gui\msgbox.cpp" open="0" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | 	<File name="..\..\source\filesystem\fs_utility.cpp" open="0" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | ||||||
| 		<Cursor> | 		<Cursor> | ||||||
| 			<Cursor1 position="48249" topLine="407" /> | 			<Cursor1 position="1562" topLine="57" /> | ||||||
| 		</Cursor> | 		</Cursor> | ||||||
| 	</File> | 	</File> | ||||||
| 	<File name="..\..\source\gui\place.cpp" open="0" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | 	<File name="..\..\source\gui\widgets\menu.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | ||||||
| 		<Cursor> | 		<Cursor> | ||||||
| 			<Cursor1 position="63864" topLine="2449" /> | 			<Cursor1 position="27717" topLine="1044" /> | ||||||
| 		</Cursor> | 		</Cursor> | ||||||
| 	</File> | 	</File> | ||||||
| 	<File name="..\..\source\gui\tooltip.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | 	<File name="..\..\source\gui\detail\native_window_interface.cpp" open="0" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | ||||||
| 		<Cursor> | 		<Cursor> | ||||||
| 			<Cursor1 position="4739" topLine="194" /> | 			<Cursor1 position="4901" topLine="171" /> | ||||||
| 		</Cursor> |  | ||||||
| 	</File> |  | ||||||
| 	<File name="..\..\source\detail\platform_spec_selector.cpp" open="0" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> |  | ||||||
| 		<Cursor> |  | ||||||
| 			<Cursor1 position="587" topLine="2" /> |  | ||||||
| 		</Cursor> | 		</Cursor> | ||||||
| 	</File> | 	</File> | ||||||
| 	<File name="..\..\source\gui\filebox.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | 	<File name="..\..\source\gui\filebox.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | ||||||
| @ -156,4 +131,29 @@ | |||||||
| 			<Cursor1 position="22934" topLine="871" /> | 			<Cursor1 position="22934" topLine="871" /> | ||||||
| 		</Cursor> | 		</Cursor> | ||||||
| 	</File> | 	</File> | ||||||
|  | 	<File name="..\..\source\audio\detail\audio_device.cpp" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | ||||||
|  | 		<Cursor> | ||||||
|  | 			<Cursor1 position="6256" topLine="215" /> | ||||||
|  | 		</Cursor> | ||||||
|  | 	</File> | ||||||
|  | 	<File name="..\..\source\gui\widgets\checkbox.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | ||||||
|  | 		<Cursor> | ||||||
|  | 			<Cursor1 position="6998" topLine="275" /> | ||||||
|  | 		</Cursor> | ||||||
|  | 	</File> | ||||||
|  | 	<File name="..\..\source\detail\platform_spec_selector.cpp" open="0" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | ||||||
|  | 		<Cursor> | ||||||
|  | 			<Cursor1 position="587" topLine="2" /> | ||||||
|  | 		</Cursor> | ||||||
|  | 	</File> | ||||||
|  | 	<File name="..\..\source\gui\widgets\categorize.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | ||||||
|  | 		<Cursor> | ||||||
|  | 			<Cursor1 position="6160" topLine="196" /> | ||||||
|  | 		</Cursor> | ||||||
|  | 	</File> | ||||||
|  | 	<File name="..\..\source\paint\text_renderer.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | ||||||
|  | 		<Cursor> | ||||||
|  | 			<Cursor1 position="5894" topLine="205" /> | ||||||
|  | 		</Cursor> | ||||||
|  | 	</File> | ||||||
| </CodeBlocks_layout_file> | </CodeBlocks_layout_file> | ||||||
|  | |||||||
| @ -184,7 +184,6 @@ | |||||||
|     <ClCompile Include="..\..\source\datetime.cpp" /> |     <ClCompile Include="..\..\source\datetime.cpp" /> | ||||||
|     <ClCompile Include="..\..\source\deploy.cpp" /> |     <ClCompile Include="..\..\source\deploy.cpp" /> | ||||||
|     <ClCompile Include="..\..\source\detail\win32\platform_spec.cpp" /> |     <ClCompile Include="..\..\source\detail\win32\platform_spec.cpp" /> | ||||||
|     <ClCompile Include="..\..\source\exceptions.cpp" /> |  | ||||||
|     <ClCompile Include="..\..\source\filesystem\filesystem.cpp" /> |     <ClCompile Include="..\..\source\filesystem\filesystem.cpp" /> | ||||||
|     <ClCompile Include="..\..\source\filesystem\file_iterator.cpp" /> |     <ClCompile Include="..\..\source\filesystem\file_iterator.cpp" /> | ||||||
|     <ClCompile Include="..\..\source\filesystem\fs_utility.cpp" /> |     <ClCompile Include="..\..\source\filesystem\fs_utility.cpp" /> | ||||||
| @ -272,7 +271,6 @@ | |||||||
|     <ClInclude Include="..\..\include\nana\detail\linux_X11\msg_packet.hpp" /> |     <ClInclude Include="..\..\include\nana\detail\linux_X11\msg_packet.hpp" /> | ||||||
|     <ClInclude Include="..\..\include\nana\detail\linux_X11\platform_spec.hpp" /> |     <ClInclude Include="..\..\include\nana\detail\linux_X11\platform_spec.hpp" /> | ||||||
|     <ClInclude Include="..\..\include\nana\detail\win32\platform_spec.hpp" /> |     <ClInclude Include="..\..\include\nana\detail\win32\platform_spec.hpp" /> | ||||||
|     <ClInclude Include="..\..\include\nana\exceptions.hpp" /> |  | ||||||
|     <ClInclude Include="..\..\include\nana\extrlib\png.h" /> |     <ClInclude Include="..\..\include\nana\extrlib\png.h" /> | ||||||
|     <ClInclude Include="..\..\include\nana\extrlib\pngconf.h" /> |     <ClInclude Include="..\..\include\nana\extrlib\pngconf.h" /> | ||||||
|     <ClInclude Include="..\..\include\nana\extrlib\pnglibconf.h" /> |     <ClInclude Include="..\..\include\nana\extrlib\pnglibconf.h" /> | ||||||
|  | |||||||
| @ -306,9 +306,6 @@ | |||||||
|     <ClCompile Include="..\..\source\deploy.cpp"> |     <ClCompile Include="..\..\source\deploy.cpp"> | ||||||
|       <Filter>Source Files\nana</Filter> |       <Filter>Source Files\nana</Filter> | ||||||
|     </ClCompile> |     </ClCompile> | ||||||
|     <ClCompile Include="..\..\source\exceptions.cpp"> |  | ||||||
|       <Filter>Source Files\nana</Filter> |  | ||||||
|     </ClCompile> |  | ||||||
|     <ClCompile Include="..\..\source\traits.cpp"> |     <ClCompile Include="..\..\source\traits.cpp"> | ||||||
|       <Filter>Source Files\nana</Filter> |       <Filter>Source Files\nana</Filter> | ||||||
|     </ClCompile> |     </ClCompile> | ||||||
| @ -577,9 +574,6 @@ | |||||||
|     <ClInclude Include="..\..\include\nana\deploy.hpp"> |     <ClInclude Include="..\..\include\nana\deploy.hpp"> | ||||||
|       <Filter>Header Files</Filter> |       <Filter>Header Files</Filter> | ||||||
|     </ClInclude> |     </ClInclude> | ||||||
|     <ClInclude Include="..\..\include\nana\exceptions.hpp"> |  | ||||||
|       <Filter>Header Files</Filter> |  | ||||||
|     </ClInclude> |  | ||||||
|     <ClInclude Include="..\..\include\nana\fwd.hpp"> |     <ClInclude Include="..\..\include\nana\fwd.hpp"> | ||||||
|       <Filter>Header Files</Filter> |       <Filter>Header Files</Filter> | ||||||
|     </ClInclude> |     </ClInclude> | ||||||
|  | |||||||
| @ -156,7 +156,6 @@ | |||||||
|     <ClCompile Include="..\..\source\datetime.cpp" /> |     <ClCompile Include="..\..\source\datetime.cpp" /> | ||||||
|     <ClCompile Include="..\..\source\deploy.cpp" /> |     <ClCompile Include="..\..\source\deploy.cpp" /> | ||||||
|     <ClCompile Include="..\..\source\detail\win32\platform_spec.cpp" /> |     <ClCompile Include="..\..\source\detail\win32\platform_spec.cpp" /> | ||||||
|     <ClCompile Include="..\..\source\exceptions.cpp" /> |  | ||||||
|     <ClCompile Include="..\..\source\filesystem\filesystem.cpp" /> |     <ClCompile Include="..\..\source\filesystem\filesystem.cpp" /> | ||||||
|     <ClCompile Include="..\..\source\filesystem\file_iterator.cpp" /> |     <ClCompile Include="..\..\source\filesystem\file_iterator.cpp" /> | ||||||
|     <ClCompile Include="..\..\source\filesystem\fs_utility.cpp" /> |     <ClCompile Include="..\..\source\filesystem\fs_utility.cpp" /> | ||||||
|  | |||||||
| @ -72,9 +72,6 @@ | |||||||
|     <ClCompile Include="..\..\source\deploy.cpp"> |     <ClCompile Include="..\..\source\deploy.cpp"> | ||||||
|       <Filter>Source Files</Filter> |       <Filter>Source Files</Filter> | ||||||
|     </ClCompile> |     </ClCompile> | ||||||
|     <ClCompile Include="..\..\source\exceptions.cpp"> |  | ||||||
|       <Filter>Source Files</Filter> |  | ||||||
|     </ClCompile> |  | ||||||
|     <ClCompile Include="..\..\source\internationalization.cpp"> |     <ClCompile Include="..\..\source\internationalization.cpp"> | ||||||
|       <Filter>Source Files</Filter> |       <Filter>Source Files</Filter> | ||||||
|     </ClCompile> |     </ClCompile> | ||||||
|  | |||||||
| @ -1,95 +0,0 @@ | |||||||
| /*
 |  | ||||||
|  *	Exception Definition |  | ||||||
|  *	Copyright(C) 2003-2013 Jinhao(cnjinhao@hotmail.com) |  | ||||||
|  * |  | ||||||
|  *	Distributed under the Boost Software License, Version 1.0.  |  | ||||||
|  *	(See accompanying file LICENSE_1_0.txt or copy at  |  | ||||||
|  *	http://www.boost.org/LICENSE_1_0.txt)
 |  | ||||||
|  * |  | ||||||
|  *	@file: nana/exceptions.hpp |  | ||||||
|  */ |  | ||||||
| 
 |  | ||||||
| #ifndef NANA_EXCEPTIONS_H |  | ||||||
| #define NANA_EXCEPTIONS_H |  | ||||||
| #include <exception> |  | ||||||
| #include <string> |  | ||||||
| 
 |  | ||||||
| namespace nana |  | ||||||
| { |  | ||||||
| 
 |  | ||||||
| 	/**
 |  | ||||||
| 	 *	nana::threads::thread::exit throws this exception to exit thread |  | ||||||
| 	 *	this exception is not allowed to be catch by programmer, |  | ||||||
| 	 *	otherwise the thread may not exit |  | ||||||
| 	 */ |  | ||||||
| 	class thrd_exit: public std::exception |  | ||||||
| 	{ |  | ||||||
| 	public: |  | ||||||
| 		thrd_exit(unsigned retval); |  | ||||||
| 		~thrd_exit() throw(); |  | ||||||
| 		const char* what() const throw(); |  | ||||||
| 		unsigned retval() const; |  | ||||||
| 	private: |  | ||||||
| 		unsigned retval_; |  | ||||||
| 	}; |  | ||||||
| 
 |  | ||||||
| 	/**
 |  | ||||||
| 	 * nana::text::settings_t throws this exception if it dose not found a given member |  | ||||||
| 	 * in a scope |  | ||||||
| 	 */ |  | ||||||
| 	class bad_member: public std::exception |  | ||||||
| 	{ |  | ||||||
| 	public: |  | ||||||
| 		bad_member(const std::string& what); |  | ||||||
| 		~bad_member() throw(); |  | ||||||
| 		const char* what() const throw(); |  | ||||||
| 	private: |  | ||||||
| 		std::string what_; |  | ||||||
| 	}; |  | ||||||
| 
 |  | ||||||
| 	/**
 |  | ||||||
| 	 * nana::text::settings_t throws this exception if there is a syntax error |  | ||||||
| 	 */ |  | ||||||
| 	class bad_syntax: public std::exception |  | ||||||
| 	{ |  | ||||||
| 	public: |  | ||||||
| 		bad_syntax(const std::string& what); |  | ||||||
|         ~bad_syntax() throw(); |  | ||||||
| 		const char* what() const throw(); |  | ||||||
| 	private: |  | ||||||
| 		std::string what_; |  | ||||||
| 	}; |  | ||||||
| 
 |  | ||||||
| 	class bad_error: public std::exception |  | ||||||
| 	{ |  | ||||||
| 	public: |  | ||||||
| 		bad_error(const std::string& what); |  | ||||||
|         ~bad_error() throw(); |  | ||||||
| 		const char* what() const throw(); |  | ||||||
| 	private: |  | ||||||
| 		std::string what_; |  | ||||||
| 	}; |  | ||||||
| 
 |  | ||||||
| 	class bad_handle: public std::exception |  | ||||||
| 	{ |  | ||||||
| 	public: |  | ||||||
| 		bad_handle(const std::string& what); |  | ||||||
|         ~bad_handle() throw(); |  | ||||||
| 		const char* what() const throw(); |  | ||||||
| 	private: |  | ||||||
| 		std::string what_; |  | ||||||
| 	}; |  | ||||||
| 
 |  | ||||||
| 	class bad_window |  | ||||||
| 		:public std::exception |  | ||||||
| 	{ |  | ||||||
| 	public:    |  | ||||||
| 		bad_window(const char* what); |  | ||||||
| 		~bad_window() throw(); |  | ||||||
| 		const char* what() const throw(); |  | ||||||
| 	private: |  | ||||||
| 		std::string what_; |  | ||||||
| 	}; |  | ||||||
| }// end namespace nana
 |  | ||||||
| 
 |  | ||||||
| #endif |  | ||||||
| @ -12,9 +12,6 @@ | |||||||
| 
 | 
 | ||||||
| #ifndef NANA_GUI_DETAIL_BEDROCK_HPP | #ifndef NANA_GUI_DETAIL_BEDROCK_HPP | ||||||
| #define NANA_GUI_DETAIL_BEDROCK_HPP | #define NANA_GUI_DETAIL_BEDROCK_HPP | ||||||
| #include "window_manager.hpp" |  | ||||||
| #include "events_operation.hpp" |  | ||||||
| #include "runtime_manager.hpp" |  | ||||||
| #include "general_events.hpp" | #include "general_events.hpp" | ||||||
| #include "color_schemes.hpp" | #include "color_schemes.hpp" | ||||||
| #include "internal_scope_guard.hpp" | #include "internal_scope_guard.hpp" | ||||||
| @ -23,9 +20,11 @@ namespace nana | |||||||
| { | { | ||||||
| namespace detail | namespace detail | ||||||
| { | { | ||||||
| 	struct native_interface; | 	class	element_store; | ||||||
| 
 | 
 | ||||||
| 	class element_store; | 	class	events_operation; | ||||||
|  | 	struct	basic_window; | ||||||
|  | 	class	window_manager; | ||||||
| 
 | 
 | ||||||
| 	//class bedrock
 | 	//class bedrock
 | ||||||
| 	//@brief:	bedrock is a fundamental core component, it provides a abstract to the OS platform
 | 	//@brief:	bedrock is a fundamental core component, it provides a abstract to the OS platform
 | ||||||
| @ -34,9 +33,7 @@ namespace detail | |||||||
| 	{ | 	{ | ||||||
| 		bedrock(); | 		bedrock(); | ||||||
| 	public: | 	public: | ||||||
| 		typedef native_interface	interface_type; | 		using core_window_t = basic_window; | ||||||
| 		typedef window_manager window_manager_t; |  | ||||||
| 		typedef window_manager_t::core_window_t core_window_t; |  | ||||||
| 
 | 
 | ||||||
| 		struct thread_context; | 		struct thread_context; | ||||||
| 
 | 
 | ||||||
| @ -53,7 +50,6 @@ namespace detail | |||||||
| 
 | 
 | ||||||
| 		::nana::category::flags category(core_window_t*); | 		::nana::category::flags category(core_window_t*); | ||||||
| 		core_window_t* focus(); | 		core_window_t* focus(); | ||||||
| 		native_window_type root(core_window_t*); |  | ||||||
| 
 | 
 | ||||||
| 		void set_menubar_taken(core_window_t*); | 		void set_menubar_taken(core_window_t*); | ||||||
| 
 | 
 | ||||||
| @ -83,14 +79,13 @@ namespace detail | |||||||
| 		void undefine_state_cursor(core_window_t*, thread_context*); | 		void undefine_state_cursor(core_window_t*, thread_context*); | ||||||
| 
 | 
 | ||||||
| 		widget_colors& get_scheme_template(scheme_factory_base&&); | 		widget_colors& get_scheme_template(scheme_factory_base&&); | ||||||
| 		std::unique_ptr<widget_colors> make_scheme(scheme_factory_base&&); | 		widget_colors* make_scheme(scheme_factory_base&&); | ||||||
|  | 
 | ||||||
|  | 		events_operation&	evt_operation(); | ||||||
|  | 		window_manager&		wd_manager(); | ||||||
|  | 
 | ||||||
|  | 		void manage_form_loader(core_window_t*, bool insert_or_remove); | ||||||
| 	public: | 	public: | ||||||
| 		events_operation	evt_operation; |  | ||||||
| 		window_manager_t	wd_manager; |  | ||||||
| 
 |  | ||||||
| 		runtime_manager<core_window_t*, bedrock>	rt_manager; |  | ||||||
| 
 |  | ||||||
| 		bool emit(event_code, core_window_t*, const arg_mouse&, bool ask_update, thread_context*); |  | ||||||
| 		bool emit(event_code, core_window_t*, const event_arg&, bool ask_update, thread_context*); | 		bool emit(event_code, core_window_t*, const event_arg&, bool ask_update, thread_context*); | ||||||
| 		bool emit_drawer(event_code, core_window_t*, const event_arg&, thread_context*); | 		bool emit_drawer(event_code, core_window_t*, const event_arg&, thread_context*); | ||||||
| 	private: | 	private: | ||||||
|  | |||||||
| @ -3,6 +3,9 @@ | |||||||
| 
 | 
 | ||||||
| #include <nana/gui/detail/bedrock.hpp> | #include <nana/gui/detail/bedrock.hpp> | ||||||
| #include "color_schemes.hpp" | #include "color_schemes.hpp" | ||||||
|  | #include "events_operation.hpp" | ||||||
|  | #include "window_manager.hpp" | ||||||
|  | #include <set> | ||||||
| 
 | 
 | ||||||
| namespace nana | namespace nana | ||||||
| { | { | ||||||
| @ -10,8 +13,10 @@ namespace nana | |||||||
| 	{ | 	{ | ||||||
| 		struct bedrock::pi_data | 		struct bedrock::pi_data | ||||||
| 		{ | 		{ | ||||||
| 			color_schemes scheme; | 			color_schemes				scheme; | ||||||
| 
 | 			events_operation			evt_operation; | ||||||
|  | 			window_manager				wd_manager; | ||||||
|  | 			std::set<core_window_t*>	auto_form_set; | ||||||
| 		}; | 		}; | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
|  | |||||||
| @ -14,7 +14,6 @@ | |||||||
| #define NANA_DETAIL_COLOR_SCHEMES_HPP | #define NANA_DETAIL_COLOR_SCHEMES_HPP | ||||||
| 
 | 
 | ||||||
| #include "widget_colors.hpp" | #include "widget_colors.hpp" | ||||||
| #include <nana/pat/cloneable.hpp> |  | ||||||
| 
 | 
 | ||||||
| namespace nana | namespace nana | ||||||
| { | { | ||||||
| @ -27,8 +26,8 @@ namespace nana | |||||||
| 			virtual ~scheme_factory_base() = default; | 			virtual ~scheme_factory_base() = default; | ||||||
| 
 | 
 | ||||||
| 			virtual factory_identifier* get_id() const = 0; | 			virtual factory_identifier* get_id() const = 0; | ||||||
| 			virtual std::unique_ptr<widget_colors> create() = 0; | 			virtual	widget_colors* create() = 0; | ||||||
| 			virtual std::unique_ptr<widget_colors> create(widget_colors&) = 0; | 			virtual widget_colors* create(widget_colors&) = 0; | ||||||
| 		}; | 		}; | ||||||
| 
 | 
 | ||||||
| 		template<typename Scheme> | 		template<typename Scheme> | ||||||
| @ -41,14 +40,14 @@ namespace nana | |||||||
| 				return &fid_; | 				return &fid_; | ||||||
| 			} | 			} | ||||||
| 
 | 
 | ||||||
| 			std::unique_ptr<widget_colors> create() override | 			widget_colors* create() override | ||||||
| 			{ | 			{ | ||||||
| 				return std::unique_ptr<widget_colors>(new Scheme); | 				return (new Scheme); | ||||||
| 			} | 			} | ||||||
| 
 | 
 | ||||||
| 			std::unique_ptr<widget_colors> create(widget_colors& other) override | 			widget_colors* create(widget_colors& other) override | ||||||
| 			{ | 			{ | ||||||
| 				return std::unique_ptr<widget_colors>{new Scheme(static_cast<Scheme&>(other))}; | 				return (new Scheme(static_cast<Scheme&>(other))); | ||||||
| 			} | 			} | ||||||
| 		private: | 		private: | ||||||
| 			static factory_identifier fid_; | 			static factory_identifier fid_; | ||||||
| @ -71,7 +70,7 @@ namespace nana | |||||||
| 			~color_schemes(); | 			~color_schemes(); | ||||||
| 
 | 
 | ||||||
| 			scheme&	scheme_template(scheme_factory_base&&); | 			scheme&	scheme_template(scheme_factory_base&&); | ||||||
| 			std::unique_ptr<scheme> create(scheme_factory_base&&); | 			scheme* create(scheme_factory_base&&); | ||||||
| 		private: | 		private: | ||||||
| 			implement * impl_; | 			implement * impl_; | ||||||
| 		}; | 		}; | ||||||
|  | |||||||
| @ -4,6 +4,7 @@ | |||||||
| #include <nana/paint/graphics.hpp> | #include <nana/paint/graphics.hpp> | ||||||
| #include <nana/paint/pixel_buffer.hpp> | #include <nana/paint/pixel_buffer.hpp> | ||||||
| #include <nana/gui/layout_utility.hpp> | #include <nana/gui/layout_utility.hpp> | ||||||
|  | #include <nana/gui/detail/window_layout.hpp> | ||||||
| 
 | 
 | ||||||
| namespace nana{ | namespace nana{ | ||||||
| 	namespace detail | 	namespace detail | ||||||
| @ -14,7 +15,7 @@ namespace nana{ | |||||||
| 			edge_nimbus_renderer() = default; | 			edge_nimbus_renderer() = default; | ||||||
| 		public: | 		public: | ||||||
| 			using core_window_t = CoreWindow; | 			using core_window_t = CoreWindow; | ||||||
| 			using window_layer = window_layout; | 			using window_layer = ::nana::detail::window_layout; | ||||||
| 			using graph_reference = ::nana::paint::graphics&; | 			using graph_reference = ::nana::paint::graphics&; | ||||||
| 
 | 
 | ||||||
| 			static edge_nimbus_renderer& instance() | 			static edge_nimbus_renderer& instance() | ||||||
|  | |||||||
| @ -6,9 +6,9 @@ | |||||||
| #include <unordered_map> | #include <unordered_map> | ||||||
| 
 | 
 | ||||||
| #if defined(NANA_MINGW) && defined(STD_THREAD_NOT_SUPPORTED) | #if defined(NANA_MINGW) && defined(STD_THREAD_NOT_SUPPORTED) | ||||||
|     #include <nana/std_mutex.hpp> | #include <nana/std_mutex.hpp> | ||||||
| #else | #else | ||||||
|     #include <mutex> | #include <mutex> | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| namespace nana | namespace nana | ||||||
| @ -24,8 +24,8 @@ namespace nana | |||||||
| 			void cancel(event_handle); | 			void cancel(event_handle); | ||||||
| 			void erase(event_handle); | 			void erase(event_handle); | ||||||
| 		private: | 		private: | ||||||
| 			mutable std::recursive_mutex mutex_; | 			std::recursive_mutex mutex_; | ||||||
| 			std::unordered_set<event_handle>	register_; | 			std::unordered_set<event_handle>	handles_; | ||||||
| 			std::unordered_map<window, std::shared_ptr<general_events>> evt_table_; | 			std::unordered_map<window, std::shared_ptr<general_events>> evt_table_; | ||||||
| 		}; | 		}; | ||||||
| 	}//end namespace detail
 | 	}//end namespace detail
 | ||||||
|  | |||||||
| @ -1,100 +0,0 @@ | |||||||
| /*
 |  | ||||||
|  *	A Runtime Manager Implementation |  | ||||||
|  *	Copyright(C) 2003-2013 Jinhao(cnjinhao@hotmail.com) |  | ||||||
|  * |  | ||||||
|  *	Distributed under the Boost Software License, Version 1.0.  |  | ||||||
|  *	(See accompanying file LICENSE_1_0.txt or copy at  |  | ||||||
|  *	http://www.boost.org/LICENSE_1_0.txt)
 |  | ||||||
|  * |  | ||||||
|  *	@file: nana/gui/detail/runtime_manager.hpp |  | ||||||
|  * |  | ||||||
|  */ |  | ||||||
| #ifndef NANA_GUI_DETAIL_RUNTIME_MANAGER_HPP |  | ||||||
| #define NANA_GUI_DETAIL_RUNTIME_MANAGER_HPP |  | ||||||
| 
 |  | ||||||
| #include <map> |  | ||||||
| 
 |  | ||||||
| namespace nana |  | ||||||
| { |  | ||||||
| 	namespace detail |  | ||||||
| 	{ |  | ||||||
| 		template<typename Window, typename Bedrock> |  | ||||||
| 		class runtime_manager |  | ||||||
| 		{ |  | ||||||
| 		public: |  | ||||||
| 			typedef Window	window_handle; |  | ||||||
| 
 |  | ||||||
| 			template<typename Form, typename... Args> |  | ||||||
| 			Form* create_form(Args&&... args) |  | ||||||
| 			{ |  | ||||||
| 				widget_placer<Form> * holder = new widget_placer<Form>; |  | ||||||
| 				if (holder->create(std::forward<Args>(args)...)) |  | ||||||
| 				{ |  | ||||||
| 					holder_[holder->get_handle()] = holder; |  | ||||||
| 					return holder->get(); |  | ||||||
| 				} |  | ||||||
| 
 |  | ||||||
| 				delete holder; |  | ||||||
| 				return nullptr; |  | ||||||
| 			} |  | ||||||
| 
 |  | ||||||
| 			void remove_if_exists(window_handle wd) |  | ||||||
| 			{ |  | ||||||
| 				auto i = holder_.find(wd); |  | ||||||
| 				if(i != holder_.cend()) |  | ||||||
| 				{ |  | ||||||
| 					delete i->second; |  | ||||||
| 					holder_.erase(i); |  | ||||||
| 				} |  | ||||||
| 			} |  | ||||||
| 		private: |  | ||||||
| 			class widget_holder |  | ||||||
| 			{ |  | ||||||
| 			public: |  | ||||||
| 				virtual ~widget_holder(){} |  | ||||||
| 				virtual window_handle get_handle() const = 0; |  | ||||||
| 			}; |  | ||||||
| 
 |  | ||||||
| 			template<typename Form> |  | ||||||
| 			class widget_placer : public widget_holder |  | ||||||
| 			{ |  | ||||||
| 			public: |  | ||||||
| 				widget_placer() |  | ||||||
| 					:	form_(nullptr) |  | ||||||
| 				{} |  | ||||||
| 
 |  | ||||||
| 				~widget_placer() |  | ||||||
| 				{ |  | ||||||
| 					delete form_; |  | ||||||
| 				} |  | ||||||
| 
 |  | ||||||
| 				template<typename... Args> |  | ||||||
| 				bool create(Args&&... args) |  | ||||||
| 				{ |  | ||||||
| 					if (nullptr == form_) |  | ||||||
| 						form_ = new Form(std::forward<Args>(args)...); |  | ||||||
| 
 |  | ||||||
| 					return (form_ && !form_->empty()); |  | ||||||
| 				} |  | ||||||
| 
 |  | ||||||
| 				Form* get() const |  | ||||||
| 				{ |  | ||||||
| 					return form_; |  | ||||||
| 				} |  | ||||||
| 
 |  | ||||||
| 				window_handle get_handle() const override |  | ||||||
| 				{ |  | ||||||
| 					return reinterpret_cast<window_handle>(form_ ? form_->handle() : nullptr); |  | ||||||
| 				} |  | ||||||
| 			private: |  | ||||||
| 				Form * form_; |  | ||||||
| 			}; |  | ||||||
| 		private: |  | ||||||
| 			std::map<window_handle, widget_holder*>	holder_; |  | ||||||
| 		}; //end class runtime_manager
 |  | ||||||
| 
 |  | ||||||
| 	}//end namespace detail
 |  | ||||||
| }//end namespace nana
 |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| #endif |  | ||||||
| @ -134,7 +134,6 @@ namespace detail | |||||||
| 		bool get_graphics(core_window_t*, nana::paint::graphics&); | 		bool get_graphics(core_window_t*, nana::paint::graphics&); | ||||||
| 		bool get_visual_rectangle(core_window_t*, nana::rectangle&); | 		bool get_visual_rectangle(core_window_t*, nana::rectangle&); | ||||||
| 
 | 
 | ||||||
| 		::nana::widget* get_widget(core_window_t*) const; |  | ||||||
| 		std::vector<core_window_t*> get_children(core_window_t*) const; | 		std::vector<core_window_t*> get_children(core_window_t*) const; | ||||||
| 		bool set_parent(core_window_t* wd, core_window_t* new_parent); | 		bool set_parent(core_window_t* wd, core_window_t* new_parent); | ||||||
| 		core_window_t* set_focus(core_window_t*, bool root_has_been_focused); | 		core_window_t* set_focus(core_window_t*, bool root_has_been_focused); | ||||||
|  | |||||||
| @ -47,7 +47,7 @@ namespace nana | |||||||
| 		public: | 		public: | ||||||
| 			bground_transparent(std::size_t percent); | 			bground_transparent(std::size_t percent); | ||||||
| 		private: | 		private: | ||||||
| 			virtual bground_interface* create() const; | 			bground_interface* create() const override; | ||||||
| 		private: | 		private: | ||||||
| 			std::size_t percent_; | 			std::size_t percent_; | ||||||
| 		}; | 		}; | ||||||
| @ -58,7 +58,7 @@ namespace nana | |||||||
| 		public: | 		public: | ||||||
| 			bground_blur(std::size_t radius); | 			bground_blur(std::size_t radius); | ||||||
| 		private: | 		private: | ||||||
| 			virtual bground_interface * create() const; | 			bground_interface * create() const override; | ||||||
| 		private: | 		private: | ||||||
| 			std::size_t radius_; | 			std::size_t radius_; | ||||||
| 		}; | 		}; | ||||||
|  | |||||||
| @ -13,9 +13,9 @@ | |||||||
| #ifndef NANA_GUI_PROGRAMMING_INTERFACE_HPP | #ifndef NANA_GUI_PROGRAMMING_INTERFACE_HPP | ||||||
| #define NANA_GUI_PROGRAMMING_INTERFACE_HPP | #define NANA_GUI_PROGRAMMING_INTERFACE_HPP | ||||||
| #include <nana/config.hpp> | #include <nana/config.hpp> | ||||||
| #include "detail/bedrock.hpp" |  | ||||||
| #include "effects.hpp" | #include "effects.hpp" | ||||||
| #include "detail/general_events.hpp" | #include "detail/general_events.hpp" | ||||||
|  | #include "detail/color_schemes.hpp" | ||||||
| #include <nana/paint/image.hpp> | #include <nana/paint/image.hpp> | ||||||
| #include <memory> | #include <memory> | ||||||
| 
 | 
 | ||||||
| @ -44,6 +44,11 @@ namespace nana | |||||||
| 
 | 
 | ||||||
| namespace API | namespace API | ||||||
| { | { | ||||||
|  | 	namespace detail | ||||||
|  | 	{ | ||||||
|  | 		::nana::widget_colors* make_scheme(::nana::detail::scheme_factory_base&&); | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
| 	void effects_edge_nimbus(window, effects::edge_nimbus); | 	void effects_edge_nimbus(window, effects::edge_nimbus); | ||||||
| 	effects::edge_nimbus effects_edge_nimbus(window); | 	effects::edge_nimbus effects_edge_nimbus(window); | ||||||
| 
 | 
 | ||||||
| @ -60,8 +65,7 @@ namespace API | |||||||
| 		template<typename Scheme> | 		template<typename Scheme> | ||||||
| 		std::unique_ptr<Scheme> make_scheme() | 		std::unique_ptr<Scheme> make_scheme() | ||||||
| 		{ | 		{ | ||||||
| 			return std::unique_ptr<Scheme>( | 			return std::unique_ptr<Scheme>{static_cast<Scheme*>(API::detail::make_scheme(::nana::detail::scheme_factory<Scheme>()))}; | ||||||
| 				static_cast<Scheme*>(::nana::detail::bedrock::instance().make_scheme(::nana::detail::scheme_factory<Scheme>()).release())); |  | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		void set_scheme(window, widget_colors*); | 		void set_scheme(window, widget_colors*); | ||||||
| @ -82,9 +86,56 @@ namespace API | |||||||
| 	}//end namespace dev
 | 	}//end namespace dev
 | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | 	widget* get_widget(window); | ||||||
|  | 
 | ||||||
| 	namespace detail | 	namespace detail | ||||||
| 	{ | 	{ | ||||||
| 		general_events* get_general_events(window); | 		general_events* get_general_events(window); | ||||||
|  | 		bool emit_event(event_code, window, const ::nana::event_arg&); | ||||||
|  | 
 | ||||||
|  | 		class enum_widgets_function_base | ||||||
|  | 		{ | ||||||
|  | 		public: | ||||||
|  | 			virtual ~enum_widgets_function_base() = default; | ||||||
|  | 			void enum_widgets(window, bool recursive); | ||||||
|  | 		private: | ||||||
|  | 			virtual bool _m_enum_fn(::nana::widget*) = 0; | ||||||
|  | 		}; | ||||||
|  | 
 | ||||||
|  | 		template<typename Widget, typename EnumFunction> | ||||||
|  | 		class enum_widgets_function | ||||||
|  | 			: public enum_widgets_function_base | ||||||
|  | 		{ | ||||||
|  | 		public: | ||||||
|  | 			enum_widgets_function(EnumFunction && enum_fn) | ||||||
|  | 				: enum_fn_(static_cast<EnumFunction&&>(enum_fn)) | ||||||
|  | 			{} | ||||||
|  | 		private: | ||||||
|  | 			bool _m_enum_fn(::nana::widget* wd) override | ||||||
|  | 			{ | ||||||
|  | 				return _m_enum_call<Widget>(wd, nullptr); | ||||||
|  | 			} | ||||||
|  | 
 | ||||||
|  | 			template<typename T, typename std::enable_if<std::is_same<::nana::widget, T>::value>::type* = nullptr> | ||||||
|  | 			bool _m_enum_call(::nana::widget* wd) | ||||||
|  | 			{ | ||||||
|  | 				enum_fn_(*wd); | ||||||
|  | 				return true; | ||||||
|  | 			} | ||||||
|  | 
 | ||||||
|  | 			template<typename T, typename std::enable_if<!std::is_same<::nana::widget, T>::value>::type* = nullptr> | ||||||
|  | 			bool _m_enum_call(::nana::widget* wd) | ||||||
|  | 			{ | ||||||
|  | 				auto ptr = dynamic_cast<Widget*>(wd); | ||||||
|  | 				if (nullptr == ptr) | ||||||
|  | 					return false; | ||||||
|  | 
 | ||||||
|  | 				enum_fn_(*ptr); | ||||||
|  | 				return true; | ||||||
|  | 			} | ||||||
|  | 		private: | ||||||
|  | 			EnumFunction && enum_fn_; | ||||||
|  | 		}; | ||||||
| 	}//end namespace detail
 | 	}//end namespace detail
 | ||||||
| 
 | 
 | ||||||
| 	void exit(); | 	void exit(); | ||||||
| @ -98,25 +149,12 @@ namespace API | |||||||
| 	rectangle make_center(window, unsigned width, unsigned height);   ///< Retrieves a rectangle which is in the center of the window
 | 	rectangle make_center(window, unsigned width, unsigned height);   ///< Retrieves a rectangle which is in the center of the window
 | ||||||
| 
 | 
 | ||||||
| 	template<typename Widget=::nana::widget, typename EnumFunction> | 	template<typename Widget=::nana::widget, typename EnumFunction> | ||||||
| 	void enum_widgets(window wd, bool recursive, EnumFunction && ef) | 	void enum_widgets(window wd, bool recursive, EnumFunction && fn) | ||||||
| 	{ | 	{ | ||||||
| 		static_assert(std::is_convertible<Widget, ::nana::widget>::value, "enum_widgets<Widget>: The specified Widget is not a widget type."); | 		static_assert(std::is_convertible<Widget, ::nana::widget>::value, "enum_widgets<Widget>: The specified Widget is not a widget type."); | ||||||
| 
 | 
 | ||||||
| 		typedef ::nana::detail::basic_window core_window_t; | 		detail::enum_widgets_function<Widget, EnumFunction> enum_fn(static_cast<EnumFunction&&>(fn)); | ||||||
| 		auto & brock = ::nana::detail::bedrock::instance(); | 		enum_fn.enum_widgets(wd, recursive); | ||||||
| 		internal_scope_guard lock; |  | ||||||
| 
 |  | ||||||
| 		auto children = brock.wd_manager.get_children(reinterpret_cast<core_window_t*>(wd)); |  | ||||||
| 		for (auto child : children) |  | ||||||
| 		{ |  | ||||||
| 			auto wgt = dynamic_cast<Widget*>(brock.wd_manager.get_widget(child)); |  | ||||||
| 			if (nullptr == wgt) |  | ||||||
| 				continue; |  | ||||||
| 
 |  | ||||||
| 			ef(*wgt); |  | ||||||
| 			if (recursive) |  | ||||||
| 				enum_widgets<Widget>(wd, recursive, std::forward<EnumFunction>(ef)); |  | ||||||
| 		} |  | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	void window_icon_default(const paint::image& small_icon, const paint::image& big_icon = {}); | 	void window_icon_default(const paint::image& small_icon, const paint::image& big_icon = {}); | ||||||
| @ -172,8 +210,7 @@ namespace API | |||||||
| 	template<typename EventArg, typename std::enable_if<std::is_base_of< ::nana::event_arg, EventArg>::value>::type* = nullptr> | 	template<typename EventArg, typename std::enable_if<std::is_base_of< ::nana::event_arg, EventArg>::value>::type* = nullptr> | ||||||
| 	bool emit_event(event_code evt_code, window wd, const EventArg& arg) | 	bool emit_event(event_code evt_code, window wd, const EventArg& arg) | ||||||
| 	{ | 	{ | ||||||
| 		auto & brock = ::nana::detail::bedrock::instance(); | 		return detail::emit_event(evt_code, wd, arg); | ||||||
| 		return brock.emit(evt_code, reinterpret_cast< ::nana::detail::bedrock::core_window_t*>(wd), arg, true, brock.get_thread_context()); |  | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	void umake_event(event_handle); | 	void umake_event(event_handle); | ||||||
|  | |||||||
| @ -166,9 +166,7 @@ namespace nana | |||||||
| 				std::size_t pos_{0}; | 				std::size_t pos_{0}; | ||||||
| 			}; | 			}; | ||||||
| 
 | 
 | ||||||
| 
 | 			using selection = std::vector<index_pair>; | ||||||
| 
 |  | ||||||
| 			typedef std::vector<index_pair> selection; |  | ||||||
| 
 | 
 | ||||||
| 			/// struct essence_t
 | 			/// struct essence_t
 | ||||||
| 			///@brief:	this struct gives many data for listbox,
 | 			///@brief:	this struct gives many data for listbox,
 | ||||||
| @ -180,7 +178,7 @@ namespace nana | |||||||
| 			class drawer_lister_impl; | 			class drawer_lister_impl; | ||||||
| 
 | 
 | ||||||
| 			/// mostly works on display positions
 | 			/// mostly works on display positions
 | ||||||
|             class trigger: public drawer_trigger | 			class trigger: public drawer_trigger | ||||||
| 			{ | 			{ | ||||||
| 			public: | 			public: | ||||||
| 				trigger(); | 				trigger(); | ||||||
| @ -208,9 +206,9 @@ namespace nana | |||||||
| 				drawer_lister_impl *drawer_lister_; | 				drawer_lister_impl *drawer_lister_; | ||||||
| 			};//end class trigger
 | 			};//end class trigger
 | ||||||
| 
 | 
 | ||||||
|             /// operate with absolute positions and contain only the position but montain pointers to parts of the real items 
 | 			/// operate with absolute positions and contain only the position but montain pointers to parts of the real items 
 | ||||||
| 			/// item_proxy self, it references and iterators are not invalidated by sort()
 | 			/// item_proxy self, it references and iterators are not invalidated by sort()
 | ||||||
|             class item_proxy | 			class item_proxy | ||||||
| 				: public std::iterator<std::input_iterator_tag, item_proxy> | 				: public std::iterator<std::input_iterator_tag, item_proxy> | ||||||
| 			{ | 			{ | ||||||
| 			public: | 			public: | ||||||
| @ -445,18 +443,18 @@ namespace nana | |||||||
| 				size_type	pos_{0};  ///< Absolute position, not relative to display, and dont change during sort()
 | 				size_type	pos_{0};  ///< Absolute position, not relative to display, and dont change during sort()
 | ||||||
| 			}; | 			}; | ||||||
| 		 | 		 | ||||||
|             struct export_options | 			struct export_options | ||||||
|             { | 			{ | ||||||
|                nana::string sep = nana::string {STR("\t" )},  | 				nana::string sep = nana::string {STR("\t" )},  | ||||||
|                             endl= nana::string {STR("\n")} ;  | 							 endl= nana::string {STR("\n")}; | ||||||
|                bool only_selected_items{true},  | 				bool only_selected_items{true},  | ||||||
|                     only_checked_items {false}, | 					 only_checked_items {false}, | ||||||
|                     only_visible_columns{true}; | 					 only_visible_columns{true}; | ||||||
| 
 | 
 | ||||||
|                using columns_indexs = std::vector<size_type>; | 				using columns_indexs = std::vector<size_type>; | ||||||
|                columns_indexs columns_order; | 				columns_indexs columns_order; | ||||||
|             }; | 			}; | ||||||
|         } | 		} | ||||||
| 	}//end namespace drawerbase
 | 	}//end namespace drawerbase
 | ||||||
| 
 | 
 | ||||||
| 	struct arg_listbox | 	struct arg_listbox | ||||||
|  | |||||||
| @ -1,7 +1,7 @@ | |||||||
| /*
 | /*
 | ||||||
|  *	Nana GUI Library Definition |  *	Nana GUI Library Definition | ||||||
|  *	Nana C++ Library(http://www.nanapro.org)
 |  *	Nana C++ Library(http://www.nanapro.org)
 | ||||||
|  *	Copyright(C) 2003-2014 Jinhao(cnjinhao@hotmail.com) |  *	Copyright(C) 2003-2015 Jinhao(cnjinhao@hotmail.com) | ||||||
|  * |  * | ||||||
|  *	Distributed under the Boost Software License, Version 1.0. |  *	Distributed under the Boost Software License, Version 1.0. | ||||||
|  *	(See accompanying file LICENSE_1_0.txt or copy at |  *	(See accompanying file LICENSE_1_0.txt or copy at | ||||||
| @ -20,27 +20,42 @@ | |||||||
| #include "widgets/form.hpp" | #include "widgets/form.hpp" | ||||||
| #include "drawing.hpp" | #include "drawing.hpp" | ||||||
| #include "msgbox.hpp" | #include "msgbox.hpp" | ||||||
| #include "../exceptions.hpp" |  | ||||||
| 
 | 
 | ||||||
| namespace nana | namespace nana | ||||||
| { | { | ||||||
| 	template<typename Form, bool IsMakeVisible = true> | 	namespace detail | ||||||
| 	class form_loader |  | ||||||
| 	{ | 	{ | ||||||
| 	public: | 		struct form_loader_private | ||||||
| 		template<typename... Args> |  | ||||||
| 		Form & operator()(Args &&... args) const |  | ||||||
| 		{ | 		{ | ||||||
| 			Form* res = detail::bedrock::instance().rt_manager.create_form<Form>(std::forward<Args>(args)...); | 			template<typename, bool> friend class form_loader; | ||||||
| 			if (nullptr == res) | 		private: | ||||||
| 				throw nana::bad_window("form_loader.operator(): failed to create a window"); | 			static void insert_form(::nana::widget*); | ||||||
|  | 		}; | ||||||
| 
 | 
 | ||||||
| 			if (IsMakeVisible) res->show(); | 		template<typename Form, bool IsVisible> | ||||||
|  | 		class form_loader | ||||||
|  | 		{ | ||||||
|  |         public: | ||||||
|  |             template<typename... Args> | ||||||
|  |             Form & operator()(Args &&... args) const | ||||||
|  |             { | ||||||
|  |                 auto p = new Form(std::forward<Args>(args)...); | ||||||
| 
 | 
 | ||||||
| 			return *res; |                 if (p->empty()) | ||||||
| 		} |                     throw std::logic_error("form_loader failed to create the form"); | ||||||
| 
 | 
 | ||||||
| 	}; |                 detail::form_loader_private::insert_form(p); | ||||||
|  |                 if (IsVisible) | ||||||
|  |                     p->show(); | ||||||
|  | 
 | ||||||
|  |                 return *p; | ||||||
|  |             } | ||||||
|  | 
 | ||||||
|  |         }; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  |     template<typename Form, bool IsVisible = true> | ||||||
|  |     using form_loader = detail::form_loader<Form, IsVisible>; | ||||||
| 
 | 
 | ||||||
| 	void exec(); | 	void exec(); | ||||||
| }//end namespace nana
 | }//end namespace nana
 | ||||||
|  | |||||||
| @ -1,7 +1,7 @@ | |||||||
| /*
 | /*
 | ||||||
|  *	Image Processor Algorithm Implementation |  *	Image Processor Algorithm Implementation | ||||||
|  *	Nana C++ Library(http://www.nanapro.org)
 |  *	Nana C++ Library(http://www.nanapro.org)
 | ||||||
|  *	Copyright(C) 2003-2014 Jinhao(cnjinhao@hotmail.com) |  *	Copyright(C) 2003-2015 Jinhao(cnjinhao@hotmail.com) | ||||||
|  * |  * | ||||||
|  *	Distributed under the Boost Software License, Version 1.0. |  *	Distributed under the Boost Software License, Version 1.0. | ||||||
|  *	(See accompanying file LICENSE_1_0.txt or copy at |  *	(See accompanying file LICENSE_1_0.txt or copy at | ||||||
| @ -233,9 +233,9 @@ namespace detail | |||||||
| 							std::size_t coef2 = el.iu * iv_minus_coef; | 							std::size_t coef2 = el.iu * iv_minus_coef; | ||||||
| 							std::size_t coef3 = el.iu * iv;			 | 							std::size_t coef3 = el.iu * iv;			 | ||||||
| 
 | 
 | ||||||
| 							i->element.red = static_cast<unsigned>((coef0 * col0.element.red + coef1 * col1.element.red + (coef2 * col2.element.red + coef3 * col3.element.red)) >> double_shift_size); | 							i->element.red = static_cast<unsigned char>((coef0 * col0.element.red + coef1 * col1.element.red + (coef2 * col2.element.red + coef3 * col3.element.red)) >> double_shift_size); | ||||||
| 							i->element.green = static_cast<unsigned>((coef0 * col0.element.green + coef1 * col1.element.green + (coef2 * col2.element.green + coef3 * col3.element.green)) >> double_shift_size); | 							i->element.green = static_cast<unsigned char>((coef0 * col0.element.green + coef1 * col1.element.green + (coef2 * col2.element.green + coef3 * col3.element.green)) >> double_shift_size); | ||||||
| 							i->element.blue = static_cast<unsigned>((coef0 * col0.element.blue + coef1 * col1.element.blue + (coef2 * col2.element.blue + coef3 * col3.element.blue)) >> double_shift_size); | 							i->element.blue = static_cast<unsigned char>((coef0 * col0.element.blue + coef1 * col1.element.blue + (coef2 * col2.element.blue + coef3 * col3.element.blue)) >> double_shift_size); | ||||||
| 						} | 						} | ||||||
| 					} | 					} | ||||||
| 				} | 				} | ||||||
|  | |||||||
| @ -13,6 +13,7 @@ | |||||||
| 
 | 
 | ||||||
| #ifndef NANA_PAT_ABSFACTORY_HPP | #ifndef NANA_PAT_ABSFACTORY_HPP | ||||||
| #define NANA_PAT_ABSFACTORY_HPP | #define NANA_PAT_ABSFACTORY_HPP | ||||||
|  | #include "cloneable.hpp" | ||||||
| #include <memory> | #include <memory> | ||||||
| 
 | 
 | ||||||
| namespace nana | namespace nana | ||||||
|  | |||||||
| @ -14,7 +14,7 @@ | |||||||
| 
 | 
 | ||||||
| #include <nana/deploy.hpp> | #include <nana/deploy.hpp> | ||||||
| #include <nana/traits.hpp> | #include <nana/traits.hpp> | ||||||
| #include <nana/exceptions.hpp> | #include <stdexcept> | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| namespace nana | namespace nana | ||||||
| @ -70,19 +70,19 @@ namespace system | |||||||
| 			typedef typename function_ptr<Function>::type fptr_type; | 			typedef typename function_ptr<Function>::type fptr_type; | ||||||
| 
 | 
 | ||||||
| 			if(nana::traits::is_function_pointer<fptr_type>::value == false) | 			if(nana::traits::is_function_pointer<fptr_type>::value == false) | ||||||
| 				throw nana::bad_error("shared_wrapper::symbols, template<_Function> is not a function type or a function pointer type"); | 				throw std::invalid_argument("shared_wrapper::symbols, template<_Function> is not a function type or a function pointer type"); | ||||||
| 
 | 
 | ||||||
| 			if(symbol == 0) | 			if(symbol == 0) | ||||||
| 				throw nana::bad_handle("shared_wrapper::symbols, symbol is null string"); | 				throw std::invalid_argument("shared_wrapper::symbols, symbol is null string"); | ||||||
| 
 | 
 | ||||||
| 			if(impl_.handle == 0) | 			if(impl_.handle == 0) | ||||||
| 				throw nana::bad_handle("shared_wrapper::symbols, empty handle"); | 				throw std::logic_error("shared_wrapper::symbols, empty handle"); | ||||||
| 
 | 
 | ||||||
| 			if(impl_.symbol != symbol) | 			if(impl_.symbol != symbol) | ||||||
| 			{ | 			{ | ||||||
| 				void *result = detail::shared_helper::symbols(impl_.handle, symbol); | 				void *result = detail::shared_helper::symbols(impl_.handle, symbol); | ||||||
| 				if(result == 0) | 				if(result == 0) | ||||||
| 					throw nana::bad_handle("shared_wrapper::symbols, empty proc address"); | 					throw std::logic_error("shared_wrapper::symbols, empty proc address"); | ||||||
| 			 | 			 | ||||||
| 				impl_.proc_address = result; | 				impl_.proc_address = result; | ||||||
| 				impl_.symbol = symbol; | 				impl_.symbol = symbol; | ||||||
|  | |||||||
| @ -24,6 +24,7 @@ | |||||||
| #include <nana/paint/graphics.hpp> | #include <nana/paint/graphics.hpp> | ||||||
| #include <nana/gui/detail/bedrock.hpp> | #include <nana/gui/detail/bedrock.hpp> | ||||||
| #include <nana/gui/detail/basic_window.hpp> | #include <nana/gui/detail/basic_window.hpp> | ||||||
|  | #include <nana/gui/detail/window_manager.hpp> | ||||||
| #include <nana/system/platform.hpp> | #include <nana/system/platform.hpp> | ||||||
| #include <errno.h> | #include <errno.h> | ||||||
| #include <sstream> | #include <sstream> | ||||||
| @ -696,7 +697,7 @@ namespace detail | |||||||
| 		if(vec) | 		if(vec) | ||||||
| 		{ | 		{ | ||||||
| 			set_error_handler(); | 			set_error_handler(); | ||||||
| 			auto & wd_manager = detail::bedrock::instance().wd_manager; | 			auto & wd_manager = detail::bedrock::instance().wd_manager(); | ||||||
| 			for(auto u = vec->rbegin(); u != vec->rend(); ++u) | 			for(auto u = vec->rbegin(); u != vec->rend(); ++u) | ||||||
| 				wd_manager.close(wd_manager.root(*u)); | 				wd_manager.close(wd_manager.root(*u)); | ||||||
| 
 | 
 | ||||||
| @ -1362,7 +1363,7 @@ namespace detail | |||||||
| 					::XTranslateCoordinates(self.display_, self.root_window(), evt.xclient.window, x, y, &self.xdnd_.pos.x, &self.xdnd_.pos.y, &child); | 					::XTranslateCoordinates(self.display_, self.root_window(), evt.xclient.window, x, y, &self.xdnd_.pos.x, &self.xdnd_.pos.y, &child); | ||||||
| 					typedef detail::bedrock bedrock; | 					typedef detail::bedrock bedrock; | ||||||
| 
 | 
 | ||||||
| 					auto wd = bedrock::instance().wd_manager.find_window(reinterpret_cast<native_window_type>(evt.xclient.window),													self.xdnd_.pos.x, self.xdnd_.pos.y); | 					auto wd = bedrock::instance().wd_manager().find_window(reinterpret_cast<native_window_type>(evt.xclient.window),													self.xdnd_.pos.x, self.xdnd_.pos.y); | ||||||
| 					if(wd && wd->flags.dropable) | 					if(wd && wd->flags.dropable) | ||||||
| 					{ | 					{ | ||||||
| 						accepted = true; | 						accepted = true; | ||||||
|  | |||||||
| @ -1,71 +0,0 @@ | |||||||
| /*
 |  | ||||||
|  *	Exception Definition |  | ||||||
|  *	Copyright(C) 2003-2013 Jinhao(cnjinhao@hotmail.com) |  | ||||||
|  * |  | ||||||
|  *	Distributed under the Boost Software License, Version 1.0.  |  | ||||||
|  *	(See accompanying file LICENSE_1_0.txt or copy at  |  | ||||||
|  *	http://www.boost.org/LICENSE_1_0.txt)
 |  | ||||||
|  * |  | ||||||
|  *	@file: nana/exceptions.cpp |  | ||||||
|  */ |  | ||||||
| #include <nana/exceptions.hpp> |  | ||||||
| 
 |  | ||||||
| namespace nana |  | ||||||
| { |  | ||||||
| 
 |  | ||||||
| 	//class thrd_exit
 |  | ||||||
| 		thrd_exit::thrd_exit(unsigned retval):retval_(retval){} |  | ||||||
| 		thrd_exit::~thrd_exit() throw(){} |  | ||||||
| 		const char* thrd_exit::what() const throw(){ return "Exit-Threading Exception"; } |  | ||||||
| 		unsigned thrd_exit::retval() const {	return retval_;	} |  | ||||||
| 	//end class thrd_exit
 |  | ||||||
| 
 |  | ||||||
| 	//class bad_member
 |  | ||||||
| 		bad_member::bad_member(const std::string& what):what_(what){} |  | ||||||
| 		bad_member::~bad_member() throw(){} |  | ||||||
| 		const char* bad_member::what() const throw() |  | ||||||
| 		{ |  | ||||||
| 			return what_.c_str(); |  | ||||||
| 		} |  | ||||||
| 	//end class bad_member
 |  | ||||||
| 
 |  | ||||||
| 	//class bad_syntax
 |  | ||||||
| 		bad_syntax::bad_syntax(const std::string& what):what_(what){} |  | ||||||
| 		bad_syntax::~bad_syntax() throw(){} |  | ||||||
| 		const char* bad_syntax::what() const throw() |  | ||||||
| 		{ |  | ||||||
| 			return what_.c_str(); |  | ||||||
| 		} |  | ||||||
| 	//end class bad_syntax
 |  | ||||||
| 
 |  | ||||||
| 	//class bad_error
 |  | ||||||
| 		bad_error::bad_error(const std::string& what):what_(what){} |  | ||||||
| 		bad_error::~bad_error() throw(){} |  | ||||||
| 		const char* bad_error::what() const throw() |  | ||||||
| 		{ |  | ||||||
| 			return what_.c_str(); |  | ||||||
| 		} |  | ||||||
| 	//end class bad_error
 |  | ||||||
| 
 |  | ||||||
| 	//class bad_handle: public std::exception
 |  | ||||||
| 		bad_handle::bad_handle(const std::string& what):what_(what){} |  | ||||||
| 		bad_handle::~bad_handle() throw(){} |  | ||||||
| 		const char* bad_handle::what() const throw() |  | ||||||
| 		{ |  | ||||||
| 			return what_.c_str(); |  | ||||||
| 		} |  | ||||||
| 	//end class bad_handle
 |  | ||||||
| 
 |  | ||||||
| 	//class bad_window  
 |  | ||||||
| 		bad_window::bad_window(const char* what) |  | ||||||
| 			:what_(what) |  | ||||||
| 		{} |  | ||||||
| 		 |  | ||||||
| 		bad_window::~bad_window() throw(){} |  | ||||||
| 
 |  | ||||||
| 		const char* bad_window::what() const throw() |  | ||||||
| 		{ |  | ||||||
| 			return what_.c_str(); |  | ||||||
| 		} |  | ||||||
| 	//end class bad_window
 |  | ||||||
| } //end namespace nana
 |  | ||||||
| @ -18,6 +18,7 @@ | |||||||
| 
 | 
 | ||||||
| #include <vector> | #include <vector> | ||||||
| #include <list> | #include <list> | ||||||
|  | #include <map> | ||||||
| #include <algorithm> | #include <algorithm> | ||||||
| 
 | 
 | ||||||
| #if defined(NANA_MINGW) && defined(STD_THREAD_NOT_SUPPORTED) | #if defined(NANA_MINGW) && defined(STD_THREAD_NOT_SUPPORTED) | ||||||
|  | |||||||
| @ -29,12 +29,12 @@ namespace nana | |||||||
| 	//class internal_scope_guard
 | 	//class internal_scope_guard
 | ||||||
| 		internal_scope_guard::internal_scope_guard() | 		internal_scope_guard::internal_scope_guard() | ||||||
| 		{ | 		{ | ||||||
| 			detail::bedrock::instance().wd_manager.internal_lock().lock(); | 			detail::bedrock::instance().wd_manager().internal_lock().lock(); | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		internal_scope_guard::~internal_scope_guard() | 		internal_scope_guard::~internal_scope_guard() | ||||||
| 		{ | 		{ | ||||||
| 			detail::bedrock::instance().wd_manager.internal_lock().unlock(); | 			detail::bedrock::instance().wd_manager().internal_lock().unlock(); | ||||||
| 		} | 		} | ||||||
| 	//end class internal_scope_guard
 | 	//end class internal_scope_guard
 | ||||||
| 
 | 
 | ||||||
| @ -54,12 +54,12 @@ namespace nana | |||||||
| 	{ | 	{ | ||||||
| 		void events_operation_register(event_handle evt) | 		void events_operation_register(event_handle evt) | ||||||
| 		{ | 		{ | ||||||
| 			bedrock::instance().evt_operation.register_evt(evt); | 			bedrock::instance().evt_operation().register_evt(evt); | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		void events_operation_cancel(event_handle evt) | 		void events_operation_cancel(event_handle evt) | ||||||
| 		{ | 		{ | ||||||
| 			bedrock::instance().evt_operation.cancel(evt); | 			bedrock::instance().evt_operation().cancel(evt); | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		class bedrock::flag_guard | 		class bedrock::flag_guard | ||||||
| @ -73,7 +73,7 @@ namespace nana | |||||||
| 
 | 
 | ||||||
| 			~flag_guard() | 			~flag_guard() | ||||||
| 			{ | 			{ | ||||||
| 				if (brock_->wd_manager.available((wd_))) | 				if (brock_->wd_manager().available((wd_))) | ||||||
| 					wd_->flags.refreshing = false; | 					wd_->flags.refreshing = false; | ||||||
| 			} | 			} | ||||||
| 		private: | 		private: | ||||||
| @ -82,6 +82,31 @@ namespace nana | |||||||
| 
 | 
 | ||||||
| 		}; | 		}; | ||||||
| 
 | 
 | ||||||
|  | 		events_operation& bedrock::evt_operation() | ||||||
|  | 		{ | ||||||
|  | 			return pi_data_->evt_operation; | ||||||
|  | 		} | ||||||
|  | 
 | ||||||
|  | 		window_manager& bedrock::wd_manager() | ||||||
|  | 		{ | ||||||
|  | 			return pi_data_->wd_manager; | ||||||
|  | 		} | ||||||
|  | 
 | ||||||
|  | 		void bedrock::manage_form_loader(core_window_t* wd, bool insert_or_remove) | ||||||
|  | 		{ | ||||||
|  | 			if (insert_or_remove) | ||||||
|  | 			{ | ||||||
|  | 				pi_data_->auto_form_set.insert(wd); | ||||||
|  | 				return; | ||||||
|  | 			} | ||||||
|  | 			 | ||||||
|  | 			if (pi_data_->auto_form_set.erase(wd)) | ||||||
|  | 			{ | ||||||
|  | 				auto p = wd->widget_notifier->widget_ptr(); | ||||||
|  | 				delete p; | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
|  | 
 | ||||||
| 		void bedrock::event_expose(core_window_t * wd, bool exposed) | 		void bedrock::event_expose(core_window_t * wd, bool exposed) | ||||||
| 		{ | 		{ | ||||||
| 			if (nullptr == wd) return; | 			if (nullptr == wd) return; | ||||||
| @ -113,11 +138,11 @@ namespace nana | |||||||
| 						wd = wd->seek_non_lite_widget_ancestor(); | 						wd = wd->seek_non_lite_widget_ancestor(); | ||||||
| 					} | 					} | ||||||
| 					else if (category::flags::frame == wd->other.category) | 					else if (category::flags::frame == wd->other.category) | ||||||
| 						wd = wd_manager.find_window(wd->root, wd->pos_root.x, wd->pos_root.y); | 						wd = wd_manager().find_window(wd->root, wd->pos_root.x, wd->pos_root.y); | ||||||
| 				} | 				} | ||||||
| 
 | 
 | ||||||
| 				wd_manager.refresh_tree(wd); | 				wd_manager().refresh_tree(wd); | ||||||
| 				wd_manager.map(wd, false); | 				wd_manager().map(wd, false); | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| @ -130,13 +155,13 @@ namespace nana | |||||||
| 				arg.x = x; | 				arg.x = x; | ||||||
| 				arg.y = y; | 				arg.y = y; | ||||||
| 				if (emit(event_code::move, wd, arg, false, get_thread_context())) | 				if (emit(event_code::move, wd, arg, false, get_thread_context())) | ||||||
| 					wd_manager.update(wd, false, true); | 					wd_manager().update(wd, false, true); | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		bool bedrock::event_msleave(core_window_t* hovered) | 		bool bedrock::event_msleave(core_window_t* hovered) | ||||||
| 		{ | 		{ | ||||||
| 			if (wd_manager.available(hovered) && hovered->flags.enabled) | 			if (wd_manager().available(hovered) && hovered->flags.enabled) | ||||||
| 			{ | 			{ | ||||||
| 				hovered->flags.action = mouse_action::normal; | 				hovered->flags.action = mouse_action::normal; | ||||||
| 
 | 
 | ||||||
| @ -155,7 +180,7 @@ namespace nana | |||||||
| 		void bedrock::update_cursor(core_window_t * wd) | 		void bedrock::update_cursor(core_window_t * wd) | ||||||
| 		{ | 		{ | ||||||
| 			internal_scope_guard isg; | 			internal_scope_guard isg; | ||||||
| 			if (wd_manager.available(wd)) | 			if (wd_manager().available(wd)) | ||||||
| 			{ | 			{ | ||||||
| 				auto * thrd = get_thread_context(wd->thread_id); | 				auto * thrd = get_thread_context(wd->thread_id); | ||||||
| 				if (nullptr == thrd) | 				if (nullptr == thrd) | ||||||
| @ -167,7 +192,7 @@ namespace nana | |||||||
| 					return; | 					return; | ||||||
| 
 | 
 | ||||||
| 				native_interface::calc_window_point(native_handle, pos); | 				native_interface::calc_window_point(native_handle, pos); | ||||||
| 				if (wd != wd_manager.find_window(native_handle, pos.x, pos.y)) | 				if (wd != wd_manager().find_window(native_handle, pos.x, pos.y)) | ||||||
| 					return; | 					return; | ||||||
| 
 | 
 | ||||||
| 				set_cursor(wd, wd->predef_cursor, thrd); | 				set_cursor(wd, wd->predef_cursor, thrd); | ||||||
| @ -179,7 +204,7 @@ namespace nana | |||||||
| 			return pi_data_->scheme.scheme_template(std::move(factory)); | 			return pi_data_->scheme.scheme_template(std::move(factory)); | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		std::unique_ptr<widget_colors> bedrock::make_scheme(scheme_factory_base&& factory) | 		widget_colors* bedrock::make_scheme(scheme_factory_base&& factory) | ||||||
| 		{ | 		{ | ||||||
| 			return pi_data_->scheme.create(std::move(factory)); | 			return pi_data_->scheme.create(std::move(factory)); | ||||||
| 		} | 		} | ||||||
| @ -415,7 +440,7 @@ namespace nana | |||||||
| 		void bedrock::_m_except_handler() | 		void bedrock::_m_except_handler() | ||||||
| 		{ | 		{ | ||||||
| 			std::vector<core_window_t*> v; | 			std::vector<core_window_t*> v; | ||||||
| 			wd_manager.all_handles(v); | 			wd_manager().all_handles(v); | ||||||
| 			if (v.size()) | 			if (v.size()) | ||||||
| 			{ | 			{ | ||||||
| 				std::vector<native_window_type> roots; | 				std::vector<native_window_type> roots; | ||||||
| @ -432,7 +457,7 @@ namespace nana | |||||||
| 				} | 				} | ||||||
| 
 | 
 | ||||||
| 				for (auto i : roots) | 				for (auto i : roots) | ||||||
| 					interface_type::close_window(i); | 					native_interface::close_window(i); | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 	}//end namespace detail
 | 	}//end namespace detail
 | ||||||
|  | |||||||
| @ -76,12 +76,12 @@ namespace nana | |||||||
| 
 | 
 | ||||||
| 				//Creates a scheme template if no template
 | 				//Creates a scheme template if no template
 | ||||||
| 				if (!tmpl_scheme) | 				if (!tmpl_scheme) | ||||||
| 					factory.create().swap(tmpl_scheme); | 					tmpl_scheme.reset(factory.create()); | ||||||
| 
 | 
 | ||||||
| 				return *tmpl_scheme.get(); | 				return *tmpl_scheme.get(); | ||||||
| 			} | 			} | ||||||
| 
 | 
 | ||||||
| 			std::unique_ptr<widget_colors> color_schemes::create(scheme_factory_base&& factory) | 			widget_colors* color_schemes::create(scheme_factory_base&& factory) | ||||||
| 			{ | 			{ | ||||||
| 				return factory.create(scheme_template(std::move(factory))); | 				return factory.create(scheme_template(std::move(factory))); | ||||||
| 			} | 			} | ||||||
|  | |||||||
| @ -5,7 +5,7 @@ namespace nana | |||||||
| 	namespace detail | 	namespace detail | ||||||
| 	{ | 	{ | ||||||
| 		//class events_operation
 | 		//class events_operation
 | ||||||
| 			typedef std::lock_guard<std::recursive_mutex> lock_guard; | 			using lock_guard = std::lock_guard<std::recursive_mutex>; | ||||||
| 
 | 
 | ||||||
| 			void events_operation::make(window wd, const std::shared_ptr<general_events>& sp) | 			void events_operation::make(window wd, const std::shared_ptr<general_events>& sp) | ||||||
| 			{ | 			{ | ||||||
| @ -22,21 +22,21 @@ namespace nana | |||||||
| 			void events_operation::register_evt(event_handle evt) | 			void events_operation::register_evt(event_handle evt) | ||||||
| 			{ | 			{ | ||||||
| 				lock_guard lock(mutex_); | 				lock_guard lock(mutex_); | ||||||
| 				register_.insert(evt); | 				handles_.insert(evt); | ||||||
| 			} | 			} | ||||||
| 
 | 
 | ||||||
| 			void events_operation::cancel(event_handle evt) | 			void events_operation::cancel(event_handle evt) | ||||||
| 			{ | 			{ | ||||||
| 				lock_guard lock(mutex_); | 				lock_guard lock(mutex_); | ||||||
| 				register_.erase(evt); | 				handles_.erase(evt); | ||||||
| 			} | 			} | ||||||
| 
 | 
 | ||||||
| 			void events_operation::erase(event_handle evt) | 			void events_operation::erase(event_handle evt) | ||||||
| 			{ | 			{ | ||||||
| 				lock_guard lock(mutex_); | 				lock_guard lock(mutex_); | ||||||
| 
 | 
 | ||||||
| 				auto i = register_.find(evt); | 				auto i = handles_.find(evt); | ||||||
| 				if (i != register_.end()) | 				if (i != handles_.end()) | ||||||
| 				{ | 				{ | ||||||
| 					reinterpret_cast<detail::docker_interface*>(evt)->get_event()->remove(evt); | 					reinterpret_cast<detail::docker_interface*>(evt)->get_event()->remove(evt); | ||||||
| 				} | 				} | ||||||
|  | |||||||
| @ -233,7 +233,7 @@ namespace detail | |||||||
| 		if(wd) | 		if(wd) | ||||||
| 		{ | 		{ | ||||||
| 			internal_scope_guard isg; | 			internal_scope_guard isg; | ||||||
| 			if(wd_manager.available(wd)) | 			if(wd_manager().available(wd)) | ||||||
| 				return wd->other.category; | 				return wd->other.category; | ||||||
| 		} | 		} | ||||||
| 		return category::flags::super; | 		return category::flags::super; | ||||||
| @ -241,21 +241,10 @@ namespace detail | |||||||
| 
 | 
 | ||||||
| 	bedrock::core_window_t* bedrock::focus() | 	bedrock::core_window_t* bedrock::focus() | ||||||
| 	{ | 	{ | ||||||
| 		core_window_t* wd = wd_manager.root(native_interface::get_focus_window()); | 		core_window_t* wd = wd_manager().root(native_interface::get_focus_window()); | ||||||
| 		return (wd ? wd->other.attribute.root->focus : 0); | 		return (wd ? wd->other.attribute.root->focus : 0); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	native_window_type bedrock::root(core_window_t* wd) |  | ||||||
| 	{ |  | ||||||
| 		if(wd) |  | ||||||
| 		{ |  | ||||||
| 			internal_scope_guard isg; |  | ||||||
| 			if(wd_manager.available(wd)) |  | ||||||
| 				return wd->root; |  | ||||||
| 		} |  | ||||||
| 		return nullptr; |  | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	void bedrock::set_menubar_taken(core_window_t* wd) | 	void bedrock::set_menubar_taken(core_window_t* wd) | ||||||
| 	{ | 	{ | ||||||
| 		auto pre = impl_->menu.taken_window; | 		auto pre = impl_->menu.taken_window; | ||||||
| @ -265,8 +254,8 @@ namespace detail | |||||||
| 		if ((!wd) && pre) | 		if ((!wd) && pre) | ||||||
| 		{ | 		{ | ||||||
| 			internal_scope_guard lock; | 			internal_scope_guard lock; | ||||||
| 			wd_manager.set_focus(pre, false); | 			wd_manager().set_focus(pre, false); | ||||||
| 			wd_manager.update(pre, true, false); | 			wd_manager().update(pre, true, false); | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| @ -381,17 +370,9 @@ namespace detail | |||||||
| 		//No implementation for Linux
 | 		//No implementation for Linux
 | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| 	bool bedrock::emit(event_code evt_code, core_window_t* wd, const arg_mouse& arg, bool ask_update, thread_context* thrd) |  | ||||||
| 	{ |  | ||||||
| 		if(evt_code != arg.evt_code) |  | ||||||
| 			throw std::runtime_error("Nana.bedrock: Invalid event arg."); |  | ||||||
| 		return emit(evt_code, wd, static_cast<const ::nana::event_arg&>(arg), ask_update, thrd); |  | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	bool bedrock::emit(event_code evt_code, core_window_t* wd, const ::nana::event_arg& arg, bool ask_update, thread_context* thrd) | 	bool bedrock::emit(event_code evt_code, core_window_t* wd, const ::nana::event_arg& arg, bool ask_update, thread_context* thrd) | ||||||
| 	{ | 	{ | ||||||
| 		if(wd_manager.available(wd) == false) | 		if(wd_manager().available(wd) == false) | ||||||
| 			return false; | 			return false; | ||||||
| 
 | 
 | ||||||
| 		core_window_t * prev_wd; | 		core_window_t * prev_wd; | ||||||
| @ -408,7 +389,7 @@ namespace detail | |||||||
| 		_m_emit_core(evt_code, wd, false, arg); | 		_m_emit_core(evt_code, wd, false, arg); | ||||||
| 
 | 
 | ||||||
| 		if(ask_update) | 		if(ask_update) | ||||||
| 			wd_manager.do_lazy_refresh(wd, false); | 			wd_manager().do_lazy_refresh(wd, false); | ||||||
| 		else | 		else | ||||||
| 			wd->other.upd_state = core_window_t::update_state::none; | 			wd->other.upd_state = core_window_t::update_state::none; | ||||||
| 
 | 
 | ||||||
| @ -418,7 +399,7 @@ namespace detail | |||||||
| 
 | 
 | ||||||
| 	bool bedrock::emit_drawer(event_code evt_code, core_window_t* wd, const ::nana::event_arg& arg, thread_context* thrd) | 	bool bedrock::emit_drawer(event_code evt_code, core_window_t* wd, const ::nana::event_arg& arg, thread_context* thrd) | ||||||
| 	{ | 	{ | ||||||
| 		if(wd_manager.available(wd) == false) | 		if(wd_manager().available(wd) == false) | ||||||
| 			return false; | 			return false; | ||||||
| 
 | 
 | ||||||
| 		core_window_t * prev_wd; | 		core_window_t * prev_wd; | ||||||
| @ -541,7 +522,7 @@ namespace detail | |||||||
| 		static auto& brock = detail::bedrock::instance(); | 		static auto& brock = detail::bedrock::instance(); | ||||||
| 
 | 
 | ||||||
| 		auto native_window = reinterpret_cast<native_window_type>(msg.u.packet_window); | 		auto native_window = reinterpret_cast<native_window_type>(msg.u.packet_window); | ||||||
| 		auto root_runtime = brock.wd_manager.root_runtime(native_window); | 		auto root_runtime = brock.wd_manager().root_runtime(native_window); | ||||||
| 
 | 
 | ||||||
| 		if(root_runtime) | 		if(root_runtime) | ||||||
| 		{ | 		{ | ||||||
| @ -550,7 +531,7 @@ namespace detail | |||||||
| 			switch(msg.kind) | 			switch(msg.kind) | ||||||
| 			{ | 			{ | ||||||
| 			case nana::detail::msg_packet_tag::kind_mouse_drop: | 			case nana::detail::msg_packet_tag::kind_mouse_drop: | ||||||
| 				msgwd = brock.wd_manager.find_window(native_window, msg.u.mouse_drop.x, msg.u.mouse_drop.y); | 				msgwd = brock.wd_manager().find_window(native_window, msg.u.mouse_drop.x, msg.u.mouse_drop.y); | ||||||
| 				if(msgwd) | 				if(msgwd) | ||||||
| 				{ | 				{ | ||||||
| 					arg_dropfiles arg; | 					arg_dropfiles arg; | ||||||
| @ -560,7 +541,7 @@ namespace detail | |||||||
| 					arg.pos.x = msg.u.mouse_drop.x - msgwd->pos_root.x; | 					arg.pos.x = msg.u.mouse_drop.x - msgwd->pos_root.x; | ||||||
| 					arg.pos.y = msg.u.mouse_drop.y - msgwd->pos_root.y; | 					arg.pos.y = msg.u.mouse_drop.y - msgwd->pos_root.y; | ||||||
| 					msgwd->together.events_ptr->mouse_dropfiles.emit(arg); | 					msgwd->together.events_ptr->mouse_dropfiles.emit(arg); | ||||||
| 					brock.wd_manager.do_lazy_refresh(msgwd, false); | 					brock.wd_manager().do_lazy_refresh(msgwd, false); | ||||||
| 				} | 				} | ||||||
| 				break; | 				break; | ||||||
| 			default: | 			default: | ||||||
| @ -572,7 +553,7 @@ namespace detail | |||||||
| 	template<typename Arg> | 	template<typename Arg> | ||||||
| 	void emit_drawer(void(::nana::detail::drawer::*event_ptr)(const Arg&), basic_window* wd, const Arg& arg, bedrock::thread_context* thrd) | 	void emit_drawer(void(::nana::detail::drawer::*event_ptr)(const Arg&), basic_window* wd, const Arg& arg, bedrock::thread_context* thrd) | ||||||
| 	{ | 	{ | ||||||
| 		if(bedrock::instance().wd_manager.available(wd) == false) | 		if(bedrock::instance().wd_manager().available(wd) == false) | ||||||
| 			return; | 			return; | ||||||
| 		basic_window * pre_wd; | 		basic_window * pre_wd; | ||||||
| 		if(thrd) | 		if(thrd) | ||||||
| @ -597,7 +578,7 @@ namespace detail | |||||||
| 		static core_window_t*	last_mouse_down_window; | 		static core_window_t*	last_mouse_down_window; | ||||||
| 
 | 
 | ||||||
| 		auto native_window = reinterpret_cast<native_window_type>(event_window(xevent)); | 		auto native_window = reinterpret_cast<native_window_type>(event_window(xevent)); | ||||||
| 		auto root_runtime = brock.wd_manager.root_runtime(native_window); | 		auto root_runtime = brock.wd_manager().root_runtime(native_window); | ||||||
| 
 | 
 | ||||||
| 		if(root_runtime) | 		if(root_runtime) | ||||||
| 		{ | 		{ | ||||||
| @ -612,7 +593,7 @@ namespace detail | |||||||
| 			switch(xevent.type) | 			switch(xevent.type) | ||||||
| 			{ | 			{ | ||||||
| 			case EnterNotify: | 			case EnterNotify: | ||||||
| 				msgwnd = brock.wd_manager.find_window(native_window, xevent.xcrossing.x, xevent.xcrossing.y); | 				msgwnd = brock.wd_manager().find_window(native_window, xevent.xcrossing.x, xevent.xcrossing.y); | ||||||
| 				if(msgwnd) | 				if(msgwnd) | ||||||
| 				{ | 				{ | ||||||
| 					if (mouse_action::pressed != msgwnd->flags.action) | 					if (mouse_action::pressed != msgwnd->flags.action) | ||||||
| @ -626,7 +607,7 @@ namespace detail | |||||||
| 					arg.evt_code = event_code::mouse_move; | 					arg.evt_code = event_code::mouse_move; | ||||||
| 					brock.emit(event_code::mouse_move, msgwnd, arg, true, &context); | 					brock.emit(event_code::mouse_move, msgwnd, arg, true, &context); | ||||||
| 					 | 					 | ||||||
| 					if (!brock.wd_manager.available(hovered_wd)) | 					if (!brock.wd_manager().available(hovered_wd)) | ||||||
| 						hovered_wd = nullptr; | 						hovered_wd = nullptr; | ||||||
| 				} | 				} | ||||||
| 				break; | 				break; | ||||||
| @ -646,7 +627,7 @@ namespace detail | |||||||
| 					arg.receiver = native_window; | 					arg.receiver = native_window; | ||||||
| 					arg.getting = true; | 					arg.getting = true; | ||||||
| 					if(!brock.emit(event_code::focus, focus, arg, true, &context)) | 					if(!brock.emit(event_code::focus, focus, arg, true, &context)) | ||||||
| 						brock.wd_manager.set_focus(msgwnd, true); | 						brock.wd_manager().set_focus(msgwnd, true); | ||||||
| 				} | 				} | ||||||
| 				break; | 				break; | ||||||
| 			case FocusOut: | 			case FocusOut: | ||||||
| @ -672,7 +653,7 @@ namespace detail | |||||||
| 				if(msgwnd->dimension.width != static_cast<unsigned>(xevent.xconfigure.width) || msgwnd->dimension.height != static_cast<unsigned>(xevent.xconfigure.height)) | 				if(msgwnd->dimension.width != static_cast<unsigned>(xevent.xconfigure.width) || msgwnd->dimension.height != static_cast<unsigned>(xevent.xconfigure.height)) | ||||||
| 				{ | 				{ | ||||||
| 					auto & cf = xevent.xconfigure; | 					auto & cf = xevent.xconfigure; | ||||||
| 					brock.wd_manager.size(msgwnd, nana::size{static_cast<unsigned>(cf.width), static_cast<unsigned>(cf.height)}, true, true); | 					brock.wd_manager().size(msgwnd, nana::size{static_cast<unsigned>(cf.width), static_cast<unsigned>(cf.height)}, true, true); | ||||||
| 				} | 				} | ||||||
| 				 | 				 | ||||||
| 				if(msgwnd->pos_native.x != xevent.xconfigure.x || msgwnd->pos_native.y != xevent.xconfigure.y) | 				if(msgwnd->pos_native.x != xevent.xconfigure.x || msgwnd->pos_native.y != xevent.xconfigure.y) | ||||||
| @ -686,7 +667,7 @@ namespace detail | |||||||
| 				if(xevent.xbutton.button == Button4 || xevent.xbutton.button == Button5) | 				if(xevent.xbutton.button == Button4 || xevent.xbutton.button == Button5) | ||||||
| 					break; | 					break; | ||||||
| 					 | 					 | ||||||
| 				msgwnd = brock.wd_manager.find_window(native_window, xevent.xbutton.x, xevent.xbutton.y); | 				msgwnd = brock.wd_manager().find_window(native_window, xevent.xbutton.x, xevent.xbutton.y); | ||||||
| 				if(nullptr == msgwnd) break; | 				if(nullptr == msgwnd) break; | ||||||
| 					 | 					 | ||||||
| 				if ((msgwnd == msgwnd->root_widget->other.attribute.root->menubar) && brock.get_menu(msgwnd->root, true)) | 				if ((msgwnd == msgwnd->root_widget->other.attribute.root->menubar) && brock.get_menu(msgwnd->root, true)) | ||||||
| @ -706,9 +687,9 @@ namespace detail | |||||||
| 						if (new_focus && !new_focus->flags.ignore_mouse_focus) | 						if (new_focus && !new_focus->flags.ignore_mouse_focus) | ||||||
| 						{ | 						{ | ||||||
| 							context.event_window = new_focus; | 							context.event_window = new_focus; | ||||||
| 							auto kill_focus = brock.wd_manager.set_focus(new_focus, false); | 							auto kill_focus = brock.wd_manager().set_focus(new_focus, false); | ||||||
| 							if (kill_focus != new_focus) | 							if (kill_focus != new_focus) | ||||||
| 								brock.wd_manager.do_lazy_refresh(kill_focus, false); | 								brock.wd_manager().do_lazy_refresh(kill_focus, false); | ||||||
| 						} | 						} | ||||||
| 					} | 					} | ||||||
| 
 | 
 | ||||||
| @ -722,7 +703,7 @@ namespace detail | |||||||
| 					arg.evt_code = dbl_click ? event_code::dbl_click : event_code::mouse_down; | 					arg.evt_code = dbl_click ? event_code::dbl_click : event_code::mouse_down; | ||||||
| 					if(brock.emit(arg.evt_code, msgwnd, arg, true, &context)) | 					if(brock.emit(arg.evt_code, msgwnd, arg, true, &context)) | ||||||
| 					{ | 					{ | ||||||
| 						if (brock.wd_manager.available(msgwnd)) | 						if (brock.wd_manager().available(msgwnd)) | ||||||
| 						{ | 						{ | ||||||
| 							pressed_wd = msgwnd; | 							pressed_wd = msgwnd; | ||||||
| 							//If a root window is created during the mouse_down event, Nana.GUI will ignore the mouse_up event.
 | 							//If a root window is created during the mouse_down event, Nana.GUI will ignore the mouse_up event.
 | ||||||
| @ -731,7 +712,7 @@ namespace detail | |||||||
| 								//call the drawer mouse up event for restoring the surface graphics
 | 								//call the drawer mouse up event for restoring the surface graphics
 | ||||||
| 								msgwnd->flags.action = mouse_action::normal; | 								msgwnd->flags.action = mouse_action::normal; | ||||||
| 								emit_drawer(&drawer::mouse_up, msgwnd, arg, &context); | 								emit_drawer(&drawer::mouse_up, msgwnd, arg, &context); | ||||||
| 								brock.wd_manager.do_lazy_refresh(msgwnd, false); | 								brock.wd_manager().do_lazy_refresh(msgwnd, false); | ||||||
| 							} | 							} | ||||||
| 						} | 						} | ||||||
| 					} | 					} | ||||||
| @ -758,7 +739,7 @@ namespace detail | |||||||
| 				} | 				} | ||||||
| 				else | 				else | ||||||
| 				{ | 				{ | ||||||
| 					msgwnd = brock.wd_manager.find_window(native_window, xevent.xbutton.x, xevent.xbutton.y); | 					msgwnd = brock.wd_manager().find_window(native_window, xevent.xbutton.x, xevent.xbutton.y); | ||||||
| 					if(nullptr == msgwnd) | 					if(nullptr == msgwnd) | ||||||
| 						break; | 						break; | ||||||
| 
 | 
 | ||||||
| @ -786,7 +767,7 @@ namespace detail | |||||||
| 						} | 						} | ||||||
| 					 | 					 | ||||||
| 						//Do mouse_up, this handle may be closed by click handler.
 | 						//Do mouse_up, this handle may be closed by click handler.
 | ||||||
| 						if(brock.wd_manager.available(msgwnd) && msgwnd->flags.enabled) | 						if(brock.wd_manager().available(msgwnd) && msgwnd->flags.enabled) | ||||||
| 						{ | 						{ | ||||||
| 							if(hit) | 							if(hit) | ||||||
| 								msgwnd->flags.action = mouse_action::over; | 								msgwnd->flags.action = mouse_action::over; | ||||||
| @ -805,7 +786,7 @@ namespace detail | |||||||
| 								evt_ptr->click.emit(arg); | 								evt_ptr->click.emit(arg); | ||||||
| 							} | 							} | ||||||
| 
 | 
 | ||||||
| 							if (brock.wd_manager.available(msgwnd)) | 							if (brock.wd_manager().available(msgwnd)) | ||||||
| 							{ | 							{ | ||||||
| 								arg.evt_code = event_code::mouse_up; | 								arg.evt_code = event_code::mouse_up; | ||||||
| 								evt_ptr->mouse_up.emit(arg); | 								evt_ptr->mouse_up.emit(arg); | ||||||
| @ -818,7 +799,7 @@ namespace detail | |||||||
| 							arg.by_mouse = true; | 							arg.by_mouse = true; | ||||||
| 							msgwnd->together.events_ptr->click.emit(arg); | 							msgwnd->together.events_ptr->click.emit(arg); | ||||||
| 						} | 						} | ||||||
| 						brock.wd_manager.do_lazy_refresh(msgwnd, false); | 						brock.wd_manager().do_lazy_refresh(msgwnd, false); | ||||||
| 					} | 					} | ||||||
| 					pressed_wd = nullptr; | 					pressed_wd = nullptr; | ||||||
| 				} | 				} | ||||||
| @ -826,7 +807,7 @@ namespace detail | |||||||
| 			case DestroyNotify: | 			case DestroyNotify: | ||||||
| 				{ | 				{ | ||||||
| 					auto & spec = nana::detail::platform_spec::instance(); | 					auto & spec = nana::detail::platform_spec::instance(); | ||||||
| 					if(brock.wd_manager.available(msgwnd)) | 					if(brock.wd_manager().available(msgwnd)) | ||||||
| 					{ | 					{ | ||||||
| 						//The msgwnd may be destroyed if the window is destroyed by calling native interface of close_window().
 | 						//The msgwnd may be destroyed if the window is destroyed by calling native interface of close_window().
 | ||||||
| 						if (msgwnd->root == brock.get_menu()) | 						if (msgwnd->root == brock.get_menu()) | ||||||
| @ -836,10 +817,10 @@ namespace detail | |||||||
| 						} | 						} | ||||||
| 
 | 
 | ||||||
| 						spec.remove(native_window); | 						spec.remove(native_window); | ||||||
| 						brock.wd_manager.destroy(msgwnd); | 						brock.wd_manager().destroy(msgwnd); | ||||||
| 
 | 
 | ||||||
| 						brock.rt_manager.remove_if_exists(msgwnd); | 						brock.manage_form_loader(msgwnd, false); | ||||||
| 						brock.wd_manager.destroy_handle(msgwnd); | 						brock.wd_manager().destroy_handle(msgwnd); | ||||||
| 					} | 					} | ||||||
| 				} | 				} | ||||||
| 				break; | 				break; | ||||||
| @ -854,8 +835,8 @@ namespace detail | |||||||
| 				else | 				else | ||||||
| 					break; | 					break; | ||||||
| 
 | 
 | ||||||
| 				msgwnd = brock.wd_manager.find_window(native_window, xevent.xmotion.x, xevent.xmotion.y); | 				msgwnd = brock.wd_manager().find_window(native_window, xevent.xmotion.x, xevent.xmotion.y); | ||||||
| 				if (brock.wd_manager.available(hovered_wd) && (msgwnd != hovered_wd)) | 				if (brock.wd_manager().available(hovered_wd) && (msgwnd != hovered_wd)) | ||||||
| 				{ | 				{ | ||||||
| 					brock.event_msleave(hovered_wd); | 					brock.event_msleave(hovered_wd); | ||||||
| 					hovered_wd->flags.action = mouse_action::normal; | 					hovered_wd->flags.action = mouse_action::normal; | ||||||
| @ -863,14 +844,14 @@ namespace detail | |||||||
| 
 | 
 | ||||||
| 					//if msgwnd is neither a captured window nor a child of captured window,
 | 					//if msgwnd is neither a captured window nor a child of captured window,
 | ||||||
| 					//redirect the msgwnd to the captured window.
 | 					//redirect the msgwnd to the captured window.
 | ||||||
| 					auto cap_wd = brock.wd_manager.capture_redirect(msgwnd); | 					auto cap_wd = brock.wd_manager().capture_redirect(msgwnd); | ||||||
| 					if(cap_wd) | 					if(cap_wd) | ||||||
| 						msgwnd = cap_wd; | 						msgwnd = cap_wd; | ||||||
| 				} | 				} | ||||||
| 				else if(msgwnd) | 				else if(msgwnd) | ||||||
| 				{ | 				{ | ||||||
| 					bool prev_captured_inside; | 					bool prev_captured_inside; | ||||||
| 					if(brock.wd_manager.capture_window_entered(xevent.xmotion.x, xevent.xmotion.y, prev_captured_inside)) | 					if(brock.wd_manager().capture_window_entered(xevent.xmotion.x, xevent.xmotion.y, prev_captured_inside)) | ||||||
| 					{ | 					{ | ||||||
| 						event_code evt_code; | 						event_code evt_code; | ||||||
| 						if(prev_captured_inside) | 						if(prev_captured_inside) | ||||||
| @ -909,7 +890,7 @@ namespace detail | |||||||
| 					arg.evt_code = event_code::mouse_move; | 					arg.evt_code = event_code::mouse_move; | ||||||
| 					brock.emit(event_code::mouse_move, msgwnd, arg, true, &context); | 					brock.emit(event_code::mouse_move, msgwnd, arg, true, &context); | ||||||
| 				} | 				} | ||||||
| 				if (!brock.wd_manager.available(hovered_wd)) | 				if (!brock.wd_manager().available(hovered_wd)) | ||||||
| 					hovered_wd = nullptr; | 					hovered_wd = nullptr; | ||||||
| 				break; | 				break; | ||||||
| 			case MapNotify: | 			case MapNotify: | ||||||
| @ -1010,11 +991,11 @@ namespace detail | |||||||
| 							{ | 							{ | ||||||
| 								arg_keyboard argkey; | 								arg_keyboard argkey; | ||||||
| 								brock.get_key_state(argkey); | 								brock.get_key_state(argkey); | ||||||
| 								auto tstop_wd = brock.wd_manager.tabstop(msgwnd, !argkey.shift); | 								auto tstop_wd = brock.wd_manager().tabstop(msgwnd, !argkey.shift); | ||||||
| 								if (tstop_wd) | 								if (tstop_wd) | ||||||
| 								{ | 								{ | ||||||
| 									brock.wd_manager.set_focus(tstop_wd, false); | 									brock.wd_manager().set_focus(tstop_wd, false); | ||||||
| 									brock.wd_manager.do_lazy_refresh(tstop_wd, true); | 									brock.wd_manager().do_lazy_refresh(tstop_wd, true); | ||||||
| 								} | 								} | ||||||
| 							} | 							} | ||||||
| 							else if(keyboard::alt == keychar) | 							else if(keyboard::alt == keychar) | ||||||
| @ -1050,7 +1031,7 @@ namespace detail | |||||||
| 								arg.window_handle = reinterpret_cast<window>(msgwnd); | 								arg.window_handle = reinterpret_cast<window>(msgwnd); | ||||||
| 								brock.emit(event_code::key_press, msgwnd, arg, true, &context); | 								brock.emit(event_code::key_press, msgwnd, arg, true, &context); | ||||||
| 
 | 
 | ||||||
| 								if((XLookupKeySym == status) && (brock.wd_manager.available(msgwnd))) | 								if((XLookupKeySym == status) && (brock.wd_manager().available(msgwnd))) | ||||||
| 								{ | 								{ | ||||||
| 									//call key_char event if status is XLookupKeySym to avaid calling key_char
 | 									//call key_char event if status is XLookupKeySym to avaid calling key_char
 | ||||||
| 									//twice, because the status would be equal to XLookupChars if the input method is
 | 									//twice, because the status would be equal to XLookupChars if the input method is
 | ||||||
| @ -1069,7 +1050,7 @@ namespace detail | |||||||
| 
 | 
 | ||||||
| 							if(XLookupKeySym == status) | 							if(XLookupKeySym == status) | ||||||
| 							{ | 							{ | ||||||
| 								brock.wd_manager.do_lazy_refresh(msgwnd, false); | 								brock.wd_manager().do_lazy_refresh(msgwnd, false); | ||||||
| 								break; | 								break; | ||||||
| 							} | 							} | ||||||
| 						case XLookupChars: | 						case XLookupChars: | ||||||
| @ -1099,7 +1080,7 @@ namespace detail | |||||||
| 										arg.ctrl = arg.shift = false; | 										arg.ctrl = arg.shift = false; | ||||||
| 										arg.evt_code = event_code::shortkey; | 										arg.evt_code = event_code::shortkey; | ||||||
| 										brock.set_keyboard_shortkey(true); | 										brock.set_keyboard_shortkey(true); | ||||||
| 										auto shr_wd = brock.wd_manager.find_shortkey(native_window, arg.key); | 										auto shr_wd = brock.wd_manager().find_shortkey(native_window, arg.key); | ||||||
| 										if(shr_wd) | 										if(shr_wd) | ||||||
| 										{ | 										{ | ||||||
| 											arg.window_handle = reinterpret_cast<window>(shr_wd); | 											arg.window_handle = reinterpret_cast<window>(shr_wd); | ||||||
| @ -1112,7 +1093,7 @@ namespace detail | |||||||
| 									brock.get_key_state(arg); | 									brock.get_key_state(arg); | ||||||
| 
 | 
 | ||||||
| 									msgwnd->together.events_ptr->key_char.emit(arg); | 									msgwnd->together.events_ptr->key_char.emit(arg); | ||||||
| 									if(arg.ignore == false && brock.wd_manager.available(msgwnd)) | 									if(arg.ignore == false && brock.wd_manager().available(msgwnd)) | ||||||
| 										brock.emit_drawer(event_code::key_char, msgwnd, arg, &context); | 										brock.emit_drawer(event_code::key_char, msgwnd, arg, &context); | ||||||
| 								} | 								} | ||||||
| 
 | 
 | ||||||
| @ -1121,7 +1102,7 @@ namespace detail | |||||||
| 							} | 							} | ||||||
| 							break; | 							break; | ||||||
| 						} | 						} | ||||||
| 						brock.wd_manager.do_lazy_refresh(msgwnd, false); | 						brock.wd_manager().do_lazy_refresh(msgwnd, false); | ||||||
| 						if(keybuf != fixbuf) | 						if(keybuf != fixbuf) | ||||||
| 							delete [] keybuf; | 							delete [] keybuf; | ||||||
| 					} | 					} | ||||||
| @ -1156,7 +1137,7 @@ namespace detail | |||||||
| 						{ | 						{ | ||||||
| 							bool set_focus = (brock.focus() != msgwnd) && (!msgwnd->root_widget->flags.ignore_menubar_focus); | 							bool set_focus = (brock.focus() != msgwnd) && (!msgwnd->root_widget->flags.ignore_menubar_focus); | ||||||
| 							if (set_focus) | 							if (set_focus) | ||||||
| 								brock.wd_manager.set_focus(msgwnd, false); | 								brock.wd_manager().set_focus(msgwnd, false); | ||||||
| 
 | 
 | ||||||
| 							arg_keyboard arg; | 							arg_keyboard arg; | ||||||
| 							arg.evt_code = event_code::key_release; | 							arg.evt_code = event_code::key_release; | ||||||
| @ -1194,7 +1175,7 @@ namespace detail | |||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
| 
 | 
 | ||||||
| 			root_runtime = brock.wd_manager.root_runtime(native_window); | 			root_runtime = brock.wd_manager().root_runtime(native_window); | ||||||
| 			if(root_runtime) | 			if(root_runtime) | ||||||
| 			{ | 			{ | ||||||
| 				context.event_window = pre_event_window; | 				context.event_window = pre_event_window; | ||||||
| @ -1207,11 +1188,11 @@ namespace detail | |||||||
| 				if(context) context->event_window = pre_event_window; | 				if(context) context->event_window = pre_event_window; | ||||||
| 			} | 			} | ||||||
| 
 | 
 | ||||||
| 			auto thread_id = ::nana::system::this_thread_id() | 			auto thread_id = ::nana::system::this_thread_id(); | ||||||
| 			brock.wd_manager.call_safe_place(thread_id); | 			brock.wd_manager().call_safe_place(thread_id); | ||||||
| 
 | 
 | ||||||
| 			if(msgwnd) | 			if(msgwnd) | ||||||
| 				brock.wd_manager.remove_trash_handle(thread_id); | 				brock.wd_manager().remove_trash_handle(thread_id); | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| @ -1226,18 +1207,18 @@ namespace detail | |||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		++(context->event_pump_ref_count); | 		++(context->event_pump_ref_count); | ||||||
| 		wd_manager.internal_lock().revert(); | 		wd_manager().internal_lock().revert(); | ||||||
| 		 | 		 | ||||||
| 		native_window_type owner_native = 0; | 		native_window_type owner_native = 0; | ||||||
| 		core_window_t * owner = 0; | 		core_window_t * owner = 0; | ||||||
| 		if(modal_window) | 		if(modal_window) | ||||||
| 		{ | 		{ | ||||||
| 			native_window_type modal = root(reinterpret_cast<core_window_t*>(modal_window)); | 			native_window_type modal = reinterpret_cast<core_window_t*>(modal_window)->root; | ||||||
| 			owner_native = native_interface::get_owner_window(modal); | 			owner_native = native_interface::get_owner_window(modal); | ||||||
| 			if(owner_native) | 			if(owner_native) | ||||||
| 			{ | 			{ | ||||||
| 				native_interface::enable_window(owner_native, false); | 				native_interface::enable_window(owner_native, false); | ||||||
| 				owner = wd_manager.root(owner_native); | 				owner = wd_manager().root(owner_native); | ||||||
| 				if(owner) | 				if(owner) | ||||||
| 					owner->flags.enabled = false; | 					owner->flags.enabled = false; | ||||||
| 			}	 | 			}	 | ||||||
| @ -1252,7 +1233,7 @@ namespace detail | |||||||
| 			native_interface::enable_window(owner_native, true); | 			native_interface::enable_window(owner_native, true); | ||||||
| 		} | 		} | ||||||
| 		 | 		 | ||||||
| 		wd_manager.internal_lock().forward(); | 		wd_manager().internal_lock().forward(); | ||||||
| 		if(0 == --(context->event_pump_ref_count)) | 		if(0 == --(context->event_pump_ref_count)) | ||||||
| 		{ | 		{ | ||||||
| 			if(0 == modal_window || 0 == context->window_count) | 			if(0 == modal_window || 0 == context->window_count) | ||||||
| @ -1338,7 +1319,7 @@ namespace detail | |||||||
| 
 | 
 | ||||||
| 	void bedrock::undefine_state_cursor(core_window_t * wd, thread_context* thrd) | 	void bedrock::undefine_state_cursor(core_window_t * wd, thread_context* thrd) | ||||||
| 	{ | 	{ | ||||||
| 		if (!wd_manager.available(wd)) | 		if (!wd_manager().available(wd)) | ||||||
| 			return; | 			return; | ||||||
| 	 | 	 | ||||||
| 		wd->root_widget->other.attribute.root->state_cursor = nana::cursor::arrow; | 		wd->root_widget->other.attribute.root->state_cursor = nana::cursor::arrow; | ||||||
| @ -1350,7 +1331,7 @@ namespace detail | |||||||
| 			return; | 			return; | ||||||
| 
 | 
 | ||||||
| 		native_interface::calc_window_point(native_handle, pos); | 		native_interface::calc_window_point(native_handle, pos); | ||||||
| 		auto rev_wd = wd_manager.find_window(native_handle, pos.x, pos.y); | 		auto rev_wd = wd_manager().find_window(native_handle, pos.x, pos.y); | ||||||
| 		if (rev_wd) | 		if (rev_wd) | ||||||
| 			set_cursor(rev_wd, rev_wd->predef_cursor, thrd); | 			set_cursor(rev_wd, rev_wd->predef_cursor, thrd); | ||||||
| 	} | 	} | ||||||
|  | |||||||
| @ -1,7 +1,7 @@ | |||||||
| /*
 | /*
 | ||||||
|  *	Platform Implementation |  *	Platform Implementation | ||||||
|  *	Nana C++ Library(http://www.nanapro.org)
 |  *	Nana C++ Library(http://www.nanapro.org)
 | ||||||
|  *	Copyright(C) 2003-2014 Jinhao(cnjinhao@hotmail.com) |  *	Copyright(C) 2003-2015 Jinhao(cnjinhao@hotmail.com) | ||||||
|  * |  * | ||||||
|  *	Distributed under the Boost Software License, Version 1.0. |  *	Distributed under the Boost Software License, Version 1.0. | ||||||
|  *	(See accompanying file LICENSE_1_0.txt or copy at |  *	(See accompanying file LICENSE_1_0.txt or copy at | ||||||
| @ -25,6 +25,7 @@ | |||||||
| #elif defined(NANA_X11) | #elif defined(NANA_X11) | ||||||
| 	#include <nana/system/platform.hpp> | 	#include <nana/system/platform.hpp> | ||||||
| 	#include <nana/gui/detail/bedrock.hpp> | 	#include <nana/gui/detail/bedrock.hpp> | ||||||
|  | 	#include <nana/gui/detail/window_manager.hpp> | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| namespace nana{ | namespace nana{ | ||||||
| @ -595,7 +596,7 @@ namespace nana{ | |||||||
| 
 | 
 | ||||||
| 			Display* disp = restrict::spec.open_display(); | 			Display* disp = restrict::spec.open_display(); | ||||||
| 			restrict::spec.remove(wd); | 			restrict::spec.remove(wd); | ||||||
| 			auto iwd = brock.wd_manager.root(wd); | 			auto iwd = brock.wd_manager().root(wd); | ||||||
| 			if(iwd) | 			if(iwd) | ||||||
| 			{ | 			{ | ||||||
| 				{ | 				{ | ||||||
| @ -607,9 +608,9 @@ namespace nana{ | |||||||
| 					::XFlush(disp); | 					::XFlush(disp); | ||||||
| 					restrict::spec.rev_error_handler(); | 					restrict::spec.rev_error_handler(); | ||||||
| 				} | 				} | ||||||
| 				brock.wd_manager.destroy(iwd); | 				brock.wd_manager().destroy(iwd); | ||||||
| 				brock.rt_manager.remove_if_exists(iwd); | 				brock.manage_form_loader(iwd, false); | ||||||
| 				brock.wd_manager.destroy_handle(iwd); | 				brock.wd_manager().destroy_handle(iwd); | ||||||
| 			} | 			} | ||||||
| 
 | 
 | ||||||
| 			nana::detail::platform_scope_guard psg; | 			nana::detail::platform_scope_guard psg; | ||||||
|  | |||||||
| @ -251,10 +251,10 @@ namespace detail | |||||||
| 
 | 
 | ||||||
| 	bedrock::~bedrock() | 	bedrock::~bedrock() | ||||||
| 	{ | 	{ | ||||||
| 		if(wd_manager.number_of_core_window()) | 		if(wd_manager().number_of_core_window()) | ||||||
| 		{ | 		{ | ||||||
| 			std::stringstream ss; | 			std::stringstream ss; | ||||||
| 			ss<<"Nana.GUI detects a memory leaks in window_manager, "<<static_cast<unsigned>(wd_manager.number_of_core_window())<<" window(s) are not uninstalled."; | 			ss<<"Nana.GUI detects a memory leaks in window_manager, "<<static_cast<unsigned>(wd_manager().number_of_core_window())<<" window(s) are not uninstalled."; | ||||||
| 			::MessageBoxA(0, ss.str().c_str(), ("Nana C++ Library"), MB_OK); | 			::MessageBoxA(0, ss.str().c_str(), ("Nana C++ Library"), MB_OK); | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| @ -364,7 +364,7 @@ namespace detail | |||||||
| 
 | 
 | ||||||
| 		++(context->event_pump_ref_count); | 		++(context->event_pump_ref_count); | ||||||
| 
 | 
 | ||||||
| 		auto & intr_locker = wd_manager.internal_lock(); | 		auto & intr_locker = wd_manager().internal_lock(); | ||||||
| 		intr_locker.revert(); | 		intr_locker.revert(); | ||||||
| 
 | 
 | ||||||
| 		try | 		try | ||||||
| @ -372,8 +372,7 @@ namespace detail | |||||||
| 			MSG msg; | 			MSG msg; | ||||||
| 			if(modal_window) | 			if(modal_window) | ||||||
| 			{ | 			{ | ||||||
| 				HWND native_handle = reinterpret_cast<HWND>( | 				HWND native_handle = reinterpret_cast<HWND>(reinterpret_cast<core_window_t*>(modal_window)->root); | ||||||
| 									root(reinterpret_cast<core_window_t*>(modal_window))); |  | ||||||
| 				if (is_modal) | 				if (is_modal) | ||||||
| 				{ | 				{ | ||||||
| 					HWND owner = ::GetWindow(native_handle, GW_OWNER); | 					HWND owner = ::GetWindow(native_handle, GW_OWNER); | ||||||
| @ -395,7 +394,7 @@ namespace detail | |||||||
| 								::TranslateMessage(&msg); | 								::TranslateMessage(&msg); | ||||||
| 								::DispatchMessage(&msg); | 								::DispatchMessage(&msg); | ||||||
| 
 | 
 | ||||||
| 								wd_manager.remove_trash_handle(tid); | 								wd_manager().remove_trash_handle(tid); | ||||||
| 							} | 							} | ||||||
| 						} | 						} | ||||||
| 					} | 					} | ||||||
| @ -413,8 +412,8 @@ namespace detail | |||||||
| 							::DispatchMessage(&msg); | 							::DispatchMessage(&msg); | ||||||
| 						} | 						} | ||||||
| 
 | 
 | ||||||
| 						wd_manager.call_safe_place(tid); | 						wd_manager().call_safe_place(tid); | ||||||
| 						wd_manager.remove_trash_handle(tid); | 						wd_manager().remove_trash_handle(tid); | ||||||
| 						if (msg.message == WM_DESTROY  && msg.hwnd == native_handle) | 						if (msg.message == WM_DESTROY  && msg.hwnd == native_handle) | ||||||
| 							break; | 							break; | ||||||
| 					}//end while
 | 					}//end while
 | ||||||
| @ -433,8 +432,8 @@ namespace detail | |||||||
| 						::DispatchMessage(&msg); | 						::DispatchMessage(&msg); | ||||||
| 					} | 					} | ||||||
| 
 | 
 | ||||||
| 					wd_manager.call_safe_place(tid); | 					wd_manager().call_safe_place(tid); | ||||||
| 					wd_manager.remove_trash_handle(tid); | 					wd_manager().remove_trash_handle(tid); | ||||||
| 				}//end while
 | 				}//end while
 | ||||||
| 
 | 
 | ||||||
| 				//Empty these rest messages, there is not a window to process these messages.
 | 				//Empty these rest messages, there is not a window to process these messages.
 | ||||||
| @ -607,7 +606,7 @@ namespace detail | |||||||
| 		case nana::detail::messages::map_thread_root_buffer: | 		case nana::detail::messages::map_thread_root_buffer: | ||||||
| 			{ | 			{ | ||||||
| 				auto stru = reinterpret_cast<detail::messages::map_thread*>(lParam); | 				auto stru = reinterpret_cast<detail::messages::map_thread*>(lParam); | ||||||
| 				bedrock.wd_manager.map(reinterpret_cast<bedrock::core_window_t*>(wParam), stru->forced, (stru->ignore_update_area ? nullptr : &stru->update_area)); | 				bedrock.wd_manager().map(reinterpret_cast<bedrock::core_window_t*>(wParam), stru->forced, (stru->ignore_update_area ? nullptr : &stru->update_area)); | ||||||
| 				::UpdateWindow(wd); | 				::UpdateWindow(wd); | ||||||
| 				::HeapFree(::GetProcessHeap(), 0, stru); | 				::HeapFree(::GetProcessHeap(), 0, stru); | ||||||
| 			} | 			} | ||||||
| @ -760,7 +759,7 @@ namespace detail | |||||||
| 	template<typename Arg> | 	template<typename Arg> | ||||||
| 	void emit_drawer(void (::nana::detail::drawer::*event_ptr)(const Arg&), basic_window* wd, const Arg& arg, bedrock::thread_context* thrd) | 	void emit_drawer(void (::nana::detail::drawer::*event_ptr)(const Arg&), basic_window* wd, const Arg& arg, bedrock::thread_context* thrd) | ||||||
| 	{ | 	{ | ||||||
| 		if (bedrock::instance().wd_manager.available(wd) == false) | 		if (bedrock::instance().wd_manager().available(wd) == false) | ||||||
| 			return; | 			return; | ||||||
| 
 | 
 | ||||||
| 		basic_window* prev_event_wd; | 		basic_window* prev_event_wd; | ||||||
| @ -788,7 +787,7 @@ namespace detail | |||||||
| 		static restrict::TRACKMOUSEEVENT track = {sizeof track, 0x00000002}; | 		static restrict::TRACKMOUSEEVENT track = {sizeof track, 0x00000002}; | ||||||
| 
 | 
 | ||||||
| 		auto native_window = reinterpret_cast<native_window_type>(root_window); | 		auto native_window = reinterpret_cast<native_window_type>(root_window); | ||||||
| 		auto* root_runtime = brock.wd_manager.root_runtime(native_window); | 		auto* root_runtime = brock.wd_manager().root_runtime(native_window); | ||||||
| 
 | 
 | ||||||
| 		if(root_runtime) | 		if(root_runtime) | ||||||
| 		{ | 		{ | ||||||
| @ -884,7 +883,7 @@ namespace detail | |||||||
| 					arg_focus arg; | 					arg_focus arg; | ||||||
| 					assign_arg(arg, focus, native_window, true); | 					assign_arg(arg, focus, native_window, true); | ||||||
| 					if (!brock.emit(event_code::focus, focus, arg, true, &context)) | 					if (!brock.emit(event_code::focus, focus, arg, true, &context)) | ||||||
| 						brock.wd_manager.set_focus(msgwnd, true); | 						brock.wd_manager().set_focus(msgwnd, true); | ||||||
| 				} | 				} | ||||||
| 				def_window_proc = true; | 				def_window_proc = true; | ||||||
| 				break; | 				break; | ||||||
| @ -915,21 +914,21 @@ namespace detail | |||||||
| 				break; | 				break; | ||||||
| 			case WM_LBUTTONDBLCLK: case WM_MBUTTONDBLCLK: case WM_RBUTTONDBLCLK: | 			case WM_LBUTTONDBLCLK: case WM_MBUTTONDBLCLK: case WM_RBUTTONDBLCLK: | ||||||
| 				pressed_wd = nullptr; | 				pressed_wd = nullptr; | ||||||
| 				msgwnd = brock.wd_manager.find_window(native_window, pmdec.mouse.x, pmdec.mouse.y); | 				msgwnd = brock.wd_manager().find_window(native_window, pmdec.mouse.x, pmdec.mouse.y); | ||||||
| 				if(msgwnd && msgwnd->flags.enabled) | 				if(msgwnd && msgwnd->flags.enabled) | ||||||
| 				{ | 				{ | ||||||
| 					if (msgwnd->flags.take_active && !msgwnd->flags.ignore_mouse_focus) | 					if (msgwnd->flags.take_active && !msgwnd->flags.ignore_mouse_focus) | ||||||
| 					{ | 					{ | ||||||
| 						auto killed = brock.wd_manager.set_focus(msgwnd, false); | 						auto killed = brock.wd_manager().set_focus(msgwnd, false); | ||||||
| 						if (killed != msgwnd) | 						if (killed != msgwnd) | ||||||
| 							brock.wd_manager.do_lazy_refresh(killed, false); | 							brock.wd_manager().do_lazy_refresh(killed, false); | ||||||
| 					} | 					} | ||||||
| 
 | 
 | ||||||
| 					arg_mouse arg; | 					arg_mouse arg; | ||||||
| 					assign_arg(arg, msgwnd, message, pmdec); | 					assign_arg(arg, msgwnd, message, pmdec); | ||||||
| 					if (brock.emit(arg.evt_code, msgwnd, arg, true, &context)) | 					if (brock.emit(arg.evt_code, msgwnd, arg, true, &context)) | ||||||
| 					{ | 					{ | ||||||
| 						if (brock.wd_manager.available(msgwnd)) | 						if (brock.wd_manager().available(msgwnd)) | ||||||
| 							pressed_wd = msgwnd; | 							pressed_wd = msgwnd; | ||||||
| 					} | 					} | ||||||
| 				} | 				} | ||||||
| @ -939,7 +938,7 @@ namespace detail | |||||||
| 				def_window_proc = true; | 				def_window_proc = true; | ||||||
| 				break; | 				break; | ||||||
| 			case WM_LBUTTONDOWN: case WM_MBUTTONDOWN: case WM_RBUTTONDOWN: | 			case WM_LBUTTONDOWN: case WM_MBUTTONDOWN: case WM_RBUTTONDOWN: | ||||||
| 				msgwnd = brock.wd_manager.find_window(native_window, pmdec.mouse.x, pmdec.mouse.y); | 				msgwnd = brock.wd_manager().find_window(native_window, pmdec.mouse.x, pmdec.mouse.y); | ||||||
| 				if(nullptr == msgwnd)	break; | 				if(nullptr == msgwnd)	break; | ||||||
| 
 | 
 | ||||||
| 				//if event on the menubar, just remove the menu if it is not associating with the menubar
 | 				//if event on the menubar, just remove the menu if it is not associating with the menubar
 | ||||||
| @ -957,9 +956,9 @@ namespace detail | |||||||
| 						auto new_focus = (msgwnd->flags.take_active ? msgwnd : msgwnd->other.active_window); | 						auto new_focus = (msgwnd->flags.take_active ? msgwnd : msgwnd->other.active_window); | ||||||
| 						if (new_focus && (!new_focus->flags.ignore_mouse_focus)) | 						if (new_focus && (!new_focus->flags.ignore_mouse_focus)) | ||||||
| 						{ | 						{ | ||||||
| 							auto kill_focus = brock.wd_manager.set_focus(new_focus, false); | 							auto kill_focus = brock.wd_manager().set_focus(new_focus, false); | ||||||
| 							if (kill_focus != new_focus) | 							if (kill_focus != new_focus) | ||||||
| 								brock.wd_manager.do_lazy_refresh(kill_focus, false); | 								brock.wd_manager().do_lazy_refresh(kill_focus, false); | ||||||
| 						} | 						} | ||||||
| 					} | 					} | ||||||
| 
 | 
 | ||||||
| @ -976,14 +975,14 @@ namespace detail | |||||||
| 							auto pos = native_interface::cursor_position(); | 							auto pos = native_interface::cursor_position(); | ||||||
| 							auto rootwd = native_interface::find_window(pos.x, pos.y); | 							auto rootwd = native_interface::find_window(pos.x, pos.y); | ||||||
| 							native_interface::calc_window_point(rootwd, pos); | 							native_interface::calc_window_point(rootwd, pos); | ||||||
| 							if(msgwnd != brock.wd_manager.find_window(rootwd, pos.x, pos.y)) | 							if(msgwnd != brock.wd_manager().find_window(rootwd, pos.x, pos.y)) | ||||||
| 							{ | 							{ | ||||||
| 								//call the drawer mouse up event for restoring the surface graphics
 | 								//call the drawer mouse up event for restoring the surface graphics
 | ||||||
| 								msgwnd->flags.action = mouse_action::normal; | 								msgwnd->flags.action = mouse_action::normal; | ||||||
| 
 | 
 | ||||||
| 								arg.evt_code = event_code::mouse_up; | 								arg.evt_code = event_code::mouse_up; | ||||||
| 								emit_drawer(&drawer::mouse_up, msgwnd, arg, &context); | 								emit_drawer(&drawer::mouse_up, msgwnd, arg, &context); | ||||||
| 								brock.wd_manager.do_lazy_refresh(msgwnd, false); | 								brock.wd_manager().do_lazy_refresh(msgwnd, false); | ||||||
| 							} | 							} | ||||||
| 						} | 						} | ||||||
| 					} | 					} | ||||||
| @ -995,7 +994,7 @@ namespace detail | |||||||
| 			case WM_LBUTTONUP: | 			case WM_LBUTTONUP: | ||||||
| 			case WM_MBUTTONUP: | 			case WM_MBUTTONUP: | ||||||
| 			case WM_RBUTTONUP: | 			case WM_RBUTTONUP: | ||||||
| 				msgwnd = brock.wd_manager.find_window(native_window, pmdec.mouse.x, pmdec.mouse.y); | 				msgwnd = brock.wd_manager().find_window(native_window, pmdec.mouse.x, pmdec.mouse.y); | ||||||
| 				if(nullptr == msgwnd) | 				if(nullptr == msgwnd) | ||||||
| 					break; | 					break; | ||||||
| 
 | 
 | ||||||
| @ -1022,7 +1021,7 @@ namespace detail | |||||||
| 					} | 					} | ||||||
| 
 | 
 | ||||||
| 					//Do mouse_up, this handle may be closed by click handler.
 | 					//Do mouse_up, this handle may be closed by click handler.
 | ||||||
| 					if(brock.wd_manager.available(msgwnd) && msgwnd->flags.enabled) | 					if(brock.wd_manager().available(msgwnd) && msgwnd->flags.enabled) | ||||||
| 					{ | 					{ | ||||||
| 						arg.evt_code = event_code::mouse_up; | 						arg.evt_code = event_code::mouse_up; | ||||||
| 						emit_drawer(&drawer::mouse_up, msgwnd, arg, &context); | 						emit_drawer(&drawer::mouse_up, msgwnd, arg, &context); | ||||||
| @ -1035,7 +1034,7 @@ namespace detail | |||||||
| 							retain->click.emit(arg); | 							retain->click.emit(arg); | ||||||
| 						} | 						} | ||||||
| 
 | 
 | ||||||
| 						if (brock.wd_manager.available(msgwnd)) | 						if (brock.wd_manager().available(msgwnd)) | ||||||
| 						{ | 						{ | ||||||
| 							arg.evt_code = event_code::mouse_up; | 							arg.evt_code = event_code::mouse_up; | ||||||
| 							retain->mouse_up.emit(arg); | 							retain->mouse_up.emit(arg); | ||||||
| @ -1048,13 +1047,13 @@ namespace detail | |||||||
| 						arg.by_mouse = true; | 						arg.by_mouse = true; | ||||||
| 						retain->click.emit(arg); | 						retain->click.emit(arg); | ||||||
| 					} | 					} | ||||||
| 					brock.wd_manager.do_lazy_refresh(msgwnd, false); | 					brock.wd_manager().do_lazy_refresh(msgwnd, false); | ||||||
| 				} | 				} | ||||||
| 				pressed_wd = nullptr; | 				pressed_wd = nullptr; | ||||||
| 				break; | 				break; | ||||||
| 			case WM_MOUSEMOVE: | 			case WM_MOUSEMOVE: | ||||||
| 				msgwnd = brock.wd_manager.find_window(native_window, pmdec.mouse.x, pmdec.mouse.y); | 				msgwnd = brock.wd_manager().find_window(native_window, pmdec.mouse.x, pmdec.mouse.y); | ||||||
| 				if (brock.wd_manager.available(hovered_wd) && (msgwnd != hovered_wd)) | 				if (brock.wd_manager().available(hovered_wd) && (msgwnd != hovered_wd)) | ||||||
| 				{ | 				{ | ||||||
| 					brock.event_msleave(hovered_wd); | 					brock.event_msleave(hovered_wd); | ||||||
| 					hovered_wd->flags.action = mouse_action::normal; | 					hovered_wd->flags.action = mouse_action::normal; | ||||||
| @ -1062,7 +1061,7 @@ namespace detail | |||||||
| 
 | 
 | ||||||
| 					//if msgwnd is neither captured window nor the child of captured window,
 | 					//if msgwnd is neither captured window nor the child of captured window,
 | ||||||
| 					//redirect the msgwnd to the captured window.
 | 					//redirect the msgwnd to the captured window.
 | ||||||
| 					auto wd = brock.wd_manager.capture_redirect(msgwnd); | 					auto wd = brock.wd_manager().capture_redirect(msgwnd); | ||||||
| 					if(wd) | 					if(wd) | ||||||
| 						msgwnd = wd; | 						msgwnd = wd; | ||||||
| 				} | 				} | ||||||
| @ -1070,7 +1069,7 @@ namespace detail | |||||||
| 				else if(msgwnd) | 				else if(msgwnd) | ||||||
| 				{ | 				{ | ||||||
| 					bool prev_captured_inside; | 					bool prev_captured_inside; | ||||||
| 					if(brock.wd_manager.capture_window_entered(pmdec.mouse.x, pmdec.mouse.y, prev_captured_inside)) | 					if(brock.wd_manager().capture_window_entered(pmdec.mouse.x, pmdec.mouse.y, prev_captured_inside)) | ||||||
| 					{ | 					{ | ||||||
| 						event_code evt_code; | 						event_code evt_code; | ||||||
| 						if(prev_captured_inside) | 						if(prev_captured_inside) | ||||||
| @ -1115,7 +1114,7 @@ namespace detail | |||||||
| 					track.hwndTrack = native_window; | 					track.hwndTrack = native_window; | ||||||
| 					restrict::track_mouse_event(&track); | 					restrict::track_mouse_event(&track); | ||||||
| 				} | 				} | ||||||
| 				if (!brock.wd_manager.available(hovered_wd)) | 				if (!brock.wd_manager().available(hovered_wd)) | ||||||
| 					hovered_wd = nullptr; | 					hovered_wd = nullptr; | ||||||
| 				break; | 				break; | ||||||
| 			case WM_MOUSELEAVE: | 			case WM_MOUSELEAVE: | ||||||
| @ -1131,7 +1130,7 @@ namespace detail | |||||||
| 					if (pointer_wd == root_window) | 					if (pointer_wd == root_window) | ||||||
| 					{ | 					{ | ||||||
| 						::ScreenToClient(pointer_wd, &scr_pos); | 						::ScreenToClient(pointer_wd, &scr_pos); | ||||||
| 						auto scrolled_wd = brock.wd_manager.find_window(reinterpret_cast<native_window_type>(pointer_wd), scr_pos.x, scr_pos.y); | 						auto scrolled_wd = brock.wd_manager().find_window(reinterpret_cast<native_window_type>(pointer_wd), scr_pos.x, scr_pos.y); | ||||||
| 
 | 
 | ||||||
| 						def_window_proc = true; | 						def_window_proc = true; | ||||||
| 						auto evt_wd = scrolled_wd; | 						auto evt_wd = scrolled_wd; | ||||||
| @ -1141,7 +1140,7 @@ namespace detail | |||||||
| 							{ | 							{ | ||||||
| 								def_window_proc = false; | 								def_window_proc = false; | ||||||
| 								nana::point mspos{ scr_pos.x, scr_pos.y }; | 								nana::point mspos{ scr_pos.x, scr_pos.y }; | ||||||
| 								brock.wd_manager.calc_window_point(evt_wd, mspos); | 								brock.wd_manager().calc_window_point(evt_wd, mspos); | ||||||
| 
 | 
 | ||||||
| 								arg_wheel arg; | 								arg_wheel arg; | ||||||
| 								arg.which = (WM_MOUSEHWHEEL == message ? arg_wheel::wheel::horizontal : arg_wheel::wheel::vertical); | 								arg.which = (WM_MOUSEHWHEEL == message ? arg_wheel::wheel::horizontal : arg_wheel::wheel::vertical); | ||||||
| @ -1155,13 +1154,13 @@ namespace detail | |||||||
| 						if (scrolled_wd && (nullptr == evt_wd)) | 						if (scrolled_wd && (nullptr == evt_wd)) | ||||||
| 						{ | 						{ | ||||||
| 							nana::point mspos{ scr_pos.x, scr_pos.y }; | 							nana::point mspos{ scr_pos.x, scr_pos.y }; | ||||||
| 							brock.wd_manager.calc_window_point(scrolled_wd, mspos); | 							brock.wd_manager().calc_window_point(scrolled_wd, mspos); | ||||||
| 
 | 
 | ||||||
| 							arg_wheel arg; | 							arg_wheel arg; | ||||||
| 							arg.which = (WM_MOUSEHWHEEL == message ? arg_wheel::wheel::horizontal : arg_wheel::wheel::vertical); | 							arg.which = (WM_MOUSEHWHEEL == message ? arg_wheel::wheel::horizontal : arg_wheel::wheel::vertical); | ||||||
| 							assign_arg(arg, scrolled_wd, pmdec); | 							assign_arg(arg, scrolled_wd, pmdec); | ||||||
| 							brock.emit_drawer(event_code::mouse_wheel, scrolled_wd, arg, &context); | 							brock.emit_drawer(event_code::mouse_wheel, scrolled_wd, arg, &context); | ||||||
| 							brock.wd_manager.do_lazy_refresh(scrolled_wd, false); | 							brock.wd_manager().do_lazy_refresh(scrolled_wd, false); | ||||||
| 						} | 						} | ||||||
| 					} | 					} | ||||||
| 					else | 					else | ||||||
| @ -1179,7 +1178,7 @@ namespace detail | |||||||
| 					POINT pos; | 					POINT pos; | ||||||
| 					::DragQueryPoint(drop, &pos); | 					::DragQueryPoint(drop, &pos); | ||||||
| 
 | 
 | ||||||
| 					msgwnd = brock.wd_manager.find_window(native_window, pos.x, pos.y); | 					msgwnd = brock.wd_manager().find_window(native_window, pos.x, pos.y); | ||||||
| 					if(msgwnd) | 					if(msgwnd) | ||||||
| 					{ | 					{ | ||||||
| 						arg_dropfiles dropfiles; | 						arg_dropfiles dropfiles; | ||||||
| @ -1209,11 +1208,11 @@ namespace detail | |||||||
| 							dropfiles.pos.x = pos.x; | 							dropfiles.pos.x = pos.x; | ||||||
| 							dropfiles.pos.y = pos.y; | 							dropfiles.pos.y = pos.y; | ||||||
| 
 | 
 | ||||||
| 							brock.wd_manager.calc_window_point(msgwnd, dropfiles.pos); | 							brock.wd_manager().calc_window_point(msgwnd, dropfiles.pos); | ||||||
| 							dropfiles.window_handle = reinterpret_cast<window>(msgwnd); | 							dropfiles.window_handle = reinterpret_cast<window>(msgwnd); | ||||||
| 
 | 
 | ||||||
| 							msgwnd->together.events_ptr->mouse_dropfiles.emit(dropfiles); | 							msgwnd->together.events_ptr->mouse_dropfiles.emit(dropfiles); | ||||||
| 							brock.wd_manager.do_lazy_refresh(msgwnd, false); | 							brock.wd_manager().do_lazy_refresh(msgwnd, false); | ||||||
| 						} | 						} | ||||||
| 					} | 					} | ||||||
| 
 | 
 | ||||||
| @ -1301,7 +1300,7 @@ namespace detail | |||||||
| 				break; | 				break; | ||||||
| 			case WM_SIZE: | 			case WM_SIZE: | ||||||
| 				if(wParam != SIZE_MINIMIZED) | 				if(wParam != SIZE_MINIMIZED) | ||||||
| 					brock.wd_manager.size(msgwnd, size(pmdec.size.width, pmdec.size.height), true, true); | 					brock.wd_manager().size(msgwnd, size(pmdec.size.width, pmdec.size.height), true, true); | ||||||
| 				break; | 				break; | ||||||
| 			case WM_MOVE: | 			case WM_MOVE: | ||||||
| 				brock.event_move(msgwnd, (int)(short) LOWORD(lParam), (int)(short) HIWORD(lParam)); | 				brock.event_move(msgwnd, (int)(short) LOWORD(lParam), (int)(short) HIWORD(lParam)); | ||||||
| @ -1327,7 +1326,7 @@ namespace detail | |||||||
| 			case WM_SYSCHAR: | 			case WM_SYSCHAR: | ||||||
| 				def_window_proc = true; | 				def_window_proc = true; | ||||||
| 				brock.set_keyboard_shortkey(true); | 				brock.set_keyboard_shortkey(true); | ||||||
| 				msgwnd = brock.wd_manager.find_shortkey(native_window, static_cast<unsigned long>(wParam)); | 				msgwnd = brock.wd_manager().find_shortkey(native_window, static_cast<unsigned long>(wParam)); | ||||||
| 				if(msgwnd) | 				if(msgwnd) | ||||||
| 				{ | 				{ | ||||||
| 					arg_keyboard arg; | 					arg_keyboard arg; | ||||||
| @ -1374,7 +1373,7 @@ namespace detail | |||||||
| 
 | 
 | ||||||
| 						bool set_focus = (brock.focus() != msgwnd) && (!msgwnd->root_widget->flags.ignore_menubar_focus); | 						bool set_focus = (brock.focus() != msgwnd) && (!msgwnd->root_widget->flags.ignore_menubar_focus); | ||||||
| 						if (set_focus) | 						if (set_focus) | ||||||
| 							brock.wd_manager.set_focus(msgwnd, false); | 							brock.wd_manager().set_focus(msgwnd, false); | ||||||
| 
 | 
 | ||||||
| 						arg_keyboard arg; | 						arg_keyboard arg; | ||||||
| 						arg.evt_code = event_code::key_release; | 						arg.evt_code = event_code::key_release; | ||||||
| @ -1408,12 +1407,12 @@ namespace detail | |||||||
| 						{ | 						{ | ||||||
| 							bool is_forward = (::GetKeyState(VK_SHIFT) >= 0); | 							bool is_forward = (::GetKeyState(VK_SHIFT) >= 0); | ||||||
| 
 | 
 | ||||||
| 							auto tstop_wd = brock.wd_manager.tabstop(msgwnd, is_forward); | 							auto tstop_wd = brock.wd_manager().tabstop(msgwnd, is_forward); | ||||||
| 							if (tstop_wd) | 							if (tstop_wd) | ||||||
| 							{ | 							{ | ||||||
| 								brock.wd_manager.set_focus(tstop_wd, false); | 								brock.wd_manager().set_focus(tstop_wd, false); | ||||||
| 								brock.wd_manager.do_lazy_refresh(msgwnd, false); | 								brock.wd_manager().do_lazy_refresh(msgwnd, false); | ||||||
| 								brock.wd_manager.do_lazy_refresh(tstop_wd, true); | 								brock.wd_manager().do_lazy_refresh(tstop_wd, true); | ||||||
| 							} | 							} | ||||||
| 						} | 						} | ||||||
| 						else | 						else | ||||||
| @ -1455,10 +1454,10 @@ namespace detail | |||||||
| 						arg.ignore = false; | 						arg.ignore = false; | ||||||
| 
 | 
 | ||||||
| 						msgwnd->together.events_ptr->key_char.emit(arg); | 						msgwnd->together.events_ptr->key_char.emit(arg); | ||||||
| 						if ((false == arg.ignore) && brock.wd_manager.available(msgwnd)) | 						if ((false == arg.ignore) && brock.wd_manager().available(msgwnd)) | ||||||
| 							brock.emit_drawer(event_code::key_char, msgwnd, arg, &context); | 							brock.emit_drawer(event_code::key_char, msgwnd, arg, &context); | ||||||
| 
 | 
 | ||||||
| 						brock.wd_manager.do_lazy_refresh(msgwnd, false); | 						brock.wd_manager().do_lazy_refresh(msgwnd, false); | ||||||
| 					} | 					} | ||||||
| 				} | 				} | ||||||
| 				return 0; | 				return 0; | ||||||
| @ -1506,12 +1505,12 @@ namespace detail | |||||||
| 					brock.erase_menu(false); | 					brock.erase_menu(false); | ||||||
| 					brock.delay_restore(3);	//Restores if delay_restore not decleared
 | 					brock.delay_restore(3);	//Restores if delay_restore not decleared
 | ||||||
| 				} | 				} | ||||||
| 				brock.wd_manager.destroy(msgwnd); | 				brock.wd_manager().destroy(msgwnd); | ||||||
| 				nana::detail::platform_spec::instance().release_window_icon(msgwnd->root); | 				nana::detail::platform_spec::instance().release_window_icon(msgwnd->root); | ||||||
| 				break; | 				break; | ||||||
| 			case WM_NCDESTROY: | 			case WM_NCDESTROY: | ||||||
| 				brock.rt_manager.remove_if_exists(msgwnd); | 				brock.manage_form_loader(msgwnd, false); | ||||||
| 				brock.wd_manager.destroy_handle(msgwnd); | 				brock.wd_manager().destroy_handle(msgwnd); | ||||||
| 
 | 
 | ||||||
| 				if(--context.window_count <= 0) | 				if(--context.window_count <= 0) | ||||||
| 				{ | 				{ | ||||||
| @ -1523,7 +1522,7 @@ namespace detail | |||||||
| 				def_window_proc = true; | 				def_window_proc = true; | ||||||
| 			} | 			} | ||||||
| 
 | 
 | ||||||
| 			root_runtime = brock.wd_manager.root_runtime(native_window); | 			root_runtime = brock.wd_manager().root_runtime(native_window); | ||||||
| 			if(root_runtime) | 			if(root_runtime) | ||||||
| 			{ | 			{ | ||||||
| 				root_runtime->condition.pressed = pressed_wd; | 				root_runtime->condition.pressed = pressed_wd; | ||||||
| @ -1540,21 +1539,15 @@ namespace detail | |||||||
| 	::nana::category::flags bedrock::category(core_window_t* wd) | 	::nana::category::flags bedrock::category(core_window_t* wd) | ||||||
| 	{ | 	{ | ||||||
| 		internal_scope_guard lock; | 		internal_scope_guard lock; | ||||||
| 		return (wd_manager.available(wd) ? wd->other.category : ::nana::category::flags::super); | 		return (wd_manager().available(wd) ? wd->other.category : ::nana::category::flags::super); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	auto bedrock::focus() ->core_window_t* | 	auto bedrock::focus() ->core_window_t* | ||||||
| 	{ | 	{ | ||||||
| 		core_window_t* wd = wd_manager.root(native_interface::get_focus_window()); | 		core_window_t* wd = wd_manager().root(native_interface::get_focus_window()); | ||||||
| 		return (wd ? wd->other.attribute.root->focus : nullptr); | 		return (wd ? wd->other.attribute.root->focus : nullptr); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	native_window_type bedrock::root(core_window_t* wd) |  | ||||||
| 	{ |  | ||||||
| 		internal_scope_guard lock; |  | ||||||
| 		return (wd_manager.available(wd) ? wd->root : nullptr); |  | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	void bedrock::set_menubar_taken(core_window_t* wd) | 	void bedrock::set_menubar_taken(core_window_t* wd) | ||||||
| 	{ | 	{ | ||||||
| 		auto pre = impl_->menu.taken_window; | 		auto pre = impl_->menu.taken_window; | ||||||
| @ -1565,8 +1558,8 @@ namespace detail | |||||||
| 		if ((!wd) && pre && (pre->root != get_menu())) | 		if ((!wd) && pre && (pre->root != get_menu())) | ||||||
| 		{ | 		{ | ||||||
| 			internal_scope_guard lock; | 			internal_scope_guard lock; | ||||||
| 			wd_manager.set_focus(pre, false); | 			wd_manager().set_focus(pre, false); | ||||||
| 			wd_manager.update(pre, true, false); | 			wd_manager().update(pre, true, false); | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| @ -1694,17 +1687,9 @@ namespace detail | |||||||
| #endif | #endif | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	bool bedrock::emit(event_code evt_code, core_window_t* wd, const arg_mouse& arg, bool ask_update, thread_context* thrd) |  | ||||||
| 	{ |  | ||||||
| 		if (evt_code != arg.evt_code) |  | ||||||
| 			throw std::runtime_error("Nana.bedrock: invalid event arg."); |  | ||||||
| 
 |  | ||||||
| 		return emit(evt_code, wd, static_cast<const ::nana::event_arg&>(arg), ask_update, thrd); |  | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	bool bedrock::emit(event_code evt_code, core_window_t* wd, const ::nana::event_arg& arg, bool ask_update, thread_context* thrd) | 	bool bedrock::emit(event_code evt_code, core_window_t* wd, const ::nana::event_arg& arg, bool ask_update, thread_context* thrd) | ||||||
| 	{ | 	{ | ||||||
| 		if (wd_manager.available(wd) == false) | 		if (wd_manager().available(wd) == false) | ||||||
| 			return false; | 			return false; | ||||||
| 
 | 
 | ||||||
| 		basic_window* prev_event_wd; | 		basic_window* prev_event_wd; | ||||||
| @ -1721,8 +1706,8 @@ namespace detail | |||||||
| 		_m_emit_core(evt_code, wd, false, arg); | 		_m_emit_core(evt_code, wd, false, arg); | ||||||
| 
 | 
 | ||||||
| 		if (ask_update) | 		if (ask_update) | ||||||
| 			wd_manager.do_lazy_refresh(wd, false); | 			wd_manager().do_lazy_refresh(wd, false); | ||||||
| 		else if (wd_manager.available(wd)) | 		else if (wd_manager().available(wd)) | ||||||
| 			wd->other.upd_state = basic_window::update_state::none; | 			wd->other.upd_state = basic_window::update_state::none; | ||||||
| 
 | 
 | ||||||
| 		if (thrd)	thrd->event_window = prev_event_wd; | 		if (thrd)	thrd->event_window = prev_event_wd; | ||||||
| @ -1731,7 +1716,7 @@ namespace detail | |||||||
| 
 | 
 | ||||||
| 	bool bedrock::emit_drawer(event_code evt_code, core_window_t* wd, const ::nana::event_arg& arg, thread_context* thrd) | 	bool bedrock::emit_drawer(event_code evt_code, core_window_t* wd, const ::nana::event_arg& arg, thread_context* thrd) | ||||||
| 	{ | 	{ | ||||||
| 		if (bedrock_object.wd_manager.available(wd) == false) | 		if (bedrock_object.wd_manager().available(wd) == false) | ||||||
| 			return false; | 			return false; | ||||||
| 
 | 
 | ||||||
| 		core_window_t* prev_event_wd; | 		core_window_t* prev_event_wd; | ||||||
| @ -1856,7 +1841,7 @@ namespace detail | |||||||
| 			thrd = get_thread_context(wd->thread_id); | 			thrd = get_thread_context(wd->thread_id); | ||||||
| 
 | 
 | ||||||
| 		HCURSOR rev_handle = ::LoadCursor(nullptr, IDC_ARROW); | 		HCURSOR rev_handle = ::LoadCursor(nullptr, IDC_ARROW); | ||||||
| 		if (!wd_manager.available(wd)) | 		if (!wd_manager().available(wd)) | ||||||
| 		{ | 		{ | ||||||
| 			::ShowCursor(FALSE); | 			::ShowCursor(FALSE); | ||||||
| 			::SetCursor(rev_handle); | 			::SetCursor(rev_handle); | ||||||
| @ -1877,7 +1862,7 @@ namespace detail | |||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		native_interface::calc_window_point(native_handle, pos); | 		native_interface::calc_window_point(native_handle, pos); | ||||||
| 		auto rev_wd = wd_manager.find_window(native_handle, pos.x, pos.y); | 		auto rev_wd = wd_manager().find_window(native_handle, pos.x, pos.y); | ||||||
| 		if (rev_wd) | 		if (rev_wd) | ||||||
| 		{ | 		{ | ||||||
| 			set_cursor(rev_wd, rev_wd->predef_cursor, thrd); | 			set_cursor(rev_wd, rev_wd->predef_cursor, thrd); | ||||||
|  | |||||||
| @ -8,12 +8,12 @@ | |||||||
|  *	http://www.boost.org/LICENSE_1_0.txt)
 |  *	http://www.boost.org/LICENSE_1_0.txt)
 | ||||||
|  * |  * | ||||||
|  *	@file: nana/gui/detail/window_manager.cpp |  *	@file: nana/gui/detail/window_manager.cpp | ||||||
|  *	@author: Jinhao |  | ||||||
|  *	@contributors:	Katsuhisa Yuasa |  *	@contributors:	Katsuhisa Yuasa | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| #include <nana/config.hpp> | #include <nana/config.hpp> | ||||||
| #include <nana/gui/detail/bedrock.hpp> | #include <nana/gui/detail/bedrock.hpp> | ||||||
|  | #include <nana/gui/detail/events_operation.hpp> | ||||||
| #include <nana/gui/detail/handle_manager.hpp> | #include <nana/gui/detail/handle_manager.hpp> | ||||||
| #include <nana/gui/detail/window_manager.hpp> | #include <nana/gui/detail/window_manager.hpp> | ||||||
| #include <nana/gui/detail/native_window_interface.hpp> | #include <nana/gui/detail/native_window_interface.hpp> | ||||||
| @ -33,7 +33,7 @@ namespace detail | |||||||
| 			{ | 			{ | ||||||
| 				void operator()(basic_window* wd) const | 				void operator()(basic_window* wd) const | ||||||
| 				{ | 				{ | ||||||
| 					bedrock::instance().evt_operation.umake(reinterpret_cast<window>(wd)); | 					bedrock::instance().evt_operation().umake(reinterpret_cast<window>(wd)); | ||||||
| 					delete wd; | 					delete wd; | ||||||
| 				} | 				} | ||||||
| 			}; | 			}; | ||||||
| @ -788,12 +788,6 @@ namespace detail | |||||||
| 				false); | 				false); | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		::nana::widget* window_manager::get_widget(core_window_t* wd) const |  | ||||||
| 		{ |  | ||||||
| 			std::lock_guard<decltype(mutex_)> lock(mutex_); |  | ||||||
| 			return (impl_->wd_register.available(wd) ? wd->widget_notifier->widget_ptr() : nullptr); |  | ||||||
| 		} |  | ||||||
| 
 |  | ||||||
| 		std::vector<window_manager::core_window_t*> window_manager::get_children(core_window_t* wd) const | 		std::vector<window_manager::core_window_t*> window_manager::get_children(core_window_t* wd) const | ||||||
| 		{ | 		{ | ||||||
| 			std::lock_guard<decltype(mutex_)> lock(mutex_); | 			std::lock_guard<decltype(mutex_)> lock(mutex_); | ||||||
|  | |||||||
| @ -22,7 +22,7 @@ namespace nana | |||||||
| 	{ | 	{ | ||||||
| 		namespace | 		namespace | ||||||
| 		{ | 		{ | ||||||
| 			using core_window_t = detail::bedrock::core_window_t; | 			using core_window_t = detail::basic_window; | ||||||
| 
 | 
 | ||||||
| 			inline detail::drawer& get_drawer(window wd) | 			inline detail::drawer& get_drawer(window wd) | ||||||
| 			{ | 			{ | ||||||
|  | |||||||
| @ -241,11 +241,15 @@ namespace nana | |||||||
| 	} | 	} | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| 	typedef ::nana::detail::bedrock bedrock; |  | ||||||
| 	//class notifier
 | 	//class notifier
 | ||||||
| 	notifier::notifier(window wd) | 	notifier::notifier(window wd) | ||||||
| 		: impl_(new implement) | 		: impl_(new implement) | ||||||
| 	{ | 	{ | ||||||
|  | 		impl_->handle = wd; | ||||||
|  | 		impl_->native_handle = API::root(wd); | ||||||
|  | 		if (!impl_->native_handle) | ||||||
|  | 			throw std::invalid_argument("Invalid window handle"); | ||||||
|  | 
 | ||||||
| 		impl_->ani_timer.elapse([this] | 		impl_->ani_timer.elapse([this] | ||||||
| 		{ | 		{ | ||||||
| #if defined(NANA_WINDOWS) | #if defined(NANA_WINDOWS) | ||||||
| @ -257,9 +261,6 @@ namespace nana | |||||||
| #endif | #endif | ||||||
| 		}); | 		}); | ||||||
| 
 | 
 | ||||||
| 		auto & brock = bedrock::instance(); |  | ||||||
| 		impl_->handle = wd; |  | ||||||
| 		impl_->native_handle = brock.root(reinterpret_cast<bedrock::core_window_t*>(wd)); |  | ||||||
| 		impl_->evt_destroy = API::events(wd).destroy([this] | 		impl_->evt_destroy = API::events(wd).destroy([this] | ||||||
| 		{ | 		{ | ||||||
| 			close(); | 			close(); | ||||||
|  | |||||||
| @ -1074,7 +1074,6 @@ namespace nana | |||||||
| 				} | 				} | ||||||
| 
 | 
 | ||||||
| 				block_px = lowest; | 				block_px = lowest; | ||||||
| 
 |  | ||||||
| 				if (blocks > min_count) | 				if (blocks > min_count) | ||||||
| 					rest_px -= (lowest-level_px) * (blocks - min_count); | 					rest_px -= (lowest-level_px) * (blocks - min_count); | ||||||
| 
 | 
 | ||||||
| @ -1141,7 +1140,6 @@ namespace nana | |||||||
| 
 | 
 | ||||||
| 		void collocate(window wd) override | 		void collocate(window wd) override | ||||||
| 		{ | 		{ | ||||||
| 
 |  | ||||||
| 			if (!field || !(visible && display)) | 			if (!field || !(visible && display)) | ||||||
| 				return; | 				return; | ||||||
| 
 | 
 | ||||||
| @ -1797,14 +1795,16 @@ namespace nana | |||||||
| 					if (arg.button != ::nana::mouse::left_button) | 					if (arg.button != ::nana::mouse::left_button) | ||||||
| 						return; | 						return; | ||||||
| 
 | 
 | ||||||
|  | 					bool is_vert = _m_is_vert(dir_); | ||||||
|  | 
 | ||||||
| 					API::capture_window(this->handle(), true); | 					API::capture_window(this->handle(), true); | ||||||
| 					auto basepos = API::cursor_position(); | 					auto basepos = API::cursor_position(); | ||||||
| 					base_pos_.x = (_m_is_vert(dir_) ? basepos.y : basepos.x); | 					base_pos_.x = (is_vert ? basepos.y : basepos.x); | ||||||
| 
 | 
 | ||||||
| 					basepos = this->pos(); | 					basepos = this->pos(); | ||||||
| 					base_pos_.y = (_m_is_vert(dir_) ? basepos.y : basepos.x); | 					base_pos_.y = (is_vert ? basepos.y : basepos.x); | ||||||
| 
 | 
 | ||||||
| 					base_px_ = (_m_is_vert(dir_) ? pane_dv_->field_area.height : pane_dv_->field_area.width); | 					base_px_ = (is_vert ? pane_dv_->field_area.height : pane_dv_->field_area.width); | ||||||
| 				}); | 				}); | ||||||
| 
 | 
 | ||||||
| 				this->events().mouse_up([this] | 				this->events().mouse_up([this] | ||||||
| @ -1855,6 +1855,8 @@ namespace nana | |||||||
| 						else | 						else | ||||||
| 							px -= static_cast<unsigned>(delta); | 							px -= static_cast<unsigned>(delta); | ||||||
| 						break; | 						break; | ||||||
|  |                     default: | ||||||
|  |                         break; | ||||||
| 					} | 					} | ||||||
| 
 | 
 | ||||||
| 					auto dock_px = (_m_is_vert(dir_) ? dock_dv_->field_area.height : dock_dv_->field_area.width); | 					auto dock_px = (_m_is_vert(dir_) ? dock_dv_->field_area.height : dock_dv_->field_area.width); | ||||||
| @ -1880,21 +1882,17 @@ namespace nana | |||||||
| 
 | 
 | ||||||
| 		}; | 		}; | ||||||
| 	public: | 	public: | ||||||
| 
 |  | ||||||
| 		div_dock(std::string && name, implement* impl) | 		div_dock(std::string && name, implement* impl) | ||||||
| 			: division(kind::dock, std::move(name)), impl_(impl) | 			: division(kind::dock, std::move(name)), impl_(impl) | ||||||
| 		{} | 		{} | ||||||
| 
 | 
 | ||||||
| 		division* front() const | 		division* front() const | ||||||
| 		{ | 		{ | ||||||
| 			auto i = children.cbegin(); |  | ||||||
| 			 |  | ||||||
| 			for (auto i = children.cbegin(); i != children.cend(); ++i) | 			for (auto i = children.cbegin(); i != children.cend(); ++i) | ||||||
| 			{ | 			{ | ||||||
| 				if (i->get()->display) | 				if (i->get()->display) | ||||||
| 					return i->get(); | 					return i->get(); | ||||||
| 			} | 			} | ||||||
| 
 |  | ||||||
| 			return nullptr; | 			return nullptr; | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| @ -1912,8 +1910,6 @@ namespace nana | |||||||
| 				if (!child->display) | 				if (!child->display) | ||||||
| 					continue; | 					continue; | ||||||
| 
 | 
 | ||||||
| 				auto child_dv = dynamic_cast<div_dockpane*>(child.get()); |  | ||||||
| 
 |  | ||||||
| 				const auto is_vert = _m_is_vert(child->dir); | 				const auto is_vert = _m_is_vert(child->dir); | ||||||
| 				if (is_first) | 				if (is_first) | ||||||
| 				{ | 				{ | ||||||
| @ -1930,16 +1926,13 @@ namespace nana | |||||||
| 				prev_attr = is_vert; | 				prev_attr = is_vert; | ||||||
| 			} | 			} | ||||||
| 			if (0 == vert_count) | 			if (0 == vert_count) | ||||||
| 				++vert_count; | 				vert_count = 1; | ||||||
| 			if (0 == horz_count) | 			if (0 == horz_count) | ||||||
| 				++horz_count; | 				horz_count = 1; | ||||||
| 
 | 
 | ||||||
| 			//room indicates the size without splitters
 | 			//room indicates the size without splitters
 | ||||||
| 			::nana::size room(area.width - splitter_px * (horz_count - 1), area.height - splitter_px * (vert_count - 1)); | 			::nana::size room(area.width - splitter_px * (horz_count - 1), area.height - splitter_px * (vert_count - 1)); | ||||||
| 
 | 
 | ||||||
| 			//double auto_horz_w = double(area.width - splitter_px * (horz_count - 1))/ horz_count;
 |  | ||||||
| 			//double auto_vert_w = double(area.height - splitter_px * (vert_count - 1)) / vert_count;
 |  | ||||||
| 
 |  | ||||||
| 			double left = area.x; | 			double left = area.x; | ||||||
| 			double right = area.right(); | 			double right = area.right(); | ||||||
| 			double top = area.y; | 			double top = area.y; | ||||||
| @ -2049,7 +2042,6 @@ namespace nana | |||||||
| 				if (split_range_begin > -0.5) | 				if (split_range_begin > -0.5) | ||||||
| 					split->range(static_cast<int>(split_range_begin), static_cast<int>(split_range_end)); | 					split->range(static_cast<int>(split_range_begin), static_cast<int>(split_range_end)); | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| 				if (is_vert) | 				if (is_vert) | ||||||
| 				{ | 				{ | ||||||
| 					room.height -= child_r.height; | 					room.height -= child_r.height; | ||||||
|  | |||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @ -12,6 +12,7 @@ | |||||||
| #include <nana/gui/state_cursor.hpp> | #include <nana/gui/state_cursor.hpp> | ||||||
| #include <nana/gui/detail/bedrock.hpp> | #include <nana/gui/detail/bedrock.hpp> | ||||||
| #include <nana/gui/detail/basic_window.hpp> | #include <nana/gui/detail/basic_window.hpp> | ||||||
|  | #include <nana/gui/detail/window_manager.hpp> | ||||||
| 
 | 
 | ||||||
| namespace nana | namespace nana | ||||||
| { | { | ||||||
| @ -20,7 +21,7 @@ namespace nana | |||||||
| 	{ | 	{ | ||||||
| 		auto & brock = detail::bedrock::instance(); | 		auto & brock = detail::bedrock::instance(); | ||||||
| 		auto wd = reinterpret_cast<detail::basic_window*>(handle); | 		auto wd = reinterpret_cast<detail::basic_window*>(handle); | ||||||
| 		if (brock.wd_manager.available(wd)) | 		if (brock.wd_manager().available(wd)) | ||||||
| 			brock.define_state_cursor(wd, cur, nullptr); | 			brock.define_state_cursor(wd, cur, nullptr); | ||||||
| 		else | 		else | ||||||
| 			handle_ = nullptr; | 			handle_ = nullptr; | ||||||
| @ -40,7 +41,7 @@ namespace nana | |||||||
| 			{ | 			{ | ||||||
| 				auto & brock = detail::bedrock::instance(); | 				auto & brock = detail::bedrock::instance(); | ||||||
| 				auto wd = reinterpret_cast<detail::basic_window*>(handle_); | 				auto wd = reinterpret_cast<detail::basic_window*>(handle_); | ||||||
| 				if (brock.wd_manager.available(wd)) | 				if (brock.wd_manager().available(wd)) | ||||||
| 					brock.undefine_state_cursor(wd, nullptr); | 					brock.undefine_state_cursor(wd, nullptr); | ||||||
| 			} | 			} | ||||||
| 			handle_ = rhs.handle_; | 			handle_ = rhs.handle_; | ||||||
| @ -55,7 +56,7 @@ namespace nana | |||||||
| 		{ | 		{ | ||||||
| 			auto & brock = detail::bedrock::instance(); | 			auto & brock = detail::bedrock::instance(); | ||||||
| 			auto wd = reinterpret_cast<detail::basic_window*>(handle_); | 			auto wd = reinterpret_cast<detail::basic_window*>(handle_); | ||||||
| 			if (brock.wd_manager.available(wd)) | 			if (brock.wd_manager().available(wd)) | ||||||
| 				brock.undefine_state_cursor(wd, nullptr); | 				brock.undefine_state_cursor(wd, nullptr); | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
|  | |||||||
| @ -297,7 +297,7 @@ namespace nana | |||||||
| 
 | 
 | ||||||
| 				return *this; | 				return *this; | ||||||
| 			} | 			} | ||||||
| 			 | 
 | ||||||
| 			iresolver::iresolver(const std::vector<cell>& cl) | 			iresolver::iresolver(const std::vector<cell>& cl) | ||||||
| 				: cells_(cl) | 				: cells_(cl) | ||||||
| 			{} | 			{} | ||||||
| @ -317,7 +317,7 @@ namespace nana | |||||||
| 			//end class iresolver/oresolver
 | 			//end class iresolver/oresolver
 | ||||||
| 
 | 
 | ||||||
|             /// Essence of the columns Header
 |             /// Essence of the columns Header
 | ||||||
| 			class es_header    | 			class es_header | ||||||
| 			{ | 			{ | ||||||
| 			public: | 			public: | ||||||
| 
 | 
 | ||||||
| @ -339,10 +339,10 @@ namespace nana | |||||||
| 
 | 
 | ||||||
|                 export_options::columns_indexs all_headers(bool only_visibles) const |                 export_options::columns_indexs all_headers(bool only_visibles) const | ||||||
|                 { |                 { | ||||||
|                     export_options::columns_indexs	idx;				 |                     export_options::columns_indexs	idx; | ||||||
| 					for(const auto &header : cont()) | 					for(const auto &header : cont()) | ||||||
| 					{ | 					{ | ||||||
| 						if(header.visible || !only_visibles)   | 						if(header.visible || !only_visibles) | ||||||
| 							idx.push_back(header.index); | 							idx.push_back(header.index); | ||||||
| 					} | 					} | ||||||
|                     return idx; |                     return idx; | ||||||
| @ -350,13 +350,13 @@ namespace nana | |||||||
| 
 | 
 | ||||||
|                 nana::string to_string(const export_options& exp_opt) const |                 nana::string to_string(const export_options& exp_opt) const | ||||||
|                 { |                 { | ||||||
|                     nana::string head_str;  |                     nana::string head_str; | ||||||
|                     bool first{true}; |                     bool first{true}; | ||||||
|                     for( size_type idx{}; idx<exp_opt.columns_order.size(); ++idx) |                     for( size_type idx{}; idx<exp_opt.columns_order.size(); ++idx) | ||||||
| 					{ | 					{ | ||||||
|                         if(first) |                         if(first) | ||||||
|                             first=false; |                             first=false; | ||||||
|                         else  |                         else | ||||||
|                             head_str += exp_opt.sep; |                             head_str += exp_opt.sep; | ||||||
| 
 | 
 | ||||||
| 	        			head_str += column_ref(exp_opt.columns_order[idx]).text; | 	        			head_str += column_ref(exp_opt.columns_order[idx]).text; | ||||||
| @ -668,7 +668,7 @@ namespace nana | |||||||
| 				category_t(nana::string str) | 				category_t(nana::string str) | ||||||
| 					:text(std::move(str)) | 					:text(std::move(str)) | ||||||
| 				{} | 				{} | ||||||
| 				 | 
 | ||||||
| 				bool selected() const | 				bool selected() const | ||||||
| 				{ | 				{ | ||||||
| 					for (auto & m : items) | 					for (auto & m : items) | ||||||
| @ -723,7 +723,7 @@ namespace nana | |||||||
| 					return nullptr; | 					return nullptr; | ||||||
| 				} | 				} | ||||||
|                 nana::string to_string(const export_options& exp_opt) const; |                 nana::string to_string(const export_options& exp_opt) const; | ||||||
|                  | 
 | ||||||
|                 /// each sort() ivalidate any existing reference from display position to absolute item, that is after sort() display offset point to different items
 |                 /// each sort() ivalidate any existing reference from display position to absolute item, that is after sort() display offset point to different items
 | ||||||
|                 void sort() |                 void sort() | ||||||
| 				{ | 				{ | ||||||
| @ -872,7 +872,7 @@ namespace nana | |||||||
| 					list_.back().key_ptr = ptr; | 					list_.back().key_ptr = ptr; | ||||||
| 					return &list_.back(); | 					return &list_.back(); | ||||||
| 				} | 				} | ||||||
|                 /// add a new cat created at "pos" and return a ref to it 
 |                 /// add a new cat created at "pos" and return a ref to it
 | ||||||
| 				category_t* create_cat(std::size_t pos, nana::string&& text) | 				category_t* create_cat(std::size_t pos, nana::string&& text) | ||||||
| 				{ | 				{ | ||||||
| 					return &(*list_.emplace(this->get(pos), std::move(text))); | 					return &(*list_.emplace(this->get(pos), std::move(text))); | ||||||
| @ -917,7 +917,7 @@ namespace nana | |||||||
|                     for (size_type i=0; i<catobj.sorted.size();++i) |                     for (size_type i=0; i<catobj.sorted.size();++i) | ||||||
|                         if (pos==catobj.sorted[i]) |                         if (pos==catobj.sorted[i]) | ||||||
|                             return i; |                             return i; | ||||||
| 					  | 
 | ||||||
| 					return   npos ; | 					return   npos ; | ||||||
| 				} | 				} | ||||||
| 
 | 
 | ||||||
| @ -966,7 +966,7 @@ namespace nana | |||||||
| 				index_pair advance(index_pair from, size_type offset)   //    <------------- index
 | 				index_pair advance(index_pair from, size_type offset)   //    <------------- index
 | ||||||
| 				{ | 				{ | ||||||
|                     index_pair dpos{npos, npos}; |                     index_pair dpos{npos, npos}; | ||||||
| 					if(from.cat >= size_categ() || (from.item != npos && from.item >= size_item(from.cat)))  | 					if(from.cat >= size_categ() || (from.item != npos && from.item >= size_item(from.cat))) | ||||||
|                         return dpos; |                         return dpos; | ||||||
| 
 | 
 | ||||||
| 					dpos  = from; | 					dpos  = from; | ||||||
| @ -1293,7 +1293,7 @@ namespace nana | |||||||
| 					for(auto & cat : list_) | 					for(auto & cat : list_) | ||||||
| 					{ | 					{ | ||||||
| 						id.item = 0; | 						id.item = 0; | ||||||
| 						for(auto & m : cat.items)   | 						for(auto & m : cat.items) | ||||||
| 						{ | 						{ | ||||||
| 							if(m.flags.selected) | 							if(m.flags.selected) | ||||||
| 								vec.push_back(id);  // absolute positions, no relative to display
 | 								vec.push_back(id);  // absolute positions, no relative to display
 | ||||||
| @ -1302,14 +1302,14 @@ namespace nana | |||||||
| 						++id.cat; | 						++id.cat; | ||||||
| 					} | 					} | ||||||
| 				} | 				} | ||||||
|                  | 
 | ||||||
|                 index_pair find_first_selected() |                 index_pair find_first_selected() | ||||||
|                 { |                 { | ||||||
| 					index_pair id; | 					index_pair id; | ||||||
| 					for(auto & cat : list_) | 					for(auto & cat : list_) | ||||||
| 					{ | 					{ | ||||||
| 						id.item = 0; | 						id.item = 0; | ||||||
| 						for(auto & m : cat.items)   | 						for(auto & m : cat.items) | ||||||
| 						{ | 						{ | ||||||
| 							if(m.flags.selected) | 							if(m.flags.selected) | ||||||
| 								return id;  // absolute positions, no relative to display
 | 								return id;  // absolute positions, no relative to display
 | ||||||
| @ -1659,7 +1659,7 @@ namespace nana | |||||||
| 				///Translate relative position (position in display) into absolute position (original data order)
 | 				///Translate relative position (position in display) into absolute position (original data order)
 | ||||||
| 				size_type absolute(const index_pair& display_pos) const | 				size_type absolute(const index_pair& display_pos) const | ||||||
| 				{ | 				{ | ||||||
| 					if(sorted_index_ == npos || display_pos.item == npos)  | 					if(sorted_index_ == npos || display_pos.item == npos) | ||||||
| 						return display_pos.item ; | 						return display_pos.item ; | ||||||
| 
 | 
 | ||||||
| 					auto & catobj = *get(display_pos.cat); | 					auto & catobj = *get(display_pos.cat); | ||||||
| @ -1674,11 +1674,11 @@ namespace nana | |||||||
| 					auto item_pos = absolute(display_pos); | 					auto item_pos = absolute(display_pos); | ||||||
| 					return {item_pos != npos ? display_pos.cat : npos, item_pos}; | 					return {item_pos != npos ? display_pos.cat : npos, item_pos}; | ||||||
| 				} | 				} | ||||||
| 				 | 
 | ||||||
|                 ///Translate absolute position (original data order) into relative position (position in display)
 |                 ///Translate absolute position (original data order) into relative position (position in display)
 | ||||||
|                 size_type relative(const index_pair& pos) const |                 size_type relative(const index_pair& pos) const | ||||||
| 				{ | 				{ | ||||||
| 					if (sorted_index_ == npos)  | 					if (sorted_index_ == npos) | ||||||
| 						return pos.item ; | 						return pos.item ; | ||||||
| 
 | 
 | ||||||
| 					auto& catobj = *get(pos.cat); | 					auto& catobj = *get(pos.cat); | ||||||
| @ -1686,7 +1686,7 @@ namespace nana | |||||||
| 					for (size_type i=0; i<catobj.sorted.size();++i) | 					for (size_type i=0; i<catobj.sorted.size();++i) | ||||||
| 						if (pos.item == catobj.sorted[i]) | 						if (pos.item == catobj.sorted[i]) | ||||||
| 							return i; | 							return i; | ||||||
| 					  | 
 | ||||||
| 					if (catobj.items.empty() && (pos == index_pair{ 0, 0 })) | 					if (catobj.items.empty() && (pos == index_pair{ 0, 0 })) | ||||||
| 						return 0; | 						return 0; | ||||||
| 
 | 
 | ||||||
| @ -1698,7 +1698,7 @@ namespace nana | |||||||
| 					auto item_pos = relative(pos); | 					auto item_pos = relative(pos); | ||||||
| 					return {(item_pos != npos ? pos.cat : npos), item_pos}; | 					return {(item_pos != npos ? pos.cat : npos), item_pos}; | ||||||
| 				} | 				} | ||||||
| 				 | 
 | ||||||
| 				/// all arg are relative to display order, or all are absolute, but not mixed
 | 				/// all arg are relative to display order, or all are absolute, but not mixed
 | ||||||
| 				bool forward(index_pair from, size_type offs, index_pair& item) const | 				bool forward(index_pair from, size_type offs, index_pair& item) const | ||||||
| 				{ | 				{ | ||||||
| @ -1781,7 +1781,7 @@ namespace nana | |||||||
| 					} | 					} | ||||||
| 					return false; | 					return false; | ||||||
| 				} | 				} | ||||||
| 				 | 
 | ||||||
| 				/// categories iterator
 | 				/// categories iterator
 | ||||||
| 				container::iterator get(size_type pos) | 				container::iterator get(size_type pos) | ||||||
| 				{ | 				{ | ||||||
| @ -1792,7 +1792,7 @@ namespace nana | |||||||
| 					std::advance(i, pos); | 					std::advance(i, pos); | ||||||
| 					return i; | 					return i; | ||||||
| 				} | 				} | ||||||
| 				 | 
 | ||||||
| 				container::const_iterator get(size_type pos) const | 				container::const_iterator get(size_type pos) const | ||||||
| 				{ | 				{ | ||||||
| 					if (pos >= list_.size()) | 					if (pos >= list_.size()) | ||||||
| @ -1841,12 +1841,6 @@ namespace nana | |||||||
| 
 | 
 | ||||||
|                 ::nana::listbox::export_options def_exp_options; |                 ::nana::listbox::export_options def_exp_options; | ||||||
| 
 | 
 | ||||||
|                 ::nana::listbox::export_options& def_export_options() |  | ||||||
|                 { |  | ||||||
| 			        return def_exp_options; |  | ||||||
|                 } |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| 				es_header header; | 				es_header header; | ||||||
| 				es_lister lister;  // we have at least one emty cat. the #0
 | 				es_lister lister;  // we have at least one emty cat. the #0
 | ||||||
| 
 | 
 | ||||||
| @ -1925,7 +1919,7 @@ namespace nana | |||||||
| 					scroll_y_dpl_refresh() ; | 					scroll_y_dpl_refresh() ; | ||||||
| 				} | 				} | ||||||
| 
 | 
 | ||||||
| 				/// directly set a tested relative display pos 
 | 				/// directly set a tested relative display pos
 | ||||||
| 				void set_scroll_y_dpl(const index_pair& pos_dpl) | 				void set_scroll_y_dpl(const index_pair& pos_dpl) | ||||||
| 				{ | 				{ | ||||||
| 					scroll.offset_y_dpl = pos_dpl; | 					scroll.offset_y_dpl = pos_dpl; | ||||||
| @ -1950,7 +1944,7 @@ namespace nana | |||||||
|                 { |                 { | ||||||
|                     if(      dpl_pos.cat <  scroll.offset_y_dpl.cat    // in prevoious cat    ---------------- up ----> we need to move
 |                     if(      dpl_pos.cat <  scroll.offset_y_dpl.cat    // in prevoious cat    ---------------- up ----> we need to move
 | ||||||
|                         || ((dpl_pos.cat == scroll.offset_y_dpl.cat) && ( scroll.offset_y_dpl.item != npos)  // is our cat, where we are an item
 |                         || ((dpl_pos.cat == scroll.offset_y_dpl.cat) && ( scroll.offset_y_dpl.item != npos)  // is our cat, where we are an item
 | ||||||
|                                                                      && (dpl_pos.item == npos || dpl_pos.item <  scroll.offset_y_dpl.item)))  |                                                                      && (dpl_pos.item == npos || dpl_pos.item <  scroll.offset_y_dpl.item))) | ||||||
| 					                                                                                    // problem!!!!!!
 | 					                                                                                    // problem!!!!!!
 | ||||||
|                     { |                     { | ||||||
| 						if(lister.expand(dpl_pos.cat) == false) | 						if(lister.expand(dpl_pos.cat) == false) | ||||||
| @ -1960,7 +1954,7 @@ namespace nana | |||||||
| 							else | 							else | ||||||
| 								lister.expand(dpl_pos.cat, true); | 								lister.expand(dpl_pos.cat, true); | ||||||
| 						} | 						} | ||||||
|                         set_scroll_y_dpl(dpl_pos);     //  <------------------------- set       scroll.offset_y_dpl   &     scroll.offset_y_abs 
 |                         set_scroll_y_dpl(dpl_pos);     //  <------------------------- set       scroll.offset_y_dpl   &     scroll.offset_y_abs
 | ||||||
| 					} | 					} | ||||||
| 					else | 					else | ||||||
| 					{ | 					{ | ||||||
| @ -1969,7 +1963,7 @@ namespace nana | |||||||
| 						if(numbers > off) return; | 						if(numbers > off) return; | ||||||
| 						index_pair n_off = lister.advance(scroll.offset_y_dpl, (off - numbers) + 1); | 						index_pair n_off = lister.advance(scroll.offset_y_dpl, (off - numbers) + 1); | ||||||
| 
 | 
 | ||||||
| 						if(n_off.cat != npos)       //  <------------------------- set       scroll.offset_y_dpl   &     scroll.offset_y_abs 
 | 						if(n_off.cat != npos)       //  <------------------------- set       scroll.offset_y_dpl   &     scroll.offset_y_abs
 | ||||||
|                             set_scroll_y_dpl(n_off); |                             set_scroll_y_dpl(n_off); | ||||||
| 					} | 					} | ||||||
| 
 | 
 | ||||||
| @ -1978,7 +1972,7 @@ namespace nana | |||||||
| 
 | 
 | ||||||
|                 void trace_item_abs( index_pair abs_pos ) |                 void trace_item_abs( index_pair abs_pos ) | ||||||
|                 { |                 { | ||||||
| 					if(abs_pos.item == npos && abs_pos.cat              == scroll.offset_y_abs.cat  | 					if(abs_pos.item == npos && abs_pos.cat              == scroll.offset_y_abs.cat | ||||||
|                                             && scroll.offset_y_abs.item == npos                      ) // if item==off y and is a cat
 |                                             && scroll.offset_y_abs.item == npos                      ) // if item==off y and is a cat
 | ||||||
| 						return; | 						return; | ||||||
| 
 | 
 | ||||||
| @ -2020,7 +2014,7 @@ namespace nana | |||||||
| 						scroll.v.value(off); | 						scroll.v.value(off); | ||||||
| 					} | 					} | ||||||
| 				} | 				} | ||||||
|                   | 
 | ||||||
| 				void adjust_scroll_life()  // at end call adjust_scroll_value(); | 				void adjust_scroll_life()  // at end call adjust_scroll_value(); | ||||||
| 				{ | 				{ | ||||||
| 					internal_scope_guard lock; | 					internal_scope_guard lock; | ||||||
| @ -2252,7 +2246,7 @@ namespace nana | |||||||
| 
 | 
 | ||||||
| 					if (target == scroll.offset_y_dpl) | 					if (target == scroll.offset_y_dpl) | ||||||
| 						return false; | 						return false; | ||||||
| 					 | 
 | ||||||
| 					set_scroll_y_dpl ( target ); | 					set_scroll_y_dpl ( target ); | ||||||
| 					return true; | 					return true; | ||||||
| 				} | 				} | ||||||
| @ -2465,10 +2459,10 @@ namespace nana | |||||||
| 
 | 
 | ||||||
| 						if (good(next_selected_dpl)) | 						if (good(next_selected_dpl)) | ||||||
| 						{ | 						{ | ||||||
| 							if (unselect_previous && !single_selection_ )  | 							if (unselect_previous && !single_selection_ ) | ||||||
|                                 select_for_all(false); |                                 select_for_all(false); | ||||||
| 
 | 
 | ||||||
|                             /// is ignored if no change (maybe set last_selected anyway??), but if change emit event, deselect others if need ans set/unset last_selected 
 |                             /// is ignored if no change (maybe set last_selected anyway??), but if change emit event, deselect others if need ans set/unset last_selected
 | ||||||
|                             item_proxy::from_display(ess_, next_selected_dpl).select(true); |                             item_proxy::from_display(ess_, next_selected_dpl).select(true); | ||||||
| 
 | 
 | ||||||
|                             if (trace_selected) |                             if (trace_selected) | ||||||
| @ -2482,7 +2476,7 @@ namespace nana | |||||||
| 
 | 
 | ||||||
| 			nana::string es_lister::to_string(const export_options& exp_opt) const | 			nana::string es_lister::to_string(const export_options& exp_opt) const | ||||||
| 			{ | 			{ | ||||||
| 				nana::string list_str;  | 				nana::string list_str; | ||||||
| 				bool first{true}; | 				bool first{true}; | ||||||
| 				for(auto & cat: cat_container()) | 				for(auto & cat: cat_container()) | ||||||
| 				{ | 				{ | ||||||
| @ -2509,8 +2503,7 @@ namespace nana | |||||||
|                     if (it.selected() != sel) |                     if (it.selected() != sel) | ||||||
| 						it.select(sel); | 						it.select(sel); | ||||||
|                 } |                 } | ||||||
| 
 |                 last_selected_abs = last_selected_dpl = index_pair{cat, npos}; | ||||||
|                 last_selected_abs = last_selected_dpl =  index_pair {cat, npos}; |  | ||||||
| 			} | 			} | ||||||
| 
 | 
 | ||||||
| 			class drawer_header_impl | 			class drawer_header_impl | ||||||
| @ -2586,9 +2579,9 @@ namespace nana | |||||||
| 						const auto& item = essence_->header.column(item_spliter_); | 						const auto& item = essence_->header.column(item_spliter_); | ||||||
| 						//Resize the item specified by item_spliter_.
 | 						//Resize the item specified by item_spliter_.
 | ||||||
| 						auto new_w = orig_item_width_ - (ref_xpos_ - pos.x); | 						auto new_w = orig_item_width_ - (ref_xpos_ - pos.x); | ||||||
| 						if(static_cast<int>(item.pixels) != new_w) | 						if(item.pixels != new_w) | ||||||
| 						{ | 						{ | ||||||
| 							essence_->header.item_width(item_spliter_, (new_w < static_cast<int>(essence_->suspension_width + 20) ? essence_->suspension_width + 20 : new_w)); | 							essence_->header.item_width(item_spliter_, (new_w < (essence_->suspension_width + 20) ? essence_->suspension_width + 20 : new_w)); | ||||||
| 							new_w = essence_->header.pixels(); | 							new_w = essence_->header.pixels(); | ||||||
| 							if(new_w < (rect.width + essence_->scroll.offset_x)) | 							if(new_w < (rect.width + essence_->scroll.offset_x)) | ||||||
| 								essence_->scroll.offset_x = (new_w > rect.width ? new_w - rect.width : 0); | 								essence_->scroll.offset_x = (new_w > rect.width ? new_w - rect.width : 0); | ||||||
| @ -2749,8 +2742,8 @@ namespace nana | |||||||
| 					unsigned header_w = essence_->header.pixels(); | 					unsigned header_w = essence_->header.pixels(); | ||||||
| 					essence_->graph->set_color(bgcolor); | 					essence_->graph->set_color(bgcolor); | ||||||
| 					if(header_w - essence_->scroll.offset_x < rect.width) | 					if(header_w - essence_->scroll.offset_x < rect.width) | ||||||
| 						essence_->graph->rectangle(rectangle{ point(rect.x + static_cast<int>(header_w)-essence_->scroll.offset_x,  rect.y),  | 						essence_->graph->rectangle(rectangle{ point(rect.x + static_cast<int>(header_w)-essence_->scroll.offset_x,  rect.y), | ||||||
|                                                               size(static_cast<int>(rect.width)  + essence_->scroll.offset_x - static_cast<int>(header_w),  rect.height) },  |                                                               size(static_cast<int>(rect.width)  + essence_->scroll.offset_x - static_cast<int>(header_w),  rect.height) }, | ||||||
|                                                     true); |                                                     true); | ||||||
| 
 | 
 | ||||||
| 					es_lister & lister = essence_->lister; | 					es_lister & lister = essence_->lister; | ||||||
| @ -2801,7 +2794,7 @@ namespace nana | |||||||
| 							_m_draw_item(*i_categ, item_index, x, y, txtoff, header_w, rect, subitems, bgcolor,fgcolor, state); | 							_m_draw_item(*i_categ, item_index, x, y, txtoff, header_w, rect, subitems, bgcolor,fgcolor, state); | ||||||
| 							y += essence_->item_size; | 							y += essence_->item_size; | ||||||
| 						} | 						} | ||||||
| 	 | 
 | ||||||
| 						++i_categ; | 						++i_categ; | ||||||
| 						++idx.cat; | 						++idx.cat; | ||||||
| 					} | 					} | ||||||
| @ -2857,7 +2850,7 @@ namespace nana | |||||||
| 
 | 
 | ||||||
| 					facade<element::arrow> arrow("double"); | 					facade<element::arrow> arrow("double"); | ||||||
| 					arrow.direction(categ.expand ? ::nana::direction::north : ::nana::direction::south); | 					arrow.direction(categ.expand ? ::nana::direction::north : ::nana::direction::south); | ||||||
| 					arrow.draw(	*graph, {}, txt_color,  | 					arrow.draw(	*graph, {}, txt_color, | ||||||
| 								{ x + 5, y + static_cast<int>(essence_->item_size - 16) / 2, 16, 16 }, | 								{ x + 5, y + static_cast<int>(essence_->item_size - 16) / 2, 16, 16 }, | ||||||
| 								element_state::normal); | 								element_state::normal); | ||||||
| 
 | 
 | ||||||
| @ -2890,7 +2883,7 @@ namespace nana | |||||||
| 				{ | 				{ | ||||||
| 					auto & item = cat.items[item_pos.item]; | 					auto & item = cat.items[item_pos.item]; | ||||||
| 
 | 
 | ||||||
| 					if (item.flags.selected)                                    // fetch the "def" colors 
 | 					if (item.flags.selected)                                    // fetch the "def" colors
 | ||||||
| 						bgcolor = essence_->scheme_ptr->item_selected; | 						bgcolor = essence_->scheme_ptr->item_selected; | ||||||
| 					else if (!item.bgcolor.invisible()) | 					else if (!item.bgcolor.invisible()) | ||||||
| 						bgcolor = item.bgcolor; | 						bgcolor = item.bgcolor; | ||||||
| @ -3043,7 +3036,7 @@ namespace nana | |||||||
| 										//The text is painted over the next subitem                // here beging the ...
 | 										//The text is painted over the next subitem                // here beging the ...
 | ||||||
| 										int xpos = item_xpos + static_cast<int>(header.pixels) - static_cast<int>(essence_->suspension_width); | 										int xpos = item_xpos + static_cast<int>(header.pixels) - static_cast<int>(essence_->suspension_width); | ||||||
| 
 | 
 | ||||||
| 										graph->set_color(it_bgcolor);                                   // litter rect with the  item bg end ... 
 | 										graph->set_color(it_bgcolor);                                   // litter rect with the  item bg end ...
 | ||||||
| 										graph->rectangle(rectangle{ xpos, y + 2, essence_->suspension_width, essence_->item_size - 4 }, true); | 										graph->rectangle(rectangle{ xpos, y + 2, essence_->suspension_width, essence_->item_size - 4 }, true); | ||||||
| 										graph->string(point{ xpos, y + 2 }, STR("...")); | 										graph->string(point{ xpos, y + 2 }, STR("...")); | ||||||
| 
 | 
 | ||||||
| @ -3315,7 +3308,7 @@ namespace nana | |||||||
| 									if (arg.shift) | 									if (arg.shift) | ||||||
| 										lister.select_display_range(lister.last_selected_abs , item_pos, sel); | 										lister.select_display_range(lister.last_selected_abs , item_pos, sel); | ||||||
| 									else if (arg.ctrl) | 									else if (arg.ctrl) | ||||||
| 										sel = !item_proxy(essence_, index_pair (item_pos.cat, lister.absolute(item_pos))).selected();   | 										sel = !item_proxy(essence_, index_pair (item_pos.cat, lister.absolute(item_pos))).selected(); | ||||||
| 									else | 									else | ||||||
| 										lister.select_for_all(false);	//cancel all selections
 | 										lister.select_for_all(false);	//cancel all selections
 | ||||||
| 								} | 								} | ||||||
| @ -3325,7 +3318,7 @@ namespace nana | |||||||
| 								if(item_ptr) | 								if(item_ptr) | ||||||
| 								{ | 								{ | ||||||
| 									item_ptr->flags.selected = sel; | 									item_ptr->flags.selected = sel; | ||||||
| 									index_pair last_selected(item_pos.cat, lister.absolute(item_pos));  | 									index_pair last_selected(item_pos.cat, lister.absolute(item_pos)); | ||||||
| 
 | 
 | ||||||
| 									arg_listbox arg{item_proxy{essence_, last_selected}, sel}; | 									arg_listbox arg{item_proxy{essence_, last_selected}, sel}; | ||||||
| 									lister.wd_ptr()->events().selected.emit(arg); | 									lister.wd_ptr()->events().selected.emit(arg); | ||||||
| @ -3334,7 +3327,7 @@ namespace nana | |||||||
| 									{ | 									{ | ||||||
| 										lister.cancel_others_if_single_enabled(true, last_selected); | 										lister.cancel_others_if_single_enabled(true, last_selected); | ||||||
| 										essence_->lister.last_selected_abs = last_selected; | 										essence_->lister.last_selected_abs = last_selected; | ||||||
| 										 | 
 | ||||||
| 									} | 									} | ||||||
| 									else if (essence_->lister.last_selected_abs == last_selected) | 									else if (essence_->lister.last_selected_abs == last_selected) | ||||||
| 										essence_->lister.last_selected_abs.set_both(npos); | 										essence_->lister.last_selected_abs.set_both(npos); | ||||||
| @ -3424,7 +3417,7 @@ namespace nana | |||||||
| 				void trigger::dbl_click(graph_reference graph, const arg_mouse&) | 				void trigger::dbl_click(graph_reference graph, const arg_mouse&) | ||||||
| 				{ | 				{ | ||||||
| 					if (essence_->pointer_where.first == essence_t::parts::header) | 					if (essence_->pointer_where.first == essence_t::parts::header) | ||||||
| 						if (cursor::size_we == essence_->lister.wd_ptr()->cursor())	 | 						if (cursor::size_we == essence_->lister.wd_ptr()->cursor()) | ||||||
|                         { |                         { | ||||||
|  			               if (essence(). auto_width(drawer_header_->item_spliter() )) // ? in order
 |  			               if (essence(). auto_width(drawer_header_->item_spliter() )) // ? in order
 | ||||||
| 			                   essence().update(); | 			                   essence().update(); | ||||||
| @ -3471,7 +3464,7 @@ namespace nana | |||||||
| 					bool up = false; | 					bool up = false; | ||||||
| 
 | 
 | ||||||
|                     if (essence_->lister.size_categ()==1 && essence_->lister.size_item(0)==0) |                     if (essence_->lister.size_categ()==1 && essence_->lister.size_item(0)==0) | ||||||
|                        return ;  |                        return ; | ||||||
| 
 | 
 | ||||||
| 					switch(arg.key) | 					switch(arg.key) | ||||||
| 					{ | 					{ | ||||||
| @ -3494,7 +3487,7 @@ namespace nana | |||||||
|                     case keyboard::os_pagedown: |                     case keyboard::os_pagedown: | ||||||
|                     { |                     { | ||||||
| 					    auto& scrl = essence_->scroll.v; | 					    auto& scrl = essence_->scroll.v; | ||||||
|                         if (! scrl.make_page_scroll(!up))  |                         if (! scrl.make_page_scroll(!up)) | ||||||
|                             return; |                             return; | ||||||
|                         essence_->lister.select_for_all(false); |                         essence_->lister.select_for_all(false); | ||||||
| 
 | 
 | ||||||
| @ -3504,7 +3497,7 @@ namespace nana | |||||||
| 
 | 
 | ||||||
|                         if (idx.is_item()) |                         if (idx.is_item()) | ||||||
|                            item_proxy::from_display(essence_, idx).select(true); |                            item_proxy::from_display(essence_, idx).select(true); | ||||||
|                         else  |                         else | ||||||
|                             if(!essence_->lister.single_selection()) |                             if(!essence_->lister.single_selection()) | ||||||
| 								essence_->lister.categ_selected(idx.cat, true); | 								essence_->lister.categ_selected(idx.cat, true); | ||||||
| 
 | 
 | ||||||
| @ -3519,7 +3512,7 @@ namespace nana | |||||||
|                         index_pair frst{essence_->lister.first()}; |                         index_pair frst{essence_->lister.first()}; | ||||||
|                         if (frst.is_item()) |                         if (frst.is_item()) | ||||||
|                            item_proxy::from_display(essence_, frst).select(true); |                            item_proxy::from_display(essence_, frst).select(true); | ||||||
|                         else  |                         else | ||||||
|                             if(!essence_->lister.single_selection()) |                             if(!essence_->lister.single_selection()) | ||||||
| 								essence_->lister.categ_selected(frst.cat, true); | 								essence_->lister.categ_selected(frst.cat, true); | ||||||
| 
 | 
 | ||||||
| @ -3545,13 +3538,13 @@ namespace nana | |||||||
| 					{ | 					{ | ||||||
|                     case keyboard::copy: |                     case keyboard::copy: | ||||||
|                     { |                     { | ||||||
|                         export_options exp_opt {essence_->def_export_options()};   |                         export_options exp_opt {essence_->def_exp_options}; | ||||||
|                         exp_opt.columns_order = essence_->header.all_headers(true); |                         exp_opt.columns_order = essence_->header.all_headers(true); | ||||||
|                         exp_opt.only_selected_items = true; |                         exp_opt.only_selected_items = true; | ||||||
|                         ::nana::system::dataexch().set(essence_->to_string(exp_opt)); |                         ::nana::system::dataexch().set(essence_->to_string(exp_opt)); | ||||||
|                         return; |                         return; | ||||||
|                     } |                     } | ||||||
|                     case keyboard::select_all :   |                     case keyboard::select_all : | ||||||
|                         essence_->lister.select_for_all(true); |                         essence_->lister.select_for_all(true); | ||||||
| 						refresh(graph); | 						refresh(graph); | ||||||
| 					    API::lazy_refresh(); | 					    API::lazy_refresh(); | ||||||
| @ -3581,7 +3574,7 @@ namespace nana | |||||||
| 				} | 				} | ||||||
| 
 | 
 | ||||||
|                 /// the main porpose of this it to make obvious that item_proxy operate with absolute positions, and dont get moved during sort()
 |                 /// the main porpose of this it to make obvious that item_proxy operate with absolute positions, and dont get moved during sort()
 | ||||||
|                 item_proxy item_proxy::from_display(essence_t *ess, const index_pair &relative)  |                 item_proxy item_proxy::from_display(essence_t *ess, const index_pair &relative) | ||||||
|                 { |                 { | ||||||
|                     return item_proxy{ess, ess->lister.absolute_pair(relative)}; |                     return item_proxy{ess, ess->lister.absolute_pair(relative)}; | ||||||
|                 } |                 } | ||||||
| @ -3619,7 +3612,7 @@ namespace nana | |||||||
| 					return cat_->items.at(pos_.item).flags.checked; | 					return cat_->items.at(pos_.item).flags.checked; | ||||||
| 				} | 				} | ||||||
| 
 | 
 | ||||||
|                 /// is ignored if no change (maybe set last_selected anyway??), but if change emit event, deselect others if need ans set/unset last_selected 
 |                 /// is ignored if no change (maybe set last_selected anyway??), but if change emit event, deselect others if need ans set/unset last_selected
 | ||||||
|                 item_proxy & item_proxy::select(bool s) |                 item_proxy & item_proxy::select(bool s) | ||||||
| 				{ | 				{ | ||||||
| 					auto & m = cat_->items.at(pos_.item);       // a ref to the real item     // what is pos is a cat?
 | 					auto & m = cat_->items.at(pos_.item);       // a ref to the real item     // what is pos is a cat?
 | ||||||
| @ -3638,7 +3631,7 @@ namespace nana | |||||||
| 							ess_->lister.last_selected_abs.set_both(npos); | 							ess_->lister.last_selected_abs.set_both(npos); | ||||||
| 
 | 
 | ||||||
| 					ess_->update(); | 					ess_->update(); | ||||||
| 					 | 
 | ||||||
| 					ess_->update(); | 					ess_->update(); | ||||||
| 					return *this; | 					return *this; | ||||||
| 				} | 				} | ||||||
| @ -3719,7 +3712,7 @@ namespace nana | |||||||
| 				bool item_proxy::operator==(const char * s) const | 				bool item_proxy::operator==(const char * s) const | ||||||
| 				{ | 				{ | ||||||
| 					return (ess_->lister.get_cells(cat_, pos_.item).at(0).text == nana::string(nana::charset(s))); | 					return (ess_->lister.get_cells(cat_, pos_.item).at(0).text == nana::string(nana::charset(s))); | ||||||
| 					 | 
 | ||||||
| 				} | 				} | ||||||
| 
 | 
 | ||||||
| 				bool item_proxy::operator==(const wchar_t * s) const | 				bool item_proxy::operator==(const wchar_t * s) const | ||||||
| @ -4257,8 +4250,8 @@ namespace nana | |||||||
| 			  // from current display position
 | 			  // from current display position
 | ||||||
| 			  // move to the cat self if not in first cat
 | 			  // move to the cat self if not in first cat
 | ||||||
|               // move to first item ?? if in first cat
 |               // move to first item ?? if in first cat
 | ||||||
|             ess.scroll_y_abs(ess.scroll_y_abs());  |             ess.scroll_y_abs(ess.scroll_y_abs()); | ||||||
|   | 
 | ||||||
| 			ess.update(); | 			ess.update(); | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| @ -4271,8 +4264,8 @@ namespace nana | |||||||
| 			  // from current display position
 | 			  // from current display position
 | ||||||
| 			  // move to the cat self if not in first cat
 | 			  // move to the cat self if not in first cat
 | ||||||
|               // move to first item ?? if in first cat
 |               // move to first item ?? if in first cat
 | ||||||
|             ess.scroll_y_abs(ess.scroll_y_abs());  |             ess.scroll_y_abs(ess.scroll_y_abs()); | ||||||
|   | 
 | ||||||
| 			ess.update(); | 			ess.update(); | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| @ -4300,7 +4293,7 @@ namespace nana | |||||||
| 		{ | 		{ | ||||||
| 			auto & ess = _m_ess(); | 			auto & ess = _m_ess(); | ||||||
| 			ess.lister.erase(); | 			ess.lister.erase(); | ||||||
| 			ess.scroll_y_abs(index_pair());   | 			ess.scroll_y_abs(index_pair()); | ||||||
| 			ess.update(); | 			ess.update(); | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| @ -4432,7 +4425,7 @@ namespace nana | |||||||
| 
 | 
 | ||||||
|         listbox::export_options& listbox::def_export_options() |         listbox::export_options& listbox::def_export_options() | ||||||
|         { |         { | ||||||
| 			return _m_ess().def_export_options(); | 			return _m_ess().def_exp_options; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
| 		drawerbase::listbox::essence_t & listbox::_m_ess() const | 		drawerbase::listbox::essence_t & listbox::_m_ess() const | ||||||
|  | |||||||
| @ -1222,12 +1222,11 @@ namespace nana{	namespace widgets | |||||||
| 					    auto ki = kwptr->schemes.find(ds.scheme); | 					    auto ki = kwptr->schemes.find(ds.scheme); | ||||||
| 					    if (ki != kwptr->schemes.end() && ki->second) | 					    if (ki != kwptr->schemes.end() && ki->second) | ||||||
| 					    { | 					    { | ||||||
| 						    schemes_.emplace(ds.scheme, ki->second); | 							entities.emplace_back(); | ||||||
| 						    entities.emplace_back(); | 							auto & last = entities.back(); | ||||||
| 						    auto & last = entities.back(); | 							last.begin = text.data() + pos; | ||||||
| 						    last.begin = text.data() + pos; | 							last.end = last.begin + ds.text.size(); | ||||||
| 						    last.end = last.begin + ds.text.size(); | 							last.scheme = ki->second.get(); | ||||||
| 						    last.scheme = ki->second.get(); |  | ||||||
| 					    } | 					    } | ||||||
|                     } |                     } | ||||||
| 				} | 				} | ||||||
| @ -1259,7 +1258,6 @@ namespace nana{	namespace widgets | |||||||
| 			} | 			} | ||||||
| 		private: | 		private: | ||||||
| 			std::vector<entity> entities_; | 			std::vector<entity> entities_; | ||||||
| 			std::map<std::string, std::shared_ptr<keyword_scheme>> schemes_; |  | ||||||
| 		}; | 		}; | ||||||
| 
 | 
 | ||||||
| 		//class text_editor
 | 		//class text_editor
 | ||||||
|  | |||||||
| @ -1,6 +1,6 @@ | |||||||
| /*
 | /*
 | ||||||
|  *	Nana GUI Library Definition |  *	Nana GUI Library Definition | ||||||
|  *	Copyright(C) 2003-2013 Jinhao(cnjinhao@hotmail.com) |  *	Copyright(C) 2003-2015 Jinhao(cnjinhao@hotmail.com) | ||||||
|  * |  * | ||||||
|  *	Distributed under the Boost Software License, Version 1.0.  |  *	Distributed under the Boost Software License, Version 1.0.  | ||||||
|  *	(See accompanying file LICENSE_1_0.txt or copy at  |  *	(See accompanying file LICENSE_1_0.txt or copy at  | ||||||
| @ -12,9 +12,17 @@ | |||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| #include <nana/gui/wvl.hpp> | #include <nana/gui/wvl.hpp> | ||||||
| 
 | #include <nana/gui/detail/bedrock.hpp> | ||||||
| namespace nana | namespace nana | ||||||
| { | { | ||||||
|  | 	namespace detail | ||||||
|  | 	{ | ||||||
|  | 		void form_loader_private::insert_form(::nana::widget* p) | ||||||
|  | 		{ | ||||||
|  | 			bedrock::instance().manage_form_loader(reinterpret_cast<basic_window*>(p->handle()), true); | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
| 	void exec() | 	void exec() | ||||||
| 	{ | 	{ | ||||||
| 		detail::bedrock::instance().pump_event(nullptr, false); | 		detail::bedrock::instance().pump_event(nullptr, false); | ||||||
|  | |||||||
| @ -16,6 +16,8 @@ | |||||||
| #include <fstream> | #include <fstream> | ||||||
| #include <sstream> | #include <sstream> | ||||||
| #include <memory> | #include <memory> | ||||||
|  | #include <mutex> | ||||||
|  | #include <map> | ||||||
| 
 | 
 | ||||||
| namespace nana | namespace nana | ||||||
| { | { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Jinhao
						Jinhao