A Changeable columns width listbox
my original class is built on class desinger. For convenience,
I generated to PRG file by Class Brower. Pls rebuild on class designer
Properties:
ColumnCount > 1 (require)
ColumnWidth (optional)
MinimumWidth (optional)
**************************************************
*-- Class: changeablecolwidthlst
*-- ParentClass: listbox
*-- BaseClass: listbox
*-- Time Stamp: 10/19/02 09:33:08 AM
*
DEFINE CLASS changeablecolwidthlst AS listbox
PROCEDURE MouseDown
Lparameters nButton, nShift, nXCoord, nYCoord
Local nColwidth,nXobj
nColwidth=0
this.DragCol=0
For i= 1 To This.ColumnCount-1
nColwidth=nColwidth+ This.acolumnswidth(i)+2
nXobj=nXCoord-This.Left - This.nMargin
IF Between(nXobj,nColwidth - This.nMargin,nColwidth + This.nMargin )
this.DragCol=i
Endif
Endfor
ENDPROC
PROCEDURE Init
IF this.ColumnCount =1
this.ColumnCount=0
return
endif
DIMENSION this.acolumnswidth(this.ColumnCount)
this.stringtoarray()
FOR i=1 TO this.ColumnCount
IF this.aColumnsWidth(i)=0
this.aColumnsWidth(i)=INT((this.width-this.nmargin)/this.ColumnCount)
ENDIF
DO WHILE this.aColumnsWidth(i) <= this.nMargin*2
this.aColumnsWidth(i)=this.aColumnsWidth(i)+this.nMargin
ENDDO
THIS.ColumnWidths=THIS.ColumnWidths+IIF(i=1,"",",")+ allt(STR(this.aColumnsWidth(i)))
ENDFOR
ENDPROC
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.