Fl_Help_Dialog::load() now returns an error code (STR #3429)

This commit is contained in:
Matthias Melcher 2019-02-02 01:10:24 +01:00
parent 0698e16a6b
commit 2ce406ab42
4 changed files with 19 additions and 12 deletions

View File

@ -67,7 +67,7 @@ public:
~Fl_Help_Dialog();
int h();
void hide();
void load(const char *f);
int load(const char *f);
void position(int xx, int yy);
void resize(int xx, int yy, int ww, int hh);
void show();

View File

@ -221,10 +221,11 @@ void Fl_Help_Dialog::hide() {
window_->hide();
}
void Fl_Help_Dialog::load(const char *f) {
int Fl_Help_Dialog::load(const char *f) {
view_->set_changed();
view_->load(f);
int ret = view_->load(f);
window_->label(view_->title());
return ret;
}
void Fl_Help_Dialog::position(int xx, int yy) {

View File

@ -29,7 +29,7 @@ comment {//
} {in_source in_header
}
decl {\#include <FL/Fl_Shared_Image.H>} {selected private local
decl {\#include <FL/Fl_Shared_Image.H>} {private local
}
decl {\#include "flstring.h"} {private local
@ -50,8 +50,7 @@ class FL_EXPORT Fl_Help_Dialog {open
}
decl {int find_pos_;} {private local
}
Function {Fl_Help_Dialog()} {open
} {
Function {Fl_Help_Dialog()} {} {
Fl_Window window_ {
label {Help Dialog} open
private xywh {398 64 530 385} type Double hide resizable size_range {260 150 0 0}
@ -190,11 +189,13 @@ fl_register_images();} {}
} {
code {window_->hide();} {}
}
Function {load(const char *f)} {return_type void
Function {load(const char *f)} {open return_type int
} {
code {view_->set_changed();
view_->load(f);
window_->label(view_->title());} {}
int ret = view_->load(f);
window_->label(view_->title());
return ret;} {selected
}
}
Function {position(int xx, int yy)} {return_type void
} {

View File

@ -40,9 +40,14 @@
/** \fn void Fl_Help_Dialog::hide()
Hides the Fl_Help_Dialog window.*/
/** \fn void Fl_Help_Dialog::load(const char *f)
Loads the specified HTML file into the Fl_Help_View widget.
The filename can also contain a target name ("filename.html#target").
/** \fn int Fl_Help_Dialog::load(const char *f)
\brief Loads the specified HTML file into the Fl_Help_View widget.
The filename can also contain a target name ("filename.html#target"). Always
use forward slashes as path deliminators, MSWindows-style backslashes are not
supported here
\param[in] f the name and path of an HTML file
\return 0 on success, -1 on error
\see Fl_Help_View::load(), fl_load_uri()
*/
/** \fn void Fl_Help_Dialog::position(int x, int y)