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

Gnostice eDocEngine VCL Developer Guide
TgtPDFFormComboBox Class

This class represents a combo box form field.

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

A combo box provides a drop-down list of options.

gtExPDFEng

procedure TForm1.Demo_TgtPDFFormComboBox;
var
  gtPDFFormComboBox1: TgtPDFFormComboBox;
  gtPDFFormPushButton1: TgtPDFFormPushButton;
  gtPDFEngine1: TgtPDFEngine;
begin
  gtPDFEngine1 := TgtPDFEngine.Create(Nil);
  // Create a combo box form field
  gtPDFFormComboBox1 := TgtPDFFormComboBox.Create;
  gtPDFFormComboBox1.Rect := gtRect(1, 1, 3, 1.3);
  gtPDFFormComboBox1.FieldName := 'cmbFruit';
  gtPDFFormComboBox1.AddItem('Apples');
  gtPDFFormComboBox1.AddItem('Oranges');
  gtPDFFormComboBox1.AddItem('Pineapple');
  gtPDFFormComboBox1.AddItem('Grapes');
  gtPDFFormComboBox1.IsEditable := True;
  gtPDFFormComboBox1.IsSortList := True;
  gtPDFFormComboBox1.SelectedItemIndex := 0; // First option selected

  // 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 := 'combobox_formfield.pdf';

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





Properties
TgtPDFFormComboBox 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 the list of options is editable. 
 
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. 
 
Specifies index of the selected option. 
Methods
TgtPDFFormComboBox Class
 
Name 
Description 
 
Adds specified option to the combo box.