Ejemplo n.º 1
0
 public void addWriteInput(KeyboardViewEventArgs keyboardViewEventArgs)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 2
0
 public void addWriteInput(KeyboardViewEventArgs keyboardViewEventArgs)
 {
     switch (keyboardViewEventArgs.Value)
     {
         case KeyboardButtons.AlphaA:
             ContactViewContainer.activeControl.Text += "A";
             break;
         case KeyboardButtons.AlphaB:
             ContactViewContainer.activeControl.Text += "B";
             break;
         case KeyboardButtons.AlphaC:
             ContactViewContainer.activeControl.Text += "C";
             break;
         case KeyboardButtons.AlphaD:
             ContactViewContainer.activeControl.Text += "D";
             break;
         case KeyboardButtons.AlphaE:
             ContactViewContainer.activeControl.Text += "E";
             break;
         case KeyboardButtons.AlphaF:
             ContactViewContainer.activeControl.Text += "F";
             break;
         case KeyboardButtons.AlphaG:
             ContactViewContainer.activeControl.Text += "G";
             break;
         case KeyboardButtons.AlphaH:
             ContactViewContainer.activeControl.Text += "H";
             break;
         case KeyboardButtons.AlphaI:
             ContactViewContainer.activeControl.Text += "I";
             break;
         case KeyboardButtons.AlphaJ:
             ContactViewContainer.activeControl.Text += "J";
             break;
         case KeyboardButtons.AlphaK:
             ContactViewContainer.activeControl.Text += "K";
             break;
         case KeyboardButtons.AlphaL:
             ContactViewContainer.activeControl.Text += "L";
             break;
         case KeyboardButtons.AlphaM:
             ContactViewContainer.activeControl.Text += "M";
             break;
         case KeyboardButtons.AlphaN:
             ContactViewContainer.activeControl.Text += "N";
             break;
         case KeyboardButtons.AlphaO:
             ContactViewContainer.activeControl.Text += "O";
             break;
         case KeyboardButtons.AlphaP:
             ContactViewContainer.activeControl.Text += "P";
             break;
         case KeyboardButtons.AlphaQ:
             ContactViewContainer.activeControl.Text += "Q";
             break;
         case KeyboardButtons.AlphaR:
             ContactViewContainer.activeControl.Text += "R";
             break;
         case KeyboardButtons.AlphaS:
             ContactViewContainer.activeControl.Text += "S";
             break;
         case KeyboardButtons.AlphaT:
             ContactViewContainer.activeControl.Text += "T";
             break;
         case KeyboardButtons.AlphaU:
             ContactViewContainer.activeControl.Text += "U";
             break;
         case KeyboardButtons.AlphaV:
             ContactViewContainer.activeControl.Text += "V";
             break;
         case KeyboardButtons.AlphaW:
             ContactViewContainer.activeControl.Text += "W";
             break;
         case KeyboardButtons.AlphaX:
             ContactViewContainer.activeControl.Text += "X";
             break;
         case KeyboardButtons.AlphaY:
             ContactViewContainer.activeControl.Text += "Y";
             break;
         case KeyboardButtons.AlphaZ:
             ContactViewContainer.activeControl.Text += "Z";
             break;
         case KeyboardButtons.NumericOne:
             ContactViewContainer.activeControl.Text += "1";
             break;
         case KeyboardButtons.NumericTwo:
             ContactViewContainer.activeControl.Text += "2";
             break;
         case KeyboardButtons.NumericThree:
             ContactViewContainer.activeControl.Text += "3";
             break;
         case KeyboardButtons.NumericFour:
             ContactViewContainer.activeControl.Text += "4";
             break;
         case KeyboardButtons.NumericFive:
             ContactViewContainer.activeControl.Text += "5";
             break;
         case KeyboardButtons.NumericSix:
             ContactViewContainer.activeControl.Text += "6";
             break;
         case KeyboardButtons.NumericSeven:
             ContactViewContainer.activeControl.Text += "7";
             break;
         case KeyboardButtons.NumericEight:
             ContactViewContainer.activeControl.Text += "8";
             break;
         case KeyboardButtons.NumericNine:
             ContactViewContainer.activeControl.Text += "9";
             break;
         case KeyboardButtons.NumericZero:
             ContactViewContainer.activeControl.Text += "0";
             break;
         case KeyboardButtons.SpecialCharAt:
             ContactViewContainer.activeControl.Text += "@";
             break;
         case KeyboardButtons.SpecialCharSpace:
             ContactViewContainer.activeControl.Text += " ";
             break;
         case KeyboardButtons.SpecialCharBackspace:
             if (ContactViewContainer.activeControl.Text.Length > 0)
                 ContactViewContainer.activeControl.Text = ContactViewContainer.activeControl.Text.Substring(0, ContactViewContainer.activeControl.Text.Length - 1);
             break;
         case KeyboardButtons.PunctationDot:
             ContactViewContainer.activeControl.Text += ".";
             break;
         case KeyboardButtons.PunctationComma:
             ContactViewContainer.activeControl.Text += ",";
             break;
         case KeyboardButtons.PunctationQuestion:
             ContactViewContainer.activeControl.Text += "?";
             break;
         case KeyboardButtons.PunctationExclamation:
             ContactViewContainer.activeControl.Text += "!";
             break;
         case KeyboardButtons.UmlautA:
             ContactViewContainer.activeControl.Text += "Ä";
             break;
         case KeyboardButtons.UmlautO:
             ContactViewContainer.activeControl.Text += "Ö";
             break;
         case KeyboardButtons.UmlautU:
             ContactViewContainer.activeControl.Text += "Ü";
             break;
         case KeyboardButtons.UmlautS:
             ContactViewContainer.activeControl.Text += "ß";
             break;
         default:
             break;
     }
 }
Ejemplo n.º 3
0
 public virtual void OnUpPress(Button sender, KeyboardViewEventArgs e)
 {
     this.up();
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Is raised when the cancel-button was pushed.
 /// </summary>
 /// <param name="sender">Button which was canceled</param>
 /// <param name="e">The specific button which was canceled</param>
 public virtual void OnCancel(Button sender, KeyboardViewEventArgs e)
 {
     if (Canceled != null)
     {
         Canceled(this, e);
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Is raised when the apply-button was pushed.
 /// </summary>
 /// <param name="sender">Button which was applied</param>
 /// <param name="e">The specific button which was applied</param>
 public virtual void OnApply(Button sender, KeyboardViewEventArgs e)
 {
     if (Applied != null)
     {
         Applied(this, e);
     }
 }
Ejemplo n.º 6
0
        internal static void handleKeyboardEvent(KeyboardViewEventArgs keyboardViewEventArgs)
        {
            switch (Input.MenuState)
            {
                case MenuState.None:
                    Dialog dialog;
                    switch (keyboardViewEventArgs.Value)
                    {
                        case KeyboardButtons.MenuMessageNew:
                            Input.setNewMenuState(MenuState.NewMessage);
                            break;
                        case KeyboardButtons.MenuMessageRecv:
                            Input.setNewMenuState(MenuState.ViewMessage);
                            break;
                        case KeyboardButtons.MenuContactNew:
                            Input.setNewMenuState(MenuState.AddNewContact);
                            break;
                        case KeyboardButtons.MenuContactEdit:
                            Input.setNewMenuState(MenuState.EditContact);
                            break;
                        case KeyboardButtons.MenuContactDelete:
                            Input.setNewMenuState(MenuState.DeleteContact);
                            break;
                        case KeyboardButtons.ApplicationClose:
                            dialog = new Dialog("Bestätigung", "Wollen sie KomMee wirklich beenden?", new String[] { "Ja", "Nein" });
                            dialog.ShowDialog();
                            if (dialog.ClickedDialogButton == "Ja")
                                Application.Exit();
                            break;
                        case KeyboardButtons.TextToSpeech:
                            if (textToSpechEnabled)
                            {
                                textToSpechEnabled = false;
                                dialog = new Dialog("Information", "Der Vorlesemodus ist nun deaktiviert", new String[] { "Ok" });
                                dialog.ShowDialog();
                            }
                            else
                            {
                                textToSpechEnabled = true;
                                dialog = new Dialog("Information", "Der Vorlesemodus ist nun eingeschaltet", new String[] { "Ok" });
                                dialog.ShowDialog();
                            }

                            break;
                    }
                    break;
                case MenuState.ViewMessage:
                    break;
                case MenuState.AnswerMessage:
                    break;
                case MenuState.DeleteMessage:
                    break;
                case MenuState.NewMessage:
                    if (keyboardViewEventArgs.Value == KeyboardButtons.TextSend)
                    {
                        object data = Input.currentIViewContaier.getData();
                        Input.message = new SMSMessage(data);
                        ((SMSViewContainer)(Input.currentIViewContaier)).setColor(Color.White);
                        Input.setNewMenuState(MenuState.ChoseReceiver);
                    }
                    else
                        Input.currentIViewContaier.addWriteInput(keyboardViewEventArgs);
                    break;
                case MenuState.ChoseReceiver:
                    break;
                case MenuState.ChoseMessageType:
                    break;
                case MenuState.AddNewContact:
                    if (keyboardViewEventArgs.Value == KeyboardButtons.SpecialCharReturn)
                    {
                        if (((ContactViewContainer)Input.currentIViewContaier).apply())
                        {
                            String[] data = (String[])Input.currentIViewContaier.getData();
                            String firstname, lastname, phonenumber;
                            firstname = data[0];
                            lastname= data[1];
                            phonenumber = data[2];

                            Contact newContact = new Contact(firstname, lastname);
                            SMSAddress newAddress = new SMSAddress(phonenumber);
                            newContact.ContactTypes.Add(phonenumber, newAddress);
                            newContact.DefaultAddress = newAddress;
                            newContact.saveContact();
                            AddressBook addressBook = AddressBook.getInstance();
                            addressBook.addContact(newContact);

                            dialog = new Dialog("Information", "Der Kontakt \"" + lastname + ", " + firstname + "\" wurde erfolgreich gespeichert!", new String[] { "Ok" });
                            dialog.ShowDialog();

                            Input.clearViewContainer();
                            Input.setNewMenuState(MenuState.None);
                        }
                    }
                    else
                        Input.currentIViewContaier.addWriteInput(keyboardViewEventArgs);
                    break;
                case MenuState.EditContact:
                    break;
                case MenuState.DeleteContact:
                    break;
                case MenuState.AddMessageTypeToContact:
                    break;
                default:
                    break;
            }
        }