Commit 24d376d2 authored by sumpfralle's avatar sumpfralle

moved "unit" control to the settings dialog

added a switch for hiding the dimension status bar in the 3D view


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@185 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 11a000e2
......@@ -289,9 +289,14 @@ class GLView:
GuiCommon.draw_complete_model_view(self.settings)
# update the dimension display
s = self.settings
dimension_bar = self.gui.get_object("view3ddimension")
if s.get("show_dimensions"):
self.gui.get_object("model_dim_x").set_text("%.3f %s" % (s.get("maxx") - s.get("minx"), s.get("unit")))
self.gui.get_object("model_dim_y").set_text("%.3f %s" % (s.get("maxy") - s.get("miny"), s.get("unit")))
self.gui.get_object("model_dim_z").set_text("%.3f %s" % (s.get("maxz") - s.get("minz"), s.get("unit")))
dimension_bar.show()
else:
dimension_bar.hide()
class ProjectGui:
......@@ -392,6 +397,7 @@ class ProjectGui:
self.gui.get_object("Toggle3DView").connect("toggled", self.toggle_3d_view)
for name, objname in (("show_model", "ShowModelCheckBox"),
("show_axes", "ShowAxesCheckBox"),
("show_dimensions", "ShowDimensionsCheckBox"),
("show_bounding_box", "ShowBoundingCheckBox"),
("show_toolpath", "ShowToolPathCheckBox"),
("show_drill_progress", "ShowDrillProgressCheckBox"),
......@@ -416,6 +422,7 @@ class ProjectGui:
self.settings.set("show_toolpath", True)
self.settings.set("show_bounding_box", True)
self.settings.set("show_axes", True)
self.settings.set("show_dimensions", True)
skip_obj = self.gui.get_object("DrillProgressFrameSkipControl")
self.settings.add_item("drill_progress_max_fps", skip_obj.get_value, skip_obj.set_value)
self.settings.set("drill_progress_max_fps", 2)
......
......@@ -392,39 +392,6 @@
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">3</property>
<child>
<object class="GtkHBox" id="unit_box">
<property name="visible">True</property>
<child>
<object class="GtkLabel" id="UnitLabel">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Unit:</property>
</object>
<packing>
<property name="expand">False</property>
<property name="padding">3</property>
<property name="position">0</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkHSeparator" id="hseparator3">
<property name="visible">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="padding">10</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox6">
<property name="visible">True</property>
......@@ -457,7 +424,7 @@
</child>
</object>
<packing>
<property name="position">2</property>
<property name="position">0</property>
</packing>
</child>
<child>
......@@ -469,7 +436,7 @@
</object>
<packing>
<property name="expand">False</property>
<property name="position">3</property>
<property name="position">1</property>
</packing>
</child>
<child>
......@@ -482,7 +449,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">4</property>
<property name="position">2</property>
</packing>
</child>
</object>
......@@ -2574,6 +2541,29 @@
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="unit_box">
<property name="visible">True</property>
<child>
<object class="GtkLabel" id="UnitLabel">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Unit:</property>
</object>
<packing>
<property name="expand">False</property>
<property name="padding">3</property>
<property name="position">0</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
......@@ -2665,6 +2655,19 @@
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="ShowDimensionsCheckBox">
<property name="label" translatable="yes">Show Dimensions</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="position">4</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="ShowDrillProgressCheckBox">
<property name="label" translatable="yes">Show Drill Progress</property>
......@@ -2675,7 +2678,7 @@
</object>
<packing>
<property name="expand">False</property>
<property name="position">4</property>
<property name="position">5</property>
</packing>
</child>
<child>
......@@ -2707,7 +2710,7 @@
</object>
<packing>
<property name="expand">False</property>
<property name="position">5</property>
<property name="position">6</property>
</packing>
</child>
</object>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment