dlganchor和dlgside的小部件对齐方式有什么区别? 我注意到有两种可用于对齐小部件的方法:dlganchor和dlgside(有时在某些情况下称为dlgalign)。乍一看,他们似乎有同样的目的...

问题描述 投票:0回答:1
(有时在某些情况下称为dlgalign)。乍一看,他们似乎有同样的目的,但我怀疑其用法存在细微的差异。

有人可以提供一个示例或解释,以阐明dlganchor和dlgside之间的使用差异?特别是: 在哪种场景中,一个方案比另一个方案更喜欢?

他们的一致性行为在实际应用中有何不同?

任何示例代码或详细示例表明差异将不胜感激。
  • 不同的对话框安排命令使用不同的属性值。 (所有对话框构建只是描述符标记组的汇编,然后将其翻译成对话框。)
  • the thecanner
  • 属性用于表布局,如以下示例:

class UITest : UIFrame { object ShowTest(object self, number variant) { TagGroup DLG,DLGItems DLG = DLGCreateDialog("VariantTest",DLGitems) for(number i=0;i<25;i++) { number col = (i%5) number row = trunc(i/5) TagGroup item = DLGCreatePushButton("#"+i,"") number width = (0==row%2) ? 5+col*12 : 65-col*12 number height = (1==row%3) ? 35-col*6 : 5+col*6*row item.DLGInternalPadding(width,height) //item.DLGExternalPadding(5,5) DLGItems.DLGAddElement( item ) } if (0==Variant) { DLG.DLGTableLayout(5,5,0) } else if (1==Variant) { DLG.DLGTableLayout(5,5,1) // All item tiles are same size in grid } else if (2==Variant) { DLG.DLGTableLayout(5,5,0) taggroup item // 2nd row gets "South" attribute to align bottom for (number i=5;i<10;i++){ if (DLGItems.TagGroupGetIndexedTagAsTagGroup(i,item)) item.DLGAnchor("South") } // 3nd row gets "North" attribute to align top for (number i=10;i<15;i++){ if (DLGItems.TagGroupGetIndexedTagAsTagGroup(i,item)) item.DLGAnchor("North") } } else if (3==Variant) { DLG.DLGTableLayout(5,5,0) taggroup item // 3rd colum gets "East" attribute to align left for (number i=2;i<25;i+=5){ if (DLGItems.TagGroupGetIndexedTagAsTagGroup(i,item)) item.DLGAnchor("East") } // 4th colum gets "West" attribute to align right for (number i=3;i<25;i+=5){ if (DLGItems.TagGroupGetIndexedTagAsTagGroup(i,item)) item.DLGAnchor("West") } } self.Init(DLG).Display("Test "+variant) return self } } Alloc(UITest).ShowTest(0) Alloc(UITest).ShowTest(1) Alloc(UITest).ShowTest(2) Alloc(UITest).ShowTest(3)

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

class UITest : UIFrame { object ShowTest(object self) { TagGroup DLG,DLGItems DLG = DLGCreateDialog("VariantTest",DLGitems) TagGroup Radio1,RadioItems1 Radio1 = DLGCreateRadioList(RadioItems1,1) Radio1.DLGExternalPadding(0,20) DLGItems.DLGAddElement(Radio1) // Left-to-Right arrangement For (Number i=1;i<=5;i++) Radio1.DLGAddRadioItem("radio 1/"+i,10*i).DLGSide("Left") TagGroup Radio2,RadioItems2 Radio2 = DLGCreateRadioList(RadioItems2,1) Radio2.DLGExternalPadding(0,20) DLGItems.DLGAddElement(Radio2) // Right-To-Left arrangement For (Number i=1;i<=5;i++) Radio2.DLGAddRadioItem("radio 2/"+i,10*i).DLGSide("Right") TagGroup Radio3,RadioItems3 Radio3 = DLGCreateRadioList(RadioItems3,1) Radio3.DLGExternalPadding(0,20) DLGItems.DLGAddElement(Radio3) // Top-to-Bottom arrangement For (Number i=1;i<=5;i++) Radio3.DLGAddRadioItem("radio 3/"+i,10*i).DLGSide("Top") TagGroup Radio4,RadioItems4 Radio4 = DLGCreateRadioList(RadioItems4,1) Radio4.DLGExternalPadding(0,20) DLGItems.DLGAddElement(Radio4) // Bottom-to-Top arrangement For (Number i=1;i<=5;i++) Radio4.DLGAddRadioItem("radio 4/"+i,10*i).DLGSide("Bottom") self.Init(DLG).Display("Test") return self } } Alloc(UITest).ShowTest()

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.