ClsCheckList - Scrollview (panel) width

stefanoa

Active Member
Licensed User
Longtime User
hi,
how can i set, by code, "Scrollview width" in clschecklist?

i have:
B4X:
Dim lstAudio As ClsCheckList
...
'scvFiles=scrollview
lstAudio.Initialize( Me, scvFiles, "", "Audio_Click", "Audio_LongClick",1)
...
lstAudio.AddItemNoChkbx(fm.Get("ID" & ix), fm.Get("Title" & ix), fm.Get("Location" & ix), Null)
...
lstAudio.ResizePanel

lstaudio (ClsCheckList) don't have the property "width"...

i tried to see in clsCheckList module, but i don't find the solution...
thanks
:sign0085:
 

stefanoa

Active Member
Licensed User
Longtime User
Scvfiles.width determine the width of scrollview but NOT the width of panels contained, so the panels results more shorts...
The dlass clschecklist manages panels dimension in the scrollview..
 
Upvote 0

stefanoa

Active Member
Licensed User
Longtime User
Of course i've read the code.. :cool:
I asked if there's a method to change these values by parameters, without change your class (to mantain your class for future update...) because I have to change the width (and also font size) dinamically.
Ok i'll change your class if this is the only possibiity..
 
Upvote 0

Informatix

Expert
Licensed User
Longtime User
Of course i've read the code.. :cool:
I asked if there's a method to change these values by parameters, without change your class (to mantain your class for future update...) because I have to change the width (and also font size) dinamically.
Ok i'll change your class if this is the only possibiity..

There's absolutely nothing to change in the class since it doesn't change any width once the list is filled. And if you want to change a width, it's as simple as width = new value (width can be the scrollview panel width or the item panel width). So I really don't understand the problem.
 
Upvote 0

stefanoa

Active Member
Licensed User
Longtime User
ok. i solved, the problem was in panel configuration and it was not necessary modify the class, as your information.
B4X:
Dim scvFiles As ScrollView
Dim pnlAudio As Panel
.....
pnlAudio.AddView(scvFiles, 0, 0, wwww, hhhhh )
...
where wwww=width and hhhh=height of panel

For the fonts size instead, i need to modify the class clsCheckList in sub AddItemNoChkbx
B4X:
Public Sub AddItemNoChkbx(ID As Object, Text1 As String, Text2 As String, Image As Bitmap)
....
   lbl1.TextSize = 18dip        '<<< UPDATE
   lbl2.TextSize = 12dip        '<<< UPDATE
....

thanks
 
Upvote 0

Informatix

Expert
Licensed User
Longtime User
ok. i solved, the problem was in panel configuration and it was not necessary modify the class, as your information.
B4X:
Dim scvFiles As ScrollView
Dim pnlAudio As Panel
.....
pnlAudio.AddView(scvFiles, 0, 0, wwww, hhhhh )
...
where wwww=width and hhhh=height of panel

For the fonts size instead, i need to modify the class clsCheckList in sub AddItemNoChkbx
B4X:
Public Sub AddItemNoChkbx(ID As Object, Text1 As String, Text2 As String, Image As Bitmap)
....
   lbl1.TextSize = 18dip        '<<< UPDATE
   lbl2.TextSize = 12dip        '<<< UPDATE
....

If your panel size is subject to frequent changes, you can set the width and height of the ScrollView to -1 (not tested, but that should work). This value means "FILL_PARENT". The ScrollView will be automatically resized when the panel size changes.
For the font size, you can modify the class, of course, but you can also create custom content and add it with AddCustomItem.
Beware: don't set TextSize in DIPs (it is already measured in physical units).
 
Upvote 0
Top