How to return a button itself ?

How to return a button itself ?

Postby ShumingWang » Tue Jun 03, 2008 3: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
ShumingWang
 
Posts: 465
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

Postby Antonio Linares » Tue Jun 03, 2008 7: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42107
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby ShumingWang » Tue Jun 03, 2008 8: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

3. 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
ShumingWang
 
Posts: 465
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

Postby Antonio Linares » Tue Jun 03, 2008 8:15 am

Shuming,

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

Very good :-)
regards, saludos

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 68 guests