![]() |
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 :) .
|
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 :redface: |
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
|
Would it be possible to make a command that highlights text?
i.e. highlightText(pos1, pos2) |
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 |
Quote:
|
Quote:
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 :D lineup: 59 adds, 2 deletes, 11 replaces) |
Quote:
|
Quote:
|
| All times are GMT +2. The time now is 08:53 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.