I have a number of objects in Panel1 (see [login to view URL]) Controls #1 and #11 are fixed. Controls #2-#10 are not always visible. Object N is visible if and only if function GetSetting(N) returns TRUE. Please write the code in Delphi 5 that will nicely place visible objects #2-#10 in Panel1 for any case. The code will provide a test project where GetSetting randomly returns True or False. The code should work whatever the labels text length and whatever the number of labels. Suggested algorithm: max number of Rows -> MaxRows 1. using a TStringlist or whatever you like, mem which object is written into which row (1..MaxRows) 2. depending on GetSetting, calculate which rows you will actually draw (if no object of row R is drawn, the whole row is not drawn). Store their number in a list (RowLst:TStringList). 3. we will equally space the rows in the parent panel. So the Top value for row R-th (0 based) will be: Top:=r*([login to view URL] div [login to view URL]) 4. for each row to draw R 5. calculate the number of objects to draw on row R -> NObj 6. sum the TextWidth of all captions to draw on row R -> TotWidth 7. we will space each caption with some number of pixels, say Spacing (integer) 8. add Spacing*(NObj-1) to TotWidth: TotWidth:=TotWidth+Spacing*(NObj-1) 9. we will center the objects in row R. So the value of Left for the first object to draw will be ([login to view URL] div 2)-(TotWidth div 2) 10. etc (by now you should have a clear idea of what I need)
## Deliverables
1) All deliverables will be considered "work made for hire" under U.S. Copyright law. Employer will receive exclusive and complete copyrights to all work purchased. (No 3rd party components unless all copyright ramifications are explained AND AGREED TO by the employer on the site per the worker's Worker Legal Agreement).
## Platform
windows xp