![]()  | 
 
Adding icon to a popup Item | 
 
    Post Reply  
   | 
  
| Author | |
   
   sdancer75  
   
   Groupie  
   Joined: 08 July 2008 Location: Greece Status: Offline Points: 70  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Topic: Adding icon to a popup ItemPosted: 02 October 2014 at 8:10am  | 
 
| 
   
    
   Hi,  
   
  I am trying to add an icon to an item popup menu. But when I open the popup menu it shows nothing. 	CXTPPopupBar *pChildBar =  (CXTPPopupBar*)((CMainFrame *)AfxGetMainWnd())->m_pPopupHistory->GetCommandBar();		 	//******** manually create Control Button ************************* 	CXTPControlButton  *pItem = (CXTPControlButton*) CXTPControlButton::CreateObject();	 	pItem->SetID(ID_TOC_HISTORY); 	pItem->SetCaption(m_TreeCtrl.GetItemText(m_TreeCtrl.GetSelectedItem())); 	pItem->SetIconSize(CSize(32,32)); 	pItem->SetIconId(IDB_PNG_HISTORY); <-- Seems to do nothing 	//******************************************************************** 	CXTPControl* pMenuItem = pChildBar->GetControls()->InsertAt(pItem,0); // add item created before to the menu. What seems to be the problem in the code above ? regards,  | 
 |
| 
   
     
     Just me!
     
   
   | 
 |
![]()  | 
 |
   
   sdancer75  
   
   Groupie  
   Joined: 08 July 2008 Location: Greece Status: Offline Points: 70  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 02 October 2014 at 8:45am | 
 
| 
   
    
   Ok I solve it with the code below 
   
  UINT nID_History[] = {ID_TOC_HISTORY}; pCommandBars->GetImageManager()->SetIcons(IDB_PNG_HISTORY, nID_History, _countof(nID_History), CSize(16, 16), xtpImageNormal); But why didn't work with the SetIconId() ? Regards,  | 
 |
| 
   
     
     Just me!
     
   
   | 
 |
![]()  | 
 |
   
   Willowmaster  
   
   Senior Member  
    
   Joined: 12 July 2010 Location: Netherlands Status: Offline Points: 180  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 02 October 2014 at 8:47am | 
 
| 
   
    
   Different icon size maybe?
    
   
   | 
 |
| 
   
     
     Product: Xtreme SuitePro (ActiveX) version 15.3.1  
   
  Platform: Windows XP (32bit) - SP 3 (on VMWare) Language: Visual Basic 6.0  | 
 |
![]()  | 
 |
   
   sdancer75  
   
   Groupie  
   Joined: 08 July 2008 Location: Greece Status: Offline Points: 70  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 03 October 2014 at 11:32am | 
 
   
   
 Hi, No its the same....  
   ![]()  | 
 |
| 
   
     
     Just me!
     
   
   | 
 |
![]()  | 
 |
   
   Willowmaster  
   
   Senior Member  
    
   Joined: 12 July 2010 Location: Netherlands Status: Offline Points: 180  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 03 October 2014 at 4:22pm | 
 
| 
   
    
   In your examples you use two different icon sizes. 16X16 and 32X32. Not sure if it was clear what I meant.
    
   
   | 
 |
| 
   
     
     Product: Xtreme SuitePro (ActiveX) version 15.3.1  
   
  Platform: Windows XP (32bit) - SP 3 (on VMWare) Language: Visual Basic 6.0  | 
 |
![]()  | 
 |
   
   sdancer75  
   
   Groupie  
   Joined: 08 July 2008 Location: Greece Status: Offline Points: 70  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 04 October 2014 at 5:16am | 
 
   
   
 Yes you are right, sorry for my mistake in the examples above, but in the real code inside my project, I have already corrected my mistake at the very beggining and the result is just the same....... I think that the problem is that I have to store the image inside the Image Manager before I call the SetIconId() to take care some parameters......... Regards,  | 
 |
| 
   
     
     Just me!
     
   
   | 
 |
![]()  | 
 |
    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  |