![]()  | 
 
controlcombobox | 
 
    Post Reply  
   | 
  
| Author | |
   
   feffe  
   
   Groupie  
   Joined: 04 September 2009 Status: Offline Points: 56  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Topic: controlcomboboxPosted: 14 December 2009 at 5:18am  | 
 
| 
   
    
   Hi,
 
   
  I have a combo shown in a ribbon group. 
I'd like the combo to be below icon and caption, not on the right of as you can see here. 
![]() Any suggestion? 
Thank you very much  
    | 
 |
![]()  | 
 |
   
   Oleg  
   
   Senior Member  
   Joined: 21 May 2003 Location: United States Status: Offline Points: 11234  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 14 December 2009 at 6:22am | 
 
| 
   
    
   Hi,
 
   
  You can make 2 separate controls - xtpControlLabel with icon and caption + Combo without Icon and caption. 
    | 
 |
| 
   
     
     Oleg, Support Team 
   
  CODEJOCK SOFTWARE SOLUTIONS  | 
 |
![]()  | 
 |
   
   feffe  
   
   Groupie  
   Joined: 04 September 2009 Status: Offline Points: 56  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 14 December 2009 at 8:02am | 
 
| 
   
    
   ... You're right!
 
   
  And... for setting a control position inside a group? 
E.g., bottom/right 
    | 
 |
![]()  | 
 |
   
   Oleg  
   
   Senior Member  
   Joined: 21 May 2003 Location: United States Status: Offline Points: 11234  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 15 December 2009 at 4:52am | 
 
| 
   
    
   Hi,
 
   
  There is no such method :( If you don't like how Group position it with//without SetControlsCentering option you can override CXTPRibbonGroup::OnCalcDynamicSize and manually position them. 
    | 
 |
| 
   
     
     Oleg, Support Team 
   
  CODEJOCK SOFTWARE SOLUTIONS  | 
 |
![]()  | 
 |
   
   feffe  
   
   Groupie  
   Joined: 04 September 2009 Status: Offline Points: 56  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 16 December 2009 at 12:20pm | 
 
| 
   
    Hi, I've tried to override the method you've suggest. For fastly seeing the result, I've tried to do this: 
 I can't see anything in my group. 
Is it correct to call CXTPControl::SetRect? 
EDIT: The first time the group is shown I can't see anything... 
If I minimize and then maximize the ribbon, I can see them... 
And then if I switch tabs, they "go down" until they are not visible yet. 
Why? 
 | 
 |
![]()  | 
 |
   
   Oleg  
   
   Senior Member  
   Joined: 21 May 2003 Location: United States Status: Offline Points: 11234  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 17 December 2009 at 7:34am | 
 
| 
   
    
   Hi,
 
   
  Sorry, CONTROLINFO is declared as private type of CXTPRibbnoGroup and seems you can't access it to position controls. Sorry our bad - we will move it to protected section (please also patch your sources) - you will be able to change m_pLayoutInfo array. See how original method works: 
int nDataCount = m_pLayoutInfo->nControlCount; 
CONTROLINFO* pData = m_pLayoutInfo->pControls;  for (int i = 0; i < nDataCount; i++) 
{ CONTROLINFO* pControl = &pData;   BOOL bFullRow = pControl->pControl->GetStyle() == xtpButtonIconAndCaptionBelow; 
pControl->EnsureButtonSize(pDC); CSize szControl = pControl->szControl;   int dx = szControl.cx; 
int dy = szControl.cy;   BOOL bBeginGroup = pControl->bBeginGroup && i > 0; 
BOOL bWrapGroup = pControl->bWrapGroup && i > 0;   if (bBeginGroup) 
x += 6;   if (i > 0 && !bWrapGroup && !bFullRow && dyPrev + dy <= nResultHeight) 
{ pControl->rcControl.SetRect(x, dyPrev, x + dx, dyPrev + dy);    dxPrev = max(dxPrev, dx); 
} else { x += dxPrev; pControl->rcControl.SetRect(x, 0, x + dx, dy); dxPrev = dx; } sizeResult.cx = max(x + dx, sizeResult.cx);   dyPrev = pControl->rcControl.bottom; 
   }  | 
 |
| 
   
     
     Oleg, Support Team 
   
  CODEJOCK SOFTWARE SOLUTIONS  | 
 |
![]()  | 
 |
   
   feffe  
   
   Groupie  
   Joined: 04 September 2009 Status: Offline Points: 56  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 17 December 2009 at 8:49am | 
 
| 
   
    It works now. Thank you! 
Is there also a method for setting the position of icon and caption, when the style is 
"icon and caption below"? 
    | 
 |
![]()  | 
 |
    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  |