Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - CXTPControlComboBox with images ?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPControlComboBox with images ?

 Post Reply Post Reply
Author
Message
lion View Drop Down
Groupie
Groupie


Joined: 04 March 2008
Status: Offline
Points: 22
Post Options Post Options   Thanks (0) Thanks(0)   Quote lion Quote  Post ReplyReply Direct Link To This Post Topic: CXTPControlComboBox with images ?
    Posted: 28 October 2008 at 6:06am
Hi
is there a ComboBox that supports icons for every entry ?
cu B
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: 28 October 2008 at 10:59am
Hi,
 
You need SetListIconId method.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
lion View Drop Down
Groupie
Groupie


Joined: 04 March 2008
Status: Offline
Points: 22
Post Options Post Options   Thanks (0) Thanks(0)   Quote lion Quote  Post ReplyReply Direct Link To This Post Posted: 29 October 2008 at 4:25am
Hi,
thanx for your help.
i tried doing that in the ComandBarControls Example in the file MainFrm.cpp but it did not show any effect. I just inserted it after creating a new icon around line number 111:
    CXTPToolBar* pToolBarCombo = pCommandBars->Add(_T("Combo"), xtpBarTop);
    pToolBarCombo->SetBarID(IDR_MAINFRAME + 3);
    pToolBarCombo->GetControls()->Add(xtpControlLabel, 0)->SetCaption(_T("CXTPControlComboBox:"));
    pToolBarCombo->GetControls()->Add(xtpControlComboBox, ID_FILE_NEW);
    CXTPControlComboBox* pControlCombo = (CXTPControlComboBox*)pToolBarCombo->GetControls()->Add(xtpControlComboBox, ID_FILE_NEW);
    pControlCombo->AddString("asdf1");
    pControlCombo->AddString("asdf2");
    pControlCombo->AddString("asdf3");
    pControlCombo->AddString("asdf4");
    pControlCombo->SetDropDownListStyle();
    DockRightOf(pToolBarCombo, pToolBarPopups);

    pControlCombo->SetListIconId(IDI_ICON1);

and pControlCombo->IsImageVisible(); returns false.

the thing I want to achieve is that I have an Icon/Image per Item in the list:


we have several such controls to choose patterns etc.
how do i do this with an CXTPControlComboBox ?

I would appreciate your help very much.
Thanx.

Cheers Björn


Back to Top
lion View Drop Down
Groupie
Groupie


Joined: 04 March 2008
Status: Offline
Points: 22
Post Options Post Options   Thanks (0) Thanks(0)   Quote lion Quote  Post ReplyReply Direct Link To This Post Posted: 01 December 2008 at 3:43am
Hi,
it still did not seem to work. What could be wrong?
Cheers B
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: 23 January 2009 at 9:00am
Hello Björn;

have you ever solved this;
otherwise does anyone know how to solve 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
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: 23 January 2009 at 9:31am
Hi;

I solved it by myself. Using SetListIconId did it, but the order of calling SetListIconId and AddString is important!

BTW: if I set SetDropDownListStyle(FALSE), why is the icon of the selected listbox item not automatically set in the edit control? Should be improved!
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
foxars View Drop Down
Newbie
Newbie


Joined: 27 January 2009
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote foxars Quote  Post ReplyReply Direct Link To This Post Posted: 27 January 2009 at 7:59pm
Hi,

Please tell me how did you do with SetListIconId ??!!

Thanks
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: 11 February 2009 at 3:40pm
Hi;
Try this:
    if (lpCreateControl->nID == ID_RESULTS_TRANSACTIONTYPE)
    {
        lpCreateControl->pControl->SetWidth(250);
        CXTPControlComboBox* pCombo=reinterpret_cast<CXTPControlComboBox*>(lpCreateControl->pControl);
        pCombo->SetListIconId(TransactionUnknown);
        pCombo->SetDropDownListStyle(FALSE);
        pCombo->SetFlags(xtpFlagLeftPopup);
        pCombo->AddString(_T("Alle anzeigen"));
        pCombo->AddString(_T("Produktionssätze"));
        pCombo->AddString(_T("Verbrauchssätze"));
        pCombo->AddString(_T("Stillstandssätze"));
       
        pCombo->SetCurSel(0);

        return;
    }

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
 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.