campo-sirio/include/browfile.h
guy 33e30f1df6 array.cpp Corretto metodo TPointer_array::destroy
array.h      Aggiunto metodo TPointer_array::insert_long
browfile.h   Aggiunto metodo TBrowse_file::set_vis_win da usare nelle derivazioni
confapp.cpp  Aggiornato uso del metodo TConfig::get (vedi sotto)
config.h     Tolto #include <xvt.h>
             Il metodo TConfig::get ora ritorna una 'const TString&'
             non piu' una 'TString&'
             I valori di default vengono scritti su file solo se non nulli
controls.cpp Gestione menu di Modifica
             Allineamento dei bottoni a fianco di campi o listbox
             Corretta gestione dei tasti AltGr nelle tatstiere non U.S.A.


git-svn-id: svn://10.65.10.50/trunk@6040 c028cbd2-c16b-5b4b-a496-9718f37d4682
1998-01-28 08:21:11 +00:00

78 lines
2.6 KiB
C++
Executable File

#ifndef __BROWFILE_H
#define __BROWFILE_H
#ifndef __MASK_H
#include <mask.h>
#endif
class TViswin;
// viene chiamato sia al semplice passaggio del cursore sul testo
// (con doubleclick = FALSE) o alla pressione di tasti o balle per
// collegare (doubleclick = TRUE)
// se non ritorna NULL, il testo usato per linkare viene sostituito
// dal testo ritornato
typedef const char* (*MASK_LINKHANDLER)(TMask&, int, const char*, bool doubleclick);
class TBrowsefile_field : public TOperable_field
{
friend class TViswin;
TViswin* _viswin;
MASK_LINKHANDLER _lh;
TArray _links;
bool _m_link;
short _dlg;
WINDOW _parent;
TString_array _background; // Background per usi diversi da anteprima!
protected:
virtual word class_id() const;
virtual void parse_head(TScanner& scanner);
virtual void create(WINDOW parent);
public:
TViswin* vis_win() const { return _viswin; }
void set_vis_win(TViswin* viswin);
void add_line(const char* l);
long set_text(const char* file, const char* line = NULL);
const char* get_text(long line, int column = 0, int len = -1);
// posiziona su riga e colonna passate
void goto_pos(long r, long c);
void goto_top();
void goto_end();
void refresh();
void close();
// link processor
void set_link_handler(MASK_LINKHANDLER lh) { _lh = lh; }
MASK_LINKHANDLER get_link_handler() { return _lh; }
TArray& links() { return _links; }
void set_multiple_link(bool on) { _m_link = on; }
bool is_multiple_link() { return _m_link; }
int find_link(const char* descr);
int enable_link (const char* descr, char fg, char bg = 'w');
void disable_link(char fg, char bg = 'w');
void disable_links() { _links.destroy(); }
long lines();
// print background
void set_background(const char* bg);
TString_array& get_bg_desc() { return _background; }
virtual short dlg() const { return _dlg; }
// @cmember Ritorna la finestra padre
virtual WINDOW parent() const { return _parent; }
TBrowsefile_field(TMask* m);
virtual ~TBrowsefile_field();
};
#endif