public search_renderer(log_view parent, search_form search) { search_ = search; drawer_ = new log_view_item_draw_ui(parent); Color normal_fg_ = app.inst.fg, normal_bg_ = app.inst.bg; default_ = new text_part(0, 0) { fg = normal_fg_, bg = normal_bg_, }; Color search_line_fg_ = app.inst.search_found_full_line_fg, search_line_bg_ = app.inst.bg; around_search_ = new text_part(0, 0) { fg = search_line_fg_, bg = search_line_bg_ }; Color search_fg_ = app.inst.search_found_fg, search_bg_ = util.darker_color(app.inst.bg); search_text_ = new text_part(0, 0) { text = "not important", fg = search_fg_, bg = search_bg_, bold = true, italic = false }; }
public search_renderer(log_view parent, search_form search) { search_ = search; drawer_ = new log_view_item_draw_ui(parent); Color normal_fg_ = app.inst.fg, normal_bg_ = app.inst.bg; default_ = new text_part(0,0) { fg = normal_fg_, bg = normal_bg_, }; Color search_line_fg_ = app.inst.search_found_full_line_fg, search_line_bg_ = app.inst.bg; around_search_ = new text_part(0,0) { fg = search_line_fg_, bg = search_line_bg_ }; Color search_fg_ = app.inst.search_found_fg, search_bg_ = util.darker_color(app.inst.bg); search_text_ = new text_part(0,0) { text = "not important", fg = search_fg_, bg = search_bg_, bold = true, italic = false }; }
private void handle_action(action_type action) { int sel = viewsTab.SelectedIndex; var lv = selected_view(); Debug.Assert(lv != null); switch (action) { case action_type.search: if (lv.item_count < 1) { set_status("Can't search - nothing to search", status_ctrl.status_type.err); break; } var searcher = new search_form(this, lv, lv.smart_edit_sel_text); if (searcher.ShowDialog() == DialogResult.OK) { // remove focus from the Filters tab, just in case (otherwise, search prev/next would end up working on that) unfocus_filter_panel(); lv.search_for_text(searcher.search); lv.search_for_text_first(); } break; case action_type.default_search: // remove focus from the Filters tab, just in case (otherwise, search prev/next would end up working on that) unfocus_filter_panel(); var search = search_form.default_search; var sel_text = lv.smart_edit_sel_text; if (sel_text != "") { search.text = sel_text; search.type = 1; // text } lv.search_for_text(search); lv.search_next(); break; case action_type.search_prev: lv.search_prev(); break; case action_type.search_next: lv.search_next(); break; case action_type.escape: if (logHistory.DroppedDown) close_history_dropdown(); else lv.escape(); break; case action_type.right_click_via_key: lv.do_right_click_via_key(); break; case action_type.next_view: { int prev_idx = viewsTab.SelectedIndex; int next_idx = viewsTab.TabCount > 0 ? (sel + 1) % viewsTab.TabCount : -1; if (next_idx >= 0) { viewsTab.SelectedIndex = next_idx; log_view_for_tab(next_idx).on_selected(); } if (prev_idx >= 0) log_view_for_tab(prev_idx).update_x_of_y(); } break; case action_type.prev_view: { int prev_idx = viewsTab.SelectedIndex; int next_idx = viewsTab.TabCount > 0 ? (sel + viewsTab.TabCount - 1) % viewsTab.TabCount : -1; if (next_idx >= 0) { viewsTab.SelectedIndex = next_idx; log_view_for_tab(next_idx).on_selected(); } if (prev_idx >= 0) log_view_for_tab(prev_idx).update_x_of_y(); } break; case action_type.home: case action_type.end: case action_type.pageup: case action_type.pagedown: case action_type.arrow_up: case action_type.arrow_down: case action_type.shift_arrow_down: case action_type.shift_arrow_up: lv.on_action(action); break; case action_type.toggle_filters: toggle_filters(); break; case action_type.toggle_notes: toggle_notes(); break; case action_type.toggle_fulllog: toggle_full_log(); break; case action_type.toggle_source: toggle_source(); break; case action_type.copy_to_clipboard: lv.copy_to_clipboard(); set_status("Lines copied to Clipboard, as text and html"); break; case action_type.copy_full_line_to_clipboard: lv.copy_full_line_to_clipboard(); set_status("Full Lines copied to Clipboard, as text and html"); break; case action_type.toggle_bookmark: int line_idx = lv.sel_line_idx; if (line_idx >= 0) { if (bookmarks_.Contains(line_idx)) bookmarks_.Remove(line_idx); else bookmarks_.Add(line_idx); save_bookmarks(); notify_views_of_bookmarks(); } break; case action_type.clear_bookmarks: bookmarks_.Clear(); save_bookmarks(); notify_views_of_bookmarks(); break; case action_type.next_bookmark: lv.next_bookmark(); break; case action_type.prev_bookmark: lv.prev_bookmark(); break; case action_type.pane_next: switch_pane(true); break; case action_type.pane_prev: switch_pane(false); break; case action_type.toggle_history_dropdown: if (logHistory.DroppedDown) close_history_dropdown(); else { logHistory.Visible = true; logHistory.Focus(); logHistory.DroppedDown = true; } break; case action_type.new_log_wizard: new log_wizard( ).Show(); break; case action_type.show_preferences: whatsupPreferences_Click(null, null); break; case action_type.increase_font: foreach (log_view view in all_log_views_and_full_log()) view.increase_font(1); break; case action_type.decrease_font: foreach (log_view view in all_log_views_and_full_log()) view.increase_font(-1); break; case action_type.scroll_up: lv.scroll_up(); break; case action_type.scroll_down: lv.scroll_down(); break; case action_type.go_to_line: var dlg = new go_to_line_time_form(this); if (dlg.ShowDialog() == DialogResult.OK) { if (dlg.is_number()) { if (dlg.has_offset != '\0') lv.offset_closest_line(dlg.number, dlg.has_offset == '+'); else lv.go_to_closest_line(dlg.number - 1, log_view.select_type.notify_parent); } else if (dlg.has_offset != '\0') lv.offset_closest_time(dlg.time_milliseconds, dlg.has_offset == '+'); else lv.go_to_closest_time(dlg.normalized_time); } break; case action_type.refresh: refreshToolStripMenuItem_Click(null, null); break; case action_type.toggle_title: toggle_title(); break; case action_type.toggle_status: toggle_status(); break; case action_type.toggle_view_tabs: toggle_view_tabs(); break; case action_type.toggle_view_header: toggle_view_header(); break; case action_type.toggle_details: toggle_details(); break; case action_type.open_in_explorer: if (text_ != null) util.open_in_explorer(text_.name); break; case action_type.none: break; case action_type.goto_position_1: toggle_custom_ui(0); break; case action_type.goto_position_2: toggle_custom_ui(1); break; case action_type.goto_position_3: toggle_custom_ui(2); break; case action_type.goto_position_4: toggle_custom_ui(3); break; case action_type.goto_position_5: toggle_custom_ui(4); break; case action_type.goto_position_6: toggle_custom_ui(5); break; case action_type.goto_position_7: toggle_custom_ui(6); break; case action_type.goto_position_8: toggle_custom_ui(7); break; case action_type.goto_position_9: toggle_custom_ui(8); break; case action_type.goto_position_10: toggle_custom_ui(9); break; case action_type.toggle_enabled_dimmed: filtCtrl.toggle_enabled_dimmed(); break; case action_type.export_notes: export_notes_to_logwizard_file(); break; case action_type.undo: if (global_ui.show_filter) filtCtrl.undo(); else if (global_ui.show_notes) notes.undo(); break; case action_type.toggle_filter_view: lv.set_filter( !lv.filter_view, lv.show_full_log); break; case action_type.toggle_show_full_log: { lv.set_filter(lv.filter_view, !lv.show_full_log); var old = global_ui.view(lv.name); global_ui.view(lv.name, new ui_info.view_info(old.column_positions, !old.show_full_log) ); } break; case action_type.open_log: whatsupOpen_Click(null, null); break; default: Debug.Assert(false); break; } }