FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Insert/Overstrike Cursors in GETS
Posts: 53
Joined: Fri Mar 23, 2007 04:10 AM

Insert/Overstrike Cursors in GETS

Posted: Sat May 19, 2007 04:03 PM

Our customers are used to seeing the thin vertical cursor (|) for both insert and overstrike mode (this is the behavior in Word, Quickbooks, and even the very text box I'm typing in right now on this forum). Does anyone know if there a way to either have the thin (|) cursor always appear in a GET, or at least reverse them and have the | cursor be for insert mode and the wider cursor for overstrike?

Thanks!

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Insert/Overstrike Cursors in GETS

Posted: Sat May 19, 2007 04:48 PM
Patrick,

In Class TGet comment out this code:
           DestroyCaret()
           if Set( _SET_INSERT )
              CreateCaret( ::hWnd, 0, 6, ::nGetChrHeight() )
           else
              CreateCaret( ::hWnd, 0, 2, ::nGetChrHeight() )
           endif
           ShowCaret( ::hWnd )

and
          DestroyCaret()
          CreateCaret( ::hWnd, 0, 6, ::nGetChrHeight() )
          ShowCaret( ::hWnd )
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 53
Joined: Fri Mar 23, 2007 04:10 AM

Insert/Overstrike Cursors in GETS

Posted: Mon May 21, 2007 09:04 AM

Thanks Antonio, that worked perfectly. I actually used:

CreateCaret( ::hWnd, 0, 2, ::nGetChrHeight() )

...to get the smaller vertical bar cursor. I also made a change to the KeyChar() method in TGet.prg so that the GET text control will stop accepting characters in insert mode when the control is full, instead of having existing characters "fall off" on the right. This is more in keeping with the behavior of our current application I am porting. For consistency, I also changed the WM_PASTE case in HandleEvent() so that only as many characters as there is space remaining for in the control will be pasted, again preventing existing text in the control from being truncated on the right if the paste string is too big.

I think it's wonderful that you have opened up many of the FiveWin classes to user inspection and customization. For me personally they are a great learning tool since I have not done much object oriented programming as of yet. And having some of the FiveWin source code also gives us a glimpse at how very well designed and elegant FiveWin is internally.

-Patrick

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Insert/Overstrike Cursors in GETS

Posted: Mon May 21, 2007 09:36 AM

Patrick,

glad to know you are moving forward and enjoying FiveWin :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM

Insert/Overstrike Cursors in GETS

Posted: Mon May 21, 2007 09:29 PM

Patrick,

>For me personally they are a great learning tool since I have not done much object oriented programming as of yet.

Have you read the articles about programming with OOP and Fivewin on my website? They may help.

http://ourworld.compuserve.com/homepage ... rogram.htm

Regards,
James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 1096
Joined: Fri Oct 28, 2005 02:27 AM

Insert/Overstrike Cursors in GETS

Posted: Tue May 22, 2007 01:18 AM

Using testmem3.prg in the FWH's SAMPLES directory, I find pressing Insert button doesn't toggle between the 2 mode (insert/overstrike). How to solve this?

TIA

--
FWH 2.8

FWH 11.08/FWH 19.12

BCC5.82/BCC7.3

xHarbour/Harbour
Posts: 4
Joined: Sat May 12, 2007 04:32 AM

Do you have to recompile fivewin libaries

Posted: Sat May 26, 2007 09:22 AM

Hi Antonio Linares,

I have marked out the lines you mentioned in "/SOURCE/CLASSES/TGET.PRG"

Following which I recompiled a test app with a get object.

The change in "TGET.PRG" does not take place. The get object still changes to a thick line as before making the change.

What am I not doing ? Do you have to recompile fivewin libraries ? If so, can you tell me how?

Thank you.(hope if its not too much trouble.!)

D.Charles
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Insert/Overstrike Cursors in GETS

Posted: Sat May 26, 2007 09:40 AM

You have to link the resulting GET.obj into your app

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 4
Joined: Sat May 12, 2007 04:32 AM

It works!

Posted: Sat May 26, 2007 11:58 AM

Hi Antonio,

Thanks for the reply. It works!.
It comes to me now that this is the same way things were done in clipper 5.2. Sorry but I am a bit rusty in clipper programming. I an including two working BAT scripts to convert the TGET.PRG into an OBJ. Could you just comment if its OK by you.

FILENAME: C.BAT

ECHO Compiling from .PRG to .C

set hdir=\zz\xh
set fwhdir=\zz\fwxh
set bcdir=\zz\bcc55

%hdir%\bin\harbour /n /w /p /oOBJ\ /i%fwhdir%\include;%hdir%\include;%bcdir%\include %1 %2 %3 > clip.log
@TYPE clip.log

FILENAME: L.BAT

@ECHO OFF
ECHO Compiling...From .C TO .OBJ

SET hdir=\zz\xh
SET fwh=\zz\fwxh
SET bcdir=\zz\bcc55

ECHO -oOBJ\%1 -I%fwh%\include;%hdir%\include;%bcdir%\include -L%fwh%\lib;%hdir%\lib;%bcdir%\lib OBJ\%1.c > l.bc

%bcdir%\bin\bcc32 -M -c -v @l.bc

Thanks a lot.

D.Charles
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Insert/Overstrike Cursors in GETS

Posted: Sat May 26, 2007 03:42 PM

Yes, it seems ok

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion