From 9fe90a1062fe9b01684a1ac6d674e1a67b5dfece Mon Sep 17 00:00:00 2001 From: luca Date: Fri, 21 Feb 2003 11:46:14 +0000 Subject: [PATCH] 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 --- include/relapp.cpp | 75 +++++++++++++++++++++++----------------------- 1 file changed, 37 insertions(+), 38 deletions(-) diff --git a/include/relapp.cpp b/include/relapp.cpp index 1024a3800..03b12844b 100755 --- a/include/relapp.cpp +++ b/include/relapp.cpp @@ -129,50 +129,49 @@ void TRelation_application::set_limits( void TRelation_application::set_find_button() { - 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; - TButton_field & f_find = (TButton_field &)_mask->fld(pos); - - TString16 p(f_find.prompt()); - if (p == "~c.") - return; 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; - int by = (rct_base.bottom - rct_base.top) / 2; + r = rct_base; r.left += bx; r.right -= bx; + f_find.set_rect(r); // Ridimensiona il bottone centrale di ricerca + + bx += 4; by += 2; // Aggiusta dimensioni botoni sussidiari - pos = _mask->id2pos(DLG_FIRSTREC); - if (pos >= 0) - { - r = rct_base; r.left += bx; r.right -= bx; - f_find.set_prompt("~c."); - f_find.set_rect(r); - bx += 4; - by += 2; - r = rct_base; r.top = r.bottom - by; r.right = r.left + bx; - _mask->fld(pos).set_rect(r); - } - pos = _mask->id2pos(DLG_PREVREC); - if (pos >= 0) - { - r = rct_base; r.bottom = r.top + by; r.right = r.left + bx; - _mask->fld(pos).set_rect(r); - } - pos = _mask->id2pos(DLG_NEXTREC); - if (pos >= 0) - { - r = rct_base; r.bottom = r.top + 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); - } + pos = _mask->id2pos(DLG_FIRSTREC); + if (pos >= 0) + { + r = rct_base; r.top = r.bottom - by; r.right = r.left + bx; + _mask->fld(pos).set_rect(r); + } + pos = _mask->id2pos(DLG_PREVREC); + if (pos >= 0) + { + r = rct_base; r.bottom = r.top + by; r.right = r.left + bx; + _mask->fld(pos).set_rect(r); + } + pos = _mask->id2pos(DLG_NEXTREC); + if (pos >= 0) + { + r = rct_base; r.bottom = r.top + 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); + } + } } }