ButtonImageGadget Focus Indicator

Just starting out? Need help? Post your questions and find answers here.
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

ButtonImageGadget Focus Indicator

Post by Karbon »

In my callback I'm trapping #WM_COMMAND and #EN_SETFOCUS to hook in selection indicators. It seems to work with text boxes and editor gadgets but not with image buttons (or maybe buttons in general - I haven't tried). I also tried checking the return of EventType() and comparing it to #PB_EventType_Focus but tabbing to the button doesn't seem to fire any event of any kind.

The button is getting the focus, though. If I tab from the field above it and hit the space bar the button does "push". Is there any way to detect when a button has focus and indicate that on the button visually somehow? I'd be happy to change the image by hand but I'll have to be able to trap the focus event somehow.

I have a form that users will "tab through" to enter data and it looks like the cursor/focus disappears when the button gets it's turn. It's definitely a button data entry people will use as it is "auto fill".

Thanks!
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post by Karbon »

I should add that this is all on a panel gadget, if that makes a difference.
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
User avatar
Fluid Byte
Addict
Addict
Posts: 2336
Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany

Post by Fluid Byte »

Just that I understand correctly, you don't see a focus rect on image buttons?

I ask because I just tested that and have focus rect drawn on the button.
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post by Karbon »

True - I see nothing... I'm betting now that it has something to do with the button being on a panel.
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
User avatar
Fluid Byte
Addict
Addict
Posts: 2336
Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany

Post by Fluid Byte »

I think this is the old Windows focus rectangle issue. Sometimes the rect is shown, somtimes not. If you deactivate "XP Skin Support" in the compiler it should always show the rect. If you still have trouble go ask sparkman, he's an expert regarding this issue.
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

Thanks for the vote of confidence Fluid Byte :)

Karbon, see if this helps

Code: Select all

SendMessage_(WindowID(#YourWindow), #WM_UPDATEUISTATE, 2 | 1 <<16, 0) 
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post by Karbon »

Wow, I guess you ARE an expert. That worked!

Care to explain why it does? I'm curious.
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
Post Reply