схемка
Add(MainForm,10639992,364,105)
{
Width=407
Height=258
Position=1
}
Add(ListBox,4150150,693,161)
{
Left=5
Top=5
Width=310
Height=210
Color=16777215
Font=[arial,10,0,0,1]
WinStyle=1
SizeSp=0
ItemHeight=21
BoxDrawManager="Test"
Point(Handle)
Point(onMouseUp)
Point(onMouseWheel)
Point(onKeyDown)
Point(EndIdx)
link(onChange,4522979:In,[])
link(onMouseUp,5027586:doEvent1,[])
link(onMouseWheel,5027586:doEvent2,[])
link(onKeyDown,5027586:doEvent3,[])
}
Add(TrackBarRush,10773167,504,238)
{
Left=297
Top=5
Width=20
Height=212
Color=16777215
Visible=1
Max=1
Frequency=0
AbsPosition=0
TickMarks=2
Kind=1
ThumbLength=40
TickBorderWidth=0
DotsOrient=1
Point(doMax)
Point(Handle)
Point(onKeyDown)
Point(onMouseDown)
link(onPosition,12301572:doEvent1,[])
link(onKeyDown,12301572:doEvent2,[])
link(onMouseDown,12301572:doEvent3,[])
}
Add(Counter,6371961,574,161)
{
Max=9999
link(onNext,4150150:doAdd,[])
}
Add(Hub,5027586,742,175)
{
InCount=3
OutCount=1
link(onEvent1,16274641:In,[])
}
Add(InlineCode,3974644,714,238)
{
WorkPoints=#8:doScroll|14:doGetScrollPos|10:doGetCount|
EventPoints=#14:onSetScrollPos|10:onSetCount|
DataPoints=#6:Handle|7:Handle2|3:Pos|
Code=#15:unit HiAsmUnit;|0:|9:interface|0:|38:uses kol,Share,Debug,Windows,Messages;|0:|4:type|28: THiAsmClass = class(TDebug)|10: private|11: HD:HWND;|21: Poser: integer; |9: public|58: Handle,Handle2,Pos,onSetScrollPos,onSetCount:THI_Event;|47: procedure doScroll(var Data:TData;idx:word);|51: procedure doGetScrollPos(var dt:TData;idx:word);|47: procedure doGetCount(var dt:TData;idx:word);|5: end;|14:implementation|0:|37:procedure THiAsmClass.doGetScrollPos;|5:begin|27:HD:=ToIntegerEvent(Handle);|54:_hi_onEvent(onSetScrollPos,GetScrollPos(HD, SB_VERT));|4:end;|0:|31:procedure THiAsmClass.doScroll;|5:begin|27:HD:=ToIntegerEvent(Handle);|29:Poser:=ReadInteger(Data,Pos);|39:SetScrollPos(HD, SB_VERT, Poser, True);|68:SendMessage(HD, WM_VSCROLL, MAKEWPARAM(SB_THUMBPOSITION, Poser), 0);|4:end;|0:|33:procedure THiAsmClass.doGetCount;|38:var IH,IC,LBH,Count:integer; TR:TRect;|5:begin|27:HD:=ToIntegerEvent(Handle);|39:IC:=SendMessage(HD, LB_GETCOUNT, 0, 0);|44:IH:=SendMessage(HD, LB_GETITEMHEIGHT, 0, 0);|21:GetWindowRect(HD,TR);|33:LBH:=integer(TR.Bottom - TR.Top);|27:if (IC > (LBH div IH)) then|5:begin|38:ShowWindow(ToIntegerEvent(Handle2),1);|49:_hi_onEvent(onSetCount,Integer(IC-(LBH div IH)));|3:end|4:else|38:ShowWindow(ToIntegerEvent(Handle2),0);|4:end;|0:|4:end.|
link(Handle,4150150:Handle,[])
link(Handle2,10773167:Handle,[(727,226)(664,226)(664,282)(517,282)])
link(onSetScrollPos,16037508:In,[])
link(onSetCount,15670172:In,[])
link(POS,4074684:Var,[(734,226)(680,226)(680,373)(510,373)])
}
Add(LineBreak,2188249,672,245)
{
link(Out,3974644:doGetScrollPos,[])
Primary=[16274641,98,-70]
}
Add(LineBreak,3377518,420,245)
{
link(Out,10773167:doPosition2,[])
Primary=[16037508,343,-7]
}
Add(LineBreak,5424033,637,252)
{
link(Out,3974644:doGetCount,[])
Primary=[4522979,105,-91]
}
Add(LineBreak,14279127,455,252)
{
link(Out,10773167:doMax,[])
Primary=[15670172,350,-7]
}
Add(Button,11786375,441,161)
{
Left=325
Top=10
Color=10
Caption="+1"
link(onClick,2494911:doWork2,[])
}
Add(BoxDrawManager,5134939,693,112)
{
Name="Test"
ImageShift=-1
GutterShift=-1
GutterWidth=-1
}
Add(Button,11688679,441,203)
{
Left=325
Top=35
Color=35
Caption="+50"
link(onClick,3359381:doFor,[])
}
Add(For,3359381,497,203)
{
End=49
link(onEvent,2494911:doWork3,[(543,209)])
}
Add(HubEx,2494911,539,161)
{
link(onEvent,6371961:doNext,[])
}
Add(Button,11573607,441,112)
{
Left=325
Top=60
Color=60
Caption="-1"
link(onClick,15314086:doWork2,[])
}
Add(Button,11540889,441,70)
{
Left=325
Top=85
Color=85
Caption="-50"
link(onClick,15899138:doFor,[])
}
Add(For,15899138,497,70)
{
End=49
link(onEvent,15314086:doWork1,[(543,76)])
}
Add(HubEx,15314086,539,112)
{
link(onEvent,16401731:doData,[])
}
Add(PointHint,4074684,93,322)
{
Info=#143:для onKeyDown и onMouseDown так как при нажатии клавиш Up и Down и кликах в зоне TrackBar но не самом ползунке событие onPosition не вызывается|
Width=834
Height=39
link(Data,10773167:Position,[])
}
Add(Hub,12301572,546,238)
{
InCount=3
OutCount=1
link(onEvent1,3974644:doScroll,[])
}
Add(DoData,16401731,574,112)
{
link(onEventData,4150150:doDelete,[(650,118)(650,181)])
link(Data,4150150:EndIdx,[(580,100)(654,100)(654,218)(727,218)])
}
------------ Дoбавленo в 22.52:
ах да и работает корректно только с BoxDrawManager так как без него высота пунктов зависит от размера шрифта