![]() |
when the toolbar docking both side, nothing! |
Post Reply
|
| Author | |
suchout
Groupie
Joined: 29 September 2009 Status: Offline Points: 13 |
Post Options
Thanks(0)
Quote Reply
Topic: when the toolbar docking both side, nothing!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~^^
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 23 October 2009 at 8:46am |
|
Hi,
Show some code where you create it.
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
suchout
Groupie
Joined: 29 September 2009 Status: Offline Points: 13 |
Post Options
Thanks(0)
Quote Reply
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, "\\%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
|
|
![]() |
|
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 |