There are extensive explanations in the Examples section on how to use TabbedView with its many configuration options .
by Jost Muxfeldt, OCT 09, 2012 version 1.29. Change History at bottom.
create a Tabbed View
parent |
a parent view. if nil, then a new window is created |
bounds |
Rect . if nil then the parent Rect is used |
labels |
an array of strings. determines how many tabs there are. default ["tab1", "tab2", "tab3"] |
colors |
an array of colors. if the array is smaller than the amount of labels, the color series repeats. For convenience, a color scheme is automatically created using these colors. You cannot use gradients here, because the tabs are drawn with Pen. Gradients only work with background_; Custom color schemes and shapes can be controlled with instance variables or with the *new variations below. |
name |
a name for the window if a new window is created (view==nil) -- default " " |
scroll |
boolean defaults to false. It substitutes the CompositeView with a ScrollView. |
returns a TabbedView
create a very space efficient TabbedView
create a flat TabbedView
create a tall TabbedView
create a Tabbed View with rgb tabs
create a Tabbed View with rgb labels
create a very basic TabbedView
create a transparent TabbedView
deprecated, use newColor
deprecated, use newColorLabels
the container for all the views
an array of Composite/Scroll Views
adds a tab with label
label |
string, the label |
index |
int, (optional) the index at which the tab is inserted (if nil, add to the end) |
the tab container that was added
inserts a tab at index with label string
index |
the index at which the tab is inserted |
label |
(describe argument here) |
the tab container that was added
remove tab at Index
index |
the index of the tab to be removed |
selects one of the tabs
index |
int, the index to focus |
returns the index of the focused tab
value |
an Array of user onFocus functions. |
an Array of user onFocus functions.
value |
an Array of user onUnfocus functions. |
an Array of user onUnfocus functions.
symbol |
\left, \top, \right, or \bottom. |
Set tabs parallel or perpendicular to container edges.
bool |
default true. (Set tabs parallel) |
set the label colors
colorArray |
Array of Colors for the tabs. |
set the unfocusedColors colors
colorArray |
Array of Colors for the unfocused tabs |
set the focusFrameColor
color |
Array of Colors for the unfocused tabs Color of the focus frame of the tabs. Cocoa only |
Unfocuses the UserView which draws the tabs after a tab is clicked. Defaut on Cocoa or QT is false, otherwise true. (because Swing can't hide focus frames);
colorArray |
Array of Colors for the CompositeViews |
color |
a Color |
color |
a Color |
int |
if autosizing is on, then this determines left and right padding from th label text |
int |
int or \auto ; a fixed tab width, or "auto" for automatic tab width (default "auto", unless using themes) |
int |
int or \auto ; a fixed tab height, or "auto" for automatic tab height (default "auto", unless using themes) |
int |
the radius in pixels of the rounded tab corners |
point |
Point ; a multiplication factor for a string/tab width for GUI.swing only. default Point(0.52146,1.25) |
(describe method here)
fnt |
(describe argument here) |
(describe returnvalue here)
do the actions of the current tab
Usage:
use CompositeView style GUI
use FlowView style GUI
quick styling with variations on *new:(There are some color differences for swing)
set tabPosition and followEdges:live switching adjusts positions of contents if you use .flow .
Drag objects from one tab to another (under cocoa and qt only at the moment):
add, removeAt, insert tabs
defaults on *new, but other thems use fixedwidths:
nest TabbedViews & use scrolling
uses scroll:true in the inner tab
user functions: focus and unfocus
turn on/off scopes , e.g.
focusFrameColor_(color) and unfocusTabs_(bool)The tabs are drawn with user view which have a clear focus frame on Cocoa. On Swing, the frame cannot be made clear, so by default the tabs are unfocused after clicking. You can change this if it interferes with your tabbing scheme.
default autosizing tabs
defaults to auto on *new, but other themes use fixedwidths:
fixed tab sizes
set font
Swing fonts only work within certain limits for now. use swingFactor_ to adjust the conversion.
Set colors with an argument to .newColors can wrap around if there are less than there are labels. Unfocused colors are calculated automatically.
Set colors very specifically to your own taste using set methods
adjust padding and curves for small autowidth
labelPadding only has an effect on autowidth
adjust tab height and curves