Messagebox (Sample)

From SEGGER Wiki
Jump to: navigation, search
GUI_Messagebox.c
GUI Messagebox.gif
File(s) required
  • GUI_Messagebox.c
Runs in simulation Yes
Runs on target Yes
Download GUI_Messagebox.c

The sample demonstrates the usage of MESSAGEBOX dialogs.

Code

/*********************************************************************
*                    SEGGER Microcontroller GmbH                     *
*        Solutions for real time microcontroller applications        *
**********************************************************************
*                                                                    *
*        (c) 1996 - 2020  SEGGER Microcontroller GmbH                *
*                                                                    *
*        Internet: www.segger.com    Support:  support@segger.com    *
*                                                                    *
**********************************************************************

** emWin V6.10 - Graphical user interface for embedded applications **
emWin is protected by international copyright laws.   Knowledge of the
source code may not be used to write a similar product.  This file may
only  be used  in accordance  with  a license  and should  not be  re-
distributed in any way. We appreciate your understanding and fairness.
----------------------------------------------------------------------
File        : GUI_Messagebox.c
Purpose     : Sample that demonstrates the usage of MESSAGEBOX
              dialogues in emWin.
Requirements: WindowManager - (x)
              MemoryDevices - ( )
              AntiAliasing  - ( )
              VNC-Server    - ( )
              PNG-Library   - ( )
              TrueTypeFonts - ( )
---------------------------END-OF-HEADER------------------------------
*/

#include "DIALOG.h"

/*********************************************************************
*
*       Public code
*
**********************************************************************
*/
/*********************************************************************
*
*       MainTask
*/
void MainTask(void) {
  WM_HWIN hMessage;
  WM_HWIN hMessageMove;

  //
  // Init GUI
  //
  GUI_Init();
  WM_SetDesktopColor(GUI_BLACK);
  //
  // Enable multi-buffering to avoid flickering during movement of a framewin.
  //
  WM_MULTIBUF_Enable(1);
  //
  // Create messagebox
  //
  hMessage = GUI_MessageBox("Sample message", "Sample title", 0);
  //
  // Create movable messagebox
  //
  hMessageMove = GUI_MessageBox("This message is movable!", "Movable Messagebox", GUI_MESSAGEBOX_CF_MOVEABLE);

  while (1) {
    GUI_Delay(100);
  }
}

/*************************** End of file ****************************/