applicat.cpp Gestione semplificata dei bar_item

array.cpp      Corretti TPointer_array
assoc.cpp      Aggiuntta add()
cfiles.c       Corretto salvataggio pathpref.ini
controls.cpp   Aggiunto attributo di read_only
default.url    Aggiunto menu di edit ed help
mask.cpp       Gestione menu edit
maskfld.cpp    Gestione menu edit
msksheet.cpp   Gestione menu edit
progind.cpp    Aggiunto nuova scavatura 3D
sheet.cpp
viswin.cpp     Aggiornati ID del menu edit
window.cpp     Corretta gestione voci di menu standard
xvtility.cpp   Aggiunto metodo per skippare gli errori di XVT


git-svn-id: svn://10.65.10.50/trunk@5791 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1997-12-24 14:26:25 +00:00
parent 7f16a46079
commit 3e793a4cab
23 changed files with 277 additions and 118 deletions

View File

@ -59,8 +59,10 @@ bool xvt_running()
// Ritorna il nome della ditta che vende il programma attuale
HIDDEN char* prassi_spa()
{
TString firm(80);
TString firm(80);
ignore_xvt_errors(TRUE);
char* p = xvt_res_get_str(STR_FIRMNAME, firm.get_buffer(), firm.size());
ignore_xvt_errors(FALSE);
if (p == NULL)
p = "PR.A.S.S.I. S.p.A.";
return p;
@ -185,12 +187,28 @@ long XVT_CALLCONV1 TApplication::task_eh(WINDOW win, EVENT *ep)
exit(0);
}
#endif
TTemp_window tw(win);
TString cap;
cap << prassi_spa() << " - " << main_app().get_module_name();
tw.set_caption(cap);
// Setta il vero menu principale se diverso dal default
const int meno = _application->argc() > 1 ? atoi(_application->argv(1)+1) : 0;
ignore_xvt_errors(TRUE);
MENU_ITEM* menu = xvt_res_get_menu(MENU_BAR(meno));
ignore_xvt_errors(FALSE);
if (menu)
{
xvt_menu_set_tree(win, menu);
xvt_res_free_menu_tree(menu);
}
// Setta la caption della task window
TString cap;
cap << prassi_spa() << " - " << _application->get_module_name();
TTemp_window tw(win);
tw.set_caption(cap);
// Carica colori e font
customize_controls(TRUE);
// Crea il banner iniziale
create_backdrop();
#if defined(DBG) && XVT_OS == XVT_OS_SCOUNIX
@ -228,7 +246,6 @@ long TApplication::handler(WINDOW win, EVENT* ep)
#if XVT_OS == XVT_OS_SCOUNIX
do_events();
#endif
/* allow_another_instance(); */
}
else
stop_run();
@ -253,9 +270,30 @@ long TApplication::handler(WINDOW win, EVENT* ep)
if (config())
on_config_change();
break;
case (M_FILE+11):
case (M_FILE_ABOUT+1):
about();
break;
case M_HELP_CONTENTS:
case M_HELP_SEARCH:
case M_HELP_HELPONHELP:
#if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_WIN32
if (fexist("prassi.hlp"))
{
TFilename hlp("prassi.hlp");
TString mod(main_app().name());
mod.cut(2); mod.lower();
if (mod != "ba") hlp.insert(mod, 0);
HWND hwnd = (HWND)xvt_vobj_get_attr(win, ATTR_NATIVE_WINDOW);
switch(ep->v.cmd.tag)
{
case M_HELP_CONTENTS: WinHelp(hwnd, hlp, HELP_CONTENTS, 0); break;
case M_HELP_SEARCH: WinHelp(hwnd, hlp, HELP_PARTIALKEY, (DWORD)""); break;
case M_HELP_HELPONHELP: WinHelp(hwnd, hlp, HELP_HELPONHELP, 0); break;
default: break;
}
}
#endif
break;
default:
if (ep->v.cmd.tag > MAX_MENU_TAG)
{
@ -349,7 +387,7 @@ bool TApplication::remove_menu(MENU_TAG id)
TApplication::TApplication()
: _savefirm(0), _create_ok(FALSE), _bar(TASK_MENUBAR),
: _savefirm(0), _create_ok(FALSE), /* _bar(TASK_MENUBAR), */
_name(80), _title(80)
{}
@ -522,15 +560,15 @@ void TApplication::run(
__argc = argc;
__argv = (const char**)argv;
int addbar = 0;
/* int addbar = 0; */
if (argc > 1 && argv[1][0] == '-')
{
addbar = atoi(argv[1]+1);
_name = cmd2name(argv[0], argv[1]);
// addbar = atoi(argv[1]+1);
}
else
{
addbar = 0;
// addbar = 0;
_name = cmd2name(argv[0]);
}
@ -553,7 +591,7 @@ void TApplication::run(
return;
XVT_CONFIG cfg;
cfg.menu_bar_ID = TASK_MENUBAR+addbar;
cfg.menu_bar_ID = TASK_MENUBAR /*+addbar */;
cfg.about_box_ID = 0;
cfg.base_appl_name = (char*)base.name();
cfg.appl_name = (char*)title;

View File

@ -27,8 +27,8 @@ class TApplication
// @access:(INTERNAL) Private Member
{
// @cmember:(INTERNAL) Identificatore del menu' legato all'applicazione
int _bar;
// // @cmember:(INTERNAL) Identificatore del menu' legato all'applicazione
// int _bar;
// @cmember:(INTERNAL) Numero di argomenti passati all'applicazione
int __argc;
// @cmember:(INTERNAL) Array di argomenti passati all'applicazione
@ -102,8 +102,8 @@ protected:
// @access Public Member
public:
// @cmember Modifca la barra dei menu' inserendo la <p menubar>
void setbar(int menubar)
{ _bar = menubar;}
// void setbar(int menubar) { _bar = menubar;}
// @cmember Fa partire l'applicazione
void run(int argc, char* argv[], const char* name);

View File

@ -596,9 +596,15 @@ TPointer_array& TPointer_array::operator= (const TArray& a)
return *this;
}
int TPointer_array::add(TObject* object, int index)
{
remove(index);
return TArray::add(object, index);
}
int TPointer_array::add(const TObject& object, int index)
{
return TArray::add(&(TObject&)object, index);
return add(&(TObject&)object, index);
}
int TPointer_array::insert(const TObject& object, int index, bool force)

View File

@ -210,10 +210,14 @@ class TPointer_array : public TArray
{
public:
virtual bool destroy(int index = -1, bool pack = FALSE);
virtual int add(TObject* object, int index);
virtual int add(const TObject& object, int index);
virtual int insert(const TObject& object, int index = 0, bool force = FALSE);
virtual TPointer_array& operator= (const TArray& a);
long get_long(int index) const { return (long)objptr(index); }
int add_long(long value, int index) { return add((TObject*)value, index); }
TPointer_array() { }
TPointer_array(int size) : TArray(size) { }
TPointer_array(const TArray& a) { *this = a; }

View File

@ -39,7 +39,7 @@ THash_object* TAssoc_array::_lookup(
for (int i = 0; i < arr.items(); i++)
{
THash_object* ob = (THash_object*)&arr[i];
THash_object* ob = (THash_object*)arr.objptr(i);
if (ob->_key == key)
{ o = ob; break; }
if (ob->_key > key)

View File

@ -461,7 +461,16 @@ BOOLEAN CPutPrawin(const char* pref)
{
int disk = toupper(*prawin) - 'A';
if (GetDriveType(disk) == 3) // Aggiorna lo studio solo sui dischi locali
{
FILE* ppi;
WritePrivateProfileString("Main", "Study", __ptprf, prawin);
// Aggiorna anche il vecchio pathpref.ini
ppi = fopen("pathpref.ini", "w");
fprintf(ppi, "%s\n", __ptprf);
fclose(ppi);
}
}
return good;
}
@ -516,7 +525,7 @@ const char* CGetPref()
if (!pathpread)
{
FILE* f = fopen("pathpref.ini", "r");
FILE* f = fopen("pathpref.ini", "r");
pathpread = TRUE;
if (f != NULL)
{

View File

@ -1183,6 +1183,16 @@ void TField_control::set_rect(const RCT& r)
_obj->v.field->rct = r;
}
bool TField_control::read_only() const
{
return bool((xi_get_attrib(_obj) & XI_ATR_READONLY) != 0);
}
void TField_control::set_read_only(bool on)
{
change_attrib(XI_ATR_READONLY, on);
}
bool TField_control::event_handler(XI_OBJ* itf, XI_EVENT* xiev)
{
if (in_create)

View File

@ -153,6 +153,9 @@ public:
// @cmember Ridimensiona il rettangolo su video
virtual void set_rect(const RCT& r);
bool read_only() const;
void set_read_only(bool on = TRUE);
// @cmember Costruttore
TField_control(WINDOW win, short cid,

View File

@ -29,23 +29,40 @@
#include <urldefid.h>
MENUBAR TASK_MENUBAR
MENUBAR TASK_MENUBAR
MENU MENU_FILE
ITEM M_FILE_NEW "Scelta ~Ditta..."
ITEM M_FILE_REVERT "Impostazione ~Parametri..."
SEPARATOR
ITEM M_FILE_PG_SETUP "~Impostazione Stampante..."
ITEM M_FILE_PRINT "~Stampa" DISABLED
SEPARATOR
ITEM (M_FILE+11) "I~nformazioni"
ITEM M_FILE_QUIT "~Fine"
MENU TASK_MENUBAR
SUBMENU M_FILE "~File"
SUBMENU M_EDIT "~Modifica"
SUBMENU M_HELP "~Help"
MENU M_FILE
ITEM M_FILE_NEW "Scelta ~Ditta..."
ITEM M_FILE_REVERT "Impostazione ~Parametri..."
SEPARATOR
ITEM M_FILE_PG_SETUP "~Impostazione Stampante..."
ITEM M_FILE_PRINT "~Stampa" DISABLED
SEPARATOR
ITEM M_FILE_QUIT "~Fine"
MENU M_EDIT
ITEM M_EDIT_CUT "~Taglia\tCtrl+X"
ITEM M_EDIT_COPY "~Copia\tCtrl+C"
ITEM M_EDIT_PASTE "~Incolla\tCtrl+V"
ITEM M_EDIT_CLEAR "~Elimina\tDel"
MENU M_HELP
ITEM M_HELP_CONTENTS "~Sommario"
ITEM M_HELP_SEARCH "~Cerca argomento ..."
ITEM M_HELP_HELPONHELP "~Uso della guida"
SEPARATOR
ITEM M_FILE_ABOUT+1 "~Informazioni ..."
MENUBAR VISWIN_BAR
MENU VISWIN_BAR
SUBMENU MENU_VISWIN "~Visualizzazione"
SUBMENU M_EDIT "~Modifica"
SUBMENU MENU_VISWIN "~Visualizzazione"
SUBMENU MENU_VISWIN_EDIT "~Modifica"
MENU MENU_VISWIN
ITEM M_EDIT_CLIPBOARD "Interrompi\tESC"
@ -57,14 +74,14 @@ ITEM M_SHOW_RULERS "Mostra ~righelli" CHECKABLE
ITEM M_SHOW_BUTTONS "Mostra ~bottoni" CHECKABLE
ITEM M_EDIT_UNDO "Ri~disegna"
SEPARATOR
ITEM M_EDIT_QUIT "Chiudi\tESC+ESC"
ITEM M_EDIT_QUIT "Chiudi\tESC+ESC"
MENU M_EDIT
ITEM M_EDIT_COPY "~Copia" DISABLED
ITEM M_EDIT_CLEAR "~Annulla" DISABLED
MENU MENU_VISWIN_EDIT
ITEM M_EDIT_COPY "~Copia" DISABLED
ITEM M_EDIT_CLEAR "~Annulla" DISABLED
SEPARATOR
ITEM M_EDIT_SEARCH "Cerca...\tF7"
ITEM M_EDIT_DELETE "Cerca il prossimo\tF8" DISABLED
ITEM M_EDIT_SEARCH "Cerca...\tF7"
ITEM M_EDIT_DELETE "Cerca il prossimo\tF8" DISABLED
MENUBAR BROWSE_BAR
@ -72,13 +89,27 @@ MENU BROWSE_BAR
SUBMENU BROWSE_BAR+1 "~Proprieta'"
MENU BROWSE_BAR+1
ITEM M_EDIT_COPY "~Salva impostazioni colonne"
ITEM M_EDIT_UNDO "~Ripristina impostazioni colonne"
ITEM M_EDIT_SEL_ALL "~Salva impostazioni colonne"
ITEM M_EDIT_UNDO "~Ripristina impostazioni colonne"
SEPARATOR
ITEM M_EDIT_SEARCH "~Informazioni"
ACCEL MENU_FILE "f" alt
/* Old accelerators */
ACCEL M_EDIT_UNDO BACK ALT
ACCEL M_EDIT_CUT DEL SHIFT
ACCEL M_EDIT_COPY INS CONTROL
ACCEL M_EDIT_PASTE INS SHIFT
#ifdef STR_M_EDIT_COPY_ACCEL
/* New accelerators */
ACCEL M_EDIT_UNDO STR_M_EDIT_UNDO_ACCEL
ACCEL M_EDIT_CUT STR_M_EDIT_CUT_ACCEL
ACCEL M_EDIT_COPY STR_M_EDIT_COPY_ACCEL
ACCEL M_EDIT_PASTE STR_M_EDIT_PASTE_ACCEL
#endif
STRING STR_FIRMNAME QFIRMNAME
#if XVTWS == WINWS

View File

@ -172,10 +172,10 @@ void TMask::add_field(TMask_field* f)
if (id > 0 && id < 512)
{
#ifdef DBG
if (_position.objptr(id))
if (_position.get_long(id))
NFCHECK("Il campo %d e' duplicato!", id);
#endif
_position.TArray::add((TObject*)pos, id);
#endif
_position.add_long(pos, id);
}
}
@ -507,40 +507,12 @@ int TMask::id2pos(
// @comm Cerca nella maschera il campo con identificatore <p id> e ne ritorna il numero ordinale
// (es. il campo 120 e' il quarto della maschera)
{
/*
const int MAX_FIELDS = 256;
static byte positions[MAX_FIELDS]; // 100 <= id < MAX_FIELDS
const int max = fields();
const int j = id-100;
int pos = -1;
if (j >= 0 && j < MAX_FIELDS) // Try using cache
{
pos = positions[j];
if (pos >= 0 && pos < max)
{
const TMask_field& f = fld(pos);
if (f.dlg() == id) // Mask could have been changed!
return pos;
}
}
for (pos = 0; pos < max; pos++) // Standard linear search
{
const TMask_field& f = fld(pos);
if (f.dlg() == id)
{
if (j >= 0 && j < MAX_FIELDS) // Store position for the next time
positions[j] = pos;
return pos;
}
}
return -1; // Not found!
*/
int pos = -1;
if (id > 0 && id < 512)
pos = int(long(_position.objptr(id))-1);
{
pos = int(_position.get_long(id)-1);
CHECKD(pos < 0 || fld(pos).dlg() == id, "Bad position for field: ", id);
}
else
{
for (pos = fields()-1; pos >= 0; pos--)
@ -695,23 +667,29 @@ void TMask::handler(WINDOW win, EVENT* ep)
}
if (ep->type == E_COMMAND)
{
if (_last_sheet)
{
switch (ep->v.cmd.tag)
{
case M_EDIT_UNDO:
switch (ep->v.cmd.tag)
{
case M_EDIT_CUT:
case M_EDIT_COPY:
case M_EDIT_PASTE:
case M_EDIT_CLEAR:
focus_field().on_clipboard(ep->v.cmd.tag);
break;
case M_EDIT_UNDO:
if (_last_sheet)
_last_sheet->reset_columns_order();
case M_EDIT_COPY:
case M_EDIT_SEL_ALL:
if (_last_sheet)
_last_sheet->save_columns_order();
break;
case M_EDIT_SEARCH:
break;
case M_EDIT_SEARCH:
if (_last_sheet)
_last_sheet->on_key(K_F11);
break;
default:
break;
}
return;
break;
default:
break;
}
return;
}
TWindow::handler(win, ep);

View File

@ -508,6 +508,11 @@ bool TMask_field::on_key(KEY key)
return TRUE;
}
bool TMask_field::on_clipboard(MENU_TAG mt)
{
return FALSE;
}
#define build_msg() char* _msg = (char*)(const char*)_ctl_data._park;va_list argptr;va_start(argptr,fmt);vsprintf(_msg,fmt,argptr);va_end(argptr)
// @doc EXTERNAL
@ -1443,6 +1448,52 @@ bool TEditable_field::autoload(const TRelation& r)
return _field != NULL;
}
bool TEditable_field::on_clipboard(MENU_TAG mt)
{
bool ok = FALSE;
switch (mt)
{
case M_EDIT_COPY:
case M_EDIT_CUT:
if (xvt_cb_open(TRUE))
{
const TString& str = get_window_data();
const long size = str.len()+1;
char* p = xvt_cb_alloc_data(size);
if (p != NULL)
{
strcpy(p, str);
ok = xvt_cb_put_data(CB_TEXT, NULL, size, (PICTURE)0) != FALSE;
xvt_cb_free_data();
if (ok && mt == M_EDIT_CUT)
reset();
}
xvt_cb_close();
}
break;
case M_EDIT_PASTE:
if (xvt_cb_open(FALSE))
{
long size;
const char* const p = xvt_cb_get_data(CB_TEXT, NULL, &size);
if (p && size > 0)
{
set(p);
ok = TRUE;
}
xvt_cb_close();
}
break;
case M_EDIT_CLEAR:
reset();
ok = TRUE;
break;
default:
break;
}
return ok;
}
///////////////////////////////////////////////////////////
// Boolean_field
///////////////////////////////////////////////////////////

View File

@ -305,6 +305,9 @@ public:
// @cmember Gestisce la pressione del tasto (TRUE se la gestione ha avuto successo)
virtual bool on_key(KEY key);
// @cmember Gestisce un'operazione della clipboard (M_EDIT_CUT, M_EDITCOPY, M_EDITPASTE)
virtual bool on_clipboard(MENU_TAG mt);
// @cmember Setta il contenuto del campo inserendo la stringa <p s>
virtual void set(const char* s);
@ -654,6 +657,8 @@ public:
// @cmember Ritorna TRUE se il campo e' di tipo editable
virtual bool is_editable() const { return TRUE; }
virtual bool on_clipboard(MENU_TAG mt);
TEditable_field(TMask* m);
virtual ~TEditable_field();
};

View File

@ -263,7 +263,7 @@ public:
// @cmember Ritorna se e' possibile lasciare il focus dallo spreadsheet (TRUE se e' possibile)
bool test_focus_change();
// @cmember Setta il membro <p _notify> al valore <p n>
void set_notify(SPREADSHEET_NOTIFY n)
{ _notify = n; }
@ -821,10 +821,10 @@ void TSpreadsheet::notify_change()
_edit_field = cell2field(NULL); // Ricalcola correttamente il campo corrente
notify(_cur_rec, K_SPACE);
_row_dirty = _cell_dirty = TRUE;
xvt_statbar_refresh();
set_dirty();
}
_row_dirty = _cell_dirty = TRUE; // Era tra le graffe
}
const char* TSpreadsheet::copy_cell2field(XI_OBJ* cell)
@ -2029,7 +2029,6 @@ void TSpreadsheet::str2mask(int riga)
owner().row2mask(riga, r);
}
// Certified 100%
bool TSpreadsheet::notify(int rec, KEY k)
{
@ -2080,7 +2079,6 @@ KEY TSpreadsheet::edit(int n)
// TSheet_field
///////////////////////////////////////////////////////////
// Certified 100%
TSheet_field::TSheet_field(TMask* m)
: TLoadable_field(m), _append(TRUE),

View File

@ -105,6 +105,7 @@ public:
// @cmember Gestisce la pressione del tasto (TRUE se la gestione ha avuto successo)
virtual bool on_key(KEY k);
// @cmember Si, sono uno spreadsheet
virtual bool is_sheet() const { return TRUE; }
// @cmember Legge automaticamente la linea dal record array assegnato

View File

@ -39,6 +39,7 @@ TIndwin::TIndwin(long max, const char* txt, bool cancel, bool bar, int div)
set_win(create_interface(TASK_WIN, -1, -1, hor, ver, TITLE_TEXT, this, FALSE));
_text = new TMultiline_control(win(), DLG_NULL, 1, 1, hor-2, lines+1, 512, "CD", "");
_text->set_read_only();
testo.replace('\n', '\r');
_text->set_caption(testo);
@ -118,16 +119,30 @@ void TIndwin::update_bar()
r.bottom = r.top + 2*CHARY;
RCT b = r;
// Rettangolo in rilievo
b.right = b.left + int((r.right-r.left)*prc);
// xi_draw_3d_rect(w, &b, FALSE, 2, 0, 0, 0);
xi_draw_3d_rect(w, &b, FALSE, 2,
BTN_LIGHT_COLOR, BTN_BACK_COLOR, BTN_DARK_COLOR);
// Rettangolo scavato
b.left = b.right; b.right = r.right;
// xi_draw_3d_rect(w, &b, TRUE, 2, 0, 0, 0);
xi_draw_3d_rect(w, &b, TRUE, 2,
BTN_LIGHT_COLOR, BTN_BACK_COLOR, BTN_DARK_COLOR);
if (CAMPI_SCAVATI)
{
// Rettangolo scavato
xi_draw_3d_rect(w, &r, TRUE, 2,
BTN_LIGHT_COLOR, BTN_BACK_COLOR, BTN_DARK_COLOR);
b.left += 2; b.right -= 1;
b.top += 2; b.bottom -= 1;
// Rettangolo in rilievo
b.right = b.left + int((b.right-b.left)*prc);
xi_draw_3d_rect(w, &b, FALSE, 2,
BTN_LIGHT_COLOR, BTN_BACK_COLOR, BTN_DARK_COLOR);
}
else
{
// Rettangolo in rilievo
b.right = b.left + int((r.right-r.left)*prc);
xi_draw_3d_rect(w, &b, FALSE, 2,
BTN_LIGHT_COLOR, BTN_BACK_COLOR, BTN_DARK_COLOR);
// Rettangolo scavato
b.left = b.right; b.right = r.right;
xi_draw_3d_rect(w, &b, TRUE, 2,
BTN_LIGHT_COLOR, BTN_BACK_COLOR, BTN_DARK_COLOR);
}
char n[8]; sprintf(n, "%d%%", (int)floor(prc * 100.0 + 0.5));
xvt_dwin_draw_text(w, r.left+r.right/2-CHARX, (r.bottom+r.top+CHARY)/2-3, n, -1);

View File

@ -13,6 +13,7 @@
#ifndef __CONTROLS_H
class TControl;
class TField_control;
#endif
// @doc EXTERNAL
@ -32,7 +33,7 @@ class TIndwin : public TWindow
IND_FINISHED= 0x02 };
// @cmember:(INTERNAL) Testo da inserire nella finestra
TControl* _text;
TField_control* _text;
// @cmember:(INTERNAL) Bottone "Annulla"
TControl* _cancel;
// @cmember:(INTERNAL) Movimento della barra e percentuale

View File

@ -80,7 +80,7 @@ enum TIsamerr {
_isfileovf = 203, // @emem Overflow del file
_iskeynotfound = 204, // @emem Chiave non trovata
_isemptyfile = 205, // @emem File vuoto
_isdupkey = 206, // @emem Chiave duplicata
_isdupkey = 206, // @emem Chiave secondaria duplicata
_isnocurkey = 207, // @emem Non esiste la chiave corrente
_iskeyrangeerr = 211, // @emem Valore errato della chiave
_iskeyerr = 212, // @emem Errore generico della chiave
@ -93,7 +93,7 @@ enum TIsamerr {
_isnotcurr = 221, // @emem Non esiste il record corrente
_isalropen = 222, // @emem File gia' aperto
_isdeadlock = 223, // @emem Condizione di deadlock
_isreinsert = 224, // @emem Chiave duplicata su indici diversi da 1
_isreinsert = 224, // @emem Chiave primaria duplicata
_islocked = 225} ; // @emem Record bloccato
typedef long TRecnotype;

View File

@ -1425,7 +1425,7 @@ void TBrowse_sheet::handler(
{
case M_EDIT_UNDO:
sheet().set_columns_order(NULL);
case M_EDIT_COPY:
case M_EDIT_CLEAR:
sheet().save_columns_order(field());
return;
default:

View File

@ -6,19 +6,20 @@
#endif
/* @M
Identificatori (tag) per i menu' e le voci dei menu' ad uso di URL
Identificatori (tag) per i menu e le voci dei menu ad uso di URL
*/
#define TASK_MENUBAR 10000
#define MENU_BAR(i) (10000+i)
#define MENU_BAR(i) (10001+i)
#define BAR_ITEM(i) (5000+100*i)
#define MENU_ITEM(i) (30000+i)
#define VISWIN_BAR (7000)
#define BROWSE_BAR (8000)
#define MENU_VISWIN 7100
#define MENU_VISWIN 7001
#define MENU_VISWIN_EDIT 7002
#define MENU_FILE BAR_ITEM(0)
#define MENU_FILE M_FILE
#define M_EDIT_SEARCH (M_EDIT+8)
#define M_EDIT_DELETE (M_EDIT+9)

View File

@ -601,12 +601,6 @@ void TViswin::repos_buttons ()
{
if (_toplevel)
{
// autoscroll(FALSE);
// set_mode(M_COPY);
// set_brush(BACKGROUND);
// bar(5, rows()-BUTTONROW_SIZE, columns()+1, rows()+1);
// autoscroll(TRUE);
for (int i = 0; i < _modules.items(); i++)
((TImage&)_modules[i]).set_pos(4, 4+int(rows()-BUTTONROW_SIZE)*CHARY);

View File

@ -177,16 +177,20 @@ HIDDEN void xvt_menu_enable(MENU_ITEM* m, bool on)
{
while (m->tag)
{
/*
switch(m->tag)
{
case MENU_FILE: // Leave it as is
case M_FONT:
case -1: // Separator
case M_DEFAULT_SEPARATOR:
break;
default:
xvt_menu_set_item_enabled(TASK_WIN, m->tag, on);
break;
}
*/
if (m->tag > BAR_ITEM(0) && m->tag < BAR_ITEM(16))
xvt_menu_set_item_enabled(TASK_WIN, m->tag, on);
m++;
}
}

View File

@ -17,8 +17,17 @@ extern "C" { long nap(long period); }
// ERROR HOOK che intercetta errori XVT
// put breakpoint here
BOOLEAN error_hook(XVT_ERRMSG err, DATA_PTR)
static bool _ignore_errors = FALSE;
void ignore_xvt_errors(bool ie)
{
_ignore_errors = ie;
}
BOOLEAN error_hook(XVT_ERRMSG err, DATA_PTR)
{
if (_ignore_errors)
return TRUE;
const XVT_ERRSEV sev = xvt_errmsg_get_sev_id(err);
#ifdef DBG
return FALSE;

View File

@ -40,6 +40,8 @@ WINDOW xvt_create_window
void do_events();
void set_xvt_hooks();
void ignore_xvt_errors(bool ie);
void customize_colors();
void customize_controls(bool on);
@ -61,7 +63,6 @@ WINDOW xvt_create_window
};
void xvt_set_font(WINDOW win, const char* family, int style, int dim = 0);
bool xvt_test_menu_tag(MENU_TAG tag);
COLOR trans_color(char c);