Home » U++ Library support » U++ Widgets - General questions or Mixed problems » Size of TopWindow is different then the size I set for it
Size of TopWindow is different then the size I set for it [message #48330] |
Fri, 23 June 2017 15:58 |
rafiwui
Messages: 105 Registered: June 2017 Location: Stuttgart, Germany
|
Experienced Member |
|
|
When I wanted to add some buttons to a window I encountered a problem:
They were not fully visible. I added them depending on the size returned by TopWindow::GetSize() so I thought they should fit.
Can someone tell me why the TopWIndow is not in the size I gave him?
Here is an example code snippet that should produce the problem properly:
#include <CtrlLib/CtrlLib.h>
using namespace Upp;
GUI_APP_MAIN
{
TopWindow app;
app.SetRect(0, 0, 500, 200);
Button button1;
// Button 1 should be centered and with a bit of space on both sides and a bit of space to
// the top
button1.SetLabel("Test Button 1").LeftPosZ(10, 480).TopPosZ(10, 80);
Button button2;
// Button 2 should be centered and with a bit of space on both sides and a bit of space to
// the bottom. This time the size is measured from the size of the TopWindow and not
// hardcoded
button2.SetLabel("Test Button 2").LeftPosZ(10, app.GetSize().cx - 20).TopPosZ(110, 80);
app.Add(button1);
app.Add(button2);
app.Run();
}
And to be safe I added an image how the window looks when you run the code.
Greetings
Daniel
|
|
|
|
|
Size of TopWindow is different then the size I set for it
By: rafiwui on Fri, 23 June 2017 15:58
|
|
|
Re: Size of TopWindow is different then the size I set for it
By: mirek on Sat, 24 June 2017 15:23
|
|
|
Re: Size of TopWindow is different then the size I set for it
By: rafiwui on Mon, 26 June 2017 09:49
|
|
|
Re: Size of TopWindow is different then the size I set for it
By: rafiwui on Mon, 26 June 2017 12:51
|
|
|
Re: Size of TopWindow is different then the size I set for it
By: mirek on Mon, 26 June 2017 13:08
|
|
|
Re: Size of TopWindow is different then the size I set for it
By: rafiwui on Mon, 26 June 2017 13:32
|
|
|
Re: Size of TopWindow is different then the size I set for it
By: mirek on Mon, 26 June 2017 14:37
|
|
|
Re: Size of TopWindow is different then the size I set for it
By: rafiwui on Mon, 26 June 2017 14:51
|
|
|
Re: Size of TopWindow is different then the size I set for it
By: mirek on Mon, 26 June 2017 15:15
|
|
|
Re: Size of TopWindow is different then the size I set for it
By: rafiwui on Tue, 10 October 2017 08:54
|
|
|
Re: Size of TopWindow is different then the size I set for it
By: mirek on Sat, 14 October 2017 11:05
|
|
|
Re: Size of TopWindow is different then the size I set for it
By: rafiwui on Mon, 16 October 2017 09:29
|
|
|
Re: Size of TopWindow is different then the size I set for it
By: mirek on Mon, 16 October 2017 10:56
|
|
|
Re: Size of TopWindow is different then the size I set for it
By: rafiwui on Mon, 16 October 2017 12:08
|
Goto Forum:
Current Time: Mon May 13 09:21:22 CEST 2024
Total time taken to generate the page: 0.03685 seconds
|