Page 1 of 1

xBrowse Cell Edit

Posted: Wed Apr 28, 2010 8:55 am
by fraxzi
Hi All,

If I edit xBrowse cell/column the edit value is highlighted or selected.. How to avoid this?


Regards,
Frances

Re: xBrowse Cell Edit

Posted: Wed Apr 28, 2010 10:01 am
by nageswaragunupudi
You need to modify xbrowse.prg.

In the METHOD Edit() CLASS TXBrwColumn, search for "::oEditGet:SelectAll()" and comment out that line.

I wonder what many programmers would prefer. The present default behavior of xbrowse or the new behavior preferred by you?

Re: xBrowse Cell Edit

Posted: Thu Apr 29, 2010 5:07 am
by fraxzi
nageswaragunupudi wrote:You need to modify xbrowse.prg.

In the METHOD Edit() CLASS TXBrwColumn, search for "::oEditGet:SelectAll()" and comment out that line.

I wonder what many programmers would prefer. The present default behavior of xbrowse or the new behavior preferred by you?
Dear RAO,

I think it would be better if there's a logical data whether to :selectall() or :selectnone()..

for example, my users edit a memo on xbrowse coloumn.. if by default is :selectall(), the entire content can be deleted if a char key was pressed.. so just by avoiding..

BTW, I commented what you suggests.

just maybe.. similar to this

Code: Select all

 oCol:bEditWhen := {|Self| IF( Self:oEditGet <> Nil, Self:oEditGet:SelectNone(), Nil), .T.}
would be handy so not to modify xbrowse.


best regards,
Frances

Re: xBrowse Cell Edit

Posted: Thu Apr 29, 2010 1:27 pm
by nageswaragunupudi
Mr Fraxzi

Personally I too prefer not to use :SelectAll().
Depending on what most users prefer, Mr Antonio may finally decide.

Re: xBrowse Cell Edit

Posted: Thu Apr 29, 2010 2:41 pm
by frose
Hi to all,

the default in most windows software is SelectAll(), but with increasing size of the content to edit, a data loss becomes more and more dangerous.

So, it would really be better to have a more comfortable way to switch between SelectAll() and SelectNone, as Frances described above.

Re: xBrowse Cell Edit

Posted: Mon Aug 21, 2017 8:34 pm
by Gale FORd
Has anyone found a way to have memo edit default to selectnone() or unselect text during ON INIT?
I have tried many different ways to get the memo edit not to select all automatically.
This has caused more than 1 person to accidentally erase memo with keystroke.

Code: Select all

local oDlg, oGet1, cText
   cText := 'This is existing text'
   DEFINE DIALOG oDlg RESOURCE "DLG_NOTE" TITLE 'Edit Note'
   REDEFINE GET oGet1 VAR cText  TEXT  ID 100 OF oDlg UPDATE
   ACTIVATE DIALOG oDlg CENTERED ON INIT oGet1:KeyDown( VK_END )
 

Re: xBrowse Cell Edit

Posted: Tue Sep 05, 2017 2:00 pm
by nageswaragunupudi
fraxzi wrote:
nageswaragunupudi wrote:You need to modify xbrowse.prg.

In the METHOD Edit() CLASS TXBrwColumn, search for "::oEditGet:SelectAll()" and comment out that line.

I wonder what many programmers would prefer. The present default behavior of xbrowse or the new behavior preferred by you?
Dear RAO,

I think it would be better if there's a logical data whether to :selectall() or :selectnone()..

for example, my users edit a memo on xbrowse coloumn.. if by default is :selectall(), the entire content can be deleted if a char key was pressed.. so just by avoiding..

BTW, I commented what you suggests.

just maybe.. similar to this

Code: Select all

 oCol:bEditWhen := {|Self| IF( Self:oEditGet <> Nil, Self:oEditGet:SelectNone(), Nil), .T.}
would be handy so not to modify xbrowse.


best regards,
Frances
Without modifying XBrowse, you can set

Code: Select all

XbrGetSelectAll( .F. )
 

Re: xBrowse Cell Edit

Posted: Tue Sep 05, 2017 2:54 pm
by nageswaragunupudi
Gale Ford

Please try this

Code: Select all

local oDlg, oGet1, cText
   cText := 'This is existing text'
   DEFINE DIALOG oDlg RESOURCE "DLG_NOTE" TITLE 'Edit Note'
   REDEFINE GET oGet1 VAR cText  TEXT  ID 100 OF oDlg UPDATE
   oGet1:bGotFocus := { || oGet1:SetSel( 0, 0 ) }
   
   ACTIVATE DIALOG oDlg CENTERED
 

Re: xBrowse Cell Edit

Posted: Tue Sep 05, 2017 7:15 pm
by Gale FORd
I started another conversation and received similar solution.
Thanks for your follow up. Appreciated as always.