Antonio: Modifying CLASS TRBtn (Bug?)

Antonio: Modifying CLASS TRBtn (Bug?)

Postby byte-one » 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: Select all  Expand view
case ::nTypeButton == TYPE_POPUP
                     if nCol >= ::nPopupMargin .or. !lAction
                        oWnd := ::oWnd
                        oWnd:NcMouseMove() // close the tooltip
                        if oWnd:oPopup == nil
                           oWnd:oPopup = ::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
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Antonio: Modifying CLASS TRBtn (Bug?)

Postby James Bott » Mon Jan 26, 2015 7: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Antonio: Modifying CLASS TRBtn (Bug?)

Postby nageswaragunupudi » Tue Jan 27, 2015 5: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
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Antonio: Modifying CLASS TRBtn (Bug?)

Postby Antonio Linares » Tue Jan 27, 2015 6:06 am

Günther,

Could you please provide an example to test here ? thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41315
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Antonio: Modifying CLASS TRBtn (Bug?)

Postby byte-one » Tue Jan 27, 2015 2: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: Select all  Expand view
::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: Select all  Expand view
::oPopup:Activate( ::nTop + ::nHeight(),;
::nLeft - If( ! oWnd:IsKindOf( "TRBGROUP" ), oWnd:nLeft, 0 ),;   //here are the fault
 oWnd, .F. )


This code are also in
Code: Select all  Expand view
METHOD ShowPopup() CLASS TRBtn
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Antonio: Modifying CLASS TRBtn (Bug?)

Postby James Bott » Tue Jan 27, 2015 2: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.
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Antonio: Modifying CLASS TRBtn (Bug?)

Postby byte-one » Tue Jan 27, 2015 4:14 pm

Antonio, James, here are a small example!
Code: Select all  Expand view
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
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Antonio: Modifying CLASS TRBtn (Bug?)

Postby byte-one » Fri Jan 30, 2015 8: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
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Antonio: Modifying CLASS TRBtn (Bug?)

Postby Enrico Maria Giordano » Fri Jan 30, 2015 9:12 am

Günther,

yes, I confirm the problem.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8315
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Antonio: Modifying CLASS TRBtn (Bug?)

Postby nageswaragunupudi » 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
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Antonio: Modifying CLASS TRBtn (Bug?)

Postby Antonio Linares » Sun Feb 01, 2015 5:05 pm

Günther, Enrico,

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

Code: Select all  Expand view
                 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
User avatar
Antonio Linares
Site Admin
 
Posts: 41315
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Antonio: Modifying CLASS TRBtn (Bug?)

Postby nageswaragunupudi » Sun Feb 01, 2015 5:20 pm

That's what Mr Günther proposed.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Antonio: Modifying CLASS TRBtn (Bug?)

Postby Antonio Linares » Sun Feb 01, 2015 6:15 pm

::CoorsUpdate() was missing

Without it, it fails
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41315
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 83 guests