PlainDocument (クラス)
public PlainDocument {inherits Document}
パッケージ: CURL.ENGINE.APPLET

このドキュメント スタイルでは、Frame の内部にそのコンテンツを配置します。

説明

DefaultDocument と違って ScrollBox が配置されないので、ドキュメント内容が利用可能な領域を超えると、その部分は見えなくなります。その一方で、伸長性を持つオブジェクトは可視領域全体に引き伸ばされます。
HTML ページに Curl アプレットを埋め込む場合は通常、アプレットを PlainDocument で表現します。

次のコードをファイルにコピーし、それをブラウザにロードし、ブラウザ ウィンドウを縮小してみてください。
{document-style PlainDocument}
|| add a rectangle of a fixed size
{Fill 
    background = "yellow",
    width = 5in, 
    height = 5in
}
さらに、次のコードでも実施してみてください。
{document-style PlainDocument}
|| add a rectangle that stretches to fill the window 
{Fill
    background = "yellow"
}

注意事項

Frame はオブジェクトを 1 つしか持てないため、ドキュメント内の最初のオブジェクトだけが表示されます。オブジェクトを追加するときは、VBox などのなんらかの他のコンテナ内部にネストしない限り、エラーが発生します。

また、PlainDocument ドキュメント スタイルは、将来的にはドキュメントよりむしろアプリケーションに近い Curl ページを作成するために、別のメカニズムに置き換えられる可能性があります。

ドキュメントの性質は set-document-propertiesを使用すれば変更できます。これは、ドキュメントのコンテンツを囲む Frame のオプションを設定します。設定されるオプションには 2 つのクラスがあります。

PlainDocument に設定するオプションをいくつか示します。
background:Background
halign:any
hstretch?:bool
valign:any
vstretch?:bool

コンストラクタ
default:PlainDocument を作成します。
コンストラクタ public {PlainDocument.default}

プロパティ
プロパティ 継承 Document: destination-table, document-graphic, extension-table, last-id, scroller, top-level-graphic

メソッド
add-elaborated-form:オブジェクトを現在のドキュメントに追加するため、ローダーによって呼び出されます。
public {PlainDocument.add-elaborated-form val:any}:void
add-error-message:オブジェクトを現在のドキュメントに追加するため、ローダーによって呼び出されます。既定では、Document.add-elaborated-form を呼び出すだけです。
public {PlainDocument.add-error-message val:any}:void
create-top-level-graphic:ブラウザがこのドキュメントを表示するためのオブジェクトを作成します。Document.top-level-graphic を参照してください。
protected {PlainDocument.create-top-level-graphic}:Graphic
メソッド 継承 Document: add-destination, add-target, get-page-position, scroll-to-anchor, set-page-position
メソッド 継承 Object: object-describe, object-describe-for-debugging, object-serialize



コンストラクタ詳細
default (コンストラクタ)
public {PlainDocument.default}

PlainDocument を作成します。

プログラミング注意事項

通常、PlainDocument{document-style PlainDocument} を介して暗黙的に作成されます。



プロパティ詳細


メソッド詳細
add-elaborated-form (メソッド)
public {PlainDocument.add-elaborated-form val:any}:void

オブジェクトを現在のドキュメントに追加するため、ローダーによって呼び出されます。



add-error-message (メソッド)
public {PlainDocument.add-error-message val:any}:void

オブジェクトを現在のドキュメントに追加するため、ローダーによって呼び出されます。既定では、Document.add-elaborated-form を呼び出すだけです。

オーバーライド

追加されるアイテムがエンジンからのエラーメッセージか、Document のアイテムであるかをサブクラスが確認する必要がある場合、サブクラスでこのメソッドをオーバーライドする必要があります。


create-top-level-graphic (メソッド)
protected {PlainDocument.create-top-level-graphic}:Graphic

ブラウザがこのドキュメントを表示するためのオブジェクトを作成します。Document.top-level-graphic を参照してください。