FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour How to return a button itself ?
Posts: 474
Joined: Sun Oct 30, 2005 06:37 AM
How to return a button itself ?
Posted: Tue Jun 03, 2008 03:52 AM

Hi,
Redefine button obutton id 201 of odlg action fun1(obutton)
This shows run time error : var obutton does not exists
I want
function fun1(obutton)
array1:=arect(obutton)
ACTIVATE MENU omenubill OF odlg at array1[1], array1[2]
// build a menu at obutton nrow,ncol
return

Regards !
Shuming Wang

http://www.xtech2.top
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
How to return a button itself ?
Posted: Tue Jun 03, 2008 07:37 AM

Shuming,

Have you previously declared a:

local oButton

Also, replace these lines:

oRect := obutton:GetRect()
ACTIVATE MENU omenubill OF odlg at oRect:nTop, oRect:nLeft

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 474
Joined: Sun Oct 30, 2005 06:37 AM
How to return a button itself ?
Posted: Tue Jun 03, 2008 08:12 AM

Antonio,
1.Yes, I missed done local obutton.

2.oRect := obutton:GetRect()
ACTIVATE MENU omenubill OF odlg at oRect:nTop, oRect:nLeft

This always show menu at right area of nomodal dialog

  1. array1:= GetCoors(obutton:hwnd)
    ACTIVATE MENU omenubill OF odlg at array1[1], array1[2]

This shows menu at button proper position on nomodal dialog .

Thank you !
Shuming Wang

http://www.xtech2.top
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
How to return a button itself ?
Posted: Tue Jun 03, 2008 08:15 AM

Shuming,

Right. Thats another way of doing it without using a TRect object.

Very good :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion