Difference between revisions of "Slicer4:Layouts"
From Slicer Wiki
Line 4: | Line 4: | ||
<?xml version="1.0" encoding="UTF-8"?> | <?xml version="1.0" encoding="UTF-8"?> | ||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> | <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> | ||
+ | <!-- Layouts --> | ||
<xs:element name="layout"> | <xs:element name="layout"> | ||
<xs:complexType> | <xs:complexType> | ||
Line 21: | Line 22: | ||
</xs:restriction> | </xs:restriction> | ||
</xs:simpleType> | </xs:simpleType> | ||
+ | <!-- Items --> | ||
<xs:element name="item"> | <xs:element name="item"> | ||
<xs:complexType> | <xs:complexType> | ||
Line 35: | Line 37: | ||
</xs:complexType> | </xs:complexType> | ||
</xs:element> | </xs:element> | ||
+ | <!-- Views --> | ||
<xs:element name="view"> | <xs:element name="view"> | ||
<xs:complexType> | <xs:complexType> |
Revision as of 14:30, 5 April 2011
Home < Slicer4:LayoutsXML specification for a layout
- XSD schema for layouts
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="layout">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="unbounded" ref="item"/>
</xs:sequence>
<xs:attribute name="split" type="xs:boolean"/>
<xs:attribute name="type" use="required" type="xs:layoutType"/>
</xs:complexType>
</xs:element>
<xs:simpleType name="layoutType">
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="horizontal" />
<xs:enumeration value="vertical" />
<xs:enumeration value="grid" />
<xs:enumeration value="tab" />
</xs:restriction>
</xs:simpleType>
<xs:element name="item">
<xs:complexType>
<xs:choice>
<xs:element ref="layout"/>
<xs:element ref="view"/>
</xs:choice>
<xs:attribute name="column" type="xs:nonNegativeInteger" />
<xs:attribute name="colspan" type="xs:integer" />
<xs:attribute name="multiple" type="xs:boolean"/>
<xs:attribute name="name"/>
<xs:attribute name="row" type="xs:nonNegativeInteger" />
<xs:attribute name="rowspan" type="integer" />
</xs:complexType>
</xs:element>
<xs:element name="view">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" ref="property"/>
</xs:sequence>
<xs:attribute name="class" use="required" type="xs:string"/>
<xs:attribute name="singletontag" type="xs:string"/>
</xs:complexType>
</xs:element>
<xs:element name="property">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="name" use="required" type="xs:string"/>
<xs:attribute name="action" type="xs:string"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:schema>
Adding a new layout to Slicer4
- Libs/MRML/vtkMRMLLayoutNode.h
- Add an enum to the list of available layouts
- Libs/MRMLLogic/vtkMRMLLayoutLogic.cxx
- Add a string constant containing the XML describing the layout
- Add a line to the AddDefaultsLayouts() method
- Libs/qMRMLWidgets/Resources/Icons/
- Add an icon
- Applications/SlicerQT/Resources/qSlicerMainWindow.ui
- Add an action using the Action Editor View
- Drag&Drop created action into the LayoutMenu (View->Layout)
- Drag&Drop created action into the LayoutToolbar
- Applications/SlicerQt/qSlicerMainWindow.cxx
- Add a line to setupMenuActions()