|
From: Alex S. <ss...@mw...> - 2013-01-10 14:47:21
|
On 2013/01/10 02:37 PM, Alexander S.Kresin wrote:
> clauses are in these new commands. What is a most suitable way to
> provide compatibility is still an open question. For example, we can
> create a new .ch, where old SAY, BUTTON, GROUP commands will be related
> with new "ex" classes.
To allow using different classes with a command I did this (see CLASS
clause):
#xcommand @ <x>,<y> GET [ <oEdit> VAR ] <vari> ;
[ OF <oWnd> ] ;
[ ID <nId> ] ;
[ SIZE <width>, <height> ] ;
[ COLOR <color> ] ;
[ BACKCOLOR <bcolor> ] ;
[ PICTURE <cPicture> ] ;
[ WHEN <bGfocus> ] ;
[ VALID <bLfocus> ] ;
[<lPassword: PASSWORD>] ;
[ MAXLENGTH <nMaxLength> ] ;
[ STYLE <nStyle> ] ;
[<lnoborder: NOBORDER>] ;
[ FONT <oFont> ] ;
[ ON INIT <bInit> ] ;
[ TOOLTIP <ctoolt> ] ;
[ ON KEYDOWN <bKeyDown> ];
[ ON CHANGE <bChange> ] ;
[ ON CHANGE <bChange> ] ;
[ <class: CLASS> <classname> ] ;
=> ;
[<oEdit> := ] __IIF(<.class.>, <classname>, HEdit)():New(
<oWnd>,<nId>,<vari>, ;
{|v|Iif(v==Nil,<vari>,<vari>:=v)}, ;
<nStyle>,<x>,<y>,<width>,<height>,<oFont>,<bInit>,,, ;
<bGfocus>,<bLfocus>,<ctoolt>,<color>,<bcolor>,<cPicture>,;
<.lnoborder.>,<nMaxLength>,<.lPassword.>,<bKeyDown>, <bChange>)
It doesn't really help in your situation now but I always wished it was
implemented for all relevant commands because then you are free to
inherit from the HWGUI classes but you don't have to rewrite the command
to use your new class. In this way the EX versions need not have created
new commands unless they had new clauses.
--
Regards
Alex
|