Patch level :2.0 aga nopatch

Files correlati     :libs
Ricompilazione Demo : [ ]
Commento            :sistemato il bottone pentapartito


git-svn-id: svn://10.65.10.50/trunk@10835 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
luca 2003-02-21 11:46:14 +00:00
parent 723d587c66
commit 9fe90a1062

View File

@ -129,50 +129,49 @@ void TRelation_application::set_limits(
void TRelation_application::set_find_button() void TRelation_application::set_find_button()
{ {
int pos = _mask->id2pos(DLG_FINDREC); int pos = _mask->id2pos(DLG_FINDREC);
if (pos >= 0) if (pos >= 0 && _mask->id2pos(DLG_FIRSTREC)) //se e' un bottone pentapartito...
{ {
TButton_field& f_find = (TButton_field &)_mask->fld(pos);
RCT rct_base, r; RCT rct_base, r;
TButton_field & f_find = (TButton_field &)_mask->fld(pos);
TString16 p(f_find.prompt());
if (p == "~c.")
return;
f_find.get_rect(rct_base); f_find.get_rect(rct_base);
const int bwidth = (rct_base.right - rct_base.left);
const int bheight = (rct_base.bottom - rct_base.top);
if (bwidth > 3*bheight/2) // Controllo se ho gia' ridimensionato i bottoni in precedenza
{
int bx = bwidth / 3;
int by = bheight / 2;
int bx = (rct_base.right - rct_base.left) / 3; r = rct_base; r.left += bx; r.right -= bx;
int by = (rct_base.bottom - rct_base.top) / 2; f_find.set_rect(r); // Ridimensiona il bottone centrale di ricerca
bx += 4; by += 2; // Aggiusta dimensioni botoni sussidiari
pos = _mask->id2pos(DLG_FIRSTREC); pos = _mask->id2pos(DLG_FIRSTREC);
if (pos >= 0) if (pos >= 0)
{ {
r = rct_base; r.left += bx; r.right -= bx; r = rct_base; r.top = r.bottom - by; r.right = r.left + bx;
f_find.set_prompt("~c."); _mask->fld(pos).set_rect(r);
f_find.set_rect(r); }
bx += 4; pos = _mask->id2pos(DLG_PREVREC);
by += 2; if (pos >= 0)
r = rct_base; r.top = r.bottom - by; r.right = r.left + bx; {
_mask->fld(pos).set_rect(r); r = rct_base; r.bottom = r.top + by; r.right = r.left + bx;
} _mask->fld(pos).set_rect(r);
pos = _mask->id2pos(DLG_PREVREC); }
if (pos >= 0) pos = _mask->id2pos(DLG_NEXTREC);
{ if (pos >= 0)
r = rct_base; r.bottom = r.top + by; r.right = r.left + bx; {
_mask->fld(pos).set_rect(r); r = rct_base; r.bottom = r.top + by; r.left = r.right - bx;
} _mask->fld(pos).set_rect(r);
pos = _mask->id2pos(DLG_NEXTREC); }
if (pos >= 0) pos = _mask->id2pos(DLG_LASTREC);
{ if (pos >= 0)
r = rct_base; r.bottom = r.top + by; r.left = r.right - bx; {
_mask->fld(pos).set_rect(r); r = rct_base; r.top = r.bottom - by; r.left = r.right - bx;
} _mask->fld(pos).set_rect(r);
pos = _mask->id2pos(DLG_LASTREC); }
if (pos >= 0) }
{
r = rct_base; r.top = r.bottom - by; r.left = r.right - bx;
_mask->fld(pos).set_rect(r);
}
} }
} }