Print Page | Close Window

Setting Color for Automatic Button?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=4944
Printed Date: 04 March 2025 at 10:20am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Setting Color for Automatic Button?
Posted By: Sstar9
Subject: Setting Color for Automatic Button?
Date 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



Replies:
Posted By: Oleg
Date 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


Posted By: Sstar9
Date 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


Posted By: Oleg
Date Posted: 12 September 2006 at 12:28am
Hi,
 
Right, sorry. You don't need _XTP_EXT_CLASS


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net