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

TabbedView : Object
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

TabbedView.new(parent, bounds, labels, colors, name: " ", scroll: false)

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

TabbedView.newPacked(parent, bounds, labels, colors, name: " ", scroll: false)

create a very space efficient TabbedView

TabbedView.newFlat(parent, bounds, labels, colors, name: " ", scroll: false)

create a flat TabbedView

TabbedView.newTall(parent, bounds, labels, colors, name: " ", scroll: false)

create a tall TabbedView

TabbedView.newColor(parent, bounds, labels, colors, name: " ", scroll: false)

create a Tabbed View with rgb tabs

TabbedView.newColorLabels(parent, bounds, labels, colors, name: " ", scroll: false)

create a Tabbed View with rgb labels

TabbedView.newBasic(parent, bounds, labels, colors, name: " ", scroll: false)

create a very basic TabbedView

TabbedView.newTransparent(parent, bounds, labels, colors, name: " ", scroll: false)

create a transparent TabbedView

TabbedView.newRGB: METHOD NOT FOUND!

deprecated, use newColor

TabbedView.newRGBLabels: METHOD NOT FOUND!

deprecated, use newColorLabels

Inherited class methods

Instance Methods

.view

Returns:

the container for all the views

.views

Returns:

an array of Composite/Scroll Views

.add(label, index)

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(index, label)

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(index)

remove tab at Index

Arguments:

index

the index of the tab to be removed

.focus(index)

selects one of the tabs

Arguments:

index

int, the index to focus

.activeTab

Returns:

returns the index of the focused tab

.focusActions

.focusActions = value

Arguments:

(value)

an Array of user onFocus functions.

Returns:

an Array of user onFocus functions.

.unfocusActions

.unfocusActions = value

Arguments:

(value)

an Array of user onUnfocus functions.

Returns:

an Array of user onUnfocus functions.

.tabPosition

.tabPosition = symbol

Arguments:

symbol

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

.followEdges

.followEdges = bool

Set tabs parallel or perpendicular to container edges.

Arguments:

bool

default true. (Set tabs parallel)

.resize

.resize = int

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

Arguments:

int

default 1

.labelColors = colorArray

set the label colors

Arguments:

colorArray

Array of Colors for the tabs.

.unfocusedColors = colorArray

set the unfocusedColors colors

Arguments:

colorArray

Array of Colors for the unfocused tabs

.focusFrameColor

.focusFrameColor = color

set the focusFrameColor

Arguments:

color

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

.unfocusTabs

.unfocusTabs = value

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 = colorArray

Arguments:

colorArray

Array of Colors for the CompositeViews

.stringColor = color

Arguments:

color

a Color

.stringFocusedColor = color

Arguments:

color

a Color

.labelPadding

.labelPadding = int

Arguments:

int

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

.tabWidth = int

Arguments:

int

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

.tabHeight

.tabHeight = val

Arguments:

int

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

.tabCurve = int

Arguments:

int

the radius in pixels of the rounded tab corners

.swingFactor

.swingFactor = value

Arguments:

(point)

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

.font

.font = fnt

(describe method here)

Arguments:

fnt

(describe argument here)

Returns:

(describe returnvalue here)

.doActions

do the actions of the current tab

Inherited instance methods

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