protected override void DrawPriorUpdate() { GHManager.UpdateScrSize(); if (KeyboardActive) { if (SelectIndex <= 0) { SelectIndex = 0; MysetIcon.control.Focus(); } else { if (GroupManager.CheckRange(SelectIndex - 1)) { GroupManager.Items[SelectIndex - 1].icon.control.Focus(); } } } }
protected override bool Hide_Criteria() { if (FormVisible) { bool n = ParentGHForm == 0 ? GHManager.Launcher.SelectIndex - 1 >= 0 : GHManager.MysetList.SelectIndex != -1; if (GHManager.Contains.ItemList || n) { if (ParentGHForm == 0) { GroupManager.OpenedItemList(ItemIndex, true); } else { MysetManager.OpenedItemList(ItemIndex, true); } return(false); } if (!IsAnimation) { if (ParentGHForm == 0) { GroupManager.OpenedItemList(ItemIndex, false); } else { MysetManager.OpenedItemList(ItemIndex, false); } FixedActive = false; return(true); } } if (ParentGHForm == 0) { GroupManager.OpenedItemList(ItemIndex, true); } else { MysetManager.OpenedItemList(ItemIndex, true); } return(false); }
/// <summary> /// ウィンドウプロシージャ /// </summary> /// <param name="m">Windowsメッセージ</param> protected override void WndProc(ref Message m) { base.WndProc(ref m); switch (m.Msg) { case WinAPI.WM_COPYDATA: // DLLからデータを受信 // 受信したデータを元の型にキャストして、追加する WinAPI.COPYDATASTRUCT_LONG_ARRAY cds = (WinAPI.COPYDATASTRUCT_LONG_ARRAY)Marshal.PtrToStructure(m.LParam, typeof(WinAPI.COPYDATASTRUCT_LONG_ARRAY)); StringBuilder stringBuilder = new StringBuilder(255); long[] dest = new long[255]; for (int i = 0, j = 0; i < cds.lpData.Length; ++i) { if (cds.lpData[i] == 0) { continue; } if (dest.Contains(cds.lpData[i])) { continue; } if (WinAPI.GetWindowText((IntPtr)cds.lpData[i], stringBuilder, stringBuilder.Capacity) == 0) { continue; } dest[j++] = cds.lpData[i]; } GroupManager.AddItems(ref dest); break; case WinAPI.WM_HOTKEY: ShortcutProc.RunAction((int)m.WParam); break; default: break; } }
protected override int GetItemCount() { int cnt = 0; if (ParentGHForm == 0) { if (GroupManager.CheckRange(ItemIndex)) { cnt = GroupManager.Items[ItemIndex].Items.Count; } } else { if (MysetManager.CheckRange(ItemIndex)) { cnt = MysetManager.Items[ItemIndex].Items.Count; } } return(cnt); }
/// <summary> /// グループの番号を設定し表示 /// </summary> /// <param name="n">グループ番号</param> public void SetGroup(int n) { if (0 <= n && n < GroupManager.Items.Count) { if (ParentGHForm == 1 && GHManager.MysetList.FormVisible) { GHManager.MysetList.MysetList_Hide(); uint pos = GHManager.Settings.Launcher.Pos; if (pos == 0) { Left = GHManager.ScreenSize.Left; } else if (pos == 1) { Top = GHManager.ScreenSize.Top; } else if (pos == 2) { Left = GHManager.ScreenSize.Right - GHManager.Launcher.Width; } else if (pos == 3) { Top = GHManager.ScreenSize.Bottom - GHManager.Launcher.Height; } } if (!Visible) { Visible = true; } ParentGHForm = 0; FixedActive = true; ItemIndex = n; ControlsClear(); GroupManager.Items[ItemIndex].AddItems(); SelectIndex = -1; NoSelectItem(); GHFormUpdate(); GroupManager.OpenedItemList(ItemIndex, true); } }
protected override void DrawPriorUpdate() { if (KeyboardActive) { if (ParentGHForm == 0) { if (GroupManager.CheckRange(ParentSelectIndex)) { if (GroupManager.Items[ParentSelectIndex].CheckRange(SelectIndex)) { if (!GroupManager.Items[ParentSelectIndex].Items[SelectIndex].icon.IsEntered) { GroupManager.Items[ParentSelectIndex].Items[SelectIndex].icon.control.Focus(); } } } } else { if (MysetManager.CheckRange(ParentSelectIndex)) { if (MysetManager.Items[ParentSelectIndex].CheckRange(SelectIndex)) { if (!MysetManager.Items[ParentSelectIndex].Items[SelectIndex].icon.IsEntered) { MysetManager.Items[ParentSelectIndex].Items[SelectIndex].icon.control.Focus(); } } } } } else { if (SelectIndex == -1) { NoSelectItem(); } } }
protected override void Update_Bounds() { int cnt = 0; Rectangle rect = new Rectangle(0, 0, 0, 0); int left = 0; int top = 0; if (ParentGHForm == 0) { if (!GroupManager.CheckRange(ItemIndex)) { return; } GroupManager.Items[ItemIndex].icon.GetRect(out rect); cnt = GroupManager.Items[ItemIndex].Items.Count; left = GHManager.Launcher.Left; top = GHManager.Launcher.Top; } else { if (!MysetManager.CheckRange(ItemIndex)) { return; } MysetManager.Items[ItemIndex].icon.GetRect(out rect); cnt = MysetManager.Items[ItemIndex].Items.Count; left = GHManager.MysetList.Left; top = GHManager.MysetList.Top; } CalcBounds(out Rectangle bounds, cnt, rect, left, top); Bounds = bounds; }
/// <summary> /// 初期化 /// </summary> public static int Initialize() { try { UpdateScrSize(); GroupManager.Initialize(); MysetManager.Initialize(); //TextIdentifier = "-" + Application.ProductName + "-" + Application.ProductVersion; Launcher = new LauncherForm(); ItemList = new ItemListForm(); MysetList = new MysetListForm(); ItemList.Hide(); MysetList.Hide(); IntPtr h = Launcher.Handle; h = ItemList.Handle; h = MysetList.Handle; ShortcutProc.Initialize(); LoadSetting(); Skin.LoadSkinImages(); MysetManager.LoadMyset(); return(0); } catch { Console.WriteLine("Error: Initializing."); return(-1); } }
protected override void Update_Visible() { ParentSelectIndex = ParentGHForm == 0 ? GHManager.Launcher.SelectIndex - 1 : GHManager.MysetList.SelectIndex; MouseActive = ParentSelectIndex >= 0 ? true : GHManager.Contains.ItemList; //KeyboardActive = ParentSelectIndex != -1; int idx = 0; if (ParentGHForm == 0) { if (GroupManager.CheckRange(ItemIndex)) { if ((idx = GroupManager.Items[ItemIndex].GetActiveIndex()) != -1) { SelectIndex = idx; } else { SelectIndex = -1; } } } else { if (MysetManager.CheckRange(ItemIndex)) { if ((idx = MysetManager.Items[ItemIndex].GetActiveIndex()) != -1) { SelectIndex = idx; } else { SelectIndex = -1; } } } }
/// グループアイコンに一定時間乗せた時のイベント /// </summary> private void Group_Control_Timer(object sender, EventArgs e) { timer.Stop(); GroupManager.ShowItemList(this); }
/// <summary> /// メニューの グループ削除 をクリックした時のイベント /// </summary> private void MenuItem_DelGroup_Click(object sender, EventArgs e) { GroupManager.DeleteGroup(this); }
private void MenuItem_MovePrev_Click(object sender, EventArgs e) { GroupManager.GroupMove(this, false); }
private void MenuItem_MoveNext_Click(object sender, EventArgs e) { GroupManager.GroupMove(this, true); }
private static void DeleteSelectItem() { FormType n = GHManager.GetActiveForm(); if (n == FormType.Launcher) { if (GHManager.Launcher.FormVisible) { int idx = GHManager.Launcher.SelectIndex - 1; if (0 <= idx && idx < GroupManager.Items.Count) { GroupManager.DeleteGroup(GroupManager.Items[idx]); } } } else if (n == FormType.ItemList) { if (GHManager.ItemList.FormVisible) { int select = 0; if (GHManager.ItemList.ParentGHForm == 0) { select = GHManager.Launcher.SelectIndex - 1; if (GroupManager.CheckRange(select)) { GroupManager.Items[select].DeleteItem(GHManager.ItemList.SelectIndex); if (GroupManager.Items[select].Items.Count <= 0) { GHManager.ItemList.HideItemList(); } } } else { select = GHManager.MysetList.SelectIndex; if (MysetManager.CheckRange(select)) { if (MysetManager.Items[select].DeleteItem(GHManager.ItemList.SelectIndex)) { GHManager.ItemList.HideItemList(); if (MysetManager.Items.Count <= 0) { GHManager.MysetList.MysetList_Hide(); } } } } } } else if (n == FormType.MysetList) { if (GHManager.MysetList.FormVisible) { int idx = GHManager.MysetList.SelectIndex; if (MysetManager.CheckRange(idx)) { MysetManager.DeleteMyset(MysetManager.Items[idx]); if (MysetManager.Items.Count <= 0) { GHManager.MysetList.MysetList_Hide(); } } } } }
private static void OpenSelectItem() { if (GHManager.Launcher.FormVisible) { FormType n = GHManager.GetActiveForm(); if (n == FormType.Launcher) { // ランチャー if (GHManager.Launcher.MysetIcon.control.Focused) { if (GHManager.MysetList.FormVisible) { GHManager.MysetList.FixedActive = false; GHManager.MysetList.MysetList_Hide(); } else { if (MysetManager.Items.Count > 0) { GHManager.MysetList.FixedActive = true; GHManager.MysetList.MysetList_Show(); } } } else if (GroupManager.CheckRange(GHManager.Launcher.SelectIndex - 1)) { GroupManager.Items[GHManager.Launcher.SelectIndex - 1].SwitchShowOrHide(); } } else if (n == FormType.ItemList) { // アイテムリスト int num; int select = GHManager.ItemList.SelectIndex; if (GHManager.ItemList.ParentGHForm == 0) { num = GHManager.Launcher.SelectIndex - 1; if (GroupManager.CheckRange(num)) { if (GroupManager.Items[num].CheckRange(select)) { GHProcess.SwitchShowOrHide((IntPtr)GroupManager.Items[num].Items[select].Handle); } } } else { num = GHManager.MysetList.SelectIndex; if (MysetManager.CheckRange(num)) { if (MysetManager.Items[num].CheckRange(select)) { MysetManager.Items[num].Items[select].Execute(); } } } } else if (n == FormType.MysetList) { // マイセット int num = GHManager.MysetList.SelectIndex; if (MysetManager.CheckRange(num)) { MysetManager.Items[num].ExecuteItems(); } } } }