📄 slider_pane.cs
字号:
base.OnKeyUp(e);
}
protected override void OnLostFocus(EventArgs e)
{
this.m_toggled_index = -1;
this.do_paint();
base.OnLostFocus(e);
}
protected override void OnMouseDown(MouseEventArgs e)
{
base.Focus();
this.browse_item_by_pos(new browse_item_handler(this.on_mouse_down_helper), e, null);
base.OnMouseDown(e);
}
protected override void OnMouseLeave(EventArgs e)
{
if (-1 != this.m_hot_index)
{
this.m_hot_index = -1;
this.do_paint();
}
base.OnMouseLeave(e);
}
protected override void OnMouseMove(MouseEventArgs e)
{
if (-1 == this.m_toggled_index)
{
int num = this.browse_item_by_pos(new browse_item_handler(this.on_mouse_move_helper), e, null);
if ((-1 == num) && (-1 != this.m_hot_index))
{
this.m_hot_index = -1;
this.do_paint();
}
}
base.OnMouseMove(e);
}
protected override void OnMouseUp(MouseEventArgs e)
{
this.browse_item_by_pos(new browse_item_handler(this.on_mouse_up_helper), e, null);
this.m_toggled_index = -1;
base.OnMouseUp(e);
}
protected override void OnPaint(PaintEventArgs pe)
{
this.do_paint(pe.Graphics);
}
protected override void OnPaintBackground(PaintEventArgs pevent)
{
this.do_paint(pevent.Graphics);
base.OnPaintBackground(pevent);
}
protected override void OnSizeChanged(EventArgs e)
{
base.OnSizeChanged(e);
this.calculate_item_window_rect();
this.do_paint();
}
public void select_slider(int index)
{
if ((0 <= index) && (index < this.m_slider_items.get_Count()))
{
int num = this.m_selected_index;
if (this.selected_index_changing != null)
{
cancel_select_event_args args = new cancel_select_event_args();
args.m_new_selected_index = index;
args.m_old_selected_index = this.m_selected_index;
args.Cancel = false;
this.selected_index_changing(this, args);
if (args.Cancel)
{
return;
}
}
this.m_selected_index = index;
this.m_focus_index = index;
IntPtr handle = base.Handle;
this.do_paint();
if (index != num)
{
if ((0 <= num) && (this.m_slider_items.get_Count() > num))
{
Control window = this.m_slider_items.get_Item(num).window;
if (window != null)
{
window.Visible = false;
}
}
Control control2 = this.m_slider_items.get_Item(index).window;
if (control2 != null)
{
this.calculate_item_window_rect();
control2.Visible = true;
control2.BringToFront();
control2.Invalidate();
this.do_paint();
}
if (this.selected_index_changed != null)
{
this.selected_index_changed(this, new EventArgs());
}
}
}
}
protected void update_item_window_pos()
{
if ((0 <= this.m_selected_index) && (this.m_slider_items.get_Count() > this.m_selected_index))
{
Control window = this.m_slider_items.get_Item(this.m_selected_index).window;
if (window != null)
{
window.Location = this.m_item_window_rect.Location;
window.Size = this.m_item_window_rect.Size;
if (0 >= window.Size.Height)
{
window.Visible = false;
}
else if (!window.Visible)
{
window.Visible = true;
}
}
}
}
protected override void WndProc(ref Message m)
{
if (0x87 == m.Msg)
{
m.Result = (IntPtr) 0x81;
}
else
{
if (0x100 == m.Msg)
{
if (((IntPtr) 0x26) == m.WParam)
{
m.Result = IntPtr.Zero;
if (this.m_items_dock_bottom)
{
if ((this.m_slider_items.get_Count() - 1) == this.m_focus_index)
{
this.m_focus_index = 0;
this.do_paint();
return;
}
this.m_focus_index++;
this.do_paint();
return;
}
if (this.m_focus_index == 0)
{
this.m_focus_index = this.m_slider_items.get_Count() - 1;
this.do_paint();
return;
}
this.m_focus_index--;
this.do_paint();
return;
}
if (((IntPtr) 40) == m.WParam)
{
m.Result = IntPtr.Zero;
if (this.m_items_dock_bottom)
{
if (this.m_focus_index == 0)
{
this.m_focus_index = this.m_slider_items.get_Count() - 1;
this.do_paint();
return;
}
this.m_focus_index--;
this.do_paint();
return;
}
if ((this.m_slider_items.get_Count() - 1) == this.m_focus_index)
{
this.m_focus_index = 0;
this.do_paint();
return;
}
this.m_focus_index++;
this.do_paint();
return;
}
}
base.WndProc(ref m);
}
}
public bool animated_slider
{
get
{
return this.m_slider_style;
}
set
{
this.m_slider_style = value;
IntPtr handle = base.Handle;
this.calculate_item_window_rect();
this.do_paint();
}
}
public Color background_color
{
get
{
return this.m_clr_background;
}
set
{
this.m_clr_background = value;
IntPtr handle = base.Handle;
this.do_paint();
}
}
public Color frame_color
{
get
{
return this.m_clr_frame;
}
set
{
this.m_clr_frame = value;
IntPtr handle = base.Handle;
this.do_paint();
}
}
public Color hotitem_bottom_color
{
get
{
return this.m_clr_hotitem_bottom;
}
set
{
this.m_clr_hotitem_bottom = value;
IntPtr handle = base.Handle;
this.do_paint();
}
}
public Color hotitem_top_color
{
get
{
return this.m_clr_hotitem_top;
}
set
{
this.m_clr_hotitem_top = value;
IntPtr handle = base.Handle;
this.do_paint();
}
}
public Color hottext_color
{
get
{
return this.m_clr_hottext;
}
set
{
this.m_clr_hottext = value;
IntPtr handle = base.Handle;
this.do_paint();
}
}
public bool is_qqstyle
{
get
{
return this.m_is_qqstyle;
}
set
{
this.m_is_qqstyle = value;
IntPtr handle = base.Handle;
this.calculate_item_window_rect();
this.do_paint();
}
}
public Color item_bottom_color
{
get
{
return this.m_clr_item_bottom;
}
set
{
this.m_clr_item_bottom = value;
IntPtr handle = base.Handle;
this.do_paint();
}
}
public int item_count
{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -