PC SOFT

WINDEV的在线文档

  • 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
  • Finding out the caption of the active dynamic tab pane
  • Retrieving the internal window displayed in a pane
  • Properties specific to the Tab controls
文档页面当前正在翻译。对于此延迟我们深表歉意。
您可以自愿地帮助我们翻译您想要的文档段落,然后只需通过以下地址与我们联系:info@cn.windev.com
产品
WinDevWebDev-服务器代码WebDev-浏览器代码WinDev Mobile报表和查询
平台
WindowsLinuxWindows MobileWindows PhoneWindows Store appsAndroidAndroid Widget iPhone/iPad
语言
JavaPHPAjax用户代码(MCU)外部语言
数据库
HFSQLHFSQL Client/Server存储过程HF 5.5OLE DBODBC本地访问

Handling a dynamic tab by programming

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 the 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 the Tab control. In this case, the options specified in the description window of the Tab control are taken into account.
  • by programming, via 选项卡打开.

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 the 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 the 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 选项卡打开.
    • no internal window.
      In this case, the internal window to open must be specified by programming. To do so, 选项卡打开 must be used in the "Creating a pane" process of the Tab control (see Opening a tab pane via TabOpen).
Note: The "+" button of the dynamic tab automatically calls the "Creating a pane" process of the Tab control. If this process is using 选项卡打开, this process will have 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 选项卡打开.

This function can for example:

  • be used in a button to open an additional tab pane in a Tab control.
  • be used in the "Creating a pane" process of the Tab control.
选项卡打开 is used to:
  • Find out the alias of the tab pane. This alias is used to handle the tab pane by programming. This alias is also returned by ..值 or by ..别名.
  • Specify the caption of the tab pane.
  • Specify the internal window to open.
  • Pass parameters to the internal window to open.
Example:

Alias_Tab字符串型
// New tab displaying the form of the current customer
Alias_Tab选项卡打开TAB_Menu"Customer "+Customer.CustomerIDIW_CustomerFormCustomer.CustomerID
// Modify the image of the tab pane
TAB_MenuAlias_Tab】..图片="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, all you have to do is use 改变窗口源 with the following syntax:
    ChangeSourceWindow(<Selected Internal Window>, <Replacement Internal Window>)

    For example:
    // Replaces the choice window by a form
    改变窗口源IW_ChoiceIW_Form
  • To handle the added tab, sue the following syntax:
    <WindowName>.<TabName>[<WindowName>.<TabName>]

    For example, to modify the caption of the opened tab:
    WIN_DYNHAND.TAB_MDIWIN_DYNHAND.TAB_MDI】..标签="Form "+SysTime()

Handling a dynamic tab pane
To handle a dynamic tab pane, use the following syntax:

NameTabControl[AliasOfTabPane]..PropertyName = PropertyValue

For example:

TAB_MyTabTAB_MyTab】..报表=变灰

Notes:
  • 控件的窗格 is used to find out the name of the dynamic pane (alias) displaying a specific control.
    // Click on "BTN_UPD" button
    MyPaneControl
    MyPane<-控件的窗格(我自己)
    MyPane..标签=MyPane..标签+" (Modified)"
  • 选项卡报表 is used find out the status of a dynamic tab pane: active, floating, not found.
  • To find out the aliases of the opened dynamic panes, all you have to do is call 列举控件 on the Tab pane:
    // Fill a combo box with the list of window controls
    i整数型1
    ResControl字符串型
    ResControl列举控件TAB_MyTabi
    只要ResControl不等于""
    i++
    跟踪ResControl
    ResControl列举控件TAB_MyTabi
    结束

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 the dynamic tab pane to enable:
    NameTabControl = AliasOfTabPane
  • Use ..值.
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 the active dynamic tab pane
To retrieve the caption of the active tab, all you have to do is use ..标签 on the tab pane (identified by its alias):

For example:

AliasTab1字符串型选项卡打开TAB_Test"My tab 1""IW_InternalWindow"
跟踪TAB_TestAliasTab1】..标签)

..标签 can also be used to modify the caption of the 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
oInternalWinControl小于-TAB_TestPaneAlias1

// Retrieves the internal window associated with the pane
MyInternalWindow列举控件oInternalWin1根据创建顺序

Properties specific to the Tab controls
The following properties are used to manage the characteristics of a dynamic Tab control by programming.
20版本和更高版本
带关闭按钮
20新版本
带关闭按钮
带关闭按钮
..带关闭按钮 is used to:
  • Find out whether all the panes of a dynamic tab include a closing cross.
  • Configure all the panes of a dynamic tab in order to display a closing cross.
20版本和更高版本
带新建按钮
20新版本
带新建按钮
带新建按钮
..带新建按钮 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.
20版本和更高版本
窗口是否为新建
窗口是否为新建
..窗口是否为新建 is used to find out and modify the name of the internal window to open if the end user opens a new pane in a dynamic Tab control.
20版本和更高版本
是否新建标签
是否新建标签
..是否新建标签 is used to find out and modify the caption of the new pane opened by the end user in a dynamic Tab control.
20版本和更高版本
存储配置
20新版本
存储配置
存储配置
..存储配置 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).
20版本和更高版本
动态选项卡
20新版本
动态选项卡
动态选项卡
..动态选项卡 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).
20版本和更高版本
可分离的窗格
可分离的窗格
..可分离的窗格 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.

To find out the entire list of WLanguage properties that can be used with a Tab control, see Properties associated with a Tab control.