ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/Frodo4/Src/dlgMain.cpp
Revision: 1.1
Committed: 2007-01-28T19:00:01Z (17 years, 2 months ago) by berlac
Branch: MAIN
CVS Tags: HEAD
Log Message:
Initial revision.

File Contents

# User Rev Content
1 berlac 1.1 /*
2     * dlgMain.cpp - Main SDL GUI dialog
3     *
4     * (C) 2006 Bernd Lachner
5     *
6     * This program is free software; you can redistribute it and/or modify
7     * it under the terms of the GNU General Public License as published by
8     * the Free Software Foundation; either version 2 of the License, or
9     * (at your option) any later version.
10     *
11     * This program is distributed in the hope that it will be useful,
12     * but WITHOUT ANY WARRANTY; without even the implied warranty of
13     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14     * GNU General Public License for more details.
15     *
16     * You should have received a copy of the GNU General Public License
17     * along with this program; if not, write to the Free Software
18     * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19     */
20    
21     #include "dlgMain.h"
22     #include "sdlgui.h"
23    
24     extern void Dialog_Drives(Prefs &prefs);
25     extern void Dialog_Options(Prefs &prefs);
26     extern void Dialog_VideoSound(Prefs &prefs);
27     extern void Dialog_Advanced(Prefs &prefs);
28     extern void Dialog_Input(Prefs &prefs);
29    
30     enum MAINDLG {
31     box_main,
32     box_settings,
33     text_settings,
34     DRIVES,
35     VIDEOSOUND,
36     INPUT,
37     OPTIONS,
38     ADVANCED,
39     APPLY,
40     CANCEL,
41     SAVE,
42     box_quickaccess,
43     text_quickaccess,
44     RESET,
45     QUIT,
46     ABOUT
47     };
48    
49     /* The keyboard dialog: */
50     /* Spalte, Zeile, Länge, Höhe*/
51     static SGOBJ maindlg[] =
52     {
53     { SGBOX, SG_BACKGROUND, 0, 0,0, 35,20, NULL },
54     { SGBOX, 0, 0, 1,2, 33,10, NULL },
55     { SGTEXT, 0, 0, 2, 1, 16, 1, " Frodo Settings "},
56    
57     { SGBUTTON, SG_SELECTABLE|SG_EXIT, 0, 2, 3, 14,1, "Drives" },
58     { SGBUTTON, SG_SELECTABLE|SG_EXIT, 0, 2, 5, 14,1, "Video/Sound" },
59     { SGBUTTON, SG_SELECTABLE|SG_EXIT, 0, 2, 7, 14,1, "Input" },
60     { SGBUTTON, SG_SELECTABLE|SG_EXIT, 0, 18,3, 14,1, "Options" },
61     { SGBUTTON, SG_SELECTABLE|SG_EXIT, 0, 18,5, 14,1, "Advanced" },
62    
63     { SGBUTTON, SG_SELECTABLE|SG_EXIT|SG_DEFAULT, 0, 2,10,8,1, "Apply" },
64     { SGBUTTON, SG_SELECTABLE|SG_EXIT, 0, 13,10, 8,1, "Cancel" },
65     { SGBUTTON, SG_SELECTABLE|SG_EXIT, 0, 24,10, 8,1, "Save" },
66    
67     { SGBOX, 0, 0, 1,15, 33,3, NULL },
68     { SGTEXT, 0, 0, 2, 14, 22, 1, " Quick-Access-Buttons "},
69    
70     { SGBUTTON, SG_SELECTABLE|SG_EXIT, 0, 2,16,8,1, "Reset" },
71     { SGBUTTON, SG_SELECTABLE|SG_EXIT, 0, 13,16, 8,1, "Quit" },
72     { SGBUTTON, SG_SELECTABLE|SG_EXIT, 0, 24,16, 8,1, "About" },
73    
74     { -1, 0, 0, 0,0, 0,0, NULL }
75     };
76    
77     int Dialog_Main(Prefs &prefs)
78     {
79     // apply
80     while (1)
81     {
82     switch (SDLGui_DoDialog(maindlg))
83     {
84     case DRIVES:
85     Dialog_Drives(prefs);
86     break;
87     case OPTIONS:
88     Dialog_Options(prefs);
89     break;
90     case VIDEOSOUND:
91     Dialog_VideoSound(prefs);
92     break;
93     case ADVANCED:
94     Dialog_Advanced(prefs);
95     break;
96     case INPUT:
97     Dialog_Input(prefs);
98     break;
99     case APPLY:
100     return DO_USEPREFS;
101     case SAVE:
102     return DO_SAVEPREFS;
103     case RESET:
104     return DO_RESET;
105     case QUIT:
106     return DO_QUIT;
107     case CANCEL:
108     return DO_NOTHING;
109     }
110     }
111     return DO_NOTHING;
112     }
113