Severe Anchor Problems with NxPageControl
#1
Posted 04 December 2007 - 01:32 PM
I've got a severe problem with anchored controls on a NxPageControl!
When I create some pages and put some NxControls on it and anchor them to all sides (with Anchors property) I see that only the activepage is resized properly when I resize the application in the TForm.OnCreate handler. The other controls on non visible pages are not resized properly.
The NxPageControl is alClient aligned to the Form and has a Margin of 4.
#2
Posted 04 December 2007 - 03:53 PM
Maybe it is not possible different, because I am hidding innactive pages and this maybe block anchors
I will see what I can do here. If you have any suggestion , please tell me.
Best regards
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#3
Posted 04 December 2007 - 04:01 PM
I suggest disabling next line in NxCustomNotebook.SetActivePage:
if Assigned(FActivePage) then
begin
// FActivePage.Hide; { page is not hidden in design-time } <------ comment this line
FActivePage.DoHide; { event }
AOldIndex := FActivePage.PageIndex;
end else AOldIndex := -1;
But, I am not sure is this will cause some other problems, like tab going into hidden page and similar.
I will test it more, if you can please tell me if you spot some anomaly.
Best regards
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#4
Posted 04 December 2007 - 04:34 PM
Strangely enough is resizing at designtime ok. It only happens at runtime (even if i do not set the bounds of the app at startup, controls just don't anchor on certain sides as if the anchor property isn't loaded correctly).
#5
Posted 04 December 2007 - 05:49 PM
I now can get 3 of the 6 tabs to align properly. The rest of the tabs and their controls refuse to anchor(or only do so horizontally). It's the first two and the active Tabsheet one at designtime (or the last one i edited, not sure about that).
Strangely enough is resizing at designtime ok. It only happens at runtime (even if i do not set the bounds of the app at startup, controls just don't anchor on certain sides as if the anchor property isn't loaded correctly).
#6
Posted 04 December 2007 - 07:06 PM
In run-time, page can't be hidden and this is why all work fine. But in run-time, if I don't hide page (TNxTabSheet), user will be able to Tab troughs 2 pages even one is inactive.
Maybe I can try to call resize of all inactive pages in WM_SIZE message.
Best regards
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#7
Posted 04 December 2007 - 07:10 PM
I hope you find a good solution. For now (due to pressure on the project) I hardcoded the resizing.
In run-time, page can't be hidden and this is why all work fine. But in run-time, if I don't hide page (TNxTabSheet), user will be able to Tab troughs 2 pages even one is inactive.
Maybe I can try to call resize of all inactive pages in WM_SIZE message.
Best regards
#8
Posted 04 December 2007 - 07:33 PM
Can you please tell me how do you do this? Do you have force anchors?
I have try to not hide page (commenting line in sample which I post in previous posts), but Tabs are moving trough visible and invisible pages then
I will need to somehow disable inactive pages instead hiding it.
Best regards
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#9
Posted 04 December 2007 - 07:40 PM
Maybe there is a hope for this problem
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#10
Posted 04 December 2007 - 10:17 PM
Change next procedure in NxPageControl.pas file:
begin
inherited;
if Value is TNxCustomNotebook then
begin
FPageControl := TNxCustomNotebook(Value);
if Self <> FPageControl.ActivePage then Hide;
FPageControl.FPageList.Add(Self);
SetBounds(0, 0, FPageControl.ClientWidth, FPageControl.ClientHeight); // <------ new line
end;
end;
Please tell me how it works now.
Best regards
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#11
Posted 05 December 2007 - 12:38 AM
#12
Posted 05 December 2007 - 01:21 AM
Maybe this is same problem which you have reported.
Try to apply this fix and test it for your problem.
Best regards
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#13
Posted 05 December 2007 - 03:50 PM
Hurray it seems to work properly (i removed the first fix and applied the 2nd one). Keep testing it a bit more please.
What a single line of code can make a difference!
Maybe this is same problem which you have reported.
Try to apply this fix and test it for your problem.
Best regards
#14
Posted 05 December 2007 - 03:52 PM
I will continue testing it too. Solution is possible, only to see if this is righ one.
Best regards
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











