xBrowse Cell Edit

Post Reply
User avatar
fraxzi
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines
Contact:

xBrowse Cell Edit

Post by fraxzi »

Hi All,

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


Regards,
Frances
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: xBrowse Cell Edit

Post 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?
Regards

G. N. Rao.
Hyderabad, India
User avatar
fraxzi
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines
Contact:

Re: xBrowse Cell Edit

Post 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
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: xBrowse Cell Edit

Post by nageswaragunupudi »

Mr Fraxzi

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

G. N. Rao.
Hyderabad, India
User avatar
frose
Posts: 327
Joined: Tue Mar 10, 2009 11:54 am
Location: Germany, Gütersloh
Contact:

Re: xBrowse Cell Edit

Post 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.
Gale FORd
Posts: 663
Joined: Mon Dec 05, 2005 11:22 pm
Location: Houston
Contact:

Re: xBrowse Cell Edit

Post 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 )
 
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: xBrowse Cell Edit

Post 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. )
 
Regards

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

Re: xBrowse Cell Edit

Post 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
 
Regards

G. N. Rao.
Hyderabad, India
Gale FORd
Posts: 663
Joined: Mon Dec 05, 2005 11:22 pm
Location: Houston
Contact:

Re: xBrowse Cell Edit

Post by Gale FORd »

I started another conversation and received similar solution.
Thanks for your follow up. Appreciated as always.
Post Reply