![]() |
Draw transparent toolbar? |
Post Reply ![]() |
Author | |
jeffcmj ![]() Groupie ![]() Joined: 28 October 2004 Status: Offline Points: 92 |
![]() ![]() ![]() ![]() ![]() Posted: 12 July 2005 at 3:42am |
Hi, Does anyone know how to make toolbar transparent? I mean the toolbar's uses the background filled via FillDockBar. Best
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
See code of void CXTPNativeXPTheme::FillCommandBarEntry(CDC* pDC, CXTPCommandBar* pBar) it can help... |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
jeffcmj ![]() Groupie ![]() Joined: 28 October 2004 Status: Offline Points: 92 |
![]() ![]() ![]() ![]() ![]() |
This code seems use the same function to draw both of them. It works well with solid background, but what if the background is a picture? What I want is the thing like MFC toolbar on the rebar, with whom I can draw a picture on the rebar and make toolbar transparent, then the toolbar button will show on the picture. Thanks
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
In FillCommandBarEntry you must draw part of this picture to make it look like transparent. Windows doesn't allow to make child window transparent. |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
jeffcmj ![]() Groupie ![]() Joined: 28 October 2004 Status: Offline Points: 92 |
![]() ![]() ![]() ![]() ![]() |
In my previous project, I use this trick to let parent window draw child window. CPoint pt (0, 0); bRes = (BOOL) pParent->SendMessage (WM_ERASEBKGND, (WPARAM)pDC->m_hDC); pDC->SetWindowOrg(pt.x, pt.y); But it does not work with XTP, because XTP draws the DockBar in OnPaint, not OnEraseBkgnd, any suggestion? Thanks |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
ok, here is your sample |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
jeffcmj ![]() Groupie ![]() Joined: 28 October 2004 Status: Offline Points: 92 |
![]() ![]() ![]() ![]() ![]() |
Thanks ole. I feel myself silly after seeing your sample. ;-)
|
|
![]() |
|
jeffcmj ![]() Groupie ![]() Joined: 28 October 2004 Status: Offline Points: 92 |
![]() ![]() ![]() ![]() ![]() |
Sorry for bring this thread back. I still think XTP command bar shall redraw the background in OnErase handler. For example, I have another control placed on the bar, if XTP's bar redraw the background in OnErase handle, then I only need to use the following code to make my control transparent: CPoint pt (0, 0); bRes = (BOOL) pParent->SendMessage (WM_ERASEBKGND, (WPARAM)pDC->m_hDC); pDC->SetWindowOrg(pt.x, pt.y); The big advantage of this way is the control actually not even know it's parent is the XTP bar, thus makes the control more independent. Best Jeff |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi, Standard controls and CommandBars too supports WM_PRINT message. instead bRes = (BOOL) pParent->SendMessage (WM_ERASEBKGND, (WPARAM)pDC->m_hDC); try pParent->Print(pDC, PRF_CLIENT); |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
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 |