Iso view

 From:  Michael Gibson
8679.4 In reply to 8679.3 
Hi matt, so for setting up buttons on the View tab in the side pane, you would need to edit the SidePane.htm file in a text editor like Notepad++ .

The existing view tab is this, do a find for "ViewTabContent":

code:
    <div id="ViewTabContent">
        <table>
            <tr>
                <td><moi:CommandButton icon="ViewReset.png" onclick="moi.view.resetAll();"><moi:Text textid="Reset all"/></moi:CommandButton></td>
                <td><moi:CommandButton icon="icons/ImageIcon.png" command="image"><moi:Text textid="Image"/></moi:CommandButton></td>
                <td><moi:CommandButton icon="icons/CPlaneIcon.png" onclick="if ( event.button == 2 ) { moi.view.resetCPlane(); } else { moi.view.setCPlaneInteractive(); }"><moi:Text textid="CPlane"/></moi:CommandButton></td>
            </tr>
            <tr>
                <td colspan="3" style="padding:0.1em 0.4em 0.2em 0.4em">
                    <moi:CheckButton style="text-align:left;" binding="value = moi.view.showHiddenLines"><moi:Text textid="Hidden lines checkbox"/></moi:CheckButton>
                </td>
            </tr>
        </table>
    </div>


So to add in a new row of buttons you'd need to add a new table row () and table cells (
) that have buttons in them (<moi:CommandButton). Which would look something like this - new lines added between the new stuff start and new stuff end markers and note the new stuff is added before the closing
:

code:
    <div id="ViewTabContent">
        <table>
            <tr>
                <td><moi:CommandButton icon="ViewReset.png" onclick="moi.view.resetAll();"><moi:Text textid="Reset all"/></moi:CommandButton></td>
                <td><moi:CommandButton icon="icons/ImageIcon.png" command="image"><moi:Text textid="Image"/></moi:CommandButton></td>
                <td><moi:CommandButton icon="icons/CPlaneIcon.png" onclick="if ( event.button == 2 ) { moi.view.resetCPlane(); } else { moi.view.setCPlaneInteractive(); }"><moi:Text textid="CPlane"/></moi:CommandButton></td>
            </tr>
            <tr>
                <td colspan="3" style="padding:0.1em 0.4em 0.2em 0.4em">
                    <moi:CheckButton style="text-align:left;" binding="value = moi.view.showHiddenLines"><moi:Text textid="Hidden lines checkbox"/></moi:CheckButton>
                </td>
            </tr>

            <!-- new stuff start -->
            <tr>
                <td><moi:CommandButton icon="SetView1.png" onclick="script:var vp = moi.ui.mainWindow.viewpanel.getViewport('3D'); vp.projection = 'Parallel'; vp.setAngles( 90 - (Math.asin(Math.tan(30 * Math.PI/180)) * 180/Math.PI), 315 );">View1</moi:CommandButton></td>
                <td><moi:CommandButton icon="SetView2.png" onclick="script:var vp = moi.ui.mainWindow.viewpanel.getViewport('3D'); vp.projection = 'Parallel'; vp.setAngles( 90 - (Math.asin(Math.tan(30 * Math.PI/180)) * 180/Math.PI), 315 );">View2</moi:CommandButton></td>
                <td><moi:CommandButton icon="SetView3.png" onclick="script:var vp = moi.ui.mainWindow.viewpanel.getViewport('3D'); vp.projection = 'Parallel'; vp.setAngles( 90 - (Math.asin(Math.tan(30 * Math.PI/180)) * 180/Math.PI), 315 );">View3</moi:CommandButton></td>
                <td><moi:CommandButton icon="SetView4.png" onclick="script:var vp = moi.ui.mainWindow.viewpanel.getViewport('3D'); vp.projection = 'Parallel'; vp.setAngles( 90 - (Math.asin(Math.tan(30 * Math.PI/180)) * 180/Math.PI), 315 );">View4</moi:CommandButton></td>
            </tr>
            <!-- new stuff end -->

        </table>
    </div>


And also you'd need to add new images SetView1.png - SetView2.png in the icons folder if you want icons to show up there.

- Michael