Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type
- TSlackyLine = record
- Panel: TPanel;
- DropDowns: array[0..2] of TComboBox;
- end;
- var
- SlackyForm: TForm;
- SlackyButton: TButton;
- SlackyLines: array of TSlackyLine;
- procedure addSlackyLine(Self, Sender: TObject);
- var
- i: Int32;
- Line: TSlackyLine;
- begin
- Line.Panel.Init(SlackyForm);
- Line.Panel.setParent(SlackyForm);
- Line.Panel.SetAlign(alTop);
- for i := 0 to High(Line.DropDowns) do
- begin
- Line.DropDowns[i].Init(Line.Panel);
- Line.DropDowns[i].SetParent(Line.Panel);
- Line.DropDowns[i].SetAlign(alLeft);
- Line.DropDowns[i].GetItems().Add('Click This');
- Line.DropDowns[i].GetItems().Add('Click That');
- Line.DropDowns[i].GetItems().Add('Or Maybe This');
- Line.DropDowns[i].SetText('Click This');
- Line.DropDowns[i].SetWidth(100);
- Line.DropDowns[i].SetReadOnly(True);
- end;
- Line.Panel.setBevelOuter(bvNone);
- Line.Panel.setHeight(Line.DropDowns[0].GetHeight());
- SlackyLines += Line;
- end;
- procedure ShowSlackyForm;
- var
- i: Int32;
- begin
- SlackyForm.Init(nil);
- SlackyForm.setPosition(poScreenCenter);
- SlackyForm.setWidth(300);
- SlackyButton.Init(SlackyForm);
- SlackyButton.SetParent(SlackyForm);
- SlackyButton.SetAlign(alTop);
- SlackyButton.SetOnClick(@addSlackyLine);
- SlackyButton.SetCaption('Add Operation');
- SlackyForm.ShowModal();
- for i := 0 to High(SlackyLines) do
- begin
- Client.WriteLn(
- SlackyLines[i].DropDowns[0].GetText() + ', ' +
- SlackyLines[i].DropDowns[1].GetText() + ', ' +
- SlackyLines[i].DropDowns[2].GetText()
- );
- end;
- SlackyForm.Free();
- end;
- begin
- Sync(@ShowSlackyForm);
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement