TabbedView:
Filter:
TabbedView/Classes (extension) | GUI > Views

TabbedView
ExtensionExtension

an array of CompositeViews (or ScrollViews) with tabs for switching

Description

There are extensive explanations in the Examples section on how to use TabbedView with its many configuration options .

Author

by Jost Muxfeldt, OCT 09, 2012 version 1.29. Change History at bottom.

WARNING: TabbedView is maintained only for backward compatabiity!. Please use TabbedView2 for new code. (you may have to activate the TabbedView2 Quark).

Class Methods

.new

create a Tabbed View

Arguments:

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:

returns a TabbedView

.newPacked

create a very space efficient TabbedView

.newFlat

create a flat TabbedView

.newTall

create a tall TabbedView

.newColor

create a Tabbed View with rgb tabs

.newColorLabels

create a Tabbed View with rgb labels

.newBasic

create a very basic TabbedView

.newTransparent

create a transparent TabbedView

.newRGB

deprecated, use newColor

.newRGBLabels

deprecated, use newColorLabels

Instance Methods

.view

Returns:

the container for all the views

.views

Returns:

an array of Composite/Scroll Views

.add

adds a tab with label

Arguments:

label

string, the label

index

int, (optional) the index at which the tab is inserted (if nil, add to the end)

Returns:

the tab container that was added

.insert

inserts a tab at index with label string

Arguments:

index

the index at which the tab is inserted

label

(describe argument here)

Returns:

the tab container that was added

.removeAt

remove tab at Index

Arguments:

index

the index of the tab to be removed

.focus

selects one of the tabs

Arguments:

index

int, the index to focus

.activeTab

Returns:

returns the index of the focused tab

.focusActions

Arguments:

value

an Array of user onFocus functions.

Returns:

an Array of user onFocus functions.

.unfocusActions

Arguments:

value

an Array of user onUnfocus functions.

Returns:

an Array of user onUnfocus functions.

.tabPosition

Arguments:

symbol

\left, \top, \right, or \bottom.

.followEdges

Set tabs parallel or perpendicular to container edges.

Arguments:

bool

default true. (Set tabs parallel)

.resize

sets the resize flag (1-9 ). see Resize behaviour

Arguments:

int

default 1

.labelColors

set the label colors

Arguments:

colorArray

Array of Colors for the tabs.

.unfocusedColors

set the unfocusedColors colors

Arguments:

colorArray

Array of Colors for the unfocused tabs

.focusFrameColor

set the focusFrameColor

Arguments:

color

Array of Colors for the unfocused tabs Color of the focus frame of the tabs. Cocoa only

.unfocusTabs

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);

.backgrounds

Arguments:

colorArray

Array of Colors for the CompositeViews

.stringColor

Arguments:

color

a Color

.stringFocusedColor

Arguments:

color

a Color

.labelPadding

Arguments:

int

if autosizing is on, then this determines left and right padding from th label text

.tabWidth

Arguments:

int

int or \auto ; a fixed tab width, or "auto" for automatic tab width (default "auto", unless using themes)

.tabHeight

Arguments:

int

int or \auto ; a fixed tab height, or "auto" for automatic tab height (default "auto", unless using themes)

.tabCurve

Arguments:

int

the radius in pixels of the rounded tab corners

.swingFactor

Arguments:

point

Point ; a multiplication factor for a string/tab width for GUI.swing only. default Point(0.52146,1.25)

.font

(describe method here)

Arguments:

fnt

(describe argument here)

Returns:

(describe returnvalue here)

.doActions

do the actions of the current tab

Examples

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

Change History