Procedure

TfrmODGen.PlaceLookup

Module

fODGen

Last Modified

7/15/2014 3:26:42 PM

Visibility

Private

Owner

TfrmODGen

Declaration

procedure PlaceLookup(DialogCtrl: TDialogCtrl; DialogItem: TDialogItem; CurrentItemNumber: Integer);

Calls Hierarchy


TfrmODGen.PlaceLookup
 ├GlobalRefForFile
 ├TfrmODGen.SetComponentName
 ├GetDefaultTSForEvt
 ├GetTSListForEvt
 ├TfrmODGen.LookupNeedData
 │ └SubsetOfEntries
 ├TfrmODGen.ControlChange
 │ ├TResponses.Update
 │ │ ├TResponses.FindResponseByName
 │ │ └TResponses.IENForPrompt
 │ └TResponses.GetOrderText
 │   ├TResponses.NextInstance
 │   ├TResponses.FindResponseByName
 │   ├TResponses.FormatResponse
 │   │ └TResponses.FindResponseByIEN
 │   └TResponses.AppendChildren
 │     ├TResponses.FindPromptByIEN
 │     ├TResponses.FindResponseByIEN
 │     └TResponses.FormatResponse...
 └TfrmODGen.PlaceLabel

Called-By Hierarchy


      TfrmODGen.PlaceLookup
  TfrmODGen.PlaceControls┘ 
 TfrmODGen.SetDialogIEN┘   
TfrmODGen.SetupDialog┘     

Calls

Name Declaration Comments
TfrmODGen.ControlChange procedure ControlChange(Sender: TObject); -
GetDefaultTSForEvt function GetDefaultTSForEvt(AnEvtID: integer): string; -
GetTSListForEvt procedure GetTSListForEvt(Dest: TStrings; AnEvtID:integer); -
GlobalRefForFile function GlobalRefForFile(const FileID: string): string; -
TfrmODGen.LookupNeedData procedure LookupNeedData(Sender: TObject; const StartFrom: string; Direction, InsertAt: Integer); -
TfrmODGen.PlaceLabel procedure PlaceLabel(DialogCtrl: TDialogCtrl; DialogItem: TDialogItem); -
TfrmODGen.SetComponentName procedure SetComponentName(Editor: TWinControl; Index: Integer; DialogCtrl: TDialogCtrl); -

Called-By

Name Declaration Comments
TfrmODGen.PlaceControls procedure PlaceControls; -


Source

481   procedure TfrmODGen.PlaceLookup(DialogCtrl: TDialogCtrl; DialogItem: TDialogItem; CurrentItemNumber: Integer);
482   const
483     NUM_CHAR = 32;
484   var
485     idx,defidx,evtChars: integer;
486     GblRef, XRef: string;
487     TopTSList: TStringList;
488   begin
489     with DialogCtrl do
490     begin
491       GblRef := DialogItem.Domain;
492       if CharAt(GblRef, 1) in ['0'..'9','.']
493         then GblRef := GlobalRefForFile(Piece(GblRef, ':', 1))
494         else GblRef := Piece(GblRef, ':', 1);
495       if CharAt(GblRef, 1) <> U then GblRef := U + GblRef;
496       if Length(DialogItem.CrossRef) > 0 then XRef := DialogItem.CrossRef else XRef := 'B';
497       XRef := GblRef + '"' + XRef + '")';
498       Editor := TORComboBox.Create(Self);
499       Editor.Parent := sbxMain;
500       TORComboBox(Editor).Style := orcsDropDown;
501       TORComboBox(Editor).ListItemsOnly := True;
502       TORComboBox(Editor).Pieces := '2';
503       TORComboBox(Editor).LongList := True;
504        SetComponentName(Editor, CurrentItemNumber, DialogCtrl);
505      // TORComboBox(Editor).Name := DialogCtrl.ID + IntToStr(CurrentItemNumber);
506       // 2nd bar piece of hint is not visible, hide xref, global ref, & screen code in tab pieces
507       TORComboBox(Editor).RpcCall := DialogItem.HelpText + '|' + XRef + #9 + GblRef + #9 +
508                                   DialogItem.ScreenRef;
509       if ( compareText(TsID,DialogItem.Id)=0 ) or (compareText(TSDomain,DialogItem.Domain)=0)then
510       begin
511         TopTSList := TStringList.Create;
512         DialogItem.IDefault := Piece(GetDefaultTSForEvt(Self.EvtID),'^',1);
513         GetTSListForEvt(TStrings(TopTSList),Self.EvtID);
514         if TopTSList.Count > 0 then
515         begin
516           if Length(DialogItem.IDefault)>0 then
517           begin
518             defidx := -1;
519             for idx := 0 to topTSList.Count - 1 do
520               if Piece(TopTSList[idx],'^',1)= DialogItem.IDefault then
521               begin
522                 defidx := idx;
523                 break;
524               end;
525             if defidx >= 0 then
526               topTSList.Move(defidx,0);
527           end;
528           with TORComboBox(Editor) do
529           begin
530             FastAddStrings(TStrings(TopTSList), TORComboBox(Editor).Items);
531             LongList := false;
532           end;
533         end else
534           TORComboBox(Editor).OnNeedData := LookupNeedData;
535         if Length(DialogItem.IDefault)<1 then
536           DialogItem.IDefault := '0';
537       end else
538         TORComboBox(Editor).OnNeedData := LookupNeedData;
539       Editor.SetBounds(FEditorLeft, FEditorTop, NUM_CHAR * FCharWd, HT_FRAME * FCharHt);
540       TORComboBox(Editor).InitLongList(DialogItem.EDefault);
541       TORComboBox(Editor).SelectByID(DialogItem.IDefault);
542       if Length(DialogItem.HelpText) > 0 then TORComboBox(Editor).ShowHint := True;
543       TORComboBox(Editor).OnChange := ControlChange;
544       if ( AnsiCompareText(ID,'EVENT')=0 ) and (Self.EvtID>0)then
545       begin
546          evtChars := length(Responses.EventName);
547          if evtChars > NUM_CHAR then
548             Editor.SetBounds(FEditorLeft, FEditorTop, (evtChars + 6) * FCharWd, HT_FRAME * FCharHt);
549          TORComboBox(Editor).Enabled := False;
550       end;
551       PlaceLabel(DialogCtrl, DialogItem);
552       FEditorTop := FEditorTop + HT_FRAME + FCharHt + HT_SPACE;
553     end;
554   end;