Aggiunti commenti per docs
git-svn-id: svn://10.65.10.50/trunk@1954 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
31b97a6795
commit
c56bf2bce0
@ -21,7 +21,9 @@
|
|||||||
enum print_action { REPEAT_PAGE, NEXT_PAGE };
|
enum print_action { REPEAT_PAGE, NEXT_PAGE };
|
||||||
|
|
||||||
// user functions to pass field informations to setrow()
|
// user functions to pass field informations to setrow()
|
||||||
|
// allow passing file, field and optional substring or format informations
|
||||||
// no class or nice C++ interface since varargs is nasty
|
// no class or nice C++ interface since varargs is nasty
|
||||||
|
// vedi papiro per spiegazioni
|
||||||
|
|
||||||
// FLD(Num.logico, Nome campo [, da [, a]])
|
// FLD(Num.logico, Nome campo [, da [, a]])
|
||||||
const char* FLD(int lognum, const char* f, int from = -1, int to = -1);
|
const char* FLD(int lognum, const char* f, int from = -1, int to = -1);
|
||||||
@ -64,7 +66,7 @@ class TPrint_application : public TApplication
|
|||||||
char _fillchar; // fill character for empty fields
|
char _fillchar; // fill character for empty fields
|
||||||
link_item* _pr_tree; // functions for autom. printing of relations
|
link_item* _pr_tree; // functions for autom. printing of relations
|
||||||
int _maxrow; // reference to maxrow
|
int _maxrow; // reference to maxrow
|
||||||
int _cur_file;
|
int _cur_file; // per questi vedi le funzioni inline
|
||||||
bool _print_defined;
|
bool _print_defined;
|
||||||
bool _force_progind;
|
bool _force_progind;
|
||||||
bool _force_setpage;
|
bool _force_setpage;
|
||||||
@ -80,10 +82,13 @@ class TPrint_application : public TApplication
|
|||||||
void set_printer() { printer().set(); }
|
void set_printer() { printer().set(); }
|
||||||
// print a single record; does not advance cursor
|
// print a single record; does not advance cursor
|
||||||
// returns failure or success
|
// returns failure or success
|
||||||
bool print_one(int file);
|
bool print_one(int file);
|
||||||
// to be documented but very fig
|
// to be documented but very fig
|
||||||
bool print_tree(link_item* head);
|
bool print_tree(link_item* head);
|
||||||
|
|
||||||
|
// metahandlers per controllare header, footer, e links quando si usa la
|
||||||
|
// viswin; servono per controllare handlers di altre classi e chiamano
|
||||||
|
// virtuali di TPrintapp
|
||||||
static void _pp_header(TPrinter& pr);
|
static void _pp_header(TPrinter& pr);
|
||||||
static void _pp_footer(TPrinter& pr);
|
static void _pp_footer(TPrinter& pr);
|
||||||
static void _pp_link(int id, const char* s);
|
static void _pp_link(int id, const char* s);
|
||||||
@ -164,6 +169,7 @@ protected:
|
|||||||
// footer etc) sono spiegate nel seguito
|
// footer etc) sono spiegate nel seguito
|
||||||
// ****************************************************
|
// ****************************************************
|
||||||
|
|
||||||
|
// vedi sopra, per chi non l'ha capito
|
||||||
virtual bool user_create() pure;
|
virtual bool user_create() pure;
|
||||||
virtual bool user_destroy() pure;
|
virtual bool user_destroy() pure;
|
||||||
|
|
||||||
@ -193,7 +199,8 @@ protected:
|
|||||||
// whole page (after all sons are printed) or print
|
// whole page (after all sons are printed) or print
|
||||||
// counter is the current page or print number
|
// counter is the current page or print number
|
||||||
virtual print_action postprocess_page(int file, int counter)
|
virtual print_action postprocess_page(int file, int counter)
|
||||||
{ return NEXT_PAGE; }
|
{ return NEXT_PAGE; }
|
||||||
|
// vedi papiro precedente
|
||||||
virtual print_action postprocess_print(int file, int counter)
|
virtual print_action postprocess_print(int file, int counter)
|
||||||
{ return NEXT_PAGE; }
|
{ return NEXT_PAGE; }
|
||||||
// executed after all print job is completed
|
// executed after all print job is completed
|
||||||
@ -203,7 +210,6 @@ protected:
|
|||||||
// preview window
|
// preview window
|
||||||
virtual void process_link(int id, const char* text) {}
|
virtual void process_link(int id, const char* text) {}
|
||||||
|
|
||||||
|
|
||||||
// called when user cancels print; returning TRUE
|
// called when user cancels print; returning TRUE
|
||||||
// actually stops printing; not called if no cancel
|
// actually stops printing; not called if no cancel
|
||||||
virtual bool cancel_hook() {return TRUE;}
|
virtual bool cancel_hook() {return TRUE;}
|
||||||
@ -253,6 +259,8 @@ public:
|
|||||||
// real, TParagraph_string e a TString, memorizzandoli. Non ci sono problemi con la resize.
|
// real, TParagraph_string e a TString, memorizzandoli. Non ci sono problemi con la resize.
|
||||||
// Comunque, il modo corretto di adoperare il codice # e'
|
// Comunque, il modo corretto di adoperare il codice # e'
|
||||||
// usarlo solo per stampare MEMBRI della classe derivata da TPrint_application
|
// usarlo solo per stampare MEMBRI della classe derivata da TPrint_application
|
||||||
|
// Credo che Bonazzi abbia aggiunto #p per le TParagraph_string ma bisogna
|
||||||
|
// chiederlo a lui, che non si e' preoccupato di documentare
|
||||||
// ----------------------------------------------
|
// ----------------------------------------------
|
||||||
// field codes (match one of FLD() functions)
|
// field codes (match one of FLD() functions)
|
||||||
// @@ -> @
|
// @@ -> @
|
||||||
@ -310,12 +318,14 @@ public:
|
|||||||
// Includi ditte abilitato) per un esempio.
|
// Includi ditte abilitato) per un esempio.
|
||||||
// --------------------------------------------------------
|
// --------------------------------------------------------
|
||||||
|
|
||||||
|
// azzera la definizione della riga row
|
||||||
void reset_row(int r);
|
void reset_row(int r);
|
||||||
|
|
||||||
// chiamare reset_print() durante la stampa forza la
|
// chiamare reset_print() durante la stampa forza la
|
||||||
// rilettura di set_page() alla prossima volta
|
// rilettura di set_page() alla prossima volta
|
||||||
void reset_print();
|
void reset_print();
|
||||||
|
|
||||||
|
// se n'e' parlato diffusamente
|
||||||
void set_row(int r, const char* fmt, ...);
|
void set_row(int r, const char* fmt, ...);
|
||||||
|
|
||||||
// ---------------------------------------------
|
// ---------------------------------------------
|
||||||
@ -356,8 +366,39 @@ public:
|
|||||||
// viene passata a enable_link una tokenstring con tutti i 'bottoni' dello
|
// viene passata a enable_link una tokenstring con tutti i 'bottoni' dello
|
||||||
// stesso colore presenti sulla riga
|
// stesso colore presenti sulla riga
|
||||||
void set_multiple_link(bool on);
|
void set_multiple_link(bool on);
|
||||||
|
|
||||||
// BACKGROUND PAINTING! Chefigata! poi vi spiego....
|
// -------------------------------------------------------------
|
||||||
|
// BACKGROUND PAINTING! Chefigata!
|
||||||
|
// -------------------------------------------------------------
|
||||||
|
// gli si passa uno stringone che contiene codici per stampare
|
||||||
|
// box, linee, bitmap sullo sfondo, e per variarne gli attributi:
|
||||||
|
// se null lo azzera. Il background e' stampato sia su viswin
|
||||||
|
// che su stampante, e riguarda una PAGINA fisica e non le righe o le
|
||||||
|
// "pages" relative al cursore; viene replicato ad ogni nuova
|
||||||
|
// pagina fisica a meno che non venga cancellato o ridefinito in una
|
||||||
|
// <qualcosa>process<qualcos'altro>().
|
||||||
|
// ---------------------------------------------------------------
|
||||||
|
// CODICI BACKGROUND
|
||||||
|
// ---------------------------------------------------------------
|
||||||
|
// Una stringa con n codici, opzionalmente separati da spazi o tab
|
||||||
|
//
|
||||||
|
// -- SETTINGS ----------------------------------------------------
|
||||||
|
//
|
||||||
|
// P<n> setta pen style (n = codice XVT)
|
||||||
|
// B<n> setta brush style (idem)
|
||||||
|
// W<n> line width in pixel
|
||||||
|
// C<n> pen color (codice colore solito)
|
||||||
|
//
|
||||||
|
// -- DRAWING COMMANDS --------------------------------------------
|
||||||
|
//
|
||||||
|
// i{string,x1,y1,x2,y2} disegna bitmap <string> (nome file)
|
||||||
|
// alle coordinate indicate
|
||||||
|
// l{x1,y1,x2,y2} linea da/a (la resa delle oblique
|
||||||
|
// dipende dalla stampante)
|
||||||
|
// b{x1,y1,x2,y2} box
|
||||||
|
// r{x1,y1,x2,y2} rounded box
|
||||||
|
// t{text,x,y} testo <text> a x,y
|
||||||
|
// -----------------------------------------------------------------
|
||||||
void set_background(const char* bgdesc = NULL);
|
void set_background(const char* bgdesc = NULL);
|
||||||
|
|
||||||
|
|
||||||
@ -475,16 +516,14 @@ public:
|
|||||||
// se header == TRUE gli header stanno nel file e non vengono stampati
|
// se header == TRUE gli header stanno nel file e non vengono stampati
|
||||||
// se direct == FALSE le rigne vengono aggiunte con set_row da printapp, altrimenti
|
// se direct == FALSE le rigne vengono aggiunte con set_row da printapp, altrimenti
|
||||||
// si usa printer::merge_export_file
|
// si usa printer::merge_export_file
|
||||||
void merge_export_file(const char* file, bool header = TRUE, bool direct = FALSE);
|
void merge_export_file(const char* file, bool header = TRUE, bool direct = FALSE);
|
||||||
|
|
||||||
|
|
||||||
void set_n_copies(int n) { _ncopies = n; }
|
void set_n_copies(int n) { _ncopies = n; }
|
||||||
int get_n_copies() const { return _ncopies; }
|
int get_n_copies() const { return _ncopies; }
|
||||||
void repeat_print() { _repeat_print = TRUE; }
|
void repeat_print() { _repeat_print = TRUE; }
|
||||||
|
|
||||||
bool is_cancelled() const { return _cancelled; }
|
bool is_cancelled() const { return _cancelled; }
|
||||||
|
|
||||||
|
|
||||||
TPrint_application();
|
TPrint_application();
|
||||||
virtual ~TPrint_application();
|
virtual ~TPrint_application();
|
||||||
};
|
};
|
||||||
|
@ -13,34 +13,43 @@
|
|||||||
#include <text.h>
|
#include <text.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Implementazione di una finestra XVT per la stampa: scrivendoci su tutto l'output
|
||||||
|
// va sulla stampante corrente. Usata direttamente da TPrinter.
|
||||||
|
|
||||||
class TPrintwin : public TWindow
|
class TPrintwin : public TWindow
|
||||||
{
|
{
|
||||||
|
bool _aborted; // stampa abortita
|
||||||
bool _aborted;
|
PRINT_RCD* _printrcd; // record di stampa XVT
|
||||||
PRINT_RCD* _printrcd;
|
int _formlen; // indovina
|
||||||
int _formlen;
|
int _formwidth; // indovina
|
||||||
int _formwidth;
|
TArray* _bg; // l'intero background della pagina (vedi TPrintapp)
|
||||||
TArray* _bg;
|
TTextfile& _txt; // il TText da stampare
|
||||||
TTextfile& _txt;
|
|
||||||
|
|
||||||
TArray _images;
|
TArray _images; // bitmaps da stampare sotto al testo
|
||||||
|
|
||||||
|
// un'orrenda quantita' di dettagli relativi ai font e alle loro dimensioni
|
||||||
int _lead, _ascent, _descent;
|
int _lead, _ascent, _descent;
|
||||||
int _hofs, _vofs;
|
int _hofs, _vofs;
|
||||||
int _chary;
|
int _chary;
|
||||||
int _char_size;
|
int _char_size;
|
||||||
|
// tutto ok per stampare
|
||||||
bool _inited;
|
bool _inited;
|
||||||
|
|
||||||
void paint_background(long j);
|
// pitta lo sfondo della riga j
|
||||||
void paint_row(long j);
|
void paint_background(long j);
|
||||||
bool print_band(int, RCT&);
|
// pitta la riga j
|
||||||
|
void paint_row(long j);
|
||||||
|
// pitta la fetta di finestra che XVT gli lascia pittare per la pagina data
|
||||||
|
// (dipende dal driver, ma di solito pitta l'intera pagina)
|
||||||
|
bool print_band(int page, RCT&);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// check if aborted; also returned by do_print
|
// check if aborted; also returned by do_print
|
||||||
bool aborted() const { return _aborted; }
|
bool aborted() const { return _aborted; }
|
||||||
|
|
||||||
// starts printing; FALSE if aborted
|
// starts printing; FALSE if aborted; when possible starts concurrent thread
|
||||||
|
// (not possible in WIN 3.1)
|
||||||
bool do_print();
|
bool do_print();
|
||||||
|
|
||||||
TPrintwin(TTextfile& txt);
|
TPrintwin(TTextfile& txt);
|
||||||
|
@ -27,42 +27,42 @@ class TTextfile: public TObject
|
|||||||
{
|
{
|
||||||
enum {DEFAULT_PAGESIZE = 128};
|
enum {DEFAULT_PAGESIZE = 128};
|
||||||
|
|
||||||
TArray _page;
|
TArray _page; // pagina di testo correntemente in memoria
|
||||||
TBit_array _dirty_lines;
|
TBit_array _dirty_lines; // un bit per ogni riga, TRUE se ci si e' fatto replace
|
||||||
long _page_start;
|
long _page_start; // inizio...
|
||||||
long _page_end;
|
long _page_end; // e fine della _page in coordinate testo
|
||||||
long _page_size;
|
long _page_size; // n. righe in _page
|
||||||
long _lines;
|
long _lines; // n. totale linee testo
|
||||||
long _cur_line;
|
long _cur_line; // linea corrente
|
||||||
TFilename _filename;
|
TFilename _filename; // nome file testo (puo' essere temporaneo)
|
||||||
TFilename _indname;
|
TFilename _indname; // nome file indice (sempre temporaneo)
|
||||||
FILE* _index;
|
FILE* _index; // handle file indice
|
||||||
FILE* _instr;
|
FILE* _instr; // handle file testo
|
||||||
direction _direction;
|
direction _direction; // direzione ottimale lettura file
|
||||||
|
|
||||||
int _item; // Piece corrente
|
int _item; // Piece corrente
|
||||||
TToken_string _line; // Testo riga corrente
|
TToken_string _line; // Testo riga corrente
|
||||||
long _styles[256]; // Stile e colore carattere
|
long _styles[256]; // Stile e colore carattere
|
||||||
bool _tabbed_piece;
|
bool _tabbed_piece; // uso dei tab con @t
|
||||||
|
|
||||||
TArray _hotspots;
|
TArray _hotspots; // punti ipertestuali come passati da utente (viswin)
|
||||||
TArray _spots;
|
TArray _spots; // rappr. interna punti ipertestuali
|
||||||
bool _dirty;
|
bool _dirty; // modificato con replace
|
||||||
bool _isopen;
|
bool _isopen; // files aperti
|
||||||
bool _istemp;
|
bool _istemp; // si usa un file temporaneo
|
||||||
bool _accept;
|
bool _accept; // append permessa
|
||||||
bool _interactive;
|
bool _interactive; // si sta modificando con add e si puo' fare replace
|
||||||
|
|
||||||
// for merging with database fields
|
// for merging with database fields
|
||||||
TRelation* _rel;
|
TRelation* _rel; // gestisce sostituzione di campi al posto di tag nel testo
|
||||||
|
|
||||||
void _read_page(long line);
|
void _read_page(long line); // riempi pagina contenente line, ottimizzando start/end
|
||||||
bool _in_page(long l)
|
bool _in_page(long l) // la riga l e' nella pagina corrente
|
||||||
{ return l >= _page_start && l < _page_end; }
|
{ return l >= _page_start && l < _page_end; }
|
||||||
void _save_changes();
|
void _save_changes(); // salva i replace fatti sul file (anche temporaneo)
|
||||||
|
|
||||||
// void _parse_style(long j);
|
// void _parse_style(long j);
|
||||||
style _trans_style(char c);
|
style _trans_style(char c); // traduci il tag dello stile in stile XVT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -71,34 +71,40 @@ public:
|
|||||||
|
|
||||||
// line() ritorna la stringa di caratteri senza formattazione
|
// line() ritorna la stringa di caratteri senza formattazione
|
||||||
// ed eventualmente con i campi sostituiti se la relazione
|
// ed eventualmente con i campi sostituiti se la relazione
|
||||||
// non e' NULL
|
// non e' NULL; parte da row e column, per howmuch caratteri utili
|
||||||
|
// default tutta la riga
|
||||||
const char* line(long row, long column = 0, int howmuch = -1);
|
const char* line(long row, long column = 0, int howmuch = -1);
|
||||||
// line_formatted() la ritorna, come e' logico attendersi, con
|
// line_formatted() la ritorna, come e' logico attendersi, con
|
||||||
// la formattazione
|
// la formattazione (ovvero tutti i @eccetera, che anche la printer capisce)
|
||||||
const char* line_formatted(long row);
|
const char* line_formatted(long row);
|
||||||
// appende una riga al text (con i formati del caso)
|
// appende una riga al text (con i formati del caso)
|
||||||
bool append(const char* l);
|
bool append(const char* l);
|
||||||
|
|
||||||
// chide tutti i files per poter copiare o eseguire operazioni
|
// chide tutti i files per poter copiare o eseguire operazioni
|
||||||
// dopo close() non si puo' piu' fare nulla
|
// dopo close() non si puo' piu' fare nulla
|
||||||
void close();
|
void close();
|
||||||
|
// stampa sulla carta
|
||||||
void print();
|
void print();
|
||||||
// chiude l'aggiunta di nuove linee
|
// chiude l'aggiunta di nuove linee
|
||||||
void freeze() { _accept = FALSE; }
|
void freeze() { _accept = FALSE; }
|
||||||
bool frozen() { return !_accept; }
|
bool frozen() { return !_accept; }
|
||||||
|
|
||||||
// per leggere il testo formattato, si fa prima read_line, poi
|
// per leggere il testo formattato, si fa prima read_line, poi
|
||||||
// si prende un pezzo per volta
|
// si prende un pezzo per volta; le si passa la riga, pos e' la y iniziale
|
||||||
|
// (mai usato) e pg fa si' che se la linea non e' nella pagina corrente
|
||||||
|
// non si faccia nulla; diversamente rilegge una nuova pagina dal file
|
||||||
// style() ritorna lo stile (vedi enum) del piece() corrente
|
// style() ritorna lo stile (vedi enum) del piece() corrente
|
||||||
// se chiamata con parametri ritorna lo stile del carattere alla
|
// se chiamata con parametri ritorna lo stile del carattere alla
|
||||||
// posizione data
|
// posizione data
|
||||||
// get_background() e get_foreground() ritornano il suo colore di bg e fg
|
// get_background() e get_foreground() ritornano il suo colore di bg e fg
|
||||||
// piece() ritorna il pezzo di linea successivo con stile e colore
|
// piece() ritorna il pezzo di linea successivo con stile e colore
|
||||||
// invarianti, o NULL quando non ce n'e' piu'
|
// invarianti, o NULL quando non ce n'e' piu'
|
||||||
// bello, vero?
|
// bello, vero?
|
||||||
|
|
||||||
void read_line(long j, long b = 0, bool pg = TRUE);
|
void read_line(long j, long b = 0, bool pg = TRUE);
|
||||||
const char* piece();
|
const char* piece();
|
||||||
|
|
||||||
|
// ritornano stile testo, colori bg e fg, o l'intero long contenente tutti gli
|
||||||
|
// attributi carattere alla pos corrente (piece corrente) o a quella specificata
|
||||||
int get_style(int pos = -1);
|
int get_style(int pos = -1);
|
||||||
char get_background(int pos = -1);
|
char get_background(int pos = -1);
|
||||||
char get_foreground(int pos = -1);
|
char get_foreground(int pos = -1);
|
||||||
@ -139,8 +145,11 @@ public:
|
|||||||
// <@file->fieldname@[format]@[len]@[just]>
|
// <@file->fieldname@[format]@[len]@[just]>
|
||||||
void set_relation(TRelation* r) { _rel = r; }
|
void set_relation(TRelation* r) { _rel = r; }
|
||||||
|
|
||||||
|
// se si prevede lo scorrimento in una sola direzione, gli si dia
|
||||||
|
// up o down come 3o parametro, e si sara' felici
|
||||||
TTextfile(const char* file = NULL, int pagesize = DEFAULT_PAGESIZE,
|
TTextfile(const char* file = NULL, int pagesize = DEFAULT_PAGESIZE,
|
||||||
direction preferred = updown, bool interactive = TRUE);
|
direction preferred = updown, bool interactive = TRUE);
|
||||||
|
|
||||||
virtual ~TTextfile();
|
virtual ~TTextfile();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
136
include/viswin.h
136
include/viswin.h
@ -18,7 +18,7 @@ class TBrowsefile_field;
|
|||||||
|
|
||||||
class TViswin : public TScroll_window
|
class TViswin : public TScroll_window
|
||||||
{
|
{
|
||||||
friend class TBrowsefile_field;
|
friend class TBrowsefile_field; // yes, perche' puo' anche essere un controllo di una mask
|
||||||
|
|
||||||
enum { MAXBUT = 4, MAXLEN = 256, BUFFERSIZE = 256, MAXPIC=4};
|
enum { MAXBUT = 4, MAXLEN = 256, BUFFERSIZE = 256, MAXPIC=4};
|
||||||
enum scroll { none, up, down, left, right };
|
enum scroll { none, up, down, left, right };
|
||||||
@ -36,10 +36,10 @@ class TViswin : public TScroll_window
|
|||||||
bool _istimer; // timer successivo attivo?
|
bool _istimer; // timer successivo attivo?
|
||||||
bool _isopen; // new lines may arrive
|
bool _isopen; // new lines may arrive
|
||||||
bool _selflag;
|
bool _selflag;
|
||||||
bool _sel_displayed;
|
bool _sel_displayed; // selezione evidenziata
|
||||||
bool _link_displayed;
|
bool _link_displayed; // link ipertestuale evidenziato
|
||||||
bool _cross_displayed;
|
bool _cross_displayed; // visualizzato cursore a croce
|
||||||
bool _point_displayed;
|
bool _point_displayed; // visualizzato cursore a carattere
|
||||||
long _timer; // timer per evitare autorepeat tasti
|
long _timer; // timer per evitare autorepeat tasti
|
||||||
long _wtimer; // wait timer before close()
|
long _wtimer; // wait timer before close()
|
||||||
scroll _need_scroll; // scrolling required?
|
scroll _need_scroll; // scrolling required?
|
||||||
@ -48,8 +48,8 @@ class TViswin : public TScroll_window
|
|||||||
int _curbut; // button which currently has focus
|
int _curbut; // button which currently has focus
|
||||||
int _buttons; // button count
|
int _buttons; // button count
|
||||||
|
|
||||||
WINDOW _link_button;
|
WINDOW _link_button; // ID bottone "Collega"
|
||||||
WINDOW _print_button;
|
WINDOW _print_button; // ID bottone "Stampa"
|
||||||
|
|
||||||
long _textrows; // righe di testo
|
long _textrows; // righe di testo
|
||||||
long _textcolumns; // indovina indovinello
|
long _textcolumns; // indovina indovinello
|
||||||
@ -57,11 +57,12 @@ class TViswin : public TScroll_window
|
|||||||
TTextfile _txt; // text being displayed
|
TTextfile _txt; // text being displayed
|
||||||
long _firstline; // 1rst text line being displayed
|
long _firstline; // 1rst text line being displayed
|
||||||
long _lastline; // last text line being displayed
|
long _lastline; // last text line being displayed
|
||||||
|
|
||||||
TString _txt_to_find; // text to find
|
// Ricerca testo
|
||||||
TPoint _last_found; // position of last find
|
TString _txt_to_find; // text to find
|
||||||
bool _down_dir; // search direction
|
TPoint _last_found; // position of last find
|
||||||
bool _case_sensitive;
|
bool _down_dir; // search direction
|
||||||
|
bool _case_sensitive; // case sensitivity
|
||||||
|
|
||||||
int _formlen; // length of a page
|
int _formlen; // length of a page
|
||||||
|
|
||||||
@ -78,21 +79,23 @@ class TViswin : public TScroll_window
|
|||||||
|
|
||||||
TArray _modules; // Scrolling module icons
|
TArray _modules; // Scrolling module icons
|
||||||
TArray _images; // pictures properly resized
|
TArray _images; // pictures properly resized
|
||||||
|
|
||||||
bool _multiple;
|
|
||||||
TString80 _linktxt;
|
|
||||||
int _linkID;
|
|
||||||
TToken_string _multiple_link;
|
|
||||||
|
|
||||||
TArray* _bg;
|
// link multiplo: se si' vengono passati all'handler tutti i link presenti sulla
|
||||||
bool _frozen;
|
// stessa riga anziche' solo il selezionato
|
||||||
bool _toplevel;
|
bool _multiple; // si/no
|
||||||
bool _rulers;
|
TString80 _linktxt; // testo del link
|
||||||
bool _showbuts;
|
int _linkID; // ID del link specificata
|
||||||
bool _inside_linkexec;
|
TToken_string _multiple_link; // tutti i link della riga
|
||||||
bool _menu_present;
|
|
||||||
|
|
||||||
// viene istanziato soltanto se e' usata come controllo BROWSEFILE
|
TArray* _bg; // internal structure to hold parsed background
|
||||||
|
bool _frozen; // non si tocca piu' nulla (files temp. cancellati), gestito internamente
|
||||||
|
bool _toplevel; // e' una finestra colle palle (se FALSE e' un campo di una mask)
|
||||||
|
bool _rulers; // righello mostrato
|
||||||
|
bool _showbuts; // bottoni mostrati
|
||||||
|
bool _inside_linkexec; // var di comodo per sapere se si sta attivando un link
|
||||||
|
bool _menu_present; // c'e' il menu specifico della viswin
|
||||||
|
|
||||||
|
// viene istanziato soltanto se e' usata come controllo BROWSEFILE in una mask
|
||||||
TBrowsefile_field* _brwfld;
|
TBrowsefile_field* _brwfld;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -103,43 +106,71 @@ protected:
|
|||||||
int tabx(int x) const; // Convert charx to pixels
|
int tabx(int x) const; // Convert charx to pixels
|
||||||
int taby(int y) const; // Convert chary to pixels
|
int taby(int y) const; // Convert chary to pixels
|
||||||
|
|
||||||
void shift_screen(scroll);
|
void shift_screen(scroll); // shift di 1 su, giu', dx, sin a seconda di scroll passato
|
||||||
void paint_screen();
|
void paint_screen(); // pittura lo schermo sulla porzione corrente di testo
|
||||||
void draw_crossbars();
|
void draw_crossbars(); // pittura il cursore a crossbar in xor
|
||||||
|
|
||||||
void paint_header();
|
// pittura header (righello)
|
||||||
void paint_point(bool erase = FALSE);
|
void paint_header();
|
||||||
void paint_row(long r);
|
// pittura il cursore (in xor) nello stile del momento, se
|
||||||
void paint_column(long r, bool end);
|
// necessario e erase == TRUE cancella quello di prima
|
||||||
void paint_selection();
|
void paint_point(bool erase = FALSE);
|
||||||
void paint_waitbar(bool xor = TRUE);
|
// pittura la riga r (in coordinate testo)
|
||||||
void paint_background(long, int);
|
void paint_row(long r);
|
||||||
bool call_editor();
|
// pittura una sola colonna: se end == true e' l'ultima e implica uno scroll orizz. avvenuto
|
||||||
bool in_text(const TPoint& p) const;
|
void paint_column(long r, bool end);
|
||||||
|
// pittura (in xor) la selezione corrente a meno che non sia gia' pitturata
|
||||||
|
void paint_selection();
|
||||||
|
// controlla l'immaginetta di 'busy'; xor serve solo per UNIX, dove si
|
||||||
|
// pittura una barretta che viene cancellata alla prossima paint
|
||||||
|
void paint_waitbar(bool xor = TRUE);
|
||||||
|
// pittura il background specificato a riga long e colonna int
|
||||||
|
void paint_background(long, int);
|
||||||
|
// chiama l'editor definito nei parametri con il testo corrente
|
||||||
|
bool call_editor();
|
||||||
|
// utility per sapere se il punto e' nel testo mostrato
|
||||||
|
bool in_text(const TPoint& p) const;
|
||||||
|
|
||||||
WINDOW add_button(short id, const char* caption);
|
WINDOW add_button(short id, const char* caption);
|
||||||
void repos_buttons();
|
void repos_buttons();
|
||||||
void adjust_selection(TPoint& p1, TPoint& p2);
|
// assicura che la selezione rimanga nei limiti fisici del testo
|
||||||
|
void adjust_selection(TPoint& p1, TPoint& p2);
|
||||||
|
// interfaccia furba a paint_selection: display mostra se non c'e', erase cancella se c'e'
|
||||||
void display_selection();
|
void display_selection();
|
||||||
void erase_selection();
|
void erase_selection();
|
||||||
|
// interfaccia furba a paint_point (se cross): display mostra se non c'e', erase cancella se c'e'
|
||||||
void display_crossbar();
|
void display_crossbar();
|
||||||
void erase_crossbar();
|
void erase_crossbar();
|
||||||
|
// interfaccia furba a paint_point (se point): display mostra se non c'e', erase cancella se c'e'
|
||||||
void display_point();
|
void display_point();
|
||||||
void erase_point();
|
void erase_point();
|
||||||
bool check_link(TPoint* where = NULL);
|
// controlla se la nuova posizione cursore (se NULL e' il curs. corrente) cade su un
|
||||||
|
// link ipertestuale e si comporta di conseguenza
|
||||||
|
bool check_link(TPoint* where = NULL);
|
||||||
|
// sistema x1 e x2 in modo che il minore sia il primo, e controlla che y sia
|
||||||
|
// nel testo (box e' su una sola riga, usata solo per i link)
|
||||||
bool adjust_box(long& x1, long& x2, long y);
|
bool adjust_box(long& x1, long& x2, long y);
|
||||||
|
// display mostra il link ipertestuale se non c'e', erase cancella se c'e'
|
||||||
void paint_link(long, long, long);
|
void paint_link(long, long, long);
|
||||||
void erase_link(long, long, long);
|
void erase_link(long, long, long);
|
||||||
|
// mostra in xor sto cazzo di link ipertesticolare (usata da paint/erase link)
|
||||||
void display_link(long, long, long, const char*);
|
void display_link(long, long, long, const char*);
|
||||||
void freeze() { _frozen = TRUE; }
|
// usata internamente per bloccare l'aggiunta di nuove righe
|
||||||
void exec_link();
|
void freeze() { _frozen = TRUE; }
|
||||||
|
// chiama l'handler del link se si preme collega o si batte spazio su un link
|
||||||
|
void exec_link();
|
||||||
|
// controlla la generazione del menu indice se ci sono bookmarks
|
||||||
void build_index_menu();
|
void build_index_menu();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void scroll_error(long x, long y);
|
|
||||||
|
|
||||||
|
// chiamata quando si fa uno scroll impossibile da x,y
|
||||||
|
// fa beep e torna li'
|
||||||
|
void scroll_error(long x, long y);
|
||||||
|
|
||||||
|
// son tutte figlie di mamma application
|
||||||
virtual void update();
|
virtual void update();
|
||||||
virtual void handler(WINDOW win, EVENT* ep);
|
virtual void handler(WINDOW win, EVENT* ep);
|
||||||
|
|
||||||
void check_menu_item(MENU_TAG item, bool on = TRUE);
|
void check_menu_item(MENU_TAG item, bool on = TRUE);
|
||||||
void enable_menu_item(MENU_TAG item, bool on = TRUE);
|
void enable_menu_item(MENU_TAG item, bool on = TRUE);
|
||||||
|
|
||||||
@ -150,29 +181,32 @@ public:
|
|||||||
// non c'e' selezione non viene chiamata affatto (il bottone non fa nulla)
|
// non c'e' selezione non viene chiamata affatto (il bottone non fa nulla)
|
||||||
// Se serve, si faccia stop_run() qui dentro
|
// Se serve, si faccia stop_run() qui dentro
|
||||||
virtual void process_link(TTextfile& txt, TPoint start, TPoint end) { }
|
virtual void process_link(TTextfile& txt, TPoint start, TPoint end) { }
|
||||||
|
// termina la stampa su video e crea il menu indice se c'e'
|
||||||
void close_print();
|
void close_print();
|
||||||
bool frozen() { return _frozen; }
|
bool frozen() { return _frozen; }
|
||||||
|
// terminazione by user (ESC durante stampa)
|
||||||
void abort_print();
|
void abort_print();
|
||||||
|
|
||||||
long lines() { return _txt.lines(); }
|
long lines() { return _txt.lines(); }
|
||||||
TTextfile& text() { return _txt; }
|
TTextfile& text() { return _txt; }
|
||||||
|
|
||||||
|
// bound to keys and menu actions
|
||||||
void goto_end();
|
void goto_end();
|
||||||
void goto_top();
|
void goto_top();
|
||||||
void goto_pos(long r, long c, bool moveorigin = TRUE);
|
void goto_pos(long r, long c, bool moveorigin = TRUE);
|
||||||
void refresh();
|
void refresh();
|
||||||
|
|
||||||
void show_rulers (bool on = TRUE);
|
void show_rulers (bool on = TRUE);
|
||||||
void show_buttons(bool on = TRUE);
|
void show_buttons(bool on = TRUE);
|
||||||
|
|
||||||
|
// usata da chi la usa (es. printer) per stampare nella finestra
|
||||||
void add_line(const char* l);
|
void add_line(const char* l);
|
||||||
|
|
||||||
// non_interactive search and replace
|
// non-interactive search and replace
|
||||||
long search (const char* txt, int& pos, long from = 0,
|
long search (const char* txt, int& pos, long from = 0,
|
||||||
bool down = TRUE, bool casesens = FALSE);
|
bool down = TRUE, bool casesens = FALSE);
|
||||||
int replace(long line, const char* txt, int pos = 0, int len = -1);
|
int replace(long line, const char* txt, int pos = 0, int len = -1);
|
||||||
|
|
||||||
// interactive search
|
// interactive search (con maschera, bound to F7/F8)
|
||||||
void find();
|
void find();
|
||||||
void find_next();
|
void find_next();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user