Jump into edit mode

Jump into edit mode

Postby Detlef » Wed Mar 09, 2022 6:20 pm

Dear all,
I have a dialog with a xBrowse with arrays datasource.
The array has only one single row.
How can I jump directly into edit mode of the first left cell when the dialog opens?

I tried the ON INIT clause when activating the dialog.
But oBrw:aCols[1]:SetFocus() does of course not work.

Anyone who give me a hint?
User avatar
Detlef
 
Posts: 209
Joined: Mon Feb 07, 2022 9:54 pm

Re: Jump into edit mode

Postby FranciscoA » Wed Mar 09, 2022 9:59 pm

Algo asi?:
Code: Select all  Expand view  RUN
//--------------------------------------------//
//  BROWSE EN EDICION AL INICIAR EL DIALOG
//--------------------------------------------//
FUNCTION BrwEditIni()
local oCodi,cCodi:="   ", oCodi2,cCodi2:="   ", oDlg, oBrw, aData := {"    ","    ","    ","    "}

   DEFINE DIALOG oDlg SIZE 540,200 PIXEL TITLE "BRW EN EDICION AL INICIO"

   @ 4,10 GET oCodi Var cCodi  SIZE 50,10 PIXEL OF oDlg PICTURE "@!"
   @ 4,70 GET oCodi2 Var cCodi2  SIZE 50,10 PIXEL OF oDlg PICTURE "@!"

   @ 20, 10 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg  DATASOURCE aData ;
   COLUMNS 1,2,3,4  HEADERS  "Col1", "Col2", "Col3", "Col4" FASTEDIT

   WITH OBJECT oBrw
      :nMarqueeStyle  := MARQSTYLE_HIGHLCELL
      :nEditTypes := { 1, 1, 1, 1 }

      :CreateFromCode()
   END

   ACTIVATE DIALOG oDlg CENTERED ;
      ON INIT ( oBrw:SetFocus(), oBrw:nColSel := 1 )

Return nil
 
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2158
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: Jump into edit mode

Postby Detlef » Thu Mar 10, 2022 8:24 am

Yes, it jumps to the first column.
But unfortunately it doesn’t get into edit mode.

Anyhow many thanks for your help, Francisco.
User avatar
Detlef
 
Posts: 209
Joined: Mon Feb 07, 2022 9:54 pm

Re: Jump into edit mode

Postby nageswaragunupudi » Thu Mar 10, 2022 10:23 pm

Please try:
Code: Select all  Expand view  RUN
     ON INIT ( oBrw:SetFocus(), oBrw:nColSel := 1, oBrw:Edit() )
 
Regards

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

Re: Jump into edit mode

Postby Detlef » Fri Mar 11, 2022 8:21 am

Thanks, Mr. Rao.
Unfortunately my FWH version doesn't know the method ::Edit()
User avatar
Detlef
 
Posts: 209
Joined: Mon Feb 07, 2022 9:54 pm

Re: Jump into edit mode

Postby nageswaragunupudi » Fri Mar 11, 2022 9:34 am

Sorry, my mistake.
Try this:
Code: Select all  Expand view  RUN
 ON INIT ( oBrw:SetFocus(), oBrw:nColSel := 1, oBrw:aCols[ 1 ]:Edit() )
 
Regards

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

Re: Jump into edit mode

Postby Detlef » Fri Mar 11, 2022 1:41 pm

This works fine.
Many thanks
User avatar
Detlef
 
Posts: 209
Joined: Mon Feb 07, 2022 9:54 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], Silvio.Falconi and 104 guests