Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Other possibilities:</p> <ol> <li><p>Use available experts functionalities:</p> <ul> <li>Use CnPack Property Corrector and define action that prompt you on specified component drop.</li> <li>Use GExperts Rename/Replace Components futures (required implementation of your custom controls)<br/><br/></li> </ul></li> <li><p>Most complicated - implement TForm descendant witch <a href="http://www.delphidabbler.com/tips/76" rel="nofollow">design time drag and drop</a> and modify dropped controls PupupMenu property.</p></li> <li><p><p>Ugly but flexible and without any descendant controls implementation - use below procedure:<br/></p> <ul> <li>CustomizePopupMenu(Form, [TEdit, TMemo], MyPopupMenu)<br/></li> <li>CustomizePopupMenu(AnyForm, [TEdit, TMemo], AnyPopupMenu)<br/></p></li> </ul></li> </ol> <hr> <pre><code>procedure CustomizePopupMenu( const aCtrl: TWinControl; const aClasses: array of TControlClass; const aPopUp: TPopupMenu); procedure Process(const aCtrl: TWinControl; const aClasses: array of TControlClass; const aPopUp: TPopupMenu); procedure Match(const aCtrl: TControl; const aClasses: array of TControlClass; const aPopUp: TPopupMenu); var Ix: Integer; begin for Ix := Low(aClasses) to High(aClasses) do begin if aCtrl.InheritsFrom(aClasses[Ix]) then aCtrl.PopupMenu:= aPopUp; end; end; var Ix: Integer; Ctrl: TControl; begin for Ix := 0 to Pred(aCtrl.ControlCount) do begin if aCtrl.Controls[Ix] is TWinControl then Process(TWinControl(aCtrl.Controls[Ix]), aClasses, aPopUp); Match(aCtrl.Controls[Ix], aClasses, aPopUp) end; end; begin if (aCtrl &lt;&gt; nil) and (Length(aClasses) &gt; 0) and (aPopUp &lt;&gt; nil) then Process(aCtrl, aClasses, aPopUp) end; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload