printer.cpp Riaggiorna la lista delle stampanti dopo aver premuto
il tasto Imposta: MI6251 progind.cpp Corrette dimensioni barra di attesa in 3D relation.cpp Tolto il limite di 80 caratteri sulla descrizione dei files scanner.h Tolto #include <xvt.h> scanner.cpp Modificato il metodo TScanner::rectangle git-svn-id: svn://10.65.10.50/trunk@6044 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
02858f2975
commit
330f90f7ea
@ -79,7 +79,6 @@ class TPrint_intersector : public TString_array
|
|||||||
char f_horizontal() const { return _fink[9]; }
|
char f_horizontal() const { return _fink[9]; }
|
||||||
char f_vertical() const { return _fink[10]; }
|
char f_vertical() const { return _fink[10]; }
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// aggiunge un elemento grafico
|
// aggiunge un elemento grafico
|
||||||
@ -95,8 +94,6 @@ class TPrint_intersector : public TString_array
|
|||||||
virtual ~TPrint_intersector() {}
|
virtual ~TPrint_intersector() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
char TPrint_intersector::check_intersection(int x, int y, char ch)
|
char TPrint_intersector::check_intersection(int x, int y, char ch)
|
||||||
{
|
{
|
||||||
char a = ' ', b = ' ', c = ' ', d = ' ';
|
char a = ' ', b = ' ', c = ' ', d = ' ';
|
||||||
@ -229,13 +226,11 @@ PrintWhat;
|
|||||||
|
|
||||||
#if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_WIN32
|
#if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_WIN32
|
||||||
|
|
||||||
void TPrinter::_get_windows_printer_names (TToken_string & t)
|
void TPrinter::_get_windows_printer_names (TToken_string& t)
|
||||||
{
|
{
|
||||||
char *buf = new char[4096]; // ammazzao'
|
char* buf = t.get_buffer(2048); // ammazzao'
|
||||||
|
GetProfileString ("devices", NULL, "", buf, t.size());
|
||||||
GetProfileString ("devices", NULL, "", buf, 4096);
|
for (int i = 0; i < t.size(); i++)
|
||||||
|
|
||||||
for (int i = 0; i < 4095; i++)
|
|
||||||
{
|
{
|
||||||
if (buf[i] == '\0')
|
if (buf[i] == '\0')
|
||||||
{
|
{
|
||||||
@ -243,8 +238,6 @@ void TPrinter::_get_windows_printer_names (TToken_string & t)
|
|||||||
else break;
|
else break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
t = buf;
|
|
||||||
delete buf;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN XVT_CALLCONV1 TPrinter::start_winprint (long data)
|
BOOLEAN XVT_CALLCONV1 TPrinter::start_winprint (long data)
|
||||||
@ -1880,7 +1873,7 @@ bool TPrinter::set()
|
|||||||
|
|
||||||
TMask mask("bagn001a");
|
TMask mask("bagn001a");
|
||||||
|
|
||||||
TToken_string pn1(50), pn2(100);
|
TToken_string pn1(50);
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
mask.set(MSK_FILENAME, _printerfile);
|
mask.set(MSK_FILENAME, _printerfile);
|
||||||
@ -1890,9 +1883,7 @@ bool TPrinter::set()
|
|||||||
mask.enable(DLG_OK, can_save);
|
mask.enable(DLG_OK, can_save);
|
||||||
// mask.enable(DLG_SAVEREC, can_save);
|
// mask.enable(DLG_SAVEREC, can_save);
|
||||||
|
|
||||||
#if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_WIN32
|
TToken_string& pn2 = getprinternames();
|
||||||
|
|
||||||
pn2 = getprinternames();
|
|
||||||
char old_default[80];
|
char old_default[80];
|
||||||
GetProfileString ("windows", "device", ",,,", old_default, sizeof(old_default));
|
GetProfileString ("windows", "device", ",,,", old_default, sizeof(old_default));
|
||||||
|
|
||||||
@ -1938,9 +1929,16 @@ bool TPrinter::set()
|
|||||||
if (k == DLG_SETPRINT)
|
if (k == DLG_SETPRINT)
|
||||||
{
|
{
|
||||||
// l'handler setta default di windows a quella nel listbox e ribecca l'rcd
|
// l'handler setta default di windows a quella nel listbox e ribecca l'rcd
|
||||||
#if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_WIN32
|
|
||||||
if (xvt_dm_post_page_setup(get_printrcd()))
|
if (xvt_dm_post_page_setup(get_printrcd()))
|
||||||
{
|
{
|
||||||
|
// Ricarica la lista delle stampanti (L'utente puo' aggiungerne!)
|
||||||
|
_get_windows_printer_names(pn2);
|
||||||
|
pn1.cut(0);
|
||||||
|
int i = 0;
|
||||||
|
FOR_EACH_TOKEN(pn2, tok)
|
||||||
|
pn1.add(i++);
|
||||||
|
plst.replace_items(pn1, pn2); // Genera printer list
|
||||||
|
|
||||||
// see if user has changed printer
|
// see if user has changed printer
|
||||||
// determine index of currently selected printer
|
// determine index of currently selected printer
|
||||||
// ACTHUNG! Deep hacking of XVT internals! NON PORTABLE!
|
// ACTHUNG! Deep hacking of XVT internals! NON PORTABLE!
|
||||||
@ -1958,7 +1956,6 @@ bool TPrinter::set()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
beep ();
|
beep ();
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2002,7 +1999,6 @@ bool TPrinter::set()
|
|||||||
_lines_per_inch = mask.get_int (MSK_LINES);
|
_lines_per_inch = mask.get_int (MSK_LINES);
|
||||||
_isgraphics = mask.get_bool (MSK_ISGRAPHICS);
|
_isgraphics = mask.get_bool (MSK_ISGRAPHICS);
|
||||||
set_win_formlen ();
|
set_win_formlen ();
|
||||||
#endif
|
|
||||||
|
|
||||||
if (k == K_INS)
|
if (k == K_INS)
|
||||||
save_configuration();
|
save_configuration();
|
||||||
|
@ -133,8 +133,8 @@ void TIndwin::update_bar()
|
|||||||
// Rettangolo scavato
|
// Rettangolo scavato
|
||||||
xi_draw_3d_rect(w, &r, TRUE, 2,
|
xi_draw_3d_rect(w, &r, TRUE, 2,
|
||||||
BTN_LIGHT_COLOR, BTN_BACK_COLOR, BTN_DARK_COLOR);
|
BTN_LIGHT_COLOR, BTN_BACK_COLOR, BTN_DARK_COLOR);
|
||||||
b.left += 2; b.right -= 1;
|
b.left += 2; b.right -= 2;
|
||||||
b.top += 2; b.bottom -= 1;
|
b.top += 2; b.bottom -= 2;
|
||||||
// Rettangolo in rilievo
|
// Rettangolo in rilievo
|
||||||
b.right = b.left + int((b.right-b.left)*prc);
|
b.right = b.left + int((b.right-b.left)*prc);
|
||||||
xi_draw_3d_rect(w, &b, FALSE, 2,
|
xi_draw_3d_rect(w, &b, FALSE, 2,
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <applicat.h>
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <expr.h>
|
#include <expr.h>
|
||||||
#include <extcdecl.h>
|
#include <extcdecl.h>
|
||||||
@ -1999,6 +1998,7 @@ void TRelation_description::read_rel()
|
|||||||
|
|
||||||
TTrec trec; trec.get(which_file);
|
TTrec trec; trec.get(which_file);
|
||||||
TToken_string ttmp(64);
|
TToken_string ttmp(64);
|
||||||
|
TString dfld(256);
|
||||||
|
|
||||||
for (int f = 0; f < trec.fields(); f++)
|
for (int f = 0; f < trec.fields(); f++)
|
||||||
{
|
{
|
||||||
@ -2006,7 +2006,7 @@ void TRelation_description::read_rel()
|
|||||||
const TString16 name(ttmp.get(0));
|
const TString16 name(ttmp.get(0));
|
||||||
if (!name.blank())
|
if (!name.blank())
|
||||||
{
|
{
|
||||||
TString80 dfld(conf.get(name, NULL, -1, "Missing description"));
|
dfld = conf.get(name, NULL, -1, "Missing description");
|
||||||
if (!dfld.blank() && dfld[0] != '#')
|
if (!dfld.blank() && dfld[0] != '#')
|
||||||
{
|
{
|
||||||
ttmp.add(dfld,4);
|
ttmp.add(dfld,4);
|
||||||
@ -2260,7 +2260,7 @@ const char* TRelation_description::get_field_description(const char* field)
|
|||||||
{
|
{
|
||||||
TString_array& fld = (TString_array&)_fields[_cur_file];
|
TString_array& fld = (TString_array&)_fields[_cur_file];
|
||||||
|
|
||||||
for (int i = 0; i < fld.items(); i++)
|
for (int i = fld.items()-1; i >= 0; i--)
|
||||||
{
|
{
|
||||||
TToken_string& tt = fld.row(i);
|
TToken_string& tt = fld.row(i);
|
||||||
if (strcmp(tt.get(0),field) == 0)
|
if (strcmp(tt.get(0),field) == 0)
|
||||||
|
@ -22,7 +22,7 @@ TScanner::TScanner(const char* filename)
|
|||||||
_token(128), _key(2), _buffer(1024*16)
|
_token(128), _key(2), _buffer(1024*16)
|
||||||
{
|
{
|
||||||
setbuf((char*)(const char*)_buffer, _buffer.size());
|
setbuf((char*)(const char*)_buffer, _buffer.size());
|
||||||
open(filename);
|
open(filename, ios::in | ios::nocreate, filebuf::sh_read);
|
||||||
if (bad())
|
if (bad())
|
||||||
fatal_box("Impossibile aprire %s", filename);
|
fatal_box("Impossibile aprire %s", filename);
|
||||||
}
|
}
|
||||||
@ -90,12 +90,12 @@ const TString& TScanner::string()
|
|||||||
return _token;
|
return _token;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TScanner::rectangle(RCT& rect)
|
void TScanner::rectangle(short& left, short& top, short& right, short& bottom)
|
||||||
{
|
{
|
||||||
rect.left = integer();
|
left = integer();
|
||||||
rect.top = integer();
|
top = integer();
|
||||||
rect.right = integer();
|
right = integer();
|
||||||
rect.bottom = integer();
|
bottom = integer();
|
||||||
}
|
}
|
||||||
|
|
||||||
int TScanner::integer()
|
int TScanner::integer()
|
||||||
@ -138,13 +138,20 @@ void TScanner::push(const char* s)
|
|||||||
_pushed = TRUE;
|
_pushed = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Certified 100%
|
||||||
|
// @doc EXTERNAL
|
||||||
|
// @mfunc Va al paragrafo <p name>
|
||||||
|
// @rdesc Ritorna TRUE se il paragrafo esiste
|
||||||
bool TScanner::paragraph(const char* name)
|
bool TScanner::paragraph(const char* name)
|
||||||
{
|
{
|
||||||
TString p;
|
TString p = name;
|
||||||
p << '[' << name << ']';
|
if (p[0] != '[')
|
||||||
|
{
|
||||||
|
p.insert("[", 0);
|
||||||
|
p << ']';
|
||||||
|
}
|
||||||
|
|
||||||
seekg(0L);
|
seekg(0L);
|
||||||
|
|
||||||
while (line().not_empty())
|
while (line().not_empty())
|
||||||
if (token() == p) return TRUE;
|
if (token() == p) return TRUE;
|
||||||
|
|
||||||
|
@ -9,10 +9,6 @@
|
|||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef INCL_XVTH
|
|
||||||
#include <xvt.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// @doc EXTERNAL
|
// @doc EXTERNAL
|
||||||
|
|
||||||
// @class TScanner | Classe per le lettura e la traduzione dei file
|
// @class TScanner | Classe per le lettura e la traduzione dei file
|
||||||
@ -57,7 +53,7 @@ public:
|
|||||||
const TString& equal()
|
const TString& equal()
|
||||||
{ return line('='); }
|
{ return line('='); }
|
||||||
// @cmember Legge le coordinate di un rettangolo
|
// @cmember Legge le coordinate di un rettangolo
|
||||||
void rectangle(RCT& rect);
|
void rectangle(short& left, short& top, short& right, short& bottom);
|
||||||
// @cmember Ritorna un intero letto dal file
|
// @cmember Ritorna un intero letto dal file
|
||||||
int integer();
|
int integer();
|
||||||
// @cmember Ritorna un double letto dal file
|
// @cmember Ritorna un double letto dal file
|
||||||
|
@ -743,7 +743,7 @@ bool TSheet_control::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
|||||||
|
|
||||||
if (_disabled[rec])
|
if (_disabled[rec])
|
||||||
{
|
{
|
||||||
xiev->v.cell_request.color = DISABLED_COLOR;
|
// xiev->v.cell_request.color = DISABLED_COLOR; // Uniforme coi TField_control
|
||||||
xiev->v.cell_request.back_color = DISABLED_BACK_COLOR;
|
xiev->v.cell_request.back_color = DISABLED_BACK_COLOR;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user