Update_Register

 

The program keep a 64 bit flag of most of the changes that happens. If one of these changes affect your module, you need to know about it when it happens.  You can use the "Update_Register" function to ask sliceOmatic to let you know of the changes.  The program will call your function "Update_A" and "Update_B" when one of the update condition you registered for occurs.

 

The function does not accept any arguments and it return a 64 bit unsigned integer value containing all the "update" bits that you want to be used to generate a callback.

 

A list of all the update bits can be found in the file "flag_update.hpp".

 

Syntax

 

extern "C" __declspec(dllexportUInt64  Update_Register(

          void

)

 

 

Parameters

 

This function does not have a parameter.

 

 

Return value

 

The function returns an "or" of all the "Update Flag" values that it want to register for.

 

 

Remarks

 

This function is optional.  If you do not want to register to any updates, you can omit it.

The update bits "UPDATE_USER_1" to "UPDATE_USER_8" do not generate any callback, They are intended for local use within your module.

The update bits "UPDATE_DELAY_ON" and "UPDATE_DELAY_OFF" do not generate any callback, They are used internally by sliceOmatic to stop/start the update mechanism.

 

If on the, other hand, you change one of the variables that are covered by the update flag, you should notify sliceOmatic of these changes so that it can update the flag.  To do this you use the "Fct_Update()" function.

 

Example: Your module change the current TAG value.

 

...

 

// --- Get a pointer to the TAG_Cur variable ---

unsigned short *TAG_Cur = (unsigned short *) Fct_Variable_Get( "$TAG_CUR" ) ;

 

// --- change the value of TAG_Cur ---

*TAG_Cur = 1 ;

 

// --- Let the program know about it ---

Fct_Update( UPDATE_CUR_TAG ) ;

 

...

 

 

Requirements

 

Header:

          sliceO_include.hpp

 

Library:

          sliceO_Structures.lib

 

 

Example

 

This is the "Update_Register" function for the "Edit.dll" module.

 

...

 

// ----------------------------------------------------------------------------

//

//          Update_Register

//

//          We want to be called back if one of these condition change

//

// ----------------------------------------------------------------------------

extern "C" __declspec(dllexport) UInt64          Update_Register( void )

{

          return( UPDATE_UNDO                              // change in the undo status

                | UPDATE_ERASE                              // change in the "erase" buffer

                | UPDATE_SELECTION                    // The current selection has changed

                | UPDATE_TAG_LOCK                              // The TAG_Lock has changed

                | UPDATE_TAG_LABEL                    // The TAG_Label has changed

                | UPDATE_COLOR_TAG                    // The color of the tag have changed

                | UPDATE_CUR_TAG                              // the current tag has changed

                | UPDATE_CUR_BRUSH ) ;                    // the current brush has changed

}

 

...

 

See also

 

Update_A

Update_B

Fct_Update