PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • Overview
  • Opening a dynamic tab pane
  • Opening a tab pane via the "+" button
  • Opening a tab pane via TabOpen
  • 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
  • Knowing the label of the Active dynamic tab pane
  • Retrieving the internal window displayed in a pane
  • Access the content of 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.
Remark: 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.

Opening a tab pane via the "+" button

To open a tab pane via the "+" button found in the Tab control:
  1. 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.
      Remark: 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 event "Creating a pane" of the Tab control (see Opening a tab pane via TabOpen).
Remark: The "+" button of the dynamic tab automatically calls the event "Creating a pane" of the Tab control. If this event uses TabOpen, this event will take priority over the internal window specified in the interface.

Opening a tab pane via TabOpen

To open a tab pane, you also have the ability to use TabOpen.
This function can for example:
  • be used in a button to open an additional tab pane in a Tab control.
  • be used in the event "Creating a pane" of the Tab control.
The TabOpen function allows you to:
  • Knowing the Tab Pane Alias. 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 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 the button used to choose the type of pane, use 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
Remarks:
  • 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 the open dynamic panes, simply call EnumControl on the Tab control:
    // Fill a Combo Box control with the list of controls in the window
    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:
    Tab control name = 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
Knowing the label of the Active dynamic tab pane
To retrieve the label of the active tab, simply use the Property Libellé 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)
The Property Libellé also allows you to change the label of the tab pane.
Retrieving the internal window displayed in a pane
To get the name of 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)
Access the content of the internal window displayed in a pane
indirection operators can be used to access the value of a control or variable in the internal window displayed in a dynamic pane:
// Retrieves the value of a control in the internal window
Info({PaneAlias1 + ".ControlName", indControl})
 
// Retrieves the value of a variable in the internal window
Info({PaneAlias1 + ".VariableName", indVariablel})
 
// Call a procedure of the internal window
ExecuteProcess(PaneAlias1 + ".pProcédureName", trtProcédure)
 
// Equivalent to:
MyProcedure is procédure = gsAlias_Tab + ".pProcedureName"
MyProcedure()
It is preferable to use the locals procedures of a window to manipulate its controls, instead of directly accessing the controls and the variables by indirection. This keeps the internal window autonomous and facilitates maintenance.
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
The Property LibelléSiNouveau makes it possible to know and modify the label 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
The Property Dynamic Tab allows you 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
The StoreTheConfiguration property is used to:
  • Determine whether the configuration of the panes in a dynamic Tab control or Ribbon control is automatically saved and restored.
  • Modify the configuration of the panes in a dynamic Tab control or Ribbon control so that it is automatically saved and restored (or not)
Versions 20 and later
UndockablePane
New in version 20
UndockablePane
UndockablePane
The Property detachable shutter allows 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 26 and later
Undocked
New in version 26
Undocked
Undocked
The Undocked property is used to determine if a pane of a Tab or Ribbon control is undocked.
Versions 20 and later
WindowIfNew
New in version 20
WindowIfNew
WindowIfNew
The Property WindowSiNew allows to know and modify the name of the internal window to be opened if the end user opens a new pane in a dynamic Tab control.
Versions 20 and later
WithClosingButton
New in version 20
WithClosingButton
WithClosingButton
The WithClosingButton property is used to:
  • Find out whether all the panes of a dynamic tab have an "X" icon.
  • Configure all panes of a dynamic tab in order to display an "X" icon.
Versions 20 and later
WithNewButton
New in version 20
WithNewButton
WithNewButton
The Property WithNew Button allows you 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 version required
  • Version 20
Comments
Click [Add] to post a comment