Patch level : 10.0

Files correlati     : agalib.lib
Ricompilazione Demo : [ ]
Commento            :
Aggiunto valore di ritorno agli handler delle finestre
void TWindow::handler(WINDOW win, EVENT* e)
e' diventato
long TWindow::handler(WINDOW win, EVENT* e)


git-svn-id: svn://10.65.10.50/trunk@19478 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2009-10-20 15:22:22 +00:00
parent 69d1f20de3
commit 3d6a0f9bae
31 changed files with 249 additions and 178 deletions

View File

@ -137,14 +137,14 @@ class TAVM_list_window : public TField_window
protected:
virtual void update();
virtual void handler(WINDOW win, EVENT* ep);
virtual long handler(WINDOW win, EVENT* ep);
public:
void set_bytecode(const TBytecode* bc, int ip, const TString_array& uw);
TAVM_list_window(int x, int y, int dx, int dy, WINDOW parent, TWindowed_field* owner);
};
void TAVM_list_window::handler(WINDOW win, EVENT* ep)
long TAVM_list_window::handler(WINDOW win, EVENT* ep)
{
if (ep->type == E_MOUSE_DOWN)
{
@ -156,7 +156,7 @@ void TAVM_list_window::handler(WINDOW win, EVENT* ep)
force_update();
}
}
TField_window::handler(win, ep);
return TField_window::handler(win, ep);
}
void TAVM_list_window::update()

View File

@ -12,14 +12,9 @@ bool TAutomask::error_box(const char* fmt, ...)
va_end(argptr);
if (is_sheetmask() && !is_running())
{
xvtil_statbar_set(msg);
beep(2);
}
get_sheet()->error_box(msg);
else
{
post_error_message(msg, 3);
}
return false;
}

View File

@ -11,6 +11,8 @@ BEGIN
MESSAGE SHOW,MSK_PRINTERS|HIDE,MSK_FILENAME
ITEM "1|File su disco"
MESSAGE HIDE,MSK_PRINTERS|SHOW,MSK_FILENAME
ITEM "4|Acrobat"
MESSAGE SHOW,MSK_PRINTERS|HIDE,MSK_FILENAME
FLAGS "Z"
END

View File

@ -895,7 +895,7 @@ bool ini_set_bool(int cfg, const char* paragraph, const char* name, bool val, in
const TString& get_oem_info(const char* varname)
{
static int oem = ini_get_int(CONFIG_OEM, "MAIN", "OEM");
TString8 para; para.format("OEM_%d", oem);
return ini_get_string(CONFIG_OEM, para, varname);
TString& tmp = get_tmp_string(50);
xvt_sys_get_oem_string(varname, tmp, tmp.get_buffer(), tmp.size());
return tmp;
}

View File

@ -193,5 +193,6 @@ bool ini_set_int (int cfg, const char* para, const char* name, int v
bool ini_set_string(int cfg, const char* para, const char* name, const char* val, int idx = -1);
const TString& get_oem_info(const char* varname); // ini_get_string(CONFIG_OEM, "OEM_?", varname);
bool is_aga_version(bool power_user_only = false);
#endif

View File

@ -769,7 +769,7 @@ bool TDongle::burn_hardlock()
{
memcpy(data, &_eprom[60], sizeof(data));
garble(data);
if (data[0] < 1997 || data[0] > 2997)
if (data[0] < 2001 || data[0] > 3001)
return error_box("On Line Assistance error.");
if (data[1] == 0 || data[1] >= 10000)
return error_box("Bad users number.");

View File

@ -4569,8 +4569,8 @@ void TForm::read(
// read base form
TFilename n(_name); n.ext("frm");
n.custom_path();
if (n.exist())
if (n.custom_path())
{
_filename = n;
printer().set_form_name(n);
@ -4585,16 +4585,15 @@ void TForm::read(
TString filter(80);
ok = parse_use(scanner, filter);
while (ok && scanner.popkey() == "JO" || scanner.key() == "SO")
while (ok)
{
if (scanner.key() == "JO")
ok = parse_join(scanner);
else // join a sorted file
{
ok= parse_sortedjoin(scanner);
}
const TString& k = scanner.popkey();
if (k == "JO") ok = parse_join(scanner); else
if (k == "SO") ok = parse_sortedjoin(scanner);
else
break;
}
if (!filter.empty())
if (filter.full())
_cursor->setfilter(filter);
parse_description(scanner); // Parse description
}

View File

@ -508,7 +508,7 @@ class TGolem_window : public TField_window
protected:
virtual bool on_key(KEY k);
virtual void update();
virtual void handler(WINDOW win, EVENT* ep);
virtual long handler(WINDOW win, EVENT* ep);
public:
@ -633,7 +633,7 @@ bool TGolem_window::on_key(KEY k)
return TField_window::on_key(k);
}
void TGolem_window::handler(WINDOW win, EVENT* ep)
long TGolem_window::handler(WINDOW win, EVENT* ep)
{
switch (ep->type)
{
@ -679,7 +679,7 @@ void TGolem_window::handler(WINDOW win, EVENT* ep)
default:
break;
}
TField_window::handler(win, ep);
return TField_window::handler(win, ep);
}
TGolem_window::TGolem_window(int x, int y, int dx, int dy, WINDOW parent, TGolem_client_field* owner)

View File

@ -239,7 +239,7 @@ bool rpc_UserLogin(const char* server, const char* user,
if (_client == NULL)
{
if (!rpc_Start())
return FALSE;
return false;
}
const bool local = server == NULL || *server == '\0' ||
@ -308,7 +308,7 @@ bool rpc_UserLogout(const char* appname)
_connection = 0;
}
return TRUE;
return true;
}
bool http_isredirected_server(TString& server,
@ -330,10 +330,7 @@ bool http_isredirected_server(TString& server,
return ok;
}
bool http_get(const char* server,
const char* remote_file,
const char* local_file,
const char* authorization)
bool http_get(const char* server, const char* remote_file, const char* local_file, const char* authorization)
{
TSocketClient client;
if (!client.IsOk())

View File

@ -71,8 +71,12 @@ TMask::TMask(const char* title, int pages, int cols, int rows,
init_mask();
if (pages > 1)
{
WINDOW w = create_interface(parent, xpos, ypos, cols, rows, title, this);
set_win(w); // Crea la pagina principale che ospitera' il notebook
//WINDOW w = create_interface(parent, xpos, ypos, cols, rows, title, this);
//set_win(w); // Crea la pagina principale che ospitera' il notebook
const WIN_TYPE wt = (cols == 0) ? W_PLAIN : W_DOC;
const long wsf = WSF_INVISIBLE | WSF_NO_MENUBAR;
create(xpos, ypos, cols, rows, title, wsf, wt);
create_book(false); // Crea il notebook che ospitera' le pagine
for (int p = 1; p <= pages; p++)
{
@ -782,7 +786,7 @@ void TMask::on_button(short)
/* Non devo fare niente !!! non essendo una TWindow */
}
void TMask::handler(WINDOW w, EVENT* ep)
long TMask::handler(WINDOW w, EVENT* ep)
{
static TSheet_field* _last_sheet = NULL;
@ -817,7 +821,7 @@ void TMask::handler(WINDOW w, EVENT* ep)
xvt_res_free_menu_tree(menu);
}
}
return;
return 0L;
}
if (ep->type == E_COMMAND)
{
@ -832,12 +836,12 @@ void TMask::handler(WINDOW w, EVENT* ep)
case 4: _last_sheet->esporta(); break;
default: break;
}
return;
return 0L;
}
if (tag == M_HELP_ONCONTEXT)
{
on_key(K_F1);
return;
return 0L;
}
}
@ -868,11 +872,16 @@ void TMask::handler(WINDOW w, EVENT* ep)
case WC_NOTEBK:
if (ep->v.ctl.ci.win == _notebook)
{
const int new_page = ep->v.ctl.ci.v.notebk.tab_no;
const int new_page = ep->v.ctl.ci.v.notebk.page_new;
if (new_page != _page && new_page < _pages) // Cambio pagina effettivo
{
if (fld(_focus).on_key(K_TAB))
bool can_proceed = true;
if (_focus >= 0 && find_parent_page(fld(_focus)) != new_page)
can_proceed = check_current_field();
if (can_proceed)
show_page(new_page);
else
return 1;
}
}
break;
@ -902,7 +911,7 @@ void TMask::handler(WINDOW w, EVENT* ep)
break;
}
}
return;
return 0L;
}
if (ep->type == E_UPDATE && w == page_win(0))
@ -927,7 +936,7 @@ void TMask::handler(WINDOW w, EVENT* ep)
}
}
TWindow::handler(w, ep);
return TWindow::handler(w, ep);
}
@ -1241,8 +1250,9 @@ WINDOW TMask::create_book(bool single)
WINDOW parent = win();
if (parent == NULL_WIN)
{
parent = create_interface(NULL_WIN, 0, 0, 0, 0, "", this);
set_win(parent);
//parent = create_interface(NULL_WIN, 0, 0, 0, 0, "", this);
//set_win(parent);
parent = create(0, 0, 0, 0, "", WSF_INVISIBLE|WSF_NO_MENUBAR, W_PLAIN);
}
if (single)
{
@ -1856,12 +1866,9 @@ void TMask::on_idle()
set_focus();
switch(_error_severity)
{
case 2:
warning_box("%s", (const char*)_error_message); break;
case 3:
error_box("%s", (const char*)_error_message); break;
default:
message_box("%s", (const char*)_error_message); break;
case 2: xvt_dm_popup_warning(_error_message); break;
case 3: xvt_dm_popup_error (_error_message); break;
default: xvt_dm_popup_message(_error_message); break;
}
_error_severity = 0;
}
@ -2584,8 +2591,8 @@ TTimed_box::TTimed_box(const char * header,const char * message,int seconds,shor
: TMask(header,1,x,y)
{
// costruisce una maschera run time
add_memo(FIRST_FIELD, 0, "", 1, 0,-1,-3);
set(FIRST_FIELD, message);
TMemo_field& m = add_memo(DLG_NULL, 0, "", 1, 0,-1,-3);
m.set(message);
// setta il timer per l'evento
_timer_delay=seconds * 1000 + 1;
@ -2601,11 +2608,11 @@ void TTimed_box::start_run()
TMask::start_run();
}
void TTimed_box::handler(WINDOW win, EVENT* ep)
long TTimed_box::handler(WINDOW win, EVENT* ep)
{
if (ep->type == E_TIMER && ep->v.timer.id==_timer_id)
send_key(K_SPACE, _button_id);
TMask::handler(win, ep);
return TMask::handler(win, ep);
}
TTimed_box::~TTimed_box()
@ -2654,3 +2661,4 @@ TYesnoallnone_box::TYesnoallnone_box(const char * message, int default_key)
TYesnoallnone_box::~TYesnoallnone_box()
{}

View File

@ -41,7 +41,7 @@ class TMask : public TWindow
enum { MAX_PAGES = 16 };
// @cmember Gestisce gli eventi della finestra
virtual void handler(WINDOW win, EVENT* ep);
virtual long handler(WINDOW win, EVENT* ep);
// @access:(INTERNAL) Private Member
private:
@ -464,9 +464,11 @@ class TTimed_box: public TMask
long _timer_delay;
long _timer_id;
short _button_id;
protected:
virtual void handler(WINDOW win, EVENT* ep);
virtual long handler(WINDOW win, EVENT* ep);
virtual void start_run();
public:
TTimed_box(const char * header,const char * message,int seconds,short button_id,int x,int y);
~TTimed_box();

View File

@ -1659,7 +1659,7 @@ class TField_window : public TScroll_window
protected:
virtual void update();
virtual void handler(WINDOW win, EVENT* ep);
virtual long handler(WINDOW win, EVENT* ep);
void set_owner(TWindowed_field* o);
public:

View File

@ -2560,11 +2560,13 @@ bool TSpreadsheet::add_row_auto()
bool TSpreadsheet::error_box(const char* msg)
{
_check_enabled = false;
xvt_dm_post_speech(msg, 0, TRUE);
const int r = _cur_row;
const int c = _cur_col;
::error_box(msg);
xvt_scr_set_focus_vobj(parent());
xvt_dm_popup_error(msg); // was xvt_dm_post_error(msg);
TMask& m = owner().mask();
m.set_focus_field(owner().dlg());
set_focus_cell(r, c);
xvt_win_set_caret_visible(parent(), true);
_check_enabled = true;
@ -3152,8 +3154,6 @@ bool TSheet_field::on_key(KEY k)
s->add_row_auto();
return true;
}
return TOperable_field::on_key(k);
}

View File

@ -2,6 +2,7 @@
#include <automask.h>
#include <config.h>
#include <golem.h>
#include <execp.h>
#include <printer.h>
#include <printwin.h>
#include <toolfld.h>
@ -228,9 +229,11 @@ TPrinter_setup_mask::TPrinter_setup_mask()
_skip_events = true;
if (pr._printertype == fileprinter)
set (MSK_TYPE, "1");
set(MSK_TYPE, "1");
else if (pr._printertype == screenvis)
set(MSK_TYPE, "2");
else if (pr._printertype == acrobatprinter)
set(MSK_TYPE, "4");
else
set(MSK_TYPE, "0");
@ -1402,6 +1405,7 @@ void TPrinter::read_configuration(
case 1: _printertype = fileprinter; break;
case 2: _printertype = screenvis; break;
case 3: _printertype = exportprinter; break;
case 4: _printertype = acrobatprinter; break;
default: _printertype = winprinter; break;
}
}
@ -1559,11 +1563,12 @@ bool TPrinter::printrow(
if (_currentpage < _frompage || _currentpage > _topage)
return true;
TString rw (rowtoprint == NULL ? "" : ((_printertype == screenvis || _printertype == winprinter ||
_printertype == exportprinter) ?
rowtoprint->row_codified () :
rowtoprint->row ()));
rw.rtrim();
TString rw;
if (rowtoprint != NULL)
{
rw = (_printertype == fileprinter) ? rowtoprint->row() : rowtoprint->row_codified();
rw.rtrim();
}
int lun = rw.len ();
int idx;
@ -1815,6 +1820,8 @@ bool TPrinter::set()
break;
case 2: // video
_printertype = screenvis; break;
case 4: // acrobat
_printertype = acrobatprinter; break;
default: // stampante
_printertype = winprinter; break;
}
@ -1905,7 +1912,6 @@ bool TPrinter::print_txt(TTextfile& txt)
return ok;
}
bool TPrinter::print_pdf(TTextfile& txt, const TFilename& pdf)
{
bool ok = txt.lines() > 0;
@ -1932,6 +1938,21 @@ bool TPrinter::print_pdf(TTextfile& txt, const TFilename& pdf)
return ok;
}
bool TPrinter::acrobatically_print_pdf(const TFilename& pdf) const
{
TString cmd(512);
bool ok = xvt_sys_find_editor(pdf, cmd.get_buffer()) != FALSE;
if (ok)
{
// /s=suppress banner; /t=file name + printer name
cmd << " /s /t \"" << pdf << "\" \"" << printername() << "\"";
xvt_sys_execute(cmd, TRUE, FALSE);
}
else
error_box(TR("Adobe Acrobat non installato"));
return ok;
}
void TPrinter::close ()
{
@ -1945,25 +1966,27 @@ void TPrinter::close ()
_fp = NULL;
}
if (_printertype == screenvis)
switch (_printertype)
{
_vf->close_print();
const KEY key = _vf->run();
if (_vf->is_open())
_vf->close_modal();
_bookmarks.destroy();
if (key == K_CTRL+'S')
case winprinter:
if (_txt.lines() > 0L)
print_txt(_txt);
break;
case fileprinter:
{
_isopen = false;
_currentrow = _currentpage = 1;
print_txt(_vf->text());
FILE* fp = fopen(_printerfile, _appendfile ? "a" : "w");
if (fp == NULL)
{
error_box(FR("Impossibile aprire il file %s"), (const char*)_printerfile);
return;
}
for (long i = 0; i < _txt.lines(); i++)
fprintf(fp,"%s\n", _txt.line(i));
fclose(fp);
message_box(FR("Stampa su file terminata. Nome archivio: %s"),(const char *)_printerfile);
}
delete _vf; _vf = NULL;
}
else if (_printertype == exportprinter)
{
break;
case exportprinter:
if (_exportfile.not_empty() && _txt.lines() > 0L)
{
ofstream txt(_exportfile);
@ -1971,23 +1994,35 @@ void TPrinter::close ()
txt << _txt.line_formatted(i) << '\n';
txt.close();
}
}
else if (_printertype == winprinter && _txt.lines() > 0L)
{
print_txt(_txt);
}
else if (_printertype == fileprinter)
{
FILE* fp = fopen(_printerfile, _appendfile ? "a" : "w");
if (fp == NULL)
break;
case acrobatprinter:
{
error_box(FR("Impossibile aprire il file %s"), (const char*)_printerfile);
return;
TWait_cursor hourglass;
TFilename fn; fn.tempdir(); fn.add("tmp.pdf");
if (print_pdf(_txt, fn))
acrobatically_print_pdf(fn);
fn.fremove();
}
for (long i = 0; i < _txt.lines(); i++)
fprintf(fp,"%s\n", _txt.line(i));
fclose(fp);
message_box(FR("Stampa su file terminata. Nome archivio: %s"),(const char *)_printerfile);
break;
case screenvis:
default:
{
_vf->close_print();
const KEY key = _vf->run();
if (_vf->is_open())
_vf->close_modal();
_bookmarks.destroy();
if (key == K_CTRL+'S')
{
_isopen = false;
_currentrow = _currentpage = 1;
print_txt(_vf->text());
}
delete _vf; _vf = NULL;
}
break;
}
if (_finker)

View File

@ -33,7 +33,8 @@ enum TPrtype
winprinter = 0, // @emem Stampa su stampante normale
fileprinter = 1, // @emem Stampa su file
screenvis = 2, // @emem Anteprima a video
exportprinter = 3 // @emem Esporatzione di stampa
exportprinter= 3, // @emem Esportazione di stampa
acrobatprinter=4, // @emem Stampa tramite Acrobat
};
// @doc EXTERNAL
@ -421,6 +422,8 @@ public:
bool print_txt(TTextfile& txt);
// @cmember Stampa il testo su pdf
bool print_pdf(TTextfile& txt, const TFilename& fn);
// @cmember Stampa il pdf con Acrobat
bool acrobatically_print_pdf(const TFilename& pdf) const;
// @cmember Setta l'handle dell'header
void setheaderhandler(PRINTSECTIONHANDLER h)

View File

@ -277,7 +277,7 @@ bool TProgind::setstatus(long l)
// TTimerind ------------------------------------------------------------
void TTimerind::handler(WINDOW w, EVENT* e)
long TTimerind::handler(WINDOW w, EVENT* e)
{
switch(e->type)
{
@ -296,7 +296,7 @@ void TTimerind::handler(WINDOW w, EVENT* e)
default:
break;
}
TIndwin::handler(w,e);
return TIndwin::handler(w,e);
}
TTimerind::TTimerind(long msec, const char* txt, bool cancel, bool bar, int div, int i)

View File

@ -145,7 +145,7 @@ class TTimerind : public TIndwin
// @access Protected Member
protected:
// @cmember Gestisce gli eventi della finestra
virtual void handler(WINDOW w, EVENT* e);
virtual long handler(WINDOW w, EVENT* e);
// @access Public Member
public:

View File

@ -1636,8 +1636,8 @@ void real::print_on(ostream& out) const
void TDistrib::add(real slice)
{
if (slice > real (1.0))
slice /= 100.0;
if (slice > UNO)
slice /= CENTO;
CHECK (!_ready, "TDistrib: les jeux sont faits");
_slices.add (slice);
}
@ -1668,10 +1668,11 @@ void TDistrib::init (
// cambia solo il totale
{
_current = 0; _prog = 0;
_tot = r; _ready = FALSE;
_tot = r; _ready = false;
if (zap) _slices.destroy();
}
///////////////////////////////////////////////////////////
// Generic_distrib
// Oggetto per dividere un real in parti prefissate
@ -1688,7 +1689,7 @@ void TGeneric_distrib::add(real slice)
real TGeneric_distrib::get ()
{
_ready = TRUE;
_ready = true;
CHECK (_current < _slices.items(), "TGeneric_distrib: too many gets");
real & currslice = (real &) _slices[_current++];
real r = currslice;

View File

@ -338,15 +338,9 @@ extern const real ZERO;
extern const real UNO;
extern const real CENTO;
// @doc EXTERNAL
// @class TDistrib | Classe per dividere un <c real> in varie sue percentuali
// in modo che la loro somma dia sempre il real di partenza
//
// @base public | TObject
class TDistrib : public TObject
// @author:(INTERNAL) Guido
// @author:(INTERNAL) Villa
{
// @access:(INTERNAL) Private Member
@ -396,6 +390,7 @@ public:
{}
};
// @doc EXTERNAL
// @class TGeneric_distrib | Classe per dividere un real in parti fissate

View File

@ -1597,7 +1597,10 @@ void TRecordset_sheet::get_row(long r, TToken_string& row)
if (_query.move_to(r))
{
TString str;
for (unsigned int c = 0; c < _query.columns(); c++)
unsigned int cols = _query.sheet_head().items();
if (cols == 0)
cols = _query.columns();
for (unsigned int c = 0; c < cols; c++)
{
_query.get(c).as_string(str);
row.add(str);

View File

@ -5,13 +5,13 @@
#include <defmask.h>
#include <diction.h>
#include <dongle.h>
#include <execp.h>
#include <modaut.h>
#include <printer.h>
#include <progind.h>
#include <reprint.h>
#include <spotlite.h>
#include <statbar.h>
#include <treectrl.h>
#include <urldefid.h>
#include <utility.h>
#include <xvtility.h>
@ -256,7 +256,7 @@ protected:
const TReport_link* find_link(const PNT& pnt) const;
void draw_page(int pg);
virtual void handler(WINDOW win, EVENT* ep);
virtual long handler(WINDOW win, EVENT* ep);
virtual void update();
virtual bool on_key(KEY k);
@ -468,7 +468,7 @@ const TReport_link* TPrint_preview_window::find_link(const PNT& pnt) const
return NULL;
}
void TPrint_preview_window::handler(WINDOW win, EVENT* ep)
long TPrint_preview_window::handler(WINDOW win, EVENT* ep)
{
static PNT ptPan;
@ -565,9 +565,9 @@ void TPrint_preview_window::handler(WINDOW win, EVENT* ep)
}
break;
default:
TField_window::handler(win, ep);
break;
return TField_window::handler(win, ep);
}
return 0L;
}
void TPrint_preview_window::do_scroll(int kx, int ky)
@ -663,7 +663,7 @@ protected:
virtual bool on_key(KEY k);
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
virtual TMask_field* parse_field(TScanner& scanner);
virtual void handler(WINDOW win, EVENT* ep);
virtual long handler(WINDOW win, EVENT* ep);
public:
TPreview_mask(TBook* book);
@ -694,7 +694,7 @@ bool TPreview_mask::on_key(KEY k)
return TAutomask::on_key(k);
}
void TPreview_mask::handler(WINDOW win, EVENT* ep)
long TPreview_mask::handler(WINDOW win, EVENT* ep)
{
// Riflessione eventi di scroll
switch (ep->type)
@ -713,9 +713,9 @@ void TPreview_mask::handler(WINDOW win, EVENT* ep)
}
break;
default:
TAutomask::handler(win, ep);
break;
return TAutomask::handler(win, ep);
}
return 0L;
}
bool TPreview_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
@ -2073,9 +2073,10 @@ bool TBook::print(size_t pagefrom, size_t pageto, word copies)
if (pages() <= 0)
return false;
TPrinter& p = printer();
if (pagefrom == 0)
{
TPrinter& p = printer();
TMask msk("bagn003");
msk.set(F_PRINTER, p.printername());
msk.set(F_FORM, p.get_form_name());
@ -2089,7 +2090,7 @@ bool TBook::print(size_t pagefrom, size_t pageto, word copies)
msk.set(F_COPIES, 1);
if (msk.run() == K_ENTER)
{
_copies = msk.get_int(F_COPIES);
_copies = max(msk.get_int(F_COPIES), 1);
_pagefrom = msk.get_int(F_FROMPAGE);
_pageto = msk.get_int(F_TOPAGE);
}
@ -2100,11 +2101,28 @@ bool TBook::print(size_t pagefrom, size_t pageto, word copies)
{
_pagefrom = pagefrom;
_pageto = pageto;
_copies = copies;
_copies = max(copies, 1);
}
_pdf_file.cut(0);
return xvt_print_start_thread(main_loop_callback, (long)this) != 0;
bool ok = false;
if (p.printtype() == acrobatprinter)
{
TFilename f;
f.tempdir(); f.add("tmp.pdf");
f.fremove();
_pdf_file = f;
ok = xvt_print_start_thread(main_loop_callback, (long)this) != 0;
if (ok && fsize(f) > 0)
printer().acrobatically_print_pdf(f);
f.fremove();
}
else
{
_pdf_file.cut(0);
ok = xvt_print_start_thread(main_loop_callback, (long)this) != 0;
}
return ok;
}
bool TBook::export_pdf(TFilename& filename, bool signature)
@ -2123,9 +2141,9 @@ bool TBook::export_pdf(TFilename& filename, bool signature)
if (ok && signature && main_app().has_module(FDAUT)) // Controllo paranoico dei permessi
{
char outfile[_MAX_PATH] = "";
if (xvt_sign_file(filename, outfile))
if (xvt_sign_file(filename, outfile) && filename != outfile)
{
xvt_fsys_remove_file(filename); // Sbatto via il documento originale non firmato
filename.fremove(); // Sbatto via il documento originale non firmato
filename = outfile;
}
}
@ -2226,9 +2244,7 @@ bool TBook::print_or_preview()
bool ok = true;
switch (printer().printtype())
{
case screenvis:
ok = preview();
break;
case screenvis: ok = preview(); break;
case exportprinter:
{
TFilename f = printer().get_export_file();
@ -2237,9 +2253,17 @@ bool TBook::print_or_preview()
xvt_sys_goto_url(f, "open");
}
break;
default:
ok = print();
case acrobatprinter:
{
TFilename f; f.tempdir(); f.add("tmp.pdf");
if (export_pdf(f, false))
{
printer().acrobatically_print_pdf(f);
f.fremove();
}
}
break;
default: ok = print(); break;
}
return ok;
}

View File

@ -1719,7 +1719,7 @@ bool TBrowse_sheet::filter_handler(TMask_field& f, KEY k)
// @doc EXTERNAL
// @mfunc Gestisce l'handler della finestra
void TBrowse_sheet::handler(
long TBrowse_sheet::handler(
WINDOW win, // @parm Finestra da gestire
EVENT* ep) // @parm Evento da gestire nella finestra
{
@ -1739,7 +1739,7 @@ void TBrowse_sheet::handler(
dictionary_translate_menu(menu);
xvt_menu_popup(menu->child, win, ep->v.mouse.where, XVT_POPUP_LEFT_ALIGN, NULL);
xvt_res_free_menu_tree(menu);
return; // no default handling!
return 0L; // no default handling!
}
}
}
@ -1761,16 +1761,16 @@ void TBrowse_sheet::handler(
{
case 1:
save_columns_order(field());
return;
return 0L;
case 2:
set_columns_order(NULL);
return;
return 0L;
case 3:
fld(0).on_key(K_F11);
return;
return 0L;
case 4:
on_key(K_CTRL + 'E');
return;
return 0L;
default:
break;
}
@ -1779,7 +1779,7 @@ void TBrowse_sheet::handler(
break;
}
TCursor_sheet::handler(win, ep);
return TCursor_sheet::handler(win, ep);
}
bool lst_handler(TMask_field& lst, KEY k)

View File

@ -240,7 +240,7 @@ protected:
// @cmember Gestisce la pressione del tasto (vedi <mf TWindow::on_key>)
virtual bool on_key(KEY k);
// @cmember Gestisce gli eventi della finestra
virtual void handler(WINDOW win, EVENT* ep);
virtual long handler(WINDOW win, EVENT* ep);
// @cmember Ritorna il campo a cui si riferisce lo sheet
TEdit_field& field() { return _field; }

View File

@ -13,15 +13,7 @@
// TField_window
///////////////////////////////////////////////////////////
#ifndef INCL_XI
extern "C"
{
void xi_draw_3d_rect( WINDOW win, RCT* rctp, BOOLEAN well, int height,
COLOR color_light, COLOR color_ctrl, COLOR color_dark );
}
#endif
void TField_window::handler(WINDOW win, EVENT* ep)
long TField_window::handler(WINDOW win, EVENT* ep)
{
switch (ep->type)
{
@ -37,13 +29,13 @@ void TField_window::handler(WINDOW win, EVENT* ep)
if (ep->v.mouse.button == 1 && _owner != NULL)
{
_owner->on_key(K_F11);
return;
return 0L;
}
break;
default:
break;
}
TScroll_window::handler(win, ep);
return TScroll_window::handler(win, ep);
}
bool TField_window::on_key(KEY k)
@ -201,7 +193,7 @@ TWindowed_field::~TWindowed_field()
// TControl_host_window
///////////////////////////////////////////////////////////
void TControl_host_window::handler(WINDOW win, EVENT* ep)
long TControl_host_window::handler(WINDOW win, EVENT* ep)
{
switch (ep->type)
{
@ -215,12 +207,12 @@ void TControl_host_window::handler(WINDOW win, EVENT* ep)
break;
case E_UPDATE:
if (_ctrl != NULL_WIN)
return; // Inutile disegnare: _ctrl occupa tutta la client area
return 0L; // Inutile disegnare: _ctrl occupa tutta la client area
break;
default:
break;
}
TField_window::handler(win, ep);
return TField_window::handler(win, ep);
}
TControl_host_window::TControl_host_window(int x, int y, int dx, int dy,
@ -247,7 +239,7 @@ private:
protected: // TWindow
virtual void update();
virtual void handler(WINDOW win, EVENT* ep);
virtual long handler(WINDOW win, EVENT* ep);
virtual void force_update();
public:
@ -408,21 +400,24 @@ void TTree_window::update()
}
}
void TTree_window::handler(WINDOW win, EVENT* ep)
long TTree_window::handler(WINDOW win, EVENT* ep)
{
switch (ep->type)
{
case E_CONTROL:
if (ep->v.ctl.ci.type == WC_TREE && _tree != NULL)
{
handle_tree_event(ep);
return 0L;
}
break;
case E_UPDATE:
update(); // TControl_host_window non lo fa
return;
return 0L;
default:
break;
}
TControl_host_window::handler(win, ep);
return TControl_host_window::handler(win, ep);
}
bool TTree_window::select_current()
@ -599,7 +594,7 @@ TField_window* TTree_field::create_window(int x, int y, int dx, int dy, WINDOW p
class TOutlook_window : public TControl_host_window
{
public:
virtual void handler(WINDOW win, EVENT* ep);
virtual long handler(WINDOW win, EVENT* ep);
public:
int add_item(short icon, const char* text, int flags);
@ -610,7 +605,7 @@ public:
TOutlook_window(int x, int y, int dx, int dy, WINDOW parent, TOutlook_field* owner);
};
void TOutlook_window::handler(WINDOW win, EVENT* ep)
long TOutlook_window::handler(WINDOW win, EVENT* ep)
{
switch (ep->type)
{
@ -618,13 +613,13 @@ void TOutlook_window::handler(WINDOW win, EVENT* ep)
if (ep->v.ctl.ci.type == WC_OUTLOOKBAR)
{
owner().on_key(K_SPACE);
return;
return 0L;
}
break;
default:
break;
}
TControl_host_window::handler(win, ep);
return TControl_host_window::handler(win, ep);
}
int TOutlook_window::add_item(short icon, const char* text, int flags)

View File

@ -12,7 +12,7 @@ protected:
WINDOW _ctrl;
protected:
virtual void handler(WINDOW win, EVENT* ep);
virtual long handler(WINDOW win, EVENT* ep);
TControl_host_window(int x, int y, int dx, int dy,
WINDOW parent, TWindowed_field* owner);
};

View File

@ -606,6 +606,14 @@ bool is_power_station()
return ps != 0;
}
bool is_power_reseller(bool power_user_only)
{
bool yes = xvt_sys_get_oem_int("OEM", -1);
if (yes && power_user_only)
yes = is_power_station();
return yes;
}
bool expand_sys_vars(TString& str)
{
bool found = false;

View File

@ -51,6 +51,7 @@ istream& eatwhite (istream& i);
const TString& get_hostname();
bool is_power_station();
bool is_power_reseller(bool power_user_only = false);
long daytime();
bool expand_sys_vars(TString& str);

View File

@ -1326,7 +1326,7 @@ void TViswin::on_button(short dlg)
}
void TViswin::handler (WINDOW win, EVENT * ep)
long TViswin::handler (WINDOW win, EVENT * ep)
{
static bool ignore = FALSE;
@ -1855,7 +1855,7 @@ void TViswin::handler (WINDOW win, EVENT * ep)
if (_isselection)
display_selection ();
}
TWindow::handler (win, ep);
return TWindow::handler (win, ep);
}
bool TViswin::on_key(KEY key)

View File

@ -261,7 +261,7 @@ protected:
// @cmember Aggiorna la finestra di stampa
virtual void update();
// @cmember Gestisce l'handler della finestra (vedi <mf TWindow::handler>
virtual void handler(WINDOW win, EVENT* ep);
virtual long handler(WINDOW win, EVENT* ep);
// @cmember Controlla se e' stato selezionato la voce <p item> (parametro <p on>???)
void check_menu_item(MENU_TAG item, bool on = TRUE);

View File

@ -392,10 +392,11 @@ word TWindow::class_id() const
long TWindow::window_handler(WINDOW win, EVENT* ep)
{
long ret = 0;
TWindow* w = (TWindow*)xvt_vobj_get_data(win);
if (w != NULL)
w->handler(win, ep);
return 0L;
ret = w->handler(win, ep);
return ret;
}
// @doc EXTERNAL
@ -552,7 +553,7 @@ void TWindow::on_button(short dlg)
// @doc EXTERNAL
// @mfunc Gestisce l'handler della finestra
void TWindow::handler(
long TWindow::handler(
WINDOW win, // @parm Finestra da gestire
EVENT* ep) // @parm Evento da gestire nella finestra
{
@ -581,6 +582,7 @@ void TWindow::handler(
default:
break;
}
return 0L;
}
void TWindow::on_idle()
@ -1104,7 +1106,7 @@ void TScroll_window::update_thumb(
xvt_sbar_set_pos(win(), VSCROLL, int(_origin.y >> _shift));
}
void TScroll_window::handler(WINDOW win, EVENT* ep)
long TScroll_window::handler(WINDOW win, EVENT* ep)
{
if (ep->type == E_HSCROLL || ep->type == E_VSCROLL)
{
@ -1142,7 +1144,7 @@ void TScroll_window::handler(WINDOW win, EVENT* ep)
}
}
TWindow::handler(win, ep);
return TWindow::handler(win, ep);
}
bool TScroll_window::on_key(KEY key)

View File

@ -164,7 +164,7 @@ public:
virtual void on_button(short dlg);
// @cmember Gestisce gli eventi della finestra
virtual void handler(WINDOW win, EVENT* ep);
virtual long handler(WINDOW win, EVENT* ep);
// @cmember Mette la finestra in primo piano
virtual void set_focus();
@ -367,7 +367,7 @@ public:
virtual bool on_key(KEY key);
// @cmember Gestisce l'handler della finestra (vedi <mf TWindow::handler>)
virtual void handler(WINDOW win, EVENT* ep);
virtual long handler(WINDOW win, EVENT* ep);
// @cmember Setta punto di massimo scroll
void set_scroll_max(long maxx, long maxy);