Пример #1
0
 private void MainForm_Load(object sender, EventArgs e)
 {
     XenotypeBrahmi xBrahmi = new XenotypeBrahmi();
     BrahmiBox.LanguageOption = RichTextBoxLanguageOptions.UIFonts;
     BrahmiBox.Font = new Font("Pali Brahmi", 16, System.Drawing.FontStyle.Regular);
     BrahmiBox.Text = "Aī";
     string uni = "devānaṁpiye piyadasi lājā hevaṁ āhā ye atikaṁtaṁ \naṁtalaṁ lājāne husa hevaṁ ichisu kathaṁ jane \ndhaṁmavaḍhiyā vāḍheya nocujane anulupāyā dhaṁmavaḍhiyā";
     string converted = xBrahmi.ConvertToBrahmi(uni);
     converted = converted.Replace(" ", "  ");
     BrahmiBox.Text += " " + converted;
     InputBox.Text = uni;
     //this.BrahmiBox.Text = s;
     //this.InputBox.Text = c.ToString();
 }
Пример #2
0
 private void InputBox_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
 {
     textPuffer += e.KeyChar.ToString();
     if (e.KeyChar.ToString() == " ")
     {
         string[] words = textPuffer.Split(' ');
         string lastword = words[words.Length - 2];
         XenotypeBrahmi xBrahmi = new XenotypeBrahmi();
         string converted = xBrahmi.ConvertToBrahmi(lastword);
         converted = converted.Replace(" ", "  ");
         BrahmiBox.Text += " " + converted;
         BrahmiBox.SelectAll();
         BrahmiBox.SelectionFont = new System.Drawing.Font("Pali Brahmi", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     }
     //ImperialBrahmi IBrahmi = new ImperialBrahmi();
     //BrahmiBox.Text = IBrahmi.Replace(textPuffer);
 }
Пример #3
0
 private void InputBox_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e)
 {
     if ((e.Shift && e.KeyCode == Keys.Insert) || (e.Control && e.KeyCode == Keys.V))
     {
         //ImperialBrahmi IBrahmi = new ImperialBrahmi();
         BrahmiBox.LanguageOption = RichTextBoxLanguageOptions.UIFonts;
         XenotypeBrahmi xBrahmi = new XenotypeBrahmi();
         string converted = xBrahmi.ConvertToBrahmi(InputBox.Text);
         converted = converted.Replace(" ", "  ");
         BrahmiBox.Text += " " + converted;
         //BrahmiBox.Text += IBrahmi.Replace(InputBox.Text);
     }
 }
Пример #4
0
        private void InputBox_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
        {
            /*if( ( e.KeyCode == Keys.M ) && ( e.Modifiers == Keys.Alt ) )
            {
                InputBox.Text += "ṃ";
                string cmd = "{RIGHT " + InputBox.Text.Length.ToString() + "}";
                SendKeys.Send(cmd);
            }
            else if( ( e.KeyCode == Keys.A ) && ( e.Modifiers == Keys.Alt ) )
            {
                InputBox.Text += "ā";
                string cmd = "{RIGHT " + InputBox.Text.Length.ToString() + "}";
                SendKeys.Send(cmd);
            }
            else if( ( e.KeyCode == Keys.I ) && ( e.Modifiers == Keys.Alt ) )
            {
                InputBox.Text += "ī";
                string cmd = "{RIGHT " + InputBox.Text.Length.ToString() + "}";
                SendKeys.Send(cmd);
            }
            else if( ( e.KeyCode == Keys.U ) && ( e.Modifiers == Keys.Alt ) )
            {
                InputBox.Text += "ū";
                string cmd = "{RIGHT " + InputBox.Text.Length.ToString() + "}";
                SendKeys.Send(cmd);
            }
            else if( ( e.KeyCode == Keys.D ) && ( e.Modifiers == Keys.Alt ) )
            {
                InputBox.Text += "ḍ";
                string cmd = "{RIGHT " + InputBox.Text.Length.ToString() + "}";
                SendKeys.Send(cmd);
            }
            else if( ( e.KeyCode == Keys.T ) && ( e.Modifiers == Keys.Alt ) )
            {
                InputBox.Text += "ṭ";
                string cmd = "{RIGHT " + InputBox.Text.Length.ToString() + "}";
                SendKeys.Send(cmd);
            }
            else if( ( e.KeyCode == Keys.L ) && ( e.Modifiers == Keys.Alt ) )
            {
                InputBox.Text += "ḷ";
                string cmd = "{RIGHT " + InputBox.Text.Length.ToString() + "}";
                SendKeys.Send(cmd);
            }
            else if( ( e.KeyCode == Keys.G ) && ( e.Modifiers == Keys.Alt ) )
            {
                InputBox.Text += "ṅ";
                string cmd = "{RIGHT " + InputBox.Text.Length.ToString() + "}";
                SendKeys.Send(cmd);
            }
            else if( ( e.KeyCode == Keys.N ) && ( e.Modifiers == Keys.Alt ) )
            {
                InputBox.Text += "ṇ";
                string cmd = "{RIGHT " + InputBox.Text.Length.ToString() + "}";
                SendKeys.Send(cmd);
            }
            else if( ( e.KeyCode == Keys.J ) && ( e.Modifiers == Keys.Alt ) )
            {
                InputBox.Text += "ñ";
                string cmd = "{RIGHT " + InputBox.Text.Length.ToString() + "}";
                SendKeys.Send(cmd);
            }*/
            if ((e.Shift && e.KeyCode == Keys.Insert) || (e.Control && e.KeyCode == Keys.V))
            {
            //		BrahmiBox.Text += this.replace(InputBox.Text);
            }
            if(e.KeyValue == 8)
            {
                string newBrahmi = "";
                BrahmiBox.LanguageOption = RichTextBoxLanguageOptions.UIFonts;
                //ImperialBrahmi IBrahmi = new ImperialBrahmi();
                XenotypeBrahmi xBrahmi = new XenotypeBrahmi();
                //BrahmiBox.Text += IBrahmi.Replace(InputBox.Text);
                BrahmiBox.Text += xBrahmi.ConvertToBrahmi(InputBox.Text);

                if(InputBox.Text.Length > 0)
                    newBrahmi = InputBox.Text.Substring(0,InputBox.Text.Length-1);
                BrahmiBox.Text = "";
                textPuffer = "";
                textPuffer = xBrahmi.ConvertToBrahmi(newBrahmi);
                BrahmiBox.Text = xBrahmi.ConvertToBrahmi(newBrahmi);
            }
        }