Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > General Discussion
  New Posts New Posts RSS Feed - CDialog/Toolbar/Menu Problem
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CDialog/Toolbar/Menu Problem

 Post Reply Post Reply
Author
Message
JamesC View Drop Down
Newbie
Newbie


Joined: 03 December 2003
Status: Offline
Points: 21
Post Options Post Options   Thanks (0) Thanks(0)   Quote JamesC Quote  Post ReplyReply Direct Link To This Post Topic: CDialog/Toolbar/Menu Problem
    Posted: 05 February 2004 at 12:44pm
I have a CDialog and I attached a toolbar and a menu to the Dialog. Both show up and everything looks good but nothing gets highlighted when I mouse over an item. In regards to the menu, when I click the menu, items do pop up and do respond to mouse clicks. In regards to the toolbar, tooltips do work when I mouse over an item and the toolbar does respond when I click on an item BUT the toolbar item remains highlighted from that point forward? I compared my code to that of the DialogSample and I can't see any difference. Any ideas? This is happening on ALL of my dialogs that contain a menu and/or toolbar. Mainframe works fine though. Problem is just on dialogs.
Back to Top
JamesC View Drop Down
Newbie
Newbie


Joined: 03 December 2003
Status: Offline
Points: 21
Post Options Post Options   Thanks (0) Thanks(0)   Quote JamesC Quote  Post ReplyReply Direct Link To This Post Posted: 05 February 2004 at 12:47pm
Also my dialog is resizable and even though both the toolbar and the menu have the flag xtpFlagStretched set they do not draw to the end when I resize the dialog. At first the dialog looks good but if you resize the dialog to anything larger then the created size, you can see the bk color of the dialog.
Back to Top
JamesC View Drop Down
Newbie
Newbie


Joined: 03 December 2003
Status: Offline
Points: 21
Post Options Post Options   Thanks (0) Thanks(0)   Quote JamesC Quote  Post ReplyReply Direct Link To This Post Posted: 05 February 2004 at 1:32pm
Ok. I figured out the OnKickIdle part that I seemed to have forgotten which fixed the highlighting issue on some of the dialogs but on others they are still messed up. The resizing issue is still there.

Edited by JamesC
Back to Top
krulle View Drop Down
Newbie
Newbie


Joined: 05 October 2004
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote krulle Quote  Post ReplyReply Direct Link To This Post Posted: 10 November 2004 at 4:39am

For solving the sizing issue, overload the OnSize event. Something like this should work:

void CMyDlg::OnSize(UINT nType, int cx, int cy)  {

    CDialog::OnSize(nType, cx, cy);

    RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0);

}



Edited by krulle
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.