mirror of
https://github.com/siemens-mobile-hacks/sieelf.git
synced 2026-11-25 22:27:29 +00:00
NEWSGOLD采用了和SGOLD不一样的短信系统,避免版本错乱,直接跳到1.8-_- +*使用多行菜单来显示多号码选择菜单中的区号秀,消灭以前版本在这个功能上的一系列麻烦事.:) 将elka的HOOK部分从main.asm中独立出来作为entry_elka.asm,目前main.asm有点乱了,如果可以的话,把newsgold/sgold都独立出来吧 将函数部分也独立出来作为func.asm 改写了elka的HOOK部分代码,去掉所有中间跳转.
51 lines
1.1 KiB
C
51 lines
1.1 KiB
C
/*********************************************
|
|
区号秀号码选择菜单部分(新), 1.8以后版本使用
|
|
作者: BingK(binghelingxi)
|
|
最后修改: 2008.08.07
|
|
简述:
|
|
改用多行菜单.
|
|
***********************************************/
|
|
|
|
#include "type_.h"
|
|
extern WSTRING *AllocMenuWS(void *gui, int len);
|
|
extern void AppendInfoW(WSTRING *pWS, WSTRING * pNo);
|
|
extern void SetMLMenuItemText(void *data,void *item,WSTRING *ws1,WSTRING *ws2,int n);
|
|
void setMenuText(void *gui, void *item, WSTRING *text,int item_n)
|
|
{
|
|
unsigned short *p=text->pstr+1;
|
|
int wslen=text->pstr[0];
|
|
int i=0;
|
|
int is_num=1;
|
|
WSTRING *ws2=AllocMenuWS(gui, 24);
|
|
if(*p=='+')
|
|
p+=3;
|
|
for(;i<wslen;i++) //检查是否是号码
|
|
{
|
|
if(p[i]>'9'||p[i]<'0')
|
|
{
|
|
is_num=0;
|
|
break;
|
|
}
|
|
}
|
|
if(is_num)
|
|
{
|
|
#define N 4 //空格数
|
|
unsigned short *p2;
|
|
AppendInfoW(ws2, text);
|
|
//前面加N个空格
|
|
wslen=ws2->pstr[0];
|
|
p=ws2->pstr+1;
|
|
p2=p+wslen-1;
|
|
for(i=0;i<wslen;i++) //后移
|
|
{
|
|
*(p2-i+N)=*(p2-i);
|
|
}
|
|
for(i=0;i<N;i++) //加空格
|
|
{
|
|
p[i]=' ';
|
|
}
|
|
ws2->pstr[0]=wslen+N;
|
|
}
|
|
SetMLMenuItemText(gui, item, text, ws2, item_n);
|
|
}
|
|
|