mirror of
https://github.com/fltk/fltk.git
synced 2026-05-30 21:25:30 +08:00
Fl_Help_View: Refactoring static sizes
- replaced Fl_Int_Vector with std::vector<int> - removed static buffers in path arrangement methods - NULL to nullptr
This commit is contained in:
+5
-15
@@ -42,7 +42,7 @@ typedef const char *(Fl_Help_Func)(Fl_Widget *, const char *);
|
|||||||
/**
|
/**
|
||||||
\brief A widget to display formatted text, formatted in a subset of HTML.
|
\brief A widget to display formatted text, formatted in a subset of HTML.
|
||||||
|
|
||||||
The Fl_Help_View widget displays HTML text. Most HTML 2.0 elements are
|
The Fl_Help_View widget displays HTML text. Most HTML 2.0 elements are
|
||||||
supported, as well as a primitive implementation of tables.
|
supported, as well as a primitive implementation of tables.
|
||||||
GIF, JPEG, and PNG images are displayed inline.
|
GIF, JPEG, and PNG images are displayed inline.
|
||||||
|
|
||||||
@@ -110,7 +110,7 @@ typedef const char *(Fl_Help_Func)(Fl_Widget *, const char *);
|
|||||||
but can't be changed for backwards compatibility. If you don't want a frame
|
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.
|
around the widget you can use FL_FLAT_BOX instead.
|
||||||
*/
|
*/
|
||||||
class FL_EXPORT Fl_Help_View : public Fl_Group
|
class FL_EXPORT Fl_Help_View : public Fl_Group
|
||||||
{
|
{
|
||||||
private: // classes, structs, and types
|
private: // classes, structs, and types
|
||||||
|
|
||||||
@@ -159,7 +159,7 @@ private: // classes, structs, and types
|
|||||||
std::vector<Font_Style> elts_; ///< font elements
|
std::vector<Font_Style> elts_; ///< font elements
|
||||||
};
|
};
|
||||||
|
|
||||||
enum { RIGHT = -1, CENTER, LEFT }; ///< Alignments
|
enum class Align { RIGHT = -1, CENTER, LEFT }; ///< Alignments
|
||||||
|
|
||||||
private: // data members
|
private: // data members
|
||||||
|
|
||||||
@@ -216,11 +216,11 @@ private: // methods
|
|||||||
Text_Block *add_block(const char *s, int xx, int yy, int ww, int hh, uchar border = 0);
|
Text_Block *add_block(const char *s, int xx, int yy, int ww, int hh, uchar border = 0);
|
||||||
void add_link(const std::string &link, int xx, int yy, int ww, int hh);
|
void add_link(const std::string &link, int xx, int yy, int ww, int hh);
|
||||||
void add_target(const std::string &n, int yy);
|
void add_target(const std::string &n, int yy);
|
||||||
int do_align(Text_Block *block, int line, int xx, int a, int &l);
|
int do_align(Text_Block *block, int line, int xx, Align a, int &l);
|
||||||
void format();
|
void format();
|
||||||
void format_table(int *table_width, int *columns, const char *table);
|
void format_table(int *table_width, int *columns, const char *table);
|
||||||
void free_data();
|
void free_data();
|
||||||
int get_align(const char *p, int a);
|
Align get_align(const char *p, Align a);
|
||||||
const char *get_attr(const char *p, const char *n, char *buf, int bufsize);
|
const char *get_attr(const char *p, const char *n, char *buf, int bufsize);
|
||||||
Fl_Color get_color(const char *n, Fl_Color c);
|
Fl_Color get_color(const char *n, Fl_Color c);
|
||||||
Fl_Shared_Image *get_image(const char *name, int W, int H);
|
Fl_Shared_Image *get_image(const char *name, int W, int H);
|
||||||
@@ -255,30 +255,20 @@ public:
|
|||||||
int find(const char *s, int p = 0);
|
int find(const char *s, int p = 0);
|
||||||
void link(Fl_Help_Func *fn);
|
void link(Fl_Help_Func *fn);
|
||||||
int load(const char *f);
|
int load(const char *f);
|
||||||
/** Gets the size of the help view. */
|
|
||||||
int size() const { return (size_); }
|
int size() const { return (size_); }
|
||||||
void size(int W, int H) { Fl_Widget::size(W, H); }
|
void size(int W, int H) { Fl_Widget::size(W, H); }
|
||||||
/** Sets the default text color. */
|
|
||||||
void textcolor(Fl_Color c) { if (textcolor_ == defcolor_) textcolor_ = c; defcolor_ = c; }
|
void textcolor(Fl_Color c) { if (textcolor_ == defcolor_) textcolor_ = c; defcolor_ = c; }
|
||||||
/** Returns the current default text color. */
|
|
||||||
Fl_Color textcolor() const { return (defcolor_); }
|
Fl_Color textcolor() const { return (defcolor_); }
|
||||||
/** Sets the default text font. */
|
|
||||||
void textfont(Fl_Font f) { textfont_ = f; format(); }
|
void textfont(Fl_Font f) { textfont_ = f; format(); }
|
||||||
/** Returns the current default text font. */
|
|
||||||
Fl_Font textfont() const { return (textfont_); }
|
Fl_Font textfont() const { return (textfont_); }
|
||||||
/** Sets the default text size. */
|
|
||||||
void textsize(Fl_Fontsize s) { textsize_ = s; format(); }
|
void textsize(Fl_Fontsize s) { textsize_ = s; format(); }
|
||||||
/** Gets the default text size. */
|
|
||||||
Fl_Fontsize textsize() const { return (textsize_); }
|
Fl_Fontsize textsize() const { return (textsize_); }
|
||||||
void topline(const char *n);
|
void topline(const char *n);
|
||||||
void topline(int);
|
void topline(int);
|
||||||
/** Returns the current top line in pixels. */
|
|
||||||
int topline() const { return (topline_); }
|
int topline() const { return (topline_); }
|
||||||
void leftline(int);
|
void leftline(int);
|
||||||
/** Gets the left position in pixels. */
|
|
||||||
int leftline() const { return (leftline_); }
|
int leftline() const { return (leftline_); }
|
||||||
void value(const char *val);
|
void value(const char *val);
|
||||||
/** Returns the current buffer contents. */
|
|
||||||
const char *value() const { return (value_); }
|
const char *value() const { return (value_); }
|
||||||
void clear_selection();
|
void clear_selection();
|
||||||
void select_all();
|
void select_all();
|
||||||
|
|||||||
+282
-236
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user