Originally posted by: Roeland Bekker
Just that.
ReplyOriginally posted by: Alex
Hi all,
I would like to use the outlook bar, but only need one folder. For some reason the application crashes when I do so. Adding at least one more folder solves the problem. Does anyone know what happens here?
Thanx,
Alex
Never mind, I already solved the problem. The problem was due to the bug already found by zhangbo. The data member iSelFolder should be initialized with 0 instead of 1 in the constructor of CGfxOutBarCtrl.
That's it.
Alex
ReplyOriginally posted by: mz
Where can i find an MFC wrapper for the outlook-style CaptionBar control.
ReplyOriginally posted by: Shadowulf
void CGfxOutBarCtrl::DrawAnimItem(const int xoffset, const int yoffset, const int index)
CRect rc, irc;
if (iLastSel >= iFirstItem && irc.bottom > rc.bottom && irc.top < rc.top)
ASSERT(index >= 0 && index < pbf->GetItemCount());
ASSERT(pi && ima);
IMAGEINFO ii;
CRect rcBck(pt.x-1, pt.y-1, pt.x + szImage.cx+2, pt.y + szImage.cy+2);
/* PREPARE THE MEMORY DC */
/* FILL THE DC WITH THE BACKGROUND COLOUR TO REMOVE THE OLD ICON POSITION */
/* DRAW THE ICON AT THE NEW POSITION */
Have fun.
This code fixes the flickering problem when the selected icon animates.
It uses the standard double-buffering routine.
Just replace the DrawAnimItem function with this one:
{
CImageList * ima = GetFolderImageList(iSelFolder, IsSmallIconView());
GetInsideRect(irc);
GetItemRect(iSelFolder, iLastSel, rc);
{
ASSERT(iSelFolder >= 0 && iSelFolder < GetFolderCount());
CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(iSelFolder);
CBarItem * pi = (CBarItem *) pbf->arItems.GetAt(index);
ima->GetImageInfo(pi->iImageIndex, &ii);
CSize szImage = CRect(ii.rcImage).Size();
CPoint pt;
if (IsSmallIconView())
{
pt.x = rc.left + 2;
pt.y = rc.top + (rc.Height() - szImage.cy) / 2;
}
else
{
pt.x = rc.left + (rc.Width() - szImage.cx) / 2;
pt.y = rc.top;
}
CClientDC dc(this);
HDC hMemDC = CreateCompatibleDC(dc);
HBITMAP hBmp = CreateCompatibleBitmap(dc, rcBck.right - rcBck.left, rcBck.bottom - rcBck.top );
SelectObject(hMemDC, GetStockObject(DEFAULT_GUI_FONT));
SelectObject(hMemDC, hBmp);
SetViewportOrgEx(hMemDC, rcBck.left * -1, rcBck.top * -1, NULL);
CBrush brushFill( crBackGroundColor );
FillRect(hMemDC, &rcBck, (HBRUSH)brushFill.m_hObject);
pt.x += xoffset;
pt.y += yoffset;
ima->Draw(CDC::FromHandle(hMemDC), pi->iImageIndex, pt, ILD_NORMAL);
/* APPLY THE MEMORY DC TO THE ORIGINAL DC */
BitBlt(dc, rcBck.left, rcBck.top, rcBck.right - rcBck.left,
rcBck.bottom - rcBck.top, hMemDC, rcBck.left, rcBck.top, SRCCOPY);
}
}
Originally posted by: Andreas
Can anybody say how I can make it that I see the imagelist in other resolution, my imagelist is in the new XP format (True color I think) but I will only see 256 colors can anyone help me that it will works with the new resolution?
Thanks much
ReplyOriginally posted by: mowng
The code to create the splitter window follows:
if (!wndSplitter.CreateStatic(this, 1, 2)) return false;
if (!wndSplitter2.CreateView(0, 0, pContext->m_pNewViewClass, CSize(0,0), pContext)) return false;
I have a CGfxSplitterWnd splitter with 2 vertical panes and then create two horizotal panes from the right vertical panes. So I end up with one vertical pane on the left and two horizontal panes on the right. The problem is I can't click on the split handle bar to resize the two horzontal panes on the right. Why and how to solve it?
if (!wndSplitter2.CreateStatic(&wndSplitter, 2, 1, WS_CHILD | WS_VISIBLE | WS_BORDER,wndSplitter.IdFromRowCol(0, 1) )) return false;
if (!wndSplitter2.CreateView(1, 0, pContext->m_pNewViewClass, CSize(0,0), pContext)) return false;
Originally posted by: Kannan
I saw in a prev post that adding an OnSysColor() handler to CMainFrame and from there calling a method of outbar control shd do the trick...but, what xactly shd be done in the OutBar's OnSysColorOutBar() function??
Is CWnd::OnSysColor() stment enuf??
ReplyOriginally posted by: Murugan
MDI Version of this control does not work in my application. The problem here is that OnCreateClient(...) function of the MDI fram window class does not get the CCreateContext pointer. In the MDI application OnCreateClient() of the FrameWnd class get passed only the NULL pointer, which we try to access in the OnCreateClient(..) function. Can anyone tell me the solution for this MDI applicaition which uses this control.
Thanks in Advance
Regards
Murugan
Originally posted by: Frank.Jame
Hi,
thank you for you cool outlook bar control,it is a useful control.But i have two questions when i use this control.
question 1:
I want to create a outlookbar at the left-up conner and create a button at the left-down conner.then how can I realize my this dreame
question 2:
when i clik on one of items,i want do display a dialog.I realize this in the OUTBAR_NOTIFY,the code like that:
CxxxDlg dlg;
dlg.DoModal();
when the dialog display,but i cannot press any button on it.
can you help me?
Originally posted by: fatpenguin
I want to drag and drop an image from popMenu to right window.I used BeginDrag,DragMove and EndDrag function to do but failed.
Now I want to make it through another way:copy the image which be clicked on and paste at where buttonUp.How can I do?I'm a beginner,thank you very much.