示例#1
0
        public log_wizard()
        {
            InitializeComponent();
            forms.Add(this);
            Text += " " + version();
            sourceTypeCtrl.SelectedIndex = 0;
            bool first_time = contexts_.Count == 0;
            if (first_time) {
                app.inst.load();
                load_contexts();
            }

            ignore_change = true;

            foreach ( ui_context ctx in contexts_)
                curContextCtrl.Items.Add(ctx.name);
            // just select something
            curContextCtrl.SelectedIndex = 0;

            foreach ( history hist in history_)
                logHistory.Items.Add(hist.combo_name);

            load();

            fullLogCtrl = new log_view( this, "[All]");
            fullLogCtrl.Dock = DockStyle.Fill;
            filteredLeft.Panel2.Controls.Add(fullLogCtrl);
            fullLogCtrl.show_name(false);
            fullLogCtrl.show_view(true);

            ignore_change = false;
            hide_tabs(leftPane);

            msg_details_ = new msg_details_ctrl(this);
            Controls.Add(msg_details_);
            handle_subcontrol_keys(this);

            bool open_cmd_line_file = forms.Count == 1 && Program.open_file_name != null;
            if ( history_.Count > 0 && !open_cmd_line_file)
                logHistory.SelectedIndex = history_.Count - 1;
            if (open_cmd_line_file)
                on_file_drop(Program.open_file_name);

            viewsTab.DrawMode = TabDrawMode.OwnerDrawFixed;
            viewsTab.DrawItem += ViewsTabOnDrawItem;

            update_topmost_image();
            update_toggle_topmost_visibility();
        }
示例#2
0
        private log_view ensure_we_have_log_view_for_tab(int idx)
        {
            //if ( text_ == null)
              //  return;
            TabPage tab = viewsTab.TabPages[idx];
            foreach ( Control c in tab.Controls)
                if ( c is log_view)
                    return c as log_view; // we have it

            foreach ( Control c in tab.Controls)
                c.Visible = false;

            log_view new_ = new log_view( this, viewsTab.TabPages[idx].Text );
            new_.Dock = DockStyle.Fill;
            tab.Controls.Add(new_);
            new_.show_name(source_shown);
            new_.set_bookmarks(bookmarks_.ToList());
            if ( log_parser_ != null)
                new_.set_log( new log_line_reader(log_parser_));
            return new_;
        }