{
auto frame = create_framed_widget( TextureBrowser_constructWindow( GroupDialog_getWindow() ) );
g_page_textures = GroupDialog_addPage( "Textures", frame, TextureBrowserExportTitleCaller() );
-
-#ifndef GARUX_GTK_WORKAROUND
- /* workaround for gtk 2.24 issue: not displayed glwidget after toggle */
- g_object_set_data( G_OBJECT( GroupDialog_getWindow() ), "glwidget", TextureBrowser_getGLWidget() );
-#endif
+ WORKAROUND_GOBJECT_SET_GLWIDGET( GroupDialog_getWindow(), TextureBrowser_getGLWidget() );
}
+ // FIXME: find a way to do it with newer syntax
+ // m_vSplit = 0;
+ // m_hSplit = 0;
+ // m_vSplit2 = 0;
+
GroupDialog_show();
}
- else // 4 way
+ else if ( CurrentStyle() == eSplit )
{
m_pCamWnd = NewCamWnd();
GlobalCamera_setCamWnd( *m_pCamWnd );
{
auto frame = create_framed_widget( TextureBrowser_constructWindow( GroupDialog_getWindow() ) );
g_page_textures = GroupDialog_addPage( "Textures", frame, TextureBrowserExportTitleCaller() );
-#ifndef GARUX_GTK_WORKAROUND
- /* workaround for gtk 2.24 issue: not displayed glwidget after toggle */
- g_object_set_data( G_OBJECT( GroupDialog_getWindow() ), "glwidget", TextureBrowser_getGLWidget() );
-#endif
+
+ WORKAROUND_GOBJECT_SET_GLWIDGET( window, TextureBrowser_getGLWidget() );
}
}
- ui::Widget split = create_split_views( camera, yz, xy, xz );
+ else // single window
+ {
+ m_pCamWnd = NewCamWnd();
+ GlobalCamera_setCamWnd( *m_pCamWnd );
+ CamWnd_setParent( *m_pCamWnd, window );
+
+ ui::Widget camera = CamWnd_getWidget( *m_pCamWnd );
+
+ m_pYZWnd = new XYWnd();
+ m_pYZWnd->SetViewType( YZ );
+
+ ui::Widget yz = m_pYZWnd->GetWidget();
+
+ m_pXYWnd = new XYWnd();
+ m_pXYWnd->SetViewType( XY );
+
+ ui::Widget xy = m_pXYWnd->GetWidget();
+
+ m_pXZWnd = new XYWnd();
+ m_pXZWnd->SetViewType( XZ );
+
+ ui::Widget xz = m_pXZWnd->GetWidget();
+
+ ui::Widget hsplit = ui::HPaned(ui::New);
+ vbox.pack_start( hsplit, TRUE, TRUE, 0 );
+ hsplit.show();
+
- gtk_paned_add1( GTK_PANED( hsplit ), split );
++ /* Before merging NetRadiantCustom:
++ ui::Widget split = create_split_views( camera, yz, xy, xz ); */
++ m_hSplit = create_split_views( camera, yz, xy, xz, m_vSplit, m_vSplit2 );
+
+ ui::Widget vsplit = ui::VPaned(ui::New);
+ vsplit.show();
+
+ // textures
+ ui::Widget texture_window = create_framed_widget( TextureBrowser_constructWindow( window ) );
+
+ // console
+ ui::Widget console_window = create_framed_widget( Console_constructWindow( window ) );
+
++ /* Before merging NetRadiantCustom:
++ gtk_paned_add1( GTK_PANED( hsplit ), m_hSplit );
+ gtk_paned_add2( GTK_PANED( hsplit ), vsplit );
+
+ gtk_paned_add1( GTK_PANED( vsplit ), texture_window );
+ gtk_paned_add2( GTK_PANED( vsplit ), console_window );
++ */
++
++ gtk_paned_pack1( GTK_PANED( hsplit ), m_hSplit, TRUE, TRUE );
++ gtk_paned_pack2( GTK_PANED( hsplit ), vsplit, TRUE, TRUE);
++
++ gtk_paned_pack1( GTK_PANED( vsplit ), texture_window, TRUE, TRUE );
++ gtk_paned_pack2( GTK_PANED( vsplit ), console_window, TRUE, TRUE );
+
+ hsplit.connect( "size_allocate", G_CALLBACK( hpaned_allocate ), &g_single_hpaned );
+ hsplit.connect( "notify::position", G_CALLBACK( paned_position ), &g_single_hpaned );
+
+ vsplit.connect( "size_allocate", G_CALLBACK( vpaned_allocate ), &g_single_vpaned );
+ vsplit.connect( "notify::position", G_CALLBACK( paned_position ), &g_single_vpaned );
+ }
EntityList_constructWindow( window );
PreferencesDialog_constructWindow( window );
}
}
-
+ class MaximizeView
+ {
+ public:
+ MaximizeView(): m_maximized( false ){
+ }
+ void toggle(){
+ return m_maximized ? restore() : maximize();
+ }
+ private:
+ bool m_maximized;
+ int m_vSplitPos;
+ int m_vSplit2Pos;
+ int m_hSplitPos;
+
+ void restore(){
+ m_maximized = false;
+ gtk_paned_set_position( GTK_PANED( g_pParentWnd->m_vSplit ), m_vSplitPos );
+ gtk_paned_set_position( GTK_PANED( g_pParentWnd->m_vSplit2 ), m_vSplit2Pos );
+ gtk_paned_set_position( GTK_PANED( g_pParentWnd->m_hSplit ), m_hSplitPos );
+ }
+
+ void maximize(){
+ m_maximized = true;
+ m_vSplitPos = gtk_paned_get_position( GTK_PANED( g_pParentWnd->m_vSplit ) );
+ m_vSplit2Pos = gtk_paned_get_position( GTK_PANED( g_pParentWnd->m_vSplit2 ) );
+ m_hSplitPos = gtk_paned_get_position( GTK_PANED( g_pParentWnd->m_hSplit ) );
+
+ int vSplitX, vSplitY, vSplit2X, vSplit2Y, hSplitX, hSplitY;
+ gdk_window_get_origin( GTK_WIDGET( g_pParentWnd->m_vSplit )->window, &vSplitX, &vSplitY );
+ gdk_window_get_origin( GTK_WIDGET( g_pParentWnd->m_vSplit2 )->window, &vSplit2X, &vSplit2Y );
+ gdk_window_get_origin( GTK_WIDGET( g_pParentWnd->m_hSplit )->window, &hSplitX, &hSplitY );
+
+ vSplitY += m_vSplitPos;
+ vSplit2Y += m_vSplit2Pos;
+ hSplitX += m_hSplitPos;
+
+ int cur_x, cur_y;
+ Sys_GetCursorPos( MainFrame_getWindow(), &cur_x, &cur_y );
+
+ if( cur_x > hSplitX ){
+ gtk_paned_set_position( GTK_PANED( g_pParentWnd->m_hSplit ), 0 );
+ }
+ else{
+ gtk_paned_set_position( GTK_PANED( g_pParentWnd->m_hSplit ), 9999 );
+ }
+ if( cur_y > vSplitY ){
+ gtk_paned_set_position( GTK_PANED( g_pParentWnd->m_vSplit ), 0 );
+ }
+ else{
+ gtk_paned_set_position( GTK_PANED( g_pParentWnd->m_vSplit ), 9999 );
+ }
+ if( cur_y > vSplit2Y ){
+ gtk_paned_set_position( GTK_PANED( g_pParentWnd->m_vSplit2 ), 0 );
+ }
+ else{
+ gtk_paned_set_position( GTK_PANED( g_pParentWnd->m_vSplit2 ), 9999 );
+ }
+ }
+ };
+
+ MaximizeView g_maximizeview;
+
+ void Maximize_View(){
+ if( g_pParentWnd != 0 && g_pParentWnd->m_vSplit != 0 && g_pParentWnd->m_vSplit2 != 0 && g_pParentWnd->m_hSplit != 0 )
+ g_maximizeview.toggle();
+ }
+
#include "preferencesystem.h"
#include "stringio.h"
+#include "transformpath/transformpath.h"
void MainFrame_Construct(){
GlobalCommands_insert( "OpenManual", makeCallbackF(OpenHelpURL), Accelerator( GDK_KEY_F1 ) );
GlobalCommands_insert( "ColorSchemeQER", makeCallbackF(ColorScheme_QER) );
GlobalCommands_insert( "ColorSchemeBlackAndGreen", makeCallbackF(ColorScheme_Black) );
GlobalCommands_insert( "ColorSchemeYdnar", makeCallbackF(ColorScheme_Ydnar) );
- GlobalCommands_insert("ColorSchemeAdwaitaDark", makeCallbackF(ColorScheme_AdwaitaDark));
++ GlobalCommands_insert( "ColorSchemeAdwaitaDark", makeCallbackF(ColorScheme_AdwaitaDark));
GlobalCommands_insert( "ChooseTextureBackgroundColor", makeCallback( g_ColoursMenu.m_textureback ) );
GlobalCommands_insert( "ChooseGridBackgroundColor", makeCallback( g_ColoursMenu.m_xyback ) );
GlobalCommands_insert( "ChooseGridMajorColor", makeCallback( g_ColoursMenu.m_gridmajor ) );