本文整理汇总了TypeScript中ui/layouts/dock-layout.DockLayout类的典型用法代码示例。如果您正苦于以下问题:TypeScript DockLayout类的具体用法?TypeScript DockLayout怎么用?TypeScript DockLayout使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DockLayout类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: test_dock_left_top_righ_bottom_fill
export function test_dock_left_top_righ_bottom_fill() {
var testBtnLeft = new helper.MyButton();
testBtnLeft.width = 20;
rootLayout.addChild(testBtnLeft);
var testBtnTop = new helper.MyButton();
testBtnTop.height = 20;
dockModule.DockLayout.setDock(testBtnTop, enums.Dock.top);
rootLayout.addChild(testBtnTop);
var testBtnRight = new helper.MyButton();
testBtnRight.width = 20;
dockModule.DockLayout.setDock(testBtnRight, enums.Dock.right);
rootLayout.addChild(testBtnRight);
var testBtnBottom = new helper.MyButton();
testBtnBottom.height = 20;
dockModule.DockLayout.setDock(testBtnBottom, enums.Dock.bottom);
rootLayout.addChild(testBtnBottom);
var testBtnFill = new helper.MyButton();
dockModule.DockLayout.setDock(testBtnFill, enums.Dock.bottom);
rootLayout.addChild(testBtnFill);
TKUnit.waitUntilReady(() => { return rootLayout.isLayoutValid; });
helper.assertLayout(testBtnLeft, 0, 0, 20, 300, "Left button");
helper.assertLayout(testBtnTop, 20, 0, 280, 20, "Top button");
helper.assertLayout(testBtnRight, 280, 20, 20, 280, "Right button");
helper.assertLayout(testBtnBottom, 20, 280, 260, 20, "Bottom button");
helper.assertLayout(testBtnFill, 20, 20, 260, 260, "Fill button");
}
示例2: test_dock_right
export function test_dock_right() {
var testBtn = new helper.MyButton();
testBtn.width = 20;
dockModule.DockLayout.setDock(testBtn, enums.Dock.right);
rootLayout.stretchLastChild = false;
rootLayout.addChild(testBtn);
TKUnit.waitUntilReady(() => { return rootLayout.isLayoutValid; });
helper.assertLayout(testBtn, 280, 0, 20, 300);
}
示例3: test_dock_left_stretched
export function test_dock_left_stretched() {
var testBtn = new helper.MyButton();
rootLayout.addChild(testBtn);
TKUnit.waitUntilReady(() => { return rootLayout.isLayoutValid; });
helper.assertLayout(testBtn, 0, 0, 300, 300);
}
示例4: test_dock_left
export function test_dock_left() {
var testBtn = new helper.MyButton();
testBtn.width = 20;
rootLayout.stretchLastChild = false;
rootLayout.addChild(testBtn);
TKUnit.waitUntilReady(() => { return rootLayout.isLayoutValid; });
helper.assertLayout(testBtn, 0, 0, 20, 300);
}
示例5: test_padding
export function test_padding() {
var testBtn = new helper.MyButton();
rootLayout.addChild(testBtn);
rootLayout.paddingLeft = 10;
rootLayout.paddingTop = 20;
rootLayout.paddingRight = 30;
rootLayout.paddingBottom = 40;
TKUnit.waitUntilReady(() => { return rootLayout.isLayoutValid; });
helper.assertMeasure(testBtn, 260, 240);
helper.assertLayout(testBtn, 10, 20, 260, 240);
}