popup_dialog.c 822 Bytes
Newer Older
1 2 3 4
#include <cdk_int.h>

/*
 * $Author: tom $
5 6
 * $Date: 2012/03/21 08:45:41 $
 * $Revision: 1.3 $
7 8 9 10 11
 */

/*
 * This pops up a dialog box.
 */
12
int popupDialog (CDKSCREEN *screen, CDK_CSTRING2 mesg, int mesgCount, CDK_CSTRING2 buttons, int buttonCount)
13 14 15 16 17 18 19
{
   /* Declare local variables. */
   CDKDIALOG *popup	= 0;
   int choice;

   /* Create the dialog box. */
   popup = newCDKDialog (screen, CENTER, CENTER,
20 21 22 23
			 mesg, mesgCount,
			 buttons, buttonCount,
			 A_REVERSE, TRUE,
			 TRUE, FALSE);
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40

   /* Activate the dialog box */
   drawCDKDialog (popup, TRUE);

   /* Get the choice. */
   choice = activateCDKDialog (popup, 0);

   /* Destroy the dialog box. */
   destroyCDKDialog (popup);

   /* Clean the screen. */
   eraseCDKScreen (screen);
   refreshCDKScreen (screen);

   /* Return the choice. */
   return choice;
}