Beispiel #1
0
        protected override void Update_ItemPos()
        {
            Rectangle rect = new Rectangle(0, 0, 0, 0);

            if (ParentGHForm == 0)
            {
                if (!GroupManager.CheckRange(ItemIndex))
                {
                    return;
                }
                rect = new Rectangle(GHManager.Settings.Style.ItemList.WindowPadding.Left, GHManager.Settings.Style.ItemList.WindowPadding.Top, GHManager.Settings.Style.ItemList.ItemSize, GHManager.Settings.Style.ItemList.ItemSize);

                GroupManager.Items[ItemIndex].SetRectItems(ref rect);
            }
            else
            {
                if (!MysetManager.CheckRange(ItemIndex))
                {
                    return;
                }
                rect = new Rectangle(GHManager.Settings.Style.ItemList.WindowPadding.Left, GHManager.Settings.Style.ItemList.WindowPadding.Top, GHManager.Settings.Style.ItemList.ItemSize, GHManager.Settings.Style.ItemList.ItemSize);

                MysetManager.Items[ItemIndex].SetRectItems(ref rect);
            }
        }
Beispiel #2
0
        protected override void DrawForm(ref Graphics graph)
        {
            base.DrawForm(ref graph);

            Skin.DrawingSkinImageRepeat(ref graph, SkinImage.Launcher_Background, new Rectangle(0, 0, Size.Width, Size.Height));

            MysetManager.Draw(ref graph);
        }
Beispiel #3
0
 /// <summary>
 /// ランチャーが終了する時のイベント (後処理)
 /// </summary>
 private void Launcher_FormClosing(object sender, FormClosingEventArgs e)
 {
     // フックを解除
     Dll.EndHook();
     MysetManager.SaveMyset();
     GHManager.SaveSetting();
     GHManager.UnregistHotKey(Handle);
 }
Beispiel #4
0
 /// <summary>
 /// マイセット内からアイテムを削除
 /// </summary>
 /// <param name="item">削除するアイテム</param>
 public void DeleteItem(MysetItem item)
 {
     item.icon.control.Dispose();
     Items.Remove(item);
     if (Items.Count <= 0)
     {
         MysetManager.DeleteMyset(this);
     }
 }
Beispiel #5
0
 protected override void DrawPriorUpdate()
 {
     if (KeyboardActive)
     {
         if (MysetManager.CheckRange(SelectIndex))
         {
             if (!MysetManager.Items[SelectIndex].icon.IsEntered)
             {
                 MysetManager.Items[SelectIndex].icon.control.Focus();
             }
         }
     }
 }
Beispiel #6
0
 public bool DeleteItem(int idx)
 {
     if (0 <= idx && idx < Items.Count)
     {
         Items[idx].icon.control.Dispose();
         Items.RemoveAt(idx);
         if (Items.Count <= 0)
         {
             MysetManager.DeleteMyset(this);
             return(true);
         }
     }
     return(false);
 }
Beispiel #7
0
 /// <summary>
 /// 他のアイテムを表示している場合はそのまま表示
 /// 表示していない場合はタイマー開始
 /// </summary>
 private void Myset_Control_Enter(object sender, EventArgs e)
 {
     if (GHManager.ItemList.ItemIndex != -1 && GHManager.ItemList.FormVisible)
     {
         if (MysetManager.SetMysetNum(this))
         {
             timer.Stop();
         }
     }
     else
     {
         timer.Start();
     }
 }
Beispiel #8
0
 private static void ShowForm()
 {
     if (GHManager.Launcher.FormVisible)
     {
         FormType n = GHManager.GetActiveForm();
         if (n == FormType.Launcher)
         {
             int idx = GHManager.Launcher.SelectIndex;
             if (GroupManager.CheckRange(idx - 1))
             {
                 GHManager.ItemList.KeyboardActive = true;
                 GroupManager.ShowItemList(GroupManager.Items[idx - 1]);
             }
             if (idx == 0)
             {
                 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 (n == FormType.MysetList)
         {
             int idx = GHManager.MysetList.SelectIndex;
             if (0 <= idx && idx < MysetManager.Items.Count)
             {
                 GHManager.MysetList.KeyboardActive = true;
                 MysetManager.SetMysetNum(MysetManager.Items[idx]);
             }
         }
         else
         {
         }
     }
     else
     {
         GHManager.Launcher.KeyboardActive = true;
     }
 }
Beispiel #9
0
 /// <summary>
 /// アイテムリストを非表示にする
 /// </summary>
 public void HideItemList()
 {
     if (FormVisible)
     {
         HideAnimation();
         FixedActive = false;
         HideTimer.Stop();
         if (ParentGHForm == 0)
         {
             GroupManager.OpenedItemList(ItemIndex, false);
         }
         else
         {
             MysetManager.OpenedItemList(ItemIndex, false);
         }
     }
 }
Beispiel #10
0
        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);
        }
Beispiel #11
0
        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);
        }
Beispiel #12
0
 /// <summary>
 /// マイセットの番号を設定し表示
 /// </summary>
 /// <param name="n">マイセット番号</param>
 public void SetMyset(int n)
 {
     if (0 <= n && n < MysetManager.Items.Count)
     {
         if (ParentGHForm == 0 && FixedActive)
         {
             uint pos   = GHManager.Settings.Launcher.Pos;
             Size myset = GHManager.MysetList.Size;
             if (pos == 0)
             {
                 Left = GHManager.ScreenSize.Left + GHManager.Launcher.Width + myset.Width;
             }
             else if (pos == 1)
             {
                 Top = GHManager.ScreenSize.Top + GHManager.Launcher.Height + myset.Height;
             }
             else if (pos == 2)
             {
                 Left = GHManager.ScreenSize.Right - GHManager.Launcher.Width - myset.Width;
             }
             else if (pos == 3)
             {
                 Top = GHManager.ScreenSize.Bottom - GHManager.Launcher.Height - myset.Height;
             }
         }
         if (!Visible)
         {
             Visible = true;
         }
         ParentGHForm = 1;
         FixedActive  = true;
         ItemIndex    = n;
         ControlsClear();
         MysetManager.Items[ItemIndex].AddItems();
         NoSelectItem();
         SelectIndex = -1;
         GHFormUpdate();
         MysetManager.OpenedItemList(ItemIndex, true);
     }
 }
Beispiel #13
0
 protected override void Update_Visible()
 {
     MouseActive = GHManager.Contains.MysetList || GHManager.Launcher.MysetIcon.IsEntered;
     if (MysetManager.Items.Count == 0)
     {
         MouseActive = false;
         FixedActive = false;
     }
     else
     {
         int cnt = MysetManager.GetActiveIndex();
         if (cnt != -1)
         {
             SelectIndex = cnt;
         }
         else
         {
             SelectIndex = -1;
             NoSelectItem();
         }
     }
 }
Beispiel #14
0
 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();
         }
     }
 }
Beispiel #15
0
        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;
        }
Beispiel #16
0
        /// <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);
            }
        }
Beispiel #17
0
        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;
                    }
                }
            }
        }
Beispiel #18
0
        protected override void Update_ItemPos()
        {
            Rectangle rect = new Rectangle(GHManager.Settings.Style.MysetList.WindowPadding.Left, GHManager.Settings.Style.MysetList.WindowPadding.Top, GHManager.Settings.Style.MysetList.ItemSize, GHManager.Settings.Style.MysetList.ItemSize);

            MysetManager.SetPosition(ref rect, GHManager.IsVertical);
        }
Beispiel #19
0
 /// <summary>
 /// 時間が経ったらアイテムを表示
 /// </summary>
 private void Myset_Control_Timer(object sender, EventArgs e)
 {
     timer.Stop();
     MysetManager.SetMysetNum(this);
 }
Beispiel #20
0
 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();
             }
         }
     }
 }
Beispiel #21
0
        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();
                        }
                    }
                }
            }
        }
Beispiel #22
0
 /// <summary>
 /// メニューの マイセットに登録 をクリックした時のイベント
 /// </summary>
 private void MenuItem_RegMyset_Click(object sender, EventArgs e)
 {
     MysetManager.AddMyset(this);
 }
Beispiel #23
0
 /// <summary>
 /// マイセット削除
 /// </summary>
 private void MenuItem_DelMyset_Click(object sender, EventArgs e)
 {
     MysetManager.DeleteMyset(this);
 }