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:
parent
70284e5e53
commit
2f700876a1
@ -519,7 +519,6 @@ bool TMenu::read(const char* name, TString& root)
|
|||||||
// Menu
|
// Menu
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
bool TMenu::read(const char* name)
|
bool TMenu::read(const char* name)
|
||||||
{
|
{
|
||||||
TString root;
|
TString root;
|
||||||
@ -757,23 +756,12 @@ TMenu::TMenu() : _current(NULL), _item(0), _mask_mode(0)
|
|||||||
TMenu::~TMenu()
|
TMenu::~TMenu()
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
|
||||||
bool is_tassan()
|
bool is_tassan()
|
||||||
{
|
{
|
||||||
bool yes = dongle().number() > 0;
|
bool yes = false;
|
||||||
if (!yes && !is_power_station())
|
if (dongle().number() == 202)
|
||||||
{
|
{
|
||||||
TString80 name;
|
const TDate morti(24, 11, 2008); // Giorno della morte del programma
|
||||||
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 oggi(TODAY);
|
const TDate oggi(TODAY);
|
||||||
yes = oggi >= morti;
|
yes = oggi >= morti;
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ protected:
|
|||||||
bool perform_program() const;
|
bool perform_program() const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual bool ok() { return _caption.not_empty(); }
|
virtual bool ok() const { return _caption.full(); }
|
||||||
|
|
||||||
const TString& caption() const { return _caption; }
|
const TString& caption() const { return _caption; }
|
||||||
int icon() const;
|
int icon() const;
|
||||||
|
@ -255,9 +255,14 @@ TImage* TMenu_tree::image(bool selected) const
|
|||||||
{
|
{
|
||||||
const TMenuitem& mi = curr_item();
|
const TMenuitem& mi = curr_item();
|
||||||
if (mi.disabled())
|
if (mi.disabled())
|
||||||
return get_res_image(BMP_STOP);
|
return get_res_icon(10203);
|
||||||
if (!mi.is_submenu())
|
if (mi.is_program())
|
||||||
return get_res_image(BMP_PROGRAM);
|
{
|
||||||
|
int ico = mi.icon();
|
||||||
|
if (ico <= 0)
|
||||||
|
ico = ICON_RSRC;
|
||||||
|
return get_res_icon(ico);
|
||||||
|
}
|
||||||
return TTree::image(selected);
|
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_img = (double)_max_side;
|
||||||
const double max_lgo = rct.right - _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 ratiox = max_img / image.width();
|
||||||
const double ratioy = max_img / image.height();
|
const double ratioy = max_img / image.height();
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#include "ba0103.h"
|
#include "ba0103.h"
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
#include <controls.h>
|
||||||
#include <defmask.h>
|
#include <defmask.h>
|
||||||
#include <diction.h>
|
#include <diction.h>
|
||||||
#include <dongle.h>
|
#include <dongle.h>
|
||||||
@ -187,10 +188,15 @@ short TBook_window::add_page(const TString& caption)
|
|||||||
{
|
{
|
||||||
if (_ctrl == NULL_WIN)
|
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));
|
WIN_DEF wd; memset(&wd, 0, sizeof(wd));
|
||||||
wd.wtype = WC_NOTEBK;
|
wd.wtype = WC_NOTEBK;
|
||||||
|
wd.ctlcolors = xcc;
|
||||||
wd.v.ctl.ctrl_id = DLG_MAIN;
|
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_TAB_BOTTOM; // should be wxCHECK_VERSION(2,8,9)
|
||||||
wd.v.ctl.flags |= CTL_FLAG_CENTER_JUST; // old compatibility flags
|
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
|
MENU_ITEM* mi = xvt_res_get_menu(10004); // Menu_Ba0-3
|
||||||
if (mi != NULL)
|
if (mi != NULL)
|
||||||
{
|
{
|
||||||
|
dictionary_translate_menu(mi);
|
||||||
const PNT pos = { -1, -1 };
|
const PNT pos = { -1, -1 };
|
||||||
xvt_menu_popup(mi->child, o.parent(), pos, XVT_POPUP_LEFT_ALIGN, 0);
|
xvt_menu_popup(mi->child, o.parent(), pos, XVT_POPUP_LEFT_ALIGN, 0);
|
||||||
xvt_res_free_menu_tree(mi);
|
xvt_res_free_menu_tree(mi);
|
||||||
|
126
ba/ba1101.cpp
126
ba/ba1101.cpp
@ -345,86 +345,86 @@ void TRec_sheet::edit()
|
|||||||
main_app().print();
|
main_app().print();
|
||||||
break;
|
break;
|
||||||
case K_F6:
|
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);
|
TMask m("ba1100f");
|
||||||
if (nf.not_empty())
|
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);
|
ofstream out(nf);
|
||||||
out << *_rec;
|
out << *_dir;
|
||||||
_rec->set_des();
|
|
||||||
}
|
}
|
||||||
nf.ext("dir");
|
|
||||||
ofstream out(nf);
|
|
||||||
out << *_dir;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case K_F7:
|
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));
|
TMask m("ba1100f");
|
||||||
if (nf.not_empty())
|
TFilename nout(_dir->name());
|
||||||
{
|
|
||||||
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++)
|
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())
|
||||||
{
|
{
|
||||||
f1.row(i) = _rec->fielddef(i);
|
import_dirty = TRUE;
|
||||||
if (_descr)
|
_rec->set_des(_descr,_tab.upper());
|
||||||
f1.row(i).add(_descr->get(_rec->rec()->Fd[i].Name));
|
ifstream in(nf);
|
||||||
else
|
in >> *_rec;
|
||||||
f1.row(i).add("");
|
nfields = _rec->fields();
|
||||||
const TFieldtypes type = (TFieldtypes) f1.row(i).get_int(1);
|
fcopy(_descfname,"des.xxx"); // salva il vecchio file di descrizioni
|
||||||
switch (type)
|
f1.destroy(-1);
|
||||||
|
|
||||||
|
for (int i = 0; i < nfields; i++)
|
||||||
{
|
{
|
||||||
case _datefld :
|
f1.row(i) = _rec->fielddef(i);
|
||||||
case _wordfld :
|
if (_descr)
|
||||||
case _charfld :
|
f1.row(i).add(_descr->get(_rec->rec()->Fd[i].Name));
|
||||||
case _boolfld :
|
else
|
||||||
case _memofld:
|
f1.row(i).add("");
|
||||||
f1.disable_cell(i, 2);
|
const TFieldtypes type = (TFieldtypes) f1.row(i).get_int(1);
|
||||||
case _alfafld :
|
switch (type)
|
||||||
case _intfld :
|
{
|
||||||
case _longfld :
|
case _datefld :
|
||||||
case _intzerofld :
|
case _wordfld :
|
||||||
case _longzerofld:
|
case _charfld :
|
||||||
f1.disable_cell(i, 3);
|
case _boolfld :
|
||||||
default:
|
case _memofld:
|
||||||
break;
|
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;
|
break;
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
@ -492,6 +492,7 @@ protected:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
void on_print();
|
void on_print();
|
||||||
|
void on_pdf();
|
||||||
bool save_report();
|
bool save_report();
|
||||||
bool save_if_needed();
|
bool save_if_needed();
|
||||||
void global_reset();
|
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()
|
TReport_section& TReport_mask::curr_section()
|
||||||
{
|
{
|
||||||
return *_curr_section;
|
return *_curr_section;
|
||||||
@ -956,7 +968,9 @@ void TReport_mask::report_query()
|
|||||||
{
|
{
|
||||||
_report.set_recordset(qm.get(F_SQL));
|
_report.set_recordset(qm.get(F_SQL));
|
||||||
_is_dirty = true;
|
_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();
|
const bool full = !efield(F_CODICE).empty();
|
||||||
enable(DLG_SAVEREC, full);
|
enable(DLG_SAVEREC, full);
|
||||||
enable(DLG_DELREC, 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)
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case DLG_PDF:
|
||||||
|
if (e == fe_button)
|
||||||
|
{
|
||||||
|
on_pdf();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case DLG_NEWREC:
|
case DLG_NEWREC:
|
||||||
if (e == fe_button)
|
if (e == fe_button)
|
||||||
{
|
{
|
||||||
|
@ -43,29 +43,49 @@ BEGIN
|
|||||||
PICTURE BMP_DELREC
|
PICTURE BMP_DELREC
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON DLG_PRINT 10 2
|
BUTTON DLG_NULL 10 2
|
||||||
BEGIN
|
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
|
PICTURE BMP_PRINT
|
||||||
END
|
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
|
BUTTON DLG_INFO 2 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 9 1 "Informazioni"
|
PROMPT 8 0 "Informazioni"
|
||||||
MESSAGE EXIT,K_F2
|
MESSAGE EXIT,K_F2
|
||||||
PICTURE 162
|
PICTURE 162
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON DLG_HELP 2 2
|
BUTTON DLG_HELP 2 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 10 1 "Help"
|
PROMPT 9 0 "Help"
|
||||||
MESSAGE EXIT,K_F1
|
MESSAGE EXIT,K_F1
|
||||||
PICTURE 163
|
PICTURE 163
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON DLG_QUIT 10 2
|
BUTTON DLG_QUIT 2 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 8 0 ""
|
PROMPT 10 0 ""
|
||||||
END
|
END
|
||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user