Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Setting Color for Automatic Button?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Setting Color for Automatic Button?

 Post Reply Post Reply
Author
Message
Sstar9 View Drop Down
Newbie
Newbie


Joined: 25 August 2006
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sstar9 Quote  Post ReplyReply Direct Link To This Post Topic: Setting Color for Automatic Button?
    Posted: 01 September 2006 at 12:54am
I noticed the "Automatic" button of a Color TearOff bar  could be set a color in Office applications.  A small square color icon is displayed the left side of the button.
 
 
How could I do the same with CodeJock? I am not sure how this could be done by modifying the TearOff example. 
 
Oleg, do you have any suggestions?
 
Sharing makes life better
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 01 September 2006 at 11:52am
Hello,
Only manually to draw it.
 
Some steps:
 
1. create custom Control derived from CXTPControlButtonColor
 
class _XTP_EXT_CLASS CMyControlButtonColor: public CXTPControlButtonColor
{
 DECLARE_XTP_CONTROL(CMyControlButtonColor)
public:
 void Draw(CDC* pDC);
};
2. in cpp:

IMPLEMENT_XTP_CONTROL(CMyControlButtonColor, CXTPControlButtonColor)

void CMyControlButtonColor::Draw(CDC* pDC)
{
  CXTPControlButtonColor::Draw(CDC* pDC)

// Draw some color.
}
and use it instead CXTPControlButtonColor.
 
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Sstar9 View Drop Down
Newbie
Newbie


Joined: 25 August 2006
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sstar9 Quote  Post ReplyReply Direct Link To This Post Posted: 11 September 2006 at 9:21pm

Hi, Oleg,

What are the following lines of codes in your suggestion doing?

_XTP_EXT_CLASS
 
DECLARE_XTP_CONTROL(CMyControlButtonColor)
IMPLEMENT_XTP_CONTROL(CMyControlButtonColor, CXTPControlButtonColor)
 
In my derived class, if put these in, I would get errors during compilation of my program.  Do you mean if I want to create new derive classes and place header and CPP files into source directory, I should add these things? 
 
Sharing makes life better
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 12 September 2006 at 12:28am
Hi,
 
Right, sorry. You don't need _XTP_EXT_CLASS
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.031 seconds.