Print Page | Close Window

when the toolbar docking both side, nothing!

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=15427
Printed Date: 27 September 2024 at 3:29pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: when the toolbar docking both side, nothing!
Posted By: suchout
Subject: when the toolbar docking both side, nothing!
Date Posted: 23 October 2009 at 5:41am

Hi

i developed dynamic toolbar.
 
and, if the toolbar is docking top or bottom ,  buttons are show
 
but toolbar was dragged left or right side, the toolbar is empty,
 
 
i don't know what to do..ㅠㅠ
 
please help me handsom guys~^^
 
 



Replies:
Posted By: Oleg
Date Posted: 23 October 2009 at 8:46am
Hi,
 
Show some code where you create it.


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


Posted By: suchout
Date Posted: 25 October 2009 at 8:23pm

Hi,

< create toolbar >
   m_pToolBar = (CXTPToolBar*)m_pCmdBars->Add(_T("toolbar"), m_aNFInfo->vec_tbInfo.BarPos);
   if (!m_pToolBar || !m_pToolBar->LoadToolBar(IDR_MAINFRAME)) {
       TRACE0("Failed to create toolbar\n");
       return;
   }  
 
  < and clear toolbar >
   int i, nCount;
   for (i = 1; i < pMainCommandBars->GetCount();i++) {  
      m_pToolBar = pMainCommandBars->GetAt(i);    
      nCount = m_pToolBar->GetControlCount();  
      for (int j = 0; j < nCount; j++) {
         m_pToolBar->GetControls()->Remove(0);    
      }
   }
 
 < and dynamic add >
   char *_path, *_image, *_tok;   
   CString *sPath;
   HICON hIcon = NULL;
   HBITMAP hBitmap = NULL;
   CXTPImageManagerIconHandle icoHandle;
       
   m_ToolbarID[0] = WM_USER + m_nUserid;       
   if (strstr(_tok, "ICON")) {
      hIcon = (HICON)LoadImage(NULL, *sPath, IMAGE_ICON, 16, 16, LR_LOADFROMFILE | LR_CREATEDIBSECTION);
      icoHandle.CopyHandle(CXTPImageManagerIconHandle(hIcon));
   }
   else if(strstr(_tok, "BMP")) {    
       sprintf(_image, " file://\\%s.bmp - \\%s.bmp ", tool_info.image);
       strcat(_path, _image);
       sPath = new CString(_path); 
    
       m_hbmImage = LoadImage(NULL, *sPath, IMAGE_BITMAP, 16, 16, LR_LOADFROMFILE | LR_CREATEDIBSECTION );        
       BITMAP bm = {0};
       ::GetObject(m_hbmImage, sizeof(bm), &bm );
       CBitmap bmpIcon;
       bmpIcon.Attach(m_hbmImage);   
       CSize iconSize(bm.bmWidth, bm.bmHeight);
       HICON hIcon = CXTPTransparentBitmap(bmpIcon).ConvertToIcon();
       icoHandle = hIcon;
   }   
   m_hIcon = icoHandle.GetIcon();
   m_pToolBar->GetControls()->Add(xtpControlCustom, m_ToolbarID[0]); 
   m_pToolBar->GetControl(m_pToolBar->GetControls()->GetCount() - 1)->SetCustomIcon(m_hIcon);   
   m_pToolBar->GetControl(m_pToolBar->GetControls()->GetCount() - 1)->SetTooltip((CString)tool_info._name);
   
 
is there any fault in this code? or ..??
 
thank you



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