Corretta ricolorazione in seguito a cambio studio e/o utente

git-svn-id: svn://10.65.10.50/trunk@5806 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1997-12-30 09:53:44 +00:00
parent a9f6202682
commit eaa1387389

View File

@ -1,7 +1,7 @@
#define STRICT
#define XVT_INCL_NATIVE
#include <xi.h>
#include <xinclude.h>
#include <applicat.h>
#include <colors.h>
@ -68,11 +68,6 @@ void TPicture_mask::update()
if (xvt_dwin_is_update_needed(win(), &dst))
_image.draw(win(), dst);
xvt_vobj_get_client_rect(win(), &cli);
cli.bottom--;
cli.right--;
xvt_draw_rect(win(), cli, MASK_LIGHT_COLOR, MASK_DARK_COLOR, 1);
}
}
@ -134,7 +129,11 @@ PNT TColor_mask::log2dev(long x, long y) const
PNT p = { int(y * XI_FU_MULTIPLE), int(x * XI_FU_MULTIPLE) };
XI_OBJ* itf = xi_get_itf(win());
#ifdef XI_R4
xi_fu_to_pu(itf, (XinPoint*)&p, 1);
#else
xi_fu_to_pu(itf, &p, 1);
#endif
p.v = int(y * ROWY);
p.h += XI_FU_MULTIPLE / 2;
@ -224,7 +223,7 @@ void TColor_mask::set_color_entry(const char* name, COLOR col)
TString* s = (TString*)_color.objptr(name);
if (s == NULL)
{
s = new TString(16);
s = new TString(15);
_color.add(name, s);
}
s->format("%d,%d,%d", XVT_COLOR_GET_RED(col), XVT_COLOR_GET_GREEN(col), XVT_COLOR_GET_BLUE(col));
@ -797,7 +796,8 @@ bool TMenu::jumpto(TSubmenu* next)
if (next->query_firm())
{
#ifdef _DEMO_
main_app().set_firm(1);
if (!main_app().set_firm(1))
next = NULL;
#else
if (!main_app().set_firm())
next = NULL;
@ -876,7 +876,8 @@ TImage& TMenu::image(const char* name)
else
image = (TImage*)_images.objptr("ba00.bmp");
}
CHECK(image, "No images");
if (image == NULL)
fatal_box("Impossibile trovare l'immagine ba00.bmp");
return *image;
}
@ -1127,6 +1128,7 @@ int TMenu_application::do_level()
TImage& image = _menu.image(curr.picture());
TPicture_mask mask(curr.caption(), width, height, image);
CHECK(_mask == NULL, "Two masks are better than one?");
_mask = &mask;
const int x = width / 2;
@ -1332,6 +1334,7 @@ bool TMenu_application::check_user()
enable_menu_item(M_FONT);
customize_colors(); // Aggiorna set di colori
reload_images(); // Ritrasparentizza immagini
xvt_dwin_invalidate_rect(TASK_WIN, NULL); // Ridisegna sfondo
}
}
@ -1351,7 +1354,7 @@ bool TMenu_application::create()
#ifdef _DEMO_
{
TMask w("Attenzione", 1, 80, 14);
TMask w("Attenzione", 1, 78, 14);
w.add_static(DLG_NULL, 0 ,"@bAttenzione" , 35 , 1);
w.add_static(DLG_NULL, 0 ,"@bQuesto programma e' in versione dimostrativa." , 1 , 3);
@ -1559,12 +1562,14 @@ bool TMenu_application::choose_study()
m.set(DLG_USER, prefix().get_studio());
bool ok = m.run() == K_ENTER;
if (ok)
{
{
destroy();
prefix().set_studio(m.get(DLG_USER));
ok = create();
if (!ok)
stop_run();
if (ok)
_mask->stop_run(K_F9); // Ricarica maschera
else
stop_run(); // Termina applicazione
}
return ok;
}