示例#1
0
文件: resource.py 项目: iske/PySolFC
 def __init__(self, **kw):
     kw = KwStruct(kw,
         name = "",
         filename = "",
         basename = "",      # basename of filename
         absname = "",       # absolute filename
         # implicit
         index = -1,
         error = 0,          # error while loading this resource
     )
     Struct.__init__(self, **kw.getKw())
示例#2
0
 def __init__(self, parent, ex, title="Error", **kw):
     kw = KwStruct(kw, bitmap="error")
     text = kw.get("text", "")
     if not text.endswith("\n"):
         text = text + "\n"
     text = text + "\n"
     if isinstance(ex, EnvironmentError) and ex.filename is not None:
         t = "[Errno %s] %s:\n%s" % (ex.errno, ex.strerror, repr(ex.filename))
     else:
         t = str(ex)
     kw.text = text + unicode(t, errors='replace')
     MfxMessageDialog.__init__(self, parent, title, **kw.getKw())
示例#3
0
 def __init__(self, parent, ex, title="Error", **kw):
     kw = KwStruct(kw, bitmap="error")
     text = str(kw.get("text", ""))
     if text and text[-1] != "\n":
         text = text + "\n"
     text = text + "\n"
     if isinstance(ex, EnvironmentError) and ex.filename is not None:
         t = '[Errno %s] %s:\n%s' % (ex.errno, ex.strerror, repr(ex.filename))
     else:
         t = str(ex)
     kw.text = text + t
     MfxDialog.__init__(self, parent, title, **kw.__dict__)
示例#4
0
 def __init__(self, parent, ex, title="Error", **kw):
     kw = KwStruct(kw, bitmap="error")
     text = str(kw.get("text", ""))
     if text and text[-1] != "\n":
         text = text + "\n"
     text = text + "\n"
     if isinstance(ex, EnvironmentError) and ex.filename is not None:
         t = '[Errno %s] %s:\n%s' % (ex.errno, ex.strerror, repr(ex.filename))
     else:
         t = str(ex)
     kw.text = text + t
     MfxDialog.__init__(self, parent, title, **kw.__dict__)
示例#5
0
 def __init__(self, **kw):
     kw = KwStruct(
         kw,
         name="",
         filename="",
         basename="",  # basename of filename
         absname="",  # absolute filename
         # implicit
         index=-1,
         error=0,  # error while loading this resource
     )
     Struct.__init__(self, **kw.getKw())
示例#6
0
 def __init__(self, parent, ex, title="Error", **kw):
     kw = KwStruct(kw, bitmap="error")
     text = kw.get("text", "")
     if not text.endswith("\n"):
         text = text + "\n"
     text = text + "\n"
     if isinstance(ex, EnvironmentError) and ex.filename is not None:
         t = "[Errno %s] %s:\n%s" % \
             (ex.errno, ex.strerror, repr(ex.filename))
     else:
         t = str(ex)
     kw.text = text + unicode(t, errors='replace')
     MfxMessageDialog.__init__(self, parent, title, **kw.getKw())
 def initKw(self, kw):
     strings = [_('&Start'), _('&Play'), _('&New'), _('&Close'), ]
     kw = KwStruct(kw,
                   strings=strings,
                   default=0,
                   )
     return self._calc_MfxDialog().initKw(self, kw)
示例#8
0
 def initKw(self, kw):
     kw = KwStruct(
         kw,
         strings=(_("&OK"), _("&Cancel")),
         default=0,
     )
     return self._calc_MfxDialog().initKw(self, kw)
示例#9
0
 def initKw(self, kw):
     kw = KwStruct(kw,
                   strings=(_("&OK"),),
                   default=0,
                   separator=True,
                   )
     return self._calc_MfxDialog().initKw(self, kw)
示例#10
0
 def initKw(self, kw):
     kw = KwStruct(
         kw,
         strings=(_('&OK'), _('&Cancel')),
         default=0,
     )
     return MfxDialog.initKw(self, kw)
示例#11
0
 def initKw(self, kw):
     strings = [_("&OK"), _("&Apply"), _("&Cancel"), ]
     kw = KwStruct(kw,
                   strings=strings,
                   default=0,
                   )
     return MfxDialog.initKw(self, kw)
示例#12
0
 def initKw(self, kw):
     kw = KwStruct(kw,
                   strings=(None, None, _("&Cancel"),), default=0,
                   resizable=True,
                   separator=True,
                   )
     return MfxDialog.initKw(self, kw)
示例#13
0
 def initKw(self, kw):
     kw = KwStruct(
         kw,
         strings=(_("&OK"), (_("&Full log..."), 103),
                  (_("&Save to file"), 204)),
         default=0,)
     return FullLog_StatsDialog.initKw(self, kw)
示例#14
0
 def initKw(self, kw):
     kw = KwStruct(kw,
                   strings=(_("&OK"), (_("Session &log..."), 104),
                            (_("&Save to file"), 203)), default=0,
                   width=76*self.CHAR_W,
                   )
     return AllGames_StatsDialog.initKw(self, kw)
示例#15
0
 def initKw(self, kw):
     kw = KwStruct(
         kw,
         timeout=0,
         resizable=False,
         text="",
         justify="center",
         strings=(_("&OK"), ),
         default=0,
         width=0,
         padx=20,
         pady=20,
         bitmap=None,
         bitmap_side="left",
         bitmap_padx=10,
         bitmap_pady=20,
         image=None,
         image_side="left",
         image_padx=10,
         image_pady=20,
     )
     # default to separator if more than one button
     sep = len(kw.strings) > 1
     kwdefault(kw.__dict__, separator=sep)
     return kw
示例#16
0
 def initKw(self, kw):
     kw = KwStruct(kw,
                   strings=((_("&Rules"), 10), 'sep',
                            _("&Select"), _("&Cancel"),),
                   default=0,
                   )
     return SelectGameDialog.initKw(self, kw)
 def initKw(self, kw):
     kw = KwStruct(kw,
                   strings=(_("&OK"), _("&Cancel")),
                   default=-1,
                   resizable=self._calc_Resizable(),
                   separator=False,
                   )
     return self._calc_MfxDialog().initKw(self, kw)
示例#18
0
 def initKw(self, kw):
     kw = KwStruct(kw,
                   strings=(_('&OK'),),
                   default=0,
                   image=self.app.gimages.logos[4],
                   separator=True,
                   )
     return MfxDialog.initKw(self, kw)
示例#19
0
 def initKw(self, kw):
     kw = KwStruct(
         kw,
         strings=(_("&OK"), _("&Cancel")),
         default=0,
         separator=False,
     )
     return MfxDialog.initKw(self, kw)
示例#20
0
 def initKw(self, kw):
     kw = KwStruct(kw,
                   strings=(_("&OK"), _("&Cancel")), default=0,
                   separator=False,
                   resizable=False,
                   padx=10, pady=10,
                   buttonpadx=10, buttonpady=5,
                   )
     return MfxDialog.initKw(self, kw)
示例#21
0
 def initKw(self, kw):
     kw = KwStruct(
         kw,
         strings=(_("&OK"), _("&Cancel")),
         default=0,
         padx=10,
         pady=10,
     )
     return MfxDialog.initKw(self, kw)
示例#22
0
 def initKw(self, kw):
     kw = KwStruct(kw,
                   strings=(_("&OK"),
                            (_("&Save to file"), 500)),
                   default=0,
                   width=76*self.CHAR_W,
                   separator=False,
                   )
     return MfxDialog.initKw(self, kw)
示例#23
0
文件: tkstats.py 项目: yegle/PySolFC
 def initKw(self, kw):
     kw = KwStruct(
         kw,
         strings=((_("&Play this game"), 401), "sep", _("&OK"),
                  (_("&Reset..."), 500)),
         default=0,
         separator=False,
     )
     return MfxDialog.initKw(self, kw)
示例#24
0
 def initKw(self, kw):
     kw = KwStruct(kw,
                   strings=(_("&OK"), _("&Load"), _("&Cancel"),),
                   default=0,
                   resizable=True,
                   padx=10, pady=10,
                   buttonpadx=10, buttonpady=5,
                   )
     return MfxDialog.initKw(self, kw)
示例#25
0
 def initKw(self, kw):
     kw = KwStruct(kw,
                   strings=(_("&OK"),
                            (_("&All games..."), 102),
                            (TOP_TITLE + "...", 105),
                            (_("&Reset..."), 302)), default=0,
                   image=self.app.gimages.logos[5],
                   padx=10, pady=10,
                   )
     return MfxDialog.initKw(self, kw)
示例#26
0
 def initKw(self, kw):
     kw = KwStruct(kw,
                   strings=((_("&Solid color..."), 10),
                            'sep', _("&OK"), _("&Cancel"),),
                   default=0,
                   resizable=True,
                   font=None,
                   padx=10, pady=10,
                   )
     return MfxDialog.initKw(self, kw)
示例#27
0
 def initKw(self, kw):
     if USE_PIL:
         s = (_("&Info / Settings..."), 10)
     else:
         s = (_("&Info..."), 10)
     kw = KwStruct(kw,
                   strings=(s, 'sep',
                            _("&OK"), _("&Cancel"),),
                   default=0,
                   resizable=True,
                   )
     return MfxDialog.initKw(self, kw)
示例#28
0
 def initKw(self, kw):
     if USE_PIL:
         strings = (_("&Save"), _("&Cancel"))
     else:
         strings = (_("&OK"),)
     kw = KwStruct(kw,
                   strings=strings,
                   default=0,
                   resizable=True,
                   separator=True,
                   )
     return MfxDialog.initKw(self, kw)
示例#29
0
 def initKw(self, kw):
     kw = KwStruct(
         kw,
         strings=(_("&OK"),
                  (_("&Save to file"), 202),
                  (_("&Reset all..."), 301),),
         default=0,
         resizable=True,
         padx=10, pady=10,
         # width=900,
     )
     return MfxDialog.initKw(self, kw)
示例#30
0
文件: resource.py 项目: iske/PySolFC
 def __init__(self, **kw):
     # start with all fields from CardsetConfig
     config = CardsetConfig()
     kw = KwStruct(config.__dict__, **kw)
     # si is the SelectionInfo struct that will be queried by
     # the "select cardset" dialogs. It can be freely modified.
     si = Struct(type=0, size=0, styles=[], nationalities=[], dates=[])
     kw = KwStruct(kw,
         # essentials
         ranks = (),
         suits = (),
         trumps = (),
         nbottoms = 7,
         nletters = 4,
         nshadows = 1 + 13,
         # selection criterias
         si = si,
         # implicit
         backname = None,
         dir = "",
     )
     Resource.__init__(self, **kw.getKw())
示例#31
0
 def __init__(self, **kw):
     # start with all fields from CardsetConfig
     config = CardsetConfig()
     kw = KwStruct(config.__dict__, **kw)
     # si is the SelectionInfo struct that will be queried by
     # the "select cardset" dialogs. It can be freely modified.
     si = Struct(type=0, size=0, styles=[], nationalities=[], dates=[])
     kw = KwStruct(
         kw,
         # essentials
         ranks=(),
         suits=(),
         trumps=(),
         nbottoms=7,
         nletters=4,
         nshadows=1 + 13,
         # selection criteria
         si=si,
         # implicit
         backname=None,
         dir="",
     )
     Resource.__init__(self, **kw.getKw())
示例#32
0
 def initKw(self, kw):
     kw = KwStruct(kw, strings=(_('&OK'),), default=0, separator=True)
     return MfxDialog.initKw(self, kw)