Welcome![Sign In][Sign Up]
Location:
Search - EVENT MANAGER

Search list

[GUI Developbrew window manager

Description:

 

Objective
This topic describes how to create a windowed application that will share the display with other applications.
Brew® MP windowed applications need to be written differently than traditional Brew MP applications. Traditional Brew MP applications, when running in the foreground, occupy full screen space and can modify the display at any time. In the windowing framework, multiple applications share the display at the same time and are not allowed to modify the display arbitrarily. A windowed application also needs to create one or more widgets to be used to create the windows.
A windowed application needs to:
·                  Create and initialize one or more widgets to be passed to IWindowMgr_CreateWindow().
The application can implement its own IWidget, or it can make use of an existing IWidget.
·                  Handle the EVT_APP_START_WINDOW event (and create a window).
·                  Implement handlers for visibility changes, focus changes, and extent changes. The implementation of these handlers is dependent on the details of the application.
·                  Draw in two stages:
·                                  Tell the container that drawing is necessary (ICONTAINER_Invalidate()).
·                                  Draw only when told to draw by the container (IWIDGET_Draw()).
Note: A windowed application should not call any functions that modify IDisplay directly. This includes explicit IDisplay function calls or implicit updates, such as calls to IIMAGE_Draw() or ICONTROL_Redraw(). Drawing should happen only on demand, for example, when IWIDGET_Draw() is called for the widget used to create the window. Existing Widget based applications follow these guidelines and, with minor modifications, can be ported to the windowing framework.
Event handling
A windowed application must respond to these events:
EVT_APP_START_WINDOW and EVT_APP_START
A window-based application receives EVT_APP_START_WINDOW first. If the application returns TRUE for this event, the application does not receive EVT_APP_START. If an application needs to support both the environments (window based and non-window based), it should handle both events.
When the application receives EVT_APP_START_WINDOW, it should create one or more windows.
If creation of IWindowMgr0 fails while handling EVT_APP_START_WINDOW, the application should assume that the platform does not support window-based applications. In this case, the application should return FALSE and continue the application logic in the code for EVT_APP_START.
EVT_APP_SUSPEND and EVT_APP_RESUME
After an application returns TRUE for EVT_APP_START_WINDOW, it will not receive EVT_APP_SUSPEND and EVT_APP_RESUME as non-windowed Brew MP applications do. Instead, the application must check for window status events that are sent to the widget through EVT_WDG_SETPROPERTY events. For EVT_WDG_SETPROPERTY events, wParam indicates which property was set, and dwParam specifies the value of the property. When the AEEWindowMgrExt_PROPEX_STATE property has a value of AEEWindowMgrExt_STATE_VISIBLE, the window is visible.
EVT_WDG_WINDOWSTATUS
The EVT_WDG_WINDOWSTATUS event is sent to a widget to notify it about various window related status messages. AEEWindowStatus.h contains information on the meaning of various status messages.
Sample code location

ZIP filename
Location
Run app
hellowindowapp
Brew MP Library
·                       Download and extract the ZIP file.
·                       Compile the app.
·                       Run it on the Brew MP Simulator.

Example of a windowed application
In the hellowindowapp sample, HelloWindowApp_HandleEvent handles the EVT_APP_START_WINDOW event and creates soft key and pop-up windows:
   case EVT_APP_START_WINDOW:   
      DBGPRINTF("EVT_APP_START_WINDOW");
 
      // Create the softkey and popup windows
      HelloWindowApp_CreateSoftkey(pMe);
      HelloWindowApp_CreateOrActivatePopup(pMe);
 
      // Handling this event tells Brew that we are a windowing
      // application.
      return TRUE;  
HelloWindowApp_CreateSoftkey() creates the soft key widget, sets the color text of the widget, then calls HelloWindowApp_CreateWindow() to create the window.
   WidgetWindow *pWindow = &pMe->softkeyWindow;
  
   if (pWindow->piWindowWidget != NULL) return;
   pWindow->pszDbgName = "Softkey";
   pWindow->pMe = pMe;
  
   (void) ISHELL_CreateInstance(pMe->applet.m_pIShell, AEECLSID_SoftkeyWidget,
            (void **) &pWindow->piWindowWidget);
   if (pWindow->piWindowWidget == NULL) return;
 
   {
      WidgetExtent extent = {0, HWA_SOFTKEY_HEIGHT};
      IWidget_SetExtent(pWindow->piWindowWidget, &extent);
   }
  
   (void) IWidget_SetBGColor(pWindow->piWindowWidget, MAKE_RGBA(200,200,200,255));
  
   // Now set the softkeys text
   {
      IWidget *piTextWidget = NULL;
      (void) IWidget_GetSoftkey(pWindow->piWindowWidget, PROP_SOFTKEY1, &piTextWidget);
     
      if (piTextWidget != NULL) {
         (void) IWidget_SetText(piTextWidget, L"Hover", TRUE);
      }
      RELEASEIF(piTextWidget);
 
      (void) IWidget_GetSoftkey(pWindow->piWindowWidget, PROP_SOFTKEY2, &piTextWidget);
      if (piTextWidget != NULL) {
         (void) IWidget_SetText(piTextWidget, L"Close", TRUE);
      }
      RELEASEIF(piTextWidget);
   }
 
   HelloWindowApp_CreateWindow(pMe, pWindow, AEEWindowMgrExt_CLASS_Softkey);  
HelloWindowApp_CreateWindow() creates the soft key window, as follows:
   int result;
   uint32 winId;
   AEEWindowProp propList[1];
  
   // Set custom window handler
   HANDLERDESC_Init(&pWindow->hdHandler, HelloWindowApp_WindowHandler, pWindow, NULL);
   IWIDGET_SetHandler(pWindow->piWindowWidget, &pWindow->hdHandler);
        
   propList[0].id = AEEWindowMgrExtProp_CLASS;
   propList[0].pbyLen = sizeof(winClass);
   propList[0].pby = (void *) &winClass;
     
   result = IWindowMgr_CreateWindow(pMe->piWindowMgr, (IQI*) (void *) pWindow->piWindowWidget,
      propList, ARR_SIZE(propList), &winId);
 
   if (result != SUCCESS) {
      DBGPRINTF("Window creation failed for %s: %d", pWindow->pszDbgName, result);
      HelloWindowApp_DestroyWindow(pWindow);
   } else {
      DBGPRINTF("Window %s created: id=%d", pWindow->pszDbgName, winId);
   }
HelloWindowApp_CreateOrActivatePopup() creates the widget for the pop-up window, then calls HelloWindowApp_CreateWindow() to create the pop-up window.
   pWindow->piWindowWidget = HelloWindowApp_CreateAndInitImageWidget(
                                pMe,
                                "popups.main" // Image as defined in appinfo.ini
                             );
 
   if (pWindow->piWindowWidget == NULL) return;
 
   {
      WExtent extent = {HWA_POPUP_WIDTH, HWA_POPUP_HEIGHT};
      IWIDGET_SetExtent(pWindow->piWindowWidget, &extent);
   }
 
   HelloWindowApp_CreateWindow(pMe, pWindow, AEEWindowMgrExt_CLASS_Popup);
Related information
·                  See Brew MP Widgets Technology Guide: Creating a Widgets application
·                  See Brew MP API Reference

Base version:
Brew MP 1.0
Tested version:
Brew MP 1.0
Phone tested:
No

 

Platform: | Size: 439828 | Author: bluecrest | Hits:

[Other Embeded programpwm

Description: ti2407 pwm 产生程序 用来上手 事件管理器-ti2407 pwm generation process used to use Event Manager
Platform: | Size: 12288 | Author: henryorange | Hits:

[Windows Developcppevent

Description: 根据c#的事件委托机制,实现c++事件管理器-According to c# Events commissioned mechanism c++ Event Manager
Platform: | Size: 9216 | Author: llg | Hits:

[Othersource

Description: 应用DSP2812,采用事件管理器EVA定时器中断方式实现循环控制LED灯-Application of DSP2812, using Event Manager EVA realize timer interrupt cycle control LED lights
Platform: | Size: 1024 | Author: 刘玉领 | Hits:

[DSP programEvTimer

Description: F2812上有两个事件管理器 EVA、EVB,本程序主要对事件管理定时器1和定时器2进行操作,目的是让用户熟悉EV事件管理器的编程方法。-F2812 has two events on Manager EVA, EVB, this process is essentially one of the event management and timer 2 timer to operate, the purpose is to enable users familiar with the event manager EV programming method.
Platform: | Size: 156672 | Author: 龙天啸 | Hits:

[DSP programchapter6EV

Description: PT格式的DSP28系列的事件管理器EV的设置与应用。 国内少有的中文资料。-PT format DSP28 series of event manager EV settings and applications. Rare in the Chinese domestic information.
Platform: | Size: 1339392 | Author: sunjie | Hits:

[DSP program(PWM)

Description: 用DSP进行PWM调投制,用事件管理器的定时器,的比较寄存器,周期寄存器,控制寄存器-Using DSP to vote PWM transfer system, event manager with the timer, the compare registers, the cycle register, control register
Platform: | Size: 46080 | Author: ren | Hits:

[DSP programTMS320F2812controlPMSM

Description: 基于TMS320F2812的永磁同步电动机控制.doc 例1、空间矢量算法实现 例2、事件管理器配置 例3、TMS320F2812电流及DC母线电压检测 例4、电动机位置检测 -TMS320F2812-based control of permanent magnet synchronous motor. Doc Example 1, the space vector algorithm Example 2, Event Manager configuration cases 3, TMS320F2812 current and DC bus voltage detection of cases of 4, the motor position detection
Platform: | Size: 24576 | Author: haoz | Hits:

[DSP programeva

Description: 事件管理器测试程序 事件管理器测试程序-Event Manager Event Manager test procedure test procedures
Platform: | Size: 114688 | Author: yang | Hits:

[DSP programsv

Description: TI2812DSP芯片采用EVA(事件管理器)产生SVPWM例程,能够正常使用-TI2812DSP chip EVA (Event Manager) SVPWM have routines to normal use
Platform: | Size: 373760 | Author: 龚思 | Hits:

[DSP programEV

Description: DSP320LF2407 事件管理器EVM 例程 标准程序-Event Manager DSP320LF2407 routine EVM standard procedures
Platform: | Size: 13312 | Author: 孟超 | Hits:

[CSharpsvpwm

Description: 本题目利用2407的强大功能,使用事件管理器进行对输入电平的变频调速-2407 the subject of the use of the power of Event Manager for use on the input level of the Frequency Control
Platform: | Size: 1024 | Author: 谢晓晓 | Hits:

[DSP programidenti

Description: Is basic algoritm of configuration DSPF2812 to idetificaction turn A/D and EVent manager,and include basic configuration stdout to comunication.and line equation to control duty cicle in pwm out.
Platform: | Size: 421888 | Author: arte | Hits:

[SCMDSP

Description: 介绍了以DSP为核心的励磁控制系统,利用其事件管理器能直接输出PWM波的特点,通过对永磁同步发电机的运行参数的监测与处理,自动调节复合式励磁发电机的电励磁调节器,使其输出电压保持稳定.实验结果表明该控制器性能良好,实用性强.-Introduced to the DSP as the core excitation control system, event manager to use its direct output PWM wave characteristics of permanent magnet synchronous generators of the operating parameters of the monitoring and processing, automatic adjustment composite electrical excitation generator excitation regulator , and its output voltage to remain stable. The experimental results show that good performance of the controller, practical.
Platform: | Size: 601088 | Author: 将建 | Hits:

[DSP programADCcalibrationV11

Description: This example program runs from RAM on the EzDSP. It initializes the event manager to generate a periodic start of conversion (SOC) pulse to the ADC. This will trigger a conversion of the ADC and when completed the ADC will generate an interrupt. The interrupt is serviced and the ADC calibration function is called. This function will read two user selected reference channels and calculate the appropriate calibration gain and offset and then calibrate all other user channels.
Platform: | Size: 115712 | Author: 诚仁 | Hits:

[DSP programEvent-capture

Description: 代码功能:在DSP2812平台上用C语言进行开发实现利用事件管理器EVA中捕获单元的捕获输入引脚检测两个事件变化的时间,即用捕获引脚CAP4检测手动按下开关的时间,至少五次,将两个捕获引脚每次变化是定时器的值存入数据区,手动开关计数值存入200H单元开始的数据区。-Code function: In DSP2812 platform using C language developed to use the Event Manager EVA capture unit to capture input pin testing two events change the time, that is used to capture the pin CAP4 detect manually press the switch time, at least fivewill capture two pins each change is the timer value stored in the data area manually switch the count value stored in the 200H unit began the data area
Platform: | Size: 1024 | Author: Mei | Hits:

[DSP programEvent-capture

Description: 利用事件管理器EVA中捕获单元的捕获输入引脚检测两个事件变化的时间。(通过手动时间开关存数值)-Using the Event Manager EVA unit captured two events capture input pin to detect changes in time. (By manually switching time value stored)
Platform: | Size: 63488 | Author: yangdianshuai | Hits:

[Internet-NetworkMultitasking-remind-manager-v1

Description: php+mysql 原创多任务倒计时事件管理器.功能:可添加、删除,可发送邮件触发短信20131104 v1.0版-Original multitasking countdown event manager. Feature: you can add, delete, can send E-mail to trigger messages
Platform: | Size: 587776 | Author: jobba | Hits:

[DSP programDSP2407-event-manager-

Description: 基于dsp2407事件管理器的程序,对于初学者很有帮助-The DSP2407 event manager based program, very helpful for beginners
Platform: | Size: 27648 | Author: 莫康 | Hits:

[OS programSystem-Event-Manager

Description: 读取系统事件日志,vs2003编译通过,有兴趣的可以自行下载修改-Read the system event log, vs2003 compiler is available, who are interested can modify
Platform: | Size: 57344 | Author: zhaoxiaojun | Hits:
« 12 3 4 5 6 7 8 »

CodeBus www.codebus.net