public column_formatter_renderer(log_view parent, ObjectListView list)
 {
     parent_    = parent;
     list_      = list;
     drawer_    = new log_view_item_draw_ui(parent_);
     formatter_ = parent.formatter;
 }
        public edit_column_formatters_form(log_view lv, string format_syntax, bool apply_only_to_me) {
            lv_ = lv;
            InitializeComponent();
            list.VirtualMode = false;
            list.Font = lv.list.Font;

            var formatter = new column_formatter_array();
            formatter.load(format_syntax);
            render_ = new column_formatter_renderer(lv, list);
            render_.formatter = formatter;

            syntax.Text = prev_syntax_ = render_.formatter.syntax;
            applyToCurrentViewOnly.Checked = apply_only_to_me;
                        
            update_column_visibility();
            load_surrounding_rows();
        }
Example #3
0
        public void edit_column_formatting() {
            var sett = this.cur_history().write_settings;
            var cur_view_name = selected_view().name;
            bool old_apply_to_me = sett.apply_column_formatting_to_me.get(cur_view_name);
            var old_format = sett.column_formatting.get( old_apply_to_me ? cur_view_name : log_view.ALL_VIEWS );
            var form = new edit_column_formatters_form(selected_view(), old_format, old_apply_to_me);
            if (form.ShowDialog(this) == DialogResult.OK) {
                bool new_apply_to_me = form.apply_only_to_me;
                string new_format = form.format_syntax;
                sett.column_formatting.set( new_apply_to_me ? cur_view_name : log_view.ALL_VIEWS, new_format);
                sett.apply_column_formatting_to_me.set( cur_view_name, new_apply_to_me);
                save();
                var needs_refresh = all_log_views_and_full_log();
                if ( new_apply_to_me)
                    needs_refresh = new List<log_view>() { selected_view() };

                foreach ( var view in needs_refresh) {
                    // ignore those views with "apply only to me" 
                    bool view_has_apply_only_to_me = view != selected_view() && view.formatter_applies_only_to_me;
                    if (!view_has_apply_only_to_me) {
                        var new_formatter = new column_formatter_array();
                        new_formatter.load(new_format);
                        view.formatter = new_formatter;
                    }
                }
                selected_view().list.Refresh();
            }
        }
 private void refresh_Tick(object sender, EventArgs e) {
     var cur_syntax = syntax.Text;
     if (prev_syntax_ != cur_syntax) {
         prev_syntax_ = cur_syntax;
         var new_formater = new column_formatter_array();
         string errors = "";
         new_formater.load(cur_syntax, ref errors);
         if (errors == "") {
             render_.formatter = new_formater;
             list.Refresh();
             previewStatus.Text = "Previewing " + list.GetItemCount() + " items.";
             previewStatus.ForeColor = Color.Blue;
         } else {
             previewStatus.Text = errors;
             previewStatus.ForeColor = Color.Red;
         }
     }
 }
 public column_formatter_renderer(log_view parent, ObjectListView list) {
     parent_ = parent;
     list_ = list;
     drawer_ = new log_view_item_draw_ui(parent_);
     formatter_ = parent.formatter;
 }