We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Undo multi-level like VS.NET

Thread ID:

Created:

Updated:

Platform:

Replies:

234 May 7,2002 07:47 AM Jul 4,2002 03:47 AM Windows Forms 5
loading
Tags: Tools
Sebastien Lange
Asked On May 7, 2002 07:47 AM

Is there a sample somewhere that show how to develop a multi-level undo? I know I have to create my custom popup. Your VS.NET sample in the showcase shows it but I do not see any code sample.

Administrator [Syncfusion]
Replied On May 8, 2002 06:58 AM

I have attached a modified TextEditorForm.cs in our XPMenus sample that now has a undo-popup like the one you see in the VS.Net sample. Start looking at the "undoPopup" in the source. Do let me know if you have any trouble with this sample. -Praveen Ramesh

Sebastien Lange
Replied On May 9, 2002 12:23 PM

There were just 2 errors with the PopupControlContainer that does not accept 1 argument: this.undoPopup = new Syncfusion.Windows.Forms.PopupControlContainer();//(this.components); this.popupControlContainer1 = new Syncfusion.Windows.Forms.PopupControlContainer();//(this.components); Thanks, that's exactly what I was looking for. Sebastien

Administrator [Syncfusion]
Replied On May 10, 2002 04:01 AM

Thanks, you are welcome. -Praveen Ramesh

Sebastien Lange
Replied On July 3, 2002 03:25 AM

Hi, There is a small bug in the XPMenus sample, with the multiple undo. When you click to undo one action, you unselect this action so you should add: private void undoList_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) { int index = this.undoList.IndexFromPoint(e.X, e.Y); if(index != -1) this.undoList.SetSelected(index, true); } Sebastien

Sebastien Lange
Replied On July 4, 2002 03:47 AM

That's not finished;-) If your stack contains more than 15 elements, you will not have the possibility to select more than 15 (the topindex is reset). You should change: private void undoList_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e) { int index = this.undoList.IndexFromPoint(e.X, e.Y); if(index != -1) { for(int i = index; i >= 0; i--) this.undoList.SetSelected(i, true); for(int i = index + 1; i < this.undoList.Items.Count; i++) this.undoList.SetSelected(i, false); index++; this.undoLabel.Text = "Undo " + index.ToString() + " Actions."; } } by private void undoList_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e) { int index = this.undoList.IndexFromPoint(e.X, e.Y); if(index != -1) { int topIndex = this.undoList.TopIndex; this.undoList.BeginUpdate(); for(int i = index; i >= 0; i--) this.undoList.SetSelected(i, true); for(int i = index + 1; i < this.undoList.Items.Count; i++) this.undoList.SetSelected(i, false); this.undoList.TopIndex = topIndex; this.undoList.EndUpdate(); index++; this.undoLabel.Text = "Undo " + index.ToString() + " Actions."; } } Begin & EndUpdate to avoid to much flashing but... this is not enough. Any idea to definitely remove this flash? Sebastien

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;