カラー選択画面でエンバグしていたので修正。

誕生日選択画面タッチパッド対応準備

git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@207 b08762b0-b915-fc4b-9d8c-17b2551a87ff
This commit is contained in:
yoshida_teruhisa 2007-11-19 03:55:45 +00:00
parent 09f470a951
commit 9215521ecb
3 changed files with 106 additions and 12 deletions

View File

@ -29,11 +29,13 @@
#define CLIST_KEY_PER_SEGMENT 5
#define CLIST_SEGMENT_INTERVAL 7
// キャンセルボタン領域
#define CANCEL_BUTTON_TOP_X ( 2 * 8 )
#define CANCEL_BUTTON_TOP_Y ( 21 * 8 )
#define CANCEL_BUTTON_BOTTOM_X ( CANCEL_BUTTON_TOP_X + (8 * 8) )
#define CANCEL_BUTTON_BOTTOM_Y ( CANCEL_BUTTON_TOP_Y + (2 * 8) )
// OKボタン領域
#define OK_BUTTON_TOP_X ( 26 * 8 )
#define OK_BUTTON_TOP_Y ( 21 * 8 )
#define OK_BUTTON_BOTTOM_X ( OK_BUTTON_TOP_X + (4 * 8) )
@ -71,6 +73,9 @@ typedef enum NameOrComment
// extern data----------------------------------
extern u32 bg_char_data[16 * 3];
extern u16 bg_scr_data[32 * 32];
extern u16 bg_birth_scr_data[32 * 32];
// function's prototype-------------------------
static void SetNicknameInit( void );
@ -249,6 +254,10 @@ void SetOwnerInfoInit( void )
s_pStrSetting[ i ] = s_pStrSettingElemTbl[ i ][ TSD_GetLanguage() ];
}
// BGデータのロード処理
GX_LoadBG1Char(bg_char_data, 0, sizeof(bg_char_data));
GX_LoadBG1Scr(bg_scr_data, 0, sizeof(bg_scr_data));
DrawOwnerInfoMenuScene();
SVC_CpuClear( 0x0000, &tpd, sizeof(TpWork), 16 );
@ -598,17 +607,40 @@ static int SetNicknameMain( void )
return 0;
}
// 誕生日編集画面の表示
static void DrawSetBirthdayScene( void )
{
NNS_G2dCharCanvasClear( &gCanvas, TXT_COLOR_NULL );
PutStringUTF16( 0, 0, TXT_COLOR_BLUE, (const u16 *)L"BIRTHDAY" );
PutStringUTF16( CANCEL_BUTTON_TOP_X, CANCEL_BUTTON_TOP_Y, TXT_UCOLOR_G0, (const u16 *)L"<EFBFBD>CANCEL" );
PutStringUTF16( OK_BUTTON_TOP_X, OK_BUTTON_TOP_Y, TXT_UCOLOR_G0, (const u16 *)L"<EFBFBD>OK" );
PutStringUTF16( 128-36+16, 12*8, TXT_COLOR_BLACK, (const u16 *)L"月   日" );
PrintfSJIS( 128-36, 12*8, (s_birth_csr ? TXT_COLOR_GREEN : TXT_COLOR_BLACK), "%d", s_temp_birthday.month / 10);
PrintfSJIS( 128-28, 12*8, (s_birth_csr ? TXT_COLOR_GREEN : TXT_COLOR_BLACK), "%d", s_temp_birthday.month % 10);
PrintfSJIS( 128+12, 12*8, (!s_birth_csr ? TXT_COLOR_GREEN : TXT_COLOR_BLACK), "%d", s_temp_birthday.day / 10);
PrintfSJIS( 128+20, 12*8, (!s_birth_csr ? TXT_COLOR_GREEN : TXT_COLOR_BLACK), "%d", s_temp_birthday.day % 10);
PutStringUTF16( 128-36+16, 11*8, TXT_COLOR_BLACK, (const u16 *)L"月   日" );
PrintfSJIS( 128-36, 11*8, (s_birth_csr ? TXT_COLOR_GREEN : TXT_COLOR_BLACK), "%d", s_temp_birthday.month / 10);
PrintfSJIS( 128-28, 11*8, (s_birth_csr ? TXT_COLOR_GREEN : TXT_COLOR_BLACK), "%d", s_temp_birthday.month % 10);
PrintfSJIS( 128+12, 11*8, (!s_birth_csr ? TXT_COLOR_GREEN : TXT_COLOR_BLACK), "%d", s_temp_birthday.day / 10);
PrintfSJIS( 128+20, 11*8, (!s_birth_csr ? TXT_COLOR_GREEN : TXT_COLOR_BLACK), "%d", s_temp_birthday.day % 10);
}
// SetBirthdayMainのSelectSomethingByTPで使うSelectSomethingFuncの実装
static BOOL SelectBirthdayFunc( u16 *csr, TPData *tgt )
{
int l;
// 単純な実装例
// 有効範囲全部について押されたかどうかの確認
// 有効範囲の区分が多い時は、タッチパッドの座標から確認範囲を絞るのが望ましい
for(l=0; l<4; l++)
{
int x = 12*8 + (l%2)*6*8;
int y = 8*8 + (l/2)*6*8;
if(WithinRangeTP( x, y, 16, 16, tgt ))
{
*csr = (u16)l;
return TRUE;
}
}
return FALSE;
}
// 誕生日編集の初期化
@ -627,6 +659,10 @@ static void SetBirthdayInit( void )
s_pStrSetting[ i ] = s_pStrSettingElemTbl[ i ][ TSD_GetLanguage() ];
}
// BGデータのロード処理
GX_LoadBG1Char(bg_char_data, 0, sizeof(bg_char_data));
GX_LoadBG1Scr(bg_birth_scr_data, 0, sizeof(bg_birth_scr_data));
DrawSetBirthdayScene();
SVC_CpuClear( 0x0000, &tpd, sizeof(TpWork), 16 );
@ -640,7 +676,7 @@ static void SetBirthdayInit( void )
// 誕生日編集メイン
static int SetBirthdayMain( void )
{
SelectSomethingFunc func[2]={SelectCancelFunc, SelectOKFunc};
SelectSomethingFunc func[3]={SelectBirthdayFunc, SelectCancelFunc, SelectOKFunc};
u8 maxday;
BOOL tp_touch = FALSE;
@ -667,9 +703,9 @@ static int SetBirthdayMain( void )
if( s_temp_birthday.day > maxday ) s_temp_birthday.day = 1;
// TPチェック
tp_touch = SelectSomethingByTP(&tp_csr, func, 2 );
tp_touch = SelectSomethingByTP(&tp_csr, func, 3 );
if (tp_touch && (tp_csr != KEY_OK && tp_csr != KEY_CANCEL)){
//s_birth_csr = tp_csr;
// 月日変更処理
}
DrawSetBirthdayScene();
@ -789,7 +825,7 @@ static int SetUserColorMain( void )
// TPチェック
tp_touch = SelectSomethingByTP(&tp_csr, func, 3 );
if (tp_csr != KEY_OK && tp_csr != KEY_CANCEL){
if (tp_touch && (tp_csr != KEY_OK && tp_csr != KEY_CANCEL)){
s_color_csr = (u8)tp_csr;
}
@ -866,7 +902,7 @@ static int SetCommentMain( void )
}
//======================================================
// ニックネーム入力用キャラテーブル
// ソフトウェアキーボード用キャラテーブル
//======================================================
static const u16 char_tbl[CHAR_LIST_MODE_NUM][CHAR_LIST_CHAR_NUM] = {

View File

@ -8,8 +8,66 @@ u32 bg_char_data[16 * 3] = {
0xeeeeeeee, 0xeeeeeeee, 0xeeeeeeee, 0xeeeeeeee,
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,// 0003h
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,// 0004h右上
0xfffffff1, 0xfffffff1, 0xfffff11f, 0xfffff11f,
0xfff11fff, 0xfff11fff, 0xf11fffff, 0xf11fffff,// 0005h右下
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
};
// BGスクリーンデータ1
u16 bg_birth_scr_data[32 * 32]=
{
0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,//0
0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,
0x1002,0x1002,0x1002,0x1002,0x1002,0x1002,0x1002,0x1002,0x1002,0x1002,0x1002,0x1002,0x1002,0x1002,0x1002,0x1002,//1
0x1002,0x1002,0x1002,0x1002,0x1002,0x1002,0x1002,0x1002,0x1002,0x1002,0x1002,0x1002,0x1002,0x1002,0x1002,0x1002,
0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,//2
0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,
0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,//3
0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,
0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,//4
0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,
0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,//5
0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,
0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,//6
0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,
0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,//7
0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,
0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1404,0x1004,0x1003,0x1003,//8
0x1003,0x1003,0x1404,0x1004,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,
0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1405,0x1005,0x1003,0x1003,//9
0x1003,0x1003,0x1405,0x1005,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,
0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,//10
0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,
0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,//11
0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,
0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,//12
0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,
0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,//13
0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,
0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1c05,0x1805,0x1003,0x1003,//14
0x1003,0x1003,0x1c05,0x1805,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,
0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1c04,0x1804,0x1003,0x1003,//15
0x1003,0x1003,0x1c04,0x1804,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,
0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,//16
0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,
0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,//17
0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,
0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,//18
0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,
0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,//19
0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,
0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,//20
0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,
0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,//21
0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,0x1003,
0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,//22
0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,
0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,//23
0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,
};// Buffer for screen data(背景の枠)
// BGスクリーンデータ1
u16 bg_scr_data[32 * 32]=
{
@ -61,4 +119,4 @@ u16 bg_scr_data[32 * 32]=
0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,0x1802,
0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,//23
0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,0x1801,
};// Buffer for screen data(背景の枠)
};// Buffer for screen data(誕生日設定のBG)

View File

@ -523,7 +523,7 @@ void DrawMenu( u16 nowCsr, const MenuParam *pMenu )
}
// タッチパネルによる選択を行う関数・汎用版。
// 主にチャタリングを吸収する程度の能を持つ。
// 主にチャタリングを吸収する程度の能を持つ。
// SelectSomethingFunc型の関数ポインタfuncには、次に示す条件を満たす関数を作り、リストにしてセットして使う。
// 要素上でタッチしていればTRUEを返し、そうでなければFALSEを返す。
// 2.第一引数に与えたポインタの指す変数にカーソル位置を入れて返す。