LB-Make math toggle column

From Vectorlab
Jump to: navigation, search


Procedure to make a List Browser column with text-only toggling between math symbols. Loads the index of inserted column data items in an array as VAR. No need to preload images. You need to load the sub-routine LB_ToggleColumn first. By Orso B. Schmid

{ Orso ********************************************* }
{ adds text 'arrows' to a LB, keep it ALWAYS BELOW the LB setup routine }
{ this is also needs SetLBColumnOwnerDrawnType(gD, LB, row, col, 7);	7=Text }
PROCEDURE LB_MakeMathToggleCol(d, LB: LONGINT; col: INTEGER; VAR arr: DYNARRAY[] OF INTEGER);
	BEGIN
		{ this doesn't need images, since we toggle only text strings }
		
		LB_ToggleColumn(d, LB, col, 2); { kLBdispTextOnly }
	
		arr[1] := InsertLBColumnDataItem(d, LB, col, '=', -1, -1, 0);
		arr[3] := InsertLBColumnDataItem(d, LB, col, '<>', -1, -1, 0);
		arr[2] := InsertLBColumnDataItem(d, LB, col, '<', -1, -1, 0);
		arr[4] := InsertLBColumnDataItem(d, LB, col, '>', -1, -1, 0);
	END;