Class: Selectable

DKTools.Window.Selectable

new DKTools.Window.Selectable ()

Extends

  • Window_Selectable

Mixes In

Members

_itemPaintOpacity function | Number privatereadonly

_itemTextColor function | String privatereadonly

Methods

_clearAll () private

Clears all
Version:
  • 1.1.5

addItem (item)

Adds an item
Name Type Description
item Object Item
Since:
  • 1.1.1

callHandler (symbol)

Calls the handler of the symbol
Name Type Description
symbol String Symbol

callOkHandler ()

Calls the handler of the Ok

changePaintOpacity (paintOpacity)

Changes the paint opacity
Name Type Description
paintOpacity Boolean | Number Paint opacity

col ()Number

Returns the current column
Since:
  • 1.1.0
Returns:
Type Description
Number Current column

contentsWidth ()Number

Returns width of the contents
Returns:
Type Description
Number Width of the contents

currentExt ()* | null

Returns the current ext
Since:
  • 1.1.1
Returns:
Type Description
* | null Ext or null

currentItem ()Object | null

Returns the current item (selected item)
Returns:
Type Description
Object | null Current item (selected item) or null

currentSymbol ()* | null

Returns the current symbol
Since:
  • 1.1.1
Returns:
Type Description
* | null Symbol or null

cursorDown (wrap)

Moves the cursor to down
Name Type Default Description
wrap Boolean false optional Wrap cursor

cursorLeft (wrap)

Moves the cursor to left
Name Type Default Description
wrap Boolean false optional Wrap cursor

cursorRight (wrap)

Moves the cursor to right
Name Type Default Description
wrap Boolean false optional Wrap cursor

cursorUp (wrap)

Moves the cursor to up
Name Type Default Description
wrap Boolean false optional Wrap cursor

disableItemsBackground ()

Disables the items background
Since:
  • 1.1.5

drawAll ()

Draws all

drawAllItems ()

Draws all items

drawItem (index)

Draws the item
Name Type Description
index Number Index

ensureCursorVisible (smooth)

Name Type Default Description
smooth Boolean false optional Smooth

findExt (ext)Number

Finds the ext Returns index
Name Type Description
ext * Ext
Returns:
Type Description
Number Index

findSymbol (symbol)Number

Finds the symbol Returns index
Name Type Description
symbol String Symbol
Returns:
Type Description
Number Index

hasItems ()Boolean

Returns true if the items exists
Returns:
Type Description
Boolean Items exists

hasSymbol (symbol)Boolean

Returns true if the item with symbol exists
Name Type Description
symbol String Symbol
Returns:
Type Description
Boolean Item with symbol exists

hideCursor ()DKTools.Event

Hides the cursor Returns the event with "update" type
Returns:
Type Description
DKTools.Event Event

isCurrentItemEnabled ()Boolean

Returns true if the current item (selected item) is enabled
Returns:
Type Description
Boolean Current item (selected item) is enabled

isHorizontal ()Boolean

Returns true if the horizontal scrolling
Returns:
Type Description
Boolean Horizontal scrolling

isItemEnabled (index)Boolean

Returns true if the item is enabled
Name Type Description
index Number Index
Returns:
Type Description
Boolean Item is enabled

isItemsBackgroundEnabled ()Boolean

Returns true if the items background enabled
Since:
  • 1.1.5
Returns:
Type Description
Boolean Items background enabled

isItemSelected (index)Boolean

Returns true if the item is selected
Name Type Description
index Number Index
Since:
  • 1.1.5
Returns:
Type Description
Boolean Item is selected

isOkEnabled ()Boolean

Returns true if the OK enabled
Returns:
Type Description
Boolean OK enabled

isRefreshOnSelect ()Boolean

Returns true if the refreshing when the item is selected
Since:
  • 1.1.5
Returns:
Type Description
Boolean Refreshing when the item is selected

isScrollEnabled ()Boolean

Returns true if the scroll enabled
Returns:
Type Description
Boolean Scroll enabled

item (index)Object | null

Returns the item by index
Name Type Description
index Number Index
Since:
  • 1.1.0
Returns:
Type Description
Object | null Item or null

itemExt (index)* | null

Returns the command ext
Name Type Description
index Number Index
Since:
  • 1.1.1
Returns:
Type Description
* | null Command ext

itemExt (index)* | null

Returns the ext of the item by index
Name Type Description
index Number Index
Returns:
Type Description
* | null Ext of the item by index or null

itemHeight ()Number

Returns the height of the item
Returns:
Type Description
Number Height of the item

itemName (index)String | undefined

Returns the name of the item
Name Type Description
index Number Index
Since:
  • 1.1.1
Returns:
Type Description
String | undefined Name of the item

itemPaintOpacity (index)Number

Returns the paint opacity of the item
Name Type Description
index Number Index
Returns:
Type Description
Number Paint opacity of the item

itemRect (index)

Name Type Description
index Number Item index
Version:
  • 1.2.5

itemSymbol (index)String | null

Returns the command symbol
Name Type Description
index Number Index
Since:
  • 1.1.1
Returns:
Type Description
String | null Command symbol

itemTextAlign (index)String

Returns the align of the item
Name Type Description
index Number Index
Returns:
Type Description
String Align of the item

itemTextColor (index)String

Returns the text color of the item
Name Type Description
index Number Index
Returns:
Type Description
String Text color of the item

itemWidth ()Number

Returns the width of the item
Returns:
Type Description
Number Width of the item

maxCols ()Number

Returns max cols
Returns:
Type Description
Number Max cols

maxItems ()Number

Returns max items
Returns:
Type Description
Number Max items

maxPageItems ()Number

Returns page items
Returns:
Type Description
Number Page items

maxVisibleItems ()Number

Returns max visible items
Returns:
Type Description
Number Max visible items

nextIndex (wrap)Number

Returns the next index
Name Type Default Description
wrap Boolean false optional Wrap cursor
Since:
  • 1.1.0
Returns:
Type Description
Number Next index

nextItem (wrap)Object | null

Returns the next item
Name Type Default Description
wrap Boolean false optional Wrap cursor
Since:
  • 1.1.0
Returns:
Type Description
Object | null Next item or null

overallHeight ()Number

Returns the overall height
Returns:
Type Description
Number Overall height

overallWidth ()Number

Returns the overall width
Returns:
Type Description
Number Overall width

paint ()

playCursorSound ()

Plays "cursor" sound

prevIndex (wrap)Number

Returns the previous index
Name Type Default Description
wrap Boolean false optional Wrap cursor
Since:
  • 1.1.0
Returns:
Type Description
Number Previous index

prevItem (wrap)Object | null

Returns the previous item
Name Type Default Description
wrap Boolean false optional Wrap cursor
Since:
  • 1.1.0
Returns:
Type Description
Object | null Previous item or null

processCancel ()

Processes cancel

processOk ()

Processes ok

refreshAll ()

Refreshes the window

refreshOnSelect ()

Enables refreshing when the item is selected
Since:
  • 1.1.5

select (index, playCursor)

Selects the item
Name Type Default Description
index Number Index
playCursor Boolean false optional Play "cursor" sound
Version:
  • 1.1.5

selectExt (ext)

Selects ext
Name Type Description
ext * Ext

selectFirstItem (smooth, playCursor)

Selects the first item
Name Type Default Description
smooth Boolean false optional Smooth select
playCursor Boolean false optional Play "cursor" sound

selectLasItem (smooth, playCursor)

Selects the last item
Name Type Default Description
smooth Boolean false optional Smooth select
playCursor Boolean false optional Play "cursor" sound

selectNextItem (wrap, smooth, playCursor)

Selects the next item
Name Type Default Description
wrap Boolean false optional Wrap cursor
smooth Boolean false optional Smooth select
playCursor Boolean false optional Play "cursor" sound

selectPrevItem (wrap, smooth, playCursor)

Selects the previous item
Name Type Default Description
wrap Boolean false optional Wrap cursor
smooth Boolean false optional Smooth select
playCursor Boolean false optional Play "cursor" sound

selectSymbol (symbol)

Select symbol
Name Type Description
symbol String Symbol

setItems (items, blockStart)Boolean

Sets the items Returns true if the change occurred
Name Type Default Description
items Array.<Object> Items
blockStart Boolean false optional Blocking call of the "start" function
Returns:
Type Description
Boolean Change occurred

setMaxCols (maxCols, blockStart)Boolean

Sets the max cols Returns true if the change occurred
Name Type Default Description
maxCols Number Max cols
blockStart Boolean false optional Blocking call of the "start" function
Returns:
Type Description
Boolean Change occurred

setupAll (object)

Sets all parameters
Name Type Default Description
object Object {} optional Parameters
Name Type Description
maxCols Number optional Number of the columns
items Array.<Object> optional List of the items
drawItemHandler function optional Handler of draw of the item
itemTextColor function | String optional Text color of the item
itemPaintOpacity function | Number optional Paint opacity of the item
itemAlign function | String optional Align of the item
itemDrawHandler function optional Handler of draw of the item

setupItemAlign (itemAlign)

Sets the align of the item
Name Type Description
itemAlign function | String Align of the item

setupItemDrawHandler (handler)

Sets the handler of draw of the item
Name Type Description
handler function optional Handler of draw of the item

setupItemPaintOpacity (itemPaintOpacity)

Sets the paint opacity of the item
Name Type Description
itemPaintOpacity function | Number optional Paint opacity of the item

setupItems (items)

Sets the list of the items
Name Type Description
items Array.<Object> optional Items
items[].name function | String optional Item name
items[].align function | String optional Item align
items[].textColor function | String optional Item text color
items[].paintOpacity function | Number optional Item paint opacity
items[].enabled function | Boolean optional Item activity
items[].symbol String optional Item symbol
items[].handler function optional Symbol handler
items[].drawHandler function optional Handler of draw of the item
items[].selectHandler function optional Item select handler
items[].okHandler function optional Item ok handler
items[].cancelHandler function optional Item cancel handler

setupItemTextColor (itemTextColor)

Sets the text color of the item
Name Type Description
itemTextColor function | String optional Text color of the item

setupMaxCols (cols)

Sets the number of the columns
Name Type Default Description
cols Number this.standardMaxCols() optional Number of the columns

setupSize (width, height)

Sets the size of the window
Name Type Description
width Number | Object optional Width of the window
height Number | String optional Height of the window or number of lines (String)

standardContentsSprite ()Sprite

Returns the standard sprite of the contents
Returns:
Type Description
Sprite Standard sprite of the contents

standardItemDrawHandler ()function

Returns the standard handler of draw of the item
Version:
  • 1.1.0
Returns:
Type Description
function Standard handler of draw of the item

standardItems ()Array.<Object>

Returns the standard items
Returns:
Type Description
Array.<Object> Standard items

standardItemTextAlign ()String

Returns the standard text align
Since:
  • 1.1.1
Returns:
Type Description
String Standard text align

standardMaxCols ()Number

Returns the standard number of the columns
Returns:
Type Description
Number Standard number of the columns

topCol ()Number

Returns the top column
Returns:
Type Description
Number Top column

topIndex ()Number

Returns the top index
Returns:
Type Description
Number Top index

update ()

Updates the window

updateOrigin ()

Updates the origin

updateSelectEvents ()

Updates the events with type: select
Version:
  • 1.1.6