FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Antonio: Modifying CLASS TRBtn (Bug?)
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Antonio: Modifying CLASS TRBtn (Bug?)
Posted: Sat Jan 24, 2015 11:12 PM
I changed the marked line with NEW as when i change the position of the dialog with ON INIT oDlg:move(....) the horizontally position of the popup-menu follows not the button!

Code (fw): Select all Collapse
case ::nTypeButton == TYPE_POPUP
                     if nCol >= ::nPopupMargin .or. !lAction
                        oWnd := ::oWnd
                        oWnd:NcMouseMove() // close the tooltip
                        if oWnd:oPopup == nil
                           oWnd:oPopup = ::oPopup
//                           ::Activate( ::nTop + ::nHeight(),::nLeft - If( ! oWnd:IsKindOf( "TRBGROUP" ), oWnd:nLeft, 0 ), oWnd, .F. )
                            ::oPopup:Activate( ::nTop + ::nHeight(), ::nLeft , oWnd, .F. )    //NEW!!
Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Antonio: Modifying CLASS TRBtn (Bug?)
Posted: Mon Jan 26, 2015 07:23 PM

I'm not clear, are you saying that the code you posted is the fix for the problem? If so, which PRG, and method is it in?

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Antonio: Modifying CLASS TRBtn (Bug?)
Posted: Tue Jan 27, 2015 05:42 AM
James Bott wrote:I'm not clear, are you saying that the code you posted is the fix for the problem? If so, which PRG, and method is it in?

James

Yes. That is what he says.
This code is from Method LButtonUp() of trbtn.prg

We are yet to test at our end.
Regards



G. N. Rao.

Hyderabad, India
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Antonio: Modifying CLASS TRBtn (Bug?)
Posted: Tue Jan 27, 2015 06:06 AM

Günther,

Could you please provide an example to test here ? thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: Antonio: Modifying CLASS TRBtn (Bug?)
Posted: Tue Jan 27, 2015 02:16 PM
Antonio, if i move the window with ON INIT oWnd:move() also the data oWnd:nLeft are changed! And the comes the
Code (fw): Select all Collapse
::nLeft - oWnd:nLeft
and the popup-menu are moved left on the display-position.
z.b. Dialog position left is 700 after the move(). This oDlg:nLeft are subtract from the oButton:left !?

Code (fw): Select all Collapse
::oPopup:Activate( ::nTop + ::nHeight(),;
::nLeft - If( ! oWnd:IsKindOf( "TRBGROUP" ), oWnd:nLeft, 0 ),;   //here are the fault
 oWnd, .F. )


This code are also in
Code (fw): Select all Collapse
METHOD ShowPopup() CLASS TRBtn
Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Antonio: Modifying CLASS TRBtn (Bug?)
Posted: Tue Jan 27, 2015 02:59 PM

Günther,

I think Antonio was looking for a small self-contained example program that shows the problem that he can use to test your fix for the problem.

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: Antonio: Modifying CLASS TRBtn (Bug?)
Posted: Tue Jan 27, 2015 04:14 PM
Antonio, James, here are a small example!
Code (fw): Select all Collapse
function trb_test()
local oDlg , oBtn , oMenu
MENU oMenu POPUP
    MENUITEM "1" ACTION oDlg:end()
    MENUITEM "End" ACTION oDlg:end()
ENDMENU
DEFINE DIALOG oDlg SIZE 400,200 PIXEL TITLE "RBBTN-Menu-Test"
@ 80,5 RBBTN oBtn OF oDlg POPUP MENU oMenu PROMPT "RBBTN" SIZE 58,13
ACTIVATE DIALOG oDlg ON INIT oDlg:move(200,300)
return NIL
Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: Antonio: Modifying CLASS TRBtn (Bug?)
Posted: Fri Jan 30, 2015 08:40 AM

Antonio, please try to open the popup-menu in the above example and you can see, that the popup-menu are left from the button!

Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Antonio: Modifying CLASS TRBtn (Bug?)
Posted: Fri Jan 30, 2015 09:12 AM

Günther,

yes, I confirm the problem.

EMG

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Antonio: Modifying CLASS TRBtn (Bug?)
Posted: Fri Jan 30, 2015 12:40 PM

Thanks for the help. We are incorporating the fix for the next release.

Regards



G. N. Rao.

Hyderabad, India
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Antonio: Modifying CLASS TRBtn (Bug?)
Posted: Sun Feb 01, 2015 05:05 PM
Günther, Enrico,

To me this seems the right fix. I appreciate your feedback:

Code (fw): Select all Collapse
                  case ::nTypeButton == TYPE_POPUP
                     if nCol >= ::nPopupMargin .or. !lAction
                        oWnd := ::oWnd
                        oWnd:NcMouseMove() // close the tooltip

                        // Modified to handle Codeblock as oPopup 2014-10-10
                        if oWnd:oPopup == nil
                           oWnd:oPopup = XEval( ::oPopup, Self )
                           ::CoorsUpdate()                                  
                           oWnd:oPopup:Activate( ::nTop + ::nHeight(),;
                                                 ::nLeft, oWnd, .F. )
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Antonio: Modifying CLASS TRBtn (Bug?)
Posted: Sun Feb 01, 2015 05:20 PM

That's what Mr Günther proposed.

Regards



G. N. Rao.

Hyderabad, India
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Antonio: Modifying CLASS TRBtn (Bug?)
Posted: Sun Feb 01, 2015 06:15 PM

::CoorsUpdate() was missing

Without it, it fails

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion