eDocEngine VCL Professional Help » Symbol Reference » Namespaces of Helper Classes » gtExPDFEng Namespace » TgtPDFFormListBox Class

Gnostice eDocEngine VCL Developer Guide
TgtPDFFormListBox Class

This class represents a list box form field.

Pascal
public TgtPDFFormListBox = class(TgtPDFFormField);
C++
public: class TgtPDFFormListBox : public TgtPDFFormField;
Description

A list box provides a list of options, several of which are visible without scrolling the list.

gtExPDFEng

procedure TForm1.Demo_TgtPDFFormListBox;
var
  gtPDFFormListBox1, gtPDFFormListBox2: TgtPDFFormListBox;
  gtPDFFormPushButton1: TgtPDFFormPushButton;
  gtPDFEngine1: TgtPDFEngine;
begin
  gtPDFEngine1 := TgtPDFEngine.Create(Nil);

  // Create a list box form field
  gtPDFFormListBox1 := TgtPDFFormListBox.Create;
  gtPDFFormListBox1.Rect := gtRect(1, 1, 3, 1.5);
  gtPDFFormListBox1.FieldName := 'lbFruit';
  gtPDFFormListBox1.AddItem('Apples');
  gtPDFFormListBox1.AddItem('Oranges');
  gtPDFFormListBox1.AddItem('Pineapple');
  gtPDFFormListBox1.AddItem('Grapes');
  gtPDFFormListBox1.IsSortList := True;
  gtPDFFormListBox1.IsMultiSelect := True;

  // Create a push button form field
  gtPDFFormPushButton1 := TgtPDFFormPushButton.Create;
  gtPDFFormPushButton1.Rect := gtRect(1, 2, 2, 2.3);
  gtPDFFormPushButton1.FieldName := 'pbSubmit';
  gtPDFFormPushButton1.BorderColor := clGray;
  gtPDFFormPushButton1.NormalCaption := 'Submit Order';
  gtPDFFormPushButton1.RolloverCaption := 'Submit Order';
  gtPDFFormPushButton1.DownCaption := 'Submit Order';
  gtPDFFormPushButton1.SubmitURL :=
    'http://www.gnostice.com/newsletters/demos/200804/forms_test.asp';
  gtPDFFormPushButton1.Action := pbaSubmit;

  with gtPDFEngine1 do
  begin
    Preferences.ShowSetupDialog := False;
    Preferences.OpenAfterCreate := True;
    FileName := 'listbox_formfield.pdf';

    BeginDoc;
    TextOut(1, 0.8, 'Select a fruit:');
    // Add form fields to current page
    AddFormItem(gtPDFFormListBox1);
    AddFormItem(gtPDFFormPushButton1);
    EndDoc;
  end;
end;

 

 

 

Properties
TgtPDFFormListBox Class
 
Name 
Description 
 
Specifies background color of the form field. 
 
Specifies border color of the form field. 
 
Specifies name of the form field. 
 
Font 
Specifies font used to display the contents of the form field. 
 
Specifies whether multiple options can be selected from the list. 
 
Specifies whether the list of options is sorted and then displayed by viewer applications. 
 
Specifies settings applicable to the form field. 
 
Rect 
Specifies location on the page where the form field is displayed. 
Methods
TgtPDFFormListBox Class
 
Name 
Description 
 
Adds specified option to the list box.