Print Page | Close Window

CXTPControlComboBox with icons

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=13344
Printed Date: 06 June 2024 at 10:32am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPControlComboBox with icons
Posted By: apple
Subject: CXTPControlComboBox with icons
Date Posted: 05 February 2009 at 8:55pm
hi,
    how can I use SetListIconId() to set per item with icon in CXTPControlComboBox list ?
   Could you give me an example aout SetListconId() , or some code about using SetListconId() ?


 thanks!




Replies:
Posted By: Oleg
Date Posted: 06 February 2009 at 2:47am
Hi,
 
SetListIconId is first icon id of first list item. Second item will have SetListIconId+1 id etc.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: apple
Date Posted: 13 February 2009 at 2:09am
Hi, member_profile.asp?PF=37&FID=117 - oleg :
     I don't understand your meaning about SetListIconId(). how can I relate with AddString() using SetListIconId()? Can you tell me in details.
thanks very much


Posted By: apple
Date Posted: 15 February 2009 at 8:40pm
Who knows how to use the SetListIconId() of CXTPControlComboBox????


Posted By: Oleg
Date Posted: 18 February 2009 at 1:31am
Once again. to set icons for each item you need create array of images like (1000, 1001, 1002, 1003)
Now you call SetListIconId(1000) and first item will use image 1000, second 1001, etc.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: YMHiK
Date Posted: 29 April 2009 at 3:34pm
I'm running into situation when I have dynamic number of items in combo box ranging from 1 to 300 or more. Each item has its own icon so in this case I cannot use array of preset images.

Is there any way to apply icon to each item when populating combo box?


Posted By: fjosesen
Date Posted: 22 June 2009 at 6:54am
Hi Oleg,
 
    I'm running the same situation. I'm feeding a CXTPControlComboBox with a dynamic set of elements. Some of them needs a blank icon and another ones need a shared icon. How can I set different images to them (remember that it is a dynamic set of elements)?
 
    Thanks in advance,
 
Jose


-------------
Products: Suite Pro (ActiveX) v18.0.1
          Toolkit Pro (MFC) v18.0.1
Platform: Windows 10 (64bit)
Language: VC++ 2013 (MFC)


Posted By: fjosesen
Date Posted: 16 July 2009 at 9:26am
    Hi, anyone? Any idea? Will any support member answer this question? Any day? Any time?
 
    Regards,
 
Jose


-------------
Products: Suite Pro (ActiveX) v18.0.1
          Toolkit Pro (MFC) v18.0.1
Platform: Windows 10 (64bit)
Language: VC++ 2013 (MFC)


Posted By: Oleg
Date Posted: 17 July 2009 at 1:21am

Hi,

If you don't like standard SetListIconId method, you can override CXTPControlComboBox::DrawItem and draw item manually. See how original method works.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: fjosesen
Date Posted: 17 July 2009 at 8:45am
Hi Oleg,
 
    That's what I was doing, but it didn't worked. I've realized that the toolbars cache was destructing my control and recreating the original CXTPControlComboBox control. I've deleted the cache file and now it works.
 
    Thank you,
 
Jose


-------------
Products: Suite Pro (ActiveX) v18.0.1
          Toolkit Pro (MFC) v18.0.1
Platform: Windows 10 (64bit)
Language: VC++ 2013 (MFC)


Posted By: SunIron
Date Posted: 17 September 2009 at 6:18am
Hellow apple,

Next example demonstrate how to use SetListIconId().

CXTPToolBar* pToolBarCombo = pCommandBars->Add(_T("Combo"), xtpBarTop);
    pToolBarCombo->SetBarID(IDR_MAINFRAME + 3);
    pToolBarCombo->GetImageManager()->SetImageList(IDR_MAINFRAME, 16);     // set command bar image list
    CXTPControlComboBox* pControlCombo = (CXTPControlComboBox*)pToolBarCombo->GetControls()->Add(xtpControlComboBox, ID_FILE_NEW);
    pControlCombo->SetListIconId(0);     // set icon index for edit
    pControlCombo->SetEditIconId(1);     // set icon index for list box
    pControlCombo->AddString(_T("Combo"));
    DockRightOf(pToolBarCombo, pToolBarPopups);

Result:
   



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net