EMessageBoxReturn ret;
int loop = 1;
- window = ui::Widget(gtk_window_new( GTK_WINDOW_TOPLEVEL ));
+ window = ui::Window( ui::window_type::TOP );
gtk_signal_connect( GTK_OBJECT( window ), "delete_event",
GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( window ), "destroy",
EMessageBoxReturn ret;
int loop = 1;
- window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+ window = ui::Window( ui::window_type::TOP );
gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL );
EMessageBoxReturn ret;
int loop = 1;
- window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+ window = ui::Window( ui::window_type::TOP );
gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL );
const gchar *text = "Please set a value in the boxes below and press 'OK' to build the stairs";
- window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+ window = ui::Window( ui::window_type::TOP );
gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL );
EMessageBoxReturn ret;
int loop = 1;
- window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+ window = ui::Window( ui::window_type::TOP );
gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL );
EMessageBoxReturn ret;
int loop = 1;
- window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+ window = ui::Window( ui::window_type::TOP );
gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL );
EMessageBoxReturn ret;
int loop = 1;
- window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+ window = ui::Window( ui::window_type::TOP );
gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL );
EMessageBoxReturn ret;
int loop = 1;
- window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+ window = ui::Window( ui::window_type::TOP );
gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL );
EMessageBoxReturn ret;
int loop = 1;
- window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+ window = ui::Window( ui::window_type::TOP );
gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL );
const gchar *text = "Please set a value in the boxes below and press 'OK' to make a chain";
- window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+ window = ui::Window( ui::window_type::TOP );
gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL );
tooltips = gtk_tooltips_new();
- w_plugplug2 = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+ w_plugplug2 = ui::Window( ui::window_type::TOP );
gtk_widget_set_name( w_plugplug2, "w_plugplug2" );
gtk_window_set_title( GTK_WINDOW( w_plugplug2 ), "BrushExport-Plugin 3.0 by namespace" );
gtk_window_set_position( GTK_WINDOW( w_plugplug2 ), GTK_WIN_POS_CENTER );
// char buf[128];
// create the window
- window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+ window = ui::Window( ui::window_type::TOP );
gtk_window_set_title( GTK_WINDOW( window ), "New Camera" );
gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL );
}
// create the window
- window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+ window = ui::Window( ui::window_type::TOP );
gtk_window_set_title( GTK_WINDOW( window ), "Rename Path" );
gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL );
}
// create the window
- window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+ window = ui::Window( ui::window_type::TOP );
gtk_window_set_title( GTK_WINDOW( window ), "Add Target" );
gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL );
}
// create the window
- window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+ window = ui::Window( ui::window_type::TOP );
gtk_window_set_title( GTK_WINDOW( window ), "Add Event" );
gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL );
GtkWidget *window, *w, *vbox, *hbox, *table, *frame;
// create the window
- window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+ window = ui::Window( ui::window_type::TOP );
gtk_window_set_title( GTK_WINDOW( window ), "Camera Inspector" );
gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( ci_close ), NULL );
gtk_signal_connect( GTK_OBJECT( window ), "expose_event", GTK_SIGNAL_FUNC( ci_expose ), NULL );
const char *orientations[] = { "Ground surface", "Ceiling", "Wall facing 0", "Wall facing 90",
"Wall facing 180","Wall facing 270" };
- g_pWnd = dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+ g_pWnd = dlg = ui::Window( ui::window_type::TOP );
gtk_window_set_title( GTK_WINDOW( dlg ), gszCaption );
g_signal_connect( G_OBJECT( dlg ), "delete_event", G_CALLBACK( main_close ), NULL );
// g_signal_connect (G_OBJECT (dlg), "destroy", G_CALLBACK (gtk_widget_destroy), NULL);
azimuth = PI / 6.;
#endif
- g_pWndPreview = dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+ g_pWndPreview = dlg = ui::Window( ui::window_type::TOP );
gtk_window_set_title( GTK_WINDOW( dlg ), "GtkGenSurf Preview" );
gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event", GTK_SIGNAL_FUNC( preview_close ), NULL );
gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL );
GtkWidget *window, *w, *vbox, *hbox;
int mode = ( uType & MB_TYPEMASK ), ret, loop = 1;
- window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+ window = ui::Window( ui::window_type::TOP );
gtk_signal_connect( GTK_OBJECT( window ), "delete_event",
GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( window ), "destroy",
GtkWidget *dlg, *hbox, *vbox, *button, *label;
int loop = 1, ret = IDCANCEL;
- dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+ dlg = ui::Window( ui::window_type::TOP );
gtk_window_set_title( GTK_WINDOW( dlg ), "About Portal Viewer" );
gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event",
GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL );
GtkWidget *show2check, *show3check, *portalcheck;
int loop = 1, ret = IDCANCEL;
- dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+ dlg = ui::Window( ui::window_type::TOP );
gtk_window_set_title( GTK_WINDOW( dlg ), "Portal Viewer Configuration" );
gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event",
GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL );
GtkWidget *dlg, *vbox, *hbox, *button, *entry, *check2d, *check3d;
int loop = 1, ret = IDCANCEL;
- dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+ dlg = ui::Window( ui::window_type::TOP );
gtk_window_set_title( GTK_WINDOW( dlg ), "Load .prt" );
gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event",
GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL );
void about_plugin_window(){
GtkWidget *window, *vbox, *label, *button;
- window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); // create a window
+ window = ui::Window( ui::window_type::TOP ); // create a window
gtk_window_set_transient_for( GTK_WINDOW( window ), SunPlug::main_window ); // make the window to stay in front of the main window
g_signal_connect( G_OBJECT( window ), "delete_event", G_CALLBACK( delete_event ), NULL ); // connect the delete event
g_signal_connect( G_OBJECT( window ), "destroy", G_CALLBACK( destroy ), NULL ); // connect the destroy event for the window
char line[20];
// in any case we need a window to show the user what to do
- window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); // create the window
+ window = ui::Window( ui::window_type::TOP ); // create the window
gtk_window_set_transient_for( GTK_WINDOW( window ), SunPlug::main_window ); // make the window to stay in front of the main window
g_signal_connect( G_OBJECT( window ), "delete_event", G_CALLBACK( delete_event ), NULL ); // connect the delete event for the window
g_signal_connect( G_OBJECT( window ), "destroy", G_CALLBACK( destroy ), NULL ); // connect the destroy event for the window
}
GtkWindow* create_floating_window( const char* title, GtkWindow* parent ){
- GtkWindow* window = GTK_WINDOW( gtk_window_new( GTK_WINDOW_TOPLEVEL ) );
+ GtkWindow* window = ui::Window( ui::window_type::TOP );
gtk_window_set_title( window, title );
if ( parent != 0 ) {
return ::file_dialog(*this, open, title, path, pattern, want_load, want_import, want_save);
}
+ Window::Window(window_type type)
+ : Window(GTK_WINDOW(gtk_window_new(
+ type == window_type::TOP ? GTK_WINDOW_TOPLEVEL :
+ type == window_type::POPUP ? GTK_WINDOW_POPUP :
+ GTK_WINDOW_TOPLEVEL)))
+ { };
+
Window Window::create_dialog_window(const char *title, void func(), void *data, int default_w, int default_h)
{
return Window(::create_dialog_window(*this, title, func, data, default_w, default_h));
NO,
};
+ enum class window_type {
+ TOP,
+ POPUP
+ };
+
template<class Self, class T, bool implicit = true>
struct Convertible;
WRAP(Window, Widget, ui_window,
Window() : Window(nullptr) {};
+ Window(window_type type);
Window create_dialog_window(const char *title, void func(), void *data, int default_w = -1,
int default_h = -1);
GtkWidget *window, *w, *vbox, *hbox;
int mode = ( uType & MB_TYPEMASK ), ret, loop = 1;
- window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+ window = ui::Window( ui::window_type::TOP );
gtk_signal_connect( GTK_OBJECT( window ), "delete_event",
GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL );
gtk_signal_connect( GTK_OBJECT( window ), "destroy",
ASSERT_MESSAGE( m_window, "dialog cannot be destroyed" );
gtk_widget_destroy( GTK_WIDGET( m_window ) );
- m_window = ui::Window(nullptr);
+ m_window = ui::Window();
}
ui::Widget dlg;
ui::Widget vbox, hbox, button, scr, text;
- dlg = ui::Widget(gtk_window_new( GTK_WINDOW_TOPLEVEL ));
+ dlg = ui::Window( ui::window_type::TOP );
g_signal_connect( G_OBJECT( dlg ), "delete_event",
G_CALLBACK( editor_delete ), 0 );
ui::Window create_splash(){
- ui::Window window = ui::Window(GTK_WINDOW( gtk_window_new( GTK_WINDOW_TOPLEVEL ) ));
+ ui::Window window = ui::Window( ui::window_type::TOP );
gtk_window_set_decorated( window, FALSE );
gtk_window_set_resizable( window, FALSE );
gtk_window_set_modal( window, TRUE );
}
void MainFrame::Create(){
- ui::Window window = ui::Window(GTK_WINDOW( gtk_window_new( GTK_WINDOW_TOPLEVEL ) ));
+ ui::Window window = ui::Window( ui::window_type::TOP );
GlobalWindowObservers_connectTopLevel( window );