Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Creating Toolbars: Create or Add?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Creating Toolbars: Create or Add?

 Post Reply Post Reply
Author
Message
prashant View Drop Down
Senior Member
Senior Member
Avatar

Joined: 19 February 2007
Location: India
Status: Offline
Points: 165
Post Options Post Options   Thanks (0) Thanks(0)   Quote prashant Quote  Post ReplyReply Direct Link To This Post Topic: Creating Toolbars: Create or Add?
    Posted: 20 August 2007 at 3:46am
Hi Oleg,

I am creating four toolbars on my application.Previously we were using CreateEx method for creating those toolbars.

Presently I am using "Add" method for crating those Toolbars on Commandbar, but in one of the codejock examples I came across Create function for creating toolbars.

My question is:-

What is the most significant way for creating multiple toolbars?
Add on command bar or Create? Please justify.


Same question applies for adding controls on Toolbar,
e.g. Adding Combobox on Toolbar.

thanks in advance.
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 20 August 2007 at 6:04am
Hello,
 
Add method is always better. CreateToolbar can be used if you need create single toolbar without CommandBars/Docking/Customization to put it in some custom location.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
prashant View Drop Down
Senior Member
Senior Member
Avatar

Joined: 19 February 2007
Location: India
Status: Offline
Points: 165
Post Options Post Options   Thanks (0) Thanks(0)   Quote prashant Quote  Post ReplyReply Direct Link To This Post Posted: 20 August 2007 at 6:44am
Hi Oleg,

Thanks for your reply. Any other advantages by using "Add" method?
Is same rule applies while creating controls on Toolbars?
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 20 August 2007 at 7:21am
Hello,
If you need CommandBars and CommandBarsOptions, Load/Save, Customization and Docking you use Add, in other case use Create.
 
With Controls you can use any method. they all good. :)
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
prashant View Drop Down
Senior Member
Senior Member
Avatar

Joined: 19 February 2007
Location: India
Status: Offline
Points: 165
Post Options Post Options   Thanks (0) Thanks(0)   Quote prashant Quote  Post ReplyReply Direct Link To This Post Posted: 20 August 2007 at 8:49am
Hi Oleg,

I have created one toolbar on Commandbar using function "Add"

I am adding one EditBox on that Toolbar using following method:

CXTPControlEdit m_EditBox;
EditBox =
(CXTPControlEdit*)this->Add(xtpControlEdit, nID);

But I am getting Non Editable EditBox on the toolbar. Why it's happening so?

Thanks :)
Back to Top
prashant View Drop Down
Senior Member
Senior Member
Avatar

Joined: 19 February 2007
Location: India
Status: Offline
Points: 165
Post Options Post Options   Thanks (0) Thanks(0)   Quote prashant Quote  Post ReplyReply Direct Link To This Post Posted: 20 August 2007 at 9:51am
Hi Oleg,

Solved above mentioned problem using

m_EditBox->SetFlags(xtpFlagManualUpdate);

But how to trap Edit box update and Enter key pressed events? (Command Handlers?)

Previously I am using CEdit control so I could able to trap
::PreTranslateMessage(MSG *pMsg) and
ON_EN_CHANGE(ID_EDITBOX, OnChangeEdit)

What I need to do for trapping above mentioned messages?
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 21 August 2007 at 12:50am
Hello,
 
See Samples\CommandBars\CustomThemes\CustomThemesView.cpp  file.
 
You need ON_XTP_EXECUTE macro.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
prashant View Drop Down
Senior Member
Senior Member
Avatar

Joined: 19 February 2007
Location: India
Status: Offline
Points: 165
Post Options Post Options   Thanks (0) Thanks(0)   Quote prashant Quote  Post ReplyReply Direct Link To This Post Posted: 22 August 2007 at 6:17am
Hi Oleg,
With CXTPEditControl added on Toolbar, I am unable to handle PretranslateMessage. What is the work around for this problem?

Previously I am using create and now I am using Add.

Thanks in advance.
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 22 August 2007 at 8:25am
Hello,
PretranslateMessage of what class ?
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
prashant View Drop Down
Senior Member
Senior Member
Avatar

Joined: 19 February 2007
Location: India
Status: Offline
Points: 165
Post Options Post Options   Thanks (0) Thanks(0)   Quote prashant Quote  Post ReplyReply Direct Link To This Post Posted: 22 August 2007 at 9:24am
Hi Oleg,

I am getting crash  following call:-

>> CToolBarViewName is derived from CXTPToolBar

>> Also I added following lines in .h and .cpp file respectively.

DECLARE_DYNAMIC(CToolBarViewName
IMPLEMENT_DYNAMIC(CToolBarViewName ,CXTPToolBar)

CToolBarViewName *m_wndToolBar;

Following Line of code CRASHING:

m_wndToolBar = (CToolBarViewName*)pCommandBars->Add(_T("View"), xtpBarTop, RUNTIME_CLASS(CToolBarViewName ));

2) I need to handle PreTranslateMessage of my Toolbar class CToolBarViewName.

Thanks in advance.
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 22 August 2007 at 12:40pm
instead DECLARE_DYNAMIC, IMPLEMENT_DYNAMIC use DECLARE_XTP_COMMANDBAR, IMPLEMENT_XTP_COMMANDBAR,
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
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.