|
I have tried to add tooltip for each item but from some reason didn't get to the TTN_NEEDTEXT message.
Do you have any Idea how can I implement tooltips?
|
|
|
|
|
Hi, I want to add this control to Mainframe of a MDI project,as you know,We couldn't cite OncreateClients in Mainframe,what I can do? thanks!
|
|
|
|
|
hi,
i got the compilation error. imagelist_read and imagelist_write undeclared identifier. CString, CDC and some class are ambigious symbols. what can i do for that. pls explain to me. i have wtl 7.0. any other files need for that.
thanks in advance.
|
|
|
|
|
Why there is message loop in OnLButtonDown function ?
|
|
|
|
|
Hi,donno20,
Have you solved it?
Best regards,
Cui Sheng
shengcui@hotmail.com
|
|
|
|
|
Hi thanks for this article,but i'm wandring if we can implement it in a dialog
that would be perfect anyone have an idea
|
|
|
|
|
Hi,
nice project. I have added some gradient painting code to caption bar, and I have added redraw code in idle handler, and also sent some painting messages from different threads with redrawwindow function with RDW_INTERNALPAINT parameter. Anyway, after few minutes, or I think about 800-1000 WM_PAINT messages, things start going bad. WM_PAINT handler caused some GDI problems, and other windows of the application are not painted correctly, such as about dialog. Static control's fonts alike System font, buttons are not drawn... May be I have done something GDI does not like, or your code may have problem. I am not good at forensics of WM_PAINT troubles, and I thought it would be better to examine your code together to figure out what's going on, because your code still exists in my project but only background filling stuff changed. I am posting my code, I would be grateful, if you add this code to your one, and test it. I have changed caption text as well. Caption is dynamic, and collecting caption text from an array in memory, increases a number by 1, and redraws the caption. After 1sec, caption is receiving another WM_PAINT message, and increases number by 1 again, and so on...
I have removed CDC allocation from heap, and put it on stack. This should increase speed. Here my code goes:
CRect rect, rectOriginal;<br />
GetClientRect(&rect);<br />
rectOriginal = rect;<br />
<br />
CDC pDC;
<br />
pDC.CreateCompatibleDC(hDC.m_hDC);<br />
CBitmap bmp;<br />
bmp.CreateCompatibleBitmap(hDC.m_hDC, rect.Width(), rect.Height()); <br />
HBITMAP obmp = pDC.SelectBitmap(bmp);<br />
<br />
if (m_bFlatEdge)<br />
pDC.DrawEdge(&rect, EDGE_ETCHED, BF_LEFT | BF_TOP | BF_RIGHT | BF_BOTTOM | BF_ADJUST);<br />
rect.DeflateRect(m_nBorder, m_nBorder);<br />
<br />
pDC.SetBkMode(TRANSPARENT);<br />
<br />
TRIVERTEX tx[2];<br />
tx[0].x=0;<br />
tx[0].y=0;<br />
tx[0].Red=0x6900;<br />
tx[0].Green=0xb700;<br />
tx[0].Blue=0xff00;<br />
tx[0].Alpha=0x0000;<br />
<br />
tx[1].x=rect.Width()+5;<br />
tx[1].y=1;<br />
tx[1].Red=0x6800;<br />
tx[1].Green=0x7b00;<br />
tx[1].Blue=0xbd00;<br />
tx[1].Alpha=0x0000;<br />
<br />
TRIVERTEX tx2[2];<br />
tx2[0].x=0;<br />
tx2[0].y=1;<br />
tx2[0].Red=0x3900;<br />
tx2[0].Green=0x9800;<br />
tx2[0].Blue=0xE800;<br />
tx2[0].Alpha=0x0000;<br />
<br />
tx2[1].x=rect.Width()+5;<br />
tx2[1].y=rect.Height();<br />
tx2[1].Red=0x1800;<br />
tx2[1].Green=0x7200;<br />
tx2[1].Blue=0xbe00;<br />
tx2[1].Alpha=0x0000;<br />
<br />
TRIVERTEX tx3[2];<br />
tx3[0].x=0;<br />
tx3[0].y=rect.Height()-1;<br />
tx3[0].Red=0x1f00;<br />
tx3[0].Green=0x7200;<br />
tx3[0].Blue=0xb900;<br />
tx3[0].Alpha=0x0000;<br />
<br />
tx3[1].x=rect.Width()+5;<br />
tx3[1].y=rect.Height();<br />
tx3[1].Red=0x6600;<br />
tx3[1].Green=0x3300;<br />
tx3[1].Blue=0x9900;<br />
tx3[1].Alpha=0x0000;<br />
<br />
GRADIENT_RECT gRect;<br />
<br />
gRect.UpperLeft=0;<br />
gRect.LowerRight=1;<br />
GradientFill(pDC.m_hDC,tx,2,&gRect, 1, GRADIENT_FILL_RECT_H);<br />
GradientFill(pDC.m_hDC,tx2,2,&gRect, 1, GRADIENT_FILL_RECT_H);<br />
GradientFill(pDC.m_hDC,tx3,2,&gRect, 1, GRADIENT_FILL_RECT_H);<br />
Thanks!
|
|
|
|
|
Although I have not looked at this code, I had a similar problem with one of my applications a few months ago. I tracked it down to not calling SelectObject() to restore original values after changing them (pens, fonts, foreground/background color, bitmaps...etc) in the onDraw/OnPaint procedures.
Steve
|
|
|
|
|
Thanks for the control.How can I use it in C# or vb.net.
If possible, I would'nt mind a vb version of it.
Mokah
|
|
|
|
|
Great control, but there is something I wish it had.
If I am viewing in small icon view, and have quite long labels, I can't read the label text. What I feel the control needs is to show a tool-tip when hovering over an item whose label is obscured, like you get in the standard Windows tree control.
Does anyone have any code to do this? I've tried using tool-tips but find it very difficult to get them to do what I want.
Paul.
---
"The way of a fool seems right to him, but a wise man listens to advice" - Proverbs 12:15 (NIV)
|
|
|
|
|
I found out that when icons of bar items in bar folders are drawn, they do not use background color as it was intended. The back ground color is hardcoded (hardpainted, ehh.. ) into the bitmaps that represent those two imagelists.
When i wanted to use some transparensy, just got screwed up.
what did i do:
1. Created two icons, using background color. For ex. IDI_ICON1, and IDI_ICON2.
2. Added them to image lists in CBarFolder, using AddIcon, at the initialization time.
3. Set background color to CLR_NONE using SetBkColor
ima->SetBkColor(CLR_NONE);
4. Painted it.
ima->Draw(pDC->m_hDC, pi->iImageIndex, pt, ILD_NORMAL);
And that does nothing
Whats wrong with the code?
1. Should i use overlay images when using .Draw?
2. Did i do wrong when creating icons in resource editor?
3. Image lists were created actually far from the module in dlls, 1 dll for each folder. Is that it?
4. ...?
Sincerely yours, Ilya Kalujny.
|
|
|
|
|
It seems that only 16 color icons work in the Outlook Bar control. Is there anyway to use 256 or true color icons instead?
Thanks,
Clint
|
|
|
|
|
How can I map the message,when clicking the the treeitems,then set the right view's content?
best regards.
roobee@yeah.net
|
|
|
|
|
Hi,
I want to add a button to standard outlook toolbar. If you know how to do this, please let me know.
Regards,
Ajith.
AjithBuwa.
|
|
|
|
|
If I want to use this ATL/WTL application OutLook control in my application for sending and receiving email;what Should I do? Are there any API to Microsoft Outlook application to pull out my email messages?.
I have similar question about Task?
Could I get some ideas from you all how you have used this control?
Thanks
Pati
nrc
|
|
|
|
|
If you add DT_END_ELLIPSIS to the DrawText-calls in the DrawFolder method, it's event closer to the original
Again just a suggestin
Pål
|
|
|
|
|
Thanks again
I have updated the code, for the next release
|
|
|
|
|
To make the outlookbar look even more like the original, the following change can be done to the OnPaint-method in atloutbarctrl.h:
change from
if (!GetFolderChild())
pDC->FillSolidRect(rc, crBackGroundColor);
to
if (!GetFolderChild()) {
pDC->FillSolidRect(rc, crBackGroundColor);
// adds a dark shadow at edge
pDC->Draw3dRect(rc, crDkShadowBorder, crBackGroundColor);
}
Just a suggestion
Thanks for a nice article
|
|
|
|
|
Thanks
I have updated the code, for the next release
|
|
|
|
|
How can i find " atlres.h " ?
|
|
|
|
|
You need the WTL Library
see the article http://www.codeproject.com/wtl/wtlinst.asp on how to download the latest version of WTL.
|
|
|
|
|
I get error when trying to compile. Basically DrawIconEx is not a member of CDT<1>. any ideas? My second question... have you made this into an axtive X control that I might be able to put into a ATL DHTML Control to display in an app?
Thanks....
Derek
|
|
|
|
|
check the version of your WTL Library. It should be v3.1
see the article http://www.codeproject.com/wtl/wtlinst.asp on how to download the latest version of WTL.
also I have not made this into an ActiveX control
|
|
|
|
|
i have try out your outlookbar... emm.. but after i remove the last item "folder" the sample program crash... gee i should allow user to remove my bar at all i guess...;)
knowledge is power
|
|
|
|
|
The control is getting a msg from WM_PAINT. If there are no folders in the control to paint it will crash due to calls to GetBarFolderListItem that might return a NULL pointer and accesses them directly after without checking first. In debug builds this should assert as the author does a check for (iFolder < GetFolderCount()) Although does not return an error if this happens. So in release builds and there are no items it will crash.
This is very easily fixed by adding a return using similar logic as the assert in the paint functions and a few others.
I also added the following lines to OnPaint during my own developments while making this an ActiveX control..
//Ths is the ORIGINAL code from the author to show the insertion point.
GetInsideRect(rc);
if (!GetFolderChild())
pDC->FillSolidRect(rc, crBackGroundColor);
int max = arFolder.size();
//The following is added code........
if (max == 0)
{
dc.BitBlt(clientRc.left, clientRc.top, clientRc.Width(), clientRc.Height(), pDC->m_hDC, 0,0, SRCCOPY);
if (pDC)
delete pDC;
return 0;
}
|
|
|
|
|