Patch level : 10.0 196

Files correlati     : ba0.exe
Ricompilazione Demo : [ ]
Commento            :
0001080: menu preferiti
il menu preferiti non viene visualizzato in caso non ci siano preferiti, dal momento in cui ne aggiungo uno, il menu viene visualizzato solo al successivo collegamento.


git-svn-id: svn://10.65.10.50/trunk@17928 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2008-12-17 11:43:17 +00:00
parent 883b0df1a1
commit c6753414df
5 changed files with 44 additions and 43 deletions

View File

@ -1802,7 +1802,7 @@ void TMenu_application::update_preferred()
void TMenu_application::update_preferred_tree()
{
TSubmenu* pref = _menu.find("MENU_PREFERITI");
if (pref != NULL && _preferred.items() > 0)
if (pref != NULL)
{
TToken_string node(16, '.');
pref->destroy_items();
@ -1823,7 +1823,14 @@ void TMenu_application::update_preferred_tree()
pref->add(new TMenuitem(sm->item(num)));
}
}
}
}
if (_tree_view == 3 && _mask != NULL)
{
TMask_field& ol = _mask->field(102);
ol.set_focusdirty(false);
ol.on_hit(); // fe_init
}
}
}
@ -1892,7 +1899,7 @@ void TMenu_application::add_to_preferred()
}
break;
}
if (tok.full() && _preferred.find(tok) < 0)
if (tok.full() && tok.find("MENU_PREFERITI")<0 && _preferred.find(tok)<0)
{
_preferred.add(tok);
save_preferences();

View File

@ -663,29 +663,13 @@ bool TMenu::perform()
return ok;
}
//setta la trasparenza alle immagini con i 4 corner-pixel di colore uguale
/* bool TMenu::can_be_transparent(const TImage& i) const
{
const int w = i.width()-1;
const int h = i.height()-1;
const COLOR col = i.get_pixel(0,0);
if (i.get_pixel(w,0) != col)
return false;
if (i.get_pixel(w,h) != col)
return false;
if (i.get_pixel(0,h) != col)
return false;
return true;
}
*/
TImage& TMenu::image(const char* name)
{
TTimed_image* img = (TTimed_image*)_images.objptr(name);
if (img == NULL)
{
TFilename realname;
const char* ext[] = { "jpg", "gif", "bmp", "png", NULL };
const char* ext[] = { "png", "gif", "jpg", "bmp", NULL };
bool bFound = false;
for (int i = 0; ext[i] && !bFound; i++)
{

View File

@ -155,10 +155,10 @@ bool TMenu_tree::goto_firstson()
_curr_id << '/' << mi.action() << ".0";
_submenu = sm;
_menuitem = 0;
return TRUE;
return true;
}
}
return FALSE;
return false;
}
bool TMenu_tree::goto_rbrother()
@ -168,9 +168,9 @@ bool TMenu_tree::goto_rbrother()
const int dot = _curr_id.rfind('.');
_curr_id.cut(dot+1);
_curr_id << (++_menuitem);
return TRUE;
return true;
}
return FALSE;
return false;
}
bool TMenu_tree::goto_node(const TString &id)

View File

@ -1,5 +1,6 @@
#include "ba0103.h"
#include <applicat.h>
#include <config.h>
#include <controls.h>
#include <defmask.h>
@ -560,6 +561,33 @@ bool TOutlook_mask::on_field_event(TOperable_field& o, TField_event e, long joll
tf.win().force_update();
tf.on_key(K_SPACE);
}
main_app().enable_menu_item(30005, id.find("MENU_PREFERITI") < 0);
} else
if (e == fe_init)
{
TOutlook_field& of = (TOutlook_field&)o;
of.clear();
TString caption;
int i = 0;
int ico = 10219;
of.add_item(ico, TR("Menu principale"), 0);
_icon[i++] = ico;
TToken_string id("MENU_000", '/');
_tree.change_root(id); // Torna alla radice standard
for (bool ok = _tree.goto_root(); ok; ok = _tree.goto_rbrother())
{
const TMenuitem& mi = _tree.curr_item();
if (mi.enabled())
{
_tree.get_description(caption);
const int ico = mi.icon();
of.add_item(ico, caption, 0);
_icon[i++] = ico; // Memorizza icona per orecchie
}
}
if (atoi(of.get()) >= of.items()-1) // Se sono sui preferiti ...
set(o.dlg(), "", true); // ... torna al menu principale
}
break;
default: break;
@ -605,24 +633,6 @@ TOutlook_mask::TOutlook_mask(TMenu& menu) : _tree(menu), _locked(false)
cf->create(DLG_MAIN, w, 0, 0, 0, panel);
add_field(cf);
TString caption;
int i = 0;
int ico = 10219;
of->add_item(ico, TR("Menu principale"), 0);
_icon[i++] = ico;
for (bool ok = _tree.goto_root(); ok; ok = _tree.goto_rbrother())
{
const TMenuitem& mi = _tree.curr_item();
if (mi.enabled())
{
_tree.get_description(caption);
const int ico = mi.icon();
of->add_item(ico, caption, 0);
_icon[i++] = ico; // Memorizza icona per orecchie
}
}
xvt_pane_add(panel, dlg2win(DLG_TREE), "Menu", 1, 0); // Left upper pane
xvt_pane_add(panel, dlg2win(DLG_LOOK), "Aree", 1, 0); // Left lower pane
xvt_pane_add(panel, dlg2win(DLG_MAIN), "Main", 0, 0); // Main pane

View File

@ -8,7 +8,6 @@ Item_02 = "Amministrazione", <cgarea.men>, "", 10212
Item_03 = "Acquisti e vendite", <vearea.men>, "", 10211
Item_04 = "Magazzino e Produzione", <mgarea.men>, "", 10215
Item_05 = "Gestione Lavanderie", <lvmenu.men>, "", 10220
Item_05 = "Query e Report", [MENU_014], "", 10217
Item_06 = "Manutenzione", [MENU_015], "", 10210
Item_07 = "Preferiti", [MENU_PREFERITI], "", 10216
@ -113,6 +112,7 @@ Item_06 = "Creazione dischi di installazione", "ba1 -5", ""
Item_07 = "Backup", "ba2 -1", "", 10213
Item_08 = "Procedure speciali", [MENU_016]
Item_09 = "Gestione dizionario", "ba2 -6", ""
Item_10 = "Query e Report", [MENU_014], "", 10217
[MENU_016]
Caption = "Procedure speciali"