本文整理汇总了Python中thorpy.elements.element.Element.finish方法的典型用法代码示例。如果您正苦于以下问题:Python Element.finish方法的具体用法?Python Element.finish怎么用?Python Element.finish使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类thorpy.elements.element.Element
的用法示例。
在下文中一共展示了Element.finish方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: finish
# 需要导入模块: from thorpy.elements.element import Element [as 别名]
# 或者: from thorpy.elements.element.Element import finish [as 别名]
def finish(self):
Element.finish(self)
self._drag_element.set_center((None, self.get_fus_center()[1]))
for state in self._states:
self._states[state].refresh_ghost_rect()
self._setup()
self._drag_element.place_at(self.initial_value)
示例2: finish
# 需要导入模块: from thorpy.elements.element import Element [as 别名]
# 或者: from thorpy.elements.element.Element import finish [as 别名]
def finish(self):
Element.finish(self)
(x, y) = self.is_family_bigger()
if (y and self._has_lift) or self._force_lift:
self.add_lift(typ="dv")
## self._lift.active_wheel = True
self._lift.active_wheel = False
示例3: _get_file_element
# 需要导入模块: from thorpy.elements.element import Element [as 别名]
# 或者: from thorpy.elements.element.Element import finish [as 别名]
def _get_file_element(self, name):
painter = functions.obtain_valid_painter(painterstyle.NAME_PAINTER,
size=style.SIZE)
el = Element(name)
el.set_painter(painter)
el.set_style(style.STYLE_NAME)
el.finish()
return el
示例4: finish
# 需要导入模块: from thorpy.elements.element import Element [as 别名]
# 或者: from thorpy.elements.element.Element import finish [as 别名]
def finish(self):
Element.finish(self)
if self._size == "auto":
self.fit_children(only_children=False)
(x, y) = self.is_family_bigger()
if (y and self._has_lift) or self._force_lift:
self.add_lift(type_="dv")
## self._lift.active_wheel = True
self._lift.active_wheel = False
示例5: finish
# 需要导入模块: from thorpy.elements.element import Element [as 别名]
# 或者: from thorpy.elements.element.Element import finish [as 别名]
def finish(self):
self._path_element._set_path_elements()
Element.finish(self)
self.store()
centerx = self.get_fus_rect().centerx
self.text_element.set_center((centerx, None))
ycoord = self._path_element._elements[0].get_storer_rect().centery
self._path_element._set_path_elements(ycoord)
self.set_prison()
示例6: add_basic_help
# 需要导入模块: from thorpy.elements.element import Element [as 别名]
# 或者: from thorpy.elements.element.Element import finish [as 别名]
def add_basic_help(self, text, wait_time=None, jail=None):
helper = Element(text)
helper.set_style("help")
helper.finish()
helper.scale_to_title()
if wait_time is None:
wait_time=self._help_wait_time
helper.set_help_of(self, self._help_wait_time)
if jail:
helper.set_jailed(jail)
示例7: _get_name_element
# 需要导入模块: from thorpy.elements.element import Element [as 别名]
# 或者: from thorpy.elements.element.Element import finish [as 别名]
def _get_name_element(self, name, namestyle):
painter = functions.obtain_valid_painter(
painterstyle.CHECKER_NAME_PAINTER,
size=style.SIZE)
el = Element(name)
el.set_painter(painter)
if namestyle:
el.set_style(namestyle)
el.finish()
return el
示例8: _get_value_element
# 需要导入模块: from thorpy.elements.element import Element [as 别名]
# 或者: from thorpy.elements.element.Element import finish [as 别名]
def _get_value_element(self, valuestyle):
painter = functions.obtain_valid_painter(
painterstyle.CHECKER_VALUE_PAINTER,
size=style.CHECK_SIZE)
el = Element(str(self.get_value()))
el.set_painter(painter)
if valuestyle:
el.set_style(valuestyle)
el.finish()
return el
示例9: make_text
# 需要导入模块: from thorpy.elements.element import Element [as 别名]
# 或者: from thorpy.elements.element.Element import finish [as 别名]
def make_text(text, font_size=style.FONT_SIZE, font_color=style.FONT_COLOR):
params = {"font_color":font_color, "font_size":font_size}
button = Element(text, normal_params=params)
if not "\n" in text:
button.set_style("text")
button.finish()
if "\n" in text:
button.scale_to_title()
button.set_main_color((0,0,0,0))
return button
示例10: finish
# 需要导入模块: from thorpy.elements.element import Element [as 别名]
# 或者: from thorpy.elements.element.Element import finish [as 别名]
def finish(self):
Element.finish(self)
if not self._size:
self._size = self.get_fus_rect()
self.set_size(self._size)
for line in self.get_lines(STATE_NORMAL):
e = OneLineText(line)
e.finish()
e.set_writer(self.current_state.fusionner.title._writer)
self.add_elements([e])
self.format_txt()
示例11: finish
# 需要导入模块: from thorpy.elements.element import Element [as 别名]
# 或者: from thorpy.elements.element.Element import finish [as 别名]
def finish(self):
Element.finish(self)
if self._size == "auto":
self.fit_children(only_children=False)
w,h = None, None
if self.get_fus_rect().height > style.DDL_MAX_SIZE[1]:
h = style.DDL_MAX_SIZE[1]
if self.get_fus_rect().width > style.DDL_MAX_SIZE[0]:
w = style.DDL_MAX_SIZE[0]
if w or h:
self.set_size((w,h))
(x, y) = self.is_family_bigger()
if (y and self._has_lift) or self._force_lift:
self.add_lift(type_="dv")
## self._lift.active_wheel = True
self._lift.active_wheel = False
示例12: _get_example_element
# 需要导入模块: from thorpy.elements.element import Element [as 别名]
# 或者: from thorpy.elements.element.Element import finish [as 别名]
def _get_example_element(self):
color = self.get_color()
painter_frame = functions.obtain_valid_painter(painterstyle.DEF_PAINTER,
pressed=True,
size=self._color_size)
if painter_frame.clip:
color_size = painter_frame.clip.size
else:
color_size = self._color_size
painter_example = BasicFrame(size=color_size, color=color)
example = Element()
example.set_painter(painter_example)
example.finish()
frame = Element(elements=[example])
frame.set_painter(painter_frame)
frame.finish()
example.set_center(frame.get_fus_center())
return frame
示例13: finish
# 需要导入模块: from thorpy.elements.element import Element [as 别名]
# 或者: from thorpy.elements.element.Element import finish [as 别名]
def finish(self):
Element.finish(self)
time_state = State(self.time_params.get_fusionner())
self.add_state(constants.REAC_TIME, time_state)
self.set_init_pos()
self.change_state(constants.REAC_TIME)
示例14: finish
# 需要导入模块: from thorpy.elements.element import Element [as 别名]
# 或者: from thorpy.elements.element.Element import finish [as 别名]
def finish(self):
painter = self._get_shadow_painter()
self.set_painter(painter)
Element.finish(self)
self._refresh_position()
示例15: ColorSetterLauncher
# 需要导入模块: from thorpy.elements.element import Element [as 别名]
# 或者: from thorpy.elements.element.Element import finish [as 别名]
class ColorSetterLauncher(Clickable):
@staticmethod
def make(colorsetter,
text="",
show_select=True,
click_cancel=False):
cs = ColorSetterLauncher(colorsetter, text, show_select, click_cancel)
cs.finish()
return cs
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 finish(self):
Clickable.finish(self)
## self.e_color.stick_to(self, "right", "right")
## self.e_color.move((-2,0))
store(self, mode="h")
self.fit_children()
self._set_launcher()
def get_value(self):
return self.colorsetter.get_value()
def set_value(self, value):
self.colorsetter.set_value(value)
self.refresh()
def refresh(self):
color = self.colorsetter.get_value()
self.e_color.get_elements()[0].set_main_color(color)
self.old_color = color
def _set_launcher(self):
launcher = launchmod.Launcher(self.launched, launching=self)
reac_enter = ConstantReaction(constants.THORPY_EVENT,
launcher.launch,
{"id": constants.EVENT_UNPRESS, "el":self})
## reac_name="reac_launch")
reac_done = ConstantReaction(constants.THORPY_EVENT,
self.unlaunch,
{"id": constants.EVENT_DONE, "el":self.launched})
## reac_name="reac_done")
reac_cancel = ConstantReaction(constants.THORPY_EVENT,
self._unlaunch_cancel,
{"id": constants.EVENT_CANCEL, "el":self.launched})
## reac_name="reac_cancel")
if self.click_cancel:
reac_click_cancel = Reaction(parameters.MOUSEBUTTONUP,
self._unlaunch_click_cancel,
params={"launcher":launcher})
## reac_name="reac_cancel")
self.launched.add_reaction(reac_click_cancel)
self.launched.add_reaction(reac_cancel)
self.add_reaction(reac_enter)
self.launched.add_reaction(reac_done)
self.launcher = launcher
def _unlaunch_cancel(self, what=CANCEL):
self.colorsetter.set_value(self.old_color)
self.launcher.unlaunch(what)
def _unlaunch_click_cancel(event, launcher):
if not launcher.launched.collide(event.pos):
self._unlaunch_cancel(CLICK_QUIT)
def default_unlaunch(self):
self.refresh()
self.launcher.unlaunch(DONE)
## self._file_element.set_text(text,
## size=(self.file_width, self.get_fus_rect().h),
## cut=True)
def unlaunch(self):
if not self.unlaunch_func:
self.default_unlaunch()
else:
self.unlaunch_func()