Insert/Overstrike Cursors in GETS

Post Reply
User avatar
PatrickWeisser
Posts: 53
Joined: Fri Mar 23, 2007 4:10 am
Location: Seattle, WA, USA
Contact:

Insert/Overstrike Cursors in GETS

Post by PatrickWeisser »

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!
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Patrick,

In Class TGet comment out this code:

Code: Select all

           DestroyCaret()
           if Set( _SET_INSERT )
              CreateCaret( ::hWnd, 0, 6, ::nGetChrHeight() )
           else
              CreateCaret( ::hWnd, 0, 2, ::nGetChrHeight() )
           endif
           ShowCaret( ::hWnd )
and

Code: Select all

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

Antonio Linares
www.fivetechsoft.com
User avatar
PatrickWeisser
Posts: 53
Joined: Fri Mar 23, 2007 4:10 am
Location: Seattle, WA, USA
Contact:

Post by PatrickWeisser »

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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Patrick,

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

Antonio Linares
www.fivetechsoft.com
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

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
hua
Posts: 861
Joined: Fri Oct 28, 2005 2:27 am

Post by hua »

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
charles dominic
Posts: 4
Joined: Sat May 12, 2007 4:32 am
Location: Kuala Lumpur, Malaysia

Do you have to recompile fivewin libaries

Post by charles dominic »

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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

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

Antonio Linares
www.fivetechsoft.com
charles dominic
Posts: 4
Joined: Sat May 12, 2007 4:32 am
Location: Kuala Lumpur, Malaysia

It works!

Post by charles dominic »

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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Yes, it seems ok
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply