Patch level : 10.0

Files correlati     : ba0.exe
Ricompilazione Demo : [ ]
Commento            :
Corretto errore 0000916: file logo
Se nella custom si mette un'immagine di nome logo questa appare anche sulla mappa del menu non outlook sostituendo Sirio.


git-svn-id: svn://10.65.10.50/trunk@17459 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2008-10-23 13:11:15 +00:00
parent 4ca44a0c36
commit c88808ff25
4 changed files with 24 additions and 17 deletions

View File

@ -257,20 +257,16 @@ TPicture_mask::TPicture_mask(const char* name, int dx, int dy,
: TMask(name, 1, dx, dy, x, y), _submenu(NULL), _logo(NULL)
{
set_current(submenu);
TFilename logoname;
const char* const ext[] = { "jpg", "png", "gif", "bmp", "jpeg", NULL };
for (int i = 0; ext[i]; i++)
_logo = new TImage("menulogo");
if (_logo->ok())
{
logoname = "logo"; logoname.ext(ext[i]);
if (logoname.custom_path())
break;
if (can_be_transparent(*_logo))
_logo->convert_transparent_color(MASK_BACK_COLOR);
}
TImage logo(logoname);
if (logo.ok())
else
{
if (can_be_transparent(logo))
logo.convert_transparent_color(MASK_BACK_COLOR);
_logo = new TImage(logo);
delete _logo;
_logo = NULL;
}
}

View File

@ -29,6 +29,11 @@ const TMenuitem& TMenu_tree::curr_item() const
return sm.item(_menuitem);
}
bool TMenu_tree::enabled() const
{
return curr_item().enabled();
}
struct TFind_node_data
{
TString _id;
@ -389,7 +394,7 @@ TObject* TMenulist_images::key2obj(const char* key)
const double max_img = (double)_max_side;
const double max_lgo = rct.right - _max_side;
if (strcmp(key,"logo") != 0)
if (strcmp(key,"menulogo") != 0)
{
const double ratiox = max_img / image.width();
const double ratioy = max_img / image.height();
@ -441,7 +446,7 @@ TImage* TMenulist_images::image(const char* name)
TObject* obj = objptr(name);
if (obj == NULL &&
xvt_str_compare_ignoring_case(name, "ba00") != 0 &&
xvt_str_compare_ignoring_case(name, "logo") != 0)
xvt_str_compare_ignoring_case(name, "menulogo") != 0)
obj = objptr("ba00");
return (TImage*)obj;
}
@ -592,7 +597,7 @@ void TMenulist_window::update()
img->draw(win(), x, y);
}
TImage* logo = db ? _images.image("logo") : NULL; //logo del programma
TImage* logo = db ? _images.image("menulogo") : NULL; //logo del programma
if (logo != NULL) //disegna il logo
{
RCT rct; xvt_vobj_get_client_rect(win(), &rct);

View File

@ -46,6 +46,7 @@ public: // TTree
virtual void curr_id(TString& id) const { id = _curr_id; }
virtual bool get_description(TString& desc) const;
virtual TImage* image(bool selected) const;
virtual bool enabled() const;
public:
const TSubmenu& curr_submenu() const;

View File

@ -271,7 +271,7 @@ void TBook_window::erode_antipa()
TBook_window::TBook_window(int x, int y, int dx, int dy,
WINDOW parent, TWindowed_field* owner)
: TControl_host_window(x, y, dx, dy, parent, owner), _logo("logo.gif")
: TControl_host_window(x, y, dx, dy, parent, owner), _logo("menulogo")
{
if (_logo.ok() && can_be_transparent(_logo))
_logo.convert_transparent_color(NORMAL_BACK_COLOR);
@ -425,6 +425,7 @@ void TOutlook_mask::handler(WINDOW w, EVENT* ep)
_tree.shrink_all();
tf.win().force_update(); // Provoca la rigenerazione dell'albero collassato
tf.on_key(K_SPACE);
set(DLG_LOOK, -1); // Deseleziona
}
break;
case 8002:
@ -524,11 +525,15 @@ bool TOutlook_mask::on_field_event(TOperable_field& o, TField_event e, long joll
case DLG_LOOK:
if (e == fe_modify)
{
const int sel = atoi(o.get());
TToken_string id("MENU_000", '/');
_tree.change_root(id); // Torna alla radice standard
const int sel = atoi(o.get());
for (int i = 0; i < sel; i++)
_tree.goto_rbrother(); // Seglie l'opportuno ramo principale
{
do
_tree.goto_rbrother(); // Sceglie l'opportuno ramo principale
while (!_tree.enabled());
}
_tree.goto_firstson();
_tree.curr_id(id);
_tree.change_root(id.get(1)); // Imposta una nuova radice