Profile Picture

Floated NDockingPanel NFrameAppearance

Posted By Craig Swearingen 12 Years Ago
Author
Message
Craig Swearingen
Posted 12 Years Ago
View Quick Profile
Supreme Being

Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)

Group: Forum Members
Last Active: 7 Years Ago
Posts: 99, Visits: 654

I've got the following:

NDockingPanel panelWindow = new NDockingPanel();

int newwidth, newheight;

<Calculate newwidth and newheight for panel>

Size pwSize = new Size(newwidth, newheight);

panelWindow.FloatingSize = pwSize;

panelWindow.TabInfo.AutoHideSize = pwSize;

panelWindow.SizeInfo.PreferredSize = pwSize;

<fill out rest of panelWindow etc.>

panelWindow.float();

I'm trying to calculate the appropriate size of the panel before calling the float method.  I know what the client dimensions of the floated window need to be and I want to add to this the needs for the borders and caption text like so: 

Width = ClientWidth + frameAppearance.LeftBorder + frameAppearance.RightBorder;

Height = ClientHeight + frameAppearance.BottomBorder + frameAppearance.CaptionHeight;

How can I get the NFrameAppearance used by floated panels?  It seems its close to

NFrameAppearance frameAppearance = NUIManager.GetPredefinedFrame(PredefinedFrame.Simple)

but that's not it exactly.  It's not NUIManager.FrameAppearance either.  I've looked but I haven't discovered a way to query these dimensions.  Thanks for any thoughts on how to do this.



Nevron Support
Posted 12 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)

Group: Forum Members
Last Active: Last Year
Posts: 3,039, Visits: 3,746
Hello Craig,

Did you try panelWindow.BorderWidth?


Best Regards,
Nevron Support Team



Craig Swearingen
Posted 12 Years Ago
View Quick Profile
Supreme Being

Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)

Group: Forum Members
Last Active: 7 Years Ago
Posts: 99, Visits: 654
Thanks for the suggestion.  The panelWindow.BorderWidth value always comes back 0 no matter when I call it.  I also looked at panelWindow.Caption.ButtonSize and it returns negative values.  For panels, I see a border that is something between 2 - 4 pixels in width.  I know borders can be affected by OS changes (e.g. for purposes of accessibility) which is why I am looking for something to tell me what the borders and caption height are.  Any other ideas?

Nevron Support
Posted 12 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)

Group: Forum Members
Last Active: Last Year
Posts: 3,039, Visits: 3,746
Hello Craig,

Can you post a snapshot image of the floating panel you have? Also, the version of the assemblies you use.
Thanks.

Best Regards,
Nevron Support Team



Craig Swearingen
Posted 12 Years Ago
View Quick Profile
Supreme Being

Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)

Group: Forum Members
Last Active: 7 Years Ago
Posts: 99, Visits: 654
On Win7 I use the 11.12.14.12 build.  I've attached a picture of the floated panel having first removed the client contents.  You'll notice a thin black border all around it as well as a caption bar at the top.  I need the dimensions of all these things and I'm wanting not to hardcode them based on what I see.

Attachments
panelCapture.GIF (228 views, 33.00 KB)
Nevron Support
Posted 12 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)

Group: Forum Members
Last Active: Last Year
Posts: 3,039, Visits: 3,746
Hello Craig,

To get the size of the panel including borders use NDockingPanel.FloatingSize.

To get the client size (without borders with caption) use
NFloatingDockingPanelContainer container = nDockingPanel1.ContainerPanel as NFloatingDockingPanelContainer;
container.DisplayRectangle;

To get the height of the caption without borders use NDockManager.CaptionStyle.Height


Best Regards,
Nevron Support Team



Craig Swearingen
Posted 12 Years Ago
View Quick Profile
Supreme Being

Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)

Group: Forum Members
Last Active: 7 Years Ago
Posts: 99, Visits: 654

Seems you're suggesting I get the size, create the panel, add it to its host, float it, query what the panel dimensions are, set the panel floating size again, and then float the panel again.  That almost worked but I found there still appeared to be a problem with the height and I experimented a bit with that idea but it led to more questions. 

Thanks though.  I think I'm going to give up on this issue.  Perhaps at some point you can add the ability to return the NFrameAppearance for a floated panel in a future release.





Similar Topics


Reading This Topic