Bug on the IDE?

Just starting out? Need help? Post your questions and find answers here.
ClueLess
Enthusiast
Enthusiast
Posts: 360
Joined: Sun Jan 11, 2009 1:04 am

Bug on the IDE?

Post by ClueLess »

Hi
When designing a form, you define the height and width of a gadget, but that gets changed when the code is generated. For example, on the designer you define a string gadget with width of 150 and height of 30, and in the code generated it appears 100, 25.
Is this a bug?
Than You

// Moved from "Bugs - Windows" to "Coding Questions" (Kiffi)
User avatar
jacdelad
Addict
Addict
Posts: 1992
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: Bug on the IDE?

Post by jacdelad »

Geez...
...without code there are several causes that may be responsible. So before claiming for a bug here, please provide a code, that shows the problem to YOU. After confirming the bug, a mod will move the thread to the bug section.
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
User avatar
Kiffi
Addict
Addict
Posts: 1485
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: Bug on the IDE?

Post by Kiffi »

jacdelad wrote: Tue Sep 17, 2024 8:27 pmAfter confirming the bug, a mod will move the thread to the bug section.
+1

:?
Hygge
ClueLess
Enthusiast
Enthusiast
Posts: 360
Joined: Sun Jan 11, 2009 1:04 am

Re: Bug on the IDE?

Post by ClueLess »

I have no idea what code do you want me to send. Can't generate a code for the specifications of the gadget on de desiner. Unfortunatly can't send a picture
User avatar
ChrisR
Addict
Addict
Posts: 1466
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: Bug on the IDE?

Post by ChrisR »

Confirmed, seems to be related to DPI scaling.
Looks good if you close the IDE, change the scaling to 100% and then restart the IDE. You can then restore your default scaling.
User avatar
jacdelad
Addict
Addict
Posts: 1992
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: Bug on the IDE?

Post by jacdelad »

ClueLess wrote: Tue Sep 17, 2024 9:01 pm I have no idea what code do you want me to send. Can't generate a code for the specifications of the gadget on de desiner. Unfortunatly can't send a picture
What code? The code that shows the problem.
How do you expect us to test it without your code? All I can say is that I don't have the problem and like ChrisR said, it's probably due to dpi settings.
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
User avatar
Mindphazer
Enthusiast
Enthusiast
Posts: 456
Joined: Mon Sep 10, 2012 10:41 am
Location: Savoie

Re: Bug on the IDE?

Post by Mindphazer »

jacdelad wrote: Wed Sep 18, 2024 1:04 am
ClueLess wrote: Tue Sep 17, 2024 9:01 pm I have no idea what code do you want me to send. Can't generate a code for the specifications of the gadget on de desiner. Unfortunatly can't send a picture
What code? The code that shows the problem.
How do you expect us to test it without your code? All I can say is that I don't have the problem and like ChrisR said, it's probably due to dpi settings.
There is no code because, as he said, he uses Form Designer. The code generated by FD doesn't have the same size values of the gadgets than the sizes he set on FD. So the code won't help.
MacBook Pro 16" M4 Pro - 24 Gb - MacOS 15.4.1 - Iphone 15 Pro Max - iPad at home
...and unfortunately... Windows at work...
User avatar
jacdelad
Addict
Addict
Posts: 1992
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: Bug on the IDE?

Post by jacdelad »

Oh now I understand. So you want ot create a gadget with height 30 in the form designer, but the resulting code has height 25?
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
User avatar
Mindphazer
Enthusiast
Enthusiast
Posts: 456
Joined: Mon Sep 10, 2012 10:41 am
Location: Savoie

Re: Bug on the IDE?

Post by Mindphazer »

Yeah it seems so
MacBook Pro 16" M4 Pro - 24 Gb - MacOS 15.4.1 - Iphone 15 Pro Max - iPad at home
...and unfortunately... Windows at work...
User avatar
TI-994A
Addict
Addict
Posts: 2698
Joined: Sat Feb 19, 2011 3:47 am
Location: Singapore
Contact:

Re: Bug on the IDE?

Post by TI-994A »

ClueLess wrote: Tue Sep 17, 2024 8:24 pm...on the designer you define a string gadget with width of 150 and height of 30, and in the code generated it appears 100, 25.

The Form Designer conforms to DPI awareness. So, this happens when your display is scaled.

Image


As @ChrisR had mentioned earlier in this thread, simply reset the scaling to 100% and the gadget metrics will revert accordingly.
ChrisR wrote: Tue Sep 17, 2024 9:39 pm...close the IDE, change the scaling to 100% and then restart the IDE. You can then restore your default scaling.
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel :D
User avatar
ChrisR
Addict
Addict
Posts: 1466
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: Bug on the IDE?

Post by ChrisR »

Yes, but it shouldn't be like this.
IMO, If the user enters a width of 150 for a Gadget, the width in the generated code should also be 150, whatever its scale factor.

I had a quick look to the FormDesigner source code, removing all DesktopUnscaledX(Y) from codeviewer.pb and all DesktopScaledX(Y) from opensave.pb, it seems to do the trick.

I can test it a bit more and possibly create a Pull Request on github, if it is confirmed as a bug, too.

Temporarily, If anyone would like to test it, PureBasic.exe (Windows x64)
User avatar
TI-994A
Addict
Addict
Posts: 2698
Joined: Sat Feb 19, 2011 3:47 am
Location: Singapore
Contact:

Re: Bug on the IDE?

Post by TI-994A »

ChrisR wrote: Wed Sep 18, 2024 3:50 pmIMO, If the user enters a width of 150 for a Gadget, the width in the generated code should also be 150, whatever its scale factor.
I believe that this is done to preserve the visual representation of the form at design time. It is a visual designer after all. :wink:
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel :D
User avatar
ChrisR
Addict
Addict
Posts: 1466
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: Bug on the IDE?

Post by ChrisR »

Yes, that's an understandable point of view :)

As for me, it's a bug, we should have the same values (x, y, width, height) between the grid and the generated code.
As if we were drawing to a scale of 100%. The scaling is then done according to the DPIaware compiler option, to be compatible with all possible scaling factors. That's what I do in my visual designer :wink:
Furthermore, the ScrollArea InnerWidth(Height) is not currently scaled/unscaled as for ScrollBar, ProgressBar Minimum(Maximum). It's not consistent with the other values.

My point of view, but I'm not the one who decides whether it's a bug or not.
User avatar
HeX0R
Addict
Addict
Posts: 1189
Joined: Mon Sep 20, 2004 7:12 am
Location: Hell

Re: Bug on the IDE?

Post by HeX0R »

ChrisR wrote: Wed Sep 18, 2024 5:44 pm My point of view, but I'm not the one who decides whether it's a bug or not.
At least there is one moron who sees it the same way :mrgreen:
ClueLess
Enthusiast
Enthusiast
Posts: 360
Joined: Sun Jan 11, 2009 1:04 am

Re: Bug on the IDE?

Post by ClueLess »

It seems that someone understood what I mean
Post Reply