PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • Opening a dynamic tab pane
  • Tip: Proposing a "Menu" pane allowing the user to choose the type of pane to create
  • Handling a dynamic tab pane
  • Changing the active dynamic tab pane
  • Finding out the caption of active dynamic tab pane
  • Retrieving the internal window displayed in a pane
  • Properties specific to the Tab controls
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Overview
WINDEV allows you to handle the dynamic Tab controls by programming with the TabXXX functions and with several WLanguage properties. You also have the ability to handle a dynamic Tab control by programming. To do so, use the variable of the Tab control in the code.
Caution: The static tab panes and the dynamic tab panes are not identified the same way:
  • the static tab panes are identified by the number of the active pane.
  • the dynamic tab panes are identified by the alias of active pane.
Note: When the internal window handled in the dynamic tab is using HFSQL data files, the internal window must use an independent HFSQL context.
Opening a dynamic tab pane
Several methods can be used to open a dynamic tab pane:
  • via the "+" button of Tab control. In this case, the options specified in the description window of Tab control are taken into account.
  • by programming, via TabOpen.
  1. In the description window of Tab control, "Details" tab, check "With "New" button" and specify the "Internal window in creation" and the "Default caption of new pane".In the description window of Tab control, "Details" tab, check "With "New" button (+)" and specify the "Internal window on New button (+)" and the "Default caption of new pane".
  2. The internal window opened by the "+" button can be:
    • a specific internal window (adding a customer form for example).
      When the user clicks the "+" button, the created tab panes will be identical, based on the same internal window.
      Note: If the internal window expects parameters, the tab pane must be opened by programming with TabOpen.
    • no internal window.
      In this case, the internal window to open must be specified by programming. To do so, TabOpen must be used in the "Creating a pane" process of Tab control (see Opening a tab pane via TabOpen).
Note: The "+" button of dynamic tab automatically calls the "Creating a pane" process of Tab control. If this process is using TabOpen, this process will have priority over the internal window specified in the interface.
TabOpen
This function can for example:
  • be used in a button to open an additional tab pane in a Tab control.
  • être utilisé dans le traitement "Création d'un volet" du champ Onglet.
TabOpen is used to:
  • Find out the alias of tab pane. This alias is used to handle the tab pane by programming. This alias is also returned by ..Value or by ..Alias.
  • Specify the caption of tab pane.
  • Specify the internal window to open.
  • Pass parameters to the internal window to open.
Example:
Alias_Tab is string
// New tab displaying the form of the current customer
Alias_Tab = TabOpen(TAB_Menu, "Customer "+ Customer.CustomerID, IW_CustomerForm, Customer.CustomerID)
// Modify the image of tab pane
TAB_Menu[Alias_Tab]..Image = "NewCust.png"

Tip: Proposing a "Menu" pane allowing the user to choose the type of pane to create

During the click on the "+" button, some interfaces can propose a menu allowing the user to choose the type of information to display.
To develop this type of interface, all you have to do is create an internal window named "Menu". For example, this window can allow the user to display a customer form, an invoice or the list of orders.
In this case, the user chooses the type of tab pane to create and the current tab pane is replaced by the selected pane.
Some modifications are required to develop this type of interface:
  • In the click code of button used to choose the type of pane, all you have to do is call ChangeSourceWindow with the following syntax:
    ChangeSourceWindow(<Selected Internal Window>, <Replacement Internal Window>)

    For example:
    // Replaces the choice window by a form
    ChangeSourceWindow(IW_Choice, IW_Form)
  • To handle the added tab, use the following syntax:
    <WindowName>.<TabName>[<WindowName>.<TabName>]

    For example, to modify the caption of the opened tab:
    WIN_DYNHAND.TAB_MDI[WIN_DYNHAND.TAB_MDI]..Caption = "Form " + SysTime()
Handling a dynamic tab pane
To handle a dynamic tab pane, use the following syntax:
NameTabControl[AliasOfTabPane]..PropertyName = PropertyValue
For example:
TAB_MyTab[TAB_MyTab]..State = Grayed
Notes:
  • ControlPane is used to find out the name of the dynamic pane (alias) displaying a specific control.
    // Click on "BTN_UPD" button
    MyPane is Control
    MyPane <- ControlPane(MySelf)
    MyPane..Caption = MyPane..Caption + " (Modified)"
  • TabStatus is used find out the status of a dynamic tab pane: active, floating, not found.
  • To find out the aliases of opened dynamic panes, all you have to do is call EnumControl on the Tab pane:
    // Fill a combo box with the list of window controls
    i is int = 1
    ResControl is string
    ResControl = EnumControl(TAB_MyTab, i)
    WHILE ResControl <> ""
    i++
    Trace(ResControl)
    ResControl = EnumControl(TAB_MyTab, i)
    END
Changing the active dynamic tab pane
The last created dynamic tab pane is enabled by default. The current tab can be changed by programming.
To enable a dynamic tab pane:
  • Assign the tab with the alias of dynamic tab pane to enable:
    NameTabControl = AliasOfTabPane
  • Use ..Value.
Reminder: To enable a static tab pane, all you have to do is specify the number of the pane to enable.
NameTabControl = PaneNum
Finding out the caption of active dynamic tab pane
To retrieve the caption of active tab, all you have to do is call ..Caption on the tab pane (identified by its alias):
For example:
AliasTab1 is string = TabOpen(TAB_Test, "My tab 1", "IW_InternalWindow")
Trace(TAB_Test[AliasTab1]..Caption)
..Caption can also be used to modify the caption of tab pane.
Retrieving the internal window displayed in a pane
To retrieve the name of the internal window displayed in a dynamic pane, you have the ability to use the following code:
// Retrieves the displayed pane
oInternalWin is Control <- TAB_Test[PaneAlias1]

// Retrieves the internal window associated with the pane
sInternalWindowName is string
sInternalWindowName = EnumControl(oInternalWin, 1, byCreationOrder)
Properties specific to the Tab controls
The following properties are used to manage the characteristics of a dynamic Tab control by programming.
Versions 20 and later
CaptionIfNew
New in version 20
CaptionIfNew
CaptionIfNew
..CaptionIfNew is used to find out and modify the caption of the new pane opened by the end user in a dynamic Tab control.
Versions 20 and later
DynamicTab
New in version 20
DynamicTab
DynamicTab
..DynamicTab is used to:
  • Find out the type of a Tab control (static tab or dynamic tab).
  • Modify the type of a Tab control (static tab or dynamic tab).
Versions 20 and later
StoreTheConfiguration
New in version 20
StoreTheConfiguration
StoreTheConfiguration
..StoreTheConfiguration is used to:
  • Find out whether the configuration of the panes in a dynamic Tab control is automatically saved and restored.
  • Modify the configuration of the panes in a dynamic Tab control so that it is automatically saved and restored (or not).
Versions 20 and later
UndockablePane
New in version 20
UndockablePane
UndockablePane
..UndockablePane is used to:
  • Find out whether the panes of a dynamic Tab control can be moved outside the window by the end user.
  • Allow (or not) the panes of a dynamic Tab control to be moved outside the window by the end user.
Versions 20 and later
WindowIfNew
New in version 20
WindowIfNew
WindowIfNew
..WindowIfNew is used to find out and modify the name of internal window to open if the end user opens a new pane in a dynamic Tab control.
Versions 20 and later
WithClosingButton
New in version 20
WithClosingButton
WithClosingButton
..WithClosingButton is used to:
  • Find out whether all panes of a dynamic tab include a closing cross.
  • Configure all panes of a dynamic tab in order to display a closing cross.
Versions 20 and later
WithNewButton
New in version 20
WithNewButton
WithNewButton
..WithNewButton is used to:
  • Find out whether a dynamic Tab control proposes an addition cross.
  • Configure a dynamic Tab control so that it proposes (or not) an addition cross.
To find out the entire list of WLanguage properties that can be used with a Tab control, see Properties associated with a Tab control.
Related Examples:
WD Multi-Windowing Training (WINDEV): WD Multi-Windowing
[ + ] This example presents the basic concepts for managing the multi-windowing and the dynamic tabs with WINDEV.

This example includes a simple interface for managing the customer forms:
- multi-windowing with MDI interface,
- multi tabs with a dynamic tab control.
Minimum required version
  • Version 20
Comments
Click [Add] to post a comment