Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

To Do List #175

Open
7 of 8 tasks
ragardner opened this issue May 2, 2023 · 8 comments
Open
7 of 8 tasks

To Do List #175

ragardner opened this issue May 2, 2023 · 8 comments

Comments

@ragardner
Copy link
Owner

ragardner commented May 2, 2023

Tasks in this list may or may not be completed

  • Add pyproject.toml file
  • Ctrl/Cmd click deselect (version 7)
  • Overhaul events to make them clearer and consistent for ease of identification and use (version 7)
  • Add SheetModified event data and make consistent with above change (version 7)
  • Add named spans (version 7)
  • Add find window Ctrl/Cmd f
  • Attempt to add Treeview with capability to enable or disable it (version 7.1)
  • Tags for rows and maybe also columns (version 7.1)
@CalJaDav
Copy link
Contributor

CalJaDav commented May 3, 2023

Let me know if you want me to have a crack at any of these!

@ragardner
Copy link
Owner Author

Thanks, at the moment the library is undergoing some big changes so I'll let you know when they're done, afterwards work can continue on adding new features

@CalJaDav
Copy link
Contributor

CalJaDav commented May 4, 2023

Great! I have some features I am planning on adding, I'll list them below and get your thoughts:

  1. Named Ranges. Fairly straightforward to implement, this would add an additional named range/cell/row/column parameter to cell options which would allow users to specify an area on the table that can be referenced and by calling the name. This would move with the table as columns./rows are added and ranges would expand if rows/columns are inserted within their bounds.

  2. Text wrapping. I have already implemented a test build of this and it is pretty straight forward. One small thing I have noticed is that purely pythonic text wrappers are a little slow and this does mean we get a minor (and I do mean quite minor) performance hit when very very very large numbers of wrapped cells are shown on screen at a time, since the text wrapping is calculated for every cell on screen. I have thought about implementing a binary executable (compiled Rust code) that would speed up that end of things. But that would take us away from a purely python based solution, I'd value your input on that. There are probably other ways of speeding it up, perhaps using some clever code to limit text-wrap calcs to just cells whose widths are modified on redraw, but that would involve storing wrapped data separately to the main data and I'm already getting confused... There is also a slightly more significant performance bottle neck due the new lines of text adding additional calls to the canvas draw text function that also impacts performance for large numbers of displayed cells with many lines. Although this is not something I necessarily see as being very easily solved nor is it text-wrapping specific, more a byproduct of it.

  3. More events. Currently I am running a modded build of tksheet with some additional event bindings to make drawing custom sheets much easier. Event listeners are a pretty integral part of tkinter and are just so useful for making very extensible widgets. I think in addition to <<SheetModified>>, a <<SheetRedrawn>> event is quite useful for updating user canvas elements alongside the sheet. I'm sure there are plenty of other places they could be added as well. I'll attach a screenshot of one of the CRUD interfaces I am currently working on that uses a modified version of tksheet with custom canvas elements to display and edit timeseries data, might be nice to see how your hard work is being used IRL.
    image

  4. Vertical alignment. Not a priority, but probably a nice-to-have. Doesn't seem super complex to implement, more just annoying to account for all the edge cases and logic.

Look forward to seeing the changes in the next build. Thanks again!
C.

@ragardner
Copy link
Owner Author

ragardner commented May 5, 2023

Hey, thanks for the screenshot, that’s a nice looking UI, did you use ttk styles? How did you manage to change the scroll bar too? :o

about the named ranges, any idea at the moment what the dict key would be for cell_options for example, don’t worry if not sure, I have to add something like this at some point anyway

About text wrapping, I will have to get back to you on this, at some point I’m going to try something which if it succeeds will mean the ability to use the native tkinter canvas text width argument and easily wrap any cell, it might not work I’m not 100% sure

Version 6.1.0 should have the redrawn event, in case you were wondering, I’d be happy to add more in the future, I haven’t added the docs yet because of the lack of data but considering the that I might not get around to that for some time I probably should do the docs

@rdbende
Copy link

rdbende commented May 5, 2023

Hey, that’s a nice looking UI, did you use ttk styles? How did you manage to change the scroll bar too? :o

Ohh, wow. Is that a custormized Azure ttk theme? I love the colors 😍

@CaJaDav
Copy link

CaJaDav commented May 6, 2023

Hi! CalJaDavs's alternate account here.

Hey, thanks for the screenshot, that’s a nice looking UI, did you use ttk styles? How did you manage to change the scroll bar too?

Thanks, full credit to @rdbende for figuring out most of this, check out his repos to see how a lot of this stuff works. Tkinter runs on a Tcl backend, so knowing how all that stuff works is pretty powerful. Its how I was able to code in the closeable notebook tabs and some other more specialized widgets not shown here.

Ohh, wow. Is that a custormized Azure ttk theme? I love the colors 😍

Hey! I knew you were lurking around here! Full credit where its due, many of the assets were ripped from your sun-valley theme. I just painstakingly broke them down into a series of layered greyscale bitmaps so that I could change them to any colours I liked. I might tidy up the little UI designer thingy I made to do this and push it someday. Especially if it is something you might be interested in including on one of your repos.

any idea at the moment what the dict key would be for cell_options

Hmmmm. Not yet, but I have some idea of the functionaility I'd like to see. A range is an area on the sheet bounded by two vertices (corner cells) with all cells falling between them included in the range. This area can expand or shrink as rows/columns are added/removed. Named cells are simply a one-cell named range, and named columns/rows are just ranged that sit within column named range.

@ragardner
Copy link
Owner Author

ragardner commented May 6, 2023

any idea at the moment what the dict key would be for cell_options for example

@CalJaDav Hey btw don't worry about answering this question, I don't think it would work in cell options anyway, I'll figure this out, it just might be a while until I get around to doing a release with it

Thanks, full credit to @rdbende for figuring out most of this, check out his repos to see how a lot of this stuff works. Tkinter runs on a Tcl backend, so knowing how all that stuff works is pretty powerful. Its how I was able to code in the closeable notebook tabs and some other more specialized widgets not shown here.

Cheers!

@CaJaDav
Copy link

CaJaDav commented May 6, 2023

Apologies for posting half written comments btw, I keep pressing shift-enter instead of enter, I'll blame this Drambuie.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants