Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - HOWTO: Emulate CBS_DROPDOWNLIST style
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

HOWTO: Emulate CBS_DROPDOWNLIST style

 Post Reply Post Reply
Author
Message
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Topic: HOWTO: Emulate CBS_DROPDOWNLIST style
    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
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 20 May 2011 at 6:55pm
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
Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Posted: 20 May 2011 at 8:45pm
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
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 21 May 2011 at 3:34am
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
Back to Top
StuartB View Drop Down
Newbie
Newbie


Joined: 18 February 2011
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote StuartB Quote  Post ReplyReply Direct Link To This Post Posted: 08 August 2011 at 11:18am
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" ?
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.156 seconds.