TabView

Version 1.0

 

Description:

This PHP component class is used to generate navigable tabs.

 

Usage:

  1. Require the ďtab_view.phpĒ file in the PHP script you wish to write the tabs.

e.g.† require(ďpath/to/tree_view.phpĒ)

 

  1. Instantiate the TabView class.

e.g.† $TabView = new TabView;

 

  1. Set the following TabView class properties (public variables):

 

    1. $TabView->BackColor = (String)

Default:† #EEEEFF

Sets the background color for tabs that are not selected.

 

    1. $TabView->BodyBackground = (String)

Default:† #FFFFFF

Sets the background color for the TabView area to match the background color of the page.

 

    1. $TabView->Class = (String)

The name of the style sheet class name that defines the styles for the tabs.

 

    1. $TabView->ImagePath = (String)

The relative path to the TabView images.

 

    1. $TabView->Orientation = (Integer)

Default:† 0

0 = left aligns the tabs

1 = right aligns the tabs

 

    1. $TabView->QueryString = (String)

The query string to append to each of the tab URLs.

 

    1. $TabView->SelectedBackColor = (String)

Default:† #CCCCFF

Sets the background color for the tab that has been selected.

 

    1. $TabView->SelectedBold = (Boolean)

Default:† false

When set to true, bolds the text of the selected tab.

 

    1. $TabView->SelectedForeColor = (String)

Sets the font color for the tab that has been selected.

 

    1. $TabView->StartTab = (String)

Sets the tab that is selected when the page is first loaded by using the tabís key value.

 

    1. $TabView->Image = (String)

Sets the image for all unselected tabs.† This setting can be overridden by each tabís Image property.

 

    1. $TabView->SelectedImage = (String)

Sets the image for the selected tab.† This setting is overridden by each tabís SelectedImage property.

 

    1. $TabView->DHTML = (String)

Adds user defined DHTML to each tabís URL.† That is, you can add properties to the anchor tag <a> of each tab such as the onClick event.

 

    1. $TabView->ForceDHTML = (String)

Omits the href property of the anchor tag and uses only the DHTML property value for each tabís URL.

 

  1. Add tabs using the Add() method of the TabView class.

$Tab =& $TabView->Add($strKey, $strText, $strURL, $strTarget, $strCaption);

 

Where the given variables are defined as the following:

 

strKey

Unique key identifying a given tab.

strText

Text to display on the tab.

strURL

Web address to fetch when the tab is clicked.

strTarget

Target frame or window name when fetching the address.

strCaption

Text Tool Tip to display when the mouse hovers over the tabís text.

 

  1. The Add() method returns a pointer to the new Tab object that was created and added to TabView.† You will notice in the last step that the $Tab variable captured the pointer to the new Tab object returned by the by the Add() method.† The Tab class has several additional properties that can be set after the tab has been created:

 

    1. $Tab->ForeColor = (String)

Sets the font color for the given tab.

 

    1. $Tab->Bold = (Boolean)

Controls whether or not the tabís text is bold.

 

    1. $Tab->Image = (String)

Sets the image for the tab when it is not selected.† This setting overrides the TabView class Image property.

 

    1. $Tab->SelectedImage = (String)

Sets the image for the tab when it is selected.† This setting is overrides the TabView class SelectedImage property.

 

    1. $Tab->DHTML = (String)

Adds user defined DHTML to the given tabís URL.† That is, you can add properties to the anchor tag <a> of this tab such as the onClick event.

 

    1. $Tab->ForceDHTML = (String)

Omits the href property of the anchor tag and uses only the DHTML property value for the given tabís URL.

 

    1. $Tab->TabWidth = (Integer)

Defines the width of the given tab measured in pixels.

 

  1. To display TabView simply call the Show() method:

e.g.† $TabView->Show();