2 PrtView plugin for GtkRadiant
\r
3 Copyright (C) 2001 Geoffrey Dewan, Loki software and qeradiant.com
\r
5 This library is free software; you can redistribute it and/or
\r
6 modify it under the terms of the GNU Lesser General Public
\r
7 License as published by the Free Software Foundation; either
\r
8 version 2.1 of the License, or (at your option) any later version.
\r
10 This library is distributed in the hope that it will be useful,
\r
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
\r
13 Lesser General Public License for more details.
\r
15 You should have received a copy of the GNU Lesser General Public
\r
16 License along with this library; if not, write to the Free Software
\r
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
\r
20 // AboutDialog.cpp : implementation file
\r
26 #define new DEBUG_NEW
\r
28 //static char THIS_FILE[] = __FILE__;
\r
31 /////////////////////////////////////////////////////////////////////////////
\r
32 // CAboutDialog dialog
\r
36 static void dialog_button_callback (GtkWidget *widget, gpointer data)
\r
41 parent = gtk_widget_get_toplevel (widget);
\r
42 loop = (int*)g_object_get_data (G_OBJECT (parent), "loop");
\r
43 ret = (int*)g_object_get_data (G_OBJECT (parent), "ret");
\r
49 static gint dialog_delete_callback (GtkWidget *widget, GdkEvent* event, gpointer data)
\r
53 gtk_widget_hide (widget);
\r
54 loop = (int*)g_object_get_data (G_OBJECT (widget), "loop");
\r
62 GtkWidget *dlg, *hbox, *vbox, *button, *label;
\r
63 int loop = 1, ret = IDCANCEL;
\r
65 dlg = gtk_window_new (GTK_WINDOW_TOPLEVEL);
\r
66 gtk_window_set_title (GTK_WINDOW (dlg), "About Portal Viewer");
\r
67 gtk_signal_connect (GTK_OBJECT (dlg), "delete_event",
\r
68 GTK_SIGNAL_FUNC (dialog_delete_callback), NULL);
\r
69 gtk_signal_connect (GTK_OBJECT (dlg), "destroy",
\r
70 GTK_SIGNAL_FUNC (gtk_widget_destroy), NULL);
\r
71 g_object_set_data (G_OBJECT (dlg), "loop", &loop);
\r
72 g_object_set_data (G_OBJECT (dlg), "ret", &ret);
\r
74 hbox = gtk_hbox_new (FALSE, 10);
\r
75 gtk_widget_show (hbox);
\r
76 gtk_container_add (GTK_CONTAINER (dlg), hbox);
\r
77 gtk_container_set_border_width (GTK_CONTAINER (hbox), 10);
\r
79 label = gtk_label_new ("Version 1.000\n\n"
\r
80 "Gtk port by Leonardo Zide\nleo@lokigames.com\n\n"
\r
81 "Written by Geoffrey DeWan\ngdewan@prairienet.org\n\n"
\r
82 "Built against GtkRadiant " RADIANT_VERSION "\n"
\r
85 gtk_widget_show (label);
\r
86 gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
\r
87 gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
\r
89 vbox = gtk_vbox_new (FALSE, 0);
\r
90 gtk_widget_show (vbox);
\r
91 gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 0);
\r
93 button = gtk_button_new_with_label ("OK");
\r
94 gtk_widget_show (button);
\r
95 gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
\r
96 gtk_signal_connect (GTK_OBJECT (button), "clicked",
\r
97 GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK));
\r
98 gtk_widget_set_usize (button, 60, -2);
\r
100 gtk_grab_add (dlg);
\r
101 gtk_widget_show (dlg);
\r
104 gtk_main_iteration ();
\r
106 gtk_grab_remove (dlg);
\r
107 gtk_widget_destroy (dlg);
\r
110 #else // GTK_PLUGIN
\r
112 CAboutDialog::CAboutDialog(CWnd* pParent /*=NULL*/)
\r
113 : CDialog(CAboutDialog::IDD, pParent)
\r
115 //{{AFX_DATA_INIT(CAboutDialog)
\r
116 // NOTE: the ClassWizard will add member initialization here
\r
121 void CAboutDialog::DoDataExchange(CDataExchange* pDX)
\r
123 CDialog::DoDataExchange(pDX);
\r
124 //{{AFX_DATA_MAP(CAboutDialog)
\r
125 // NOTE: the ClassWizard will add DDX and DDV calls here
\r
130 BEGIN_MESSAGE_MAP(CAboutDialog, CDialog)
\r
131 //{{AFX_MSG_MAP(CAboutDialog)
\r
132 // NOTE: the ClassWizard will add message map macros here
\r
136 #endif // GTK_PLUGIN
\r
138 /////////////////////////////////////////////////////////////////////////////
\r
139 // CAboutDialog message handlers
\r