Patch level :2.1 042

Files correlati     :ba0.exe,ba0close.exe
Ricompilazione Demo : [ ]
Commento            :
Bug 0000162
relativo alle visualizzazioni del menu.

Su ba0close cambiate alcune righe inutili.


git-svn-id: svn://10.65.10.50/trunk@12075 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
luca 2004-05-13 15:12:14 +00:00
parent 036922ec70
commit ba267e9546
3 changed files with 44 additions and 18 deletions

View File

@ -185,7 +185,7 @@ void TPicture_mask::update()
maxx = int(ratio * image.width());
maxy = int(ratio * image.height());
x = 1;
y = 1;
y = (client.bottom - maxy) / 2;
}
RCT dst;
@ -196,7 +196,8 @@ void TPicture_mask::update()
if (_logo != NULL)
{
const int lx = tree_view ? dst.right-_logo->width()-1 : x;
_logo->draw(win(), lx, y+maxy+1);
const int ly = ROWY;
_logo->draw(win(), lx, ly);
}
}
}
@ -260,9 +261,10 @@ TPicture_mask::TPicture_mask(const char* name, int dx, int dy,
const double ratio = rct.right / logo.width() / 2.0;
const int maxx = int(ratio * logo.width());
const int maxy = int(ratio * logo.height());
if (can_be_transparent(logo))
logo.convert_transparent_color(MASK_BACK_COLOR);
_logo = new TImage(logo, maxx, maxy);
if (can_be_transparent(*_logo))
_logo->convert_transparent_color(MASK_BACK_COLOR);
}
}
@ -654,7 +656,10 @@ int TMenu_application::do_level()
CHECK(_mask == NULL, "Two masks are better than one?");
_mask = &mask;
const int x = mask.columns() / 2;;
const int ampiezza = 51;
const int margin = (mask.columns()-80) / 2;
const int x = mask.columns() - ampiezza -margin;
int y = 1;
TString caption;
@ -672,15 +677,22 @@ int TMenu_application::do_level()
if (item.disabled())
mask.disable(id);
}
TEdit_field& ef = mask.add_string(DLG_USER, 0, PR("Cerca "), 1, -3, 50, "", 50);
mask.add_static(DLG_NULL, 0, PR("Cerca"), x, -4);
TEdit_field& ef = mask.add_string(DLG_USER, 0, "", x, -3, 50, "", ampiezza - 2);
ef.set_handler(menu_find_handler);
const bool top = _menu.at_top();
mask.add_button(DLG_QUIT, 0, PR("Fine"), -12, -1, bwidth, 2);
if (!top)
mask.add_button(DLG_CANCEL, 0, TR("Menu precedente"), -22, -1, bwidth, 2);
const int bottone = ampiezza / 3;
const int spazio = (ampiezza - bottone * 2) / 3;
const bool top = _menu.at_top();
mask.add_button(DLG_QUIT, 0, PR("Fine"), x + spazio, -1, bottone, 2);
if (!top)
mask.add_button(DLG_CANCEL, 0, PR("Menu precedente"), x + spazio * 2 + bottone, -1, bottone, 2);
mask.first_focus(101+_menu.selected());
const int k = mask.run();
@ -1686,16 +1698,21 @@ int TMenu_application::do_tree()
TTree_field& tree_fld = mask.add_tree(DLG_TREE, 0, 0, 0, twidth, -1);
tree_fld.set_tree(&tree);
tree_fld.set_handler(tree_handler);
mask.add_static(DLG_NULL, 0, PR("Cerca"), -2, 0);
const int inizio = twidth - margin + 2;
const int ampiezza = mask.columns() - inizio - margin;
const int bottone = ampiezza / 3;
const int spazio = (ampiezza - 2 * bottone) / 3;
mask.add_static(DLG_NULL, 0, PR("Cerca"), inizio + 2, -4);
TEdit_field& ef = mask.add_string(DLG_USER, 0, "", -2, 1, 50, "", bwidth);
TEdit_field& ef = mask.add_string(DLG_USER, 0, "", inizio + 2, -3, 50, "", ampiezza - 4);
ef.set_handler(tree_find_handler);
TButton_field& mf = mask.add_button(201, 0, PR("Menu Principale"), -1, 2, bwidth, 2);
TButton_field& mf = mask.add_button(201, 0, PR("Menu Principale"), inizio + spazio * 2 + bottone, -1, bottone, 2);
mf.set_handler(tree_shrink_handler);
mask.add_button(DLG_QUIT, 0, PR("Fine"), -56, -1, bwidth/2, 2);
mask.add_button(DLG_QUIT, 0, PR("Fine"), inizio + spazio, -1, bottone, 2);
mask.first_focus(DLG_TREE);
KEY key = mask.run();

View File

@ -36,7 +36,7 @@ struct TFind_node_data
struct TFind_string_data
{
TString _str;
TAssoc_array* _ignore_list;
TAssoc_array* _ignore_list;
};
HIDDEN bool find_string_callback(TTree& tree, void* jolly, word flags)
@ -554,10 +554,17 @@ void TMenulist_window::draw_menu_caption(COLOR rgb)
if (logo != NULL)
y -= logo->height();
}
xvt_dwin_set_font(win(), xvt_default_font(true));
XVT_FNTID font_menu = xvt_font_create();
xvt_font_copy(font_menu, xvt_default_font(true), XVT_FA_ALL);
const int size = xvt_font_get_size(font_menu);
xvt_font_set_size(font_menu, 130 * size / 100);
xvt_dwin_set_font(win(), font_menu);
set_color(rgb, NORMAL_BACK_COLOR);
xvt_dwin_draw_text(win(), x, y, caption, -1);
xvt_font_destroy(font_menu);
statbar_set_title(TASK_WIN, caption);
}

View File

@ -56,5 +56,7 @@ int PASCAL WinMain(HINSTANCE, HINSTANCE , LPSTR, int)
Renamer("*.??_");
Renamer("Servers\\*.??_");
WinExec("ba0.exe", SW_SHOWNORMAL);
return 0;
}