1. Typing into a Combobox

Is it possible to know which keystroke has been typed into the text box of a
combo before reading all the text?
I mean to know in real time if an ESC or CR key have been pressed...

Thanks

ANTONIO

new topic     » topic index » view message » categorize

2. Re: Typing into a Combobox

unknown wrote:
> 
> Is it possible to know which keystroke has been typed into the text box of a
> combo
> before reading all the text?
> I mean to know in real time if an ESC or CR key have been pressed...

If you are using Win32lib its easy. There is an undocumented (sorry)
routine called "getEdit" that returns the id of the combobox's edit
area. You can use that to set a handler to trap keystrokes. Something
along the lines of ...

procedure keytrap(integer self, integer event, sequence parms)
      if parms[1] = VK_ESC then
         . . . 
      elsif parms[1] = VK_ENTER then
         . . .
      end if
  end procedure
  setHandler(getEdit(MyCombo), w32HKeyPress, routine_id("keytrap"))

 
-- 
Derek Parnell
Melbourne, Australia

new topic     » goto parent     » topic index » view message » categorize

3. Re: Typing into a Combobox

Very nice; thank you, Derek.
I became crazy in the attempt to trap just these two keystrokes.

My name was missing may be for the hurry, but more probably for being a bit
burst.

Another little question, just because its you:

I met an unsolved problem using a ComboBoxEx with icons, represented by the
cursor.
It changes into a text cursor, that is the vertical line, even to scroll and
select items; I find it not suitable, at least into my program, where no change
is been made to the combo content.
I could not change this cursor with setMousePointer() or restoreMousePointer().
Could you?

Antonio Alessi

a.admin at myway.it
Cecina (Italy)

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu