Patch level : no patch
Files correlati : Ricompilazione Demo : [ ] Commento : Aggiunta la set_find_button git-svn-id: svn://10.65.10.50/trunk@10103 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
7650181c48
commit
10a8253a5a
@ -127,6 +127,56 @@ void TRelation_application::set_limits(
|
||||
}
|
||||
}
|
||||
|
||||
void TRelation_application::set_find_button()
|
||||
{
|
||||
|
||||
int pos = _mask->id2pos(DLG_FINDREC);
|
||||
if (pos >= 0)
|
||||
{
|
||||
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);
|
||||
|
||||
int bx = (rct_base.right - rct_base.left) / 3;
|
||||
int by = (rct_base.bottom - rct_base.top) / 2;
|
||||
|
||||
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_bmp(BMP_STOPREC, BMP_STOPREC);
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool TRelation_application::create()
|
||||
{
|
||||
bool ok = user_create();
|
||||
@ -134,47 +184,6 @@ bool TRelation_application::create()
|
||||
{
|
||||
write_enable();
|
||||
_mask = get_mask(MODE_QUERY);
|
||||
int pos = _mask->id2pos(DLG_FINDREC);
|
||||
if (pos >= 0)
|
||||
{
|
||||
RCT rct_base, r;
|
||||
TButton_field & f_find = (TButton_field &)_mask->fld(pos);
|
||||
|
||||
f_find.get_rect(rct_base);
|
||||
|
||||
int bx = (rct_base.right - rct_base.left) / 3;
|
||||
int by = (rct_base.bottom - rct_base.top) / 2;
|
||||
|
||||
pos = _mask->id2pos(DLG_FIRSTREC);
|
||||
if (pos >= 0)
|
||||
{
|
||||
r = rct_base; r.left += bx; r.right -= bx;
|
||||
f_find.set_bmp(BMP_STOPREC, BMP_STOPREC);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
filter();
|
||||
set_key_filter();
|
||||
@ -291,7 +300,7 @@ void TRelation_application::set_toolbar(bool all)
|
||||
_mask->fld(pos).enable(enabins);
|
||||
}
|
||||
}
|
||||
|
||||
set_find_button();
|
||||
enable_query();
|
||||
}
|
||||
|
||||
|
@ -104,6 +104,9 @@ private:
|
||||
bool has_filtered_cursor() const
|
||||
{ return filtered() || force_cursor_usage();}
|
||||
|
||||
// @cmember:(INTERNAL) Sistema il bottone ricerca se necessario
|
||||
void set_find_button();
|
||||
|
||||
// @access Protected Member
|
||||
protected: // TApplication
|
||||
// @cmember Effettua i controlli all'inizio dell'applicazione
|
||||
|
Loading…
x
Reference in New Issue
Block a user