EntityClassMenu g_EntityClassMenu;
-
--
-void ShowNamesExport( const BoolImportCallback& importer ){
- importer( GlobalEntityCreator().getShowNames() );
-}
-typedef FreeCaller1<const BoolImportCallback&, ShowNamesExport> ShowNamesExportCaller;
-ShowNamesExportCaller g_show_names_caller;
-ToggleItem g_show_names( g_show_names_caller );
+// Names
void ShowNamesToggle(){
GlobalEntityCreator().setShowNames( !GlobalEntityCreator().getShowNames() );
- g_show_names.update();
XY_UpdateAllWindows();
}
-void ShowTargetNamesExport( const BoolImportCallback& importer ){
- importer( GlobalEntityCreator().getShowTargetNames() );
+typedef FreeCaller<void(), ShowNamesToggle> ShowNamesToggleCaller;
+
+void ShowNamesExport( const Callback<void(bool)> & importer ){
+ importer( GlobalEntityCreator().getShowNames() );
}
-typedef FreeCaller1<const BoolImportCallback&, ShowTargetNamesExport> ShowTargetNamesExportCaller;
-ShowTargetNamesExportCaller g_show_targetnames_caller;
-ToggleItem g_show_targetnames( g_show_targetnames_caller );
+
+typedef FreeCaller<void(const Callback<void(bool)> &), ShowNamesExport> ShowNamesExportCaller;
+
++// TargetNames
+ void ShowTargetNamesToggle(){
+ GlobalEntityCreator().setShowTargetNames( !GlobalEntityCreator().getShowTargetNames() );
- g_show_targetnames.update();
+ XY_UpdateAllWindows();
+ }
+
-void ShowAnglesExport( const BoolImportCallback& importer ){
- importer( GlobalEntityCreator().getShowAngles() );
++typedef FreeCaller<void(), ShowTargetNamesToggle> ShowTargetNamesToggleCaller;
++
++void ShowTargetNamesExport( const Callback<void(bool)> & importer ){
++ importer( GlobalEntityCreator().getShowTargetNames() );
+ }
-typedef FreeCaller1<const BoolImportCallback&, ShowAnglesExport> ShowAnglesExportCaller;
-ShowAnglesExportCaller g_show_angles_caller;
-ToggleItem g_show_angles( g_show_angles_caller );
++
++typedef FreeCaller<void(const Callback<void(bool)> &), ShowTargetNamesExport> ShowTargetNamesExportCaller;
++
+// Angles
void ShowAnglesToggle(){
GlobalEntityCreator().setShowAngles( !GlobalEntityCreator().getShowAngles() );
- g_show_angles.update();
XY_UpdateAllWindows();
}
}
*/
-BoolExportCaller g_show_size_caller( g_xywindow_globals_private.m_bSizePaint );
-ToggleItem g_show_size_item( g_show_size_caller );
-void ToggleShowSizeInfo(){
+// Size
+void ShowSizeToggle(){
g_xywindow_globals_private.m_bSizePaint = !g_xywindow_globals_private.m_bSizePaint;
- g_show_size_item.update();
XY_UpdateAllWindows();
}
+typedef FreeCaller<void(), ShowSizeToggle> ShowSizeToggleCaller;
+void ShowSizeExport( const Callback<void(bool)> & importer ){
+ importer( g_xywindow_globals_private.m_bSizePaint );
+}
+typedef FreeCaller<void(const Callback<void(bool)> &), ShowSizeExport> ShowSizeExportCaller;
-BoolExportCaller g_show_crosshair_caller( g_bCrossHairs );
-ToggleItem g_show_crosshair_item( g_show_crosshair_caller );
-void ToggleShowCrosshair(){
- g_bCrossHairs ^= 1;
- g_show_crosshair_item.update();
+// Crosshair
+void ShowCrosshairToggle(){
+ g_xywindow_globals_private.g_bCrossHairs ^= 1;
XY_UpdateAllWindows();
}
+typedef FreeCaller<void(), ShowCrosshairToggle> ShowCrosshairToggleCaller;
+void ShowCrosshairExport( const Callback<void(bool)> & importer ){
+ importer( g_xywindow_globals_private.g_bCrossHairs );
+}
+typedef FreeCaller<void(const Callback<void(bool)> &), ShowCrosshairExport> ShowCrosshairExportCaller;
-BoolExportCaller g_show_grid_caller( g_xywindow_globals_private.d_showgrid );
-ToggleItem g_show_grid_item( g_show_grid_caller );
-void ToggleShowGrid(){
+// Grid
+void ShowGridToggle(){
g_xywindow_globals_private.d_showgrid = !g_xywindow_globals_private.d_showgrid;
- g_show_grid_item.update();
XY_UpdateAllWindows();
}
+typedef FreeCaller<void(), ShowGridToggle> ShowGridToggleCaller;
+void ShowGridTExport( const Callback<void(bool)> & importer ){
+ importer( g_xywindow_globals_private.d_showgrid );
+}
+typedef FreeCaller<void(const Callback<void(bool)> &), ShowSizeExport> ShowGridExportCaller;
+
+
+ShowNamesExportCaller g_show_names_caller;
+Callback<void(const Callback<void(bool)> &)> g_show_names_callback( g_show_names_caller );
+ToggleItem g_show_names( g_show_names_callback );
+
++ShowTargetNamesExportCaller g_show_targetnames_caller;
++Callback<void(const Callback<void(bool)> &)> g_show_targetnames_callback( g_show_targetnames_caller );
++ToggleItem g_show_targetnames( g_show_targetnames_callback );
++
+ShowAnglesExportCaller g_show_angles_caller;
+Callback<void(const Callback<void(bool)> &)> g_show_angles_callback( g_show_angles_caller );
+ToggleItem g_show_angles( g_show_angles_callback );
+
+ShowBlocksExportCaller g_show_blocks_caller;
+Callback<void(const Callback<void(bool)> &)> g_show_blocks_callback( g_show_blocks_caller );
+ToggleItem g_show_blocks( g_show_blocks_callback );
+
+ShowCoordinatesExportCaller g_show_coordinates_caller;
+Callback<void(const Callback<void(bool)> &)> g_show_coordinates_callback( g_show_coordinates_caller );
+ToggleItem g_show_coordinates( g_show_coordinates_callback );
+
+ShowOutlineExportCaller g_show_outline_caller;
+Callback<void(const Callback<void(bool)> &)> g_show_outline_callback( g_show_outline_caller );
+ToggleItem g_show_outline( g_show_outline_callback );
+
+ShowAxesExportCaller g_show_axes_caller;
+Callback<void(const Callback<void(bool)> &)> g_show_axes_callback( g_show_axes_caller );
+ToggleItem g_show_axes( g_show_axes_callback );
+
+ShowWorkzoneExportCaller g_show_workzone_caller;
+Callback<void(const Callback<void(bool)> &)> g_show_workzone_callback( g_show_workzone_caller );
+ToggleItem g_show_workzone( g_show_workzone_callback );
+
+ShowSizeExportCaller g_show_size_caller;
+Callback<void(const Callback<void(bool)> &)> g_show_size_callback( g_show_size_caller );
+ToggleItem g_show_size( g_show_size_callback );
+
+ShowCrosshairExportCaller g_show_crosshair_caller;
+Callback<void(const Callback<void(bool)> &)> g_show_crosshair_callback( g_show_crosshair_caller );
+ToggleItem g_show_crosshair( g_show_crosshair_callback );
+
+ShowGridExportCaller g_show_grid_caller;
+Callback<void(const Callback<void(bool)> &)> g_show_grid_callback( g_show_grid_caller );
+ToggleItem g_show_grid( g_show_grid_callback );
void XYShow_registerCommands(){
- GlobalToggles_insert( "ToggleSizePaint", FreeCaller<ToggleShowSizeInfo>(), ToggleItem::AddCallbackCaller( g_show_size_item ), Accelerator( 'J' ) );
- GlobalToggles_insert( "ToggleCrosshairs", FreeCaller<ToggleShowCrosshair>(), ToggleItem::AddCallbackCaller( g_show_crosshair_item ), Accelerator( 'X', (GdkModifierType)GDK_SHIFT_MASK ) );
- GlobalToggles_insert( "ToggleGrid", FreeCaller<ToggleShowGrid>(), ToggleItem::AddCallbackCaller( g_show_grid_item ), Accelerator( '0' ) );
+ GlobalToggles_insert( "ToggleSizePaint", ShowSizeToggleCaller(), ToggleItem::AddCallbackCaller( g_show_size ), Accelerator( 'J' ) );
+ GlobalToggles_insert( "ToggleCrosshairs", ShowCrosshairToggleCaller(), ToggleItem::AddCallbackCaller( g_show_crosshair ), Accelerator( 'X', (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalToggles_insert( "ToggleGrid", ShowGridToggleCaller(), ToggleItem::AddCallbackCaller( g_show_grid ), Accelerator( '0' ) );
- GlobalToggles_insert( "ShowAngles", FreeCaller<ShowAnglesToggle>(), ToggleItem::AddCallbackCaller( g_show_angles ) );
- GlobalToggles_insert( "ShowNames", FreeCaller<ShowNamesToggle>(), ToggleItem::AddCallbackCaller( g_show_names ) );
- GlobalToggles_insert( "ShowTargetNames", FreeCaller<ShowTargetNamesToggle>(), ToggleItem::AddCallbackCaller( g_show_targetnames ) );
- GlobalToggles_insert( "ShowBlocks", FreeCaller<ShowBlocksToggle>(), ToggleItem::AddCallbackCaller( g_show_blocks ) );
- GlobalToggles_insert( "ShowCoordinates", FreeCaller<ShowCoordinatesToggle>(), ToggleItem::AddCallbackCaller( g_show_coordinates ) );
- GlobalToggles_insert( "ShowWindowOutline", FreeCaller<ShowOutlineToggle>(), ToggleItem::AddCallbackCaller( g_show_outline ) );
- GlobalToggles_insert( "ShowAxes", FreeCaller<ShowAxesToggle>(), ToggleItem::AddCallbackCaller( g_show_axes ) );
- GlobalToggles_insert( "ShowWorkzone", FreeCaller<ShowWorkzoneToggle>(), ToggleItem::AddCallbackCaller( g_show_workzone ) );
+ GlobalToggles_insert( "ShowAngles", ShowAnglesToggleCaller(), ToggleItem::AddCallbackCaller( g_show_angles ) );
+ GlobalToggles_insert( "ShowNames", ShowNamesToggleCaller(), ToggleItem::AddCallbackCaller( g_show_names ) );
++ GlobalToggles_insert( "ShowTargetNames", ShowTargetNamesToggleCaller(), ToggleItem::AddCallbackCaller( g_show_targetnames ) );
+ GlobalToggles_insert( "ShowBlocks", ShowBlocksToggleCaller(), ToggleItem::AddCallbackCaller( g_show_blocks ) );
+ GlobalToggles_insert( "ShowCoordinates", ShowCoordinatesToggleCaller(), ToggleItem::AddCallbackCaller( g_show_coordinates ) );
+ GlobalToggles_insert( "ShowWindowOutline", ShowOutlineToggleCaller(), ToggleItem::AddCallbackCaller( g_show_outline ) );
+ GlobalToggles_insert( "ShowAxes", ShowAxesToggleCaller(), ToggleItem::AddCallbackCaller( g_show_axes ) );
+ GlobalToggles_insert( "ShowWorkzone", ShowWorkzoneToggleCaller(), ToggleItem::AddCallbackCaller( g_show_workzone ) );
}
void XYWnd_registerShortcuts(){