fix view and workbench destroy issue.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@941 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
bernard.xiong@gmail.com 2010-09-24 04:31:20 +00:00
parent 2ef68fcee8
commit c217605bef
4 changed files with 10 additions and 2 deletions

View File

@ -6,7 +6,7 @@
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); 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);
static void rtgui_hz_bitmap_font_get_metrics(struct rtgui_font* font, const char* text, rtgui_rect_t* rect); static void rtgui_hz_bitmap_font_get_metrics(struct rtgui_font* font, const char* text, rtgui_rect_t* rect);
struct rtgui_font_engine hz_bmp_font_engine = const struct rtgui_font_engine hz_bmp_font_engine =
{ {
RT_NULL, RT_NULL,
RT_NULL, RT_NULL,

View File

@ -15,7 +15,7 @@ static int _font_cache_compare(struct hz_cache* node1, struct hz_cache* node2);
static void rtgui_hz_file_font_load(struct rtgui_font* font); 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); 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);
static void rtgui_hz_file_font_get_metrics(struct rtgui_font* font, const char* text, rtgui_rect_t* rect); static void rtgui_hz_file_font_get_metrics(struct rtgui_font* font, const char* text, rtgui_rect_t* rect);
struct rtgui_font_engine rtgui_hz_file_font_engine = const struct rtgui_font_engine rtgui_hz_file_font_engine =
{ {
RT_NULL, RT_NULL,
rtgui_hz_file_font_load, rtgui_hz_file_font_load,

View File

@ -10,6 +10,7 @@
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes
* 2009-10-16 Bernard first version * 2009-10-16 Bernard first version
* 2010-09-24 Bernard fix view destroy issue
*/ */
#include <rtgui/dc.h> #include <rtgui/dc.h>
#include <rtgui/rtgui_system.h> #include <rtgui/rtgui_system.h>
@ -119,8 +120,11 @@ void rtgui_view_destroy(rtgui_view_t* view)
if (view->modal_show == RT_TRUE) if (view->modal_show == RT_TRUE)
rtgui_view_end_modal(view, RTGUI_MODAL_CANCEL); rtgui_view_end_modal(view, RTGUI_MODAL_CANCEL);
else else
{
rtgui_view_hide(view);
rtgui_widget_destroy(RTGUI_WIDGET(view)); rtgui_widget_destroy(RTGUI_WIDGET(view));
} }
}
#ifndef RTGUI_USING_SMALL_SIZE #ifndef RTGUI_USING_SMALL_SIZE
void rtgui_view_set_box(rtgui_view_t* view, rtgui_box_t* box) void rtgui_view_set_box(rtgui_view_t* view, rtgui_box_t* box)

View File

@ -10,6 +10,7 @@
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes
* 2009-10-04 Bernard first version * 2009-10-04 Bernard first version
* 2010-09-24 Bernard fix workbench destroy issue
*/ */
#include <rtgui/rtgui_system.h> #include <rtgui/rtgui_system.h>
#include <rtgui/widgets/window.h> #include <rtgui/widgets/window.h>
@ -134,6 +135,9 @@ void rtgui_workbench_destroy(rtgui_workbench_t* workbench)
{ {
RT_ASSERT(workbench != RT_NULL); RT_ASSERT(workbench != RT_NULL);
/* hide workbench firstly */
rtgui_workbench_hide(workbench);
if (RTGUI_TOPLEVEL(workbench)->server != RT_NULL) if (RTGUI_TOPLEVEL(workbench)->server != RT_NULL)
{ {
struct rtgui_event_panel_detach edetach; struct rtgui_event_panel_detach edetach;