Class: Selectable

DKTools.Window.Selectable

new DKTools.Window.Selectable ()

Extends

  • Window_Selectable

Mixes In

Classes

Selectable

Members

_itemPaintOpacity function | Number privatereadonly

_itemTextColor function | String privatereadonly

Methods

_createAllParts ()

_refreshArrows ()

Refreshes arrows

_updateArrows () private

addItem (item)

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

bottomCol ()Number

Returns bottom column
Since:
  • 10.0.0
Returns:
Type Description
Number Bottom column

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
Returns:
Type Description
Number Current column

currentExt ()* | null

Returns the current ext
Since:
  • 10.0.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:
  • 10.0.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

drawAll ()

Draws all

drawAllItems ()

Draws all items

drawItem (index)

Draws the item
Name Type Description
index Number Index

ensureCursorVisible ()

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

initialize (object, y, width, height)

Initializes a selectable window
Name Type Description
object Number | Graphics | Object optional The X coordinate or Graphics or object with parameters
y Number optional The Y coordinate (if object is Number)
width Number optional Width of the window (if object is Number)
height Number | String optional Height of the window or number of lines (String) (if object is Number)
object.x Number optional The X coordinate
object.y Number optional The Y coordinate
object.width Number optional Width of the window
object.height Number | String optional Height of the window or number of lines (String)

isCurrentItemEnabled ()Boolean

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

isCursorVisible ()Boolean

Returns true if the cursor is visible
Returns:
Type Description
Boolean Cursor is visible

isItemEnabled (index)Boolean

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

item (index)Object | null

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

itemExt (index)* | null

Returns the command ext
Name Type Description
index Number Index
Since:
  • 10.0.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:
  • 10.0.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

itemSymbol (index)String | null

Returns the command symbol
Name Type Description
index Number Index
Since:
  • 10.0.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

maxTopCol ()Number

Returns the maximum top column
Returns:
Type Description
Number Maximum top column

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:
  • 10.0.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:
  • 10.0.0
Returns:
Type Description
Object | null Next item or null

onTouch (triggered)

Name Type Description
triggered Boolean optional

playCursorSound ()

Plays "cursor" sound

prevIndex (wrap)Number

Returns the previous index
Name Type Default Description
wrap Boolean false optional Wrap cursor
Since:
  • 10.0.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:
  • 10.0.0
Returns:
Type Description
Object | null Previous item or null

processCancel ()

Processes cancel

processOk ()

Processes ok

processWheel ()

Processes wheel scroll

refresh ()

refreshAll ()

Refreshes the window

scrollLeft ()

Scrolls left

scrollRight ()

Scrolls right

select (index, playCursor)

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

selectExt (ext)

Selects ext
Name Type Description
ext * Ext
Version:
  • 10.0.3

selectFirstItem (playCursor)

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

selectLasItem (playCursor)

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

selectNextItem (wrap, playCursor)

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

selectPrevItem (wrap, playCursor)

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

selectSymbol (symbol)

Select symbol
Name Type Description
symbol String Symbol
Version:
  • 10.0.3

setBottomCol (col)

Name Type Description
col Number Column

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

setTopCol (col)

Name Type Description
col Number Column

setTopRow (row)

Name Type Description
row Number Row

setupAll (object)

Sets all parameters
Name Type Default Description
object Object {} optional Parameters
Name Type Description
index Number optional Index
maxCols Number optional Number of the columns
items Array.<Object> optional List of the items
drawItemHandler function optional Handler of draw of the item
itemWidth function | Number optional Width of the item
itemHeight function | Number optional Height of the item
itemFont function | Object optional Font 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

setupItemHeight (itemHeight)

Sets the height of the item
Name Type Description
itemHeight function | Number optional Height 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

setupItemWidth (itemWidth)

Sets the width of the item
Name Type Description
itemWidth function | Number optional Width 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
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:
  • 10.0.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

updateArrows ()

Updates the arrows

updateSelectEvents ()

Updates the events with type: select
Version:
  • 10.0.5