From c4104e628b6fbe34a53294329d746b8cb8e6cc75 Mon Sep 17 00:00:00 2001 From: guy Date: Tue, 7 Jan 1997 11:27:47 +0000 Subject: [PATCH] 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 --- include/applicat.cpp | 47 +++++++++++++++++++++++++++++--------------- include/default.url | 6 ++++++ include/urldefid.h | 2 ++ 3 files changed, 39 insertions(+), 16 deletions(-) diff --git a/include/applicat.cpp b/include/applicat.cpp index b81a91423..fe714bf32 100755 --- a/include/applicat.cpp +++ b/include/applicat.cpp @@ -54,19 +54,28 @@ TApplication& main_app() // @flag FALSE | Se se non e' stata definita una bool xvt_running() { 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 /////////////////////////////////////////////////////////// -HIDDEN long backdrop_eh( WINDOW win, EVENT* ep) +HIDDEN long backdrop_eh(WINDOW win, EVENT* ep) { xvt_dwin_clear(win, MASK_DARK_COLOR); return 0L; } -HIDDEN void create_backdrop( void ) +HIDDEN void create_backdrop(void) { #if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_NT xvt_create_statbar(); @@ -135,9 +144,9 @@ void TBanner::handler(WINDOW win, EVENT* ep) xvt_dwin_draw_text(win, x, y, t, -1); set_font(XVT_FFN_TIMES); - t = "PRASSI S.p.A."; + t = prassi_spa(); 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); t = "Caricamento in corso"; @@ -162,14 +171,21 @@ long XVT_CALLCONV1 TApplication::task_eh(WINDOW win, EVENT *ep) switch (ep->type) { case E_CREATE: - _application->pre_create(); - customize_controls(TRUE); - create_backdrop(); + if (_application->pre_create()) + { + 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 - message_box("Attach to process %d ...", getpid()); + message_box("Attach to process %d ...", getpid()); #endif - do_events(); - allow_another_instance(); + do_events(); + allow_another_instance(); + } break; #if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_NT case E_UPDATE: @@ -495,16 +511,15 @@ void TApplication::run( set_perms(); 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; cfg.menu_bar_ID = TASK_MENUBAR+addbar; cfg.about_box_ID = 0; cfg.base_appl_name = (char*)base.name(); 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); @@ -528,7 +543,7 @@ void TApplication::about() const { #include 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); } diff --git a/include/default.url b/include/default.url index 11706899f..8994f6721 100755 --- a/include/default.url +++ b/include/default.url @@ -12,6 +12,10 @@ #define QRESDIR "f:/p.due/bmp/" #endif +#ifndef QFIRMNAME +#define QFIRMNAME "PR.A.S.S.I. S.p.A." +#endif + #define LANG_ITA_W52 #define NO_STD_EDIT_MENU @@ -74,6 +78,8 @@ SEPARATOR ITEM M_EDIT_SEARCH "~Informazioni" ACCEL MENU_FILE "f" alt + +STRING STR_FIRMNAME QFIRMNAME #if XVTWS == WINWS image BMP_OK QRESDIR"ok.bmp" diff --git a/include/urldefid.h b/include/urldefid.h index 5e903f684..2c826924c 100755 --- a/include/urldefid.h +++ b/include/urldefid.h @@ -27,6 +27,8 @@ #define M_SHOW_RULERS (M_EDIT+20) #define M_SHOW_BUTTONS (M_EDIT+21) +#define STR_FIRMNAME 101 + #if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_NT #define ICO_SEARCH 109