Пример #1
0
        private void FormMapRadius_Load(object sender, EventArgs e)
        {
            // turn off UI updating
            this.senseListCtrl.BeginUpdate();

            // Address textbox
            //			this.senseListCtrl.AddItem(new SensePanelDividerItem("DividerItemTaskNotes", "Task description"));
            textRadius = new SensePanelTextboxItem("textRadius");
            textRadius.LayoutSytle = SenseTexboxLayoutStyle.Vertical;
            textRadius.LabelText = "Radius (in meters):";
            textRadius.ShowSeparator = false;
            //			textRadius.Height = GetLongTextBoxSize();
            //textRadius.StdInputMask = SenseInputMaskType.Custom;
            //textRadius.InputMask = "00000";
            //textRadius.Value = radius.ToString();
            textRadius.Text = radius.ToString();
            this.senseListCtrl.AddItem(textRadius);

            // Search button
            btSet = new SensePanelButtonItem("btSet");
            btSet.LabelText = "";
            btSet.Text = "Set";
            btSet.OnClick += new SensePanelButtonItem.ClickEventHandler(btSet_Click);
            this.senseListCtrl.AddItem(btSet);

            // we are done so turn on UI updating
            this.senseListCtrl.EndUpdate();

            setupSIP();
        }
Пример #2
0
        private void FormMapSearch_Load(object sender, EventArgs e)
        {
            // turn off UI updating
            this.senseListCtrl.BeginUpdate();

            // Address textbox
//			this.senseListCtrl.AddItem(new SensePanelDividerItem("DividerItemTaskNotes", "Task description"));
            tboxAddress               = new SensePanelTextboxItem();
            tboxAddress               = new SensePanelTextboxItem("tboxAddress");
            tboxAddress.LayoutSytle   = SenseTexboxLayoutStyle.Vertical;
            tboxAddress.LabelText     = "Address:";
            tboxAddress.ShowSeparator = false;
            tboxAddress.Multiline     = true;
            tboxAddress.Height        = GetLongTextBoxSize();
            tboxAddress.Text          = "";
            this.senseListCtrl.AddItem(tboxAddress);

            // Search button
            btSearch           = new SensePanelButtonItem("btSearch");
            btSearch.LabelText = "";
            btSearch.Text      = "Search";
            btSearch.OnClick  += new SensePanelButtonItem.ClickEventHandler(btSearch_Click);
            this.senseListCtrl.AddItem(btSearch);

            // we are done so turn on UI updating
            this.senseListCtrl.EndUpdate();

            setupSIP();
        }
Пример #3
0
        private void FormMapRadius_Load(object sender, EventArgs e)
        {
            // turn off UI updating
            this.senseListCtrl.BeginUpdate();

            // Address textbox
//			this.senseListCtrl.AddItem(new SensePanelDividerItem("DividerItemTaskNotes", "Task description"));
            textRadius               = new SensePanelTextboxItem("textRadius");
            textRadius.LayoutSytle   = SenseTexboxLayoutStyle.Vertical;
            textRadius.LabelText     = "Radius (in meters):";
            textRadius.ShowSeparator = false;
//			textRadius.Height = GetLongTextBoxSize();
            //textRadius.StdInputMask = SenseInputMaskType.Custom;
            //textRadius.InputMask = "00000";
            //textRadius.Value = radius.ToString();
            textRadius.Text = radius.ToString();
            this.senseListCtrl.AddItem(textRadius);

            // Search button
            btSet           = new SensePanelButtonItem("btSet");
            btSet.LabelText = "";
            btSet.Text      = "Set";
            btSet.OnClick  += new SensePanelButtonItem.ClickEventHandler(btSet_Click);
            this.senseListCtrl.AddItem(btSet);

            // we are done so turn on UI updating
            this.senseListCtrl.EndUpdate();

            setupSIP();
        }
Пример #4
0
        private void FormMapSearch_Load(object sender, EventArgs e)
        {
            // turn off UI updating
            this.senseListCtrl.BeginUpdate();

            // Address textbox
            //			this.senseListCtrl.AddItem(new SensePanelDividerItem("DividerItemTaskNotes", "Task description"));
            tboxAddress = new SensePanelTextboxItem();
            tboxAddress = new SensePanelTextboxItem("tboxAddress");
            tboxAddress.LayoutSytle = SenseTexboxLayoutStyle.Vertical;
            tboxAddress.LabelText = "Address:";
            tboxAddress.ShowSeparator = false;
            tboxAddress.Multiline = true;
            tboxAddress.Height = GetLongTextBoxSize();
            tboxAddress.Text = "";
            this.senseListCtrl.AddItem(tboxAddress);

            // Search button
            btSearch = new SensePanelButtonItem("btSearch");
            btSearch.LabelText = "";
            btSearch.Text = "Search";
            btSearch.OnClick += new SensePanelButtonItem.ClickEventHandler(btSearch_Click);
            this.senseListCtrl.AddItem(btSearch);

            // we are done so turn on UI updating
            this.senseListCtrl.EndUpdate();

            setupSIP();
        }
Пример #5
0
        public static SensePanelTextboxItem CreateTextboxItem(SensePropertyBag parameter, EventHandler handler)
        {
            SensePanelTextboxItem result = new SensePanelTextboxItem(parameter.PropertyName)
            {
                LabelWidth    = 30,
                LayoutSytle   = SenseTexboxLayoutStyle.Horizontal,
                LabelText     = parameter.PropertyLabel,
                ShowSeparator = true,
                Text          = Settings.GetProperty(parameter.PropertyName)
            };

            result.TextChanged += handler;

            return(result);
        }
Пример #6
0
        private void SetupControls()
        {
            // turn off UI updating
            this.senseListCtrl.BeginUpdate();

            // Subject textbox
            mTboxSubject = new SensePanelTextboxItem();
            mTboxSubject = new SensePanelTextboxItem("mTboxSubject");
            mTboxSubject.LayoutSytle = SenseTexboxLayoutStyle.Vertical;
            mTboxSubject.LabelText = "Subject:";
            mTboxSubject.Text = "";
            this.senseListCtrl.AddItem(mTboxSubject);

            // location button
            mBtnSetLocation = new SensePanelButtonItem("mBtnSetLocation");
            mBtnSetLocation.LabelText = "Location:";
            mBtnSetLocation.Text = "Set Location";
            mBtnSetLocation.OnClick += new SensePanelButtonItem.ClickEventHandler(OnBtnSetLocation);
            this.senseListCtrl.AddItem(mBtnSetLocation);

            // location label
            mTxtLocation = new SensePanelItem("mTxtLocation");
            mTxtLocation.PrimaryTextAlignment = SenseAPIs.SenseFont.PanelTextAlignment.Top;
            //			mTxtLocation.PrimaryTextLineHeight = SenseAPIs.SenseFont.PanelTextLineHeight.SingleLine;
            mTxtLocation.Visible = false;
            this.senseListCtrl.AddItem(mTxtLocation);

            // Action type combobox
            mCbbActionType = new SensePanelComboItem("mCbbActionType");
            mCbbActionType.OnSelectedIndexChanged += new SensePanelComboItem.SelectedIndexChangedEventHandler(OnCbbActionTypeSelectedIndexChanged);
            this.senseListCtrl.AddItem(mCbbActionType);
            mCbbActionType.Items.Add(new SensePanelComboItem.Item("Show notification", Task.ActionTypes.NOTIFICATION));
            mCbbActionType.Items.Add(new SensePanelComboItem.Item("Send SMS", Task.ActionTypes.SMS));
            mCbbActionType.Items.Add(new SensePanelComboItem.Item("Launch application", Task.ActionTypes.APP));
            mCbbActionType.LabelText = "Action type:";
            mCbbActionType.SelectedIndex = 0;

            // SMS recipient textbox
            mTboxSMSRecipient = new SensePanelTextboxItem();
            mTboxSMSRecipient = new SensePanelTextboxItem("mTboxSMSRecipient");
            mTboxSMSRecipient.LayoutSytle = SenseTexboxLayoutStyle.Vertical;
            mTboxSMSRecipient.LabelText = "SMS Recipient:";
            mTboxSMSRecipient.Text = "";
            mTboxSMSRecipient.Visible = false;
            this.senseListCtrl.AddItem(mTboxSMSRecipient);

            // SMS body textbox
            mTboxSMSBody = new SensePanelTextboxItem();
            mTboxSMSBody = new SensePanelTextboxItem("mTboxSMSBody");
            mTboxSMSBody.LayoutSytle = SenseTexboxLayoutStyle.Vertical;
            mTboxSMSBody.LabelText = "SMS Text:";
            mTboxSMSBody.Multiline = true;
            mTboxSMSBody.Height = GetLongTextBoxSize();
            mTboxSMSBody.Text = "";
            mTboxSMSBody.Visible = false;
            this.senseListCtrl.AddItem(mTboxSMSBody);

            // Select application button
            mBtnSelectApplication = new SensePanelButtonItem("mBtnSelectApplication");
            mBtnSelectApplication.LabelText = "Application:";
            mBtnSelectApplication.Text = "Select application";
            mBtnSelectApplication.OnClick += new SensePanelButtonItem.ClickEventHandler(OnBtnSelectApplication);
            mBtnSelectApplication.Visible = false;
            this.senseListCtrl.AddItem(mBtnSelectApplication);

            // monitoring period time start
            this.senseListCtrl.AddItem(new SensePanelDividerItem("DividerItemMonitorPeriod", "Monitoring period"));
            mTimeMonitorStart = new SensePanelTimeItem("mTimeMonitorStart");
            mTimeMonitorStart.AutoShowDialog = true;
            mTimeMonitorStart.ButtonAnimation = true;
            mTimeMonitorStart.PrimaryText = "Start monitoring at";
            //			mTimeMonitorStart.SecondaryText = "Style set for auto dialog...";
            mTimeMonitorStart.Time = new Time(DateTime.Now);
            this.senseListCtrl.AddItem(mTimeMonitorStart);

            // monitoring period time end
            mTimeMonitorEnd = new SensePanelTimeItem("mTimeMonitorEnd");
            mTimeMonitorEnd.AutoShowDialog = true;
            mTimeMonitorEnd.ButtonAnimation = true;
            mTimeMonitorEnd.PrimaryText = "End monitoring at";
            mTimeMonitorEnd.Time = new Time(DateTime.Now);
            this.senseListCtrl.AddItem(mTimeMonitorEnd);

            // Notes textbox
            this.senseListCtrl.AddItem(new SensePanelDividerItem("DividerItemTaskNotes", "Notes"));
            mTboxNotes = new SensePanelTextboxItem();
            mTboxNotes = new SensePanelTextboxItem("mTboxNotes");
            mTboxNotes.LayoutSytle = SenseTexboxLayoutStyle.Horizontal;
            mTboxNotes.LabelText = "";
            mTboxNotes.ShowSeparator = false;
            mTboxNotes.Multiline = true;
            mTboxNotes.Height = GetLongTextBoxSize();
            mTboxNotes.Text = "";
            this.senseListCtrl.AddItem(mTboxNotes);

            // we are done so turn on UI updating
            this.senseListCtrl.EndUpdate();

            setupSIP();
        }
Пример #7
0
        private void SetupControls()
        {
            // turn off UI updating
            this.senseListCtrl.BeginUpdate();

            // Subject textbox
            mTboxSubject             = new SensePanelTextboxItem();
            mTboxSubject             = new SensePanelTextboxItem("mTboxSubject");
            mTboxSubject.LayoutSytle = SenseTexboxLayoutStyle.Vertical;
            mTboxSubject.LabelText   = "Subject:";
            mTboxSubject.Text        = "";
            this.senseListCtrl.AddItem(mTboxSubject);

            // location button
            mBtnSetLocation           = new SensePanelButtonItem("mBtnSetLocation");
            mBtnSetLocation.LabelText = "Location:";
            mBtnSetLocation.Text      = "Set Location";
            mBtnSetLocation.OnClick  += new SensePanelButtonItem.ClickEventHandler(OnBtnSetLocation);
            this.senseListCtrl.AddItem(mBtnSetLocation);

            // location label
            mTxtLocation = new SensePanelItem("mTxtLocation");
            mTxtLocation.PrimaryTextAlignment = SenseAPIs.SenseFont.PanelTextAlignment.Top;
            //			mTxtLocation.PrimaryTextLineHeight = SenseAPIs.SenseFont.PanelTextLineHeight.SingleLine;
            mTxtLocation.Visible = false;
            this.senseListCtrl.AddItem(mTxtLocation);

            // Action type combobox
            mCbbActionType = new SensePanelComboItem("mCbbActionType");
            mCbbActionType.OnSelectedIndexChanged += new SensePanelComboItem.SelectedIndexChangedEventHandler(OnCbbActionTypeSelectedIndexChanged);
            this.senseListCtrl.AddItem(mCbbActionType);
            mCbbActionType.Items.Add(new SensePanelComboItem.Item("Show notification", Task.ActionTypes.NOTIFICATION));
            mCbbActionType.Items.Add(new SensePanelComboItem.Item("Send SMS", Task.ActionTypes.SMS));
            mCbbActionType.Items.Add(new SensePanelComboItem.Item("Launch application", Task.ActionTypes.APP));
            mCbbActionType.LabelText     = "Action type:";
            mCbbActionType.SelectedIndex = 0;

            // SMS recipient textbox
            mTboxSMSRecipient             = new SensePanelTextboxItem();
            mTboxSMSRecipient             = new SensePanelTextboxItem("mTboxSMSRecipient");
            mTboxSMSRecipient.LayoutSytle = SenseTexboxLayoutStyle.Vertical;
            mTboxSMSRecipient.LabelText   = "SMS Recipient:";
            mTboxSMSRecipient.Text        = "";
            mTboxSMSRecipient.Visible     = false;
            this.senseListCtrl.AddItem(mTboxSMSRecipient);

            // SMS body textbox
            mTboxSMSBody             = new SensePanelTextboxItem();
            mTboxSMSBody             = new SensePanelTextboxItem("mTboxSMSBody");
            mTboxSMSBody.LayoutSytle = SenseTexboxLayoutStyle.Vertical;
            mTboxSMSBody.LabelText   = "SMS Text:";
            mTboxSMSBody.Multiline   = true;
            mTboxSMSBody.Height      = GetLongTextBoxSize();
            mTboxSMSBody.Text        = "";
            mTboxSMSBody.Visible     = false;
            this.senseListCtrl.AddItem(mTboxSMSBody);

            // Select application button
            mBtnSelectApplication           = new SensePanelButtonItem("mBtnSelectApplication");
            mBtnSelectApplication.LabelText = "Application:";
            mBtnSelectApplication.Text      = "Select application";
            mBtnSelectApplication.OnClick  += new SensePanelButtonItem.ClickEventHandler(OnBtnSelectApplication);
            mBtnSelectApplication.Visible   = false;
            this.senseListCtrl.AddItem(mBtnSelectApplication);


            // monitoring period time start
            this.senseListCtrl.AddItem(new SensePanelDividerItem("DividerItemMonitorPeriod", "Monitoring period"));
            mTimeMonitorStart = new SensePanelTimeItem("mTimeMonitorStart");
            mTimeMonitorStart.AutoShowDialog  = true;
            mTimeMonitorStart.ButtonAnimation = true;
            mTimeMonitorStart.PrimaryText     = "Start monitoring at";
            //			mTimeMonitorStart.SecondaryText = "Style set for auto dialog...";
            mTimeMonitorStart.Time = new Time(DateTime.Now);
            this.senseListCtrl.AddItem(mTimeMonitorStart);

            // monitoring period time end
            mTimeMonitorEnd = new SensePanelTimeItem("mTimeMonitorEnd");
            mTimeMonitorEnd.AutoShowDialog  = true;
            mTimeMonitorEnd.ButtonAnimation = true;
            mTimeMonitorEnd.PrimaryText     = "End monitoring at";
            mTimeMonitorEnd.Time            = new Time(DateTime.Now);
            this.senseListCtrl.AddItem(mTimeMonitorEnd);

            // Notes textbox
            this.senseListCtrl.AddItem(new SensePanelDividerItem("DividerItemTaskNotes", "Notes"));
            mTboxNotes               = new SensePanelTextboxItem();
            mTboxNotes               = new SensePanelTextboxItem("mTboxNotes");
            mTboxNotes.LayoutSytle   = SenseTexboxLayoutStyle.Horizontal;
            mTboxNotes.LabelText     = "";
            mTboxNotes.ShowSeparator = false;
            mTboxNotes.Multiline     = true;
            mTboxNotes.Height        = GetLongTextBoxSize();
            mTboxNotes.Text          = "";
            this.senseListCtrl.AddItem(mTboxNotes);

            // we are done so turn on UI updating
            this.senseListCtrl.EndUpdate();

            setupSIP();
        }
Пример #8
0
        private void InitializeSenseComponents()
        {
            SenseHeaderControl header = new SenseHeaderControl();

            header.Dock = DockStyle.Top;
            header.Text = "LEN Configurator";

            list      = new SenseListControl();
            list.Dock = DockStyle.Fill;

            SensePanelDividerItem divStatus = new SensePanelDividerItem();

            divStatus.Text = "Status";

            itemStatus = new SensePanelColoredLabelItem();
            HandleTimerAppRunningTick(this, EventArgs.Empty);

            SensePanelDividerItem divNotify = new SensePanelDividerItem();

            divNotify.Text = "Notify on...";

            SensePanelOnOffItem itemCalls = new SensePanelOnOffItem();

            itemCalls.PrimaryText      = "Missed calls";
            itemCalls.Status           = ToItemStatus(Settings.Instance.NotifyOnMissedCalls);
            itemCalls.OnStatusChanged += new SensePanelOnOffItem.StatusEventHandler(HandleItemCallsStatusChanged);

            SensePanelOnOffItem itemSms = new SensePanelOnOffItem();

            itemSms.PrimaryText      = "Unread SMS";
            itemSms.Status           = ToItemStatus(Settings.Instance.NotifyOnSms);
            itemSms.OnStatusChanged += new SensePanelOnOffItem.StatusEventHandler(HandleItemSmsStatusChanged);

            SensePanelOnOffItem itemMms = new SensePanelOnOffItem();

            itemMms.PrimaryText      = "Unread MMS";
            itemMms.Status           = ToItemStatus(Settings.Instance.NotifyOnMms);
            itemMms.OnStatusChanged += new SensePanelOnOffItem.StatusEventHandler(HandleItemMmsStatusChanged);

            SensePanelOnOffItem itemEmail = new SensePanelOnOffItem();

            itemEmail.PrimaryText      = "Unread e-mail";
            itemEmail.Status           = ToItemStatus(Settings.Instance.NotifyOnEmail);
            itemEmail.OnStatusChanged += new SensePanelOnOffItem.StatusEventHandler(HandleItemEmailStatusChanged);

            SensePanelOnOffItem itemVmail = new SensePanelOnOffItem();

            itemVmail.PrimaryText      = "Voicemail messages";
            itemVmail.Status           = ToItemStatus(Settings.Instance.NotifyOnVoicemail);
            itemVmail.OnStatusChanged += new SensePanelOnOffItem.StatusEventHandler(HandleItemVmailStatusChanged);

            SensePanelOnOffItem itemReminder = new SensePanelOnOffItem();

            itemReminder.PrimaryText      = "Reminders";
            itemReminder.Status           = ToItemStatus(Settings.Instance.NotifyOnReminders);
            itemReminder.OnStatusChanged += new SensePanelOnOffItem.StatusEventHandler(HandleItemReminderStatusChanged);

            SensePanelDividerItem divBehaviour = new SensePanelDividerItem();

            divBehaviour.Text = "Behaviour options";

            SensePanelOnOffItem itemStopDuringCall = new SensePanelOnOffItem();

            itemStopDuringCall.PrimaryText      = "Stop blinking during call";
            itemStopDuringCall.SecondaryText    = "Continues after call finished";
            itemStopDuringCall.Status           = ToItemStatus(Settings.Instance.DoNotNotifyDuringCall);
            itemStopDuringCall.OnStatusChanged += new SensePanelOnOffItem.StatusEventHandler(HandleItemStopDuringCallStatusChanged);

            SensePanelOnOffItem itemStopAfterUnlock = new SensePanelOnOffItem();

            itemStopAfterUnlock.PrimaryText      = "Stop blinking after unlock";
            itemStopAfterUnlock.SecondaryText    = "Until new notifications are available";
            itemStopAfterUnlock.Status           = ToItemStatus(Settings.Instance.StopBlinkingAfterUnlock);
            itemStopAfterUnlock.OnStatusChanged += new SensePanelOnOffItem.StatusEventHandler(HandleItemStopAfterUnlockStatusChanged);

            // Duration
            int curDuration = Settings.Instance.NotificationTimeoutInSeconds;

            itemDuration               = new SensePanelMoreItem();
            itemDuration.PrimaryText   = "Stop blinking after X seconds";
            itemDuration.SecondaryText = "Currently " + (curDuration > 0 ? "set to " + curDuration + " seconds" : "disabled");

            txtDuration            = new SensePanelTextboxItem();
            txtDuration.LabelText  = "Set a new time? (0 = forever)";
            txtDuration.Text       = curDuration + "";
            txtDuration.GotFocus  += new EventHandler(HandleTextboxGotFocus);
            txtDuration.LostFocus += new EventHandler(HandleTextboxLostFocus);
            itemDuration.Children.Add(txtDuration);

            SensePanelButtonItem btnDuration = new SensePanelButtonItem();

            btnDuration.Text     = "Save";
            btnDuration.OnClick += new SensePanelButtonItem.ClickEventHandler(HandleDurationClick);
            itemDuration.Children.Add(btnDuration);

            // Blinking sequence
            string curSequence = Settings.Instance.BlinkingSequence;

            itemSequence               = new SensePanelMoreItem();
            itemSequence.PrimaryText   = "Set the blinking sequence";
            itemSequence.SecondaryText = "Currently: " + curSequence;

            txtSequence            = new SensePanelTextboxItem();
            txtSequence.LabelText  = "Set new sequence (off-on-off-on-etc...)";
            txtSequence.Text       = curSequence;
            txtSequence.GotFocus  += new EventHandler(HandleTextboxGotFocus);
            txtSequence.LostFocus += new EventHandler(HandleTextboxLostFocus);
            itemSequence.Children.Add(txtSequence);

            SensePanelButtonItem btnSequence = new SensePanelButtonItem();

            btnSequence.Text     = "Save";
            btnSequence.OnClick += new SensePanelButtonItem.ClickEventHandler(HandleSequenceClick);
            itemSequence.Children.Add(btnSequence);

            // Blinking sleep
            int curBlinkSleep = Settings.Instance.SleepTimeBetweenSequencesInMilliseconds;

            itemBlinkSleep               = new SensePanelMoreItem();
            itemBlinkSleep.PrimaryText   = "Time between blinking sequences";
            itemBlinkSleep.SecondaryText = "Currently set to " + curBlinkSleep + " ms";

            txtBlinkSleep            = new SensePanelTextboxItem();
            txtBlinkSleep.LabelText  = "Set new time between blinking sequences (in ms)";
            txtBlinkSleep.Text       = curBlinkSleep + "";
            txtBlinkSleep.GotFocus  += new EventHandler(HandleTextboxGotFocus);
            txtBlinkSleep.LostFocus += new EventHandler(HandleTextboxLostFocus);
            itemBlinkSleep.Children.Add(txtBlinkSleep);

            SensePanelButtonItem btnBlinkSleep = new SensePanelButtonItem();

            btnBlinkSleep.Text     = "Save";
            btnBlinkSleep.OnClick += new SensePanelButtonItem.ClickEventHandler(HandleBlinkSleepClick);
            itemBlinkSleep.Children.Add(btnBlinkSleep);

            list.AddItem(divStatus, true);
            list.AddItem(itemStatus, true);
            list.AddItem(divNotify, true);
            list.AddItem(itemCalls, true);
            list.AddItem(itemSms, true);
            list.AddItem(itemMms, true);
            list.AddItem(itemEmail, true);
            list.AddItem(itemVmail, true);
            list.AddItem(itemReminder, true);
            list.AddItem(divBehaviour, true);
            list.AddItem(itemStopDuringCall, true);
            list.AddItem(itemStopAfterUnlock, true);
            list.AddItem(itemDuration, true);
            list.AddItem(itemSequence, true);
            list.AddItem(itemBlinkSleep, true);

            Controls.Add(list);
            Controls.Add(header);
        }