Exemple #1
0
 def __init__(self,
              params,
              text="",
              title=None,
              click_cancel=False,
              text_ok="Ok",
              text_cancel="Cancel",
              paramsetter_elements=None,
              finish=True):
     """params can either be a varset or a paramsetter.
     title can either be a string or an element."""
     if isinstance(params, ParamSetter):
         self.paramsetter = params
     else:
         self.paramsetter = ParamSetter(params, elements=paramsetter_elements)
     self.click_cancel = click_cancel
     self.max_chars = float("inf")
     self.cut_text = ".."
     self.launcher = None
     e_title = _get_title(title)
     if e_title:
         elements = [e_title, self.paramsetter]
     else:
         elements = [self.paramsetter]
     box = launchmod.make_ok_cancel_box(elements, text_ok, text_cancel)
     self.launched = box
     Clickable.__init__(self, text, finish=False)
     if finish:
         self.finish()
 def __init__(self,
              params,
              text="",
              title=None,
              click_cancel=False,
              text_ok="Ok",
              text_cancel="Cancel",
              paramsetter_elements=None):
     """params can either be a varset or a paramsetter.
     title can either be a string or an element."""
     if isinstance(params, ParamSetter):
         self.paramsetter = params
     else:
         self.paramsetter = ParamSetter(params, elements=paramsetter_elements)
         self.paramsetter.finish()
     self.click_cancel = click_cancel
     self.max_chars = float("inf")
     self.cut_text = ".."
     self.launcher = None
     e_title = _get_title(title)
     if e_title:
         elements = [e_title, self.paramsetter]
     else:
         elements = [self.paramsetter]
     box = launchmod.make_ok_cancel_box(elements, text_ok, text_cancel)
     self.launched = box
     Clickable.__init__(self, text)
Exemple #3
0
 def __init__(self,
              browser,
              const_text="",
              var_text="",
              show_select=True,
              click_cancel=False,
              text_ok="Ok",
              text_cancel="Cancel",
              finish=True):
     self.recenter = True
     self.const_text = const_text
     self.var_text = var_text
     self.click_cancel = click_cancel
     ##        self.max_chars = float("inf")
     self.max_chars = 30
     self.cut_text = ".."
     self.show_select = show_select
     self.launcher = None
     self.unlaunch_func = None
     box = launchmod.make_ok_cancel_box([browser], text_ok, text_cancel)
     self.launched = box
     self.browser = browser
     Clickable.__init__(self, self.const_text + self.var_text, finish=False)
     if finish:
         self.finish()
Exemple #4
0
 def __init__(self,
              colorsetter,
              text="",
              show_select=True,
              click_cancel=False):
     self.text = text
     self.show_select = show_select
     self.click_cancel = click_cancel
     if not isinstance(colorsetter, ColorSetter):
         self.colorsetter = ColorSetter.make(self.text, value=colorsetter)
     else:
         self.colorsetter = colorsetter
     self.old_color = self.colorsetter.get_value()
     self.launched = launchmod.make_ok_cancel_box([self.colorsetter], "Ok", "Cancel") #!!! text
     self.launcher = None
     self.e_color = get_example_element(self.colorsetter.get_color(), (20,20))
     self.e_text = Element(self.text)
     self.e_text.set_style("text")
     self.e_text.finish()
     self.unlaunch_func = None
     Clickable.__init__(self, elements=[self.e_text, self.e_color])
 def __init__(self,
              colorsetter,
              text="",
              show_select=True,
              click_cancel=False):
     self.text = text
     self.show_select = show_select
     self.click_cancel = click_cancel
     if not isinstance(colorsetter, ColorSetter):
         self.colorsetter = ColorSetter.make(self.text, value=colorsetter)
     else:
         self.colorsetter = colorsetter
     self.old_color = self.colorsetter.get_value()
     self.launched = launchmod.make_ok_cancel_box([self.colorsetter], "Ok", "Cancel") #!!! text
     self.launcher = None
     self.e_color = get_example_element(self.colorsetter.get_color(), (20,20))
     self.e_text = Element(self.text)
     self.e_text.set_style("text")
     self.e_text.finish()
     self.unlaunch_func = None
     Clickable.__init__(self, elements=[self.e_text, self.e_color])
    def __init__(self,
                 browser,
                 const_text="",
                 var_text="",
                 show_select=True,
                 click_cancel=False,
                 text_ok="Ok",
                 text_cancel="Cancel"):
        self.recenter=True
        self.const_text = const_text
        self.var_text = var_text
        self.click_cancel = click_cancel
##        self.max_chars = float("inf")
        self.max_chars = 30
        self.cut_text = ".."
        self.show_select = show_select
        self.launcher = None
        self.unlaunch_func = None
        box = launchmod.make_ok_cancel_box([browser], text_ok, text_cancel)
        self.launched = box
        self.browser = browser
        Clickable.__init__(self, self.const_text+self.var_text)