applicat.cpp Caricato dall'url il nome della ditta che rilascia il programma

default.url    Aggiunta stringa col nome della ditta
urldefid.h     Aggiunta #defina STR_FIRMNAME


git-svn-id: svn://10.65.10.50/trunk@4040 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1997-01-07 11:27:47 +00:00
parent 3c9bd9c26f
commit c4104e628b
3 changed files with 39 additions and 16 deletions

View File

@ -54,19 +54,28 @@ TApplication& main_app()
// @flag FALSE | Se se non e' stata definita una <c TApplication> // @flag FALSE | Se se non e' stata definita una <c TApplication>
bool xvt_running() bool xvt_running()
{ return _application != NULL; } { return _application != NULL; }
// Ritorna il nome della ditta che vende il programma attuale
HIDDEN char* prassi_spa()
{
TString firm(80);
char* p = xvt_res_get_str(STR_FIRMNAME, firm.get_buffer(), firm.size());
if (p == NULL)
p = "PR.A.S.S.I. S.p.A.";
return p;
}
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
// Gestione dello sfondo della finestra principale // Gestione dello sfondo della finestra principale
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
HIDDEN long backdrop_eh( WINDOW win, EVENT* ep) HIDDEN long backdrop_eh(WINDOW win, EVENT* ep)
{ {
xvt_dwin_clear(win, MASK_DARK_COLOR); xvt_dwin_clear(win, MASK_DARK_COLOR);
return 0L; return 0L;
} }
HIDDEN void create_backdrop( void ) HIDDEN void create_backdrop(void)
{ {
#if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_NT #if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_NT
xvt_create_statbar(); xvt_create_statbar();
@ -135,9 +144,9 @@ void TBanner::handler(WINDOW win, EVENT* ep)
xvt_dwin_draw_text(win, x, y, t, -1); xvt_dwin_draw_text(win, x, y, t, -1);
set_font(XVT_FFN_TIMES); set_font(XVT_FFN_TIMES);
t = "PRASSI S.p.A."; t = prassi_spa();
w = xvt_dwin_get_text_width(win, t, -1); w = xvt_dwin_get_text_width(win, t, -1);
x = (r.right-r.left-w)>>1, y = BIGY; x = (r.right-r.left-w)>>1; y = BIGY;
xvt_dwin_draw_text(win, x, y, t, -1); xvt_dwin_draw_text(win, x, y, t, -1);
t = "Caricamento in corso"; t = "Caricamento in corso";
@ -162,14 +171,21 @@ long XVT_CALLCONV1 TApplication::task_eh(WINDOW win, EVENT *ep)
switch (ep->type) switch (ep->type)
{ {
case E_CREATE: case E_CREATE:
_application->pre_create(); if (_application->pre_create())
customize_controls(TRUE); {
create_backdrop(); TString caption(24);
caption << prassi_spa() << " - " << main_app().get_module_name();
xvt_vobj_set_title(win, caption.get_buffer());
customize_controls(TRUE);
create_backdrop();
#if defined(DBG) && XVT_OS == XVT_OS_SCOUNIX #if defined(DBG) && XVT_OS == XVT_OS_SCOUNIX
message_box("Attach to process %d ...", getpid()); message_box("Attach to process %d ...", getpid());
#endif #endif
do_events(); do_events();
allow_another_instance(); allow_another_instance();
}
break; break;
#if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_NT #if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_NT
case E_UPDATE: case E_UPDATE:
@ -495,16 +511,15 @@ void TApplication::run(
set_perms(); set_perms();
const TFixed_string mod(get_module_name()); const TFixed_string mod(get_module_name());
if (mod.empty()) return; if (mod.empty())
return;
TString caption; caption << "PRASSI S.p.A. - " << mod;
XVT_CONFIG cfg; XVT_CONFIG cfg;
cfg.menu_bar_ID = TASK_MENUBAR+addbar; cfg.menu_bar_ID = TASK_MENUBAR+addbar;
cfg.about_box_ID = 0; cfg.about_box_ID = 0;
cfg.base_appl_name = (char*)base.name(); cfg.base_appl_name = (char*)base.name();
cfg.appl_name = (char*)(const char*)title; cfg.appl_name = (char*)(const char*)title;
cfg.taskwin_title = (char*)(const char*)caption; cfg.taskwin_title = "PR.A.S.S.I.";
xvt_vobj_set_attr(NULL_WIN,ATTR_WIN_PM_DRAWABLE_TWIN, TRUE); xvt_vobj_set_attr(NULL_WIN,ATTR_WIN_PM_DRAWABLE_TWIN, TRUE);
@ -528,7 +543,7 @@ void TApplication::about() const
{ {
#include <prassi.ver> #include <prassi.ver>
const TFilename n(__argv[0]); const TFilename n(__argv[0]);
message_box("PRASSI Versione %s\nProgramma %s\nLibreria del %s\nN.ro di serie %d-%s", message_box("Versione %s\nProgramma %s\nLibreria del %s\nN.ro di serie %d-%s",
VERSION, (const char*)n.name(), __DATE__, SerNo, INTERNAL_VERSION); VERSION, (const char*)n.name(), __DATE__, SerNo, INTERNAL_VERSION);
} }

View File

@ -12,6 +12,10 @@
#define QRESDIR "f:/p.due/bmp/" #define QRESDIR "f:/p.due/bmp/"
#endif #endif
#ifndef QFIRMNAME
#define QFIRMNAME "PR.A.S.S.I. S.p.A."
#endif
#define LANG_ITA_W52 #define LANG_ITA_W52
#define NO_STD_EDIT_MENU #define NO_STD_EDIT_MENU
@ -74,6 +78,8 @@ SEPARATOR
ITEM M_EDIT_SEARCH "~Informazioni" ITEM M_EDIT_SEARCH "~Informazioni"
ACCEL MENU_FILE "f" alt ACCEL MENU_FILE "f" alt
STRING STR_FIRMNAME QFIRMNAME
#if XVTWS == WINWS #if XVTWS == WINWS
image BMP_OK QRESDIR"ok.bmp" image BMP_OK QRESDIR"ok.bmp"

View File

@ -27,6 +27,8 @@
#define M_SHOW_RULERS (M_EDIT+20) #define M_SHOW_RULERS (M_EDIT+20)
#define M_SHOW_BUTTONS (M_EDIT+21) #define M_SHOW_BUTTONS (M_EDIT+21)
#define STR_FIRMNAME 101
#if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_NT #if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_NT
#define ICO_SEARCH 109 #define ICO_SEARCH 109