public EntryBoxValidationButton(Window pSourceWindow, String pLabelText, KeyboardMode pKeyboardMode, string pRule, bool pRequired, string pIconFile = "")
            : base(pSourceWindow, pLabelText)
        {
            //Settings
            string iconSelectRecord = FrameworkUtils.OSSlash(string.Format("{0}{1}", GlobalFramework.Path["images"], @"Icons/Windows/icon_window_select_record.png"));
            string iconFile         = (pIconFile != string.Empty) ? pIconFile : iconSelectRecord;

            //Init Button
            _button = GetButton(iconFile);

            //EntryValidation
            _entryValidation = new EntryValidation(pSourceWindow, pKeyboardMode, pRule, pRequired)
            {
                Label = _label, LabelText = _label.Text
            };
            _entryValidation.ModifyFont(_fontDescription);
            //Started Validate
            _entryValidation.Validate();

            //Pack Hbox
            _hbox.PackStart(_entryValidation, true, true, 0);
            _hbox.PackStart(_button, false, false, 0);
            //Init Keyboard
            InitKeyboard(_entryValidation);
        }
        public XPOEntryBoxSelectRecordValidation(Window pSourceWindow, string pLabelText, string pFieldDisplayValue, string pFieldValidateValue, T1 pCurrentValue, CriteriaOperator pCriteriaOperator, KeyboardMode pKeyboardMode, string pRule, bool pRequired)
            : base(pSourceWindow, pLabelText, pFieldDisplayValue, pFieldValidateValue, pCurrentValue, pCriteriaOperator)
        {
            //Entry: Required to Assign BaseClass _label Reference to EntryValidation.Label :)
            _entryValidation = new EntryValidation(pSourceWindow, pKeyboardMode, pRule, pRequired)
            {
                Label = _label
            };

            //Start Validated
            _entryValidation.Validate(GetValue(pFieldValidateValue));

            //Always validate when we Change Values
            _entryValidation.Changed += delegate
            {
                _entryValidation.Validate(GetValue(pFieldValidateValue));
            };

            InitEntry(_entryValidation);
            //Init Keyboard
            InitKeyboard(_entryValidation);
        }
Example #3
0
        public EntryBoxValidation(Window pSourceWindow, String pLabelText, KeyboardMode pKeyboardMode, string pRule, bool pRequired)
            : base(pSourceWindow, pLabelText)
        {
            //EntryValidation
            _entryValidation = new EntryValidation(pSourceWindow, pKeyboardMode, pRule, pRequired)
            {
                Label = _label, LabelText = _label.Text
            };
            _entryValidation.ModifyFont(_fontDescription);
            //Started Validate
            _entryValidation.Validate();

            //Pack
            _hbox.PackStart(_entryValidation, true, true, 0);
            //Init Keyboard
            InitKeyboard(_entryValidation);
        }
Example #4
0
        public NumberPadPin(Window pSourceWindow, string pName, Color pButtonColor, string pFont, string pFontLabelStatus, Color pFontColor, Color pFontColorLabelStatus, byte pButtonWidth, byte pButtonHeight, bool pShowSystemButtons = false, bool pVisibleWindow = false, uint pRowSpacingLabelStatus = 20, uint pRowSpacingSystemButtons = 40, byte pPadding = 3)
        {
            _sourceWindow = pSourceWindow;
            this.Name     = pName;

            //Show or Hide System Buttons (Startup Visible, Pos Change User Invisible)
            uint tableRows = (pShowSystemButtons) ? (uint)5 : (uint)3;

            _eventbox = new EventBox()
            {
                VisibleWindow = pVisibleWindow
            };

            _table             = new Table(tableRows, 3, true);
            _table.Homogeneous = false;

            //Pin Entry
            _entryPin = new EntryValidation(pSourceWindow, KeyboardMode.None, SettingsApp.RegexLoginPin, true)
            {
                InvisibleChar = '*', Visibility = false
            };
            _entryPin.ModifyFont(Pango.FontDescription.FromString(pFont));
            _entryPin.Alignment = 0.5F;

            //ResetPassword
            string numberPadPinButtonPasswordResetImageFileName = FrameworkUtils.OSSlash(GlobalFramework.Path["images"] + @"Icons\Other\pinpad_password_reset.png");

            _buttonKeyResetPassword = new TouchButtonIcon("touchButtonKeyPasswordReset", System.Drawing.Color.Transparent, numberPadPinButtonPasswordResetImageFileName, new Size(20, 20), 25, 25)
            {
                Sensitive = false
            };

            //Start Validated
            _entryPin.Validate();
            //Event
            _entryPin.Changed         += _entryPin_Changed;
            _entryPin.KeyReleaseEvent += _entryPin_KeyReleaseEvent;

            //Label Status
            _labelStatus = new Label(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "pos_pinpad_message_type_password"));
            _labelStatus.ModifyFont(Pango.FontDescription.FromString(pFontLabelStatus));
            _labelStatus.ModifyFg(StateType.Normal, Utils.ColorToGdkColor(pFontColorLabelStatus));
            _labelStatus.SetAlignment(0.5F, 0.5f);

            //Initialize Buttons
            TouchButtonText buttonKey1  = new TouchButtonText("touchButtonKey1", pButtonColor, "1", pFont, pFontColor, pButtonWidth, pButtonHeight);
            TouchButtonText buttonKey2  = new TouchButtonText("touchButtonKey2", pButtonColor, "2", pFont, pFontColor, pButtonWidth, pButtonHeight);
            TouchButtonText buttonKey3  = new TouchButtonText("touchButtonKey3", pButtonColor, "3", pFont, pFontColor, pButtonWidth, pButtonHeight);
            TouchButtonText buttonKey4  = new TouchButtonText("touchButtonKey4", pButtonColor, "4", pFont, pFontColor, pButtonWidth, pButtonHeight);
            TouchButtonText buttonKey5  = new TouchButtonText("touchButtonKey5", pButtonColor, "5", pFont, pFontColor, pButtonWidth, pButtonHeight);
            TouchButtonText buttonKey6  = new TouchButtonText("touchButtonKey6", pButtonColor, "6", pFont, pFontColor, pButtonWidth, pButtonHeight);
            TouchButtonText buttonKey7  = new TouchButtonText("touchButtonKey7", pButtonColor, "7", pFont, pFontColor, pButtonWidth, pButtonHeight);
            TouchButtonText buttonKey8  = new TouchButtonText("touchButtonKey8", pButtonColor, "8", pFont, pFontColor, pButtonWidth, pButtonHeight);
            TouchButtonText buttonKey9  = new TouchButtonText("touchButtonKey9", pButtonColor, "9", pFont, pFontColor, pButtonWidth, pButtonHeight);
            TouchButtonText buttonKey0  = new TouchButtonText("touchButtonKey0", pButtonColor, "0", pFont, pFontColor, pButtonWidth, pButtonHeight);
            TouchButtonText buttonKeyCE = new TouchButtonText("touchButtonKeyCE_Red", pButtonColor, "CE", pFont, pFontColor, pButtonWidth, pButtonHeight);

            //Shared Button,can be OK or Quit based on ShowSystemButtons
            TouchButtonText _buttonQuitOrOk;

            //Outside Reference Buttons (Public)
            _buttonKeyOK = new TouchButtonText("touchButtonKeyOK_Green", pButtonColor, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "widget_pospinpad_ok"), pFont, pFontColor, pButtonWidth, pButtonHeight)
            {
                Sensitive = false
            };
            //_buttonKeyResetPassword = new TouchButtonText("touchButtonKeyReset_Red", pButtonColor, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "widget_pospinpad_change_password, pFont, pFontColor, pButtonWidth, pButtonHeight) { Sensitive = false };

            if (pShowSystemButtons)
            {
                _buttonKeyFrontOffice = new TouchButtonText("touchButtonKeyFrontOffice_DarkGrey", pButtonColor, "FO", pFont, pFontColor, pButtonWidth, pButtonHeight)
                {
                    Sensitive = false, Visible = false
                };
                _buttonKeyQuit       = new TouchButtonText("touchButtonKeyQuit_DarkGrey", pButtonColor, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_quit_title"), pFont, pFontColor, pButtonWidth, pButtonHeight);
                _buttonKeyBackOffice = new TouchButtonText("touchButtonKeyBackOffice_DarkGrey", pButtonColor, "BO", pFont, pFontColor, pButtonWidth, pButtonHeight)
                {
                    Sensitive = false, Visible = false
                };
                _buttonQuitOrOk = _buttonKeyQuit;
            }
            else
            {
                _buttonQuitOrOk = _buttonKeyOK;
            }

            //_buttonKeyOK.Style.SetBgPixmap(StateType.Active, Utils.FileToPixmap("Assets/Themes/Default/Backgrounds/Windows/test.png"));
            //_buttonKeyOK.Style = Utils.GetThemeStyleBackground(@"Backgrounds/Windows/test.png");

            //Events
            buttonKey1.Clicked  += buttonKey_Clicked;
            buttonKey2.Clicked  += buttonKey_Clicked;
            buttonKey3.Clicked  += buttonKey_Clicked;
            buttonKey4.Clicked  += buttonKey_Clicked;
            buttonKey5.Clicked  += buttonKey_Clicked;
            buttonKey6.Clicked  += buttonKey_Clicked;
            buttonKey7.Clicked  += buttonKey_Clicked;
            buttonKey8.Clicked  += buttonKey_Clicked;
            buttonKey9.Clicked  += buttonKey_Clicked;
            buttonKey0.Clicked  += buttonKey_Clicked;
            buttonKeyCE.Clicked += buttonKeyCE_Clicked;

            //Prepare Table

            //row0
            int entryPinTablePos = (pShowSystemButtons) ? 2 : 3;

            //Without ResetPassword Button
            if (!pShowSystemButtons)
            {
                _table.Attach(_entryPin, 0, 3, 0, 1, AttachOptions.Fill, AttachOptions.Fill, pPadding, pPadding);
            }
            //With ResetPassword Button
            else
            {
                _table.Attach(_entryPin, 0, 2, 0, 1, AttachOptions.Fill, AttachOptions.Fill, pPadding, pPadding);
                _table.Attach(_buttonKeyResetPassword, 2, 3, 0, 1, AttachOptions.Fill, AttachOptions.Fill, pPadding, pPadding);
            }
            //row1
            _table.Attach(buttonKey7, 0, 1, 1, 2, AttachOptions.Fill, AttachOptions.Fill, pPadding, pPadding);
            _table.Attach(buttonKey8, 1, 2, 1, 2, AttachOptions.Fill, AttachOptions.Fill, pPadding, pPadding);
            _table.Attach(buttonKey9, 2, 3, 1, 2, AttachOptions.Fill, AttachOptions.Fill, pPadding, pPadding);
            //row2
            _table.Attach(buttonKey4, 0, 1, 2, 3, AttachOptions.Fill, AttachOptions.Fill, pPadding, pPadding);
            _table.Attach(buttonKey5, 1, 2, 2, 3, AttachOptions.Fill, AttachOptions.Fill, pPadding, pPadding);
            _table.Attach(buttonKey6, 2, 3, 2, 3, AttachOptions.Fill, AttachOptions.Fill, pPadding, pPadding);
            //row3
            _table.Attach(buttonKey1, 0, 1, 3, 4, AttachOptions.Fill, AttachOptions.Fill, pPadding, pPadding);
            _table.Attach(buttonKey2, 1, 2, 3, 4, AttachOptions.Fill, AttachOptions.Fill, pPadding, pPadding);
            _table.Attach(buttonKey3, 2, 3, 3, 4, AttachOptions.Fill, AttachOptions.Fill, pPadding, pPadding);
            //row4
            _table.Attach(buttonKeyCE, 0, 1, 4, 5, AttachOptions.Fill, AttachOptions.Fill, pPadding, pPadding);
            _table.Attach(buttonKey0, 1, 2, 4, 5, AttachOptions.Fill, AttachOptions.Fill, pPadding, pPadding);
            _table.Attach(_buttonQuitOrOk, 2, 3, 4, 5, AttachOptions.Fill, AttachOptions.Fill, pPadding, pPadding);
            //Row5
            _table.Attach(_labelStatus, 0, 3, 5, 6, AttachOptions.Fill, AttachOptions.Fill, pPadding, pPadding);
            _table.SetRowSpacing(4, pRowSpacingLabelStatus);
            //row6
            if (pShowSystemButtons)
            {
                //_table.Attach(_buttonKeyFrontOffice, 0, 1, 5, 6, AttachOptions.Fill, AttachOptions.Fill, pPadding, pPadding);
                //_table.Attach(_buttonKeyOK, 0, 3, 7, 8, AttachOptions.Fill, AttachOptions.Fill, pPadding, pPadding);
                //_table.Attach(_buttonKeyBackOffice, 2, 3, 5, 6, AttachOptions.Fill, AttachOptions.Fill, pPadding, pPadding);
                _table.Attach(_buttonKeyOK, 0, 3, 7, 8, AttachOptions.Fill, AttachOptions.Fill, pPadding, pPadding);
                //space between Status Message and POS Keys
                _table.SetRowSpacing(5, pRowSpacingSystemButtons);
            }

            _eventbox.Add(_table);
            this.Add(_eventbox);
        }