|  | 
| Setting Color for Automatic Button? | 
| Post Reply   | 
| Author | |
| Sstar9   Newbie   Joined: 25 August 2006 Status: Offline Points: 25 |  Post Options  Thanks(0)  Quote  Reply  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
     | |
|  | |
| Oleg   Senior Member   Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |  Post Options  Thanks(0)  Quote  Reply  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) // Draw some color. } and use it instead CXTPControlButtonColor. | |
| 
     Oleg, Support Team CODEJOCK SOFTWARE SOLUTIONS | |
|  | |
| Sstar9   Newbie   Joined: 25 August 2006 Status: Offline Points: 25 |  Post Options  Thanks(0)  Quote  Reply  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
     | |
|  | |
| Oleg   Senior Member   Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |  Post Options  Thanks(0)  Quote  Reply  Posted: 12 September 2006 at 12:28am | 
| 
   Hi,
 Right, sorry. You don't need _XTP_EXT_CLASS | |
| 
     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 |