add
This commit is contained in:
59
Assets/CoolapeFrame/Scripts/ui/form/CLUIElementTime.cs
Normal file
59
Assets/CoolapeFrame/Scripts/ui/form/CLUIElementTime.cs
Normal file
@@ -0,0 +1,59 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using System;
|
||||
using Coolape;
|
||||
using System.Collections.Generic;
|
||||
|
||||
[RequireComponent (typeof(UIInput))]
|
||||
public class CLUIElementTime : UIEventListener
|
||||
{
|
||||
public List<EventDelegate> onChange = new List<EventDelegate>();
|
||||
UIInput _input;
|
||||
|
||||
public UIInput input {
|
||||
get {
|
||||
if (_input == null) {
|
||||
_input = GetComponent<UIInput> ();
|
||||
if (_input != null) {
|
||||
_input.enabled = false;
|
||||
}
|
||||
}
|
||||
return _input;
|
||||
}
|
||||
}
|
||||
|
||||
public void OnClick ()
|
||||
{
|
||||
Hashtable map = new Hashtable();
|
||||
map["time"] = input.value;
|
||||
map["callback"]= (Callback)onGetDate;
|
||||
CLPanelManager.getPanelAsy("PanelPopTime", (Callback)onGetCalenderPanel, map);
|
||||
}
|
||||
|
||||
public static void onGetCalenderPanel(params object[] orgs)
|
||||
{
|
||||
CLPanelBase p = orgs[0] as CLPanelBase;
|
||||
Hashtable map = orgs[1] as Hashtable;
|
||||
if (p == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
p.setData(map);
|
||||
CLPanelManager.showTopPanel(p, true, true);
|
||||
}
|
||||
|
||||
public void onGetDate (params object[] paras)
|
||||
{
|
||||
input.value = paras [0].ToString ();
|
||||
ExecuteOnChange();
|
||||
}
|
||||
|
||||
|
||||
protected void ExecuteOnChange()
|
||||
{
|
||||
if (EventDelegate.IsValid(onChange))
|
||||
{
|
||||
EventDelegate.Execute(onChange, gameObject); // modify by chenbin
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user