Ini++ Update: New ‘Undo’ feature

Ini++ has a new feature, by the request of HolyMonkey.

Everything that the object does which changes data can now be undone. The object stores a list of things which have been done. When desired, the ‘undo’ action can be called to revert the last set of changes. A new condition ‘Has undo’ can be used to see if the undo buffer has anything in it or not.

The undo buffer can be infinite size, of some finite size (so that it remembers the last, say, 8 actions) or zero, which disables it. By default it is zero, as if you do not use this feature, it will waste memory.

This allows people who have developed Multimedia Fusion applications around the Ini++ object to add ‘Undo’ capability ‘for free’ (i.e. with little or no extra work). It also means that people who want to design applications with an ‘undo’ feature can easily do it if they centre their program around Ini++.

You can also undo undoes with the redo feature. The redo buffer size can be separately kept. Redoes can be undone with the undo action, if that makes sense. Ini++ also automatically clears the redo buffer when the any changes are made to the data (except via the Undo or Redo actions).

Caveats: Undo functions do not necessarily retrain the group ordering. You will need to request this as a feature if you want that. Undo functions do not necessarily strip out redundant operations (i.e. setting an item to the same value as it currently is, or deleting a non-existing item), although it may and behaviour may change. Request as a feature if you think you know how it is best done. Finally, operations in your program may translate into multiple operations to the Ini++ object, and so you may need the ‘undo’ button in your program to undo more than once depending on what operations were previously done.

A new example demonstrates a simple level editor that takes only 6 or so events and supports ‘undo’ and ‘redo’. It is Unicode only because I accidentally opened saved it in MMF  Unicode. Opps. Speaking of which, there are lots of improvements in the Unicode support. Saving/loading alterable strings and global strings now works fine in Unicode mode, although it is work noting that internally it will always use ANSI strings. This means that you may not get what you put in if it is a character from the extended set.

In addition, some other bugs have been fixed, and so you should update even if you do not plan to use these features.

Now I hope I never have to touch this object again! Hopefully it will be out the way so I can actually release the Chart object, which has been finished for ages but needs a stable release of Ini++ before I can get it out the door.



One Response to Ini++ Update: New ‘Undo’ feature

  1. Pingback: New Expression Editor for Multimedia Fusion « Jack's Personal Blog

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: