Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - CXTPControlComboBox with icons
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPControlComboBox with icons

 Post Reply Post Reply
Author
Message
apple View Drop Down
Newbie
Newbie


Joined: 28 April 2008
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote apple Quote  Post ReplyReply Direct Link To This Post Topic: CXTPControlComboBox with icons
    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!

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: 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
Back to Top
apple View Drop Down
Newbie
Newbie


Joined: 28 April 2008
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote apple Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
apple View Drop Down
Newbie
Newbie


Joined: 28 April 2008
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote apple Quote  Post ReplyReply Direct Link To This Post Posted: 15 February 2009 at 8:40pm
Who knows how to use the SetListIconId() of CXTPControlComboBox????
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: 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
Back to Top
YMHiK View Drop Down
Groupie
Groupie
Avatar

Joined: 21 January 2009
Location: United States
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote YMHiK Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
fjosesen View Drop Down
Groupie
Groupie
Avatar

Joined: 30 June 2008
Status: Offline
Points: 49
Post Options Post Options   Thanks (0) Thanks(0)   Quote fjosesen Quote  Post ReplyReply Direct Link To This Post 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)
Back to Top
fjosesen View Drop Down
Groupie
Groupie
Avatar

Joined: 30 June 2008
Status: Offline
Points: 49
Post Options Post Options   Thanks (0) Thanks(0)   Quote fjosesen Quote  Post ReplyReply Direct Link To This Post 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)
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: 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
Back to Top
fjosesen View Drop Down
Groupie
Groupie
Avatar

Joined: 30 June 2008
Status: Offline
Points: 49
Post Options Post Options   Thanks (0) Thanks(0)   Quote fjosesen Quote  Post ReplyReply Direct Link To This Post 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)
Back to Top
SunIron View Drop Down
Newbie
Newbie
Avatar

Joined: 18 March 2008
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote SunIron Quote  Post ReplyReply Direct Link To This Post 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:
   
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.125 seconds.