int loop = 1;
auto window = ui::Window( ui::window_type::TOP );
- window.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
+ gtk_window_set_transient_for( GTK_WINDOW( window ), GTK_WINDOW( g_pRadiantWnd ) );
+ window.connect( "delete_event", G_CALLBACK( custom_dialog_delete_callback ), NULL );
window.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_title( window, lpCaption );
gtk_container_set_border_width( GTK_CONTAINER( window ), 10 );
int loop = 1;
auto window = ui::Window( ui::window_type::TOP );
+ gtk_window_set_transient_for( GTK_WINDOW( window ), GTK_WINDOW( g_pRadiantWnd ) );
- window.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
+ window.connect( "delete_event", G_CALLBACK( custom_dialog_delete_callback ), NULL );
window.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
gtk_window_set_title( window, "Polygon Builder" );
EMessageBoxReturn ret;
int loop = 1;
- auto window = ui::Window( ui::window_type::TOP );
+ auto window = main_window.create_dialog_window( "Texture Reset", G_CALLBACK( custom_dialog_delete_callback ), &dialog );
+ gtk_window_set_transient_for( GTK_WINDOW( window ), GTK_WINDOW( g_pRadiantWnd ) );
+ gtk_window_set_modal( GTK_WINDOW( window ), TRUE );
- window.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
window.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
- gtk_window_set_title( window, "Texture Reset" );
gtk_container_set_border_width( GTK_CONTAINER( window ), 10 );
g_object_set_data( G_OBJECT( window ), "loop", &loop );
#include "debugging/debugging.h"
#include "callbacks.h"
#include "support.h"
+#include "gtkutil/dialog.h"
+ #include "plugin.h"
#define GLADE_HOOKUP_OBJECT( component,widget,name ) \
g_object_set_data_full( G_OBJECT( component ), name, \
g_object_set_data( G_OBJECT( component ), name, (void *) widget )
// created by glade
-ui::Widget create_w_plugplug2( void ){
+ui::Widget create_w_plugplug2( ui::Window main_window ){
GSList *r_collapse_group = NULL;
+ ModalDialog dialog;
- auto w_plugplug2 = ui::Window( ui::window_type::TOP );
+ auto w_plugplug2 = main_window.create_dialog_window( "BrushExport", G_CALLBACK( dialog_delete_callback ), &dialog );
gtk_widget_set_name( w_plugplug2, "w_plugplug2" );
- gtk_window_set_title( w_plugplug2, "BrushExport-Plugin 3.0 by namespace" );
+ gtk_window_set_position( GTK_WINDOW( w_plugplug2 ), GTK_WIN_POS_CENTER_ON_PARENT );
+ gtk_window_set_transient_for( GTK_WINDOW( w_plugplug2 ), GTK_WINDOW( g_pRadiantWnd ) );
gtk_window_set_destroy_with_parent( w_plugplug2, TRUE );
auto vbox1 = ui::VBox( FALSE, 0 );
#if !defined( INCLUDED_BRUSH_EXPORT_H )
#define INCLUDED_BRUSH_EXPORT_H
+ #include <uilib/uilib.h>
+
+#define PLUGIN_NAME "BrushExport"
+#define PLUGIN_VERSION "2.0"
+
+ extern ui::Widget g_pRadiantWnd;
+
#endif
clr.green = (guint16) (GetBValue(*c) * (65535 / 255));
auto dlg = ui::Widget::from(gtk_color_selection_dialog_new( "Choose Color" ));
- gtk_window_set_transient_for( GTK_WINDOW( dlg ), config_dialog );
-
+ gtk_window_set_transient_for( GTK_WINDOW( dlg ), GTK_WINDOW( g_pRadiantWnd ) );
+ gtk_window_set_position( GTK_WINDOW( dlg ),GTK_WIN_POS_CENTER_ON_PARENT );
+ gtk_window_set_modal( GTK_WINDOW( dlg ), TRUE );
gtk_color_selection_set_current_color( GTK_COLOR_SELECTION( gtk_color_selection_dialog_get_color_selection(GTK_COLOR_SELECTION_DIALOG(dlg)) ), &clr );
dlg.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
dlg.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
SceneChangeNotify();
}
-void DoConfigDialog(){
+void DoConfigDialog( ui::Window main_window ){
int loop = 1, ret = IDCANCEL;
+ ModalDialog dialog;
- auto dlg = main_window.create_dialog_window( "Portal Viewer Configuration", G_CALLBACK( custom_dialog_delete_callback ), &dialog );
-
- dlg.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
+ auto dlg = ui::Window( ui::window_type::TOP );
-
- gtk_window_set_transient_for( GTK_WINDOW( dlg ), GTK_WINDOW( g_pRadiantWnd ) );
- gtk_window_set_position( GTK_WINDOW( dlg ),GTK_WIN_POS_CENTER_ON_PARENT );
- gtk_window_set_modal( GTK_WINDOW( dlg ), TRUE );
-
+ gtk_window_set_title( dlg, "Portal Viewer Configuration" );
+ dlg.connect( "delete_event",
+ G_CALLBACK( dialog_delete_callback ), NULL );
+ dlg.connect( "destroy",
+ G_CALLBACK( gtk_widget_destroy ), NULL );
g_object_set_data( G_OBJECT( dlg ), "loop", &loop );
g_object_set_data( G_OBJECT( dlg ), "ret", &ret );
- config_dialog = dlg;
auto vbox = ui::VBox( FALSE, 5 );
vbox.show();
Q3R_CMD_LOAD;
+ ui::Widget g_pRadiantWnd{ui::null};
const char* QERPlug_Init( void *hApp, void* pMainWidget ){
- return "Portal Viewer for Q3Radiant";
+ g_pRadiantWnd = ui::Window::from(pMainWidget);
+ main_window = ui::Window::from(pMainWidget);
+ ASSERT_TRUE( main_window );
+
+ return PLUGIN_NAME " for " RADIANT_NAME;
}
const char* QERPlug_GetName(){
#if !defined( INCLUDED_PRTVIEW_H )
#define INCLUDED_PRTVIEW_H
-#define MSG_PREFIX "Portal Viewer plugin: "
+ #include <uilib/uilib.h>
+
+#define PLUGIN_NAME "Portal Viewer"
+#define PLUGIN_VERSION "1.0"
+
+#define MSG_PREFIX PLUGIN_NAME " plugin: "
void InitInstance();
void SaveConfig();
create_game_help_menu( menu );
create_menu_item_with_mnemonic( menu, "Bug report", makeCallbackF(OpenBugReportURL) );
- create_menu_item_with_mnemonic( menu, "Shortcuts list", makeCallbackF(DoCommandListDlg) );
+ create_menu_item_with_mnemonic( menu, "Shortcuts", makeCallbackF(DoCommandListDlg) );
- create_menu_item_with_mnemonic( menu, "_About", makeCallbackF(DoAbout) );
+ create_menu_item_with_mnemonic( menu, "_About...", makeCallbackF(DoAbout) );
return help_menu_item;
}
return FALSE;
}
-
void XYWnd_CameraMoved( XYWnd& xywnd ){
- if ( g_xywindow_globals_private.m_bCamXYUpdate ) {
+ // if ( g_xywindow_globals_private.m_bCamXYUpdate ) {
//XYWnd_Update( xywnd );
xywnd.UpdateCameraIcon();
- }
+ // }
}
XYWnd::XYWnd() :