GET with ACTION not Jumping to the desired GET Object

GET with ACTION not Jumping to the desired GET Object

Postby anserkk » Tue Mar 24, 2009 11:32 am

Hi Friends,

I don't know where I have went wrong. The oJump of the GetObject is not functioning as expected.

In my DIALOG I have 5 GET Objects. In my 1st GET Object I have an ACTION clause.
When the user clicks on the BUTTON associated with the 1st GET object , I am calling cGetFile function to select a file. After the file is selected, I need to jump/set focus to the 3rd get object in the Dialog.
Unfortunately even after giving the oJump and SetFoucs, the cursor is remaining at the 1st GET itself


Here is the Sample code

Code: Select all  Expand view
*--------------------------------------------*
Function Main()
*--------------------------------------------*
Local oDlg,oBtnSend,oBtnStop,oGetFile,oGetNoIds,oGetStartRow,oGetAttachments,oGetHtml,oGetProcessOnly
Local cXlsFile:=spac(100),nNoIds:=0,nStartRow:=2,nProcessOnly:=250,cAttachment:=spac(100),cHtmlFile:=spac(100)

SetBalloon(.T.)
DEFINE DIALOG oDlg TITLE "Regal Bulk Mail Sender" FROM 1,1 to 35,120 TRANSPARENT

@0.9,1 say "Excel File containing Email Id's"
@1.8,1 say "No of Email Id's found in the Excel File"
@2.7,1 Say "Please specify the starting row in Excel"
@3.5,1 SAY "No of email id's to be processed from the start row"
@4.4,1 SAY "Attachments"
@5.3,1 say "Mail HTML File"

@1,16 GET oGetFile VAR cXlsFile SIZE 130,12 ;
      ACTION (cXlsFile:=cGetFile( "*.xls", "Please select a Excel file" ), ;
                   oGetFile:oJump:=oGetStartRow,oGetStartRow:SetFocus() )
@2,16 GET oGetNoIds VAR nNoIds PICTURE "999999" RIGHT WHEN .F. UPDATE
@3,16 GET oGetStartRow VAR nStartRow PICTURE "999999" RIGHT UPDATE
@4,16 GET oGetProcessOnly VAR nProcessOnly PICTURE "999999" RIGHT UPDATE
@5,16 GET oGetAttachments VAR cAttachment SIZE 130,12 ACTION (cAttachment:=cGetFile( "*.*", "Please select the file to be attached" ) )
@6,16 GET oGetHtml VAR cHtmlFile size 130,12 ACTION (cAttachment:=cGetFile( "*.html", "Please select the Email Draft file" ) )

@7,10 BUTTONBMP oBtnSend PROMPT "Start Sending" SIZE 56,20 ACTION oBtnSend:Disable()
@7,22 BUTTONBMP oBtnStop PROMPT "Stop Sending"  SIZE 56,20 ACTION oBtnSend:Enable()

ACTIVATE DIALOG oDlg

Return NIL
 


Any Idea where I have went wrong. I have also tries oDlg:Update(), Sysrefresh() in the ACTION clause of the 1st GETbut found no difference.

Regards

Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: GET with ACTION not Jumping to the desired GET Object

Postby Enrico Maria Giordano » Tue Mar 24, 2009 11:54 am

Code: Select all  Expand view
@1,16 GET oGetFile VAR cXlsFile SIZE 130,12 ;
      ACTION (cXlsFile:=cGetFile( "*.xls", "Please select a Excel file" ), ;
              oGetStartRow:PostMsg( WM_SETFOCUS ) )


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

Re: GET with ACTION not Jumping to the desired GET Object

Postby anserkk » Tue Mar 24, 2009 12:03 pm

Dear Mr.EMG,

Thankyou. With the PostMsg( WM_SETFOCUS ) It is working fine now. Is it the ACTION button associated with the GET that is blocking the regular oGet:oJump and oGet:SetFocus(). I am bit confused regarding where to use what, I mean oGet:SetFocus() or oGet:PostMsg( WM_SETFOCUS )

Regards

Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: GET with ACTION not Jumping to the desired GET Object

Postby anserkk » Tue Mar 24, 2009 12:09 pm

Dear EMG,

Now another problem, after the PostMsg( WM_SETFOCUS ) is executed the cursor is getting displayed at the desired get ie the 3rd one ie oGetStartRow , but whatever I type using the keyboard is appearing on the 1st GET.

The hair (EDIT) cursor is on the 3rd GET and whatever I type using the keyboard is appearing in the 1st GET

Regards

Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: GET with ACTION not Jumping to the desired GET Object

Postby Enrico Maria Giordano » Tue Mar 24, 2009 12:34 pm

Code: Select all  Expand view
@1,16 GET oGetFile VAR cXlsFile SIZE 130,12 ;
      ACTION (cXlsFile:=cGetFile( "*.xls", "Please select a Excel file" ), ;
                   oGetFile:oBtn:oJump:=oGetStartRow )


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

Re: GET with ACTION not Jumping to the desired GET Object

Postby anserkk » Wed Mar 25, 2009 4:42 am

Dear Mr.EMG

oGetFile:oBtn:oJump:=oGetStartRow solved the problem

Thankyou

Regards

Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India


Return to FiveWin for Harbour/xHarbour

Who is online

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