How to use the shortcut keys in Host+dll mode
Recently in a Host+dll plug-in system, each DLL module inherits a base class module Tbaseform, and then the base class module defines the F1, delete F2, change F3, check F4 and other functions, each function defines a shortcut key,
On the main program side through Pagecontrol to load each DLL module, the problem is, when I open more than one module, when I press F1, the system call is not my current active Tabsheet module, but the first open module of the new
function, the original shortcut key was registered after the first module, the module after the re-registration is invalid. Later thought of a method, is again Tabsheet Onhide event in the current module of the shortcut key cancellation, in the OnShow event
Then the current module of the shortcut key Association, after testing success!!! , the following is part of the code:
1 procedureTbaseform.bidingshortcut;//binding shortcut keys 2 begin 3Al_new. Shortcut:=texttoshortcut ('F5'); 4Al_edit. Shortcut:=texttoshortcut ('F6'); 5Al_Delete. Shortcut:=texttoshortcut ('F7'); 6Al_refdata. Shortcut:=texttoshortcut ('F8'); 7Al_query. Shortcut:=texttoshortcut ('F3'); 8Al_report. Shortcut:=texttoshortcut ('F2'); 9Al_Export. Shortcut:=texttoshortcut ('F10'); TenAl_import. Shortcut:=texttoshortcut ('F4'); OneAl_gridset. Shortcut:=texttoshortcut ('F9'); A End; - - procedureTbaseform.unbidingshortcut;//unbind shortcut keys the begin -Al_new. Shortcut:=texttoshortcut ('None'); -Al_edit. Shortcut:=texttoshortcut ('None'); -Al_Delete. Shortcut:=texttoshortcut ('None'); +Al_refdata. Shortcut:=texttoshortcut ('None'); -Al_query. Shortcut:=texttoshortcut ('None'); +Al_report. Shortcut:=texttoshortcut ('None'); AAl_Export. Shortcut:=texttoshortcut ('None'); atAl_import. Shortcut:=texttoshortcut ('None'); -Al_gridset. Shortcut:=texttoshortcut ('None'); - End;
The Onhide and OnShow in the host program are then called Unbidingshortcut and Bidingshortcut respectively.
There is a base class conversion process, because I saved the current form in Tabsheet's tag beforehand, so just make the following conversions:
Tbaseform (Tabsheet.tag). Bidingshourtcut can do it.
The above describes how to use the shortcut keys in the Host+dll mode, including the use of shortcut keys, I hope the PHP tutorial interested in a friend helpful.