Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #13547 > unrolled thread

Mofdify Input dropdownlist

Started byJack Konings <glados.1964@gmail.com>
First post2022-02-24 02:40 -0800
Last post2022-02-25 07:49 -0800
Articles 10 — 4 participants

Back to article view | Back to comp.lang.clipper.visual-objects


Contents

  Mofdify Input dropdownlist Jack Konings <glados.1964@gmail.com> - 2022-02-24 02:40 -0800
    Re: Mofdify Input dropdownlist dlzc <dlzc1@cox.net> - 2022-02-24 06:49 -0800
      Re: Mofdify Input dropdownlist Jack Konings <glados.1964@gmail.com> - 2022-02-24 07:03 -0800
        Re: Mofdify Input dropdownlist dlzc <dlzc1@cox.net> - 2022-02-24 12:20 -0800
          Re: Mofdify Input dropdownlist Jack Konings <glados.1964@gmail.com> - 2022-02-25 07:51 -0800
            Re: Mofdify Input dropdownlist dlzc <dlzc1@cox.net> - 2022-02-25 10:33 -0800
    Re: Mofdify Input dropdownlist JohnMartens <martens@tennishulp.info> - 2022-02-24 15:54 +0100
      Re: Mofdify Input dropdownlist Jack Konings <glados.1964@gmail.com> - 2022-02-24 07:07 -0800
    Re: Mofdify Input dropdownlist "Karl-Heinz" <invalid@invalid.invalid> - 2022-02-24 18:55 +0100
      Re: Mofdify Input dropdownlist Jack Konings <glados.1964@gmail.com> - 2022-02-25 07:49 -0800

#13547 — Mofdify Input dropdownlist

FromJack Konings <glados.1964@gmail.com>
Date2022-02-24 02:40 -0800
SubjectMofdify Input dropdownlist
Message-ID<bc535ae4-d0a8-44ed-835c-91f5c43faa60n@googlegroups.com>
Hi,

On a window I've got a combobox as (sorted) dropdownlist. The box is filled with items which all have the same format like "R-"+9999 (like 'R-1234'). The list is used to select more detailed data.
Currently the user punches in "R-" followed by the number. In doing this the combobox displays the item which best fits the input.
Since the format is always the same punching in the "R-" is inefficient. It would be more convenient if the user just has to punch in the number and the best "R-9999" match would be shown.

I tried to get this behavior by defining a keyup event, "catch" the numbers and add "R-' to them. This didn't work well and i'm starting to doubt keyup is the right way to do this.

Can someone give me a hint as how to make the desired behavior?
TIA.

[toc] | [next] | [standalone]


#13548

Fromdlzc <dlzc1@cox.net>
Date2022-02-24 06:49 -0800
Message-ID<4d167f65-c5ec-4f0d-ae1b-a83fda5b1b8en@googlegroups.com>
In reply to#13547
Dear Jack Konings:

On Thursday, February 24, 2022 at 3:40:13 AM UTC-7, Jack Konings wrote:
> Hi, 
> 
> On a window I've got a combobox as (sorted) dropdownlist. The box is
> filled with items which all have the same format like "R-"+9999 (like 'R-1234').
> The list is used to select more detailed data.  Currently the user punches in
> "R-" followed by the number. In doing this the combobox displays the item
> which best fits the input.  Since the format is always the same punching in
> the "R-" is inefficient.

The hacker solution:  Push "R-" into the keyboard buffer, before entering the dialog.  So you've entered it for them.

> It would be more convenient if the user just has to punch in the number
> and the best "R-9999" match would be shown. 

Don't include the "R-" in the list you show them.  "Doctor, it hurts when I do this!"  Probably ignore "R" and "-" when they do press them, since you've trained some of them to type it.  Might even say on screen "Enter the R-[number] you want more information on?"

David A. Smith

[toc] | [prev] | [next] | [standalone]


#13550

FromJack Konings <glados.1964@gmail.com>
Date2022-02-24 07:03 -0800
Message-ID<2a2c93de-df36-4f5c-846d-cc28cf37d8f1n@googlegroups.com>
In reply to#13548
> The hacker solution: Push "R-" into the keyboard buffer, before entering the dialog. So you've entered it for them.

And how would i do that?

[toc] | [prev] | [next] | [standalone]


#13555

Fromdlzc <dlzc1@cox.net>
Date2022-02-24 12:20 -0800
Message-ID<0af52234-4e14-46d2-86dc-4fa7b3490464n@googlegroups.com>
In reply to#13550
On Thursday, February 24, 2022 at 8:03:46 AM UTC-7, Jack Konings wrote:
> > The hacker solution: Push "R-" into the keyboard buffer, before entering the dialog. So you've entered it for them.
> And how would i do that?

Outside VO, but you probably have these WINAPI functions available:
https://stackoverflow.com/questions/10787949/insert-into-windows-keyboard-buffer

David A. Smith

[toc] | [prev] | [next] | [standalone]


#13557

FromJack Konings <glados.1964@gmail.com>
Date2022-02-25 07:51 -0800
Message-ID<402529e4-61e7-412b-954c-9d76615a7acfn@googlegroups.com>
In reply to#13555
> Outside VO, but you probably have these WINAPI functions available: 
> https://stackoverflow.com/questions/10787949/insert-into-windows-keyboard-buffer 

That's a little bit over my paygrade........
I'll give the sample of Karl-Heinz a go.

[toc] | [prev] | [next] | [standalone]


#13559

Fromdlzc <dlzc1@cox.net>
Date2022-02-25 10:33 -0800
Message-ID<867bf7e0-bcad-4327-81ad-564a85d8c116n@googlegroups.com>
In reply to#13557
Dear Jack Konings:

On Friday, February 25, 2022 at 8:51:06 AM UTC-7, Jack Konings wrote:
> > Outside VO, but you probably have these WINAPI functions available: 
> > https://stackoverflow.com/questions/10787949/insert-into-windows-keyboard-buffer

> That's a little bit over my paygrade........ 
> I'll give the sample of Karl-Heinz a go.

OK.  Don't you initialize the search string you have the customer type in to navigate that list?  Can't you set it to "R-" before calling the display routine?  I don't do VO, but we have stuff like this in xHarbour...

David A. Smith

[toc] | [prev] | [next] | [standalone]


#13549

FromJohnMartens <martens@tennishulp.info>
Date2022-02-24 15:54 +0100
Message-ID<sv8666$krk$1@dont-email.me>
In reply to#13547
Why not use an SLE ?

Did you check on ListBoxSelect method ?

METHOD ListBoxSelect(oControlEvent) CLASS frmMyWindow
	SUPER:ListBoxSelect(oControlEvent)
	*
	IF oControlEvent:Control:NameSym == #MYCOMBO


John


Op 24-2-2022 om 11:40 schreef Jack Konings:
> Hi,
> 
> On a window I've got a combobox as (sorted) dropdownlist. The box is filled with items which all have the same format like "R-"+9999 (like 'R-1234'). The list is used to select more detailed data.
> Currently the user punches in "R-" followed by the number. In doing this the combobox displays the item which best fits the input.
> Since the format is always the same punching in the "R-" is inefficient. It would be more convenient if the user just has to punch in the number and the best "R-9999" match would be shown.
> 
> I tried to get this behavior by defining a keyup event, "catch" the numbers and add "R-' to them. This didn't work well and i'm starting to doubt keyup is the right way to do this.
> 
> Can someone give me a hint as how to make the desired behavior?
> TIA.
> 

[toc] | [prev] | [next] | [standalone]


#13551

FromJack Konings <glados.1964@gmail.com>
Date2022-02-24 07:07 -0800
Message-ID<75d87075-bd87-4c57-ae5b-bbb8d042aaedn@googlegroups.com>
In reply to#13549
> Why not use an SLE ? 

Because I want the user to have the possibility to select the item with mouse (and see all the items).

> Did you check on ListBoxSelect method ? 

Yes, but i fail to see how that would solve my issue.

[toc] | [prev] | [next] | [standalone]


#13554

From"Karl-Heinz" <invalid@invalid.invalid>
Date2022-02-24 18:55 +0100
Message-ID<j7pv60F6f0jU1@mid.individual.net>
In reply to#13547
Hi Jack

some month ago i posted a sleInputTimer class in the X#-Forum. With some
small modifications the code seems to work with a DROPDOWNLIST Combo too. To
see what's going on, i added some console output to the attached
cmbTimerSearch class. Just inherit your comboBox from cmbTimerSearch and
give it a try.

What the CB_SELECTSTRING msg does is described here:

https://docs.microsoft.com/en-us/windows/win32/controls/cb-selectstring

regards
Karl-Heinz

CLASS cmbTimerSearch INHERIT ComboBox
PROTECT _lTimerActive AS LOGIC
PROTECT _nInterval := 400 AS DWORD
PROTECT _cSearch AS STRING

METHOD Destroy() CLASS cmbTimerSearch

    SELF:StopTimer()

   SUPER:Destroy()

   RETURN NIL

METHOD Dispatch ( oEv ) CLASS cmbTimerSearch
LOCAL oEvent AS Event


    oEvent := oEv


    DO CASE

    CASE oEvent:message == WM_CHAR

            _cSearch += CHR (oEvent:wParam )


    CASE oEvent:message == WM_KEYUP

            SELF:StartTimer()


    CASE oEvent:message == WM_KEYDOWN

            SELF:StopTimer()


    CASE oEvent:message == WM_KILLFOCUS

            SELF:StopTimer()


    CASE oEvent:message == WM_TIMER


            IF ! Empty ( _cSearch )

                SELF:StopTimer()

                ? "Search for:" , _cSearch := "R-" + _cSearch

                ? SendMessage( SELF:Handle() , CB_SELECTSTRING  , DWORD (
_CAST , -1 )  , LONG (_CAST, String2Psz ( _cSearch ) ) )

                _cSearch := ""

            ENDIF


    ENDCASE


    RETURN SUPER:Dispatch ( oEvent )


METHOD init (oOwner, nID, oPoint, oDimension, kComboType, kStyle ) CLASS
cmbTimerSearch

    SUPER:init (oOwner, nID, oPoint, oDimension, kComboType, kStyle )

    RETURN SELF

METHOD SetTimerInterval ( n ) CLASS cmbTimerSearch

    _nInterval := n

    RETURN SELF

METHOD StartTimer() CLASS cmbTimerSearch


    IF ! _lTimerActive

        IF SetTimer(SELF:Handle(), 4711 , _nInterval  , NULL_PTR) == 4711

            _lTimerActive := TRUE

        ENDIF

    ENDIF

    RETURN _lTimerActive

METHOD StopTimer() CLASS cmbTimerSearch


      IF _lTimerActive

        IF KillTimer ( SELF:Handle() , 4711 )

            _lTimerActive := FALSE

        ENDIF

      ENDIF

    RETURN ! _lTimerActive 

[toc] | [prev] | [next] | [standalone]


#13556

FromJack Konings <glados.1964@gmail.com>
Date2022-02-25 07:49 -0800
Message-ID<064c131e-3af7-4b19-ac29-03391e6ed576n@googlegroups.com>
In reply to#13554
> cmbTimerSearch class. Just inherit your comboBox from cmbTimerSearch and 
> give it a try. 

Ah, this gives me a push in the right direction. Thanks, I will give it a try.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.clipper.visual-objects


csiph-web