![]() ![]() ![]()
|
SophiaFramework UNIVERSE 5.0 |
#include <SFZSoftKeyControl.h.hpp>
class SFZSoftKeyControl : public SFYControl;
SFMTYPEDEFCLASS(SFZSoftKeyControl)


3 つのソフトキーラベルから構成されるソフトキーメニュー(スタンダードスタイル)と、 5 つのソフトキーラベルと上下左右カーソルキー矢印から構成されるソフトキーメニュー(エクステンションスタイル)の機能を提供するコントロールです。
![]() |
Tip |
|---|---|
| ソフトキーメニューのデフォルトはスタンダードスタイルです。 | |
■ソフトキーコントロールの機能
ソフトキーコントロールが提供する機能は以下のとおりです。
レスポンダのフォーカス状態の「視覚的 ON/OFF」 については、状態をご覧ください。
■SFZSoftKeyControl クラスの使い方
以下、window1 と window2 のウィンドウを持つ application アプリケーションクラスがあるとして説明します。
ソフトキーコントロールのインスタンスを生成します。
// 1アプレットにつき1つのソフトキーコントロールのインスタンスが有効
_softkey = SFZSoftKeyControl::NewInstance(&error);
ソフトキーコントロールの親を application アプリケーションクラス[ルート(SFZRoot クラス)]にします(ルートの子レスポンダの中で常に最前面になるように自動的に配置されます)。
// ソフトキーコントロールの親は必ずアプリケーションクラスにする
_softkey->SetParent(application);
ソフトキーコントロールのスタイル(スタンダードかエクステンション)を設定します。
// ソフトキーコントロールのスタイルをエクステンションに設定する
_softkey->SetStyle(SFZSoftKeyControl::EXTENSION);
ソフトキーコントロールの実領域を設定します。
// ソフトキーコントロールの実領域を自動的に計算して設定する
_softkey->SetRealBound(_softkey->GetSuitableBound());
ソフトキーコントロールの状態を設定します。必ず「可視+活性+操作不可能+非フォーカス」の状態で設定します。
// ソフトキーコントロールの状態を「可視+活性+操作不可能+非フォーカス」でまとめて設定する
_softkey->SetState(true, true, false, false);
ラベルに表示されるテキスト、イメージ、カラー(3色の構造体)をキーを指定して登録します。(※テキスト、イメージ、カラーは異なるラベル間で共有することができ、それぞれユニークなキーで管理されます。)
// ソフトキーコントロールのラベルに表示されるテキスト、イメージ、カラーを登録する
_softkey->RegisterText(KEY_TEXT, text);
_softkey->RegisterImage(KEY_IMAGE, image);
_softkey->RegisterFrameColor(KEY_COLOR, colorFrame);
_softkey->RegisterForeColor(KEY_COLOR, colorFore);
_softkey->RegisterBackColor(KEY_COLOR, colorBack);
メニューキーを指定してソフトキーメニューを作成します。(※メニューは異なるレスポンダ間で共有することができ、ユニークなキーで管理されます。)
// ソフトキーコントロールのメニューを作成する
_softkey->CreateMenu(KEY_MENU);
ソフトキーメニューにあらかじめ登録しておいたテキスト、イメージ、カラーのキーをセットします。
// ソフトキー1のラベルに対してテキスト、イメージ、カラーをセットする
_softkey->SetTextKey(KEY_MENU, SFZSoftKeyControl::SOFTKEY_1, KEY_TEXT);
_softkey->SetImageKey(KEY_MENU, SFZSoftKeyControl::SOFTKEY_1, KEY_IMAGE);
_softkey->SetColorKey(KEY_MENU, SFZSoftKeyControl::SOFTKEY_1, KEY_COLOR);
window1 と共にソフトキーコントロールを表示します。
window1 のコンストラクタ内で以下の処理を行います。
![]() |
SophiaFramework 標準レスポンダの場合 |
|---|---|
window1 が標準レスポンダ (SFZWindow や SFZTextMenu など) でコンストラクタを編集できない場合、 下記の処理は外部から行います。 | |
ソフトキーコントロールのインスタンスを取得します。
// ソフトキーコントロールのインスタンスを取得する
_softkey = USRApplication::GetSoftKey();
※ USRApplication クラスにソフトキーコントロールのインスタンスを取得する関数を定義しているとします。
window1 と ソフトキーメニュー、ソフトキーコントロールをバインドします。
// ソフトキーコントロールとウィンドウをバインドする
_softkey->Bind(this, KEY_MENU);
ソフトキーコントロールのハンドラを登録します(ソフトキーイベントのハンドラ OnSoftkey の宣言と実装も必要です)。
// ソフトキーイベントのハンドラを登録する
_softkey->RegisterHandler(
SFXEventRange(SFEVT_RESPONDER_SOFTKEY, SFEVT_RESPONDER_SOFTKEY, AVK_SOFT1, AVK_SOFT4),
XANDLER_INTERNAL(OnSoftkey)
);
このソフトキーコントロールを表示する必要がなくなればアンバインドします。
// ソフトキーコントロールとウィンドウをアンバインドする // バインドされたレスポンダが無効になれば自動的にアンバイドされるので省略可能 _softkey->UnBind(this);
![]() |
複数のレスポンダとソフトキーコントロールの管理 |
|---|---|
|
ソフトキーコントロールはソフトキーメニューを設定し、複数のレスポンダとバインドして利用します。 バインドしているレスポンダのどれかのソフトキーメニューを表示すべきとき『ソフトキーコントロールはアクティブである』と呼びます。 そのとき、バインドされたレスポンダの中で最も前面にあるフォーカスを持つレスポンダのソフトキーメニューが表示されます。 アクティブなソフトキーコントロールは、そのレスポンダにソフトキー1〜4のキーイベントを転送します。 ソフトキーコントロールが非アクティブである場合、ソフトキー1〜4のキーイベントは他のレスポンダに転送されません。 | |
![]() |
ソフトキーコントロール利用時の注意事項 |
|---|---|
|
ソフトキーコントロールを利用すると、ソフトキーコントロール内部で下記のようにアプリケーションクラスのトレーサに配信規則が登録されます。 // ソフトキーコントロールの親レスポンダをアプリケーションクラスに設定したとき // トレーサには下記の配信規則が登録される application->RegisterTracer( SFXEventRange(SFEVT_KEY, SFEVT_KEY, AVK_SOFT1, AVK_SOFT4), SFYTracer::ORDER_FORWARD, SFYTracer::STATE_ALL, false ); 配信規則は、
となっています。 ソフトキーコントロールはアプリケーションクラス[ルート(SFZRoot クラス)]の最前面の子レスポンダなので、 ソフトキー1〜4のキーイベントは必ずソフトキーコントロール内で処理されます。 ソフトキーコントロールはソフトキー1〜4のキーイベントを表示中のソフトキーメニューにバインドされたレスポンダへ転送します。 ソフトキーメニューが表示されていない場合、 ソフトキー1〜4のキーイベントはどのレスポンダにも転送されません。 | |
例 804. ソフトキーコントロールの定義と生成
// screensaver_sfy アプリケーションクラスの定義 SFMTYPEDEFCLASS(screensaver_sfy) class screensaver_sfy : public SFYApplication { SFMSEALCOPY(screensaver_sfy) private: SFZSoftKeyControlSmp _softkey; // ソフトキーコントロールはアプリケーションクラスのグローバル変数として保持する MainWindowSmp _main; public: static SFCInvokerPtr Factory(Void); static SFZSoftKeyControlSmp GetSoftKey(Void); private: explicit screensaver_sfy(Void) static_throws; virtual ~screensaver_sfy(Void); XANDLER_DECLARE_VOIDRENDER(OnRenderRequest) }; // screensaver_sfy アプリケーションクラスのコンストラクタ screensaver_sfy::screensaver_sfy(Void) static_throws { SFCError error; if (static_try()) { // 最初にソフトキーコントロールを作成する(ソフトキーコントロールはルートの最前面の子レスポンダ) if (static_try()) { // アプリケーションクラスはひとつだけソフトキーコントロールを持てる // ソフトキーコントロールを使うとき、 // ソフトキー1〜4のキーイベントはすべてソフトキーコントロール内で処理される _softkey = SFZSoftKeyControl::NewInstance(&error); if (_softkey != null) { // 親レスポンダはアプリケーションクラスルート)とする // ※ソフトキーコントロールはルートの子レスポンダでなければいけない error = _softkey->SetParent(GetThis()); if (error == SFERR_NO_ERROR) { // スタイルを設定する(ここではエクステンションスタイルのソフトキーコントロール) _softkey->SetStyle(SFZSoftKeyControl::EXTENSION); // 実領域を設定する(携帯電話の画面のサイズとスタイルから自動的に計算して設定) _softkey->SetRealBound(_softkey->GetSuitableBound()); // 状態を「可視+活性+操作不可能+非フォーカス」にまとめて設定する _softkey->SetState(true, true, false, false); // 最前面に配置する(常に最前面になるように内部処理される) // _softkey->ToFront(); // 内部的に自動的に実行されるので不要 // 適宜、ソフトキーにテキスト(、イメージ、カラー)を割り当てます。 // レスポンダとソフトキーメニューがバインドされ、テキスト(、イメージ、カラー)が、 // 実際に使用されてしまう前に割り当てる必要があります。 _softkey->RegisterText(KEY_TEXT_EXIT, SFXWideString("終了")); _softkey->RegisterText(KEY_TEXT_EDIT, SFXWideString("設定")); _softkey->RegisterText(KEY_TEXT_ADD, SFXWideString("追加")); _softkey->RegisterText(KEY_TEXT_CHANGE, SFXWideString("変更")); _softkey->RegisterText(KEY_TEXT_REMOVE, SFXWideString("削除")); // 適宜、ソフトキーメニューを作成しラベルのキーをセットします。 // レスポンダとソフトキーメニューがバインドされる前に作成する必要があります。 _softkey->CreateMenu(KEY_MENU_MAIN); // それぞれ SELECT, SOFTKEY_1, SOFTKEY_2, SOFTKEY_3, SOFTKEY_4 のラベルに対応します。 UInt32 key_text[] = {KEY_TEXT_EDIT, KEY_TEXT_EXIT, KEY_TEXT_ADD, KEY_TEXT_CHANGE, KEY_TEXT_REMOVE}; _softkey->SetTextKey(KEY_MENU_MAIN, key_text, lengthof(key_text)); } } } // 次にメイン ウィンドウを作成する if (error == SFERR_NO_ERROR) { _main = MainWindow::NewInstance(&error); ................. } ................. } } // ソフトキーコントロールのインスタンスを取得する関数の定義 SFZSoftKeyControlSmp screensaver_sfy::GetSoftKey(Void) { SFZSoftKeyControlSmp softkey(static_pointer_cast<SFZSoftKeyControl>(GetRoot()->GetChildFront())); if (softkey == null || softkey->GetType() != SFZSoftKeyControl::CODE_TYPE) { softkey = SFZSoftKeyControlSmp::EmptyInstance(); } return softkey; }
例 805. ソフトキーコントロールの作成とソフトキーハンドラの宣言・登録
// ソフトキーコントロールの定義とハンドラの宣言 SFMTYPEDEFRESPONDER(MainWindow) class MainWindow : public SFZWindow { SFMSEALRESPONDER(MainWindow) SFMRESPONDERINSTANTIATEFOUR(MainWindow, SFZWindow, SFYContainer, SFYWidget, SFYResponder) public: ................ private: SFZSoftKeyControlSmp _softkey;// ソフトキーコントロール ................ private: XANDLER_DECLARE_VOIDEVENT(OnKey) // キーハンドラ XANDLER_DECLARE_VOIDEVENT(OnSoftkey) // ソフトキーハンドラ ................ }; // MainWindow のコンストラクタ // ソフトキーコントロールのバインド、各種設定、ハンドラ登録 MainWindow::MainWindow(Void) static_throws { static SFXEventRange::AtomRecConst range[] = { {SFEVT_APP_SUSPEND, SFEVT_APP_SUSPEND, SFP16_BEGIN, SFP16_END}, {SFEVT_APP_RESUME, SFEVT_APP_RESUME, SFP16_BEGIN, SFP16_END}, {SFEVT_KEY, SFEVT_KEY, SFP16_BEGIN, SFP16_END}, {SFEVT_RESPONDER_SOFTKEY, SFEVT_RESPONDER_SOFTKEY, AVK_SOFT1, AVK_SOFT4} // ソフトキーコントロールのイベント }; SFYHandler::RuleRec rule[lengthof(range)]; if (static_try()) { SetType(CODE_TYPE); // ハンドラの登録 rule[0].spp = XANDLER_FUNCTION(OnSuspend); rule[0].reference = this; rule[1].spp = XANDLER_FUNCTION(OnResume); rule[1].reference = this; rule[2].spp = XANDLER_FUNCTION(OnKey); rule[2].reference = this; rule[3].spp = XANDLER_FUNCTION(OnSoftkey); // ソフトキーコントロールのハンドラ rule[3].reference = this; static_throw(RegisterHandler(atomic_cast(range), rule, lengthof(range))); // ソフトキーコントロールの設定 // ソフトキーコントロールのインスタンスを取得する if ((_softkey = screensaver_sfy::GetSoftKey()) != null) { // ソフトキーコントロールを MainWindow、KEY_MENU_MAIN にバインドする // ※ 以下の関数呼び出しでバインドするレスポンダの引数は SFYResponderPtr 型を要求しているので this を指定している _softkey->Bind(this, KEY_MENU_MAIN); } } }
例 806. ソフトキーコントロールのハンドラの実装
// ソフトキーコントロールのハンドラの実装 : ソフトキー1〜4のキーイベントを受信したときのハンドラ // ソフトキーコントロールにバインドされたフォーカスを持つ他のレスポンダよりも前面にあり、 // MainWindow がフォーカスを持つ場合にしか呼び出されない XANDLER_IMPLEMENT_VOIDEVENT(MainWindow, OnSoftkey, invoker, event) { ................. switch (event.GetP16()) { case AVK_SOFT1: // 終了確認ダイアログの作成 ................. break; case AVK_SOFT2: // メニューの作成 ................. }
■実行結果
スタンダードスタイル:

エクステンションスタイル:

| コンストラクタ/デストラクタ |
|---|
|
SFZSoftKeyControl( Void ) SFZSoftKeyControl クラスのコンストラクタです。
|
|
~SFZSoftKeyControl( Void ) SFZSoftKeyControl クラスのデストラクタです。
|
| パブリック関数 | |
|---|---|
| SFCError |
Bind(
SFYResponderPtr responder
, UInt32 key
) ソフトキーコントロールをバインドします。
|
| Bool |
ContainsColorKey(
UInt32 key
) 指定したカラーキーが含まれるか判定します。
|
| Bool |
ContainsImageKey(
UInt32 key
) 指定したイメージキーが含まれるか判定します。
|
| Bool |
ContainsMenuKey(
UInt32 key
) 指定したメニューキーが含まれるか判定します。
|
| Bool |
ContainsResponder(
SFYResponderPtr responder
) 指定したレスポンダが含まれるか判定します。
|
| Bool |
ContainsTextKey(
UInt32 key
) 指定したテキストキーが含まれるか判定します。
|
| SFCError |
CreateMenu(
UInt32 key
) 指定したメニューのキーに対応するソフトキーメニューを作成します。
|
| Void |
DestroyMenu(
UInt32 key
) 指定したメニューのキーに対応するソフトキーメニューを削除します。
|
| SInt16 |
GetArrowBaseLength( Void ) 矢印の底辺の長さを取得します。
|
| SInt16 |
GetArrowHeight( Void ) 矢印の高さを取得します。
|
| SFXRGBColorConstRef |
GetBackColor(
UInt32 key
) ソフトキーラベルの背景色(方向キーの色)を取得します。
|
| SInt16 |
GetBaseSpace( Void ) ソフトキーコントロールの境界線とラベル間のスペース値を取得します。
|
| UInt32 |
GetColorKey(
UInt32 menuKey
, SoftkeyEnum softNum
) メニューのキーとラベル番号を指定して、ラベルのカラーキーを取得します。
|
| Bool |
GetEnable(
UInt32 menuKey
, SoftkeyEnum softNum
) メニューのキーとラベル番号を指定して、ラベルの状態を取得します。
|
| AEEFont |
GetFont( Void ) フォントを取得します。
|
| SFXRGBColorConstRef |
GetForeColor(
UInt32 key
) ソフトキーラベルの前景色(テキストの色)を取得します。
|
| SFXRGBColorConstRef |
GetFrameColor(
UInt32 key
) ソフトキーラベルのフレーム色を取得します。
|
| SFBImageSmpConstRef |
GetImage(
UInt32 key
) ソフトキーラベルのイメージを取得します。
|
| UInt32 |
GetImageKey(
UInt32 menuKey
, SoftkeyEnum softNum
) メニューのキーとラベル番号を指定して、ラベルのイメージキーを取得します。
|
| UInt32 |
GetMenuKey(
SFYResponderPtr responder
) 指定のレスポンダと Bind されているメニューキーを取得します。
|
| StyleEnum |
GetStyle( Void ) ソフトキーのスタイルを設定します。
|
| SFXWideStringConstRef |
GetText(
UInt32 key
) ソフトキーラベルのテキストを取得します。
|
| UInt32 |
GetTextKey(
UInt32 menuKey
, SoftkeyEnum softNum
) メニューのキーとラベル番号を指定して、ラベルのテキストキーを取得します。
|
| static SFZSoftKeyControlSmp |
NewInstance(
SFCErrorPtr exception = null
) 新しいインスタンスを作成します。
|
| SFCError |
RegisterBackColor(
UInt32 key
, SFXRGBColorConstRef param
) ソフトキーラベルの背景色を登録します。
|
| SFCError |
RegisterForeColor(
UInt32 key
, SFXRGBColorConstRef param
) ソフトキーラベルの前景色を登録します。
|
| SFCError |
RegisterFrameColor(
UInt32 key
, SFXRGBColorConstRef param
) ソフトキーラベルのフレーム色を登録します。
|
| SFCError |
RegisterImage(
UInt32 key
, SFXPathConstRef path
) RegisterImage( UInt32 key , SFBImagePtr param ) RegisterImage( UInt32 key , SFXPathConstRef path , UInt16 id ) ソフトキーラベルのイメージを設定します。
|
| SFCError |
RegisterImageRange(
UInt32 originKey
, SFXPathConstRef path
, UInt16 start
, UInt16 end
) リソースID の範囲を指定してソフトキーラベルのイメージを設定します。
|
| SFCError |
RegisterText(
UInt32 key
, SFXPathConstRef path
, UInt16 id
) RegisterText( UInt32 key , SFXWideStringConstRef param ) ソフトキーラベルのテキストを設定します。
|
| SFCError |
RegisterTextRange(
UInt32 originKey
, SFXPathConstRef path
, UInt16 start
, UInt16 end
) リソースID の範囲を指定してソフトキーラベルのテキストを設定します。
|
| Void |
SetArrowBaseLength(
SInt16 param
) 矢印の底辺の長さを設定します。
|
| Void |
SetArrowHeight(
SInt16 param
) 矢印の高さを設定します。
|
| Void |
SetBaseSpace(
SInt16 param
) ソフトキーコントロールの境界線とラベル間のスペース値を設定します。
|
| SFCError |
SetColorKey(
UInt32 menuKey
, SoftkeyEnum softNum
, UInt32 colorKey
) SetColorKey( UInt32 menuKey , UInt32ConstPtr keys , UInt32 num ) メニューのキーとラベルを指定して、ラベルのカラーキーを設定します。
|
| SFCError |
SetEnable(
UInt32 menuKey
, SoftkeyEnum softNum
, Bool enable
) SetEnable( UInt32 menuKey , BoolConstPtr enables , UInt32 num ) メニューのキーとラベルを指定して、ラベルの状態を設定します。
|
| Void |
SetFont(
AEEFont param
) フォントを設定します。
|
| SFCError |
SetImageKey(
UInt32 menuKey
, SoftkeyEnum softNum
, UInt32 imageKey
) SetImageKey( UInt32 menuKey , UInt32ConstPtr keys , UInt32 num ) メニューのキーとラベルを指定して、ラベルのイメージキーを設定します。
|
| Void |
SetStyle(
StyleEnum param
) ソフトキーのスタイルを設定します。
|
| SFCError |
SetTextKey(
UInt32 menuKey
, SoftkeyEnum softNum
, UInt32 textKey
) SetTextKey( UInt32 menuKey , UInt32ConstPtr keys , UInt32 num ) メニューのキーとラベルを指定して、ラベルのテキストキーを設定します。
|
| Void |
UnBind(
SFYResponderPtr responder
) ソフトキーコントロールをアンバインドします。
|
| Void |
UnregisterColor(
UInt32 key
) ソフトキーラベルの色を未設定にします。
|
| Void |
UnregisterImage(
UInt32 key
) ソフトキーラベルのイメージを未設定にします。
|
| Void |
UnregisterText(
UInt32 key
) ソフトキーラベルのテキストを未設定にします。
|
| Void |
ClearHandler( Void )
(SFYResponder から継承)
ハンドラの登録をすべて解除します。
|
| Void |
ClearTracer( Void )
(SFYResponder から継承)
トレーサの登録をすべて解除します。
|
| SFCError |
Distribute(
SFXEventConstRef event
, BoolPtr result = null
)
(SFYResponder から継承)
配信エンジンを起動してイベントを配信します。
|
| SFXRGBColorConstRef |
GetBackgroundColor( Void )
(SFYWidget から継承)
背景の色を取得します。
|
| SFYResponderSmp |
GetChildBack( Void )
(SFYResponder から継承)
GetChildBack( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) GetChildBack( UInt32 id ) (SFYResponder から継承) GetChildBack( Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) 最背面に位置する子レスポンダを取得します。
|
| SFYResponderSmp |
GetChildBackward(
SInt32 index
)
(SFYResponder から継承)
GetChildBackward( SInt32 index , UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) GetChildBackward( SInt32 index , UInt32 id ) (SFYResponder から継承) GetChildBackward( SInt32 index , Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) 背面から数えて指定された順番に位置する子レスポンダを取得します。
|
| SInt32 |
GetChildCount( Void )
(SFYResponder から継承)
GetChildCount( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) GetChildCount( UInt32 id ) (SFYResponder から継承) GetChildCount( Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) 子レスポンダの数を取得します。
|
| SFYResponderSmp |
GetChildForward(
SInt32 index
)
(SFYResponder から継承)
GetChildForward( SInt32 index , UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) GetChildForward( SInt32 index , UInt32 id ) (SFYResponder から継承) GetChildForward( SInt32 index , Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) 前面から数えて指定された順番に位置する子レスポンダを取得します。
|
| SFYResponderSmp |
GetChildFront( Void )
(SFYResponder から継承)
GetChildFront( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) GetChildFront( UInt32 id ) (SFYResponder から継承) GetChildFront( Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) 最前面に位置する子レスポンダを取得します。
|
| SInt32 |
GetCurrentValue( Void )
(SFYControl から継承)
コントロールの現在値を取得します。
|
| SFYDistributerPtr |
GetDistributer( Void )
(SFYResponder から継承)
配信エンジンを取得します。
|
| SFXRectangle |
GetGlobalBound( Void )
(SFYResponder から継承)
グローバル領域を取得します。
|
| UInt32 |
GetID( Void )
(SFYResponder から継承)
ID を取得します。
|
| SFXRectangle |
GetLocalBound( Void )
(SFYResponder から継承)
ローカル領域を取得します。
|
| SInt32 |
GetMaximumValue( Void )
(SFYControl から継承)
コントロールの最大値を取得します。
|
| SInt32 |
GetMinimumValue( Void )
(SFYControl から継承)
コントロールの最小値を取得します。
|
| SInt32 |
GetNthBackward( Void )
(SFYResponder から継承)
GetNthBackward( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) GetNthBackward( UInt32 id ) (SFYResponder から継承) GetNthBackward( Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) 自レスポンダが背面から数えて何番目に位置するかを取得します。
|
| SInt32 |
GetNthForward( Void )
(SFYResponder から継承)
GetNthForward( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) GetNthForward( UInt32 id ) (SFYResponder から継承) GetNthForward( Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) 自レスポンダが前面から数えて何番目に位置するかを取得します。
|
| SFYResponderSmp |
GetParent( Void )
(SFYResponder から継承)
親レスポンダを取得します。
|
| Bool |
GetPropertyTransparent( Void )
(SFYResponder から継承)
透過属性を取得します。
|
| SFXRectangleConstRef |
GetRealBound( Void )
(SFYResponder から継承)
実領域を取得します。
|
| VoidPtr |
GetReference( Void )
(SFYResponder から継承)
リファレンス値を取得します。
|
| SFYRendererPtr |
GetRenderer( Void )
(SFYResponder から継承)
描画エンジンを取得します。
|
| SFYResponderSmp |
GetRoot( Void )
(SFYResponder から継承)
ルートレスポンダを取得します。
|
| Bool |
GetStateActive(
Bool inherit = false
)
(SFYResponder から継承)
活性状態を取得します。
|
| Bool |
GetStateEnable(
Bool inherit = false
)
(SFYResponder から継承)
操作可能状態を取得します。
|
| Bool |
GetStateFocus(
Bool inherit = false
)
(SFYResponder から継承)
フォーカス状態を取得します。
|
| Bool |
GetStateVisible(
Bool inherit = false
)
(SFYResponder から継承)
可視状態を取得します。
|
| SFXRectangle |
GetSuitableBound( Void )
(SFYResponder から継承)
GetSuitableBound( SFXRectangleConstRef param ) (SFYResponder から継承) 最適な大きさを取得します。
|
| SFXMargin |
GetSuitableMargin( Void )
(SFYResponder から継承)
最適な余白を取得します。
|
| SFCType |
GetType( Void )
(SFYResponder から継承)
タイプを取得します。
|
| SFXRectangleConstRef |
GetVirtualBound( Void )
(SFYResponder から継承)
仮想領域を取得します。
|
| Void |
Initialize( Void )
(SFYResponder から継承)
レスポンダを初期化します。
|
| Void |
Invalidate( Void )
(SFYResponder から継承)
Invalidate( SFXRectangleConstRef param ) (SFYResponder から継承) 再描画領域を登録します。
|
| Void |
InvokeBackward(
SFXEventConstRef event
, Bool overload
, BoolPtr result = null
)
(SFYResponder から継承)
レスポンダにイベントを送信します。ハンドラ関数はハンドラリストに登録された順序で呼び出されます。
|
| Void |
InvokeForward(
SFXEventConstRef event
, Bool overload
, BoolPtr result = null
)
(SFYResponder から継承)
レスポンダにイベントを送信します。ハンドラ関数はハンドラリストに登録された逆順で呼び出されます。
|
| Bool |
IsBack( Void )
(SFYResponder から継承)
IsBack( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) IsBack( UInt32 id ) (SFYResponder から継承) IsBack( Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) 自レスポンダが最背面に位置するかどうかを判定します。
|
| Bool |
IsFront( Void )
(SFYResponder から継承)
IsFront( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) IsFront( UInt32 id ) (SFYResponder から継承) IsFront( Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) 自レスポンダが最前面に位置するかどうかを判定します。
|
| Bool |
IsNthBackward(
SInt32 index
)
(SFYResponder から継承)
IsNthBackward( SInt32 index , UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) IsNthBackward( SInt32 index , UInt32 id ) (SFYResponder から継承) IsNthBackward( SInt32 index , Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) 自レスポンダが背面から数えて指定された順番に位置するかどうかを判定します。
|
| Bool |
IsNthForward(
SInt32 index
)
(SFYResponder から継承)
IsNthForward( SInt32 index , UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) IsNthForward( SInt32 index , UInt32 id ) (SFYResponder から継承) IsNthForward( SInt32 index , Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) 自レスポンダが前面から数えて指定された順番に位置するかどうかを判定します。
|
| Bool |
IsRoot( Void )
(SFYResponder から継承)
自レスポンダがルートレスポンダかどうかを判定します。
|
| SFCError |
RegisterHandler(
SFXEventRangeConstRef range
, SFYHandler::RuleRecConstRef rule
)
(SFYResponder から継承)
RegisterHandler( SFXEventRangeConstPtr range , SFYHandler::HandlerSPPConstPtr spp , VoidPtrConstPtr reference , SInt32 length ) (SFYResponder から継承) RegisterHandler( SFXEventRangeConstPtr range , SFYHandler::RuleRecConstPtr rule , SInt32 length ) (SFYResponder から継承) RegisterHandler( SFXEventRangeConstRef range , SFYHandler::HandlerSPP spp , VoidPtr reference ) (SFYResponder から継承) ハンドラを登録します。
|
| SFCError |
RegisterTracer(
SFXEventRangeConstRef range
, SFYTracer::RuleRecConstRef rule
)
(SFYResponder から継承)
RegisterTracer( SFXEventRangeConstPtr range , SFYTracer::OrderEnumConstPtr order , SFYTracer::StateEnumConstPtr state , BoolConstPtr overload , SInt32 length ) (SFYResponder から継承) RegisterTracer( SFXEventRangeConstPtr range , SFYTracer::RuleRecConstPtr rule , SInt32 length ) (SFYResponder から継承) RegisterTracer( SFXEventRangeConstRef range , SFYTracer::OrderEnum order , SFYTracer::StateEnum state , Bool overload ) (SFYResponder から継承) トレーサを登録します。
|
| SFCError |
Render(
Bool force = false
)
(SFYResponder から継承)
描画エンジンを起動して再描画します。
|
| Void |
SetBackgroundColor(
SFXRGBColorConstRef param
)
(SFYWidget から継承)
背景の色を設定します。
|
| Void |
SetCurrentValue(
SInt32 param
)
(SFYControl から継承)
コントロールの現在値を設定します。
|
| Void |
SetDistributer(
SFYDistributerPtr param
)
(SFYResponder から継承)
配信エンジンを設定します。
|
| Void |
SetID(
UInt32 param
)
(SFYResponder から継承)
ID を設定します。
|
| Void |
SetMaximumValue(
SInt32 param
)
(SFYControl から継承)
コントロールの最大値を設定します。
|
| Void |
SetMinimumValue(
SInt32 param
)
(SFYControl から継承)
コントロールの最小値を設定します。
|
| SFCError |
SetParent(
SFYResponderSmpConstRef param
)
(SFYResponder から継承)
親レスポンダを設定します。
|
| Void |
SetProperty(
Bool transparent
)
(SFYResponder から継承)
属性をまとめて設定します。
|
| Void |
SetPropertyTransparent(
Bool param
)
(SFYResponder から継承)
透過属性を設定します。
|
| Void |
SetRealBound(
SFXRectangleConstRef param
)
(SFYResponder から継承)
実領域を設定します。
|
| Void |
SetReference(
VoidPtr param
)
(SFYResponder から継承)
リファレンス値を設定します。
|
| Void |
SetRenderer(
SFYRendererPtr param
)
(SFYResponder から継承)
描画エンジンを設定します。
|
| Void |
SetState(
Bool visible
, Bool active
, Bool enable
, Bool focus
)
(SFYResponder から継承)
状態をまとめて設定します。
|
| Void |
SetStateActive(
Bool param
)
(SFYResponder から継承)
活性状態を設定します。
|
| Void |
SetStateEnable(
Bool param
)
(SFYResponder から継承)
操作可能状態を設定します。
|
| Void |
SetStateFocus(
Bool param
)
(SFYResponder から継承)
フォーカス状態を設定します。
|
| Void |
SetStateVisible(
Bool param
)
(SFYResponder から継承)
可視状態を設定します。
|
| Void |
SetVirtualBound(
SFXRectangleConstRef param
)
(SFYResponder から継承)
仮想領域を設定します。
|
| Void |
Terminate( Void )
(SFYResponder から継承)
レスポンダの終了処理をします。
|
| Void |
ToBack( Void )
(SFYResponder から継承)
ToBack( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) ToBack( UInt32 id ) (SFYResponder から継承) ToBack( Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) 自レスポンダを姉妹レスポンダのなかで最背面に移動します。
|
| Void |
ToFront( Void )
(SFYResponder から継承)
ToFront( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) ToFront( UInt32 id ) (SFYResponder から継承) ToFront( Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) 自レスポンダを姉妹レスポンダのなかで最前面に移動します。
|
| Void |
ToNthBackward(
SInt32 index
)
(SFYResponder から継承)
ToNthBackward( SInt32 index , UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) ToNthBackward( SInt32 index , UInt32 id ) (SFYResponder から継承) ToNthBackward( SInt32 index , Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) 自レスポンダを背面から数えて指定された順番に移動します。
|
| Void |
ToNthForward(
SInt32 index
)
(SFYResponder から継承)
ToNthForward( SInt32 index , UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) ToNthForward( SInt32 index , UInt32 id ) (SFYResponder から継承) ToNthForward( SInt32 index , Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) 自レスポンダを前面から数えて指定された順番に移動します。
|
| Void |
UnregisterHandler(
SFXEventRangeConstRef range
, SFYHandler::RuleRecConstRef rule
)
(SFYResponder から継承)
UnregisterHandler( SFXEventRangeConstPtr range , SFYHandler::HandlerSPPConstPtr spp , VoidPtrConstPtr reference , SInt32 length ) (SFYResponder から継承) UnregisterHandler( SFXEventRangeConstPtr range , SFYHandler::RuleRecConstPtr rule , SInt32 length ) (SFYResponder から継承) UnregisterHandler( SFXEventRangeConstRef range , SFYHandler::HandlerSPP spp , VoidPtr reference ) (SFYResponder から継承) ハンドラの登録を解除します。
|
| Void |
UnregisterTracer(
SFXEventRangeConstRef range
)
(SFYResponder から継承)
UnregisterTracer( SFXEventRangeConstPtr range , SInt32 length ) (SFYResponder から継承) トレーサの登録を解除します。
|
| T const & |
static_catch(
Void
)
(static_exception から継承)
現在保持している例外を取得します。
|
| プロテクト関数 | |
|---|---|
| Void |
HandleBoundOptimize(
SFXRectanglePtr rectangle
) 指定した矩形に収まる範囲内で最適なサイズを計算します。
|
| Void |
HandleBoundReal( Void ) 実領域が変化した時の処理です。
|
| Void |
HandleBoundRequest(
SFXRectanglePtr rectangle
) 最適な矩形を計算します。
|
| Void |
HandleBoundVirtual( Void ) 仮想領域の変更処理を行います。
|
| Void |
HandleRenderRequest(
SFXGraphicsPtr graphics
) レスポンダを描画します。
|
| static SFYResponderSmp |
Factory(
SFYResponderPtr responder
, SFCErrorPtr exception = null
)
(SFYResponder から継承)
NewInstance 関数の実装を補助します。
|
| SFYResponderSmp |
GetThis( Void )
(SFYResponder から継承)
スマートポインタで保持された this を取得します。
|
| Void |
HandleBoundGlobal(
SFXRectangleConstRef rectangle
)
(SFYWidget から継承)
グローバル領域の変更処理を行います。
|
| Void |
SetType(
SFCType param
)
(SFYResponder から継承)
タイプを設定します。
|
| Void |
static_throw(
static_exception< T > const & param
)
(static_exception から継承)
static_throw( T const & param ) (static_exception から継承) 例外を設定します。
|
| Bool |
static_try(
Void
)
(static_exception から継承)
例外が保持されているかどうかを確かめます。
|
| 型 |
|---|
|
CodeEnum SFZSoftKeyControl クラスを表す定数です。
|
|
KeyEnum 特別なキー値を表す定数です。
|
|
SoftkeyEnum ソフトキーを表す定数です。
|
|
StyleEnum SFZSoftKeyControl のスタイルを表す定数です。
|
[ protected, explicit ] SFZSoftKeyControl(Void);
[ protected, virtual ] virtual ~SFZSoftKeyControl(Void);
[ public ] SFCError Bind( SFYResponderPtr responder // バインドするレスポンダ UInt32 key // メニューのキー );
ソフトキーコントロールとレスポンダ、メニューキーを関連付けます。
Bind されたレスポンダがフォーカス状態になったときに、メニューキーに対応するソフトキーメニューが表示されます。
[ public, const ] Bool ContainsResponder( SFYResponderPtr responder // レスポンダ );
指定したメニューのキーに対応するソフトキーメニューを作成します。
キー値 INVALID_KEY (= UINT32_MAXIMUM) のメニューは作成できません。また、キー値 0 はデフォルトのソフトキーメニューとして使用されます。
指定のキーに対して既にメニューが作成されていた場合は、古いメニューは削除され新しく作成されます。
作成された直後は、すべてのラベルで有効状態となりキー値(テキスト、イメージ、カラー)はすべて 0 に設定されます。
指定したメニューのキーに対応するソフトキーメニューを削除します。
指定のメニューが存在しなかった場合は、何も起こりません。
[ public, const ] SInt16 GetArrowBaseLength(Void);
矢印の底辺の長さ。
矢印の底辺の長さを取得します。矢印の底辺とは、3角形を成す矢印に含まれる3辺の中で最も長い辺のことを指しています。
[ public, const ] SInt16 GetArrowHeight(Void);
矢印の高さ。
*** 解説 ***
[ public, const ] SFXRGBColorConstRef GetBackColor( UInt32 key // カラーキー(ユニークな識別子) );
カラーキーと関連付けられている背景色(方向キーの色)を取得します。
該当するキーが存在しない場合は、デフォルトカラーの背景色を返します。
初期状態では、キー値 0 のカラーはデフォルトのソフトキーメニューに参照されています。
SFZSoftKeyControl::RegisterBackColor | SFZSoftKeyControl::UnregisterColor | SFZSoftKeyControl::GetFrameColor | SFZSoftKeyControl::GetForeColor | SFZSoftKeyControl::GetText | SFZSoftKeyControl::GetImage
[ public, const ] SInt16 GetBaseSpace(Void);
基準のスペース値
ラベルを配置する基準となるソフトキーコントロールの境界線とラベル間のスペース値を取得します(ラベル同士の間隔もこの値になります)。
[ public, const ] UInt32 GetColorKey( UInt32 menuKey // メニューのキー(ユニークな識別子) SoftkeyEnum softNum // ラベル番号 );
取得したカラーキーを返します。
該当するメニューのキーやラベル番号がない場合、INVALID_KEY (= UINT32_MAXIMUM) が返されます。
メニューのキーとラベル番号を指定して、ラベルのカラーキーを取得します。
不正なメニューのキーやラベル番号を指定した場合は INVALID_KEY (= UINT32_MAXIMUM) が返されます。
[ public, const ] Bool GetEnable( UInt32 menuKey // メニューのキー(ユニークな識別子) SoftkeyEnum softNum // ラベル番号 );
メニューのキーとラベル番号を指定して、ラベルの状態を取得します。
ラベルは無効状態のとき描画されません。
不正なメニューのキーやラベル番号を指定した場合は false が返されます。
[ public, const ] AEEFont GetFont(Void);
[ public, const ] SFXRGBColorConstRef GetForeColor( UInt32 key // カラーキー(ユニークな識別子) );
カラーキーと関連付けられている前景色(テキストの色)を取得します。
該当するキーが存在しない場合は、デフォルトカラーの前景色を返します。
初期状態では、キー値 0 のカラーはデフォルトのソフトキーメニューに参照されています。
SFZSoftKeyControl::RegisterForeColor | SFZSoftKeyControl::UnregisterColor | SFZSoftKeyControl::GetFrameColor | SFZSoftKeyControl::GetBackColor | SFZSoftKeyControl::GetText | SFZSoftKeyControl::GetImage
[ public, const ] SFXRGBColorConstRef GetFrameColor( UInt32 key // カラーキー(ユニークな識別子) );
カラーキーと関連付けられているフレーム色を取得します。
該当するキーが存在しない場合は、デフォルトカラーのフレーム色を返します。
初期状態では、キー値 0 のカラーはデフォルトのソフトキーメニューに参照されています。
SFZSoftKeyControl::RegisterFrameColor | SFZSoftKeyControl::UnregisterColor | SFZSoftKeyControl::GetForeColor | SFZSoftKeyControl::GetBackColor | SFZSoftKeyControl::GetText | SFZSoftKeyControl::GetImage
[ public, const ] SFBImageSmpConstRef GetImage( UInt32 key // イメージのキー(ユニークな識別子) );
イメージのキーと関連付けられているイメージ SFBImageSmpConstRef を返します。
該当するキーが存在しない場合は、SFBImageSmp::EmptyInstance() が返されます。