[Gambas-user] Tableview problem
Gianluigi
bagonergi at gmail.com
Mon Mar 11 17:25:08 CET 2019
Il giorno lun 11 mar 2019 alle ore 15:28 Peter Peyotle <peterpeyotle at gmx.de>
ha scritto:
> Hello and good day.
>
> I have the following problem:
>
> I put a combo box (or another control) in a cell of a tableview. The
> ComboBox is set by clicking on the cell.
> I use the following code:
> '
> -----------------------------------------------------------------------------------------------
> 'Gambas class file
>
> Private myCombo As ComboBox
>
> Public Sub form_Open ()
> myCombo = New ComboBox (TableView1.Children [0])
> Object.Attach (TableView1, Me, "tabEvents")
>
> TableView1.Columns.Count = 2
> TableView1.rows.Count = 15
> TableView1.Columns [0] .Width = TableView1.W / 2 - 15
> TableView1.Columns [1] .Width = TableView1.W / 2 - 15
> End
>
> Public Sub showCombo (tabIndex As Integer)
> Dim Xstart, CorrY As Integer
>
> myCombo.w = TableView1 [0, 1] .Width
> myCombo.h = TableView1 [0, 1] .Height
>
> myCombo.Y = TableView1 [tabIndex, 1] .Y
> myCombo.X = TableView1 [tabIndex, 1] .x
> End
>
> Public Sub tabEvents_Click ()
>
> show combo (Last.row)
>
> End
>
> '
> --------------------------------------------------------------------------------------------------------------------
>
> It works very well too.
> But, if I scroll the view into the area whose cells are first visible by
> scrolling, then the position fails (thus here: myCombo.Y = TableView1
> [tabIndex, 1] .Y)
>
> Perhaps this can be compensated by a correction factor.
> But I think the tableview should also place in the not (always) visible
> area correctly.
>
> Thanks for the help - I need her :-(.
>
>
I attach a project that could offer you some ideas.
It comes from this discussion on Gambas-it.org [0].
Use the translator for explanations (they are in Italian).
Regards
Gianluigi
[0] https://www.gambas-it.org/smf/index.php?topic=4921.0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20190311/3aa906d0/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ButtonDraw-0.0.3.tar.gz
Type: application/gzip
Size: 23816 bytes
Desc: not available
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20190311/3aa906d0/attachment-0001.gz>
More information about the User
mailing list