Creating Toolbars: Create or Add? |
Post Reply |
Author | |
prashant
Senior Member Joined: 19 February 2007 Location: India Status: Offline Points: 165 |
Post Options
Thanks(0)
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. |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
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 |
|
prashant
Senior Member Joined: 19 February 2007 Location: India Status: Offline Points: 165 |
Post Options
Thanks(0)
|
Hi Oleg,
Thanks for your reply. Any other advantages by using "Add" method? Is same rule applies while creating controls on Toolbars? |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
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 |
|
prashant
Senior Member Joined: 19 February 2007 Location: India Status: Offline Points: 165 |
Post Options
Thanks(0)
|
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 :) |
|
prashant
Senior Member Joined: 19 February 2007 Location: India Status: Offline Points: 165 |
Post Options
Thanks(0)
|
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? |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hello,
See Samples\CommandBars\CustomThemes\CustomThemesView.cpp file.
You need ON_XTP_EXECUTE macro.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
prashant
Senior Member Joined: 19 February 2007 Location: India Status: Offline Points: 165 |
Post Options
Thanks(0)
|
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. |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hello,
PretranslateMessage of what class ?
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
prashant
Senior Member Joined: 19 February 2007 Location: India Status: Offline Points: 165 |
Post Options
Thanks(0)
|
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. |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
instead DECLARE_DYNAMIC, IMPLEMENT_DYNAMIC use DECLARE_XTP_COMMANDBAR, IMPLEMENT_XTP_COMMANDBAR,
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |