Print Page | Close Window

Add a seporator

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=5859
Printed Date: 16 July 2025 at 9:06am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Add a seporator
Posted By: Frme
Subject: Add a seporator
Date Posted: 20 December 2006 at 8:01pm
Hi, I need dynamically add a separator in dynamic sub-menu in the main frame. As a basic sample i use the 'CControlFavorites' class from 'dynamicpopups' sample (XTP ver. 10.3.1). As i understand i have to change some preperty of 'CXTPControlButton' object, but i cannot find the way to do it. What is the most preferable way to insert a separator dynamically?
 
Thanks in advance.



Replies:
Posted By: Oleg
Date Posted: 21 December 2006 at 12:48am
pControl->SetBeginGroup(TRUE);

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


Posted By: Frme
Date Posted: 21 December 2006 at 9:26am
Thank You! I do this way:

CXTPControlButton* pControl1 = (CXTPControlButton*)m_pControls->Add(xtpControlButton, 0, NULL, 2);

pControl1->SetBeginGroup(TRUE);
 
but after this code after separator  ihave the blank menu item. after it in turn everything is fine. How to avoid such 'blank' menu item after separator?
 


Posted By: Oleg
Date Posted: 22 December 2006 at 1:09am
no. you don't have add additonal button. call SetBeginGroup for button you already have.

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


Posted By: Frme
Date Posted: 22 December 2006 at 9:30am
Thank You oleg, but I still cannot add a separator :(
Below is the snapshot of my code:
 
CXTPControlButton* pControl = (CXTPControlButton*)m_pControls->Add(xtpControlButton, ID_PLUGINS_RELOADPLUGINS, L"Reload plugins",1);
pControl->SetCaption(L"Reload plugins");
pControl->SetTooltip(L"Click to reload present plugins");
pControl->SetDescription(L"Click to reload present plugins");
pControl->SetFlags(xtpFlagManualUpdate);
pControl->SetStyle(xtpButtonIconAndCaption);

//CXTPControlButton* pControl1 = (CXTPControlButton*)m_pControls->Add(xtpControlButton, 0, NULL, 2);

pControl->SetBeginGroup(TRUE);

int i = 2;

for (folder_entry_vec::iterator iter = m_PlVec.begin(); iter != m_PlVec.end(); iter++ ){
CXTPControlButton* pControl = (CXTPControlButton*)m_pControls->Add(xtpControlButton, ID_PLUGINS_RELOADPLUGINS+i-1, (LPCWSTR)iter->m_PlResName, i, FALSE);
pControl->SetCaption((LPCWSTR)iter->m_PlResName);
pControl->SetTooltip((LPCWSTR)iter->m_PlDescription);
pControl->SetDescription((LPCWSTR)iter->m_PlDescription);
pControl->SetCustomIcon((HICON)iter->m_PlIcon);
pControl->SetFlags(xtpFlagManualUpdate);
pControl->SetStyle(xtpButtonIconAndCaption);
++i;
}
 
Excuse me for my  obtrusiveness, i can release the app even without this separator, but i just want to make this question clear at least for me.
 
Thank You


Posted By: Oleg
Date Posted: 22 December 2006 at 10:04am

Hello,

SetBeginGroup adds separator before control. You added separator before first item so it is not visible.
 
add it in "for loop"
 
pControl->SetBeginGroup(iter == m_PlVec.begin());


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


Posted By: Frme
Date Posted: 22 December 2006 at 10:38am
Thank You Oleg, that is realy what I need :) Tnanks again!



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