hasii2011 / pyut

A UML Diagrammer implemented in Python
GNU Affero General Public License v3.0
11 stars 4 forks source link

Use common directory selector component #560

Open hasii2011 opened 1 month ago

hasii2011 commented 1 month ago

Take the code in pyut.uiv2.preferencesv2.GeneralPreferences

 def _layoutDiagramsDirectory(self, sizedPanel: SizedPanel):
        directoryPanel: SizedStaticBox = SizedStaticBox(sizedPanel, label='Diagrams Directory')

        directoryPanel.SetSizerType('horizontal')
        directoryPanel.SetSizerProps(expand=True, proportion=2)

        textCtrl: TextCtrl = TextCtrl(directoryPanel)
        textCtrl.SetSizerProps(expand=False, proportion=5)

        selectButton: GenBitmapButton = GenBitmapButton(directoryPanel, ID_ANY, ImgFolder.embeddedImage.GetBitmap())
        selectButton.SetSizerProps(expand=False, proportion=1)

        textCtrl.SetValue(self._preferences.diagramsDirectory)
        textCtrl.SetEditable(False)

        self._textDiagramsDirectory = textCtrl
        sizedPanel.Bind(EVT_BUTTON, self._onSelectDiagramsDirectory, selectButton)

Make it a common component in codeallyadvanced.

I am going to create the component in pyfabricate and then move it the above