Should my CAdUiPaletteSets auto-close?

Should my CAdUiPaletteSets auto-close?

Kyudos
Advisor Advisor
759 Views
3 Replies
Message 1 of 4

Should my CAdUiPaletteSets auto-close?

Kyudos
Advisor
Advisor

I have developed some info panels derived from CAdUiPaletteSet. I've called AdUiRegisterTool so that my panels remember their open state in the workspace. I've also added my GUIDs to: 

HKEY_LOCAL_MACHINE\SOFTWARE\Autodesk\AutoCAD\R23.0\ACAD-2001:409\DockingTools\<classId>

 so that my panels also show up in CUI.

 

When I close the last document, the standard palettes are all hidden, but mine remain visible. Should they be hidden automatically by AutoCAD or is it something I need to do manually? If it is meant to be automatic, what have I neglected to do to make it so?

 

Cheers.

0 Likes
Accepted solutions (1)
760 Views
3 Replies
Replies (3)
Message 2 of 4

moogalm
Autodesk Support
Autodesk Support

 

Do you have CommandClose key in your registry entry under DockingTools, CLSID.

CommandClose 
REG_SZ 
Command to close the window 


Though this is not mandatory, if not presented, AutoCAD will enforce by pumping a windows message to close.

Can you try, creating an associated CommandClose too.

In the CommandClose function, you should able to close with MFC  API CMDIFrameWnd::ShowControlBar

 

 

    //If docking Palette is displayed, hide it.
   CMDIFrameWnd* pAcadFrame = acedGetAcadFrame();
   if (NULL != pAcadFrame)
   {
       pAcadFrame->ShowControlBar(pointerToYourPaletteSet, FALSE, FALSE);
   }

 

 

 

 

DockingTools_Close.JPG

0 Likes
Message 3 of 4

Kyudos
Advisor
Advisor

I did add the CommandClose registry entry, but (when) is that used?

You appear to be saying I still need to "manually" close my palette sets? (i.e., close them in my code, AutoCAD won't close them for me?) It's fine if I do have to, just want to understand I'm doing things, correctly.

0 Likes
Message 4 of 4

moogalm
Autodesk Support
Autodesk Support
Accepted solution

Correct.

You need to manage hide and show of your PaletteSet, watch for DocumentToBeDestroyed and DocumentActivated event respectively.
Make sure that you hide Paletteset when you enter in zero-doc state i.e non-dwg window.

0 Likes