September 25, 2022, 11:51:48 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Retrieving a key press

Started by Brian, January 12, 2014, 07:19:59 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Brian

Hi,

I was thinking of maybe putting in a search on the first column of my grid. Pressing a key would
jump to the first cell in column 1 that started with whatever key was pressed (obviously in
the range of A to Z) using IWG_GetCellDat in a loop

How do I get the key that has been pressed? @IDCHAR? @IDKEYDOWN? And I suppose
it has to backwards as well!

Brian

Sam

Hi Brian

I have no experience with IWGrid but, if it behaves like other windows controls, I suspect you would need to subclass it in order to intercept the messages you want.

LarryMc

@ tennisbum - subclassing is not the answer in this case.

@ Brian - When you click on a cell, with a couple of exceptions, you put that cell in edit mode which calls one of the internal dialogs.
And some cells are numbers only so letter hits are trashed.

Off the top of my head there are two ways you could go.
1) This will work for sure
   You create a cell with a type of @IWGBUTTON - clicking it calls a subroutine that you write
   In your subroutine you could open a dialog and
  A) have an edit control where you type in what to search for which could include:
      a) one or more characters to search for
      b) a range of columns and/or rows to search in
   B) a button for each of the 26 letters of the alphabet
2) I think you might be able to pull it off with a @IWGCOMBO cell if all you want is a-z
   this one I'll have to rig up a demo to prove it would work
   the thing I'm concerned about is if you selected the same letter twice in a row(which is not a change)
   but I think I know how to get around that without changing any of the grid's code.
   worse case is I might just have to add a new notification message.

Let me know if the first method will do what you want to do; if it won't and you think the 2nd way would I'll look into it.
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library