Page 1 of 2

Auto-completion for Text controls

Posted: Wed Jan 07, 2015 1:53 pm
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.

Auto-completion for Text controls

Posted: Wed Jan 07, 2015 2:13 pm
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.

Re: Auto-completion for Text controls

Posted: Wed Jan 07, 2015 2:19 pm
by Steed
Hi, Pablo,

Did you see these sample from Rathi ComboAnywhereSearch
viewtopic.php?f=9&t=3845&p=35660&hilit=autofill#p35666

Auto-completion for Text controls

Posted: Wed Jan 07, 2015 2:38 pm
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 !

Re: Auto-completion for Text controls

Posted: Wed Jan 07, 2015 4:52 pm
by Javier Tovar
Interesante! quieres hacerlo como en Notepad++ cuando reconoce alguna Función o Procedimento!,

Gracias Pablo césar por compartir!

Re: Auto-completion for Text controls

Posted: Wed Jan 07, 2015 5:03 pm
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.

Auto-completion for Text controls

Posted: Thu Jan 08, 2015 10:55 am
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 !

Re: Auto-completion for Text controls

Posted: Thu Jan 08, 2015 4:08 pm
by Rathinagiri
The editor looks just great. Thanks for sharing Pablo.

Auto-completion for Text controls

Posted: Thu Jan 08, 2015 5:31 pm
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

Re: Auto-completion for Text controls

Posted: Fri Jan 09, 2015 4:01 am
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