Print Page | Close Window

Creating Toolbars: Create or Add?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=7838
Printed Date: 18 June 2025 at 4:05am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Creating Toolbars: Create or Add?
Posted By: prashant
Subject: Creating Toolbars: Create or Add?
Date 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.



Replies:
Posted By: Oleg
Date 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


Posted By: prashant
Date 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?


Posted By: Oleg
Date 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


Posted By: prashant
Date 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 :)


Posted By: prashant
Date 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?


Posted By: Oleg
Date 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


Posted By: prashant
Date 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.


Posted By: Oleg
Date Posted: 22 August 2007 at 8:25am
Hello,
PretranslateMessage of what class ?


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: prashant
Date 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.


Posted By: Oleg
Date 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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net