Files
cdesktop/cde/doc/ja_JP.dt-eucJP/guides/progGuide/ch07.sgm

2973 lines
121 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!-- $XConsortium: ch07.sgm /main/10 1996/09/08 19:37:00 rws $ -->
<!-- (c) Copyright 1995 Digital Equipment Corporation. -->
<!-- (c) Copyright 1995 Hewlett-Packard Company. -->
<!-- (c) Copyright 1995 International Business Machines Corp. -->
<!-- (c) Copyright 1995 Sun Microsystems, Inc. -->
<!-- (c) Copyright 1995 Novell, Inc. -->
<!-- (c) Copyright 1995 FUJITSU LIMITED. -->
<!-- (c) Copyright 1995 Hitachi. -->
<Chapter Id="PG.widgs.div.1">
<Title Id="PG.widgs.mkr.1">共通デスクトップ環境の Motif ウィジェット</Title>
<Para>共通デスクトップ環境は、Motif ツールキットを提供します。<IndexTerm>
<Primary>Motif ライブラリ</Primary>
</IndexTerm><IndexTerm>
<Primary>ライブラリ</Primary>
<Secondary>Motif</Secondary>
</IndexTerm><IndexTerm>
<Primary>ウィジェット</Primary>
<Secondary>Motif</Secondary>
</IndexTerm>
さらに、
共通デスクトップ環境 は、
<IndexTerm>
<Primary>OPEN LOOK 互換性</Primary>
</IndexTerm><IndexTerm>
<Primary>互換性</Primary>
<Secondary>OPEN LOOK</Secondary>
</IndexTerm>OPEN LOOK&trade;と
<IndexTerm>
<Primary>MWウィンドウ互換性</Primary>
</IndexTerm><IndexTerm>
<Primary>互換性</Primary>
<Secondary>MWウィンドウ</Secondary>
</IndexTerm>Microsoft&reg; ウィンドウの特定の機能を提供するために使用できる4つのカスタム・ウィジェットを提供します。
この章では、Motifカスタム・ウィジェットについて説明します。</Para>
<InformalTable Id="PG.widgs.itbl.1" Frame="All">
<TGroup Cols="1">
<ColSpec Colname="1" Colwidth="4.0 in">
<TBody>
<Row Rowsep="1">
<Entry><Para><!--Original XRef content: ''-->
<XRef Role="CodeOrFigureOrTable" Linkend="PG.widgs.mkr.2">
<!--Original XRef content: 'Using Common Desktop Environment Motif70'-->
<XRef Role="JumpText" Linkend="PG.widgs.mkr.2"></Para></Entry>
</Row>
<Row Rowsep="1">
<Entry><Para><!--Original XRef content: 'Text Field and Arrow Button Widget (DtSpinBox)73'-->
<XRef Role="JumpText" Linkend="PG.widgs.mkr.3"></Para></Entry>
</Row>
<Row Rowsep="1">
<Entry><Para><!--Original XRef content: 'Text Field and List Box Widget (DtComboBox)82'-->
<XRef Role="JumpText" Linkend="PG.widgs.mkr.8"></Para></Entry>
</Row>
<Row Rowsep="1">
<Entry><Para><!--Original XRef content: 'Menu Button Widget (DtMenuButton)89'-->
<XRef Role="JumpText" Linkend="PG.widgs.mkr.13"></Para></Entry>
</Row>
<Row Rowsep="1">
<Entry><Para><!--Original XRef content: 'Text Editor Widget (DtEditor)94'-->
<XRef Role="JumpText" Linkend="PG.widgs.mkr.17"></Para></Entry>
</Row>
</TBody>
</TGroup>
</InformalTable>
<Para>
<IndexTerm>
<Primary>ウィジェット</Primary>
<Secondary>ライブラリ</Secondary>
</IndexTerm><IndexTerm>
<Primary>ライブラリ</Primary>
<Secondary>ウィジェット</Secondary>
</IndexTerm><IndexTerm>
<Primary>&lt;Filename>libDtWidget&lt;Default Para Font>ライブラリ</Primary>
</IndexTerm><IndexTerm>
<Primary>ライブラリ</Primary>
<Secondary>&lt;Filename>libDtWidget&lt;Default Para Font></Secondary>
</IndexTerm>ウィジェット・ライブラリ、 <Command>libDtWidget</Command>には、既存のMotif 2.1ウィジェットの機能を組み合わせたり、拡張する4つのウィジェットがあります。
:</Para>
<ItemizedList Remap="Bullet1">
<ListItem>
<Para><Command><IndexTerm>
<Primary>&lt;Filename>DtSpinBox&lt;Default Para Font> ウィジェット</Primary>
</IndexTerm><IndexTerm>
<Primary>ウィジェット</Primary>
<Secondary>&lt;Filename>DtSpinBox&lt;Default Para Font></Secondary>
</IndexTerm><IndexTerm>
<Primary>ウィジェット</Primary>
<Secondary>テキスト・フィールドと矢印ボタン</Secondary>
</IndexTerm><IndexTerm>
<Primary>テキスト・フィールドと矢印ボタン・ウィジェット</Primary>
</IndexTerm><IndexTerm>
<Primary>矢印ボタンとテキスト・フィールド・ウィジェット</Primary>
</IndexTerm><IndexTerm>
<Primary>ウィジェット</Primary>
<Secondary>矢印ボタンとテキスト・フィールド</Secondary>
</IndexTerm>DtSpinBox</Command>は、テキスト・フィールドと矢印ボタンを組み合わせたコントロールを作成して、数値またはテキスト値を増減できます。
これは、<Command>XmSimpleSpinBox</Command>によります。</Para>
</ListItem>
<ListItem>
<Para><Command><IndexTerm>
<Primary>&lt;Filename>DtComboBox&lt;Default Para Font> ウィジェット</Primary>
</IndexTerm><IndexTerm>
<Primary>ウィジェット</Primary>
<Secondary>&lt;Filename>DtComboBox&lt;Default Para Font>、ウィジェット</Secondary>
<Tertiary>テキスト・フィールド とリスト・ボックス</Tertiary>
</IndexTerm><IndexTerm>
<Primary>ウィジェット</Primary>
<Secondary>リスト・ボックスとテキスト・フィールド</Secondary>
</IndexTerm><IndexTerm>
<Primary>リスト・ボックスとテキスト・フィールド・ウィジェット</Primary>
</IndexTerm><IndexTerm>
<Primary>テキスト・フィールドとリスト・ボックス・ウィジェット</Primary>
</IndexTerm>DtComboBox</Command>は、テキスト・フィールドとリスト・ボックスを組み合わせたコントロールを作成して、テキスト・フィールドに対する多数の有効な選択項目の1つを表示します。
これは、<Command>XmComboBox</Command>によります。</Para>
</ListItem>
<ListItem>
<Para><Command><IndexTerm>
<Primary>&lt;Filename>DtMenuButton&lt;Default Para Font> ウィジェット</Primary>
</IndexTerm><IndexTerm>
<Primary>ウィジェット</Primary>
<Secondary>&lt;Filename>DtMenuButton&lt;Default Para Font></Secondary>
</IndexTerm><IndexTerm>
<Primary>メニュー・ウィジェット、ポップアップ</Primary>
</IndexTerm><IndexTerm>
<Primary>ポップアップ・メニュー・ウィジェット</Primary>
</IndexTerm><IndexTerm>
<Primary>ウィジェット</Primary>
<Secondary>ポップアップ・メニュー</Secondary>
</IndexTerm>DtMenuButton</Command>は、メニュー・バーの外側に
<IndexTerm>
<Primary>メニュー階層式機能</Primary>
</IndexTerm><IndexTerm>
<Primary>階層式メニュー機能</Primary>
</IndexTerm><IndexTerm>
<Primary>機能</Primary>
<Secondary>階層式メニュー</Secondary>
</IndexTerm>メニュー階層式機能を提供します。
</Para>
</ListItem>
<ListItem>
<Para><Command><IndexTerm>
<Primary>&lt;Filename>DtEditor&lt;Default Para Font> ウィジェット</Primary>
</IndexTerm><IndexTerm>
<Primary>ウィジェット</Primary>
<Secondary>&lt;Filename>DtEditor&lt;Default Para Font></Secondary>
</IndexTerm><IndexTerm>
<Primary>ウィジェット</Primary>
<Secondary>テキスト・エディタ</Secondary>
</IndexTerm><IndexTerm>
<Primary>テキスト・エディタ・ウィジェット</Primary>
</IndexTerm><IndexTerm>
<Primary>エディタ・ウィジェット</Primary>
</IndexTerm>DtEditor</Command>は、カット&ペーストなどの単純なテキスト・エディタ関数を組み込みます。</Para>
</ListItem>
</ItemizedList>
<Para>これらのウィジェットは、すべての共通デスクトップ環境アプリケーションに共通の機能を提供します。
これらのウィジェットは、サブクラス化はサポートしていません。</Para>
<Para>カスタム・ウィジェット・ライブラリは、次のライブラリに直接依存します。:</Para>
<ItemizedList Remap="Bullet1">
<ListItem>
<Para><Command>Xm</Command>Motifスーパークラスのサポートについては<Command>Xm</Command> ライブラリ </Para>
</ListItem>
<ListItem>
<Para>ウィジェットの作成と操作については<Command>Xt</Command> ライブラリ </Para>
</ListItem>
<ListItem>
<Para>ベースX ウィンドウ・システムについては<Command>X11</Command>ライブラリ</Para>
</ListItem>
<ListItem>
<Para><Command>DtEditor</Command>が使用するデスクトップ・サポートについては<Command>DtSvc</Command> </Para>
</ListItem>
</ItemizedList>
<Sect1 Id="PG.widgs.div.2">
<Title Id="PG.widgs.mkr.2">共通デスクトップ環境のMotifの使い方</Title>
<Para>
<IndexTerm>
<Primary>CDE Motif ツールキット</Primary>
</IndexTerm><IndexTerm>
<Primary>Motif ツールキット</Primary>
</IndexTerm><IndexTerm>
<Primary>ツールキット、 Motif</Primary>
</IndexTerm>共通デスクトップ環境はMotif 2.1と4つのカスタム・ウィジェットからなります。
カスタム・ウィジェットは、この章で詳しく述べています。
</Para>
<Para>共通デスクトップ環境は、Motif 1.2 アプリケーションとソースおよびバイナリの互換性があります。
既存のMotif 1.2 アプリケーションは、Motif 2.1 インクルード・ファイルを使用してコンパイルできます。
既存のMotif 1.2バイナリは、Motif 2.1ライブラリを使用して変更を行うことなく実行できます。
</Para>
<Sect2 Id="PG.widgs.div.3">
<Title>Motifライブラリ<IndexTerm>
<Primary>Motifライブラリ</Primary>
</IndexTerm><IndexTerm>
<Primary>ライブラリ</Primary>
<Secondary>Motif</Secondary>
</IndexTerm></Title>
<Para>Motif 2.1およびX11R6.2 ライブラリは、Xウィンドウ・システム用の共通デスクトップ環境のMotif準拠アプリケーションを開発するために使用します。
</Para>
<Sect3 Id="PG.widgs.div.4">
<Title>Motifライブラリ(libXm)</Title>
<Para>共通デスクトップ環境 は、すべての
<IndexTerm>
<Primary>Motif ヘッダ・ファイル</Primary>
</IndexTerm><IndexTerm>
<Primary>ヘッダ・ファイル</Primary>
<Secondary>Motif</Secondary>
</IndexTerm>Motif 2.1 ヘッダ・ファイルを提供します。</Para>
</Sect3>
<Sect3 Id="PG.widgs.div.5">
<Title>Motif UIL ライブラリ(libUil)<IndexTerm>
<Primary>Motif UIL ライブラリ</Primary>
</IndexTerm><IndexTerm>
<Primary>ライブラリ</Primary>
<Secondary>Motif UIL</Secondary>
</IndexTerm><IndexTerm>
<Primary>ライブラリ</Primary>
<Secondary>&lt;Filename>libUil&lt;Default Para Font></Secondary>
</IndexTerm><IndexTerm>
<Primary>&lt;Filename>libUil&lt;Default Para Font></Primary>
</IndexTerm></Title>
<Para>Motif ユーザ・インタフェース言語 (UIL)Motif アプリケーションのユーザ・インタフェースの初期状態を記述するための指定言語です。
</Para>
<Para>UILにアクセスするには、
<IndexTerm>
<Primary>ヘッダ・ファイル</Primary>
<Secondary>Motif UIL ライブラリ</Secondary>
</IndexTerm><IndexTerm>
<Primary>Motif UIL ライブラリ</Primary>
<Secondary>ヘッダ・ファイル</Secondary>
</IndexTerm><IndexTerm>
<Primary>&lt;Filename>UilDef.h&lt;Default Para Font>ヘッダ・ファイル</Primary>
<Secondary>&lt;Filename>Uil.Def.h&lt;Default Para Font></Secondary>
</IndexTerm><Filename>uil/UilDef.h</Filename> ヘッダ・ファイルを組み込みます。</Para>
</Sect3>
<Sect3 Id="PG.widgs.div.6">
<Title>Motif リソース・マネージャ・ライブラリ(libMrm)<IndexTerm>
<Primary>Motifリソース・マネージャ・ライブラリ</Primary>
</IndexTerm><IndexTerm>
<Primary>ライブラリ</Primary>
<Secondary>Motifリソース・マネージャ</Secondary>
</IndexTerm><IndexTerm>
<Primary>ライブラリ</Primary>
<Secondary>&lt;Filename>libMrm&lt;Default Para Font></Secondary>
</IndexTerm><IndexTerm>
<Primary>&lt;Filename>libMrm&lt;Default Para Font> ライブラリ</Primary>
</IndexTerm></Title>
<Para>Motifリソース・マネージャ(MRM)は、UILコンパイラが作成したユーザ・インタフェース定義(UID) ファイルにある定義に基づいて、ウィジェットを作成します。
MRMは、UILコンパイラの出力を解釈し、ウィジェット作成関数に対する適切な引数リストを生成します。
Motifリソース・マネージャにアクセスするには、<Command>libMrm</Command>を使用します。
</Para>
<Para>アプリケーションの中で<Command>libMrm</Command> にアクセスするには、
<IndexTerm>
<Primary>Motif リソース・マネージャ・ヘッダ・ファイル</Primary>
</IndexTerm><IndexTerm>
<Primary>&lt;Filename>MrmPublic.h&lt;Default Para Font> ヘッダ・ファイル</Primary>
</IndexTerm><IndexTerm>
<Primary>ヘッダ・ファイル&lt;Filename>MrmPublic.h&lt;Default Para Font></Primary>
</IndexTerm><Filename>Mrm/MrmPublic.h</Filename> ヘッダ・ ファイルを組み込みます。
</Para>
</Sect3>
</Sect2>
<Sect2 Id="PG.widgs.div.8">
<Title>強化機能<IndexTerm>
<Primary>強化機能</Primary>
</IndexTerm><IndexTerm>
<Primary>強化</Primary><Secondary>機能</Secondary>
</IndexTerm></Title>
<Para>Motif 2.1 は、OPEN LOOKおよびMicrosoft Windowsのユーザにとってより使いやすくするためのマイナー強化が含まれています。
より使いやすくするための機能としては、次のものがあります。:</Para>
<ItemizedList Remap="Bullet1">
<ListItem>
<Para>3ボタン・マウスのボタンを使用して現在の選択を広げることができます。
この機能は、
<IndexTerm>
<Primary>OPEN LOOK</Primary>
<Secondary>マウス機能</Secondary>
</IndexTerm><IndexTerm>
<Primary>マウス機能、 OPEN LOOK</Primary>
</IndexTerm>OPEN LOOK
ADJUST マウス・ボタンに相当します。</Para>
</ListItem>
<ListItem>
<Para>
<IndexTerm>
<Primary>タブ・ナビゲーション</Primary>
</IndexTerm><IndexTerm>
<Primary>ナビゲーション、タブ</Primary>
</IndexTerm>タブを使用して、<Command>PushButton</Command> ウィジェットとガジェット、 <Command>ArrowButton</Command>ウィジェットとガジェット、および
<Command>DrawnButton</Command>
ウィジェットのグループ内を移動できます。</Para>
</ListItem>
<ListItem>
<Para>ボタン 3で<Command>CascadeButton</Command> メニューを起動できます。</Para>
</ListItem>
<ListItem>
<Para><Command><IndexTerm>
<Primary>&lt;Filename>XmFileSelectionBox&lt;Default Para Font> ウィジェット・リソース</Primary>
</IndexTerm><IndexTerm>
<Primary>リソース</Primary>
<Secondary>&lt;Filename>XmFileSelectionBox&lt;Default Para Font> ウィジェット</Secondary>
</IndexTerm><IndexTerm>
<Primary>ウィジェット</Primary>
<Secondary>&lt;Filename>XmFileSelectionBox&lt;Default Para Font></Secondary>
</IndexTerm>XmFileSelectionBox</Command> ウィジェットに3つの新しいリソース(<Command>pathMode, fileFilterStyle,</Command>、および<Command>dirTextLabelStrin</Command>g)を提供し、新しいルック・アンド
・フィールドを与えます。
<Command>XmFileSelectionBox</Command>の新しいリソースの詳細については、<Emphasis>共通デスクトップ環境:
プログラマ概要</Emphasis>を参照してください。
</Para>
</ListItem>
<ListItem>
<Para>Motif仮想キーに複数のキーを割り当てることによって、OPEN LOOKおよびMicrosoft Windowsとの相互運用を可能にします。
</Para>
</ListItem>
</ItemizedList>
<Para>上記の拡張機能はそれぞれ
ウィジェット・リソース( <Command>XmFileSelectionBox</Command>)またはアプリケーション全体のリソース
(その他すべて)によって制御できます。このリソースのデフォルト値は、Motif 1.2と同一の動作とAPIを提供します。
これらの拡張機能とリソースの詳細については、
<Filename>XmDisplay(3x)</Filename>および<Command>XmFileSelectionBox(3x)</Command> のマニュアル・ページを参照してください。</Para>
</Sect2>
<Sect2 Id="PG.widgs.div.9">
<Title>外観の強化<IndexTerm>
<Primary>Motif外観の強化</Primary>
</IndexTerm><IndexTerm>
<Primary>外観の強化、Motif</Primary>
</IndexTerm><IndexTerm>
<Primary>強化、外観のMotif</Primary>
</IndexTerm></Title>
<Para>共通デスクトップ環境では、次の点で Motifの外観を変更します。
:</Para>
<ItemizedList Remap="Bullet1">
<ListItem>
<Para><Command>RadioBox</Command>の塗りつぶしカラーが、状態をより明確に示すように変更されます。</Para>
</ListItem>
<ListItem>
<Para><Command>RadioBox</Command>の形がダイヤモンド形から円形に変更されます。</Para>
</ListItem>
<ListItem>
<Para>状態をより明確に示すように、<Command>CheckBox</Command>にチェック絵文字が追加されます。</Para>
</ListItem>
<ListItem>
<Para><Command>CascadeButtons</Command> とメニュー項目が、アクティブなときには境界に刻み目が付けられるように変更されます。
</Para>
</ListItem>
<ListItem>
<Para>スケールと区別するために、読みとり専用スケールからつまみが削除されます。</Para>
</ListItem>
<ListItem>
<Para>デフォルトのシャドウの太さが、1ピクセルに変更されます。</Para>
</ListItem>
<ListItem>
<Para>デフォルトのハイライトの太さが、1ピクセルに変更されます。</Para>
</ListItem>
<ListItem>
<Para>デフォルトの<Command>PushButton</Command>の外観は、ボタンのデフォルトのシャドウの内側にハイライトを描きます。
</Para>
</ListItem>
</ItemizedList>
<Para>アプリケーション全体のリソースは、これらの強化機能のそれぞれを制御することができます。
これらのリソースのデフォルト値は、Motif 1.2と同一の動作とAPI を提供します。
</Para>
<Para>これらの強化機能の詳細については、<Filename MoreInfo="RefEntry">XmDisplay</Filename>(3)、
<Filename MoreInfo="RefEntry">XmPushButton</Filename>(3)、 <Filename MoreInfo="RefEntry">XmPushButtonGadget</Filename>(3)、 <Filename MoreInfo="RefEntry">XmToggleButton</Filename>(3)、
<Filename MoreInfo="RefEntry">XmToggleButtonGadget</Filename>(3)、および <Filename MoreInfo="RefEntry">XmScale</Filename>(3)のマニュアル・ページを参照してください。</Para>
</Sect2>
</Sect1>
<Sect1 Id="PG.widgs.div.10">
<Title Id="PG.widgs.mkr.3">テキスト・フィールドと矢印ボタン・ウィジェット
(DtSpinBox<Filename>)</Filename><IndexTerm>
<Primary>テキスト・フィールドと矢印ボタン・ウィジェット</Primary>
</IndexTerm><IndexTerm>
<Primary>ウィジェット</Primary>
<Secondary>テキスト・フィールドと矢印ボタン</Secondary>
</IndexTerm><IndexTerm>
<Primary>ウィジェット</Primary>
<Secondary>矢印ボタンと
テキスト・フィールド</Secondary>
</IndexTerm><IndexTerm>
<Primary>ウィジェット&lt;Filename>DtSpinBox&lt;Default Para Font></Primary>
</IndexTerm><IndexTerm>
<Primary>&lt;Filename>DtSpinBox&lt;Default Para Font> ウィジェット</Primary>
</IndexTerm></Title>
<Para><Command>DtSpinBox</Command> は、
<IndexTerm>
<Primary>循環ウィジェット</Primary>
</IndexTerm><IndexTerm>
<Primary>ウィジェット</Primary>
<Secondary>循環</Secondary>
</IndexTerm>テキスト項目のリストを循環させたり、数値入力を増減するために使用します。
<Command>DtSpinBox</Command>は、<Command>XmManager</Command>クラスのサブクラスであり、テキスト・フィールド と2個の矢印を表示するために使用されます。
</Para>
<Para><Command>DtSpinBox</Command> ウィジェットは、
<IndexTerm>
<Primary>増減ウィジェット</Primary>
</IndexTerm><IndexTerm>
<Primary>ウィジェット</Primary>
<Secondary>増減</Secondary>
</IndexTerm><IndexTerm>
<Primary>増減ウィジェット</Primary>
</IndexTerm>任意のテキストまたは数値フィールドを増減するために使用されるユーザ・インタフェース・コントロールです。
たとえば、1年の各月または1カ月の各日を循環させることができます。
<!--Original XRef content: 'Figure&numsp;7&hyphen;1'-->
<XRef Role="CodeOrFigureOrTable" Linkend="PG.widgs.mkr.4">に、
<Command>DtSpinBox</Command> ウィジェットの例を示します。</Para>
<Figure>
<Title Id="PG.widgs.mkr.4">DtSpinBox ウィジェットの例<IndexTerm>
<Primary>&lt;Filename>DtSpinBox&lt;Default Para Font>ウィジェット、図</Primary>
</IndexTerm></Title>
<Graphic Entityref="PG.widgs.fig.1" Id="PG.widgs.grph.1"></Graphic>
</Figure>
<Sect2 Id="PG.widgs.div.11">
<Title>ライブラリとヘッダ・ファイル<IndexTerm>
<Primary>ヘッダ・ファイル</Primary>
<Secondary>&lt;Filename>Dt/SpinBox.h&lt;Default Para Font></Secondary>
</IndexTerm><IndexTerm>
<Primary>&lt;Filename>Dt/SpinBox.h&lt;Default Para Font> ヘッダ・ファイル</Primary>
</IndexTerm><IndexTerm>
<Primary>ライブラリ</Primary>
<Secondary>&lt;Filename>libDtWidget&lt;Default Para Font></Secondary>
</IndexTerm><IndexTerm>
<Primary>&lt;Filename>libDtWidget&lt;Default Para Font> ライブラリ</Primary>
</IndexTerm></Title>
<Para><Command>DtSpinBox</Command> ウィジェットは、<Command><IndexTerm>
<Primary>ウィジェット</Primary>
<Secondary>&lt;Filename>libDtWidget&lt;Default Para Font> ライブラリ</Secondary>
</IndexTerm>libDtWidget</Command> ライブラリにあります。ヘッダ・ファイルは、
<Filename>Dt/SpinBox.h</Filename>です。</Para>
</Sect2>
<Sect2 Id="PG.widgs.div.12">
<Title>デモ・プログラム<IndexTerm>
<Primary>ウィジェット</Primary>
<Secondary>デモ・プログラム</Secondary>
</IndexTerm><IndexTerm>
<Primary>デモ・プログラム</Primary>
<Secondary>ウィジェット</Secondary>
</IndexTerm></Title>
<Para><Command>DtSpinBox</Command> ウィジェット の使用例が入っているデモが、
<Filename>/usr/dt/examples/dtwidget/controls.c</Filename>にあります。</Para>
</Sect2>
<Sect2 Id="PG.widgs.div.13">
<Title>XmSimpleSpinBoxへの変更<IndexTerm>
<Primary>互換性</Primary>
<Secondary>Motif 2.1 &lt;Filename>XmSimpleSpinBox&lt;Default Para Font></Secondary>
</IndexTerm><IndexTerm>
<Primary>&lt;Filename>DtSpinBox&lt;Default Para Font>、Motif 2.1との互換性</Primary>
</IndexTerm></Title>
<Para>Motif 2.1 <Command>DtSimpleSpinBox</Command> ウィジェットを使用するには、クラス、型、および作成 ルーチンの<Command>Dt</Command>名を<Command>Xm</Command>に変更します。
たとえば、コードの中に出てくる <Command>DtSpinBox</Command>のすべてを <Command>XmSimpleSpinBox</Command>に変更します。
一方既存のコードを
<Symbol>-DDT_USE_XM_SSPINBOX</Symbol>でコンパイルすることもできます。
この情報は、CDE 1.0 アプリケーションを修正して、Motif 2.1 ウィジェットを使用する場合を配慮して提供されます。
</Para>
</Sect2>
<Sect2 Id="PG.widgs.div.14">
<Title>簡易関数<IndexTerm>
<Primary>簡易関数</Primary>
<Secondary>&lt;Filename>DtSpinBox&lt;Default Para Font>ウィジェット</Secondary>
</IndexTerm><IndexTerm>
<Primary>&lt;Filename>DtSpinBox&lt;Default Para Font></Primary>
<Secondary>簡易関数</Secondary>
</IndexTerm></Title>
<Para><Command>DtSpinBox</Command>ウィジェットのための簡易関数を<!--Original XRef content: 'Table&numsp;7&hyphen;1'-->
<XRef Role="CodeOrFigureOrTable" Linkend="PG.widgs.mkr.5">にリストします。
詳細については、<Filename MoreInfo="RefEntry">DtSpinBox</Filename>(3)のマニュアル・ページを参照してください。</Para>
<Table Id="PG.widgs.tbl.1" Frame="Topbot">
<Title Id="PG.widgs.mkr.5">DtSpinBox 簡易関数</Title>
<TGroup Cols="2">
<ColSpec Colname="1" Colwidth="2.0 in">
<ColSpec Colname="2" Colwidth="3.0 in">
<THead>
<Row>
<Entry><Para><Literal>関数</Literal></Para></Entry>
<Entry><Para><Literal>説明</Literal></Para></Entry>
</Row>
</THead>
<TBody>
<Row>
<Entry><Para><Filename>DtCreateSpinBox()</Filename></Para></Entry>
<Entry><Para>SpinBox ウィジェットを作成します。</Para></Entry>
</Row>
<Row>
<Entry><Para><Filename>DtSpinBoxAddItem()</Filename></Para></Entry>
<Entry><Para><Command>DtSpinBox</Command> ウィジェットの指定された位置に項目を追加します。
</Para></Entry>
</Row>
<Row>
<Entry><Para><Filename>DtSpinBoxDeletePos()</Filename></Para></Entry>
<Entry><Para>指定された項目を<Command>DtSpinBox</Command>
ウィジェットから削除します。</Para></Entry>
</Row>
<Row>
<Entry><Para><Filename>DtSpinBoxSetItem()</Filename></Para></Entry>
<Entry><Para><Command>DtSpinBox</Command> ウィジェットに項目を設定します。</Para></Entry>
</Row>
</TBody>
</TGroup>
</Table>
</Sect2>
<Sect2 Id="PG.widgs.div.15">
<Title>クラス<IndexTerm>
<Primary>&lt;Filename>DtSpinBox&lt;Default Para Font></Primary>
<Secondary>クラス</Secondary>
</IndexTerm><IndexTerm>
<Primary>クラス</Primary>
<Secondary>&lt;Filename>DtSpinBox&lt;Default Para Font></Secondary>
</IndexTerm></Title>
<Para><Command>DtSpinBoxWidget</Command>は、<Command>Core</Command>、
<Command>Composite</Command>、 <Command>Constraint</Command>、および <Command>XmManager</Command> クラスから動作とリソースを継承します。</Para>
<Para>クラス・ポインタは、<Command>dtSpinBoxWidgetClass</Command></Para>
<Para>クラス名は、<Command>DtSpinBoxWidget</Command>です。</Para>
<Para><Command>DtSpinBoxWidget</Command> は、サブクラス化をサポートしません。</Para>
</Sect2>
<Sect2 Id="PG.widgs.div.16">
<Title>リソース<IndexTerm>
<Primary>リソース</Primary>
<Secondary>&lt;Filename>DtSpinBox&lt;Default Para Font></Secondary>
</IndexTerm><IndexTerm>
<Primary>&lt;Filename>DtSpinBox&lt;Default Para Font></Primary>
<Secondary>リソース</Secondary>
</IndexTerm></Title>
<Para><Command>DtSpinBox</Command> ウィジェットは、次のウィジェット・リソースのセットを定義します。各リソースのクラス、
型、デフォルト、およびアクセスを
<!--Original XRef content: 'Table&numsp;7&hyphen;2'-->
<XRef Role="CodeOrFigureOrTable" Linkend="PG.widgs.mkr.6">
にリストします。</Para>
<ItemizedList Remap="Bullet1">
<ListItem>
<Para><Command>DtNarrowLayout</Command>は、<Command>DtSpinBox</Command>の矢印のスタイルと位置を指定します。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNarrowSensitivity</Command>は、<Command>DtSpinBox</Command>の矢印の感度を指定します。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNspinBoxChildType</Command>は、<Command>DtSpinBox</Command>のスタイルを指定します。</Para>
</ListItem>
<ListItem>
<Para><Command>DtNdecimalPoints</Command>は、子の型 が数値のとき、整数値の中の小数点の位置を指定します。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNincrementValue</Command>は、子の型 が数値のとき、位置を増減する量を指定します。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNinitialDelay</Command>は、矢印ボタンが連続スピンを始めるまでの時間をミリ秒単位で指定します。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNnumValues</Command>は、子の型 が文字列のとき、<Command>DtNvalues</Command>リストの項目数を指定します。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNvalues</Command>は、子の型のリソースが文字列のとき、循環する文字列のリストを指定します。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNmaximumValue</Command>は、子の型が数値のとき、<Command>DtSpinBox</Command>の上限を指定します。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNminimumValue</Command>は、子の型が数値のとき、<Command>DtSpinBox</Command>の下限を指定します。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNmodifyVerifyCallback</Command>は、 <Command>DtSpinBox</Command>
の位置が変わる直前に呼び出されます。 アプリケーションは、このコールバックを使用して、新しい位置の設定、特定の値までのスピン、または実行直前の取り消しなど、アプリケーション関連の新しい論理を実現することができます。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNposition</Command>は、子の型のリソースによって異なる値を持ちます。子の型が文字列のとき、<Command>DtNposition</Command>は、現在の項目の<Command>DtNvalues</Command>リストの索引です。
子の型が数値のとき、<Command>DtNposition</Command>は、最大値から最小値までの範囲内の<Command>DtSpinBox</Command>の整数値です。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNrepeatDelay</Command>は、ユーザが <Command>DtSpinBox</Command>をスピンしているときに<Command>DtNvalueChangedCallback</Command>を呼び出す間隔を指定するミリ秒単位の数値です。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNvalueChangedCallback</Command>は、スピン矢印の使用によって<Command>DtNposition</Command>リソースの値が変更されるときに必ず呼び出されます。
</Para>
</ListItem>
</ItemizedList>
<Para>詳細については、<Filename MoreInfo="RefEntry">DtSpinBox</Filename>(3) のマニュアル・ページを参照してください。</Para>
<Table Id="PG.widgs.tbl.2" Frame="Topbot">
<Title><Command Id="PG.widgs.mkr.6"></Command>DtSpinBoxWidge<Command>t</Command> リソース</Title>
<TGroup Cols="5">
<ColSpec Colname="1" Colwidth="1.96865 in">
<ColSpec Colname="2" Colwidth="1.58095 in">
<ColSpec Colname="3" Colwidth="1.375 in">
<ColSpec Colname="4" Colwidth="1.5 in">
<ColSpec Colname="5" Colwidth="0.57103 in">
<THead>
<Row>
<Entry><Para><Literal>名前</Literal></Para></Entry>
<Entry><Para><Literal>クラス</Literal></Para></Entry>
<Entry><Para><Literal>型</Literal></Para></Entry>
<Entry><Para><Literal>デフォルト</Literal></Para></Entry>
<Entry><Para><Literal>アクセス</Literal></Para></Entry>
</Row>
</THead>
<TBody>
<Row>
<Entry><Para><Command>DtNarrowLayout</Command></Para></Entry>
<Entry><Para><Command>DtCArrowLayout</Command></Para></Entry>
<Entry><Para><Command>unsigned char</Command></Para></Entry>
<Entry><Para><Filename>DtARROWS_END</Filename></Para></Entry>
<Entry><Para>CSG</Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNarrowSensitivity</Command></Para></Entry>
<Entry><Para><Command>DtCArrowSensitivity</Command></Para></Entry>
<Entry><Para><Command>unsigned char</Command></Para></Entry>
<Entry><Para><Filename>DtARROWS_SENSITIVE</Filename></Para></Entry>
<Entry><Para>CSG</Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNspinBoxChildType</Command></Para></Entry>
<Entry><Para><Command>DtCSpinBoxChildType</Command></Para></Entry>
<Entry><Para><Command>unsigned char</Command></Para></Entry>
<Entry><Para><Command>DtSTRING</Command></Para></Entry>
<Entry><Para>CG</Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNdecimalPoints</Command></Para></Entry>
<Entry><Para><Command>DtCDecimalPoints</Command></Para></Entry>
<Entry><Para><Command>short</Command></Para></Entry>
<Entry><Para><Filename>0</Filename></Para></Entry>
<Entry><Para>CSG</Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNincrementValue</Command></Para></Entry>
<Entry><Para><Command>DtCIncrementValue</Command></Para></Entry>
<Entry><Para><Command>int</Command></Para></Entry>
<Entry><Para><Filename>1</Filename></Para></Entry>
<Entry><Para>CSG</Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNinitialDelay</Command></Para></Entry>
<Entry><Para><Command>DtCInitialDelay</Command></Para></Entry>
<Entry><Para><Command>unsigned int</Command></Para></Entry>
<Entry><Para><Command>250 ms</Command></Para></Entry>
<Entry><Para>CSG</Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNnumValues</Command></Para></Entry>
<Entry><Para><Command>DtCNumValues</Command></Para></Entry>
<Entry><Para><Command>int</Command></Para></Entry>
<Entry><Para><Filename>0</Filename></Para></Entry>
<Entry><Para>CSG</Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNvalues</Command></Para></Entry>
<Entry><Para><Command>DtCValues</Command></Para></Entry>
<Entry><Para><Command>XmStringTable</Command></Para></Entry>
<Entry><Para><Command>NULL</Command></Para></Entry>
<Entry><Para>CSG</Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNmaximumValue</Command></Para></Entry>
<Entry><Para><Command>DtCMaximumValue</Command></Para></Entry>
<Entry><Para><Command>int</Command></Para></Entry>
<Entry><Para><Filename>10</Filename></Para></Entry>
<Entry><Para>CSG</Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNminimumValue</Command></Para></Entry>
<Entry><Para><Command>DtCMinimumValue</Command></Para></Entry>
<Entry><Para><Command>int</Command></Para></Entry>
<Entry><Para><Filename>0</Filename></Para></Entry>
<Entry><Para>CSG</Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNmodifyVerifyCallback</Command></Para></Entry>
<Entry><Para><Command>DtCCallback</Command></Para></Entry>
<Entry><Para><Command>XtCallbackList</Command></Para></Entry>
<Entry><Para><Command>NULL</Command></Para></Entry>
<Entry><Para>C</Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNposition</Command></Para></Entry>
<Entry><Para><Command>DtCPosition</Command></Para></Entry>
<Entry><Para><Command>int</Command></Para></Entry>
<Entry><Para><Filename>0</Filename></Para></Entry>
<Entry><Para>CSG</Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNrepeatDelay</Command></Para></Entry>
<Entry><Para><Command>DtCRepeatDelay</Command></Para></Entry>
<Entry><Para><Command>unsigned int</Command></Para></Entry>
<Entry><Para><Command>200 ms</Command></Para></Entry>
<Entry><Para>CSG</Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNvalueChangedCallback</Command></Para></Entry>
<Entry><Para><Command>DtCCallback</Command></Para></Entry>
<Entry><Para><Command>XtCallbackList</Command></Para></Entry>
<Entry><Para><Command>NULL</Command></Para></Entry>
<Entry><Para>C</Para></Entry>
</Row>
</TBody>
</TGroup>
</Table>
</Sect2>
<Sect2 Id="PG.widgs.div.17">
<Title>コールバックのための構造体<IndexTerm>
<Primary>&lt;Filename>DtSpinBox&lt;Default Para Font></Primary>
<Secondary>コールバックのための構造体</Secondary>
</IndexTerm><IndexTerm>
<Primary>コールバックのための構造体</Primary>
<Secondary>&lt;Filename>DtSpinBox&lt;Default Para Font></Secondary>
</IndexTerm></Title>
<Para>コールバックのための構造体を次に示し、
<!--Original XRef content: 'Table&numsp;7&hyphen;3'-->
<XRef Role="CodeOrFigureOrTable" Linkend="PG.widgs.mkr.7">で説明します。</Para>
<ProgramListing>typedef struct {
int <Symbol Role="Variable">reason</Symbol>;
XEvent <Symbol Role="Variable">*event</Symbol>;
Widget <Symbol Role="Variable">widget</Symbol>;
Boolean <Symbol Role="Variable">doit</Symbol>;
int <Symbol Role="Variable">position</Symbol>;
XmString <Symbol Role="Variable">value</Symbol>;
Boolean <Symbol Role="Variable">crossed_boundary</Symbol>;
} DtSpinBoxCallbackStruct;
</ProgramListing>
<Table Id="PG.widgs.tbl.3" Frame="Topbot">
<Title><Command Id="PG.widgs.mkr.7"></Command>DtSpinBox コールバック</Title>
<TGroup Cols="2">
<ColSpec Colname="1" Colwidth="1.47818 in">
<ColSpec Colname="2" Colwidth="3.54168 in">
<THead>
<Row>
<Entry><Para><Literal>コールバック</Literal></Para></Entry>
<Entry><Para><Literal>説明</Literal></Para></Entry>
</Row>
</THead>
<TBody>
<Row>
<Entry><Para><Symbol Role="Variable">reason</Symbol></Para></Entry>
<Entry><Para>このコールバックは、つの実行可能なreasonを使用します。スピンの最初にコールバックへの最初の呼び出しを行う、またはスピン矢印のつを起動する場合には、 <Filename>DtCR_OK</Filename>がreasonです。
<Command>DtSpinBox</Command>が連続でスピンしている場合のreasonは、スピンしている矢印に応じて
<Filename>DtCR_SPIN_NEXT</Filename>か<Filename>DtCR_SPIN_PRIOR</Filename>になります。
</Para></Entry>
</Row>
<Row>
<Entry><Para><Symbol Role="Variable">event</Symbol></Para></Entry>
<Entry><Para>このコールバックが呼び出される原因となったイベントへのポインタ
<Command>DtSpinBox</Command>が連続でスピンしているときには<Command>NULL</Command>になります。
</Para></Entry>
</Row>
<Row>
<Entry><Para><Symbol Role="Variable">widget</Symbol></Para></Entry>
<Entry><Para>スピンによって影響を受けるテキスト・ウィジェットのウィジェット識別子
</Para></Entry>
</Row>
<Row>
<Entry><Para><Symbol Role="Variable">doit</Symbol></Para></Entry>
<Entry><Para>この値は、<Filename>call_data</Filename>が
<Command>DtNmodifyVerifyCallback</Command>から来るときだけ設定します。modifyVerify コールバックの場合、アプリケーションがこのフィールドをどのように設定するかによって、コールバックを開始したアクションを実行するかどうか決まります。
このフィールドにアクションが設定 されたときには、アクションは実行されません。
</Para></Entry>
</Row>
<Row>
<Entry><Para><Symbol Role="Variable">position</Symbol></Para></Entry>
<Entry><Para>スピンの結果として得られる<Command>DtNposition</Command>リソースの新しい値。
</Para></Entry>
</Row>
<Row>
<Entry><Para><Symbol Role="Variable">value</Symbol></Para></Entry>
<Entry><Para>スピンの結果として得られるテキスト・ウィジェットに表示される新しい<Command>XmString</Command>の値。
この文字列を
<Filename>call_data</Filename>構造体の範囲を越えて使用する場合には、コピーしなければなりません。</Para></Entry>
</Row>
<Row>
<Entry><Para><Symbol Role="Variable">crossed_boundary</Symbol></Para></Entry>
<Entry><Para>この論理値は、スピン・ボックスが循環するとき、および(または)
<Command>XmSTRING</Command>の<Command>DtNspinBoxChildType</Command>が最初の項目から最後の項目へ、または最後の項目から最初の項目へ続くときにはTrueです。
<Command>DtNspinBoxChildType</Command>が<Command>XmNUMERIC</Command>のとき、<Command>DtSpinBox</Command>が最大値から最小値まで、または最小値から最大値まで循環するときには、Trueです。
</Para></Entry>
</Row>
</TBody>
</TGroup>
</Table>
</Sect2>
<Sect2 Id="PG.widgs.div.18">
<Title>DtSpinBox ウィジェットの例<IndexTerm>
<Primary>&lt;Filename>DtSpinBox&lt;Default Para Font></Primary>
<Secondary>例 コード</Secondary>
</IndexTerm><IndexTerm>
<Primary>コード 例</Primary>
<Secondary>&lt;Filename>DtSpinBox&lt;Default Para Font></Secondary>
</IndexTerm></Title>
<Para>次の例は、<Command>DtSpinBox</Command> ウィジェットの作成方法と使用方法を示しています。
このコードは、<Command>/usr/dt/examples/dtwidget</Command>ディレクトリの<Filename>controls.c</Filename>デモの一部です。</Para>
<ProgramListing>/*
* Example code for SpinBox
*/
#include &lt;Dt/SpinBox.h>
static char *spinValueStrings[] = {
&ldquo;alpha&rdquo;, &ldquo;beta&rdquo;, &ldquo;gamma&rdquo;, &ldquo;delta&rdquo;,
&ldquo;epsilon&rdquo;, &ldquo;zeta&rdquo;, &ldquo;eta&rdquo;, &ldquo;theta&rdquo;,
&ldquo;iota&rdquo;, &ldquo;kappa&rdquo;, &ldquo;lambda&rdquo;, &ldquo;mu&rdquo;,
&ldquo;nu&rdquo;, &ldquo;xi&rdquo;, &ldquo;omicron&rdquo;, &ldquo;pi&rdquo;,
&ldquo;rho&rdquo;, &ldquo;sigma&rdquo;, &ldquo;tau&rdquo;, &ldquo;upsilon&rdquo;,
&ldquo;phi&rdquo;, &ldquo;chi&rdquo;, &ldquo;psi&rdquo;, &ldquo;omega&rdquo;
};
static void ModifyVerifyCb(Widget, XtPointer, XtPointer);
static void CreateSpinBoxes(Widget parent)
{
Widget titleLabel, spinBox;
XmString *valueXmstrings;
int numValueStrings;
XmString labelString;
Arg args[20];
int i, n;
/* Create value compound strings */
numValueStrings = XtNumber(spinValueStrings);
valueXmstrings = (XmString *)XtMalloc(numValueStrings
sizeof(XmString*));
for (i = 0; i &lt; numValueStrings; i++) {
valueXmstrings[i] =
XmStringCreateLocalized(spinValueStrings[i]);
}
/* Create title label */
labelString = XmStringCreateLocalized(&ldquo;SpinBox Widget&rdquo;);
n = 0;
XtSetArg(args[n], XmNlabelString, labelString); n++;
titleLabel = XmCreateLabel(parent, &ldquo;title&rdquo;, args, n);
XtManageChild(titleLabel);
XmStringFree(labelString);
/*
* Create a SpinBox containing string values.
*/
n = 0;
XtSetArg(args[n], DtNvalues, valueXmstrings); n++;
XtSetArg(args[n], DtNnumValues, numValueStrings); n++;
XtSetArg(args[n], DtNcolumns, 10); n++;
spinBox = DtCreateSpinBox(parent, &ldquo;spinBox1&rdquo;, args, n);
XtManageChild(spinBox);
/*
* Create a SpinBox containing numeric values to 3 decimal places.
* Position the arrows on either side of the displayed value.
*/
n = 0;
XtSetArg(args[n], DtNspinBoxChildType, DtNUMERIC); n++;
XtSetArg(args[n], DtNminimumValue, 1000); n++;
XtSetArg(args[n], DtNmaximumValue, 100000); n++;
XtSetArg(args[n], DtNincrementValue,1000); n++;
XtSetArg(args[n], DtNdecimalPoints,3); n++;
XtSetArg(args[n], DtNposition,1000); n++;
XtSetArg(args[n], DtNarrowLayout,DtARROWS_SPLIT); n++;
XtSetArg(args[n], DtNcolumns, 10); n++;
spinBox = DtCreateSpinBox(parent, &ldquo;spinBox2&rdquo;, args, n);
XtManageChild(spinBox);
/*
* Create a SpinBox containing numeric values to 2 decimal places.
* Position the arrows on the left of the displayed value.
* Disallow alternate user changes by adding a modify/verify
callback.
*/
n = 0;
XtSetArg(args[n], DtNspinBoxChildType, DtNUMERIC); n++;
XtSetArg(args[n], DtNminimumValue, 1500); n++;
XtSetArg(args[n], DtNmaximumValue, 60500); n++;
XtSetArg(args[n], DtNincrementValue,1500); n++;
XtSetArg(args[n], DtNdecimalPoints,2); n++;
XtSetArg(args[n], DtNposition,7500); n++
XtSetArg(args[n], DtNarrowLayout,DtARROWS_FLAT_BEGINNING); n++;
XtSetArg(args[n], DtNcolumns, 10); n++;
spinBox = DtCreateSpinBox(parent, &ldquo;spinBox3&rdquo;, args, n);
XtManageChild(spinBox);
XtAddCallback(spinBox, DtNmodifyVerifyCallback, ModifyVerifyCb,
NULL);
/*
* Create a SpinBox containing string values.
* Position the arrows on the left of the display value
*/
n = 0;
XtSetArg(args[n], DtNvalues, valueXmstrings); n++;
XtSetArg(args[n], DtNnumValues, numValueStrings); n++;
XtSetArg(args[n], DtNarrowLayout, DtARROWS_BEGINNING); n++;
XtSetArg(args[n], DtNcolumns, 10); n++;
spinBox = DtCreateSpinBox(parent, &ldquo;spinBox4&rdquo;, args, n);
XtManageChild(spinBox);
/*
* Create a SpinBox containing numeric values to 3 decimal places.
* Position the arrows on the right of the displayed value.
*/
n = 0;
XtSetArg(args[n], DtNspinBoxChildType, DtNUMERIC); n++;
XtSetArg(args[n], DtNminimumValue, 1000); n++;
XtSetArg(args[n], DtNmaximumValue, 100000); n++;
XtSetArg(args[n], DtNincrementValue,1000); n++;
XtSetArg(args[n], DtNdecimalPoints,3); n++;
XtSetArg(args[n], DtNposition,1000); n++;
XtSetArg(args[n], DtNarrowLayout, DtARROWS_FLAT_END); n++;
XtSetArg(args[n], DtNcolumns, 10); n++;
spinBox = DtCreateSpinBox(parent, &ldquo;spinBox5&rdquo;, args, n);
XtManageChild(spinBox);
/*
* Free value strings, SpinBox has taken a copy.
*/
for (i = 0; i &lt; numValueStrings; i++) {
XmStringFree(valueXmstrings[i]);
}
XtFree((char*)valueXmstrings);
}
/*
* modify/verify callback.
*
* Allow/disallow alternate user changes
*/
static void ModifyVerifyCb(Widget w, XtPointer cd, XtPointer cb)
{
DtSpinBoxCallbackStruct *scb= (DtSpinBoxCallbackStruct*)cb;
static Boolean allowChange = True;
scb->doit = allowChange;
if (allowChange == False) {
printf(&ldquo;DtSpinBox: DtNmodifyVerifyCallback.
Change disallowed.\n&rdquo;);
XBell(XtDisplay(w), 0);
}
allowChange = (allowChange == True) ? False: True;
}</ProgramListing>
</Sect2>
</Sect1>
<Sect1 Id="PG.widgs.div.19">
<Title Id="PG.widgs.mkr.8">テキスト・フィールドとボックス・ウィジェット(DtComboBox)<IndexTerm>
<Primary>テキスト・フィールドとボックス・ウィジェット</Primary>
</IndexTerm><IndexTerm>
<Primary>リスト・ボックスとテキスト・フィールド・ウィジェット</Primary>
</IndexTerm><IndexTerm>
<Primary>ウィジェット</Primary>
<Secondary>テキスト・フィールド とリスト・ボックス</Secondary>
</IndexTerm><IndexTerm>
<Primary>ウィジェット</Primary>
<Secondary>リスト・ボックス とテキスト・フィールド</Secondary>
</IndexTerm><IndexTerm>
<Primary>ウィジェット</Primary>
<Secondary>&lt;Filename>DtComboBox&lt;Default Para Font></Secondary>
</IndexTerm><IndexTerm>
<Primary>&lt;Filename>DtComboBox&lt;Default Para Font> ウィジェット</Primary>
</IndexTerm></Title>
<Para><Command>DtComboBox</Command> ウィジェットは、リストとリストの現在の選択項目を表示するために使用します。
このウィジェットは、表示用だけに使用するか、選択可能なコントロールとして使用することができます。</Para>
<Para> <Command>DtComboBox</Command> ウィジェットは、テキスト・フィールドとリスト・ウィジェットの組み合わせで、テキスト・フィールドに対する有効な選択項目のリストを提供します。
このリストから項目を選択すると、そのリスト項目が自動的にテキスト・フィールドに記入されます。
<!--Original XRef content: 'Figure&numsp;7&hyphen;2'-->
<XRef Role="CodeOrFigureOrTable" Linkend="PG.widgs.mkr.14">に、<Command>DtComboBox</Command> ウィジェットの例を示します。
</Para>
<Figure>
<Title Id="PG.widgs.mkr.9">テキスト・フィールド とリスト・ボックス・ウィジェット (DtComboBox)の例<IndexTerm>
<Primary>&lt;Filename>DtComboBox&lt;Default Para Font></Primary>
<Secondary>図</Secondary>
</IndexTerm><IndexTerm>
<Primary>図</Primary>
<Secondary>&lt;Filename>DtComboBox&lt;Default Para Font></Secondary>
</IndexTerm></Title>
<Graphic Entityref="PG.widgs.fig.2" Id="PG.widgs.grph.2"></Graphic>
<Graphic Entityref="PG.widgs.fig.4" Id="PG.widgs.grph.4"></Graphic>
</Figure>
<Sect2 Id="PG.widgs.div.20">
<Title>ライブラリとヘッダ・ファイル<IndexTerm>
<Primary>ヘッダ・ファイル</Primary>
<Secondary>&lt;Filename>DtComboBox&lt;Default Para Font></Secondary>
</IndexTerm><IndexTerm>
<Primary>&lt;Filename>DtComboBox&lt;Default Para Font></Primary>
<Secondary>ヘッダ・ファイル</Secondary>
</IndexTerm><IndexTerm>
<Primary>&lt;Filename>DtComboBox&lt;Default Para Font></Primary>
<Secondary>ライブラリ</Secondary>
</IndexTerm><IndexTerm>
<Primary>ライブラリ</Primary>
<Secondary>&lt;Filename>libDtWidget&lt;Default Para Font></Secondary>
</IndexTerm><IndexTerm>
<Primary>&lt;Filename>libDtWidget&lt;Default Para Font> ライブラリ</Primary>
</IndexTerm></Title>
<Para> <Command>DtComboBox</Command> ウィジェットは、<Command>libDtWidget</Command> ライブラリにあります。 ヘッダ・ファイルは、
<Filename>Dt/ComboBox.h</Filename>です。</Para>
</Sect2>
<Sect2 Id="PG.widgs.div.21">
<Title>デモ・プログラム<IndexTerm>
<Primary>デモ・プログラム</Primary>
<Secondary>&lt;Filename>DtComboBox&lt;Default Para Font></Secondary>
</IndexTerm><IndexTerm>
<Primary>&lt;Filename>DtComboBox&lt;Default Para Font></Primary>
<Secondary>デモ・プログラム</Secondary>
</IndexTerm></Title>
<Para><Command>DtComboBox</Command> ウィジェットの使用例が入っているデモが、
<Filename>/usr/dt/examples/dtwidget/controls.c</Filename>にあります。</Para>
</Sect2>
<Sect2 Id="PG.widgs.div.22">
<Title>XmComboBoxへの変更<IndexTerm>
<Primary>互換性</Primary>
<Secondary>&lt;Filename>DtComboBox&lt;Default Para Font></Secondary>
</IndexTerm><IndexTerm>
<Primary>&lt;Filename>DtComboBox&lt;Default Para Font></Primary>
<Secondary>Motif 2.1との互換性</Secondary>
</IndexTerm><IndexTerm>
<Primary>&lt;Filename>XmComboBox&lt;Default Para Font>、 &lt;Filename>DtComboBox&lt;Default Para Font>との互換性</Primary>
</IndexTerm></Title>
<Para>Motif 2.1 <Command>XmComboBox</Command> ウィジェットを使用するには、
クラス、型、および作成 ルーチンの<Command>Dt</Command>名を<Command>Xm</Command>に変更します。
たとえば、コードの中に出てくる
<Command>DtComboBox</Command>のすべてを<Command>XmComboBox</Command>に変更します。一方、既存のコードを
<Symbol>-DDT_USE_XM_COMBOBOX</Symbol>でコンパイルできます。
この情報は、CDE 1.0 アプリケーションを修正して、Motif 2.1 ウィジェットを使用する場合を配慮して提供されます。
</Para>
</Sect2>
<Sect2 Id="PG.widgs.div.23">
<Title>簡易関数<IndexTerm>
<Primary>簡易関数</Primary>
<Secondary>&lt;Filename>DtComboBox&lt;Default Para Font></Secondary>
</IndexTerm><IndexTerm>
<Primary>&lt;Filename>DtComboBox&lt;Default Para Font></Primary>
<Secondary>簡易関数</Secondary>
</IndexTerm></Title>
<Para><Command>DtComboBox</Command> ウィジェットは、次の簡易関数を提供しますが、詳細については
<!--Original XRef content: 'Table&numsp;7&hyphen;4'-->
<XRef Role="CodeOrFigureOrTable" Linkend="PG.widgs.mkr.10">に示します。</Para>
<Para>詳細については、<Filename MoreInfo="RefEntry">DtComboBox</Filename>(3)の
マニュアル・ページ を参照してください。</Para>
<Table Id="PG.widgs.tbl.4" Frame="Topbot">
<Title Id="PG.widgs.mkr.10">DtComboBox ウィジェット簡易関数</Title>
<TGroup Cols="2">
<ColSpec Colname="1" Colwidth="1.875 in">
<ColSpec Colname="2" Colwidth="3.125 in">
<THead>
<Row>
<Entry><Para><Literal>関数</Literal></Para></Entry>
<Entry><Para><Literal>説明</Literal></Para></Entry>
</Row>
</THead>
<TBody>
<Row>
<Entry><Para><Filename>DtCreateComboBox()</Filename></Para></Entry>
<Entry><Para> <Command>DtComboBox</Command> ウィジェットを作成します。</Para></Entry>
</Row>
<Row>
<Entry><Para><Filename>DtComboBoxAddItem()</Filename></Para></Entry>
<Entry><Para><Command>DtComboBox</Command> ウィジェットの指定された位置に項目を追加します。
</Para></Entry>
</Row>
<Row>
<Entry><Para><Filename>DtComboBoxDeletePos()</Filename></Para></Entry>
<Entry><Para>指定された項目を<Command>DtComboBox</Command>
ウィジェットから削除します。
</Para></Entry>
</Row>
<Row>
<Entry><Para><Filename>DtComboBoxSetItem()</Filename></Para></Entry>
<Entry><Para><Command>DtComboBox</Command>ウィジェットの<Command>XmList</Command>の中の項目を選択して、それをリスト表示の最初の項目にします。
</Para></Entry>
</Row>
<Row>
<Entry><Para><Filename>DtComboBoxSelectItem()</Filename></Para></Entry>
<Entry><Para><Command>DtComboBox</Command>ウィジェットの
<Command>XmList</Command>の中の項目を選択します。
</Para></Entry>
</Row>
</TBody>
</TGroup>
</Table>
<Para><Command>DtComboBox</Command>は、<Command>XmManager</Command> クラスのサブクラス であり、
<Command>XmList</Command> または<Command>XmScrolledList</Command>を表示するために使われます。</Para>
</Sect2>
<Sect2 Id="PG.widgs.div.24">
<Title>クラス<IndexTerm>
<Primary>クラス</Primary>
<Secondary>&lt;Filename>DtComboBox&lt;Default Para Font></Secondary>
</IndexTerm><IndexTerm>
<Primary>&lt;Filename>DtComboBox&lt;Default Para Font></Primary>
<Secondary>クラス</Secondary>
</IndexTerm></Title>
<Para><Command>DtComboBox</Command>は、<Command>Core</Command>、<Command>Composite</Command>、
<Command>Constraints</Command>、および<Command>XmManager</Command> クラスから動作とリソースを継承します。
</Para>
<Para>クラス・ポインタは、<Command>dtComboBoxWidgetClass</Command>です。</Para>
<Para>クラス名は、<Command>DtComboBoxWidget</Command>です。</Para>
<Para><Command>DtComboBoxWidget</Command>は、サブクラス化をサポートしません。</Para>
</Sect2>
<Sect2 Id="PG.widgs.div.25">
<Title>リソース<IndexTerm>
<Primary>&lt;Filename>DtComboBox&lt;Default Para Font></Primary>
<Secondary>リソース</Secondary>
</IndexTerm><IndexTerm>
<Primary>リソース</Primary>
<Secondary>&lt;Filename>DtComboBox&lt;Default Para Font></Secondary>
</IndexTerm></Title>
<Para><Command>DtComboBox</Command>は、次のリソースを提供します。これらのリソースのクラス、 型、デフォルト、およびアクセスを
<!--Original XRef content: 'Table&numsp;7&hyphen;5'-->
<XRef Role="CodeOrFigureOrTable" Linkend="PG.widgs.mkr.11">
に示します。</Para>
<ItemizedList Remap="Bullet1">
<ListItem>
<Para><Command>DtNmarginHeight</Command> は、テキスト・ウィジェットのトップとボトムの間に追加されるピクセル数と、シャドウの開始位置を指定します。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNmarginWidth</Command>は、テキスト・ウィジェットの右辺と左辺の間に追加されるピクセル数と、シャドウの開始位置を指定します。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNselectedItem</Command>は<Command>XmList</Command>に渡され、リストの指定された<Command>XmString</Command>と一致する<Command>DtNitems</Command>の中の単一項目として<Command>XmNselectedItemCount</Command> と<Command>XmNselectedItems</Command>を設定します。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNselectedPosition</Command>は<Command>XmList</Command> に渡され、リストの指定された位置にある単一項目として
<Command>XmNselectedItemCount</Command> と<Command>XmNselectedItems</Command>を設定します。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNselectionCallback</Command>は、<Command>DtComboBox</Command> ウィジェット・リストから項目が選択されたときに発行されます。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNcomboBoxType</Command>は、 <Command>DtComboBox</Command>のスタイルの種類を決めます。</Para>
</ListItem>
</ItemizedList>
<Para> リスト・ウィジェット IDは、<Filename>XtNameToWidget()</Filename>関数を使用してアクセスできます。
これらのウィジェット のリソースを設定することができます。詳細については、<Filename MoreInfo="RefEntry">DtComboBox</Filename>(3)のマニュアル・ページを参照してください。
</Para>
<Para>アクセス欄のコードは、次のことが可能かどうかを示します。:</Para>
<ItemizedList Remap="Bullet1">
<ListItem>
<Para>作成時にリソースを設定する(C)</Para>
</ListItem>
<ListItem>
<Para><Command>XtSetValues</Command>を使用して設定する (S)</Para>
</ListItem>
<ListItem>
<Para><Command>XtGetValues</Command>を使用して検索する (G)</Para>
</ListItem>
</ItemizedList>
<Table Id="PG.widgs.tbl.5" Frame="Topbot">
<Title Id="PG.widgs.mkr.11">DtComboBox ウィジェット・リソース</Title>
<TGroup Cols="5">
<ColSpec Colname="1" Colwidth="1.7 in">
<ColSpec Colname="2" Colwidth="1.6 in">
<ColSpec Colname="3" Colwidth="1.325 in">
<ColSpec Colname="4" Colwidth="1.7 in">
<ColSpec Colname="5" Colwidth="0.7 in">
<THead>
<Row>
<Entry><Para><Literal>名前</Literal></Para></Entry>
<Entry><Para><Literal>クラス</Literal></Para></Entry>
<Entry><Para><Literal>型</Literal></Para></Entry>
<Entry><Para><Literal>デフォルト</Literal></Para></Entry>
<Entry><Para><Literal>アクセス</Literal></Para></Entry>
</Row>
</THead>
<TBody>
<Row>
<Entry><Para><Command>DtNmarginHeight</Command></Para></Entry>
<Entry><Para><Command>DtCMarginHeight</Command></Para></Entry>
<Entry><Para><Command>Dimension</Command></Para></Entry>
<Entry><Para><Filename>2</Filename></Para></Entry>
<Entry><Para><Command>CSG</Command></Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNmarginWidth</Command></Para></Entry>
<Entry><Para><Command>DtCMarginWidth</Command></Para></Entry>
<Entry><Para><Command>Dimension</Command></Para></Entry>
<Entry><Para><Filename>2</Filename></Para></Entry>
<Entry><Para><Command>CSG</Command></Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNselectedItem</Command></Para></Entry>
<Entry><Para><Command>DtCSelectedItem</Command></Para></Entry>
<Entry><Para><Command>XmString</Command></Para></Entry>
<Entry><Para><Command>Dimension</Command></Para></Entry>
<Entry><Para><Command>CSG</Command></Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNselectedPosition</Command></Para></Entry>
<Entry><Para><Command>DtCSelectedPosition</Command></Para></Entry>
<Entry><Para><Command>int</Command></Para></Entry>
<Entry><Para><Command>Dimension</Command></Para></Entry>
<Entry><Para><Command>CSG</Command></Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNselectionCallback</Command></Para></Entry>
<Entry><Para><Command>DtCCallback</Command></Para></Entry>
<Entry><Para><Command>XtCallbackList</Command></Para></Entry>
<Entry><Para><Command>XmString</Command></Para></Entry>
<Entry><Para><Command>C</Command></Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNcomboBoxType</Command></Para></Entry>
<Entry><Para><Command>DtCComboBoxType</Command></Para></Entry>
<Entry><Para><Command>unsigned char</Command></Para></Entry>
<Entry><Para><Command>int</Command></Para></Entry>
<Entry><Para><Command>CG</Command></Para></Entry>
</Row>
</TBody>
</TGroup>
</Table>
</Sect2>
<Sect2 Id="PG.widgs.div.26">
<Title>コールバックのための構造体<IndexTerm>
<Primary>&lt;Filename>DtComboBox&lt;Default Para Font></Primary>
<Secondary>コールバックのための構造体</Secondary>
</IndexTerm><IndexTerm>
<Primary>コールバックのための構造体</Primary>
</IndexTerm><IndexTerm>
<Primary>&lt;Filename>DtComboBox&lt;Default Para Font></Primary>
</IndexTerm></Title>
<Para>コールバックのための構造体を次に示し、
<!--Original XRef content: 'Table&numsp;7&hyphen;6'-->
<XRef Role="CodeOrFigureOrTable" Linkend="PG.widgs.mkr.12">で説明します。</Para>
<ProgramListing>typedef struct {
int <Symbol Role="Variable">reason</Symbol>;
XEvent <Symbol Role="Variable">*event</Symbol>;
XmString <Symbol Role="Variable">item_or_text</Symbol>;
int <Symbol Role="Variable">item_position</Symbol>;
} DtComboBoxCallbackStruct;</ProgramListing>
<Table Id="PG.widgs.tbl.6" Frame="Topbot">
<Title Id="PG.widgs.mkr.12">DtComboBoxコールバックのための構造体</Title>
<TGroup Cols="2">
<ColSpec Colname="1" Colwidth="1.25 in">
<ColSpec Colname="2" Colwidth="3.75 in">
<THead>
<Row>
<Entry><Para><Literal>構造体</Literal></Para></Entry>
<Entry><Para><Literal>説明</Literal></Para></Entry>
</Row>
</THead>
<TBody>
<Row>
<Entry><Para><Symbol Role="Variable">reason</Symbol></Para></Entry>
<Entry><Para>このコールバックを発行する唯一のreason は、<Filename>XmCR_SELECT</Filename>です。</Para></Entry>
</Row>
<Row>
<Entry><Para><Symbol Role="Variable">event</Symbol></Para></Entry>
<Entry><Para>このコールバック が呼び出される原因となったイベントへのポインタ。
NULLになることもあります。</Para></Entry>
</Row>
<Row>
<Entry><Para><Symbol Role="Variable">item_or_text</Symbol></Para></Entry>
<Entry><Para>イベントがコールバックを呼び出したときのテキスト・ウィジェットの内容。
このデータは<Filename>call_data</Filename> 構造体の範囲でのみ有効で、この範囲外で使用するときにはコピーしなければなりません。
</Para></Entry>
</Row>
<Row>
<Entry><Para><Symbol Role="Variable">item_position</Symbol></Para></Entry>
<Entry><Para><Command>DtComboBox</Command> リストの<Command>DtNposition</Command> リソースの新しい値。
値が0の場合、ユーザは<Command>XmTextField</Command> ウィジェットに値を入力したことになります。
</Para></Entry>
</Row>
</TBody>
</TGroup>
</Table>
</Sect2>
<Sect2 Id="PG.widgs.div.27">
<Title>DtComboBoxウィジェットの例<IndexTerm>
<Primary>&lt;Filename>DtComboBox&lt;Default Para Font></Primary>
<Secondary>例 コード</Secondary>
</IndexTerm><IndexTerm>
<Primary>コード 例</Primary>
<Secondary>&lt;Filename>DtComboBox&lt;Default Para Font></Secondary>
</IndexTerm></Title>
<Para>次の例は、<Command>DtComboBox</Command> ウィジェットの作成方法と使用方法を示しています。
このコードは、<Filename>/usr/dt/examples/dtwidget</Filename>ディレクトリの<Filename>controls.c</Filename> デモの一部です。
</Para>
<ProgramListing>/*
* Example code for DtComboBox
*/
#include &lt;Dt/ComboBox.h>
static char *comboValueStrings[] = {
&ldquo;alpha&rdquo;, &ldquo;beta&rdquo;, &ldquo;gamma&rdquo;, &ldquo;delta&rdquo;,
&ldquo;epsilon&rdquo;, &ldquo;zeta&rdquo;, &ldquo;eta&rdquo;, &ldquo;theta&rdquo;,
&ldquo;iota&rdquo;, &ldquo;kappa&rdquo;, &ldquo;lambda&rdquo;, &ldquo;mu&rdquo;,
&ldquo;nu&rdquo;, &ldquo;xi&rdquo;, &ldquo;omicron&rdquo;, &ldquo;pi&rdquo;,
&ldquo;rho&rdquo;, &ldquo;sigma&rdquo;, &ldquo;tau&rdquo;, &ldquo;upsilon&rdquo;,
&ldquo;phi&rdquo;, &ldquo;chi&rdquo;, &ldquo;psi&rdquo;, &ldquo;omega&rdquo;
};
static char *colorStrings[] = { &ldquo;Red&rdquo;, &ldquo;Yellow&rdquo;, &ldquo;Green&rdquo;, &ldquo;Brown&rdquo;,
&ldquo;Blue&rdquo; };
static void CreateComboBoxes(Widget parent)
{
Widget titleLabel, comboBox, list;
XmString *valueXmstrings, *colorXmstrings;
int numValueStrings, numColorStrings;
XmString labelString, xmString;
Arg args[20];
int i, n;
/* Create value compound strings */
numValueStrings = XtNumber(comboValueStrings);
valueXmstrings = (XmString *)XtMalloc(numValueStrings *
sizeof(XmString*));
for (i = 0; i &lt; numValueStrings; i++) {
valueXmstrings[i] =
XmStringCreateLocalized(comboValueStrings[i]);
}
/* Create color compound strings */
numColorStrings = XtNumber(colorStrings);
colorXmstrings = (XmString *)XtMalloc(numColorStrings *
sizeof(XmString*));
for (i = 0; i &lt; numColorStrings; i++) {
colorXmstrings[i] =
XmStringCreateLocalized(colorStrings[i]);
}
/* Create title label */
labelString = XmStringCreateLocalized(&ldquo;ComboBox Widget&rdquo;);
n = 0;
XtSetArg(args[n], XmNlabelString, labelString); n++;
titleLabel = XmCreateLabel(parent, &ldquo;title&rdquo;, args, n);
XtManageChild(titleLabel);
XmStringFree(labelString);
/*
* Create an editable ComboBox containing the color strings.
* Get the widget id of the drop down list, add some greek
* letter names to it, and make more items visible.
*/
n = 0;
XtSetArg(args[n], DtNcomboBoxType, DtDROP_DOWN_COMBO_BOX); n++;
XtSetArg(args[n], DtNitems, colorXmstrings); n++;
XtSetArg(args[n], DtNitemCount, numColorStrings); n++;
XtSetArg(args[n], DtNvisibleItemCount, 5); n++;
XtSetArg(args[n], DtNcolumns, 10); n++;
comboBox = DtCreateComboBox(parent, &ldquo;comboBox1&rdquo;, args, n);
XtManageChild(comboBox);
list = XtNameToWidget(comboBox, &ldquo;*List&rdquo;);
XmListAddItems(list, valueXmstrings, 10, 0);
XtVaSetValues(list, XmNvisibleItemCount, 10, NULL);
/*
* Create an editable ComboBox with no entries.
* Get the widget id of the drop down list, add some greek
* letter names to it and select the third item in the list.
*/
n = 0;
XtSetArg(args[n], DtNcomboBoxType, DtDROP_DOWN_COMBO_BOX); n++;
XtSetArg(args[n], DtNorientation, DtLEFT); n++;
XtSetArg(args[n], DtNcolumns, 10); n++;
comboBox = DtCreateComboBox(parent, &ldquo;comboBox2&rdquo;, args, n);
XtManageChild(comboBox);
list = XtNameToWidget(comboBox, &ldquo;*List&rdquo;);
XmListAddItems(list, valueXmstrings, 7, 0);
XtVaSetValues(list, XmNvisibleItemCount, 7, NULL);
XtVaSetValues(comboBox, DtNselectedPosition, 3, NULL);
/*
* Create a non-editable ComboBox containing some greek letter
names.
* Position the arrow on the left.
* Select the `gamma' item in the list.
*/
n = 0;
XtSetArg(args[n], DtNorientation, DtLEFT); n++;
XtSetArg(args[n], DtNitems, valueXmstrings); n++;
XtSetArg(args[n], DtNitemCount, numValueStrings); n++;
XtSetArg(args[n], DtNvisibleItemCount, 8); n++;
comboBox = DtCreateComboBox(parent, &ldquo;comboBox3&rdquo;, args, n);
XtManageChild(comboBox);
xmString = XmStringCreateLocalized(&ldquo;gamma&rdquo;);
XtVaSetValues(comboBox, DtNselectedItem, xmString, NULL);
XmStringFree(xmString);
/*
* Create a non-editable ComboBox with no entries.
* Position the arrow on the right.
* Add the greek letter names to the list and select the fourth
item.
*/
n = 0;
XtSetArg(args[n], DtNorientation, DtRIGHT); n++;
XtSetArg(args[n], DtNvisibleItemCount, 8); n++;
comboBox = DtCreateComboBox(parent, &ldquo;comboBox4&rdquo;, args, n);
XtManageChild(comboBox);
for (i = 0; i &lt; numValueStrings; i++) {
DtComboBoxAddItem(comboBox, valueXmstrings[i],
0, True);
}
XtVaSetValues(comboBox, DtNselectedPosition, 4, NULL);
/*
* Free value and color strings, ComboBox has taken a copy.
*/
for (i = 0; i &lt; numValueStrings; i++) {
XmStringFree(valueXmstrings[i]);
}
XtFree((char*)valueXmstrings);
for (i = 0; i &lt; numColorStrings; i++) {
XmStringFree(colorXmstrings[i]);
}
XtFree((char*)colorXmstrings);
}</ProgramListing>
</Sect2>
</Sect1>
<Sect1 Id="PG.widgs.div.28">
<Title Id="PG.widgs.mkr.13">メニュー・ボタン・ウィジェット (DtMenuButton)<IndexTerm>
<Primary>&lt;Filename>DtMenuButton&lt;Default Para Font> ウィジェット</Primary>
</IndexTerm><IndexTerm>
<Primary>ウィジェット</Primary>
<Secondary>&lt;Filename>DtMenuButton&lt;Default Para Font></Secondary>
</IndexTerm><IndexTerm>
<Primary>メニュー・ボタン・ウィジェット</Primary>
</IndexTerm><IndexTerm>
<Primary>ウィジェット</Primary>
<Secondary>メニュー・ボタン</Secondary>
</IndexTerm><IndexTerm>
<Primary>ポップアップ・メニュー・ボタン・ウィジェット</Primary>
</IndexTerm><IndexTerm>
<Primary>ウィジェット</Primary>
<Secondary>ポップアップ・メニュー</Secondary>
</IndexTerm></Title>
<Para><Command>DtMenuButton</Command>ウィジェットは、メニュー区画の外側にメニュー階層機能を提供するために使用します。
</Para>
<Para><Command>DtMenuButton</Command> ウィジェットは、<Command>XmCascadeButton</Command>ウィジェットの メニュー
<IndexTerm>
<Primary>階層・メニュー・ウィジェット</Primary>
</IndexTerm><IndexTerm>
<Primary>ウィジェット</Primary>
<Secondary>階層・メニュー</Secondary>
</IndexTerm>階層機能を補足するコマンド・ウィジェットです。
<Command>XmCascadeButton</Command> ウィジェットを補うものとして、<Command>MenuBar</Command>、
<Command>Pulldown</Command>、または <Command>Popup</Command>の外側で示すことができます。 (<Command>MenuPane</Command>の内部では<Command>XmCascadeButton</Command> ウィジェットを使用します。 )
<!--Original XRef content: 'Figure&numsp;7&hyphen;2'-->
<XRef Role="CodeOrFigureOrTable" Linkend="PG.widgs.mkr.9"> に、<Command>DtMenuButton</Command> ウィジェットの使用例を示します。</Para>
<Figure>
<Title Id="PG.widgs.mkr.14">メニュー・ボタン・ウィジェットの例 (DtMenuButton)<IndexTerm>
<Primary>&lt;Filename>DtMenuButton&lt;Default Para Font></Primary>
<Secondary>図</Secondary>
</IndexTerm><IndexTerm>
<Primary>図</Primary>
<Secondary>&lt;Filename>DtMenuButton&lt;Default Para Font></Secondary>
</IndexTerm></Title>
<Graphic Entityref="PG.widgs.fig.3" Id="PG.widgs.grph.3"></Graphic>
</Figure>
<Sect2 Id="PG.widgs.div.29">
<Title>ライブラリとヘッダ・ファイル<IndexTerm>
<Primary>&lt;Filename>DtMenuButton&lt;Default Para Font></Primary>
<Secondary>ヘッダ・ファイル</Secondary>
</IndexTerm><IndexTerm>
<Primary>ヘッダ・ファイル</Primary>
<Secondary>&lt;Filename>DtMenuButton&lt;Default Para Font></Secondary>
</IndexTerm><IndexTerm>
<Primary>ライブラリ</Primary>
<Secondary>&lt;Filename>libDtWidget&lt;Default Para Font></Secondary>
</IndexTerm><IndexTerm>
<Primary>&lt;Filename>libDtWidget&lt;Default Para Font> ライブラリ</Primary>
</IndexTerm></Title>
<Para><Command>DtMenuButton</Command> ウィジェットは、<Command>libDtWidget</Command> ライブラリにあります。ヘッダ・ファイルは、
<Filename>Dt/MenuButton.h</Filename>です。</Para>
</Sect2>
<Sect2 Id="PG.widgs.div.30">
<Title>デモ・プログラム<IndexTerm>
<Primary>&lt;Filename>DtMenuButton&lt;Default Para Font></Primary>
<Secondary>デモ・プログラム</Secondary>
</IndexTerm><IndexTerm>
<Primary>デモ・プログラム</Primary>
<Secondary>&lt;Filename>DtMenuButton&lt;Default Para Font></Secondary>
</IndexTerm></Title>
<Para><Command>DtMenuButton</Command> ウィジェットの使用例が入っているデモが、
<Filename>/usr/dt/examples/dtwidget/controls.c</Filename>にあります。</Para>
</Sect2>
<Sect2 Id="PG.widgs.div.31">
<Title>簡易関数<IndexTerm>
<Primary>&lt;Filename>DtMenuButton&lt;Default Para Font></Primary>
<Secondary>簡易関数</Secondary>
</IndexTerm><IndexTerm>
<Primary>簡易関数</Primary>
<Secondary>&lt;Filename>DtMenuButton&lt;Default Para Font></Secondary>
</IndexTerm></Title>
<Para><Filename>DtCreateMenuButton()</Filename>は、共通デスクトップ環境ウィジェットを作成する簡易関数です。
</Para>
<Para><Command>DtMenuButton</Command> ウィジェットは、<Command>XmLabel</Command> クラスのサブクラスです。視覚的には、
<Command>DtMenuButton</Command> ウィジェットは、ラベル文字とメニュー・グリフを持ちます。メニュー・グリフは、常にウィジェットの右端に表示され、デフォルトでは下向き矢印です。
</Para>
<Para><Command>DtMenuButton</Command> ウィジェットには、暗黙的に作成されたサブメニューが接続されています。
サブメニュー は、この<Command>DtMenuButton</Command> ウィジェットを親とするポップアップ・メニューです。
暗黙的に作成されたサブメニューの名前は、この<Command>DtMenuButton</Command> ウィジェットの名前の前に
<Filename>submenu_</Filename> を付けたものです。
サブメニューのウィジェット IDは、この<Command>DtMenuButton</Command> ウィジェットの<Command>DtNsubMenuId</Command> リソースに<Command>XtGetValues</Command>を設定することにより取得できます。
暗黙的に作成されたサブメニューは、このウィジェットの利用者によって破壊されることはありません。
</Para>
<Para>サブメニューは、<Command>DtMenuButton</Command>ウィジェットのどこかで[メニュー・ポスト]ボタン(<Command>XmRowColumn</Command>の
<Command>XmNmenuPost</Command> リソースを参照)を押すことによって、またはMotifの取り消しキー(通常は[Escape]キー)を押すことによってポップアップすることができます。
</Para>
</Sect2>
<Sect2 Id="PG.widgs.div.32">
<Title>クラス<IndexTerm>
<Primary>&lt;Filename>DtMenuButton&lt;Default Para Font></Primary>
<Secondary>クラス</Secondary>
</IndexTerm><IndexTerm>
<Primary>クラス</Primary>
<Secondary>&lt;Filename>DtMenuButton&lt;Default Para Font></Secondary>
</IndexTerm></Title>
<Para><Command>DtMenuButtonWidget</Command>は、<Command>Core</Command>、<Command>XmPrimitive</Command>、および<Command>XmLabel</Command> クラスから動作とリソースを継承します。
</Para>
<Para>クラス・ポインタは、<Command>dtMenuButtonWidgetClass</Command>です。</Para>
<Para>クラス名は、<Command>DtMenuButtonWidget</Command>です。</Para>
<Para><Command>DtMenuButtonWidget</Command> は、サブクラス化をサポートしません。</Para>
</Sect2>
<Sect2 Id="PG.widgs.div.33">
<Title>リソース<IndexTerm>
<Primary>&lt;Filename>DtMenuButton&lt;Default Para Font></Primary>
<Secondary>リソース</Secondary>
</IndexTerm><IndexTerm>
<Primary>リソース</Primary>
<Secondary>&lt;Filename>DtMenuButton&lt;Default Para Font></Secondary>
</IndexTerm></Title>
<Para><Command>DtMenuButtonWidget</Command>は、次のリソースを提供します。これらのリソースのクラス、型、デフォルト、およびアクセスを
<!--Original XRef content: 'Table&numsp;7&hyphen;7'-->
<XRef Role="CodeOrFigureOrTable" Linkend="PG.widgs.mkr.15"> に示します。
</Para>
<ItemizedList Remap="Bullet1">
<ListItem>
<Para><Command>DtNcascadingCallback</Command>は、接続されたサブメニューが表示される前に呼び出されるコールバックのリストを指定します。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNcascadePixmap</Command>は、メニュー・グリフとして表示されるピックスマップを指定します。ピックスマップが指定されない場合は、下向き矢印が表示されます。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNsubMenuId</Command>は、この<Command>DtMenuButton</Command>ウィジェットと関連付けられるポップアップ・メニュー区画のウィジェット IDを指定します。
ポップアップ・
メニュー 区画をこの<Command>DtMenuButton</Command>を親として作成しなければなりません。リソースの設定時にこのウィジェットによってサブメニューが自動的に破壊されるので、ウィジェットの作成時にこのリソースを設定することはできません。
</Para>
</ListItem>
</ItemizedList>
<Para>詳細については、<Filename MoreInfo="RefEntry">DtMenuButtonWidget</Filename>(3)のマニュアル・ページを参照してください。</Para>
<Para>アクセス欄のコードは、次のことが可能かどうかを示します。:</Para>
<ItemizedList Remap="Bullet1">
<ListItem>
<Para>作成時にリソースを設定する(C)</Para>
</ListItem>
<ListItem>
<Para><Command>XtSetValues</Command>を使用して設定する (S)</Para>
</ListItem>
<ListItem>
<Para><Command>XtGetValues</Command>を使用して検索する (G)</Para>
</ListItem>
</ItemizedList>
<Table Id="PG.widgs.tbl.7" Frame="Topbot">
<Title Id="PG.widgs.mkr.15">DtMenuButtonWidgetリソース</Title>
<TGroup Cols="5">
<ColSpec Colname="1" Colwidth="1.8 in">
<ColSpec Colname="2" Colwidth="1.5 in">
<ColSpec Colname="3" Colwidth="1.27857 in">
<ColSpec Colname="4" Colwidth="1.70714 in">
<ColSpec Colname="5" Colwidth="0.7 in">
<THead>
<Row>
<Entry><Para><Literal>名前</Literal></Para></Entry>
<Entry><Para><Literal>クラス</Literal></Para></Entry>
<Entry><Para><Literal>型</Literal></Para></Entry>
<Entry><Para><Literal>デフォルト</Literal></Para></Entry>
<Entry><Para><Literal>アクセス</Literal></Para></Entry>
</Row>
</THead>
<TBody>
<Row>
<Entry><Para><Command>DtNcascadingCallback</Command></Para></Entry>
<Entry><Para><Command>DtCCallback</Command></Para></Entry>
<Entry><Para><Command>XtCallbackList</Command></Para></Entry>
<Entry><Para><Command>NULL</Command></Para></Entry>
<Entry><Para><Command>C</Command></Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNcascadePixmap</Command></Para></Entry>
<Entry><Para><Command>DtCPixmap</Command></Para></Entry>
<Entry><Para><Command>Pixmap</Command></Para></Entry>
<Entry><Para><Filename>XmUNSPECIFIED_PIXMAP</Filename></Para></Entry>
<Entry><Para><Command>CSG</Command></Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNsubMenuId</Command></Para></Entry>
<Entry><Para><Command>DtCMenuWidget</Command></Para></Entry>
<Entry><Para><Command>Widget</Command></Para></Entry>
<Entry><Para><Command>NULL</Command></Para></Entry>
<Entry><Para><Command>SG</Command></Para></Entry>
</Row>
</TBody>
</TGroup>
</Table>
</Sect2>
<Sect2 Id="PG.widgs.div.34">
<Title>コールバックのための構造体<IndexTerm>
<Primary>&lt;Filename>DtMenuButton&lt;Default Para Font></Primary>
<Secondary>コールバック 構造体</Secondary>
</IndexTerm><IndexTerm>
<Primary>コールバック 構造体</Primary>
<Secondary>&lt;Filename>DtMenuButton&lt;Default Para Font></Secondary>
</IndexTerm></Title>
<Para>コールバックのための構造体を次に示し、
<!--Original XRef content: 'Table&numsp;7&hyphen;8'-->
<XRef Role="CodeOrFigureOrTable" Linkend="PG.widgs.mkr.16">で説明します。</Para>
<ProgramListing>typedef struct {
int <Symbol Role="Variable">reason</Symbol>;
XEvent <Symbol Role="Variable">*event</Symbol>;
} XmAnyCallbackStruct;</ProgramListing>
<Table Id="PG.widgs.tbl.8" Frame="Topbot">
<Title Id="PG.widgs.mkr.16">DtMenuButtonWidgetコールバックのための構造体</Title>
<TGroup Cols="2">
<ColSpec Colname="1" Colwidth="1.25 in">
<ColSpec Colname="2" Colwidth="3.74009 in">
<THead>
<Row>
<Entry><Para><Literal>構造体</Literal></Para></Entry>
<Entry><Para><Literal>説明</Literal></Para></Entry>
</Row>
</THead>
<TBody>
<Row>
<Entry><Para><Symbol Role="Variable">reason</Symbol></Para></Entry>
<Entry><Para>コールバックが呼び出されたreasonを返します。</Para></Entry>
</Row>
<Row>
<Entry><Para><Symbol Role="Variable">event</Symbol></Para></Entry>
<Entry><Para>コールバックの要因となった<Command>XEvent</Command>へのポインタ。コールバックがXEventによって起動されなかった場合には<Command>NULL</Command>になります。
</Para></Entry>
</Row>
</TBody>
</TGroup>
</Table>
</Sect2>
<Sect2 Id="PG.widgs.div.35">
<Title>DtMenuButton ウィジェットの例<IndexTerm>
<Primary>&lt;Filename>DtMenuButton&lt;Default Para Font></Primary>
<Secondary>例 コード</Secondary>
</IndexTerm><IndexTerm>
<Primary>コード 例</Primary>
<Secondary>&lt;Filename>DtMenuButton&lt;Default Para Font></Secondary>
</IndexTerm></Title>
<Para>次の例は、<Command>DtMenuButton</Command> ウィジェットの作成方法と使用方法を示しています。
このコードは、<Filename>/usr/dt/examples/dtwidget</Filename>ディレクトリの<Filename>controls.c</Filename>デモの一部です。
</Para>
<ProgramListing>/*
* Example code for DtMenuButton
*/
#include Dt/DtMenuButton.h
/* MenuButton custom glyph */
#define menu_glyph_width 16
#define menu_glyph_height 16
static unsigned char menu_glyph_bits[] = {
0xe0, 0x03, 0x98, 0x0f, 0x84, 0x1f, 0x82, 0x3f, 0x82, 0x3f, 0x81,
0x7f,
0x81, 0x7f, 0xff, 0x7f, 0xff, 0x40, 0xff, 0x40, 0xfe, 0x20, 0xfe,
0x20,
0xfc, 0x10, 0xf8, 0x0c, 0xe0, 0x03, 0x00, 0x00};
static void CreateMenuButtons(Widget parent)
{
Widget menuButton, submenu, titleLabel, button;
Pixmap cascadePixmap;
Pixel fg, bg;
Cardinal depth;
XmString labelString;
Arg args[20];
int i, n;
/* Create title label */
labelString = XmStringCreateLocalized(&ldquo;MenuButton Widget&rdquo;);
n = 0;
XtSetArg(args[n], XmNlabelString, labelString); n++;
titleLabel = XmCreateLabel(parent, &ldquo;title&rdquo;, args, n);
XtManageChild(titleLabel);
XmStringFree(labelString);
/*
* Create a MenuButton.
* Add push buttons to the built-in popup menu.
*/
labelString = XmStringCreateLocalized(&ldquo;Action&rdquo;);
n = 0;
XtSetArg(args[n], XmNlabelString, labelString); n++;
menuButton = DtCreateMenuButton(parent, &ldquo;menuButton1&rdquo;, args, n);
XtManageChild(menuButton);
XmStringFree(labelString);
XtVaGetValues(menuButton, DtNsubMenuId, &amp;submenu, NULL);
button= XmCreatePushButton(submenu, &ldquo;Push&rdquo;, NULL, 0);
XtManageChild(button);
button = XmCreatePushButton(submenu, &ldquo;Pull&rdquo;, NULL, 0);
XtManageChild(button);
button = XmCreatePushButton(submenu, &ldquo;Turn&rdquo;, NULL, 0);
XtManageChild(button);
/*
* Create a MenuButton.
* Replace the built-in popup menu with a tear-off menu.
* Add a custom pixmap in the colors of the MenuButton.
*/
labelString = XmStringCreateLocalized(&ldquo;Movement&rdquo;);
n = 0;
XtSetArg(args[n], XmNlabelString, labelString); n++;
menuButton = DtCreateMenuButton(parent, &ldquo;menuButton1&rdquo;, args, n);
XtManageChild(menuButton);
XmStringFree(labelString);
/* Create a tear-off menu */
n = 0;
XtSetArg(args[0], XmNtearOffModel, XmTEAR_OFF_ENABLED); n++;
submenu = XmCreatePopupMenu(menuButton, &ldquo;submenu&rdquo;, args, n);
button = XmCreatePushButton(submenu, &ldquo;Run&rdquo;, NULL, 0);
XtManageChild(button);
button = XmCreatePushButton(submenu, &ldquo;Jump&rdquo;, NULL, 0);
XtManageChild(button);
button = XmCreatePushButton(submenu, &ldquo;Stop&rdquo;, NULL, 0);
XtManageChild(button);
XtVaSetValues(menuButton, DtNsubMenuId, submenu, NULL);
/* Create a pixmap using the menu button's colors and depth */
XtVaGetValues(menuButton,
XmNforeground, &amp;fg,
XmNbackground, &amp;bg,
XmNdepth, &amp;depth,
NULL);
cascadePixmap = XCreatePixmapFromBitmapData(XtDisplay
(menuButton),DefaultRootWindow(XtDisplay
(menuButton)),
(char*)menu_glyph_bits,
menu_glyph_width, menu_glyph_height,
fg, bg, depth);
XtVaSetValues(menuButton, DtNcascadePixmap, cascadePixmap,
NULL);
}</ProgramListing>
</Sect2>
</Sect1>
<Sect1 Id="PG.widgs.div.36">
<Title Id="PG.widgs.mkr.17">テキスト・エディタ・ウィジェット (DtEditor)<IndexTerm>
<Primary>ウィジェット</Primary>
<Secondary>テキスト・エディタ</Secondary>
</IndexTerm><IndexTerm>
<Primary>テキスト・エディタ・ウィジェット</Primary>
</IndexTerm><IndexTerm>
<Primary>ウィジェット</Primary>
<Secondary>&lt;Filename>DtEditor&lt;Default Para Font></Secondary>
</IndexTerm><IndexTerm>
<Primary>&lt;Filename>DtEditor&lt;Default Para Font> ウィジェット</Primary>
</IndexTerm></Title>
<Para>共通デスクトップ環境テキスト編集システムは、次の2つのコンポーネントから成ります。
:</Para>
<ItemizedList Remap="Bullet1">
<ListItem>
<Para>グラフィカル・インタフェース、アクション・インタフェース、およびToolTalkインタフェースを介して編集サービスを提供するテキスト・エディタ・クライアントの<Command>dtpad</Command>。
</Para>
</ListItem>
<ListItem>
<Para>次の編集サービスのためのプログラム・インタフェースを提供するエディタ・ウィジェットの <Filename MoreInfo="RefEntry">DtEditor</Filename>(3)。
:</Para>
<ItemizedList Remap="Bullet2">
<ListItem>
<Para>カット&ペースト</Para>
</ListItem>
<ListItem>
<Para>検索と置換</Para>
</ListItem>
<ListItem>
<Para>単純な書式化</Para>
</ListItem>
<ListItem>
<Para>スペルチェック( 8ビット・ロケール用)</Para>
</ListItem>
<ListItem>
<Para>以前の編集を元に戻す</Para>
</ListItem>
<ListItem>
<Para> ASCII テキスト、マルチバイト・テキスト、およびバッファ・データの入出力をサポートする拡張入出力処理機能
</Para>
</ListItem>
<ListItem>
<Para>ファイルの直接読み書きのサポート</Para>
</ListItem>
</ItemizedList>
</ListItem>
</ItemizedList>
<Para>Motifテキスト・ウィジェットはプログラム・インタフェースも提供しますが、システム全体で一貫したエディタを使用するアプリケーションは、
<Filename MoreInfo="RefEntry">DtEditor</Filename>(3) ウィジェットを使用しなければなりません。共通デスクトップ環境のテキスト・エディタとメール・プログラムは、エディタ・ウィジェットを使用します。
このウィジェットは、次のような状況のときに使用してください。:</Para>
<OrderedList>
<ListItem>
<Para>[スペルチェック]、[元に戻す]、および[検索/変更]など、<Filename MoreInfo="RefEntry">DtEditor</Filename>(3)ウィジェットが提供する機能を使いたい場合。
</Para>
</ListItem>
<ListItem>
<Para>ユーザがファイルからデータを読み込んだり、ファイルにデータを書き込んだりするコードを作成したくない場合。
</Para>
</ListItem>
<ListItem>
<Para>ユーザが入力した文字またはユーザが行ったカーソル移動を調べる必要がないプログラムを作成する場合。
</Para>
</ListItem>
</OrderedList>
<Para>この節では、テキスト・エディタ・ウィジェット<Filename MoreInfo="RefEntry">DtEditor</Filename>(3)について説明します。</Para>
<Para>エディタ・ウィジェット・ライブラリは、テキスト・ファイルの作成と編集のためのサポートを提供します。
デスクトップ環境で実行するアプリケーションで、一貫した方法でテキスト・データを編集できるようにします。
<Filename MoreInfo="RefEntry">DtEditor</Filename>(3) ウィジェットは、テキスト用のスクロールする編集ウィンドウ、オプションのステータス行、およびテキストの検索と置換、スペルチェック、書式オプションの指定を行うためのダイアログから成ります。
テキスト・エディタ・ウィジェットには、ウィジェットをプログラム的に制御するための簡易関数のセットが含まれています。
</Para>
<Sect2 Id="PG.widgs.div.37">
<Title>ライブラリとヘッダ・ファイル<IndexTerm>
<Primary>&lt;Filename>DtEditor&lt;Default Para Font></Primary>
<Secondary>ヘッダ・ファイル</Secondary>
</IndexTerm><IndexTerm>
<Primary>ヘッダ・ファイル</Primary>
<Secondary>&lt;Filename>DtEditor&lt;Default Para Font></Secondary>
</IndexTerm><IndexTerm>
<Primary>&lt;Filename>libDtWidget&lt;Default Para Font> ライブラリ</Primary>
</IndexTerm><IndexTerm>
<Primary>ライブラリ</Primary>
<Secondary>&lt;Filename>libDtWidget&lt;Default Para Font></Secondary>
</IndexTerm></Title>
<Para><Command>DtEditor</Command> ウィジェットは、<Command>libDtWidget</Command> ライブラリにあります。ヘッダ・ファイルは、
<Filename>Dt/Editor.h</Filename>です。</Para>
</Sect2>
<Sect2 Id="PG.widgs.div.38">
<Title>デモ・プログラム<IndexTerm>
<Primary>&lt;Filename>DtEditor&lt;Default Para Font></Primary>
<Secondary>デモ・プログラム</Secondary>
</IndexTerm><IndexTerm>
<Primary>デモ・プログラム</Primary>
<Secondary>&lt;Filename>DtEditor&lt;Default Para Font></Secondary>
</IndexTerm></Title>
<Para><Command>DtEditor</Command> ウィジェットの使用例が入っているデモが、
<Filename>/usr/dt/examples/dtwidget/editor.c</Filename>にあります。</Para>
</Sect2>
<Sect2 Id="PG.widgs.div.39">
<Title>クラス<IndexTerm>
<Primary>&lt;Filename>DtEditor&lt;Default Para Font></Primary>
<Secondary>クラス</Secondary>
</IndexTerm><IndexTerm>
<Primary>クラス</Primary>
<Secondary>&lt;Filename>DtEditor&lt;Default Para Font></Secondary>
</IndexTerm></Title>
<Para><Command>DtEditor</Command> ウィジェット・クラスについては、ウィジェットのサブクラス化はサポートされません。</Para>
<Para><Command>DtEditor</Command> は、<Command>Core</Command>、<Command>Composite</Command>、
<Command>Constraints</Command>、<Command>XmManager</Command>、および<Command>XmForm</Command>クラスから動作とリソースを継承します。
</Para>
<Para>エディタ・ウィジェットのクラス名は、<Command>DtEditorWidget</Command>です。</Para>
<Para>クラス・ポインタ は、<Command>dtEditorWidgetClass</Command>です。</Para>
</Sect2>
<Sect2 Id="PG.widgs.div.40">
<Title>簡易関数<IndexTerm>
<Primary>&lt;Filename>DtEditor&lt;Default Para Font></Primary>
<Secondary>簡易関数</Secondary>
</IndexTerm><IndexTerm>
<Primary>簡易関数</Primary>
<Secondary>&lt;Filename>DtEditor&lt;Default Para Font></Secondary>
</IndexTerm></Title>
<Para><Command>DtEditor</Command>簡易関数を次の表に示します。</Para>
<Sect3 Id="PG.widgs.div.41">
<Title>ライフ・サイクル関数<IndexTerm>
<Primary>&lt;Filename>DtEditor&lt;Default Para Font></Primary>
<Secondary>ライフ・サイクル関数</Secondary>
</IndexTerm><IndexTerm>
<Primary>ライフ・サイクル関数</Primary>
<Secondary>&lt;Filename>DtEditor&lt;Default Para Font></Secondary>
</IndexTerm></Title>
<Para><Command>DtEditor</Command>ライフ・サイクル関数を
<!--Original XRef content: 'Table&numsp;7&hyphen;9'-->
<XRef Role="CodeOrFigureOrTable" Linkend="PG.widgs.mkr.18">に示します。</Para>
<Table Id="PG.widgs.tbl.9" Frame="Topbot">
<Title Id="PG.widgs.mkr.18">DtEditor ライフ・サイクル関数</Title>
<TGroup Cols="2">
<ColSpec Colname="1" Colwidth="2.125 in">
<ColSpec Colname="2" Colwidth="2.87897 in">
<THead>
<Row>
<Entry><Para><Literal>関数</Literal></Para></Entry>
<Entry><Para><Literal>説明</Literal></Para></Entry>
</Row>
</THead>
<TBody>
<Row>
<Entry><Para><Command>DtCreateEditor</Command></Para></Entry>
<Entry><Para><Command>DtEditor</Command> ウィジェットの新規インスタンス
とその子を作成します。</Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtEditorReset</Command></Para></Entry>
<Entry><Para><Command>DtEditor</Command> ウィジェットを初期状態に復元します。</Para></Entry>
</Row>
</TBody>
</TGroup>
</Table>
</Sect3>
<Sect3 Id="PG.widgs.div.42">
<Title>入出力関数<IndexTerm>
<Primary>&lt;Filename>DtEditor&lt;Default Para Font></Primary>
<Secondary>入出力関数</Secondary>
</IndexTerm><IndexTerm>
<Primary>入出力関数</Primary>
<Secondary>&lt;Filename>DtEditor&lt;Default Para Font></Secondary>
</IndexTerm></Title>
<Para><Command>DtEditor</Command>入出力関数を
<!--Original XRef content: 'Table&numsp;7&hyphen;10'-->
<XRef Role="CodeOrFigureOrTable" Linkend="PG.widgs.mkr.19">に示します。</Para>
<Table Id="PG.widgs.tbl.10" Frame="Topbot">
<Title Id="PG.widgs.mkr.19">DtEditor 入出力関数</Title>
<TGroup Cols="2">
<ColSpec Colname="1" Colwidth="2.25 in">
<ColSpec Colname="2" Colwidth="2.75 in">
<THead>
<Row>
<Entry><Para><Literal>関数</Literal></Para></Entry>
<Entry><Para><Literal>説明</Literal></Para></Entry>
</Row>
</THead>
<TBody>
<Row>
<Entry><Para><Command>DtEditorAppend</Command></Para></Entry>
<Entry><Para>エディタ・ウィジェットの最後に内容データを追加します。
</Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtEditorAppendFromFile</Command></Para></Entry>
<Entry><Para>エディタ・ウィジェットの最後にファイルの内容を追加します。
</Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtEditorGetContents</Command></Para></Entry>
<Entry><Para>エディタ・ウィジェットの内容全体を検索します。
</Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtEditorInsert</Command></Para></Entry>
<Entry><Para>内容データを現在の挿入位置に挿入します。
</Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtEditorInsertFromFile</Command></Para></Entry>
<Entry><Para>ファイルの内容を現在の挿入位置に挿入します。
</Para></Entry>
</Row>
<Row>
<Entry><Para>DtEditorReplace</Para></Entry>
<Entry><Para>テキストの一部を与えられたデータと置き換えます。
</Para></Entry>
</Row>
<Row>
<Entry><Para>DtEditorReplaceFromFile</Para></Entry>
<Entry><Para>テキストの一部をファイルの内容と置き換えます。
</Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtEditorSaveContentsToFile</Command></Para></Entry>
<Entry><Para>全体の内容をファイルに保存します。</Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtEditorSetContents</Command></Para></Entry>
<Entry><Para>内容データをエディタ・ウィジェットに読み込んで、ウィジェットの内容全体を置き換えます。
</Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtEditorSetContentsFromFile</Command></Para></Entry>
<Entry><Para>ファイルの内容をエディタ・ウィジェットに読み込んで、ウィジェットの内容全体を置き換えます。
</Para></Entry>
</Row>
</TBody>
</TGroup>
</Table>
</Sect3>
<Sect3 Id="PG.widgs.div.43">
<Title>選択関数<IndexTerm>
<Primary>&lt;Filename>DtEditor&lt;Default Para Font></Primary>
<Secondary>選択関数</Secondary>
</IndexTerm><IndexTerm>
<Primary>選択関数</Primary>
<Secondary>&lt;Filename>DtEditor&lt;Default Para Font></Secondary>
</IndexTerm></Title>
<Para><Command>DtEditor</Command>選択関数を
<!--Original XRef content: 'Table&numsp;7&hyphen;11'-->
<XRef Role="CodeOrFigureOrTable" Linkend="PG.widgs.mkr.20">に示します。</Para>
<Table Id="PG.widgs.tbl.11" Frame="Topbot">
<Title Id="PG.widgs.mkr.20">DtEditor 選択関数</Title>
<TGroup Cols="2">
<ColSpec Colname="1" Colwidth="2.25 in">
<ColSpec Colname="2" Colwidth="2.75 in">
<THead>
<Row>
<Entry><Para><Literal>関数</Literal></Para></Entry>
<Entry><Para><Literal>説明</Literal></Para></Entry>
</Row>
</THead>
<TBody>
<Row>
<Entry><Para><Command>DtEditorClearSelection</Command></Para></Entry>
<Entry><Para>現在選択されている内容を空白に置き換えます。
</Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtEditorCopyToClipboard</Command></Para></Entry>
<Entry><Para>現在選択されている内容をクリップボードにコピーします。
</Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtEditorCutToClipboard</Command></Para></Entry>
<Entry><Para>現在選択されている内容を削除して、クリップボードに入れます。
</Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtEditorDeleteSelection</Command></Para></Entry>
<Entry><Para>現在選択されている内容を削除します。</Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtEditorDeselect</Command></Para></Entry>
<Entry><Para>選択されている内容を選択解除します。</Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtEditorPasteFromClipboard</Command></Para></Entry>
<Entry><Para>クリップボードの内容をエディタ・ウィジェットにペーストして、現在選択されている内容を置き換えます。
</Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtEditorSelectAll</Command></Para></Entry>
<Entry><Para>エディタ・ウィジェットの内容全体を選択します。
</Para></Entry>
</Row>
</TBody>
</TGroup>
</Table>
</Sect3>
<Sect3 Id="PG.widgs.div.44">
<Title>書式化関数<IndexTerm>
<Primary>&lt;Filename>DtEditor&lt;Default Para Font></Primary>
<Secondary>書式化関数</Secondary>
</IndexTerm><IndexTerm>
<Primary>書式化関数</Primary>
<Secondary>&lt;Filename>DtEditor&lt;Default Para Font></Secondary>
</IndexTerm></Title>
<Para><Command>DtEditor</Command>書式化関数を
<!--Original XRef content: 'Table&numsp;7&hyphen;12'-->
<XRef Role="CodeOrFigureOrTable" Linkend="PG.widgs.mkr.21">に示します。</Para>
<Table Id="PG.widgs.tbl.12" Frame="Topbot">
<Title Id="PG.widgs.mkr.21">DtEditor 書式化関数</Title>
<TGroup Cols="2">
<ColSpec Colname="1" Colwidth="2.12302 in">
<ColSpec Colname="2" Colwidth="2.85715 in">
<THead>
<Row>
<Entry><Para><Literal>関数</Literal></Para></Entry>
<Entry><Para><Literal>説明</Literal></Para></Entry>
</Row>
</THead>
<TBody>
<Row>
<Entry><Para><Command>DtEditorFormat</Command></Para></Entry>
<Entry><Para>エディタ・ウィジェットの内容の全部または一部を書式化します。
</Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtEditorInvokeFormatDialog</Command></Para></Entry>
<Entry><Para>[書式]ダイアログ・ボックスを表示して、マージンと位置揃えのスタイルに関する書式設定を指定し、書式操作を実行することができます。
</Para></Entry>
</Row>
</TBody>
</TGroup>
</Table>
</Sect3>
<Sect3 Id="PG.widgs.div.45">
<Title>検索/変更関数
<IndexTerm>
<Primary>&lt;Filename>DtEditor&lt;Default Para Font></Primary>
<Secondary>検索/変更関数</Secondary>
</IndexTerm><IndexTerm>
<Primary>検索/変更関数</Primary>
<Secondary>&lt;Filename>DtEditor&lt;Default Para Font></Secondary>
</IndexTerm></Title>
<Para><Command>DtEditor</Command>検索/変更関数を
<!--Original XRef content: 'Table&numsp;7&hyphen;13'-->
<XRef Role="CodeOrFigureOrTable" Linkend="PG.widgs.mkr.22">に示します。</Para>
<Table Id="PG.widgs.tbl.13" Frame="Topbot">
<Title Id="PG.widgs.mkr.22">DtEditArea 検索/変更関数</Title>
<TGroup Cols="2">
<ColSpec Colname="1" Colwidth="2.5 in">
<ColSpec Colname="2" Colwidth="2.5 in">
<THead>
<Row>
<Entry><Para><Literal>関数</Literal></Para></Entry>
<Entry><Para><Literal>説明</Literal></Para></Entry>
</Row>
</THead>
<TBody>
<Row>
<Entry><Para><Command>DtEditorChange</Command></Para></Entry>
<Entry><Para>文字列の1つまたはすべての存在箇所を置換します。
</Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtEditorFind</Command></Para></Entry>
<Entry><Para>文字列の次の出現箇所を検索します。</Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtEditorInvokeFindChangeDialog</Command></Para></Entry>
<Entry><Para>文字列を検索(オプションで置換も)するためのダイアログ・ボックスを表示します。
</Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtEditorInvokeSpellDialog</Command></Para></Entry>
<Entry><Para>現在の内容の中でスペルが間違っている単語のリストがあるダイアログ・ボックスを表示します。
</Para></Entry>
</Row>
</TBody>
</TGroup>
</Table>
</Sect3>
<Sect3 Id="PG.widgs.div.46">
<Title>補助関数<IndexTerm>
<Primary>&lt;Filename>DtEditor&lt;Default Para Font></Primary>
<Secondary>補助関数</Secondary>
</IndexTerm><IndexTerm>
<Primary>補助関数</Primary>
<Secondary>&lt;Filename>DtEditor&lt;Default Para Font></Secondary>
</IndexTerm></Title>
<Para><Command>DtEditor</Command>補助関数を
<!--Original XRef content: 'Table&numsp;7&hyphen;14'-->
<XRef Role="CodeOrFigureOrTable" Linkend="PG.widgs.mkr.23">に示します。</Para>
<Table Id="PG.widgs.tbl.14" Frame="Topbot">
<Title Id="PG.widgs.mkr.23">DtEditor 補助関数</Title>
<TGroup Cols="2">
<ColSpec Colname="1" Colwidth="2.5 in">
<ColSpec Colname="2" Colwidth="2.5 in">
<THead>
<Row>
<Entry><Para><Literal>関数</Literal></Para></Entry>
<Entry><Para><Literal>説明</Literal></Para></Entry>
</Row>
</THead>
<TBody>
<Row>
<Entry><Para><Command>DtEditorCheckForUnsavedChanges</Command></Para></Entry>
<Entry><Para>エディタ・ウィジェットの内容が前回の検索または保存以後に変更されていれかどうかを報告します。
</Para></Entry>
</Row>
<Row>
<Entry><Para>DtEditorDisableRedisplay</Para></Entry>
<Entry><Para>ビジュアル属性が変更された場合でも、エディタ・ウィジェットの再表示をしません。
</Para></Entry>
</Row>
<Row>
<Entry><Para>DtEditorEnableRedisplay</Para></Entry>
<Entry><Para>エディタ・ウィジェット
の表示の更新を強制します。
</Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtEditorGetInsertPosition</Command></Para></Entry>
<Entry><Para>エディタ・ウィジェットの挿入カーソル位置を返します。
</Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtEditorGetLastPosition</Command></Para></Entry>
<Entry><Para>編集ウィンドウの最後の文字の位置を返します。
</Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtEditorGetMessageTextFieldID</Command></Para></Entry>
<Entry><Para>アプリケーション・メッセージを表示するために使用されるテキスト・フィールド・ウィジェットのウィジェット IDを検索します。
</Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtEditorGetSizeHints</Command></Para></Entry>
<Entry><Para>エディタ・ウィジェットからサイズ情報を検索します。
</Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtEditorGoToLine</Command></Para></Entry>
<Entry><Para>挿入カーソルを指定された行へ移動します。
</Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtEditorSetInsertionPosition</Command></Para></Entry>
<Entry><Para>挿入カーソルの位置を設定します。</Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtEditorTraverseToEditor</Command></Para></Entry>
<Entry><Para>エディタ・ウィジェットの編集ウィンドウへのキーボード移動を設定します。
</Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtEditorUndoEdit</Command></Para></Entry>
<Entry><Para>ユーザが行なった最後の編集を元に戻します。</Para></Entry>
</Row>
</TBody>
</TGroup>
</Table>
</Sect3>
</Sect2>
<Sect2 Id="PG.widgs.div.47">
<Title>リソース<IndexTerm>
<Primary>&lt;Filename>DtEditor&lt;Default Para Font></Primary>
<Secondary>リソース</Secondary>
</IndexTerm><IndexTerm>
<Primary>リソース</Primary>
<Secondary>&lt;Filename>DtEditor&lt;Default Para Font></Secondary>
</IndexTerm></Title>
<Para><Command>DtEditor</Command> ウィジェットは、次のリソースのセットを提供します。</Para>
<ItemizedList Remap="Bullet1">
<ListItem>
<Para><Command>DtNautoShowCursorPosition</Command>にTrueが設定されたとき、スクロール編集ウィンドウに表示されるテキストに挿入カーソルが必ずあるようにします。
挿入カーソル
が変わると、エディタの内容をスクロールして、挿入ポイントがウィンドウに入るようにします。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNblinkRate</Command>は、テキスト・カーソルの点滅間隔をミリ秒単位で指定します。
挿入カーソルの点滅に要する時間は、点滅間隔の2倍です。点滅間隔がゼロに設定されたときには、カーソルは点滅しません。
値を負にすることはできません。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNbuttonFontList</Command>は、 <Command>DtEditor</Command>のダイアログ・ボックスに表示されるボタンのフォント・リストを指定します。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNcolumns</Command> は、エディタの初期の幅を整数の文字単位で指定します。
値は0より大きくなければなりません。</Para>
</ListItem>
<ListItem>
<Para><Command>DtNcursorPosition</Command>は、エディタの中で現在の挿入カーソルが置かれる位置を指定します。
位置は、テキストの先頭からの文字数によって決められます。
最初の
文字位置は0です。</Para>
</ListItem>
<ListItem>
<Para><Command>DtNcursorPositionVisible</Command>論理値がTrueのとき点滅しているテキスト・カーソルで挿入カーソルの位置をマークします。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNdialogTitle</Command>は、DtEditorによって表示されるすべてのダイアログのタイトルを指定します。
これには、単語の検索と置換、スペルが間違っている単語、および書式設定のためのダイアログが含まれます。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNeditable</Command>にTrueが設定されているとき、ユーザはデータを編集できます。
Falseが設定されているときには、ユーザはデータを編集できません。</Para>
</ListItem>
<ListItem>
<Para><Command>DtNlabelFontList</Command>は、 <Command>DtEditor</Command>ラベルとして使用されるフォント・リストを指定します(ラベルは、ステータス行と<Command>DtEditor</Command>ダイアログ・ボックスに表示されます)。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNoverstrike</Command>にFalseが設定されているとき、エディタ・ウィジェットに入力された文字は、カーソルの位置に挿入されます
( デフォルト)。Trueが設定されているときには、エディタ・ウィジェットに入力された文字は、挿入カーソルの直後の文字を置き換えます。
行末に達したときには、文字は行末に追加されます。
ステータス行が表示されている場合、 <Command>DtNoverstrike</Command>がTrueのときは
<Command>DtNoverstrikeIndicatorLabel</Command> が必ずステータス行に表示されます。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNrows</Command>は、エディタの初期の高さを文字単位で指定します。
値は0より大きくなければなりません。</Para>
</ListItem>
<ListItem>
<Para><Command>DtNscrollHorizontal</Command>は、論理値がTrueのときテキストを水平方向にスクロールできるようにするスクロール・バーを追加します。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNscrollLeftSide</Command>は、論理値がTrueのときスクロール編集ウィンドウの左側に垂直スクロール・バーを置きます。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNshowStatusLine</Command>は、Trueが設定されたときテキスト・ウィンドウの下にステータス行を表示します。
ステータス行のフィールドには、挿入カーソルの現在の行番号、ドキュメント内の総行数、およびエディタが上書きモードかどうかを表示します。ユーザは、行番号表示に行番号を入力することによって、直接その行を表示することができます。
</Para>
</ListItem>
</ItemizedList>
<Para>ステータス行は、アプリケーションによって提供されるメッセージを表示するためのMotifの<Filename MoreInfo="RefEntry">XmTextField</Filename>(3) ウィジェットも含んでいます。
このフィールドは、アプリケーションが編集中の ドキュメントについての ステータスとフィードバックを表示するのに便利な場所です。
テキスト・フィールドのIDは、
<Filename MoreInfo="RefEntry">DtEditorGetMessageTextFieldID</Filename>(3)を使用して検索されます。メッセージは、このウィジェットの
<Command>XmNvalue</Command>または<Command>XmNvalueWcs</Command> リソースを設定することによって表示されます。 テキスト・フィールドが必要ない場合には、
そのIDで<Filename MoreInfo="RefEntry">XtUnmanageWidget</Filename>(3) を呼び出すことによって管理から外せます。</Para>
<ItemizedList Remap="Bullet1">
<ListItem>
<Para><Command>DtNspellFilter</Command> は、スペルチェックに使用するフィルタを指定します。
関数<Filename MoreInfo="RefEntry">DtEditorInvokeSpellDialog</Filename>(3)は、<Command>DtNspellFilter</Command>によって指定されたフィルタを使用してエディタの内容をチェックします。
指定されたフィルタは、ファイル名を受け入れて、このファイルの中のスペルが間違っている単語と認識不能の単語のリストを<Command>stdout</Command>に出力しなければなりません。デフォルトのフィルタは、<Filename>spell</Filename>(1)です。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNtextBackground</Command>は、編集ウィンドウのバックグラウンドを指定します。</Para>
</ListItem>
<ListItem>
<Para><Command>DtNtextDeselectCallback</Command> は、編集領域内でテキストが選択されていないときに呼び出される関数を指定します。
コールバックによって送られるreasonは、
<Filename>DtEDITOR_TEXT_DESELECT</Filename>です。</Para>
</ListItem>
<ListItem>
<Para><Command>DtNtextFontList</Command> は、<Command>DtEditor</Command> 編集ウィンドウとテキスト・フィールドに使用されるフォント・リストを指定します。
テキスト・フィールドは、ステータス行と<Command>DtEditor</Command>ダイアログ・ボックスに表示されます。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNtextForeground</Command> は、編集ウィンドウのフォアグラウンドを指定します。</Para>
</ListItem>
<ListItem>
<Para><Command>DtNtextSelectCallback</Command>は、編集領域内でテキストが選択されたときに呼び出される関数を指定します。コールバックによって送られるreasonは、
<Filename>DtEDITOR_TEXT_SELECT</Filename>です。</Para>
</ListItem>
<ListItem>
<Para><Command>DtNtextTranslations</Command> は、編集ウィンドウに追加される変換を指定します。
このリソースで指定された変換は、編集ウィンドウに対して定義された重複する変換を無効にします。 <Command>DtEditor</Command>によって提供される変換のリストにていては、
<Filename MoreInfo="RefEntry">DtEditor</Filename>(3) マニュアル・ページを参照してください。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNtopCharacter</Command>は、スクロールした編集ウィンドウの最上部にテキストの位置がある行を表示します。
行は、テキストを左右に移動することなくウィジェットの最上部に表示されます。
位置は、テキストの先頭からの文字数によって決められます。最初の文字位置は0です。
</Para>
<Para><Command>DtNtopCharacter</Command>に対する<Filename MoreInfo="RefEntry">XGetValues</Filename>(3)は、ウィジェットの最上部に表示される行の最初の文字の位置を返します。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNwordWrap</Command>は、ウィンドウの右端に達したときに、語の切れ目でソフト・キャリッジ・リターンによる行分割を行います。ワードラップは、エディタ・ウィジェットの内容の視覚的外観にだけ影響を及ぼすので注意してください。行分割(ソフト・キャリッジ・リターン)は、テキストに物理的に挿入されるわけではありません。エディタは、ウィジェットの内容が検索されるときまたはファイルに保存されるときに、ハード・キャリッジ・リターンへの置換をサポートします。
詳細については、<Filename MoreInfo="RefEntry">DtEditorGetContents</Filename>(3)
と<Filename MoreInfo="RefEntry">DtEditorSaveContentsToFile</Filename>(3) のマニュアル・ページを参照してください。</Para>
</ListItem>
</ItemizedList>
<Para>各リソースのクラス、 型、デフォルト、およびアクセスを<!--Original XRef content: 'Table&numsp;7&hyphen;15'-->
<XRef Role="CodeOrFigureOrTable" Linkend="PG.widgs.mkr.24">にリストします。継承クラスのリソース 値を設定することによって、このウィジェットの属性を設定することもできます。<Filename>
.Xdefaults</Filename> ファイルの中で名前またはクラスによってリソースを参照するには、 <Command>DtN</Command>または<Command>DtC</Command>の接頭辞を除いて、残りの文字を使用します。
<Filename>.Xdefaults</Filename>ファイルでリソースに対して定義済みの値の1つを指定するには、<Command>Dt</Command>接頭辞を除いて、残りの文字を使用します(小文字または大文字で、ただし、語の間に下線を入れています)。
</Para>
<Para>アクセス欄のコードは、次のことが可能かどうかを示します。:</Para>
<ItemizedList Remap="Bullet1">
<ListItem>
<Para>作成時にリソースを設定する。(C)</Para>
</ListItem>
<ListItem>
<Para><Command>XtSetValues</Command>を使用して設定する (S)</Para>
</ListItem>
<ListItem>
<Para><Command>XtGetValues</Command>を使用して検索する。 (G)</Para>
</ListItem>
</ItemizedList>
<Para>詳細については、<Filename MoreInfo="RefEntry">DtEditor</Filename>(3)のマニュアル・ページを参照してください。</Para>
<Table Id="PG.widgs.tbl.15" Frame="Topbot">
<Title Id="PG.widgs.mkr.24">DtEditor リソース</Title>
<TGroup Cols="5">
<ColSpec Colname="1" Colwidth="2.1131 in">
<ColSpec Colname="2" Colwidth="2.13294 in">
<ColSpec Colname="3" Colwidth="1.26984 in">
<ColSpec Colname="4" Colwidth="0.98214 in">
<ColSpec Colname="5" Colwidth="0.53571 in">
<THead>
<Row>
<Entry><Para><Literal>名前</Literal></Para></Entry>
<Entry><Para><Literal>クラス</Literal></Para></Entry>
<Entry><Para><Literal>型</Literal></Para></Entry>
<Entry><Para><Literal>デフォルト</Literal></Para></Entry>
<Entry><Para><Literal>アクセス</Literal></Para></Entry>
</Row>
</THead>
<TBody>
<Row>
<Entry><Para><Command>DtNautoShowCursorPosition</Command></Para></Entry>
<Entry><Para><Command>DtCAutoShowCursorPosition</Command></Para></Entry>
<Entry><Para><Command>Boolean</Command></Para></Entry>
<Entry><Para><Command>True</Command></Para></Entry>
<Entry><Para><Command>CSG</Command></Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNblinkRate</Command></Para></Entry>
<Entry><Para><Command>DtCBlinkRate</Command></Para></Entry>
<Entry><Para><Command>int</Command></Para></Entry>
<Entry><Para><Filename>500</Filename></Para></Entry>
<Entry><Para><Command>CSG</Command></Para></Entry>
</Row>
<Row>
<Entry><Para>DtNbuttonFontList</Para></Entry>
<Entry><Para>DtCFontList</Para></Entry>
<Entry><Para>XmFontList</Para></Entry>
<Entry><Para>Dynamic</Para></Entry>
<Entry><Para>CSG</Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNcolumns</Command></Para></Entry>
<Entry><Para><Command>DtCColumns</Command></Para></Entry>
<Entry><Para><Command>XmNcolumns</Command></Para></Entry>
<Entry><Para><Command>Dynamic</Command></Para></Entry>
<Entry><Para><Command>CSG</Command></Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNcursorPosition</Command></Para></Entry>
<Entry><Para><Command>DtCCursorPosition</Command></Para></Entry>
<Entry><Para><Command>XmTextPosition</Command></Para></Entry>
<Entry><Para><Filename>0</Filename></Para></Entry>
<Entry><Para><Command>CSG</Command></Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNcursorPositionVisible</Command></Para></Entry>
<Entry><Para><Command>DtCCursorPositionVisible</Command></Para></Entry>
<Entry><Para><Command>Boolean</Command></Para></Entry>
<Entry><Para><Command>True</Command></Para></Entry>
<Entry><Para><Command>CSG</Command></Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNdialogTitle</Command></Para></Entry>
<Entry><Para><Command>DtCDialogTitle</Command></Para></Entry>
<Entry><Para><Command>XmString</Command></Para></Entry>
<Entry><Para><Command>NULL</Command></Para></Entry>
<Entry><Para><Command>CSG</Command></Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNeditable</Command></Para></Entry>
<Entry><Para><Command>DtCEditable</Command></Para></Entry>
<Entry><Para><Command>Boolean</Command></Para></Entry>
<Entry><Para><Command>True</Command></Para></Entry>
<Entry><Para><Command>CSG</Command></Para></Entry>
</Row>
<Row>
<Entry><Para>DtNlabelFontList</Para></Entry>
<Entry><Para>DtCFontList</Para></Entry>
<Entry><Para>XmFontList</Para></Entry>
<Entry><Para>Dynamic</Para></Entry>
<Entry><Para>CSG</Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNmaxLength</Command></Para></Entry>
<Entry><Para><Command>DtCMaxLength</Command></Para></Entry>
<Entry><Para><Command>int</Command></Para></Entry>
<Entry><Para><Command>Largest
integer</Command></Para></Entry>
<Entry><Para><Command>CSG</Command></Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNoverstrike</Command></Para></Entry>
<Entry><Para><Command>DtCOverstrike</Command></Para></Entry>
<Entry><Para><Command>Boolean</Command></Para></Entry>
<Entry><Para><Command>False</Command></Para></Entry>
<Entry><Para><Command>CSG</Command></Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNrows</Command></Para></Entry>
<Entry><Para><Command>DtCRows</Command></Para></Entry>
<Entry><Para><Command>XmNrows</Command></Para></Entry>
<Entry><Para><Command>Dynamic</Command></Para></Entry>
<Entry><Para><Command>CSG</Command></Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNscrollHorizontal</Command></Para></Entry>
<Entry><Para><Command>DtCScroll</Command></Para></Entry>
<Entry><Para><Command>Boolean</Command></Para></Entry>
<Entry><Para><Command>True</Command></Para></Entry>
<Entry><Para><Command>CG</Command></Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNscrollLeftSide</Command></Para></Entry>
<Entry><Para><Command>DtCScrollSide</Command></Para></Entry>
<Entry><Para><Command>Boolean</Command></Para></Entry>
<Entry><Para><Command>Dynamic</Command></Para></Entry>
<Entry><Para><Command>CG</Command></Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNscrollTopSide</Command></Para></Entry>
<Entry><Para><Command>DtCScrollSide</Command></Para></Entry>
<Entry><Para><Command>Boolean</Command></Para></Entry>
<Entry><Para><Command>False</Command></Para></Entry>
<Entry><Para><Command>CG</Command></Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNscrollVertical</Command></Para></Entry>
<Entry><Para><Command>DtCScroll</Command></Para></Entry>
<Entry><Para><Command>Boolean</Command></Para></Entry>
<Entry><Para><Command>True</Command></Para></Entry>
<Entry><Para><Command>CG</Command></Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNshowStatusLine</Command></Para></Entry>
<Entry><Para><Command>DtCShowStatusLine</Command></Para></Entry>
<Entry><Para><Command>Boolean</Command></Para></Entry>
<Entry><Para><Command>False</Command></Para></Entry>
<Entry><Para><Command>CSG</Command></Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNspellFilter</Command></Para></Entry>
<Entry><Para><Command>DtCspellFilter</Command></Para></Entry>
<Entry><Para><Command>char *</Command></Para></Entry>
<Entry><Para><Command>Spell</Command></Para></Entry>
<Entry><Para><Command>CSG</Command></Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNtextBackground</Command></Para></Entry>
<Entry><Para><Command>DtCBackground</Command></Para></Entry>
<Entry><Para><Command>Pixel</Command></Para></Entry>
<Entry><Para><Command>Dynamic</Command></Para></Entry>
<Entry><Para><Command>CSG</Command></Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNtextDeselectCallback</Command></Para></Entry>
<Entry><Para><Command>DtCCallback</Command></Para></Entry>
<Entry><Para><Command>XtCallbackList</Command></Para></Entry>
<Entry><Para><Command>NULL</Command></Para></Entry>
<Entry><Para><Command>C</Command></Para></Entry>
</Row>
<Row>
<Entry><Para>DtNtextFontList</Para></Entry>
<Entry><Para>DtCFontList</Para></Entry>
<Entry><Para>XmFontList</Para></Entry>
<Entry><Para>Dynamic</Para></Entry>
<Entry><Para>CSG</Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNtextForeground</Command></Para></Entry>
<Entry><Para><Command>DtCForeground</Command></Para></Entry>
<Entry><Para><Command>Pixel</Command></Para></Entry>
<Entry><Para><Command>Dynamic</Command></Para></Entry>
<Entry><Para><Command>CSG</Command></Para></Entry>
</Row>
<Row>
<Entry><Para>DtNtextTranslations</Para></Entry>
<Entry><Para>DtCTranslations</Para></Entry>
<Entry><Para>XtTranslations</Para></Entry>
<Entry><Para>NULL</Para></Entry>
<Entry><Para>CS</Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNtextSelectCallback</Command></Para></Entry>
<Entry><Para><Command>DtCCallback</Command></Para></Entry>
<Entry><Para><Command>XtCallbackList</Command></Para></Entry>
<Entry><Para><Command>NULL</Command></Para></Entry>
<Entry><Para><Command>C</Command></Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNtopCharacter</Command></Para></Entry>
<Entry><Para><Command>DtCTextPosition</Command></Para></Entry>
<Entry><Para><Command>XmTextPosition</Command></Para></Entry>
<Entry><Para><Filename>0</Filename></Para></Entry>
<Entry><Para><Command>CSG</Command></Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNwordWrap</Command></Para></Entry>
<Entry><Para><Command>DtCWordWrap</Command></Para></Entry>
<Entry><Para><Command>Boolean</Command></Para></Entry>
<Entry><Para><Command>True</Command></Para></Entry>
<Entry><Para><Command>CSG</Command></Para></Entry>
</Row>
</TBody>
</TGroup>
</Table>
</Sect2>
<Sect2 Id="PG.widgs.div.48">
<Title>継承されるリソース<IndexTerm>
<Primary>&lt;Filename>DtEditor&lt;Default Para Font></Primary>
<Secondary>継承されるリソース</Secondary>
</IndexTerm><IndexTerm>
<Primary>継承されるリソース</Primary>
<Secondary>&lt;Filename>DtEditor&lt;Default Para Font>&lt;Filename>DtEditor&lt;Default Para Font></Secondary>
</IndexTerm></Title>
<Para><Command>DtEditor</Command>は、次のスーパークラスから動作とリソースを継承します。:</Para>
<ItemizedList Remap="Bullet1">
<ListItem>
<Para><Command>XmForm</Command></Para>
</ListItem>
<ListItem>
<Para><Command>XmManager</Command></Para>
</ListItem>
<ListItem>
<Para><Command>Composite</Command></Para>
</ListItem>
<ListItem>
<Para><Command>Core</Command></Para>
</ListItem>
</ItemizedList>
<Para>詳細については、該当するマニュアル・ページを参照してください。</Para>
</Sect2>
<Sect2 Id="PG.widgs.div.49">
<Title>ローカライズ・リソース</Title>
<Para>次のリストは、<Command>DtEditor</Command> ウィジェットとそのダイアログ・ボックスのローカライズのために設計されるウィジェット・リソースのセットを示しています。これらのリソースのデフォルト値は、ロケールに依存します。
</Para>
<ItemizedList Remap="Bullet1">
<ListItem>
<Para><Command>DtNcenterToggleLabel</Command>は、[書式の設定]ダイアログ・ボックスの中央に揃えるトグル・ボタンのラベルを指定します。Cロケールでのデフォルト値は、[Center]です。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNchangeAllButtonLabel</Command>は、ドキュメントの中の検索文字列のすべての存在箇所を置換する[検索/変更]ダイアログ・ボックスにあるボタンのラベルを指定します。Cロケールでのデフォルト値は、[Change All]です。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNchangeButtonLabel</Command>は、ドキュメントの中の検索文字列の次の存在箇所を置換する[検索/変更]ダイアログ・ボックスにあるボタンのラベルを指定します。Cロケールでのデフォルト値は、[Change]です。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNchangeFieldLabel</Command>は、ユーザが置換文字列を指定する[検索/変更]ダイアログ・ボックスにあるフィールドのラベルを指定します。Cロケールでのデフォルト値は、[Change To]です。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNcurrentLineLabel</Command>は、ステータス行の現在の行番号フィールドのラベルを指定します。Cロケールでのデフォルト値は、[Line]です。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNfindButtonLabel</Command>は、ドキュメントの中の検索文字列の次の存在箇所を検索する[検索/変更]ダイアログ・ボックスにあるボタンのラベルを指定します。Cロケールでのデフォルト値は、[Find]です。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNfindChangeDialogTitle</Command>は、[検索/変更]ダイアログ・ボックスのタイトルを指定します。
<Command>DtNdialogTitle</Command> がヌルでない場合は、このリソースの前面に追加されてタイトルを形成します。Cロケールでのデフォルト値は、[
Find/Change]
です。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNfindFieldLabel</Command>は、ユーザが検索文字列を指定する[検索/変更]ダイアログ・ボックスにあるフィールドのラベルを指定します。Cロケールでのデフォルト値は、[Find]です。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNformatAllButtonLabel</Command>は、ドキュメント全体を書式化する[書式の設定]ダイアログ・ボックスにあるボタンのラベル を指定します。Cロケールでのデフォルト値は、[All]です。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNformatParagraphButtonLabel</Command>は、挿入カーソルを含んでいるパラグラフを書式化する[書式の設定]ダイアログ・ボックスにあるボタンのラベル を指定します。Cロケールでのデフォルト値は、[Paragraph]です。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNformatSettingsDialogTitle</Command>は、[書式の設定]ダイアログ・ボックスのタイトルを指定します。
DtNdialogTitleがヌルでない場合は、このリソースの前面に追加されてタイトルを形成します。Cロケールでのデフォルト値は、[Format Setting]です。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNinformationDialogTitle</Command>は、ユーザにフィードバックと一般情報を提示するのに使用される[インフォメーション]ダイアログ・ボックスのタイトルを指定します。
<Command>DtNdialogTitle</Command>がヌルでない場合は、このリソースの前面に追加されてタイトルを形成します。Cロケールでのデフォルト値は、[Information]です。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNjustifyToggleLabel</Command>は、[書式の設定]ダイアログ・ボックスにある両端揃えトグルボタンを指定します。Cロケールでのデフォルト値は、[Justify]です。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNleftAlignToggleLabel</Command>は、[書式の設定]ダイアログ・ボックスにある左揃えトグルボタンのラベルを指定します。Cロケールでのデフォルト値は、[ Left Align]です。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNleftMarginFieldLabel</Command>は、[書式の設定]ダイアログ・ボックスにある左マージン値フィールドのラベルを指定します。Cロケールでのデフォルト値は、[Left Margin]です。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNmisspelledListLabel</Command>は、[スペルチェック]ダイアログ・ボックスにある認識不能のまたはスペルが間違っている単語のリストのラベルを指定します。Cロケールでのデフォルト値は、[Misspelled Words]です。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNoverstrikeLabel</Command>は、エディタが上書きモードであることを示すステータス行にあるラベルを指定します。Cロケールでのデフォルト値は、[Overstrike]です。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNrightAlignToggleLabel</Command>は、[書式の設定]ダイアログ・ボックスにある右揃えトグルボタンのラベルを指定します。Cロケールでのデフォルト値は、[Right Align]です。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNrightMarginFieldLabel</Command>は、[書式の設定]ダイアログ・ボックスにある右マージン値フィールドのラベル を指定します。Cロケールでのデフォルト値は、[Right Margin]です。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNspellDialogTitle</Command>は、[書式の設定]ダイアログ・ボックスのタイトルを指定します。
<Command>DtNdialogTitle</Command>がヌルでない場合は、このリソースの前方に追加されてタイトルを形成します。Cロケールでのデフォルト値は、[Spell]です。
</Para>
</ListItem>
<ListItem>
<Para><Command>DtNtotalLineCountLabel</Command> は、ドキュメントの総行数を示すステータス 行にあるディスプレイのラベル を指定します。Cロケールでのデフォルト値は、[Total]です。
</Para>
</ListItem>
</ItemizedList>
<Para>ローカライズ・リソースのそれぞれのクラス、型、デフォルト、およびアクセスを<!--Original XRef content: 'Table&numsp;7&hyphen;16'-->
<XRef Role="CodeOrFigureOrTable" Linkend="PG.widgs.mkr.25">にリストします。アクセス欄のコードは、次のことが可能かどうかを示します。
:</Para>
<ItemizedList Remap="Bullet1">
<ListItem>
<Para>作成時にリソース を設定する(C)</Para>
</ListItem>
<ListItem>
<Para><Command>XtSetValues</Command>を使用して設定する (S)</Para>
</ListItem>
<ListItem>
<Para><Command>XtGetValues</Command>を使用して検索する。 (G)</Para>
</ListItem>
</ItemizedList>
<Para>詳細については、<Filename MoreInfo="RefEntry">DtEditor</Filename>(3)のマニュアル・ページを参照してください。</Para>
<Table Id="PG.widgs.tbl.16" Frame="Topbot">
<Title Id="PG.widgs.mkr.25">DtEditor ローカライズ・リソース</Title>
<TGroup Cols="5">
<ColSpec Colname="1" Colwidth="2.53969 in">
<ColSpec Colname="2" Colwidth="2.32143 in">
<ColSpec Colname="3" Colwidth="0.80357 in">
<ColSpec Colname="4" Colwidth="0.73412 in">
<ColSpec Colname="5" Colwidth="0.54563 in">
<THead>
<Row>
<Entry><Para><Literal>名前</Literal></Para></Entry>
<Entry><Para><Literal>クラス</Literal></Para></Entry>
<Entry><Para><Literal>型</Literal></Para></Entry>
<Entry><Para><Literal>デフォルト</Literal></Para></Entry>
<Entry><Para><Literal>アクセス</Literal></Para></Entry>
</Row>
</THead>
<TBody>
<Row>
<Entry><Para><Command>DtNcenterToggleLabel</Command></Para></Entry>
<Entry><Para><Command>DtCCenterToggleLabel</Command></Para></Entry>
<Entry><Para><Command>XmString</Command></Para></Entry>
<Entry><Para><Command>Dynamic</Command></Para></Entry>
<Entry><Para><Command>CSG</Command></Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNchangeAllButtonLabel</Command></Para></Entry>
<Entry><Para><Command>DtCChangeAllButtonLabel</Command></Para></Entry>
<Entry><Para><Command>XmString</Command></Para></Entry>
<Entry><Para><Command>Dynamic</Command></Para></Entry>
<Entry><Para><Command>CSG</Command></Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNchangeButtonLabel</Command></Para></Entry>
<Entry><Para><Command>DtCChangeButtonLabel</Command></Para></Entry>
<Entry><Para><Command>XmString</Command></Para></Entry>
<Entry><Para><Command>Dynamic</Command></Para></Entry>
<Entry><Para><Command>CSG</Command></Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNchangeFieldLabel</Command></Para></Entry>
<Entry><Para><Command>DtCChangeFieldLabel</Command></Para></Entry>
<Entry><Para><Command>XmString</Command></Para></Entry>
<Entry><Para><Command>Dynamic</Command></Para></Entry>
<Entry><Para><Command>CSG</Command></Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNcurrentLineLabel</Command></Para></Entry>
<Entry><Para><Command>DtCCurrentLineLabel</Command></Para></Entry>
<Entry><Para><Command>XmString</Command></Para></Entry>
<Entry><Para><Command>Dynamic</Command></Para></Entry>
<Entry><Para><Command>CSG</Command></Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNfindButtonLabel</Command></Para></Entry>
<Entry><Para><Command>DtCFindButtonLabel</Command></Para></Entry>
<Entry><Para><Command>XmString</Command></Para></Entry>
<Entry><Para><Command>Dynamic</Command></Para></Entry>
<Entry><Para><Command>CSG</Command></Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNfindChangeDialogTitle</Command></Para></Entry>
<Entry><Para><Command>DtCFindChangeDialogTitle</Command></Para></Entry>
<Entry><Para><Command>XmString</Command></Para></Entry>
<Entry><Para><Command>Dynamic</Command></Para></Entry>
<Entry><Para><Command>CSG</Command></Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNfindFieldLabel</Command></Para></Entry>
<Entry><Para><Command>DtCFindFieldLabel</Command></Para></Entry>
<Entry><Para><Command>XmString</Command></Para></Entry>
<Entry><Para><Command>Dynamic</Command></Para></Entry>
<Entry><Para><Command>CSG</Command></Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNformatAllButtonLabel</Command></Para></Entry>
<Entry><Para><Command>DtCFormatAllButtonLabel</Command></Para></Entry>
<Entry><Para><Command>XmString</Command></Para></Entry>
<Entry><Para><Command>Dynamic</Command></Para></Entry>
<Entry><Para><Command>CSG</Command></Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNformatParagraphButtonLabel</Command></Para></Entry>
<Entry><Para><Command>DtCFormatParagraphButtonLabel</Command></Para></Entry>
<Entry><Para><Command>XmString</Command></Para></Entry>
<Entry><Para><Command>Dynamic</Command></Para></Entry>
<Entry><Para><Command>CSG</Command></Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNformatSettingsDialogTitle</Command></Para></Entry>
<Entry><Para><Command>DtCFormatSettingsDialogTitle</Command></Para></Entry>
<Entry><Para><Command>XmString</Command></Para></Entry>
<Entry><Para><Command>Dynamic</Command></Para></Entry>
<Entry><Para><Command>CSG</Command></Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNinformationDialogTitle</Command></Para></Entry>
<Entry><Para><Command>DtCInformationDialogTitle</Command></Para></Entry>
<Entry><Para><Command>XmString</Command></Para></Entry>
<Entry><Para><Command>Dynamic</Command></Para></Entry>
<Entry><Para><Command>CSG</Command></Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNjustifyToggleLabel</Command></Para></Entry>
<Entry><Para><Command>DtCJustifyToggleLabel</Command></Para></Entry>
<Entry><Para><Command>XmString</Command></Para></Entry>
<Entry><Para><Command>Dynamic</Command></Para></Entry>
<Entry><Para><Command>CSG</Command></Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNleftAlignToggleLabel</Command></Para></Entry>
<Entry><Para><Command>DtCLeftAlignToggleLabel</Command></Para></Entry>
<Entry><Para><Command>XmString</Command></Para></Entry>
<Entry><Para><Command>Dynamic</Command></Para></Entry>
<Entry><Para><Command>CSG</Command></Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNleftMarginFieldLabel</Command></Para></Entry>
<Entry><Para><Command>DtCLeftMarginFieldLabel</Command></Para></Entry>
<Entry><Para><Command>XmString</Command></Para></Entry>
<Entry><Para><Command>Dynamic</Command></Para></Entry>
<Entry><Para><Command>CSG</Command></Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNmisspelledListLabel</Command></Para></Entry>
<Entry><Para><Command>DtCMisspelledListLabel</Command></Para></Entry>
<Entry><Para><Command>XmString</Command></Para></Entry>
<Entry><Para><Command>Dynamic</Command></Para></Entry>
<Entry><Para><Command>CSG</Command></Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNoverstrikeLabel</Command></Para></Entry>
<Entry><Para><Command>DtCOverstrikeLabel</Command></Para></Entry>
<Entry><Para><Command>XmString</Command></Para></Entry>
<Entry><Para><Command>Dynamic</Command></Para></Entry>
<Entry><Para><Command>CSG</Command></Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNrightAlignToggleLabel</Command></Para></Entry>
<Entry><Para><Command>DtCRightAlignToggleLabel</Command></Para></Entry>
<Entry><Para><Command>XmString</Command></Para></Entry>
<Entry><Para><Command>Dynamic</Command></Para></Entry>
<Entry><Para><Command>CSG</Command></Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNrightMarginFieldLabel</Command></Para></Entry>
<Entry><Para><Command>DtCRightMarginFieldLabel</Command></Para></Entry>
<Entry><Para><Command>XmString</Command></Para></Entry>
<Entry><Para><Command>Dynamic</Command></Para></Entry>
<Entry><Para><Command>CSG</Command></Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNspellDialogTitle</Command></Para></Entry>
<Entry><Para><Command>DtCSpellDialogTitle</Command></Para></Entry>
<Entry><Para><Command>XmString</Command></Para></Entry>
<Entry><Para><Command>Dynamic</Command></Para></Entry>
<Entry><Para><Command>CSG</Command></Para></Entry>
</Row>
<Row>
<Entry><Para><Command>DtNtotalLineCountLabel</Command></Para></Entry>
<Entry><Para><Command>DtCTotalLineCountLabel</Command></Para></Entry>
<Entry><Para><Command>XmString</Command></Para></Entry>
<Entry><Para><Command>Dynamic</Command></Para></Entry>
<Entry><Para><Command>CSG</Command></Para></Entry>
</Row>
</TBody>
</TGroup>
</Table>
</Sect2>
<Sect2 Id="PG.widgs.div.50">
<Title>コールバック関数<IndexTerm>
<Primary>&lt;Filename>DtEditor&lt;Default Para Font></Primary>
<Secondary>コールバック関数</Secondary>
</IndexTerm><IndexTerm>
<Primary>コールバック関数</Primary>
<Secondary>&lt;Filename>DtEditor&lt;Default Para Font></Secondary>
</IndexTerm></Title>
<Para><Command>DtEditor</Command> ウィジェットは、次の3つのコールバック関数をサポートします。:</Para>
<ItemizedList Remap="Bullet1">
<ListItem>
<Para><Command>DtEditorNHelpCallback</Command></Para>
</ListItem>
<ListItem>
<Para><Command>DtNtextSelectCallback</Command></Para>
</ListItem>
<ListItem>
<Para><Command>DtNtextDeselectCallback</Command></Para>
</ListItem>
</ItemizedList>
<Para>エディタ・ウィジェットとそのダイアログ・ボックスについてのヘルプ情報を提示したい場合は、
<Command>XmNhelpCallback</Command> リソース を設定し、<Command>DtEditorHelpCallbackStruct</Command>の一部として渡されるreason フィールドを使用して、[ヘルプ]ダイアログ・ボックスの内容を設定します。次の構造体へのポインタが<Command>XmNHelpCallback</Command>に渡されます。
コールバックのための構造体を次に示し、
<!--Original XRef content: 'Table&numsp;7&hyphen;17'-->
<XRef Role="CodeOrFigureOrTable" Linkend="PG.widgs.mkr.26">で説明します。</Para>
<ProgramListing>typedef struct {
int <Symbol Role="Variable">reason</Symbol>;
XEvent *<Symbol Role="Variable">event</Symbol>;
} DtEditorHelpCallbackStruct;</ProgramListing>
<Table Id="PG.widgs.tbl.17" Frame="Topbot">
<Title Id="PG.widgs.mkr.26">DtEditorHelp コールバックのための構造体</Title>
<TGroup Cols="2">
<ColSpec Colname="1" Colwidth="0.86309 in">
<ColSpec Colname="2" Colwidth="4.13692 in">
<THead>
<Row>
<Entry><Para><Literal>構造体</Literal></Para></Entry>
<Entry><Para><Literal>説明</Literal></Para></Entry>
</Row>
</THead>
<TBody>
<Row>
<Entry><Para><Symbol Role="Variable">reason</Symbol></Para></Entry>
<Entry><Para>コールバックが呼び出されたreason。
reasonのリストについては、<Filename MoreInfo="RefEntry">DtEditor</Filename>(3)
のマニュアル・ページ を参照してください。</Para></Entry>
</Row>
<Row>
<Entry><Para><Symbol Role="Variable">event</Symbol></Para></Entry>
<Entry><Para>コールバックを呼び出したイベントへのポインタ。値は、NULLになることもあります。
</Para></Entry>
</Row>
</TBody>
</TGroup>
</Table>
<Para>テキストが選択されているかどうかによってメニュー項目とコマンドを有効か無効にしたいときには、<Command>DtNtextSelectCallback</Command>リソースおよび<Command>DtNtextDeselectCallback</Command>リソースを使用します。
<Command>DtNtextSelectCallback</Command>は、編集ウィンドウでテキストが選択されたときに呼び出される関数を指定します。
<Command>DtNtextDeselectCallback</Command>は、編集ウィンドウでテキストが選択されていないときに呼び出される関数を指定します。
コールバックによって送られるreasonは、
<Filename>DtEDITOR_TEXT_SELECT</Filename>と<Filename>DtEDITOR_TEXT_DESELECT</Filename>です。</Para>
</Sect2>
</Sect1>
</Chapter>
<!--fickle 1.14 mif-to-docbook 1.7 01/02/96 09:54:57-->