brewpanel/dlgBrew.c

changeset 412
f1a042a59b61
parent 410
e3f8a51b566a
child 416
7e6d682fc950
equal deleted inserted replaced
411:ae85e91dcc58 412:f1a042a59b61
24 *****************************************************************************/ 24 *****************************************************************************/
25 25
26 #include "brewpanel.h" 26 #include "brewpanel.h"
27 #include "dlgBrew.h" 27 #include "dlgBrew.h"
28 #include "sdlgui.h" 28 #include "sdlgui.h"
29 #include "slcd.h"
30
29 31
30 #ifdef HAVE_SDL_SDL_H 32 #ifdef HAVE_SDL_SDL_H
31 33
32 extern SDL_Surface *PAN_surface; 34 extern SDL_Surface *PAN_surface;
33 extern int my_shutdown; 35 extern int my_shutdown;
55 { -1, 0, 0, 0, 0, 0, 0, NULL } 57 { -1, 0, 0, 0, 0, 0, 0, NULL }
56 }; 58 };
57 59
58 60
59 61
62 int Dialog_LCDinit(int *x, int *y, int *w, int *h, int *cols, int *rows, int index)
63 {
64 int retval;
65
66 retval = SDLGui_LCDinit(maindlg, x, y, w, h, cols, rows, index);
67
68 fprintf(stdout, "SDLGui_LCDinit(maindlg, %d, %d, %d, %d, %d, %d, %d) = %d\n", *x, *y, *w, *h, *cols, *rows, index, retval);
69 return retval;
70 }
71
72
60 73
61 /* 74 /*
62 * This functions sets up the actual font and then displays the brew panel dialog. 75 * This functions sets up the actual font and then displays the brew panel dialog.
63 */ 76 */
64 int Dialog_BrewDlg(void) 77 int Dialog_BrewDlg(void)
65 { 78 {
66 int retbut; 79 int retbut;
67 int bOldMouseVisibility; 80 int bOldMouseVisibility;
68 int nOldMouseX, nOldMouseY; 81 int nOldMouseX, nOldMouseY;
82 int x, y, w, h, cols, rows, fd;
69 83
70 if (SDLGui_SetScreen(PAN_surface)) { 84 if (SDLGui_SetScreen(PAN_surface)) {
71 syslog(LOG_NOTICE, "SDLGui_SetScreen(PAN_surface) failed: %s", SDL_GetError()); 85 syslog(LOG_NOTICE, "SDLGui_SetScreen(PAN_surface) failed: %s", SDL_GetError());
72 return FALSE; 86 return FALSE;
73 } 87 }
75 SDL_GetMouseState(&nOldMouseX, &nOldMouseY); 89 SDL_GetMouseState(&nOldMouseX, &nOldMouseY);
76 bOldMouseVisibility = SDL_ShowCursor(SDL_QUERY); 90 bOldMouseVisibility = SDL_ShowCursor(SDL_QUERY);
77 SDL_ShowCursor(SDL_ENABLE); 91 SDL_ShowCursor(SDL_ENABLE);
78 92
79 SDLGui_CenterDlg(maindlg); 93 SDLGui_CenterDlg(maindlg);
94 SDLGui_DoDialogInit(maindlg);
95 fd = Dialog_LCDinit(&x, &y, &w, &h, &cols, &rows, 0);
96 fprintf(stdout, "Dialog_LCDinit(%d, %d, %d, %d, %d, %d, 0) = %d\n", x, y, w, h, cols, rows, fd);
97 slcdInit(fd, x, y, w, h, cols, rows);
80 98
81 do { 99 do {
82 retbut = SDLGui_DoDialog(maindlg, NULL); 100 retbut = SDLGui_DoDialogLoop(maindlg);
83 SDLGui_LCDwrite(maindlg, 0, 0, 'A', 0); 101 slcdPuts(0, (char *)"Hello");
84 102
85 fprintf(stdout, "SDLGui_DoDialog retbut=%d\n", retbut); 103 fprintf(stdout, "SDLGui_DoDialog retbut=%d\n", retbut);
86 104
87 switch (retbut) { 105 switch (retbut) {
88 case MAINDLG_B1: fprintf(stdout, "Button 1\n"); 106 case MAINDLG_B1: fprintf(stdout, "Button 1\n");
97 break; 115 break;
98 } 116 }
99 117
100 } while (retbut != SDLGUI_QUIT && retbut != SDLGUI_ERROR && !my_shutdown); 118 } while (retbut != SDLGUI_QUIT && retbut != SDLGUI_ERROR && !my_shutdown);
101 119
120 SDLGui_DoDialogEnd();
102 SDL_ShowCursor(bOldMouseVisibility); 121 SDL_ShowCursor(bOldMouseVisibility);
103 122
104 return TRUE; 123 return TRUE;
105 } 124 }
106 125

mercurial