Example #1
0
def RunAppReset():
    shutil.rmtree(os.path.join(bin.application_root_folder(), 'taskrx'))
    for f in bin.find(root=bin.application_root_path(), type='f', name='taskrx*'):
        debug('Found {}'.format(f))
        os.remove(f)
    app = App()
    app.mainloop()
Example #2
0
    def __init__(self, *args, **kwargs):
        tk.Tk.__init__(self, *args, **kwargs)

        self.version=0
        self.geometry('950x360+100+100')
        self.set_window_title('Task Manager')

        self.theme=theme.Theme()
        self.theme.font_name="Courier"
        self.theme.background_color='white'
        
        self.canvas=tk.Canvas(self, background=self.theme.background_color, bd=0, height=600, width=950, highlightthickness=0)
        self.canvas.pack(fill=tk.BOTH, expand=False)

        self.tm=taskmanager.TaskManager(root=self, canvas=self.canvas, theme=self.theme)

        folder=os.path.join(bin.application_root_folder(), 'items')
        bin.mkdir(folder)
        self.items=taskmanager.Items(folder=folder)

        self.sb=statusbox.StatusBox(root=self, canvas=self.canvas, theme=self.theme)
        #self.sb2=statusbox.StatusBox(root=self, canvas=self.canvas, theme=self.theme)
        self.tm.add_statusbox(self.sb)
        self.tm.add_timeline(name='hourly', type='hourly', items=self.items, y=0,  height=100,
            statusbox=self.sb, total_days_displayed=1, min_days_displayed=.5, max_days_displayed=1,
            label_format='%I%p', draw_labels=True, group=0)
        self.tm.add_timeline(name='daily', type='daily', items=self.items, y=100, height=85,
            statusbox=self.sb, total_days_displayed=7, min_days_displayed=1, max_days_displayed=21,
            label_format='%d%a', draw_labels=False, group=0)
#        self.tm.add_timeline(name='monthly', type='monthly', items=self.items, y=100+85, height=75,
#            statusbox=self.sb, total_days=180, label_format='%B %y', draw_labels=False, group=0)

        #self.tm.add_statusbox(self.sb2)
        self.tm.draw(x=0, y=0)

        # self.timeline.dump(file_name='C:\\temp\\dump.txt')

        self.bind('<Configure>', self.configure_event)

        self.tm.init()
Example #3
0
    def __init__(self, *args, **kwargs):

        self.root=kwargs['root']
        self.canvas=kwargs['canvas']
        self.height=kwargs['height']

        self.keyboard=keyboard.Keyboard(canvas=self.canvas)

        if 'x' in kwargs.keys():
            self.x=kwargs['x']
        else:
            self.x=0

        self.original_x=self.x

        if 'y' in kwargs.keys():
            self.y=kwargs['y']
        else:
            self.y=0

        if 'statusbox' in kwargs.keys():
            self.statusbox=kwargs['statusbox']
        else:
            self.statusbox=None

        if 'cbfunc' in kwargs.keys():
            self.cbfunc=kwargs['cbfunc']
        else:
            self.cbfunc=None

        # ToDo: This can be removed soon.
        self.files={}

        self.objects={}

        self.filebar=None

        self.bottom=None

        # Used for drag and drop operations.
        self._dragging={}

        # Total real width of the file bar, not what is shown on the screen.
        self.filebar_width=None

        # Pointer to the first thumbnail on the file bar.
        self._object_id_of_first_file=None
                
        self.images_folder=os.path.join(bin.application_root_folder(), 'images')

        # ToDo: Add audio and video types.
        self.extensions={
            '.jpg'  : 'image',
            '.gif'  : 'image',
            '.bmp'  : 'image',
            '.docx' : 'word.jpg',
            '.pptx' : 'ppt.jpg',
            '.txt'  : 'text.jpg'
        }

        self.patterns_to_exclude=[]

        self.canvas.tag_bind("FileBarFile", "<ButtonPress-1>",   self._thumbnail_mouse_down)
        #self.canvas.tag_bind("FileBarFile", "<B1-Motion>",       self._thumbnail_mouse_over)
        self.canvas.tag_bind("FileBarFile", "<Motion>",       self._thumbnail_mouse_over)
        self.canvas.tag_bind("FileBarFile", "<ButtonRelease-1>", self._thumbnail_mouse_up)
        self.canvas.tag_bind("FileBarFile", "<Double-1>",        self._thumbnail_mouse_doubleclick)

        self.real_x=self.x

        self.draw()