u_tab


Ancestor

UserObject

Library

workbook.pbl

Description

This object creates an Excel style tab folder component. You can have any sized tab with scrolling, top or bottom and you can also alter the angle of the tab sides.

This is an old PB4 component so some of the function names and code style are out of date but feel free to change it if you want!

Usage

Place on a window, tell the component about your tabs and listen for the evetns.

Model

u_tab
Boolean ib_Bottom = FALSE

String is_Text[]
Integer ii_Width[]
Integer ii_ShowTab = 1

Integer ii_Current = 0
Integer ii_Number = 0
Integer ii_TotalWidth = 0
Integer ii_LastFull = 0

Integer ci_Angle = 4
Integer ci_Y1 = 1
Integer ci_Y2 = 17

Integer ii_redraw
integer setredraw (boolean ab_setting)
(none) uf_add_scrollers (boolean ab_add)
boolean uf_add_tabs (string as_text[])
boolean uf_add_text (integer ai_no)
(none) uf_draw ()
(none) uf_draw_tab (integer ai_no)
(none) uf_kill_tab (integer ai_no)
(none) uf_set_angle (integer ai_angle)
(none) uf_set_bottom (boolean ab_bottom)
integer uf_size_of_text (string as_text)

Functions


setredraw

Description Allow weighted redrawing of the component.

Return integer
  • 0, Redraw not switched back on
  • 1, Redraw switched on/off

  • Access protected

    Arguments
    Argument DataType Description
    ab_setting boolean Tell us to switch redrawing on or off.

    Usage this.SetReDraw( FALSE )


    uf_add_scrollers

    Description Switch on/off the two scroller buttons for the tab.

    Return (none)


    Access protected

    Arguments
    Argument DataType Description
    ab_add boolean Setting for the scrollers on/off

    Usage this.uf_add_scrollers( TRUE )


    uf_add_tabs

    Description Add multiple tabs to the control. Call this function passing an array of strings to add as tabs to the control.

    Return boolean
  • True, added ok
  • False, add failed

  • Access public

    Arguments
    Argument DataType Description
    as_text[] string Unbound array of strings to add as tabs.

    Usage uo_1.uf_add_tabs( as_MyTabs )


    uf_add_text

    Description Add a text item to the datawindow.

    Return boolean
  • T, added ok
  • F, add failed

  • Access protected

    Arguments
    Argument DataType Description
    ai_no integer Text to add.

    Usage this.uf_add_text( 1 )


    uf_draw

    Description Draw the tab object

    Return (none)


    Access protected

    Arguments (none)
    Usage (none)


    uf_draw_tab

    Description Draw a tab based on the text size and the angle of the tab edges.

    Return (none)


    Access protected

    Arguments
    Argument DataType Description
    ai_no integer Number of tab to draw

    Usage this.uf_draw_tab( 1 )


    uf_kill_tab

    Description Remove a tab from the datawindow

    Return (none)


    Access protected

    Arguments
    Argument DataType Description
    ai_no integer

    Usage (none)


    uf_set_angle

    Description Call this function to set the angle of the edge of the tab.

    Return (none)


    Access public

    Arguments
    Argument DataType Description
    ai_angle integer the number of picels for the flange either side of the tab.

    Usage uo_1.uf_set_angle( 3 )


    uf_set_bottom

    Description Set the control to display top or bottom style tabs.

    Return (none)


    Access public

    Arguments
    Argument DataType Description
    ab_bottom boolean Setting of the top/bottom display

    Usage this.uf_set_bottom( TRUE )


    uf_size_of_text

    Description This method will determine the length of a static text control in pixels.

    Return integer
  • Length in pixels of the static text control
  • 0, if an error occurs

  • Access protected

    Arguments
    Argument DataType Description
    as_text string

    Usage long ll_Length

    ll_Length = iapi_hdl.GetTextLength( win.st_Text )

    Events


    constructor

    Description Create the dummy DW used for the painting.


    See Also

    (none)