Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Property Grid
  New Posts New Posts RSS Feed - Inplace button appearance
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Inplace button appearance

 Post Reply Post Reply
Author
Message
farr02 View Drop Down
Groupie
Groupie


Joined: 10 May 2005
Status: Offline
Points: 51
Post Options Post Options   Thanks (0) Thanks(0)   Quote farr02 Quote  Post ReplyReply Direct Link To This Post Topic: Inplace button appearance
    Posted: 30 October 2006 at 9:06am
Hello,

is it possible to modify the appearance of the inplace button apart from writing a special OnPaint routine?
I want to set my own text as caption for the button and my own callback function.

Best regards,
   Holger

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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: 30 October 2006 at 2:47pm
Sorry, you can draw it with own style but size always will be GetSystemMetrics(SM_CXHTHUMB) :(
 
We are going improve it soon.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
farr02 View Drop Down
Groupie
Groupie


Joined: 10 May 2005
Status: Offline
Points: 51
Post Options Post Options   Thanks (0) Thanks(0)   Quote farr02 Quote  Post ReplyReply Direct Link To This Post Posted: 31 October 2006 at 10:08am
Hello Oleg,

thanks for your answer. I found another solution for my problem: According to the custom spin-button element in property-grid sample I implemented a 'normal' button for property-grid items. So I can set size and text of the button and by handling the BN_CLICKED notification of the button I can call a user-given callback function:-)
Implementation is straightforward: Given the spin-button element just replace the CSpinButtonCtrl with a C(XT)Button and the UDN_DELTAPOS notification with BN_CLICKED.
If someone is interested in the source code let me know and I will post it here (but at the moment there are still some problems with getting the keyboard focus, maybe someone has a hint on how the button can get the keybord focus).

Bye
   Holger

Back to Top
randob1 View Drop Down
Newbie
Newbie


Joined: 01 November 2006
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote randob1 Quote  Post ReplyReply Direct Link To This Post Posted: 01 November 2006 at 10:54am

Not sure if my focus issue will relate to yours but due to how we implement the inplaceButton I could not Tab into or out of any buttons.  I wound up having to use a combination of the OnNavigate method and PreTranslate.

This is why my situation may not help.  In my case the buttons, if they exist, proceed an inplace edit control.  OnNavigate was triggered for all the grid controls except the buttons, so if the buttons existed and current grid item was an edit control I could use Windows API to get the focus to the buttons. 

To get back from the buttons I used PreTranslate where I checked for Tab keydown and the shift key.  If I was on the last button and tab was selected, I would then simply set focus to the parent control, again with windows API.  The shift/tab was kind of a hack, if I needed to get back to the edit from the fist button.  I set focus to the parent control and then called OnNavigate to move forward once more so that to the user it would appear that we navigated back one instead of forward twice.  Hope this gives you some ideas.

Back to Top
farr02 View Drop Down
Groupie
Groupie


Joined: 10 May 2005
Status: Offline
Points: 51
Post Options Post Options   Thanks (0) Thanks(0)   Quote farr02 Quote  Post ReplyReply Direct Link To This Post Posted: 17 November 2006 at 5:00am
Thanks for your answer, I will try it.
Bye
   Holger
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.203 seconds.