void MarkCurrObject( void ) /*************************/ { /* mark the current object */ OBJPTR currobj; currobj = GetPrimaryObject(); if( currobj != NULL ) { ObjMark( currobj ); } }
OBJPTR FMEDITAPI GetCurrObject( void ) /************************************/ { /* return pointer to the current object */ OBJPTR obj; OBJPTR userobj; obj = GetPrimaryObject(); userobj = NULL; if( obj != NULL ) { OBJ_DISPATCHER( obj )( GET_OBJPTR, obj, &userobj, NULL ); } return( userobj ); }
extern void Align( WPARAM wparam ) /********************************/ { /* Perform the requested alignment of current objects relative to the primary * object */ OBJPTR currobj; OBJPTR primary; RECT primrect; RECT rect; BOOL atleasttwo; POINT offset; LIST *objlist; primary = GetPrimaryObject(); if( primary == NULL ) { return; } atleasttwo = FALSE; currobj = GetECurrObject(); while( currobj != NULL && !atleasttwo ) { if( currobj != primary ) { atleasttwo = TRUE; } else { currobj = GetNextECurrObject( currobj ); } } if( !atleasttwo ) { return; } if( !CheckMoveOperation( &objlist ) ) { return; } BeginMoveOperation( objlist ); ListFree( objlist ); currobj = GetECurrObject(); primary = GetPrimaryObject(); Location( primary, &primrect ); while( currobj != NULL ) { if( currobj != primary ) { Location( currobj, &rect ); switch( LOWORD( wparam ) ) { case IDM_FMLEFT: offset.x = primrect.left - rect.left; offset.y = 0; break; case IDM_FMHCENTRE: offset.x = ((primrect.right + primrect.left) / 2) - ((rect.right + rect.left) / 2); offset.y = 0; break; case IDM_FMRIGHT: offset.x = primrect.right - rect.right; offset.y = 0; break; case IDM_FMTOP: offset.x = 0; offset.y = primrect.top - rect.top; break; case IDM_FMVCENTRE: offset.x = 0; offset.y = ((primrect.bottom + primrect.top) / 2) - ((rect.bottom + rect.top) / 2); break; case IDM_FMBOTTOM: offset.x = 0; offset.y = primrect.bottom - rect.bottom; break; } Move( currobj, &offset, TRUE ); } currobj = GetNextECurrObject( currobj ); } FinishMoveOperation( TRUE ); }