2001-08-02 23:43:49 +04:00
|
|
|
//
|
2001-10-29 06:44:33 +03:00
|
|
|
// Help Viewer widget definitions.
|
2001-08-02 23:43:49 +04:00
|
|
|
//
|
2010-11-29 00:06:39 +03:00
|
|
|
// Copyright 1997-2010 by Easy Software Products.
|
2009-01-01 19:11:32 +03:00
|
|
|
// Image support by Matthias Melcher, Copyright 2000-2009.
|
2021-01-07 17:46:19 +03:00
|
|
|
// Copyright 2011-2022 by Bill Spitzak and others.
|
2001-08-02 23:43:49 +04:00
|
|
|
//
|
2011-07-19 08:49:30 +04:00
|
|
|
// This library is free software. Distribution and use rights are outlined in
|
|
|
|
// the file "COPYING" which should have been included with this file. If this
|
|
|
|
// file is missing or damaged, see the license at:
|
|
|
|
//
|
2020-07-01 19:03:10 +03:00
|
|
|
// https://www.fltk.org/COPYING.php
|
2001-08-02 23:43:49 +04:00
|
|
|
//
|
2020-07-01 19:03:10 +03:00
|
|
|
// Please see the following page on how to report bugs and issues:
|
2005-04-16 04:13:17 +04:00
|
|
|
//
|
2020-07-01 19:03:10 +03:00
|
|
|
// https://www.fltk.org/bugs.php
|
2001-08-02 23:43:49 +04:00
|
|
|
//
|
|
|
|
|
2008-10-15 17:46:06 +04:00
|
|
|
/* \file
|
2008-09-16 11:26:22 +04:00
|
|
|
Fl_Help_View widget . */
|
|
|
|
|
2001-11-24 05:46:19 +03:00
|
|
|
#ifndef Fl_Help_View_H
|
2017-08-18 18:46:20 +03:00
|
|
|
#define Fl_Help_View_H
|
2001-08-02 23:43:49 +04:00
|
|
|
|
|
|
|
//
|
|
|
|
// Include necessary header files...
|
|
|
|
//
|
|
|
|
|
2017-08-18 18:46:20 +03:00
|
|
|
#include "Fl.H"
|
|
|
|
#include "Fl_Group.H"
|
|
|
|
#include "Fl_Scrollbar.H"
|
|
|
|
#include "fl_draw.H"
|
|
|
|
#include "filename.H"
|
2001-08-02 23:43:49 +04:00
|
|
|
|
2018-05-06 13:20:45 +03:00
|
|
|
class Fl_Shared_Image;
|
2001-08-02 23:43:49 +04:00
|
|
|
//
|
2001-09-29 18:38:59 +04:00
|
|
|
// Fl_Help_Func type - link callback function for files...
|
2001-08-02 23:43:49 +04:00
|
|
|
//
|
|
|
|
|
2001-10-27 07:29:25 +04:00
|
|
|
typedef const char *(Fl_Help_Func)(Fl_Widget *, const char *);
|
2001-08-02 23:43:49 +04:00
|
|
|
|
|
|
|
//
|
2001-09-29 18:38:59 +04:00
|
|
|
// Fl_Help_Block structure...
|
2001-08-02 23:43:49 +04:00
|
|
|
//
|
|
|
|
|
2011-01-24 20:04:22 +03:00
|
|
|
struct Fl_Help_Block {
|
2020-07-01 19:03:10 +03:00
|
|
|
const char *start, // Start of text
|
|
|
|
*end; // End of text
|
|
|
|
uchar border; // Draw border?
|
|
|
|
Fl_Color bgcolor; // Background color
|
|
|
|
int x, // Indentation/starting X coordinate
|
|
|
|
y, // Starting Y coordinate
|
|
|
|
w, // Width
|
|
|
|
h; // Height
|
|
|
|
int line[32]; // Left starting position for each line
|
2021-01-07 17:46:19 +03:00
|
|
|
int ol; // is ordered list <OL> element
|
|
|
|
int ol_num; // item number in ordered list
|
2001-08-02 23:43:49 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
//
|
2001-09-29 18:38:59 +04:00
|
|
|
// Fl_Help_Link structure...
|
2001-08-02 23:43:49 +04:00
|
|
|
//
|
2009-03-16 00:16:34 +03:00
|
|
|
/** Definition of a link for the html viewer. */
|
2011-01-24 20:04:22 +03:00
|
|
|
struct Fl_Help_Link {
|
2020-07-01 19:03:10 +03:00
|
|
|
char filename[192], ///< Reference filename
|
|
|
|
name[32]; ///< Link target (blank if none)
|
|
|
|
int x, ///< X offset of link text
|
|
|
|
y, ///< Y offset of link text
|
|
|
|
w, ///< Width of link text
|
|
|
|
h; ///< Height of link text
|
2001-08-02 23:43:49 +04:00
|
|
|
};
|
|
|
|
|
2009-01-14 20:59:49 +03:00
|
|
|
/*
|
|
|
|
* Fl_Help_View font stack opaque implementation
|
|
|
|
*/
|
|
|
|
|
2009-04-07 21:33:22 +04:00
|
|
|
/** Fl_Help_View font stack element definition. */
|
2011-01-23 01:40:11 +03:00
|
|
|
struct FL_EXPORT Fl_Help_Font_Style {
|
2009-01-14 20:59:49 +03:00
|
|
|
Fl_Font f; ///< Font
|
|
|
|
Fl_Fontsize s; ///< Font Size
|
|
|
|
Fl_Color c; ///< Font Color
|
|
|
|
void get(Fl_Font &afont, Fl_Fontsize &asize, Fl_Color &acolor) {afont=f; asize=s; acolor=c;} ///< Gets current font attributes
|
|
|
|
void set(Fl_Font afont, Fl_Fontsize asize, Fl_Color acolor) {f=afont; s=asize; c=acolor;} ///< Sets current font attributes
|
|
|
|
Fl_Help_Font_Style(Fl_Font afont, Fl_Fontsize asize, Fl_Color acolor) {set(afont, asize, acolor);}
|
|
|
|
Fl_Help_Font_Style(){} // For in table use
|
|
|
|
};
|
|
|
|
|
2009-04-07 21:33:22 +04:00
|
|
|
/** Fl_Help_View font stack definition. */
|
2009-01-14 20:59:49 +03:00
|
|
|
const size_t MAX_FL_HELP_FS_ELTS = 100;
|
|
|
|
|
2011-01-23 01:40:11 +03:00
|
|
|
struct FL_EXPORT Fl_Help_Font_Stack {
|
2009-04-07 21:33:22 +04:00
|
|
|
/** font stack construction, initialize attributes. */
|
2009-01-14 20:59:49 +03:00
|
|
|
Fl_Help_Font_Stack() {
|
|
|
|
nfonts_ = 0;
|
|
|
|
}
|
|
|
|
|
2020-07-01 19:03:10 +03:00
|
|
|
void init(Fl_Font f, Fl_Fontsize s, Fl_Color c) {
|
2009-01-14 20:59:49 +03:00
|
|
|
nfonts_ = 0;
|
|
|
|
elts_[nfonts_].set(f, s, c);
|
2020-07-01 19:03:10 +03:00
|
|
|
fl_font(f, s);
|
2009-01-14 20:59:49 +03:00
|
|
|
fl_color(c);
|
|
|
|
}
|
2009-04-07 21:33:22 +04:00
|
|
|
/** Gets the top (current) element on the stack. */
|
2009-01-14 20:59:49 +03:00
|
|
|
void top(Fl_Font &f, Fl_Fontsize &s, Fl_Color &c) { elts_[nfonts_].get(f, s, c); }
|
|
|
|
/** Pushes the font style triplet on the stack, also calls fl_font() & fl_color() adequately */
|
2020-07-01 19:03:10 +03:00
|
|
|
void push(Fl_Font f, Fl_Fontsize s, Fl_Color c) {
|
2009-01-14 20:59:49 +03:00
|
|
|
if (nfonts_ < MAX_FL_HELP_FS_ELTS-1) nfonts_ ++;
|
|
|
|
elts_[nfonts_].set(f, s, c);
|
2020-07-01 19:03:10 +03:00
|
|
|
fl_font(f, s); fl_color(c);
|
2009-01-14 20:59:49 +03:00
|
|
|
}
|
|
|
|
/** Pops from the stack the font style triplet and calls fl_font() & fl_color() adequately */
|
2020-07-01 19:03:10 +03:00
|
|
|
void pop(Fl_Font &f, Fl_Fontsize &s, Fl_Color &c) {
|
2009-04-03 11:31:51 +04:00
|
|
|
if (nfonts_ > 0) nfonts_ --;
|
2009-01-14 20:59:49 +03:00
|
|
|
top(f, s, c);
|
|
|
|
fl_font(f, s); fl_color(c);
|
|
|
|
}
|
2009-04-07 21:33:22 +04:00
|
|
|
/** Gets the current count of font style elements in the stack. */
|
|
|
|
size_t count() const {return nfonts_;} // Gets the current number of fonts in the stack
|
2009-01-14 20:59:49 +03:00
|
|
|
|
|
|
|
protected:
|
2020-07-01 19:03:10 +03:00
|
|
|
size_t nfonts_; ///< current number of fonts in stack
|
2017-08-18 18:46:20 +03:00
|
|
|
Fl_Help_Font_Style elts_[MAX_FL_HELP_FS_ELTS]; ///< font elements
|
2009-01-14 20:59:49 +03:00
|
|
|
};
|
|
|
|
|
2009-03-16 00:16:34 +03:00
|
|
|
/** Fl_Help_Target structure */
|
|
|
|
|
2011-01-24 20:04:22 +03:00
|
|
|
struct Fl_Help_Target {
|
2020-07-01 19:03:10 +03:00
|
|
|
char name[32]; ///< Target name
|
|
|
|
int y; ///< Y offset of target
|
2001-08-02 23:43:49 +04:00
|
|
|
};
|
|
|
|
|
2008-09-15 00:00:03 +04:00
|
|
|
/**
|
|
|
|
The Fl_Help_View widget displays HTML text. Most HTML 2.0
|
|
|
|
elements are supported, as well as a primitive implementation of tables.
|
|
|
|
GIF, JPEG, and PNG images are displayed inline.
|
2010-02-23 18:55:22 +03:00
|
|
|
|
|
|
|
Supported HTML tags:
|
|
|
|
- A: HREF/NAME
|
|
|
|
- B
|
|
|
|
- BODY: BGCOLOR/TEXT/LINK
|
|
|
|
- BR
|
|
|
|
- CENTER
|
|
|
|
- CODE
|
|
|
|
- DD
|
|
|
|
- DL
|
|
|
|
- DT
|
|
|
|
- EM
|
|
|
|
- FONT: COLOR/SIZE/FACE=(helvetica/arial/sans/times/serif/symbol/courier)
|
|
|
|
- H1/H2/H3/H4/H5/H6
|
|
|
|
- HEAD
|
|
|
|
- HR
|
|
|
|
- I
|
|
|
|
- IMG: SRC/WIDTH/HEIGHT/ALT
|
|
|
|
- KBD
|
|
|
|
- LI
|
|
|
|
- OL
|
|
|
|
- P
|
|
|
|
- PRE
|
|
|
|
- STRONG
|
|
|
|
- TABLE: TH/TD/TR/BORDER/BGCOLOR/COLSPAN/ALIGN=CENTER|RIGHT|LEFT
|
|
|
|
- TITLE
|
|
|
|
- TT
|
|
|
|
- U
|
|
|
|
- UL
|
|
|
|
- VAR
|
|
|
|
|
|
|
|
Supported color names:
|
|
|
|
- black,red,green,yellow,blue,magenta,fuchsia,cyan,aqua,white,gray,grey,lime,maroon,navy,olive,purple,silver,teal.
|
|
|
|
|
|
|
|
Supported urls:
|
|
|
|
- Internal: file:
|
|
|
|
- External: http: ftp: https: ipp: mailto: news:
|
|
|
|
|
|
|
|
Quoted char names:
|
|
|
|
- Aacute aacute Acirc acirc acute AElig aelig Agrave agrave amp Aring aring Atilde atilde Auml auml
|
|
|
|
- brvbar bull
|
|
|
|
- Ccedil ccedil cedil cent copy curren
|
2020-07-01 17:10:31 +03:00
|
|
|
- dagger deg divide
|
2010-02-23 18:55:22 +03:00
|
|
|
- Eacute eacute Ecirc ecirc Egrave egrave ETH eth Euml euml euro
|
|
|
|
- frac12 frac14 frac34
|
|
|
|
- gt
|
|
|
|
- Iacute iacute Icirc icirc iexcl Igrave igrave iquest Iuml iuml
|
|
|
|
- laquo lt
|
|
|
|
- macr micro middot
|
|
|
|
- nbsp not Ntilde ntilde
|
|
|
|
- Oacute oacute Ocirc ocirc Ograve ograve ordf ordm Oslash oslash Otilde otilde Ouml ouml
|
2016-05-17 19:33:50 +03:00
|
|
|
- para permil plusmn pound
|
2010-02-23 18:55:22 +03:00
|
|
|
- quot
|
|
|
|
- raquo reg
|
|
|
|
- sect shy sup1 sup2 sup3 szlig
|
|
|
|
- THORN thorn times trade
|
|
|
|
- Uacute uacute Ucirc ucirc Ugrave ugrave uml Uuml uuml
|
|
|
|
- Yacute yacute
|
|
|
|
- yen Yuml yuml
|
|
|
|
|
2022-07-14 21:05:21 +03:00
|
|
|
\note You can't effectively set the box() to FL_NO_BOX, this would result
|
|
|
|
in FL_DOWN_BOX being used as the boxtype of the widget. This is unexpected
|
|
|
|
but can't be changed for backwards compatibility. If you don't want a frame
|
|
|
|
around the widget you can use FL_FLAT_BOX instead.
|
2008-09-15 00:00:03 +04:00
|
|
|
*/
|
2020-07-01 19:03:10 +03:00
|
|
|
class FL_EXPORT Fl_Help_View : public Fl_Group { // Help viewer widget
|
|
|
|
|
|
|
|
enum { RIGHT = -1, CENTER, LEFT }; ///< Alignments
|
|
|
|
|
|
|
|
char title_[1024]; ///< Title string
|
|
|
|
Fl_Color defcolor_, ///< Default text color
|
|
|
|
bgcolor_, ///< Background color
|
|
|
|
textcolor_, ///< Text color
|
|
|
|
linkcolor_; ///< Link color
|
|
|
|
Fl_Font textfont_; ///< Default font for text
|
|
|
|
Fl_Fontsize textsize_; ///< Default font size
|
|
|
|
const char *value_; ///< HTML text value
|
|
|
|
Fl_Help_Font_Stack fstack_; ///< font stack management
|
|
|
|
int nblocks_, ///< Number of blocks/paragraphs
|
|
|
|
ablocks_; ///< Allocated blocks
|
|
|
|
Fl_Help_Block *blocks_; ///< Blocks
|
|
|
|
|
|
|
|
Fl_Help_Func *link_; ///< Link transform function
|
|
|
|
|
|
|
|
int nlinks_, ///< Number of links
|
|
|
|
alinks_; ///< Allocated links
|
|
|
|
Fl_Help_Link *links_; ///< Links
|
|
|
|
|
|
|
|
int ntargets_, ///< Number of targets
|
|
|
|
atargets_; ///< Allocated targets
|
|
|
|
Fl_Help_Target *targets_; ///< Targets
|
|
|
|
|
|
|
|
char directory_[FL_PATH_MAX];///< Directory for current file
|
|
|
|
char filename_[FL_PATH_MAX]; ///< Current filename
|
|
|
|
int topline_, ///< Top line in document
|
|
|
|
leftline_, ///< Lefthand position
|
|
|
|
size_, ///< Total document length
|
|
|
|
hsize_, ///< Maximum document width
|
|
|
|
scrollbar_size_; ///< Size for both scrollbars
|
|
|
|
Fl_Scrollbar scrollbar_, ///< Vertical scrollbar for document
|
|
|
|
hscrollbar_; ///< Horizontal scrollbar
|
2001-08-02 23:43:49 +04:00
|
|
|
|
2024-07-29 15:03:16 +03:00
|
|
|
static int selection_first_;
|
|
|
|
static int selection_last_;
|
|
|
|
static int selection_push_first_;
|
|
|
|
static int selection_push_last_;
|
|
|
|
static int selection_drag_first_;
|
|
|
|
static int selection_drag_last_;
|
|
|
|
static int selected_;
|
|
|
|
static int draw_mode_;
|
|
|
|
static int mouse_x_;
|
|
|
|
static int mouse_y_;
|
|
|
|
static int current_pos_;
|
|
|
|
static Fl_Help_View *current_view_;
|
|
|
|
static Fl_Color hv_selection_color_;
|
|
|
|
static Fl_Color hv_selection_text_color_;
|
2006-06-18 19:53:26 +04:00
|
|
|
|
2009-01-14 20:59:49 +03:00
|
|
|
|
|
|
|
void initfont(Fl_Font &f, Fl_Fontsize &s, Fl_Color &c) { f = textfont_; s = textsize_; c = textcolor_; fstack_.init(f, s, c); }
|
|
|
|
void pushfont(Fl_Font f, Fl_Fontsize s) {fstack_.push(f, s, textcolor_);}
|
|
|
|
void pushfont(Fl_Font f, Fl_Fontsize s, Fl_Color c) {fstack_.push(f, s, c);}
|
|
|
|
void popfont(Fl_Font &f, Fl_Fontsize &s, Fl_Color &c) {fstack_.pop(f, s, c);}
|
|
|
|
|
2020-07-01 19:03:10 +03:00
|
|
|
Fl_Help_Block *add_block(const char *s, int xx, int yy, int ww, int hh, uchar border = 0);
|
|
|
|
void add_link(const char *n, int xx, int yy, int ww, int hh);
|
|
|
|
void add_target(const char *n, int yy);
|
|
|
|
static int compare_targets(const Fl_Help_Target *t0, const Fl_Help_Target *t1);
|
|
|
|
int do_align(Fl_Help_Block *block, int line, int xx, int a, int &l);
|
2013-12-30 18:18:18 +04:00
|
|
|
protected:
|
2022-12-30 21:14:36 +03:00
|
|
|
void draw() FL_OVERRIDE;
|
2013-12-30 18:18:18 +04:00
|
|
|
private:
|
2020-07-01 19:03:10 +03:00
|
|
|
void format();
|
|
|
|
void format_table(int *table_width, int *columns, const char *table);
|
|
|
|
void free_data();
|
|
|
|
int get_align(const char *p, int a);
|
|
|
|
const char *get_attr(const char *p, const char *n, char *buf, int bufsize);
|
|
|
|
Fl_Color get_color(const char *n, Fl_Color c);
|
2001-11-24 05:46:19 +03:00
|
|
|
Fl_Shared_Image *get_image(const char *name, int W, int H);
|
2020-07-01 19:03:10 +03:00
|
|
|
int get_length(const char *l);
|
2013-12-30 18:18:18 +04:00
|
|
|
public:
|
2022-12-30 21:14:36 +03:00
|
|
|
int handle(int) FL_OVERRIDE;
|
2013-12-30 18:18:18 +04:00
|
|
|
private:
|
2001-08-02 23:43:49 +04:00
|
|
|
|
2016-05-19 19:50:09 +03:00
|
|
|
void hv_draw(const char *t, int x, int y, int entity_extra_length = 0);
|
2006-06-16 23:45:13 +04:00
|
|
|
char begin_selection();
|
|
|
|
char extend_selection();
|
|
|
|
void end_selection(int c=0);
|
|
|
|
void clear_global_selection();
|
|
|
|
Fl_Help_Link *find_link(int, int);
|
|
|
|
void follow_link(Fl_Help_Link*);
|
|
|
|
|
|
|
|
public:
|
2001-08-02 23:43:49 +04:00
|
|
|
|
2024-07-29 15:03:16 +03:00
|
|
|
static const char *copy_menu_text;
|
|
|
|
|
2001-09-29 18:38:59 +04:00
|
|
|
Fl_Help_View(int xx, int yy, int ww, int hh, const char *l = 0);
|
|
|
|
~Fl_Help_View();
|
2009-04-07 21:33:22 +04:00
|
|
|
/** Returns the current directory for the text in the buffer. */
|
2020-07-01 19:03:10 +03:00
|
|
|
const char *directory() const { if (directory_[0]) return (directory_);
|
|
|
|
else return ((const char *)0); }
|
2009-04-07 21:33:22 +04:00
|
|
|
/** Returns the current filename for the text in the buffer. */
|
2020-07-01 19:03:10 +03:00
|
|
|
const char *filename() const { if (filename_[0]) return (filename_);
|
|
|
|
else return ((const char *)0); }
|
|
|
|
int find(const char *s, int p = 0);
|
2008-09-15 00:00:03 +04:00
|
|
|
/**
|
|
|
|
This method assigns a callback function to use when a link is
|
2009-03-16 00:28:50 +03:00
|
|
|
followed or a file is loaded (via Fl_Help_View::load()) that
|
|
|
|
requires a different file or path.
|
2020-07-01 19:03:10 +03:00
|
|
|
|
2009-03-16 00:28:50 +03:00
|
|
|
The callback function receives a pointer to the Fl_Help_View
|
|
|
|
widget and the URI or full pathname for the file in question.
|
|
|
|
It must return a pathname that can be opened as a local file or NULL:
|
2020-07-01 19:03:10 +03:00
|
|
|
|
2008-09-15 23:21:20 +04:00
|
|
|
\code
|
2008-09-15 00:00:03 +04:00
|
|
|
const char *fn(Fl_Widget *w, const char *uri);
|
2008-09-15 23:21:20 +04:00
|
|
|
\endcode
|
2020-07-01 19:03:10 +03:00
|
|
|
|
2009-03-16 00:28:50 +03:00
|
|
|
The link function can be used to retrieve remote or virtual
|
2008-09-15 00:00:03 +04:00
|
|
|
documents, returning a temporary file that contains the actual
|
|
|
|
data. If the link function returns NULL, the value of
|
2009-03-16 00:28:50 +03:00
|
|
|
the Fl_Help_View widget will remain unchanged.
|
2020-07-01 19:03:10 +03:00
|
|
|
|
2009-03-16 00:28:50 +03:00
|
|
|
If the link callback cannot handle the URI scheme, it should
|
2008-09-15 00:00:03 +04:00
|
|
|
return the uri value unchanged or set the value() of the widget
|
|
|
|
before returning NULL.
|
|
|
|
*/
|
2020-07-01 19:03:10 +03:00
|
|
|
void link(Fl_Help_Func *fn) { link_ = fn; }
|
|
|
|
int load(const char *f);
|
2022-12-30 21:14:36 +03:00
|
|
|
void resize(int,int,int,int) FL_OVERRIDE;
|
2009-04-07 21:33:22 +04:00
|
|
|
/** Gets the size of the help view. */
|
2020-07-01 19:03:10 +03:00
|
|
|
int size() const { return (size_); }
|
|
|
|
void size(int W, int H) { Fl_Widget::size(W, H); }
|
2008-09-15 00:00:03 +04:00
|
|
|
/** Sets the default text color. */
|
2020-07-01 19:03:10 +03:00
|
|
|
void textcolor(Fl_Color c) { if (textcolor_ == defcolor_) textcolor_ = c; defcolor_ = c; }
|
2009-03-16 00:28:50 +03:00
|
|
|
/** Returns the current default text color. */
|
2020-07-01 19:03:10 +03:00
|
|
|
Fl_Color textcolor() const { return (defcolor_); }
|
2008-09-15 00:00:03 +04:00
|
|
|
/** Sets the default text font. */
|
2020-07-01 19:03:10 +03:00
|
|
|
void textfont(Fl_Font f) { textfont_ = f; format(); }
|
2008-09-15 00:00:03 +04:00
|
|
|
/** Returns the current default text font. */
|
2008-04-23 23:09:28 +04:00
|
|
|
Fl_Font textfont() const { return (textfont_); }
|
2008-09-15 00:00:03 +04:00
|
|
|
/** Sets the default text size. */
|
2020-07-01 19:03:10 +03:00
|
|
|
void textsize(Fl_Fontsize s) { textsize_ = s; format(); }
|
2008-09-15 00:00:03 +04:00
|
|
|
/** Gets the default text size. */
|
2008-08-16 01:11:21 +04:00
|
|
|
Fl_Fontsize textsize() const { return (textsize_); }
|
2008-09-15 00:00:03 +04:00
|
|
|
/** Returns the current document title, or NULL if there is no title. */
|
2020-07-01 19:03:10 +03:00
|
|
|
const char *title() { return (title_); }
|
|
|
|
void topline(const char *n);
|
|
|
|
void topline(int);
|
2009-04-07 21:33:22 +04:00
|
|
|
/** Returns the current top line in pixels. */
|
2020-07-01 19:03:10 +03:00
|
|
|
int topline() const { return (topline_); }
|
|
|
|
void leftline(int);
|
2009-04-07 21:33:22 +04:00
|
|
|
/** Gets the left position in pixels. */
|
2020-07-01 19:03:10 +03:00
|
|
|
int leftline() const { return (leftline_); }
|
|
|
|
void value(const char *val);
|
2008-09-15 00:00:03 +04:00
|
|
|
/** Returns the current buffer contents. */
|
2020-07-01 19:03:10 +03:00
|
|
|
const char *value() const { return (value_); }
|
2006-06-16 23:45:13 +04:00
|
|
|
void clear_selection();
|
|
|
|
void select_all();
|
2009-04-03 02:02:19 +04:00
|
|
|
/**
|
|
|
|
Gets the current size of the scrollbars' troughs, in pixels.
|
|
|
|
|
2020-07-01 19:03:10 +03:00
|
|
|
If this value is zero (default), this widget will use the
|
2009-04-03 02:02:19 +04:00
|
|
|
Fl::scrollbar_size() value as the scrollbar's width.
|
2020-07-01 19:03:10 +03:00
|
|
|
|
2009-04-07 21:33:22 +04:00
|
|
|
\returns Scrollbar size in pixels, or 0 if the global Fl::scrollbar_size() is being used.
|
2009-04-03 02:02:19 +04:00
|
|
|
\see Fl::scrollbar_size(int)
|
|
|
|
*/
|
|
|
|
int scrollbar_size() const {
|
|
|
|
return(scrollbar_size_);
|
|
|
|
}
|
|
|
|
/**
|
2011-10-04 17:10:55 +04:00
|
|
|
Sets the pixel size of the scrollbars' troughs to \p newSize, in pixels.
|
2009-04-03 02:02:19 +04:00
|
|
|
|
|
|
|
Normally you should not need this method, and should use
|
2020-07-01 19:03:10 +03:00
|
|
|
Fl::scrollbar_size(int) instead to manage the size of ALL
|
|
|
|
your widgets' scrollbars. This ensures your application
|
2009-04-03 02:02:19 +04:00
|
|
|
has a consistent UI, is the default behavior, and is normally
|
|
|
|
what you want.
|
|
|
|
|
|
|
|
Only use THIS method if you really need to override the global
|
|
|
|
scrollbar size. The need for this should be rare.
|
2020-07-01 19:03:10 +03:00
|
|
|
|
2011-10-04 17:10:55 +04:00
|
|
|
Setting \p newSize to the special value of 0 causes the widget to
|
2009-04-03 02:02:19 +04:00
|
|
|
track the global Fl::scrollbar_size(), which is the default.
|
2020-07-01 19:03:10 +03:00
|
|
|
|
2011-10-04 17:10:55 +04:00
|
|
|
\param[in] newSize Sets the scrollbar size in pixels.\n
|
2009-04-03 02:02:19 +04:00
|
|
|
If 0 (default), scrollbar size tracks the global Fl::scrollbar_size()
|
|
|
|
\see Fl::scrollbar_size()
|
|
|
|
*/
|
2011-10-02 10:25:13 +04:00
|
|
|
void scrollbar_size(int newSize) {
|
|
|
|
scrollbar_size_ = newSize;
|
2020-07-01 19:03:10 +03:00
|
|
|
}
|
2024-07-29 15:03:16 +03:00
|
|
|
|
|
|
|
// Check if the user selected text in this view.
|
|
|
|
int text_selected();
|
|
|
|
|
|
|
|
// If text is selected in this view, copy it to a clipboard.
|
|
|
|
int copy(int clipboard=1);
|
2001-08-02 23:43:49 +04:00
|
|
|
};
|
|
|
|
|
2001-11-24 05:46:19 +03:00
|
|
|
#endif // !Fl_Help_View_H
|