-
Couldn't load subscription status.
- Fork 54
wcPanel
The public interface for the docking panel, it contains a layout that can be filled with custom elements and a number of convenience functions for use.
You should not be constructing these by hand, instead use wcDocker.addPanel()
for proper construction.
type
Type: String
The type name of the panel, pre-registered using wcDocker.registerPanelType().
Provides access to the main wcDocker object.
Gets, or Sets the displayed title for this panel.
title
Type: String
If supplied, will assign a new title for this panel.
Provides access to the internal wcLayout object.
Brings this panel into focus by making its floating window top-most and
activating its current tab item.
flash
Type: Boolean
An optional parameter to cause a flashing effect on the window.
Version: Beta
Creates a custom button that appears on the upper right of the panels title bar.
You can catch press or toggle actions by catching the wcDocker.EVENT_BUTTON event.
name
String: The custom name of the button, used to identify it.
className
String: A custom class name to apply to the button.
text
String: A text string to assign as the text of the button. The button, by default, is only large enough to fit a single letter.
tip
String: A tooltip string for the button.
isToggle
Boolean: True to make the button a toggle button.
Version: Beta
Removes a previously added button, identified by its name.
name
String: The previously assigned name of the button to identify it.
Gets, or Sets the desired starting position for the panel. Note: Setting the
position only works during the creation callback of a new panel and only if it
is floating.
x, y
Type: Number
The desired X and Y screen position (in a percentage value from 0-1) in which to center the floating panel.
Sets the initial desired size of the panel. Note: Setting the size will
only work during the creation callback of a new panel.
x, y
Type: Number
The desired X and Y size, in pixels, for the panel.
Designates a minimum constraint size for this panel. It is recommended
that you minimize use of this function except in extreme circumstances,
as it can severely limit the users interaction.
x, y
Type: Number
The minimum X and Y size, in pixels, for this panel.
Designates a maximum constraint size for this panel. It is recommended
that you minimize use of this function except in extreme circumstances,
as it can severely limit the users interaction.
x, y
Type: Number
The maximum X and Y size, in pixels, for this panel.
Either scrolls the panel to a given position, or retrieves the current
scroll position.
x, y
Type: Number
If supplied, will assign a new X and Y scroll position for the panel.
Allows elements to draw beyond the bounds of the panel, good for popup menus and the
like. Note, enabling this feature will cause scrolling of the panel to be disabled.
If the visibility is not supplied, will retrieve the current visibility instead.
visible
Type: Boolean
If supplied, will assign the overflow visibility.
Designates whether the inner layout can show its scroll bars (if needed).
By default, x and y scroll is enabled.
x, y
Type: Boolean
Whether the layout can scroll in a direction.
Gets, or Sets the moveable status of the panel. A non-moving panel appears
with no title bar and no panels can be docked relative to it.
enabled
Type: Boolean
If supplied, will assign whether the panel can be moved.
Gets, or Sets whether the panel can be closed by the user via 'X' button.
enabled
Type: Boolean
If supplied, will assign whether the panel can be closed.
Closes the panel, this can be done even if closeable is not enabled.
Registers the panel to receive an event.
eventType
Type: String
The event type, case sensitive. Any type name can be used and triggered manually, however,
the following event types are used internally and are defined by the following:
wcDocker.EVENT_UPDATED = 'panelUpdated' = When the panel is updated internally (usually when it is resized).
wcDocker.EVENT_CLOSED = 'panelClosed' = When the panel has been closed and is about to be destroyed.
wcDocker.EVENT_ATTACHED = 'panelAttached' = When the panel has changed from a floating panel to a docked panel.
wcDocker.EVENT_DETACHED = 'panelDetached' = When the panel has changed from a docked panel to a floating panel.
wcDocker.EVENT_MOVED = 'panelMoved' = Whenever the position of the panel has changed.
wcDocker.EVENT_RESIZED = 'panelResized' = Whenever the size of the panel has changed.
wcDocker.EVENT_SCROLLED = 'panelScrolled' = Whenever the contents of the panel has scrolled.
wcDocker.EVENT_SAVE_LAYOUT = 'layoutSave' = Whenever the layout is being saved on this panel.
wcDocker.EVENT_RESTORE_LAYOUT = 'layoutRestore' = Whenever the layout is being restored on this panel.
All of these internal event types pass nothing as its custom data except for the save and restore layout events. The save layout event passes in an empty object that can be filled with whatever data you wish to save, and the restore layout event returns that same object for loading.
Version: Beta
wcDocker.EVENT_BUTTON = 'panelButton' = Whenever a custom button, added with wcPanel.addButton(), for the panel is pressed or toggled by the user, this event is triggered with a data object in the form {name:String, state:String}. The name is the name identifier used as the first parameter of the addButton() function and the state is a string value matching either wcDocker.BUTTON_STATE_NORMAL or wcDocker.BUTTON_STATE_TOGGLED.
handler
Type: Function(data)
The function callback to be called whenever this event has been triggered. 'this' is the panel itself and the parameter given is the custom data object defined by the event type received.
Unregisters an event on this panel.
eventType
Type: String
The event type to unregister, case sensitive. If the parameter is omitted, all events on the panel will be removed.
handler
Type: Function(panel, data)
If supplied, will only remove an event that matches the given handler function.
Manually triggers an event. This will propagate to all panels and has
the same functionality as wcDocker.trigger().
eventType
Type: String
The event type to trigger, case sensitive.
data
Type: Object
Any custom data object that will be passed into all receiving event handlers.