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

Gnostice eDocEngine VCL Developer Guide
TgtPDFFormRadioButton Class

This class represents a radio button form field.

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

A radio button is a group of radio button items representing a single form field. 

Each radio button item represents a different value for the same form field, that is, the radio button. 

When a PDF form is submitted, the value of the selected radio button item will be submitted on behalf of the radio button.

gtExPDFEng

procedure TForm1.Demo_TgtPDFFormRadioButton;
var
  gtPDFFormRadioItem1, gtPDFFormRadioItem2: TgtPDFFormRadioItem;
  gtPDFFormRadioButton1: TgtPDFFormRadioButton;
  gtPDFFormPushButton1: TgtPDFFormPushButton;
  gtPDFEngine1: TgtPDFEngine;
begin
  gtPDFEngine1 := TgtPDFEngine.Create(Nil);

  // Create a radio button *item*
  gtPDFFormRadioItem1 := TgtPDFFormRadioItem.Create;
  gtPDFFormRadioItem1.Rect := gtRect(1, 1, 1.1, 1.1);
  gtPDFFormRadioItem1.Value := 'Tea';

  // Create anoter radio button *item*
  gtPDFFormRadioItem2 := TgtPDFFormRadioItem.Create;
  gtPDFFormRadioItem2.Rect := gtRect(2, 1, 2.1, 1.1);
  gtPDFFormRadioItem2.Value := 'Coffee';

  // Create a radio *button*
  gtPDFFormRadioButton1 := TgtPDFFormRadioButton.Create;
  gtPDFFormRadioButton1.FieldName := 'rbRefreshments';
  gtPDFFormRadioButton1.AtleastOneSelectedItem := True;
  gtPDFFormRadioButton1.Symbol := pfcsStar;

  // Add the radio button items to the radio button
  gtPDFFormRadioButton1.AddItem(gtPDFFormRadioItem1);
  gtPDFFormRadioButton1.AddItem(gtPDFFormRadioItem2);

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

    BeginDoc;
    TextOut(1, 0.8, 'Refreshments:');
    TextOut(1.2, 1, 'Tea');
    TextOut(2.2, 1, 'Coffee');
    // Add the form fields to current page
    AddFormItem(gtPDFFormRadioButton1);
    AddFormItem(gtPDFFormPushButton1);
    EndDoc;
  end;

end;

 


 

 


Properties
TgtPDFFormRadioButton Class
 
Name 
Description 
 
Specifies whether at least one radio button item needs to be selected. 
 
Specifies name of the form field. 
 
Font 
Specifies font used to display the contents of the form field. 
 
Specifies settings applicable to the form field. 
 
Specifies index of the selected radio button item. 
 
Specifies symbol used to display a selected radio button item in the radio button. 
Methods
TgtPDFFormRadioButton Class
 
Name 
Description 
 
Adds a specified radio button item to the radio button form field.