![]() |
how to switch bitmap in toolbar dynamica? |
Post Reply
|
| Author | |
freehawk
Groupie
Joined: 22 April 2004 Status: Offline Points: 95 |
Post Options
Thanks(0)
Quote Reply
Topic: how to switch bitmap in toolbar dynamica?Posted: 15 November 2004 at 1:20am |
|
Hello I want to switch bitmap control in toolbar dynamically, How to realize it? Thanks. -Freehawk |
|
![]() |
|
Ark42
Senior Member
Joined: 20 October 2003 Status: Offline Points: 291 |
Post Options
Thanks(0)
Quote Reply
Posted: 15 November 2004 at 11:37am |
|
Use SetIconID - or look at CXTPControlPopupColor if you want to draw into the icon manually. |
|
![]() |
|
freehawk
Groupie
Joined: 22 April 2004 Status: Offline Points: 95 |
Post Options
Thanks(0)
Quote Reply
Posted: 15 November 2004 at 8:40pm |
|
I want to display a bitmap which is not icon or button in toolbar. So "SetIconID" is not useful.
|
|
![]() |
|
Ark42
Senior Member
Joined: 20 October 2003 Status: Offline Points: 291 |
Post Options
Thanks(0)
Quote Reply
Posted: 15 November 2004 at 9:05pm |
|
Perhaps you need to do a little more research of the documentation or header files. SetIconID is still probably what you want to use. Just add your bitmap or icon to the image manager. |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 16 November 2004 at 3:13am |
|
As variant you can draw control manually: class CControlStatic : public CXTPControl IMPLEMENT_XTP_CONTROL(CControlStatic, CXTPControl) CSize CControlStatic::GetSize(CDC* pDC) if (bVert) return CSize(30, 20); return CSize(20, 30); } ...
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
freehawk
Groupie
Joined: 22 April 2004 Status: Offline Points: 95 |
Post Options
Thanks(0)
Quote Reply
Posted: 16 November 2004 at 8:33pm |
|
int CMainFrame::OnCreateControl(LPCREATECONTROLSTRUCT lpCreateControl) and in "Draw()" of "CControStatic", I load a bitmap, but when I change the ID of bitmap, the bitmap in toolbar can not be changed at all. Could you tell me why? Thanks.
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 16 November 2004 at 11:40pm |
|
give me your void CControlStatic::Draw(CDC* pDC) and how you change its id. |
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
freehawk
Groupie
Joined: 22 April 2004 Status: Offline Points: 95 |
Post Options
Thanks(0)
Quote Reply
Posted: 17 November 2004 at 12:03am |
|
CControlBitmap::CControlBitmap() VERIFY(m_bmpControl1.LoadBitmap(ID_BUTTON_BITMAP )); VERIFY(m_bmpControl2.LoadBitmap(ID_BUTTON_BITMAP 1)); case ID_BUTTON_BITMAP1: I debugged it, in "Draw(CDC* pDC)" m_nMyBitmapId is always ID_BUTTON_BITMAP1. I dont know why.
|
|
![]() |
|
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 |