ButtonSpecAny Focus Issue

Topics related to the Krypton Toolkit.

Moderators: Phil Wright, Chris Porter

ButtonSpecAny Focus Issue

Postby kenmullins2 » Thu Feb 03, 2011 5:08 pm

I have a problem with a ButtonSpec added to a text box. It is acting as a search key replacing a &Find button from a previous version. Less screen real estate, more visually appealing :D The problem is ButtonSpec doesn't get focus!! I have read the reasons why and that to “give focus is a niche issue at best”. However from a data input point of view many high level users rely on key entry (aka tab, space bar, enter etc) to navigate the form data entry controls and button click events. If the ButtonSpec doesn't get focus then an operator can't Tab>Tab>Enter to activate the process they can only click.

TextBox FindButton Pair.PNG
Image of Pre & Post textBox FindButton pair
TextBox FindButton Pair.PNG (3.46 KiB) Viewed 421 times

From a high volume data input perspective this is not good. Any ideas?
kenmullins2
 
Posts: 27
Joined: Fri Jun 11, 2010 10:47 am

Re: ButtonSpecAny Focus Issue

Postby vulkanino » Sat Feb 05, 2011 1:41 am

You may not need the focus on the lens. It would be good to immediately (almost) react to user input, without waiting for other key presses or mouse clicks.

I have implemented a search text control. It listens for the TextChanged event and when it fires it starts a timer to wait a (customizable) time in milliseconds. When the timer expires, it fires an event to say the caller: "hey, search the text". If the user keeps writing, the timer resets, so there's a nice delay between writing and searching.

It behaves like the vista/7 search box. When you type, it shows the cross/close icon. I can sell you this nice control if you want :)
nonfocusedsb.png
nonfocusedsb.png (1.39 KiB) Viewed 395 times

focusedsb.png
focusedsb.png (729 Bytes) Viewed 395 times

filledsb.png
filledsb.png (704 Bytes) Viewed 395 times
vulkanino
 
Posts: 110
Joined: Fri Oct 01, 2010 8:15 pm

Re: ButtonSpecAny Focus Issue

Postby kenmullins2 » Tue Feb 08, 2011 11:37 am

Thanks but no thanks. The button loads a search screen, its not a typeahead type control.
kenmullins2
 
Posts: 27
Joined: Fri Jun 11, 2010 10:47 am

Re: ButtonSpecAny Focus Issue

Postby colonel32 » Wed Feb 09, 2011 8:02 am

What I usually do is catch the Return key in the text box's keypress event, mark it as handled, and fire off the buttonspec's click handler.
colonel32
 
Posts: 34
Joined: Tue Oct 13, 2009 1:31 am

Re: ButtonSpecAny Focus Issue

Postby Phil Wright » Thu Feb 24, 2011 11:16 am

The ButtonSpec cannot receieve focus because it is not a real control. It does not have a window handle it is just an area of the control that is manually drawn as needed. This reduces the number of resources used but also means it cannot have the focus.
Phil Wright
Site Admin
 
Posts: 2720
Joined: Thu Apr 13, 2006 2:55 pm
Location: Melbourne, Australia


Return to Krypton Toolkit

Who is online

Users browsing this forum: No registered users and 0 guests