Esempio n. 1
0
        //This is how to get a Base on the Stack Panel
        private void Stack_Panel_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            //Get the information of where the click happened
            Point p = e.GetPosition(this.Stack_Panel);
            int   x = (int)p.X;
            int   y = (int)p.Y;
            //MessageBox.Show("X: "+x+" Y:"+y);
            Base b;

            newBaseType = '\0';
            if (m != null)
            {
                b = m.SearchForBase(x, y);
                //MessageBox.Show("ID: " + b.GetID() + " Type: " + b.GetBaseType());
                BaseWindow bw = new BaseWindow(this, b);
                bw.ShowDialog();
                bw.Close();
                if (!newBaseType.Equals('\0'))
                {
                    StringBuilder str = new StringBuilder(rnaString);
                    str[b.GetID() - 1] = newBaseType;
                    rnaString          = str.ToString();
                    m.ChangeBaseType(b.GetID() - 1, newBaseType);
                }
                //Create a new window BaseWindow(this, b) to display the following information
                //ID and type of base
                //Allow the user to change the type of base
            }
        }
Esempio n. 2
0
        //This is how to get a Base on the Stack Panel
        private void Stack_Panel_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            //Get the information of where the click happened
            System.Windows.Point p = e.GetPosition(this.Stack_Panel);
            int x = (int)p.X;
            int y = (int)p.Y;
            //MessageBox.Show("X: "+x+" Y:"+y);
            Base b;

            newBaseType = '\0';
            if (m != null)
            {
                b = m.SearchForBase(x - (RADIUS / 2), y - (RADIUS / 2), x, y);
                //MessageBox.Show("ID: " + b.GetID() + " Type: " + b.GetBaseType());
                if (b != null)
                {
                    BaseWindow bw = new BaseWindow(this, b);
                    bw.ShowDialog();
                    bw.Close();
                    if (!newBaseType.Equals('\0'))
                    {
                        StringBuilder str = new StringBuilder(rnaString);
                        str[b.GetID() - 1] = newBaseType;
                        rnaString          = str.ToString();
                        m.ChangeBaseType(rnaString);
                    }
                }
            }
        }