Recent

Author Topic: Help designing questionnaire design  (Read 10105 times)

Leledumbo

  • Hero Member
  • *****
  • Posts: 8835
  • Programming + Glam Metal + Tae Kwon Do = Me
Help designing questionnaire design
« on: March 12, 2010, 09:50:32 am »
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

  • Administrator
  • Hero Member
  • *
  • Posts: 12715
  • FPC developer.
Re: Help designing questionnaire design
« Reply #1 on: March 12, 2010, 10:03:41 am »
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

  • Hero Member
  • *****
  • Posts: 8835
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Help designing questionnaire design
« Reply #2 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?

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1934
Re: Help designing questionnaire design
« Reply #3 on: March 12, 2010, 10:55:07 am »

davesimplewear

  • Sr. Member
  • ****
  • Posts: 321
    • Davids Freeware
Re: Help designing questionnaire design
« Reply #4 on: March 17, 2010, 10:50:57 pm »
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: [Select]
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;

Regards
Dave
All things considered insanity seems the best option

Leledumbo

  • Hero Member
  • *****
  • Posts: 8835
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Help designing questionnaire design
« Reply #5 on: March 18, 2010, 06:40:39 am »
Quote
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.
Doesn't it get called only when I click the cell? I mean, when viewed normally, the radio is not shown.

davesimplewear

  • Sr. Member
  • ****
  • Posts: 321
    • Davids Freeware
Re: Help designing questionnaire design
« Reply #6 on: March 18, 2010, 07:17:03 am »
yes, you are correct, sorry, did not think of that.

Regards
Dave
All things considered insanity seems the best option

davesimplewear

  • Sr. Member
  • ****
  • Posts: 321
    • Davids Freeware
Re: Help designing questionnaire design
« Reply #7 on: March 20, 2010, 01:27:20 am »
Have you had a look at Orpheus controls, they have a table component with check box that may do what you are after.

Regards
Dave :-X

All things considered insanity seems the best option

jesusr

  • Sr. Member
  • ****
  • Posts: 499
Re: Help designing questionnaire design
« Reply #8 on: March 20, 2010, 02:48:00 am »
in r24105 I have improved the support in checkbox column a little, find attached a sample project.

 

TinyPortal © 2005-2018