Print Page | Close Window

CXTButton

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=7244
Printed Date: 12 November 2025 at 11:52pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTButton
Posted By: Kenneth
Subject: CXTButton
Date Posted: 25 May 2007 at 4:37pm

The default behavior of the CXTButton appears to have been changed in version 11.1.2 as compared to version 10.4.2.  The latest version draws a double width border around the button if it has been selected.

The following image, on the left, is the button prior to being selected and, on the right, the button after it has been selected.
 
 
The button theme is set to Microsoft Office 2003, enable word theme with a border style of semi-flat.  The show focus option is not selected.  The button style was set as follows:
 
m_btnGo.SetXButtonStyle(BS_XT_TWOROWS);
 
 
The difference can be seen in the toolkit pro button files sample program.  In the 10.4.2 sample, the double width border is never drawn, no matter what option is selected.  In the 11.1.2 sample, the double width border is drawn.  There appears to be no logic as to why it is drawn.
 
Is this some type of theme drawing error?  What needs to be done to prevent the double border when a button has been selected?
 



Replies:
Posted By: Oleg
Date Posted: 31 May 2007 at 12:51am

Hi,

From 11.1.x release CXTButton supports BS_DEFAULT style - this border shows that its default button - will be execute if user press enter.


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


Posted By: Kenneth
Date Posted: 31 May 2007 at 8:45am
Yes, but I did not select that option.  So how do I turn it off?


Posted By: Kenneth
Date Posted: 01 June 2007 at 2:01pm

In fact, what the code really does is to draw the double border for the LAST SELECTED BUTTON, not the default button.    

Is there any way to turn off the drawing of the double button border?



Posted By: Oleg
Date Posted: 02 June 2007 at 3:52am

Hello,

You can only patch sources. in
CXTButtonThemeOffice2003::DrawButtonThemeBackground comment
 
"if (m_bWordTheme && pButton->GetButtonStyle() == BS_DEFPUSHBUTTON)"
block.


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


Posted By: Kenneth
Date Posted: 02 June 2007 at 12:21pm
Oleg
 
You are correct, if I remove the:
 
if (m_bWordTheme && pButton->GetButtonStyle() == BS_DEFPUSHBUTTON)"
 
then the double border does not get drawn.
 
What I don't understand is why if I remove the BS_DEFPUSHBUTTON style bit after I create the button, it still gets drawn with the double border.  Is something in toolkitpro setting the BS_DEFPUSHBUTTON style regardless of what I set it as?
 
In a test, I create the button, reset the BS_DEFPUSHBUTTON bit, then call pButton->GetButtonStyle(), the BS_DEFPUSHBUTTON bit IS NOT set.  However the double border still gets drawn.
 
 


Posted By: mgampi
Date Posted: 03 June 2007 at 4:32am
Hi;
 
Perhaps if (m_bWordTheme && pButton->GetButtonStyle() == BS_DEFPUSHBUTTON)
 
should be changed to
 
if (m_bWordTheme && (pButton->GetButtonStyle() & BS_DEFPUSHBUTTON)==BS_DEFPUSHBUTTON)


-------------
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022


Posted By: Oleg
Date Posted: 03 June 2007 at 5:02am
Try standard dialog with standard Ok and Cancel button - after you set focus to cancel you will see border around cancel - it show that button now default.  OS automatically change style from BS_PUSHBUTTON to BS_DEFPUSHBUTTON if it become selected.
 
btw if you don't like it - in propeties of this button set Owner drawn.


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


Posted By: Kenneth
Date Posted: 03 June 2007 at 9:33am
Oleg
 
It was my customers that did not like the double border, not me.  However the owner draw flag works great, and I don't have to modify the toolkit.  Thanks a lot for resolving this!



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