Class TfrmFormula

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TfrmFormula = class(TfrmCustomGoPhast)

Description

TfrmFormula provides a way for the user to edit formulas

Hierarchy

Overview

Fields

Implicit btn0: TButton;
Implicit btn1: TButton;
Implicit btn2: TButton;
Implicit btn3: TButton;
Implicit btn4: TButton;
Implicit btn5: TButton;
Implicit btn6: TButton;
Implicit btn7: TButton;
Implicit btn8: TButton;
Implicit btn9: TButton;
Implicit btnAnd: TButton;
Implicit btnCancel: TBitBtn;
Implicit btnCloseParen: TButton;
Implicit btnComma: TButton;
Implicit btnDecimal: TButton;
Implicit btnDiv: TButton;
Implicit btnDivide: TButton;
Implicit btnE: TButton;
Implicit btnEquals: TButton;
Implicit btnFalse: TButton;
Implicit btnFunctionHelp: TBitBtn;
Implicit btnGreaterOrEquals: TButton;
Implicit btnGreaterThan: TButton;
Implicit btnHelp: TBitBtn;
Implicit btnLessEquals: TButton;
Implicit btnLessThan: TButton;
Implicit btnMinus: TButton;
Implicit btnMod: TButton;
Implicit btnMultiply: TButton;
Implicit btnNot: TButton;
Implicit btnNotEqual: TButton;
Implicit btnOK: TBitBtn;
Implicit btnOpenParen: TButton;
Implicit btnOr: TButton;
Implicit btnPlus: TButton;
Implicit btnQuote: TButton;
Implicit btnSelectMatchParen: TButton;
Implicit btnTrue: TButton;
Implicit btnXor: TButton;
Implicit memoFormula: TMemo;
Implicit pnlBottom: TPanel;
Implicit pnlButtons: TPanel;
Implicit pnlLabelTree: TPanel;
Implicit pnlMain: TPanel;
Implicit pnlRight: TPanel;
Implicit rbFormulaParser: TRbwParser;
Implicit Splitter: TSplitter;
Implicit Timer: TTimer;
Implicit tvItems: TTreeView;
Private FDataSetGroupName: string;
Private FFunctionHelpString: string;
Private FFunctions: TTreeNode;
Private FLastButton: TButton;
Private FNewSelectionLength: integer;
Private FNewSelectionStart: integer;
Private FResultSet: boolean;

Methods

Implicit procedure btnFunctionHelpClick(Sender: TObject);
Implicit procedure btnOKClick(Sender: TObject);
Implicit procedure btnSelectMatchParenClick(Sender: TObject);
Implicit procedure buttonClick(Sender: TObject);
Implicit procedure FormCreate(Sender: TObject); override;
Implicit procedure FormShow(Sender: TObject);
Implicit procedure memoFormulaChange(Sender: TObject);
Implicit procedure memoFormulaDblClick(Sender: TObject);
Implicit procedure memoFormulaKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
Implicit procedure memoFormulaMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
Implicit procedure SplitterCanResize(Sender: TObject; var NewSize: Integer; var Accept: Boolean);
Implicit procedure TimerSetSelection(Sender: TObject);
Implicit procedure tvItemsItemClick(Sender: TObject; Button: TMouseButton; Node: TTreeNode; const Pt: TPoint);
Implicit procedure tvItemsItemDoubleClick(Sender: TObject; Node: TTreeNode);
Private function GetFormula: string;
Private procedure InsertText(const NewText: string);
Private procedure SetFormula(const Value: string);
Public procedure RemoveGIS_Functions;
Public procedure UpdateTreeList;

Properties

Public property DataSetGroupName: string read FDataSetGroupName write FDataSetGroupName;
Public property Formula: string read GetFormula write SetFormula;
Public property ResultSet: boolean read FResultSet;

Description

Fields

Implicit btn0: TButton;

btn0: TButton; btn0 is used to insert "0" in the formula.

Implicit btn1: TButton;

btn1: TButton; btn1 is used to insert "1" in the formula.

Implicit btn2: TButton;

btn2: TButton; btn2 is used to insert "2" in the formula.

Implicit btn3: TButton;

btn3: TButton; btn3 is used to insert "3" in the formula.

Implicit btn4: TButton;

btn4: TButton; btn4 is used to insert "4" in the formula.

Implicit btn5: TButton;

btn5: TButton; btn5 is used to insert "5" in the formula.

Implicit btn6: TButton;

btn6: TButton; btn6 is used to insert "6" in the formula.

Implicit btn7: TButton;

btn7: TButton; btn7 is used to insert "7" in the formula.

Implicit btn8: TButton;

btn8: TButton; btn8 is used to insert "8" in the formula.

Implicit btn9: TButton;

btn9: TButton; btn9 is used to insert "9" in the formula.

Implicit btnAnd: TButton;

btnAnd: TButton; btnAnd is used to insert "and" in the formula.

Implicit btnCancel: TBitBtn;

btnCancel: TBitBtn; btnCancel closes the dialog box and sets the ModalResult to mrCancel.

Implicit btnCloseParen: TButton;

btnCloseParen: TButton; btnCloseParen is used to insert ")" in the formula.

Implicit btnComma: TButton;

btnComma: TButton; btnComma is used to insert "," in the formula.

Implicit btnDecimal: TButton;

btnDecimal: TButton; btnDecimal is used to insert "." in the formula.

Implicit btnDiv: TButton;

btnDiv: TButton; btnDiv is used to insert "div" in the formula.

Implicit btnDivide: TButton;

btnDivide: TButton; btnDivide is used to insert "/" in the formula.

Implicit btnE: TButton;

btnE: TButton; btnE is used to insert "E" in the formula.

Implicit btnEquals: TButton;

btnEquals: TButton; btnEquals is used to insert "=" in the formula.

Implicit btnFalse: TButton;

btnFalse: TButton; btnFalse is used to insert "False" in the formula.

Implicit btnFunctionHelp: TBitBtn;

btnFunctionHelp: TBitBtn; See btnFunctionHelpClick.

Implicit btnGreaterOrEquals: TButton;

btnGreaterOrEquals: TButton; btnGreaterOrEquals is used to insert ">-" in the formula.

Implicit btnGreaterThan: TButton;

btnGreaterThan: TButton; btnGreaterThan is used to insert ">" in the formula.

Implicit btnHelp: TBitBtn;

btnHelp: TBitBtn; btnHelp shows help for the dialog box.

Implicit btnLessEquals: TButton;

btnLessEquals: TButton; btnLessEquals is used to insert "<=" in the formula.

Implicit btnLessThan: TButton;

btnLessThan: TButton; btnLessThan is used to insert "<" in the formula.

Implicit btnMinus: TButton;

btnMinus: TButton; btnMinus is used to insert "-" in the formula.

Implicit btnMod: TButton;

btnMod: TButton; btnMod is used to insert "mod" in the formula.

Implicit btnMultiply: TButton;

btnMultiply: TButton; btnMultiply is used to insert "*" in the formula.

Implicit btnNot: TButton;

btnNot: TButton; btnNot is used to insert "not" in the formula.

Implicit btnNotEqual: TButton;

btnNotEqual: TButton; btnNotEqual is used to insert "<>" in the formula.

Implicit btnOK: TBitBtn;

btnOK: TBitBtn; See btnOKClick.

Implicit btnOpenParen: TButton;

btnOpenParen: TButton; btnOpenParen is used to insert "(" in the formula.

Implicit btnOr: TButton;

btnOr: TButton; btnOr is used to insert "or" in the formula.

Implicit btnPlus: TButton;

btnPlus: TButton; btnPlus is used to insert "+" in the formula.

Implicit btnQuote: TButton;

btnQuote: TButton; btnQuote is used to insert '"" in the formula.

Implicit btnSelectMatchParen: TButton;

btnSelectMatchParen: TButton; See btnSelectMatchParenClick.

Implicit btnTrue: TButton;

btnTrue: TButton; btnTrue is used to insert "True" in the formula.

Implicit btnXor: TButton;

btnXor: TButton; btnXor is used to insert "xor" in the formula.

Implicit memoFormula: TMemo;

memoFormula: TMemo; memoFormula displays the formula.

Implicit pnlBottom: TPanel;

pnlBottom: TPanel; pnlBottom is the panel at the bottom of the dialog box.

Implicit pnlButtons: TPanel;

pnlButtons: TPanel; pnlButtons is the panel holding must of the buttons.

Implicit pnlLabelTree: TPanel;

pnlLabelTree labels tvItems.

Implicit pnlMain: TPanel;

pnlMain: TPanel; pnlMain holds pnlButtons and memoFormula. It is present to allow Splitter to work properly.

Implicit pnlRight: TPanel;

pnlRight holds tvItems and pnlLabelTree.

Implicit rbFormulaParser: TRbwParser;

rbFormulaParser: TRbwParser; rbFormulaParser is used to test the validity of the formula.

Implicit Splitter: TSplitter;

Splitter: TSplitter; Splitter allows the user to resize parts of the dialog box.

Implicit Timer: TTimer;

Timer: TTimer; Timer is used to allow for a slight delay before selecting text in memoFormula.

Implicit tvItems: TTreeView;

tvItems: TTreeView; tvItems displays the TDataArrays and functions that can be used in the formula.

Private FDataSetGroupName: string;

See DataSetGroupName

Private FFunctionHelpString: string;

FFunctionHelpString is the caption of the TTreeNode in tvItems that was last clicked. It is used to get context sensitive help on Functions displayed in tvItems.

Private FFunctions: TTreeNode;

FFunctions: TTreeNode; FFunctions is the parent TTreeNode that holds all the TTreeNodes for functions.

Private FLastButton: TButton;

FLastButton: TButton; FLastButton is set to the previous button that was clicked. It is used to help determine whether there should be spaces before the the text specified by the button.

Private FNewSelectionLength: integer;

FNewSelectionLength: integer; FNewSelectionLength specifies the length of the text that should be selected in memoFormulaDblClick.

Private FNewSelectionStart: integer;

FNewSelectionStart: integer; FNewSelectionStart specifies the start of the text that should be selected in memoFormulaDblClick.

Private FResultSet: boolean;

FResultSet: boolean; See ResultSet.

Methods

Implicit procedure btnFunctionHelpClick(Sender: TObject);

btnFunctionHelpClick shows help on the function that is selected in tvItems. See tvItemsItemClick.

Implicit procedure btnOKClick(Sender: TObject);

btnOKClick checks that the formula is valid. If so, it closes the dialog box and sets the ModalResult to mrOK. Otherwise, it disables the OK button.

Implicit procedure btnSelectMatchParenClick(Sender: TObject);

When a "(" or a ")" is selected, clicking btnSelectMatchParen will move to the matching ")" or "(". See memoFormulaMouseUp and memoFormulaKeyUp.

Implicit procedure buttonClick(Sender: TObject);

buttonClick is the OnClick event handler for most of the buttons in the dialog box. It inserts the caption of the button into the formula.

Implicit procedure FormCreate(Sender: TObject); override;

FormCreate initializes the TfrmFormula.

Implicit procedure FormShow(Sender: TObject);

FormShow calls memoFormula.SetFocus;

Implicit procedure memoFormulaChange(Sender: TObject);

memoFormulaChange enables the OK button.

Implicit procedure memoFormulaDblClick(Sender: TObject);

memoFormulaDblClick determines which a token in the formula should be selected and starts Timer. See TimerSetSelection.

Implicit procedure memoFormulaKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);

memoFormulaKeyUp enables btnSelectMatchParen when the selected text in memoFormula is a "(" or a ")".

Implicit procedure memoFormulaMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);

memoFormulaMouseUp enables btnSelectMatchParen when the selected text in memoFormula is a "(" or a ")".

Implicit procedure SplitterCanResize(Sender: TObject; var NewSize: Integer; var Accept: Boolean);

SplitterCanResize ensures that the splitter can't make pnlMain go below its minimum width.

Implicit procedure TimerSetSelection(Sender: TObject);

TimerSetSelection selects the text specified in memoFormulaDblClick and stops Timer.

Implicit procedure tvItemsItemClick(Sender: TObject; Button: TMouseButton; Node: TTreeNode; const Pt: TPoint);

tvItemsItemClick sets FFunctionHelpString to the Text of Node. FFunctionHelpString is then used in btnFunctionHelpClick.

Implicit procedure tvItemsItemDoubleClick(Sender: TObject; Node: TTreeNode);

tvItemsItemDoubleClick inserts the selected in in tvItems into the formula.

Private function GetFormula: string;

See Formula.

Private procedure InsertText(const NewText: string);

InsertText inserts NewText into the formula at the position of the selected text.

Private procedure SetFormula(const Value: string);

See Formula.

Public procedure RemoveGIS_Functions;

RemoveGIS_Functions sets rbFormulaParser so that only the functions set in TRbwParser.Functions by default are present. GIS functions and any other extra functions are removed.

Public procedure UpdateTreeList;

UpdateTreeList creates the nodes in tvItems.

Properties

Public property DataSetGroupName: string read FDataSetGroupName write FDataSetGroupName;

Name used in the TTreeNode that holds TCustomVariables in tvItems. By default, it is 'Data Sets'.

Public property Formula: string read GetFormula write SetFormula;

use Formula to read or set the formula.

Public property ResultSet: boolean read FResultSet;

ResultSet is set to true if the formula has been successfully changed.


Generated by PasDoc 0.10.0 on 2006-10-31 09:56:34