ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/proj/RenegadeMapSelector/MapSelector.h
Revision: 94
Committed: 2003-03-22T13:53:44-08:00 (22 years, 3 months ago) by douglas
Content type: text/x-c
Original Path: trunk/RenegadeMapSelector/MapSelector.h
File size: 1442 byte(s)
Log Message:
Did stuff and ran into problem with GTK+ version, arg!

File Contents

# User Rev Content
1 douglas 86 // Renegade Map Selector
2     //
3     // Douglas Thrift
4     //
5     // MapSelector.h
6    
7     #ifndef _WIN32
8     #ifndef _MapSelector_h_
9     #define _MapSelector_h_
10    
11     #include "RenegadeConfig.h"
12 douglas 88 #include <sys/types.h>
13     #include <sys/param.h>
14     #include <unistd.h>
15     #include <dirent.h>
16 douglas 86 #include <gtk/gtk.h>
17    
18 douglas 87 extern RenegadeConfig* config;
19    
20 douglas 86 inline void message(GtkWindow* parent, const string& text, const string& title,
21     GtkMessageType type)
22     {
23     GtkWidget* box = gtk_message_dialog_new(parent, GTK_DIALOG_MODAL, type,
24     GTK_BUTTONS_OK, text.c_str());
25    
26     gtk_window_set_title(GTK_WINDOW(box), title.c_str());
27    
28     gtk_dialog_run(GTK_DIALOG(box));
29     gtk_widget_destroy(box);
30     }
31    
32     class MapSelector
33     {
34     private:
35     GtkWidget* window;
36 douglas 88 GtkWidget* available;
37     GtkWidget* selected;
38 douglas 86 GtkWidget* add;
39     GtkWidget* remove;
40     GtkWidget* up;
41     GtkWidget* down;
42 douglas 88 void setupAvailable();
43     void setupSelected();
44 douglas 86 public:
45     MapSelector();
46 douglas 87 ~MapSelector() {}
47     // friends:
48     friend void destruct(GtkWidget* widget, MapSelector* data);
49     friend void done(GtkWidget* widget, MapSelector* data);
50 douglas 94 friend void changeAvailable(GtkTreeSelection* selection, MapSelector* data);
51     friend void changeSelected(GtkTreeSelection* selection, MapSelector* data);
52 douglas 87 friend void mapAdd(GtkWidget* widget, MapSelector* data);
53     friend void mapRemove(GtkWidget* widget, MapSelector* data);
54     friend void mapUp(GtkWidget* widget, MapSelector* data);
55     friend void mapDown(GtkWidget* widget, MapSelector* data);
56 douglas 86 };
57    
58     #endif _MapSelector_h_
59     #endif