ListViewAutoScale

wm.chatman

Well-Known Member
Licensed User
Longtime User
Hi

this Test App uses Filippos listview to show Photos, using Auto Scale compile,
the listview on my MDA is only half the size shown.
Original code-> 'lv.New1("Form1",0,50,Form1.Width,Form1.Height - 50)
Here on MDA is only half the size shown.

Changed code:
lv.new1("Form1",0,0,Form1.width * ScreenScaleX, Form1.height * ScreenScaleY)
Now the LV is full size on Device, but it does not show the scroll bars.
It would be nice if someone has a better working code, so the Scrollbars are also shown. Any ideas and Help on this would be very nice.
I would like to continue using Filippos LV.

Best regards.

William
 
Last edited:
D

Deleted member 103

Guest
Hi William,

you need the library "FormLib.dll" into your project and then add this line in the Sub App_Start.

du musst die Library "FormLib.dll" in dein Project hinzfügen und dann diese Zeile in den Sub "App_Start" hinzufügen

frmMain.New1("form1",B4PObject(1))


This Sub You also need to add:

Diese Sub musst du auch hinzufügen:

Sub frmMain_resize
lv.Width=form1.Width
lv.Height=form1.Height
End Sub


Ciao,
Filippo
 

wm.chatman

Well-Known Member
Licensed User
Longtime User
Filippo

frmMain.New1("form1",B4PObject(1)) gives Error Msg on Desktop.

does frmMain.New1 not have to be flb.New1?

Do I need to add frmMain as new Object?

I added flb.New1 in Sub App_Start. Still frmMain is not a known control or object.
Occured on Line: 15 and this is frmMain.New1("form1",B4PObject(1))

Also there is no frmMain. Only Main. I changed this, but getting no Results. Confused now.
 
Last edited:

wm.chatman

Well-Known Member
Licensed User
Longtime User
sure Filippo, I did this.

Under Tools / Components, I added FormLib.
Under Tools / Add Objects, I added FormLib.
Name: flb

I then added In App_Start
flb.New1
but I am still getting the same Error Msg.
What did I miss?

I took in all the Info, on Using a library in your Basic4ppc project. And still can not get results.

Is it possible for just a little more help on this please. This would really be great!

William
 
Last edited:

wm.chatman

Well-Known Member
Licensed User
Longtime User
Hi

I Updated Post #1. Now has the changed part of code. I did have this correct, a while back. But seems to me still something might be missing.

NO Auto Scale on Device...

Would some kind Heart please take a look, 4 eyes are better then 2.

Place myImages Folder in the Main App. for Tests. Even with the new added lines of code, outcome is the same. Please check Attachment.

Reading the ListView Help, seems like no AutoScale is avail. But, I think with just a little bit of good code, this would work.
But, as I do not know how to write this helping code, I quess I am SHOT! App is at 99% from being done, I am just shot and put under ground. Now i am teed, because we can JUNK THIS PROJECT.

Reading the ListView Help, seems like no way to get lv to Auto Scale on Device. But, there is a way with some good code.
I am not able to write this code. The Project is at its end 99.9%. Well, looks like I am just SHOT, and put UNDER.
Guess we can Junk, the Project. Sad Story.

Thanks.

William

PS. Filippo. it sure would be very nice if your LISTVIEW Control would also AutoScale, for the DEVICE... such a cool tool, but NO AutoScale for Device. Thats, a shame. This would really help alot!
 

Attachments

  • lvDevice.JPG
    26.5 KB · Views: 195
Last edited:

klaus

Expert
Licensed User
Longtime User
Hi William,

I modyfied your code as follows:
B4X:
[FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]lv.New1([/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]"Form1"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2],[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2],[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]50[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]*[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]ScreenScaleY[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2],Form1.Width*[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]ScreenScaleX[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2],(Form1.Height - [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]50[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2])*[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]ScreenScaleY[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2])[/SIZE][/FONT]
[SIZE=2][FONT=Courier New]lv.AddColumn([/FONT][/SIZE][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]"FileName"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2],[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]100[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]*[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]ScreenScaleX[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2],[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2],[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]False[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2],coltype.NText)[/SIZE][/FONT]
[SIZE=2][FONT=Courier New]lv.AddColumn([/FONT][/SIZE][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]"FileFullName"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2],[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]100[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]*[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]ScreenScaleX[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2],[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2],[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]False[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2],coltype.NText)[/SIZE][/FONT]
[/SIZE][/FONT]
This works on my htc Touch HD.

Best regards.
 

wm.chatman

Well-Known Member
Licensed User
Longtime User
Klaus

does this really work? because I am ready to just JUNK this Project.

Update: @klaus / check Attachment please!
 

Attachments

  • @klaus.JPG
    22.1 KB · Views: 221
Last edited:

wm.chatman

Well-Known Member
Licensed User
Longtime User
As you can see, the screenshot is from my device !

Best regards.
Klaus, I jumpt about one meter in the Air! I just could
not believe my eyes. When all seems at Deadwoods end, Sir, your the Best!
There are nobody that have used there own time so much and has Helpt others so very much, as yourself. >Sir, great Respect, and Honor<

In a few days I would like to post this little App into >Share Your Creations. What would be the best way, for doing this Klaus?

Thank you much Sir.

Best regards to you.

William
 
Last edited:

wm.chatman

Well-Known Member
Licensed User
Longtime User
Klaus

I took a Photo with the internal Device Camera. Sad News.
The Photo had been saved in the myImages Folder. After Open Photo Viewer the ListView has the same Problem.
I restarted the Program on the Device, and see there the ListView was once again Auto Scaled. Please Klaus, check this for me. Please take a Photo, and save, then go to Open Photo Viewer. I think you will get the same Problem.

edit: i tried again, to no avail. whats missing now?
I know it is the same problem as before, but I do not know where to start and look.

William
 
Last edited:

klaus

Expert
Licensed User
Longtime User
Hi William,

I missed these 2 lines:
B4X:
[FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]Sub [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]frmMain_Resize[/SIZE][/FONT]
[SIZE=2][FONT=Courier New] lv.Width=Form1.Width[/FONT][/SIZE][/SIZE][/FONT]
[FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] lv.Height=Form1.Height[/SIZE][/FONT][/SIZE][/FONT]
[FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]End Sub[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT]

I don't know if on your device when you come back from the frmPhoto form the Resize event is triggerd.

Try the following:
- remove the frmMain_Resize routine
- replace the frmMain_Resize routine by:
B4X:
[FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]Sub [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]frmMain_Resize[/SIZE][/FONT]
[SIZE=2][FONT=Courier New] lv.Width=Form1.Width*[/FONT][/SIZE][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]ScreenScaleX[/COLOR][/SIZE][/FONT]
[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] lv.Top=[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]50[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]*[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]ScreenScaleY[/COLOR][/SIZE][/FONT]
[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] lv.Height=(Form1.Height - [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]50[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2])*[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]ScreenScaleY[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2])[/SIZE][/FONT]
[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]End Sub[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT]

On my htc Touch HD, the 2 solutions above work OK, even leaving the 2 lines as on top works OK, that means that on my device the frmMain_Resize event is not triggered.

Best regards.
 

wm.chatman

Well-Known Member
Licensed User
Longtime User
Hello Klaus.

I knew it had the same problem as before, and I did have in my Mind the SubfrmMain_Resize.

Thinking it did have something to do with the ScreenScale Situation. But, I was not sure at all. So...

After changing this line:
lv.Height=(Form1.Height - 50)*ScreenScaleY)

To:
lv.Height=(Form1.Height - 50)*ScreenScaleY

it gave no more Problems.

Let me Quote: Like Sarah Ward wrote. You are a hero!
Thank you for taking your time and Helping me Sir!

Have a nice day.
Best regards.

William

:sign0089:
 

wm.chatman

Well-Known Member
Licensed User
Longtime User
@ Klaus. yes, now I understand this portion of code!

YOU, SAVED THIS PROJECT!

I left all lines intakt, just added your new lines of code. >WORKS GREAT<

BTW Klaus. is it possible to make the TempImage invisible, so TempImage is not schon in the ListView?
TempImage is also shown in the Clip. So while viewing the Clip, we see the TempImage and new
Photo that had been saved. Something like a double Picture effect, if you know what I mean Klaus.
Can I just make Invisible the TepmImage? Working on Patching this Source to the Main TRUIDbase Program.

Please take look at Attached Device Img
 
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…