Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - CXTButton
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTButton

 Post Reply Post Reply
Author
Message
Kenneth View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 May 2004
Location: United States
Status: Offline
Points: 256
Post Options Post Options   Thanks (0) Thanks(0)   Quote Kenneth Quote  Post ReplyReply Direct Link To This Post Topic: CXTButton
    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?
 
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


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: 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
Back to Top
Kenneth View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 May 2004
Location: United States
Status: Offline
Points: 256
Post Options Post Options   Thanks (0) Thanks(0)   Quote Kenneth Quote  Post ReplyReply Direct Link To This Post Posted: 31 May 2007 at 8:45am
Yes, but I did not select that option.  So how do I turn it off?
Back to Top
Kenneth View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 May 2004
Location: United States
Status: Offline
Points: 256
Post Options Post Options   Thanks (0) Thanks(0)   Quote Kenneth Quote  Post ReplyReply Direct Link To This Post 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?

Back to Top
Oleg View Drop Down
Senior Member
Senior Member


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: 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
Back to Top
Kenneth View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 May 2004
Location: United States
Status: Offline
Points: 256
Post Options Post Options   Thanks (0) Thanks(0)   Quote Kenneth Quote  Post ReplyReply Direct Link To This Post 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.
 
 
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1210
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


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: 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
Back to Top
Kenneth View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 May 2004
Location: United States
Status: Offline
Points: 256
Post Options Post Options   Thanks (0) Thanks(0)   Quote Kenneth Quote  Post ReplyReply Direct Link To This Post 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!
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.047 seconds.