summaryrefslogtreecommitdiff
path: root/src/Fl_Help_Dialog.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2005-09-25 16:54:40 +0000
committerMatthias Melcher <fltk@matthiasm.com>2005-09-25 16:54:40 +0000
commit44f06b5d35f8c655ddc0d2c28d8e979713f134c7 (patch)
treef3d4b8bba388048afa76d0d50b50578c93bcd855 /src/Fl_Help_Dialog.cxx
parente1fa5dc88b7db6b7de395ae51ec98df30909dd8d (diff)
STR #1035: Fl_Help_View now accepts direct buffer loading and reading via 'value()' functions.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4582 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Help_Dialog.cxx')
-rw-r--r--src/Fl_Help_Dialog.cxx61
1 files changed, 40 insertions, 21 deletions
diff --git a/src/Fl_Help_Dialog.cxx b/src/Fl_Help_Dialog.cxx
index 0795d784d..6e2b83d23 100644
--- a/src/Fl_Help_Dialog.cxx
+++ b/src/Fl_Help_Dialog.cxx
@@ -32,34 +32,43 @@
#include <FL/fl_ask.H>
void Fl_Help_Dialog::cb_view__i(Fl_Help_View*, void*) {
- if (view_->changed())
+ if (view_->filename())
{
- index_ ++;
-
- if (index_ >= 100)
+ if (view_->changed())
{
- memmove(line_, line_ + 10, sizeof(line_[0]) * 90);
- memmove(file_, file_ + 10, sizeof(file_[0]) * 90);
- index_ -= 10;
- }
+ index_ ++;
+
+ if (index_ >= 100)
+ {
+ memmove(line_, line_ + 10, sizeof(line_[0]) * 90);
+ memmove(file_, file_ + 10, sizeof(file_[0]) * 90);
+ index_ -= 10;
+ }
- max_ = index_;
+ max_ = index_;
- strlcpy(file_[index_], view_->filename(),sizeof(file_[0]));
- line_[index_] = view_->topline();
+ strlcpy(file_[index_], view_->filename(),sizeof(file_[0]));
+ line_[index_] = view_->topline();
- if (index_ > 0)
- back_->activate();
- else
- back_->deactivate();
+ if (index_ > 0)
+ back_->activate();
+ else
+ back_->deactivate();
- forward_->deactivate();
- window_->label(view_->title());
-}
-else if (view_->filename())
-{
- strlcpy(file_[index_], view_->filename(), sizeof(file_[0]));
+ forward_->deactivate();
+ window_->label(view_->title());
+ }
+ else // if ! view_->changed()
+ {
+ strlcpy(file_[index_], view_->filename(), sizeof(file_[0]));
+ line_[index_] = view_->topline();
+ }
+} else { // if ! view_->filename()
+ index_ = 0; // hitting an internal page will disable the back/fwd buffer
+ file_[index_][0] = 0; // unnamed internal page
line_[index_] = view_->topline();
+ back_->deactivate();
+ forward_->deactivate();
};
}
void Fl_Help_Dialog::cb_view_(Fl_Help_View* o, void* v) {
@@ -281,6 +290,16 @@ void Fl_Help_Dialog::topline(int n) {
view_->topline(n);
}
+void Fl_Help_Dialog::value(const char *f) {
+ view_->set_changed();
+view_->value(f);
+window_->label(view_->title());
+}
+
+const char * Fl_Help_Dialog::value() const {
+ return view_->value();
+}
+
int Fl_Help_Dialog::visible() {
return (window_->visible());
}