⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dimsgbox.c

📁 Turbo C 3.0 + UCOS2 + UCGUI PC学习版本
💻 C
字号:
/*
*********************************************************************************************************
*                                                uC/GUI
*                        Universal graphic software for embedded applications
*
*                       (c) Copyright 2002, Micrium Inc., Weston, FL
*                       (c) Copyright 2002, SEGGER Microcontroller Systeme GmbH
*
*              礐/GUI 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 redistributed
*              in any way. We appreciate your understanding and fairness.
*
----------------------------------------------------------------------
File        : DIALOG_MessageBox.c
Purpose     : Example demonstrating GUI_MessageBox
----------------------------------------------------------------------
*/
#ifndef DEMOCHOICE

#include "headers.h"

#include "GUI.H"
#include "PC.H"
#include "graphics.h"


void DrawInit (void)
{
 int driver=DETECT,graphmode;
 registerfarbgidriver (EGAVGA_driver_far);
 initgraph (&driver,&graphmode,"");
}
#endif
/*******************************************************************
*
*                 main
*
********************************************************************
*/

void DemoMsgBox (void *pData)
{
  pData=pData;

  GUI_Init();
  WM_SetDesktopColor(GUI_LIGHTBLUE);     /* Automacally update desktop window */
  /* Create message box and wait until it is closed */
  while (1){
    GUI_Delay (0);
    GUI_MessageBox("清明时节雨纷纷,\n路上行人欲断云。\n借问酒家何处有,\n牧童遥指杏花村。\n",
		   "消息框", GUI_MESSAGEBOX_CF_MOVEABLE);
    GUI_Delay(0);                    /* Wait for a short moment ... */
    GUI_MessageBox("Task DemoMsgBox's window",
		   "Task DemoMsgBox2", GUI_MESSAGEBOX_CF_MOVEABLE);
  }
  //while (1)GUI_Delay (1);
}

#ifndef DEMOCHOICE
void main(void) {
  DrawInit ();

  OSInit();                                              /* Initialize uC/OS-II                      */
  PC_DOSSaveReturn();                                    /* Save environment to return to DOS        */
  PC_VectSet(uCOS, OSCtxSw);                             /* Install uC/OS-II's context switch vector */

  OS_ENTER_CRITICAL();
  PC_VectSet(0x08, OSTickISR);                           /* Install uC/OS-II's clock tick ISR        */
  PC_SetTickRate(OS_TICKS_PER_SEC);                      /* Reprogram tick rate                      */
  OS_EXIT_CRITICAL();

  OSTaskCreateExt(DemoMsgBox,(void *)0,&TestTask1Stk[TASK_ONE_STACKSIZE-1],1,1,&TestTask1Stk[0],TASK_ONE_STACKSIZE,(void *)0,OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR);
  OSTaskCreateExt(TestTask2,(void *)0,&TestTask2Stk[TASK_TWO_STACKSIZE-1],2,2,&TestTask2Stk[0],TASK_TWO_STACKSIZE,(void *)0,OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR);
  //OSTaskCreateExt(TestTask3,(void *)0,&TestTask3Stk[TASK_THR_STACKSIZE-1],3,3,&TestTask3Stk[0],TASK_THR_STACKSIZE,(void *)0,OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR);

  OSStart();

  while (1);
}
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -