brewpanel/dlgBrew.c

changeset 428
d64c4c1edd78
parent 427
e8e548922e31
child 429
2d7f427b2f74
equal deleted inserted replaced
427:e8e548922e31 428:d64c4c1edd78
22 * along with mbsePi-apps; see the file COPYING. If not, write to the Free 22 * along with mbsePi-apps; see the file COPYING. If not, write to the Free
23 * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 23 * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
24 *****************************************************************************/ 24 *****************************************************************************/
25 25
26 #include "brewpanel.h" 26 #include "brewpanel.h"
27 #include "sockio.h"
28 #include "dlgBrew.h" 27 #include "dlgBrew.h"
29 #include "sdlgui.h" 28 #include "sdlgui.h"
30 #include "slcd.h" 29 #include "slcd.h"
30 #include "sockio.h"
31 31
32 32
33 #ifdef HAVE_SDL_SDL_H 33 #ifdef HAVE_SDL_SDL_H
34 34
35 extern SDL_Surface *PAN_surface; 35 extern SDL_Surface *PAN_surface;
49 49
50 50
51 /* The main dialog: */ 51 /* The main dialog: */
52 static SGOBJ maindlg[] = 52 static SGOBJ maindlg[] =
53 { 53 {
54 /* type flags state x y w h txt */ 54 /* type flags state x y w h txt */
55 { SGBOX, 0, 0, 0, 0, 374, 470, NULL }, 55 { SGBOX, 0, 0, 0, 0, 374, 470, NULL },
56 { SGLCD, 0, 0, -1, 44, 20, 4, NULL }, 56 { SGLCD, 0, 0, -1, 44, 20, 4, NULL },
57 { SGBUTTON, 0, 0, 147, 430, 80, 20, (char *)"Quit" }, 57 { SGBUTTON, 0, 0, 147, 430, 80, 20, (char *)"Quit" },
58 { SGBUTTON, 0, 0, 80, 135, 30, 30, (char *)"1" }, 58 { SGBUTTON, 0, 0, 80, 135, 30, 30, (char *)"1" },
59 { SGTTF, 0, 0, 85, 170, 20, 20, (char *)"Up" }, 59 { SGTTF, 0, 0, 85, 170, 20, 20, (char *)"Up" },
60 { SGBUTTON, 0, 0, 140, 135, 30, 30, (char *)"2" }, 60 { SGBUTTON, 0, 0, 140, 135, 30, 30, (char *)"2" },
61 { SGTTF, 0, 0, 135, 170, 20, 20, (char *)"Down" }, 61 { SGTTF, 0, 0, 135, 170, 20, 20, (char *)"Down" },
62 { SGBUTTON, 0, 0, 200, 135, 30, 30, (char *)"3" }, 62 { SGBUTTON, 0, 0, 200, 135, 30, 30, (char *)"3" },
63 { SGTTF, 0, 0, 203, 170, 20, 20, (char *)"Ret" }, 63 { SGTTF, 0, 0, 203, 170, 20, 20, (char *)"Ret" },
64 { SGBUTTON, 0, 0, 260, 135, 30, 30, (char *)"4" }, 64 { SGBUTTON, 0, 0, 260, 135, 30, 30, (char *)"4" },
65 { SGTTF, 0, 0, 258, 170, 20, 20, (char *)"Enter" }, 65 { SGTTF, 0, 0, 258, 170, 20, 20, (char *)"Enter" },
66 { SGBUTTON, 0, 0, 110, 195, 30, 30, (char *)"12" }, 66 { SGBUTTON, 0, 0, 110, 195, 30, 30, (char *)"12" },
67 { SGBUTTON, 0, 0, 170, 195, 30, 30, (char *)"23" }, 67 { SGBUTTON, 0, 0, 170, 195, 30, 30, (char *)"23" },
68 { SGBUTTON, 0, 0, 230, 195, 30, 30, (char *)"34" }, 68 { SGBUTTON, 0, 0, 230, 195, 30, 30, (char *)"34" },
69 { SGBUTTON, 0, 0, 170, 255, 30, 30, (char *)"All" }, 69 { SGBUTTON, 0, 0, 170, 255, 30, 30, (char *)"All" },
70 { -1, 0, 0, 0, 0, 0, 0, NULL } 70 { SGLEDRED, 0, 0, 110, 300, 12, 0, NULL },
71 { SGLEDBLUE, 0, 0, 170, 300, 12, 0, NULL },
72 { SGLEDYELLOW, 0, 0, 230, 300, 12, 0, NULL },
73 { -1, 0, 0, 0, 0, 0, 0, NULL }
71 }; 74 };
72 75
73 76
74 77
75 int Dialog_LCDinit(int *x, int *y, int *w, int *h, int *cols, int *rows, int index) 78 int Dialog_LCDinit(int *x, int *y, int *w, int *h, int *cols, int *rows, int index)
104 SDL_ShowCursor(SDL_ENABLE); 107 SDL_ShowCursor(SDL_ENABLE);
105 108
106 if (fermenter == 1) { 109 if (fermenter == 1) {
107 maindlg[1].w = 16; 110 maindlg[1].w = 16;
108 maindlg[1].h = 2; 111 maindlg[1].h = 2;
109 maindlg[7].type = SGLEDRED; 112 maindlg[7].type = SGLEDGREEN;
110 maindlg[7].x = 218; 113 maindlg[7].x = 218;
111 maindlg[7].y = 153; 114 maindlg[7].y = 153;
112 maindlg[7].w = 12; 115 maindlg[7].w = 12;
113 maindlg[8].txt = (char *)""; 116 maindlg[8].txt = (char *)"";
114 maindlg[12].type = -1; 117 maindlg[12].type = -1;
117 SDLGui_CenterDlg(maindlg); 120 SDLGui_CenterDlg(maindlg);
118 SDLGui_DoDialogInit(maindlg); 121 SDLGui_DoDialogInit(maindlg);
119 fd = Dialog_LCDinit(&x, &y, &w, &h, &cols, &rows, 0); 122 fd = Dialog_LCDinit(&x, &y, &w, &h, &cols, &rows, 0);
120 fprintf(stdout, "Dialog_LCDinit(%d, %d, %d, %d, %d, %d, 0) = %d\n", x, y, w, h, cols, rows, fd); 123 fprintf(stdout, "Dialog_LCDinit(%d, %d, %d, %d, %d, %d, 0) = %d\n", x, y, w, h, cols, rows, fd);
121 socket_connect(); 124 socket_connect();
122 slcdInit(fd, x, y, w, h, cols, rows); 125 slcdInit(maindlg, fd, x, y, w, h, cols, rows);
123 126
124 do { 127 do {
125 retbut = SDLGui_DoDialogLoop(maindlg); 128 retbut = SDLGui_DoDialogLoop(maindlg);
126 fprintf(stdout, "SDLGui_DoDialog retbut=%d\n", retbut); 129 fprintf(stdout, "SDLGui_DoDialog retbut=%d\n", retbut);
127 130

mercurial