About Browse Compatibility...

Moderator: Rathinagiri

Post Reply
User avatar
Roberto Lopez
HMG Founder
Posts: 3944
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 18 times
Been thanked: 143 times

About Browse Compatibility...

Post by Roberto Lopez » Sun Nov 27, 2011 11:13 pm

Francesco, Luigi,

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> =>
And this to hmg3.ch:

Code: Select all

#xcommand VALID		<valid>	=>
#xcommand WHEN		<when>	=>
Note that READONLYFIELDS definition was already in place, but, for some reason was not working (I've checked with .ppo). I've simply rewrote from the scratch and it worked fine.

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:
Image1.jpg
Image1.jpg (65.36 KiB) Viewed 1409 times
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

At first, I ask if someone can upload the required directives for me, I'll appreciate it greatly and if is possible, take a look at the runtime error generated.

TIA.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

mrduck
Posts: 497
Joined: Fri Sep 10, 2010 5:22 pm

Post by mrduck » Sun Nov 27, 2011 11:22 pm

[quote]
And this to hmg3.ch:

Code: Select all

#xcommand VALID		<valid>	=>
#xcommand WHEN		<when>	=>

You told previously that VALID/WHEN in this case are the same of COLUMNVALID/COLUMNWHEN and since they are implemented in HMG4 I'd put them to work...

User avatar
Roberto Lopez
HMG Founder
Posts: 3944
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 18 times
Been thanked: 143 times

Post by Roberto Lopez » Sun Nov 27, 2011 11:58 pm

mrduck wrote:
And this to hmg3.ch:

Code: Select all

#xcommand VALID		<valid>	=>
#xcommand WHEN		<when>	=>

You told previously that VALID/WHEN in this case are the same of COLUMNVALID/COLUMNWHEN and since they are implemented in HMG4 I'd put them to work...
Maybe I've was not clear, since my English is not good...

I've created BROWSE in a very early experimental stage of MiniGUI library.

In that moment VALID and WHEN appeared to be correct denominations for column pre and post validation.

Across time, become clear that it was confusing for some users (they were right :) ) so when I've added GRID, I've used COLUMNWHEN and COLUMNVALID instead.

I've kept the VALID/WHEN denominations for BROWSE since there were hundreds of users at that moment that could be affected by the change.

Adding WHEN and VALID in hmg3.ch now, is intended to make code generated by IDE work without modifications.

I hope that I'm be more clear now.

Thanks again for your help on this.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

mrduck
Posts: 497
Joined: Fri Sep 10, 2010 5:22 pm

Post by mrduck » Mon Nov 28, 2011 12:31 am

Committed.

Please read changelog

User avatar
Roberto Lopez
HMG Founder
Posts: 3944
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 18 times
Been thanked: 143 times

Post by Roberto Lopez » Mon Nov 28, 2011 12:47 am

mrduck wrote:Committed.

Please read changelog
Thanks!
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
Roberto Lopez
HMG Founder
Posts: 3944
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 18 times
Been thanked: 143 times

Post by Roberto Lopez » Mon Nov 28, 2011 1:02 am

Francesco,

Now, another runtime error arises:
Image1.jpg
Image1.jpg (47.98 KiB) Viewed 1395 times
The sample app. still the same.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

mrduck
Posts: 497
Joined: Fri Sep 10, 2010 5:22 pm

Post by mrduck » Mon Nov 28, 2011 11:38 am

Now it should work
Roberto Lopez wrote:Francesco,

Now, another runtime error arises:

The sample app. still the same.

User avatar
Roberto Lopez
HMG Founder
Posts: 3944
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 18 times
Been thanked: 143 times

Post by Roberto Lopez » Mon Nov 28, 2011 12:48 pm

mrduck wrote:Now it should work
Roberto Lopez wrote:Francesco,

Now, another runtime error arises:

The sample app. still the same.
It is working now.

Thanks.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
Roberto Lopez
HMG Founder
Posts: 3944
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 18 times
Been thanked: 143 times

Post by Roberto Lopez » Mon Nov 28, 2011 12:55 pm

Francesco,

From the 24 controls included in latest release of IDE.4 there is only one generating a runtime error: the animatebox.

This is the error:
Image1.jpg
Image1.jpg (46.5 KiB) Viewed 1369 times
This is the app code:

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 147 , 415 WIDTH 579 HEIGHT 304 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 ANIMATEBOX Animate_1
        ROW    110
        COL    160
        WIDTH  210
        HEIGHT 60
        FILE ""
        HELPID Nil
        TRANSPARENT .F.
        AUTOPLAY .F.
        CENTER .F.
    END ANIMATEBOX

END WINDOW

Thanks for your help on this.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

Post Reply