Add(MainForm,4720280,231,203)
{
Width=424
}
Add(ListBox,6857207,294,182)
{
Left=10
Top=5
Width=320
Height=205
Strings=#7:1111111|7:2222222|7:3333333|7:4444444|7:5555555|7:6666666|
Point(Index)
Point(String)
Point(doSelect)
}
Add(Button,4006544,231,259)
{
Left=340
Top=5
TabOrder=-1
Caption="Up"
link(onClick,6836872:doUp,[])
}
Add(Button,6590722,231,294)
{
Left=340
Top=30
TabOrder=-1
Caption="Down"
link(onClick,6836872:doDown,[(279,300)(279,272)])
}
Add(InlineCode,6836872,294,259)
{
WorkPoints=#4:doUp|6:doDown|
EventPoints=#6:onText|8:onSelect|
DataPoints=#4:Text|3:Idx|0:|
Code=#15:unit HiAsmUnit;|0:|9:interface|0:|21:uses kol,Share,Debug;|0:|4:type|28: THiAsmClass = class(TDebug)|10: private|23: StrList: PStrList;|9: public|10: Text,|9: Idx,|12: onText,|25: onSelect: THI_Event;|24: constructor Create;|34: destructor Destroy; override;|49: procedure doUp(var _Data:TData; Index:word);|56: procedure doDown(var _Data:TData; Index:word); |5: end;|0:|14:implementation|0:|31:constructor THiAsmClass.Create;|5:begin|12: inherited;|24: StrList := NewStrList;|4:end;|0:|31:destructor THiAsmClass.Destroy;|5:begin|15: StrList.free;|12: inherited;|4:end;|0:|27:procedure THiAsmClass.doUp;|3:var|16: idx1: integer;|5:begin|30: idx1 := ToIntegerEvent(Idx);|25: if idx1 <= 0 then exit;|42: StrList.text := ReadString(_Data, Text);|31: StrList.Swap(idx1, idx1 - 1);|36: _hi_onEvent(onText, StrList.text);|37: _hi_onEvent(onSelect, idx1 - 1); |4:end;|0:|34:procedure THiAsmClass.doDown; |3:var|16: idx1: integer;|5:begin|30: idx1 := ToIntegerEvent(Idx);|42: StrList.text := ReadString(_Data, Text);|56: if (idx1 > StrList.Count - 2) or (idx1 < 0) then exit;|31: StrList.Swap(idx1, idx1 + 1);|36: _hi_onEvent(onText, StrList.text);|35: _hi_onEvent(onSelect, idx1 + 1); |4:end;|0:|4:end.|
link(Text,6857207:Text,[])
link(onText,6857207:doText,[(341,265)(341,170)(281,170)(281,209)])
link(onSelect,6857207:doSelect,[(352,272)(352,163)(272,163)(272,230)])
link(Idx,6857207:Index,[(307,247)(321,247)])
}
Разработчик
Ответов: 26164
Рейтинг: 2127
|
|||
Вот вам IC
|
|||
карма: 22 |
| ||
Голосовали: | Tad |