Package totalcross.ui

Class TopMenu

    • Field Detail

      • percIcon

        public static int percIcon
        The percentage of the area used for the icon and the caption
      • percCap

        public static int percCap
        The percentage of the area used for the icon and the caption
      • selected

        protected int selected
      • autoClose

        public boolean autoClose
        Set to false to disable the close when pressing in a button of the menu.
      • totalTime

        public int totalTime
        Defines the animation delay
      • percWidth

        public int percWidth
        The percentage of the screen that this TopMenu will take: LEFT/RIGHT will take 50% of the screen's width, other directions will take 80% of the screen's width. Must be ser before calling popup().
      • widthInPixels

        public int widthInPixels
        The width in pixels instead of percentage of screen's width.
      • backImage

        public Image backImage
        An optional image to be used as background
      • backImageAlpha

        public int backImageAlpha
        The alpha value to be applied to the background image
      • scInsets

        public Insets scInsets
        Insets used to place the ScrollContainer.
    • Constructor Detail

      • TopMenu

        public TopMenu​(Control[] items,
                       int animDir,
                       byte borderStyle)
        Parameters:
        animDir - LEFT, RIGHT, TOP, BOTTOM, CENTER
      • TopMenu

        public TopMenu​(Control[] items,
                       int animDir)
        Parameters:
        animDir - LEFT, RIGHT, TOP, BOTTOM, CENTER
    • Method Detail

      • popup

        public void popup()
        Description copied from class: Window
        Pops up this window, blocking the execution until the window closes.
        Overrides:
        popup in class Window
      • setRect

        protected void setRect​(boolean screenResized)
      • initUI

        public void initUI()
        Description copied from class: Container
        Called to initialize the User Interface of this container. This differs from the onAddAgain method by that this method is called only once, at the first time the control is added to the parent. When the container is being setup, the initUI method is called; then, the onAddAgain is called every time the container is added again.
        Overrides:
        initUI in class Container
      • onEvent

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

        public void screenResized()
        Description copied from class: Window
        Called when the screen is resized, probably caused by a rotation. ATTENTION: THIS CALL CANNOT BE BLOCKED OR THE SYSTEM WILL LOCK!
        Overrides:
        screenResized in class Window
      • onClickedOutside

        protected boolean onClickedOutside​(PenEvent event)
        Description copied from class: Window
        called when the user clicks outside the bounds of this window. must return true if the event was handled, false otherwise. If false is returned and beepIfOut is true, then a beep is played and nothing more happens.
        Overrides:
        onClickedOutside in class Window
      • unpop

        public void unpop()
        Description copied from class: Window
        Hides this window. Calling unpop when only the MainWindow is active does nothing.
        Overrides:
        unpop in class Window
      • postUnpop

        public 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
      • onPopup

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

        public int getSelectedIndex()