Dlog-Store user pref LB column sizes

From Vectorlab
Jump to: navigation, search


Procedure to save List Browser's column sizes and sorting column in the file "SavedSettingsUser.xml". The values are separated by colon (";"). Use the routine D_LoadLBSizes to load the values. By Orso B. Schmid


{ Orso B. Schmid ************************************************ }
{ stores column LB column widths and sort column (always last) }
PROCEDURE D_StoreLBSizes(dID, LBid: LONGINT; XMLcategory, XMLelem: STRING);
	CONST
		cSC = chr(59);
	VAR 
		i, numCols, LBw :INTEGER;
		
		temp_i : INTEGER;
		temp_b :BOOLEAN;
		temp_s : STRING;
		
	BEGIN
		temp_s := '';
		numCols := GetNumLBColumns(dID, LBid);
		i := 0;
		WHILE i < numCols DO BEGIN
			temp_b := GetLBColumnWidth(dID,  LBid, i, LBw);
			temp_s := Concat(temp_s, cSC, LBw);
			i := i + 1;
		END;
		
		Delete(temp_s, 1, 1); { remove first cSC }
		
		temp_s := Concat(temp_s, cSC, GetLBSortColumn(dID, LBid));
		SetSavedSetting(XMLcategory, XMLelem, temp_s);
	END;