FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Undo feature
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Undo feature
Posted: Sun Jul 24, 2011 09:39 AM

Is undo feature contained in Tget class?
I dont't want to create something which already exist.

May thanks
Marco

Marco Boschi
info@marcoboschi.it
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Undo feature
Posted: Sun Jul 24, 2011 02:13 PM
Marco,

It is already implemented in Class TGet:
Code (fw): Select all Collapse
   METHOD UnDo() INLINE ::cText := ::oGet:Original

oGet:UnDo()
oGet:Refresh()
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: Undo feature
Posted: Mon Jul 25, 2011 09:00 AM
If I press right mouse button a menu appears.

The first voice "Annulla" (Undo) is disabled

How can I activate it?

This is the code

Many thanks

marco
Code (fw): Select all Collapse
#include "fivewin.ch"
FUNCTION MAIN()
LOCAL oDlg
LOCAL oGet1 , cGet1 := SPACE(100)
LOCAL oGet2 , cGet2 := SPACE(100)

DEFINE DIALOG oDlg FROM 10 , 10 TO 400 , 700 PIXEL

@ 30  , 1 GET oGet1 VAR cGet1 OF oDlg SIZE 200 , 20 PIXEL

@ 70 , 1 GET oGet2 VAR cGet2 OF oDlg SIZE 200 , 20 PIXEL



ACTIVATE DIALOG oDLg CENTER

RETURN NIL
Marco Boschi
info@marcoboschi.it
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Undo feature
Posted: Mon Jul 25, 2011 11:37 AM

Undo become enabled after a Cut and Delete operation. I suppose it should be active after a Paste operation too.

EMG

Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: Undo feature
Posted: Mon Jul 25, 2011 12:06 PM

Enrico,
Ok Now I see the voice "Undo" enabled but only If I use popup menu.
If I work with keyboard, for instance backspace or delete key, the "undo" voice is never enabled

Marco Boschi
info@marcoboschi.it
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: Undo feature
Posted: Tue Jul 26, 2011 07:24 PM
In your opinion Is it possible to manage Cut, Copy, Undo and Paste actions with four different buttons?

Obviously, only four buttons for all dialog's objects

Starting from this sample code

King regards

Marco
Code (fw): Select all Collapse
#include "fivewin.ch"
FUNCTION MAIN()
LOCAL oDlg
LOCAL oGet1 , cGet1 := SPACE(100)
LOCAL oGet2 , cGet2 := SPACE(100)

DEFINE DIALOG oDlg FROM 10 , 10 TO 400 , 700 PIXEL

@ 30  , 1 GET oGet1 VAR cGet1 OF oDlg SIZE 200 , 20 PIXEL

@ 70 , 1 GET oGet2 VAR cGet2 OF oDlg SIZE 200 , 20 PIXEL



ACTIVATE DIALOG oDLg CENTER

RETURN NIL
Marco Boschi
info@marcoboschi.it
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: Undo feature
Posted: Wed Jul 27, 2011 03:23 PM

up

Marco Boschi
info@marcoboschi.it
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Undo feature
Posted: Wed Jul 27, 2011 03:36 PM

Put your customized popup menu in oGet:bRClicked or in TGet:RButtonDown().

EMG

Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: Undo feature
Posted: Wed Jul 27, 2011 06:16 PM

Ok,
the last question.

Is it possible to manage these operation with four buttons in your opinion?
I've tried but without success.

Marco

Marco Boschi
info@marcoboschi.it
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Undo feature
Posted: Wed Jul 27, 2011 07:09 PM

Yes, buttons or menus doesn't make any differences.

EMG

Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: Undo feature
Posted: Tue Dec 20, 2011 09:37 AM
I state to have an old version (october 2009)

This is the problem:

- I modify first memo get: insert a third line with "Ccccccc"
- I change focus passing on second GET
- I realize to get wrong I have to write "Dddddddd"
- I return into first GET
- Press CTRL_Z
- I note an exact Undo operation the get returns to Initiali value

The problem is on other get, the second one not memo.

This operation does not work at all

Code (fw): Select all Collapse
#include "fivewin.ch"

#define crlf CHR(13)+CHR(10)


FUNCTION MAIN()
   LOCAL oDlg
   LOCAL oGet1   , cGet1   := "Aaaaa " + crlf + "Bbbbbbb "
   LOCAL oGet2   , cGet2   := "Cccccc Dddd Eeeeee           "

   DEFINE DIALOG oDlg

   @ 1 , 1 GET oGet1 VAR cGet1 OF oDlg SIZE 100 ,  30 PIXEL MEMO

   @ 3 , 1 GET oGet2 VAR cGet2 OF oDlg

   ACTIVATE DIALOG oDlg CENTER

RETURN nil
Marco Boschi
info@marcoboschi.it
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Undo feature
Posted: Tue Dec 20, 2011 11:18 AM
regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion