LB-Insert column

From Vectorlab
Jump to: navigation, search

Function to insert a column in a list browser. Fixes automatically Edit or Item type in case of control type "number", allows for specification of display type. By Orso B. Schmid

{ Orso ******************************************** }
{ inserts a column in a LB }
FUNCTION LB_InsertCol(d, LB: LONGINT; col, colCntrl, dispType, colWidth: INTEGER; colTitle: STRING): INTEGER;
		temp_b : BOOLEAN;
		col := InsertLBColumn(d, LB, col, colTitle, colWidth); 
		temp_b := SetLBControlType(d, LB, col, colCntrl);
		{ kLBctrMultipleImages needs display type kLBdsplImageOnly }
		IF colCntrl = 7 THEN
			dispType := 1;
		temp_b := SetLBItemDisplayType(d, LB, col, dispType);
		temp_b := SetLBEditDisplayType(d, LB, col, dispType);
		LB_InsertCol := col;