Procedure

TfrmSurgery.popNoteMemoPopup

Module

fSurgery

Last Modified

7/15/2014 3:26:38 PM

Visibility

Public/Published

Owner

TfrmSurgery

Declaration

procedure popNoteMemoPopup(Sender: TObject);

Calls Hierarchy


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

Calls

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


Source

1853  procedure TfrmSurgery.popNoteMemoPopup(Sender: TObject);
1854  begin
1855    inherited;
1856    if PopupComponent(Sender, popNoteMemo) is TCustomEdit
1857      then FEditCtrl := TCustomEdit(PopupComponent(Sender, popNoteMemo))
1858      else FEditCtrl := nil;
1859    if FEditCtrl <> nil then
1860    begin
1861      popNoteMemoCut.Enabled      := FEditCtrl.SelLength > 0;
1862      popNoteMemoCopy.Enabled     := popNoteMemoCut.Enabled;
1863      popNoteMemoPaste.Enabled    := (not TORExposedCustomEdit(FEditCtrl).ReadOnly) and
1864                                     Clipboard.HasFormat(CF_TEXT);
1865      popNoteMemoTemplate.Enabled := frmDrawers.CanEditTemplates and popNoteMemoCut.Enabled;
1866      popNoteMemoFind.Enabled := FEditCtrl.GetTextLen > 0;
1867    end else
1868    begin
1869      popNoteMemoCut.Enabled      := False;
1870      popNoteMemoCopy.Enabled     := False;
1871      popNoteMemoPaste.Enabled    := False;
1872      popNoteMemoTemplate.Enabled := False;
1873    end;
1874    if pnlWrite.Visible then
1875    begin
1876      popNoteMemoSpell.Enabled    := True;
1877      popNoteMemoGrammar.Enabled  := True;
1878      popNoteMemoReformat.Enabled := True;
1879      popNoteMemoReplace.Enabled  := (FEditCtrl.GetTextLen > 0);
1880      popNoteMemoPreview.Enabled  := (frmDrawers.TheOpenDrawer = odTemplates) and Assigned(frmDrawers.tvTemplates.Selected);
1881      popNoteMemoInsTemplate.Enabled  := (frmDrawers.TheOpenDrawer = odTemplates) and Assigned(frmDrawers.tvTemplates.Selected);
1882    end else
1883    begin
1884      popNoteMemoSpell.Enabled    := False;
1885      popNoteMemoGrammar.Enabled  := False;
1886      popNoteMemoReformat.Enabled := False;
1887      popNoteMemoReplace.Enabled  := False;
1888      popNoteMemoPreview.Enabled  := False;
1889      popNoteMemoInsTemplate.Enabled  := False;
1890    end;
1891  end;