- public override void OnInitialize()
- {
- // Initialize the propertiesControl
- _arrowImage = "./images/arrow.png";
- _textBackgroundColor = new Color(0.6f, 0.6f, 0.6f, 1.0f);
- _currentValue = 0;
- _minValue = 0;
- _maxValue = 0;
- _singleStep = 1;
- _maxTextLength = 0;
-
- // Create image visual for the arrow keys
- _arrowVisualPropertyIndex = RegisterProperty("ArrowImage", new Dali.Property.Value(_arrowImage), Dali.Property.AccessMode.READ_WRITE);
- _arrowVisual = VisualFactory.Get().CreateVisual( _arrowImage, new Uint16Pair(150, 150) );
- RegisterVisual( _arrowVisualPropertyIndex, _arrowVisual );
-
- // Create a text field
- _textField = new TextField();
- _textField.ParentOrigin = NDalic.ParentOriginCenter;
- _textField.AnchorPoint = NDalic.AnchorPointCenter;
- _textField.WidthResizePolicy = "SIZE_RELATIVE_TO_PARENT";
- _textField.HeightResizePolicy = "SIZE_RELATIVE_TO_PARENT";
- _textField.SizeModeFactor = new Vector3( 1.0f, 0.45f, 1.0f );
- _textField.PlaceholderText = "----";
- _textField.BackgroundColor = _textBackgroundColor;
- _textField.HorizontalAlignment = "Center";
- _textField.VerticalAlignment = "Center";
- _textField.SetKeyboardFocusable(true);
- _textField.Name = "_textField";
-
- this.Add(_textField);
-
- _textField.KeyInputFocusGained += TextFieldKeyInputFocusGained;
- _textField.KeyInputFocusLost += TextFieldKeyInputFocusLost;
- }