private void InitUI() { try { //Load Initial Values Load(); //Init VBOX _vbox = new VBox(true, 0); //Supplier CriteriaOperator criteriaOperatorSupplier = CriteriaOperator.Parse("(Disabled = 0 OR Disabled is NULL) AND (Supplier = 1)"); _entryBoxSelectSupplier = new XPOEntryBoxSelectRecordValidation <erp_customer, TreeViewCustomer>(this, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_supplier"), "Name", "Oid", _initialSupplier, criteriaOperatorSupplier, SettingsApp.RegexGuid, true); _entryBoxSelectSupplier.EntryValidation.IsEditable = false; _entryBoxSelectSupplier.EntryValidation.Changed += delegate { ValidateDialog(); }; //DocumentDate _entryBoxDocumentDate = new EntryBoxValidationDatePickerDialog(this, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_date"), resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_date"), _initialDocumentDate, SettingsApp.RegexDate, true, SettingsApp.DateFormat); //_entryBoxDocumentDate.EntryValidation.Sensitive = true; _entryBoxDocumentDate.EntryValidation.Text = _initialDocumentDate.ToString(SettingsApp.DateFormat); _entryBoxDocumentDate.EntryValidation.Validate(); _entryBoxDocumentDate.EntryValidation.Sensitive = true; _entryBoxDocumentDate.ClosePopup += delegate { ValidateDialog(); }; //DocumentNumber _entryBoxDocumentNumber = new EntryBoxValidation(this, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_document_number"), KeyboardMode.Alfa, SettingsApp.RegexAlfaNumericExtended, false); if (_initialDocumentNumber != string.Empty) { _entryBoxDocumentNumber.EntryValidation.Text = _initialDocumentNumber; } _entryBoxDocumentNumber.EntryValidation.Changed += delegate { ValidateDialog(); }; //SelectArticle CriteriaOperator criteriaOperatorSelectArticle = CriteriaOperator.Parse(string.Format("(Disabled IS NULL OR Disabled <> 1) AND (Class = '{0}')", SettingsApp.XpoOidArticleDefaultClass)); _entryBoxSelectArticle = new XPOEntryBoxSelectRecordValidation <fin_article, TreeViewArticle>(this, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_article"), "Designation", "Oid", null, criteriaOperatorSelectArticle, SettingsApp.RegexGuid, true); _entryBoxSelectArticle.EntryValidation.IsEditable = false; _entryBoxSelectArticle.EntryValidation.Changed += delegate { ValidateDialog(); }; //Quantity _entryBoxQuantity = new EntryBoxValidation(this, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_quantity"), KeyboardMode.Numeric, SettingsApp.RegexDecimalPositiveAndNegative, true); _entryBoxQuantity.EntryValidation.Changed += delegate { ValidateDialog(); }; //Notes _entryBoxNotes = new EntryBoxValidation(this, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_notes"), KeyboardMode.Alfa, SettingsApp.RegexAlfaNumericExtended, false); _entryBoxNotes.EntryValidation.Changed += delegate { ValidateDialog(); }; //Final Pack _vbox.PackStart(_entryBoxSelectSupplier, false, false, 0); _vbox.PackStart(_entryBoxDocumentDate, false, false, 0); _vbox.PackStart(_entryBoxDocumentNumber, false, false, 0); _vbox.PackStart(_entryBoxSelectArticle, false, false, 0); _vbox.PackStart(_entryBoxQuantity, false, false, 0); _vbox.PackStart(_entryBoxNotes, false, false, 0); } catch (Exception ex) { _log.Error(ex.Message, ex); } }
private void InitUI(DialogFlags pDialogFlags, DateTime pDateStart, DateTime pDateEnd) { //Parameters _dateStart = pDateStart; _dateEnd = pDateEnd; //Init Local Vars String windowTitle = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "window_title_dialog_datepicket_startend"); Size windowSize = new Size(300, 255); String fileDefaultWindowIcon = FrameworkUtils.OSSlash(GlobalFramework.Path["images"] + @"Icons\Windows\icon_window_date_picker.png"); //Init Content _fixedContent = new Fixed(); //Init DateEntry Start _entryBoxDateStart = new EntryBoxValidationDatePickerDialog(this, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_date_start"), _dateStart, SettingsApp.RegexDate, true); _entryBoxDateStart.EntryValidation.Text = _dateStart.ToString(SettingsApp.DateFormat); _entryBoxDateStart.EntryValidation.Validate(); _entryBoxDateStart.ClosePopup += entryBoxDateStart_ClosePopup; //Init DateEntry End _entryBoxDateEnd = new EntryBoxValidationDatePickerDialog(this, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_date_end"), _dateEnd, SettingsApp.RegexDate, true); _entryBoxDateEnd.EntryValidation.Text = _dateEnd.ToString(SettingsApp.DateFormat); _entryBoxDateEnd.EntryValidation.Validate(); _entryBoxDateEnd.ClosePopup += entryBoxDateEnd_ClosePopup; VBox vbox = new VBox(true, 0) { WidthRequest = 290 }; vbox.PackStart(_entryBoxDateStart, true, true, 2); vbox.PackStart(_entryBoxDateEnd, true, true, 2); _fixedContent.Put(vbox, 0, 0); //ActionArea Buttons _buttonOk = ActionAreaButton.FactoryGetDialogButtonType(PosBaseDialogButtonType.Ok); _buttonCancel = ActionAreaButton.FactoryGetDialogButtonType(PosBaseDialogButtonType.Cancel); //ActionArea ActionAreaButtons actionAreaButtons = new ActionAreaButtons(); actionAreaButtons.Add(new ActionAreaButton(_buttonOk, ResponseType.Ok)); actionAreaButtons.Add(new ActionAreaButton(_buttonCancel, ResponseType.Cancel)); //Start Validated Validate(); //Init Object this.InitObject(this, pDialogFlags, fileDefaultWindowIcon, windowTitle, windowSize, _fixedContent, actionAreaButtons); }
public DocumentFinanceDialogPage5(Window pSourceWindow, String pPageName, String pPageIcon, Widget pWidget, bool pEnabled = true) : base(pSourceWindow, pPageName, pPageIcon, pWidget, pEnabled) { //Init private vars _pagePad = (_sourceWindow as PosDocumentFinanceDialog).PagePad; _session = (_pagePad as DocumentFinanceDialogPagePad).Session; //Initials Values _intialValueConfigurationCountry = SettingsApp.ConfigurationSystemCountry; //ShipFrom Address _entryBoxShipFromAddressDetail = new EntryBoxValidation(_sourceWindow, Resx.global_address, KeyboardMode.Alfa, SettingsApp.RegexAlfaNumericExtended, true); _entryBoxShipFromAddressDetail.EntryValidation.Changed += delegate { Validate(); }; //ShipFrom Region _entryBoxShipFromRegion = new EntryBoxValidation(_sourceWindow, Resx.global_region, KeyboardMode.Alfa, SettingsApp.RegexAlfa, false); _entryBoxShipFromRegion.EntryValidation.Changed += delegate { Validate(); }; //ShipFrom PostalCode _entryBoxShipFromPostalCode = new EntryBoxValidation(_sourceWindow, Resx.global_zipcode, KeyboardMode.Alfa, SettingsApp.ConfigurationSystemCountry.RegExZipCode, true); _entryBoxShipFromPostalCode.EntryValidation.Changed += delegate { Validate(); }; //ShipFrom City _entryBoxShipFromCity = new EntryBoxValidation(_sourceWindow, Resx.global_city, KeyboardMode.Alfa, SettingsApp.RegexAlfa, true); _entryBoxShipFromCity.EntryValidation.Changed += delegate { Validate(); }; //ShipFrom Country CriteriaOperator criteriaOperatorCustomerCountry = CriteriaOperator.Parse("(Disabled IS NULL OR Disabled <> 1)"); _entryBoxSelectShipFromCountry = new XPOEntryBoxSelectRecordValidation <CFG_ConfigurationCountry, TreeViewConfigurationCountry>(_sourceWindow, Resx.global_country, "Designation", "Oid", _intialValueConfigurationCountry, criteriaOperatorCustomerCountry, SettingsApp.RegexGuid, true); _entryBoxSelectShipFromCountry.EntryValidation.IsEditable = false; _entryBoxSelectShipFromCountry.EntryValidation.Changed += delegate { Validate(); }; _entryBoxSelectShipFromCountry.ClosePopup += delegate { //Require to Update RegExZipCode _entryBoxShipFromPostalCode.EntryValidation.Rule = _entryBoxSelectShipFromCountry.Value.RegExZipCode; _entryBoxShipFromPostalCode.EntryValidation.Validate(); }; //ShipFromDeliveryDate _entryBoxShipFromDeliveryDate = new EntryBoxValidationDatePickerDialog(_sourceWindow, Resx.global_ship_from_delivery_date, _pagePad.DateTimeFormat, _pagePad.InitalDateTime, KeyboardMode.AlfaNumeric, SettingsApp.RegexDateTime, true, _pagePad.DateTimeFormat); _entryBoxShipFromDeliveryDate.EntryValidation.Sensitive = true; _entryBoxShipFromDeliveryDate.EntryValidation.Text = FrameworkUtils.DateTimeToString(FrameworkUtils.CurrentDateTimeAtomic()).ToString(); _entryBoxShipFromDeliveryDate.EntryValidation.Validate(); //Assign Min Date to Validation _entryBoxShipFromDeliveryDate.DateTimeMin = FrameworkUtils.CurrentDateTimeAtomic(); _entryBoxShipFromDeliveryDate.EntryValidation.Changed += _entryBoxShipFromDeliveryDate_ClosePopup; _entryBoxShipFromDeliveryDate.ClosePopup += _entryBoxShipFromDeliveryDate_ClosePopup; //ShipFromDeliveryID _entryBoxShipFromDeliveryID = new EntryBoxValidation(_sourceWindow, Resx.global_ship_from_delivery_id, KeyboardMode.Alfa, SettingsApp.RegexAlfaNumericExtended, false); _entryBoxShipFromDeliveryID.EntryValidation.Changed += delegate { Validate(); }; //ShipFromWarehouseID _entryBoxShipFromWarehouseID = new EntryBoxValidation(_sourceWindow, Resx.global_ship_from_warehouse_id, KeyboardMode.Alfa, SettingsApp.RegexAlfaNumericExtended, false); _entryBoxShipFromWarehouseID.EntryValidation.MaxLength = 50; _entryBoxShipFromWarehouseID.EntryValidation.Changed += delegate { Validate(); }; //ShipFromLocationID _entryBoxShipFromLocationID = new EntryBoxValidation(_sourceWindow, Resx.global_ship_from_location_id, KeyboardMode.Alfa, SettingsApp.RegexAlfaNumericExtended, false); _entryBoxShipFromLocationID.EntryValidation.MaxLength = 30; _entryBoxShipFromLocationID.EntryValidation.Changed += delegate { Validate(); }; //HBox hboxDeliveryDate+DeliveryID HBox hboxDeliveryDateAndDeliveryID = new HBox(true, 0); hboxDeliveryDateAndDeliveryID.PackStart(_entryBoxShipFromDeliveryDate, true, true, 0); hboxDeliveryDateAndDeliveryID.PackStart(_entryBoxShipFromDeliveryID, true, true, 0); //HBox ZipCode+City+Country HBox hboxZipCodeAndCityAndCountry = new HBox(true, 0); hboxZipCodeAndCityAndCountry.PackStart(_entryBoxShipFromPostalCode, true, true, 0); hboxZipCodeAndCityAndCountry.PackStart(_entryBoxShipFromCity, true, true, 0); hboxZipCodeAndCityAndCountry.PackStart(_entryBoxSelectShipFromCountry, true, true, 0); //HBox hboxWarehouseID+LocationID HBox hboxhboxWarehouseIDAndLocationID = new HBox(true, 0); hboxhboxWarehouseIDAndLocationID.PackStart(_entryBoxShipFromWarehouseID, true, true, 0); hboxhboxWarehouseIDAndLocationID.PackStart(_entryBoxShipFromLocationID, true, true, 0); //Pack VBOX VBox vbox = new VBox(false, 2); vbox.PackStart(_entryBoxShipFromAddressDetail, false, false, 0); vbox.PackStart(_entryBoxShipFromRegion, false, false, 0); vbox.PackStart(hboxZipCodeAndCityAndCountry, false, false, 0); vbox.PackStart(hboxDeliveryDateAndDeliveryID, false, false, 0); vbox.PackStart(hboxhboxWarehouseIDAndLocationID, false, false, 0); PackStart(vbox); }
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); */ }