Patch level :4.0 / 10.0

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :sistemato problema ingresso in menu


git-svn-id: svn://10.65.10.50/trunk@16397 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
luca 2008-03-27 15:41:11 +00:00
parent 30b4f2eacc
commit 302d045484
3 changed files with 18 additions and 6 deletions

View File

@ -156,7 +156,7 @@ void TPicture_mask::update()
RCT rctree; field(DLG_TREE).get_rect(rctree);
const int maxx = client.right - rctree.right - 2 * CHARX;
const int maxy = client.bottom - 8 * ROWY;
const int maxy = client.bottom - 10 * ROWY;
const double ratiox = double(maxx) / image.width();
const double ratioy = double(maxy) / image.height();
@ -166,7 +166,7 @@ void TPicture_mask::update()
imgy = int(ratio * image.height());
x = client.right - maxx - 4;
y = (client.bottom - maxy) / 2;
y = client.bottom - maxy;
//stabilisce la dimensione del logo
if (_logo != NULL)
@ -194,7 +194,7 @@ void TPicture_mask::update()
imgx = int(ratio * image.width());
imgy = int(ratio * image.height());
x = 1;
y = (client.bottom - maxy) / 2;
y = client.bottom - imgy - 1;
//stabilisce la dimensione del logo
if (_logo != NULL)
@ -612,7 +612,8 @@ int TMenu_application::do_level()
const TSubmenu& curr = _menu.current();
const int bwidth = 20;
TPicture_mask mask(curr.caption(), -4, -4, curr);
//TPicture_mask mask(curr.caption(), -4, -4, curr);
TPicture_mask mask(curr.caption(), 0, 0, curr, 0, 0);
CHECK(_mask == NULL, "Two masks are better than one?");
_mask = &mask;

View File

@ -279,9 +279,16 @@ TMenu_tree::TMenu_tree(TMenu& menu)
// Utility
///////////////////////////////////////////////////////////
//flag per impedire un doppio aggiornamento causato adall'autofocus del primo elemento dell'albero
//senza questo flag entra automaticamente nella prima voce di menu, un livello sotto a quello..
//..richiesto dall'utente
static bool _sincronaising = false;
// Sincronizza l'albero in basa alla list view
void synchronize_tree_field(TTree_field& tf)
{
_sincronaising = true;
TTree& mt = *tf.tree();
TString id; mt.curr_id(id); // Memorizza nodo corrente
mt.shrink_all(); // Collassa tutto l'albero
@ -291,6 +298,8 @@ void synchronize_tree_field(TTree_field& tf)
mt.goto_node(id); // Torna al nodo corrente
tf.win().force_update(); // Provoca la rigenerazione dell'albero espanso come sopra
_sincronaising = false;
}
bool can_be_transparent(const TImage& i)
@ -1153,6 +1162,7 @@ void TExplorer_mask::on_idle()
}
}
void TExplorer_mask::select_tree_current()
{
TTree_field& tf = tfield(DLG_TREE);
@ -1168,7 +1178,7 @@ bool TExplorer_mask::on_field_event(TOperable_field& o, TField_event e, long jol
switch(o.dlg())
{
case DLG_TREE:
if (e == fe_modify)
if (e == fe_modify && !_sincronaising)
{
TTree_field& tf = (TTree_field&)o;
TMenu_tree& mt = *(TMenu_tree*)tf.tree();

View File

@ -60,10 +60,11 @@ TField_event TAutomask::key2event(TMask_field& f, KEY key) const
case K_SPACE:
if (!f.is_edit())
{
const TMask& wm = f.mask();
if (f.is_kind_of(CLASS_BUTTON_FIELD))
fe = fe_button; else
if (f.is_kind_of(CLASS_TREE_FIELD))
fe = fe_modify;
fe = wm.is_running() ? fe_modify : fe_init;
else
fe = f.focusdirty() ? fe_modify : fe_init;
}