[Gambas-user] Tableview problem

Peter Peyotle peterpeyotle at gmx.de
Tue Mar 12 09:27:29 CET 2019


Thank you for your answer. I solved the problem. The cells have a continuous internal top component. then top is bigger than the field of vision. my control must be placed in the field of view. a cell is (unfortunately) not a container. So I have to insert the control relative to the scroll position. this is 
tableview [a, b] .y - tableview.scrollY. 
that's it :-), juhuuuuu

Von meinem Sony Xperia™-Smartphone gesendet

---- Gianluigi schrieb ----

>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
>
>
>----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20190312/f6d343b7/attachment.html>


More information about the User mailing list