]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - contrib/prtview/AboutDialog.cpp
Wrap GTK
[xonotic/netradiant.git] / contrib / prtview / AboutDialog.cpp
index 5f3943630864762be387a1b7e25787b16205e218..c90c319fc9391f63a9fa9a3266bfd937bc508a16 100644 (file)
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-// AboutDialog.cpp : implementation file
-//
+#include "AboutDialog.h"
+#include <gtk/gtk.h>
+#include <gtkutil/pointer.h>
+#include <uilib/uilib.h>
+#include "version.h"
+#include "gtkutil/pointer.h"
 
-#include "stdafx.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-//static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// CAboutDialog dialog
+#include "prtview.h"
+#include "ConfigDialog.h"
 
 static void dialog_button_callback( GtkWidget *widget, gpointer data ){
        GtkWidget *parent;
@@ -40,7 +36,7 @@ static void dialog_button_callback( GtkWidget *widget, gpointer data ){
        ret = (int*)g_object_get_data( G_OBJECT( parent ), "ret" );
 
        *loop = 0;
-       *ret = (int)data;
+       *ret = gpointer_to_int( data );
 }
 
 static gint dialog_delete_callback( GtkWidget *widget, GdkEvent* event, gpointer data ){
@@ -57,40 +53,39 @@ void DoAboutDlg(){
        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 );
-       gtk_signal_connect( GTK_OBJECT( dlg ), "destroy",
-                                               GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL );
+       g_signal_connect( GTK_OBJECT( dlg ), "delete_event",
+                                         G_CALLBACK( dialog_delete_callback ), NULL );
+       g_signal_connect( GTK_OBJECT( dlg ), "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 );
 
-       hbox = gtk_hbox_new( FALSE, 10 );
+       hbox = ui::HBox( FALSE, 10 );
        gtk_widget_show( hbox );
        gtk_container_add( GTK_CONTAINER( dlg ), hbox );
        gtk_container_set_border_width( GTK_CONTAINER( hbox ), 10 );
 
-       label = gtk_label_new( "Version 1.000\n\n"
+       char const *label_text = "Version 1.000\n\n"
                                                   "Gtk port by Leonardo Zide\nleo@lokigames.com\n\n"
                                                   "Written by Geoffrey DeWan\ngdewan@prairienet.org\n\n"
-                                                  "Built against GtkRadiant " RADIANT_VERSION "\n"
-                                                  __DATE__
-                                                  );
+                                                  "Built against NetRadiant " RADIANT_VERSION "\n"
+                                                  __DATE__;
        gtk_widget_show( label );
        gtk_box_pack_start( GTK_BOX( hbox ), label, TRUE, TRUE, 0 );
        gtk_label_set_justify( GTK_LABEL( label ), GTK_JUSTIFY_LEFT );
 
-       vbox = gtk_vbox_new( FALSE, 0 );
+       vbox = ui::VBox( FALSE, 0 );
        gtk_widget_show( vbox );
        gtk_box_pack_start( GTK_BOX( hbox ), vbox, FALSE, FALSE, 0 );
 
-       button = gtk_button_new_with_label( "OK" );
+       button = ui::Button( "OK" );
        gtk_widget_show( button );
        gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
-       gtk_signal_connect( GTK_OBJECT( button ), "clicked",
-                                               GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
-       gtk_widget_set_usize( button, 60, -2 );
+       g_signal_connect( GTK_OBJECT( button ), "clicked",
+                                               G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
+       gtk_widget_set_size_request( button, 60, -1 );
 
        gtk_grab_add( dlg );
        gtk_widget_show( dlg );
@@ -102,5 +97,6 @@ void DoAboutDlg(){
        gtk_widget_destroy( dlg );
 }
 
+
 /////////////////////////////////////////////////////////////////////////////
 // CAboutDialog message handlers