text.cpp Sostituito == -1 con < 0
text.h Aggiunti cast per evitare warnings a 32 bit utility.* Aggiunta funzione input_filename viswin.cpp Sostituite varie printat con stringat window.cpp Aumentato buffer per printat da 128 a 256 byte git-svn-id: svn://10.65.10.50/trunk@6354 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
a411177e90
commit
3251e4e4ba
@ -541,7 +541,7 @@ const char *TTextfile::line_formatted(
|
|||||||
long TTextfile::get_attribute (int pos)
|
long TTextfile::get_attribute (int pos)
|
||||||
{
|
{
|
||||||
long stl = 0;
|
long stl = 0;
|
||||||
if (pos == -1)
|
if (pos < 0)
|
||||||
{
|
{
|
||||||
CHECK (_item > 0, "must execute piece() before style()!");
|
CHECK (_item > 0, "must execute piece() before style()!");
|
||||||
stl = _styles[_item - 1];
|
stl = _styles[_item - 1];
|
||||||
|
@ -164,7 +164,7 @@ public:
|
|||||||
|
|
||||||
// @cmember Ritorna il pezzo di testo indicato (da <p form> a <p to>), allochera' un altro
|
// @cmember Ritorna il pezzo di testo indicato (da <p form> a <p to>), allochera' un altro
|
||||||
// TText che deve essere disfatto dall'utente.
|
// TText che deve essere disfatto dall'utente.
|
||||||
TTextfile* section(TPoint& from, TPoint& to)
|
TTextfile* section(TPoint&, TPoint&)
|
||||||
{ return this; }
|
{ return this; }
|
||||||
// @cmember Ritorna il nome del file su cui si sta lavorando
|
// @cmember Ritorna il nome del file su cui si sta lavorando
|
||||||
const char* name()
|
const char* name()
|
||||||
|
@ -168,6 +168,25 @@ int list_files(
|
|||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool input_filename(TFilename& file)
|
||||||
|
{
|
||||||
|
DIRECTORY dir;
|
||||||
|
FILE_SPEC fs;
|
||||||
|
|
||||||
|
xvt_fsys_get_dir(&dir);
|
||||||
|
xvt_fsys_get_dir(&fs.dir);
|
||||||
|
strcpy(fs.type, file.ext());
|
||||||
|
strcpy(fs.name, file);
|
||||||
|
strcpy(fs.creator, "AGA");
|
||||||
|
|
||||||
|
const bool good = xvt_dm_post_file_open(&fs, "Selezionare il file ...") == FL_OK;
|
||||||
|
xvt_fsys_set_dir(&dir);
|
||||||
|
|
||||||
|
if (good)
|
||||||
|
file = fs.name;
|
||||||
|
return good;
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Certified 99%
|
// Certified 99%
|
||||||
|
@ -17,6 +17,7 @@ long fsize(const char* file);
|
|||||||
|
|
||||||
bool make_dir(const char* file);
|
bool make_dir(const char* file);
|
||||||
int list_files(const char* mask, TString_array& result);
|
int list_files(const char* mask, TString_array& result);
|
||||||
|
bool input_filename(TFilename& file);
|
||||||
|
|
||||||
const char* encode(const char* data);
|
const char* encode(const char* data);
|
||||||
const char* decode(const char* data);
|
const char* decode(const char* data);
|
||||||
|
@ -704,7 +704,7 @@ void TViswin::paint_background(
|
|||||||
const char* line = pr.background_chars(rw);
|
const char* line = pr.background_chars(rw);
|
||||||
set_color (COLOR_BLACK, COLOR_WHITE);
|
set_color (COLOR_BLACK, COLOR_WHITE);
|
||||||
if (line != NULL && (int)strlen(line) > ox)
|
if (line != NULL && (int)strlen(line) > ox)
|
||||||
printat (X_OFFSET, row, "%s", &line[ox]);
|
stringat (X_OFFSET, row, &line[ox]);
|
||||||
// return;
|
// return;
|
||||||
}
|
}
|
||||||
if (!isbackground)
|
if (!isbackground)
|
||||||
@ -916,16 +916,12 @@ void TViswin::paint_row (long j)
|
|||||||
_txt.read_line (j, origin().x);
|
_txt.read_line (j, origin().x);
|
||||||
while ((cp = _txt.piece ()) != NULL)
|
while ((cp = _txt.piece ()) != NULL)
|
||||||
{
|
{
|
||||||
#if XVT_OS != XVT_OS_SCOUNIX
|
|
||||||
const int st = _txt.get_style();
|
const int st = _txt.get_style();
|
||||||
const COLOR bg = trans_color (_txt.get_background());
|
const COLOR bg = trans_color (_txt.get_background());
|
||||||
const COLOR fg = trans_color (_txt.get_foreground());
|
const COLOR fg = trans_color (_txt.get_foreground());
|
||||||
set_font(PRINT_FONT, st, PRINT_HEIGHT);
|
set_font(PRINT_FONT, st, PRINT_HEIGHT);
|
||||||
set_color(fg, bg);
|
set_color(fg, bg);
|
||||||
#else
|
stringat(X_OFFSET+pos, row, cp);
|
||||||
set_color (COLOR_BLACK, COLOR_WHITE);
|
|
||||||
#endif
|
|
||||||
printat (X_OFFSET+pos, row, "%s", cp);
|
|
||||||
|
|
||||||
pos += strlen (cp);
|
pos += strlen (cp);
|
||||||
}
|
}
|
||||||
@ -933,7 +929,7 @@ void TViswin::paint_row (long j)
|
|||||||
{
|
{
|
||||||
set_color (COLOR_BLACK, COLOR_WHITE);
|
set_color (COLOR_BLACK, COLOR_WHITE);
|
||||||
TString80 fill; fill.spaces(80);
|
TString80 fill; fill.spaces(80);
|
||||||
printat (X_OFFSET+pos, row, fill);
|
stringat(X_OFFSET+pos, row, fill);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((j % _formlen) == (_formlen - 1) && _toplevel) // last row
|
if ((j % _formlen) == (_formlen - 1) && _toplevel) // last row
|
||||||
@ -1010,8 +1006,8 @@ void TViswin::paint_column (
|
|||||||
COLOR fg = trans_color (_txt.get_foreground ((int) j));
|
COLOR fg = trans_color (_txt.get_foreground ((int) j));
|
||||||
set_color (fg, bg);
|
set_color (fg, bg);
|
||||||
|
|
||||||
printat (col, riga_scr, "%c",
|
char str[2] = { (unsigned int)j < strlen (c) ? c[(int)j] : ' ', '\0' };
|
||||||
(unsigned int) j < strlen (c) ? c[(int) j] : ' ');
|
stringat (col, riga_scr, str);
|
||||||
}
|
}
|
||||||
|
|
||||||
xvt_dwin_set_clip(win(), NULL);
|
xvt_dwin_set_clip(win(), NULL);
|
||||||
|
@ -1013,14 +1013,15 @@ void TWindow::stringat(short x, short y, const char* str)
|
|||||||
|
|
||||||
// @doc EXTERNAL
|
// @doc EXTERNAL
|
||||||
|
|
||||||
// @mfunc Scrive il testo formattato nella finestra all posizione indicata
|
// @mfunc Scrive il testo formattato nella finestra alla posizione indicata
|
||||||
void TWindow::printat(
|
void TWindow::printat(
|
||||||
short x, // @parm Coordinata x della finestra in cui scrivere il testo
|
short x, // @parm Coordinata x della finestra in cui scrivere il testo
|
||||||
short y, // @parm Coordinata y della finestra in cui scrivere il testo
|
short y, // @parm Coordinata y della finestra in cui scrivere il testo
|
||||||
const char* fmt, // @parm Formato che deve essere dato al testo
|
const char* fmt, // @parm Formato che deve essere dato al testo
|
||||||
...) // @parmvar Uno o piu' parametri corrispondenti ai codici in <p fmt>
|
...) // @parmvar Uno o piu' parametri corrispondenti ai codici in <p fmt>
|
||||||
{
|
{
|
||||||
char tmp[128];
|
TString str(256);
|
||||||
|
char* tmp = str.get_buffer();
|
||||||
va_list argptr;
|
va_list argptr;
|
||||||
va_start(argptr, fmt);
|
va_start(argptr, fmt);
|
||||||
vsprintf(tmp, fmt, argptr);
|
vsprintf(tmp, fmt, argptr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user