2001-08-02 23:43:49 +04:00
|
|
|
// generated by Fast Light User Interface Designer (fluid) version 1.0100
|
|
|
|
|
2001-09-29 18:38:59 +04:00
|
|
|
#include "../FL/Fl_Help_Dialog.H"
|
2002-05-16 16:47:44 +04:00
|
|
|
#include "flstring.h"
|
2001-08-02 23:43:49 +04:00
|
|
|
|
2001-09-29 18:38:59 +04:00
|
|
|
inline void Fl_Help_Dialog::cb_view__i(Fl_Help_View*, void*) {
|
2001-08-02 23:43:49 +04:00
|
|
|
if (view_->changed())
|
|
|
|
{
|
|
|
|
index_ ++;
|
|
|
|
|
|
|
|
if (index_ >= 100)
|
|
|
|
{
|
|
|
|
memcpy(line_, line_ + 10, sizeof(line_[0]) * 90);
|
|
|
|
memcpy(file_, file_ + 10, sizeof(file_[0]) * 90);
|
|
|
|
index_ -= 10;
|
|
|
|
}
|
|
|
|
|
|
|
|
max_ = index_;
|
|
|
|
|
2002-05-16 16:47:44 +04:00
|
|
|
strlcpy(file_[index_], view_->filename(),sizeof(file_[0]));
|
2001-08-02 23:43:49 +04:00
|
|
|
line_[index_] = view_->topline();
|
|
|
|
|
|
|
|
if (index_ > 0)
|
|
|
|
back_->activate();
|
|
|
|
else
|
|
|
|
back_->deactivate();
|
|
|
|
|
|
|
|
forward_->deactivate();
|
|
|
|
window_->label(view_->title());
|
|
|
|
}
|
|
|
|
else if (view_->filename())
|
|
|
|
{
|
2002-05-16 16:47:44 +04:00
|
|
|
strlcpy(file_[index_], view_->filename(), sizeof(file_[0]));
|
2001-08-02 23:43:49 +04:00
|
|
|
line_[index_] = view_->topline();
|
|
|
|
};
|
|
|
|
}
|
2001-09-29 18:38:59 +04:00
|
|
|
void Fl_Help_Dialog::cb_view_(Fl_Help_View* o, void* v) {
|
|
|
|
((Fl_Help_Dialog*)(o->parent()->user_data()))->cb_view__i(o,v);
|
2001-08-02 23:43:49 +04:00
|
|
|
}
|
|
|
|
|
2001-09-29 18:38:59 +04:00
|
|
|
inline void Fl_Help_Dialog::cb_Close_i(Fl_Button*, void*) {
|
2001-08-02 23:43:49 +04:00
|
|
|
window_->hide();
|
|
|
|
}
|
2001-09-29 18:38:59 +04:00
|
|
|
void Fl_Help_Dialog::cb_Close(Fl_Button* o, void* v) {
|
|
|
|
((Fl_Help_Dialog*)(o->parent()->user_data()))->cb_Close_i(o,v);
|
2001-08-02 23:43:49 +04:00
|
|
|
}
|
|
|
|
|
2001-09-29 18:38:59 +04:00
|
|
|
inline void Fl_Help_Dialog::cb_back__i(Fl_Button*, void*) {
|
2001-08-02 23:43:49 +04:00
|
|
|
if (index_ > 0)
|
|
|
|
index_ --;
|
|
|
|
|
|
|
|
if (index_ == 0)
|
|
|
|
back_->deactivate();
|
|
|
|
|
|
|
|
forward_->activate();
|
|
|
|
|
|
|
|
if (strcmp(view_->filename(), file_[index_]) != 0)
|
|
|
|
view_->load(file_[index_]);
|
|
|
|
|
|
|
|
view_->topline(line_[index_]);
|
|
|
|
}
|
2001-09-29 18:38:59 +04:00
|
|
|
void Fl_Help_Dialog::cb_back_(Fl_Button* o, void* v) {
|
|
|
|
((Fl_Help_Dialog*)(o->parent()->user_data()))->cb_back__i(o,v);
|
2001-08-02 23:43:49 +04:00
|
|
|
}
|
|
|
|
|
2001-09-29 18:38:59 +04:00
|
|
|
inline void Fl_Help_Dialog::cb_forward__i(Fl_Button*, void*) {
|
2001-08-02 23:43:49 +04:00
|
|
|
if (index_ < max_)
|
|
|
|
index_ ++;
|
|
|
|
|
|
|
|
if (index_ >= max_)
|
|
|
|
forward_->deactivate();
|
|
|
|
|
|
|
|
back_->activate();
|
|
|
|
|
|
|
|
if (strcmp(view_->filename(), file_[index_]) != 0)
|
|
|
|
view_->load(file_[index_]);
|
|
|
|
|
|
|
|
view_->topline(line_[index_]);
|
|
|
|
}
|
2001-09-29 18:38:59 +04:00
|
|
|
void Fl_Help_Dialog::cb_forward_(Fl_Button* o, void* v) {
|
|
|
|
((Fl_Help_Dialog*)(o->parent()->user_data()))->cb_forward__i(o,v);
|
2001-08-02 23:43:49 +04:00
|
|
|
}
|
|
|
|
|
2001-09-29 18:38:59 +04:00
|
|
|
inline void Fl_Help_Dialog::cb_smaller__i(Fl_Button*, void*) {
|
2001-08-02 23:43:49 +04:00
|
|
|
if (view_->textsize() > 8)
|
|
|
|
view_->textsize(view_->textsize() - 2);
|
|
|
|
|
|
|
|
if (view_->textsize() <= 8)
|
|
|
|
smaller_->deactivate();
|
|
|
|
larger_->activate();
|
|
|
|
}
|
2001-09-29 18:38:59 +04:00
|
|
|
void Fl_Help_Dialog::cb_smaller_(Fl_Button* o, void* v) {
|
|
|
|
((Fl_Help_Dialog*)(o->parent()->user_data()))->cb_smaller__i(o,v);
|
2001-08-02 23:43:49 +04:00
|
|
|
}
|
|
|
|
|
2001-09-29 18:38:59 +04:00
|
|
|
inline void Fl_Help_Dialog::cb_larger__i(Fl_Button*, void*) {
|
2001-08-02 23:43:49 +04:00
|
|
|
if (view_->textsize() < 18)
|
|
|
|
view_->textsize(view_->textsize() + 2);
|
|
|
|
|
|
|
|
if (view_->textsize() >= 18)
|
|
|
|
larger_->deactivate();
|
|
|
|
smaller_->activate();
|
|
|
|
}
|
2001-09-29 18:38:59 +04:00
|
|
|
void Fl_Help_Dialog::cb_larger_(Fl_Button* o, void* v) {
|
|
|
|
((Fl_Help_Dialog*)(o->parent()->user_data()))->cb_larger__i(o,v);
|
2001-08-02 23:43:49 +04:00
|
|
|
}
|
|
|
|
|
2001-09-29 18:38:59 +04:00
|
|
|
Fl_Help_Dialog::Fl_Help_Dialog() {
|
2001-09-10 07:09:43 +04:00
|
|
|
Fl_Double_Window* w;
|
|
|
|
{ Fl_Double_Window* o = window_ = new Fl_Double_Window(530, 385, "Help Dialog");
|
2001-08-02 23:43:49 +04:00
|
|
|
w = o;
|
|
|
|
o->user_data((void*)(this));
|
2001-09-29 18:38:59 +04:00
|
|
|
{ Fl_Help_View* o = view_ = new Fl_Help_View(10, 10, 510, 330);
|
2001-08-02 23:43:49 +04:00
|
|
|
o->box(FL_DOWN_BOX);
|
|
|
|
o->callback((Fl_Callback*)cb_view_);
|
|
|
|
o->end();
|
|
|
|
Fl_Group::current()->resizable(o);
|
|
|
|
}
|
|
|
|
{ Fl_Button* o = new Fl_Button(425, 350, 95, 25, "Close");
|
|
|
|
o->callback((Fl_Callback*)cb_Close);
|
|
|
|
}
|
|
|
|
{ Fl_Button* o = back_ = new Fl_Button(365, 350, 25, 25, "@<-");
|
2001-09-30 02:59:45 +04:00
|
|
|
o->tooltip("Show the previous help page.");
|
2001-08-02 23:43:49 +04:00
|
|
|
o->shortcut(0xff51);
|
|
|
|
o->labelcolor(2);
|
|
|
|
o->callback((Fl_Callback*)cb_back_);
|
|
|
|
}
|
|
|
|
{ Fl_Button* o = forward_ = new Fl_Button(395, 350, 25, 25, "@->");
|
2001-09-30 02:59:45 +04:00
|
|
|
o->tooltip("Show the next help page.");
|
2001-08-02 23:43:49 +04:00
|
|
|
o->shortcut(0xff53);
|
|
|
|
o->labelcolor(2);
|
|
|
|
o->callback((Fl_Callback*)cb_forward_);
|
|
|
|
}
|
|
|
|
{ Fl_Button* o = smaller_ = new Fl_Button(305, 350, 25, 25, "F");
|
2001-09-30 02:59:45 +04:00
|
|
|
o->tooltip("Make the help text smaller.");
|
2001-08-02 23:43:49 +04:00
|
|
|
o->labelfont(1);
|
|
|
|
o->labelsize(10);
|
|
|
|
o->callback((Fl_Callback*)cb_smaller_);
|
|
|
|
}
|
|
|
|
{ Fl_Button* o = larger_ = new Fl_Button(335, 350, 25, 25, "F");
|
2001-09-30 02:59:45 +04:00
|
|
|
o->tooltip("Make the help text larger.");
|
2001-08-02 23:43:49 +04:00
|
|
|
o->labelfont(1);
|
|
|
|
o->labelsize(16);
|
|
|
|
o->callback((Fl_Callback*)cb_larger_);
|
|
|
|
}
|
|
|
|
o->end();
|
|
|
|
}
|
|
|
|
back_->deactivate();
|
|
|
|
forward_->deactivate();
|
|
|
|
|
|
|
|
index_ = -1;
|
|
|
|
max_ = 0;
|
|
|
|
}
|
|
|
|
|
2001-09-29 18:38:59 +04:00
|
|
|
Fl_Help_Dialog::~Fl_Help_Dialog() {
|
2001-08-02 23:43:49 +04:00
|
|
|
delete window_;
|
|
|
|
}
|
|
|
|
|
2001-09-29 18:38:59 +04:00
|
|
|
int Fl_Help_Dialog::h() {
|
2001-08-02 23:43:49 +04:00
|
|
|
return (window_->h());
|
|
|
|
}
|
|
|
|
|
2001-09-29 18:38:59 +04:00
|
|
|
void Fl_Help_Dialog::hide() {
|
2001-08-02 23:43:49 +04:00
|
|
|
window_->hide();
|
|
|
|
}
|
|
|
|
|
2001-09-29 18:38:59 +04:00
|
|
|
void Fl_Help_Dialog::load(const char *f) {
|
2001-08-02 23:43:49 +04:00
|
|
|
view_->set_changed();
|
|
|
|
view_->load(f);
|
|
|
|
window_->label(view_->title());
|
|
|
|
}
|
|
|
|
|
2001-09-29 18:38:59 +04:00
|
|
|
void Fl_Help_Dialog::position(int xx, int yy) {
|
2001-08-02 23:43:49 +04:00
|
|
|
window_->position(xx, yy);
|
|
|
|
}
|
|
|
|
|
2001-09-29 18:38:59 +04:00
|
|
|
void Fl_Help_Dialog::resize(int xx, int yy, int ww, int hh) {
|
2001-08-02 23:43:49 +04:00
|
|
|
window_->resize(xx, yy, ww, hh);
|
|
|
|
}
|
|
|
|
|
2001-09-29 18:38:59 +04:00
|
|
|
void Fl_Help_Dialog::show() {
|
2001-08-02 23:43:49 +04:00
|
|
|
window_->show();
|
|
|
|
}
|
|
|
|
|
2001-12-23 06:40:51 +03:00
|
|
|
void Fl_Help_Dialog::show(int argc, char **argv) {
|
|
|
|
window_->show(argc, argv);
|
|
|
|
}
|
|
|
|
|
2001-09-29 18:38:59 +04:00
|
|
|
void Fl_Help_Dialog::textsize(uchar s) {
|
2001-08-02 23:43:49 +04:00
|
|
|
view_->textsize(s);
|
|
|
|
|
|
|
|
if (s <= 8)
|
|
|
|
smaller_->deactivate();
|
|
|
|
else
|
|
|
|
smaller_->activate();
|
|
|
|
|
|
|
|
if (s >= 18)
|
|
|
|
larger_->deactivate();
|
|
|
|
else
|
|
|
|
larger_->activate();
|
|
|
|
}
|
|
|
|
|
2001-09-29 18:38:59 +04:00
|
|
|
uchar Fl_Help_Dialog::textsize() {
|
2001-08-02 23:43:49 +04:00
|
|
|
return (view_->textsize());
|
|
|
|
}
|
|
|
|
|
2001-09-29 18:38:59 +04:00
|
|
|
void Fl_Help_Dialog::topline(const char *n) {
|
2001-08-02 23:43:49 +04:00
|
|
|
view_->topline(n);
|
|
|
|
}
|
|
|
|
|
2001-09-29 18:38:59 +04:00
|
|
|
void Fl_Help_Dialog::topline(int n) {
|
2001-08-02 23:43:49 +04:00
|
|
|
view_->topline(n);
|
|
|
|
}
|
|
|
|
|
2001-09-29 18:38:59 +04:00
|
|
|
int Fl_Help_Dialog::visible() {
|
2001-08-02 23:43:49 +04:00
|
|
|
return (window_->visible());
|
|
|
|
}
|
|
|
|
|
2001-09-29 18:38:59 +04:00
|
|
|
int Fl_Help_Dialog::w() {
|
2001-08-02 23:43:49 +04:00
|
|
|
return (window_->w());
|
|
|
|
}
|
|
|
|
|
2001-09-29 18:38:59 +04:00
|
|
|
int Fl_Help_Dialog::x() {
|
2001-08-02 23:43:49 +04:00
|
|
|
return (window_->x());
|
|
|
|
}
|
|
|
|
|
2001-09-29 18:38:59 +04:00
|
|
|
int Fl_Help_Dialog::y() {
|
2001-08-02 23:43:49 +04:00
|
|
|
return (window_->y());
|
|
|
|
}
|