mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
Refactored the refactoring.
Meta-refactoring!
This commit is contained in:
parent
0bbf7918f5
commit
1085096f37
3 changed files with 18 additions and 29 deletions
|
@ -23,22 +23,12 @@
|
||||||
|
|
||||||
__all__ = ['ColorsDialog']
|
__all__ = ['ColorsDialog']
|
||||||
|
|
||||||
# imports
|
|
||||||
import ttk
|
|
||||||
|
|
||||||
from pysollib.ui.tktile.colorsdialog import BaseColorsDialog
|
from pysollib.ui.tktile.colorsdialog import BaseColorsDialog
|
||||||
|
from pysollib.tile.basetilemfxdialog import BaseTileMfxDialog
|
||||||
|
|
||||||
# ************************************************************************
|
# ************************************************************************
|
||||||
# *
|
# *
|
||||||
# ************************************************************************
|
# ************************************************************************
|
||||||
|
|
||||||
class ColorsDialog(BaseColorsDialog):
|
class ColorsDialog(BaseColorsDialog, BaseTileMfxDialog):
|
||||||
def _calcFrame(self):
|
pass
|
||||||
return ttk.Frame
|
|
||||||
|
|
||||||
def _calcLabel(self):
|
|
||||||
return ttk.Label
|
|
||||||
|
|
||||||
def _calcButton(self):
|
|
||||||
return ttk.Button
|
|
||||||
|
|
||||||
|
|
|
@ -23,22 +23,12 @@
|
||||||
|
|
||||||
__all__ = ['ColorsDialog']
|
__all__ = ['ColorsDialog']
|
||||||
|
|
||||||
# imports
|
|
||||||
import Tkinter
|
|
||||||
|
|
||||||
from pysollib.ui.tktile.colorsdialog import BaseColorsDialog
|
from pysollib.ui.tktile.colorsdialog import BaseColorsDialog
|
||||||
|
from pysollib.tk.basetkmfxdialog import BaseTkMfxDialog
|
||||||
|
|
||||||
# ************************************************************************
|
# ************************************************************************
|
||||||
# *
|
# *
|
||||||
# ************************************************************************
|
# ************************************************************************
|
||||||
|
|
||||||
class ColorsDialog(BaseColorsDialog):
|
class ColorsDialog(BaseColorsDialog, BaseTkMfxDialog):
|
||||||
def _calcFrame(self):
|
pass
|
||||||
return Tkinter.Frame
|
|
||||||
|
|
||||||
def _calcLabel(self):
|
|
||||||
return Tkinter.Label
|
|
||||||
|
|
||||||
def _calcButton(self):
|
|
||||||
return Tkinter.Button
|
|
||||||
|
|
||||||
|
|
|
@ -38,10 +38,19 @@ from pysollib.tk.tkwidget import MfxDialog
|
||||||
# *
|
# *
|
||||||
# ************************************************************************
|
# ************************************************************************
|
||||||
|
|
||||||
class BaseColorsDialog(MfxDialog):
|
class BaseColorsDialog:
|
||||||
|
def _calcFrame(self):
|
||||||
|
return self._calcToolkit().Frame
|
||||||
|
|
||||||
|
def _calcLabel(self):
|
||||||
|
return self._calcToolkit().Label
|
||||||
|
|
||||||
|
def _calcButton(self):
|
||||||
|
return self._calcToolkit().Button
|
||||||
|
|
||||||
def __init__(self, parent, title, app, **kw):
|
def __init__(self, parent, title, app, **kw):
|
||||||
kw = self.initKw(kw)
|
kw = self.initKw(kw)
|
||||||
MfxDialog.__init__(self, parent, title, kw.resizable, kw.default)
|
self._calc_MfxDialog().__init__(self, parent, title, kw.resizable, kw.default)
|
||||||
top_frame, bottom_frame = self.createFrames(kw)
|
top_frame, bottom_frame = self.createFrames(kw)
|
||||||
self.createBitmaps(top_frame, kw)
|
self.createBitmaps(top_frame, kw)
|
||||||
|
|
||||||
|
@ -116,7 +125,7 @@ class BaseColorsDialog(MfxDialog):
|
||||||
strings=(_("&OK"), _("&Cancel")),
|
strings=(_("&OK"), _("&Cancel")),
|
||||||
default=0,
|
default=0,
|
||||||
)
|
)
|
||||||
return MfxDialog.initKw(self, kw)
|
return self._calc_MfxDialog().initKw(self, kw)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue