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']
|
||||
|
||||
# imports
|
||||
import ttk
|
||||
|
||||
from pysollib.ui.tktile.colorsdialog import BaseColorsDialog
|
||||
from pysollib.tile.basetilemfxdialog import BaseTileMfxDialog
|
||||
|
||||
# ************************************************************************
|
||||
# *
|
||||
# ************************************************************************
|
||||
|
||||
class ColorsDialog(BaseColorsDialog):
|
||||
def _calcFrame(self):
|
||||
return ttk.Frame
|
||||
|
||||
def _calcLabel(self):
|
||||
return ttk.Label
|
||||
|
||||
def _calcButton(self):
|
||||
return ttk.Button
|
||||
|
||||
class ColorsDialog(BaseColorsDialog, BaseTileMfxDialog):
|
||||
pass
|
||||
|
|
|
@ -23,22 +23,12 @@
|
|||
|
||||
__all__ = ['ColorsDialog']
|
||||
|
||||
# imports
|
||||
import Tkinter
|
||||
|
||||
from pysollib.ui.tktile.colorsdialog import BaseColorsDialog
|
||||
from pysollib.tk.basetkmfxdialog import BaseTkMfxDialog
|
||||
|
||||
# ************************************************************************
|
||||
# *
|
||||
# ************************************************************************
|
||||
|
||||
class ColorsDialog(BaseColorsDialog):
|
||||
def _calcFrame(self):
|
||||
return Tkinter.Frame
|
||||
|
||||
def _calcLabel(self):
|
||||
return Tkinter.Label
|
||||
|
||||
def _calcButton(self):
|
||||
return Tkinter.Button
|
||||
|
||||
class ColorsDialog(BaseColorsDialog, BaseTkMfxDialog):
|
||||
pass
|
||||
|
|
|
@ -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):
|
||||
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)
|
||||
self.createBitmaps(top_frame, kw)
|
||||
|
||||
|
@ -116,7 +125,7 @@ class BaseColorsDialog(MfxDialog):
|
|||
strings=(_("&OK"), _("&Cancel")),
|
||||
default=0,
|
||||
)
|
||||
return MfxDialog.initKw(self, kw)
|
||||
return self._calc_MfxDialog().initKw(self, kw)
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue