Home > DMT_EditorControl > mergeAllDocumentFromSplitScreen
DMT_EditorControl.mergeAllDocumentFromSplitScreen() method
Merge all split screens
Signature
typescript
function mergeAllDocumentFromSplitScreen(): Promise<boolean>;1
Returns
Promise<boolean>
Whether the operation is successful
Remarks
Only available when child split screens exist. It will cancel all child split screens and merge all document tabs into the initial split screen
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);
await eda.dmt_EditorControl.createSplitScreen('vertical', tabPcb);
// 2. 合并所有分屏,标签页全部回到初始分屏
const merged = await eda.dmt_EditorControl.mergeAllDocumentFromSplitScreen();
console.log('merged:', merged);
// 3. 回读分屏树,确认已无子分屏
const tree = await eda.dmt_EditorControl.getSplitScreenTree();
console.log('child splits left:', tree.children?.length ?? 0);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