Add Rotation Dialog on Main Screen

Let's take “1280M5” profile main screen as example and add there button to show Rotation widget (the features of the rotation widget are explained in the Rotation Widget manual).

Button will be on the right of “M01” button. So search “M01” in cnc-screen.xml file, get position coordinates and arrange Rotation button to the right. Rotation button will toggle visible state of custom widget “rview” -

<gitem type="button" where="magic" 
position="1040;0" height="80" width="80" 
image="tabs/rotate-r" 
action="mywidget-toggle:rview" />

Add “rview” container widget for Rotation widget. Widget definition should be before button definition (Widget should be declared at the moment of button defines show/hide event for the widget).

<gitem where="magic"  type="myitems" name="rview" 
position="80;80" height="720" width="1200" bgColor="#b0c0d0"  
hidden="1" />

And finally add Rotation Widget itself definition into the rview container.

<gitem type="rotation2view" name="rotation2view"
where="rview" position="0;0" height="720" width="1200" />

Total definition is -

<gitem where="magic"  type="myitems" name="rview" 
position="80;80" height="720" width="1200" bgColor="#b0c0d0" 
hidden="1" />
 
<gitem type="button" where="magic" 
position="1040;0" height="80" width="80" 
image="tabs/rotate-r" 
action="mywidget-toggle:rview" />
 
<gitem type="rotation2view" name="rotation2view"
where="rview" position="0;0" height="720" width="1200" />