Exemplo n.º 1
0
        private void MouseWheelEvent(object sender, MouseEventArgs e)
        {
            var currentScroll = this.simpleMeaningsPanel.AutoScrollPosition;

            if (e.Delta < 0 && prevScroll == currentScroll.Y && currentDisplayCount < 100)
            {
                currentDisplayCount += 5;
                addMeanings(DictParser.getInfoFromNaverAPI(selectedText, currentDisplayCount));
            }
            prevScroll = currentScroll.Y;
            Console.WriteLine(currentScroll.Y);
        }
Exemplo n.º 2
0
        public TranslateForm()
        {
            InitializeComponent();

            //this.AutoSize = true;
            this.StartPosition   = FormStartPosition.Manual;
            this.ShowInTaskbar   = false;
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;

            selectedText = Hook.getSelection();
            Console.WriteLine("select " + selectedText);
            translatedText = DictParser.getTranslateFromNaverAPI(selectedText);

            translatedTB.ReadOnly    = true;
            translatedTB.BorderStyle = 0;
            translatedTB.BackColor   = this.BackColor;
            translatedTB.TabStop     = false;

            Action handler = null;

            handler = () =>
            {
                MultiKeyGesture.keyUpEvent -= handler;
                this.Close();
            };

            MultiKeyGesture.keyUpEvent += handler;

            if (MultiKeyGesture.bMatched == false)
            {
                MultiKeyGesture.keyUpEvent -= handler;
                return;
            }

            this.Show();
            Application.Run();
        }
Exemplo n.º 3
0
 private void initDisplay(int currentDisplayCount)
 {
     selectedText = Hook.getSelection();
     Console.WriteLine("SEARCH : " + selectedText);
     addMeanings(DictParser.getInfoFromNaverAPI(selectedText, currentDisplayCount));
 }