ANN: GLX2 3.0.10

Mark Wieder mwieder at ahsoftware.net
Sun Aug 5 21:31:09 EDT 2012


Alejandro-

Sunday, August 5, 2012, 5:35:15 PM, you wrote:

> As I understand, GLX2 version 3.0.10 includes an Undo for everything
> that you wrote in the Script Editor. I am just trying to adapt this Undo
> code
> for vector graphics and all their attributes.

> If the code is well done, it could be extended to every control in the card,
> but first it's necessary to find a way to store only the differences between
> changed states. That is, a differential between each changed state.

> Could this be too difficult? Or Is this the wrong method to store previous
> States
> from a card, where the user could change control attributes and create or
> delete controls?

In glx2 I'm only concerned with undoing changes to the script, and so
I'm storing the htmlText as a single array in a multidimensional
array. Storing the properties could be as easy as adding one more
dimension to the array.

here pObject is the object whose properties you're interested in
and pCount is the undo level (note the propertynames doesn't give you
all the properties, but it's a start):

repeat for each line tProperty in the propertynames
  try
    -- storing a property value into the array
    put the tProperty of pObject into tProp
    put tProp into sUndoPointArray[pObject][pCount][pProperty]
    -- or retrieving a property value from the array
    put sUndoPointArray[pObject][pCount][pProperty] into tProp
  catch e
    -- in a try/catch because some properties can't be set
  end try
end repeat

-- 
-Mark Wieder
 mwieder at ahsoftware.net





More information about the use-livecode mailing list