Patch level : 2.2
Files correlati : ca2 Ricompilazione Demo : [ ] Commento : Migliorata gestione abilitazione bottoni Registra, Fine e Bloccato git-svn-id: svn://10.65.10.50/trunk@13485 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
d9222468ef
commit
f08ef6381e
@ -90,12 +90,13 @@ static TMovanal_app& app() { return (TMovanal_app&)main_app(); }
|
||||
|
||||
bool TMovanal_msk::can_be_closed() const
|
||||
{
|
||||
return mode() != MODE_MOD || !get_bool(F_BLOCCATO);
|
||||
const bool lck = app().is_transaction() && mode() == MODE_INS;
|
||||
return lck ? false : TAutomask::can_be_closed();
|
||||
}
|
||||
|
||||
bool TMovanal_msk::on_key(KEY key)
|
||||
{
|
||||
if (key == K_SHIFT + K_F12 && !can_be_closed())
|
||||
if (key == K_SHIFT + K_F12)
|
||||
{
|
||||
enable(F_BLOCCATO);
|
||||
return true;
|
||||
@ -105,16 +106,18 @@ bool TMovanal_msk::on_key(KEY key)
|
||||
|
||||
void TMovanal_msk::show_locked_buttons()
|
||||
{
|
||||
const bool editmode = mode() == MODE_MOD;
|
||||
const bool unlocked = can_be_closed();
|
||||
const bool is_trans = app().is_transaction();
|
||||
show (F_BLOCCATO, editmode);
|
||||
const bool modifying = mode() == MODE_MOD;
|
||||
const bool inserting = mode() == MODE_INS;
|
||||
const bool editing = modifying || inserting;
|
||||
const bool unlocked = !(modifying && get_bool(F_BLOCCATO));
|
||||
show (F_BLOCCATO, modifying);
|
||||
enable(F_BLOCCATO, unlocked);
|
||||
enable(DLG_SAVEREC, unlocked && (editmode || mode() == MODE_INS));
|
||||
enable(DLG_DELREC, unlocked && mode() != MODE_INS);
|
||||
enable(DLG_QUIT, unlocked && !is_trans);
|
||||
enable(DLG_CANCEL, mode() == MODE_QUERY || !is_trans);
|
||||
enable(F_RESET, unlocked);
|
||||
enable(DLG_SAVEREC, unlocked && editing);
|
||||
enable(DLG_DELREC, unlocked && !inserting);
|
||||
enable(DLG_QUIT, !is_trans || !inserting);
|
||||
enable(DLG_CANCEL, !is_trans || !inserting);
|
||||
enable(F_RESET, unlocked && editing);
|
||||
}
|
||||
|
||||
TToken_string& TMovanal_msk::get_rip_row(const TRectype& rrip)
|
||||
@ -235,7 +238,7 @@ void TMovanal_msk::load_cg_mov()
|
||||
|
||||
TImporto totdoc;
|
||||
TRecord_array cg(numregcg, LF_RMOV);
|
||||
const bool autoinsert = sfield(F_RIGHE).items() == 0;
|
||||
const bool autoinsert = sfield(F_RIGHE).empty();
|
||||
for (int i = 1; i <= cg.rows(); i++)
|
||||
{
|
||||
const TRectype& row = cg.row(i);
|
||||
|
Loading…
x
Reference in New Issue
Block a user