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)
def __init__(self, const_text="", var_text="", titles=None, ddlf_size="auto", show_select=True, click_cancel=True, 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.unlaunch_func = None ddlf_size = style.DDL_SIZE if ddlf_size is None else ddlf_size if not isinstance(titles, DropDownListFast): titles = [] if titles is None else titles self.launched = DropDownListFast(size=ddlf_size, titles=titles, x=2) else: self.launched = titles self.show_select = show_select self.launcher = None Clickable.__init__(self, self.const_text+self.var_text,finish=False) if finish: self.finish()
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()
def __init__(self): Clickable.__init__(self) reac_rightclick = Reaction(parameters.BUTTON_UNPRESS_EVENT, self._reaction_rightpress, {"button": parameters.RIGHT_CLICK_BUTTON}, reac_name=constants.REAC_RIGHT_CLICK) self.add_reaction(reac_rightclick) self.normal_params.polite_set("painter size", (16, 16)) self.press_params.polite_set("painter size", (16, 16))
def __init__(self): Clickable.__init__(self) reac_rightclick = Reaction(parameters.BUTTON_UNPRESS_EVENT, self._reaction_rightpress, {"button": parameters.RIGHT_CLICK_BUTTON}, name=constants.REAC_RIGHT_CLICK) self.add_reaction(reac_rightclick) self.normal_params.polite_set("painter size", (16, 16)) self.press_params.polite_set("painter size", (16, 16))
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)