![]() ![]() ![]()
|
BREW C++ ライブラリ & GUI フレームワーク & XML ミドルウェア : SophiaFramework UNIVERSE 5.0 |
#include <SFYResponder.h.hpp>
class SFYResponder : protected static_exception;
SFMTYPEDEFRESPONDER(SFYResponder)


レスポンダとは画面上に表示され、ユーザーの操作を受け付けイベントを処理するさまざまなユーザーインターフェースコンポーネントを表します。
レスポンダには画面上での表示位置を管理する機能、属性と状態を管理する機能、自動的にイベントを配信する機能や自動的に画面に描画する機能などさまざまな機能が備わっています。
レスポンダのコンポーネントとして、 ウィンドウ (SFZWindow) や ダイアログ (SFZDialog)、 ラベル (SFYLabelControl)、 ボタン (SFYButtonControl)、 メニュー (SFYMenu クラス)、 フレーム(SFYFrame)などのクラスがあります。
これらのクラス間には下記のような継承関係と所有関係があります。 このような階層構造により BREW 環境から送信されたイベントを適切に分岐したり、 画面を自動的に描画することが可能になっています。
![]() |
注意 |
|---|---|
| ダイアログとメニューはウィンドウと同一階層に存在します。 また、コンテナだけは特殊な設計になっていて、 コントロールや他のコンテナ(コンテナのみ)を管理したり、 逆にコントロールや他のコンテナ(コンテナ・ウィンドウ・ダイアログ)に管理されることも可能です。 | |
![]() |
フレームについて |
|---|---|
|
ウィンドウ、メニュー、ダイアログなどのレスポンダには、タイトルや余白を持つ枠組み(フレーム)を付けることが可能です。 このとき、これらのレスポンダの親はフレームとなり、フレームがウィンドウ、メニュー、ダイアログなどのレスポンダを管理します。 | |
| コンストラクタ/デストラクタ |
|---|
|
SFYResponder( Void ) SFYResponder クラスのコンストラクタです。
|
|
~SFYResponder( Void ) SFYResponder クラスのデストラクタです。
|
| パブリック関数 | |
|---|---|
| Void |
ClearHandler( Void ) ハンドラの登録をすべて解除します。
|
| Void |
ClearTracer( Void ) トレーサの登録をすべて解除します。
|
| SFCError |
Distribute(
SFXEventConstRef event
, BoolPtr result = null
) 配信エンジンを起動してイベントを配信します。
|
| SFYResponderSmp |
GetChildBack( Void ) GetChildBack( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) GetChildBack( UInt32 id ) GetChildBack( Bool visible , Bool active , Bool enable , Bool focus ) 最背面に位置する子レスポンダを取得します。
|
| SFYResponderSmp |
GetChildBackward(
SInt32 index
) GetChildBackward( SInt32 index , UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) GetChildBackward( SInt32 index , UInt32 id ) GetChildBackward( SInt32 index , Bool visible , Bool active , Bool enable , Bool focus ) 背面から数えて指定された順番に位置する子レスポンダを取得します。
|
| SInt32 |
GetChildCount( Void ) GetChildCount( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) GetChildCount( UInt32 id ) GetChildCount( Bool visible , Bool active , Bool enable , Bool focus ) 子レスポンダの数を取得します。
|
| SFYResponderSmp |
GetChildForward(
SInt32 index
) GetChildForward( SInt32 index , UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) GetChildForward( SInt32 index , UInt32 id ) GetChildForward( SInt32 index , Bool visible , Bool active , Bool enable , Bool focus ) 前面から数えて指定された順番に位置する子レスポンダを取得します。
|
| SFYResponderSmp |
GetChildFront( Void ) GetChildFront( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) GetChildFront( UInt32 id ) GetChildFront( Bool visible , Bool active , Bool enable , Bool focus ) 最前面に位置する子レスポンダを取得します。
|
| SFYDistributerPtr |
GetDistributer( Void ) 配信エンジンを取得します。
|
| SFXRectangle |
GetGlobalBound( Void ) グローバル領域を取得します。
|
| UInt32 |
GetID( Void ) ID を取得します。
|
| SFXRectangle |
GetLocalBound( Void ) ローカル領域を取得します。
|
| SInt32 |
GetNthBackward( Void ) GetNthBackward( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) GetNthBackward( UInt32 id ) GetNthBackward( Bool visible , Bool active , Bool enable , Bool focus ) 自レスポンダが背面から数えて何番目に位置するかを取得します。
|
| SInt32 |
GetNthForward( Void ) GetNthForward( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) GetNthForward( UInt32 id ) GetNthForward( Bool visible , Bool active , Bool enable , Bool focus ) 自レスポンダが前面から数えて何番目に位置するかを取得します。
|
| SFYResponderSmp |
GetParent( Void ) 親レスポンダを取得します。
|
| Bool |
GetPropertyTransparent( Void ) 透過属性を取得します。
|
| SFXRectangleConstRef |
GetRealBound( Void ) 実領域を取得します。
|
| VoidPtr |
GetReference( Void ) リファレンス値を取得します。
|
| SFYRendererPtr |
GetRenderer( Void ) 描画エンジンを取得します。
|
| SFYResponderSmp |
GetRoot( Void ) ルートレスポンダを取得します。
|
| Bool |
GetStateActive(
Bool inherit = false
) 活性状態を取得します。
|
| Bool |
GetStateEnable(
Bool inherit = false
) 操作可能状態を取得します。
|
| Bool |
GetStateFocus(
Bool inherit = false
) フォーカス状態を取得します。
|
| Bool |
GetStateVisible(
Bool inherit = false
) 可視状態を取得します。
|
| SFXRectangle |
GetSuitableBound( Void ) GetSuitableBound( SFXRectangleConstRef param ) 最適な大きさを取得します。
|
| SFXMargin |
GetSuitableMargin( Void ) 最適な余白を取得します。
|
| SFCType |
GetType( Void ) タイプを取得します。
|
| SFXRectangleConstRef |
GetVirtualBound( Void ) 仮想領域を取得します。
|
| Void |
Initialize( Void ) レスポンダを初期化します。
|
| Void |
Invalidate( Void ) Invalidate( SFXRectangleConstRef param ) 再描画領域を登録します。
|
| Void |
InvokeBackward(
SFXEventConstRef event
, Bool overload
, BoolPtr result = null
) レスポンダにイベントを送信します。ハンドラ関数はハンドラリストに登録された順序で呼び出されます。
|
| Void |
InvokeForward(
SFXEventConstRef event
, Bool overload
, BoolPtr result = null
) レスポンダにイベントを送信します。ハンドラ関数はハンドラリストに登録された逆順で呼び出されます。
|
| Bool |
IsBack( Void ) IsBack( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) IsBack( UInt32 id ) IsBack( Bool visible , Bool active , Bool enable , Bool focus ) 自レスポンダが最背面に位置するかどうかを判定します。
|
| Bool |
IsFront( Void ) IsFront( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) IsFront( UInt32 id ) IsFront( Bool visible , Bool active , Bool enable , Bool focus ) 自レスポンダが最前面に位置するかどうかを判定します。
|
| Bool |
IsNthBackward(
SInt32 index
) IsNthBackward( SInt32 index , UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) IsNthBackward( SInt32 index , UInt32 id ) IsNthBackward( SInt32 index , Bool visible , Bool active , Bool enable , Bool focus ) 自レスポンダが背面から数えて指定された順番に位置するかどうかを判定します。
|
| Bool |
IsNthForward(
SInt32 index
) IsNthForward( SInt32 index , UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) IsNthForward( SInt32 index , UInt32 id ) IsNthForward( SInt32 index , Bool visible , Bool active , Bool enable , Bool focus ) 自レスポンダが前面から数えて指定された順番に位置するかどうかを判定します。
|
| Bool |
IsRoot( Void ) 自レスポンダがルートレスポンダかどうかを判定します。
|
| SFCError |
RegisterHandler(
SFXEventRangeConstRef range
, SFYHandler::RuleRecConstRef rule
) RegisterHandler( SFXEventRangeConstPtr range , SFYHandler::HandlerSPPConstPtr spp , VoidPtrConstPtr reference , SInt32 length ) RegisterHandler( SFXEventRangeConstPtr range , SFYHandler::RuleRecConstPtr rule , SInt32 length ) RegisterHandler( SFXEventRangeConstRef range , SFYHandler::HandlerSPP spp , VoidPtr reference ) ハンドラを登録します。
|
| SFCError |
RegisterTracer(
SFXEventRangeConstRef range
, SFYTracer::RuleRecConstRef rule
) RegisterTracer( SFXEventRangeConstPtr range , SFYTracer::OrderEnumConstPtr order , SFYTracer::StateEnumConstPtr state , BoolConstPtr overload , SInt32 length ) RegisterTracer( SFXEventRangeConstPtr range , SFYTracer::RuleRecConstPtr rule , SInt32 length ) RegisterTracer( SFXEventRangeConstRef range , SFYTracer::OrderEnum order , SFYTracer::StateEnum state , Bool overload ) トレーサを登録します。
|
| SFCError |
Render(
Bool force = false
) 描画エンジンを起動して再描画します。
|
| Void |
SetDistributer(
SFYDistributerPtr param
) 配信エンジンを設定します。
|
| Void |
SetID(
UInt32 param
) ID を設定します。
|
| SFCError |
SetParent(
SFYResponderSmpConstRef param
) 親レスポンダを設定します。
|
| Void |
SetProperty(
Bool transparent
) 属性をまとめて設定します。
|
| Void |
SetPropertyTransparent(
Bool param
) 透過属性を設定します。
|
| Void |
SetRealBound(
SFXRectangleConstRef param
) 実領域を設定します。
|
| Void |
SetReference(
VoidPtr param
) リファレンス値を設定します。
|
| Void |
SetRenderer(
SFYRendererPtr param
) 描画エンジンを設定します。
|
| Void |
SetState(
Bool visible
, Bool active
, Bool enable
, Bool focus
) 状態をまとめて設定します。
|
| Void |
SetStateActive(
Bool param
) 活性状態を設定します。
|
| Void |
SetStateEnable(
Bool param
) 操作可能状態を設定します。
|
| Void |
SetStateFocus(
Bool param
) フォーカス状態を設定します。
|
| Void |
SetStateVisible(
Bool param
) 可視状態を設定します。
|
| Void |
SetVirtualBound(
SFXRectangleConstRef param
) 仮想領域を設定します。
|
| Void |
Terminate( Void ) レスポンダの終了処理をします。
|
| Void |
ToBack( Void ) ToBack( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) ToBack( UInt32 id ) ToBack( Bool visible , Bool active , Bool enable , Bool focus ) 自レスポンダを姉妹レスポンダのなかで最背面に移動します。
|
| Void |
ToFront( Void ) ToFront( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) ToFront( UInt32 id ) ToFront( Bool visible , Bool active , Bool enable , Bool focus ) 自レスポンダを姉妹レスポンダのなかで最前面に移動します。
|
| Void |
ToNthBackward(
SInt32 index
) ToNthBackward( SInt32 index , UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) ToNthBackward( SInt32 index , UInt32 id ) ToNthBackward( SInt32 index , Bool visible , Bool active , Bool enable , Bool focus ) 自レスポンダを背面から数えて指定された順番に移動します。
|
| Void |
ToNthForward(
SInt32 index
) ToNthForward( SInt32 index , UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) ToNthForward( SInt32 index , UInt32 id ) ToNthForward( SInt32 index , Bool visible , Bool active , Bool enable , Bool focus ) 自レスポンダを前面から数えて指定された順番に移動します。
|
| Void |
UnregisterHandler(
SFXEventRangeConstRef range
, SFYHandler::RuleRecConstRef rule
) UnregisterHandler( SFXEventRangeConstPtr range , SFYHandler::HandlerSPPConstPtr spp , VoidPtrConstPtr reference , SInt32 length ) UnregisterHandler( SFXEventRangeConstPtr range , SFYHandler::RuleRecConstPtr rule , SInt32 length ) UnregisterHandler( SFXEventRangeConstRef range , SFYHandler::HandlerSPP spp , VoidPtr reference ) ハンドラの登録を解除します。
|
| Void |
UnregisterTracer(
SFXEventRangeConstRef range
) UnregisterTracer( SFXEventRangeConstPtr range , SInt32 length ) トレーサの登録を解除します。
|
| T const & |
static_catch(
Void
)
(static_exception から継承)
現在保持している例外を取得します。
|
| プロテクト関数 | |
|---|---|
| static SFYResponderSmp |
Factory(
SFYResponderPtr responder
, SFCErrorPtr exception = null
) NewInstance 関数の実装を補助します。
|
| SFYResponderSmp |
GetThis( Void ) スマートポインタで保持された this を取得します。
|
| Void |
SetType(
SFCType param
) タイプを設定します。
|
| Void |
static_throw(
static_exception< T > const & param
)
(static_exception から継承)
static_throw( T const & param ) (static_exception から継承) 例外を設定します。
|
| Bool |
static_try(
Void
)
(static_exception から継承)
例外が保持されているかどうかを確かめます。
|
| 型 |
|---|
|
CodeEnum SFYResponder クラスを表す定数です。
|
[ protected, explicit ] SFYResponder(Void);
この関数は例外を搬出する可能性があります。
このクラスを継承するクラスのコンストラクタ内では、始めに例外の判定を行う必要があります。
タイプは必ずコンストラクタ内で設定します。
USRWindow クラスのコンストラクタの記述方法
USRWindow::USRWindow(Void)
{
if (static_try()) {
// タイプは必ずこの場所で設定する
// このようにすると親クラスのコンストラクト内でエラーが発生した場合は
// 親クラスのタイプが保持され、自クラスのコンストラクト内でエラーが
// 発生した場合は自クラスのタイプが設定される
// その結果、外部からこのクラスを利用する場合にエラーの発生を箇所を特定しやすくなる
SetType(four_char_code('U', 'W', 'N', 'D'));
// その他の初期化処理を記述する
...
}
}
[ protected, virtual ] virtual ~SFYResponder(Void);
[ public ] Void ClearHandler(Void);
[ public ] Void ClearTracer(Void);
[ public ] SFCError Distribute( SFXEventConstRef event // イベント BoolPtr result = null // 処理結果 );
Distribute() 関数は、 配信エンジンを起動し、 トレーサに登録された規則に従ってBREW 定義イベントやユーザー定義イベントをレスポンダに配信します。
BREW 定義イベントを配信するとき、 イベントループの最初に Distribute() 関数が自動的に呼び出されるので、 明示的に Distribute() 関数を呼び出す必要はありません。
ユーザー定義イベントの場合は、明示的に Distribute() 関数を呼び出す必要があります。
![]() |
重要項目 |
|---|---|
| InvokeForward()/InvokeBackward() 関数と異なり、 Distribute() 関数を利用して送信されたイベントは、 トレーサに登録された規則によっては送信先レスポンダの子レスポンダに配信されることがあります。 | |
SFYResponder::InvokeForward | SFYResponder::InvokeBackward | SFYApplication::Distribute | SFYApplication::InvokeForward | SFYApplication::InvokeBackward | 配信エンジン | イベント | BREW 定義イベント | イベントループ | トレーサ | ハンドラ | ハンドラリスト 配信型 | レスポンダ定義イベント | イベント一覧
[ protected, static ] SFYResponderSmp Factory( SFYResponderPtr responder // インスタンス SFCErrorPtr exception = null // エラー値 );
new 演算子を用いて新しく生成したインスタンスを設定します。
内部で発生したエラー値を返します。
新しいクラスを作成するときに NewInstance 関数の実装を補助します。
この関数を利用することで、仕様に従った NewInstance 関数を簡単に実装できます。
![]() |
static_pointer_cast 演算子 |
|---|---|
SFYResponder::Factory 関数は SFYResponderSmp 型を返すので、 static_pointer_cast 演算子を使って新しく生成するレスポンダクラスの型にダウンキャストする必要があります。 | |
USRWindow クラスに NewInstance 関数を実装する方法
USRWindowSmp USRWindow::NewInstance(SFCErrorPtr exception)
{
return static_pointer_cast<USRWindow>(Factory(::new USRWindow, exception));
}
[ public, const ] SFYResponderSmp GetChildBack(Void);
[ public, const ] SFYResponderSmp GetChildBack( Bool visible // 可視条件 Bool active // 活性条件 Bool enable // 操作可能条件 Bool focus // フォーカス条件 );
[ public, const ] SFYResponderSmp GetChildBack( UInt32 id // ID );
[ public, const ] SFYResponderSmp GetChildBack( UInt32 id // ID Bool visible // 可視条件 Bool active // 活性条件 Bool enable // 操作可能条件 Bool focus // フォーカス条件 );
最背面に位置する子レスポンダ。
存在しない場合は null を返します。
最背面に位置する子レスポンダを取得します。
検索に含める子レスポンダを ID、可視、活性、操作可能、フォーカスの状態に関する状態で制限することができます。
初期化されていない子レスポンダは検索に含まれません。
すべての子レスポンダの中で最背面のレスポンダを取得する方法
SFYResponderSmp child; child = GetChildBack();
ID = 128 の子レスポンダの中で最背面のレスポンダを取得する方法
SFYResponderSmp child; child = GetChildBack(128);
可視かつ活性な(操作可能状態とフォーカス状態の状態は問わない)子レスポンダの中で最背面のレスポンダを取得する方法
SFYResponderSmp child; child = GetChildBack(true, true, false, false);
可視、活性かつ操作可能な(フォーカス状態の状態は問わない)子レスポンダの中で最背面のレスポンダを取得する方法
SFYResponderSmp child; child = GetChildBack(true, true, true, false);
SFYResponder::GetChildFront | SFYResponder::GetChildBackward | SFYResponder::Initialize | ID | 状態 | 子レスポンダ
[ public, const ] SFYResponderSmp GetChildBackward( SInt32 index // 順番 (0-based) );
[ public, const ] SFYResponderSmp GetChildBackward( SInt32 index // 順番 (0-based) Bool visible // 可視条件 Bool active // 活性条件 Bool enable // 操作可能条件 Bool focus // フォーカス条件 );
[ public, const ] SFYResponderSmp GetChildBackward( SInt32 index // 順番 (0-based) UInt32 id // ID );
[ public, const ] SFYResponderSmp GetChildBackward( SInt32 index // 順番 (0-based) UInt32 id // ID Bool visible // 可視条件 Bool active // 活性条件 Bool enable // 操作可能条件 Bool focus // フォーカス条件 );
背面から数えて指定された順番に位置する子レスポンダ。
存在しない場合は null を返します。
背面から数えて指定された順番に位置する子レスポンダを取得します。
検索に含める子レスポンダを ID、可視、活性、操作可能、フォーカスの状態に関する状態で制限することができます。
初期化されていない子レスポンダは検索に含まれません。
すべての子レスポンダの中で背面から 3 番目のレスポンダを取得する方法
SFYResponderSmp child; child = GetChildBackward(2);
ID = 128 の子レスポンダの中で背面から 3 番目のレスポンダを取得する方法
SFYResponderSmp child; child = GetChildBackward(2, 128);
可視かつ活性な(操作可能状態とフォーカス状態の状態は問わない)子レスポンダの中で背面から 3 番目のレスポンダを取得する方法
SFYResponderSmp child; child = GetChildBackward(2, true, true, false, false);
可視、活性かつ操作可能な(フォーカス状態の状態は問わない)子レスポンダの中で背面から 3 番目のレスポンダを取得する方法
SFYResponderSmp child; child = GetChildBackward(2, true, true, true, false);
SFYResponder::GetChildForward | SFYResponder::GetChildBack | SFYResponder::Initialize | ID | 状態 | 子レスポンダ
[ public, const ] SInt32 GetChildCount(Void);
[ public, const ] SInt32 GetChildCount( Bool visible // 可視条件 Bool active // 活性条件 Bool enable // 操作可能条件 Bool focus // フォーカス条件 );
[ public, const ] SInt32 GetChildCount( UInt32 id // ID );
[ public, const ] SInt32 GetChildCount( UInt32 id // ID Bool visible // 可視条件 Bool active // 活性条件 Bool enable // 操作可能条件 Bool focus // フォーカス条件 );
子レスポンダの数を取得します。
検索に含める子レスポンダを ID、可視、活性、操作可能、フォーカスの状態に関する状態で制限することができます。
初期化されていない子レスポンダは検索に含まれません。
すべての子レスポンダの数を取得する方法
SInt32 count; count = GetChildCount();
ID = 128 の子レスポンダの数を取得する方法
SInt32 count; count = GetChildCount(128);
可視かつ活性な(操作可能状態とフォーカス状態の状態は問わない)子レスポンダの数を取得する方法
SInt32 count; count = GetChildCount(true, true, false, false);
可視、活性かつ操作可能な(フォーカス状態の状態は問わない)子レスポンダの数を取得する方法
SInt32 count; count = GetChildCount(true, true, true, false);
SFYResponder::Initialize | 状態 | ID | 子レスポンダ
[ public, const ] SFYResponderSmp GetChildForward( SInt32 index // 順番 (0-based) );
[ public, const ] SFYResponderSmp GetChildForward( SInt32 index // 順番 (0-based) Bool visible // 可視条件 Bool active // 活性条件 Bool enable // 操作可能条件 Bool focus // フォーカス条件 );
[ public, const ] SFYResponderSmp GetChildForward( SInt32 index // 順番 (0-based) UInt32 id // ID );
[ public, const ] SFYResponderSmp GetChildForward( SInt32 index // 順番 (0-based) UInt32 id // ID Bool visible // 可視条件 Bool active // 活性条件 Bool enable // 操作可能条件 Bool focus // フォーカス条件 );
前面から数えて指定された順番に位置する子レスポンダ。
存在しない場合は null を返します。
前面から数えて指定された順番に位置する子レスポンダを取得します。
検索に含める子レスポンダを ID、可視、活性、操作可能、フォーカスの状態に関する状態で制限することができます。
初期化されていない子レスポンダは検索に含まれません。
すべての子レスポンダの中で前面から 3 番目のレスポンダを取得する方法
SFYResponderSmp child; child = GetChildForward(2);
ID = 128 の子レスポンダの中で前面から 3 番目のレスポンダを取得する方法
SFYResponderSmp child; child = GetChildForward(2, 128);
可視かつ活性な(操作可能状態とフォーカス状態の状態は問わない)子レスポンダの中で前面から 3 番目のレスポンダを取得する方法
SFYResponderSmp child; child = GetChildForward(2, true, true, false, false);
可視、活性かつ操作可能な(フォーカス状態の状態は問わない)子レスポンダの中で前面から 3 番目のレスポンダを取得する方法
SFYResponderSmp child; child = GetChildForward(2, true, true, true, false);
SFYResponder::GetChildBackward | SFYResponder::GetChildFront | SFYResponder::Initialize | 状態 | ID | 子レスポンダ
[ public, const ] SFYResponderSmp GetChildFront(Void);
[ public, const ] SFYResponderSmp GetChildFront( Bool visible // 可視条件 Bool active // 活性条件 Bool enable // 操作可能条件 Bool focus // フォーカス条件 );
[ public, const ] SFYResponderSmp GetChildFront( UInt32 id // ID );
[ public, const ] SFYResponderSmp GetChildFront( UInt32 id // ID Bool visible // 可視条件 Bool active // 活性条件 Bool enable // 操作可能条件 Bool focus // フォーカス条件 );
最前面に位置する子レスポンダ。
存在しない場合は null を返します。
最前面に位置する子レスポンダを取得します。
検索に含める子レスポンダを ID、可視、活性、操作可能、フォーカスの状態に関する状態で制限することができます。
初期化されていない子レスポンダは検索に含まれません。
すべての子レスポンダの中で最前面のレスポンダを取得する方法
SFYResponderSmp child; child = GetChildFront();
ID = 128 の子レスポンダの中で最前面のレスポンダを取得する方法
SFYResponderSmp child; child = GetChildFront(128);
可視かつ活性な(操作可能状態とフォーカス状態の状態は問わない)子レスポンダの中で最前面のレスポンダを取得する方法
SFYResponderSmp child; child = GetChildFront(true, true, false, false);
可視、活性かつ操作可能な(フォーカス状態の状態は問わない)子レスポンダの中で最前面のレスポンダを取得する方法
SFYResponderSmp child; child = GetChildFront(true, true, true, false);
SFYResponder::GetChildBack | SFYResponder::GetChildForward | SFYResponder::Initialize | ID | 状態 | 子レスポンダ
[ public, const ] SFYDistributerPtr GetDistributer(Void);
レスポンダに設定された配信エンジン。
設定されていない場合、null が返ります。
レスポンダに設定されている配信エンジンを取得します。
[ public, const ] SFXRectangle GetGlobalBound(Void);
レスポンダのグローバル領域。
レスポンダのグローバル領域を取得します。
[ public, const ] UInt32 GetID(Void);
ID を設定していない場合は、デフォルト値 0 が返ります。
レスポンダのIDを取得します。
[ public, const ] SFXRectangle GetLocalBound(Void);
レスポンダのローカル領域。
レスポンダのローカル領域を取得します。
ローカル領域 | 仮想領域 | SFYResponder::SetVirtualBound | SFYResponder::GetVirtualBound | SFYResponder::GetGlobalBound
[ public, const ] SInt32 GetNthBackward(Void);
[ public, const ] SInt32 GetNthBackward( Bool visible // 可視条件 Bool active // 活性条件 Bool enable // 操作可能条件 Bool focus // フォーカス条件 );
[ public, const ] SInt32 GetNthBackward( UInt32 id // ID );
[ public, const ] SInt32 GetNthBackward( UInt32 id // ID Bool visible // 可視条件 Bool active // 活性条件 Bool enable // 操作可能条件 Bool focus // フォーカス条件 );
条件で指定した姉妹レスポンダのなかで自レスポンダが背面から数えて何番目に位置するかを取得します。
検索に含める姉妹レスポンダを ID、可視、活性、操作可能、フォーカスの状態に関する状態で制限することができます。
初期化されていない姉妹レスポンダは検索に含まれません。
すべての姉妹レスポンダの中で背面から数えて何番目かを取得する方法
SInt32 index; index = GetNthBackward();
ID = 128 の姉妹レスポンダの中で背面から数えて何番目かを取得する方法
SInt32 index; index = GetNthBackward(128);
可視かつ活性な(操作可能状態とフォーカス状態の状態は問わない)姉妹レスポンダの中で背面から数えて何番目かを取得する方法
SInt32 index; index = GetNthBackward(true, true, false, false);
可視、活性かつ操作可能な(フォーカス状態の状態は問わない)姉妹レスポンダの中で背面から数えて何番目かを取得する方法
SInt32 index; index = GetNthBackward(true, true, true, false);
[ public, const ] SInt32 GetNthForward(Void);
[ public, const ] SInt32 GetNthForward( Bool visible // 可視条件 Bool active // 活性条件 Bool enable // 操作可能条件 Bool focus // フォーカス条件 );
[ public, const ] SInt32 GetNthForward( UInt32 id // ID );
[ public, const ] SInt32 GetNthForward( UInt32 id // ID Bool visible // 可視条件 Bool active // 活性条件 Bool enable // 操作可能条件 Bool focus // フォーカス条件 );
条件で指定した姉妹レスポンダのなかで自レスポンダが前面から数えて何番目に位置するかを取得します。
検索に含める姉妹レスポンダを ID、可視、活性、操作可能、フォーカスの状態に関する状態で制限することができます。
初期化されていない姉妹レスポンダは検索に含まれません。
すべての姉妹レスポンダの中で前面から数えて何番目かを取得する方法
SInt32 index; index = GetNthForward();
ID = 128 の姉妹レスポンダの中で前面から数えて何番目かを取得する方法
SInt32 index; index = GetNthForward(128);
可視かつ活性な(操作可能状態とフォーカス状態の状態は問わない)姉妹レスポンダの中で前面から数えて何番目かを取得する方法
SInt32 index; index = GetNthForward(true, true, false, false);
可視、活性かつ操作可能な(フォーカス状態の状態は問わない)姉妹レスポンダの中で前面から数えて何番目かを取得する方法
SInt32 index; index = GetNthForward(true, true, true, false);
[ public, const ] SFYResponderSmp GetParent(Void);
親レスポンダ。
存在しない場合は null を返します。
親レスポンダを取得します。
親レスポンダ | SFYResponder::SetParent | SFZRoot | レスポンダツリー | ルートレスポンダ
[ public, const ] Bool GetPropertyTransparent(Void);
レスポンダの透過属性を取得します。
[ public, const ] SFXRectangleConstRef GetRealBound(Void);
レスポンダの実領域。
レスポンダの実領域を取得します。
[ public, const ] VoidPtr GetReference(Void);
リファレンス値。
何も設定されていない場合はデフォルト値の null が返ります。
レスポンダに設定されたリファレンス値(4バイト)を取得します。何も設定されていない場合は null が返ります。
以下は、テキストボタンコントロールを識別するための番号をリファレンス値として設定し取得するためのコードです。
SFZTextButtonControlSmp _button; SInt32 i; // 10 個のテキストボタンコントロールを作成し番号(リファレンス値)を設定する for (i = 0; i < 10; ++i) { if ((_button = SFZTextButtonControl::NewInstance(&error)) != null) { error = _button->SetParent(GetThis()); if (error == SFERR_NO_ERROR) { // テキストボタンコントロール識別用番号を設定する _button->SetReference(reinterpret_cast<VoidPtr>(i)); } } } ... // テキストボタンコントロール識別用番号を取得する SInt32 number = reinterpret_cast<SInt32>(_button->GetReference());
[ public, const ] SFYRendererPtr GetRenderer(Void);
レスポンダに設定された描画エンジン。
設定されていない場合、null が返ります。
レスポンダに設定されている描画エンジンを取得します。
[ public ] SFYResponderSmp GetRoot(Void);
レスポンダが所属するレスポンダツリーのルートレスポンダ。
レスポンダが所属するレスポンダツリーのルートレスポンダを取得します。
ルートレスポンダとはレスポンダツリーの最上位に位置するレスポンダです。
親レスポンダを持たないレスポンダはルートレスポンダであるとみなされます。
SFYResponder::IsRoot | レスポンダツリー | ルートレスポンダ | ルート | SFZRoot
[ public, const ] Bool GetStateActive( Bool inherit = false // 親レスポンダと自レスポンダのより上位の状態を継承する視覚的状態を取得するかどうか );
レスポンダの活性状態を取得します。
引数に true を設定すると、視覚的状態を取得できます。 デフォルト値である false を設定すると、物理的状態を取得できます。
状態が ON ときは true、OFF のときは false が返ります。
![]() |
活性状態の振る舞い |
|---|---|
|
「視覚的 ON」であるとき、レスポンダは操作対象になりえます。 「視覚的 OFF」であるとき、「物理的 ON」であってもレスポンダは操作対象になりえません。 | |
![]() |
物理的状態と視覚的状態について |
|---|---|
物理的状態と視覚的状態の詳細については状態を参照してください。 | |
[ public, const ] Bool GetStateEnable( Bool inherit = false // 親レスポンダと自レスポンダのより上位の状態を継承する視覚的状態を取得するかどうか );
レスポンダの操作可能状態を取得します。
引数に true を設定すると、視覚的状態を取得できます。 デフォルト値である false を設定すると、物理的状態を取得できます。
状態が ON ときは true、OFF のときは false が返ります。
![]() |
操作可能状態の振る舞い |
|---|---|
|
「視覚的 ON」であるとき、レスポンダは操作可能です。 「視覚的 OFF」であるとき、「物理的 ON」であってもレスポンダは操作することはできません。 | |
![]() |
物理的状態と視覚的状態について |
|---|---|
物理的状態と視覚的状態の詳細については状態を参照してください。 | |
[ public, const ] Bool GetStateFocus( Bool inherit = false // 親レスポンダと自レスポンダのより上位の状態を継承する視覚的状態を取得するかどうか );
レスポンダのフォーカス状態を取得します。
引数に true を設定すると、視覚的状態を取得できます。 デフォルト値である false を設定すると、物理的状態を取得できます。
状態が ON ときは true、OFF のときは false が返ります。
![]() |
フォーカス状態の振る舞い |
|---|---|
|
「視覚的 ON」であるとき、レスポンダは操作対象になっています。 「視覚的 OFF」であるとき、「物理的 ON」であってもレスポンダは操作対象になっていません。 | |
![]() |
物理的状態と視覚的状態について |
|---|---|
物理的状態と視覚的状態の詳細については状態を参照してください。 | |
[ public, const ] Bool GetStateVisible( Bool inherit = false // 親レスポンダと自レスポンダのより上位の状態を継承する視覚的状態を取得するかどうか );
レスポンダの可視状態を取得します。
引数に true を設定すると、視覚的状態を取得できます。 デフォルト値である false を設定すると、物理的状態を取得できます。
状態が ON ときは true、OFF のときは false が返ります。
![]() |
可視状態の振る舞い |
|---|---|
|
「視覚的 ON」であるとき、レスポンダを見えます。 「視覚的 OFF」であるとき、「物理的 ON」であってもレスポンダは見えません。 | |
![]() |
物理的状態と視覚的状態について |
|---|---|
物理的状態と視覚的状態の詳細については状態を参照してください。 | |
[ public ] SFXRectangle GetSuitableBound(Void);
[ public ] SFXRectangle GetSuitableBound( SFXRectangleConstRef param // 参考にする領域 );
SFYResponder::GetSuitableBound 関数はこのレスポンダの最適な大きさを自動的に取得するための関数です。
たとえばラベルやボタンなどのレスポンダでは、 テキストやイメージを設定してから SFYResponder::GetSuitableBound 関数を呼び出すと、 このレスポンダの最適な大きさが自動的に取得できます。
引数を指定しない場合は、このレスポンダの実領域を元に最適な大きさを計算して返します。
引数を指定する場合は (SFEVT_RESPONDER_BOUND, SFP16_BOUND_OPTIMIZE, *) イベント、 指定しない場合は (SFEVT_RESPONDER_BOUND, SFP16_BOUND_REQUEST, *) イベントをコールバック型でこのレスポンダに送信します。
(SFEVT_RESPONDER_BOUND, SFP16_BOUND_OPTIMIZE, *) または (SFEVT_RESPONDER_BOUND, SFP16_BOUND_REQUEST, *) イベントを受信したレスポンダは、 それぞれ SFYWidget::HandleBoundRequest または SFYWidget::HandleBoundOptimize 仮想関数を自動的に呼び出します。
SFYWidget を継承するレスポンダは SFYWidget::HandleBoundRequest または SFYWidget::HandleBoundOptimize 仮想関数をオーバーライドしてこのレスポンダの最適な大きさを計算する処理を記述できます。
![]() |
注意 |
|---|---|
|
SFYResponder::GetSuitableBound 関数はレスポンダの最適な大きさを取得するための関数です。 親レスポンダの領域内にバランス良く配置するためには、 このレスポンダの実領域の原点の位置を SFYResponder::GetSuitableBound 関数で取得したこのレスポンダの最適な大きさに合わせて調整する必要があります。 | |
テキストボタンに最適な大きさを取得して設定する方法
SFZTextButtonControlSmp button; ... // テキストボタンコントロールのテキストを設定する button->SetText("sample"); // 1.テキストボタンコントロールの最適な大きさを設定されたテキストを基にして計算する // 2.SetOrigin() 関数で原点の位置を決めて実領域を設定する button->SetRealBound(button->GetSuitableBound().SetOrigin(10, 10)); ...
SFYResponder::SetRealBound | SFYResponder::GetRealBound | SFYWidget | SFYWidget::HandleBoundRequest | SFYWidget::HandleBoundOptimize | 実領域 | 領域イベント[SFEVT_RESPONDER_BOUND] | 領域イベント専用ハンドラ[XANDLER_DECLARE_VOIDBOUND] | コールバック型
[ public ] SFXMargin GetSuitableMargin(Void);
最適な余白(マージン)。
デフォルトでは SFXMargin(0,0,0,0) を返します。
SFYResponder::GetSuitableMargin 関数は自レスポンダの最適な余白(マージン)を自動的に取得するための関数です。
(SFEVT_RESPONDER_MARGIN, SFP16_MARGIN_REQUEST, *) イベントを自分自身にコールバック型でこのレスポンダに送信します。
[ protected ] SFYResponderSmp GetThis(Void);
[ public, const ] SFCType GetType(Void);
タイプを設定しなかった場合、継承するクラスで設定されているタイプが返ります。
レスポンダのタイプを取得します。
USRWindow でのタイプの利用
Void USRResponder::PrintType(SFYResponderSmpConstRef param) Const
{
switch (param->GetType()) {
case SFZWindow::CODE_TYPE:
TRACE("It is a SFZWindow class.");
break;
case SFZDialog::CODE_TYPE:
TRACE("It is a SFZDialog class.");
break;
case SFZTextButtonControl::CODE_TYPE:
TRACE("It is a SFZTextButtonControl class.");
break;
default:
TRACE("It is an unknown class.");
break;
}
return;
}