public void Initialize()
{
+ DowncastTest();
+
NavigationPropertiesTests();
OperatorTests();
}
}
+
+
+ public void DowncastTest()
+ {
+ //Create a View as a child of parent View, get it use parent.GetChildAt(i), then DownCast to View handle, but call BackgroundColor property will crash.
+ View parent = new View();
+ View[] childs = new View[5];
+
+ for (int i = 0; i < 5; i++)
+ {
+ childs[i] = new View();
+ childs[i].Name = "child_view_" + i;
+ childs[i].BackgroundColor = Color.Red;
+ parent.Add(childs[i]);
+ }
+
+ for (uint i = 0; i < parent.GetChildCount(); i++)
+ {
+ Actor child = parent.GetChildAt(i);
+ View childView = View.DownCast<View>(child);
+ if (childView)
+ {
+ Tizen.Log.Debug("NUI", "Type[" + childView.GetTypeName() + "] BGColor[" + childView.BackgroundColor.R + "]" + " Name[" + childView.Name + "]");
+ }
+ }
+
+ PushButton button = new PushButton();
+ button.LabelText = "ButtonTest!";
+ button.BackgroundColor = Color.White;
+ View parentView = new View();
+ parentView.Add(button);
+ PushButton view = PushButton.DownCast(parentView.GetChildAt(0));
+ if (view)
+ {
+ Tizen.Log.Debug("NUI", "NUI view GetTypeName= " + view.GetTypeName());
+ Tizen.Log.Debug("NUI", "NUI view LabelText= " + view.LabelText);
+ Tizen.Log.Debug("NUI", "NUI view color= " + view.BackgroundColor.R);
+ }
+ }
+
+
+
/// <summary>
/// The main entry point for the application.
/// </summary>
Tizen.Log.Debug("NUI", "pushbutton1 clicked! add handler!");
_cnt++;
FocusManager.Instance.PreFocusChange += Instance_PreFocusChange;
+ _ani.Finished += _ani_Finished;
pushButton1.LabelText = "Add Handler" + _cnt;
pushButton2.LabelText = "Remove Handler" + _cnt;
return true;
Tizen.Log.Debug("NUI", "pushbutton2 clicked! remove handler!");
_cnt--;
FocusManager.Instance.PreFocusChange -= Instance_PreFocusChange;
+ _ani.Finished -= _ani_Finished;
pushButton1.LabelText = "Add Handler" + _cnt;
pushButton2.LabelText = "Remove Handler" + _cnt;
return true;
_ani.AnimateTo(pushButton1, "Opacity", 0.0f);
_ani.AnimateTo(pushButton2, "Opacity", 0.0f);
_ani.EndAction = Animation.EndActions.Discard;
+ _ani.Finished += _ani_Finished;
}
+ private void _ani_Finished(object sender, EventArgs e)
+ {
+ Tizen.Log.Debug("NUI", "_ani finished! _cnt=" + _cnt);
+ }
+
private View Instance_PreFocusChange(object source, FocusManager.PreFocusChangeEventArgs e)
{
View nextView;
<DebugType>full</DebugType>\r
<Optimize>false</Optimize>\r
<OutputPath>bin\Debug\</OutputPath>\r
- <DefineConstants>DEBUG;TRACE</DefineConstants>\r
+ <DefineConstants>TRACE;DEBUG;DEBUG_ON;DOT_NET_CORE</DefineConstants>\r
<ErrorReport>prompt</ErrorReport>\r
<WarningLevel>4</WarningLevel>\r
</PropertyGroup>\r
// Do not make changes to this file unless you know what you are doing--modify
// the SWIG interface file instead.
//------------------------------------------------------------------------------
-#define DOT_NET_CORE
+#define DOT_NET_CORE
#if (DOT_NET_CORE)
using System.Reflection;
#endif
-#define DOT_NET_CORE
-using System;
-using System.Runtime.InteropServices;
-using System.Collections.Generic;
+#define DOT_NET_CORE
#if (DOT_NET_CORE)
using System.Reflection;
#endif
+using System;
+using System.Runtime.InteropServices;
+using System.Collections.Generic;
namespace Tizen.NUI
{
// Do not make changes to this file unless you know what you are doing--modify
// the SWIG interface file instead.
//------------------------------------------------------------------------------
-#define DOT_NET_CORE
+#define DOT_NET_CORE
#if (DOT_NET_CORE)
using System.Reflection;
#endif
-#define DOT_NET_CORE
-using System;
-using System.Runtime.InteropServices;
-using System.Collections.Generic;
+#define DOT_NET_CORE
#if (DOT_NET_CORE)
using System.Reflection;
#endif
+using System;
+using System.Runtime.InteropServices;
+using System.Collections.Generic;
namespace Tizen.NUI
{
{
if (_animationFinishedEventHandler == null)
{
+#if DEBUG_ON
+ Tizen.Log.Debug("NUI", "con1) FinishedSignal().Empty = " + FinishedSignal().Empty());
+ Tizen.Log.Debug("NUI", "con2) FinishedSignal().GetConnectionCount = " + FinishedSignal().GetConnectionCount());
+#endif
_animationFinishedEventCallback = OnFinished;
FinishedSignal().Connect(_animationFinishedEventCallback);
+#if DEBUG_ON
+ Tizen.Log.Debug("NUI", "con3) FinishedSignal().Empty = " + FinishedSignal().Empty());
+ Tizen.Log.Debug("NUI", "con4) FinishedSignal().GetConnectionCount = " + FinishedSignal().GetConnectionCount());
+#endif
}
_animationFinishedEventHandler += value;
{
_animationFinishedEventHandler -= value;
- if (_animationFinishedEventHandler == null && _animationFinishedEventCallback != null)
+ if (_animationFinishedEventHandler == null && FinishedSignal().Empty() == false)
{
+#if DEBUG_ON
+ Tizen.Log.Debug("NUI", "discon1) FinishedSignal().Empty = " + FinishedSignal().Empty());
+ Tizen.Log.Debug("NUI", "discon2) FinishedSignal().GetConnectionCount = " + FinishedSignal().GetConnectionCount());
+#endif
FinishedSignal().Disconnect(_animationFinishedEventCallback);
+#if DEBUG_ON
+ Tizen.Log.Debug("NUI", "discon3) FinishedSignal().Empty = " + FinishedSignal().Empty());
+ Tizen.Log.Debug("NUI", "discon4) FinishedSignal().GetConnectionCount = " + FinishedSignal().GetConnectionCount());
+#endif
}
}
}
{
_clickedEventHandler -= value;
- if (_clickedEventHandler == null && _clickedCallback != null)
+ if (_clickedEventHandler == null && ClickedSignal().Empty() == false)
{
ClickedSignal().Disconnect(_clickedCallback);
}
{
_pressedEventHandler -= value;
- if (_pressedEventHandler == null && _pressedCallback != null)
+ if (_pressedEventHandler == null && PressedSignal().Empty() == false)
{
this.PressedSignal().Disconnect(_pressedCallback);
}
{
_releasedEventHandler -= value;
- if (_releasedEventHandler == null && _releasedCallback != null)
+ if (_releasedEventHandler == null && ReleasedSignal().Empty() == false)
{
ReleasedSignal().Disconnect(_releasedCallback);
}
{
_stateChangedEventHandler -= value;
- if (_stateChangedEventHandler == null && _stateChangedCallback != null)
+ if (_stateChangedEventHandler == null && StateChangedSignal().Empty() == false)
{
StateChangedSignal().Disconnect(_stateChangedCallback);
}
{
if (_preFocusChangeEventHandler == null)
{
+#if DEBUG_ON
+ Tizen.Log.Debug("NUI", "con1) PreFocusChangeSignal().Empty = " + PreFocusChangeSignal().Empty());
+ Tizen.Log.Debug("NUI", "con2) PreFocusChangeSignal().GetConnectionCount = " + PreFocusChangeSignal().GetConnectionCount());
+#endif
_preFocusChangeCallback = OnPreFocusChange;
PreFocusChangeSignal().Connect(_preFocusChangeCallback);
+#if DEBUG_ON
+ Tizen.Log.Debug("NUI", "con3) PreFocusChangeSignal().Empty = " + PreFocusChangeSignal().Empty());
+ Tizen.Log.Debug("NUI", "con4) PreFocusChangeSignal().GetConnectionCount = " + PreFocusChangeSignal().GetConnectionCount());
+#endif
}
_preFocusChangeEventHandler += value;
}
remove
{
_preFocusChangeEventHandler -= value;
- if (_preFocusChangeEventHandler == null && _preFocusChangeCallback != null)
+ if (_preFocusChangeEventHandler == null && PreFocusChangeSignal().Empty() == false)
{
+#if DEBUG_ON
+ Tizen.Log.Debug("NUI", "discon1) PreFocusChangeSignal().Empty = " + PreFocusChangeSignal().Empty());
+ Tizen.Log.Debug("NUI", "discon2) PreFocusChangeSignal().GetConnectionCount = " + PreFocusChangeSignal().GetConnectionCount());
+#endif
PreFocusChangeSignal().Disconnect(_preFocusChangeCallback);
+#if DEBUG_ON
+ Tizen.Log.Debug("NUI", "discon3) PreFocusChangeSignal().Empty = " + PreFocusChangeSignal().Empty());
+ Tizen.Log.Debug("NUI", "discon4) PreFocusChangeSignal().GetConnectionCount = " + PreFocusChangeSignal().GetConnectionCount());
+#endif
}
}
}
{
_focusChangedEventHandler -= value;
- if (_focusChangedEventCallback == null && _focusChangedEventCallback != null)
+ if (_focusChangedEventCallback == null && FocusChangedSignal().Empty() == false)
{
FocusChangedSignal().Disconnect(_focusChangedEventCallback);
}
{
_focusGroupChangedEventHandler -= value;
- if (_focusGroupChangedEventCallback == null && _focusGroupChangedEventCallback != null)
+ if (_focusGroupChangedEventCallback == null && FocusGroupChangedSignal().Empty() == false)
{
FocusGroupChangedSignal().Disconnect(_focusGroupChangedEventCallback);
}
{
_focusedViewEnterKeyEventHandler -= value;
- if (_focusedViewEnterKeyEventCallback == null && _focusedViewEnterKeyEventCallback != null)
+ if (_focusedViewEnterKeyEventCallback == null && FocusedActorEnterKeySignal().Empty() == false)
{
FocusedActorEnterKeySignal().Disconnect(_focusedViewEnterKeyEventCallback);
}
return ret;
}
- public void SetCustomAlgorithm(ICustomFocusAlgorithm arg0) {
+ public void SetCustomAlgorithm(ICustomFocusAlgorithm arg0)
+ {
_customAlgorithmInterfaceWrapper = new CustomAlgorithmInterfaceWrapper();
_customAlgorithmInterfaceWrapper.SetFocusAlgorithm(arg0);
remove
{
_popUpOutsideTouchedEventHandler -= value;
- if (_popUpOutsideTouchedEventHandler == null && _popUpOutsideTouchedEventCallbackDelegate != null)
+ if (_popUpOutsideTouchedEventHandler == null && OutsideTouchedSignal().Empty() == false)
{
this.OutsideTouchedSignal().Disconnect(_popUpOutsideTouchedEventCallbackDelegate);
}
remove
{
_popUpShowingEventHandler -= value;
- if (_popUpShowingEventHandler == null && _popUpShowingEventCallbackDelegate != null)
+ if (_popUpShowingEventHandler == null && ShowingSignal().Empty() == false)
{
ShowingSignal().Disconnect(_popUpShowingEventCallbackDelegate);
}
remove
{
_popUpShownEventHandler -= value;
- if (_popUpShownEventHandler == null && _popUpShownEventCallbackDelegate != null)
+ if (_popUpShownEventHandler == null && ShownSignal().Empty() == false)
{
ShownSignal().Disconnect(_popUpShownEventCallbackDelegate);
}
remove
{
_popUpHidingEventHandler -= value;
- if (_popUpHidingEventHandler == null && _popUpHidingEventCallbackDelegate != null)
+ if (_popUpHidingEventHandler == null && HidingSignal().Empty() == false)
{
HidingSignal().Disconnect(_popUpHidingEventCallbackDelegate);
}
remove
{
_popUpHiddenEventHandler -= value;
- if (_popUpHiddenEventHandler == null && _popUpHiddenEventCallbackDelegate != null)
+ if (_popUpHiddenEventHandler == null && HiddenSignal().Empty() == false)
{
HiddenSignal().Disconnect(_popUpHiddenEventCallbackDelegate);
}
remove
{
_progressBarValueChangedEventHandler -= value;
- if (_progressBarValueChangedEventHandler == null && _progressBarValueChangedCallbackDelegate != null)
+ if (_progressBarValueChangedEventHandler == null && ValueChangedSignal().Empty() == false)
{
ValueChangedSignal().Disconnect(_progressBarValueChangedCallbackDelegate);
}
remove
{
_scrollBarPanFinishedEventHandler -= value;
- if (_scrollBarPanFinishedEventHandler == null && _scrollBarPanFinishedEventCallbackDelegate != null)
+ if (_scrollBarPanFinishedEventHandler == null && PanFinishedSignal().Empty() == false)
{
PanFinishedSignal().Disconnect(_scrollBarPanFinishedEventCallbackDelegate);
}
remove
{
_scrollBarScrollPositionIntervalReachedEventHandler -= value;
- if (_scrollBarScrollPositionIntervalReachedEventHandler == null && _scrollBarScrollPositionIntervalReachedEventCallbackDelegate != null)
+ if (_scrollBarScrollPositionIntervalReachedEventHandler == null && ScrollPositionIntervalReachedSignal().Empty() == false)
{
ScrollPositionIntervalReachedSignal().Disconnect(_scrollBarScrollPositionIntervalReachedEventCallbackDelegate);
}
remove
{
_sliderValueChangedEventHandler -= value;
- if (_sliderValueChangedEventHandler == null && _sliderValueChangedCallbackDelegate != null)
+ if (_sliderValueChangedEventHandler == null && ValueChangedSignal().Empty() == false)
{
ValueChangedSignal().Disconnect(_sliderValueChangedCallbackDelegate);
}
remove
{
_sliderSlidingFinishedEventHandler -= value;
- if (_sliderSlidingFinishedEventHandler == null && _sliderSlidingFinishedCallbackDelegate != null)
+ if (_sliderSlidingFinishedEventHandler == null && SlidingFinishedSignal().Empty() == false)
{
SlidingFinishedSignal().Disconnect(_sliderSlidingFinishedCallbackDelegate);
}
remove
{
_sliderMarkReachedEventHandler -= value;
- if (_sliderMarkReachedEventHandler == null && _sliderMarkReachedCallbackDelegate != null)
+ if (_sliderMarkReachedEventHandler == null && MarkReachedSignal().Empty() == false)
{
MarkReachedSignal().Disconnect(_sliderMarkReachedCallbackDelegate);
}
remove
{
_stageTouchHandler -= value;
- if (_stageTouchHandler == null && _stageTouchCallbackDelegate != null)
+ if (_stageTouchHandler == null && TouchSignal().Empty() == false)
{
TouchSignal().Disconnect(_stageTouchCallbackDelegate);
}
remove
{
_stageWheelHandler -= value;
- if (_stageWheelHandler == null && _stageWheelCallbackDelegate != null)
+ if (_stageWheelHandler == null && WheelEventSignal().Empty() == false)
{
WheelEventSignal().Disconnect(_stageWheelCallbackDelegate);
}
remove
{
_stageKeyHandler -= value;
- if (_stageKeyHandler == null && _stageKeyCallbackDelegate != null)
+ if (_stageKeyHandler == null && KeyEventSignal().Empty() == false)
{
KeyEventSignal().Disconnect(_stageKeyCallbackDelegate);
}
remove
{
_stageEventProcessingFinishedEventHandler -= value;
- if (_stageEventProcessingFinishedEventHandler == null && _stageEventProcessingFinishedEventCallbackDelegate != null)
+ if (_stageEventProcessingFinishedEventHandler == null && EventProcessingFinishedSignal().Empty() == false)
{
EventProcessingFinishedSignal().Disconnect(_stageEventProcessingFinishedEventCallbackDelegate);
}
remove
{
_stageContextLostEventHandler -= value;
- if (_stageContextLostEventHandler == null && _stageContextLostEventCallbackDelegate != null)
+ if (_stageContextLostEventHandler == null && ContextLostSignal().Empty() == false)
{
ContextLostSignal().Disconnect(_stageContextLostEventCallbackDelegate);
}
remove
{
_stageContextRegainedEventHandler -= value;
- if (_stageContextRegainedEventHandler == null && _stageContextRegainedEventCallbackDelegate != null)
+ if (_stageContextRegainedEventHandler == null && ContextRegainedSignal().Empty() == false)
{
this.ContextRegainedSignal().Disconnect(_stageContextRegainedEventCallbackDelegate);
}
remove
{
_stageSceneCreatedEventHandler -= value;
- if (_stageSceneCreatedEventHandler == null && _stageSceneCreatedEventCallbackDelegate != null)
+ if (_stageSceneCreatedEventHandler == null && SceneCreatedSignal().Empty() == false)
{
SceneCreatedSignal().Disconnect(_stageSceneCreatedEventCallbackDelegate);
}
remove
{
_styleManagerStyleChangedEventHandler -= value;
- if (_styleManagerStyleChangedEventHandler == null && _styleManagerStyleChangedCallbackDelegate != null)
+ if (_styleManagerStyleChangedEventHandler == null && StyleChangedSignal().Empty() == false)
{
StyleChangedSignal().Disconnect(_styleManagerStyleChangedCallbackDelegate);
}
remove
{
_textEditorTextChangedEventHandler -= value;
- if (_textEditorTextChangedEventHandler == null && _textEditorTextChangedCallbackDelegate != null)
+ if (_textEditorTextChangedEventHandler == null && TextChangedSignal().Empty() == false)
{
TextChangedSignal().Disconnect(_textEditorTextChangedCallbackDelegate);
}
remove
{
_textFieldTextChangedEventHandler -= value;
- if (_textFieldTextChangedEventHandler == null && _textFieldTextChangedCallbackDelegate != null)
+ if (_textFieldTextChangedEventHandler == null && TextChangedSignal().Empty() == false)
{
TextChangedSignal().Disconnect(_textFieldTextChangedCallbackDelegate);
}
}
remove
{
- if (_textFieldMaxLengthReachedEventHandler == null && _textFieldMaxLengthReachedCallbackDelegate != null)
+ if (_textFieldMaxLengthReachedEventHandler == null && MaxLengthReachedSignal().Empty() == false)
{
this.MaxLengthReachedSignal().Disconnect(_textFieldMaxLengthReachedCallbackDelegate);
}
remove
{
_timerTickEventHandler -= value;
- if (_timerTickEventHandler == null && _timerTickCallbackDelegate != null)
+ if (_timerTickEventHandler == null && TickSignal().Empty() == false)
{
TickSignal().Disconnect(_timerTickCallbackDelegate);
}
remove
{
_videoViewFinishedEventHandler -= value;
- if (_videoViewFinishedEventHandler == null && _videoViewFinishedCallbackDelegate != null)
+ if (_videoViewFinishedEventHandler == null && FinishedSignal().Empty() == false)
{
FinishedSignal().Disconnect(_videoViewFinishedCallbackDelegate);
}
{
_keyInputFocusGainedEventHandler -= value;
- if (_keyInputFocusGainedEventHandler == null && _keyInputFocusGainedCallback != null)
+ if (_keyInputFocusGainedEventHandler == null && KeyInputFocusGainedSignal().Empty() == false)
{
this.KeyInputFocusGainedSignal().Disconnect(_keyInputFocusGainedCallback);
}
{
_keyInputFocusLostEventHandler -= value;
- if (_keyInputFocusLostEventHandler == null && _keyInputFocusLostCallback != null)
+ if (_keyInputFocusLostEventHandler == null && KeyInputFocusLostSignal().Empty() == false)
{
this.KeyInputFocusLostSignal().Disconnect(_keyInputFocusLostCallback);
}
{
_keyEventHandler -= value;
- if (_keyEventHandler == null && _keyCallback != null)
+ if (_keyEventHandler == null && KeyEventSignal().Empty() == false)
{
this.KeyEventSignal().Disconnect(_keyCallback);
}
{
_onRelayoutEventHandler -= value;
- if (_onRelayoutEventHandler == null && _onRelayoutEventCallback != null)
+ if (_onRelayoutEventHandler == null && OnRelayoutSignal().Empty() == false)
{
this.OnRelayoutSignal().Disconnect(_onRelayoutEventCallback);
}
{
_touchDataEventHandler -= value;
- if (_touchDataEventHandler == null && _touchDataCallback != null)
+ if (_touchDataEventHandler == null && TouchSignal().Empty() == false)
{
this.TouchSignal().Disconnect(_touchDataCallback);
}
{
_hoverEventHandler -= value;
- if (_hoverEventHandler == null && _hoverEventCallback != null)
+ if (_hoverEventHandler == null && HoveredSignal().Empty() == false)
{
this.HoveredSignal().Disconnect(_hoverEventCallback);
}
{
_wheelEventHandler -= value;
- if (_wheelEventHandler == null && _wheelEventCallback != null)
+ if (_wheelEventHandler == null && WheelEventSignal().Empty() == false)
{
this.WheelEventSignal().Disconnect(_wheelEventCallback);
}
{
_onStageEventHandler -= value;
- if (_onStageEventHandler == null && _onStageEventCallback != null)
+ if (_onStageEventHandler == null && OnStageSignal().Empty() == false)
{
this.OnStageSignal().Disconnect(_onStageEventCallback);
}
{
_offStageEventHandler -= value;
- if (_offStageEventHandler == null && _offStageEventCallback != null)
+ if (_offStageEventHandler == null && OffStageSignal().Empty() == false)
{
this.OffStageSignal().Disconnect(_offStageEventCallback);
}
}
/// <summary>
- /// Quries whether the view has key input focus.
+ /// Quries whether the view has focus.
/// </summary>
- /// <returns>true if this view has keyboard input focus</returns>
- public bool HasKeyInputFocus()
+ /// <returns>true if this view has focus</returns>
+ public bool HasFocus()
{
bool ret = NDalicPINVOKE.View_HasKeyInputFocus(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
{
_windowFocusChangedEventHandler -= value;
- if (_windowFocusChangedEventHandler == null && _windowFocusChangedEventCallback != null)
+ if (_windowFocusChangedEventHandler == null && WindowFocusChangedSignal().Empty() == false)
{
WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback);
}