undo-redo

Extend this Class to Undo/Redo in a Listview

一世执手 提交于 2019-11-30 03:46:59
问题 I'm using a thir party code to manage undo/redo operations in a WindowsForm project. I need to extend the Class to manage undo/redo operations in a Listview, this means: · Undo/Redo Add/Delete items and subitems · Undo/Redo Check/Uncheck rows · Undo/Redo some other importants things that maybe I've missed I don't know how to start doing this, the code is too complex for me, any help/tips/examples about this would be very gratified for me, but in 3 months I have not been able to carry out this

Using Vim's persistent undo?

安稳与你 提交于 2019-11-29 20:13:46
One of the new features in Vim 7.3 is 'persistent undo', which allows for the undotree to be saved to a file when exiting a buffer. Unfortunately, I haven't quite been able to get it properly enabled, or I must be using it wrong. Here's what I've tried so far: I added the following to ~/.vimrc set undofile " Save undos after file closes set undodir=$HOME/.vim/undo " where to save undo histories set undolevels=1000 " How many undos set undoreload=10000 " number of lines to save for undo After this, I supposedly should be able to open any file, edit it, then save-close it, and when I open it

Apply Undo Redo on elements that can dragable (drag and drop)

谁说胖子不能爱 提交于 2019-11-29 18:14:34
I want to implement functionality on the svgElements that can be dragged with javascript how could I do this... I have implemented this with mouse up When mouse up occurs, I save the x and y position, object id, object type (circle, rect, etc.) Can any one tell...is this good way to implement? I see a little issue in the example, you forget sometimes this. var history = { stack : [], counter : -1, add : function(item){ this.stack[++this.counter] = item; this.doSomethingWith(item); // delete anything forward of the counter this.stack.splice(this.counter+1); }, undo : function(){ this

How to create Undo-Redo in kineticjs?

元气小坏坏 提交于 2019-11-29 16:09:35
Is there any simple way how to create undo redo function in Kineticjs ? I have found a Undo Manager for HTML 5 in https://github.com/ArthurClemens/Javascript-Undo-Manager , but I don't know how to put in Kineticjs, please help me. thank you. projeqht I was able to implement a simple solution based on a post by Chtiwi Malek at CodiCode . I also used some of the code from this problem as an example to draw rectangles, so credits go to them and Chtiwi. The only difference in my solution is I used toJSON() to store each layer state in an array instead of toDataURL() on the canvas. I think toJSON()

UndoManager support in Firefox

六眼飞鱼酱① 提交于 2019-11-29 15:46:57
I'm a little confused about how to use undoManager in Firefox. According to Mozilla , Firefox 20 now has support for it, but I can't figure out where. I've checked under document , Objects , etc., but can't find it anywhere. I'm sure I'm missing something obvious, so can anyone help? You have to set the "dom.undo_manager.enabled" preference to use it, so far, since the spec is still in flux. 来源: https://stackoverflow.com/questions/15888611/undomanager-support-in-firefox

Extending Swing's UndoManager to provide repeat and multiple undo/redo

霸气de小男生 提交于 2019-11-29 15:39:33
I've been tasked with adding undo/redo/repeat functionality to an application. I'm currently investigating whether I can use Swing's UndoManager. Apart from the usual undo and redo buttons, I need to provide the ability to undo or redo multiple edits at once (drop down UI like MS Office), and repeat a chosen edit. I believe I can use UndoManager for multiple undo and redo. It provides methods for multiple undo and redo. To build the UI, I can extend UndoManager to expose the edits it holds. I'm not sure I can use UndoManager for repeat chosen operation however. My first thoughts were to extend

In Chrome undo does not work properly for input element after contents changed programmatically

夙愿已清 提交于 2019-11-29 11:12:42
In Chrome, I noticed that undo does not work properly for input element after the contents of the element has been changed programmatically. Although I get different behaviours for different browsers, they're not as bad as Chrome. FF20 good IE9 some support (undo stack cleared when input loses focus) Safari5 some support (undo stack cleared when input loses focus) Chrome26 unreliable For example, a script that trims spaces (see also jsfiddle below) type some spaces before "hello!", click outside the input element click on the input element and press Ctrl-Z now the text is gone (in Chome)

how to implement undo/redo operation without major changes in program

左心房为你撑大大i 提交于 2019-11-29 09:09:29
问题 Hi I'm about to add new functionality to application which I'm currently writting. I need to write a undo/redo fnctionality. However 90% of our application is ready and I don't know what is the best way to implementing this functionality without affectig(too much ) code which has been already created. 回答1: There aren't many details here. However, Undo/Redo functionality is typically handled via some variation of the Command Pattern. Depending on your architecture, this could be a simple

internet explorer alternative to document.execCommand(“insertText”,…), for text insertion that can be undone/redone by the user

北战南征 提交于 2019-11-29 06:14:26
When the user edits a contenteditable div , and press some keys, I would like to override the default behavior. For instance, I want to insert a normal line break when the user press ENTER. I do that using document.execCommand("insertText",...) This is the only way I have found so far to make this action undoable and redoable by the user. <div id="editor" contenteditable="true" style="white-space:pre-wrap"> Some text.... </div> <script> $("#editor").keydown(function(evt){ console.log(evt.keyCode); if(evt.keyCode==13){ document.execCommand("insertText",false,"\n"); evt.preventDefault(); evt

Using Vim's persistent undo?

最后都变了- 提交于 2019-11-28 16:10:01
问题 One of the new features in Vim 7.3 is 'persistent undo', which allows for the undotree to be saved to a file when exiting a buffer. Unfortunately, I haven't quite been able to get it properly enabled, or I must be using it wrong. Here's what I've tried so far: I added the following to ~/.vimrc set undofile " Save undos after file closes set undodir=$HOME/.vim/undo " where to save undo histories set undolevels=1000 " How many undos set undoreload=10000 " number of lines to save for undo After