Tableview edit cell
Posted
#1
(In Topic #1445)
Regular

Code (gambas)
- ' If iRC[0] <> -1 Then TablePesticide.moveto(iRC[0], iRC[1])
- TablePesticide.MoveTo(TablePesticide.Row, TablePesticide.Column)
- TablePesticide.Edit
- TextBox1 = TablePesticide.Editor
- TextBox1.SelectAll
- 'Only way to get Mouse down from Textbox1
Until now this worked, now on Textbox1.SelectAll i get null Object, commentet out nothing happens…
What i make wrong?
Posted
Guru

Posted
Regular

Posted
Guru

Andreas_K said
I get Tableview.editor is read only.
Aah yes sorry i confused it with EditWith method.
TableView.Editor is for getting the control used with TableView.EditWith() TableView.Edit
Maybe whoever wrote that example can explain what it's doing.
I'm guessing it's using TableView default editor that is probably a textbox.
But for some reason in new gambas it's not created yet.
Maybe if you use Wait 0.1 after TableView.Edit to give the textbox chance to create.
Posted
Regular

Posted
Guru

Posted
Guru

Posted
Guru

seems to work as expected here so we need to figure out why it's not for you.
Does the Textbox to edit the fields actually appear?
I suspect editing is somehow broken as you say "nothing happens"
Posted
Regular

No Textbox appears.
Posted
Regular

Here's a bit of code I wrote (don't worry, be happy
Now, a bit of theory…
When Edit/EditWith is executed, the Gambas GUI starts doing its' stuff. The "Editor" is a Control entirely within the GUI component. When you try and "get at it" in the lines following the Edit/EditWith in your code it is going to have no affect on what the GUI component is doing at that time. It has probably already displayed it and is waiting for input, you can't change it. So the only way to affect what is being displayed is like the above code i.e. you need to set it up before asking the GUI to do its' stuff and use EditWith not Edit. Also note that the control is initially typed as an anonymous Object not as Control or some specific Control.
I think TableView.Editor is only really for use in the TableView_Save() method so you can get the result of the users interaction.
Dat's what I think anywho.
b
Posted
Regular

Posted
Guru

Andreas_K said
Thanks, but is also not working, i can't see any editorbox or textbox.
Make a sample project showing the problem Andreas and post it here.
1 of 2 things happen when you do that….
Either you find you cannot reproduce the problem in your example program and it helps you find where your main program is going wrong.
Or you CAN reproduce the problem and WE can then help you find the error
But without seeing your code we cannot guess as to why your editor (textbox) does not show.
Also are you using X11 or wayland?
Posted
Regular

Code (gambas)
- .[irow, 5].Foreground = &H2727A0
- .[irow, 6].Text = GridPesticide[GridPesticide.Row, 6].Text
- .[irow, 7].Foreground = &HC0176B
- .[irow, 7].Text = GridPesticide[GridPesticide.Row, 7].Text
- .[irow, 7].tag = bBad
- .[irow, 8].Text = GridPesticide[GridPesticide.Row, 9].Text
- .[irow, 8].tag = GridPesticide[GridPesticide.Row, 10].Text
- .Rows[irow].Height = 24 '<---------
Since the update the row.height on the insertet row cannot be lower than 25, otherwise this error occur, also with higher values the text in the editorbox isnot readable. Can anyone reproduce this also? I use Ubuntu 24.10 with wayland.
1 guest and 0 members have just viewed this.


