Closing a CAcUiDockControlBar

Closing a CAcUiDockControlBar

Anonymous
Not applicable
249 Views
2 Replies
Message 1 of 3

Closing a CAcUiDockControlBar

Anonymous
Not applicable
Hello!

I have a CAcUiDockControlBar which I have a CTreeCtrl and a CListCtrl
in. I use Create() to create the controlbar.

I'm using this to start/create it

extern CODEdit *gpDocBar;
CMDIFrameWnd *pAcadFrame = acedGetAcadFrame();
if (!gpDocBar)
{
gpDocBar = new CODEdit;
CAcModuleResourceOverride resOverride;
const char dlgName[] = "Editering av Objektdata";
gpDocBar->Create(pAcadFrame, dlgName);
gpDocBar->EnableDocking(CBRS_ALIGN_ANY);
gpDocBar->RestoreControlBar();
}
else
pAcadFrame->ShowControlBar(gpDocBar, TRUE, FALSE);

CODEdit is the CAcUiDocControlBar, and is declared global (.at the
moment anyway.)

with this code the TreeCtrl and the ListCtrl will contain the same
values as when I used the gpDocBar last. I don't want this! I want to
start with an empty TreeCtrl and an empty ListCtrl everytime I start
the controlbar.

So I added the OnClosing() method and did a DeleteAllItems() for both
the TreeCtrl and the ListCtrl. and then called
CAdUiDockControlBar::OnClosing(); like the manual says.

PROBLEM: The ControlBar will not close!

The OnClosing() will perform but the ControlBar is still open.

Anyone! What am I doing wrong??

// Anders
--
bool CODEdit::OnClosing()
{
m_wndTree.DeleteAllItems();
m_wndList->DeleteAllItems();

CAdUiDockControlBar::OnClosing();

return true;
}
0 Likes
250 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
On Wed, 11 Sep 2002 03:00:38 -0700, Anders M Eriksson
wrote:

>PROBLEM: The ControlBar will not close!
>The OnClosing() will perform but the ControlBar is still open.
>Anyone! What am I doing wrong??
>

I did solve it! It seems like the OnClosing() must return FALSE to
close the window!

return CAdUiDockControlBar::OnClosing();
solved the problem

// Anders
0 Likes
Message 3 of 3

Anonymous
Not applicable
hello!

i was wondering how i can have a CTreeCtrl inside a CAcUiDockControlBar. I already have a dockable window...but I need it to contain a Tree Control.
0 Likes