#include "gtkutil/widget.h"
#include "gtkutil/glwidget.h"
#include "gtkutil/filechooser.h"
+#include "gtkutil/cursor.h"
#include "gtkmisc.h"
#include "select.h"
#include "csg.h"
bool show_blocks;
int blockSize;
- bool m_bCamXYUpdate;
+// bool m_bCamXYUpdate;
bool m_bChaseMouse;
bool m_bSizePaint;
show_names( false ),
show_coordinates( false ),
show_angles( true ),
- show_outline( false ),
+ show_outline( true ),
show_axis( true ),
d_show_work( false ),
show_blocks( false ),
- m_bCamXYUpdate( true ),
+// m_bCamXYUpdate( true ),
m_bChaseMouse( true ),
m_bSizePaint( true ),
}
}
+void XYWnd::Redraw() {
+ if ( glwidget_make_current( m_gl_widget ) != FALSE ) {
+ if ( Map_Valid( g_map ) && ScreenUpdates_Enabled() ) {
+ GlobalOpenGL_debugAssertNoErrors();
+ XY_Draw();
+ GlobalOpenGL_debugAssertNoErrors();
+
+ m_XORRectangle.set( rectangle_t() );
+ }
+ glwidget_swap_buffers( m_gl_widget );
+ }
+}
+
VIEWTYPE GlobalXYWnd_getCurrentViewType(){
ASSERT_NOTNULL( g_pParentWnd );
ASSERT_NOTNULL( g_pParentWnd->ActiveXY() );
}
gboolean xywnd_expose( ui::Widget widget, GdkEventExpose* event, XYWnd* xywnd ){
- if ( glwidget_make_current( xywnd->GetWidget() ) != FALSE ) {
- if ( Map_Valid( g_map ) && ScreenUpdates_Enabled() ) {
- GlobalOpenGL_debugAssertNoErrors();
- xywnd->XY_Draw();
- GlobalOpenGL_debugAssertNoErrors();
-
- xywnd->m_XORRectangle.set( rectangle_t() );
- }
- glwidget_swap_buffers( xywnd->GetWidget() );
- }
+ xywnd->Redraw();
return FALSE;
}
-
void XYWnd_CameraMoved( XYWnd& xywnd ){
- if ( g_xywindow_globals_private.m_bCamXYUpdate ) {
- XYWnd_Update( xywnd );
- }
+// if ( g_xywindow_globals_private.m_bCamXYUpdate ) {
+ //XYWnd_Update( xywnd );
+ xywnd.UpdateCameraIcon();
+// }
}
XYWnd::XYWnd() :
m_window_observer( NewWindowObserver() ),
m_XORRectangle( m_gl_widget ),
m_chasemouse_handler( 0 ){
+
m_bActive = false;
m_buttonstate = 0;
Map_addValidCallback( g_map, DeferredDrawOnMapValidChangedCaller( m_deferredDraw ) );
- updateProjection();
- updateModelview();
+ // This reconstruct=false argument is used to avoid a circular dependency
+ // between modelview and projection initialization and a valgrind complaint
+ updateProjection( false );
+ updateModelview( false );
+ m_view.Construct( m_projection, m_modelview, m_nWidth, m_nHeight );
AddSceneChangeCallback( ReferenceCaller<XYWnd, void(), &XYWnd_Update>( *this ) );
AddCameraMovedCallback( ReferenceCaller<XYWnd, void(), &XYWnd_CameraMoved>( *this ) );
Vector3 mousePosition;
XY_ToPoint( x, y, mousePosition );
if ( ClipMode() && GlobalClipPoints_Find( mousePosition, (VIEWTYPE)m_viewType, m_fScale ) != 0 ) {
- GdkCursor *cursor;
- cursor = gdk_cursor_new( GDK_CROSSHAIR );
- gdk_window_set_cursor( gtk_widget_get_window(m_gl_widget), cursor );
- gdk_cursor_unref( cursor );
+ set_cursor ( m_gl_widget, GDK_CROSSHAIR );
}
else
{
- gdk_window_set_cursor( gtk_widget_get_window(m_gl_widget), 0 );
+ default_cursor( m_gl_widget );
}
}
}
unsigned int MoveCamera_buttons(){
- return RAD_CONTROL | ( g_glwindow_globals.m_nMouseType == ETwoButton ? RAD_RBUTTON : RAD_MBUTTON );
+// return RAD_CONTROL | ( g_glwindow_globals.m_nMouseType == ETwoButton ? RAD_RBUTTON : RAD_MBUTTON );
+ return RAD_CONTROL | RAD_MBUTTON;
}
void XYWnd_PositionCamera( XYWnd* xywnd, int x, int y, CamWnd& camwnd ){
}
unsigned int OrientCamera_buttons(){
- if ( g_glwindow_globals.m_nMouseType == ETwoButton ) {
- return RAD_RBUTTON | RAD_SHIFT | RAD_CONTROL;
- }
+// if ( g_glwindow_globals.m_nMouseType == ETwoButton ) {
+// return RAD_RBUTTON | RAD_SHIFT | RAD_CONTROL;
+// }
return RAD_MBUTTON;
}
void XYWnd_OrientCamera( XYWnd* xywnd, int x, int y, CamWnd& camwnd ){
+ //globalOutputStream() << Camera_getAngles( camwnd ) << " b4\n";
Vector3 point = g_vector3_identity;
xywnd->XY_ToPoint( x, y, point );
- xywnd->XY_SnapToGrid( point );
+ //xywnd->XY_SnapToGrid( point );
vector3_subtract( point, Camera_getOrigin( camwnd ) );
int n1 = ( xywnd->GetViewType() == XY ) ? 1 : 2;
if ( point[n1] || point[n2] ) {
Vector3 angles( Camera_getAngles( camwnd ) );
angles[nAngle] = static_cast<float>( radians_to_degrees( atan2( point[n1], point[n2] ) ) );
+ if( angles[CAMERA_YAW] < 0 )
+ angles[CAMERA_YAW] = angles[CAMERA_YAW] + 360;
+ if ( nAngle == CAMERA_PITCH ){
+ if( fabs( angles[CAMERA_PITCH] ) > 90 ){
+ angles[CAMERA_PITCH] = ( angles[CAMERA_PITCH] > 0 ) ? ( -angles[CAMERA_PITCH] + 180 ) : ( -angles[CAMERA_PITCH] - 180 );
+ if( xywnd->GetViewType() == YZ ){
+ if( angles[CAMERA_YAW] < 180 ){
+ angles[CAMERA_YAW] = 360 - angles[CAMERA_YAW];
+ }
+ }
+ else if( angles[CAMERA_YAW] < 90 || angles[CAMERA_YAW] > 270 ){
+ angles[CAMERA_YAW] = 180 - angles[CAMERA_YAW];
+ }
+ }
+ else{
+ if( xywnd->GetViewType() == YZ ){
+ if( angles[CAMERA_YAW] > 180 ){
+ angles[CAMERA_YAW] = 360 - angles[CAMERA_YAW];
+ }
+ }
+ else if( angles[CAMERA_YAW] > 90 && angles[CAMERA_YAW] < 270 ){
+ angles[CAMERA_YAW] = 180 - angles[CAMERA_YAW];
+ }
+ }
+ }
Camera_setAngles( camwnd, angles );
}
+ //globalOutputStream() << Camera_getAngles( camwnd ) << "\n";
}
unsigned int SetCustomPivotOrigin_buttons(){
g_pParentWnd->ActiveXY()->OnEntityCreate( entity_name );
}
else {
- GlobalRadiant().m_pfnMessageBox( MainFrame_getWindow(), "There's already a worldspawn in your map!"
- "",
+ GlobalRadiant().m_pfnMessageBox( MainFrame_getWindow(),
+ "There's already a worldspawn in your map!",
"Info",
eMB_OK,
eMB_ICONDEFAULT );
};
void XYWnd::OnContextMenu(){
- if ( g_xywindow_globals.m_bRightClick == false ) {
- return;
- }
+// if ( g_xywindow_globals.m_bRightClick == false ) {
+// return;
+// }
if ( !m_mnuDrop ) { // first time, load it up
auto menu = m_mnuDrop = ui::Menu(ui::New);
Move_End();
}
m_move_started = true;
- g_xywnd_freezePointer.freeze_pointer( m_parent ? m_parent : MainFrame_getWindow(), m_gl_widget, XYWnd_moveDelta, this );
+ /* NetRadiantCustom did this instead:
+ g_xywnd_freezePointer.freeze_pointer( m_parent ? m_parent : MainFrame_getWindow(), m_gl_widget, XYWnd_moveDelta, this ); */
+ g_xywnd_freezePointer.freeze_pointer( m_gl_widget, XYWnd_moveDelta, this );
m_move_focusOut = m_gl_widget.connect( "focus_out_event", G_CALLBACK( XYWnd_Move_focusOut ), this );
}
void XYWnd::Move_End(){
m_move_started = false;
- g_xywnd_freezePointer.unfreeze_pointer( m_parent ? m_parent : MainFrame_getWindow(), false );
+ /* NetRadiant did this instead:
+ g_xywnd_freezePointer.unfreeze_pointer( m_parent ? m_parent : MainFrame_getWindow(), false ); */
+ g_xywnd_freezePointer.unfreeze_pointer( m_gl_widget, false );
g_signal_handler_disconnect( G_OBJECT( m_gl_widget ), m_move_focusOut );
}
}
m_zoom_started = true;
g_dragZoom = 0;
- g_xywnd_freezePointer.freeze_pointer( m_parent ? m_parent : MainFrame_getWindow(), m_gl_widget, XYWnd_zoomDelta, this );
+ /* NetRadiantCustom did this instead:
+ g_xywnd_freezePointer.freeze_pointer( m_parent ? m_parent : MainFrame_getWindow(), m_gl_widget, XYWnd_zoomDelta, this ); */
+ g_xywnd_freezePointer.freeze_pointer( m_parent ? m_parent : MainFrame_getWindow(), XYWnd_zoomDelta, this );
m_zoom_focusOut = m_gl_widget.connect( "focus_out_event", G_CALLBACK( XYWnd_Zoom_focusOut ), this );
}
}
// control mbutton = move camera
- else if ( getButtonState() == MoveCamera_buttons() ) {
+ else if ( buttons == MoveCamera_buttons() ) {
XYWnd_PositionCamera( this, x, y, *g_pParentWnd->GetCamWnd() );
}
// mbutton = angle camera
- else if ( getButtonState() == OrientCamera_buttons() ) {
+ else if ( buttons == OrientCamera_buttons() ) {
XYWnd_OrientCamera( this, x, y, *g_pParentWnd->GetCamWnd() );
}
void WXY_BackgroundSelect( void ){
bool brushesSelected = Scene_countSelectedBrushes( GlobalSceneGraph() ) != 0;
+
+ ui::Window main_window = MainFrame_getWindow();
+
if ( !brushesSelected ) {
- ui::alert( ui::root, "You have to select some brushes to get the bounding box for.\n",
+ ui::alert( main_window, "You have to select some brushes to get the bounding box for.\n",
"No selection", ui::alert_type::OK, ui::alert_icon::Error );
return;
}
- const char *filename = MainFrame_getWindow().file_dialog( TRUE, "Background Image", NULL, NULL );
+ const char *filename = main_window.file_dialog( TRUE, "Background Image", NULL, NULL );
+
g_pParentWnd->ActiveXY()->XY_DisableBackground();
+
if ( filename ) {
g_pParentWnd->ActiveXY()->XY_LoadBackgroundImage( filename );
}
+
+ // Draw the background image immediately (do not wait for user input).
+ g_pParentWnd->ActiveXY()->Redraw();
}
/*
}
void XYWnd::DrawCameraIcon( const Vector3& origin, const Vector3& angles ){
- float x, y, fov, box;
- double a;
-
- fov = 48 / m_fScale;
- box = 16 / m_fScale;
+ Cam.fov = 48 / m_fScale;
+ Cam.box = 16 / m_fScale;
+// globalOutputStream() << "pitch " << angles[CAMERA_PITCH] << " yaw " << angles[CAMERA_YAW] << "\n";
if ( m_viewType == XY ) {
- x = origin[0];
- y = origin[1];
- a = degrees_to_radians( angles[CAMERA_YAW] );
+ Cam.x = origin[0];
+ Cam.y = origin[1];
+ Cam.a = degrees_to_radians( angles[CAMERA_YAW] );
}
else if ( m_viewType == YZ ) {
- x = origin[1];
- y = origin[2];
- a = degrees_to_radians( angles[CAMERA_PITCH] );
+ Cam.x = origin[1];
+ Cam.y = origin[2];
+ Cam.a = degrees_to_radians( ( angles[CAMERA_YAW] > 180 ) ? ( 180.0f - angles[CAMERA_PITCH] ) : angles[CAMERA_PITCH] );
}
else
{
- x = origin[0];
- y = origin[2];
- a = degrees_to_radians( angles[CAMERA_PITCH] );
+ Cam.x = origin[0];
+ Cam.y = origin[2];
+ Cam.a = degrees_to_radians( ( angles[CAMERA_YAW] < 270 && angles[CAMERA_YAW] > 90 ) ? ( 180.0f - angles[CAMERA_PITCH] ) : angles[CAMERA_PITCH] );
}
- glColor3f( 0.0, 0.0, 1.0 );
+ //glColor3f( 0.0, 0.0, 1.0 );
+ glColor3f( 1.0, 1.0, 1.0 );
glBegin( GL_LINE_STRIP );
- glVertex3f( x - box,y,0 );
- glVertex3f( x,y + ( box / 2 ),0 );
- glVertex3f( x + box,y,0 );
- glVertex3f( x,y - ( box / 2 ),0 );
- glVertex3f( x - box,y,0 );
- glVertex3f( x + box,y,0 );
+ glVertex3f( Cam.x - Cam.box,Cam.y,0 );
+ glVertex3f( Cam.x,Cam.y + ( Cam.box / 2 ),0 );
+ glVertex3f( Cam.x + Cam.box,Cam.y,0 );
+ glVertex3f( Cam.x,Cam.y - ( Cam.box / 2 ),0 );
+ glVertex3f( Cam.x - Cam.box,Cam.y,0 );
+ glVertex3f( Cam.x + Cam.box,Cam.y,0 );
glEnd();
glBegin( GL_LINE_STRIP );
- glVertex3f( x + static_cast<float>( fov * cos( a + c_pi / 4 ) ), y + static_cast<float>( fov * sin( a + c_pi / 4 ) ), 0 );
- glVertex3f( x, y, 0 );
- glVertex3f( x + static_cast<float>( fov * cos( a - c_pi / 4 ) ), y + static_cast<float>( fov * sin( a - c_pi / 4 ) ), 0 );
+ glVertex3f( Cam.x + static_cast<float>( Cam.fov * cos( Cam.a + c_pi / 4 ) ), Cam.y + static_cast<float>( Cam.fov * sin( Cam.a + c_pi / 4 ) ), 0 );
+ glVertex3f( Cam.x, Cam.y, 0 );
+ glVertex3f( Cam.x + static_cast<float>( Cam.fov * cos( Cam.a - c_pi / 4 ) ), Cam.y + static_cast<float>( Cam.fov * sin( Cam.a - c_pi / 4 ) ), 0 );
glEnd();
}
+void XYWnd::UpdateCameraIcon( void ){
+ if ( glwidget_make_current( m_gl_widget ) != FALSE ) {
+ if ( Map_Valid( g_map ) && ScreenUpdates_Enabled() ) {
+ GlobalOpenGL_debugAssertNoErrors();
+ glDrawBuffer( GL_FRONT );
+ {
+ // clear
+ glViewport( 0, 0, m_nWidth, m_nHeight );
+ // set up viewpoint
+ glMatrixMode( GL_PROJECTION );
+ glLoadMatrixf( reinterpret_cast<const float*>( &m_projection ) );
+
+ glMatrixMode( GL_MODELVIEW );
+ glLoadIdentity();
+ glScalef( m_fScale, m_fScale, 1 );
+ int nDim1 = ( m_viewType == YZ ) ? 1 : 0;
+ int nDim2 = ( m_viewType == XY ) ? 1 : 2;
+ glTranslatef( -m_vOrigin[nDim1], -m_vOrigin[nDim2], 0 );
+
+ glDisable( GL_LINE_STIPPLE );
+ glDisableClientState( GL_TEXTURE_COORD_ARRAY );
+ glDisableClientState( GL_NORMAL_ARRAY );
+ glDisableClientState( GL_COLOR_ARRAY );
+ glDisable( GL_TEXTURE_2D );
+ glDisable( GL_LIGHTING );
+ glDisable( GL_COLOR_MATERIAL );
+ glDisable( GL_DEPTH_TEST );
+ glDisable( GL_TEXTURE_1D );
+
+ glEnable( GL_BLEND );
+ glBlendFunc( GL_ONE_MINUS_DST_COLOR, GL_ZERO );
+
+ //glColor3f( 0.0, 0.0, 1.0 );
+ glColor3f( 1.0, 1.0, 1.0 );
+ glBegin( GL_LINE_STRIP );
+ glVertex3f( Cam.x - Cam.box,Cam.y,0 );
+ glVertex3f( Cam.x,Cam.y + ( Cam.box / 2 ),0 );
+ glVertex3f( Cam.x + Cam.box,Cam.y,0 );
+ glVertex3f( Cam.x,Cam.y - ( Cam.box / 2 ),0 );
+ glVertex3f( Cam.x - Cam.box,Cam.y,0 );
+ glVertex3f( Cam.x + Cam.box,Cam.y,0 );
+ glEnd();
+
+ glBegin( GL_LINE_STRIP );
+ glVertex3f( Cam.x + static_cast<float>( Cam.fov * cos( Cam.a + c_pi / 4 ) ), Cam.y + static_cast<float>( Cam.fov * sin( Cam.a + c_pi / 4 ) ), 0 );
+ glVertex3f( Cam.x, Cam.y, 0 );
+ glVertex3f( Cam.x + static_cast<float>( Cam.fov * cos( Cam.a - c_pi / 4 ) ), Cam.y + static_cast<float>( Cam.fov * sin( Cam.a - c_pi / 4 ) ), 0 );
+ glEnd();
+
+ XYWnd::DrawCameraIcon( Camera_getOrigin( *g_pParentWnd->GetCamWnd() ), Camera_getAngles( *g_pParentWnd->GetCamWnd() ) );
+
+ glDisable( GL_BLEND );
+ glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
+ }
+
+ glDrawBuffer( GL_BACK );
+ GlobalOpenGL_debugAssertNoErrors();
+ glwidget_make_current( m_gl_widget );
+ }
+ }
+}
+
float Betwixt( float f1, float f2 ){
if ( f1 > f2 ) {
Shader* m_state_selected;
};
-void XYWnd::updateProjection(){
+void XYWnd::updateProjection( bool reconstruct ){
m_projection[0] = 1.0f / static_cast<float>( m_nWidth / 2 );
m_projection[5] = 1.0f / static_cast<float>( m_nHeight / 2 );
m_projection[10] = 1.0f / ( g_MaxWorldCoord * m_fScale );
m_projection[15] = 1.0f;
+ if (reconstruct) {
m_view.Construct( m_projection, m_modelview, m_nWidth, m_nHeight );
}
+}
// note: modelview matrix must have a uniform scale, otherwise strange things happen when rendering the rotation manipulator.
-void XYWnd::updateModelview(){
+void XYWnd::updateModelview( bool reconstruct ){
int nDim1 = ( m_viewType == YZ ) ? 1 : 0;
int nDim2 = ( m_viewType == XY ) ? 1 : 2;
m_modelview[3] = m_modelview[7] = m_modelview[11] = 0;
m_modelview[15] = 1;
+ if (reconstruct) {
m_view.Construct( m_projection, m_modelview, m_nWidth, m_nHeight );
+ }
}
/*
glScalef( m_fScale, m_fScale, 1 );
glTranslatef( -m_vOrigin[nDim1], -m_vOrigin[nDim2], 0 );
+ glEnable( GL_BLEND );
+ glBlendFunc( GL_ONE_MINUS_DST_COLOR, GL_ZERO );
DrawCameraIcon( Camera_getOrigin( *g_pParentWnd->GetCamWnd() ), Camera_getAngles( *g_pParentWnd->GetCamWnd() ) );
+ glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
+ glDisable( GL_BLEND );
Feedback_draw2D( m_viewType );
}
void XY_Focus(){
- if ( g_pParentWnd->CurrentStyle() == MainFrame::eSplit ) {
+ if ( g_pParentWnd->CurrentStyle() == MainFrame::eSplit || g_pParentWnd->CurrentStyle() == MainFrame::eFloating ) {
// cannot do this in a split window
// do something else that the user may want here
XY_Split_Focus();
XYWnd_Focus( xywnd );
}
-void XY_Top(){
- if ( g_pParentWnd->CurrentStyle() == MainFrame::eSplit || g_pParentWnd->CurrentStyle() == MainFrame::eFloating ) {
+void XY_TopFrontSide( VIEWTYPE viewtype ){
+ if ( g_pParentWnd->CurrentStyle() == MainFrame::eSplit ) {
// cannot do this in a split window
// do something else that the user may want here
XY_Split_Focus();
return;
}
-
- XYWnd* xywnd = g_pParentWnd->GetXYWnd();
- xywnd->SetViewType( XY );
+ XYWnd* xywnd = g_pParentWnd->CurrentStyle() == MainFrame::eFloating ? g_pParentWnd->ActiveXY() : g_pParentWnd->GetXYWnd();
+ xywnd->SetViewType( viewtype );
XYWnd_Focus( xywnd );
}
-void XY_Side(){
- if ( g_pParentWnd->CurrentStyle() == MainFrame::eSplit || g_pParentWnd->CurrentStyle() == MainFrame::eFloating ) {
- // cannot do this in a split window
- // do something else that the user may want here
- XY_Split_Focus();
- return;
- }
+void XY_Top(){
+ XY_TopFrontSide( XY );
+}
- XYWnd* xywnd = g_pParentWnd->GetXYWnd();
- xywnd->SetViewType( XZ );
- XYWnd_Focus( xywnd );
+void XY_Side(){
+ XY_TopFrontSide( XZ );
}
void XY_Front(){
- if ( g_pParentWnd->CurrentStyle() == MainFrame::eSplit || g_pParentWnd->CurrentStyle() == MainFrame::eFloating ) {
- // cannot do this in a split window
- // do something else that the user may want here
- XY_Split_Focus();
- return;
- }
-
- XYWnd* xywnd = g_pParentWnd->GetXYWnd();
- xywnd->SetViewType( YZ );
- XYWnd_Focus( xywnd );
+ XY_TopFrontSide( YZ );
}
-void XY_Next(){
- if ( g_pParentWnd->CurrentStyle() == MainFrame::eSplit || g_pParentWnd->CurrentStyle() == MainFrame::eFloating ) {
- // cannot do this in a split window
- // do something else that the user may want here
- XY_Split_Focus();
- return;
- }
-
- XYWnd* xywnd = g_pParentWnd->GetXYWnd();
+void XY_NextView( XYWnd* xywnd ){
if ( xywnd->GetViewType() == XY ) {
xywnd->SetViewType( XZ );
}
XYWnd_Focus( xywnd );
}
+void XY_Next(){
+ if ( g_pParentWnd->CurrentStyle() == MainFrame::eSplit ) {
+ // cannot do this in a split window
+ // do something else that the user may want here
+ XY_Split_Focus();
+ return;
+ }
+ XYWnd* xywnd = g_pParentWnd->CurrentStyle() == MainFrame::eFloating ? g_pParentWnd->ActiveXY() : g_pParentWnd->GetXYWnd();
+ XY_NextView( xywnd );
+}
+
void XY_Zoom100(){
if ( g_pParentWnd->GetXYWnd() ) {
g_pParentWnd->GetXYWnd()->SetScale( 1 );
// Names
void ShowNamesToggle(){
GlobalEntityCreator().setShowNames( !GlobalEntityCreator().getShowNames() );
-// g_show_names.update();
XY_UpdateAllWindows();
}
// Angles
void ShowAnglesToggle(){
GlobalEntityCreator().setShowAngles( !GlobalEntityCreator().getShowAngles() );
-// g_show_angles.update();
XY_UpdateAllWindows();
}
// Blocks
void ShowBlocksToggle(){
g_xywindow_globals_private.show_blocks ^= 1;
-// g_show_blocks.update();
XY_UpdateAllWindows();
}
// Coordinates
void ShowCoordinatesToggle(){
g_xywindow_globals_private.show_coordinates ^= 1;
-// g_show_coordinates.update();
XY_UpdateAllWindows();
}
// Outlines
void ShowOutlineToggle(){
g_xywindow_globals_private.show_outline ^= 1;
-// g_show_outline.update();
XY_UpdateAllWindows();
}
// Axes
void ShowAxesToggle(){
g_xywindow_globals_private.show_axis ^= 1;
-// g_show_axes.update();
XY_UpdateAllWindows();
}
typedef FreeCaller<void(), ShowAxesToggle> ShowAxesToggleCaller;
// Workzone
void ShowWorkzoneToggle(){
g_xywindow_globals_private.d_show_work ^= 1;
-// g_show_workzone.update();
XY_UpdateAllWindows();
}
typedef FreeCaller<void(), ShowWorkzoneToggle> ShowWorkzoneToggleCaller;
// 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;
// Crosshair
void ShowCrosshairToggle(){
- g_bCrossHairs ^= 1;
-// g_show_crosshair_item.update();
+ g_xywindow_globals_private.g_bCrossHairs ^= 1;
XY_UpdateAllWindows();
}
typedef FreeCaller<void(), ShowCrosshairToggle> ShowCrosshairToggleCaller;
void ShowCrosshairExport( const Callback<void(bool)> & importer ){
- importer( g_bCrossHairs );
+ importer( g_xywindow_globals_private.g_bCrossHairs );
}
typedef FreeCaller<void(const Callback<void(bool)> &), ShowCrosshairExport> ShowCrosshairExportCaller;
// 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(), ShowGridTToggle> ShowGridTToggleCaller;
+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> ShowSizeExportCaller;
+typedef FreeCaller<void(const Callback<void(bool)> &), ShowSizeExport> ShowGridExportCaller;
ShowNamesExportCaller g_show_names_caller;
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", ShowAnglesToggleCaller(), ToggleItem::AddCallbackCaller( g_show_angles ) );
GlobalToggles_insert( "ShowNames", ShowNamesToggleCaller(), ToggleItem::AddCallbackCaller( g_show_names ) );
page.appendCheckBox( "", "Solid selection boxes ( no stipple )", g_xywindow_globals.m_bNoStipple );
//page.appendCheckBox( "", "Display size info", g_xywindow_globals_private.m_bSizePaint );
page.appendCheckBox( "", "Chase mouse during drags", g_xywindow_globals_private.m_bChaseMouse );
- page.appendCheckBox( "", "Update views on camera move", g_xywindow_globals_private.m_bCamXYUpdate );
+// page.appendCheckBox( "", "Update views on camera move", g_xywindow_globals_private.m_bCamXYUpdate );
}
void Orthographic_constructPage( PreferenceGroup& group ){
PreferencesPage page( group.createPage( "Orthographic", "Orthographic View Preferences" ) );
GlobalPreferenceSystem().registerPreference( "ClipCaulk", make_property_string( g_clip_useCaulk ) );
- GlobalPreferenceSystem().registerPreference( "NewRightClick", make_property_string( g_xywindow_globals.m_bRightClick ) );
+// GlobalPreferenceSystem().registerPreference( "NewRightClick", make_property_string( g_xywindow_globals.m_bRightClick ) );
GlobalPreferenceSystem().registerPreference( "ImprovedWheelZoom", make_property_string( g_xywindow_globals.m_bImprovedWheelZoom ) );
GlobalPreferenceSystem().registerPreference( "ChaseMouse", make_property_string( g_xywindow_globals_private.m_bChaseMouse ) );
GlobalPreferenceSystem().registerPreference( "SizePainting", make_property_string( g_xywindow_globals_private.m_bSizePaint ) );
GlobalPreferenceSystem().registerPreference( "SI_ShowCoords", make_property_string( g_xywindow_globals_private.show_coordinates ) );
GlobalPreferenceSystem().registerPreference( "SI_ShowOutlines", make_property_string( g_xywindow_globals_private.show_outline ) );
GlobalPreferenceSystem().registerPreference( "SI_ShowAxis", make_property_string( g_xywindow_globals_private.show_axis ) );
- GlobalPreferenceSystem().registerPreference( "CamXYUpdate", make_property_string( g_xywindow_globals_private.m_bCamXYUpdate ) );
+// GlobalPreferenceSystem().registerPreference( "CamXYUpdate", make_property_string( g_xywindow_globals_private.m_bCamXYUpdate ) );
GlobalPreferenceSystem().registerPreference( "ShowWorkzone", make_property_string( g_xywindow_globals_private.d_show_work ) );
GlobalPreferenceSystem().registerPreference( "SI_AxisColors0", make_property_string( g_xywindow_globals.AxisColorX ) );