From eeac6b63da3a9f4c3ca76462e822e028f963eb4e Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 9 May 2001 09:49:25 +0000 Subject: [PATCH] Patch level : xx no patch Files correlati : Ricompilazione Demo : [ ] Commento : Sistemato il menu della viswin git-svn-id: svn://10.65.10.50/trunk@9677 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- include/default.url | 21 ++++++------- include/urldefid.h | 21 +++++++++---- include/viswin.cpp | 75 +++++++++++++++++++++++++-------------------- include/viswin.h | 2 -- 4 files changed, 66 insertions(+), 53 deletions(-) diff --git a/include/default.url b/include/default.url index e914a1e2d..689602131 100755 --- a/include/default.url +++ b/include/default.url @@ -58,24 +58,23 @@ SUBMENU MENU_VISWIN "~Visualizzazione" SUBMENU MENU_VISWIN_EDIT "~Modifica" MENU MENU_VISWIN -ITEM M_EDIT_CLIPBOARD "Interrompi\tESC" -ITEM M_EDIT_CUT "Colle~ga...\tCtrl+G" DISABLED -ITEM M_EDIT_PASTE "~Esporta...\tCtrl+E" -ITEM M_EDIT_SEL_ALL "~Stampa... \tCtrl+S" DISABLED +ITEM M_VISWIN_STOP "Interrompi\tESC" +ITEM M_VISWIN_LINK "Colle~ga...\tCtrl+G" DISABLED +ITEM M_VISWIN_EDIT "~Esporta...\tCtrl+E" +ITEM M_VISWIN_PRINT "~Stampa... \tCtrl+S" DISABLED SEPARATOR ITEM M_SHOW_RULERS "Mostra ~righelli" CHECKABLE ITEM M_SHOW_BUTTONS "Mostra ~bottoni" CHECKABLE -ITEM M_EDIT_UNDO "Ri~disegna" +ITEM M_VISWIN_REDRAW "Ri~disegna" SEPARATOR -ITEM M_EDIT_QUIT "Chiudi\tESC+ESC" +ITEM M_VISWIN_QUIT "Chiudi\tESC+ESC" MENU MENU_VISWIN_EDIT -ITEM M_EDIT_COPY "~Copia" DISABLED -ITEM M_EDIT_CLEAR "~Annulla" DISABLED - +ITEM M_VISWIN_COPY "~Copia" DISABLED +ITEM M_VISWIN_CLEAR "~Annulla" DISABLED SEPARATOR -ITEM M_EDIT_SEARCH "Cerca...\tF7" -ITEM M_EDIT_DELETE "Cerca il prossimo\tF8" DISABLED +ITEM M_VISWIN_SEARCH "Cerca...\tF7" +ITEM M_VISWIN_NEXT "Cerca il prossimo\tF8" DISABLED MENUBAR BROWSE_BAR diff --git a/include/urldefid.h b/include/urldefid.h index e6a3dc04d..e7d2045f9 100755 --- a/include/urldefid.h +++ b/include/urldefid.h @@ -16,19 +16,28 @@ #define VISWIN_BAR (7000) #define BROWSE_BAR (8000) -#define MENU_VISWIN 7001 -#define MENU_VISWIN_EDIT 7002 +#define MENU_VISWIN (VISWIN_BAR+1) +#define MENU_VISWIN_EDIT (VISWIN_BAR+2) + +#define M_VISWIN_STOP (VISWIN_BAR+3) +#define M_VISWIN_LINK (VISWIN_BAR+4) +#define M_VISWIN_EDIT (VISWIN_BAR+5) +#define M_VISWIN_PRINT (VISWIN_BAR+6) +#define M_SHOW_RULERS (VISWIN_BAR+7) +#define M_SHOW_BUTTONS (VISWIN_BAR+8) +#define M_VISWIN_REDRAW (VISWIN_BAR+9) +#define M_VISWIN_QUIT (VISWIN_BAR+10) +#define M_VISWIN_COPY (VISWIN_BAR+11) +#define M_VISWIN_CLEAR (VISWIN_BAR+12) +#define M_VISWIN_SEARCH (VISWIN_BAR+13) +#define M_VISWIN_NEXT (VISWIN_BAR+14) #define MENU_FILE M_FILE - #define M_EDIT_SEARCH (M_EDIT+8) #define M_EDIT_DELETE (M_EDIT+9) #define M_EDIT_QUIT (M_EDIT+10) -#define M_SHOW_RULERS (M_EDIT+20) -#define M_SHOW_BUTTONS (M_EDIT+21) - #define M_PREF (M_FILE+700) #define STR_FIRMNAME 101 diff --git a/include/viswin.cpp b/include/viswin.cpp index 78ba077e6..7d59bd03a 100755 --- a/include/viswin.cpp +++ b/include/viswin.cpp @@ -20,10 +20,10 @@ int PRINT_HEIGHT = 10; #define TEXTROWS (rows() - Y_OFFSET - BUTTONROW_SIZE) #define TEXTCOLUMNS (columns() - X_OFFSET) -#define DLG_QUIT_TITLE "Fine" -#define DLG_EDIT_TITLE "~Edit" -#define DLG_LINK_TITLE "Colle~ga" -#define DLG_PRINT_TITLE "~Stampa" +//#define DLG_QUIT_TITLE "Fine" +//#define DLG_EDIT_TITLE "~Edit" +//#define DLG_LINK_TITLE "Colle~ga" +//#define DLG_PRINT_TITLE "~Stampa" #define BACKGROUND (_toplevel ? MASK_BACK_COLOR : COLOR_GRAY) #define FOREGROUND (_toplevel ? COLOR_BLACK : COLOR_WHITE) @@ -283,7 +283,7 @@ void TViswin::display_link (long y, long x1, long x2, const char *d) if (_link_button) { if (_showbuts) _link_button->enable(); - if (_toplevel) enable_menu_item(M_EDIT_CUT, TRUE); + if (_toplevel) enable_menu_item(M_VISWIN_LINK, TRUE); } if (!_toplevel && !_inside_linkexec) { @@ -319,7 +319,7 @@ void TViswin::erase_link ( if (_link_button) { if (_showbuts) _link_button->disable(); - if (_toplevel) enable_menu_item(M_EDIT_CUT, FALSE); + if (_toplevel) enable_menu_item(M_VISWIN_LINK, FALSE); } } } @@ -392,9 +392,11 @@ bool TViswin::check_link ( if (p == &_point) plinkID = -1; - for (int i = 0; i < _hotspots->items (); i++) + TArray & h = _txt.hotspots(); + + for (int i = 0; i < h.items (); i++) { - TToken_string & t = (TToken_string &) (*_hotspots)[i]; + TToken_string & t = (TToken_string &) h[i]; t.restart (); long ty = t.get_long (); long tx1 = t.get_long (); @@ -513,7 +515,10 @@ void TViswin::erase_selection () paint_selection (); _sel_displayed = FALSE; if (_toplevel) - enable_menu_item(M_EDIT_COPY, FALSE); + { + enable_menu_item(M_VISWIN_COPY, FALSE); + enable_menu_item(M_VISWIN_CLEAR, FALSE); + } } void TViswin::display_selection () @@ -522,7 +527,10 @@ void TViswin::display_selection () paint_selection (); _sel_displayed = TRUE; if (_toplevel) - enable_menu_item(M_EDIT_COPY, TRUE); + { + enable_menu_item(M_VISWIN_COPY, TRUE); + enable_menu_item(M_VISWIN_CLEAR, TRUE); + } } // @doc INTERNAL @@ -1314,7 +1322,7 @@ void TViswin::on_button(short dlg) } break; case DLG_PRINT: - dispatch_e_menu(win(), M_EDIT_SEL_ALL); + dispatch_e_menu(win(), M_VISWIN_PRINT); break; case DLG_EDIT: check_link(); @@ -1381,16 +1389,16 @@ void TViswin::handler (WINDOW win, EVENT * ep) } else switch(ep->v.cmd.tag) { - case M_EDIT_CLIPBOARD: // interrompi + case M_VISWIN_STOP: // interrompi dispatch_e_char(win, K_ESC); break; - case M_EDIT_CUT: // collega + case M_VISWIN_LINK: // collega dispatch_e_char(win, CTRL_G); break; - case M_EDIT_PASTE: // esporta + case M_VISWIN_EDIT: // esporta dispatch_e_char(win, CTRL_E); break; - case M_EDIT_SEL_ALL: // stampa + case M_VISWIN_PRINT: // stampa xvt_statbar_set (""); xvt_statbar_refresh (); stop_run(CTRL_S); @@ -1403,24 +1411,24 @@ void TViswin::handler (WINDOW win, EVENT * ep) show_buttons(!_showbuts); check_menu_item(M_SHOW_BUTTONS, _showbuts); break; - case M_EDIT_QUIT: // chiudi + case M_VISWIN_QUIT: // chiudi xvt_statbar_set (""); xvt_statbar_refresh (); stop_run (K_ENTER); break; - case M_EDIT_COPY: // copia nella clipboard + case M_VISWIN_COPY: // copia nella clipboard dispatch_e_char(win, CTRL_C); break; - case M_EDIT_CLEAR: // annulla selezione + case M_VISWIN_CLEAR: // annulla selezione dispatch_e_char(win,K_ENTER); break; - case M_EDIT_SEARCH: // cerca + case M_VISWIN_SEARCH: // cerca find(); break; - case M_EDIT_DELETE: // cerca il prossimo + case M_VISWIN_NEXT: // cerca il prossimo find_next(); break; - case M_EDIT_UNDO: // ridisegna + case M_VISWIN_REDRAW: // ridisegna refresh(); break; } @@ -2359,11 +2367,11 @@ void TViswin::close_print () _need_update = TRUE; if (_toplevel) { - xvt_menu_set_item_title(win(), M_EDIT_QUIT, "Chiudi\tESC"); - enable_menu_item(M_EDIT_CLIPBOARD, FALSE); + xvt_menu_set_item_title(win(), M_VISWIN_QUIT, "Chiudi\tESC"); + enable_menu_item(M_VISWIN_STOP, FALSE); if (_print_button) _print_button->enable(); - enable_menu_item(M_EDIT_SEL_ALL, TRUE); + enable_menu_item(M_VISWIN_PRINT, TRUE); // build bookmark menu tree _bookmarks = &(printer().get_bookmarks()); if (_bookmarks->items() > 0) @@ -2495,7 +2503,7 @@ void TViswin::find() _last_found.y = l; } } - if (_toplevel) enable_menu_item(M_EDIT_DELETE, TRUE); + if (_toplevel) enable_menu_item(M_VISWIN_NEXT, TRUE); } void TViswin::find_next() @@ -2635,12 +2643,13 @@ TViswin::TViswin(const char *fname, { if (width == 0 && height == 0) maximize(); - enable_menu_item(M_EDIT_COPY, FALSE); + enable_menu_item(M_VISWIN_COPY, FALSE); + enable_menu_item(M_VISWIN_CLEAR, FALSE); enable_menu_item(M_SHOW_RULERS, TRUE); enable_menu_item(M_SHOW_BUTTONS, TRUE); check_menu_item(M_SHOW_RULERS, _rulers != 0); check_menu_item(M_SHOW_BUTTONS, _showbuts); - enable_menu_item(M_EDIT_SEL_ALL, FALSE); + enable_menu_item(M_VISWIN_PRINT, FALSE); } if (_txt.lines() > 0l) @@ -2649,20 +2658,20 @@ TViswin::TViswin(const char *fname, if (_toplevel) { - add_button (DLG_QUIT, DLG_QUIT_TITLE, BMP_QUIT, BMP_QUITDN); + add_button (DLG_QUIT, "", BMP_QUIT, BMP_QUITDN); if (_isedit) - add_button (DLG_EDIT, DLG_EDIT_TITLE, BMP_EDIT); + add_button (DLG_EDIT, "", BMP_EDIT); if (_islink) { - _link_button = add_button(DLG_LINK, DLG_LINK_TITLE, BMP_LINK); + _link_button = add_button(DLG_LINK, "", BMP_LINK); _link_button->disable(); } if (_isprint) { - _print_button = add_button (DLG_PRINT, DLG_PRINT_TITLE, BMP_PRINT); + _print_button = add_button (DLG_PRINT, "", BMP_PRINT); _print_button->disable(); - enable_menu_item(M_EDIT_SEL_ALL, FALSE); + enable_menu_item(M_VISWIN_PRINT, FALSE); } } @@ -2694,8 +2703,6 @@ TViswin::TViswin(const char *fname, t.restart(); _txt.set_hotspots(f, b); } - - _hotspots = &(_txt.hotspots()); } TViswin ::~TViswin () diff --git a/include/viswin.h b/include/viswin.h index 208399fef..510dc9d2d 100755 --- a/include/viswin.h +++ b/include/viswin.h @@ -130,8 +130,6 @@ class TViswin : public TField_window // @cmember:(INTERNAL) Array di link ammessi TArray* _links; - // @cmember:(INTERNAL) Array di hotspots - TArray* _hotspots; // @cmember:(INTERNAL) Array di segnalibri TArray* _bookmarks;