xBrowse Default Edit fields OverStrike vs Insert mode

xBrowse Default Edit fields OverStrike vs Insert mode

Postby Rick Lipkin » Fri May 08, 2015 7:53 pm

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
User avatar
Rick Lipkin
 
Posts: 2666
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: xBrowse Default Edit fields OverStrike vs Insert mode

Postby nageswaragunupudi » Sun May 10, 2015 12:06 am

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

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

Re: xBrowse Default Edit fields OverStrike vs Insert mode

Postby Rick Lipkin » Wed May 20, 2015 1:35 pm

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
User avatar
Rick Lipkin
 
Posts: 2666
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: xBrowse Default Edit fields OverStrike vs Insert mode

Postby karinha » Wed May 20, 2015 7:41 pm

Code: Select all  Expand view  RUN

// 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

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7872
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: xBrowse Default Edit fields OverStrike vs Insert mode

Postby Rick Lipkin » Wed May 20, 2015 9:39 pm

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
User avatar
Rick Lipkin
 
Posts: 2666
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: xBrowse Default Edit fields OverStrike vs Insert mode

Postby nageswaragunupudi » Thu May 21, 2015 12:45 am

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

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

Re: xBrowse Default Edit fields OverStrike vs Insert mode

Postby karinha » Thu May 21, 2015 12:50 pm

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7872
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: xBrowse Default Edit fields OverStrike vs Insert mode

Postby Rick Lipkin » Thu May 21, 2015 12:59 pm

Rao

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

Thank You
Rick Lipkin
Code: Select all  Expand view  RUN

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

Image
User avatar
Rick Lipkin
 
Posts: 2666
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 88 guests