DS Server

Javascript: TXTextControl.ZOrder Enumeration

Enumeration|Introduced in 28.0

Description

Specifies how the z-order of a frame (image, text frame, chart, barcode or drawing) can be changed.

Members

MemberDescription
BottomIf the frame is in front of the text, it becomes the bottommost of all objects in front of the text. If it is behind the text, it is becomes the bottommost of all objects.
BottomMostThe frame is moved behind the text below all other objects. This member is only possible, if the insertion mode is BehindTheText.
DownThe frame is moved down one plane. If it is the bottommost object in front of the text, it is not moved behind the text.
TopMostThe frame is moved in front of the text at the top of all other objects.
TopIf the frame is behind the text, it becomes the topmost of all objects behind the text. If it is in front of the text, it becomes the topmost of all objects.
UpThe frame is moved up one plane. If it is the topmost object behind the text, it is not moved in front of the text.

Examples

The following example uses TXTextControl.ZOrder.Bottom (if the frame is in front of the text, it becomes the bottommost of all objects in front of the text. If it is behind the text, it is becomes the bottommost of all objects.) in a document-editing workflow.

function onTxError(error) {
    console.error("TX Text Control error:", error.msg);
    error.handled = true;
}

function applyZOrder(frameBase) {
    frameBase.changeZOrder(
        TXTextControl.ZOrder.Bottom,
        function(result) {
            if (result) {
                console.log("change zorder is available.");
            } else {
                console.warn("change zorder is not available in the current document state.");
            }
        },
        onTxError
    );
}