4.4:Using the Geometry Manager

ジオメトリ・マネジャを使う

Use the Geometry Manager to specify how objects should be scaled and positioned when the user resizes the window.

ジオメトリ・マネジャは、ユーザーがウインドウの大きさを変更した時に、ウインドウに配置されたオブジェクトの縮小拡大や位置の調整を指定するのに使います。

Figure 44 – The Geometry Manager

図44 ー ジオメトリ・マネジャ


all_img_91



Scale or Position Selector Choose whether you want the control to be scaled or positioned when the stack is resized. Scaling will change the dimensions of the control as the stack resizes. Positioning will move the control, it does not change its dimensions. Note that it is possible to scale an object in the horizontal plane and have it position in the vertical. Select Scale then set the options for one axis in the Linking area. Then select Position and set the options for the other axis. If you set options in both the Scale and Position modes for both axis, the Scaling options will be ignored.
拡大縮小、位置選択 スタックの大きさが変更された時に、コントロールの拡大縮小を行うのか、位置変更を行うのかを指定します。拡大縮小は、スタックの大きさが変更された時に、コントロールの寸法を変更します。位置変更では、コントロールの寸法は変更せずに、位置を変更します。オブジェクトの水平面を拡大縮小し、垂直面の位置変更を行うことも可能です。拡大縮小を選択し、リンク設定エリアの一方の軸にあるオプションを設定します。次に、位置を選択し、他の軸のオプションを設定します。両軸の拡大縮小と位置変更の二つのオプションを設定すると、拡大縮小オプションは無視されます。
Linking area Use the linking area to specify the relationship between the control and the window, or other controls as the stack is resized. In Scaling mode you can link each edge of the object to the window or another object. In positioning mode, you can only link the X and Y axis of an object. Clicking the gray bars to create a link. A single click results in an absolute link, a second click will create a relative link.

An absolute link will keep the object the current number of pixels away from what it is being linked to. For example, if you link the right edge to the edge of the window and the edge is currently 10 pixels away from the edge of the window, whenever the stack is resized the edge will remain exactly 10 pixels away. However if you use a relative link the distance will be calculated as a percentage of the total width of the card. The object will remain the same percentage away from the edge of the card, the exact number of pixels will vary.

When linking to another control, be sure to link to a control that is moved relative to the window, or by a script (e.g. in a resizeStack handler).

When using the Geometry Manager with an existing resizeStack handler, be sure to pass the resizeStack message, otherwise the Geometry Manager will not be able to take effect.

To force the Geometry to manually update, call revUpdateGeometry.
リンク設定エリア リンク設定エリアを使って、コントロールとウインドウの、或いはスタックが拡大縮小された時の他のコントロール同士の関係を指定します。拡大縮小モードでは、オブジェクトの各端をウインドウか他のオブジェクトにリンクさせることができます。位置選択モードでは、オブジェクトのX辺とY辺のみをリンクさせることができます。グレーのバーをクリックしてリンクを作製します。クリック一回では絶対的なリンクを、二回目のクリックで相対的なリンクが設定されます。

絶対的リンクでは、リンクされたオブジェクトから、現在と同じピクセル数だけオブジェクトを離して設置します。例えば、右端をウインドウの端にリンクしたして、今のウインドウの端からの間隔が10ピクセルだとすると、スタックが拡大縮小されても常に、ウインドウの端から10ピクセル離れた場所に表示されます。処が、相対的リンクを使うと、ウインドウの端からの間隔は、カード全体の幅の何割であるかを計算してから決定されるので、オブジェクトのウインドウの端からの距離は拡大縮小に伴うカード・サイズの変動によってもその割合を保ち表示されることになり、ウインドウの端からのピクセル数はその都度異なることになります。

他のコントロールとリンクさせた場合は、ウインドウに対して相対的に位置が決まるコントロールにリンクするか、(resizeStackハンドラ内の)スクリプトによって設定してください。

既に存在するresizeStackハンドラとともにジオメトリ・マネジャを使う時は、resizeStackメッセージをパスするようにしてください。そうしないと、ジオメトリ・マネジャは有効に働きません。

ジオメトリ・マネジャを強制的に更新させるには、revUpdateGeometryを呼びだします。
Tip: You can use the Geometry Manager to scale objects with a divider bar. L(l)ink the edges of the controls to the divider bar, add a script in the divider to move in response to a mouse action, then call revUpdateGeometry each time it moves to have the objects scale automatically.
秘訣: ジオメトリ・マネジャは区切りバーとともにオブジェクトを拡大縮小するのに使うことができます。コントロールの端を区切りバーにリンクし、マウスの動きに反応して動くよう区切り内のスクリプトを付加し、次にオブジェクトが自動的に拡大縮小する度に revUpdateGeometryを呼びだします。
Clipping settings Turn on Prevent Object Clipping Text to prevent the control getting too small to display its label when the window is resized. If the control is a field, you can also turn on the option to display scroll bars if the text within the field does not fit.
クリップ設定 Prevent Object Clipping Textをオンにすると、ウインドウのサイズ変更が行われた時に、コントロールがそのラベルを表示できないほど縮小されるのを防ぐことができます。コントロールがフィールドの場合、フィールド内のテキストがフィールドの大きさに合致しない時に、スクロールバーを表示させるオプションを設定することもできます。
Limit settings Allows you to set the minimum and maximum possible widths and heights for the object.
限界設定 オブジェクトのとりうる最小又は最大の幅と高さを設定することができます。
Remove All Removes all Geometry settings from the control. Use this option if the settings you have applied do not give the desired effect and you want to start over.
全てを削除 コントロールから全てのジオメトリ設定を削除します。設定した各オプションが思い通りの結果とならない場合に、最初からやり直すのにこのオプションを使います。


The Geometry Card Settings options can be accessed from within the Card Property Inspector. Use these options to determine how Geometry is applied to the controls within the current card.

ジオメトリ・カード設定のオプションは、カード・プロパティ・インスペクタからアクセスできます。現在のカードのコントロールにジオメトリがどのように適用されるかを決定するためにこれらのオプションを使います。

Figure 45 – Geometry Card Settings

図45 ー ジオメトリ・カード設定



all_img_93



Add to cards virtual width or height Use this option to implement a layout that allows a section of optional controls to be folded out. The Geometry manager will ignore the extra height or width pixels specified in this area, resizing objects as if that area of the card has not been “expanded”. Normally these values are set by script as the window is resized to fold out additional controls. To set these properties by script, set the cREVGeneral[“virtualWidth”] or cREVGeneral[“virtualHeight”] card properties.
カードに仮想幅、仮想高を加える このオプションを使うと、レイアウトに広げることのできる付加的なコントロール部分を実装できるようになります。ジオメトリ・マネジャは、オブジェクトを拡大縮小した時に、このエリアは拡大せずに、このエリアに設定された臨時の高さや幅に相当するピクセルを無視するようになります。通常この値は、付加的なコントロールを広げるためにウインドウを拡大するスクリプトにより設定されます。スクリプトによりこれらのプロパティを設定するには、 cREVGeneral[“virtualWidth”] cREVGeneral[“virtualHeight”] かのカード・プロパティを設定します([]内にはピクセル数が入ります)。
Update before opening card Causes the objects to be resized when navigating to the card if the window has been resized while on another card. This option is not needed if the controls are contained within a background that has already been correctly resized to the current window dimensions.
カードを開く前に更新する カードをたどっていく時に、他のカードを開いている間にウインドウが拡大縮小した場合に、オブジェクトを拡大縮小します。現在のウインドウの寸法に従って既に適切に拡大縮小されているバックグラウンドにコントロールが設置されている場合は、このオプションは不必要です。