示例#1
0
 def on_size_snap(self, event):
     """Toggle size snap"""
     size = cfg.Repository.getsettingvalue(cfg.ID_SizeSnapping)
     size['enabled'] = event.Checked()
     if size['enabled']:
         app.get_scale_tool().setsnap( size['size'] )
     else:
         app.get_scale_tool().setsnap(0)
示例#2
0
 def on_size_snap(self, event):
     """Toggle size snap"""
     size = cfg.Repository.getsettingvalue(cfg.ID_SizeSnapping)
     size['enabled'] = event.Checked()
     if size['enabled']:
         app.get_scale_tool().setsnap(size['size'])
     else:
         app.get_scale_tool().setsnap(0)
示例#3
0
def restore_size_snapping():
    """Restore size snapping preferences"""
    size_snap = get_repository_setting_value(guisettings.ID_SizeSnapping)
    scale = app.get_scale_tool()
    if size_snap['enabled']:
        scale.setsnap(size_snap['size'])
    else:
        scale.setsnap(0)
示例#4
0
def restore_size_snapping():
    """Restore size snapping preferences"""
    size_snap = get_repository_setting_value(
                        guisettings.ID_SizeSnapping
                        )
    scale = app.get_scale_tool()
    if size_snap['enabled']:
        scale.setsnap( size_snap['size'] )
    else:
        scale.setsnap(0)
示例#5
0
    def __init__(self, parent):
        togwin.ChildToggableDialog.__init__(self, "Tool info", parent)

        # Number of decimals used in all float representations
        self.decimals = 2

        # Tool ids and paths
        self.ID_TerrainRaise = wx.NewId()
        self.ID_TerrainFlatten = wx.NewId()
        self.ID_TerrainSlope = wx.NewId()
        self.ID_TerrainSmooth = wx.NewId()
        self.ID_TerrainNoise = wx.NewId()
        self.ID_TerrainPaint = wx.NewId()
        self.ID_TerrainHole = wx.NewId()
        self.ID_Measure = wx.NewId()
        self.tool_paths = {
            toolscmds.ID_TranslateObjTool:
            app.get_translate_tool().getfullname(),
            toolscmds.ID_RotateObjTool: app.get_rotate_tool().getfullname(),
            toolscmds.ID_ScaleObjTool: app.get_scale_tool().getfullname(),
            self.ID_TerrainRaise: trn.get_terrain_tool_path('toolRaiseLow'),
            self.ID_TerrainFlatten: trn.get_terrain_tool_path('toolFlatten'),
            self.ID_TerrainSlope: trn.get_terrain_tool_path('toolSlope'),
            self.ID_TerrainSmooth: trn.get_terrain_tool_path('toolSmooth'),
            self.ID_TerrainNoise: trn.get_terrain_tool_path('toolNoise'),
            self.ID_TerrainPaint: trn.get_terrain_tool_path('toolPaint'),
            self.ID_TerrainHole: trn.get_terrain_tool_path('toolHole'),
            self.ID_Measure: app.get_measure_tool().getfullname()
        }
        self.current_tool = toolscmds.ID_NullTool

        # Label names and values. They're init with an empty string,
        # but with a width long enough to contain any name/value.
        # Each tool will then update the labels as it needs.
        self.label_names = []
        self.label_values = []
        for i in range(5):
            self.label_names.append(
                wx.StaticText(self,
                              -1,
                              "",
                              size=(80, -1),
                              style=wx.ALIGN_RIGHT))
            self.label_values.append(
                wx.StaticText(self, -1, "", size=(125, -1)))

        # Short help displayed while waiting for the first signal
        # (created last to be on top of other labels)
        self.label_help = wx.StaticText(self, -1, "For most tools, click and" \
            " drag to display\ninformation.\n\nSome tools doesn't give " \
            "information at all.", pos=(10,10))

        self.__do_layout()
        self.__bind_events()
示例#6
0
 def __init__(self, parent):
     togwin.ChildToggableDialog.__init__(
         self, "Tool info", parent
         )
     
     # Number of decimals used in all float representations
     self.decimals = 2
     
     # Tool ids and paths
     self.ID_TerrainRaise = wx.NewId()
     self.ID_TerrainFlatten = wx.NewId()
     self.ID_TerrainSlope = wx.NewId()
     self.ID_TerrainSmooth = wx.NewId()
     self.ID_TerrainNoise = wx.NewId()
     self.ID_TerrainPaint = wx.NewId()
     self.ID_TerrainHole = wx.NewId()
     self.ID_Measure = wx.NewId()
     self.tool_paths = {
         toolscmds.ID_TranslateObjTool: app.get_translate_tool().getfullname(),
         toolscmds.ID_RotateObjTool: app.get_rotate_tool().getfullname(),
         toolscmds.ID_ScaleObjTool: app.get_scale_tool().getfullname(),
         self.ID_TerrainRaise: trn.get_terrain_tool_path('toolRaiseLow'),
         self.ID_TerrainFlatten: trn.get_terrain_tool_path('toolFlatten'),
         self.ID_TerrainSlope: trn.get_terrain_tool_path('toolSlope'),
         self.ID_TerrainSmooth: trn.get_terrain_tool_path('toolSmooth'),
         self.ID_TerrainNoise: trn.get_terrain_tool_path('toolNoise'),
         self.ID_TerrainPaint: trn.get_terrain_tool_path('toolPaint'),
         self.ID_TerrainHole: trn.get_terrain_tool_path('toolHole'),
         self.ID_Measure: app.get_measure_tool().getfullname()
         }
     self.current_tool = toolscmds.ID_NullTool
     
     # Label names and values. They're init with an empty string,
     # but with a width long enough to contain any name/value.
     # Each tool will then update the labels as it needs.
     self.label_names = []
     self.label_values = []
     for i in range(5):
         self.label_names.append( wx.StaticText(self, -1, "",
             size=(80,-1), style=wx.ALIGN_RIGHT) )
         self.label_values.append( wx.StaticText(self, -1, "",
             size=(125,-1)) )
     
     # Short help displayed while waiting for the first signal
     # (created last to be on top of other labels)
     self.label_help = wx.StaticText(self, -1, "For most tools, click and" \
         " drag to display\ninformation.\n\nSome tools doesn't give " \
         "information at all.", pos=(10,10))
     
     self.__do_layout()
     self.__bind_events()