Procedure

TfrmConsults.popNoteMemoPopup

Module

fConsults

Last Modified

7/15/2014 3:26:34 PM

Visibility

Public/Published

Owner

TfrmConsults

Declaration

procedure popNoteMemoPopup(Sender: TObject);

Calls Hierarchy


TfrmConsults.popNoteMemoPopup
 └TfrmDrawers.CanEditTemplates
   └UserTemplateAccessLevel
     ├GetTemplateRoots
     └GetTemplateAccess

Calls

Name Declaration Comments
TfrmDrawers.CanEditTemplates function CanEditTemplates: boolean; -


Source

2718  procedure TfrmConsults.popNoteMemoPopup(Sender: TObject);
2719  begin
2720    inherited;
2721    if PopupComponent(Sender, popNoteMemo) is TCustomEdit
2722      then FEditCtrl := TCustomEdit(PopupComponent(Sender, popNoteMemo))
2723      else FEditCtrl := nil;
2724    if FEditCtrl <> nil then
2725     begin
2726      popNoteMemoCut.Enabled       := FEditCtrl.SelLength > 0;
2727      popNoteMemoCopy.Enabled      := popNoteMemoCut.Enabled;
2728      popNoteMemoPaste.Enabled     := (not TORExposedCustomEdit(FEditCtrl).ReadOnly) and
2729                                      Clipboard.HasFormat(CF_TEXT);
2730      popNoteMemoTemplate.Enabled  := frmDrawers.CanEditTemplates and popNoteMemoCut.Enabled;
2731      popNoteMemoFind.Enabled      := FEditCtrl.GetTextLen > 0;
2732     end
2733    else
2734     begin
2735      popNoteMemoCut.Enabled       := False;
2736      popNoteMemoCopy.Enabled      := False;
2737      popNoteMemoPaste.Enabled     := False;
2738      popNoteMemoTemplate.Enabled  := False;
2739     end;
2740    if pnlResults.Visible then
2741    begin
2742      popNoteMemoSpell.Enabled    := True;
2743      popNoteMemoGrammar.Enabled  := True;
2744      popNoteMemoReformat.Enabled := True;
2745      popNoteMemoReplace.Enabled  := (FEditCtrl.GetTextLen > 0);
2746      popNoteMemoPreview.Enabled  := (frmDrawers.TheOpenDrawer = odTemplates) and Assigned(frmDrawers.tvTemplates.Selected);
2747      popNoteMemoInsTemplate.Enabled  := (frmDrawers.TheOpenDrawer = odTemplates) and Assigned(frmDrawers.tvTemplates.Selected);
2748      popNoteMemoViewCslt.Enabled := (FEditNote.PkgPtr = PKG_CONSULTS);  //wat cq 17586
2749    end else
2750    begin
2751      popNoteMemoSpell.Enabled    := False;
2752      popNoteMemoGrammar.Enabled  := False;
2753      popNoteMemoReformat.Enabled := False;
2754      popNoteMemoReplace.Enabled  := False;
2755      popNoteMemoPreview.Enabled  := False;
2756      popNoteMemoInsTemplate.Enabled := False;
2757      popNoteMemoViewCslt.Enabled := FALSE; //wat cq 17586
2758    end;
2759  end;