//
#include "preferences.h"
+#include "globaldefs.h"
#include <gtk/gtk.h>
#include "environment.h"
}
void Interface_constructPreferences( PreferencesPage& page ){
-#ifdef WIN32
+#if GDEF_OS_WINDOWS
page.appendCheckBox( "", "Default Text Editor", g_TextEditor_useWin32Editor );
#else
{
frame.add(vbox2);
{
- PreferencesPage preferencesPage( *this, ui::Widget(GTK_WIDGET( vbox2 )) );
+ PreferencesPage preferencesPage( *this, ui::Widget(vbox2 ) );
Global_constructPreferences( preferencesPage );
CreateGlobalFrame( preferencesPage );
}
static void OnButtonClean( ui::Widget widget, gpointer data ){
// make sure this is what the user wants
- if ( ui::Widget(GTK_WIDGET( g_Preferences.GetWidget() )).alert( "This will close Radiant and clean the corresponding registry entries.\n"
+ if ( ui::Widget(g_Preferences.GetWidget( )).alert( "This will close Radiant and clean the corresponding registry entries.\n"
"Next time you start Radiant it will be good as new. Do you wish to continue?",
"Reset Registry", ui::alert_type::YESNO, ui::alert_icon::Asterisk ) == ui::alert_response::YES ) {
PrefsDlg *dlg = (PrefsDlg*)data;
ui::Window dialog = ui::Window(create_floating_window( "NetRadiant Preferences", m_parent ));
{
- ui::Widget mainvbox = ui::VBox( FALSE, 5 );
+ auto mainvbox = ui::VBox( FALSE, 5 );
dialog.add(mainvbox);
gtk_container_set_border_width( GTK_CONTAINER( mainvbox ), 5 );
mainvbox.show();
{
- ui::Widget hbox = ui::HBox( FALSE, 5 );
+ auto hbox = ui::HBox( FALSE, 5 );
hbox.show();
- gtk_box_pack_end( GTK_BOX( mainvbox ), hbox, FALSE, TRUE, 0 );
+ mainvbox.pack_end(hbox, FALSE, TRUE, 0);
{
- GtkButton* button = create_dialog_button( "OK", G_CALLBACK( dialog_button_ok ), &m_modal );
- gtk_box_pack_end( GTK_BOX( hbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 );
+ auto button = create_dialog_button( "OK", G_CALLBACK( dialog_button_ok ), &m_modal );
+ hbox.pack_end(button, FALSE, FALSE, 0);
}
{
- GtkButton* button = create_dialog_button( "Cancel", G_CALLBACK( dialog_button_cancel ), &m_modal );
- gtk_box_pack_end( GTK_BOX( hbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 );
+ auto button = create_dialog_button( "Cancel", G_CALLBACK( dialog_button_cancel ), &m_modal );
+ hbox.pack_end(button, FALSE, FALSE, 0);
}
{
- GtkButton* button = create_dialog_button( "Clean", G_CALLBACK( OnButtonClean ), this );
- gtk_box_pack_end( GTK_BOX( hbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 );
+ auto button = create_dialog_button( "Clean", G_CALLBACK( OnButtonClean ), this );
+ hbox.pack_end(button, FALSE, FALSE, 0);
}
}
{
- ui::Widget hbox = ui::HBox( FALSE, 5 );
- gtk_box_pack_start( GTK_BOX( mainvbox ), hbox, TRUE, TRUE, 0 );
+ auto hbox = ui::HBox( FALSE, 5 );
+ mainvbox.pack_start( hbox, TRUE, TRUE, 0 );
hbox.show();
{
auto sc_win = ui::ScrolledWindow(ui::New);
gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( sc_win ), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC );
- gtk_box_pack_start( GTK_BOX( hbox ), sc_win, FALSE, FALSE, 0 );
+ hbox.pack_start( sc_win, FALSE, FALSE, 0 );
sc_win.show();
gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW( sc_win ), GTK_SHADOW_IN );
m_notebook = ui::Widget(gtk_notebook_new());
// hide the notebook tabs since its not supposed to look like a notebook
gtk_notebook_set_show_tabs( GTK_NOTEBOOK( m_notebook ), FALSE );
- gtk_box_pack_start( GTK_BOX( hbox ), m_notebook, TRUE, TRUE, 0 );
+ hbox.pack_start( m_notebook, TRUE, TRUE, 0 );
m_notebook.show();
void RegisterPreferences( PreferenceSystem& preferences ){
-#ifdef WIN32
+#if GDEF_OS_WINDOWS
preferences.registerPreference( "UseCustomShaderEditor", BoolImportStringCaller( g_TextEditor_useWin32Editor ), BoolExportStringCaller( g_TextEditor_useWin32Editor ) );
#else
preferences.registerPreference( "UseCustomShaderEditor", BoolImportStringCaller( g_TextEditor_useCustomEditor ), BoolExportStringCaller( g_TextEditor_useCustomEditor ) );