Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - How to manage spacing between controls in a group?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to manage spacing between controls in a group?

 Post Reply Post Reply
Author
Message
Satyen View Drop Down
Groupie
Groupie
Avatar

Joined: 22 December 2008
Location: India
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote Satyen Quote  Post ReplyReply Direct Link To This Post Topic: How to manage spacing between controls in a group?
    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.
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Satyen View Drop Down
Groupie
Groupie
Avatar

Joined: 22 December 2008
Location: India
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote Satyen Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.031 seconds.