On Saturday 27 May 2017 11:30:38 Ryan Joseph wrote:
>
> can you show an example of this? Just curious.
>
In MSEgui most of the public widget methods an method properties use this 
approach.
"
type
 keyeventinfoty = record
  eventkind: eventkindty;
  key,keynomod: keyty;
  chars: msestring;
  shiftstate: shiftstatesty;
  eventstate: eventstatesty;
  timestamp: longword; //usec
 end;
[...]
 twidget = class(tactcomponent,iscrollframe,iface,iassistiveclient)
[...]
   procedure dokeydown(var info: keyeventinfoty); virtual;
"
"
type
 tactionwidget = class(twidget)
[...]
   property onkeydown: keyeventty read fonkeydown write fonkeydown;

"
https://gitlab.com/mseide-msegui/mseide-msegui/blob/master/lib/common/kernel/msegui.pas
https://gitlab.com/mseide-msegui/mseide-msegui/blob/master/lib/common/widgets/msewidgets.pas

Martin
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to