WIDGET: Configuration options - how to use?

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

    • WIDGET: Configuration options - how to use?

      Hello.

      In the documentation (ch. 19.1.4) is described:

      Default configuration
      All widgets also have one or more configuration macros which define various default
      settings such as fonts and colors used. The available configuration options are listed
      for each widget in their respective sections later in the chapter.

      And for each widget there is a table named "Configuration options", where are described default values for various macro.

      For example (19.7.1):

      TypeMacroDefaultDescription
      NDROPDOWN_ALIGN_DEFAULTGUI_TA_LEFTText alignment used to display the dropdown text in closed state.
      SDROPDOWN_FONT_DEFAULT&GUI_Font13_1Default font
      NDROPDOWN_BKCOLOR0_DEFAULTGUI_WHITEBackground color, unselected state.
      NDROPDOWN_BKCOLOR1_DEFAULTGUI_GRAYBackground color, selected state without focus.
      NDROPDOWN_BKCOLOR2_DEFAULTGUI_BLUEBackground color, selected state with focus.
      NDROPDOWN_KEY_EXPANDGUI_KEY_SPACEKey which can be used to expand the DROPDOWN list.
      NDROPDOWN_KEY_SELECTGUI_KEY_ENTERKey which can be used to select an item from the open dropdown list.
      NDROPDOWN_TEXTCOLOR0_DEFAULTGUI_BLACKText color, unselected state.
      NDROPDOWN_TEXTCOLOR1_DEFAULTGUI_BLACKText color, selected state without focus.
      NDROPDOWN_TEXTCOLOR2_DEFAULTGUI_WHITEEnable 3D support.




      Question:

      How to change for one or more of these macro their default values, for example - how to change predefined key "GUI_KEY_ENTER" for "DROPDOWN_KEY_SELECT"?

      And what does it mean the column "Type" (letters "S" or "N")?

      Best regards,
      Volodymyr.
      Best regards,
      Volodymyr.

      The post was edited 1 time, last by volodymyr ().

    • Hi,

      Unfortunately, it is not possible to change these setting if using a precompiled library of emWin.

      If you are using the source code of emWin you can add the desired option to your GUIConf.h and define it to another value, like:

      C Source Code

      1. #define DROPDOWN_BKCOLOR0_DEFAULT GUI_RED
      On rebuild of emWin this value will be used to set a default color.

      If you are using a static library you have to use the configuration functions like <WIDGET>_SetBkColor(). Please note that some function have no effect, due to skinning. In this case either use the classic skin or use the skinflex properties to change a widgets attribute. Additional you can set a custom callback, a skinning function or an owner draw function (depends on the widget) and draw the widget completely on your own.

      The letters are describing the type of value, for example the colors are 'N'umbers.

      Regards,
      Sven
      Please read the forum rules before posting.

      Keep in mind, this is *not* a support forum.
      Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
      Should you be entitled to support you can contact us via our support system: segger.com/ticket/

      Or you can contact us via e-mail.