Regarding the ceation of windows and adding button wdgets to the window

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Regarding the ceation of windows and adding button wdgets to the window

    Hi Segger,
    Actually , i created a window and added a dialog box on window.The dialog box contains some button widgets and frame .
    I want to display another window when i click any of the widget button.Here , how to handle the event when button is clicked.
    And also how to add image to a dialog and how to create event for that.

    • Problem1.txt

      (2.75 kB, downloaded 874 times, last: )
  • Hello Venkat,

    In order to create an event for a BUTTON click, you can react to the WM_NOTIFY_PARENT message, which is sent to the callback function of the BUTTON widget's parent window. Please refer to 15.5.2 "List of messages" in the emWin documentation.

    Please understand that "adding an image" is very general. Images can be e.g. displayed from within a widget's callback routine (WM_PAINT) or by using an IMAGE widget. Could you please tell me exactly how your image should be displayed?

    Best regards,
  • Hi Adrian,
    Thanks for Replying.
    I have a scenario like
    Homescreeen ->consist of 4 buttons
    And Each Button opens one dialog box like Button1 opens ->Dialog 1, Button2 opens ->Dialog 2 etc...
    Here, i want to return from Dialog 1 to home screen.
    My Dialog1 contains one "back" button.
    The question is,how to call homscreen when i click "back" button from Dialog1.

    Best Regards,
  • Regarding Filling circle with certain levels

    Hi Adrian,

    For creating a circle there is an API - DrawCircle().
    But,is there any API available to control the circle.
    For eg: I want to draw a circle with different colors.
    Like ,if i want a to fill a circle for certain level with one color and remaining with other color.
    Can you please suggest on this.

  • Hello Venkat,

    You can use a clipping rectangle to downsize the part of the screen which is affected by drawing operations. Drawing the circle several times using a different clipping rectangle and a different color for each operation should have the effect you want to achieve.

    You will need to use the function GUI_SetClipRect(). For a detailed function description, please refer to the chapter 2-D Graphic Library.

    Best regards,