Page 1 of 1

Bug in TBar

Posted: Fri May 01, 2015 11:53 am
by Enrico Maria Giordano
In the following sample, if you click on the window you will get TBAR. With the previous FWH release you got TSAY.

Code: Select all

#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oWnd

    DEFINE WINDOW oWnd

    DEFINE BUTTONBAR OF oWnd

    @ 10, 10 SAY "This is a test"

    ACTIVATE WINDOW oWnd;
             ON CLICK MSGINFO( oWnd:aControls[ 1 ]:ClassName )

    RETURN NIL
EMG

Re: Bug in TBar

Posted: Sun May 03, 2015 8:12 am
by Enrico Maria Giordano
The problem seems to be in TBar New() method:

Code: Select all

   if ! Empty( oWnd:hWnd )
      ::Create()
      ::GetFont()
//      oWnd:AddControl( Self )
   else
Commenting out oWnd:AddControl( Self ) seems to fix it.

Can you confirm?

EMG

Re: Bug in TBar

Posted: Sun May 03, 2015 3:22 pm
by Antonio Linares
Enrico,
In the following sample, if you click on the window you will get TBAR. With the previous FWH release you got TSAY.
That seems to be correct now. TBar is another control of the window and as it has to be created the first one
thats why it appears as the first control.

Re: Bug in TBar

Posted: Sun May 03, 2015 5:14 pm
by Enrico Maria Giordano
Antonio,

but it's no backward compatible. :-(

EMG

Re: Bug in TBar

Posted: Sun May 03, 2015 5:37 pm
by Antonio Linares
We should not keep a bug backwards compatible :-)

Does it means many changes in your app ?

Re: Bug in TBar

Posted: Sun May 03, 2015 5:57 pm
by Enrico Maria Giordano
Antonio,

probably not. But that behavior was there from the beginnings of FW. :-)

EMG

Re: Bug in TBar

Posted: Sun May 03, 2015 10:08 pm
by Antonio Linares
Enrico,

Yes, you are right, but with recent TBar changes this was needed to be implemented