![]() |
CXTButton |
Post Reply
|
| Author | |
Kenneth
Senior Member
Joined: 23 May 2004 Location: United States Status: Offline Points: 256 |
Post Options
Thanks(0)
Quote Reply
Topic: CXTButtonPosted: 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?
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
Kenneth
Senior Member
Joined: 23 May 2004 Location: United States Status: Offline Points: 256 |
Post Options
Thanks(0)
Quote Reply
Posted: 31 May 2007 at 8:45am |
|
Yes, but I did not select that option. So how do I turn it off?
|
|
![]() |
|
Kenneth
Senior Member
Joined: 23 May 2004 Location: United States Status: Offline Points: 256 |
Post Options
Thanks(0)
Quote Reply
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? |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
Kenneth
Senior Member
Joined: 23 May 2004 Location: United States Status: Offline Points: 256 |
Post Options
Thanks(0)
Quote Reply
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.
|
|
![]() |
|
mgampi
Senior Member
Joined: 14 July 2003 Status: Offline Points: 1210 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
Kenneth
Senior Member
Joined: 23 May 2004 Location: United States Status: Offline Points: 256 |
Post Options
Thanks(0)
Quote Reply
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!
|
|
![]() |
|
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 |