Corretto focus forzato sugli sheet

Tolto il bottone di stampa dalle finestre di visualizzazione
Adattati checks per FOXPRO
Resi meno ridicoli i messaggi corrispondenti a F11 e F12 (mi mancheranno)


git-svn-id: svn://10.65.10.50/trunk@941 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1995-01-31 16:15:45 +00:00
parent 4c36fed54b
commit b85ca5227d
9 changed files with 61 additions and 49 deletions

@ -2,6 +2,11 @@
#include <stdio.h>
#include <stdlib.h>
#ifdef FOXPRO
#undef XVT_OS
#include <pro_ext.h>
#endif
#ifdef XVT_OS
#include <xvt_os.h>
#if XVT_OS == XVT_OS_WIN
@ -14,11 +19,6 @@
#endif /* XVT_OS */
#ifdef FOXPRO
#undef XVT_OS
#include <pro_ext.h>
#endif
#include <checks.h>
#define buildmsg() char msg[256];va_list argptr;va_start(argptr,fmt);vsprintf(msg,fmt,argptr);va_end(argptr)

@ -934,7 +934,7 @@ bool TPrint_section::update()
}
bool TPrint_section::edit(const char* title)
bool TPrint_section::edit(const char* title, bool all)
{
TMask m("ba2100s");
m.set_caption(title);
@ -955,7 +955,7 @@ bool TPrint_section::edit(const char* title)
_y = m.get_int(F_Y);
}
TArray_sheet a(-1, -1, 0, 0, title, "Tipo@8|Riga|Col.|Gr.|Descrizione@40", 0xE);
TArray_sheet a(-1, -1, 0, 0, title, "Tipo@8|Riga|Col.|Gr.|Descrizione@40", all ? 0xE : 0x8);
for (word i = 0; i < fields(); i++)
{
@ -965,13 +965,15 @@ bool TPrint_section::edit(const char* title)
}
KEY k;
do
while ((k = a.run()) != K_ESC)
{
k = a.run();
i = (word)a.selected();
if (k == K_ENTER || k == K_INS && _msk == NULL)
if (_msk == NULL && (k == K_ENTER || k == K_INS))
{
_msk = new TMask("ba2100f");
if (!all) _msk->disable(-7);
}
switch(k)
{
@ -984,34 +986,35 @@ bool TPrint_section::edit(const char* title)
}
break;
case K_INS:
{
_msk->set_mode(MODE_INS);
TForm_string dummy(this);
if (dummy.edit(*_msk))
{
const TString& c = _msk->get(F_CLASS).left(2);
TForm_item* item = parse_item(c);
item->read_from(*_msk);
_item.insert(item, i);
TToken_string s(128); item->print_on(s);
a.insert(s, i);
dirty = TRUE;
}
}
if (all)
{
_msk->set_mode(MODE_INS);
TForm_string dummy(this);
if (dummy.edit(*_msk))
{
const TString& c = _msk->get(F_CLASS).left(2);
TForm_item* item = parse_item(c);
item->read_from(*_msk);
_item.insert(item, i);
TToken_string s(128); item->print_on(s);
a.insert(s, i);
dirty = TRUE;
}
} else error_box("L'inserimento e' disabilitato");
break;
case K_DEL:
if (yesno_box("Confermare la cancellazione"))
if (all && yesno_box("Confermare la cancellazione"))
{
_item.destroy(i, TRUE);
a.destroy(i);
dirty = TRUE;
}
} else error_box("La cancellazione e' disabilitata");
break;
default:
break;
}
} while (k != K_ESC);
}
return dirty;
}
@ -1316,7 +1319,8 @@ word TForm::height()
}
TForm::TForm(const char* name) : _name(name), _relation(NULL), _cursor(NULL)
TForm::TForm(const char* name)
: _name(name), _relation(NULL), _cursor(NULL)
{
main_app().begin_wait();

@ -57,7 +57,7 @@ public:
bool update();
bool parse(TScanner& scanner);
bool edit(const char* title);
bool edit(const char* title, bool all);
const TPrint_section& operator=(const TPrint_section& ps) { return copy(ps); }
TPrint_section(TForm* parent);
@ -70,7 +70,7 @@ class TForm : public TObject
{
friend class TForm_editor;
TFilename _name; // Profile name
TFilename _name; // Profile name
TRelation* _relation; // Can be NULL
TCursor* _cursor; // Can be NULL

@ -765,10 +765,10 @@ bool TMask::on_key(KEY key)
next_page(+1);
break;
case K_F12:
message_box("Carissimo cronometrista, eccoti i tempi:\n"
"lettura + creazione = totale : init\n"
"%ld + %ld = %ld : %ld",
_total_time-_build_time, _build_time, _total_time, _init_time);
message_box("Lettura = %ld:\n"
"Creazione = %ld:\n"
"Inizializzazione = %ld",
_total_time-_build_time, _build_time, _init_time);
break;
default:
if (key > K_CTRL)

@ -1,4 +1,4 @@
// $Id: maskfld.cpp,v 1.73 1995-01-30 13:45:59 guy Exp $
// $Id: maskfld.cpp,v 1.74 1995-01-31 16:15:29 guy Exp $
#include <xvt.h>
#include <applicat.h>
@ -457,7 +457,10 @@ void TMask_field::set_prompt(const char* p)
void TMask_field::set(const char* s)
{
{
if (_dlg == 108)
_dlg = 108;
if (mask().is_running())
{
set_window_data(s);
@ -827,9 +830,8 @@ bool TMask_field::on_key(KEY key)
const char* c = "";
if (field())
c = field()->name();
message_box("Siete fortunati utenti del campo %d della maschera '%s'\n"
"corrispondente al campo su file '%s'\n"
"Grazie per la comprensione",
message_box("State utilizzando il campo %d della maschera '%s'\n"
"corrispondente al campo su file '%s'",
dlg(), (const char*)mask().source_file(), c);
set_focus();
}

@ -1,5 +1,6 @@
#ifndef __MODAUT_H
#define __MODAUT_H
#define BAAUT 0
#define M74AUT 1
#define M75AUT 2
@ -31,4 +32,5 @@
#define DBAUT 35
#define SPAUT 36
#define ENDAUT 37
#endif // __MODAUT_H

@ -366,7 +366,7 @@ void TSpreadsheet::set_focus_cell(int riga, int colonna)
{
set_front_window(win()); // It seems necessary
const int r = row2rec(riga);
const int r = row2rec(riga);
for (; colonna < _columns; colonna++)
if (!cell_disabled(r, colonna-1))
@ -378,12 +378,13 @@ void TSpreadsheet::set_focus_cell(int riga, int colonna)
XI_MAKE_CELL(&cell, _list, r, colonna);
xi_set_focus(&cell);
if (!_edit_field)
if (_edit_field == NULL)
{
_cur_row = riga;
_cur_col = colonna;
_cur_rec = r;
_edit_field = col2field(colonna);
str2mask(_cur_rec);
_row_dirty = FALSE;
}
}
@ -1295,6 +1296,7 @@ void TSheet_field::highlight() const
if (items())
{
_sheet->_firstfocus = FALSE;
_sheet->_edit_field = NULL;
_sheet->set_focus_cell(0, 1);
}
#endif

@ -25,7 +25,7 @@ HIDDEN char __spark[MAXSTR]; // Utili
TFixed_string spark(__spark, MAXSTR);
inline bool is_space(char c)
{ return c >= K_TAB && c <= K_SPACE; }
{ return c >= '\t' && c <= ' '; }
// Dinamically resizes a string
// Certified 99%

@ -2191,12 +2191,14 @@ TViswin::TViswin(const char *fname,
_link_button = add_button (DLG_LINK, DLG_LINK_TITLE);
_buttons++;
xvt_enable_control(_link_button, FALSE);
}
if (_isprint)
{
add_button (DLG_PRINT, DLG_PRINT_TITLE);
_buttons++;
}
}
/*
if (_isprint)
{
add_button (DLG_PRINT, DLG_PRINT_TITLE);
_buttons++;
}
*/
}
else _buttons = 0;