AutoComplete Sample

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

AutoComplete Sample

Steve Alan Waring
Hi,

I have been playing around with a simple case of using Scintilla's
autocomplete. If anyone is interested in having a look, the package is
attached to this message.

This is my first time working with Scintilla and I was trying to isolate
autocomplete from other Scintilla features ... to see how it works. The idea
behind the presenter is to replace combo drop down lists and enhance single
line textedits with auto complete.

The only example I could find in the image was SmalltalkWorkspace and I used
this class as a guide. One thing I was unsure of, was why SmalltalkWorkspace
uses a timer message to trigger the autocomplete. Is this for useability
reasons or implementation reasons? When I commented out the timer in the
AutoCompleteTextPresenter class it still seemed to work OK.

Any feedback appreciated,
Steve
--
Steve Waring
[hidden email]



begin 666 SW AutoCompleteTextPresenter.zip
M4$L#!!0````(`*=-V3*+D&++7@\```PO```@````4U<@075T;T-O;7!L971E
M5&5X=%!R97-E;G1E<BYP86/M6EM/&TD6?@:)_U# 2C;:8/F.[=G,KF/(!$T(
M"'N"M+FIW%W&O;2[/5WM.)[-_O?]SJGJF[$#,V'V:44"[JHZ]WNUOXJY=.[D
MK1)?]W:3C[WGXLI^#.1,]41I>"/ZBS@<A+.YKV(U4E_BJTAI%<0J*E4RR+G\
M\E9%V@N#GJC]L+>[,Y;:<P`VPU'@V8ID;_>UYZA @]C+2*FEC-0S<3E7P8OA
MJ:A4*F(YE;'ZK"*Q"A=B*8-X;W=("^)&1EYPN[>KE_SA'^%O:B8]O^*$LXI<
M[.WN[9Y]D42Q)\H2Y!U#'BP*W].Q\+30B['C2ZV5%N%$I#P=$?#.5I:%,GA)
M?OI)=,"HWD!O&M#2=7OB<"L.4A$$BK3R)Y4\DK$7R&CUDQ^.I<^XP/U0Q2)0
MRQS(40'FED_W?4_J1YW7BAB)U*\+3WLQ@YR[8,N+5QDH"U"J5-[CW^7X7\J)
M13^*]?O3T)]/O>#]"Q!+'DH_/ +@XNW5^U1^_?XU;)#L"7K(]/]H='D>!!8$
M+3P:^JVGEOK]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JM4-4\(D17840`-NM
M5DTT&Z+%O%>931QKU^K=5JLK.D#9:=/Y-PO?3[\OQ1Q71:V!7_5&4]1;[43N
MPX#>0/H0IE,_J;<+NJ+X&L8K7P&^9C!8LE5QTFC;3Z1*/+<[Z=[3_-1(.S6B
M:<5)^6*>2"AB8EV>Y/JBUFYTN\UZ0: +&=VI*/LR%\M5@_>TV]TFG>1$P<-6
M2/@;C5:KV6PT1+?6M \G-=8Y"#E>Y/A*U*MU_.\0?>*ZW<B)D($U3PJR=42)
MW':==WOE@: XJ38S11A<G4:CRN)<F.O@Y,TX^,SQT"6O;9]4"P<#U_B>&5G0
M[<&PG *9<+M)T-5JS?ZF9^MF)&JMUFH2\/K]/&!K<.%6M5TWJC/#(:D-&T58
M3Y,O75#.\.B>A6$10H4S@>NASPAS]M'V)'X!9Z?1KC:*T7Q^'X9M2GC;+8KC
M!D5VW;+3:#3K#00+PH=739BW:C4+DK!BO@A3H-[M-%N=>]Z$4RD]DIFR@JBU
MH'XK/_V E9-:M=.!:_!6*[]UG.ZM,0!'31DX:1=VLR^^;-9D+,?DR)AM[7ZM
MO;Y_0]_I2=#S9N9?-^=O3B]OKE[W!V<79V]&QG7>-3.'S+LE$DJK]5W_R2Y=
M@S']U&A13N%/)W;M@XDP<LY:M\'_0?M$'#W8NW)SN=[!;KVVR-T+/&Z ^Q;Z
M]5?C3X/<MF7[]N_W(=M89Q.,R:8^IE5M._F#%_S]ZN+7._\+4$L!`A0+% ``
M``@`ITW9,HN08LM>#P``#"\``" ``````````0`@`````````%-7($%U=&]#
M;VUP;&5T951E>'10<F5S96YT97(N<&%C4$L%!@`````!``$`3@```)P/````
!````
`
end


Reply | Threaded
Open this post in threaded view
|

Re: AutoComplete Sample

Blair McGlashan
"Steve Waring" <[hidden email]> wrote in message
news:[hidden email]...

> Hi,
>
> I have been playing around with a simple case of using Scintilla's
> autocomplete. If anyone is interested in having a look, the package is
> attached to this message.
>
> This is my first time working with Scintilla and I was trying to isolate
> autocomplete from other Scintilla features ... to see how it works. The
> idea behind the presenter is to replace combo drop down lists and enhance
> single line textedits with auto complete.
>
> The only example I could find in the image was SmalltalkWorkspace and I
> used this class as a guide. One thing I was unsure of, was why
> SmalltalkWorkspace uses a timer message to trigger the autocomplete. Is
> this for useability reasons or implementation reasons? When I commented
> out the timer in the AutoCompleteTextPresenter class it still seemed to
> work OK.
>

Its for useability. Since the list content can take quite a bit of
computation (in the workspace case), it's desirable not to perform it if the
user is typing very rapidly, otherwise it can make user input a bit
sluggish.

It's certainly not essential, and you could do without it if your lists are
pre-built or quick to compute.

Regards

Blair


Reply | Threaded
Open this post in threaded view
|

Re: AutoComplete Sample

Steve Alan Waring
Hi Blair,

> Its for useability. Since the list content can take quite a bit of
> computation (in the workspace case), it's desirable not to perform it if
> the user is typing very rapidly, otherwise it can make user input a bit
> sluggish.

Thanks! ... this makes sense.

> It's certainly not essential, and you could do without it if your lists
> are pre-built or quick to compute.

Yes, I tried it with a set collection of strings, without the timer, and it
was very useable.

Thanks,
Steve
--
Steve Waring
[hidden email]