- # -*- coding: utf-8 -*-
- import appuifw
- appuifw.note("你好".decode("utf8"), "info")
Monthly Archives: April 2006
更换S60 SDK Emulator的skin(更正)
“更换S60 SDK Emulator的skin”里我写到要是能动态更换Skin就好了,其实Emulator已经有这个功能了,就是它的System菜单下的Next Config项。不同的配置由epoc.ini中的configuration关键字指定。比如我现在的epoc.ini的内容是这样的:
configuration epoc_NGage.ini
现在,点击Next Config…,就可以切换6630和NGage这两个Skin了。
bmconv的使用
用Carbide可以编辑一个mbmdef文件,加入要使用的bmp文件,make时会根据这个mbmdef文件生成mbm文件。不过,Carbide不会生成需要的mbg头文件。我用bmconv工具来创建mbg文件:
可以把bmconv命令设为Pre-build step。
Drawing text on screen
来自SDK中文档Developer Guides >> Programming Games in C++
要加入gdi.h这个头文件,否则编译时会报错unresolved external symbol TFontSpec
同时还要修改mmp文件,加入LIBRARY gdi.lib。我用的IDE是Carbide c++ Express,新建的Project没有生成mmp文件,需要修改Project的build配置,把gdi.lib加到Linker的Libraries列表中。
格式化文本用TBuf::Format()
- // Get smallest possible arial font
- _LIT(KMyFontName,"Arial");
- CFont* myFont;
- TFontSpec myFontSpec(KMyFontName, TInt(1));
- CGraphicsDevice* screenDevice = iCoeEnv->ScreenDevice();
- screenDevice->GetNearestFontInTwips(myFont,myFontSpec);
- // Use new font
- gc.UseFont(myFont);
- // Get the width and height of screen
- TInt width = aRect.Width();
- TInt height = aRect.Height();
- // Draw a formated text
- TBuf<32> text;
- _LIT(KMyText, "width=%d, height=%d");
- text.Format(KMyText, width, height);
- gc.DrawText(text, TPoint(10, height) );
- // Discard and release the font
- gc.DiscardFont();
- screenDevice->ReleaseFont(myFont);
用Eclipse远程调试(Remote debug)Tomcat
1. 配置Tomcat支持remote debugging
给JVM加上如下的启动参数:
-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
2. Eclipse里新建一个Remote Java Applications的debug
“Run->Debug…”, then “Remote Java Applications”, “New”,port添8000。
适合不想或没必要用任何插件的情形。
Ref: http://tomcat.apache.org/faq/development.html#rd-eclipse