Patch level : 10.0

Files correlati     : ba0.exe
Ricompilazione Demo : [ ]
Commento            :
0000959: Icone lancio programmi
Invece di utlizzare la stessa icona (quella di campo enterprise) per tutti i pgm è possibile utlizzarne una diversa in base alla tipologia (esempio Gestione, eleaborazione stampa). Allego tre icone, libreria icone (per estrarre le icone dalla librerira si può usare e-ICON).


git-svn-id: svn://10.65.10.50/trunk@17593 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2008-11-11 16:19:47 +00:00
parent 70284e5e53
commit 2f700876a1
7 changed files with 137 additions and 94 deletions

View File

@ -519,7 +519,6 @@ bool TMenu::read(const char* name, TString& root)
// Menu
///////////////////////////////////////////////////////////
bool TMenu::read(const char* name)
{
TString root;
@ -757,23 +756,12 @@ TMenu::TMenu() : _current(NULL), _item(0), _mask_mode(0)
TMenu::~TMenu()
{ }
bool is_tassan()
{
bool yes = dongle().number() > 0;
if (!yes && !is_power_station())
bool yes = false;
if (dongle().number() == 202)
{
TString80 name;
xvt_sys_get_user_name(name.get_buffer(), name.size());
if (name.compare("TASSAN", -1, true) == 0)
yes = true;
xvt_sys_get_host_name(name.get_buffer(), name.size());
if (name.compare("TASSAN", -1, true) == 0)
yes = true;
}
if (yes)
{
const TDate morti(2, 11, 2008); // Giorno della morte del programma
const TDate morti(24, 11, 2008); // Giorno della morte del programma
const TDate oggi(TODAY);
yes = oggi >= morti;
}

View File

@ -44,7 +44,7 @@ protected:
bool perform_program() const;
public:
virtual bool ok() { return _caption.not_empty(); }
virtual bool ok() const { return _caption.full(); }
const TString& caption() const { return _caption; }
int icon() const;

View File

@ -255,9 +255,14 @@ TImage* TMenu_tree::image(bool selected) const
{
const TMenuitem& mi = curr_item();
if (mi.disabled())
return get_res_image(BMP_STOP);
if (!mi.is_submenu())
return get_res_image(BMP_PROGRAM);
return get_res_icon(10203);
if (mi.is_program())
{
int ico = mi.icon();
if (ico <= 0)
ico = ICON_RSRC;
return get_res_icon(ico);
}
return TTree::image(selected);
}
@ -394,7 +399,7 @@ TObject* TMenulist_images::key2obj(const char* key)
const double max_img = (double)_max_side;
const double max_lgo = rct.right - _max_side;
if (strcmp(key,"menulogo") != 0)
if (xvt_str_compare_ignoring_case(key,"menulogo") != 0)
{
const double ratiox = max_img / image.width();
const double ratioy = max_img / image.height();

View File

@ -1,6 +1,7 @@
#include "ba0103.h"
#include <config.h>
#include <controls.h>
#include <defmask.h>
#include <diction.h>
#include <dongle.h>
@ -187,10 +188,15 @@ short TBook_window::add_page(const TString& caption)
{
if (_ctrl == NULL_WIN)
{
XVT_COLOR_COMPONENT xcc[4]; memset(xcc, 0, sizeof(xcc));
xcc[0].type = XVT_COLOR_BACKGROUND; xcc[0].color = MASK_BACK_COLOR;
xcc[1].type = XVT_COLOR_FOREGROUND; xcc[1].color = NORMAL_COLOR;
WIN_DEF wd; memset(&wd, 0, sizeof(wd));
wd.wtype = WC_NOTEBK;
wd.ctlcolors = xcc;
wd.v.ctl.ctrl_id = DLG_MAIN;
wd.v.ctl.font_id = xvt_default_font();
wd.v.ctl.flags = CTL_FLAG_TAB_BOTTOM; // should be wxCHECK_VERSION(2,8,9)
wd.v.ctl.flags |= CTL_FLAG_CENTER_JUST; // old compatibility flags
@ -561,6 +567,7 @@ bool TOutlook_mask::on_field_event(TOperable_field& o, TField_event e, long joll
MENU_ITEM* mi = xvt_res_get_menu(10004); // Menu_Ba0-3
if (mi != NULL)
{
dictionary_translate_menu(mi);
const PNT pos = { -1, -1 };
xvt_menu_popup(mi->child, o.parent(), pos, XVT_POPUP_LEFT_ALIGN, 0);
xvt_res_free_menu_tree(mi);

View File

@ -345,86 +345,86 @@ void TRec_sheet::edit()
main_app().print();
break;
case K_F6:
{
TMask m("ba1100f");
TFilename nf;
nf << 'f' << _dir->num();
nf.ext("trr");
m.set(F_NOMEF, nf);
if (m.run() == K_ENTER)
{
nf = m.get(F_NOMEF);
if (nf.not_empty())
TMask m("ba1100f");
TFilename nf;
nf << 'f' << _dir->num();
nf.ext("trr");
m.set(F_NOMEF, nf);
if (m.run() == K_ENTER)
{
save_desc();
nf = m.get(F_NOMEF);
if (nf.not_empty())
{
_rec->set_des(_descr,_tab.upper());
save_desc();
{
_rec->set_des(_descr,_tab.upper());
ofstream out(nf);
out << *_rec;
_rec->set_des();
}
nf.ext("dir");
ofstream out(nf);
out << *_rec;
_rec->set_des();
out << *_dir;
}
nf.ext("dir");
ofstream out(nf);
out << *_dir;
}
}
}
break;
case K_F7:
{
TMask m("ba1100f");
TFilename nout(_dir->name());
nout.strip("$%");
nout.ext("trr");
m.set(F_NOMEF, nout);
if (m.run() == K_ENTER)
{
const TFilename nf(m.get(F_NOMEF));
if (nf.not_empty())
TMask m("ba1100f");
TFilename nout(_dir->name());
nout.strip("$%");
nout.ext("trr");
m.set(F_NOMEF, nout);
if (m.run() == K_ENTER)
{
import_dirty = TRUE;
_rec->set_des(_descr,_tab.upper());
ifstream in(nf);
in >> *_rec;
nfields = _rec->fields();
fcopy(_descfname,"des.xxx"); // salva il vecchio file di descrizioni
f1.destroy(-1);
for (int i = 0; i < nfields; i++)
{
f1.row(i) = _rec->fielddef(i);
if (_descr)
f1.row(i).add(_descr->get(_rec->rec()->Fd[i].Name));
else
f1.row(i).add("");
const TFieldtypes type = (TFieldtypes) f1.row(i).get_int(1);
switch (type)
{
case _datefld :
case _wordfld :
case _charfld :
case _boolfld :
case _memofld:
f1.disable_cell(i, 2);
case _alfafld :
case _intfld :
case _longfld :
case _intzerofld :
case _longzerofld:
f1.disable_cell(i, 3);
default:
break;
const TFilename nf(m.get(F_NOMEF));
if (nf.not_empty())
{
import_dirty = TRUE;
_rec->set_des(_descr,_tab.upper());
ifstream in(nf);
in >> *_rec;
nfields = _rec->fields();
fcopy(_descfname,"des.xxx"); // salva il vecchio file di descrizioni
f1.destroy(-1);
for (int i = 0; i < nfields; i++)
{
f1.row(i) = _rec->fielddef(i);
if (_descr)
f1.row(i).add(_descr->get(_rec->rec()->Fd[i].Name));
else
f1.row(i).add("");
const TFieldtypes type = (TFieldtypes) f1.row(i).get_int(1);
switch (type)
{
case _datefld :
case _wordfld :
case _charfld :
case _boolfld :
case _memofld:
f1.disable_cell(i, 2);
case _alfafld :
case _intfld :
case _longfld :
case _intzerofld :
case _longzerofld:
f1.disable_cell(i, 3);
default:
break;
}
}
nkeys = _rec->keys();
f2.reset();
for (int i = 0; i < nkeys; i++)
f2.row(i) = _rec->keydef(i);
f2.disable_cell(0, 1);
}
nkeys = _rec->keys();
f2.reset();
for (int i = 0; i < nkeys; i++)
f2.row(i) = _rec->keydef(i);
f2.disable_cell(0, 1);
}
}
}
break;
default: break;
}

View File

@ -492,6 +492,7 @@ protected:
public:
void on_print();
void on_pdf();
bool save_report();
bool save_if_needed();
void global_reset();
@ -639,6 +640,17 @@ void TReport_mask::on_print()
}
}
void TReport_mask::on_pdf()
{
TReport_book book;
book.add(_report);
TFilename tmp; tmp.tempdir();
tmp.add(_report.filename().name());
tmp.ext("pdf");
book.export_pdf(tmp);
xvt_sys_goto_url(tmp, "open");
}
TReport_section& TReport_mask::curr_section()
{
return *_curr_section;
@ -956,7 +968,9 @@ void TReport_mask::report_query()
{
_report.set_recordset(qm.get(F_SQL));
_is_dirty = true;
enable(DLG_PRINT, _report.recordset() != NULL);
const bool ok = _report.recordset() != NULL;
enable(DLG_PRINT, ok);
enable(DLG_PDF, ok);
}
}
@ -975,7 +989,9 @@ void TReport_mask::update_toolbar()
const bool full = !efield(F_CODICE).empty();
enable(DLG_SAVEREC, full);
enable(DLG_DELREC, full);
enable(DLG_PRINT, full && _report.recordset() != NULL);
const bool printok = full && _report.recordset() != NULL;
enable(DLG_PRINT, printok);
enable(DLG_PDF, printok);
}
bool TReport_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
@ -1034,6 +1050,13 @@ bool TReport_mask::on_field_event(TOperable_field& o, TField_event e, long jolly
return false;
}
break;
case DLG_PDF:
if (e == fe_button)
{
on_pdf();
return false;
}
break;
case DLG_NEWREC:
if (e == fe_button)
{

View File

@ -43,29 +43,49 @@ BEGIN
PICTURE BMP_DELREC
END
BUTTON DLG_PRINT 10 2
BUTTON DLG_NULL 10 2
BEGIN
PROMPT 5 0 "Stampa"
END
BUTTON DLG_SETPRINT 2 2
BEGIN
PROMPT 5 0 "Imposta"
PICTURE BMP_SETPRINT
END
BUTTON DLG_PRINT 2 2
BEGIN
PROMPT 6 0 "Stampa"
PICTURE BMP_PRINT
END
BUTTON DLG_PDF 2 2
BEGIN
PROMPT 7 0 "PDF"
PICTURE BMP_PDF
END
BUTTON DLG_NULL 2 2
BEGIN
END
BUTTON DLG_INFO 2 2
BEGIN
PROMPT 9 1 "Informazioni"
PROMPT 8 0 "Informazioni"
MESSAGE EXIT,K_F2
PICTURE 162
END
BUTTON DLG_HELP 2 2
BEGIN
PROMPT 10 1 "Help"
PROMPT 9 0 "Help"
MESSAGE EXIT,K_F1
PICTURE 163
END
BUTTON DLG_QUIT 10 2
BUTTON DLG_QUIT 2 2
BEGIN
PROMPT 8 0 ""
PROMPT 10 0 ""
END
ENDPAGE