예제 #1
0
        /// <summary>
        /// Setup a panel with the tabbed view
        /// </summary>
        /// <param name="rpc"></param>

        void SetupTabbedPanel(
            DockPanel dp)
        {
            dp.Options.AllowFloating      = false;
            dp.Options.FloatOnDblClick    = false;
            dp.Options.ShowMaximizeButton = false;
            dp.Options.ShowAutoHideButton = false;
            dp.Options.ShowCloseButton    = false;

            dp.Tabbed = true;             // tabbed view

            ButtonCollection chbs = dp.CustomHeaderButtons;

            chbs.Clear();

            CustomHeaderButton chb = new CustomHeaderButton             // add close button
                                         ("", null, 2, HorizontalImageLocation.Default, ButtonStyle.PushButton, "Close", false, -1, true, null, true, false, true, null, null, "Close", -1);

            chbs.Add(chb);

            chb = new CustomHeaderButton             // add restore button
                      ("", null, 1, HorizontalImageLocation.Default, ButtonStyle.PushButton, "Restore", false, -1, true, null, true, false, true, null, null, "Restore", -1);
            chbs.Add(chb);

            dp.CustomButtonClick += new ButtonEventHandler(TabDockPanel_CustomButtonClick);

            return;
        }
예제 #2
0
        public VCKeyboardViewController(UIViewController parentViewController)
            : base(parentViewController, Digitals.SubPageVCKeyboard, string.Empty, TimeSpan.Zero)
        {
            _closeBtn        = new UIButton(this, Digitals.VCDialKeyboardCloseBtn);
            _shiftBtn        = new UIButton(this, Digitals.VCDialKeyboardShiftBtn);
            _callBtn         = new UIButton(this, Digitals.VCDialKeyboardCallBtn);
            _keyboardButtons = new ButtonCollection();

            var joinOffset = 0U;

            //joins here start at Digitals.VCDialKeyboardCharRangeStart
            for (var c = '0'; c <= '9'; c++)
            {
                _keyboardButtons.Add(c, new UIButton(this, Digitals.VCDialKeyboardCharRangeStart + joinOffset));
                joinOffset++;
            }

            //joins here start at Digitals.VCDialKeyboardCharRangeStart + 10

            for (var c = 'a'; c <= 'z'; c++)
            {
                _keyboardButtons.Add(c, new UIButton(this, Digitals.VCDialKeyboardCharRangeStart + joinOffset));
                joinOffset++;
            }

            //joins here start at Digitals.VCDialKeyboardCharRangeStart + 35

            _keyboardButtons.Add(' ', new UIButton(this, Digitals.VCDialKeyboardCharRangeStart + joinOffset));
            joinOffset++;

            _keyboardButtons.Add('-', new UIButton(this, Digitals.VCDialKeyboardCharRangeStart + joinOffset));
            joinOffset++;

            _keyboardButtons.Add('_', new UIButton(this, Digitals.VCDialKeyboardCharRangeStart + joinOffset));
            joinOffset++;

            _keyboardButtons.Add('@', new UIButton(this, Digitals.VCDialKeyboardCharRangeStart + joinOffset));
            joinOffset++;

            _keyboardButtons.Add('/', new UIButton(this, Digitals.VCDialKeyboardCharRangeStart + joinOffset));
            joinOffset++;

            _keyboardButtons.Add('.', new UIButton(this, Digitals.VCDialKeyboardCharRangeStart + joinOffset));
            joinOffset++;

            _keyboardButtons.Add((char)8, new UIButton(this, Digitals.VCDialKeyboardCharRangeStart + joinOffset)
            {
                HoldTime = TimeSpan.FromSeconds(0.5)
            });

            _keypadView    = new VCKeypadViewController(this);
            _keypadModeBtn = new UIButton(this, Digitals.VCDialKeyboardKeypadToggleBtn);
        }
예제 #3
0
        /// <summary>
        /// SetupDockPanel
        /// </summary>
        /// <param name="dp"></param>
        /// <param name="view"></param>

        void SetupDockPanel(
            DockPanel dp,
            ResultsViewProps view,
            XtraPanel viewPanel)
        {
            dp.Options.AllowFloating      = false;
            dp.Options.FloatOnDblClick    = false;
            dp.Options.ShowMaximizeButton = false;
            dp.Options.ShowAutoHideButton = false;
            dp.Options.ShowCloseButton    = false;

            ButtonCollection chbs = dp.CustomHeaderButtons;

            chbs.Clear();

            CustomHeaderButton chb = new CustomHeaderButton             // add close button
                                         ("", null, 2, HorizontalImageLocation.Default, ButtonStyle.PushButton, "Close", false, -1, true, null, true, false, true, null, null, "Close", -1);

            chbs.Add(chb);

            chb = new CustomHeaderButton             // add maximize button
                      ("", null, 0, HorizontalImageLocation.Default, ButtonStyle.PushButton, "Maximize", false, -1, true, null, true, false, true, null, null, "Maximize", -1);
            chbs.Add(chb);

            dp.CustomButtonClick += new ButtonEventHandler(ViewDockPanel_CustomButtonClick);
            dp.Enter             += new EventHandler(ViewDockPanel_Enter);                // when dock panel is selected
            dp.Leave             += new EventHandler(ViewDockPanel_Leave);                // when dock panel loses focus
            dp.VisibilityChanged += new VisibilityChangedEventHandler(ViewDockPanel_VisibilityChanged);
            dp.ClosedPanel       += new DockPanelEventHandler(ViewDockPanel_ClosedPanel); // when dock panel is closed
            dp.MouseClick        += new MouseEventHandler(ViewDockPanel_Click);

            dp.Tag = view;             // link the dockpanel to the view

            dp.Text = view.Title;      // set the view title

            int vi = view.GetViewIndex();

            if (dp.Text == "")
            {
                dp.Text = "View " + (vi + 1);
            }
            dp.Name = dp.Text;

            dp.ControlContainer.Controls.Add(viewPanel);             // put the view panel in the dock panel

            return;
        }
예제 #4
0
        private void ResetButton_OnClick(object sender, RoutedEventArgs e)
        {
            var customButtonCollection = new ButtonCollection();

            foreach (var sizeOption in FieldViewModel.SizeOptions)
            {
                var optionButton = new Button
                {
                    Content = sizeOption,
                    Width   = 50d,
                    ToolTip = string.Format(Properties.Resources.WinTileToolTip,
                                            Math.Pow(FieldViewModel.StartValue,
                                                     FieldViewModel.WinningPowers[sizeOption - FieldViewModel.SizeOptions[0]]))
                };
                optionButton.Click += OptionButtonOnClick;
                customButtonCollection.Add(optionButton);
            }
            BlurBehindMessageBox.Show(this, Properties.Resources.ResetBody, Properties.Resources.ResetHeader,
                                      customButtonCollection);
        }