def newFile(self, obj=None, ignoreSave=False): if self.isSaved == True or ignoreSave == True: trans = Transit() trans.object_add(self.mainEn) trans.auto_reverse = True trans.effect_wipe_add(ELM_TRANSIT_EFFECT_WIPE_TYPE_HIDE, ELM_TRANSIT_EFFECT_WIPE_DIR_RIGHT) trans.duration = 0.5 trans.go() time.sleep(0.5) self.mainWindow.title_set("Untitlted - ePad") self.mainEn.delete() self.mainEn = Entry(self.mainWindow, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) self.mainEn.callback_changed_user_add(self.textEdited) self.mainEn.scrollable_set( True) # creates scrollbars rather than enlarge window self.mainEn.line_wrap_set( False) # does not allow line wrap (can be changed by user) self.mainEn.autosave_set(False) # set to false to reduce disk I/O self.mainEn.elm_event_callback_add(self.eventsCb) self.mainEn.markup_filter_append(self.textFilter) self.mainEn.show() self.mainBox.pack_end(self.mainEn) self.isNewFile = True elif self.confirmPopup == None: self.confirmSave(self.newFile)
def newFile( self , obj=None, ignoreSave=False ): if self.isSaved == True or ignoreSave == True: trans = Transit() trans.object_add(self.mainEn) trans.auto_reverse = True trans.effect_wipe_add( ELM_TRANSIT_EFFECT_WIPE_TYPE_HIDE, ELM_TRANSIT_EFFECT_WIPE_DIR_RIGHT) trans.duration = 0.5 trans.go() time.sleep(0.5) self.mainWindow.title_set("Untitlted - ePad") self.mainEn.delete() self.mainEn = Entry(self.mainWindow, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) self.mainEn.callback_changed_user_add(self.textEdited) self.mainEn.scrollable_set(True) # creates scrollbars rather than enlarge window self.mainEn.line_wrap_set(False) # does not allow line wrap (can be changed by user) self.mainEn.autosave_set(False) # set to false to reduce disk I/O self.mainEn.elm_event_callback_add(self.eventsCb) self.mainEn.markup_filter_append(self.textFilter) self.mainEn.show() self.mainBox.pack_end(self.mainEn) self.isNewFile = True elif self.confirmPopup == None: self.confirmSave(self.newFile)
def newFile(self, obj=None, ignoreSave=False): if self.newInstance: # sh does not properly handle space between -d and path command = "epad -d'{0}'".format(self.lastDir) print("Launching new instance: {0}".format(command)) ecore.Exe(command, ecore.ECORE_EXE_PIPE_READ | ecore.ECORE_EXE_PIPE_ERROR | ecore.ECORE_EXE_PIPE_WRITE) return if self.isSaved is True or ignoreSave is True: trans = Transit() trans.object_add(self.mainEn) trans.auto_reverse = True trans.effect_wipe_add( ELM_TRANSIT_EFFECT_WIPE_TYPE_HIDE, ELM_TRANSIT_EFFECT_WIPE_DIR_RIGHT) trans.duration = 0.5 trans.go() time.sleep(0.5) self.mainWindow.title_set("Untitled - ePad") self.mainEn.delete() self.entryInit() self.isNewFile = True elif self.confirmPopup is None: self.confirmSave(self.newFile) self.mainEn.focus_set(True)
def transit_wipe(obj): trans = Transit() trans.object_add(obj) trans.auto_reverse = True trans.effect_wipe_add( ELM_TRANSIT_EFFECT_WIPE_TYPE_HIDE, ELM_TRANSIT_EFFECT_WIPE_DIR_RIGHT) trans.duration = 5.0 trans.go()
def transit_zoom(obj): trans = Transit() trans.object_add(obj) trans.effect_zoom_add(1.0, 3.0) trans.duration = 5.0 trans.go()
def transit_resizing(obj): trans = Transit() trans.object_add(obj) trans.effect_resizing_add(100, 50, 300, 150) trans.duration = 5.0 trans.go()
def newFile(self, obj=None, ignoreSave=False): if self.isSaved is True or ignoreSave is True: trans = Transit() trans.object_add(self.mainEn) trans.auto_reverse = True trans.effect_wipe_add(ELM_TRANSIT_EFFECT_WIPE_TYPE_HIDE, ELM_TRANSIT_EFFECT_WIPE_DIR_RIGHT) trans.duration = 0.5 trans.go() time.sleep(0.5) self.mainWindow.title_set("Untitled - ePad") self.mainEn.delete() self.entryInit() self.isNewFile = True elif self.confirmPopup is None: self.confirmSave(self.newFile)
def zoom_end(event_info, *args, **kwargs): po = args[0] p = event_info print("zoom end/abort <%d,%d> <%f>" % (p.x, p.y, p.zoom)) # Apply the zoom out animator po.shadow_zoom = 1.3 po.base_zoom = po.zoom po.zoom_out = Transit() po.zoom_out.duration = zoom_out_animation_duration po.zoom_out.effect_add(zoom_out_animation_operation, po, zoom_out_animation_end) po.zoom_out.go() return EVAS_EVENT_FLAG_NONE
def newFile(self, obj=None, ignoreSave=False): if self.isSaved is True or ignoreSave is True: trans = Transit() trans.object_add(self.mainEn) trans.auto_reverse = True trans.effect_wipe_add( ELM_TRANSIT_EFFECT_WIPE_TYPE_HIDE, ELM_TRANSIT_EFFECT_WIPE_DIR_RIGHT) trans.duration = 0.5 trans.go() time.sleep(0.5) self.mainWindow.title_set("Untitled - ePad") self.mainEn.delete() self.entryInit() self.isNewFile = True elif self.confirmPopup is None: self.confirmSave(self.newFile)
def transit_image_animation(obj, data): ic = data images = [ os.path.join(img_path, "icon_19.png"), os.path.join(img_path, "icon_00.png"), os.path.join(img_path, "icon_11.png"), os.path.join(img_path, "logo_small.png") ] trans = Transit() trans.del_cb_set(transit_del_cb, obj) trans.object_add(ic) trans.effect_image_animation_add(images) trans.duration = 5.0 trans.go() obj.freeze_events = True
def transit_rotation_translation_color(obj): trans = Transit() trans.object_add(obj) trans.auto_reverse = True trans.repeat_times = 2 # Translation Effect trans.effect_translation_add(-70.0, -150.0, 70.0, 150.0) # Color Effect trans.effect_color_add(100, 255, 100, 255, 50, 30, 50, 50) # Rotation Effect trans.effect_rotation_add(0.0, 135.0) trans.duration = 5.0 trans.go()
def transit9_clicked(obj, item=None): win = StandardWindow("transit9", "Transit 9", autodel=True, size=(400, 400)) bt = Button(win, text="Chain 1", size=(100, 100), pos=(0, 0)) bt.show() bt2 = Button(win, text="Chain 2", size=(100, 100), pos=(300, 0)) bt2.show() bt3 = Button(win, text="Chain 3", size=(100, 100), pos=(300, 300)) bt3.show() bt4 = Button(win, text="Chain 4", size=(100, 100), pos=(0, 300)) bt4.show() trans = Transit() trans.tween_mode = ELM_TRANSIT_TWEEN_MODE_ACCELERATE trans.effect_translation_add(0, 0, 300, 0) trans.object_add(bt) trans.duration = 1 trans.objects_final_state_keep = True trans.go() trans2 = Transit() trans2.tween_mode = ELM_TRANSIT_TWEEN_MODE_ACCELERATE trans2.effect_translation_add(0, 0, 0, 300) trans2.object_add(bt2) trans2.duration = 1 trans2.objects_final_state_keep = True trans.chain_transit_add(trans2) trans3 = Transit() trans3.tween_mode = ELM_TRANSIT_TWEEN_MODE_ACCELERATE trans3.effect_translation_add(0, 0, -300, 0) trans3.object_add(bt3) trans3.duration = 1 trans3.objects_final_state_keep = True trans2.chain_transit_add(trans3) trans4 = Transit() trans4.tween_mode = ELM_TRANSIT_TWEEN_MODE_ACCELERATE trans4.effect_translation_add(0, 0, 0, -300) trans4.object_add(bt4) trans4.duration = 1 trans4.objects_final_state_keep = True trans3.chain_transit_add(trans4) win.show()
def transit8_clicked(obj, item=None): win = StandardWindow("transit8", "Transit 8", autodel=True, size=(400, 400)) bt = Button(win, text="Button - Custom Effect", pos=(50, 50), size=(150, 150)) bt.show() # Adding Transit trans = Transit() trans.auto_reverse = True trans.tween_mode = ELM_TRANSIT_TWEEN_MODE_DECELERATE trans.object_add(bt) trans.effect_add(CustomEffect(150, 150, 50, 50)) trans.duration = 5.0 trans.repeat_times = -1 trans.go() win.show()
def transit_resizable_flip(obj, data): obj2 = data trans = Transit() trans.object_add(obj) trans.object_add(obj2) trans.effect_resizable_flip_add(ELM_TRANSIT_EFFECT_FLIP_AXIS_Y, True) trans.duration = 5.0 trans.go()
def transit_fade(obj, data): obj2 = data trans = Transit() trans.object_add(obj) trans.object_add(obj2) trans.effect_fade_add() trans.duration = 5.0 trans.go()