Patch level : 10.0

Files correlati     : relapp
Ricompilazione Demo : [ ]
Commento            :


git-svn-id: svn://10.65.10.50/trunk@16949 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2008-07-25 15:13:17 +00:00
parent e42671d911
commit 7ad78a68a2
2 changed files with 78 additions and 68 deletions

View File

@ -6,6 +6,7 @@
#include <sheet.h> #include <sheet.h>
#include <recarray.h> #include <recarray.h>
#include <relapp.h> #include <relapp.h>
#include <statbar.h>
#include <urldefid.h> #include <urldefid.h>
#include <utility.h> #include <utility.h>
@ -126,6 +127,9 @@ void TRelation_application::set_limits(
} }
void TRelation_application::set_find_button() void TRelation_application::set_find_button()
{
// Ricalcola posizioni bootoni di navigazione con la vecchia toolbar
if (_mask->toolbar() == NULL_WIN) // Non c'e' la nuova relapbar
{ {
int pos = _mask->id2pos(DLG_FINDREC); int pos = _mask->id2pos(DLG_FINDREC);
if (pos >= 0 && _mask->id2pos(DLG_FIRSTREC) >= 0) //se e' un bottone pentapartito... if (pos >= 0 && _mask->id2pos(DLG_FIRSTREC) >= 0) //se e' un bottone pentapartito...
@ -179,6 +183,10 @@ void TRelation_application::set_find_button()
} }
} }
} }
else
xvt_toolbar_realize(_mask->toolbar());
}
bool TRelation_application::create() bool TRelation_application::create()
{ {
@ -279,19 +287,20 @@ void TRelation_application::set_toolbar()
const long recno = get_relation()->lfile().recno(); const long recno = get_relation()->lfile().recno();
const bool enable_next_prev = _mask->edit_mode(); const bool enable_next_prev = _mask->edit_mode();
const bool can_nav = _lnflag == 0 && _curr_transaction != TRANSACTION_LINK;
pos = _mask->id2pos(DLG_FIRSTREC); pos = _mask->id2pos(DLG_FIRSTREC);
if (pos >= 0) if (pos >= 0)
_mask->fld(pos).enable(_lnflag == 0 && (enable_next_prev ? _first != recno : _first > 0)); _mask->fld(pos).enable(can_nav && (enable_next_prev ? _first != recno : _first > 0));
pos = _mask->id2pos(DLG_PREVREC); pos = _mask->id2pos(DLG_PREVREC);
if (pos >= 0) if (pos >= 0)
_mask->fld(pos).enable(_lnflag == 0 && enable_next_prev && _first > 0 && _first != recno); _mask->fld(pos).enable(can_nav && enable_next_prev && _first > 0 && _first != recno);
pos = _mask->id2pos(DLG_NEXTREC); pos = _mask->id2pos(DLG_NEXTREC);
if (pos >= 0) if (pos >= 0)
_mask->fld(pos).enable(_lnflag == 0 && enable_next_prev && _last > 0 && _last != recno); _mask->fld(pos).enable(can_nav && enable_next_prev && _last > 0 && _last != recno);
pos = _mask->id2pos(DLG_LASTREC); pos = _mask->id2pos(DLG_LASTREC);
if (pos >= 0) if (pos >= 0)
_mask->fld(pos).enable(_lnflag == 0 && (enable_next_prev ? _last != recno : _last > 0)); _mask->fld(pos).enable(can_nav && (enable_next_prev ? _last != recno : _last > 0));
} }
pos = _mask->id2pos(DLG_NEWREC); pos = _mask->id2pos(DLG_NEWREC);
@ -315,7 +324,7 @@ void TRelation_application::update_navigation_bar()
} }
bool TRelation_application::save_and_new() const bool TRelation_application::save_and_new() const
{ return FALSE; } { return false; }
int TRelation_application::set_mode(int mode) int TRelation_application::set_mode(int mode)
{ {

View File

@ -519,6 +519,8 @@ WINDOW xvtil_create_statbar()
{ {
CHECK(_statbar == NULL_WIN, "Onli uan statbar, plis"); CHECK(_statbar == NULL_WIN, "Onli uan statbar, plis");
if (TASK_WIN != NULL_WIN) // Puo' succedere in chiusura menu
{
const int prop_count = 4; const int prop_count = 4;
char* prop_list[prop_count+1] = char* prop_list[prop_count+1] =
{ {
@ -531,10 +533,9 @@ WINDOW xvtil_create_statbar()
_statbar = statbar_create(0, 0, 600, 1024, 800, prop_count, prop_list, _statbar = statbar_create(0, 0, 600, 1024, 800, prop_count, prop_list,
TASK_WIN, 0, 0, ""); TASK_WIN, 0, 0, "");
CHECK(_statbar, "Can't create the status bar"); CHECK(_statbar, "Can't create the status bar");
statbar_set_fontid(_statbar, xvt_default_font()); statbar_set_fontid(_statbar, xvt_default_font());
}
return _statbar; return _statbar;
} }