public msg_details_ctrl(log_wizard wizard_parent) { wizard_parent_ = wizard_parent; InitializeComponent(); SetStyle(ControlStyles.Selectable, false); Visible = true; show(false); }
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); }
// ... 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(); */ }
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); } }