DLGTableLayOut(2, 1, 0) 和 DLGLayout(DLGCreateTableLayout(2, 1, 0)) 有什么区别

问题描述 投票:0回答:1

全部: 在DM手册中,我看到有两种定义布局的方法,DLGTableLayOut(2, 1, 0)和DLGLayout(DLGCreateTableLayout(2, 1, 0))。我试过了,看起来是一样的。有什么区别吗?

问候

陈ZX

user-interface dialog dm-script
1个回答
1
投票

所有 DLG 命令仅生成或修改描述对话框的单个标签组。 如果两个命令产生相同的标签组,那么它们确实是相同的。 您最好使用命令

TagGroupOpenBrowserWindow()
来检查此内容以可视化 tagGroup。

TagGroup dlg,dlgItems
// The Command to generate a dialog just generates a structured TagGroup
// dlgItems just points to the "Items" subgroup of the same TagGroup
dlg = DLGCreateDialog("Test",dlgItems)

// Show the TagGroup at any step. Using "clone" to have a copy
// as the original will be further modified below.
dlg.TagGroupClone().TagGroupOpenBrowserWindow("Just created",0)

// Adding items just adds to the  "Items" TagGroup with correct structure and defaults
dlg.DLGAddElement( DLGCreateStringField("Text 1") )
dlg.DLGAddElement( DLGCreateStringField("Text 2", 12) )
TagGroup textItems
dlg.DLGAddElement( DLGCreateStringField("Label", textItems, "Text 3", 14) )
dlg.TagGroupClone().TagGroupOpenBrowserWindow("Added Fields",0)

// Some DLG command affect the overall structure, adding or overwriting tags
dlg.DLGTableLayout(2,2,1)
dlg.TagGroupClone().TagGroupOpenBrowserWindow("Added Table Layout",0)

dlg.DLGTableLayout(3,1,0)
dlg.TagGroupClone().TagGroupOpenBrowserWindow("Modified Table Layout",0)

// You can often do whatever you want - but it will not be "understood" by the code
// buidling the final dialog object later...
taggroup layoutTags = NewTagGroup()
layoutTags.TagGroupSetTagAsString("My own", "I do what I want!")
dlg.DLGLayout(layoutTags)
dlg.TagGroupClone().TagGroupOpenBrowserWindow("Setting customs tags (invalid)",0)

© www.soinside.com 2019 - 2024. All rights reserved.