Patch level : xx no patch
Files correlati : tutti gli url e tutte le relapp Ricompilazione Demo : [ ] Commento : Aggiunti i bottoni precedente successivo primo e ultimo alle relapp git-svn-id: svn://10.65.10.50/trunk@9679 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
eeac6b63da
commit
e1cd0c37b3
@ -111,10 +111,10 @@ image BMP_CANCEL QRESDIR"cancel.bmp"
|
||||
image BMP_QUIT QRESDIR"quit.bmp"
|
||||
image BMP_QUITDN QRESDIR"quitdn.bmp"
|
||||
image BMP_SELECT QRESDIR"select.bmp"
|
||||
//image BMP_FIRSTREC QRESDIR"firstrec.bmp"
|
||||
//image BMP_PREVREC QRESDIR"prevrec.bmp"
|
||||
//image BMP_NEXTREC QRESDIR"nextrec.bmp"
|
||||
//image BMP_LASTREC QRESDIR"lastrec.bmp"
|
||||
image BMP_FIRSTREC QRESDIR"firstrec.bmp"
|
||||
image BMP_PREVREC QRESDIR"prevrec.bmp"
|
||||
image BMP_NEXTREC QRESDIR"nextrec.bmp"
|
||||
image BMP_LASTREC QRESDIR"lastrec.bmp"
|
||||
image BMP_STOPREC QRESDIR"stoprec.bmp"
|
||||
image BMP_SAVEREC QRESDIR"saverec.bmp"
|
||||
image BMP_SAVERECDN QRESDIR"saverecd.bmp"
|
||||
@ -124,7 +124,7 @@ image BMP_DELREC QRESDIR"delrec.bmp"
|
||||
image BMP_DELRECDN QRESDIR"delrecdn.bmp"
|
||||
image BMP_FINDREC QRESDIR"findrec.bmp"
|
||||
image BMP_SEARCH QRESDIR"search.bmp"
|
||||
//image BMP_CHECK_ON QRESDIR"checkon.bmp"
|
||||
image BMP_CHECK_ON QRESDIR"checkon.bmp"
|
||||
//image BMP_CHECK_OFF QRESDIR"checkoff.bmp"
|
||||
//image BMP_RADIO_ON QRESDIR"radioon.bmp"
|
||||
//image BMP_RADIO_OFF QRESDIR"radiooff.bmp"
|
||||
|
@ -134,6 +134,48 @@ 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();
|
||||
set_limits();
|
||||
@ -223,7 +265,24 @@ void TRelation_application::set_toolbar(bool all)
|
||||
|
||||
pos = _mask->id2pos(DLG_FINDREC);
|
||||
if (pos >= 0)
|
||||
{
|
||||
_mask->fld(pos).enable(_lnflag == 0);
|
||||
const bool enable_btns = !_mask->query_mode();
|
||||
pos = _mask->id2pos(DLG_FIRSTREC);
|
||||
if (pos >= 0)
|
||||
_mask->fld(pos).enable(_lnflag == 0 && enable_btns);
|
||||
pos = _mask->id2pos(DLG_PREVREC);
|
||||
const long recno = get_relation()->lfile().recno();
|
||||
const bool enable_next_prev = enable_btns && !_mask->insert_mode();
|
||||
if (pos >= 0)
|
||||
_mask->fld(pos).enable(_lnflag == 0 && enable_next_prev && _first > 0 && _first != recno);
|
||||
pos = _mask->id2pos(DLG_NEXTREC);
|
||||
if (pos >= 0)
|
||||
_mask->fld(pos).enable(_lnflag == 0 && enable_next_prev && _last > 0 && _last != recno);
|
||||
pos = _mask->id2pos(DLG_LASTREC);
|
||||
if (pos >= 0)
|
||||
_mask->fld(pos).enable(_lnflag == 0 && enable_btns);
|
||||
}
|
||||
|
||||
pos = _mask->id2pos(DLG_NEWREC);
|
||||
if (pos >= 0)
|
||||
@ -248,15 +307,15 @@ int TRelation_application::set_mode(int mode)
|
||||
const int m = ((TMaskmode)mode == NO_MODE) ? (int) MODE_QUERY : mode;
|
||||
_mask->set_mode(m);
|
||||
|
||||
if (mode == _mode)
|
||||
{
|
||||
set_toolbar(FALSE); // Fast buttons update
|
||||
}
|
||||
else
|
||||
{
|
||||
// if (mode == _mode)
|
||||
// {
|
||||
// set_toolbar(FALSE); // Fast buttons update
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
set_toolbar(TRUE); // Full buttons update
|
||||
_mode = mode;
|
||||
}
|
||||
// }
|
||||
|
||||
const char* t = "";
|
||||
switch(mode)
|
||||
|
@ -22,11 +22,39 @@ BEGIN
|
||||
PICTURE BMP_DELRECDN
|
||||
END
|
||||
|
||||
BUTTON DLG_PREVREC 3
|
||||
BEGIN
|
||||
PROMPT -46 -2 ""
|
||||
MESSAGE EXIT,K_PREV
|
||||
PICTURE 122
|
||||
END
|
||||
|
||||
BUTTON DLG_FIRSTREC 3
|
||||
BEGIN
|
||||
PROMPT -46 -1 ""
|
||||
MESSAGE EXIT,K_HOME
|
||||
PICTURE 121
|
||||
END
|
||||
|
||||
BUTTON DLG_FINDREC 10 2
|
||||
BEGIN
|
||||
PROMPT -46 -1 "Ri~cerca"
|
||||
PROMPT -46 -1 "~c"
|
||||
MESSAGE EXIT,K_F9
|
||||
PICTURE 126
|
||||
// PICTURE 126
|
||||
END
|
||||
|
||||
BUTTON DLG_NEXTREC 3
|
||||
BEGIN
|
||||
PROMPT -46 -2 ""
|
||||
MESSAGE EXIT,K_NEXT
|
||||
PICTURE 124
|
||||
END
|
||||
|
||||
BUTTON DLG_LASTREC 3
|
||||
BEGIN
|
||||
PROMPT -46 -1 ""
|
||||
MESSAGE EXIT,K_END
|
||||
PICTURE 125
|
||||
END
|
||||
|
||||
BUTTON DLG_CANCEL 10 2
|
||||
|
Loading…
x
Reference in New Issue
Block a user