HOWTO: Emulate CBS_DROPDOWNLIST style |
Post Reply |
Author | |
mgampi
Senior Member Joined: 14 July 2003 Status: Offline Points: 1198 |
Post Options
Thanks(0)
Posted: 16 May 2011 at 8:41am |
Hi;
I'm trying to create a report item with constraint edit that behaves like standard combobox dropdownlist controls. So I want the item to open the dropdown list as soon as the user clicks into the item rectangle. Setting EditOnClick(TRUE) shows the edit control with dropdown button but the list is not open. I tried several setting but without success. |
|
Martin
Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0 Platform: Windows 10 v 1909 (64bit) Language: VC++ 2017 |
|
mgampi
Senior Member Joined: 14 July 2003 Status: Offline Points: 1198 |
Post Options
Thanks(0)
|
Isn't this possible?
Can't believe it! |
|
Martin
Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0 Platform: Windows 10 v 1909 (64bit) Language: VC++ 2017 |
|
ABuenger
Newbie Joined: 02 February 2006 Status: Offline Points: 1075 |
Post Options
Thanks(0)
|
Hi,
please set CXTPReportPaintManager::m_bShowNonActiveInPlaceButton to TRUE and call AddComboButton(TRUE) to have the combo box inside the cell. You also need to derive your own class from CXTPReportRecordItem. void CMyReportRecordItem::OnBeginEdit(XTP_REPORTRECORDITEM_ARGS *pItemArgs) { CXTPReportRecordItem::OnBeginEdit(pItemArgs); CXTPReportRecordItemEditOptions *pEditOptions = GetEditOptions(pItemArgs->pColumn); pEditOptions->arrInplaceButtons.GetAt(0)->Activate(); } You could also call CXTPReportInplaceButton::Activate() at an other event handler instead of deriving your own item class. I'll add a dropdown style to the toolkit. Andre |
|
Codejock support
|
|
mgampi
Senior Member Joined: 14 July 2003 Status: Offline Points: 1198 |
Post Options
Thanks(0)
|
Thanks Andre;
I'll try it... |
|
Martin
Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0 Platform: Windows 10 v 1909 (64bit) Language: VC++ 2017 |
|
StuartB
Newbie Joined: 18 February 2011 Status: Offline Points: 2 |
Post Options
Thanks(0)
|
I achieved this thusly, inheriting from CXTPReportRecordItemText:
void CMyReportRecordItem::OnBeginEdit (XTP_REPORTRECORDITEM_ARGS *pItemArgs) { CXTPReportRecordItemText::OnBeginEdit(pItemArgs); CXTPReportControl *pControl = pItemArgs->pControl; CXTPReportRecordItemEditOptions *pEditOptions = GetEditOptions(pItemArgs->pColumn); CXTPReportInplaceButtons *pInpaceButtons = &pEditOptions->arrInplaceButtons; if (!pEditOptions->m_bAllowEdit && pInpaceButtons->GetSize() > 0) { CXTPReportInplaceButton *pBtn = pInpaceButtons->GetAt(0); OnInplaceButtonDown(pBtn); if (!pControl->IsEditOnClick()) pBtn->Activate(); } } I took the bulk of the code from ToolkitPro v15.0.02. I'm using v15.1.1 at the moment. Did you, "add a dropdown style to the toolkit" ? |
|
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 |