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);
        }
Example #2
0
        protected void InitEntry(Entry pEntry)
        {
            //params
            _entry = pEntry;
            //Settings
            String iconSelectRecord = FrameworkUtils.OSSlash(string.Format("{0}{1}", GlobalFramework.Path["images"], @"Icons/Windows/icon_window_select_record.png"));

            //Init Button
            _buttonSelectValue = new TouchButtonIcon("touchButtonIcon", Color.Transparent, iconSelectRecord, new Size(20, 20), 30, 30);
            //UI/Pack
            //Assign Initial Value
            if (_value != null && _value.GetMemberValue(_fieldDisplayValue) != null)
            {
                try
                {
                    _entry.Text = (String)Convert.ChangeType(_value.GetMemberValue(_fieldDisplayValue), typeof(String));
                }
                catch (Exception ex)
                {
                    _log.Error(ex.Message, ex);
                    _entry.Text = string.Empty;
                }
            }
            _entry.ModifyFont(_fontDescription);
            _hbox.PackStart(_entry, true, true, 0);
            _hbox.PackStart(_buttonSelectValue, false, false, 0);
            //Events
            _buttonSelectValue.Clicked += delegate { PopupDialog(_entry); };
            //_entry.FocusGrabbed += delegate { PopupDialog(_entry); };
        }
        void Button_Clicked(object sender, EventArgs e)
        {
            TouchButtonIcon          button = (TouchButtonIcon)sender;
            EntryBoxValidationButton entryBoxValidationButton = (button.Parent.Parent.Parent as EntryBoxValidationButton);

            try
            {
                FileFilter fileFilter = Utils.GetFileFilterImages();

                //Get Current FileList Index Position
                int currentFileListIndexPosition = -1;
                for (int i = 0; i < (button.Parent.Parent.Parent.Parent as VBox).Children.Length; i++)
                {
                    EntryBoxValidationButton curentrEntryBox = ((button.Parent.Parent.Parent.Parent as VBox).Children.GetValue(i) as EntryBoxValidationButton);
                    if (curentrEntryBox == entryBoxValidationButton)
                    {
                        currentFileListIndexPosition = i;
                        if (_debug)
                        {
                            _log.Debug(string.Format("Current file List Index [{0}]: [{1}]", currentFileListIndexPosition, _fileList[currentFileListIndexPosition]));
                        }
                    }
                }

                PosFilePickerDialog dialog   = new PosFilePickerDialog(_sourceWindow, DialogFlags.DestroyWithParent, fileFilter, FileChooserAction.Open);
                ResponseType        response = (ResponseType)dialog.Run();
                if (response == ResponseType.Ok)
                {
                    if (entryBoxValidationButton.EntryValidation.Text == dialog.FilePicker.Filename)
                    {
                        //Do Nothing
                    }
                    else if (_fileList.Contains(dialog.FilePicker.Filename))
                    {
                        Utils.ShowMessageTouch(null, DialogFlags.Modal, MessageType.Error, ButtonsType.Ok, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_error"), resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "dialog_message_filepicker_existing_file_error"));
                    }
                    else
                    {
                        //Update fileList with Changed Value
                        _fileList[currentFileListIndexPosition] = dialog.FilePicker.Filename;
                        //Update and Validate Entry
                        entryBoxValidationButton.EntryValidation.Text = dialog.FilePicker.Filename;
                        entryBoxValidationButton.EntryValidation.Validate();

                        //Trigger Event
                        OnChange();

                        if (_debug)
                        {
                            ListValue();
                        }
                    }
                }
                dialog.Destroy();
            }
            catch (Exception ex)
            {
                _log.Error(ex.Message, ex);
            }
        }
        //if AddFileNameToList true, add the File to the list, else skip add, usefull when we Initialize List from Constructor pInitialFileList
        private void AddFileEntry(string pFileName, bool pAddFileNameToList)
        {
            EntryBoxValidationButton entryBoxValidationButton = new EntryBoxValidationButton(_sourceWindow, string.Format(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_file_image"), _fileList.Count + 1), KeyboardMode.None, SettingsApp.RegexAlfaNumericFilePath, true);

            entryBoxValidationButton.EntryValidation.Validate();
            entryBoxValidationButton.EntryValidation.Sensitive = false;

            //Add Aditional Button to EntryBoxValidationFilePickerDialog
            string          iconFileNameDelete = FrameworkUtils.OSSlash(string.Format("{0}{1}", GlobalFramework.Path["images"], @"Icons/Windows/icon_window_delete_record.png"));
            TouchButtonIcon buttonDelete       = new TouchButtonIcon("touchButtonIcon_Delete", Color.Transparent, iconFileNameDelete, new Size(20, 20), 30, 30);

            entryBoxValidationButton.Hbox.PackStart(buttonDelete, false, false, 0);

            //Events
            entryBoxValidationButton.Button.Clicked += Button_Clicked;
            buttonDelete.Clicked += buttonDelete_Clicked;

            //Assign Initial FileName
            entryBoxValidationButton.EntryValidation.Text = pFileName;

            //Pack
            _vbox.PackStart(entryBoxValidationButton, false, false, 0);
            entryBoxValidationButton.ShowAll();
            if (pAddFileNameToList)
            {
                _fileList.Add(_entryBoxAddFile.Value);
            }
        }
Example #5
0
        protected void InitEntry(Entry pEntry)
        {
            //params
            _entry = pEntry;
            ListStore store = null;
            //Settings
            String iconSelectRecord = FrameworkUtils.OSSlash(string.Format("{0}{1}", GlobalFramework.Path["images"], @"Icons/Windows/icon_window_select_record.png"));

            //Init Button
            _buttonSelectValue = new TouchButtonIcon("touchButtonIcon", Color.Transparent, iconSelectRecord, new Size(20, 20), 30, 30);
            //UI/Pack
            //Assign Initial Value
            if (_value != null && _value.GetMemberValue(_fieldDisplayValue) != null)
            {
                try
                {
                    _entry.Text = (String)Convert.ChangeType(_value.GetMemberValue(_fieldDisplayValue), typeof(String));
                }
                catch (Exception ex)
                {
                    _log.Error(ex.Message, ex);
                    _entry.Text = string.Empty;
                }
            }
            //TK016251 - FrontOffice - Criar novo documento com auto-complete para artigos e clientes
            //Se for código de artigo, lista os códigos, por defeito é a designação
            if (_fieldDisplayValue == "Code")
            {
                _articleCode = true;
            }
            else
            {
                _articleCode = false;
            }

            //Preenche o dropdown de auto-complete
            store = fillDropDowntext(_value);

            _entry.Completion                  = new EntryCompletion();
            _entry.Completion.Model            = store;
            _entry.Completion.TextColumn       = 0;
            _entry.Completion.PopupCompletion  = true;
            _entry.Completion.InlineCompletion = false;
            _entry.Completion.PopupSingleMatch = true;
            _entry.Completion.InlineSelection  = false;


            _entry.ModifyFont(_fontDescription);
            _hbox.PackStart(_entry, true, true, 0);
            _hbox.PackStart(_buttonSelectValue, false, false, 0);
            //Events
            _buttonSelectValue.Clicked += delegate { PopupDialog(_entry); };

            _entry.Changed += delegate
            {
                SelectRecordDropDown(_entry);
            };

            //_entry.FocusGrabbed += delegate { PopupDialog(_entry); };
        }
Example #6
0
        public TouchButtonIcon AddButton(string pObjectName, string pFileNameIcon)
        {
            string          icon   = FrameworkUtils.OSSlash(string.Format("{0}{1}", GlobalFramework.Path["images"], pFileNameIcon));
            TouchButtonIcon result = GetButton(pObjectName, icon);

            _hbox.PackStart(result, false, false, 0);
            return(result);
        }
Example #7
0
        private void BuildPlace()
        {
            //Colors
            //Color colorPosButtonFamilyBackground = FrameworkUtils.StringToColor(GlobalFramework.Settings["colorPosButtonFamilyBackground"]);

            //Scrollers
            TouchButtonIcon buttonPosScrollersPlacePrev = new TouchButtonIcon("buttonPosScrollersTablePrev", Color.White, _fileScrollLeftImage, _sizeIconScrollLeftRight, _sizePosSmallButtonScroller.Width, _sizePosSmallButtonScroller.Height);
            TouchButtonIcon buttonPosScrollersPlaceNext = new TouchButtonIcon("buttonPosScrollersTableNext", Color.White, _fileScrollRightImage, _sizeIconScrollLeftRight, _sizePosSmallButtonScroller.Width, _sizePosSmallButtonScroller.Height);

            buttonPosScrollersPlacePrev.Relief      = ReliefStyle.None;
            buttonPosScrollersPlaceNext.Relief      = ReliefStyle.None;
            buttonPosScrollersPlacePrev.BorderWidth = 0;
            buttonPosScrollersPlaceNext.BorderWidth = 0;
            buttonPosScrollersPlacePrev.CanFocus    = false;
            buttonPosScrollersPlaceNext.CanFocus    = false;
            HBox hboxPlaceScrollers = new HBox(true, 0);

            hboxPlaceScrollers.PackStart(buttonPosScrollersPlacePrev);
            hboxPlaceScrollers.PackStart(buttonPosScrollersPlaceNext);

            //TablePad Places
            //TODO:THEME
            //TableConfig tableConfig = new TableConfig(6, 1);
            TableConfig tableConfig = new TableConfig(5, 1);

            _tablePadPlace = new TablePad(
                _sqlPlaceBaseOrder,
                "ORDER BY Ord",
                "",
                Guid.Empty,
                true,
                tableConfig.Rows,
                tableConfig.Columns,
                "buttonPlaceId",
                Color.Transparent,
                _sizePosTableButton.Width,
                _sizePosTableButton.Height,
                buttonPosScrollersPlacePrev,
                buttonPosScrollersPlaceNext
                );
            //Click Event
            _tablePadPlace.Clicked += tablePadPlace_Clicked;

            _fixedContent.Put(_tablePadPlace, 0, 0);
            //TODO:THEME
            //_fixedContent.Put(hboxPlaceScrollers, 0, 493);
            _fixedContent.Put(hboxPlaceScrollers, 0, 493 - _sizePosTableButton.Height);
        }
Example #8
0
        void Button_Clicked(object sender, EventArgs e)
        {
            TouchButtonIcon          button = (TouchButtonIcon)sender;
            EntryBoxValidationButton entryBoxValidationButton = (button.Parent.Parent.Parent as EntryBoxValidationButton);

            _vbox.Remove(entryBoxValidationButton);
            _datesList.Remove(Convert.ToDateTime(entryBoxValidationButton.EntryValidation.Text));

            //Trigger Event
            OnChange();

            if (_debug)
            {
                ListValue();
            }
        }
        void buttonDelete_Clicked(object sender, EventArgs e)
        {
            TouchButtonIcon          button = (TouchButtonIcon)sender;
            EntryBoxValidationButton entryBoxValidationButton = (button.Parent.Parent.Parent as EntryBoxValidationButton);

            _vbox.Remove(entryBoxValidationButton);
            _fileList.Remove(entryBoxValidationButton.EntryValidation.Text);

            //Trigger Event
            OnChange();

            if (_debug)
            {
                ListValue();
            }
        }
Example #10
0
        //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
        //Keyboard

        public void InitKeyboard(object pBoxObject)
        {
            KeyboardMode keyboardMode = KeyboardMode.None;

            if (pBoxObject.GetType() == typeof(EntryValidation))
            {
                keyboardMode = (pBoxObject as EntryValidation).KeyboardMode;
            }
            else if (pBoxObject.GetType() == typeof(EntryMultiline))
            {
                keyboardMode = (pBoxObject as EntryMultiline).KeyboardMode;
            }

            //Prepare KeyBoard
            if (keyboardMode != KeyboardMode.None)
            {
                string iconKeyboard = FrameworkUtils.OSSlash(string.Format("{0}{1}", GlobalFramework.Path["images"], @"Icons/Windows/icon_window_keyboard.png"));
                _buttonKeyBoard = GetButton(iconKeyboard);
                _hbox.PackStart(_buttonKeyBoard, false, false, 0);
                _buttonKeyBoard.Clicked += delegate
                {
                    CallKeyboard(pBoxObject);
                };
                //Required to assign true, used only with custom buttons, when we inited widget without Keyboard, and Init it after, first time is assigned false
                if (pBoxObject.GetType() == typeof(EntryValidation))
                {
                    (pBoxObject as EntryValidation).IsEditable = true;
                }
                else if (pBoxObject.GetType() == typeof(EntryMultiline))
                {
                    (pBoxObject as EntryMultiline).TextView.Editable = true;
                }
            }
            //Make input Text ReadOnly
            else
            {
                if (pBoxObject.GetType() == typeof(EntryValidation))
                {
                    (pBoxObject as EntryValidation).IsEditable = false;
                }
                else if (pBoxObject.GetType() == typeof(EntryMultiline))
                {
                    (pBoxObject as EntryMultiline).TextView.Editable = false;
                }
            }
        }
Example #11
0
        private void InitTablePadUsers()
        {
            //Colors
            //Color colorPosButtonArticleBackground = FrameworkUtils.StringToColor(GlobalFramework.Settings["colorPosButtonArticleBackground"]);

            //Scrollers
            TouchButtonIcon buttonPosScrollersPlacePrev = new TouchButtonIcon("buttonPosScrollersTablePrev", Color.White, _fileScrollLeftImage, _sizeIconScrollLeftRight, _sizePosSmallButtonScroller.Width, _sizePosSmallButtonScroller.Height);
            TouchButtonIcon buttonPosScrollersPlaceNext = new TouchButtonIcon("buttonPosScrollersTableNext", Color.White, _fileScrollRightImage, _sizeIconScrollLeftRight, _sizePosSmallButtonScroller.Width, _sizePosSmallButtonScroller.Height);

            buttonPosScrollersPlacePrev.Relief      = ReliefStyle.None;
            buttonPosScrollersPlaceNext.Relief      = ReliefStyle.None;
            buttonPosScrollersPlacePrev.BorderWidth = 0;
            buttonPosScrollersPlaceNext.BorderWidth = 0;
            buttonPosScrollersPlacePrev.CanFocus    = false;
            buttonPosScrollersPlaceNext.CanFocus    = false;
            HBox hboxPlaceScrollers = new HBox(true, 0);

            hboxPlaceScrollers.PackStart(buttonPosScrollersPlacePrev);
            hboxPlaceScrollers.PackStart(buttonPosScrollersPlaceNext);

            //TablePad Places
            String sqlUsers = @"SELECT Oid as id, Name as name, NULL as label, NULL as image FROM sys_userdetail WHERE (Disabled IS NULL or Disabled  <> 1)";

            _tablePadUsers = new TablePadUser(
                sqlUsers,
                "ORDER BY Ord",
                "",
                GlobalFramework.LoggedUser.Oid,
                true,
                5,
                4,
                "buttonUserId",
                Color.Transparent,
                _sizePosUserButton.Width,
                _sizePosUserButton.Height,
                buttonPosScrollersPlacePrev,
                buttonPosScrollersPlaceNext
                );
            //Click Event
            _tablePadUsers.Clicked += _tablePadUsers_Clicked;
            //Pack It
            _fixedContent.Put(_tablePadUsers, 0, 0);
            _fixedContent.Put(hboxPlaceScrollers, 0, 411);
        }
Example #12
0
        private void BuildTable()
        {
            //Colors
            //Color colorPosButtonArticleBackground = FrameworkUtils.StringToColor(GlobalFramework.Settings["colorPosButtonArticleBackground"]);

            //Scrollers
            TouchButtonIcon buttonPosScrollersTablePrev = new TouchButtonIcon("buttonPosScrollersTablePrev", Color.White, _fileScrollLeftImage, _sizeIconScrollLeftRight, _sizePosSmallButtonScroller.Width, _sizePosSmallButtonScroller.Height);
            TouchButtonIcon buttonPosScrollersTableNext = new TouchButtonIcon("buttonPosScrollersTableNext", Color.White, _fileScrollRightImage, _sizeIconScrollLeftRight, _sizePosSmallButtonScroller.Width, _sizePosSmallButtonScroller.Height);

            buttonPosScrollersTablePrev.Relief      = ReliefStyle.None;
            buttonPosScrollersTableNext.Relief      = ReliefStyle.None;
            buttonPosScrollersTablePrev.BorderWidth = 0;
            buttonPosScrollersTableNext.BorderWidth = 0;
            buttonPosScrollersTablePrev.CanFocus    = false;
            buttonPosScrollersTableNext.CanFocus    = false;

            _hboxTableScrollers = new HBox(true, 0);
            _hboxTableScrollers.PackStart(buttonPosScrollersTablePrev, false, false, 0);
            _hboxTableScrollers.PackStart(buttonPosScrollersTableNext, false, false, 0);

            //TablePad Tables
            String sql    = @"SELECT Oid as id, Designation as name, NULL as label, NULL as image, TableStatus as status, TotalOpen as total, DateTableOpen as dateopen, DateTableClosed as dateclosed FROM pos_configurationplacetable WHERE (Disabled IS NULL or Disabled  <> 1)";
            String filter = string.Format("AND (Place = '{0}')", _tablePadPlace.SelectedButtonOid);

            //if in FilterMode (Change Table) OnlyFreeTables add TableStatus Filter
            if (_FilterMode == TableFilterMode.OnlyFreeTables)
            {
                filter = string.Format("{0} AND (TableStatus = {1}  OR TableStatus IS NULL)", filter, (int)TableStatus.Free);
            }

            //Prepare current table
            Guid currentTableOid = Guid.Empty;

            if (GlobalFramework.SessionApp.OrdersMain.ContainsKey(GlobalFramework.SessionApp.CurrentOrderMainOid) &&
                GlobalFramework.SessionApp.OrdersMain[GlobalFramework.SessionApp.CurrentOrderMainOid].Table != null)
            {
                currentTableOid = GlobalFramework.SessionApp.OrdersMain[GlobalFramework.SessionApp.CurrentOrderMainOid].Table.Oid;
            }

            //Initialize TablePad
            TableConfig tableConfig = new TableConfig(5, 4);

            _tablePadTable = new TablePadTable(
                sql,
                "ORDER BY Ord",
                filter,
                currentTableOid,
                true,
                tableConfig.Rows,
                tableConfig.Columns,
                "buttonTableId",
                Color.Transparent,
                _sizePosTableButton.Width,
                _sizePosTableButton.Height,
                buttonPosScrollersTablePrev,
                buttonPosScrollersTableNext
                );

            //Always Assign SelectedButton Reference to Dialog Reference, Prevent OK Withou Select Table (Toggle Mode)
            _currentTableButtonOid = _tablePadTable.SelectedButtonOid;

            //Events
            _tablePadTable.Clicked += tablePadTable_Clicked;

            _fixedContent.Put(_tablePadTable, 143, 0);
            //TODO:THEME
            //_fixedContent.Put(_hboxTableScrollers, 690, 493);
            _fixedContent.Put(_hboxTableScrollers, 690 - _sizePosTableButton.Width, 493 - _sizePosTableButton.Height);
        }
Example #13
0
        private void BuildOrders()
        {
            //Colors
            //Color colorPosButtonArticleBackground = FrameworkUtils.StringToColor(GlobalFramework.Settings["colorPosButtonArticleBackground"]);

            //Scrollers
            TouchButtonIcon buttonPosScrollersOrderPrev = new TouchButtonIcon("buttonPosScrollersOrderPrev", Color.White, _fileScrollLeftImage, _sizeIconScrollLeftRight, _sizePosSmallButtonScroller.Width, _sizePosSmallButtonScroller.Height);
            TouchButtonIcon buttonPosScrollersOrderNext = new TouchButtonIcon("buttonPosScrollersOrderNext", Color.White, _fileScrollRightImage, _sizeIconScrollLeftRight, _sizePosSmallButtonScroller.Width, _sizePosSmallButtonScroller.Height);

            buttonPosScrollersOrderPrev.Relief      = ReliefStyle.None;
            buttonPosScrollersOrderNext.Relief      = ReliefStyle.None;
            buttonPosScrollersOrderPrev.BorderWidth = 0;
            buttonPosScrollersOrderNext.BorderWidth = 0;
            buttonPosScrollersOrderPrev.CanFocus    = false;
            buttonPosScrollersOrderNext.CanFocus    = false;

            _hboxOrderScrollers = new HBox(true, 0);
            _hboxOrderScrollers.PackStart(buttonPosScrollersOrderPrev, false, false, 0);
            _hboxOrderScrollers.PackStart(buttonPosScrollersOrderNext, false, false, 0);

            //TablePad Tables
            //String sql = string.Format(@"SELECT om.Oid as id, concat(om.Oid, ':', om.OrderStatus, ':',Place) as name, NULL as label, NULL as image
            String sql = string.Format(@"
                SELECT 
                    om.Oid as id, Designation as name, NULL as label, NULL as image, TableStatus as status, TotalOpen as total, DateTableOpen as dateopen, DateTableClosed as dateclosed 
                FROM 
                    fin_documentordermain as om
                LEFT JOIN 
                    pos_configurationplacetable as pt ON om.PlaceTable = pt.Oid
                WHERE 
                    (om.OrderStatus = {0})"
                                       , (int)OrderStatus.Open)
            ;
            String filter = string.Format("AND (Place = '{0}')", _tablePadPlace.SelectedButtonOid);

            //TODO:THEME
            //TableConfig tableConfig = new TableConfig(6, 5);
            TableConfig tableConfig = new TableConfig(5, 4);

            _tablePadOrder = new TablePadTable(
                sql,
                "ORDER BY Ord",
                filter,
                Guid.Empty,
                true,
                tableConfig.Rows,
                tableConfig.Columns,
                "buttonOrderId",
                Color.Transparent,
                _sizePosTableButton.Width,
                _sizePosTableButton.Height,
                buttonPosScrollersOrderPrev,
                buttonPosScrollersOrderNext
                );

            //Events
            _tablePadOrder.Clicked += _tablePadOrder_Clicked;

            _fixedContent.Put(_tablePadOrder, 143, 0);
            //TODO:THEME
            //_fixedContent.Put(_hboxOrderScrollers, 690, 493);
            _fixedContent.Put(_hboxOrderScrollers, 690, 493 - _sizePosTableButton.Height);
        }
        private void InitUI1()
        {
            //EntryBoxValidation with KeyBoard Input
            EntryBoxValidation entryBoxValidation = new EntryBoxValidation(this, "EntryBoxValidation", KeyboardMode.Alfa, SettingsApp.RegexAlfaNumericExtended, true);

            entryBoxValidation.EntryValidation.Sensitive = false;
            entryBoxValidation.ButtonKeyBoard.Sensitive  = false;
            _vbox.PackStart(entryBoxValidation, true, true, _padding);

            //EntryBoxValidation with KeyBoard Input and Custom Buttons : Start without KeyBoard, and KeyBoard Button After all Others
            _entryBoxValidationCustomButton1 = new EntryBoxValidation(this, "EntryBoxValidationCustomButton", KeyboardMode.None, SettingsApp.RegexAlfaNumericExtended, false);
            TouchButtonIcon customButton1 = _entryBoxValidationCustomButton1.AddButton("CustomButton1", @"Icons/Windows/icon_window_orders.png");
            TouchButtonIcon customButton2 = _entryBoxValidationCustomButton1.AddButton("CustomButton2", @"Icons/Windows/icon_window_pay_invoice.png");
            TouchButtonIcon customButton3 = _entryBoxValidationCustomButton1.AddButton("CustomButton3", @"Icons/Windows/icon_window_orders.png");

            //Now we manually Init Keyboard
            _entryBoxValidationCustomButton1.EntryValidation.KeyboardMode = KeyboardMode.AlfaNumeric;
            _entryBoxValidationCustomButton1.InitKeyboard(_entryBoxValidationCustomButton1.EntryValidation);
            //Test Required Rule
            customButton1.Clicked += customButton1_Clicked;
            customButton2.Clicked += customButton2_Clicked;
            customButton3.Clicked += customSharedButton_Clicked;
            _vbox.PackStart(_entryBoxValidationCustomButton1, true, true, _padding);

            //EntryBoxValidationButton
            EntryBoxValidationButton entryBoxValidationButton = new EntryBoxValidationButton(this, "EntryBoxValidationButton", KeyboardMode.AlfaNumeric, SettingsApp.RegexAlfaNumericExtended, true);

            entryBoxValidationButton.Button.Clicked += customSharedButton_Clicked;
            _vbox.PackStart(entryBoxValidationButton, true, true, _padding);

            //Test XPOEntryBoxSelectRecordValidation without KeyBoard Input
            FIN_DocumentFinanceType defaultValueDocumentFinanceType     = (FIN_DocumentFinanceType)FrameworkUtils.GetXPGuidObject(GlobalFramework.SessionXpo, typeof(FIN_DocumentFinanceType), SettingsApp.XpoOidDocumentFinanceTypeInvoice);
            CriteriaOperator        criteriaOperatorDocumentFinanceType = CriteriaOperator.Parse("(Disabled IS NULL OR Disabled  <> 1)");
            XPOEntryBoxSelectRecordValidation <FIN_DocumentFinanceType, TreeViewDocumentFinanceType> entryBoxSelectDocumentFinanceType = new XPOEntryBoxSelectRecordValidation <FIN_DocumentFinanceType, TreeViewDocumentFinanceType>(this, Resx.global_documentfinanceseries_documenttype, "Designation", "Oid", defaultValueDocumentFinanceType, criteriaOperatorDocumentFinanceType, SettingsApp.RegexGuid, true);

            //entryBoxSelectDocumentFinanceType.EntryValidation.IsEditable = false;
            entryBoxSelectDocumentFinanceType.ClosePopup += delegate { };
            _vbox.PackStart(entryBoxSelectDocumentFinanceType, true, true, _padding);

            //Test XPOEntryBoxSelectRecordValidation with KeyBoard Input
            CriteriaOperator criteriaOperatorXPOEntryBoxSelectRecordValidationTextMode = null;

            _xPOEntryBoxSelectRecordValidationTextMode = new XPOEntryBoxSelectRecordValidation <ERP_Customer, TreeViewCustomer>(this, "XPOEntryBoxSelectRecordValidationTextMode", "Name", "Name", null, criteriaOperatorXPOEntryBoxSelectRecordValidationTextMode, KeyboardMode.AlfaNumeric, SettingsApp.RegexAlfaNumericExtended, false);
            //_xPOEntryBoxSelectRecordValidationTextMode.EntryValidation.Sensitive = false;
            //Start Disabled
            //_xPOEntryBoxSelectRecordValidationTextMode.ButtonKeyBoard.Sensitive = false;
            _xPOEntryBoxSelectRecordValidationTextMode.ClosePopup += delegate { };
            _vbox.PackStart(_xPOEntryBoxSelectRecordValidationTextMode, true, true, _padding);

            //Test XPOEntryBoxSelectRecordValidation without KeyBoard Input / Guid
            CriteriaOperator criteriaOperatorXPOEntryBoxSelectRecordValidationGuidMode = null;
            XPOEntryBoxSelectRecordValidation <ERP_Customer, TreeViewCustomer> xPOEntryBoxSelectRecordValidationGuidMode = new XPOEntryBoxSelectRecordValidation <ERP_Customer, TreeViewCustomer>(this, "XPOEntryBoxSelectRecordValidationGuidMode", "Name", "Oid", null, criteriaOperatorXPOEntryBoxSelectRecordValidationGuidMode, KeyboardMode.None, SettingsApp.RegexGuid, true);

            _xPOEntryBoxSelectRecordValidationTextMode.ClosePopup += delegate { };
            _vbox.PackStart(xPOEntryBoxSelectRecordValidationGuidMode, true, true, _padding);

            //Test DateTime Picker
            DateTime initalDateTime = DateTime.Now;
            EntryBoxValidationDatePickerDialog entryBoxShipToDeliveryDate = new EntryBoxValidationDatePickerDialog(this, Resx.global_ship_to_delivery_date, "dateFormat", DateTime.Now, SettingsApp.RegexDate, true, SettingsApp.DateFormat);

            //entryBoxShipToDeliveryDate.EntryValidation.Sensitive = true;
            entryBoxShipToDeliveryDate.EntryValidation.Text = initalDateTime.ToString(SettingsApp.DateFormat);

            //entryBoxShipToDeliveryDate.EntryValidation.Validate();
            //entryBoxShipToDeliveryDate.ClosePopup += delegate { };
            _vbox.PackStart(entryBoxShipToDeliveryDate, true, true, _padding);

            //Test DateTime Picker with KeyBoard
            EntryBoxValidationDatePickerDialog entryBoxShipToDeliveryDateKeyboard = new EntryBoxValidationDatePickerDialog(this, Resx.global_ship_to_delivery_date, SettingsApp.DateTimeFormat, DateTime.Now, KeyboardMode.AlfaNumeric, SettingsApp.RegexDateTime, true, SettingsApp.DateTimeFormat);

            entryBoxShipToDeliveryDateKeyboard.EntryValidation.Sensitive = false;
            entryBoxShipToDeliveryDateKeyboard.ButtonKeyBoard.Sensitive  = false;
            //entryBoxShipToDeliveryDate.EntryValidation.Sensitive = true;
            entryBoxShipToDeliveryDateKeyboard.EntryValidation.Text = initalDateTime.ToString(SettingsApp.DateTimeFormat);
            _vbox.PackStart(entryBoxShipToDeliveryDateKeyboard, true, true, _padding);

            //Simple ListView
            List <string> itemList = new List <string>();

            itemList.Add("Looking for Kiosk mode in Android Lollipop 5.0");
            itemList.Add("Think of a hypothetical ATM machine that is running Android");
            itemList.Add("In this article we provide a brief overview of how");
            itemList.Add("Kiosk Mode can be implemented without any modifications");
            itemList.Add("The Home key brings you back to the Home screen");

            //ListComboBox
            ListComboBox listComboBox = new ListComboBox(itemList, itemList[3]);

            _vbox.PackStart(listComboBox, true, true, _padding);

            //ListComboBoxTouch
            ListComboBoxTouch listComboBoxTouch = new ListComboBoxTouch(this, "ListComboBoxTouch (Todo: Highlight Validation in Component)", itemList, itemList[4]);

            _vbox.PackStart(listComboBoxTouch, true, true, _padding);

            //EntryMultiline entryTouchMultiline = new EntryMultiline(this, KeyboardMode.AlfaNumeric, SettingsApp.RegexAlfaNumericExtended, true, 100, 10);
            //vbox.PackStart(entryTouchMultiline, true, true, padding);
            EntryBoxValidationMultiLine entryBoxMultiLine = new EntryBoxValidationMultiLine(this, "EntryBoxMultiLine", KeyboardMode.AlfaNumeric, SettingsApp.RegexAlfaNumericExtended, true, 18, 6)
            {
                HeightRequest = 200
            };

            //Start Disabled
            entryBoxMultiLine.EntryMultiline.Sensitive = false;
            entryBoxMultiLine.ButtonKeyBoard.Sensitive = false;
            _vbox.PackStart(entryBoxMultiLine, true, true, _padding);


            /*
             * ListRadioButtonTouch listRadioButtonTouch = new ListRadioButtonTouch(this, "Label", itemList, itemList[4]);
             * _fixedContent.Put(listRadioButtonTouch, 100, 320);
             *
             * string initialShipFromDeliveryDate = FrameworkUtils.CurrentDateTimeAtomic().ToString(SettingsApp.DateFormat);
             * //EntryBoxValidationButton entryBoxDate = new EntryBoxValidationButton(this, Resx.global_ship_from_delivery_date, KeyboardModes.Alfa, regexDate, false);
             * //entryBoxDate.EntryValidation.Text = initialShipFromDeliveryDate;
             * //entryBoxDate.EntryValidation.Validate();
             *
             * EntryBoxValidationDatePickerDialog entryBoxDate = new EntryBoxValidationDatePickerDialog(this, Resx.global_ship_from_delivery_date, SettingsApp.RegexDate, false);
             * entryBoxDate.EntryValidation.Text = initialShipFromDeliveryDate;
             * entryBoxDate.EntryValidation.Validate();
             * entryBoxDate.ClosePopup += delegate
             * {
             *  _log.Debug(string.Format("entryBoxDate.Value: [{0}]", entryBoxDate.Value));
             * };
             * vbox.PackStart(entryBoxDate, true, true, padding);
             */
        }
Example #15
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);
        }