Patch level : 10.0

Files correlati     : ba0
Ricompilazione Demo : [ ]
Commento            :
Gestione nuove icone programmi nell'albero del menu


git-svn-id: svn://10.65.10.50/trunk@16071 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2008-01-31 16:37:24 +00:00
parent 814d9daefd
commit 5c26db5e28
2 changed files with 8 additions and 6 deletions

View File

@ -1549,7 +1549,7 @@ void TMenu_application::update_preferred_tree()
void TMenu_application::load_preferences() void TMenu_application::load_preferences()
{ {
TConfig cfg(CONFIG_GUI, "ba0"); TConfig cfg(CONFIG_GUI, "ba0");
_tree_view = cfg.get_int("TreeView"); _tree_view = cfg.get_int("TreeView", NULL, -1, 3);
_preferred.destroy(); _preferred.destroy();
TToken_string row; TToken_string row;
@ -1570,7 +1570,7 @@ void TMenu_application::load_preferences()
void TMenu_application::save_preferences() void TMenu_application::save_preferences()
{ {
TConfig cfg(CONFIG_GUI, "ba0"); TConfig cfg(CONFIG_GUI, "ba0");
int i; int i;
for (i = 0; i < _preferred.items(); i++) for (i = 0; i < _preferred.items(); i++)
cfg.set("Preferred", _preferred.row(i), NULL, true, i); cfg.set("Preferred", _preferred.row(i), NULL, true, i);
cfg.set("Preferred", "", NULL, true, i); cfg.set("Preferred", "", NULL, true, i);

View File

@ -219,7 +219,7 @@ bool TMenu_tree::goto_father()
const TString id = _curr_id.left(slash); const TString id = _curr_id.left(slash);
return goto_node(id); return goto_node(id);
} }
return FALSE; return false;
} }
bool TMenu_tree::goto_lbrother() bool TMenu_tree::goto_lbrother()
@ -229,9 +229,9 @@ bool TMenu_tree::goto_lbrother()
const int dot = _curr_id.rfind('.'); const int dot = _curr_id.rfind('.');
_curr_id.cut(dot+1); _curr_id.cut(dot+1);
_curr_id << (--_menuitem); _curr_id << (--_menuitem);
return TRUE; return true;
} }
return FALSE; return false;
} }
TObject* TMenu_tree::curr_node() const TObject* TMenu_tree::curr_node() const
@ -243,7 +243,7 @@ bool TMenu_tree::get_description(TString& desc) const
{ {
const TMenuitem& mi = curr_item(); const TMenuitem& mi = curr_item();
desc = mi.caption(); desc = mi.caption();
return desc.not_empty(); return desc.full();
} }
TImage* TMenu_tree::image(bool selected) const TImage* TMenu_tree::image(bool selected) const
@ -251,6 +251,8 @@ TImage* TMenu_tree::image(bool selected) const
const TMenuitem& mi = curr_item(); const TMenuitem& mi = curr_item();
if (mi.disabled()) if (mi.disabled())
return get_res_image(BMP_STOP); return get_res_image(BMP_STOP);
if (!mi.is_submenu())
return get_res_image(BMP_PROGRAM);
return TTree::image(selected); return TTree::image(selected);
} }