undo-redo

DataGrid and MVVM with Undo/Redo

↘锁芯ラ 提交于 2019-12-05 07:28:30
问题 I'm playing with quite simple interface with buttons and shortcuts for adding, inserting and removing rows of datagrid (underlying bound collection). There's also a need to implement undo stack. But...I have no idea how to do with internal logic of this control. By default DataGrid can remove or add new row automatically and performs many other things on user input (Esc,F2 and so on) thus implicitly changing the bound data. As commands are to be executed on the VM side undo stack is its (or

WPF RichTextBox TextChanged event - how to find deleted or inserted text?

五迷三道 提交于 2019-12-04 09:39:29
While creating a customized editor with RichTextBox, I've face the problem of finding deleted/inserted text with the provided information with TextChanged event. The instance of TextChangedEventArgs has some useful data, but I guess it does not cover all the needs. Suppose a scenario which multiple paragraphs are inserted, and at the same time, the selected text (which itself spanned multiple paragraphs) has been deleted. With the instance of TextChangedEventArgs, you have a collection of text changes, and each change only provides you with the number of removed or added symbols and the

best practice for Undo Redo implementation [closed]

拥有回忆 提交于 2019-12-04 08:06:54
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago . I need to implement Undo/Redo frame work for my window application(editor like powerpoint), what should be the best practice to follow, how would be handle all property changes of my objects and it reflection on UI. 回答1: There are two classic patterns to use. The first is the

How to implement undo/redo with programatic change of the textValue of a NSTextView?

落花浮王杯 提交于 2019-12-04 02:29:44
I created a simple demo app with a NSTextView and a button, the provided a NSTextViewDelegate to the textView and added an action: - (IBAction)actionButtonClicked:(id)sender { NSString *oldText = [[[self.textView textStorage] string] copy]; NSString *newText = @"And... ACTION!"; [[self.textView undoManager] registerUndoWithTarget:self.textView selector:@selector(setString:) object:oldText]; [[self.textView undoManager] setActionName:@"ACTION"]; [self.textView setString:newText]; } Undo/redo works without problems, if I change text by hand. But if I change the text with the action method, undo

DataGrid and MVVM with Undo/Redo

Deadly 提交于 2019-12-03 22:45:54
I'm playing with quite simple interface with buttons and shortcuts for adding, inserting and removing rows of datagrid (underlying bound collection). There's also a need to implement undo stack. But...I have no idea how to do with internal logic of this control. By default DataGrid can remove or add new row automatically and performs many other things on user input (Esc,F2 and so on) thus implicitly changing the bound data. As commands are to be executed on the VM side undo stack is its (or even M's) business either, yet DataGrid contains internally predefined bindings to DataGrid. commands.

How to utilize sqlite for undo/redo features?

梦想与她 提交于 2019-12-03 16:45:08
I'm writing a desktop application to do vector drawing in C++, and considering using sqlite to back my undo/redo feature. Has anybody used sqlite for undo/redo features? How does it work out for you? Clarification: I was aware of the stack approach, I have even implemented one application with that approach. The problem I encountered was that it becomes hard to maintain after a while. What I meant by utilizing sqlite is that I will map my entire in-memory data structure into a sqlite database, and let the sqlite do the diff and revision for me. Speed should not be a issue if I create a in

Command Pattern for undo/redo in paint application

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-03 03:45:50
I would like to implement undo/redo in a small paint application . It seems the Command Pattern fits the use nicely, but I am unsure how to best implement it. As I understand the pattern, it is necessary to include in each command: The details of the paint operation for purposes of redo (e.g. Line -> start & end points, free form line -> GeneralPath ) The state of the component prior to the change for undo. In this case, that will be a small snapshot image of the area affected by the command. My understanding based on that is that each command needs to be 'atomic' or self contained, with all

Redo - Undo functionality using angular js for large data

ε祈祈猫儿з 提交于 2019-12-02 18:35:08
问题 Currently i'm creating a table dynamically, in that multiple rows get added dynamically (Similar to Excel).Table can have millions of rows. For redo/undo functionality i've used Angular-Chronicle. Now redo/undo working perfectly when rows count is upto 100. How to improve redo/undo performance when data is too large. Here is working demo. Note : Pagination is not suit for my case.I want to load data on scroll. Please suggest any other suitable angular plugin or any other way to achieve redo

How to configure IntelliJ (also Android Studio) redo shortcut to CTRL+Y instead of CTRL+SHIFT+Z?

北城以北 提交于 2019-12-02 16:32:32
The default IntelliJ / Android Studio "Redo" action shortcut is CTRL + Shift + Z and this is a common problem for Windows users. A bigger problem is CTRL + Y is mapped to the "Delete line" action - and this causes the undo stack to be lost. To solve this issue, how can the "Redo" shortcut be changed to CTRL + Y in IntelliJ? İsmail Yavuz Open Settings (press CTRL + ALT + S ) Click Keymap on the left list. There is a combobox that contains keymaps. Select one of them (default means IntelliJ of course. We can't change any of pre-defined keymap however we can copy, edit and then use the edited one

Implement Undo/Redo operations for Adding/Deleting ListView Items

一曲冷凌霜 提交于 2019-12-02 07:54:12
问题 I have too much problems trying to implement an Undo/Redo operation in a ListView Control, just to add/remove items. I realized time ago a relative question here Extend this Class to Undo/Redo in a Listview where I was started multiple bountyes of 50, 100, 200 and 300 points, a total of 650 points... but no body could really helped me to finalize this issue in weeks and months. But after time in that question finally a user ( @ThorstenC ) showed me a possible solution and a great idea, the