![]() |
Add a seporator |
Post Reply
|
| Author | |
Frme
Newbie
Joined: 19 August 2006 Location: Ukraine Status: Offline Points: 11 |
Post Options
Thanks(0)
Quote Reply
Topic: Add a seporatorPosted: 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.
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 21 December 2006 at 12:48am |
|
pControl->SetBeginGroup(TRUE);
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Frme
Newbie
Joined: 19 August 2006 Location: Ukraine Status: Offline Points: 11 |
Post Options
Thanks(0)
Quote Reply
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?
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
Frme
Newbie
Joined: 19 August 2006 Location: Ukraine Status: Offline Points: 11 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
Frme
Newbie
Joined: 19 August 2006 Location: Ukraine Status: Offline Points: 11 |
Post Options
Thanks(0)
Quote Reply
Posted: 22 December 2006 at 10:38am |
|
Thank You Oleg, that is realy what I need :) Tnanks again!
|
|
![]() |
|
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 |