本文整理匯總了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);
}