Patch level : 2.1 nopatch
Files correlati : ba8.exe Ricompilazione Demo : [ ] Commento : Correzioni dell'ultimo minuto git-svn-id: svn://10.65.10.50/trunk@12008 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
3509dfabbb
commit
8015bd4fbe
@ -48,13 +48,14 @@ short str2num(const TString& str)
|
|||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// TFont_button_mask
|
// TReport_base_mask
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
class TFont_button_mask : public TAutomask
|
class TReport_base_mask : public TAutomask
|
||||||
{
|
{
|
||||||
TReport_font _font;
|
TReport_font _font;
|
||||||
bool _font_changed;
|
bool _font_changed;
|
||||||
|
TReport& _report;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
char _halign, _valign;
|
char _halign, _valign;
|
||||||
@ -67,10 +68,10 @@ public:
|
|||||||
void set_font_info(const TReport_font& font);
|
void set_font_info(const TReport_font& font);
|
||||||
bool get_font_info(TReport_font& font) const;
|
bool get_font_info(TReport_font& font) const;
|
||||||
|
|
||||||
TFont_button_mask(const char* name);
|
TReport_base_mask(const char* name, TReport& rep);
|
||||||
};
|
};
|
||||||
|
|
||||||
void TFont_button_mask::update()
|
void TReport_base_mask::update()
|
||||||
{
|
{
|
||||||
const TMask_field& fld = field(F_FONT_SELECT);
|
const TMask_field& fld = field(F_FONT_SELECT);
|
||||||
if (fld.active() && win() == fld.parent())
|
if (fld.active() && win() == fld.parent())
|
||||||
@ -95,7 +96,7 @@ void TFont_button_mask::update()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TFont_button_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
bool TReport_base_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
||||||
{
|
{
|
||||||
switch (o.dlg())
|
switch (o.dlg())
|
||||||
{
|
{
|
||||||
@ -128,18 +129,27 @@ bool TFont_button_mask::on_field_event(TOperable_field& o, TField_event e, long
|
|||||||
force_update();
|
force_update();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case F_PRESCRIPT:
|
||||||
|
case F_POSTSCRIPT:
|
||||||
|
if (e == fe_close)
|
||||||
|
{
|
||||||
|
TReport_script s;
|
||||||
|
s.set(o.get());
|
||||||
|
s.compile(_report);
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TFont_button_mask::set_font_info(const TReport_font& font)
|
void TReport_base_mask::set_font_info(const TReport_font& font)
|
||||||
{
|
{
|
||||||
_font = font;
|
_font = font;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TFont_button_mask::get_font_info(TReport_font& font) const
|
bool TReport_base_mask::get_font_info(TReport_font& font) const
|
||||||
{
|
{
|
||||||
const bool ok = _font_changed;
|
const bool ok = _font_changed;
|
||||||
if (ok)
|
if (ok)
|
||||||
@ -147,8 +157,9 @@ bool TFont_button_mask::get_font_info(TReport_font& font) const
|
|||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
TFont_button_mask::TFont_button_mask(const char* name)
|
TReport_base_mask::TReport_base_mask(const char* name, TReport& rep)
|
||||||
: TAutomask(name), _font_changed(false),
|
: TAutomask(name), _report(rep),
|
||||||
|
_font_changed(false),
|
||||||
_halign('C'), _valign('C'),
|
_halign('C'), _valign('C'),
|
||||||
_fgcolor(COLOR_BLACK), _bgcolor(COLOR_WHITE)
|
_fgcolor(COLOR_BLACK), _bgcolor(COLOR_WHITE)
|
||||||
{
|
{
|
||||||
@ -158,7 +169,7 @@ TFont_button_mask::TFont_button_mask(const char* name)
|
|||||||
// TReport_field_mask
|
// TReport_field_mask
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
class TReport_field_mask : public TFont_button_mask
|
class TReport_field_mask : public TReport_base_mask
|
||||||
{
|
{
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -173,7 +184,7 @@ public:
|
|||||||
void set_field(const TReport_field& rf);
|
void set_field(const TReport_field& rf);
|
||||||
void get_field(TReport_field& rf) const;
|
void get_field(TReport_field& rf) const;
|
||||||
|
|
||||||
TReport_field_mask() :TFont_button_mask("ba8300b") { }
|
TReport_field_mask(TReport_field& rf);
|
||||||
};
|
};
|
||||||
|
|
||||||
void TReport_field_mask::set_num(short id, long num)
|
void TReport_field_mask::set_num(short id, long num)
|
||||||
@ -202,7 +213,7 @@ void TReport_field_mask::update()
|
|||||||
i == 0 ? _fgcolor : _bgcolor, MASK_DARK_COLOR);
|
i == 0 ? _fgcolor : _bgcolor, MASK_DARK_COLOR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TFont_button_mask::update();
|
TReport_base_mask::update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TReport_field_mask::vedo_non_vedo()
|
void TReport_field_mask::vedo_non_vedo()
|
||||||
@ -287,7 +298,7 @@ bool TReport_field_mask::on_field_event(TOperable_field& o, TField_event e, long
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return TFont_button_mask::on_field_event(o, e, jolly);
|
return TReport_base_mask::on_field_event(o, e, jolly);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TReport_field_mask::set_field(const TReport_field& rf)
|
void TReport_field_mask::set_field(const TReport_field& rf)
|
||||||
@ -361,6 +372,12 @@ void TReport_field_mask::get_field(TReport_field& rf) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TReport_field_mask::TReport_field_mask(TReport_field& rf)
|
||||||
|
: TReport_base_mask("ba8300b", rf.section().report())
|
||||||
|
{
|
||||||
|
set_field(rf);
|
||||||
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// TReport_sheet
|
// TReport_sheet
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
@ -453,7 +470,7 @@ TReport_sheet::TReport_sheet(TReport_section& sec)
|
|||||||
// TSection_properties_mask
|
// TSection_properties_mask
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
class TSection_properties_mask : public TFont_button_mask
|
class TSection_properties_mask : public TReport_base_mask
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
|
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
|
||||||
@ -461,12 +478,11 @@ protected:
|
|||||||
short get_num(short id) const;
|
short get_num(short id) const;
|
||||||
|
|
||||||
void vedo_non_vedo();
|
void vedo_non_vedo();
|
||||||
|
void set_section(const TReport_section& rs);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void set_section(const TReport_section& rs);
|
|
||||||
void get_section(TReport_section& rs) const;
|
void get_section(TReport_section& rs) const;
|
||||||
|
TSection_properties_mask(TReport_section& rs);
|
||||||
TSection_properties_mask();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void TSection_properties_mask::set_num(short id, long num)
|
void TSection_properties_mask::set_num(short id, long num)
|
||||||
@ -511,7 +527,7 @@ bool TSection_properties_mask::on_field_event(TOperable_field& o, TField_event e
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return TFont_button_mask::on_field_event(o, e, jolly);
|
return TReport_base_mask::on_field_event(o, e, jolly);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TSection_properties_mask::set_section(const TReport_section& rs)
|
void TSection_properties_mask::set_section(const TReport_section& rs)
|
||||||
@ -568,28 +584,30 @@ void TSection_properties_mask::get_section(TReport_section& rs) const
|
|||||||
rs.set_postscript(get(F_POSTSCRIPT));
|
rs.set_postscript(get(F_POSTSCRIPT));
|
||||||
}
|
}
|
||||||
|
|
||||||
TSection_properties_mask::TSection_properties_mask()
|
TSection_properties_mask::TSection_properties_mask(TReport_section& rs)
|
||||||
: TFont_button_mask("ba8300c")
|
: TReport_base_mask("ba8300c", rs.report())
|
||||||
{ }
|
{
|
||||||
|
set_section(rs);
|
||||||
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// TReport_properties_mask
|
// TReport_properties_mask
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
class TReport_properties_mask : public TFont_button_mask
|
class TReport_properties_mask : public TReport_base_mask
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
|
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
|
||||||
|
void set_report(const TReport& r);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void set_report(const TReport& r);
|
|
||||||
void get_report(TReport& r) const;
|
void get_report(TReport& r) const;
|
||||||
TReport_properties_mask() : TFont_button_mask("ba8300d") { }
|
TReport_properties_mask(TReport& rep) : TReport_base_mask("ba8300d", rep) { set_report(rep); }
|
||||||
};
|
};
|
||||||
|
|
||||||
bool TReport_properties_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
bool TReport_properties_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
||||||
{
|
{
|
||||||
return TFont_button_mask::on_field_event(o, e, jolly);
|
return TReport_base_mask::on_field_event(o, e, jolly);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TReport_properties_mask::set_report(const TReport& r)
|
void TReport_properties_mask::set_report(const TReport& r)
|
||||||
@ -807,9 +825,8 @@ void TReport_mask::update_report() const
|
|||||||
void TReport_mask::add_field()
|
void TReport_mask::add_field()
|
||||||
{
|
{
|
||||||
TReport_section& rs = curr_section();
|
TReport_section& rs = curr_section();
|
||||||
TReport_field_mask m;
|
|
||||||
TReport_field* rf = new TReport_field(&rs);
|
TReport_field* rf = new TReport_field(&rs);
|
||||||
m.set_field(*rf);
|
TReport_field_mask m(*rf);
|
||||||
m.disable(DLG_DELREC);
|
m.disable(DLG_DELREC);
|
||||||
if (m.run() == K_ENTER)
|
if (m.run() == K_ENTER)
|
||||||
{
|
{
|
||||||
@ -824,8 +841,7 @@ void TReport_mask::add_field()
|
|||||||
void TReport_mask::edit_field(TReport_field& rf)
|
void TReport_mask::edit_field(TReport_field& rf)
|
||||||
{
|
{
|
||||||
TReport_section& rs = rf.section();
|
TReport_section& rs = rf.section();
|
||||||
TReport_field_mask m;
|
TReport_field_mask m(rf);
|
||||||
m.set_field(rf);
|
|
||||||
const KEY key = m.run();
|
const KEY key = m.run();
|
||||||
switch(key)
|
switch(key)
|
||||||
{
|
{
|
||||||
@ -938,8 +954,7 @@ void TReport_mask::add_section()
|
|||||||
void TReport_mask::section_properties()
|
void TReport_mask::section_properties()
|
||||||
{
|
{
|
||||||
TReport_section& rs = curr_section();
|
TReport_section& rs = curr_section();
|
||||||
TSection_properties_mask m;
|
TSection_properties_mask m(rs);
|
||||||
m.set_section(rs);
|
|
||||||
switch (m.run())
|
switch (m.run())
|
||||||
{
|
{
|
||||||
case K_ENTER:
|
case K_ENTER:
|
||||||
@ -966,8 +981,7 @@ void TReport_mask::section_properties()
|
|||||||
|
|
||||||
void TReport_mask::report_properties()
|
void TReport_mask::report_properties()
|
||||||
{
|
{
|
||||||
TReport_properties_mask m;
|
TReport_properties_mask m(_report);
|
||||||
m.set_report(_report);
|
|
||||||
if (m.run() == K_ENTER)
|
if (m.run() == K_ENTER)
|
||||||
{
|
{
|
||||||
m.get_report(_report);
|
m.get_report(_report);
|
||||||
|
@ -427,9 +427,9 @@ const TString& TReport_section::prescript() const
|
|||||||
|
|
||||||
void TReport_section::set_prescript(const char* src)
|
void TReport_section::set_prescript(const char* src)
|
||||||
{
|
{
|
||||||
|
_prescript.set(src);
|
||||||
TString desc; desc << type() << level() << " PRESCRIPT";
|
TString desc; desc << type() << level() << " PRESCRIPT";
|
||||||
_prescript.set_description(desc);
|
_prescript.set_description(desc);
|
||||||
_prescript.set(src);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const TString& TReport_section::postscript() const
|
const TString& TReport_section::postscript() const
|
||||||
@ -437,9 +437,9 @@ const TString& TReport_section::postscript() const
|
|||||||
|
|
||||||
void TReport_section::set_postscript(const char* src)
|
void TReport_section::set_postscript(const char* src)
|
||||||
{
|
{
|
||||||
|
_postscript.set(src);
|
||||||
TString desc; desc << type() << level() << " POSTSCRIPT";
|
TString desc; desc << type() << level() << " POSTSCRIPT";
|
||||||
_postscript.set_description(desc);
|
_postscript.set_description(desc);
|
||||||
_postscript.set(src);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TReport_section::unmap_font()
|
void TReport_section::unmap_font()
|
||||||
@ -766,20 +766,28 @@ void TReport_script::copy(const TReport_script& rs)
|
|||||||
set(rs.get());
|
set(rs.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool TReport_script::compile(TReport& rep)
|
||||||
|
{
|
||||||
|
if (_bc == NULL)
|
||||||
|
_bc = new TBytecode;
|
||||||
|
|
||||||
|
bool good = true;
|
||||||
|
if (_src.starts_with("MESSAGE "))
|
||||||
|
good = rep.compile(translate_message(), *_bc);
|
||||||
|
else
|
||||||
|
good = rep.compile(_src, *_bc);
|
||||||
|
_bc->set_name(_desc);
|
||||||
|
|
||||||
|
return good;
|
||||||
|
}
|
||||||
|
|
||||||
bool TReport_script::execute(TReport& rep, TString& output)
|
bool TReport_script::execute(TReport& rep, TString& output)
|
||||||
{
|
{
|
||||||
bool good = true;
|
bool good = true;
|
||||||
if (ok())
|
if (ok())
|
||||||
{
|
{
|
||||||
if (_bc == NULL)
|
if (_bc == NULL)
|
||||||
{
|
good = compile(rep);
|
||||||
_bc = new TBytecode;
|
|
||||||
if (_src.starts_with("MESSAGE "))
|
|
||||||
good = rep.compile(translate_message(), *_bc);
|
|
||||||
else
|
|
||||||
good = rep.compile(_src, *_bc);
|
|
||||||
_bc->set_name(_desc);
|
|
||||||
}
|
|
||||||
if (good)
|
if (good)
|
||||||
good = rep.execute(*_bc, output);
|
good = rep.execute(*_bc, output);
|
||||||
}
|
}
|
||||||
|
@ -120,6 +120,7 @@ public:
|
|||||||
const TString& get() const { return _src; }
|
const TString& get() const { return _src; }
|
||||||
void set_description(const char* d) { _desc = d; }
|
void set_description(const char* d) { _desc = d; }
|
||||||
|
|
||||||
|
bool compile(TReport& report);
|
||||||
bool execute(TReport& report, TString& output);
|
bool execute(TReport& report, TString& output);
|
||||||
bool execute(TReport_field& rf);
|
bool execute(TReport_field& rf);
|
||||||
|
|
||||||
|
@ -8,6 +8,8 @@
|
|||||||
#include "ba8201.h"
|
#include "ba8201.h"
|
||||||
#include "ba8303.h"
|
#include "ba8303.h"
|
||||||
|
|
||||||
|
static bool _print_aborted = false;
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// TPrint_preview_window
|
// TPrint_preview_window
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
@ -146,7 +148,10 @@ void TPrint_preview_window::handler(WINDOW win, EVENT* ep)
|
|||||||
default:processed = false; break;
|
default:processed = false; break;
|
||||||
}
|
}
|
||||||
if (processed)
|
if (processed)
|
||||||
|
{
|
||||||
|
_print_aborted = false;
|
||||||
force_update();
|
force_update();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -324,8 +329,6 @@ TPreview_mask::TPreview_mask(TPage_printer* printer)
|
|||||||
// TPage_printer
|
// TPage_printer
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
static bool _print_aborted = false;
|
|
||||||
|
|
||||||
const char* TPage_printer::form_name() const
|
const char* TPage_printer::form_name() const
|
||||||
{
|
{
|
||||||
return printer().get_form_name();
|
return printer().get_form_name();
|
||||||
@ -400,7 +403,8 @@ bool TPage_printer::main_loop()
|
|||||||
_page = 0;
|
_page = 0;
|
||||||
ok = print_loop();
|
ok = print_loop();
|
||||||
}
|
}
|
||||||
|
_print_aborted = false;
|
||||||
|
|
||||||
xvt_vobj_destroy(prwin);
|
xvt_vobj_destroy(prwin);
|
||||||
set_win(NULL_WIN);
|
set_win(NULL_WIN);
|
||||||
|
|
||||||
|
@ -535,6 +535,18 @@ bool TAVM::compile(istream& instr, TBytecode& bytecode)
|
|||||||
if (str == ";")
|
if (str == ";")
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
} else
|
||||||
|
if (str == "(")
|
||||||
|
{
|
||||||
|
TString256 str;
|
||||||
|
instr.getline(str.get_buffer(), str.size(), ')');
|
||||||
|
op = new TAVM_op(avm_nop);
|
||||||
|
} else
|
||||||
|
if (str == "\\")
|
||||||
|
{
|
||||||
|
TString256 str;
|
||||||
|
instr.getline(str.get_buffer(), str.size());
|
||||||
|
op = new TAVM_op(avm_nop);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user