FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Jump into edit mode
Posts: 218
Joined: Mon Feb 07, 2022 09:54 PM
Jump into edit mode
Posted: Wed Mar 09, 2022 06: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?

Posts: 2170
Joined: Fri Jul 18, 2008 01:24 AM
Re: Jump into edit mode
Posted: Wed Mar 09, 2022 09:59 PM
Algo asi?:
Code (fw): Select all Collapse
//--------------------------------------------// 
//  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
Posts: 218
Joined: Mon Feb 07, 2022 09:54 PM
Re: Jump into edit mode
Posted: Thu Mar 10, 2022 08: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.

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Jump into edit mode
Posted: Thu Mar 10, 2022 10:23 PM
Please try:
Code (fw): Select all Collapse
      ON INIT ( oBrw:SetFocus(), oBrw:nColSel := 1, oBrw:Edit() )
Regards



G. N. Rao.

Hyderabad, India
Posts: 218
Joined: Mon Feb 07, 2022 09:54 PM
Re: Jump into edit mode
Posted: Fri Mar 11, 2022 08:21 AM

Thanks, Mr. Rao.
Unfortunately my FWH version doesn't know the method ::Edit()

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Jump into edit mode
Posted: Fri Mar 11, 2022 09:34 AM
Sorry, my mistake.
Try this:
Code (fw): Select all Collapse
  ON INIT ( oBrw:SetFocus(), oBrw:nColSel := 1, oBrw:aCols[ 1 ]:Edit() )
Regards



G. N. Rao.

Hyderabad, India
Posts: 218
Joined: Mon Feb 07, 2022 09:54 PM
Re: Jump into edit mode
Posted: Fri Mar 11, 2022 01:41 PM

This works fine.
Many thanks

Continue the discussion