DanielBullimore / OOmutiny

OO Javascript frontend
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

0.1.1.2 List box #10

Closed DanielBullimore closed 4 years ago

DanielBullimore commented 5 years ago

Priority: Unset

Depends:

0.0 Master (OO)-[OO.class.js] => 0.1 Point (OoPoint)-[OoPoint.class.js] => 0.1.1 Region (OoRegion)-[OoPointRegion.class.js]

Implements:

0.1.1.2.1 List Item (OoListItem)-[OoPointRegionTextListItem.class.js]]

UML:

OoListbox-03-11-2019

Overview :

Effectively a graphical means of displaying arrays of objects. By default displays text list items.

Description:

Encapsulates all code required to define, render and control a OO List Box (OoPointRegionListbox.class.js) object. OO List Box objects contain OO List Items or OO List Item decedents. One list item can be selected, its then highlighted. When selected a list items's funOnSelectAction() method is called. This function can be defined and redefined at any stage of the instances life span.

Methods:

funRender() - Generates and renders a graphical representation of this object on GUI.

funAddItemArray() - Replaces the array of objects for the listbox's item array. Listboxes that have already been rendered on the document are rerendered.

funAddItem() - Adds a single item to a List Box instance's item array and updates the display if the List Box has been rendered. 

funRemoveItemIndex() - removes a single list item from the items array and the list box if it has been rendered.

funClearList() - Removes all list items from the items list and clears the List Box if it has been rendered.

funSortList - Sorts List 0-z.

funSelectItem() - Records a List Object's array key as 'has focus' and highlights the List Object if it has been rendered.

funDeselect() - unsets the List Box's selected index record and un-highlight the List Object if the List Box has been rendered.

funGetSelectedItem() - returns the object handle associated with currently selected item.

funGetObjectList() - returns a COPY of object list array

funGetSelectedIndex() - returns the list index of selected list object

funSetHighlightColor() - public function, accepts objNewHighlightColor as OoColor, sets objHighlightColor used to show a selected item with in the list.

Properties:

rayItems - array, a list of objects (objects require a toString method) to be represented as items in the listbox.

numSelectedIndex - number, contains a record of an items array key that currently has focus.

strHighlightColor - OoColor, color to highlight a selected list item.
DanielBullimore commented 4 years ago

sanity checking finds color parameters accept string not color object UML class is out of sysnc with UML Class Diagram Final Draft. Some attributes are public scope that should be protected: objHighlightColor, rayItems; objHighlightColor does not have get or set methods objForegroundColor is redundant as OoListItem inherits from OoText which already has a text color property. Correcting. Sanity check complete