Package totalcross.ui

Class ComboBoxDropDown


  • public class ComboBoxDropDown
    extends Window
    ComboBoxDropDown is a simple implementation of a PopUp Listbox. Used by the ComboBox class.
    • Field Detail

      • lb

        public ListBox lb
        The assigned ListBox.
      • dontHideParent

        public boolean dontHideParent
        Set to true if want to make the control popup below or above always, and not only if WinCE
      • fullHeight

        public boolean fullHeight
        Set to true to make this pop have the screen height
      • fullWidth

        public boolean fullWidth
        Set to true to make this popup have the screen width
    • Constructor Detail

      • ComboBoxDropDown

        public ComboBoxDropDown()
        Creates a ComboBoxDropDown with coordinates that will be set later via the setRect method.
      • ComboBoxDropDown

        public ComboBoxDropDown​(ListBox lb)
        Creates a ComboBoxDropDown with the given ListBox. You can extend the ListBox to draw the items by yourself and use this constructor so the ComboBoxDropDown will use your class and not the default ListBox one. Note that this constructor forces the ListBox.simpleBorder to true.
    • Method Detail

      • onFontChanged

        protected void onFontChanged()
        Sets the font of the controls inside this window
        Overrides:
        onFontChanged in class Control
      • onClickedOutside

        protected boolean onClickedOutside​(PenEvent event)
        Close the popup list with a click outside its bounds
        Overrides:
        onClickedOutside in class Window
      • onEvent

        public void onEvent​(Event event)
        Description copied from class: Control
        Called to process key, pen, control and other posted events.
        Overrides:
        onEvent in class Control
        Parameters:
        event - the event to process
        See Also:
        Event, KeyEvent, PenEvent
      • getPreferredWidth

        public int getPreferredWidth()
        Description copied from class: Window
        Returns the size of the title if any plus the size of the border. Note that the value returned here does not handle the controls inside the window.
        Overrides:
        getPreferredWidth in class Window
      • getPreferredHeight

        public int getPreferredHeight()
        Description copied from class: Window
        Returns the size of the title if any plus the size of the border. Note that the value returned here does not handle the controls inside the window.
        Overrides:
        getPreferredHeight in class Window
      • onPopup

        protected void onPopup()
        Description copied from class: Window
        Placeholder called imediatly before the popup began. The default implementation does nothing.
        Overrides:
        onPopup in class Window
      • postUnpop

        protected void postUnpop()
        Description copied from class: Window
        Placeholder called after the unpop is done and after the repaint of the other window. The default implementation does nothing.
        Overrides:
        postUnpop in class Window