Insert/Overstrike Cursors in GETS

Insert/Overstrike Cursors in GETS

Postby PatrickWeisser » Sat May 19, 2007 4: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!
User avatar
PatrickWeisser
 
Posts: 53
Joined: Fri Mar 23, 2007 4:10 am
Location: Seattle, WA, USA

Postby Antonio Linares » Sat May 19, 2007 4:48 pm

Patrick,

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

and
Code: Select all  Expand view
          DestroyCaret()
          CreateCaret( ::hWnd, 0, 6, ::nGetChrHeight() )
          ShowCaret( ::hWnd )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42078
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby PatrickWeisser » Mon May 21, 2007 9: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
User avatar
PatrickWeisser
 
Posts: 53
Joined: Fri Mar 23, 2007 4:10 am
Location: Seattle, WA, USA

Postby Antonio Linares » Mon May 21, 2007 9:36 am

Patrick,

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42078
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby James Bott » Mon May 21, 2007 9: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby hua » Tue May 22, 2007 1: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
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Do you have to recompile fivewin libaries

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

Postby Antonio Linares » Sat May 26, 2007 9:40 am

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42078
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

It works!

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

Postby Antonio Linares » Sat May 26, 2007 3:42 pm

Yes, it seems ok
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42078
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 50 guests