Esempio n. 1
0
    def __init__(self, parent, values={}, headings=False):
        super(TemplatePanel, self).__init__(parent)
        fields = "header body footer"

        if headings:
            fields += " headings"

        self.fields = []

        # hmm, the instructions don't get automatically done...
        self.instructions.Label = _(self.instructions.Label)

        template_options = biblemgr.bible.get_template_options()

        for field in fields.split():
            item = getattr(self, field)
            item.field = field
            if field in values:
                item.set_text(values[field])

            item.autocomplete = AutoCompleteTextBox(item, self.Update,
                                                    template_options[field])

            dialog = guiutil.toplevel_parent(self)
            if isinstance(dialog, wx.Dialog):
                item.autocomplete.dialog = dialog

            self.fields.append(item)

        if not headings:
            s = self.headings.ContainingSizer
            s.Clear(True)
            cs = s.ContainingWindow.Sizer
            cs.Remove(s)
            cs.Layout()
Esempio n. 2
0
	def tooltip(self):
		if not self._tooltip:
			self._tooltip = Tooltip(guiutil.toplevel_parent(self), 
				style=wx.NO_BORDER, logical_parent=self)
			#self.Bind(wx.EVT_KILL_FOCUS, self.KillFocus)
			
			guiconfig.mainfrm.add_toplevel(self._tooltip)

		return self._tooltip
Esempio n. 3
0
    def tooltip(self):
        if not self._tooltip:
            self._tooltip = Tooltip(guiutil.toplevel_parent(self),
                                    style=wx.NO_BORDER,
                                    logical_parent=self)
            #self.Bind(wx.EVT_KILL_FOCUS, self.KillFocus)

            guiconfig.mainfrm.add_toplevel(self._tooltip)

        return self._tooltip
Esempio n. 4
0
    def set_pane_title(self, panename, text):
        pane = self.aui_mgr.GetPane(panename)
        assert pane.IsOk()

        pane.Caption(text)
        if pane.IsFloating():
            parent = guiutil.toplevel_parent(pane.window)
            assert parent, "Top level parent of window not found!!!"

            parent.Title = text

        self.aui_mgr.Update()
Esempio n. 5
0
	def set_pane_title(self, panename, text):
		pane = self.aui_mgr.GetPane(panename)
		assert pane.IsOk()
		
		pane.Caption(text)
		if pane.IsFloating():
			parent = guiutil.toplevel_parent(pane.window)			
			assert parent, "Top level parent of window not found!!!"

			parent.Title = text
			

		self.aui_mgr.Update()
Esempio n. 6
0
	def __init__(self, parent, values={}, headings=False):
		super(TemplatePanel, self).__init__(parent)
		fields = "header body footer"

		if headings:
			fields += " headings"


		self.fields = []

		# hmm, the instructions don't get automatically done...
		self.instructions.Label = _(self.instructions.Label)

		template_options = biblemgr.bible.get_template_options()

		for field in fields.split():
			item = getattr(self, field)
			item.field = field
			if field in values:
				item.set_text(values[field])

			item.autocomplete = AutoCompleteTextBox(item, self.Update,
				template_options[field])

			dialog = guiutil.toplevel_parent(self)
			if isinstance(dialog, wx.Dialog):
				item.autocomplete.dialog = dialog
			

			self.fields.append(item)

		if not headings:
			s = self.headings.ContainingSizer
			s.Clear(True)
			cs = s.ContainingWindow.Sizer
			cs.Remove(s)
			cs.Layout()