Class VButton


  • public class VButton
    extends VControl
    Control to mimic a button.
    • Field Detail

      • oldImageData

        org.eclipse.swt.graphics.ImageData oldImageData
      • paintNative

        boolean paintNative
      • paintInactive

        boolean paintInactive
      • armed

        private boolean armed
      • hoverBackgroundColor

        org.eclipse.swt.graphics.Color hoverBackgroundColor
      • defaultHoverBackgroundColor

        org.eclipse.swt.graphics.Color defaultHoverBackgroundColor
      • hoverBorderColor

        org.eclipse.swt.graphics.Color hoverBorderColor
      • defaultHoverBorderColor

        org.eclipse.swt.graphics.Color defaultHoverBorderColor
      • selectedBackgroundColor

        org.eclipse.swt.graphics.Color selectedBackgroundColor
      • defaultSelectedBackgroundColor

        org.eclipse.swt.graphics.Color defaultSelectedBackgroundColor
      • selectedBorderColor

        org.eclipse.swt.graphics.Color selectedBorderColor
      • defaultSelectedBorderColor

        org.eclipse.swt.graphics.Color defaultSelectedBorderColor
    • Constructor Detail

      • VButton

        public VButton​(VPanel panel,
                       int style)
        Constructor
        Parameters:
        panel - parent panel
        style - button style
    • Method Detail

      • getNativeBackground

        public boolean getNativeBackground()
        Returns:
        the paintNative flag
        See Also:
        setPaintNative(boolean)
      • getSelection

        public boolean getSelection()
        Returns:
        true if this button is currently selected.
      • filterEvent

        protected void filterEvent​(org.eclipse.swt.widgets.Event event)
        Overrides:
        filterEvent in class VControl
      • createEvent

        private org.eclipse.swt.widgets.Event createEvent​(org.eclipse.swt.widgets.Event event)
      • setPaintInactive

        public void setPaintInactive​(boolean paintInactive)
        Parameters:
        paintInactive - true to paint the button in an inactive state.
      • setPaintNative

        public void setPaintNative​(boolean paintNative)
        Setting this value currently does nothing but subclasses can take advantage of this flag.

        Painting native is the act of letting the underlying OS take care of painting the background in some way or another.

        Parameters:
        paintNative - true to paint native
      • setSelection

        public void setSelection​(boolean select)
        Marks this button as being "selected" by the user.
        Parameters:
        select - true to make the button "selected".
      • setHoverBackgroundColor

        public void setHoverBackgroundColor​(org.eclipse.swt.graphics.Color hoverBackgroundColor)
        Set the background color when the mouse is hover the button
        Parameters:
        hoverBackgroundColor - new color
      • setHoverBorderColor

        public void setHoverBorderColor​(org.eclipse.swt.graphics.Color hoverBorderColor)
        border color when the mouse is hover the button
        Parameters:
        hoverBorderColor - new color
      • setSelectedBackgroundColor

        public void setSelectedBackgroundColor​(org.eclipse.swt.graphics.Color selectedBackgroundColor)
        background color when the button is selected
        Parameters:
        selectedBackgroundColor - new color
      • setSelectedBorderColor

        public void setSelectedBorderColor​(org.eclipse.swt.graphics.Color selectedBorderColor)
        background color when the button is selected
        Parameters:
        selectedBorderColor - new color