예제 #1
0
파일: GridUI.cs 프로젝트: D3L7A01/tabler
        private void OpenTabSelector()
        {
            if (!_stringtablesLoaded)
            {
                return;
            }

            var tabSelector     = new TabSelector(this);
            var tabSelectorSize = tabSelector.Size;

            if (ClientRectangle.Width <= tabSelectorSize.Width)
            {
                tabSelectorSize.Width = ClientRectangle.Width - 40;
            }

            tabSelector.Size          = tabSelectorSize;
            tabSelector.StartPosition = FormStartPosition.Manual;

            var newX = Left + (ClientRectangle.Width - tabSelectorSize.Width) / 2;
            var newY = (int)Math.Floor(Location.Y + ClientRectangle.Height * 0.3);

            // +5 because of padding
            tabSelector.Location = new Point(newX + 5, newY);

            OverlayForm.ShowOverlay(this, tabSelector);
            tabSelector.Show(this);
        }
예제 #2
0
        public override void Execute(ExecutionContext context)
        {
            int rows = Math.Max((int)GetParamAsInt(1), 1);

            m_NumberColumns = Math.Max((int)GetParamAsInt(0), 1);
            Point     current = Cursor.Position;
            Rectangle screen  = Screen.FromPoint(current).Bounds;
            int       width   = screen.Width / m_NumberColumns;
            int       height  = screen.Height / rows;

            m_Rows  = new Rectangle[rows];
            m_Areas = new Rectangle[rows * m_NumberColumns];
            for (int y = 0; y < rows; y++)
            {
                m_Rows[y] = new Rectangle(screen.X, screen.Y + y * height, screen.Width, height);
                for (int x = 0; x < m_NumberColumns; x++)
                {
                    int index = y * m_NumberColumns + x;
                    m_Areas[index] = new Rectangle(screen.X + x * width, m_Rows[y].Top, width, height);
                }
            }
            m_ScanInRow    = false;
            m_CurrentIndex = 0;

            m_View = context.View;
            m_View.StartContinuous(this);
            m_Overlay = new OverlayForm(this);
            m_Overlay.Display(screen);
            Cursor.Position = CurrentRect.Centre();
        }
예제 #3
0
 public void Stop()
 {
     m_View = null;
     m_Overlay?.Dispose();
     m_Overlay = null;
     m_Rows    = null;
     m_Areas   = null;
 }
예제 #4
0
 private void button2_Click(object sender, EventArgs e)
 {
     if (overlay != null)
     {
         overlay.Close();
         overlay = null;
     }
 }
예제 #5
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (overlay == null)
     {
         overlay = new OverlayForm(button2.Handle);     // <-- pass in an hWnd to some external window
         overlay.Show();
     }
 }
예제 #6
0
        private OverlayForm ShowOverlay()
        {
            OverlayForm overlay = new OverlayForm();

            overlay.Show(this);
            overlay.Location = new Point(this.Location.X + 8, this.Location.Y + 30);
            return(overlay);
        }
예제 #7
0
        public static IntPtr HookProc(int code, IntPtr WParam, IntPtr lParam)
        {
            var VKCode      = Marshal.ReadInt32(lParam);
            var OverlayForm = new OverlayForm();

            //Toggles
            if (WParam == (IntPtr)WMKeydown && VKCode == VKRarrow)
            {
            }

            //Save/Load config
            if (WParam == (IntPtr)WMKeydown && VKCode == VkF1)
            {
                //INI.INI.Ini.SaveConfig();
            }

            if (WParam == (IntPtr)WMKeydown && VKCode == VkF5)
            {
                //INI.INI.Ini.LoadConfig();
            }

            //ForceUpdate
            if (WParam == (IntPtr)WMKeydown && VKCode == VkF4)
            {
                MainClass.Memory.WriteInt(LocalPlayer.ClientState + 0x174, -1);
                Console.WriteLine("ForceUpdated!");
            }

            //Bunny
            if (WParam == (IntPtr)WMKeydown && VKCode == 0x20 && Settings.Bhop.Enabled)
            {
                Settings.Bhop.Key = true; //True
            }
            else if (WParam == (IntPtr)WMKeyup && VKCode == 0x20)
            {
                Settings.Bhop.Key = false; //False
            }

            //TriggerKey
            if (WParam == (IntPtr)VkLmenu && Settings.Trigger.Enabled)
            {
                Settings.Trigger.Key = true; //True
            }
            else if (WParam == (IntPtr)WMKeyup && VKCode == 0xA4)
            {
                Settings.Trigger.Key = false; //False
            }

            //Panic
            if (WParam == (IntPtr)WMKeydown && VKCode == VkF12)
            {
                Environment.Exit(0);
            }

            return(CallNextHookEx(Hhook, code, (int)WParam, lParam));
        }
 protected SharedFormsSingleton()
 {
     //Setting up the forms that need to always be available to the program
     overlayForm  = new OverlayForm();
     ToastOverlay = new Toast();
     overlayForm.RegisterOverlay(ToastOverlay);
     zoomForm = new ZoomForm();
     overlayForm.Show();
     fixationDot = new FixationDot();
 }
예제 #9
0
        public void Render(string text)
        {
            Bitmap bg = Background.Clone() as Bitmap;

            using (Graphics g = Graphics.FromImage(bg))
            {
                g.DrawString(text, RenderFont, Brushes.Black, RenderRect, SF);
            }
            OverlayForm.SetBitmap(bg, this);
            bg = null;
        }
예제 #10
0
        /* Show settings form */

        private void pbSettings_Click(object sender, EventArgs e)
        {
            OverlayForm  overlay = ShowOverlay();
            SettingsForm frm     = new SettingsForm(activeListType);

            frm.ShowDialog(this);
            frm.Dispose();
            fpListItemPanel.Focus();

            WireUpLibraryForm();
            overlay.Dispose();
        }
        public void ShowHighLightItem(string itemGuid, string itemParentGuid, Action <IBasicData, bool> restoration = null, IBasicData restorationData = null, bool v = false, bool firstTime = true)
        {
            WinAPI.SetFocus(ControlUI.corelHandle);
            WinAPI.SetForegroundWindow(ControlUI.corelHandle);

            Corel.Interop.VGCore.cdrWindowState state = corelApp.AppWindow.WindowState;


            if (state == Corel.Interop.VGCore.cdrWindowState.cdrWindowMaximized || state == Corel.Interop.VGCore.cdrWindowState.cdrWindowMinimized)
            {
                corelApp.AppWindow.WindowState = Corel.Interop.VGCore.cdrWindowState.cdrWindowMaximized;
            }
            if (state == Corel.Interop.VGCore.cdrWindowState.cdrWindowRestore)
            {
                corelApp.AppWindow.WindowState = Corel.Interop.VGCore.cdrWindowState.cdrWindowRestore;
            }
            if (state == Corel.Interop.VGCore.cdrWindowState.cdrWindowNormal)
            {
                corelApp.AppWindow.WindowState = Corel.Interop.VGCore.cdrWindowState.cdrWindowNormal;
            }
            //corelApp.AppWindow.Activate();

            System.Windows.Rect rect = this.GetItemRect(itemParentGuid, itemGuid);

            if (rect.IsZero())
            {
                //if (firstTime)
                //    ShowHighLightItem(itemGuid, itemParentGuid, restoration, restorationData, v, false);
                //else
                //{
                //core.DispactchNewMessage("Don't can find the control, maybe is does not visible", MsgType.Console);
                return;
                //}
            }

            core.DispactchNewMessage(DateTime.Now.ToLongTimeString(), MsgType.Console);

            core.SetUIVisible = false;
            //tagWindow.Visibility = win.Visibility.Collapsed;

            if (corelApp.AppWindow.WindowState == Corel.Interop.VGCore.cdrWindowState.cdrWindowMaximized)
            {
                form = new OverlayForm(rect);
            }
            else
            {
                System.Windows.Rect rect2 = new System.Windows.Rect(corelApp.AppWindow.Left, corelApp.AppWindow.Top, corelApp.AppWindow.Width, corelApp.AppWindow.Height);
                form = new OverlayForm(rect, rect2);
            }
            //Thread.Sleep(1000);
            CallForm();
        }
예제 #12
0
        private void 叠置分析ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OverlayForm overlayForm = new OverlayForm();

            if (overlayForm.ShowDialog() == DialogResult.OK)
            {
                //获取输出文件路径
                string strBufferPath = overlayForm.strOutputPath;
                //缓冲区图层载入到MapControl
                int index = strBufferPath.LastIndexOf("\\");
                this.axMapControl3.AddShapeFile(strBufferPath.Substring(0, index), strBufferPath.Substring(index));
            }
        }
예제 #13
0
        private void selectWindowFromScreen()
        {
            if (notify)
            {
                NotifyIcon.BalloonTipText = "Select a window from screen to pin it on top. Press 'Esc' to exit.";
                NotifyIcon.ShowBalloonTip(1);
                notify = false;
            }
            var overlay = new OverlayForm();

            overlay.TopMost = true;
            if (overlay.ShowDialog() == DialogResult.OK)
            {
                WinApi.SetWindowTopmost(overlay.SelectionHandle, true);
            }
        }
예제 #14
0
        private void ShowItemDetailForm(string activeListType, ItemModel item, int index, LibraryUI libraryUI)
        {
            OverlayForm    overlay = ShowOverlay();
            ItemDetailForm frm;

            if (item == null)
            {
                frm = new ItemDetailForm(activeListType, libraryUI);
            }
            else
            {
                frm = new ItemDetailForm(activeListType, item, index, libraryUI);
            }
            frm.ShowDialog(this);
            frm.Dispose();
            fpListItemPanel.Focus();
            overlay.Dispose();
        }
예제 #15
0
 /// <summary>
 ///     Show the overlay
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void launchToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (File.Exists(CurrentFile) && Path.GetExtension(CurrentFile) == ".dem" && CurrentFile != null)
     {
         using (var a = new OverlayForm(CurrentFile))
         {
             var str = richTextBox1.Text;
             richTextBox1.Text = @"Overlay launched please switch to your game!";
             a.ShowDialog();
             richTextBox1.Text = str;
         }
     }
     else
     {
         MessageBox.Show(@"No file selected please select one to use the overlay!",
                         @"Couldn't open overlay!",
                         MessageBoxButtons.OK,
                         MessageBoxIcon.Information);
     }
 }
예제 #16
0
        protected virtual void InitializeOverlay()
        {
            try
            {
                // FIXME: is this *really* correct way to get version of current assembly?
                Overlay = new OverlayForm(System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(), Name, "about:blank", Config.MaxFrameRate);

                // グローバルホットキーを設定
                if (Config.GlobalHotkeyEnabled)
                {
                    var modifierKeys = GetModifierKey(Config.GlobalHotkeyModifiers);
                    var key          = Config.GlobalHotkey;
                    var hotkeyType   = Config.GlobalHotkeyType;
                    if (key != Keys.None)
                    {
                        switch (hotkeyType)
                        {
                        case GlobalHotkeyType.ToggleVisible:
                            hook.KeyPressed += (o, e) => Config.IsVisible = !Config.IsVisible;
                            break;

                        case GlobalHotkeyType.ToggleClickthru:
                            hook.KeyPressed += (o, e) => Config.IsClickThru = !Config.IsClickThru;
                            break;

                        case GlobalHotkeyType.ToggleLock:
                            hook.KeyPressed += (o, e) => Config.IsLocked = !Config.IsLocked;
                            break;

                        default:
                            hook.KeyPressed += (o, e) => Config.IsVisible = !Config.IsVisible;
                            break;
                        }

                        hook.RegisterHotKey(modifierKeys, key);
                    }
                }

                // 画面外にウィンドウがある場合は、初期表示位置をシステムに設定させる
                if (!Util.IsOnScreen(Overlay))
                {
                    Overlay.StartPosition = FormStartPosition.WindowsDefaultLocation;
                }
                else
                {
                    Overlay.Location = Config.Position;
                }

                Overlay.Text        = Name;
                Overlay.Size        = Config.Size;
                Overlay.IsClickThru = Config.IsClickThru;

                // イベントハンドラを設定
                Overlay.Browser.LoadError += (o, e) =>
                {
                    Log(LogLevel.Error, "BrowserError: {0}, {1}, {2}", e.ErrorCode, e.ErrorText, e.FailedUrl);
                };
                Overlay.Browser.FrameLoadEnd += (o, e) =>
                {
                    Log(LogLevel.Debug, "BrowserLoad: {0}: {1}", e.HttpStatusCode, e.Url);
                    NotifyOverlayState();
                };
                Overlay.Browser.ConsoleMessage += (o, e) =>
                {
                    Log(LogLevel.Info, "BrowserConsole: {0} (Source: {1}, Line: {2})", e.Message, e.Source, e.Line);
                };
                Config.UrlChanged += (o, e) =>
                {
                    Navigate(e.NewUrl);
                };

                if (CheckUrl(Config.Url))
                {
                    Navigate(Config.Url);
                }
                else
                {
                    Navigate("about:blank");
                }

                Overlay.Show();
                Overlay.Visible = Config.IsVisible;
                Overlay.Locked  = Config.IsLocked;
            }
            catch (Exception ex)
            {
                Log(LogLevel.Error, "InitializeOverlay: {0}", Name, ex);
            }
        }
        private void LoadHighLightForm(IBasicData itemData, IBasicData parentItemData, IBasicData specialData, win.DependencyObject dependencyObject)
        {
            WinAPI.SetFocus(ControlUI.corelHandle);
            WinAPI.SetForegroundWindow(ControlUI.corelHandle);

            Corel.Interop.VGCore.cdrWindowState state = corelApp.AppWindow.WindowState;

            corelApp.AppWindow.Activate();
            if (state == Corel.Interop.VGCore.cdrWindowState.cdrWindowMaximized || state == Corel.Interop.VGCore.cdrWindowState.cdrWindowMinimized)
            {
                corelApp.AppWindow.WindowState = Corel.Interop.VGCore.cdrWindowState.cdrWindowMaximized;
            }
            if (state == Corel.Interop.VGCore.cdrWindowState.cdrWindowRestore)
            {
                corelApp.AppWindow.WindowState = Corel.Interop.VGCore.cdrWindowState.cdrWindowRestore;
            }
            if (state == Corel.Interop.VGCore.cdrWindowState.cdrWindowNormal)
            {
                corelApp.AppWindow.WindowState = Corel.Interop.VGCore.cdrWindowState.cdrWindowNormal;
            }

            System.Windows.Rect rect = this.GetItemRect(parentItemData.Guid, itemData.Guid);


            if (rect.IsZero())
            {
                return;
            }
            Views.XMLTagWindow w = Core.FindParentControl <Views.XMLTagWindow>(dependencyObject) as Views.XMLTagWindow;
            w.Visibility = win.Visibility.Collapsed;
            OverlayForm form;

            if (corelApp.AppWindow.WindowState == Corel.Interop.VGCore.cdrWindowState.cdrWindowMaximized)
            {
                form = new OverlayForm(rect);
            }
            else
            {
                System.Windows.Rect rect2 = new System.Windows.Rect(corelApp.AppWindow.Left, corelApp.AppWindow.Top, corelApp.AppWindow.Width, corelApp.AppWindow.Height);
                form = new OverlayForm(rect, rect2);
            }

            form.Show();
            form.FormClosed += (s, e) =>
            {
                w.Visibility = win.Visibility.Visible;
                if (specialData != null)
                {
                    if (specialData.GetType() == typeof(CommandBarData))
                    {
                    }
                    if (specialData.GetType() == typeof(DockerData))
                    {
                        corelApp.FrameWork.HideDocker(specialData.Guid);
                    }
                    if (specialData.GetType() == typeof(DialogData))
                    {
#if !X7
                        corelApp.FrameWork.HideDialog(specialData.Guid);
#endif
                    }
                }
            };
        }
예제 #18
0
 public OverlayPluginApi(OverlayForm o)
 {
     Form = o;
 }
예제 #19
0
        private void menuOverlay_Click(object sender, EventArgs e)
        {
            OverlayForm over = new OverlayForm(this.axMapControl1);

            over.Show();
        }
예제 #20
0
        private void toolStripButton2_Click(object sender, System.EventArgs e)
        {
            OverlayForm over = new OverlayForm(this.axMapControl1);

            over.Show();
        }