//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
        //Static Helpers

        //UI Helper to Request Acronym for Terminal Series

        public static logicpos.Utils.ResponseText PosConfirmAcronymSeriesDialog(Window pSourceWindow, FIN_DocumentFinanceYears pDocumentFinanceYear, DataTable pTerminals, string pInitialValue)
        {
            logicpos.Utils.ResponseText result = new Utils.ResponseText();
            FrameworkCallsResult        frameworkCallsResult;

            try
            {
                string fileWindowIcon = FrameworkUtils.OSSlash(GlobalFramework.Path["images"] + @"Icons\Windows\icon_window_input_text_default.png");

                PosInputTextDialog dialog = new PosInputTextDialog(
                    pSourceWindow,
                    DialogFlags.Modal,
                    new System.Drawing.Size(800, 600),
                    Resx.window_title_series_create_series,
                    fileWindowIcon,
                    Resx.global_acronym,
                    pInitialValue,
                    SettingsApp.RegexDocumentSeriesAcronym,
                    true
                    );

                //Initialize EntryBoxValidationMultiLine
                EntryBoxValidationMultiLine entryBoxValidationMultiLine = new EntryBoxValidationMultiLine(pSourceWindow, Resx.global_preview);
                entryBoxValidationMultiLine.HeightRequest = 420;
                entryBoxValidationMultiLine.EntryMultiline.TextView.WrapMode  = WrapMode.Word;
                entryBoxValidationMultiLine.EntryMultiline.TextView.Sensitive = false;

                //Start with Preview
                frameworkCallsResult = ProcessFinanceDocumentSeries.CreateDocumentFinanceYearSeriesTerminal(pDocumentFinanceYear, pTerminals, dialog.EntryBoxValidation.EntryValidation.Text, true);
                entryBoxValidationMultiLine.EntryMultiline.TextView.Buffer.Text = frameworkCallsResult.Output;

                //Pack Widgets
                dialog.VBoxContent.PackStart(entryBoxValidationMultiLine, true, true, 0);
                dialog.VBoxContent.ShowAll();
                dialog.EntryBoxValidation.EntryValidation.Changed += delegate
                {
                    if (dialog.EntryBoxValidation.EntryValidation.Validated)
                    {
                        frameworkCallsResult = ProcessFinanceDocumentSeries.CreateDocumentFinanceYearSeriesTerminal(pDocumentFinanceYear, pTerminals, dialog.EntryBoxValidation.EntryValidation.Text, true);
                        entryBoxValidationMultiLine.EntryMultiline.TextView.Buffer.Text = frameworkCallsResult.Output;
                    }
                };
                ResponseType responseType = (ResponseType)dialog.Run();
                result.ResponseType = responseType;

                if (responseType == ResponseType.Ok)
                {
                    result.Text = dialog.Value;
                }
                dialog.Destroy();
            }
            catch (Exception ex)
            {
                _log.Error(ex.Message, ex);
            }

            return(result);
        }
예제 #2
0
        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);
             */
        }