diff --git a/include/viswin.cpp b/include/viswin.cpp index e67d606f4..f2e642b6c 100755 --- a/include/viswin.cpp +++ b/include/viswin.cpp @@ -22,7 +22,7 @@ const int PRINT_HEIGHT = 10; #define DLG_QUIT_TITLE "Fine" #define DLG_EDIT_TITLE "~Edit" -#define DLG_LINK_TITLE "~Collega" +#define DLG_LINK_TITLE "Colle~ga" #define DLG_PRINT_TITLE "~Stampa" #if XVT_OS == XVT_OS_WIN @@ -337,15 +337,13 @@ void TViswin::paint_link ( // @doc INTERNAL // @mfunc Modifica le dimensione di un box -// // @rdesc Ritorna se sono state modificate le dimensioni del box: -// -// @flag TRUE | Sono state riassegante le coordinate a

e

+// @flag TRUE | Sono state riassegnate le coordinate a

e

// @flag FALSE | Non sono state riassegnate le misure del box poiche'

e' nel testo bool TViswin::adjust_box ( long &x1, // @parm Prima coordinata da riassegnare long &x2, // @parm Seconda coordinata da riassegnare - long y) // @parm Valore della riga che deve essere nel testo + long y) // @parm Valore della riga che deve essere nel testo // @comm Sistema

e

in modo che il minore sia il primo, e controlla che

sia // nel testo (box e' su una sola riga, usata solo per i link) @@ -363,9 +361,7 @@ bool TViswin::adjust_box ( // @mfunc Controlla se la posizione cursore

cade su un link ipertestuale e si // comporta di conseguenza -// // @rdesc Ritorna se la posizione cade sul link -// // @flag TRUE | Se ha constatato la corrispondenza // @flag FALSE | Se non ha constatato la corrispondenza bool TViswin::check_link ( @@ -587,7 +583,11 @@ TPushbutton_control* TViswin::add_button ( // @comm Aggiunge i bottoni nella finestra { TPushbutton_control* b = new TPushbutton_control(win(), id, -11, -1, 11, 2, "", - caption, bup, bdn); + caption, bup, bdn); + // ridimensiona sempre uguale dato che sono tutte bitmap + RCT br; b->get_rect(br); + br.top = br.bottom - taby(2); + b->set_rect(br); _button.add(b); return b; } @@ -1256,7 +1256,44 @@ void TViswin::scroll_error(long x, long y) SetCursorPos(p.x, p.y); #endif } + +void TViswin::on_button(short dlg) +{ +// if (ep->v.ctl.ci.type == WC_PUSHBUTTON) + switch (dlg) + { + case DLG_QUIT: + if (_isopen) abort_print(); + else + { +#if XVT_OS == XVT_OS_WIN + xvt_statbar_set(""); + xvt_statbar_refresh(); +#endif + stop_run(K_ENTER); + } + break; + case DLG_PRINT: + dispatch_e_menu(win(), M_EDIT_SEL_ALL); + break; + case DLG_EDIT: + check_link(); + call_editor(); + _need_update = TRUE; + update(); + check_link(&_point); + break; + case DLG_LINK: + exec_link(); + break; + default: + TWindow::on_button(dlg); + break; + } +} + + void TViswin::handler (WINDOW win, EVENT * ep) { int kdiff_x, kdiff_y; @@ -1353,35 +1390,6 @@ void TViswin::handler (WINDOW win, EVENT * ep) } break; case E_CONTROL: - if (ep->v.ctl.ci.type == WC_PUSHBUTTON) - switch (ep->v.ctl.id) - { - case DLG_QUIT: - if (_isopen) - abort_print (); - else - { -#if XVT_OS == XVT_OS_WIN - xvt_statbar_set (""); - xvt_statbar_refresh (); -#endif - stop_run (K_ENTER); - } - break; - case DLG_PRINT: - dispatch_e_menu(win, M_EDIT_SEL_ALL); - break; - case DLG_EDIT: - check_link (); - call_editor (); - _need_update = TRUE; - update (); - check_link (&_point); - break; - case DLG_LINK: - exec_link(); - break; - } break; case E_TIMER: if (ep->v.timer.id == _timer) @@ -2570,7 +2578,7 @@ TViswin::TViswin(const char *fname, add_button (DLG_EDIT, DLG_EDIT_TITLE, BMP_EDIT); if (_islink) { - _link_button = add_button (DLG_LINK, DLG_LINK_TITLE, BMP_LINK); + _link_button = add_button(DLG_LINK, DLG_LINK_TITLE, BMP_LINK); _link_button->disable(); } if (_isprint) diff --git a/include/viswin.h b/include/viswin.h index fdce8202e..e2d5d4ca9 100755 --- a/include/viswin.h +++ b/include/viswin.h @@ -165,10 +165,8 @@ class TViswin : public TScroll_window bool _inside_linkexec; // òcmember:(INTERNAL) Indica se e' presente il menu' specifico della calsse bool _menu_present; - // @cmember:(INTERNAL) Viene istanziato soltanto se e' usata come controllo TBrowsefile_field* _brwfld; - // @cmember: (INTERNAL) Rettangolo finestra madre RCT _wr; @@ -194,6 +192,8 @@ protected: // @cmember Disegna il cursore a crossbar in XOR void draw_crossbars(); + virtual void on_button(short dlg); + // @cmember Disegna l'header del video (righello) void paint_header(); // @cmember Disegna il cursore in xor nello stile del momento