Giter Club home page Giter Club logo

Comments (6)

ragardner avatar ragardner commented on June 14, 2024

Hello,

Sorry about that and thank you very much for pointing out the cause and offering a solution

It should be fixed in version 4.6.4 and the function has a few new arguments and the box should hug the cell size by using a frame internally, the new function looks like this:

create_dropdown(r = 0,
                c = 0,
                values = [],
                set_value = None,
                state = "readonly",
                see = True,
                destroy_on_select = True,
                current = False,
                openbox = True,
                set_cell_on_select = True,
                redraw = True,
                recreate_selection_boxes = True)

openbox is for whether or not you want the box to be opened upon creation, redraw and recreate are for if destroy_on_select is True

Let me know if there are further problems with the function

As for the checkbox suggestion, thankyou it's a great idea, do you mean like a single checkbox or multiple ones in a scrollable window inside the cell?

from tksheet.

skedus avatar skedus commented on June 14, 2024

Thanks for your quick answer, I made a new tests still at the end of the demo:

self.sheet.create_dropdown(3, 3, values=["AAA","BBB","CCC","DDD"],  set_value="CCC", see=False, openbox=False, destroy_on_select=False)
self.sheet.create_dropdown(4, 3, values=["AAA","BBB","CCC","DDD"],  set_value="BBB", see=False, openbox=False, destroy_on_select=False)
self.sheet.create_dropdown(5, 3, values=["AAA","BBB","CCC","DDD"],  set_value="DDD", see=False, openbox=False, destroy_on_select=False)
print (self.sheet.get_cell_data(3, 3))
print (self.sheet.get_cell_data(4, 3))
print (self.sheet.get_cell_data(5, 3))

Correction: I need to remove line 3867 in _tksheet_main_table (create_dropdown)

self.destroy_dropdown()

else all previous combox are not display only the last one (but may be this correction is too strong) sorry I do not yet read all code.

I saw as well that cell values are not really set with the print you can see old value are displayed (should be initial combo setup CCC BBB DDD in the example)

For my need a single checkbutton is enough and probably more simple to create ;-)

from tksheet.

ragardner avatar ragardner commented on June 14, 2024

Ah yeah, I see what you mean, unfortunately it's always been designed as a singular input thing and it will take a few days to overhaul the code to create and manage multiple dropdown boxes that persist as I have very little free time at the moment, but I will do the work, it will just take a few days or a week to complete

from tksheet.

skedus avatar skedus commented on June 14, 2024

I understand, no problem,
Thank you for your time

from tksheet.

ragardner avatar ragardner commented on June 14, 2024

@skedus Hello,

With version 4.6.6 I have added the basic functionality to create multiple persistent boxes which will update the underlying table upon creation and selection, I have removed the argument openbox as it was causing weird lag and focus issues, so you can try your code as below again:

self.sheet.create_dropdown(3, 3, values=["AAA","BBB","CCC","DDD"],  set_value="CCC", see=False, destroy_on_select=False)
self.sheet.create_dropdown(4, 3, values=["AAA","BBB","CCC","DDD"],  set_value="BBB", see=False, destroy_on_select=False)
self.sheet.create_dropdown(5, 3, values=["AAA","BBB","CCC","DDD"],  set_value="DDD", see=False, destroy_on_select=False)
print (self.sheet.get_cell_data(3, 3))
print (self.sheet.get_cell_data(4, 3))
print (self.sheet.get_cell_data(5, 3))

Please note that actions such as cell resizing, undo, drag and drop etc will not really work while you have these persistent boxes up, I will slowly add more code to maintain their positions and size etc, but I don't have a schedule for it

from tksheet.

skedus avatar skedus commented on June 14, 2024

Thank you for this update, It is working. But you are right many other things to do, to keep all functionalities (sorry for that)

I still do not know if it is the good approach, may by each cell should have a link to a specific class such, let say, Editor and various sub class EntryEditor (default one), ComboEditor ... which could be call only when edit cell and set the value ?? so non persistent as you did.
Then it could be possible to affect an Editor to cell, row, or column (even a custom one CustomEditor(Editor)) I do not know just thinking.

Anyway thanks again for your high level of response.

from tksheet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.