예제 #1
0
        static private void show_column(OLVColumn col, int width, bool show)
        {
            if (col.Width == 0)
            {
                col.Width = width;
            }
            if (col.is_visible() == show)
            {
                return;
            }

            col.col_width(width);
            col.is_visible(show);
        }
예제 #2
0
 public static int col_width(this OLVColumn col) {
     Debug.Assert(col.Tag != null);
     bool is_line_col = col.fixed_index() == 0;
     if (is_line_col) {
         if (col.is_visible())
             return col.Width;
         else
             return col.lv_tag().line_width;
     } else
         return col.Width;
 }
예제 #3
0
        public static void col_width(this OLVColumn col, int width) {
            Debug.Assert(col.Tag != null);

            bool is_line_col = col.fixed_index() == 0;
            bool show = col.is_visible();
            if (is_line_col) {
                if (show) {
                    col.MaximumWidth = -1;
                    col.Width = width;
                } else {
                    col.lv_tag().line_width = width;
                    // ... don't allow resizing
                    col.MaximumWidth = col.Width = 1;
                }
                col.IsVisible = true;
            } else {
                col.Width = width;
                col.IsVisible = show;
            }
        }
예제 #4
0
        public static void is_visible(this OLVColumn col, bool show) {
            Debug.Assert(col.Tag != null);

            if (col.is_visible() == show)
                return;
            // 1.6.6 for Line column - we can't hide it (due to some weird b_ug in ListView);  so we just set its width to 1
            bool is_line_col = col.fixed_index() == 0;
            if (is_line_col) {
                // for line column - simple trick - save the old width in "Tag" property
                if (show) {
                    col.MaximumWidth = -1;
                    col.Width = col.lv_tag().line_width > 0 ? col.lv_tag().line_width : 80;
                } else {
                    col.lv_tag().line_width = col.Width;
                    col.MaximumWidth = col.Width = 1;
                }
                col.IsVisible = true;
            } else
                col.IsVisible = show;
        }
예제 #5
0
        static private void show_column(OLVColumn col, int width, bool show) {
            if (col.Width == 0)
                col.Width = width;
            if (col.is_visible() == show)
                return;

            col.col_width(width);
            col.is_visible(show);
        }
예제 #6
0
 private void toggle_column_visible(OLVColumn col, ToolStripMenuItem sub) {
     col.is_visible(!col.is_visible());
     sub.Checked = col.is_visible();
     list.RebuildColumns();
     update_cur_col();
 }