Beispiel #1
0
    def __init__(self, parentWnd, currentPage, parentPage):
        super(BasePageDialog, self).__init__(parent=parentWnd)

        self._parentPage = parentPage
        self._currentPage = currentPage

        self._application = Application
        self._panels = []
        self._controllers = []

        self._config = PageDialogConfig(Application.config)

        self._notebook = wx.Notebook(self, -1)
        self._createPanels()

        self.__do_layout()

        self._application.onPageDialogInit(self._application.selectedPage,
                                           PageDialogInitParams(self))

        self.SetClientSize(
            (self._config.width.value, self._config.height.value))

        self.Center(wx.CENTRE_ON_SCREEN)
        self._generalPanel.titleTextCtrl.SetFocus()
Beispiel #2
0
    def __init__(self, generalPanel, application, dialog):
        super().__init__(application)
        self._dialog = dialog
        self._generalPanel = generalPanel
        self._config = PageDialogConfig(self._application.config)

        self._orderCalculators = [
            (ocf.orderCalculatorTop, _('Top of the list')),
            (ocf.orderCalculatorBottom, _('End of the list')),
            (ocf.orderCalculatorAlphabetically, _('Alphabetically')),
        ]

        self._setTagsList()

        self._generalPanel.typeCombo.Bind(wx.EVT_COMBOBOX,
                                          handler=self.__onPageTypeChanged)

        self._generalPanel.titleTextCtrl.Bind(
            wx.EVT_TEXT, handler=self.__onPageTitleChanged)

        self._generalPanel.orderCombo.Bind(wx.EVT_COMBOBOX,
                                           handler=self.__onPageOrderChanged)

        self._generalPanel.tagsSelector.Bind(EVT_TAGS_LIST_CHANGED,
                                             handler=self.__onTagsListChanged)
Beispiel #3
0
    def __init__(self, parentWnd, currentPage, parentPage, application):
        super(BasePageDialog, self).__init__(
            parent=parentWnd,
            style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER
        )

        self._parentPage = parentPage
        self._currentPage = currentPage

        self._application = application
        self._panels = []
        self._controllers = []

        self._config = PageDialogConfig(self._application.config)

        self._notebook = wx.Notebook(self, -1)
        self._createPanels()

        self.__do_layout()

        self._application.onPageDialogInit(self._application.selectedPage,
                                           PageDialogInitParams(self))

        self._setDialogSize()
        self._generalPanel.titleTextCtrl.SetFocus()
Beispiel #4
0
    def __init__(self, appearancePanel, application, dialog):
        super(AppearanceController, self).__init__(application)
        self._dialog = dialog
        self._appearancePanel = appearancePanel

        self._currentPage = None
        self._stylesList = None

        self.config = PageDialogConfig(self._application.config)

        self._appearancePanel.styleCombo.Bind(wx.EVT_COMBOBOX,
                                              handler=self.__onStyleChanged)
Beispiel #5
0
    def initBeforeCreation(self, parentPage):
        """
        Initialize the panel before new page creation
        parentPage - the parent page for new page
        """
        self._fillComboType(None)
        if parentPage.parent is not None:
            self.tags = parentPage.tags

        # Опция для хранения типа страницы, которая была создана последней
        lastCreatedPageType = PageDialogConfig(
            self._application.config).recentCreatedPageType.value
        self._setComboPageType(lastCreatedPageType)
        self._generalPanel.titleTextCtrl.SetValue(u'')

        self.__onPageTypeChanged(None)
Beispiel #6
0
 def saveParams(self):
     PageDialogConfig(
         self._application.config
     ).recentCreatedPageType.value = self.selectedFactory.getTypeString()