![]() |
SetDropDownWidth with combo label |
Post Reply
|
| Author | |
Louis
Newbie
Joined: 17 August 2005 Status: Offline Points: 19 |
Post Options
Thanks(0)
Quote Reply
Topic: SetDropDownWidth with combo labelPosted: 22 August 2005 at 8:28pm |
|
Created a combo box with xtpComboLabel style. By default, the drop down width of combo is the width of combo + width of label which makes drop down appear below label. I htink it should be width of combo only, makes visual funny. Also, if I adjust the width of drop down to be smaller to be same as combo, the left edge of drop down is always at left which makes it not align with combo. I think default behaviour should be drop down width is equal to width of combo only, and drop down left edge should always be align with left edge of combo. Or is there a way to adjust this already ? |
|
![]() |
|
Louis
Newbie
Joined: 17 August 2005 Status: Offline Points: 19 |
Post Options
Thanks(0)
Quote Reply
Posted: 22 August 2005 at 8:33pm |
|
For an example of what it looks like look at sample CustomThemes. Open Find combo at bottom.
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 22 August 2005 at 11:55pm |
|
It is designed behaviour and works like in Office products. For 9.80 we will add xtpFlagLeftPopup flag support for CXTPControlComboBox.
you can patch your sources now to allow it: in void CXTPPopupBar::UpdateFlags() replace m_popupFlags = xtpPopupDown; to m_popupFlags |= xtpPopupDown;
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Louis
Newbie
Joined: 17 August 2005 Status: Offline Points: 19 |
Post Options
Thanks(0)
Quote Reply
Posted: 23 August 2005 at 10:59am |
|
thanks Oleg. I tried the patch but it does not seem to work. To be sure here is what I did: In XTPPopupBar.cpp, in function UpdateFlags() if (m_pControlPopup->GetType() == xtpControlComboBox && pParent->GetType() != xtpBarTypePopup){ //m_popupFlags = xtpPopupDown; //LDaoust: 2005-08-23 m_popupFlags |= xtpPopupDown; } I recompiled, put a breakpoint, breakpoint was hit, so code is executed, but I dont see any change. Drop down is still left align with label.
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 23 August 2005 at 11:21am |
|
because you must add xtpFlagLeftPopup flag.
in OnCreateControl function also add pControlCombo->SetFlags(xtpFlagLeftPopup); |
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 23 August 2005 at 11:23am |
|
and change width pCombo->SetDropDownWidth(100); |
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Louis
Newbie
Joined: 17 August 2005 Status: Offline Points: 19 |
Post Options
Thanks(0)
Quote Reply
Posted: 23 August 2005 at 11:43am |
|
Ok, now it is working. I noticed there is a function: CXTPControlComboBox::GetLabelWidth() Is there a way I could use this function to find the proper width of drop down to use ? I tried using it in OnCreateControl but the label width is 0 at that time. I tried this: case ID_COMBO_DAYS:{ m_pComboDays = new CXTPControlComboBox(); if( m_pComboDays ) { m_pComboDays->SetFlags(xtpFlagLeftPopup); lpCreateControl->pControl = m_pComboDays; m_pComboDays->SetStyle(xtpComboLabel); int nMyWidth = 70; |
|
![]() |
|
Louis
Newbie
Joined: 17 August 2005 Status: Offline Points: 19 |
Post Options
Thanks(0)
Quote Reply
Posted: 24 August 2005 at 8:30am |
|
ok, if it helps any other, I set the proper width in OnInitCommandsPopup which is triggered by the ON_XTP_INITCOMMANDSPOPUP() message map macro. Can't wait for 9.8 to get this support and other goodies thanks Oleg for all your help, you are the master. Louis. |
|
![]() |
|
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 |