Esempio n. 1
0
        public SettingsPage2(Form parent)
        {
            this.parent = parent;
            InitializeComponent();
            btnAutoAlarm = new ALSButton();
            alarm        = new ALSAlarm();
            goBack       = new ALSButton();

            int btnWidth = (Width - MainMenu.GAP * 8) / 7;

            btnAutoAlarm.Text = CVInterface.GetAutoAlarm() ? "Disable\nauto-alarm" : "Enable\nauto-alarm";
            btnAutoAlarm.Size = new Size(btnWidth, btnWidth);


            btnToggleDecay        = new ALSButton();
            btnToggleDecay.Text   = isDecay ? "Prevent\nDecay" : "Allow\nDecay";
            btnToggleDecay.Size   = new Size(btnWidth, btnWidth);
            btnToggleDecay.Click += btnDecay_Click;
            Controls.Add(btnToggleDecay);

            Controls.Add(btnAutoAlarm);
            Controls.Add(goBack);
            Controls.Add(alarm);

            goBack.Click += new System.EventHandler(this.GoBack_Click);
            goBack.Text   = "Go Back";

            Resize             += this.Resize_SettingsScreen;
            btnAutoAlarm.Click += this.btAutoAlarm_Click;
        }
Esempio n. 2
0
        public SettingsPage2(Form parent)
        {
            this.parent = parent;
            InitializeComponent();
            btnAutoAlarm = new ALSButton();
            alarm = new ALSAlarm();
            goBack = new ALSButton();

            int btnWidth = (Width - MainMenu.GAP * 8) / 7;

            btnAutoAlarm.Text = CVInterface.GetAutoAlarm() ? "Disable\nauto-alarm" : "Enable\nauto-alarm";
            btnAutoAlarm.Size = new Size(btnWidth, btnWidth);

            btnToggleDecay = new ALSButton();
            btnToggleDecay.Text = isDecay ? "Prevent\nDecay" : "Allow\nDecay";
            btnToggleDecay.Size = new Size(btnWidth, btnWidth);
            btnToggleDecay.Click += btnDecay_Click;
            Controls.Add(btnToggleDecay);

            Controls.Add(btnAutoAlarm);
            Controls.Add(goBack);
            Controls.Add(alarm);

            goBack.Click += new System.EventHandler(this.GoBack_Click);
            goBack.Text = "Go Back";

            Resize += this.Resize_SettingsScreen;
            btnAutoAlarm.Click += this.btAutoAlarm_Click;
        }
Esempio n. 3
0
        public About()
        {
            InitializeComponent();

            btnAlarm = new ALSAlarm();
            btnBack = new ALSButton();
            lblObjective = new Label();

            btnBack.Text = "Back";
            lblObjective.Text = "This application is an Oklahoma Christian University systems " +
                                "design project. Team eyePad's members consist of " +
                                "Allison Chilton, Daniel Griffin, and Drew Harris. The team mentor " +
                                "is Professor Steve Maher, and the customer is Ash Srinivas.\n\n" +
                                "Team eyePad’s goal is to create a series of products that increase " +
                                "the quality of life of people that have Amyotrophic Lateral Sclerosis " +
                                "the designing an assistive interface via an application suite that " +
                                "the increase the ability to communicate and function independently.\n\n" +
                                "This application is dedicated to " +
                                "Dr. Weyton Tam.";

            btnBack.Click += BtnBack_Click;

            lblObjective.TextAlign = ContentAlignment.TopCenter;

            lblObjective.ForeColor = Color.AntiqueWhite;

            Controls.Add(btnAlarm);
            Controls.Add(btnBack);
            Controls.Add(lblObjective);

            btnAlarm.Location = new Point(MainMenu.GAP, MainMenu.GAP);
        }
Esempio n. 4
0
        private void EditNote(object sender, EventArgs e)
        {
            ALSButton btn = (ALSButton)sender;

            notepage.Visible = true;
            this.Visible     = false;
            //Load Text
            if (!String.IsNullOrEmpty(btn.Name))
            {
                int index = getNum(btn.Name) + pageNum * NUM_NOTES;
                if (index >= 0 && index < phrases.Count)
                {
                    notepage.setText(phrases[index]);
                    indexBeingEdited = index;
                    phrases.RemoveAt(index);
                    if ((pageNum + 1) * NUM_NOTES > phrases.Count + 1)
                    {
                        topRowButtons[3].Enabled = false;
                    }
                }
                else
                {
                    NewNote_Click(sender, e);
                }
            }
            //Set Cursor at end
            notepage.setCursorAtEnd();
        }
Esempio n. 5
0
        public void Predictionkey_Click(object sender, EventArgs e)
        {
            ALSButton key = ((ALSButton)sender);

            if (key.Text.Length == 0)
            {
                return;
            }

            string text  = _textBox.Text.Substring(0, _textBox.SelectionStart);
            var    match = Regex.Match(text, @"\S+\s*$");

            string newWord;
            int    charactersAfterCaret = _textBox.TextLength - _textBox.SelectionStart;

            if (match.Value.Contains(" "))
            {
                if (needsCapitalization())
                {
                    newWord = key.Text.Substring(0, 1).ToUpper() + key.Text.Substring(1);
                }
                else
                {
                    newWord = key.Text;
                }
                _textBox.Text = _textBox.Text.Substring(0, _textBox.SelectionStart) + newWord + " " + _textBox.Text.Substring(_textBox.SelectionStart);
            }
            else
            {
                //Remove typed characters
                int numCharactersToRemove = 0;
                for (int i = 0; i < text.Length; i++)
                {
                    if (text.ToLower()[i].Equals(key.Text.ToLower()[i]))
                    {
                        numCharactersToRemove++;
                    }
                    else
                    {
                        break;
                    }
                }
                _textBox.Text = _textBox.Text.Substring(0, _textBox.SelectionStart - numCharactersToRemove) + _textBox.Text.Substring(_textBox.SelectionStart);

                if (needsCapitalization())
                {
                    newWord = key.Text.Substring(0, 1).ToUpper() + key.Text.Substring(1);
                }
                else
                {
                    newWord = key.Text;
                }

                _textBox.Text = text.Substring(0, match.Index) + newWord + " " + _textBox.Text.Substring(_textBox.SelectionStart);
            }
            _textBox.SelectionStart = _textBox.TextLength - charactersAfterCaret + 1;

            ResetPrediction();
            Populate_Predictkeys();
        }
        private void NavigateKeyboard(object sender, EventArgs e)
        {
            ALSButton button = (ALSButton)sender;

            switch (button.Text)
            {
            case "abc":
                keyboardType = KeyboardType.Lowercase;
                break;

            case "ABC":
                keyboardType = KeyboardType.Uppercase;
                break;

            case "123":
                keyboardType = KeyboardType.Characters;
                break;
            }
            int temp = (int)keyboardType;

            for (int i = 0; i < keyboard.GetLength(1); i++)
            {
                keyboard[(int)keyboardType, i].BringToFront();
            }
        }
Esempio n. 7
0
        public About()
        {
            InitializeComponent();

            btnAlarm     = new ALSAlarm();
            btnBack      = new ALSButton();
            lblObjective = new Label();

            btnBack.Text      = "Back";
            lblObjective.Text = "This application is an Oklahoma Christian University systems " +
                                "design project. Team eyePad's members consist of " +
                                "Allison Chilton, Daniel Griffin, and Drew Harris. The team mentor " +
                                "is Professor Steve Maher, and the customer is Ash Srinivas.\n\n" +
                                "Team eyePad’s goal is to create a series of products that increase " +
                                "the quality of life of people that have Amyotrophic Lateral Sclerosis " +
                                "the designing an assistive interface via an application suite that " +
                                "the increase the ability to communicate and function independently.\n\n" +
                                "This application is dedicated to " +
                                "Dr. Weyton Tam.";

            btnBack.Click += BtnBack_Click;

            lblObjective.TextAlign = ContentAlignment.TopCenter;

            lblObjective.ForeColor = Color.AntiqueWhite;

            Controls.Add(btnAlarm);
            Controls.Add(btnBack);
            Controls.Add(lblObjective);

            btnAlarm.Location = new Point(MainMenu.GAP, MainMenu.GAP);
        }
Esempio n. 8
0
        public void FillPredictKeys(object sender, EventArgs e)
        {
            ALSButton btn = ((ALSButton)sender);

            String[] predictions;

            try
            {
                predictions = presage.getPredictions(btn.Text);
            }catch
            {
                predictions = new String[0];
            }

            for (int i = 0; i < predictionKeys.GetLength(0); i++)
            {
                try
                {
                    predictionKeys[i].Text = predictions[i];
                }
                catch (IndexOutOfRangeException)
                {
                    predictionKeys[i].Text = "";
                }
            }
        }
Esempio n. 9
0
 public void ApplySettings()
 {
     updateSldrDwellTime();
     updateSldrKeyboard();
     updateVoiceSpeed();
     BroadcastKeyboard();
     ALSButton.setDecay(isDecay);
 }
Esempio n. 10
0
        private void InitializeControls()
        {
            btnAlarm         = new ALSAlarm();
            btnSwitchAccount = new ALSButton();
            btnCompose       = new ALSButton();
            btnRefresh       = new ALSButton();
            btnDelete        = new ALSButton();
            btnMainMenu      = new ALSButton();

            btnMoveUp   = new ALSButton();
            btnMoveDown = new ALSButton();
            btnSelect   = new ALSButton();
            lbEmails    = new ListBox();

            btnSwitchAccount.Text = "Switch\nAccount";
            btnCompose.Text       = "Compose";
            btnRefresh.Text       = "Refresh";
            btnDelete.Text        = "Delete";
            btnMainMenu.Text      = "Main\nMenu";

            btnMoveUp.BackgroundImage         = Properties.Resources.UpArrow;
            btnMoveUp.BackgroundImageLayout   = ImageLayout.Zoom;
            btnMoveDown.BackgroundImage       = Properties.Resources.DownArrow;
            btnMoveDown.BackgroundImageLayout = ImageLayout.Zoom;
            btnSelect.Text = "Select";

            lbEmails.Font = new Font(lbEmails.Font.FontFamily, 20);

            btnSwitchAccount.Click += BtnSwitchAccount_Click;
            btnCompose.Click       += BtnCompose_Click;
            btnRefresh.Click       += BtnRefresh_Click;
            btnDelete.Click        += BtnDelete_Click;
            btnMainMenu.Click      += BtnMainMenu_Click;
            btnMoveUp.Click        += BtnMoveUp_Click;
            btnMoveDown.Click      += BtnMoveDown_Click;
            btnSelect.Click        += BtnSelect_Click;

            Controls.Add(btnAlarm);
            Controls.Add(btnSwitchAccount);
            Controls.Add(btnCompose);
            Controls.Add(btnRefresh);
            Controls.Add(btnDelete);
            Controls.Add(btnMainMenu);

            Controls.Add(btnMoveUp);
            Controls.Add(btnMoveDown);
            Controls.Add(btnSelect);
            Controls.Add(lbEmails);


            lbEmails.Focus();
            lbEmails.SelectedIndexChanged += LbEmails_SelectedIndexChanged;
        }
Esempio n. 11
0
        private void deleteItem(object sender, EventArgs e)
        {
            ALSButton btn = (ALSButton)sender;

            int num = getNum(btn.Name) + pageNum * NUM_CALLOUTS;

            try
            {
                phrases.RemoveAt(num);
            }
            catch (ArgumentOutOfRangeException) { }
            refreshCalloutList();
        }
Esempio n. 12
0
        public LockScreen()
        {
            InitializeComponent();
            _lock = new ALSButton();
            alarm = new ALSAlarm();

            Controls.Add(_lock);
            Controls.Add(alarm);

            _lock.Click                += new System.EventHandler(this.Lock_Click);
            _lock.BackgroundImage       = Properties.Resources.Unlock;
            _lock.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;

            Resize += this.Resize_LockScreen;
        }
Esempio n. 13
0
        private void InitializeControls(bool isQwerty)
        {
            btnAlarm   = new ALSAlarm();
            txtTo      = new ALSTextbox();
            txtSubject = new ALSTextbox();
            txtBody    = new ALSTextbox();
            btnCancel  = new ALSButton();
            btnSend    = new ALSButton();

            if (isQwerty)
            {
                keyboard = new LargeButtonKeyboard();
            }
            else
            {
                keyboard = new QwertyKeyboard();
            }

            txtTo.Multiline      = true;
            txtSubject.Multiline = true;

            btnCancel.Text  = "Cancel";
            btnSend.Text    = "Send";
            txtTo.Text      = "To:";
            txtSubject.Text = "Subject:";
            txtBody.Text    = "Body:";

            Controls.Add(btnAlarm);
            Controls.Add(txtTo);
            Controls.Add(txtSubject);
            Controls.Add(txtBody);
            Controls.Add(btnCancel);
            Controls.Add(btnSend);
            Controls.Add(keyboard);

            btnCancel.Click  += BtnCancel_Click;
            btnSend.Click    += BtnSend_Click;
            txtTo.Click      += TxtTo_Click;
            txtSubject.Click += TxtSubject_Click;
            txtBody.Click    += TxtBody_Click;

            txtTo.Font      = new Font(txtTo.Font.FontFamily, 20);
            txtSubject.Font = new Font(txtSubject.Font.FontFamily, 20);
            txtBody.Font    = new Font(txtBody.Font.FontFamily, 20);

            keyboard.HideTextBox();
            txtBody.Multiline = true;
        }
Esempio n. 14
0
        protected void TypeCharacter(object sender, EventArgs e)
        {
            if (!(sender is ALSButton))
            {
                return;
            }
            ALSButton button = (ALSButton)sender;

            switch (button.Text)
            {
            case "Space":
                Insert(" ");
                break;

            case "&&":
                Insert("&");
                break;

            case ".":
            case "!":
            case "?":
            case ",":
                string text  = _textBox.Text.Substring(0, _textBox.SelectionStart);
                var    match = Regex.Match(text, @"\s*$");
                _textBox.SelectionStart -= match.Length;
                Insert(button.Text);
                ResetPrediction();
                break;

            default:
                if (needsCapitalization())
                {
                    Insert(button.Text.ToUpper());
                }
                else
                {
                    Insert(button.Text);
                }
                break;
            }

            var isPunctuation = Regex.Match(button.Text, @"[\p{P}^+=|]");

            if (!isPunctuation.Success && button.Text.Length > 0)
            {
                this.Populate_Predictkeys();
            }
        }
Esempio n. 15
0
        private void moveItemUp(object sender, EventArgs e)
        {
            try
            {
                ALSButton btn = (ALSButton)sender;
                int       num = getNum(btn.Name);

                num = pageNum * NUM_CALLOUTS + num;

                string temp = phrases[num - 1];
                phrases[num - 1] = phrases[num];
                phrases[num]     = temp;
                refreshCalloutList();
            }
            catch (ArgumentOutOfRangeException) { }
        }
Esempio n. 16
0
        private void deleteItem(object sender, EventArgs e)
        {
            ALSButton btn = (ALSButton)sender;

            int num = getNum(btn.Name);

            try
            {
                phrases.RemoveAt(num + NUM_NOTES * pageNum);
                if ((pageNum + 1) * NUM_NOTES > phrases.Count + 1)
                {
                    topRowButtons[3].Enabled = false;
                }
            }
            catch (ArgumentOutOfRangeException) { }
            refreshNotes();
        }
        private void InitializeControls()
        {
            btnReply = new ALSButton();
            btnReplyAll = new ALSButton();
            btnForward = new ALSButton();

            btnReply.Text = "Reply";
            btnReplyAll.Text = "Reply\nAll";
            btnForward.Text = "Forward";

            btnReply.Click += BtnReply_Click;
            btnReplyAll.Click += BtnReplyAll_Click;
            btnForward.Click += BtnForward_Click;

            Controls.Add(btnReply);
            Controls.Add(btnReplyAll);
            Controls.Add(btnForward);
        }
        private void InitializeControls()
        {
            btnReply = new ALSButton();
            btnReplyAll = new ALSButton();
            btnForward = new ALSButton();

            btnReply.Text = "Reply";
            btnReplyAll.Text = "Reply\nAll";
            btnForward.Text = "Forward";

            btnReply.Click += BtnReply_Click;
            btnReplyAll.Click += BtnReplyAll_Click;
            btnForward.Click += BtnForward_Click;

            Controls.Add(btnReply);
            Controls.Add(btnReplyAll);
            Controls.Add(btnForward);
        }
Esempio n. 19
0
        private void InitializeControls(bool isQwerty)
        {
            btnAlarm    = new ALSAlarm();
            btnLogout   = new ALSButton();
            btnCancel   = new ALSButton();
            btnLogin    = new ALSButton();
            txtLoginBox = new ALSTextbox();
            txtPassword = new ALSTextbox();
            if (isQwerty)
            {
                keyboard = new LargeButtonKeyboard();
            }
            else
            {
                keyboard = new QwertyKeyboard();
            }

            txtLoginBox.Multiline = true;
            txtPassword.Multiline = true;


            btnLogout.Text = "Log\nOut";
            btnCancel.Text = "Cancel";
            btnLogin.Text  = "Log\nIn";

            Controls.Add(btnAlarm);
            Controls.Add(btnLogout);
            Controls.Add(btnCancel);
            Controls.Add(btnLogin);
            Controls.Add(txtLoginBox);
            Controls.Add(txtPassword);
            Controls.Add(keyboard);

            btnLogout.Click += BtnLogout_Click;
            btnCancel.Click += BtnCancel_Click;
            btnLogin.Click  += BtnLogin_Click;

            txtLoginBox.Font = new Font(txtLoginBox.Font.FontFamily, 20);
            txtPassword.Font = new Font(txtPassword.Font.FontFamily, 20);

            keyboard.HideTextBox();
            txtLoginBox.Focus();
        }
Esempio n. 20
0
        private void InitializeControls()
        {
            btnAlarm    = new ALSAlarm();
            btnRespond  = new ALSButton();
            btnPageUp   = new ALSButton();
            btnUp       = new ALSButton();
            btnDown     = new ALSButton();
            btnPageDown = new ALSButton();
            btnBack     = new ALSButton();
            tbEmail     = new TextBox();
            panel       = new Panel();

            btnRespond.Text  = "Respond";
            btnPageUp.Text   = "Page\nup";
            btnUp.Text       = "Scroll\nUp";
            btnDown.Text     = "Scroll\nDown";
            btnPageDown.Text = "Page\nDown";
            btnBack.Text     = "Back";

            btnRespond.Click  += BtnRespond_Click;
            btnPageUp.Click   += BtnPageUp_Click;
            btnUp.Click       += BtnUp_Click;
            btnDown.Click     += BtnDown_Click;
            btnPageDown.Click += BtnPageDown_Click;
            btnBack.Click     += BtnBack_Click;

            panel.Controls.Add(tbEmail);
            Controls.Add(btnAlarm);
            Controls.Add(btnRespond);
            Controls.Add(btnPageUp);
            Controls.Add(btnUp);
            Controls.Add(btnDown);
            Controls.Add(btnPageDown);
            Controls.Add(btnBack);
            Controls.Add(panel);

            tbEmail.Multiline = true;
            tbEmail.ReadOnly  = true;
            panel.AutoScroll  = true;
            tbEmail.Size      = new Size(100, 700);
        }
Esempio n. 21
0
        private void ALSButton_Click(object sender, EventArgs e)
        {
            startTime = DateTime.Now.ToFileTime();
            //prevents rapid clicks
            if (!clicked)
            {
                clicked       = true;
                heightCounter = 0;

                if (sender != null && sender is ALSButton && ClearClick != null)
                {
                    ALSButton button = (ALSButton)sender;
                    if (button.Text.Equals("Clear"))
                    {
                        ClearClick(this, e);
                    }
                }

                //reset
                dwellTimer.Stop();
                decayTimer.Stop();
            }
        }
Esempio n. 22
0
        protected void initialSetup()
        {
            try { presage = new PresagePredictor(); }catch (Exception e) { ALS_App.LogCrash(e); }

            _textBox           = new TextBox();
            _textBox.Font      = new Font(_textBox.Font.FontFamily, 24);
            _textBox.Multiline = true;
            Controls.Add(_textBox);

            frmClearTextConfirmation = new ClearTextConfirmation();
            frmClearTextConfirmation.ClearText_Click += FrmClearTextConfirmation_ClearText_Click;

            predictionKeys  = new ALSButton[5];
            predictionWords = new List <string>();

            for (int i = 0; i < predictionKeys.Length; i++)
            {
                predictionKeys[i] = new ALSButton();
                this.Controls.Add(predictionKeys[i]);
                predictionKeys[i].btnType = ALSButton.ButtonType.key;
                predictionKeys[i].Click  += new System.EventHandler(this.Predictionkey_Click);
            }
            this.Resize += new System.EventHandler(this.Keyboard_Resize);
        }
Esempio n. 23
0
        public Slider(string title, double value)
        {
            InitializeComponent();
            initSlider(1, 0, 10);
            if (value >= minAmount && value <= maxAmount)
            {
                this.value = value;
            }
            this.title           = new Label();
            this.title.Text      = title;
            this.title.Font      = this.Font;
            this.title.ForeColor = Color.AntiqueWhite;
            Controls.Add(this.title);

            btnLeft        = new ALSButton();
            btnLeft.Text   = "Slower";
            btnLeft.Click += BtnLeft_Click1;
            Controls.Add(btnLeft);

            btnRight        = new ALSButton();
            btnRight.Text   = "Faster";
            btnRight.Click += BtnRight_Click1;
            Controls.Add(btnRight);
        }
Esempio n. 24
0
 private void setToRightOf(ALSButton btnRight, ALSButton btnLeft)
 {
     btnRight.Location = new Point(btnLeft.Right + MainMenu.GAP, btnLeft.Top);
 }
Esempio n. 25
0
        public SettingsPage1()
        {
            InitializeComponent();

            dwellTime = -1;
            keyboardDwellTime = -1;
            voiceSpeed = -1;
            try
            {
                XmlDataDocument doc = new XmlDataDocument();
                FileStream fs = new FileStream("settings.xml", FileMode.Open, FileAccess.Read);
                doc.Load(fs);

                XmlNode xmlnode = doc.FirstChild;
                xmlnode = xmlnode.NextSibling;

                isQwerty = xmlnode["keyboard"].InnerText.Equals("Qwerty");
                CVInterface.SetAutoAlarm(xmlnode["autoalarm"].InnerText.Equals("AAEnabled"));
                isDecay = xmlnode["decay"].InnerText.Equals("Decay");
                dwellTime = Convert.ToInt32(xmlnode["dwellTime"].InnerText);
                keyboardDwellTime = Convert.ToInt32(xmlnode["keyboardDwellTime"].InnerText);
                voiceSpeed = Convert.ToInt32(xmlnode["voiceSpeed"].InnerText);
            }
            catch (Exception) { }

            nextPage = new SettingsPage2(this);

            btnAlarm.BackgroundImageLayout = ImageLayout.Zoom;

            btnAlarm.setFontSize();
            btnBack.setFontSize();
            btnResetCallouts.setFontSize();

            btnLock = new ALSButton();
            btnLock.BackgroundImage = Properties.Resources.Lock;
            btnLock.BackgroundImageLayout = ImageLayout.Zoom;
            btnLock.Click += _lock_Click;
            btnLock.Size = btnBack.Size;
            Controls.Add(btnLock);

            btnToggleKeyboard = new ALSButton();
            btnToggleKeyboard.Text = isQwerty ? "Large\nButton\nKeyboard" : "Qwerty\nKeyboard";
            btnToggleKeyboard.Size = btnBack.Size;
            btnToggleKeyboard.Click += ChangeKeyboard_Click;
            Controls.Add(btnToggleKeyboard);

            btnNext = new ALSButton();
            btnNext.Text = "More\nSettings";
            btnNext.Size = btnBack.Size;
            btnNext.Click += btnNext_Click;
            Controls.Add(btnNext);

            btnAbout = new ALSButton();
            btnAbout.Text = "About";
            btnAbout.Size = btnBack.Size;
            btnAbout.Click += BtnAbout_Click;
            Controls.Add(btnAbout);

            if (voiceSpeed != -1)
            {
                sldrDwellTime = new Slider("Dwell Time", dwellTime);
                sldrKeyboard = new Slider("Keyboard Dwell Time", keyboardDwellTime);
                sldrVoiceSpeed = new Slider("Voice Speed", voiceSpeed);
            }
            else
            {
                sldrDwellTime = new Slider("Dwell Time");
                sldrKeyboard = new Slider("Keyboard Dwell Time");
                sldrVoiceSpeed = new Slider("Voice Speed");

            }
            Controls.Add(sldrDwellTime);
            Controls.Add(sldrKeyboard);
            Controls.Add(sldrVoiceSpeed);

            sldrDwellTime.BtnRight_Click += SldrDwellTime_Btn_Click;
            sldrDwellTime.BtnLeft_Click += SldrDwellTime_Btn_Click;
            sldrKeyboard.BtnLeft_Click += SldrKeyboard_Btn_Click;
            sldrKeyboard.BtnRight_Click += SldrKeyboard_Btn_Click;
            sldrVoiceSpeed.BtnRight_Click += SldrVoiceSpeed_Btn_Click;
            sldrVoiceSpeed.BtnLeft_Click += SldrVoiceSpeed_Btn_Click;

            frmAboutPage = new About();
            frmAboutPage.VisibleChanged += FrmAboutPage_VisibleChanged;

            dwellTime = sldrDwellTime.value;
            keyboardDwellTime = sldrDwellTime.value;
            voiceSpeed = sldrVoiceSpeed.value;
        }
Esempio n. 26
0
        public SettingsPage1()
        {
            InitializeComponent();

            dwellTime         = -1;
            keyboardDwellTime = -1;
            voiceSpeed        = -1;
            try
            {
                XmlDataDocument doc = new XmlDataDocument();
                FileStream      fs  = new FileStream("settings.xml", FileMode.Open, FileAccess.Read);
                doc.Load(fs);

                XmlNode xmlnode = doc.FirstChild;
                xmlnode = xmlnode.NextSibling;

                isQwerty = xmlnode["keyboard"].InnerText.Equals("Qwerty");
                CVInterface.SetAutoAlarm(xmlnode["autoalarm"].InnerText.Equals("AAEnabled"));
                isDecay           = xmlnode["decay"].InnerText.Equals("Decay");
                dwellTime         = Convert.ToInt32(xmlnode["dwellTime"].InnerText);
                keyboardDwellTime = Convert.ToInt32(xmlnode["keyboardDwellTime"].InnerText);
                voiceSpeed        = Convert.ToInt32(xmlnode["voiceSpeed"].InnerText);
            }
            catch (Exception) { }

            nextPage = new SettingsPage2(this);

            btnAlarm.BackgroundImageLayout = ImageLayout.Zoom;

            btnAlarm.setFontSize();
            btnBack.setFontSize();
            btnResetCallouts.setFontSize();

            btnLock = new ALSButton();
            btnLock.BackgroundImage       = Properties.Resources.Lock;
            btnLock.BackgroundImageLayout = ImageLayout.Zoom;
            btnLock.Click += _lock_Click;
            btnLock.Size   = btnBack.Size;
            Controls.Add(btnLock);

            btnToggleKeyboard        = new ALSButton();
            btnToggleKeyboard.Text   = isQwerty ? "Large\nButton\nKeyboard" : "Qwerty\nKeyboard";
            btnToggleKeyboard.Size   = btnBack.Size;
            btnToggleKeyboard.Click += ChangeKeyboard_Click;
            Controls.Add(btnToggleKeyboard);

            btnNext        = new ALSButton();
            btnNext.Text   = "More\nSettings";
            btnNext.Size   = btnBack.Size;
            btnNext.Click += btnNext_Click;
            Controls.Add(btnNext);

            btnAbout        = new ALSButton();
            btnAbout.Text   = "About";
            btnAbout.Size   = btnBack.Size;
            btnAbout.Click += BtnAbout_Click;
            Controls.Add(btnAbout);

            if (voiceSpeed != -1)
            {
                sldrDwellTime  = new Slider("Dwell Time", dwellTime);
                sldrKeyboard   = new Slider("Keyboard Dwell Time", keyboardDwellTime);
                sldrVoiceSpeed = new Slider("Voice Speed", voiceSpeed);
            }
            else
            {
                sldrDwellTime  = new Slider("Dwell Time");
                sldrKeyboard   = new Slider("Keyboard Dwell Time");
                sldrVoiceSpeed = new Slider("Voice Speed");
            }
            Controls.Add(sldrDwellTime);
            Controls.Add(sldrKeyboard);
            Controls.Add(sldrVoiceSpeed);

            sldrDwellTime.BtnRight_Click  += SldrDwellTime_Btn_Click;
            sldrDwellTime.BtnLeft_Click   += SldrDwellTime_Btn_Click;
            sldrKeyboard.BtnLeft_Click    += SldrKeyboard_Btn_Click;
            sldrKeyboard.BtnRight_Click   += SldrKeyboard_Btn_Click;
            sldrVoiceSpeed.BtnRight_Click += SldrVoiceSpeed_Btn_Click;
            sldrVoiceSpeed.BtnLeft_Click  += SldrVoiceSpeed_Btn_Click;

            frmAboutPage = new About();
            frmAboutPage.VisibleChanged += FrmAboutPage_VisibleChanged;


            dwellTime         = sldrDwellTime.value;
            keyboardDwellTime = sldrDwellTime.value;
            voiceSpeed        = sldrVoiceSpeed.value;
        }
Esempio n. 27
0
 private void updateSldrKeyboard()
 {
     ALSButton.setTimerSpeed(sldrKeyboard.value, ALSButton.ButtonType.key);
 }
Esempio n. 28
0
 private void updateSldrDwellTime()
 {
     ALSButton.setTimerSpeed(sldrDwellTime.value, ALSButton.ButtonType.normal);
 }
Esempio n. 29
0
 private void placeRightOf(ALSButton right, ALSButton left)
 {
     right.Location = new Point(left.Right + MainMenu.GAP, left.Top);
 }
Esempio n. 30
0
        ALSButton[] topRowButtons; //[Alarm, Add, Edit, PageLeft, PageRight, Back]

        #endregion Fields

        #region Constructors

        public Notebook(bool isQwerty)
        {
            InitializeComponent();

            notepage = new Notepage(isQwerty);

            indexBeingEdited = -1;

            //setup  note list
            phrases = new List<String>();
            populateList();

            //this.Parent = parent;
            topRowButtons = new ALSButton[6];

            topRowButtons[0] = new ALSAlarm();

            for (int i = 1; i < topRowButtons.Length; i++)
                topRowButtons[i] = new ALSButton();

            topRowButtons[1].Text = "Delete";
            topRowButtons[2].Text = "Page\nLeft";
            topRowButtons[3].Text = "Page\nRight";
            topRowButtons[4].Text = "New\nNote";
            topRowButtons[5].Text = "Main\nMenu";

            topRowButtons[1].Click += new System.EventHandler(this.edit_Click);
            topRowButtons[2].Click += new System.EventHandler(this.pageLeft);
            topRowButtons[3].Click += new System.EventHandler(this.pageRight);
            topRowButtons[4].Click += new System.EventHandler(this.NewNote_Click);
            topRowButtons[5].Click += new System.EventHandler(this.btnMainMenu_Click);

            notepage.getBackBtn().Click += new System.EventHandler(this.Notebook_Show);
            //notepage.getSaveButton().Click += new EventHandler(this.addToList); // there is no save button...
            notepage.Back_Click += Notepage_Back_Click;

            topRowButtons[2].Enabled = false;
            if (NUM_NOTES > phrases.Count)
                topRowButtons[3].Enabled = false;

            foreach (ALSButton btn in topRowButtons)
            {
                Controls.Add(btn);
                btn.Font = new System.Drawing.Font("Microsoft Sans Serif", 40F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            }

            notes = new ALSButton[2, NUM_NOTES];
            for (int i = 0; i < notes.GetLength(0); i++)
                for (int j = 0; j < notes.GetLength(1); j++)
                {
                    notes[i, j] = new ALSButton();
                    Controls.Add(notes[i, j]);
                }

            for (int i = 0; i < notes.GetLength(1); i++)
            {
                notes[0, i].Font = new System.Drawing.Font("Microsoft Sans Serif", 40F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                notes[0, i].Click += new EventHandler(this.EditNote);
                notes[0, i].Name = "btnNotepage" + i;
            }

            for (int i = 1; i < notes.GetLength(0); i++)
                for (int j = 0; j < notes.GetLength(1); j++)
                {
                    switch (i)
                    {
                        case 1:
                            notes[i, j].BackgroundImage = Properties.Resources.trashcan;
                            notes[i, j].Name = "btnDel" + j;
                            notes[i, j].Click += new System.EventHandler(this.deleteItem);
                            break;
                    }
                    notes[i, j].BackgroundImageLayout = ImageLayout.Zoom;
                    notes[i, j].Visible = false;
                }

            flipToPage(0);
        }
Esempio n. 31
0
        public Notebook(bool isQwerty)
        {
            InitializeComponent();

            notepage = new Notepage(isQwerty);

            indexBeingEdited = -1;

            //setup  note list
            phrases = new List <String>();
            populateList();

            //this.Parent = parent;
            topRowButtons = new ALSButton[6];

            topRowButtons[0] = new ALSAlarm();

            for (int i = 1; i < topRowButtons.Length; i++)
            {
                topRowButtons[i] = new ALSButton();
            }

            topRowButtons[1].Text = "Delete";
            topRowButtons[2].Text = "Page\nLeft";
            topRowButtons[3].Text = "Page\nRight";
            topRowButtons[4].Text = "New\nNote";
            topRowButtons[5].Text = "Main\nMenu";

            topRowButtons[1].Click += new System.EventHandler(this.edit_Click);
            topRowButtons[2].Click += new System.EventHandler(this.pageLeft);
            topRowButtons[3].Click += new System.EventHandler(this.pageRight);
            topRowButtons[4].Click += new System.EventHandler(this.NewNote_Click);
            topRowButtons[5].Click += new System.EventHandler(this.btnMainMenu_Click);

            notepage.getBackBtn().Click += new System.EventHandler(this.Notebook_Show);
            //notepage.getSaveButton().Click += new EventHandler(this.addToList); // there is no save button...
            notepage.Back_Click += Notepage_Back_Click;

            topRowButtons[2].Enabled = false;
            if (NUM_NOTES > phrases.Count)
            {
                topRowButtons[3].Enabled = false;
            }

            foreach (ALSButton btn in topRowButtons)
            {
                Controls.Add(btn);
                btn.Font = new System.Drawing.Font("Microsoft Sans Serif", 40F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            }

            notes = new ALSButton[2, NUM_NOTES];
            for (int i = 0; i < notes.GetLength(0); i++)
            {
                for (int j = 0; j < notes.GetLength(1); j++)
                {
                    notes[i, j] = new ALSButton();
                    Controls.Add(notes[i, j]);
                }
            }

            for (int i = 0; i < notes.GetLength(1); i++)
            {
                notes[0, i].Font   = new System.Drawing.Font("Microsoft Sans Serif", 40F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                notes[0, i].Click += new EventHandler(this.EditNote);
                notes[0, i].Name   = "btnNotepage" + i;
            }

            for (int i = 1; i < notes.GetLength(0); i++)
            {
                for (int j = 0; j < notes.GetLength(1); j++)
                {
                    switch (i)
                    {
                    case 1:
                        notes[i, j].BackgroundImage = Properties.Resources.trashcan;
                        notes[i, j].Name            = "btnDel" + j;
                        notes[i, j].Click          += new System.EventHandler(this.deleteItem);
                        break;
                    }
                    notes[i, j].BackgroundImageLayout = ImageLayout.Zoom;
                    notes[i, j].Visible = false;
                }
            }

            flipToPage(0);
        }
Esempio n. 32
0
        public Callout(bool isQwerty)
        {
            InitializeComponent();

            ac = new AddCallout(isQwerty);
            ac.Callouts_Click += Ac_Callouts_Click;
            //setup  callout list
            phrases = new List <String>();
            populateList();

            //this.Parent = parent;
            topRowButtons = new ALSButton[6];

            topRowButtons[0] = new ALSAlarm();

            for (int i = 1; i < topRowButtons.Length; i++)
            {
                topRowButtons[i] = new ALSButton();
            }

            topRowButtons[1].Text = "Edit";
            topRowButtons[2].Text = "Page\nLeft";
            topRowButtons[3].Text = "Page\nRight";
            topRowButtons[4].Text = "Text to\nSpeech";
            topRowButtons[5].Text = "Main\nMenu";

            topRowButtons[1].Click += new System.EventHandler(this.edit_Click);
            topRowButtons[2].Click += new System.EventHandler(this.pageLeft);
            topRowButtons[3].Click += new System.EventHandler(this.pageRight);
            topRowButtons[4].Click += new System.EventHandler(this.btnTextToSpeech_Click);
            topRowButtons[5].Click += new System.EventHandler(this.btnMainMenu_Click);
            ac.getSaveButton().Click += new EventHandler(this.addToList);

            foreach (ALSButton btn in topRowButtons)
            {
                Controls.Add(btn);
                btn.Font = new System.Drawing.Font("Microsoft Sans Serif", 40F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            }

            callouts = new ALSButton[4, NUM_CALLOUTS];
            for (int i = 0; i < callouts.GetLength(0); i++)
            {
                for (int j = 0; j < callouts.GetLength(1); j++)
                {
                    callouts[i, j] = new ALSButton();
                    Controls.Add(callouts[i, j]);
                }
            }

            for (int i = 0; i < callouts.GetLength(1); i++)
            {
                callouts[0, i].Font   = new System.Drawing.Font("Microsoft Sans Serif", 40F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                callouts[0, i].Click += new EventHandler(this.speakCallout);
            }

            for (int i = 1; i < callouts.GetLength(0); i++)
            {
                for (int j = 0; j < callouts.GetLength(1); j++)
                {
                    switch (i)
                    {
                    case 1:
                        callouts[i, j].BackgroundImage = Properties.Resources.trashcan;
                        callouts[i, j].Name            = "btnDel" + j;
                        callouts[i, j].Click          += new System.EventHandler(this.deleteItem);
                        break;

                    case 2:
                        callouts[i, j].Text   = "Up";
                        callouts[i, j].Name   = "btnUp" + j;
                        callouts[i, j].Click += new System.EventHandler(this.moveItemUp);
                        break;

                    case 3:
                        callouts[i, j].Text   = "Down";
                        callouts[i, j].Name   = "btnDown" + j;
                        callouts[i, j].Click += new EventHandler(this.moveItemDown);
                        break;
                    }
                    callouts[i, j].BackgroundImageLayout = ImageLayout.Zoom;
                    callouts[i, j].Visible = false;
                }
            }
            refreshCalloutList();
        }
Esempio n. 33
0
        protected void initialSetup()
        {
            try { presage = new PresagePredictor(); }catch(Exception e) { ALS_App.LogCrash(e); }

            _textBox = new TextBox();
            _textBox.Font = new Font(_textBox.Font.FontFamily, 24);
            _textBox.Multiline = true;
            Controls.Add(_textBox);

            frmClearTextConfirmation = new ClearTextConfirmation();
            frmClearTextConfirmation.ClearText_Click += FrmClearTextConfirmation_ClearText_Click;

            predictionKeys = new ALSButton[5];
            predictionWords = new List<string>();

            for (int i = 0; i < predictionKeys.Length; i++)
            {
                predictionKeys[i] = new ALSButton();
                this.Controls.Add(predictionKeys[i]);
                predictionKeys[i].btnType = ALSButton.ButtonType.key;
                predictionKeys[i].Click += new System.EventHandler(this.Predictionkey_Click);
            }
            this.Resize += new System.EventHandler(this.Keyboard_Resize);
        }
Esempio n. 34
0
        private void speakCallout(object sender, EventArgs e)
        {
            ALSButton btn = (ALSButton)sender;

            MainMenu.Speak(btn.Text);
        }
Esempio n. 35
0
        private void InitializeControls(bool isQwerty)
        {
            btnAlarm = new ALSAlarm();
            btnLogout = new ALSButton();
            btnCancel = new ALSButton();
            btnLogin = new ALSButton();
            txtLoginBox = new ALSTextbox();
            txtPassword = new ALSTextbox();
            if (isQwerty)
                keyboard = new LargeButtonKeyboard();
            else
                keyboard = new QwertyKeyboard();

            txtLoginBox.Multiline = true;
            txtPassword.Multiline = true;

            btnLogout.Text = "Log\nOut";
            btnCancel.Text = "Cancel";
            btnLogin.Text = "Log\nIn";

            Controls.Add(btnAlarm);
            Controls.Add(btnLogout);
            Controls.Add(btnCancel);
            Controls.Add(btnLogin);
            Controls.Add(txtLoginBox);
            Controls.Add(txtPassword);
            Controls.Add(keyboard);

            btnLogout.Click += BtnLogout_Click;
            btnCancel.Click += BtnCancel_Click;
            btnLogin.Click += BtnLogin_Click;

            txtLoginBox.Font = new Font(txtLoginBox.Font.FontFamily, 20);
            txtPassword.Font = new Font(txtPassword.Font.FontFamily, 20);

            keyboard.HideTextBox();
            txtLoginBox.Focus();
        }
Esempio n. 36
0
        private void InitializeControls()
        {
            btnAlarm = new ALSAlarm();
            btnRespond = new ALSButton();
            btnPageUp = new ALSButton();
            btnUp = new ALSButton();
            btnDown = new ALSButton();
            btnPageDown = new ALSButton();
            btnBack = new ALSButton();
            tbEmail = new TextBox();
            panel = new Panel();

            btnRespond.Text = "Respond";
            btnPageUp.Text = "Page\nup";
            btnUp.Text = "Scroll\nUp";
            btnDown.Text = "Scroll\nDown";
            btnPageDown.Text = "Page\nDown";
            btnBack.Text = "Back";

            btnRespond.Click += BtnRespond_Click;
            btnPageUp.Click += BtnPageUp_Click;
            btnUp.Click += BtnUp_Click;
            btnDown.Click += BtnDown_Click;
            btnPageDown.Click += BtnPageDown_Click;
            btnBack.Click += BtnBack_Click;

            panel.Controls.Add(tbEmail);
            Controls.Add(btnAlarm);
            Controls.Add(btnRespond);
            Controls.Add(btnPageUp);
            Controls.Add(btnUp);
            Controls.Add(btnDown);
            Controls.Add(btnPageDown);
            Controls.Add(btnBack);
            Controls.Add(panel);

            tbEmail.Multiline = true;
            tbEmail.ReadOnly = true;
            panel.AutoScroll = true;
            tbEmail.Size = new Size(100, 700);
        }
Esempio n. 37
0
 private void btnDecay_Click(object sender, EventArgs e)
 {
     ALSButton.toggleDecay();
     isDecay = !isDecay;
     ((ALSButton)sender).Text = isDecay ? "Prevent\nDecay" : "Allow\nDecay";
 }
Esempio n. 38
0
        private void InitializeControls(bool isQwerty)
        {
            btnAlarm = new ALSAlarm();
            txtTo = new ALSTextbox();
            txtSubject = new ALSTextbox();
            txtBody = new ALSTextbox();
            btnCancel = new ALSButton();
            btnSend = new ALSButton();

            if (isQwerty)
                keyboard = new LargeButtonKeyboard();
            else
                keyboard = new QwertyKeyboard();

            txtTo.Multiline = true;
            txtSubject.Multiline = true;

            btnCancel.Text = "Cancel";
            btnSend.Text = "Send";
            txtTo.Text = "To:";
            txtSubject.Text = "Subject:";
            txtBody.Text = "Body:";

            Controls.Add(btnAlarm);
            Controls.Add(txtTo);
            Controls.Add(txtSubject);
            Controls.Add(txtBody);
            Controls.Add(btnCancel);
            Controls.Add(btnSend);
            Controls.Add(keyboard);

            btnCancel.Click += BtnCancel_Click;
            btnSend.Click += BtnSend_Click;
            txtTo.Click += TxtTo_Click;
            txtSubject.Click += TxtSubject_Click;
            txtBody.Click += TxtBody_Click;

            txtTo.Font = new Font(txtTo.Font.FontFamily, 20);
            txtSubject.Font = new Font(txtSubject.Font.FontFamily, 20);
            txtBody.Font = new Font(txtBody.Font.FontFamily, 20);

            keyboard.HideTextBox();
            txtBody.Multiline = true;
        }
Esempio n. 39
0
        private void NavigateKeyboard(object sender, EventArgs e)
        {
            ALSButton button = (ALSButton)sender;

            switch (button.Text)
            {
            case "abc":
                keyboardType = KeyboardType.Lowercase;
                break;

            case "ABC":
                keyboardType = KeyboardType.Uppercase;
                break;

            case "123":
                keyboardType = KeyboardType.Characters;
                break;

            case lLetters1:
                keyboardType = KeyboardType.aTOi;
                break;

            case lLetters2:
                keyboardType = KeyboardType.jTOr;
                break;

            case lLetters3:
                keyboardType = KeyboardType.sTOz;
                break;

            case uLetters1:
                keyboardType = KeyboardType.ATOI;
                break;

            case uLetters2:
                keyboardType = KeyboardType.JTOR;
                break;

            case uLetters3:
                keyboardType = KeyboardType.STOZ;
                break;

            case "1-9":
                keyboardType = KeyboardType._1TO9;
                break;

            case symbols1:
                keyboardType = KeyboardType.Punctuation;
                break;

            case symbols2:
                keyboardType = KeyboardType.Symbols;
                break;

            case symbols3:
                keyboardType = KeyboardType.Symbols2;
                break;

            case "Back":
                switch (keyboardType)
                {
                case KeyboardType.aTOi:
                case KeyboardType.jTOr:
                case KeyboardType.sTOz:
                    keyboardType = KeyboardType.Lowercase;
                    break;

                case KeyboardType.ATOI:
                case KeyboardType.JTOR:
                case KeyboardType.STOZ:
                    keyboardType = KeyboardType.Uppercase;
                    break;

                case KeyboardType._1TO9:
                case KeyboardType.Punctuation:
                case KeyboardType.Symbols:
                case KeyboardType.Symbols2:
                    keyboardType = KeyboardType.Characters;
                    break;
                }
                break;

            default:
                if (button.Text.Length > 0)
                {
                    if (button.Text[0] >= 'a' && button.Text[0] <= 'z')
                    {
                        keyboardType = KeyboardType.Lowercase;
                    }
                    else if (button.Text[0] >= 'A' && button.Text[0] <= 'Z')
                    {
                        keyboardType = KeyboardType.Uppercase;
                    }
                    else
                    {
                        keyboardType = KeyboardType.Characters;
                    }
                }
                break;
            }


            int temp = (int)keyboardType;

            for (int i = 0; i < keyboard.GetLength(1); i++)
            {
                keyboard[(int)keyboardType, i].BringToFront();
            }
        }
Esempio n. 40
0
 private void placeRightOf(ALSButton right, ALSButton left)
 {
     right.Location = new Point(left.Right + MainMenu.GAP, left.Top);
 }