Ejemplo n.º 1
0
    def __init__(self, app, parent):
        self.app = app
        actions = app.actions
        wal.HPanel.__init__(self, parent)

        action_id = pdids.ID_SNAP_TO_GRID
        tooltip_txt = get_tooltip_text(action_id)
        icons_dict = {
            True: [icons.PD_SNAP_TO_GRID_ON, tooltip_txt],
            False: [icons.PD_SNAP_TO_GRID_OFF, tooltip_txt]
        }
        sw = ActionImageSwitch(self, actions[action_id], icons_dict)
        self.pack(sw, padding=2)

        action_id = pdids.ID_SNAP_TO_GUIDE
        tooltip_txt = get_tooltip_text(action_id)
        icons_dict = {
            True: [icons.PD_SNAP_TO_GUIDE_ON, tooltip_txt],
            False: [icons.PD_SNAP_TO_GUIDE_OFF, tooltip_txt]
        }
        sw = ActionImageSwitch(self, actions[action_id], icons_dict)
        self.pack(sw, padding=2)

        action_id = pdids.ID_SNAP_TO_OBJ
        tooltip_txt = get_tooltip_text(action_id)
        icons_dict = {
            True: [icons.PD_SNAP_TO_OBJ_ON, tooltip_txt],
            False: [icons.PD_SNAP_TO_OBJ_OFF, tooltip_txt]
        }
        sw = ActionImageSwitch(self, actions[action_id], icons_dict)
        self.pack(sw, padding=2)

        action_id = pdids.ID_SNAP_TO_PAGE
        tooltip_txt = get_tooltip_text(action_id)
        icons_dict = {
            True: [icons.PD_SNAP_TO_PAGE_ON, tooltip_txt],
            False: [icons.PD_SNAP_TO_PAGE_OFF, tooltip_txt]
        }
        sw = ActionImageSwitch(self, actions[action_id], icons_dict)
        self.pack(sw, padding=2)

        self.pack(wal.PLine(self.panel), fill=True, padding=5)
Ejemplo n.º 2
0
	def __init__(self, app, parent):
		self.app = app
		actions = app.actions
		wal.HPanel.__init__(self, parent)

		action_id = pdids.ID_SNAP_TO_GRID
		tooltip_txt = get_tooltip_text(action_id)
		icons_dict = {
			True:[icons.PD_SNAP_TO_GRID_ON, tooltip_txt],
			False:[icons.PD_SNAP_TO_GRID_OFF, tooltip_txt]}
		sw = ActionImageSwitch(self, actions[action_id], icons_dict)
		self.pack(sw, padding=2)

		action_id = pdids.ID_SNAP_TO_GUIDE
		tooltip_txt = get_tooltip_text(action_id)
		icons_dict = {
			True:[icons.PD_SNAP_TO_GUIDE_ON, tooltip_txt],
			False:[icons.PD_SNAP_TO_GUIDE_OFF, tooltip_txt]}
		sw = ActionImageSwitch(self, actions[action_id], icons_dict)
		self.pack(sw, padding=2)

		action_id = pdids.ID_SNAP_TO_OBJ
		tooltip_txt = get_tooltip_text(action_id)
		icons_dict = {
			True:[icons.PD_SNAP_TO_OBJ_ON, tooltip_txt],
			False:[icons.PD_SNAP_TO_OBJ_OFF, tooltip_txt]}
		sw = ActionImageSwitch(self, actions[action_id], icons_dict)
		self.pack(sw, padding=2)

		action_id = pdids.ID_SNAP_TO_PAGE
		tooltip_txt = get_tooltip_text(action_id)
		icons_dict = {
			True:[icons.PD_SNAP_TO_PAGE_ON, tooltip_txt],
			False:[icons.PD_SNAP_TO_PAGE_OFF, tooltip_txt]}
		sw = ActionImageSwitch(self, actions[action_id], icons_dict)
		self.pack(sw, padding=2)

		self.pack(wal.VLine(self.panel), fill=True, padding=2)
Ejemplo n.º 3
0
 def get_tooltip_text(self):
     txt = resources.get_tooltip_text(self.action_id)
     if self.is_acc:
         shortcut = self.get_shortcut_text()
         txt = '%s (%s)' % (txt, shortcut)
     return txt
Ejemplo n.º 4
0
	def get_tooltip_text(self):
		txt = resources.get_tooltip_text(self.action_id)
		if self.is_acc:
			shortcut = self.get_shortcut_text()
			txt = '%s (%s)' % (txt, shortcut)
		return txt
Ejemplo n.º 5
0
	def get_tooltip_text(self):
		return resources.get_tooltip_text(self.action_id)