Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: General sizing bug with BorderStyle: None?


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 8 - Last Post: May 19, 2016 10:12 PM Last Post By: Sauter Jochen
Sauter Jochen

Posts: 4
Registered: 2/18/16
General sizing bug with BorderStyle: None?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 17, 2016 10:29 PM
Using Delphi 10 Seattle, I'm creating a new FireMonkey form with Width:=650 and Height:=400.
I place a little rectangle in the bottom right corner of the form, about 10 pixels distance to the borders.
procedure TTestform1.Rectangle1Click(Sender: TObject);
begin
  Showmessage(IntToStr(ClientWidth));
end;

I set BorderStyle to "Single", start, the rectangle sits perfectlty in the corner just like in the designer. ClientWidth: 650.

I set BorderStyle to "None", start the application. The rectangle is now much further away from the borders than the designer showed.
Clicking my rectangle tells me: 666.

Why?

I'm going to design a GUI with a lot of elements, I want to nail this borderless form down 100% before starting messy, then later on running into problems.
I just need to see in the designer what I will get in the running application.

Thanks for reading.

Markus Humm

Posts: 5,113
Registered: 11/9/03
Re: General sizing bug with BorderStyle: None? [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 18, 2016 9:48 AM   in response to: Sauter Jochen in response to: Sauter Jochen
Am 18.05.2016 um 07:36 schrieb Sauter Jochen:
Using Delphi 10 Seattle, I'm creating a new FireMonkey form with Width:=650 and Height:=400.
I place a little rectangle in the bottom right corner of the form, about 10 pixels distance to the borders.
procedure TTestform1.Rectangle1Click(Sender: TObject);
begin
  Showmessage(IntToStr(ClientWidth));
end;

I set BorderStyle to "Single", start, the rectangle sits perfectlty in the corner just like in the designer. ClientWidth: 650.

I set BorderStyle to "None", start the application. The rectangle is now much further away from the borders than the designer showed.
Clicking my rectangle tells me: 666.

Why?

I'm going to design a GUI with a lot of elements, I want to nail this borderless form down 100% before starting messy, then later on running into problems.
I just need to see in the designer what I will get in the running application.


Maybe FMX is subtracting the width of the border of your rectangle's
position?

Greetings

Markus
John Kouraklis

Posts: 209
Registered: 3/10/01
Re: General sizing bug with BorderStyle: None?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 18, 2016 11:36 AM   in response to: Sauter Jochen in response to: Sauter Jochen
Sauter Jochen wrote:
Using Delphi 10 Seattle, I'm creating a new FireMonkey form with Width:=650 and Height:=400.
I place a little rectangle in the bottom right corner of the form, about 10 pixels distance to the borders.
procedure TTestform1.Rectangle1Click(Sender: TObject);
begin
  Showmessage(IntToStr(ClientWidth));
end;

I set BorderStyle to "Single", start, the rectangle sits perfectlty in the corner just like in the designer. ClientWidth: 650.

I set BorderStyle to "None", start the application. The rectangle is now much further away from the borders than the designer showed.
Clicking my rectangle tells me: 666.

I may have missed something but is this wrong?

ClientWidth gives the width between the borders (without the width of the borders), which is 650 when you have the border on.

Then, without the border, the width of the client covers the width of the border as well, thus 666 > 650. Therefore, the border takes 16 pixels in Win7.

I tested it in Win10, and D10.1 and it gives the same values.
John Kouraklis

Posts: 209
Registered: 3/10/01
Re: General sizing bug with BorderStyle: None?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 18, 2016 12:01 PM   in response to: Sauter Jochen in response to: Sauter Jochen
I set BorderStyle to "None", start the application. The rectangle is now much further away from the borders than the designer showed.
Clicking my rectangle tells me: 666.

It looks like it is further because you don't have any borders now. If you check the Position/X/.Y you'll see that they are the same.
Sauter Jochen

Posts: 4
Registered: 2/18/16
Re: General sizing bug with BorderStyle: None?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 18, 2016 10:25 PM   in response to: John Kouraklis in response to: John Kouraklis
John Kour wrote:
I set BorderStyle to "None", start the application. The rectangle is now much further away from the borders than the designer showed.
Clicking my rectangle tells me: 666.

It looks like it is further because you don't have any borders now. If you check the Position/X/.Y you'll see that they are the same.

I'm not sure if the whole +16px width concept works for Win7 borders, but I'm on Win10.
So any visible BorderStyle has like a 2px frame width overall.

The borderless form is different than in the designer. The objects' X,Y are the same.
The Form itself grows.

I think you are right, it looks like it grows in Y-dimension for the height that a titlebar and the borders would have, if they existed.
The 16px width growth could be a relic from Windows7 borders...

I would still consider this a bug, given the deprecated nature of the hardcoded values; while i would expect that a borderless form shouldn't suddenly grow, compared to the design-time version.

Edited by: Sauter Jochen on May 18, 2016 10:41 PM

Sauter Jochen

Posts: 4
Registered: 2/18/16
Re: General sizing bug with BorderStyle: None?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 18, 2016 10:52 PM   in response to: Sauter Jochen in response to: Sauter Jochen
What is the FMX designer presenting?

You generally see the content/usable area of a Form, which is what you design. Always without borders.

The content area of a form with borders is the whole window minus the borders.
The content area of a borderless form is everything you see in the designer.

They still subtract the borders for the designer representation, even though they shouldn't.

Does that make any sense?
John Kouraklis

Posts: 209
Registered: 3/10/01
Re: General sizing bug with BorderStyle: None?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 19, 2016 12:39 AM   in response to: Sauter Jochen in response to: Sauter Jochen
Sauter Jochen wrote:

You generally see the content/usable area of a Form, which is what you design. Always without borders.

The content area of a form with borders is the whole window minus the borders.
The content area of a borderless form is everything you see in the designer.

They still subtract the borders for the designer representation, even though they shouldn't.

Does that make any sense?

Yes, you are right. On Win10 there shouldn't be big difference between the design- and runtime-representation.
Markus Humm

Posts: 5,113
Registered: 11/9/03
Re: General sizing bug with BorderStyle: None?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 19, 2016 9:11 AM   in response to: Sauter Jochen in response to: Sauter Jochen
Am 19.05.2016 um 07:52 schrieb Sauter Jochen:
What is the FMX designer presenting?

You generally see the content/usable area of a Form, which is what you design. Always without borders.

The content area of a form with borders is the whole window minus the borders.
The content area of a borderless form is everything you see in the designer.

They still subtract the borders for the designer representation, even though they shouldn't.

Does that make any sense?

Hello,

if you agree that it doesn't make sense then please go ahead and fuile a
QP report over at quality.embarcadero.com

Greetings

Markus
Sauter Jochen

Posts: 4
Registered: 2/18/16
Re: General sizing bug with BorderStyle: None?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 19, 2016 10:12 PM   in response to: Markus Humm in response to: Markus Humm
Markus Humm wrote:
Am 19.05.2016 um 07:52 schrieb Sauter Jochen:
What is the FMX designer presenting?

You generally see the content/usable area of a Form, which is what you design. Always without borders.

The content area of a form with borders is the whole window minus the borders.
The content area of a borderless form is everything you see in the designer.

They still subtract the borders for the designer representation, even though they shouldn't.

Does that make any sense?

Hello,

if you agree that it doesn't make sense then please go ahead and fuile a
QP report over at quality.embarcadero.com

Greetings

Markus

Done
https://quality.embarcadero.com/browse/RSP-14924?filter=-4
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02