/// <summary>
		/// Creates an editor control
		/// </summary>
		/// <param name="parentControl">Parent Control</param>
		/// <param name="value">Option value</param>
		/// <param name="pluginProperties">Plugin properties</param>
		/// <returns>Control</returns>
		public override Control CreateEditorControl(Control parentControl, object value, IProperties pluginProperties)
		{
			CustomTextBox textBox = new CustomTextBox();
			textBox.Text = value.ToString();
			textBox.Name = FullName;
			textBox.Pasted += (s, e) => textBox.Text = Utils.RemoveLineWhiteSpaces(textBox.Text, true, true, true);
			textBox.Leave += (s, e) => textBox.Text = Utils.RemoveLineWhiteSpaces(textBox.Text, true, true, true);
			return textBox;
		}
Exemplo n.º 2
0
        public CustomDataGridView()
        {
            AddNewRow = false;
            AutoGenerateColumns = false;
            ReadOnly = true;
            DefaultCellStyle = new DataGridViewCellStyle();

            _textBox = new CustomTextBox { Name = "TextBoxDataGridView", Visible = false, Text = string.Empty };
        }
Exemplo n.º 3
0
        public UIElement Visit(Evaluation.Values.Int value)
        {
            CustomTextBox customTextBox = new CustomTextBox(new IntHandler())
            {
                Name = uiElementId, Text = value.GetValue().ToString(), IsReadOnly = isReadOnly
            };

            customTextBox.EventUpdateValue += UpdateValue;

            return(customTextBox);
        }
        internal void Init()
        {
            bool isSingleRecording = this.ParentWindow.MacroRecorderWindow.mRenamingMacrosList.Count == 1;

            try
            {
                this.mInited = false;
                this.mScriptsStackPanel.Children.Clear();
                foreach (MacroRecording mRenamingMacros in this.ParentWindow.MacroRecorderWindow.mRenamingMacrosList)
                {
                    string suggestedName1;
                    ImportMacroScriptsControl stackPanelAndDict = this.AddRecordingToStackPanelAndDict(mRenamingMacros, isSingleRecording, out suggestedName1);
                    if (mRenamingMacros.RecordingType == RecordingTypes.MultiRecording)
                    {
                        bool?multiMacroAsUnified = this.mOperationWindow.mImportMultiMacroAsUnified;
                        if (0 == (multiMacroAsUnified.GetValueOrDefault() ? 1 : 0) & multiMacroAsUnified.HasValue)
                        {
                            stackPanelAndDict.mDependentScriptsMsg.Visibility   = Visibility.Visible;
                            stackPanelAndDict.mDependentScriptsPanel.Visibility = Visibility.Visible;
                            stackPanelAndDict.mDependentScriptsPanel.Children.Clear();
                            foreach (string sourceRecording in mRenamingMacros.SourceRecordings)
                            {
                                MacroRecording macroRecording         = JsonConvert.DeserializeObject <MacroRecording>(sourceRecording, Utils.GetSerializerSettings());
                                string         dependentRecordingName = MacroRecorderWindow.GetDependentRecordingName(suggestedName1, macroRecording.Name);
                                string         suggestedName2         = !MacroGraph.Instance.Vertices.Cast <MacroRecording>().Select <MacroRecording, string>((Func <MacroRecording, string>)(macro => macro.Name)).Contains <string>(dependentRecordingName.ToLower(CultureInfo.InvariantCulture).Trim()) ? dependentRecordingName : CommonHandlers.GetMacroName(dependentRecordingName);
                                CustomTextBox  customTextBox          = new CustomTextBox();
                                customTextBox.Height = 24.0;
                                customTextBox.HorizontalAlignment = HorizontalAlignment.Left;
                                customTextBox.Margin     = new Thickness(0.0, 5.0, 0.0, 0.0);
                                customTextBox.Text       = this.ValidateSuggestedName(suggestedName2);
                                customTextBox.Visibility = Visibility.Visible;
                                customTextBox.IsEnabled  = false;
                                CustomTextBox index = customTextBox;
                                stackPanelAndDict.mDependentScriptsPanel.Children.Add((UIElement)index);
                                this.mDependentRecordingDict[index] = macroRecording;
                            }
                        }
                    }
                }
                this.mNumberOfFilesSelectedForImport = 0;
            }
            catch (Exception ex)
            {
                Logger.Error("Error in import window init err: " + ex.ToString());
            }
            this.mInited = true;
            if (isSingleRecording)
            {
                this.mSelectAllBtn.Visibility = Visibility.Hidden;
            }
            this.mSelectAllBtn.IsChecked = new bool?(true);
            this.SelectAllBtn_Click((object)null, (RoutedEventArgs)null);
        }
Exemplo n.º 5
0
        private void TxtBusqueda_OnCustomKeyPress(object sender, KeyPressEventArgs e)
        {
            CustomTextBox txt = (CustomTextBox)sender;

            if (string.IsNullOrWhiteSpace(txt.Texto) || txt.Texto.Equals(txt.Texto_inicial))
            {
                this.BuscarVehiculos("COMPLETO", "");
            }
            else
            {
                this.BuscarVehiculos("TODO", txt.Texto);
            }
        }
Exemplo n.º 6
0
        private void TxtBusqueda_onPxClick(object sender, EventArgs e)
        {
            CustomTextBox txt = (CustomTextBox)sender;

            if (txt.Texto.Equals(txt.Texto_inicial) | txt.Texto.Equals(""))
            {
                this.BuscarClientes("COMPLETO", "");
            }
            else
            {
                this.BuscarClientes("BUSQUEDA COMPLETA", txt.Texto);
            }
        }
Exemplo n.º 7
0
        protected override void OnElementChanged(ElementChangedEventArgs <Label> e)
        {
            base.OnElementChanged(e);

            if ((Control != null) && (e.NewElement != null))
            {
                var newControl = new CustomTextBox(IsHoverEnabled());

                newControl.Cell = Control.Cell;

                SetNativeControl(newControl);
            }
        }
Exemplo n.º 8
0
        private void TxtBusqueda_onPxClick(object sender, EventArgs e)
        {
            CustomTextBox txt = (CustomTextBox)sender;

            if (txt.Texto.Equals("") || txt.Texto.Equals(txt.TextoInicial))
            {
                this.BuscarTipoArticulos("COMPLETO", "");
            }
            else
            {
                this.BuscarTipoArticulos("NOMBRE", txt.Texto);
            }
        }
Exemplo n.º 9
0
        private void TxtBusqueda_onPxClick(object sender, EventArgs e)
        {
            CustomTextBox txt = (CustomTextBox)sender;

            if (txt.Texto.Equals("") || txt.Texto.Equals(txt.TextoInicial))
            {
                this.BuscarProveedores("COMPLETO", "");
            }
            else
            {
                this.BuscarProveedores("TODO", txt.Texto);
            }
        }
 private bool ValidarCampoCompletado(CustomTextBox campo)
 {
     if (String.IsNullOrEmpty(campo.TextoCampo.Trim()))
     {
         campo.TextoError = Globals.ErrorCampoObl;
         return(false);
     }
     else
     {
         campo.TextoError = String.Empty;
         return(true);
     }
 }
Exemplo n.º 11
0
        public void ShouldBe_PossibleTo_CreateCustomTextBox()
        {
            var authForm = new AuthenticationForm();

            authForm.Open();
            var userNameTxb = authForm.UserNameTextBox;

            var userNameCustomTxb = new CustomTextBox(userNameTxb.Locator, userNameTxb.Name);

            userNameTxb.Type("wrong");
            userNameCustomTxb.Type("right");
            Assert.AreEqual(userNameTxb.Value, userNameCustomTxb.Text);
        }
Exemplo n.º 12
0
        private void TxtBusqueda_onPxClick(object sender, EventArgs e)
        {
            CustomTextBox txt = (CustomTextBox)sender;

            if (txt.Texto.Equals("") || txt.Texto.Equals(txt.Texto_inicial))
            {
                this.BuscarVehiculos(this.TipoBusqueda(), "");
            }
            else
            {
                this.BuscarVehiculos(this.TipoBusqueda(), txt.Texto);
            }
        }
Exemplo n.º 13
0
        /// <summary>
        /// Moves the custom caret on the canvas.
        /// </summary>
        private void MoveCustomCaret()
        {
            var caretLocation = CustomTextBox.GetRectFromCharacterIndex(CustomTextBox.CaretIndex).Location;

            if (!double.IsInfinity(caretLocation.X))
            {
                Canvas.SetLeft(Caret, caretLocation.X);
            }

            if (!double.IsInfinity(caretLocation.Y))
            {
                Canvas.SetTop(Caret, caretLocation.Y);
            }
        }
Exemplo n.º 14
0
        private async void TxtBusqueda_OnPxClick(object sender, EventArgs e)
        {
            CustomTextBox  txt  = (CustomTextBox)sender;
            MainController main = MainController.GetInstance();

            if (string.IsNullOrEmpty(txt.Texto))
            {
                await this.LoadAgendamientos("FECHA PENDIENTE", DateTime.Now.ToString("yyyy-MM-dd"));
            }
            else
            {
                await this.LoadClientes("TODO", txt.Texto, "");
            }
        }
        void IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                ((UIElement)target).MouseDown  += new MouseButtonEventHandler(this.ComboBoxItem_MouseDown);
                ((UIElement)target).MouseEnter += new MouseEventHandler(this.ComboBoxItem_MouseEnter);
                ((UIElement)target).MouseLeave += new MouseEventHandler(this.ComboBoxItem_MouseLeave);
                ((UIElement)target).LostFocus  += new RoutedEventHandler(this.ComboBoxItem_LostFocus);
                break;

            case 2:
                this.mSchemeControl = (Grid)target;
                break;

            case 3:
                this.mBookmarkImg            = (CustomPictureBox)target;
                this.mBookmarkImg.MouseDown += new MouseButtonEventHandler(this.Bookmark_img_MouseDown);
                break;

            case 4:
                this.mSchemeName        = (CustomTextBox)target;
                this.mSchemeName.KeyUp += new KeyEventHandler(this.MSchemeName_KeyUp);
                break;

            case 5:
                this.mEditImg            = (CustomPictureBox)target;
                this.mEditImg.MouseDown += new MouseButtonEventHandler(this.EditImg_MouseDown);
                break;

            case 6:
                this.mSaveImg            = (CustomPictureBox)target;
                this.mSaveImg.MouseDown += new MouseButtonEventHandler(this.SaveImg_MouseDown);
                break;

            case 7:
                this.mCopyImg            = (CustomPictureBox)target;
                this.mCopyImg.MouseDown += new MouseButtonEventHandler(this.CopyImg_MouseDown);
                break;

            case 8:
                this.mDeleteImg            = (CustomPictureBox)target;
                this.mDeleteImg.MouseDown += new MouseButtonEventHandler(this.DeleteImg_MouseDown);
                break;

            default:
                this._contentLoaded = true;
                break;
            }
        }
		/// <summary>
		/// Creates an editor control
		/// </summary>
		/// <param name="parentControl">Parent Control</param>
		/// <param name="value">Option value</param>
		/// <param name="pluginProperties">Plugin properties</param>
		/// <returns>Control</returns>
		public override Control CreateEditorControl(Control parentControl, object value, IProperties pluginProperties)
		{
			CustomTextBox textBox = new CustomTextBox();

			textBox.Text = value.ToString();
			textBox.Multiline = true;
			textBox.WordWrap = false;
			textBox.ScrollBars = ScrollBars.Both;
			textBox.Height = Height;
			textBox.Pasted += (s, e) => textBox.Text = Utils.UnindentLines(textBox.Text);
			textBox.Leave += (s, e) => textBox.Text = Utils.UnindentLines(textBox.Text);
			textBox.Name = FullName;
			return textBox;
		}
Exemplo n.º 17
0
        void IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.mInstallEngineFail = (TextWrapCustomCheckBox)target;
                break;

            case 2:
                this.mInstallGameFail = (TextWrapCustomCheckBox)target;
                break;

            case 3:
                this.mConflictWithOthers = (TextWrapCustomCheckBox)target;
                break;

            case 4:
                this.mStartEngineFail = (TextWrapCustomCheckBox)target;
                break;

            case 5:
                this.mGameLag = (TextWrapCustomCheckBox)target;
                break;

            case 6:
                this.mBlackScreen = (TextWrapCustomCheckBox)target;
                break;

            case 7:
                this.mCantFindGame = (TextWrapCustomCheckBox)target;
                break;

            case 8:
                this.mAppCrash = (TextWrapCustomCheckBox)target;
                break;

            case 9:
                this.mExeCrash = (TextWrapCustomCheckBox)target;
                break;

            case 10:
                this.mOtherReasonTextBox = (CustomTextBox)target;
                break;

            default:
                this._contentLoaded = true;
                break;
            }
        }
Exemplo n.º 18
0
        private void ClearInlineForm(DataGridView dgv)
        {
            this.prepared_comment = null;
            if (this.inline_comment_desc != null)
            {
                this.inline_comment_desc.Dispose();
                this.inline_comment_desc = null;
            }
            dgv.Enabled = true;

            if (dgv.Rows.Cast <DataGridViewRow>().Where(r => !(r.Tag is SupportNoteComment)).Count <DataGridViewRow>() > 0)
            {
                dgv.Rows.Remove(dgv.Rows.Cast <DataGridViewRow>().Where(r => !(r.Tag is SupportNoteComment)).First <DataGridViewRow>());
            }
        }
Exemplo n.º 19
0
    public VerticalTextBox()
    {
        //OnPaint의 e.Graphics.DrawRectangle 잔상 제거 -> ControlStyles.ResizeRedraw 필수
        base.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.DoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw, true);

        textBox        = new CustomTextBox();
        textBox.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
        this.Controls.Add(textBox);

        //Init
        Text             = "";
        BackColor        = SystemColors.Window;
        LeftRightPadding = 10;
        BorderColor      = Color.Gray;
    }
        internal void TextChanged(object sender, TextChangedEventArgs e)
        {
            if (!this.mInited)
            {
                return;
            }
            ImportMacroScriptsControl macroItemGrandchild = this.GetScriptControlFromMacroItemGrandchild((object)(sender as FrameworkElement).Parent);
            string text = (sender as CustomTextBox).Text;

            foreach (UIElement child in macroItemGrandchild.mDependentScriptsPanel.Children)
            {
                CustomTextBox index = child as CustomTextBox;
                index.Text = MacroRecorderWindow.GetDependentRecordingName(text, this.mDependentRecordingDict[index].Name);
            }
        }
Exemplo n.º 21
0
        private void TxtBusqueda_onKeyPress(object sender, KeyPressEventArgs e)
        {
            CustomTextBox txt = (CustomTextBox)sender;

            if ((int)e.KeyChar == (int)Keys.Enter)
            {
                if (txt.Texto.Equals("") || txt.Texto.Equals(txt.Texto_inicial))
                {
                    this.BuscarVehiculos(this.TipoBusqueda(), "");
                }
                else
                {
                    this.BuscarVehiculos(this.TipoBusqueda(), txt.Texto);
                }
            }
        }
Exemplo n.º 22
0
        private void TxtBusqueda_onKeyPress(object sender, KeyPressEventArgs e)
        {
            CustomTextBox txt = (CustomTextBox)sender;

            if ((int)e.KeyChar == (int)Keys.Enter)
            {
                if (txt.Texto.Equals(txt.Texto_inicial) | txt.Texto.Equals(""))
                {
                    this.BuscarClientes("COMPLETO", "");
                }
                else
                {
                    this.BuscarClientes("BUSQUEDA COMPLETA", txt.Texto);
                }
            }
        }
Exemplo n.º 23
0
        public static Entry AddTextField(this Grid contentGrid, string binding, int row, Keyboard key = null)
        {
            var entry = new CustomTextBox
            {
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions   = LayoutOptions.Center
            };

            if (key != null)
            {
                entry.Keyboard = key;
            }
            entry.SetBinding(Entry.TextProperty, binding, BindingMode.TwoWay);
            contentGrid.Children.Add(entry, 1, row);
            return(entry);
        }
        private async void TxtBuscarArticulos_OnCustomKeyPress(object sender, KeyPressEventArgs e)
        {
            CustomTextBox txt = (CustomTextBox)sender;

            if (e.KeyChar == (int)Keys.Enter)
            {
                if (txt.Texto.Equals(txt.Texto_inicial) | txt.Texto.Equals(""))
                {
                    await this.LoadArticulos("COMPLETO", "");
                }
                else
                {
                    await this.LoadArticulos("REFERENCIA", txt.Texto);
                }
            }
        }
Exemplo n.º 25
0
        private void TxtBusqueda_onKeyPress(object sender, KeyPressEventArgs e)
        {
            CustomTextBox txt = (CustomTextBox)sender;

            if ((int)e.KeyChar == (int)Keys.Enter)
            {
                if (txt.Texto.Equals("") || txt.Texto.Equals(txt.TextoInicial))
                {
                    this.BuscarProveedores("COMPLETO", "");
                }
                else
                {
                    this.BuscarProveedores("TODO", txt.Texto);
                }
            }
        }
Exemplo n.º 26
0
 private void SafeCurrencyEntry_Load(object sender, EventArgs e)
 {
     if (!DesignMode)
     {
         //Get Tube safe denomination data
         DataTable tubeSafeInfo;
         string    errorCode;
         string    errorText;
         ShopCashProcedures.GetTubeSafeDataForStore(GlobalDataAccessor.Instance.CurrentSiteId.StoreNumber, GlobalDataAccessor.Instance.DesktopSession,
                                                    out tubeSafeInfo, out errorCode, out errorText);
         if (tubeSafeInfo != null)
         {
             int i = 1;
             tubeDenomCount = tubeSafeInfo.Rows.Count;
             foreach (DataRow dr in tubeSafeInfo.Rows)
             {
                 Label  lblDenom     = new Label();
                 var    displayText  = string.Empty;
                 string denomDisplay = Utilities.GetStringValue(dr["displayname"], "");
                 int    idx          = denomDisplay.IndexOf("USD", System.StringComparison.Ordinal);
                 if (idx >= 0)
                 {
                     displayText = denomDisplay.Substring(idx + 4);
                 }
                 lblDenom.Name = "label_denom_" + i;
                 lblDenom.Text = displayText;
                 lblDenom.Size = new Size(80, 21);
                 tableLayoutPanelTubeDenom.Controls.Add(lblDenom);
                 CustomTextBox custTextCount = new CustomTextBox();
                 custTextCount.Name             = displayText;
                 custTextCount.AllowOnlyNumbers = true;
                 custTextCount.Size             = new Size(44, 21);
                 custTextCount.Leave           += custTextCount_Leave;
                 tableLayoutPanelTubeDenom.Controls.Add(custTextCount);
                 Label lblAmt = new Label();
                 lblAmt.Name     = "label_amount_" + displayText;
                 lblAmt.Size     = new Size(80, 21);
                 labelAmt.Anchor = AnchorStyles.Right;
                 labelAmt.Anchor = AnchorStyles.Left;
                 tableLayoutPanelTubeDenom.Controls.Add(lblAmt);
                 i++;
             }
         }
     }
 }
Exemplo n.º 27
0
        protected override void OnElementChanged(ElementChangedEventArgs <Label> e)
        {
            base.OnElementChanged(e);

            if ((Control != null) && (e.NewElement != null))
            {
                var newControl = new CustomTextBox(IsHoverEnabled());

                newControl.Cell = Control.Cell;

                if ((Element as ExtendedLabel).JustifyText)
                {
                    newControl.Alignment = NSTextAlignment.Justified;
                }

                SetNativeControl(newControl);
            }
        }
Exemplo n.º 28
0
        private async void TxtBusqueda_OnCustomKeyPress(object sender, KeyPressEventArgs e)
        {
            CustomTextBox txt = (CustomTextBox)sender;

            if (e.KeyChar == (int)Keys.Enter)
            {
                MainController main = MainController.GetInstance();

                if (string.IsNullOrEmpty(txt.Texto))
                {
                    await this.LoadAgendamientos("FECHA PENDIENTE", DateTime.Now.ToString("yyyy-MM-dd"));
                }
                else
                {
                    if (this.rdCliente.Checked)
                    {
                        if (int.TryParse(txt.Texto, out int id_usuario))
                        {
                            await this.LoadClientes("ID CLIENTE", id_usuario.ToString(), "");
                        }
                        else
                        {
                            Mensajes.MensajeInformacion("Debe digitar un código de solo números", "Entendido");
                        }
                    }
                    else if (this.rdVenta.Checked)
                    {
                        if (int.TryParse(txt.Texto, out int id_venta))
                        {
                            await this.LoadClientes("ID VENTA", id_venta.ToString(), "");
                        }
                        else
                        {
                            Mensajes.MensajeInformacion("Debe digitar un código de solo números", "Entendido");
                        }
                    }
                    else
                    {
                        await this.LoadClientes("TODO", txt.Texto, "");
                    }
                }
            }
        }
Exemplo n.º 29
0
        private void TxtBusqueda_onPxClick(object sender, EventArgs e)
        {
            CustomTextBox txt = (CustomTextBox)sender;

            if (txt.Texto.Equals("") || txt.Texto.Equals(txt.Texto_inicial))
            {
                this.BuscarClientes("COMPLETO ", "");
            }
            else
            {
                if (this.rdNombre.Checked)
                {
                    this.BuscarClientes("NOMBRE", txt.Texto);
                }
                else
                {
                    this.BuscarClientes("CELULAR", txt.Texto);
                }
            }
        }
		/// <summary>
		/// Creates an editor control
		/// </summary>
		/// <param name="parentControl">Parent Control</param>
		/// <param name="value">Option value</param>
		/// <param name="pluginProperties">Plugin properties</param>
		/// <returns>Control</returns>
		public override Control CreateEditorControl(Control parentControl, object value, IProperties pluginProperties)
		{
			CustomTextBox textBox = new CustomTextBox();
			ListItem[] listItems = value as ListItem[];

			textBox.Text = string.Join(Environment.NewLine,
				listItems.Where(l => (l != null) && (l.Value != null))
						.Select(l => l.Value + ";" + (l.Text ?? l.Value)).ToArray());
			textBox.Multiline = true;
			textBox.WordWrap = false;
			textBox.ScrollBars = ScrollBars.Both;
			textBox.Height = Height;

			// Remove leading & trailing spaces
			textBox.Pasted += (s, e) => textBox.Text = Utils.RemoveLineWhiteSpaces(textBox.Text, true, false, true);
			textBox.Leave += (s, e) => textBox.Text = Utils.RemoveLineWhiteSpaces(textBox.Text, true, false, true);

			// Return
			textBox.Name = FullName;
			return textBox;
		}
Exemplo n.º 31
0
        protected void gvwList_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                GeneralFunctions.ApplyGridViewAlternateItemStyle(e.Row, 5);
                ((Label)e.Row.Cells[0].FindControl("lblSlNo")).Text = ((gvwList.PageSize * gvwList.PageIndex) + e.Row.RowIndex + 1).ToString();
                ((HiddenField)e.Row.Cells[0].FindControl("hdnBookingCntrId")).Value = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "BookingContainerId"));
                ((HiddenField)e.Row.Cells[0].FindControl("hdnTypeId")).Value        = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "ContainerTypeId"));
                ((HiddenField)e.Row.Cells[0].FindControl("hdnSize")).Value          = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "ContainerSize"));
                ((HiddenField)e.Row.Cells[0].FindControl("hdnAvlUnit")).Value       = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "AvailableUnit"));
                ((HiddenField)e.Row.Cells[0].FindControl("hdnBookingUnit")).Value   = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "BookingUnit"));

                e.Row.Cells[1].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "ContainerType"));
                e.Row.Cells[2].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "ContainerSize"));
                e.Row.Cells[3].Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "AvailableUnit"));

                CustomTextBox txtReqUnit = (CustomTextBox)e.Row.Cells[4].FindControl("txtReqUnit");
                txtReqUnit.Text     = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "RequiredUnit"));
                txtReqUnit.ReadOnly = !_isEditable;
            }
        }
Exemplo n.º 32
0
        /// <summary>Generates the cell for the given item. </summary>
        /// <param name="dataGrid"></param>
        /// <param name="dataItem">The item to generate the cell for. </param>
        /// <returns>The <see cref="DataGridCellBase"/>. </returns>
        public override DataGridCellBase CreateCell(DataGrid dataGrid, object dataItem)
        {
            var block = new CustomTextBox();

            block.VerticalAlignment          = VerticalAlignment.Center;
            block.Background                 = new SolidColorBrush(Colors.Transparent);
            block.Foreground                 = Foreground;
            block.BorderBrush                = new SolidColorBrush(Colors.Transparent);
            block.BorderThickness            = new Thickness(0);
            block.Margin                     = new Thickness(2, 0, 2, 0);
            block.HorizontalContentAlignment = HorizontalAlignment.Stretch;
            block.VerticalContentAlignment   = VerticalAlignment.Stretch;
            block.IsEnabled                  = false;
            block.UpdateOnlyOnEnter          = dataGrid.UpdateOnlyOnEnter;
            block.NumericKeyType             = NumericKeyType;

            if (MaxCharacterLength != 0)
            {
                block.MaxLength = MaxCharacterLength;
            }
            if (FontSize <= 0)
            {
                FontSize = dataGrid.FontSize;
            }

            CreateBinding(StyleProperty, "Style", block, CustomTextBox.StyleProperty);
            CreateBinding(FontStyleProperty, "FontStyle", block, CustomTextBox.FontStyleProperty);
            CreateBinding(FontSizeProperty, "FontSize", block, CustomTextBox.FontSizeProperty);
            CreateBinding(ForegroundProperty, "Foreground", block, CustomTextBox.ForegroundProperty);
            CreateBinding(TextAlignmentProperty, "TextAlignment", block, CustomTextBox.TextAlignmentProperty);

            if (Binding != null)
            {
                block.SetBinding(CustomTextBox.TextProperty, Binding);
            }

            return(new DefaultDataGridCell(block));
        }
Exemplo n.º 33
0
        protected override void CreateScene()
        {
            this.Load(WaveContent.Scenes.MyScene);
            Viewport v = WaveServices.GraphicsDevice.RenderState.Viewport;

            //Pone el formato de la pantalla virtual (no de la ventana, eso va en app.cs)
            this.VirtualScreenManager.Activate(v.Width, v.Height, StretchMode.Uniform);

            //la camara
            Entity camera = new Entity("camera2D").AddComponent(new Transform2D {
                Scale = new Vector2(0.28f, 0.28f)
            })
                            .AddComponent(new Camera2D {
                BackgroundColor = Color.Brown
            })
                            .AddComponent(new Camera2DBehavior())

            ;

            EntityManager.Add(camera);
            RenderManager.SetActiveCamera2D(camera);

            TextBox      newBox = new TextBox();
            ToggleSwitch toggle = new ToggleSwitch
            {
                IsOn    = true,
                OnText  = "Can write. ',' for '.', '-' (subtract) to delete",
                OffText = "Cannot write. Switch!",
                Margin  = new Thickness(0, 30, 0, 0)
            };
            CustomTextBox custom = new CustomTextBox();

            custom.SetTextBox(newBox, toggle);

            EntityManager.Add(newBox);
            EntityManager.Add(toggle);
            EntityManager.Add(new Entity().AddComponent(custom));
        }
Exemplo n.º 34
0
        private void TxtBusqueda_onKeyPress(object sender, KeyPressEventArgs e)
        {
            CustomTextBox txt = (CustomTextBox)sender;

            if ((int)e.KeyChar == (int)Keys.Enter)
            {
                if (txt.Texto.Equals("") || txt.Texto.Equals(txt.Texto_inicial))
                {
                    this.BuscarClientes("COMPLETO ", "");
                }
                else
                {
                    if (this.rdNombre.Checked)
                    {
                        this.BuscarClientes("NOMBRE", txt.Texto);
                    }
                    else
                    {
                        this.BuscarClientes("CELULAR", txt.Texto);
                    }
                }
            }
        }
Exemplo n.º 35
0
		/// <summary>
		/// Creates an editor control
		/// </summary>
		/// <param name="parentControl">Parent Control</param>
		/// <param name="value">Option value</param>
		/// <param name="pluginProperties">Plugin properties</param>
		/// <returns>Control</returns>
		public virtual Control CreateEditorControl(Control parentControl, object value, IProperties pluginProperties)
		{
			Control control = null;
			Type valueType = value.GetType();
			if (valueType == typeof(bool))
			{
				control = new CheckBox() { Checked = (bool)value, AutoCheck = true, Text = string.Empty };
			}
			else if (valueType.IsEnum)
			{
				ListItem[] listItems = Enum.GetNames(valueType)
					.Select(p => new ListItem(p, Resources.ResourceManager.GetString("Label_" + p) ?? Utils.NameToDisplayName(p)))
					.ToArray();
				ComboBox comboBox = new ComboBox();
				comboBox.DisplayMember = "Text";
				comboBox.ValueMember = "Value";
				comboBox.DropDownStyle = ComboBoxStyle.DropDownList;
				comboBox.Items.AddRange(listItems);
				comboBox.SelectedItem = listItems.SingleOrDefault(p => p.Value == value.ToString());
				control = comboBox;
			}
			else
			{
				CustomTextBox textBox = new CustomTextBox();
				textBox.Text = value.ToString();
				control = textBox;
			}

			// Return
			control.Name = FullName;
			return control;
		}
Exemplo n.º 36
0
 public abstract Value CreateValue(CustomTextBox sender);
Exemplo n.º 37
0
 public override Value CreateValue(CustomTextBox sender)
 {
     return new Int(int.Parse(sender.Text));
 }
Exemplo n.º 38
0
 public override Values.Value CreateValue(CustomTextBox sender)
 {
     return new Values.String(sender.Text);
 }