brewpanel/dlgBrew.c

changeset 412
f1a042a59b61
parent 410
e3f8a51b566a
child 416
7e6d682fc950
--- a/brewpanel/dlgBrew.c	Sat Nov 07 22:42:47 2015 +0100
+++ b/brewpanel/dlgBrew.c	Sun Nov 08 17:49:29 2015 +0100
@@ -26,6 +26,8 @@
 #include "brewpanel.h"
 #include "dlgBrew.h"
 #include "sdlgui.h"
+#include "slcd.h"
+
 
 #ifdef HAVE_SDL_SDL_H
 
@@ -57,6 +59,17 @@
 
 
 
+int Dialog_LCDinit(int *x, int *y, int *w, int *h, int *cols, int *rows, int index)
+{
+    int	retval;
+
+    retval = SDLGui_LCDinit(maindlg, x, y, w, h, cols, rows, index);
+
+    fprintf(stdout, "SDLGui_LCDinit(maindlg, %d, %d, %d, %d, %d, %d, %d) = %d\n", *x, *y, *w, *h, *cols, *rows, index, retval);
+    return retval;
+}
+
+
 
 /*
  * This functions sets up the actual font and then displays the brew panel dialog.
@@ -66,6 +79,7 @@
     int retbut;
     int bOldMouseVisibility;
     int nOldMouseX, nOldMouseY;
+    int x, y, w, h, cols, rows, fd;
 
     if (SDLGui_SetScreen(PAN_surface)) {
 	syslog(LOG_NOTICE, "SDLGui_SetScreen(PAN_surface) failed: %s", SDL_GetError());
@@ -77,10 +91,14 @@
     SDL_ShowCursor(SDL_ENABLE);
 
     SDLGui_CenterDlg(maindlg);
+    SDLGui_DoDialogInit(maindlg);
+    fd = Dialog_LCDinit(&x, &y, &w, &h, &cols, &rows, 0);
+    fprintf(stdout, "Dialog_LCDinit(%d, %d, %d, %d, %d, %d, 0) = %d\n", x, y, w, h, cols, rows, fd);
+    slcdInit(fd, x, y, w, h, cols, rows);
 
     do {
-	retbut = SDLGui_DoDialog(maindlg, NULL);
- SDLGui_LCDwrite(maindlg, 0, 0, 'A', 0);
+	retbut = SDLGui_DoDialogLoop(maindlg);
+	slcdPuts(0, (char *)"Hello");
 
 	fprintf(stdout, "SDLGui_DoDialog retbut=%d\n", retbut);
 
@@ -99,6 +117,7 @@
 
     } while (retbut != SDLGUI_QUIT && retbut != SDLGUI_ERROR && !my_shutdown);
 
+    SDLGui_DoDialogEnd();
     SDL_ShowCursor(bOldMouseVisibility);
 
     return TRUE;

mercurial