Form designer HMG.4 compatibility issues...

Moderator: Rathinagiri

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

Form designer HMG.4 compatibility issues...

Post by Roberto Lopez » Mon Nov 21, 2011 3:02 am

Francesco, Luigi, Rathinagiri,

I've tested all the controls with the IDE form designer generated code and found the following:

- GRID and BROWSE: generates a syntax error

Code: Select all

    DEFINE GRID Grid_1
        ROW    40
        COL    50
        WIDTH  120
        HEIGHT 120
        ITEMS { {""} }
        VALUE Nil
        WIDTHS { 0 }
        HEADERS {''}
        FONTNAME "Arial"
        FONTSIZE 9
        TOOLTIP ""
        ONCHANGE Nil
        ONGOTFOCUS Nil
        ONLOSTFOCUS Nil
        FONTBOLD .F.
        FONTITALIC .F.
        FONTUNDERLINE .F.
        FONTSTRIKEOUT .F.
        ONDBLCLICK Nil
        ONHEADCLICK Nil
        ONQUERYDATA Nil
        MULTISELECT .F.
        ALLOWEDIT .F.
        VIRTUAL .F.
        DYNAMICBACKCOLOR Nil
        DYNAMICFORECOLOR Nil
        COLUMNWHEN Nil
        COLUMNVALID Nil
        COLUMNCONTROLS Nil
        SHOWHEADERS .T.
        CELLNAVIGATION .F.
        NOLINES .F.
        HELPID Nil
        IMAGE Nil
        JUSTIFY Nil
        ITEMCOUNT Nil
        BACKCOLOR Nil
        FONTCOLOR Nil
        HEADERIMAGES Nil
        ROWSOURCE Nil
        COLUMNFIELDS Nil
        ALLOWAPPEND .F.
        ALLOWDELETE .F.
        BUFFERED .F.  <<<<-------SYNTAX ERROR HERE
        DYNAMICDISPLAY Nil
        ONSAVE Nil
        LOCKCOLUMNS Nil
    END GRID

Code: Select all

    DEFINE BROWSE Browse_1
        ROW    90
        COL    220
        WIDTH  120
        HEIGHT 120
        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 <<<<-------SYNTAX ERROR HERE
        VALIDMESSAGES Nil
        LOCK .F.
        VSCROLLBAR .T.
        DYNAMICBACKCOLOR Nil
        DYNAMICFORECOLOR Nil
        INPUTMASK Nil
        FORMAT Nil
        WHEN Nil <<<<-------SYNTAX ERROR HERE
        INPUTITEMS Nil
        DISPLAYITEMS Nil
        BACKCOLOR Nil
        FONTCOLOR Nil
        IMAGE Nil
        JUSTIFY Nil
        NOLINES .F.
        READONLYFIELDS Nil <<<<-------SYNTAX ERROR HERE
        HEADERIMAGES Nil
    END BROWSE
-RADIOGROUP: 'Spacing' property is creating problems. I guess that it should be temporarily disabled.

- PLAYER, ACTIVEX and RICHEDITBOX: generates a syntax error (they are not implemented). AFAIR there is not support in QT for that. If so, I can eliminate them from form designer definitively.

- COMBOBOX: In WIN32 API, Combobox height refers to the control with the dropdown list visible. The upper part height is set by the system. By the other hand, QT interprets the height as the upper part one, giving us (with the default form designer height) an unusable combo. IMHO height property should be temporarily disabled for it.
Image1.jpg
Image1.jpg (9.86 KiB) Viewed 1592 times
All other controls compiled and ran well, exactly as they were created by the form designer (no modifications in code or property values).

I hope that this info be useful.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

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

Post by mrduck » Mon Nov 21, 2011 11:05 am

Roberto Lopez wrote:

Code: Select all

    DEFINE GRID Grid_1
        BUFFERED .F.  <<<<-------SYNTAX ERROR HERE
What is it for ? Anyway to compile add

Code: Select all

   #xcommand BUFFERED     <value>   =>  

Code: Select all

    DEFINE BROWSE Browse_1
        VALID Nil <<<<-------SYNTAX ERROR HERE
        WHEN Nil <<<<-------SYNTAX ERROR HERE
        READONLYFIELDS Nil <<<<-------SYNTAX ERROR HERE

If VALID/WHEN are the equivalent of COLUMNVALID/WHEN (there are already them as oneliner)

Code: Select all

   #xcommand VALID         <value>   =>   :ColumnValid         := <value>
   #xcommand WHEN          <value>   =>   :ColumnWhen          := <value>
READONLYFIELDS: what is it for ? as READONLY ? see above...
-RADIOGROUP: 'Spacing' property is creating problems. I guess that it should be temporarily disabled.
It may be overridden at radiogroup with an empty body.
- PLAYER, ACTIVEX and RICHEDITBOX: generates a syntax error (they are not implemented). AFAIR there is not support in QT for that. If so, I can eliminate them from form designer definitively.
ACTIVEX: remove. HMG4 supports all the platforms supported by hbQt, so we can't use s.o. specific calls. Everybody ok ?

PLAYER: there is a player inside Qt. I never used it. please keep the button but disable it.

RICHEDITBOX: well, Qt has a full blown editor inside, we just need to create a layer around it... see hbIde editor !!! any volunteer ? Keep, disabled.
- COMBOBOX: In WIN32 API, Combobox height refers to the control with the dropdown list visible. The upper part height is set by the system. By the other hand, QT interprets the height as the upper part one, giving us (with the default form designer height) an unusable combo. IMHO height property should be temporarily disabled for it.
As spacing for radiogroups.


Probably I could do quicker doing the changes in the svn, but I wanted to keep track so that everybody could read and say their ideas. I can't commit now, I will do in the evening.

Francesco

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

Post by Roberto Lopez » Mon Nov 21, 2011 12:36 pm

mrduck wrote: As spacing for radiogroups.


Probably I could do quicker doing the changes in the svn, but I wanted to keep track so that everybody could read and say their ideas. I can't commit now, I will do in the evening.

Francesco
Ok.

I could fixed that, but, since I have not enough free time to take care of my commits, I prefer that someone more involved with day to day work in the project, do it.

Thanks in advance.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Post by l3whmg » Mon Nov 21, 2011 4:23 pm

Hi Roberto
About
Roberto Lopez wrote:- COMBOBOX: In WIN32 API, Combobox height refers to the control with the dropdown list visible. The upper part height is set by the system. By the other hand, QT interprets the height as the upper part one, giving us (with the default form designer height) an unusable combo. IMHO height property should be temporarily disabled for it.
I think it is impossible to "disable".

With QT there is MaxVisibleItmes:
from http://doc.qt.nokia.com/stable/qcombobo ... Items-prop
This property holds the maximum allowed size on screen of the combo box, measured in items.
By default, this property has a value of 10.
Note: This property is ignored for non-editable comboboxes in styles that returns false for QStyle::SH_ComboBox_Popup such as the Mac style or the Gtk+ Style.
So we can add a new property (ie MaxItems) and we can use this as meaning of "height".

Theoretically, there isn't problem with "one line" translated commands, because we can coding (only for combobox)

Code: Select all

"[:MaxItems := <Height>];;"
.

IMHO, I think it's dangerous and wrong (or to avoid) for two other reasons:
1) With "alternate syntax" we can't code, at the same times, two commands with different related method:

Code: Select all

#xcommand HEIGHT <value> => :Height := <value>
#xcommand HEIGHT <value> => :MaxItems := <value>
2) On the other hand, Height means "height": normally pixel and it's one of the two dimensions of the object and it's a basis property.

Cheers
Luigi from Italy
www.L3W.it

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

Post by Roberto Lopez » Mon Nov 21, 2011 6:03 pm

l3whmg wrote:Hi Roberto
About
Roberto Lopez wrote:- COMBOBOX: In WIN32 API, Combobox height refers to the control with the dropdown list visible. The upper part height is set by the system. By the other hand, QT interprets the height as the upper part one, giving us (with the default form designer height) an unusable combo. IMHO height property should be temporarily disabled for it.
I think it is impossible to "disable".

<...>
So, my question now is, if there is a possibility to give to the 'height' property of Combo in HMG.4, the same meaning as in WIN32 API (at least for HMG3 compatibility mode)?

And, the same for 'Spacing' radiogroup PROPERTY.

In HMG 2.x and 3.x its meaning is very clear (it is the distance between options) but in HMG.4 it is apparently not working so, creating compatibility problems too.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Post by l3whmg » Mon Nov 21, 2011 7:10 pm

Hi Roberto.
I understand your POW.
Cheers
Luigi from Italy
www.L3W.it

Post Reply