[gme-users] Recognizing transactions within an add-on

Peter Volgyesi peter.volgyesi at vanderbilt.edu
Mon Jun 7 14:51:57 CDT 2010


For historical(?) reasons MGA sends GLOBALEVENT_NOTIFICATION_READY
after a successfull commit and GLOBALEVENT_ABORT_TRANSACTION after an
aborted transaction. Other than these two you might see the following
global events in practice:

GLOBALEVENT_OPEN_PROJECT: when a new project is opened or created
GLOBALEVENT_CLOSE_PROJECT: when the project is closed
GLOBALEVENT_PROJECT_PROPERTIES: when some property (Author, GUID,
Comment, Name, Version) of the project is changing
GLOBALEVENT_UNDO: after an undo or redo operation (strangely, you can
find a GLOBALEVENT_REDO in the IDL file, but MGA sends this in both
cases - I am hesitant to modify this behavior)

Components can also broadcast their events via MGA (e.g.: the XML
parser does this).

--
peter



On Mon, Jun 7, 2010 at 1:50 PM, Adam Nagel <nagelar at isis.vanderbilt.edu> wrote:
> Thank you, Peter, I think this will work.  However, at the end of the event I see a "GLOBALEVENT_NOTIFICATION_READY" event but I don't see either of the transaction-related notices.  Is there some kind of event mask for global events?
>
>
> -----Original Message-----
> From: gme-users-bounces at list.isis.vanderbilt.edu [mailto:gme-users-bounces at list.isis.vanderbilt.edu] On Behalf Of Peter Volgyesi
> Sent: Monday, June 07, 2010 1:14 PM
> To: gme-users
> Subject: Re: [gme-users] Recognizing transactions within an add-on
>
> At the end of the transaction you will also receive a Global Event
> (either GLOBALEVENT_COMMIT_TRANSACTION or
> GLOBALEVENT_ABORT_TRANSACTION). So, I guess the easiest approach is to
> set a boolean member variable (of your RawComponent) and clear it at
> the end of the transaction. (?)
> --
> peter
>
>
>
> On Mon, Jun 7, 2010 at 1:05 PM, Adam Nagel <nagelar at isis.vanderbilt.edu> wrote:
>> I'm working on an add-on that is designed to prevent the accidental deletion
>> of connections as a result of other actions by the user.  It does this by
>> catching events in RawComponent::ObjectEvent( ... ).  If the user takes an
>> action that would result in the deletion of one or more connections, the
>> component should prompt the user once, and if the user chooses to proceed,
>> then the component should remember that decision and not re-prompt for the
>> rest of the deletions in the transaction.  If the user wants to abort, the
>> component will abort the transaction.
>>
>>
>>
>> Is there some unique information about the current transaction that I can
>> store in the RawComponent class so that it can "remember" the user's choice
>> for every remaining event in the transaction?  Is there a simpler way to get
>> this behavior?
>>
>>
>>
>> Adam Nagel
>>
>> Staff Engineer, Institute for Software Integrated Systems (ISIS)
>>
>> Vanderbilt University
>>
>> nagelar at isis.vanderbilt.edu
>>
>> (615) 294-6393
>>
>>
>>
>> _______________________________________________
>> gme-users mailing list
>> gme-users at list.isis.vanderbilt.edu
>> http://list.isis.vanderbilt.edu/mailman/listinfo/gme-users
>>
>>
> _______________________________________________
> gme-users mailing list
> gme-users at list.isis.vanderbilt.edu
> http://list.isis.vanderbilt.edu/mailman/listinfo/gme-users
> _______________________________________________
> gme-users mailing list
> gme-users at list.isis.vanderbilt.edu
> http://list.isis.vanderbilt.edu/mailman/listinfo/gme-users
>


More information about the gme-users mailing list