![]() |
CXTPControlComboBox with icons |
Post Reply
|
| Author | |
apple
Newbie
Joined: 28 April 2008 Status: Offline Points: 6 |
Post Options
Thanks(0)
Quote Reply
Topic: CXTPControlComboBox with iconsPosted: 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! |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
apple
Newbie
Joined: 28 April 2008 Status: Offline Points: 6 |
Post Options
Thanks(0)
Quote Reply
Posted: 13 February 2009 at 2:09am |
|
Hi,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 |
|
![]() |
|
apple
Newbie
Joined: 28 April 2008 Status: Offline Points: 6 |
Post Options
Thanks(0)
Quote Reply
Posted: 15 February 2009 at 8:40pm |
|
Who knows how to use the SetListIconId() of CXTPControlComboBox????
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
YMHiK
Groupie
Joined: 21 January 2009 Location: United States Status: Offline Points: 14 |
Post Options
Thanks(0)
Quote Reply
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? |
|
![]() |
|
fjosesen
Groupie
Joined: 30 June 2008 Status: Offline Points: 49 |
Post Options
Thanks(0)
Quote Reply
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) |
|
![]() |
|
fjosesen
Groupie
Joined: 30 June 2008 Status: Offline Points: 49 |
Post Options
Thanks(0)
Quote Reply
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) |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
fjosesen
Groupie
Joined: 30 June 2008 Status: Offline Points: 49 |
Post Options
Thanks(0)
Quote Reply
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) |
|
![]() |
|
SunIron
Newbie
Joined: 18 March 2008 Status: Offline Points: 4 |
Post Options
Thanks(0)
Quote Reply
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:
|
|
![]() |
|
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 |