Forum > LCL

Help designing questionnaire design

(1/2) > >>

Leledumbo:
I'd like to create a questionnaire, more or less is like in the attached image. Currently it uses nested panels, but I think it's just too much. It would be better if I can use T*Grid but I have no idea how to put the radio button panel as a cell in the grid. Can anyone help me? Or is there any better approach? A code snippet to add a row would be helpful (so that questions can be dynamically added).

marcov:
Have a look at the "advanced" demo of Virtual String Tree.

There is a tab that is an example how to use VST as a grid, and another that is an example how to nest a checkbox in a stringtree. Combined it gives a grid with "other" widget functionality.

I use it in my production app at work, it is stable, though has minor visual artefacts.

Leledumbo:
Where exactly is that? I can't find it in my installation. Is it a 3rd party package?

theo:

--- Quote from: Leledumbo on March 12, 2010, 10:42:40 am ---Where exactly is that? I can't find it in my installation. Is it a 3rd party package?

--- End quote ---

http://forum.lazarus.freepascal.org/index.php/topic,8601.0.html

Home of the original delphi version:
http://www.soft-gems.net/index.php?option=com_content&task=view&id=12&Itemid=33

davesimplewear:
the following code taken from lazarus/examples/grids/gridcelleditor relates to what you want to insert a radio button in a string grid, substitute the radio button for the combobox.


--- Code: ---procedure TForm1.StringGrid1SelectEditor(Sender: TObject; aCol, aRow: Integer;

  var Editor: TWinControl);

begin

  if (aCol=3) and (aRow>0) then begin

    ComboBox1.BoundsRect:=StringGrid1.CellRect(aCol,aRow);

    ComboBox1.Text:=StringGrid1.Cells[StringGrid1.Col,StringGrid1.Row];

    Editor:=ComboBox1;

  end;

end;
--- End code ---

Regards
Dave

Navigation

[0] Message Index

[#] Next page

Go to full version