Graal Forums  

Go Back   Graal Forums > Private forums > Graal4 Forums > Graal V4 Main Forum
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 09-13-2005, 09:23 AM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Request: Undo

Would it be possible to have the GuiMLTextCtrls, and even the GuiTextCtrls to have undo capability? A big undo stack would be nice .
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
  #2  
Old 09-13-2005, 10:07 PM
calani calani is offline
Scriptess
calani's Avatar
Join Date: Aug 2003
Location: asmgarden.gmap
Posts: 606
calani is on a distinguished road
Send a message via AIM to calani
already requested and ignored twice =(
oh, and another thing that would be nice:
ctrl+left/right (word left/right) and ctrl+shift+left/right (select word left/right)



444th post
__________________
  #3  
Old 09-14-2005, 01:43 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
GuiTextCtrl already has (simple) undo, word-selection will be added soon, undo for multiline edit control is a little bit more complicated so it will take more time
  #4  
Old 09-14-2005, 04:31 AM
ChibiChibiLuc ChibiChibiLuc is offline
Cookie Monster. :3
Join Date: Jan 2005
Location: Nova Scotia, Canada
Posts: 111
ChibiChibiLuc is on a distinguished road
Send a message via AIM to ChibiChibiLuc Send a message via MSN to ChibiChibiLuc
Would it be possible to make a command that highlights text?

i.e. highlightText(pos1, pos2)
  #5  
Old 09-14-2005, 05:27 AM
calani calani is offline
Scriptess
calani's Avatar
Join Date: Aug 2003
Location: asmgarden.gmap
Posts: 606
calani is on a distinguished road
Send a message via AIM to calani
and set cursor positon
possibly also setfocus? (as long as it doesn't set the main graal window focus -.-)

and as for the undo's.. it wouldn't be that hard.
just make a small log of everything that's changed
so to undo/redo, all you need to do is parse the next entry in the log.
the format would be simple enough
(action) (row) (col) [to (row) (col)] (data)
ex. "replace 5 0 to 6 4 hello\nworld\n"
or "delete 5 0 "hello\nworld\n"

the same would go for single line text edit boxes. the only difference is keeping track of the rows wouldn't be necessary
__________________
  #6  
Old 09-14-2005, 06:33 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by calani
and set cursor positon
possibly also setfocus? (as long as it doesn't set the main graal window focus -.-)

and as for the undo's.. it wouldn't be that hard.
just make a small log of everything that's changed
so to undo/redo, all you need to do is parse the next entry in the log.
the format would be simple enough
(action) (row) (col) [to (row) (col)] (data)
ex. "replace 5 0 to 6 4 hello\nworld\n"
or "delete 5 0 "hello\nworld\n"

the same would go for single line text edit boxes. the only difference is keeping track of the rows wouldn't be necessary
I am not sure about your method (you would most likely get a lot of memory being wasted), but I do agree that having undo in GUI controls is a good idea.
__________________
Skyld
  #7  
Old 09-15-2005, 03:31 AM
calani calani is offline
Scriptess
calani's Avatar
Join Date: Aug 2003
Location: asmgarden.gmap
Posts: 606
calani is on a distinguished road
Send a message via AIM to calani
Quote:
Originally Posted by Skyld
you would most likely get a lot of memory being wasted
on the contrary, it is actually very memory efficient.
especially as there is usually only a few edit boxes active at any one time.
plus, you could further squish the format anyways
r:5,0,6,4:hello\nworld\n (24 bytes)
d:5,0:hello\nworld\n (20 bytes)

also, think about it. how many undos are usually active in the buffer anyways? most are just adds. in theory, adding a lengthy undo buffer using a log would maybe double the amount of memory used for the control, plus the header part for each entry. it might increase it by 2 1/2 times at the most, which isn't really that much considering what's usually in them... say less than 500 bytes worth of data. If, however, its a short novel or a lengthy script (say the max script size of 64k) then it would be a considerable increase (64k+64k+64k or 192k in this example). that, though, is worst-case. on average (say, 250b -> 750b), it wouldn't be that noticable.

( 72 undos used in this edit lineup: 59 adds, 2 deletes, 11 replaces)
__________________

Last edited by calani; 09-15-2005 at 03:43 AM..
  #8  
Old 09-15-2005, 08:25 AM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Quote:
Originally Posted by calani
that, though, is worst-case. on average (say, 250b -> 750b), it wouldn't be that noticable.
And, I assume, that memory would only be used when a GuiMLTextCtrl is open.
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
  #9  
Old 09-15-2005, 07:02 PM
calani calani is offline
Scriptess
calani's Avatar
Join Date: Aug 2003
Location: asmgarden.gmap
Posts: 606
calani is on a distinguished road
Send a message via AIM to calani
Quote:
Originally Posted by nano_p2p
And, I assume, that memory would only be used when a GuiMLTextCtrl is open [visible].
likely yes, or until the control is destroyed.
__________________
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 08:42 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.