Undo feature

Undo feature

Postby MarcoBoschi » Sun Jul 24, 2011 9:39 am

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

May thanks
Marco
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: Undo feature

Postby Antonio Linares » Sun Jul 24, 2011 2:13 pm

Marco,

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

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

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

Re: Undo feature

Postby MarcoBoschi » Mon Jul 25, 2011 9:00 am

If I press right mouse button a menu appears.

The first voice "Annulla" (Undo) is disabled
Image
How can I activate it?

This is the code

Many thanks

marco
Code: Select all  Expand view
#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
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: Undo feature

Postby Enrico Maria Giordano » 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
User avatar
Enrico Maria Giordano
 
Posts: 8712
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Undo feature

Postby MarcoBoschi » 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
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: Undo feature

Postby MarcoBoschi » Tue Jul 26, 2011 7: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: Select all  Expand view
#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
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: Undo feature

Postby MarcoBoschi » Wed Jul 27, 2011 3:23 pm

up
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: Undo feature

Postby Enrico Maria Giordano » Wed Jul 27, 2011 3:36 pm

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

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8712
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Undo feature

Postby MarcoBoschi » Wed Jul 27, 2011 6: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
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: Undo feature

Postby Enrico Maria Giordano » Wed Jul 27, 2011 7:09 pm

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

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8712
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Undo feature

Postby MarcoBoschi » Tue Dec 20, 2011 9: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: Select all  Expand view
#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
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: Undo feature

Postby Antonio Linares » Tue Dec 20, 2011 11:18 am

regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42082
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 32 guests