CodeThatTab Reference
Class CTabSet
Fields:
- CTab currTab
- current tab object
- Object def
- user definition for TabSet, it structure is
- {
- int x
- left coordinate of TabSet container, used only for old browsers, for new one positiong of TabSet is relative to parent element, in case not parent element presents uses BODY element.
- int y
- top coordinate of TabSet container, used only for old browsers, for new one positiong of TabSet is relative to parent element, in case not parent element presents uses BODY element.
- int width
- width of TabSet container
- int height
- height of TabSet container
- int offset
- offset before first tab in TabSet
- int spacing
- spacing between tabs in TabSet
- int padding
- padding of hint area of tab
- String layout
- Value from this set : "top", "left", "right", "bottom", defined layout of tabs, by default value is "top"
- String css
- default css class for TabSet, uses if no css property defined for tab
- String cssover
- over css class for TabSet, uses when mouse over tab and if no cssover property defined for tab
- String csscurr
- active css class for TabSet, uses when tab is current and if no csscurr property defined for tab
- String csshint
- css class for hint area of TabSet, uses if no csshint property defined for tab
- Object border
- {width:int, color:String}, represent border for TabSet, uses if no border defined for tab
- [] tabs
- array of objects, each of them has following structure
- {
- String text
- Any HTML formatted text, represents text for tab area
- String hint
- Any HTML formatted text, represents text for hint area
- String css
- default css class for tab
- String cssover
- over css class for tab, uses when mouse over tab
- String csscurr
- active css class for tab, uses when tab is current
- String csshint
- css class for hint area of tab
- Object border
- {width:int, color:String}, represent border for tab and hint of it
- int width
- width of tab
- int height
- height of tab
- Object action
- Represents action definition for tab, its structure is
- {
- js
- JS code uses as handler for onClick event
- jsover
- JS code uses as handler for onMouseOver event
- jsout
- JS code uses as handler for onMouseOut event
- url
- go to URL
- target
- link target
}
}
}
- String id
- id of TabSet, that uses to access TabSet in global array CodeThatTabs
- [] tabs
- Array of CTab objects that represent tabs in tab set
Note! User can use additional properties, named css*, they will be automatically read into CTabSet and CTab objects
Constructor:
- CTabSet(id)
- creates CEditor object with id
Methods:
- create(tabDef)
- inits CTabSet object with parameters from tabDef definition, this definition kept in CTabSet.def property
- draw ([u])
- draws TabSet in browser (for new browser), u is optional parameter, that indicates is draw called by user click on tab or not
- drawOldB (ct)
- draws TabSet in browser (for old browser), ct is CTab object that defiend current tab for TabSet, if ct equals CTabSet.currTab nothing happened
- getID (s)
- Returns string CTabSet.id + '_' + s, that used for named HTML container for TabSet
- setCurrTab (text, [id])
- Set current tab in TabSet by text or by id, id parameter is uses only if text is not defined
- toHTML ([inDiv[, ct])
- Returns HTML representation of TabSet (for new browser), creates HTML container DIV if inDIv is true and set current tab as ct, if ct is defined
- toHTMLOldB ()
- Returns HTML representation of TabSet (for old browser)
Class CTab
Fields:
- int id
- index in tabs array of TabSet
- CTabSet tabSet
- TabSet object - owner of this tab
- String text
- Any HTML formatted text, represents text for tab area
- String hint
- Any HTML formatted text, represents text for hint area
- String css
- default css class for tab
- String cssover
- over css class for tab, uses when mouse over tab
- String csscurr
- active css class for tab, uses when tab is current
- String csshint
- css class for hint area of tab
- Object border
- {width:int, color:String}, represent border for tab and hint of it
- int width
- width of tab
- int height
- height of tab
- Object action
- Represents action definition for tab, its structure is
- {
- js
- JS code uses as handler for onClick event
- jsover
- JS code uses as handler for onMouseOver event
- jsout
- JS code uses as handler for onMouseOut event
- url
- go to URL
- target
- link target
}
Constructor:
- CTab(id, tabSet, tabDef)
- create CTab object with id and tabSet-owner, defined from tabDef. tabDef has structure described for def.tabs element
Methods:
- actionOf ()
- Returns String href="" onMouseOver="" onMouseOut="" that uses inside tag A for set action for node
- getCSS ()
- Returns current css class used for tab
- getHint()
- Returns HTML representation of hint area
- getID (s)
- Returns string this.tabSet.id + '_' + this.id + ((Def(s)) ? s : '') that uses for named CTab HTML container
- getText ()
- Returns HTML representation of tab area
- init (tabDef)
- Inits from tabDef object. tabDef has structure described for def.tabs element
Read more about CodeThatTab >>
|