예제 #1
0
 public msg_details_ctrl(log_wizard wizard_parent)
 {
     wizard_parent_ = wizard_parent;
     InitializeComponent();
     SetStyle(ControlStyles.Selectable, false);
     Visible = true;
     show(false);
 }
예제 #2
0
        public log_view(log_wizard parent, string name)
        {
            InitializeComponent();
            this.parent = parent;
            viewName.Text = name;
            model_ = new list_data_source(this.list);
            list.VirtualListDataSource = model_;
            list.RowHeight = 18;

            load_font();
            parent.handle_subcontrol_keys(this);
        }
예제 #3
0
        // ... just setting .TopMost sometimes does not work
        private static void bring_to_topmost(log_wizard form) {
            form.TopMost = true;
            form.update_toggle_topmost_visibility();
            win32.MakeTopMost(form);
            /*
            form.TopMost = false;
            form.Activated += FormOnActivated;

            form.BringToFront();
            form.Focus();
            form.Activate();
            */
        }
예제 #4
0
        public void on_action(log_wizard.action_type action)
        {
            switch (action) {
            case log_wizard.action_type.home:
            case log_wizard.action_type.end:
            case log_wizard.action_type.pageup:
            case log_wizard.action_type.pagedown:
            case log_wizard.action_type.arrow_up:
            case log_wizard.action_type.arrow_down:
                break;
            default:
                Debug.Assert(false);
                return;
            }

            int sel = list.SelectedIndex;
            if (sel < 0 && list.GetItemCount() > 0)
                sel = 0; // assume we start from the top

            // int rows_per_page = list.RowsPerPage;
            int height = list.Height - list.HeaderControl.ClientRectangle.Height;
            switch (action) {
            case log_wizard.action_type.home:
                sel = 0;
                break;
            case log_wizard.action_type.end:
                sel = list.GetItemCount() - 1;
                break;
            case log_wizard.action_type.pageup:
                if (sel >= 0) {
                    var r = list.GetItem(sel).Bounds;
                    var middle = new Point( r.Left + r.Width / 2, r.Top + r.Height / 2 );
                    list.LowLevelScroll(0, -height);
                    sel = list.HitTest(middle).Item.Index;
                }
                break;
            case log_wizard.action_type.pagedown:
                if (sel < list.GetItemCount() - 1) {
                    var r = list.GetItem(sel).Bounds;
                    var middle = new Point( r.Left + r.Width / 2, r.Top + r.Height / 2 );
                    list.LowLevelScroll(0, height);
                    sel = list.HitTest(middle).Item.Index;
                }
                break;
            case log_wizard.action_type.arrow_up:
                if ( sel > 0)
                    --sel;
                break;
            case log_wizard.action_type.arrow_down:
                if ( sel < list.GetItemCount() - 1)
                    ++sel;
                break;
            }
            if (sel >= 0 && list.SelectedIndex != sel) {
                select_idx( sel, select_type.notify_parent);
                list.EnsureVisible(sel);
            }
        }