double click on toolbar of CDialog 
Author Message
 double click on toolbar of CDialog
Dear all,

I am working on an MDI application. There are different dialog boxes
(CDialog) in my Application. Most of them contains a Toolbar attached
with them on the top. Everything present on the Dialog box is working
fine except one thing. If I double click on the dialog's toolbar then
it shows another dialog box, similar to customize dialog of Internet
Explorer and hide instantly. The time of the display and hide of other
dialog is less than 1/100 of a second. I have tested this behavior
with all dialog boxes, with Toolbar, in my application and all of them
are behaving the same way. On the other hand, if I double click on any
part of CDialog box then nothing happen. It only behave wrongly, if I
double click on the Toolbar. I am attaching the source code for adding
the toolbar to dialog box.

-------------------------------------------
BOOL CMyDlg::InitDialog()
{
m_applyBtn.ModifyStyle(BS_DEFPUSHBUTTON,0);
EnableToolTips(TRUE);
DWORD dwToolBarStyle = TBSTYLE_FLAT | WS_CHILD |
WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS |
CBRS_FLYBY | CBRS_SIZE_DYNAMIC;

if (m_CSToolBar.CreateEx(this, dwToolBarStyle)) {
m_CSToolBar.LoadToolBar(IDR_BMK_TREE_TB);
m_CSToolBar.EnableToolTips();

Quote:
} else {

TRACE(_T("Failed to create toolbar bar\n"));
return FALSE;

Quote:
}

//reset control bars
CRect rcClientStart;
CRect rcClientNow;
GetClientRect(rcClientStart);
RepositionBars(AFX_IDW_CONTROLBAR_FIRST,
AFX_IDW_CONTROLBAR_LAST, 0, reposQuery, rcClientNow);

CPoint ptOffset(rcClientNow.left -
rcClientStart.left,rcClientNow.top - rcClientStart.top);

CRect rcChild;
CWnd* pwndChild = GetWindow(GW_CHILD);
while (pwndChild) {
pwndChild->GetWindowRect(rcChild);
ScreenToClient(rcChild);
rcChild.OffsetRect(ptOffset);
pwndChild->MoveWindow(rcChild, FALSE);
pwndChild = pwndChild->GetNextWindow();

Quote:
}

CRect rcWindow;
GetWindowRect(rcWindow);
rcWindow.right += rcClientStart.Width() - rcClientNow.Width();
rcWindow.bottom += rcClientStart.Height() - rcClientNow.Height();
MoveWindow(rcWindow, FALSE);

RepositionBars(AFX_IDW_CONTROLBAR_FIRST,
AFX_IDW_CONTROLBAR_LAST, 0);

SetWindowPos(this->GetParent(), 0, 0, 325, 430, SWP_NOMOVE
| SWP_NOZORDER);// | SWP_SHOWWINDOW );
m_applyBtn.ModifyStyle(BS_DEFPUSHBUTTON,0);

return TRUE;

Quote:
}

-------------------------------------------

Am I missing something,

Best Regards,

Shozi



Sun, 11 Sep 2005 16:03:55 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. CButton double click in CDialog

2. mouse up/down vs click/double click delegates

3. Capture click/double-click events from datatable

4. Single click & double click the same button

5. Change the single click to double click?

6. problem Handling Click and double click messages in CListView

7. Single-click and double-click handlers

8. double click / single click

9. problem Handling Click and double click messages in CListView

10. ListView: Single Click and Double Click

11. Double Click fires two single click events??

12. Getting the Button Clicked Event from Derived CDialog

 

 
Powered by phpBB® Forum Software