1# Copyright (c) 1999-2014 OPEN CASCADE SAS 2# 3# This file is part of Open CASCADE Technology software library. 4# 5# This library is free software; you can redistribute it and/or modify it under 6# the terms of the GNU Lesser General Public License version 2.1 as published 7# by the Free Software Foundation, with special exception defined in the file 8# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT 9# distribution for complete text of the license and disclaimer of any warranty. 10# 11# Alternatively, this file may be used under the terms of Open CASCADE 12# commercial license or contractual agreement. 13 14# 15# 02/02/1996 : pbo : creation 16# 25/10/1996 : pbo : add 2d view 17# 18# rotation/panning/zoom with buttons 19# 20 21frame .move -relief groove -borderwidth 1 22#toplevel .move 23 24frame .move.rotate -borderwidth 1 25label .move.rotate.title -text " Rotation " 26button .move.rotate.l -text " < " -command {l ; repaint} 27button .move.rotate.r -text " > " -command {r ; repaint} 28button .move.rotate.u -text " ^ " -command {u ; repaint} 29button .move.rotate.d -text " v " -command {d ; repaint} 30pack .move.rotate.title -side top 31pack .move.rotate.l -side left 32pack .move.rotate.r -side right 33pack .move.rotate.u -side top 34pack .move.rotate.d -side bottom 35pack .move.rotate 36 37frame .move.panning -borderwidth 1 38label .move.panning.title -text " Panning " 39button .move.panning.l -text " < " -command {pl ; 2dpl ; repaint} 40button .move.panning.r -text " > " -command {pr ; 2dpr ; repaint} 41button .move.panning.u -text " ^ " -command {pu ; 2dpu ; repaint} 42button .move.panning.d -text " v " -command {pd ; 2dpd ; repaint} 43pack .move.panning.title -side top 44pack .move.panning.l -side left 45pack .move.panning.r -side right 46pack .move.panning.u -side top 47pack .move.panning.d -side bottom 48pack .move.panning 49 50frame .move.zoom -borderwidth 1 51label .move.zoom.title -text " Zoom " 52button .move.zoom.mu -text " + " -command {mu ; 2dmu ; repaint} 53button .move.zoom.md -text " - " -command {md ; 2dmd ; repaint} 54button .move.zoom.fit -text "max" -command {fit ; 2dfit; repaint} 55button .move.zoom.w -text "win" -command {wzoom ; repaint} 56pack .move.zoom.title -side top 57pack .move.zoom.w -side left 58pack .move.zoom.fit -side right 59pack .move.zoom.mu -side top 60pack .move.zoom.md -side bottom 61pack .move.zoom 62 63frame .pick -borderwidth 1 64label .pick.title -text " Pick " 65button .pick.coords -text "Coords" -command {catch {puts [mpick]}} 66button .pick.dist -text "Dist" -command {catch {puts [mdist]}} 67button .pick.whatis -text "What is" -command {catch {puts [whatis .]}} 68button .pick.erase -text "Erase" -command {catch {puts [erase .]}} 69pack .pick.title 70pack .pick.coords -pady 2 -padx 10 71pack .pick.dist -pady 2 -padx 10 72pack .pick.whatis -pady 2 -padx 10 73pack .pick.erase -pady 2 -padx 10 74 75set ShowExtCommands 0 76 77proc ShowHideExtCommands {} { 78 global ShowExtCommands 79 if $ShowExtCommands { 80 pack .move -pady 1 -padx 1 -side left 81 pack .pick -pady 1 -padx 1 82 } else { 83 pack forget .move .pick 84 } 85} 86