Libraries.Interface.Controls.Blocks.Palette.BlockPalettePage Documentation

Inherits from: Libraries.Interface.Controls.Control, Libraries.Interface.Forms.FormContainerControl, Libraries.Interface.Controls.ScrollPane, Libraries.Interface.Pages.StackedRowPage, Libraries.Interface.Controls.ScrollableControl, Libraries.Interface.Forms.FormPrimitiveContainer, Libraries.Interface.Item, Libraries.Interface.Item2D, Libraries.Language.Object, Libraries.Interface.Forms.Page

Variables Table

VariablesDescription
integer LABEL_SIZEA behavior assigned to each BlockPalettetItem that is added to this page.
integer HEADER2_SIZE
integer HEADER_SIZE

Actions Documentation

Activate(Libraries.Interface.Events.BehaviorEvent event)

Returns true if rendering the focus event.

Parameters

Activate()

This action returns a default behavior for this paricular control. Some controls do nothing by default, like a TextBox that responds to different kinds of input. Others, however, have default behaviors, like a Button or a MenuItem. If there is no default behavior, this action returns undefined.

Add(integer index, Libraries.Interface.Item2D item)

Parameters

Add(Libraries.Interface.Item2D item)

AddActionBlocks()

AddBanner(text title)

This action adds a banner with the specified title to the Page.

Parameters

  • text title: The text title on the banner and the identifier for the banner.

Return

Libraries.Interface.Forms.Banner: The banner object that was added to the page.

Example

use Libraries.Interface.Forms.Form
use Libraries.Interface.Forms.Page
use Libraries.Interface.Forms.Banner

class Main
    action Main
        // create the app
        Form form
        Page homePage = form:GetMainPage() 

        Banner value = homePage:AddBanner("Hello World")

        form:Display()
    end
end

AddBanner(text name, text title, text label)

This action adds a banner with a specified identifier to the page. The title, and subtitle are displayed.

Parameters

  • text name: The text identified for the banner.
  • text title: The text title on the banner.
  • text label: The text subtitle on the banner.

Return

Libraries.Interface.Forms.Banner: The banner object that was added to the page.

Example

use Libraries.Interface.Forms.Form
use Libraries.Interface.Forms.Page
use Libraries.Interface.Forms.Banner

class Main
    action Main
        // create the app
        Form form
        Page homePage = form:GetMainPage() 

        Banner value = homePage:AddBanner("myBanner", "Hello World", "What a great day it is!")

        form:Display()
    end
end

AddBanner(text title, text label)

This action adds a banner with a title and subtitle to the page.

Parameters

  • text title: The text title on the banner and the identifier for the banner.
  • text label: The text label on the banner.

Return

Libraries.Interface.Forms.Banner: The banner object that was added to the page.

Example

use Libraries.Interface.Forms.Form
use Libraries.Interface.Forms.Page
use Libraries.Interface.Forms.Banner

class Main
    action Main
        // create the app
        Form form
        Page homePage = form:GetMainPage() 

        Banner value = homePage:AddBanner("Hello World", "What a great day it is!")

        form:Display()
    end
end

AddBasicBlocks()

This item is off the bottom of the scroll area, so don't bother looking through the rest.

AddBehavior(Libraries.Interface.Behaviors.Behavior behavior)

This action adds a new Behavior to this Item.

Parameters

AddBlockPaletteItem(text name)

Now that we've finally rendered all the contents, render the scroll bars.

Parameters

  • text name

Return

Libraries.Interface.Controls.Button:

AddButton(text name)

This action adds a button to the control.

Parameters

  • text name: The text name identifying the button.

Return

Libraries.Interface.Controls.Button: The button object created when the AddButton(text) action is called.

Example

use Libraries.Interface.Forms.Form
use Libraries.Interface.Forms.Page
use Libraries.Interface.Controls.Button

class Main
    action Main
        Form form
        Page page = form:GetMainPage()
        Button button = page:AddButton("my button")

        form:Display()
    end
end

AddButton(text name, text fileName)

This action adds a button with an icon to the control.

Parameters

  • text name: The text name identifying the button.
  • text fileName: The text file path to where the image used as the button icon is located.

Return

Libraries.Interface.Controls.Button: The button object created when the AddButton(text, text) action is called.

Example

use Libraries.Interface.Forms.Form
use Libraries.Interface.Forms.Page
use Libraries.Interface.Controls.Button

class Main
    action Main
        Form form
        Page page = form:GetMainPage()
        Button button = page:AddButton("my button", "Images/adoptUs.png")

        form:Display()
    end
end

AddCheckbox(text name)

This action adds a checkbox to the control.

Parameters

  • text name: The text name identifying the checkbox.

Return

Libraries.Interface.Controls.Checkbox: The checkbox object that was added to the control.

Example

use Libraries.Interface.Forms.Form
use Libraries.Interface.Forms.Page
use Libraries.Interface.Controls.Checkbox

class Main
    action Main
        // create the app
        Form form
        Page homePage = form:GetMainPage() 

        Checkbox field = homePage:AddCheckbox("my checkbox")
        
        form:Display()
    end
end

AddControlActivationListener(Libraries.Interface.Events.ControlActivationListener listener)

This action removes an Item2D at a specifed index from the internal array.

Parameters

Example

use Libraries.Interface.Item2D

Item2D parentItem
Item2D child
parentItem:Add(0, child)
parentItem:Remove(0)

AddControlBlocks()

AddFocusListener(Libraries.Interface.Events.FocusListener listener)

This action adds a FocusListener to the Item. When the Item receives a FocusEvent due to either gaining or losing the focus, the listener will be notified.

Parameters

Example

use Libraries.Interface.Item
use Libraries.Interface.Events.FocusListener
Item myItem
FocusListener listener
myItem:AddFocusListener(listener)

AddGestureListener(Libraries.Interface.Events.GestureListener listener)

This action adds a GestureListener to the Item. If the Item ever receives a GestureEvent, the listener will be notified.

Parameters

Example

use Libraries.Interface.Item
use Libraries.Interface.Events.GestureListener
Item myItem
GestureListener listener
myItem:AddGestureListener(listener)

AddGrouping(text name)

This action adds a grouping of elements (e.g., buttons, labels) to the Page.

Parameters

  • text name: The text represents the identifier of the grouping.

Return

Libraries.Interface.Forms.Grouping: The grouping object that was added to the page.

Example

use Libraries.Interface.Forms.Form
use Libraries.Interface.Forms.Page
use Libraries.Interface.Forms.Grouping
use Libraries.Interface.Controls.ToggleButton

class Main
    action Main
        // create the app
        Form form
        Page homePage = form:GetMainPage() 

        Grouping toggleGroup = homePage:AddGrouping("switch")
        toggleGroup:AddToggleButton("On")
        ToggleButton off = toggleGroup:AddToggleButton("Off")
        
        form:Display()
    end
end

AddIcon(text name, text fileName)

This action adds an icon(image) to the control.

Parameters

  • text name: The text name identifying the icon.
  • text fileName: The text path to the image.

Return

Libraries.Interface.Controls.Icon: The icon object that was added to the control.

Example

use Libraries.Interface.Forms.Form
use Libraries.Interface.Forms.Page

class Main
    action Main
        // create the app
        Form form
        Page homePage = form:GetMainPage() 

        homePage:AddIcon("my icon", "Images/Blue Jay.png")
        
        form:Display()
    end
end

AddLabel(text name)

This action adds a label to the control.

Parameters

  • text name: The text name identifying the label.

Return

Libraries.Game.Graphics.Label: The label object that was added to the control.

Example

use Libraries.Interface.Forms.Form
use Libraries.Interface.Forms.Page

class Main
    action Main
        // create the app
        Form form
        Page homePage = form:GetMainPage() 

        homePage:AddLabel("my label")
        
        form:Display()
    end
end

AddLabel(text name, text value)

This action adds a label to the control.

Parameters

  • text name: The text name identifying the label.
  • text value: The text displayed in the label.

Return

Libraries.Game.Graphics.Label: The label object that was added to the control.

Example

use Libraries.Interface.Forms.Form
use Libraries.Interface.Forms.Page

class Main
    action Main
        // create the app
        Form form
        Page homePage = form:GetMainPage() 

        homePage:AddLabel("my label", "Name: ")
        
        form:Display()
    end
end

AddLayoutProperties(Libraries.Interface.Layouts.LayoutProperties properties)

Returns true if rendering the mouse down event.

Parameters

AddList(text name)

This action adds a list to the control.

Parameters

  • text name: The text name identifying the list.

Return

Libraries.Interface.Controls.List: The list object that was added to the control.

Example

use Libraries.Interface.Forms.Form
use Libraries.Interface.Forms.Page

class Main
    action Main

        Form form
        Page homePage = form:GetMainPage() 

        homePage:AddList("list")
        
        form:Display()
    end
end

AddMouseListener(Libraries.Interface.Events.MouseListener listener)

This action adds a MouseListener to the Item. If the Item ever receives a MouseEvent due to a mouse click, the mouse listener will be notified.

Parameters

Example

use Libraries.Interface.Item
use Libraries.Interface.Events.MouseListener
Item myItem
MouseListener listener
myItem:AddMouseListener(listener)

AddMouseMovementListener(Libraries.Interface.Events.MouseMovementListener listener)

This action adds a MouseMovementListener to the Item. If the Item ever receives a MouseEvent due to mouse movement, the listener will be notified.

Parameters

Example

use Libraries.Interface.Item
use Libraries.Interface.Events.MouseMovementListener
Item myItem
MouseMovementListener listener
myItem:AddMouseMovementListener(listener)

AddMouseWheelListener(Libraries.Interface.Events.MouseWheelListener listener)

This action adds a MouseWheelListener to the Item. If the Item ever receives a MouseEvent due to the mouse wheel being scrolled, the listener will be notified.

Parameters

Example

use Libraries.Interface.Item
use Libraries.Interface.Events.MouseWheelListener
Item myItem
MouseWheelListener listener
myItem:AddMouseWheelListener(listener)

AddSelectionListener(Libraries.Interface.Events.SelectionListener listener)

This action adds the given SelectionListeners to the Control.

Parameters

AddStartButtonGrouping(text title, text label, text buttonName)

This action adds a grouping template called the StartButtonGrouping to the Page. This grouping contains a title, label, and button with text specified by the action parameters.

Parameters

  • text title: The text title in the grouping and the identifier for the grouping.
  • text label: The text label in the grouping.
  • text buttonName: The text on the button in the grouping.

Return

Libraries.Interface.Forms.StartButtonGrouping: The StartButtonGrouping object that was added to the page.

Example

use Libraries.Interface.Forms.Form
use Libraries.Interface.Forms.Page
use Libraries.Interface.Forms.StartButtonGrouping

class Main
    action Main
        // create the app
        Form form
        Page homePage = form:GetMainPage() 

        StartButtonGrouping group = homePage:AddStartButtonGrouping("Home Page", "Welcome to the grouping template", "Press Me")

        form:Display()
    end
end

AddTextBox(text name)

This action adds a text box to the control.

Parameters

  • text name: The text name identifying the text box.

Return

Libraries.Interface.Controls.TextBox: The text box object that was added to the control.

Example

use Libraries.Interface.Forms.Form
use Libraries.Interface.Forms.Page
use Libraries.Interface.Controls.TextBox

class Main
    action Main
        // create the app
        Form form
        Page homePage = form:GetMainPage() 

        TextBox field = homePage:AddTextBox("my textbox")
        
        form:Display()
    end
end

AddTextField(text name)

This action adds a text field to the control.

Parameters

  • text name: The text name identifying the text field.

Return

Libraries.Interface.Controls.TextField: The text field object that was added to the control.

Example

use Libraries.Interface.Forms.Form
use Libraries.Interface.Forms.Page
use Libraries.Interface.Controls.TextField

class Main
    action Main
        // create the app
        Form form
        Page homePage = form:GetMainPage() 

        TextField field = homePage:AddTextField("my field")
        
        form:Display()
    end
end

AddTouchListener(Libraries.Interface.Events.TouchListener listener)

This action adds a TouchListener to the Item. If the Item ever receives a TouchEvent, the listener will be notified.

Parameters

Example

use Libraries.Interface.Item
use Libraries.Interface.Events.TouchListener
Item myItem
TouchListener listener
myItem:AddTouchListener(listener)

Advance(number time)

This action is used to advance the item forward in time in physics space to synchronize it for time of impact solving. This action is used internally and users should not need to use this action. Attribute Parameter time The amount of seconds to advance the item forward in time

Parameters

  • number time

ApplyAngularImpulse(number impulse)

This action applies an angular impulse to this item. The units are in kilogram units squared per second. This modifies the angular velocity of this item. Physics mus