Jump into edit mode

Post Reply
User avatar
Detlef
Posts: 209
Joined: Mon Feb 07, 2022 9:54 pm

Jump into edit mode

Post by Detlef »

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
FranciscoA
Posts: 2163
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: Jump into edit mode

Post by FranciscoA »

Algo asi?:

Code: Select all | Expand

//--------------------------------------------//
//  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
Detlef
Posts: 209
Joined: Mon Feb 07, 2022 9:54 pm

Re: Jump into edit mode

Post by Detlef »

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
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: Jump into edit mode

Post by nageswaragunupudi »

Please try:

Code: Select all | Expand

     ON INIT ( oBrw:SetFocus(), oBrw:nColSel := 1, oBrw:Edit() )
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
Detlef
Posts: 209
Joined: Mon Feb 07, 2022 9:54 pm

Re: Jump into edit mode

Post by Detlef »

Thanks, Mr. Rao.
Unfortunately my FWH version doesn't know the method ::Edit()
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: Jump into edit mode

Post by nageswaragunupudi »

Sorry, my mistake.
Try this:

Code: Select all | Expand

 ON INIT ( oBrw:SetFocus(), oBrw:nColSel := 1, oBrw:aCols[ 1 ]:Edit() )
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
Detlef
Posts: 209
Joined: Mon Feb 07, 2022 9:54 pm

Re: Jump into edit mode

Post by Detlef »

This works fine.
Many thanks
Post Reply