I've been working on BROWSE compatibility, from code generated with IDE.
To make it work, I've added the following directives to hmg.ch:
Code: Select all
#xcommand INPUTITEMS <value> =>
#xcommand DISPLAYITEMS <value> =>
#xcommand VALIDMESSAGES <value> =>
#xcommand READONLYFIELDS <x> =>
Code: Select all
#xcommand VALID <valid> =>
#xcommand WHEN <when> =>
Regarding VALID and WHEN, these are used only by BROWSE in HMG3, so, putting it hmg3.ch, should give us backwards compatibility without creating any trouble for future VALID/WHEN implementations for other HMG4 widgets.
With this new directives, the application will compile ok, but will generate a runtime error:
This is the app ode:
Code: Select all
#include "hmg.ch"
Function Main
hbqt_errorsys()
HMG3(.T.)
Load Window Main
Main.Center
Main.Activate
Return
Code: Select all
* HMG-IDE Form Designer Generated Code
* (c) Roberto Lopez - http://sites.google.com/site/hmgweb
DEFINE WINDOW TEMPLATE AT 216 , 350 WIDTH 696 HEIGHT 394 VIRTUAL WIDTH Nil VIRTUAL HEIGHT Nil TITLE "Hello World!" ICON NIL MAIN CURSOR NIL ON INIT Nil ON RELEASE Nil ON INTERACTIVECLOSE Nil ON MOUSECLICK Nil ON MOUSEDRAG Nil ON MOUSEMOVE Nil ON SIZE Nil ON MAXIMIZE Nil ON MINIMIZE Nil ON PAINT Nil BACKCOLOR Nil NOTIFYICON NIL NOTIFYTOOLTIP NIL ON NOTIFYCLICK Nil ON GOTFOCUS Nil ON LOSTFOCUS Nil ON SCROLLUP Nil ON SCROLLDOWN Nil ON SCROLLLEFT Nil ON SCROLLRIGHT Nil ON HSCROLLBOX Nil ON VSCROLLBOX Nil
DEFINE BROWSE Browse_1
ROW 70
COL 230
WIDTH 193
HEIGHT 207
VALUE 0
WIDTHS {0}
HEADERS {''}
WORKAREA Nil
FIELDS {''}
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONDBLCLICK Nil
ALLOWEDIT .F.
ALLOWAPPEND .F.
ONHEADCLICK Nil
ALLOWDELETE .F.
HELPID Nil
VALID Nil
VALIDMESSAGES Nil
LOCK .F.
VSCROLLBAR .T.
DYNAMICBACKCOLOR Nil
DYNAMICFORECOLOR Nil
INPUTMASK Nil
FORMAT Nil
WHEN Nil
INPUTITEMS Nil
DISPLAYITEMS Nil
BACKCOLOR NIL
FONTCOLOR NIL
IMAGE Nil
JUSTIFY Nil
NOLINES .F.
READONLYFIELDS Nil
HEADERIMAGES Nil
END BROWSE
END WINDOW
TIA.