Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Accelerators within a dialog
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Accelerators within a dialog

 Post Reply Post Reply
Author
Message
Uwe Keim View Drop Down
Newbie
Newbie


Joined: 01 November 2004
Location: Germany
Status: Offline
Points: 29
Post Options Post Options   Thanks (0) Thanks(0)   Quote Uwe Keim Quote  Post ReplyReply Direct Link To This Post Topic: Accelerators within a dialog
    Posted: 29 June 2005 at 4:33am

Scenario: A SDI application, having several modal dialog boxes with local CodeJock menubars, toolbars, statusbars.

No I want to add accelerators to the menu items in the dialog.

I managed to do it the way I found it in the "DialogSample" in the "%PROGRAM_FILES\Codejock Software\MFC\Xtreme Toolkit Pro v9.60\Samples\CommandBars\DialogSample" folder.

What I am missing: In the main window of my SDI application, the CodeJock library automatically writes the actual shortcuts beside the menu items. Whereas in the "DialogSample" application they are hardcoded in the IDR_MAINFRAME resource.

Question: Is it possible to "tell" a menubar which accelerator-resource to use and let the menubar do all the accelerator-handling (include writing to the menu items and command routing) from within a child dialog box?

Thanks
Uwe

Back to Top
bevpet View Drop Down
Newbie
Newbie
Avatar

Joined: 01 April 2005
Location: Canada
Status: Offline
Points: 39
Post Options Post Options   Thanks (0) Thanks(0)   Quote bevpet Quote  Post ReplyReply Direct Link To This Post Posted: 29 June 2005 at 2:56pm

try this

declare oin .h

HACCEL m_hAccel;

add your your dlg.cpp:

CMyDlg::CMyDlg()

: CDialog(CMyDlg::IDD, 0)

{

//{{AFX_DATA_INIT(CMyDlg)

...

...

m_hAccel = ::LoadAccelerators(AfxGetInstanceHandle(),

MAKEINTRESOURCE(IDR_MY_DLG_ACCELERATORS));

...

}

where:

IDR_MY_DLG_ACCELERATORS = your accelerator table you wish to associate with the dlg.

HTH

 

Back to Top
Uwe Keim View Drop Down
Newbie
Newbie


Joined: 01 November 2004
Location: Germany
Status: Offline
Points: 29
Post Options Post Options   Thanks (0) Thanks(0)   Quote Uwe Keim Quote  Post ReplyReply Direct Link To This Post Posted: 29 June 2005 at 11:46pm

bevpet, thank you, but this is from the example as I'm already doing.

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.059 seconds.