Print Page | Close Window

How to manage spacing between controls in a group?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=12997
Printed Date: 20 July 2025 at 7:18am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to manage spacing between controls in a group?
Posted By: Satyen
Subject: How to manage spacing between controls in a group?
Date Posted: 22 December 2008 at 1:30am
Hi,
 
I have added a group on my application's  ribbon bar. The actual requirement is, the controls should be evenly spaced as shown below.
 
 
However when I added controls, they appear quite unevenly spaced, as below. Please let me know, how to achieve even spacing.ASAP).
 
 
 
The code for this is a below.
 

pUndeformedDispGroup->SetControlsCentering();

pUndeformedDispGroup->Add(xtpControlLabel, IDS_ANALRES_TRANSLUCENCY_LABEL);

pUndeformedDispGroup->Add(xtpControlLabel, IDS_ANALRES_EDGES_LABEL);

pUndeformedDispGroup->Add(xtpControlLabel, IDS_BLANK_LABEL);

if(CXTPControlEdit* pUndefTransSpinCtrl = (CXTPControlEdit*)pUndeformedDispGroup->Add(xtpControlEdit, ID_ANALRES_UNDEFDISP_TRANSLUCENCY))

{

pUndefTransSpinCtrl->SetWidth(50 * g_nHiResFactor);

SESetStyle(pUndefTransSpinCtrl, xtpButtonIcon);

pUndefTransSpinCtrl->ShowSpinButtons();

}

if( CXTPControlComboBox* pEdgesCtrl = new CXTPControlComboBox())

{

pEdgesCtrl->SetWidth(100 * g_nHiResFactor);

SESetStyle(pEdgesCtrl, xtpButtonCaptionAndDescription);

pUndeformedDispGroup->Add(pEdgesCtrl, ID_ANALRES_UNDEFDISP_EDGES);

}

pUndeformedDispGroup->Add(xtpControlLabel, IDS_BLANK_LABEL);

if( CXTPControlComboBox* pFaceColCtrl = new CXTPControlComboBox())

{

pFaceColCtrl->SetWidth(100 * g_nHiResFactor);

SESetStyle(pFaceColCtrl, xtpButtonCaptionAndDescription);

pUndeformedDispGroup->Add(pFaceColCtrl, ID_ANALRES_UNDEFDISP_FACECOLOR);

}

if( CXTPControlComboBox* pEdgeColCtrl = new CXTPControlComboBox())

{

pEdgeColCtrl->SetWidth(100 * g_nHiResFactor);

SESetStyle(pEdgeColCtrl, xtpButtonCaptionAndDescription);

pUndeformedDispGroup->Add(pEdgeColCtrl, ID_ANALRES_UNDEFDISP_EDGECOLOR);

}

pUndeformedDispGroup->Add(xtpControlLabel, IDS_BLANK_LABEL);

if (CXTPControl* pControl = pUndeformedDispGroup->Add(xtpControlLabel, ID_ANALRES_UNDEFDISP_SELECT_FC))

{

SESetStyle(pControl, xtpButtonIcon);

}

if (CXTPControl* pControl = pUndeformedDispGroup->Add(xtpControlLabel, ID_ANALRES_UNDEFDISP_SELECT_EC))

{

SESetStyle(pControl, xtpButtonIcon);

}

Note : I tried using 'SetControlGrouping' but that makes my display worst.


-------------
Thanks & Regards,
Satyenjit Bagal.
Software Development Engineer.
SIEMENS Automation and Drives.



Replies:
Posted By: Oleg
Date Posted: 22 December 2008 at 1:48am
Hi,
Don't add additional xtpControlLabel. Show Caption of Edit control instead.


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


Posted By: Satyen
Date Posted: 22 December 2008 at 4:41am
Thanks. The solution worked partially.
 
Now I have following display-
 
 
I want to display caption as well as tooltip for all controls. Also I want to keep them a bit apart horizontally and vertically. For horizontal distance I removed earlier caption and added blank space (3 tabs) at its place.
 
I tried to add caption and tooltip using 'SetCaption' and  'SetToolTip' functions, but it distorted the display as below.
 
 
Is there any way to 'show caption and tooltip. as well as keep controls apart'.
 


-------------
Thanks & Regards,
Satyenjit Bagal.
Software Development Engineer.
SIEMENS Automation and Drives.



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