Auto-completion for Text controls

Creative ideas/suggestions for HMG

Moderator: Rathinagiri

User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Auto-completion for Text controls

Post by Pablo César »

Have someone got any results with autocompletion in EditBox ?

In FW there is a class and command TAutoGet would wonderful to get something like that !

Code: Select all

#define CUPPER  1
#define CLOWER  2
#define CPROPER 3

#xcommand REDEFINE AUTOGET [ <oGet> VAR ] <uVar>  ; 
             [ ID <nId> ]                         ; 
             [ <dlg: OF, WINDOW, DIALOG> <oDlg> ] ; 
             [ <help:HELPID, HELP ID> <nHelpId> ] ; 
             [ VALID   <ValidFunc> ]              ; 
             [ <pict: PICTURE, PICT> <cPict> ]    ; 
             [ <color:COLOR,COLORS> <nClrFore> [,<nClrBack>] ] ; 
             [ FONT <oFont> ]                     ; 
             [ CURSOR <oCursor> ]                 ; 
             [ MESSAGE <cMsg> ]                   ; 
             [ <update: UPDATE> ]                 ; 
             [ WHEN <uWhen> ]                     ; 
             [ ON CHANGE <uChange> ]              ; 
             [ <readonly: READONLY, NO MODIFY> ]  ; 
             [ <spin: SPINNER> [ON UP <SpnUp>] [ON DOWN <SpnDn>] [MIN <Min>] [MAX <Max>] ] ; 
             [ ITEMS <aItems>]                    ;   
             [ CASE <nCase> ]                     ;
             [ <lAddNewItem: ADD ITEMS> ]         ;
       => ; 
          [ <oGet> := ] TAutoGet():ReDefine( <nId>, bSETGET(<uVar>), <oDlg>,; 
             <nHelpId>, <cPict>, <{ValidFunc}>, <nClrFore>, <nClrBack>,; 
             <oFont>, <oCursor>, <cMsg>, .T., <{uWhen}>,; 
             [ \{|nKey,nFlags,Self| <uChange> \}], <.readonly.>,; 
             <.spin.>, <{SpnUp}>, <{SpnDn}>, <{Min}>, <{Max}>, <aItems>, <nCase>, <.lAddNewItem.>) 

#command @ <nRow>, <nCol> AUTOGET [ <oGet> VAR ] <uVar> ; 
            [ <dlg: OF, WINDOW, DIALOG> <oWnd> ] ; 
            [ <pict: PICTURE, PICT> <cPict> ] ; 
            [ VALID <ValidFunc> ] ; 
            [ <color:COLOR,COLORS> <nClrFore> [,<nClrBack>] ] ; 
            [ SIZE <nWidth>, <nHeight> ]                      ; 
            [ FONT <oFont> ] ; 
            [ <design: DESIGN> ] ; 
            [ CURSOR <oCursor> ] ; 
            [ <pixel: PIXEL> ] ; 
            [ MESSAGE <cMsg> ] ; 
            [ <update: UPDATE> ] ; 
            [ WHEN <uWhen> ] ; 
            [ <lCenter: CENTER, CENTERED> ] ; 
            [ <lRight: RIGHT> ] ; 
            [ ON CHANGE <uChange> ] ; 
            [ <readonly: READONLY, NO MODIFY> ] ; 
            [ <pass: PASSWORD> ] ; 
            [ <lNoBorder: NO BORDER, NOBORDER> ] ; 
            [ <help:HELPID, HELP ID> <nHelpId> ] ; 
            [ ITEMS <aItems>] ;
            [ CASE <nCase> ] ;
            [ <lAddNewItem: ADD ITEMS> ]          ;
       => ; 
          [ <oGet> := ] TAutoGet():New( <nRow>, <nCol>, bSETGET(<uVar>),; 
             [<oWnd>], <nWidth>, <nHeight>, <cPict>, <{ValidFunc}>,; 
             <nClrFore>, <nClrBack>, <oFont>, <.design.>,; 
             <oCursor>, <.pixel.>, <cMsg>, .T., <{uWhen}>,; 
             <.lCenter.>, <.lRight.>,; 
             [\{|nKey, nFlags, Self| <uChange>\}], <.readonly.>,; 
             <.pass.>, [<.lNoBorder.>], <nHelpId>,,,,,,<aItems>, <nCase>, <.lAddNewItem.>)

#command @ <nRow>, <nCol> AUTOGET [ <oGet> VAR ] <uVar> ; 
            [ <dlg: OF, WINDOW, DIALOG> <oWnd> ] ; 
            [ <pict: PICTURE, PICT> <cPict> ] ; 
            [ VALID <ValidFunc> ] ; 
            [ <color:COLOR,COLORS> <nClrFore> [,<nClrBack>] ] ; 
            [ SIZE <nWidth>, <nHeight> ]  ; 
            [ FONT <oFont> ] ; 
            [ <design: DESIGN> ] ; 
            [ CURSOR <oCursor> ] ; 
            [ <pixel: PIXEL> ] ; 
            [ MESSAGE <cMsg> ] ; 
            [ <update: UPDATE> ] ; 
            [ WHEN <uWhen> ] ; 
            [ <lCenter: CENTER, CENTERED> ] ; 
            [ <lRight: RIGHT> ] ; 
            [ ON CHANGE <uChange> ] ; 
            [ <readonly: READONLY, NO MODIFY> ] ; 
            [ <help:HELPID, HELP ID> <nHelpId> ] ; 
            [ <spin: SPINNER> [ON UP <SpnUp>] [ON DOWN <SpnDn>] [MIN <Min>] [MAX <Max>] ] ; 
            [ ITEMS <aItems>] ;
            [ CASE <nCase> ] ;
            [ <lAddNewItem: ADD ITEMS> ]        ;
       => ; 
          [ <oGet> := ] TAutoGet():New( <nRow>, <nCol>, bSETGET(<uVar>),; 
             [<oWnd>], <nWidth>, <nHeight>, <cPict>, <{ValidFunc}>,; 
             <nClrFore>, <nClrBack>, <oFont>, <.design.>,; 
             <oCursor>, <.pixel.>, <cMsg>, .T., <{uWhen}>,; 
             <.lCenter.>, <.lRight.>,; 
             [\{|nKey, nFlags, Self| <uChange>\}], <.readonly.>,; 
             .f., .f., <nHelpId>,; 
             <.spin.>, <{SpnUp}>, <{SpnDn}>, <{Min}>, <{Max}>, <aItems>, <nCase>, <.lAddNewItem.>)

http://msdn.microsoft.com/en-us/library ... completion
Autocompletion of Strings

Autocompletion expands strings that have been partially entered in an edit control into complete strings. For example, when a user starts to enter a URL in the Address edit control that is embedded in the Windows Internet Explorer toolbar, autocompletion expands the string into one or more complete URLs that are consistent with the existing partial string. A partial URL string such as "mic" might be expanded to "http://www.microsoft.com" or "http://www.microsoft.com/windows". Autocompletion is typically used with edit controls or with controls that have an embedded edit control.
For more information, see the IAutoComplete and IAutoComplete2 interface documentation.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Auto-completion for Text controls

Post by Pablo César »

I've tried our AutoFill function from hfcl in Edit Box. Some is working but probably with some adjustments could work for text multilines. Because after selecting "Argentina" exemplo and typing ENTER not works for others.

See my tries in attached.
Attachments
EDITBOX (Source files).rar
(1.74 KiB) Downloaded 237 times
EditBox (executable file).rar
(1.06 MiB) Downloaded 278 times
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
Steed
Posts: 427
Joined: Sat Dec 12, 2009 3:40 pm

Re: Auto-completion for Text controls

Post by Steed »

Hi, Pablo,

Did you see these sample from Rathi ComboAnywhereSearch
viewtopic.php?f=9&t=3845&p=35660&hilit=autofill#p35666
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Auto-completion for Text controls

Post by Pablo César »

Thank you Ed for your interest and indication. This example is for ComboBox and I think adaptation could reach for EditBox too. But at this time, I'm not with free time for this...

Have you seen scintilla in FW ? It's amazing, so cool !
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: Auto-completion for Text controls

Post by Javier Tovar »

Interesante! quieres hacerlo como en Notepad++ cuando reconoce alguna Función o Procedimento!,

Gracias Pablo césar por compartir!
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Re: Auto-completion for Text controls

Post by Pablo César »

Javier Tovar wrote:Interesante! quieres hacerlo como en Notepad++ cuando reconoce alguna Función o Procedimento!,

Gracias Pablo césar por compartir!
Hace rato que me interesa hacer algo asi. Seria muy bueno que pudieramos tener eso en HMG.

Por eso, si alguien tiene algo hecho, es bien venido cualquier contribuicion.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Auto-completion for Text controls

Post by Pablo César »

Here in attached is a demo from Cristobal Navarro at FW comunity, the source editor is using Scintilla.dll which is a lexer for Harbour.
Very interesting, amazing capabilities with an extraordinary trait to recognize xBase syntax to put highlighted texts.

Make download of attached file, run it and load any PRG file and see how is being done for FW.

We should try with this !
Attachments
SciEdit1.zip
(1.78 MiB) Downloaded 274 times
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Auto-completion for Text controls

Post by Rathinagiri »

The editor looks just great. Thanks for sharing Pablo.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Auto-completion for Text controls

Post by Pablo César »

Nice to know you enjoyed !

In case you wish to keep forward to all releases, you make it thru this Repository: https://bitbucket.org/navarro_cristobal ... /downloads
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
bpd2000
Posts: 1207
Joined: Sat Sep 10, 2011 4:07 am
Location: India

Re: Auto-completion for Text controls

Post by bpd2000 »

Pablo César wrote:Have someone got any results with autocompletion in EditBox ?

In FW there is a class and command TAutoGet would wonderful to get something like that !
Hi Pablo,
What is class, why it is not in HMG
BPD
Convert Dream into Reality through HMG
Post Reply