diff options
| author | bernard.xiong <[email protected]> | 2010-05-15 14:36:02 +0000 |
|---|---|---|
| committer | bernard.xiong <[email protected]> | 2010-05-15 14:36:02 +0000 |
| commit | 3f319a875c675b9ffef093312de8204247f09d59 (patch) | |
| tree | d4fba5d0d49f7921617e4542c99aa721e63fd82f /components/rtgui/common | |
| parent | 3f33f036ece9d33a35aa41a7b9e09c10a47e9d5a (diff) | |
add icon display mode in listview.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@710 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'components/rtgui/common')
| -rw-r--r-- | components/rtgui/common/font_hz_bmp.c | 5 | ||||
| -rw-r--r-- | components/rtgui/common/font_hz_file.c | 3 | ||||
| -rw-r--r-- | components/rtgui/common/rtgui_system.c | 8 |
3 files changed, 13 insertions, 3 deletions
diff --git a/components/rtgui/common/font_hz_bmp.c b/components/rtgui/common/font_hz_bmp.c index 1190cb473c..5e025e0b78 100644 --- a/components/rtgui/common/font_hz_bmp.c +++ b/components/rtgui/common/font_hz_bmp.c @@ -16,7 +16,7 @@ struct rtgui_font_engine hz_bmp_font_engine = static void rtgui_hz_bitmap_font_draw_text(struct rtgui_font* font, struct rtgui_dc* dc, const char* text, rt_ubase_t len, struct rtgui_rect* rect) { - rt_base_t h; + register rt_base_t h, word_bytes; rt_uint8_t* str; struct rtgui_font_bitmap* bmp_font = (struct rtgui_font_bitmap*)(font->data); @@ -24,6 +24,7 @@ static void rtgui_hz_bitmap_font_draw_text(struct rtgui_font* font, struct rtgui /* drawing height */ h = (bmp_font->height + rect->y1 > rect->y2)? rect->y2 - rect->y1 : bmp_font->height; + word_bytes = (bmp_font->width + 7)/8; str = (rt_uint8_t*)text; @@ -43,7 +44,7 @@ static void rtgui_hz_bitmap_font_draw_text(struct rtgui_font* font, struct rtgui /* draw word */ for (i=0; i < h; i ++) { - for (j=0; j < 2; j++) + for (j=0; j < word_bytes; j++) for (k=0; k < 8; k++) { if ( ((font_ptr[i*2 + j] >> (7-k)) & 0x01) != 0 && diff --git a/components/rtgui/common/font_hz_file.c b/components/rtgui/common/font_hz_file.c index e76439b55a..9a4b6380cb 100644 --- a/components/rtgui/common/font_hz_file.c +++ b/components/rtgui/common/font_hz_file.c @@ -93,7 +93,7 @@ static void rtgui_hz_file_font_load(struct rtgui_font* font) static void rtgui_hz_file_font_draw_text(struct rtgui_font* font, struct rtgui_dc* dc, const char* text, rt_ubase_t len, struct rtgui_rect* rect) { - rt_base_t h; + register rt_base_t h, word_bytes; rt_uint8_t* str; struct rtgui_hz_file_font* hz_file_font = (struct rtgui_hz_file_font*)font->data; RT_ASSERT(hz_file_font != RT_NULL); @@ -101,6 +101,7 @@ static void rtgui_hz_file_font_draw_text(struct rtgui_font* font, struct rtgui_d /* drawing height */ h = (hz_file_font->font_size + rect->y1 > rect->y2)? rect->y2 - rect->y1 : hz_file_font->font_size; + word_bytes = (hz_file_font->font_size + 7) / 8; str = (rt_uint8_t*)text; diff --git a/components/rtgui/common/rtgui_system.c b/components/rtgui/common/rtgui_system.c index 55cecf8bb3..dc5df0c1f2 100644 --- a/components/rtgui/common/rtgui_system.c +++ b/components/rtgui/common/rtgui_system.c @@ -125,6 +125,14 @@ static void rtgui_event_dump(rt_thread_t tid, rtgui_event_t* event) } break; + case RTGUI_EVENT_KBD: + { + struct rtgui_event_kbd *ekbd = (struct rtgui_event_kbd*) event; + if (ekbd->wid != RT_NULL) + rt_kprintf("win: %s", ekbd->wid->title); + } + break; + case RTGUI_EVENT_CLIP_INFO: { struct rtgui_event_clip_info *info = (struct rtgui_event_clip_info *)event; |
