andrestudio писал(а): проще нельзя не как? программисты говорят, что любую можно усовершенствовать/упростить. Жизнь показывает, что - так оно и есть (озвучивалка чисел например)..
Усовершенствование есть искусство, а рассмативать красивую штуку приятно. Всем польза..
ЗЫ: Я сечас несколько занят и пока не вижу более простых вариантов, так что %
------------ Дoбавленo:
Вот очередной этюд 'нетаблица'
Add(ChildScrollBox,3061712,273,140) { } BEGIN_SDK Pos(6,9) Add(EditMulti,9540359,15,12) { WorkCount=1 Width=755 Height=578 link(doWork1,3952239:doEvent1,[(29,18)(29,81)]) } Add(ScrollBox,4903195,36,474) { Top=25 Width=540 Height=200 } Add(ChildPanelEx,2234832,134,40) { @Hint=#18:заголовки столбцов| link(width,9273256:doEvent1,[(182,46)(182,158)]) link(Array,11194594:Array,[(140,28)(197,28)(197,77)(231,77)]) } BEGIN_SDK Add(EditMultiEx,9085342,21,21) { WorkCount=#6:addCol| EventCount=#20:width=столбец=ширина| DataCount=#21:Array=список столбцов| Width=713 Height=354 link(addCol,13010236:doEnum,[(32,27)(32,139)]) } Add(Panel,751456,581,126) { Width=536 Height=25 Align=2 BevelOuter=1 Point(doWidth) Point(Width) } Add(ChildPanelEx,2452671,301,133) { @Hint=#7:столбец| Mode=1 link(AddWidth,13755153:doOperation,[]) link(onResize,8913017:doEvent1,[(342,153)(342,181)(224,181)(224,265)]) } BEGIN_SDK Add(EditMultiEx,3678769,21,21) { WorkCount=#5:##add|8:##select|9:##hselect| EventCount=#8:AddWidth|7:onClick|8:onResize| VarCount=#5:Width|7:##count|7:##index|13:##eventHandle| Width=503 Height=319 Point(##add) Point(##select) Point(##count) Point(##index) Point(##eventHandle) Point(##hselect) link(##add,5706602:doSplit,[(42,27)(42,83)]) link(Width,9591786:Var2,[(27,298)(237,298)]) } Add(Panel,616731,280,84) { Height=20 Align=1 ModeSp=2 ColorSp=16776960 BorderWidth=0 BevelInner=0 BevelWidth=0 Alignment=2 Point(doWidth) Point(doColor) Point(Width) Point(onResize) link(onClick,3678769:onClick,[(371,90)(371,34)]) link(onResize,10802913:doString,[(323,97)(323,136)(163,136)(163,251)]) } Add(StrPart,12114811,119,77) { Char="=" Point(onNotFound) link(onSplit,13427354:doWork1,[(207,83)]) link(onPart,616731:doCaption,[]) link(onNotFound,5544266:doData,[]) } Add(Hub,7712909,224,91) { link(onEvent1,616731:doWidth,[]) link(onEvent2,3678769:AddWidth,[(266,104)(266,27)]) } Add(DoData,5544266,161,91) { Data=Integer(70) link(onEventData,13427354:doWork2,[]) link(Data,10264691:Var,[]) } Add(HubEx,13427354,203,84) { link(onEvent,7712909:doEvent1,[]) } Add(StrPart,5706602,63,77) { Char=";" link(onSplit,12114811:doSplit,[]) link(onPart,1955936:doValue,[(109,90)(109,132)]) } Add(Memory,1955936,119,126) { @Hint=#13:номер столбца| } Add(FormatStr,10802913,175,245) { Mask="%1=%2" link(onFString,3678769:onResize,[(382,251)(382,41)]) link(Str1,1955936:Value,[(181,232)(125,232)]) link(Str2,9591786:Var1,[(188,233)]) } Add(GetDataEx,9591786,224,224) { link(Data,14437912:GetData,[]) } Add(Math,4113323,280,168) { Op2=10 ResultType=0 link(onResult,14437912:doData,[(324,174)(324,154)(219,154)(219,174)]) link(Op1,616731:Width,[]) } Add(EventFromData,14437912,231,168) { link(onEvent,4113323:doOperation,[]) } Add(GlobalVar,10264691,161,49) { Name="LenDefault" } END_SDK Add(FormatStr,4901133,91,203) { Mask="%2;%1" link(onFString,2452671:##add,[(178,209)(178,139)]) link(Str1,13010236:Item,[]) link(Str2,13010236:Index,[]) } Add(ArrayEnum,13010236,91,133) { link(onItem,4901133:doString,[(135,139)(135,174)(79,174)(79,209)]) link(Array,9085342:Array,[(97,77)(27,77)]) } Add(MultiElementEx,13755153,490,133) { link(Op2,751456:Width,[(496,116)(538,116)(538,172)(587,172)]) link(onResult,12004170:doWork2,[]) } BEGIN_SDK Add(EditMultiEx,10198753,21,21) { WorkCount=#11:doOperation| EventCount=#8:onResult| DataCount=#3:Op2| link(doOperation,12173934:doOperation,[(35,27)(35,55)]) } Add(Memory,14343570,154,49) { link(onData,11208422:doCompare,[]) } Add(Math,12173934,49,49) { Op2=4 ResultType=0 link(onResult,10378638:doOperation,[]) } Add(Math,10378638,98,49) { Op2=4 ResultType=0 link(onResult,14343570:doValue,[]) link(Op2,14343570:Value,[(111,37)(141,37)(141,93)(160,93)]) } Add(If_else,11208422,203,49) { Type=2 link(onTrue,2140742:doOperation,[]) link(Op2,10198753:Op2,[(216,35)(27,35)]) } Add(Math,2140742,259,49) { Op2=8 ResultType=0 link(onResult,10198753:onResult,[(306,55)(306,27)]) } END_SDK Add(HubEx,12004170,560,126) { link(onEvent,751456:doWidth,[]) } Add(Math,14494182,455,273) { ResultType=0 link(onResult,645980:doValue,[]) link(Op2,645980:Value,[(468,261)(494,261)(494,316)(510,316)]) } Add(Memory,645980,504,273) { Default=Integer(0) link(onData,12004170:doWork3,[(564,279)]) } Add(DoData,8036190,406,273) { link(onEventData,14494182:doOperation,[]) link(Data,2452671:Width,[(412,219)(307,219)]) } Add(For,16736323,301,266) { link(onEvent,13129388:doEvent1,[]) link(End,2452671:##count,[]) } Add(Hub,8913017,231,259) { OutCount=3 link(onEvent1,645980:doClear,[(293,265)(293,286)]) link(onEvent2,16736323:doFor,[]) link(onEvent3,9085342:width,[(275,279)(275,27)]) } Add(Hub,13129388,350,266) { link(onEvent1,2452671:##select,[(394,272)(394,228)(289,228)(289,146)]) link(onEvent2,8036190:doData,[]) } END_SDK Add(ChildPanelEx,4890174,533,96) { @Hint=#6:строки| Mode=1 link(onClick,8367307:doEvent1,[]) } BEGIN_SDK Add(EditMultiEx,9085342,21,21) { WorkCount=#5:##add|22:doWidth=столбец=ширина|8:##select|7:doColor| EventCount=#7:onClick| VarCount=#7:##count|12:##eventIndex| Width=706 Height=368 Point(##add) Point(##select) Point(##count) Point(##eventIndex) link(##add,11937314:doWork1,[(81,27)]) link(doWidth,9703362:doSplit,[(74,34)(74,188)]) link(doColor,8987099:doEvent2,[(46,48)(46,157)]) } Add(Panel,751456,581,126) { Width=536 Height=17 Align=2 BorderWidth=0 BevelWidth=0 Point(doWidth) Point(Width) Point(doColor) link(onClick,8758549:doWork3,[(625,132)(625,202)]) } Add(ChildPanelEx,6184608,455,133) { @Hint=#16:столбец (ячейка)| Mode=1 link(AddWidth,13582603:doOperation,[]) link(onClick,8758549:doWork1,[(508,146)]) } BEGIN_SDK Add(EditMultiEx,3678769,21,21) { WorkCount=#5:##add|8:##select|7:doWidth|7:doColor| EventCount=#8:AddWidth|7:onClick|8:onResize| VarCount=#5:Width|7:##count|12:##eventIndex| Point(##add) Point(##select) Point(##count) Point(##eventIndex) link(##add,12114811:doSplit,[(42,27)(42,83)]) link(Width,616731:Width,[(27,169)(209,169)]) link(doWidth,9634902:doWork1,[(172,41)]) link(doColor,616731:doColor,[(191,48)(191,104)]) } Add(Panel,616731,203,84) { Left=1 Top=1 Height=13 Align=1 Color=15793151 ColorSp=65280 BorderWidth=0 BevelInner=0 BevelOuter=2 Alignment=2 Point(doWidth) Point(doColor) Point(Width) Point(onResize) link(onClick,3678769:onClick,[(278,90)(278,34)]) link(onResize,3678769:onResize,[(286,97)(286,41)]) } Add(StrPart,12114811,63,77) { Char="=" link(onSplit,7712909:doEvent1,[(103,83)(103,97)]) link(onPart,616731:doCaption,[]) } Add(Hub,7712909,112,91) { link(onEvent1,9634902:doWork2,[]) link(onEvent2,3678769:AddWidth,[(184,104)(184,27)]) } Add(HubEx,9634902,168,84) { link(onEvent,616731:doWidth,[]) } END_SDK Add(StrPart,7900703,91,126) { Char=";" Point(onNotFound) MakeExt(Char,символ-разделитель столбцов,Char) link(onSplit,13083217:doValue,[]) link(onPart,6854237:doWork2,[]) link(onNotFound,7943141:doEvent1,[]) } Add(InfoTip,9086041,98,56) { Info=#7:строчка| Frame=3 Height=25 Margin=5 } Add(MultiElementEx,13582603,532,133) { @Hint=#23:вычисляем ширину строки| link(Op2,751456:Width,[(538,121)(528,121)(528,170)(587,170)]) link(onResult,751456:doWidth,[]) } BEGIN_SDK Add(EditMultiEx,413374,21,21) { WorkCount=#11:doOperation| EventCount=#8:onResult| DataCount=#3:Op2| link(doOperation,12173934:doOperation,[(35,27)(35,55)]) } Add(Memory,14343570,133,49) { link(onData,11208422:doCompare,[]) } Add(Math,12173934,49,49) { Op2=4 ResultType=0 link(onResult,10378638:doOperation,[]) } Add(Math,10378638,91,49) { Op2=4 ResultType=0 link(onResult,14343570:doValue,[]) link(Op2,14343570:Value,[(104,35)(128,35)(128,93)(139,93)]) } Add(If_else,11208422,175,49) { Type=2 link(onTrue,2140742:doOperation,[]) link(Op2,413374:Op2,[(188,35)(27,35)]) } Add(Math,2140742,224,49) { Op2=8 ResultType=0 link(onResult,413374:onResult,[(288,55)(288,27)]) } END_SDK Add(DoData,3215497,406,231) { link(onEventData,6184608:doColor,[(446,237)(446,160)]) link(Data,15263998:Var2,[]) } Add(Hub,6201467,350,224) { link(onEvent1,13786123:doWork3,[(396,230)]) link(onEvent2,3215497:doData,[]) } Add(HubEx,8758549,504,189) { Angle=1 link(onEvent,9085342:onClick,[(508,221)(574,221)(574,27)]) } Add(HubEx,13786123,392,182) { link(onEvent,6184608:##select,[(423,195)(423,146)]) } Add(Hub,7943141,182,140) { link(onEvent1,6854237:doWork3,[(221,146)]) link(onEvent2,8987099:doEvent1,[(230,153)(230,150)]) } Add(StrPart,9703362,84,182) { Char="=" Point(Left) link(onSplit,6184608:doWidth,[(381,188)(381,153)]) link(onPart,13786123:doWork2,[]) } Add(HubEx,6854237,217,126) { link(onEvent,6184608:##add,[]) } Add(HubEx,11937314,77,84) { Angle=1 link(onEvent,7900703:doSplit,[(81,132)]) } Add(Memory,13083217,140,126) { link(onData,11937314:doWork3,[(181,132)(181,97)]) } Add(GlobalVar,5048049,406,91) { Name="C" } Add(Hub,8987099,238,144) { InCount=2 OutCount=3 link(onEvent2,6458139:doData,[]) link(onEvent3,76190:doFor,[(289,164)(289,230)]) } Add(For,76190,308,224) { link(onEvent,6201467:doEvent1,[]) link(End,6184608:##count,[(321,209)(468,209)]) } Add(DoData,6458139,322,151) { link(onEventData,751456:doColor,[(520,157)(520,146)]) link(Data,15263998:Var1,[(328,121)]) } Add(GetDataEx,15263998,399,112) { link(Data,5048049:Var,[]) } END_SDK Add(MultiElementEx,4567879,330,152) { @Hint=#6:ширина| link(End,11422884:Var1,[(336,140)]) link(onEventData,4890174:doWidth,[(371,158)(371,109)]) link(Data,3699245:Value,[(343,145)(316,145)(316,196)(273,196)]) link(onEvent1,6035998:doWork2,[(397,165)(397,116)]) } BEGIN_SDK Add(EditMultiEx,3538396,21,21) { WorkCount=#5:doFor| EventCount=#11:onEventData|8:onEvent1| DataCount=#3:End|4:Data| link(doFor,10587224:doFor,[(35,27)(35,104)]) } Add(For,10587224,49,98) { link(onEvent,4630802:doEvent1,[]) link(End,3538396:End,[(62,60)(27,60)]) } Add(DoData,15842795,98,49) { link(onEventData,3538396:onEventData,[(226,55)(226,27)]) link(Data,3538396:Data,[(104,35)(34,35)]) } Add(Hub,4630802,91,98) { link(onEvent1,3538396:onEvent1,[(222,104)(222,34)]) link(onEvent2,15842795:doData,[(135,111)(135,83)(86,83)(86,55)]) } END_SDK Add(Timer,16507644,43,40) { @Hint=#26:Без этого работает криво..| Interval=100 AutoStop=1 link(onTimer,6508961:doEvent1,[]) } Add(Memory,3699245,267,152) { link(onData,4567879:doFor,[]) } Add(Hub,8367307,582,96) { OutCount=7 link(onEvent1,13886665:doWork3,[(621,102)]) link(onEvent2,15485939:doValue,[(621,109)(621,146)(534,146)(534,158)]) link(onEvent3,4140738:doFor,[(626,116)(626,137)(430,137)(430,158)]) link(onEvent4,9061368:doData,[(629,123)(629,190)(535,190)(535,200)]) link(onEvent5,6858502:doData,[]) link(onEvent6,5283749:doWork1,[(626,137)(626,151)]) link(onEvent7,13886665:doWork1,[(634,144)(634,81)]) } Add(Hub,9273256,204,152) { link(onEvent1,3699245:doValue,[]) link(onEvent2,15345428:doSplit,[(244,165)(244,263)]) } Add(StrPart,15345428,253,257) { Char="=" Point(Left) link(onSplit,14861762:doWrite,[]) } Add(StrList,11749331,393,180) { @Hint=#15:ширины столбцов| Strings=#0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:| } Add(ArrayRW,14861762,407,250) { link(Array,1783100:Var2,[]) link(Index,15345428:Left,[(420,238)(449,238)(449,301)(259,301)]) } Add(Hub,3952239,43,75) { OutCount=4 link(onEvent1,9986044:doData,[(122,81)(122,319)]) link(onEvent2,1189987:doClear,[(136,88)(136,452)]) link(onEvent3,11937314:doWork2,[(111,95)(111,333)]) link(onEvent4,9133602:doData,[]) } Add(Memory,13083217,197,362) { link(onData,11937314:doWork3,[(241,368)(241,333)]) } Add(Counter,1271957,358,320) { Point(doValue) } Add(DoData,9986044,148,313) { Data=Integer(-1) link(onEventData,1271957:doValue,[(345,319)(345,347)]) } Add(StrPart,7900703,148,362) { Char=";" Point(onNotFound) MakeExt(Char,символ-разделитель столбцов,Char) link(onSplit,13083217:doValue,[]) link(onPart,8577476:doEvent1,[]) link(onNotFound,12206687:doEvent1,[(193,382)(193,410)]) } Add(Hub,12206687,246,404) { OutCount=3 link(onEvent1,15332904:doWork3,[(292,410)]) link(onEvent2,3828424:doWork3,[(306,417)]) link(onEvent3,16202348:doString,[(297,424)(297,480)]) } Add(HubEx,11937314,120,320) { Angle=1 link(onEvent,7900703:doSplit,[(124,368)]) } Add(Hub,8577476,246,369) { OutCount=3 link(onEvent1,15332904:doWork2,[]) link(onEvent2,3828424:doWork2,[]) link(onEvent3,5768876:doString,[(356,389)(356,445)]) } Add(ArrayRW,14998140,393,376) { link(Array,1783100:Var1,[(399,238)]) link(Index,1271957:Count,[(406,364)(364,364)]) } Add(GetDataEx,1783100,400,229) { link(Data,11749331:Array,[]) } Add(FormatStr,5768876,386,439) { Mask="%1=%2;" link(onFString,12313600:doWork2,[]) link(Str2,820:Var2,[]) } Add(Memory,1189987,498,439) { } Add(StrCat,15930759,449,439) { link(onStrCat,1189987:doValue,[]) link(Str1,11836317:Var1,[(455,427)]) } Add(DoData,9133602,295,96) { link(onEventData,4890174:##add,[]) link(Data,11836317:Var3,[(301,85)(476,85)]) } Add(GetDataEx,11836317,463,418) { Angle=1 link(Data,1189987:Value,[(539,427)(539,486)(504,486)]) } Add(GlobalVar,5048049,638,28) { Name="Color" Data=Integer(14680059) MakeExt(Data,цвет строк,Color) } Add(GlobalVar,9165543,645,96) { Name="SelColor" Data=Integer(15400942) MakeExt(Data,цвет выделенной строки,SelColor) } Add(HubEx,15332904,288,362) { link(onEvent,1271957:doNext,[(324,375)(324,326)]) } Add(HubEx,3828424,302,369) { link(onEvent,14998140:doRead,[]) } Add(FormatStr,16202348,323,474) { Mask="%1=%2" link(onFString,12313600:doWork3,[(432,480)]) link(Str2,820:Var1,[(336,427)]) } Add(GetDataEx,820,386,418) { link(Data,14998140:Item,[]) } Add(HubEx,12313600,428,432) { link(onEvent,15930759:doStrCat,[]) } Add(GlobalVar,10264691,29,530) { Name="LenDefault" Data=Integer(70) MakeExt(Data,Ширина заголовочной ячейки по умолчания,LenDefault) } Add(StrList,11194594,211,24) { @Hint=#14:имена столбцов| Strings=#9:первый=50|9:второй=60|9:третий=45|12:четвёртый=70| MakeExt(Strings,имена столбцов = [ширина],Strings) } Add(GlobalVar,5385365,708,124) { Name="C" } Add(MultiElementEx,4140738,442,152) { @Hint=#4:цвет| link(onEventData,5283749:doWork3,[(509,158)]) link(onEvent1,7721109:doWork2,[]) link(End,11422884:Var2,[]) } BEGIN_SDK Add(EditMultiEx,3538396,21,21) { WorkCount=#5:doFor| EventCount=#11:onEventData|8:onEvent1| DataCount=#3:End|4:Data| link(doFor,10587224:doFor,[(35,27)(35,104)]) } Add(For,10587224,49,98) { link(onEvent,4630802:doEvent1,[]) link(End,3538396:End,[(62,60)(27,60)]) } Add(Hub,4630802,91,98) { link(onEvent1,3538396:onEvent1,[(232,104)(232,34)]) link(onEvent2,3538396:onEventData,[(222,111)(222,27)]) } END_SDK Add(GetDataEx,11422884,435,131) { Angle=1 link(Data,4890174:##count,[(539,140)]) } Add(HubEx,6035998,512,103) { link(onEvent,4890174:##select,[]) } Add(Memory,15485939,547,152) { Point(Data) link(Data,4890174:##eventIndex,[(553,140)(546,140)]) } Add(DoData,6858502,645,124) { link(onEventData,11627713:doWork2,[]) link(Data,9165543:Var,[]) } Add(DoData,9061368,547,194) { link(onEventData,7721109:doWork3,[(590,200)(590,230)(502,230)]) link(Data,15485939:Value,[]) } Add(HubEx,7721109,498,152) { link(onEvent,6035998:doWork3,[(516,165)]) } Add(DoData,15842795,638,54) { link(onEventData,11627713:doWork1,[(691,60)]) link(Data,5048049:Var,[]) } Add(HubEx,11627713,687,117) { link(onEvent,5385365:doValue,[]) } Add(Hub,6508961,85,40) { link(onEvent1,2234832:addCol,[]) link(onEvent2,13886665:doWork2,[(128,53)(128,81)]) } Add(HubEx,13886665,617,68) { Angle=3 link(onEvent,15842795:doData,[(621,60)]) } Add(HubEx,5283749,505,138) { Angle=3 link(onEvent,4890174:doColor,[(509,123)]) } END_SDK Add(Edit,12509281,196,133) { Left=90 Width=295 Text="Edit;zsdfg;555;привет" link(onEnter,3061712:doWork1,[]) }
по мотиву http://dev.hiasm.com/forum.html?q=3&p=86461#p86461
ЗЫ: сыровата, не проверялась на больших объёмах, есть косяки и недоделки. При расширении возможностей упёрся в несовершенство концепции, может у кого мысли получше возникнут..
|