Community
Navisworks API
Welcome to Autodesk’s Navisworks API Forums. Share your knowledge, ask questions, and explore popular Navisworks API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

dockpaneplugin: panel truncated if docked when the application starts

9 REPLIES 9
Reply
Message 1 of 10
ngombault
1065 Views, 9 Replies

dockpaneplugin: panel truncated if docked when the application starts

Hi,

 

I wrote a dockpaneplugin and its panel gets truncated if it was docked when navisworks started:

- when I first lauch the command the panel is displayed and everything works fine

- I can dock and undock it with anyother window, it works fine

- if I close the application with the panel docked, and re open Naviswork, then the panel is truncated of a couple centimeters, with no (sufficient) scroll bar to see it completly

 

I set all control on the panel to either dock or anchored to sides, the form is on Autosize, the plugin attributes are as follow:

 

<DockPanePlugin(310, 225, FixedSize:=False, AutoScroll:=True, MinimumWidth:=310, MinimumHeight:=225)>

 

What am I missing?

 

thanks

Nic

9 REPLIES 9
Message 2 of 10
xiaodong_liang
in reply to: ngombault

Hi,

 

I used this line with the demo of my dock pane plugin, opened Navisworks and docked the window. And I closed Navisworks , reopened it. The dock pane window is same. not truncated.  

 

I also changed the size of the dock pane windows (assume the controls are anchored) intentionally, closed Navisworks and opened it. All works well.

 

Could you share a small demo project to show the problem?

 

In addition, I am testing with 2013. 

Message 3 of 10
ngombault
in reply to: xiaodong_liang

Here you go;

 

I am running Navis manage 2013 too.

 

I isolated only the piece of code you need to reproduce the issue; the panel gets truncated a bit less than the other one I have but still loses some space on the right.

 

so to reproduce:

- unzip docktest_dllfornavis and put it in Navis plugin folder

- start Navis, goto Addin, start "Display Name"

- see how the space between the comboboxes and the form borders is equal on both sides

- dock it, restart navis

-> the panel shold be truncated to the right

 

PS: I change the extension of the file from .rar to .bmp otherwise the forum wouldn't let me upload it; you need to change it back. Let me know if you'd rather have me paste the code in the text window (kind of anoying with dockpane plugin as it requires 3 classes)

 

Thanks,

-Nic

 

Message 4 of 10
xiaodong_liang
in reply to: ngombault

Hi,

 

I setup an enviorment with VS2012 and Nw 2013. I built your plugin and it worked well. Could you check my test video?

http://sdrv.ms/13utRCp

Message 5 of 10
ngombault
in reply to: xiaodong_liang

Hi,

 

I think the panel is already truncated the first time you load Navis. Maybe you closed Navis with the panel docked already before you built your solution (started your video).

 

Try to:

1. Undock it > close it > then close Navis.

2. Rebuild the plugin > copy the dll like you did > Open Navis

You should have the exact same space between the combobox and the form borders on both side (your video shows the right border is touching the combobox)

 

3. Now dock the panel > close Navis

4. Reopen Navis

The panel is truncated on the right side (with this example, of only a few pixels, but I have another sample where I loose something like 15 to 25 pts on the right)

Message 6 of 10
xiaodong_liang
in reply to: ngombault

Hi,

 

yes,  the first time I saw your dockpane window is  the right border is touching the combobox, but not truncted. And in the first time, it is NOT docked. So I just docked it and restart Navisworks to see if there is any difference. 

 

I do not remember clearly how it looks in the designer of VS. I will take a look at it soon.

Message 7 of 10
ngombault
in reply to: xiaodong_liang

Hi,

 

I investigated further, and the issue is linked to having control on the form that are anchored both sides; dock (fill, top, bottom...) works fine but anchor produce these truncated results.

 

So far I have on way around, it is to first put a docked split container with panel2.collapsed set to true, and put all my controls in panel1. I tried with a simple panel but it wasn't fixing the issue, the split container does the job.

 

Let me know if you find anything else.

 

-Nic

Message 8 of 10
xiaodong_liang
in reply to: ngombault

Hi,

 

I spent some time to test.

 

Firstly, to clarify: using your plugin, in VS designer of the user control, the right border is not touching the ComboBox. When I tested last time, in the first launching, the right border has started to touch the ComboBox, i.e. the distance between the border and ComboBox became much smaller than designer,  but still not truncated (that was why I have a memory the border is touching the BomboBox). While in the second time, it the status is same. So I thought no change.

 

After I removed plugin, rebuilt and re-deployed, I can obviously see the problem you saw. I cannot see what I tested last time any more 😞 I also found:  without Anchoring to right, the issue does not occur. However this means the ComboBox will not resize when window changing size. This is not what you expected.

 

Since in the first message I cannot reproduce with SDK sample, I turned to dig into it. It is written in C#. I tried to add Anchoring like you code. I also tried to create a VB.NET project with your codes. The result is same: the ComboBox does not resize when window changing size.  As the two are built in VS2010 (.NET framework 4.0), I started to suspect the framework. So I switched your VS2012 project from 4.5 to 4.0. The result is same to VS2010, i.e. the ComboBox does not resize when window changing size anymore.

 

Sorry I did not find a solution so far. It is time to report these behaviors with our engineer team.

 

Message 9 of 10
ali.talebi
in reply to: ngombault

I just wanted to add if you've tried adding all the form contents to a table layout panel? I usually add a tabled layout panel which is docked to the usercontrol and never had any issues with resizing whether docked or not

Message 10 of 10
ngombault
in reply to: ali.talebi

Thanks for the reply.

 

I didn't know about the TableLayoutPanel, I gave it a short try, but I find the layout functionality too restrictive compare to simple Panels.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


 

Autodesk Design & Make Report