w

指定したフォームデザインオブジェクトの幅を判定します。

構文

Reference_Syntax.w( OBJECT param1 [, STRING param2 [, INTEGER param3 ] ] )

パラメーター

param1

areacontentAreadrawfieldpageAreasubform のいずれかの XML フォームオブジェクトモデルのオブジェクトの完全修飾参照構文式です。

param2(オプション)

戻り値の単位のタイプを表す文字列です。空白の場合、デフォルトの単位のタイプはポイントです。

param3(オプション)

オブジェクトの幅を取得するコンテンツ領域を示すゼロベースのインデックス値を表す整数値です。空白の場合、デフォルトの値は 0 です。

このパラメーターを使用すると、ページなど複数のコンテンツ領域に分散するオブジェクトの幅を計算できます。例えば、複数のコンテンツ領域にまたがるサブフォームオブジェクトの幅を確認する場合は、このパラメーターを使用して各コンテンツ領域のサブフォームの幅を列挙してすべて合計します。

戻り値

現在のコンテンツ領域にあるフォームデザインオブジェクトの幅です。

適用先

モデル

オブジェクト

レイアウトモデル

layoutPseudoModel

バージョン

XFA 2.1

JavaScript

// Returns the width of a single instance of TextField1 
xfa.layout.w(TextField1,"in"); 
 
// Calculates the width of Subform1 across two content areas and displays 
// the total in a message box. 
var iWidth = xfa.layout.w(Subform1,"in",0) + xfa.layout.w(Subform1,"in",1); 
xfa.host.messageBox(iWidth);

FormCalc

// Returns the width of a single instance of TextField1 
xfa.layout.w(TextField1,"in") 
 
// Calculates the width of Subform1 across two content areas and displays 
// the total in a message box. 
var iWidth = xfa.layout.w(Subform1,"in",0) + xfa.layout.w(Subform1,"in",1) 
xfa.host.messageBox(iWidth)