Page 1 of 1

About ComboBox Compatibility...

Posted: Sun Nov 27, 2011 10:17 pm
by Roberto Lopez
Francesco, Luigi,

I'm testing Combo height property compatibility and I've found that it appears to be not working, even when the height method is overloaded to allow HMG3 compatibility.

I'm sure that I'm missing something, but I'm not able to found what the problem is.

This is the 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 216 , 350 WIDTH 696 HEIGHT 215 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 COMBOBOX Combo_1
        ROW    30
        COL    260
        WIDTH  100
        HEIGHT 100
        ITEMS {""}
        VALUE 0
        FONTNAME "Arial"
        FONTSIZE 9
        TOOLTIP ""
        ONCHANGE Nil
        ONGOTFOCUS Nil
        ONLOSTFOCUS Nil
        FONTBOLD .F.
        FONTITALIC .F.
        FONTUNDERLINE .F.
        FONTSTRIKEOUT .F.
        HELPID Nil
        TABSTOP .T.
        VISIBLE .T.
        SORT .F.
        ONENTER Nil
        ONDISPLAYCHANGE Nil
        DISPLAYEDIT .F.
        IMAGE Nil
        DROPPEDWIDTH Nil
        ONDROPDOWN Nil
        ONCLOSEUP Nil
    END COMBOBOX

END WINDOW

TIA.

Re: About ComboBox Compatibility...

Posted: Sun Nov 27, 2011 10:23 pm
by Roberto Lopez
and...

This is the resulting app.

As you can see, the height property is not ignored...
Image1.jpg
Image1.jpg (58.37 KiB) Viewed 3269 times

Re: About ComboBox Compatibility...

Posted: Mon Nov 28, 2011 2:31 pm
by Roberto Lopez
Francesco,

I've made a little test about combo height in HMG3 compatibility mode:

Code: Select all

/*..............................................................................
   Height: overloaded since has different meanings from hmg3()
..............................................................................*/
METHOD Height( nArg1 ) CLASS COMBOBOX

   IF HMG3()  // hmg3 compatibility mode
      // do nothing with Height
   ELSE
	IF PCOUNT() == 1 .AND. hb_IsNumeric( nArg1 )
	      	Super:Height( nArg1 )
		MsgInfo('Combo Height Set!')
   	ENDIF
   ENDIF

RETURN Self
Then, compiled again the sample in the first message in this thread, and strangely, this was the result:
Image1.jpg
Image1.jpg (30.28 KiB) Viewed 3251 times
So, HMG3() is returning .F. in combo's height method even when HMG3(.T.) is invoked.

Re: About ComboBox Compatibility...

Posted: Mon Nov 28, 2011 2:54 pm
by mrduck
Yes, this is a known bug !

hmg3() lowercase...

HMG3 uppercase is rewritten with the #define HMG3...

it has to be changed !

hmg3_compatibility( .T. )

I will do this evening

sorry but yesterday night was too late...

Re: About ComboBox Compatibility...

Posted: Mon Nov 28, 2011 5:02 pm
by Roberto Lopez
mrduck wrote:Yes, this is a known bug !

hmg3() lowercase...

HMG3 uppercase is rewritten with the #define HMG3...

it has to be changed !

hmg3_compatibility( .T. )

I will do this evening

sorry but yesterday night was too late...
Ok.

No problem, it was too late for me too, but today is a non-working day here, so I'm dedicating it to compatibility tests :)

Thanks!

Re: About ComboBox Compatibility...

Posted: Mon Nov 28, 2011 5:47 pm
by Roberto Lopez
mrduck wrote:Yes, this is a known bug !
<...>
it has to be changed !
hmg3_compatibility( .T. )
I will do this evening
I've already done and committed.

Apparently it has not side effects and is working fine for combo.

Thanks again.