Page 1 of 1

xBrowse Default Edit fields OverStrike vs Insert mode

Posted: Fri May 08, 2015 7:53 pm
by Rick Lipkin
Rao

I know we have talked about this before, but to be compatible with Excel and many other Microsoft products, it would be nice if the Field edit would by default be in Insert Mode rather than over-strike.

I just opened Excel and went to edit a cell and moved my cursor back a few characters and started typing and all the previous text moved to the right. Even in these forums, if you move your cursor back and start typing .. all the text moves to the right as in Insert mode .. not over-strike.

I would appreciate your thoughts ?

Thanks
Rick Lipkin

Re: xBrowse Default Edit fields OverStrike vs Insert mode

Posted: Sun May 10, 2015 12:06 am
by nageswaragunupudi
Personally I too prefer insert mode.
But there is nothing like default for xbrowse-get or independent get. Get just follows the existing setting of insert mode set by programmer or user.

So, please just use Set( _SET_INSERT, .t. ) and then all subsequent xbrowse-gets and independent gets work in insert mode.

Re: xBrowse Default Edit fields OverStrike vs Insert mode

Posted: Wed May 20, 2015 1:35 pm
by Rick Lipkin
Rao

I am just getting back to this topic and I approve of the Insert Behavoir, unfortunitly, the cursor is too fat. I have searched the forums and found several topics on this

viewtopic.php?f=3&t=21995&hilit=set+cursor

However, is there a global cursor setting that will force the thin cursor even when the set insert is turned on ?

Rick Lipkin

Image

Re: xBrowse Default Edit fields OverStrike vs Insert mode

Posted: Wed May 20, 2015 7:41 pm
by karinha

Code: Select all | Expand


// testget3.prg Model.

#include "fivewin.ch"

function main()

   FromCode()

   //FromrES()
 
return Nil

Function FromCode()

   local oDlg
   local oGet1, oGet2, oGet3, oGet4
   local cVar1, cVar2, cVar3, cVar4, oHand
   local lActive := .f.
   
   cVar1 := 0
   cVar2 := 0
   cVar3 := 0
   cVar4 := 0

   DEFINE CURSOR oHand HAND
   
   define dialog oDlg title "From Code" pixel size 300,300

   Set( _SET_INSERT, ! Set( _SET_INSERT ) )

   @ 10,10 get oGet1 var cVar1 bitmap "..\bitmaps\on.bmp" ;
           action( msginfo( "With Transparent" ) ) of oDlg pixel size 60,12 ;
           CURSOR  oHand

   @ 40,10 get oGet2 var cVar2 bitmap "..\bitmaps\on.bmp" ;
           action( msginfo( "Without Transparent" ) ) of oDlg pixel size 60,12 ;
           CURSOR  oHand

   @ 70,10 get oGet3 var cVar3 bitmap "..\bitmaps\chkyes.bmp" ;
           action( msginfo( "With Adjust-Transparent" ) ) of oDlg pixel size 120,12 ;
           CURSOR  oHand

   @ 100,10 get oGet4 var cVar4 bitmap "..\bitmaps\chkyes.bmp" ;
   action( if( lActive,oGet3:disable(),oGet3:enable()),        ;
              lActive:= !lActive, oDlg:update() ) of oDlg pixel size 120,12 ;
              CURSOR  oHand
   
   oGet1:lBtnTransparent := .t.       // transparent button get oGet1
   
   oGet3:disable()
   oGet3:lBtnTransparent := .t.       // transparent button get oGet3
   oGet3:lAdjustBtn      := .t.       // Button Get Adjust Witdh oGet3
   oGet3:lDisColors      := .f.       // Deactive disable color
   oGet3:nClrTextDis     := CLR_WHITE // Color text disable status
   oGet3:nClrPaneDis     := CLR_BLUE  // Color Pane disable status
   
   oGet4:lAdjustBtn      := .t.
   
   activate dialog oDlg centered

   Set( _SET_INSERT, ! Set( _SET_INSERT ) )
 
return nil
   
Function FromRes()

   local oDlg
   local oGet1, oGet2, oGet3, oGet4
   local cVar1, cVar2, cVar3, cVar4, oHand
   local lActive := .f.
   
   cVar1 := 0
   cVar2 := 0
   cVar3 := 0
   cVar4 := 0

   DEFINE CURSOR oHand RESOURCE "Dedo"
   
   define dialog oDlg resource "fromres"

   Set( _SET_INSERT, ! Set( _SET_INSERT ) )

   redefine get oGet1 var cVar1 id 100 bitmap "on" ;
            action( msginfo( "With Transparent" ) ) of oDlg ;
            CURSOR  oHand

   redefine get oGet2 var cVar2 id 101 bitmap "on" ;
            action( msginfo( "Without Transparent" ) ) of oDlg ;
            CURSOR  oHand

   redefine get oGet3 var cVar3 id 102 bitmap "chkyes"     ;
            action( msginfo( "With Adjust-Transparent" ) ) ;
            COLOR CLR_BLACK, CLR_CYAN of oDlg              ;
            CURSOR  oHand

   redefine get oGet4 var cVar4 id 103 bitmap "chkyes"     ;
            action( if( lActive,oGet3:disable(),oGet3:enable()),    ;
                        lActive:= !lActive, oDlg:update() ) of oDlg ;
            CURSOR  oHand
   
   oGet1:lBtnTransparent := .t.       // transparent button get oGet1
   
   oGet3:disable()
   oGet3:lBtnTransparent := .t.       // transparent button get oGet3
   oGet3:lAdjustBtn      := .t.       // Button Get Adjust Witdh oGet3
   oGet3:lDisColors      := .f.       // Deactive disable color
   oGet3:nClrTextDis     := CLR_WHITE // Color text disable status
   oGet3:nClrPaneDis     := CLR_BLUE  // Color Pane disable status

   
   oGet4:lAdjustBtn := .t.
   
   activate dialog oDlg centered

   Set( _SET_INSERT, ! Set( _SET_INSERT ) )
 
return nil


Re: xBrowse Default Edit fields OverStrike vs Insert mode

Posted: Wed May 20, 2015 9:39 pm
by Rick Lipkin
Thank you for your code .. what I am trying to do is to make the insert block just a normal cursor line .. and the oHand Cursor does not effect that :|

Rick Lipkin
Image

Re: xBrowse Default Edit fields OverStrike vs Insert mode

Posted: Thu May 21, 2015 12:45 am
by nageswaragunupudi
Mr Rick

Please set TGet():lChangeCaret := .f. somewhere towards the beginning of your Main() function.

You will see only the Thin Caret in all Gets whether in Insert Mode or OverWrite Mode.

Re: xBrowse Default Edit fields OverStrike vs Insert mode

Posted: Thu May 21, 2015 12:50 pm
by karinha

Re: xBrowse Default Edit fields OverStrike vs Insert mode

Posted: Thu May 21, 2015 12:59 pm
by Rick Lipkin
Rao

This is an important topic for many developers .. a GREAT Solution! :D

Thank You
Rick Lipkin

Code: Select all | Expand


// replaces overstrike in gets
Set( _SET_INSERT, .t. )
TGet():lChangeCaret := .f.
 

Image