Include | | | | |
//Version:0.0.1
lb.swapentries(long lb,e1,e2){
sendmessage(lb,wm_setredraw,,)
insertstring(lb,0,)
insertstring(lb,-1,)
e1+
e2+
string e1s=getstring$(lb,e1)
string e2s=getstring$(lb,e2)
deletestring(lb,e1)
insertstring(lb,e1,e2s)
deletestring(lb,e2)
insertstring(lb,e2,e1s)
deletestring(lb,0)
deletestring(lb,getcount(lb)-1)
sendmessage(lb,wm_setredraw,true,)
}
lb.moveupentry(long lb,e){lb.swapentries(lb,e,e-1)}
lb.movedownentry(long lb,e){lb.swapentries(lb,e,e+1)}
lb.create(bool mode) {
case pCount==0 : mode=false
return Control(LISTBOX,, $100+if(mode,2,),,,,,hwnd,,)
}
lb.getcs(long h){
case getcount(h)<1 : return
long cs=getcursel(h)
case cs<0 : return
return getstring$(h,cs)
}
lb.getpos(long h){
case getcount(h)<1 : return 0
long cs=getcursel(h)
case cs<0 : return 0
return cs
}
lb.setpos(long h,p){sendmessage (h,LB_SETCURSEL,p,)}
lb.gettopindex(long h){return sendmessage(h,LB_GETTOPINDEX,,)}
lb.selectstring(long h,string s){;selectstring(h,-1,s)}
lb.settopindex(long h,p){sendmessage (h,LB_SETTOPINDEX,p,)}
lb.movelisttolist(long h,hold){
long ti
if hold==true {
string cs=lb.getcs(h)
ti=sendmessage(h,LB_GETTOPINDEX,,)
}
sendmessage(h,wm_setredraw,,)
sendmessage(h,$0184,,)//clear
movelisttohandle(h)
if hold==true {
lb.selectstring(h,cs)
sendmessage (h,LB_SETTOPINDEX,ti,)
} elseif hold==false {
sendmessage (h,LB_SETCURSEL,,)
sendmessage (h,LB_SETTOPINDEX,ti,)
}
sendmessage(h,wm_setredraw,true,)
}
lb.sortinternallist{
long h=lb.create(true)//create sorted list
movelisttohandle(h)
clearlist
movehandletolist(h)
destroywindow(h)
}
lb.removeSelBar(long hLB){
long c=getCurSel(hLB)
case c<0 : return false
string s=getString$(hLB,c)
deleteString(hLB,c)
insertString(hLB,c,s)
return true
}
Die Include nutze ich in den meisten Fällen in denen ich mit ListBoxen zutun habe - was nicht bedeutet, dass jemand anderes mit ihr klarkommen kann oder soll. Ablegen tue ich diese hier nur meiner Vollständigkeit halber. |
| | | | |
|
AnswerThemeninformationenDieses Thema hat 1 subscriber: |
|