File: dialog.h

package info (click to toggle)
groundhog 1.1-8
  • links: PTS
  • area: main
  • in suites: potato
  • size: 320 kB
  • ctags: 327
  • sloc: cpp: 1,816; makefile: 106; sh: 18
file content (45 lines) | stat: -rw-r--r-- 1,501 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/* Groundhog -- a simple logic game
 * Copyright (C) 1998 Maurits Rijk
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

#ifndef _DIALOG_H
#define _DIALOG_H

#include <gtk/gtk.h>

class Dialog {
   static gint DeleteCB(GtkWidget *widget, GdkEvent *event, gpointer data);
   static void OkCB(GtkWidget *widget, gpointer data);
   static void CancelCB(GtkWidget *widget, gpointer data);
protected:
   GtkWidget*	_window;

   virtual void OnCancel();
   virtual void OnOk() {}

   void SetSize(gint width, gint height) {
      gtk_widget_set_usize(GTK_WIDGET(_window), width, height);}
   void SetTitle(const char* title) {
      gtk_window_set_title(GTK_WINDOW(_window), title);}
   void AddCancelButton();
public:
   Dialog();
   virtual ~Dialog() {}
   virtual void DoDialog() {gtk_widget_show(_window);}
};

#endif // _DIALOG_H