Home > DMT_EditorControl > activateSplitScreen
DMT_EditorControl.activateSplitScreen() method
Activate a split screen
Signature
typescript
function activateSplitScreen(splitScreenId: string): Promise<boolean>;1
Parameters
Parameter | Type | Description |
|---|---|---|
splitScreenId | string | Split screen ID |
Returns
Promise<boolean>
Whether the operation is successful
Remarks
Give input focus
Example
javascript
// 1. 归一化布局后打开两个文档,并拆出一个新分屏
await eda.dmt_EditorControl.mergeAllDocumentFromSplitScreen();
const pages = await eda.dmt_Schematic.getAllSchematicPagesInfo();
const pcbs = await eda.dmt_Pcb.getAllPcbsInfo();
await eda.dmt_EditorControl.openDocument(pages[0].uuid);
const tabPcb = await eda.dmt_EditorControl.openDocument(pcbs[0].uuid);
const split = await eda.dmt_EditorControl.createSplitScreen('vertical', tabPcb);
// 2. 激活新分屏(输入焦点移到该分屏)
const activated = await eda.dmt_EditorControl.activateSplitScreen(split.newSplitScreenId);
console.log('activated:', activated);
// 3. 合并所有分屏,恢复单屏布局
const merged = await eda.dmt_EditorControl.mergeAllDocumentFromSplitScreen();
console.log('merged:', merged);1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15