Tabber
From IfsoGUIWiki
Contents |
Tabber
Type: ifsoGUI_Tabber
Module: ifsogui.tabber
Extends: ifsoGUI_Base
Imports: ifsoGUI_Panel
General
A tabber gadget allows you to provide multiple pages of gadgets. If there are more tabs than can be displayed, then an arrow tab is shown to allow the user to scroll the tabs.
Events
- ifsoGUI_EVENT_RIGHT_CLICK – Gadget has been right clicked on a tab. Data contains the index of the licked tab.
- ifsoGUI_EVENT_MIDDLE_CLICK – Gadget has been middle clicked on a tab. Data contains the index of the licked tab.
- ifsoGUI_EVENT_CHANGE – Current tab has changed. Data contains the current tab index.
- ifsoGUI_EVENT_MOUSE_DOWN – Mouse button has been pressed down on the current panel. Data contains the mouse button pressed.
- ifsoGUI_EVENT_MOUSE_UP – Mouse button has been released on the current panel. Data contains the mouse button pressed.
- ifsoGUI_EVENT_MOUSE_MOVE – Mouse has been moved over the current panel. This event is generated every time the mouse moves while over the panel. Data is 0.
- ifsoGUI_EVENT_MOUSE_ENTER – Mouse has moved over the gadget. Data is 0.
- ifsoGUI_EVENT_MOUSE_EXIT – Mouse has moved away from the gadget. Data is 0.
- ifsoGUI_EVENT_GAIN_FOCUS – Gadget has gained the focus. Data and MouseX/Y are set to 0.
- ifsoGUI_EVENT_LOST_FOCUS – Gadget has lost the focus. Data and MouseX/Y are set to 0.
Functions
Functions used by the programmer to use the gadgets.
- Create:ifsoGUI_Tabber(iX:Int, iY:Int, iW:Int, iH:Int, strName:String, intNumTabs:Int) - Creates and returns an instance of the gadget.
Methods/Properties
These are the methods and properties used by the programmer to use the gadgets.
- AddSound(iSoundEvent:Int, sndSound:TSound) - Add a sound to the event of a gadget.
- AddTab(strText:String, strTip:String = “”, intWidth:Int = 0, intIndex:Int = -1) - Adds a tab.
- AddTabChild(gadget:ifsoGUI_Base, intTab:Int) - Adds a child to a tab.
- BringToFront() - Brings the gadget to the front of its parents child list.
- CanActive:Int() - Returns whether or not this gadget can be the active gadget.
- GetAbsoluteXY(iX:Int Var, iY:Int Var, caller:ifsoGUI_Base = Null) - Retrieves the gadgets Absolute x and y position.
- GetCurrentTab:Int() - Returns the current tab.
- GetEdgeOffset:Int() - Returns the distance from the edge of the gadget to the first/last tabs.
- GetEnabled:Int() - Returns whether the gadget is enabled.
- GetFirstTab:Int() - Returns the first visible tab.
- GetFont:TImageFont() - Returns the font the gadget is using.
- GetGadgetAlpha:Float() - Returns the gadgets alpha value.
- GetH:Int() - Returns the gadgets height.
- GetNumTabs:Int() - Returns the number of tabs.
- GetProperty:Object(key:String) - Returns a custom property.
- GetShowBorder:Int() - Returns whether or not the border is showing.
- GetShowFocus:Int() - Returns whether or not the gadget will show the focus box.
- GetTabAutoHeight:Int() - Returns whether tab auto height is on or off.
- GetTabAutoWidth:Int() - Returns whether tab auto width is on or off.
- GetTabEnabled:Int(intTab:Int) - Returns whether the tab is enabled or not.
- GetTabHeight:Int() - Returns the height of the tabs.
- GetTabOrder:Int() - Returns the gadgets TabOrder.
- GetTabOverlap:Int() - Returns the amount the tabs will overlap.
- GetTabText:String(intTab:Int) - Returns the text on the tab.
- GetTabTip:String(intTab:Int) - Returns the tip of the tab.
- GetTabWidth:Int(intTab:Int) - Returns the width of the tab.
- GetVisible:Int() - Returns whether the gadget is visible.
- GetW:Int() - Returns the gadgets width.
- GetWH(width:Int Var, height:Int Var) - Retrieves the gadgets width and height.
- GetXY(iX:Int Var, iY:Int Var) - Retrieves the gadgets x and y positions.
- RemoveTab(intTab:Int) - Removes a tab.
- RemoveTabChild(gadget:ifsoGUI_Base, intTab:Int) - Removes a child from a tab.
- SendToBack() - Sends the gadget to the back of its parent child list.
- SetBounds(iX:Int, iY:Int, iW:Int, iH:Int) - Sets the x, y, width, and height all in one call.
- SetCallBack(func(gadget:ifsoGUI_Base, id:Int, data:Int, iMouseX:Int, iMouseY:Int)) - Sets the event callback function for the gadget.
- SetCurrentTab(intTab:Int) - Sets the current tab.
- SetEdgeOffset(intEdgeOffset:Int) - Sets the distance from the edge of the gadget to the first/last tabs.
- SetEnabled(bEnabled:Int = True) - Sets the gadget enabled/disabled.
- SetFirstTab(intFirstTab:Int) - Sets the first visible tab.
- SetFocus() - Gives the gadget the focus.
- SetFocusColor(iRed:Int, iGreen:Int, iBlue:Int) - Sets the gadgets focus box color.
- SetFont(Font:TImageFont) - Sets the font of the gadget.
- SetGadgetAlpha(fltAlpha:Float) - Sets the gadgets alpha value.
- SetGadgetColor(iRed:Int, iGreen:Int, iBlue:Int) - Sets the gadget color of the gadget.
- SetProperty(key:String, value:Object) - Set a custom property.
- SetShowBorder(bShowBorder:Int) - Sets whether or not the border will show.
- SetShowFocus(intShowFocus:Int) - Sets whether or not to show the focus box for this gadget.
- SetTabAutoHeight(intTabAutoHeight:Int) - Sets Tab Auto Height on or off.
- SetTabAutoWidth(intAutoWidth:Int) - Sets Tab Auto Width on or off.
- SetTabEnabled(intTab:Int, intEnabled:Int) - Sets the tab enabled/disabled.
- SetTabHeight(intHeight:Int) - Sets the height of the tabs.
- SetTabOrder(iTabOrder:Int) - Sets the gadgets TabOrder. 0=Do not tab to this gadget -1=Last in the Tab Order
- SetTabOverlap(intTabOverlap:Int) - Sets the amount the tabs will overlap.
- SetTabText(intTab:Int, strText:String) - Sets the text on the tab.
- SetTabTip(intTab:Int, strTip:String) - Sets the tip of the tab.
- SetTabWidth(intTab:Int, intWidth:Int) - Sets the width of the tab.
- SetTextColor(iRed:Int, iGreen:Int, iBlue:Int) - Sets the text color of the gadget.
- SetVisible(bVisible:Int) - Sets whether the gadget is visible.
- SetWH(width:Int, height:Int) - Sets the gadgets width and height.
- SetXY(iX:Int, iY:Int) - Sets the gadgets x and y position.
Internal Functions
These function are internal to the gadget. They should only need to be called, if you are creating a gadget.
- Drawbox(images:TImage[], ws:Int[], hs:Int[], rX:Int, rY:Int, rW:Int, rH:Int, bDrawBorder:Int = True, bTileSides:Int = False, bTileCenter:Int = False) - Draws the standard ifsoGUI image based on 4 corners, 4 sides, and a center background portion.
- GetDimensions:String(strName:String) - Gets the dimensions from the dimension file for the gadgets graphics.
- Load9Image(srcpath:String, dimensions:String[], gImage:TImage[] Var, imagew:Int[] Var, imageh:Int[] Var) - Loads the graphics for an image in 9 standard parts.
- LoadTheme() - Called when a new theme is loaded, so the gadget can load its images for drawing. The base gadget does not have a LoadTheme function, but any gadget than can be created should have one.
- SystemEvent(id:Int, data:Int) - Called when a system level event occurs that all gadgets should know about, like loading a new theme or changing the default GUI font. The base gadget does not have a SystemEvent function, but any gadget than can be created should have one.
Internal Methods
These methods are called by the GUI itself and should only be used if you are creating your own gadget.
- ChildMoved(gadget:ifsoGUI_Base) - Called when a child gadget is moved.
- Compare:Int(withObject:Object) - Compares two gadgets by TabOrder.
- Draw(parX:Int, parY:Int, parW:Int, parH:Int) - Draws the gadget and its children.
- DrawChildren(parX:Int, parY:Int, parW:Int, parH:Int) - Draws the gadgets children.
- DrawFocus(iX:Int, iY:Int, iW:Int, iH:Int) - Draws the focus box around the gadget.
- DrawTip(iMouseX:Int, iMouseY:Int) - Draws the gadgets tip.
- GadgetSystemEvent(id:Int, data:Int) - Gadget Level GUI system event occured.
- GainFocus(LostFocus:ifsoGUI_Base) - Called when the gadget becomes the active gadget.
- GetChild:ifsoGUI_Base(name:String) - Returns the gadget with the name from the child list.
- gMouseDown(iButton:Int, iMouseX:Int, iMouseY:Int) - Called when the mouse button is pressed on the gadget.
- gMouseUp(iButton:Int, iMouseX:Int, iMouseY:Int) - Called when the mouse button is released on the gadget.
- IsMouseOver:Int(parX:Int, parY:Int, parW:Int, parH:Int, iMouseX:Int, iMouseY:Int) - Returns whether or not the mouse is over the gadget.
- IsMyChild:Int(gadget:ifsoGUI_Base) - Is the gadget a child or slave of this gadget.
- IsMySlave:Int(gadget:ifsoGUI_Base) - Is the gadget a slave of this gadget.
- KeyPress(key:Int) - Called when a key is pressed on the active gadget.
- LostFocus(GainedFocus:ifsoGUI_Base) - Called when the gadget is no longer the Active Gadget.
- MouseOut(iMouseX:Int, iMouseY:Int, gOverGadget:ifsoGUI_Base) - Called when the mouse leaves the gadget.
- MouseOver(iMouseX:Int, iMouseY:Int, gWasOverGadget:ifsoGUI_Base) - Called when the mouse is over this gadget.
- MouseStatus:Int(iMouseX:Int, iMouseY:Int) - Called to determine the mouse status from the gadget.
- NextGadget:ifsoGUI_Base(start:ifsoGUI_Base, bForward:Int = True) - Returns the next gadget after start in the child list.
- Refresh() - Refreshes the gadget.
- SendEvent(id:Int, data:Int, iMouseX:Int, iMouseY:Int) - Sends an event from the gadget.
- SlaveEvent(gadget:ifsoGUI_Base, id:Int, data:Int, iMouseX:Int, iMouseY:Int) - Called from a slave gadget.
Skinning
dimensions.txt keyword: tabber
Filename: tabber.png
Filename: tabberdown.png
Filename: tabberover.png
This is a representation of the tabber tab. The sides will be stretched or tiled the height of the tab, the top and bottom will be stretched or tiled the width of the tab, and the center will be stretched or tiled to the length and width of the tab. The corners will remain as is and will not be stretched or tiled at all. The tabberdown.png and tabberover.png files are the pressed and mouseover images.
The panel area of the tabber uses the panel graphic
Filename: arrow.png
This is the arrow that will be placed on the tab that appears when the tabs are too large for the tabber gadget, to allow scrolling of the tabs. This graphic should normally be pointing to the right.
TabberTab
Type: TabberTab
Module: ifsogui.tabber
General
Each tab in the Tabber gadget is a TabberTab type. You should not need to access the TabberTab directly, as all of its settings are exposed via the ifsoGUI_Tabber.
Methods
Init(iW:Int, iH:Int, strName:String) Initializes the TabberTab setting up its default values and creating its panel.
Fields
- Text:String – Text on the Tab.
- Width:Int – Width of the Tab.
- Tip:String – Tip of the Tab.
- Enabled:Int = True – Whether or not the Tab is enabled.
- panel:ifsoGUI_Panel – The actual panel used by the Tab.
