Difference between revisions of "Slicer4:Layouts"
From Slicer Wiki
Line 1: | Line 1: | ||
= XML specification for a layout = | = XML 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:string"/> | ||
+ | </xs:complexType> | ||
+ | </xs:element> | ||
+ | <xs:element name="item"> | ||
+ | <xs:complexType> | ||
+ | <xs:sequence> | ||
+ | <xs:element minOccurs="0" ref="layout"/> | ||
+ | <xs:element minOccurs="0" ref="view"/> | ||
+ | </xs:sequence> | ||
+ | <xs:attribute name="multiple" type="xs:boolean"/> | ||
+ | <xs:attribute name="name"/> | ||
+ | </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 = | = Adding a new layout to Slicer4 = |
Revision as of 15:17, 4 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:string"/> </xs:complexType> </xs:element> <xs:element name="item"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" ref="layout"/> <xs:element minOccurs="0" ref="view"/> </xs:sequence> <xs:attribute name="multiple" type="xs:boolean"/> <xs:attribute name="name"/> </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()