Print Page | Close Window

Inplace button appearance

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Property Grid
Forum Description: Topics Related to Codejock Property Grid
URL: http://forum.codejock.com/forum_posts.asp?TID=5378
Printed Date: 25 November 2024 at 2:44am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Inplace button appearance
Posted By: farr02
Subject: Inplace button appearance
Date 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




Replies:
Posted By: Oleg
Date 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


Posted By: farr02
Date 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



Posted By: randob1
Date 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.



Posted By: farr02
Date Posted: 17 November 2006 at 5:00am
Thanks for your answer, I will try it.
Bye
   Holger



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