Patch level : 1.32
Files correlati : ba0.exe ba1.exe ba3.exe Ricompilazione Demo : [ ] Commento : Welcome to the 32 bits world! git-svn-id: svn://10.65.10.50/trunk@10102 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
d3318b868a
commit
7650181c48
82
ba/ba0.cpp
82
ba/ba0.cpp
@ -8,6 +8,7 @@
|
||||
#include <currency.h>
|
||||
#include <dongle.h>
|
||||
#include <execp.h>
|
||||
#include <image.h>
|
||||
#include <isam.h>
|
||||
#include <msksheet.h>
|
||||
#include <os_dep.h>
|
||||
@ -18,6 +19,8 @@
|
||||
#include <utility.h>
|
||||
#include <urldefid.h>
|
||||
|
||||
#include <agasys.h>
|
||||
|
||||
#include <nditte.h>
|
||||
|
||||
#include "ba0.h"
|
||||
@ -27,6 +30,12 @@
|
||||
#define OPTIONS_MENU M_FONT
|
||||
#define PREFERRED_MENU M_STYLE
|
||||
|
||||
#ifdef XVGUY
|
||||
#define MEN_FILE "bacampo.men"
|
||||
#else
|
||||
#define MEN_FILE "baprassi.men"
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// TPriority_image
|
||||
///////////////////////////////////////////////////////////
|
||||
@ -113,8 +122,8 @@ void TPicture_mask::update()
|
||||
{
|
||||
vx = -cli.right;
|
||||
::xvt_vobj_get_client_rect(win(), &cli);
|
||||
vx += cli.right - CHARX;
|
||||
vy = cli.bottom;
|
||||
vx += cli.right - 2*CHARX;
|
||||
vy = cli.bottom - 2*CHARX;
|
||||
}
|
||||
|
||||
const double ratiox = double(vx) / _image->width();
|
||||
@ -176,6 +185,7 @@ void TPicture_mask::handler(WINDOW win, EVENT* ep)
|
||||
RCT rct; xvt_vobj_get_client_rect(win, &rct);
|
||||
int x = rct.right - euro.width() -1;
|
||||
int y = rct.bottom - euro.height() -1;
|
||||
xvt_dwin_set_clip(win, &rct);
|
||||
euro.draw(win, x, y);
|
||||
|
||||
_euro_frame++;
|
||||
@ -354,10 +364,11 @@ PNT TColor_mask::log2dev(long x, long y) const
|
||||
{
|
||||
PNT p = { int(y * XI_FU_MULTIPLE), int(x * XI_FU_MULTIPLE) };
|
||||
|
||||
XI_OBJ* itf = xi_get_itf(win());
|
||||
#ifdef XI_R4
|
||||
XI_OBJ* itf = xi_get_itf((XinWindow)win());
|
||||
xi_fu_to_pu(itf, (XinPoint*)&p, 1);
|
||||
#else
|
||||
XI_OBJ* itf = xi_get_itf(win());
|
||||
xi_fu_to_pu(itf, &p, 1);
|
||||
#endif
|
||||
|
||||
@ -617,6 +628,9 @@ class TMenu : public TAssoc_array
|
||||
TAssoc_array _modules;
|
||||
|
||||
TToken_string _dangerous;
|
||||
|
||||
protected:
|
||||
bool can_be_transparent(const TImage& i) const;
|
||||
|
||||
public: // TObject
|
||||
virtual bool ok() const { return _current != NULL; }
|
||||
@ -1061,6 +1075,20 @@ bool TMenu::perform()
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool TMenu::can_be_transparent(const TImage& i) const
|
||||
{
|
||||
const int w = i.width()-1;
|
||||
const int h = i.height()-1;
|
||||
const COLOR col = i.get_pixel(0,0);
|
||||
if (i.get_pixel(w,0) != col)
|
||||
return FALSE;
|
||||
if (i.get_pixel(w,h) != col)
|
||||
return FALSE;
|
||||
if (i.get_pixel(0,h) != col)
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
TImage& TMenu::image(const char* name)
|
||||
{
|
||||
TTimed_image* image = (TTimed_image*)_images.objptr(name);
|
||||
@ -1072,7 +1100,9 @@ TImage& TMenu::image(const char* name)
|
||||
_default_bmp = name; // Store default bitmap name
|
||||
|
||||
image = new TTimed_image(name);
|
||||
image->convert_transparent_color(MASK_BACK_COLOR);
|
||||
|
||||
if (can_be_transparent(*image))
|
||||
image->convert_transparent_color(MASK_BACK_COLOR);
|
||||
_images.add(name, image);
|
||||
}
|
||||
else
|
||||
@ -1124,7 +1154,7 @@ bool TMenu::has_module(const char* mod)
|
||||
|
||||
if (_modules.items() == 0)
|
||||
{
|
||||
TScanner scanner("prassi.aut");
|
||||
TScanner scanner(AUT_FILE);
|
||||
TString16 val;
|
||||
for (int aut = 0; scanner.line() != ""; aut++)
|
||||
{
|
||||
@ -1348,9 +1378,9 @@ void TMenu_application::test_temp()
|
||||
for (int i = count-1; i >= 0; i--)
|
||||
{
|
||||
if (bar.iscancelled()) break;
|
||||
bar.addstatus(1);
|
||||
const char* e = files.row(i);
|
||||
::remove(e);
|
||||
bar.addstatus(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1589,7 +1619,7 @@ bool TMenu_application::test_programs()
|
||||
pi.addstatus(1);
|
||||
remote_install.for_each_paragraph(get_module_version, &his_modules);
|
||||
pi.addstatus(1);
|
||||
TScanner scan("prassi.aut");
|
||||
TScanner scan(AUT_FILE);
|
||||
for (int module = 0; scan.line().not_empty(); module++)
|
||||
{
|
||||
if (dongle().active(module))
|
||||
@ -1627,8 +1657,7 @@ bool TMenu_application::test_programs()
|
||||
|
||||
bool TMenu_application::create()
|
||||
{
|
||||
TApplication::create();
|
||||
|
||||
TApplication::create();
|
||||
if (!test_network())
|
||||
return FALSE;
|
||||
|
||||
@ -1665,7 +1694,7 @@ bool TMenu_application::create()
|
||||
if (!_menu.ok())
|
||||
{
|
||||
TWait_cursor hourglass;
|
||||
TFilename menu = (argc() < 2) ? "baprassi" : argv(1);
|
||||
TFilename menu = (argc() < 2) ? MEN_FILE : argv(1);
|
||||
menu.ext("men");
|
||||
_menu.read(menu);
|
||||
dispatch_e_menu(MENU_ITEM(1));
|
||||
@ -1883,6 +1912,8 @@ long TMenu_application::handler(WINDOW win, EVENT* ep)
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifndef XVGUY
|
||||
|
||||
HIDDEN bool convert(const char* menuname)
|
||||
{
|
||||
TString tag(_MAX_FNAME);
|
||||
@ -1963,6 +1994,8 @@ HIDDEN bool convert(const char* menuname)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// TMenu_tree
|
||||
///////////////////////////////////////////////////////////
|
||||
@ -2335,8 +2368,8 @@ bool TMenu_application::tree_shrink_handler(TMask_field&f, KEY k)
|
||||
void TMenu_application::update_preferred()
|
||||
{
|
||||
MENU_ITEM* mm = xvt_menu_get_tree(TASK_WIN);
|
||||
for (MENU_ITEM* mi = mm; mi->tag != 0 && mi->tag != PREFERRED_MENU; mi++);
|
||||
if (mi->tag <= 0 || mi->child == NULL)
|
||||
for (MENU_ITEM* mi = mm; mi != NULL && mi->tag != 0 && mi->tag != PREFERRED_MENU; mi++);
|
||||
if (mi == NULL || mi->tag <= 0 || mi->child == NULL)
|
||||
{
|
||||
NFCHECK("Can't find Preferiti Menu");
|
||||
return;
|
||||
@ -2406,6 +2439,10 @@ void TMenu_application::save_preferences()
|
||||
void TMenu_application::add_to_preferred()
|
||||
{
|
||||
const int maxpref = 16;
|
||||
|
||||
if (_mask == NULL) // Succede durante il login!
|
||||
return;
|
||||
|
||||
if (_preferred.items() < maxpref)
|
||||
{
|
||||
TToken_string tok;
|
||||
@ -2621,19 +2658,27 @@ bool TMenu_application::menu(MENU_TAG mt)
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
TApplication::check_parameters(argc, argv);
|
||||
|
||||
|
||||
#ifdef XVGUY
|
||||
if (user().blank())
|
||||
{
|
||||
char name[16];
|
||||
if (aga_get_user_name(name, 16))
|
||||
user() = name;
|
||||
}
|
||||
#endif
|
||||
if (user().blank())
|
||||
{
|
||||
TConfig prawin(CONFIG_INSTALL, "Main");
|
||||
user() = prawin.get("User");
|
||||
}
|
||||
|
||||
TFilename menu = (argc < 2) ? "baprassi.men" : argv[1];
|
||||
TFilename menu = (argc < 2) ? MEN_FILE : argv[1];
|
||||
|
||||
#ifndef XVGUY
|
||||
TString ext = menu.ext(); ext.lower();
|
||||
|
||||
if (ext == "men" && !menu.exist())
|
||||
ext.cut(0);
|
||||
|
||||
if (ext != "men")
|
||||
{
|
||||
if (ext.empty())
|
||||
@ -2646,6 +2691,7 @@ int main(int argc, char** argv)
|
||||
convert(menu);
|
||||
menu = newmenu;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!menu.exist())
|
||||
{
|
||||
@ -2656,7 +2702,5 @@ int main(int argc, char** argv)
|
||||
TMenu_application *ma = new TMenu_application(menu);
|
||||
ma->run(argc, argv, "Menu Principale");
|
||||
delete ma;
|
||||
|
||||
exit(0);
|
||||
return TRUE;
|
||||
return 0;
|
||||
}
|
||||
|
@ -29,8 +29,6 @@ int main(int argc,char** argv)
|
||||
default:
|
||||
ba1100(argc,argv); break; // Manutenzione
|
||||
}
|
||||
|
||||
exit(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include <ctype.h>
|
||||
#include <fcntl.h>
|
||||
#include <share.h>
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <dos.h>
|
||||
@ -93,8 +94,8 @@ HIDDEN bool browse_file_handler(TMask_field& f, KEY k)
|
||||
xvt_fsys_convert_dir_to_str(&fs.dir, n.get_buffer(n.size()), n.size());
|
||||
n.add(fs.name);
|
||||
f.set(n);
|
||||
xvt_fsys_restore_dir();
|
||||
}
|
||||
xvt_fsys_restore_dir();
|
||||
f.set_focus();
|
||||
}
|
||||
|
||||
@ -361,7 +362,7 @@ bool TManutenzione_app::create() // initvar e arrmask
|
||||
_mask->enable(-1); // Abilita campi privilegiati
|
||||
}
|
||||
|
||||
dispatch_e_menu(BAR_ITEM(1));
|
||||
dispatch_e_menu(MENU_ITEM(1));
|
||||
}
|
||||
enable_menu_item(M_FILE_PRINT);
|
||||
return TSkeleton_application::create();
|
||||
@ -909,12 +910,13 @@ void TManutenzione_app::update_dir()
|
||||
{
|
||||
if (old_is_firm && !movable_file(i) && d.eod() == 0L)
|
||||
{
|
||||
TFilename n(d.filename());
|
||||
|
||||
TFilename n(d.filename());
|
||||
save_file(n);
|
||||
remove(n);
|
||||
n.ext("cdx"); remove(n);
|
||||
n.ext("fpt"); remove(n);
|
||||
|
||||
TString s;
|
||||
s.format("File n. %d - %s : eliminato file non utilizzato", i, (const char *)d.filename());
|
||||
write_log(s);
|
||||
}
|
||||
@ -952,6 +954,7 @@ void TManutenzione_app::update_dir()
|
||||
{
|
||||
if (!recover(b, err))
|
||||
{
|
||||
TString s;
|
||||
s.format("File n. %d - %s : errore n.ro %d", i, (const char *)d.filename(), err);
|
||||
write_log(s);
|
||||
}
|
||||
@ -1188,8 +1191,9 @@ void TManutenzione_app::convert_dir()
|
||||
{
|
||||
if (!recover(b, err))
|
||||
{
|
||||
s.format("File n. %d - %s : errore n.ro %d", i, (const char *)d.filename(), err);
|
||||
write_log(s);
|
||||
TString s;
|
||||
s.format("File n. %d - %s : errore n.ro %d", i, (const char *)d.filename(), err);
|
||||
write_log(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +1,5 @@
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <applicat.h>
|
||||
#include <defmask.h>
|
||||
#include <dongle.h>
|
||||
|
@ -490,7 +490,7 @@ bool BA3200_application::preprocess_print(int file, int counter)
|
||||
void BA3200_application::destroy_objects()
|
||||
{
|
||||
if (_msk) delete _msk;
|
||||
// if (_cur) delete _cur;
|
||||
// if (_cur) delete _cur; // Deleted by printapp!
|
||||
if (_rel) delete _rel;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user