これは RuntimeRevolution 1.1.1 のヘルプにある文書を邦訳したものです。この文書の文責はUDIにあり、またUDIはこの文書についての一切の債務を負いません。 間違いがありましたら eudio@chabashira.co.jp までお知らせ下さい。この文書は必要と思われる時に適宜アップデートされます。
Help -> Revolution Documantation -> Development Guide -> Objects & messages -> About... object types and object references
About object types and object references
オブジェクトタイプとオブジェクトの参照
==============
参照:
--------------
About messages and the message path, Memory and Limits Reference, How to refer to a control on another card, Object menu > Object Properties, View menu > Application Overview, control keyword, ID property, marked keyword, mouseControl function, mouseStack function, name property, number property, owner property, recent keyword, templateAudioClip keyword, templateButton keyword, templateCard keyword, templateEPS keyword, templateField keyword, templateGraphic keyword, templateGroup keyword, templateImage keyword, templatePlayer keyword, templateScrollbar keyword, templateStack keyword, templateVideoClip keyword
オブジェクトとは、Revolution アプリケーションを構成する要素である。スクリーンに見える全てのものは、メニューバーのメニューも、スタックウィンドウも、その中のボタンやフィールドも、全てオブジェクトである。
このトピックでは、Revolution の12のオブジェクトタイプと、ハンドラからオブジェクトを参照する方法と、オブジェクトをグループにまとめる方法について解説する。
このトピックを充分に理解するためには、コントロールの作り方と、オブジェクト階層についての知識が必要である。 'Getting Started' チュートリアルが済んでいるなら、このトピックを理解するための知識は得られている。
Contents:
Revolution Objects
Stacks
Cards
Buttons
Fields
Scrollbars
Images
Graphics
Players
EPS Objects
Audio Clips
Video Clips
Groups
Referring to Objects
Revolution Objects
Revolution のオブジェクト
Revolution には12種類のオブジェクトがある:スタック、カード、ボタン、フィールド、スクロールバー、イメージ、グラフィックス、プレイヤー、EPS、オーディオクリップ、ビデオクリップ、そしてグループ。各オブジェクトタイプはそれぞれ独自の外観と動作を持ち、そのオブジェクトで使う独自のプロパティを持っている。 Revolution のオブジェクトは、全てこのどれかである。
Stacks
スタック
スタックは Revolution のオブジェクトの基本要素である。全てのウィンドウはスタックである。
Revolution の各スタックファイルは、少なくとも1つのメインスタックを持ち、複数のサブスタックを含むことが出来る。メインスタックとサブスタックは同じ構造と外観を持ち、同じようなオブジェクトを含めることが出来る。
メインスタックは少なくとも1つのカードと、いくつかのバックグラウンド、オーディオクリップ、ビデオクリップ、サブスタックを持つことが出来る。メインスタックは他のオブジェクトに含むことは出来ず、オブジェクト階層のトップに位置する。
サブスタックは少なくとも1つのカードと、いくつかのバックグラウンド、オーディオクリップ、ビデオクリップを持つことが出来る。サブスタックはメインスタックに含まれる。
スタックは、stack、window、wd を使って参照する:
show stack "My Stack" go card 3 of wd "Some Stack" set the name of window 3 to "Help"A note about stack names:
go card 3 set the backgroundColor of this cd to "black"
select button "Font" set the top of btn myButton to zero
select after text of field "Content" set the showBorder of fld 3 to false
get the rect of image "Splash" put myPictureData into img ID 2231イメージは、イメージオブジェクト自身の持つデータだけでなく、外部のピクチャーファイルの内容を表示することも出来る。
select graphic "Divider Line" set the visible of grc thisGrc to false
set the rect of player "Bouncing Betty" to myRectプレイヤーは自分のデータを持つことは出来ない。プレイヤーが表示するのは外部にあるムービーやサウンドである。プレイヤーで表示するファイルを指定するには、プレイヤーの fileName プロパティにそのファイルのファイルパスをセットするか、File メニューの 'Import Referenced Control' サブメニューにある、'Quicktime-Supported File' を選択する。(訳注:「'New Referenced Control' サブメニュー」の間違いと思います)
delete EPS "Form Layout"
play audioClip "Eeek!"
play videoClip "Munch Animated Scream"
set the vScroll of group "Main" to 50 select group ID 844またグループは、background、bkgnd、bg で参照することも出来る。グループの参照にこれらの用語を使った場合、それはカード上のグループだけを指すのではなく、スタックにあるグループのどれかを指す。
set the loc of button "OK" to 32,104オブジェクトの名前を変更するには、オブジェクトのプロパティパレットの name 欄を使うか、set コマンドを使ってオブジェクトの name プロパティを変更する:
set the name of field "Old Name" to "New Name" select after text of field "New Name"Referring to objects by number:
set the backgroundColor of field 3 to blueカードやコントロールの番号を変更するには、オブジェクトのプロパティパレットの Layer 欄を使うか、set コマンドを使ってオブジェクトの layer プロパティを変更する:
set the layer of field "Backmost" to 1ティップス: 新しいオブジェクトは常にトップレイヤーに作られる。作ったばかりのオブジェクトを参照するには、last という語を使うことが出来る:
create button set the name of last button to "My New Button"Referring to objects by ordinal:
go to last cardReferring to objects by ID:
go to card ID 1154オブジェクトの ID プロパティは変更することが出来ない。(スタックを除く)
set the backgroundColor of this stack to white send "mouseUp" to this card set the textFont of this card of stack "Menubar" to "Sans"Control references:
hide control ID 2566 send mouseDown to control "My Button" set the hilite of control 20 to falseオブジェクトタイプと番号を使ってコントロールを参照した場合は、そのオブジェクトタイプ中の番号を指す。例えば field 1 というフレーズは、そのカードの一番奥にあるフィールドを指す。しかしこれは一番奥のコントロールであるとは限らない。そのフィールドよりも奥に、他のタイプのコントロールがあるかも知れない。
show button "My Button" of card "My Card"ネストしたオブジェクトの参照で、それぞれの階層の参照に、名前、番号、順番、ID を混在することが出来る。唯一の制限は、参照の順序がオブジェクト階層の順序と同じになるように、オブジェクトからそのオブジェクトのオーナーへ向かっていなければならないことである:
field ID 34 of card "Holder" player 2 of group "Main" of card ID 20 of stack "Demo" first card of this stack stack "Dialog" of stack "Main" -- "Dialog" is a substackもしカード上にあるオブジェクトをカードの指定なしで参照した場合、Revolution はそれをカレントカード上のオブジェクトとして扱う。もしスタックの指定が無かった場合は、Revolution はそれをカレントスタック上のオブジェクトとして扱う。
button "Guido" button "Guido" of card 5 button "Guido" of group "Stereotypes" button "Guido" of group "Stereotypes" of card 5もしカード上に 'Guido' というボタンが他に無ければ、これらの表現式は全て正しい。もし別のグループ(またはグループではなくカード上)に同じ名前のボタンがある場合は、正しいボタンを参照するためにグループを指定する(2番目と3番目の書式)か、ボタンを ID で指定しなければならない。