Очень понравилась фича автозаполнения (автодополнения) из himemo
бился целый день, не могу отловить баг.
Задача: набираемый текст более 3х символов должен автозаполняться через выскакивающее меню.
Мое решение:
Add(MainForm,286634,588,287)
{
Width=900
Height=700
Position=1
}
Add(If_else,8228989,322,203)
{
Op2=Integer(13)
link(onTrue,627479:doEvent1,[])
}
Add(RichEdit,448143,322,259)
{
Left=2
Top=50
Width=1060
Height=280
Align=5
ParentFont=0
TabOrder=1
Layout="v"
WidthScale=100
HeightScale=45
ScrollBars=2
CanDragOle=1
WantTab=0
Point(SelText)
Point(onKeyDown)
Point(onWordClick)
Point(Position)
Point(doSetFocus)
Point(doFont)
Point(doSetSelStart)
link(onChange,3969493:doWork2,[(379,265)(379,251)])
link(onKeyDown,11944991:In,[])
}
Add(LineBreak,16738231,266,203)
{
Caption="enter"
link(Out,8228989:doCompare,[])
Primary=[11944991,119,63]
}
Add(ChildForm,3969493,455,238)
{
link(onEvent1,4862477:doEvent1,[])
link(Data1,448143:Array,[(461,226)(437,226)(437,330)(342,330)])
}
BEGIN_SDK
Add(EditMulti,812235,21,21)
{
EventCount=1
WorkCount=2
DataCount=1
Width=685
Height=396
HOffset=50
link(doWork1,9524991:doEnum,[(39,27)(39,76)])
link(doWork2,8015648:doValue,[(30,34)(30,258)])
}
Add(MainForm,5922847,630,350)
{
Left=35
Top=105
TaskBar=1
Position=1
Point(doVisible)
Point(doShiftLeft)
Point(doShiftTop)
}
Add(StrList,12797896,441,42)
{
}
Add(ArrayFilterRepeats,11999356,455,98)
{
link(onFilter,4705037:doAdd,[])
link(onEndFilter,4705037:doSort,[(500,111)(500,146)])
link(Array,12797896:Array,[])
}
Add(Str_Enum,9629683,112,42)
{
Delimiter=" "
link(onEnum,204474:doReplace,[])
link(String,9524991:Item,[(118,30)(93,30)(93,114)(62,114)])
}
Add(StrList,4705037,553,98)
{
Point(StrToFind)
Point(doSort)
}
Add(Hub,16762946,252,140)
{
link(onEvent1,14096079:In,[(276,146)(276,139)])
link(onEvent2,11999356:doFilter,[(360,153)(360,104)])
}
Add(LineBreak,7701053,504,112)
{
Caption="0"
link(Out,4705037:doClear,[(540,118)(540,111)])
Primary=[14096079,-217,21]
}
Add(ListBox,8325744,497,294)
{
Left=430
Top=235
Align=5
DataType=1
Point(doSetFocus)
link(onClick,4584755:doEvent1,[])
}
Add(Replace,204474,156,42)
{
SubStr="."
link(onReplace,2461083:doReplace,[])
}
Add(Replace,2461083,198,42)
{
SubStr=","
link(onReplace,13467748:doReplace,[])
}
Add(Replace,13467748,240,42)
{
SubStr="!"
link(onReplace,7583812:doReplace,[])
}
Add(Replace,7583812,282,42)
{
SubStr="?"
link(onReplace,852329:doReplace,[])
}
Add(Replace,852329,324,42)
{
SubStr=";"
link(onReplace,9926649:doReplace,[])
}
Add(Replace,9926649,366,42)
{
SubStr="-"
link(onReplace,10406926:doEvent1,[])
}
Add(StrMask,3491053,371,308)
{
Point(doMask)
link(onTrue,16532067:doEvent1,[])
link(Str,953583:Var,[])
}
Add(Hub,16532067,420,315)
{
OutCount=3
link(onEvent1,8325744:doText,[])
link(onEvent2,8325744:doSetFocus,[(466,328)(466,342)])
link(onEvent3,5922847:doVisible,[(454,335)(454,384)])
}
Add(Hub,4584755,546,301)
{
link(onEvent1,812235:onEvent1,[(658,307)(658,27)])
link(onEvent2,5922847:doClose,[(598,314)(598,377)])
}
Add(Length,9978075,133,315)
{
link(onLength,4001543:doCompare,[(187,321)(187,328)])
link(Str,7916825:Var3,[(139,299)])
}
Add(If_else,4001543,210,322)
{
Type=2
Op2=Integer(3)
link(onTrue,16291398:doString,[])
link(Op1,9978075:Result,[(216,310)(178,310)(178,359)(139,359)])
}
Add(Memory,8015648,105,252)
{
link(onData,9978075:doLength,[(149,258)(149,290)(121,290)(121,321)])
}
Add(FormatStr,16291398,259,322)
{
Mask="%1*"
link(onFString,10243739:doEvent1,[])
link(Str1,7916825:Var2,[(265,306)(111,306)])
}
Add(GetDataEx,7916825,105,294)
{
link(Data,8015648:Value,[])
}
Add(Hub,10243739,322,322)
{
link(onEvent1,3491053:doMask,[(354,328)(354,321)])
link(onEvent2,3491053:doCompare,[(350,335)(350,314)])
}
Add(ArrayEnum,9524991,56,70)
{
link(onItem,9629683:doEnum,[(103,76)(103,48)])
link(onEndEnum,16762946:doEvent1,[(105,83)(105,146)])
link(Array,812235:Data1,[(62,46)(77,46)])
}
Add(LineBreak,362696,553,168)
{
Type=1
link(Data,4705037:Text,[])
Primary=[953583,-182,119]
}
Add(Hub,10406926,406,42)
{
link(onEvent1,12797896:doAdd,[])
}
Add(PointHint,9416753,49,28)
{
Info=#22:блок формирования слов|
Transparent=0
VAlign=0
Width=596
Height=193
}
Add(PointHint,3037750,49,231)
{
Info=#24:блок автозаполнения слов|
Transparent=0
VAlign=0
Width=526
Height=158
}
END_SDK
Add(Hub,627479,378,203)
{
link(onEvent1,3969493:doWork1,[(400,209)(400,244)])
}
Add(Hub,4862477,504,238)
{
link(onEvent2,448143:doAdd,[(657,251)(657,342)(312,342)(312,265)])
}