Inheritance: MonoBehaviour
 /// <summary>
 /// Creates a visual line text element with the specified length.
 /// It uses the <see cref="ITextRunConstructionContext.VisualLine"/> and its
 /// <see cref="VisualLineElement.RelativeTextOffset"/> to find the actual text string.
 /// </summary>
 public VisualLinkLineText(string link, VisualLine parentVisualLine, int length, ClickHandler clickHandler)
     : base(parentVisualLine, length)
 {
     RequireControlModifierForClick = false;
     Text     = link;
     _clicked = clickHandler;
 }
Beispiel #2
0
        private void OnCancelBtnClick(EventContext context)
        {
            ClickHandler clickHandler = this._clickHandler;

            this.Hide();
            clickHandler?.Invoke(1);
        }
Beispiel #3
0
 public void SetCardItem(SpecialCardItem item)
 {
     specialCard = item;
     ClickHandler.Get(item.gameObject).onClickDown = OnClickDown;
     ClickHandler.Get(item.gameObject).onClickUp   = OnClickUp;
     mark = DataManager.GetInstance().GetForceMark();
 }
Beispiel #4
0
    // Use this for initialization
    void Start()
    {
        redButtons = new List <GameObject> ();
        for (int i = 0; i < Red.transform.childCount; i++)
        {
            redButtons.Add(Red.transform.GetChild(i).gameObject);
        }
        greenButtons = new List <GameObject> ();
        for (int i = 0; i < Green.transform.childCount; i++)
        {
            greenButtons.Add(Green.transform.GetChild(i).gameObject);
        }
        List <CollectionEntry> collection = new List <CollectionEntry> ();
        Status status;

        for (int i = 1; i < 5; i++)
        {
            if (i % 2 == 0)
            {
                status = Status.red;
            }
            else
            {
                status = Status.green;
            }
            CollectionEntry entry = new CollectionEntry("id" + i.ToString(), "text" + i.ToString(), status);
            collection.Add(entry);
        }
        Click = testHandler;
        setData(collection);
    }
 public ClickableCollectionComponent(Rectangle area, ClickHandler handler = null, List <IMenuComponent> components = null) : base(area, components)
 {
     if (handler != null)
     {
         Handler += handler;
     }
 }
 public ClickableCollectionComponent(Point size, ClickHandler handler = null, List <IMenuComponent> components = null) : base(size, components)
 {
     if (handler != null)
     {
         Handler += handler;
     }
 }
Beispiel #7
0
    public void Init(SquadData squadData)
    {
        _squadData = squadData;

        _childrenList = GetComponentsInChildren <Transform>(true);

        squadData.SquadFiller  = _childrenList[1].gameObject;
        squadData.ZoneAttack   = _childrenList[2].gameObject;
        squadData.Highlighting = _childrenList[7].gameObject;
        _effectSmoke           = _childrenList[8].gameObject.GetComponent <ParticleSystem>();

        _squadControlPanelUI = squadData.SquadUI;
        _clickHandler        = squadData.ClickHandler;

        _squadMovement     = gameObject.AddComponent <SquadMovementPlayer>();
        _squadSelected     = gameObject.AddComponent <SquadSelectedPlayer>();
        _squadControlPanel = gameObject.AddComponent <SquadControlPanel>();
        _squadWeapon       = gameObject.AddComponent <SquadWeapon>();
        _damageDisplay     = GetComponent <DamageDisplay>();

        squadData.SquadFiller.GetComponent <SquadFiller>().Init(Color.blue);
        _squadMovement.Init(squadData);
        _squadSelected.Init(squadData);
        _squadControlPanel.Init(squadData);
        _squadWeapon.Init(squadData);
    }
        public static MonthView Create(ViewGroup parent, LayoutInflater inflater, string weekdayNameFormat,
            DateTime today, ClickHandler handler, int dividerColor, int dayBackgroundResId,
            int dayTextColorResId, int titleTextColor, int headerTextColor)
        {
            var view = (MonthView) inflater.Inflate(Resource.Layout.month, parent, false);
            view.setDividerColor(dividerColor);
            view.setDayTextColor(dayTextColorResId);
            view.setTitleTextColor(titleTextColor);
            view.setHeaderTextColor(headerTextColor);

            if (dayBackgroundResId != 0) {
                view.setDayBackground(dayBackgroundResId);
            }

            var originalDay = today;

            var firstDayOfWeek = (int) CultureInfo.CurrentCulture.DateTimeFormat.FirstDayOfWeek;

            var headerRow = (CalendarRowView) view._grid.GetChildAt(0);

            for (int i = 0; i < 7; i++) {
                var offset = firstDayOfWeek - (int) today.DayOfWeek + i;
                today = today.AddDays(offset);
                var textView = (TextView) headerRow.GetChildAt(i);
                textView.Text = today.ToString(weekdayNameFormat);
                today = originalDay;
            }
            view._clickHandler = handler;
            return view;
        }
Beispiel #9
0
        public DevCenter()
        {
            InitializeComponent();

            this.Files = new Dictionary<Object, String>();

            StringBuilder openFileFilter = new StringBuilder();
            openFileFilter.Append("ScriptCenter Files (*");
            openFileFilter.Append(ScriptManifest.DefaultExtension);
            openFileFilter.Append(", *");
            openFileFilter.Append(ScriptPackage.DefaultExtension);
            openFileFilter.Append(", *");
            openFileFilter.Append(ScriptRepository.DefaultExtension);
            openFileFilter.Append(")|*");
            openFileFilter.Append(ScriptManifest.DefaultExtension);
            openFileFilter.Append(";*");
            openFileFilter.Append(ScriptPackage.DefaultExtension);
            openFileFilter.Append(";*");
            openFileFilter.Append(ScriptRepository.DefaultExtension);
            openFileDialog.Filter = openFileFilter.ToString();

            this.titlePanel.Visible = false;

            this.filesTree.AfterSelect += new TreeViewEventHandler(filesTree_AfterSelect);
            this.newButtonClickHandler = newManifestButton_Click;
        }
Beispiel #10
0
 private async void OnButtonClick(object sender, EventArgs e)
 {
     if (ClickHandler != null)
     {
         await ClickHandler.Invoke(Value as T);
     }
 }
Beispiel #11
0
 private static void RaiseClick(IntPtr cPtr, IntPtr sender, IntPtr e)
 {
     try {
         if (!_Click.ContainsKey(cPtr))
         {
             throw new System.InvalidOperationException("Delegate not registered for Click event");
         }
         if (sender == System.IntPtr.Zero && e == System.IntPtr.Zero)
         {
             _Click.Remove(cPtr);
             return;
         }
         if (Noesis.Extend.Initialized)
         {
             ClickHandler handler = _Click[cPtr];
             if (handler != null)
             {
                 handler(Noesis.Extend.GetProxy(sender, false), new RoutedEventArgs(e, false));
             }
         }
     }
     catch (System.Exception exception) {
         Noesis.Error.SetNativePendingError(exception);
     }
 }
Beispiel #12
0
        protected ButtonWidget MakeBack(string text, Font font, ClickHandler onClick)
        {
            int width = game.UseClassicOptions ? 400 : 200;

            return(ButtonWidget.Create(game, width, text, font, onClick)
                   .SetLocation(Anchor.Centre, Anchor.Max, 0, 25));
        }
Beispiel #13
0
 public Paint()
 {
     InitializeComponent();
     g1           = pictureBox.CreateGraphics();
     clickHandler = new ClickHandler(Mark_circle);
     Reset();
 }
Beispiel #14
0
 // Use this for initialization
 void Start()
 {
     dotScale = transform.localScale;
     col      = gameObject.GetComponent <BoxCollider2D>();
     colScale = col.size;
     cHandler = GameObject.Find("ClickHandler").GetComponent <ClickHandler>();
 }
Beispiel #15
0
        public static MonthView Create(ViewGroup parent, LayoutInflater inflater, string weekdayNameFormat,
                                       DateTime today, ClickHandler handler, int dividerColor, int dayBackgroundResId,
                                       int dayTextColorResId, int titleTextColor, int headerTextColor)
        {
            var view = (MonthView)inflater.Inflate(Resource.Layout.month, parent, false);

            view.setDividerColor(dividerColor);
            view.setDayTextColor(dayTextColorResId);
            view.setTitleTextColor(titleTextColor);
            view.setHeaderTextColor(headerTextColor);

            if (dayBackgroundResId != 0)
            {
                view.setDayBackground(dayBackgroundResId);
            }

            var originalDay = today;

            var firstDayOfWeek = (int)CultureInfo.CurrentCulture.DateTimeFormat.FirstDayOfWeek;

            var headerRow = (CalendarRowView)view._grid.GetChildAt(0);

            for (int i = 0; i < 7; i++)
            {
                var offset = firstDayOfWeek - (int)today.DayOfWeek + i;
                today = today.AddDays(offset);
                var textView = (TextView)headerRow.GetChildAt(i);
                textView.Text = today.ToString(weekdayNameFormat).ToUpper();
                today         = originalDay;
            }
            view._clickHandler = handler;
            return(view);
        }
Beispiel #16
0
 private void SubscribeEvent()
 {
     CancelEvent += new ClickHandler(UCPersonnelView_CancelEvent);
     EditEvent   += new ClickHandler(UCWareHouseView_EditEvent);
     DeleteEvent += new ClickHandler(UCWareHouseView_DeleteEvent);
     StatusEvent += new ClickHandler(UCWareHouseView_StatusEvent);
 }
Beispiel #17
0
        public CalendarPickerView(Context context, IAttributeSet attrs)
            : base(context, attrs)
        {
            ResourceIdManager.UpdateIdValues();
            _context           = context;
            MyAdapter          = new MonthAdapter(context, this);
            base.Adapter       = MyAdapter;
            base.Divider       = null;
            base.DividerHeight = 0;

            var bgColor = base.Resources.GetColor(Resource.Color.calendar_bg);

            base.SetBackgroundColor(bgColor);
            base.CacheColorHint = bgColor;

            MonthNameFormat        = base.Resources.GetString(Resource.String.month_name_format);
            WeekdayNameFormat      = base.Resources.GetString(Resource.String.day_name_format);
            FullDateFormat         = CultureInfo.CurrentCulture.DateTimeFormat.LongDatePattern;
            ClickHandler          += OnCellClicked;
            OnInvalidDateSelected += OnInvalidateDateClicked;

            if (base.IsInEditMode)
            {
                Init(DateTime.Now, DateTime.Now.AddYears(1)).WithSelectedDate(DateTime.Now);
            }
        }
Beispiel #18
0
        private void OnConfirmBtnClick(EventContext context)
        {
            ClickHandler clickHandler = this._clickHandler;

            this.Hide();
            clickHandler?.Invoke(0);
        }
        public CalendarPickerView(Context context, IAttributeSet attrs)
            : base(context, attrs)
        {
            ResourceIdManager.UpdateIdValues();
            _context = context;
            MyAdapter = new MonthAdapter(context, this);
            base.Adapter = MyAdapter;
            base.Divider = null;
            base.DividerHeight = 0;

            var bgColor = base.Resources.GetColor(Resource.Color.calendar_bg);
            base.SetBackgroundColor(bgColor);
            base.CacheColorHint = bgColor;

            MonthNameFormat = base.Resources.GetString(Resource.String.month_name_format);
            WeekdayNameFormat = base.Resources.GetString(Resource.String.day_name_format);
            FullDateFormat = CultureInfo.CurrentCulture.DateTimeFormat.LongDatePattern;
            ClickHandler += OnCellClicked;
            OnInvalidDateSelected += OnInvalidateDateClicked;

            if (base.IsInEditMode)
            {
                Init(DateTime.Now, DateTime.Now.AddYears(1)).WithSelectedDate(DateTime.Now);
            }
        }
Beispiel #20
0
        private void AddClickHandler(GameObject target, Action callback)
        {
            ClickHandler handler = null;
            var          canvas  = target.GetComponentInParent <Canvas> ();

            if (null != canvas)
            {
                handler = target.AddComponent <ClickHandlerUI> ();
            }
            else
            {
                var collider = target.GetComponent <Collider> ();
                if (null != collider)
                {
                    handler = target.AddComponent <ClickHandler3D> ();
                }
                else
                {
                    var collider2D = target.GetComponent <Collider2D> ();
                    if (null != collider2D)
                    {
                        handler = target.AddComponent <ClickHandler2D> ();
                    }
                }
            }
            if (null != handler)
            {
                handler.OnClick = callback;
                m_Handlers.Add(handler);
            }
            else
            {
                Log.W("Couldn't be to clickable. {0}", target.name);
            }
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="CalendarPickerView"/> class.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="attrs">The attrs.</param>
        public CalendarPickerView(Context context, IAttributeSet attrs)
            : base(context, attrs)
        {
            ResourceIdManager.UpdateIdValues();
            _context         = context;
            _styleDescriptor = new StyleDescriptor();
            MyAdapter        = new MonthAdapter(context, this);
            base.Adapter     = MyAdapter;


            //SetPadding(0, 0, 0, 0);

            var bgColor = base.Resources.GetColor(Resource.Color.calendar_bg);

            base.SetBackgroundColor(bgColor);

            MonthNameFormat        = base.Resources.GetString(Resource.String.month_name_format);
            WeekdayNameFormat      = base.Resources.GetString(Resource.String.day_name_format);
            FullDateFormat         = CultureInfo.CurrentCulture.DateTimeFormat.LongDatePattern;
            ClickHandler          += OnCellClicked;
            OnInvalidDateSelected += OnInvalidateDateClicked;
            SetOnPageChangeListener(new OnPageChangeListener(this));



            if (base.IsInEditMode)
            {
                Init(DateTime.Now, DateTime.Now.AddYears(1), new DayOfWeek[] { }).WithSelectedDate(DateTime.Now);
            }
        }
Beispiel #22
0
        public MruMenu(MenuItem _recentFileMenuItem, ClickHandler _clickedHandler, String _registryKeyName, bool loadFromRegistry, int _maxEntries)
        {
            if (_recentFileMenuItem == null)
            {
                throw new ArgumentNullException("recentFileMenuItem");
            }

            if (_recentFileMenuItem.Parent == null)
            {
                throw new ArgumentException("recentFileMenuItem is not part of a menu");
            }

            recentFileMenuItem             = _recentFileMenuItem;
            recentFileMenuItem.Checked     = false;
            recentFileMenuItem.Enabled     = false;
            recentFileMenuItem.DefaultItem = false;

            maxEntries = _maxEntries;
            onClicked += _clickedHandler;

            if (_registryKeyName != null)
            {
                registryKeyName = _registryKeyName;
                if (loadFromRegistry)
                {
                    LoadFromRegistry();
                }
            }
        }
Beispiel #23
0
 public static ClickHandler Instance()
 {
     if (sInstance == null) {
         sInstance = new ClickHandler ();
     }
     return sInstance;
 }
 private void SubscribeEvent()
 {
     CancelEvent += new ClickHandler(UCPersonnelView_CancelEvent);
     EditEvent += new ClickHandler(UCWareHouseView_EditEvent);
     DeleteEvent += new ClickHandler(UCWareHouseView_DeleteEvent);
     StatusEvent += new ClickHandler(UCWareHouseView_StatusEvent);
 }
Beispiel #25
0
    void LoadState()
    {
        string     destination = Application.persistentDataPath + "/save.dat";
        FileStream file;

        if (File.Exists(destination))
        {
            file = File.OpenRead(destination);
        }
        else
        {
            Debug.LogError("File not found");
            return;
        }

        BinaryFormatter bf     = new BinaryFormatter();
        int             loaded = (int)bf.Deserialize(file);

        file.Close();

        Debug.Log("Loading " + loaded);
        ClickHandler ch = counterState.GetComponent <ClickHandler>();

        ch.SetCounter(loaded);
    }
Beispiel #26
0
        protected ButtonWidget MakeTitle(int dir, int y, string text, ClickHandler onClick)
        {
            ButtonWidget widget = ButtonWidget.Create(game, 160 * dir, y, 301, 41, text, Anchor.Centre,
                                                      Anchor.Centre, titleFont, onClick);

            return(widget);
        }
        private void Awake()
        {
            unitsProtoData = Data.DataManager.GetInstance().unitsProtoData;

            bgButton           = transform.Find("BgButton").GetComponent <Button>();
            playBackButton     = transform.Find("PlayBackButton").GetComponent <Button>();
            battleResultButton = transform.Find("BattleResultButton").GetComponent <Button>();
            playerIcon         = transform.Find("PlayerIcon").GetComponent <Image>();
            winIcon            = transform.Find("WinIcon").GetComponent <Image>();
            failIcon           = transform.Find("FailIcon").GetComponent <Image>();
            deathCountText     = transform.Find("DeathCountText").GetComponent <Text>();
            battleModeText     = transform.Find("BattleModeText").GetComponent <Text>();
            battleScoreText    = transform.Find("BattleScoreText").GetComponent <Text>();
            dateText           = transform.Find("DateText").GetComponent <Text>();
            unitTransformObj   = transform.Find("UnitTransform").gameObject;
            unitTransformObj.SetActive(false);
            unitIconArray[0] = transform.Find("UnitTransform/UnitGroup/UnitIcon1/UnitIcon").GetComponent <Image>();
            unitIconArray[1] = transform.Find("UnitTransform/UnitGroup/UnitIcon2/UnitIcon").GetComponent <Image>();
            unitIconArray[2] = transform.Find("UnitTransform/UnitGroup/UnitIcon3/UnitIcon").GetComponent <Image>();
            unitIconArray[3] = transform.Find("UnitTransform/UnitGroup/UnitIcon4/UnitIcon").GetComponent <Image>();
            unitIconArray[4] = transform.Find("UnitTransform/UnitGroup/UnitIcon5/UnitIcon").GetComponent <Image>();
            unitIconArray[5] = transform.Find("UnitTransform/UnitGroup/UnitIcon6/UnitIcon").GetComponent <Image>();
            unitIconArray[6] = transform.Find("UnitTransform/UnitGroup/UnitIcon7/UnitIcon").GetComponent <Image>();
            unitIconArray[7] = transform.Find("UnitTransform/UnitGroup/UnitIcon8/UnitIcon").GetComponent <Image>();
            unitIconArray[8] = transform.Find("UnitTransform/UnitGroup/UnitIcon9/UnitIcon").GetComponent <Image>();

            playBackButton.AddListener(ClickPlayBackButton);
            battleResultButton.AddListener(ClickBattleResultButton);

            ClickHandler.Get(bgButton.gameObject).onClickDown = ClickBgButtonDown;
            ClickHandler.Get(bgButton.gameObject).onClickUp   = ClickBgButtonUp;
        }
 public void CloseJungleTrainingButton()
 {
     SetGrayMode4(true);
     ClickHandler.Get(modeButton4.gameObject).onClickDown = null;
     ClickHandler.Get(modeButton4.gameObject).onClickUp   = null;
     modeButton4.onClick.RemoveListener(OnClickModeBt4);
     mode4Image.SetGray(true);
 }
 public void CloseSkillTrainingButton()
 {
     SetGrayMode3(true);
     ClickHandler.Get(modeButton3.gameObject).onClickDown = null;
     ClickHandler.Get(modeButton3.gameObject).onClickUp   = null;
     modeButton3.onClick.RemoveListener(OnClickModeBt3);
     mode3Image.SetGray(true);
 }
 public void CloseBuildingTrainingButton()
 {
     SetGrayMode2(true);
     ClickHandler.Get(modeButton2.gameObject).onClickDown = null;
     ClickHandler.Get(modeButton2.gameObject).onClickUp   = null;
     modeButton2.onClick.RemoveListener(OnClickModeBt2);
     mode2Image.SetGray(true);
 }
 public void OpenJungleTrainingButton()
 {
     SetGrayMode4(true);
     ClickHandler.Get(modeButton4.gameObject).onClickDown = OnClickDownModeBt4;
     ClickHandler.Get(modeButton4.gameObject).onClickUp   = OnClickUpModeBt4;
     modeButton4.AddListener(OnClickModeBt4);
     mode4Image.SetGray(false);
 }
 public ClickableTextureComponent(Rectangle area, Texture2D texture, ClickHandler handler = null, Rectangle?crop = null, bool scaleOnHover = true) : base(area, texture, crop)
 {
     if (handler != null)
     {
         Handler += handler;
     }
     ScaleOnHover = scaleOnHover;
 }
    // Start is called before the first frame update
    void Start()
    {
        Texture2D t2d = Resources.Load <Texture2D>("TestClickMask");

        ClickHandler.Get(this.gameObject).OnClickAction.AddListener(CheckIsBlocked);
        tms = transform.GetOrAdd <TextureMaskSampler>();
        tms.Init();
    }
Beispiel #34
0
 public ClickableConfirmComponent(Point position, ClickHandler handler = null)
     : base(
         new Rectangle(position.X, position.Y, 16, 16),
         Game1.mouseCursors,
         handler,
         Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, 46))
 {
 }
Beispiel #35
0
        private void toolStripButtonLine_Click(object sender, EventArgs e)
        {
            m_currentCurve = null;

            _clickHandler = Line.Linie_ClickHandler;
            /* Bei jeder Maus-Klick wird die Anzeige im Toolstrip geändert*/
            StatusManager.Instance.SetStatus(Line.StartMessage);
        }
 public UCVehicleModelsAddOrEdit(WindowStatus status, string vm_id, UCVehicleModelsManage uc)
 {
     InitializeComponent();
     this.vm_id = vm_id;
     this.windowStatus = status;
     this.SaveEvent += new ClickHandler(UCVehicleModelsAddOrEdit_SaveEvent);
     CancelEvent += new ClickHandler(UCVehicleModelsAddOrEdit_CancelEvent);
     this.uc = uc;
 }
 public UCContactsAddOrEdit(WindowStatus status, string contactsId, UCContactsManage uc)
 {
     InitializeComponent();
     this.status = status;
     this.contID = contactsId;
     base.SaveEvent += new ClickHandler(UCContactsAddOrEdit_SaveEvent);
     CancelEvent += new ClickHandler(UCContactsAddOrEdit_CancelEvent);
     this.uc = uc;
 }
Beispiel #38
0
 /// <summary>
 /// Shows a messagebox with the OK and cancel options. Action is only performed on OK.
 /// </summary>
 public static void ShowOKCancel(LayerContainer Container, string Title, string Message, ClickHandler OnOKClick, MessageBoxStyle Style)
 {
     MessageBoxOptions mbo = new MessageBoxOptions();
     mbo.AddButton("OK", OnOKClick);
     mbo.AddButton("Cancel", null);
     mbo.Title = Title;
     mbo.Message = Message;
     mbo.Style = Style;
     Show(Container, mbo);
 }
Beispiel #39
0
 public static ButtonWidget Create( Game game, int x, int y, int width, int height, string text, Anchor horizontal,
     Anchor vertical, Font font, ClickHandler onClick)
 {
     ButtonWidget widget = new ButtonWidget( game, font );
     widget.Init();
     widget.HorizontalAnchor = horizontal;
     widget.VerticalAnchor = vertical;
     widget.XOffset = x; widget.YOffset = y;
     widget.DesiredMaxWidth = width; widget.DesiredMaxHeight = height;
     widget.SetText( text );
     widget.OnClick = onClick;
     return widget;
 }
Beispiel #40
0
 public void RegisterClickHandler()
 {
     click += new ClickHandler(MyHandler);
 }
Beispiel #41
0
 //
 public void WhenButtonClicked(ClickHandler process)
 {
     Clicked += process;
 }
Beispiel #42
0
 public CommandMenuItem(string Text, ClickHandler OnClick)
     : this(Text)
 {
     this.Click += OnClick;
 }
 /// <summary>
 /// 订阅事件
 /// </summary>
 private void SubscribeEvent()
 {
     EditEvent += new ClickHandler(UCContactsView_EditEvent);
     DeleteEvent += new ClickHandler(UCContactsView_DeleteEvent);
     StatusEvent += new ClickHandler(UCContactsView_StatusEvent);
 }
Beispiel #44
0
 /// <summary>
 /// Adds a button to the message box.
 /// </summary>
 public void AddButton(string Name, ClickHandler OnClick)
 {
     this._Buttons.Add(new _Button()
     {
         Name = Name,
         Click = OnClick
     });
 }
 private void SubscribeEvent()
 {
     EditEvent += new ClickHandler(UCWareHouseView_EditEvent);
     DeleteEvent += new ClickHandler(UCWareHouseView_DeleteEvent);
     StatusEvent += new ClickHandler(UCWareHouseView_StatusEvent);
 }
Beispiel #46
0
 /// <summary>
 /// Shows a messagebox with the default style with the OK and cancel options. Action is only performed on OK. 
 /// </summary>
 public static void ShowOKCancel(LayerContainer Container, string Title, string Message, ClickHandler OnOKClick)
 {
     ShowOKCancel(Container, Title, Message, OnOKClick, new MessageBoxStyle());
 }
		/// <summary>
		/// Initializes a new instance of the <see cref="CalendarPickerView"/> class.
		/// </summary>
		/// <param name="context">The context.</param>
		/// <param name="attrs">The attrs.</param>
		public CalendarPickerView(Context context, IAttributeSet attrs)
			: base(context, attrs)
		{
			ResourceIdManager.UpdateIdValues();
			_context = context;
			_styleDescriptor = new StyleDescriptor();
			MyAdapter = new MonthAdapter(context, this);
			base.Adapter = MyAdapter;

			//base.Divider = null;
			//base.DividerHeight = 0;
			this.PageMargin = 32;
			SetPadding(0, 0, 0, 0);

			//Sometimes dates could not be selected after the transform. I had to disable it. :(
			//SetPageTransformer(true, new CalendarMonthPageTransformer());

			var bgColor = base.Resources.GetColor(Resource.Color.calendar_bg);
			base.SetBackgroundColor(bgColor);
			//base.CacheColorHint = bgColor;

			MonthNameFormat = base.Resources.GetString(Resource.String.month_name_format);
			WeekdayNameFormat = base.Resources.GetString(Resource.String.day_name_format);
			FullDateFormat = CultureInfo.CurrentCulture.DateTimeFormat.LongDatePattern;
			ClickHandler += OnCellClicked;
			OnInvalidDateSelected += OnInvalidateDateClicked;
			this.SetOnPageChangeListener(new OnPageChangeListener(this));



			if(base.IsInEditMode) {
				Init(DateTime.Now, DateTime.Now.AddYears(1), new DayOfWeek[]{ }).WithSelectedDate(DateTime.Now);
			}
		}
 private void SubscribeEvent()
 {
     EditEvent += new ClickHandler(UCVehicleModelsView_EditEvent);
     DeleteEvent += new ClickHandler(UCVehicleModelsView_DeleteEvent);
     StatusEvent += new ClickHandler(UCVehicleModelsView_StatusEvent);
 }
Beispiel #49
0
 /// <summary>
 /// Creates a command menu item.
 /// </summary>
 public static CommandMenuItem Create(string Text, ClickHandler OnClick)
 {
     return new CommandMenuItem(Text, OnClick);
 }
        //初始化
        private void Init()
        {
            #region 设置功能按钮可见性
            UIAssistants.SetUCBaseFuncationVisible(this, new ObservableCollection<ButtonEx_sms>()
            {
                btnSave, btnCancel, btnSet, btnView, btnPrint
            });
            #endregion

            #region 初始化下拉框数据绑定
            CommonCtrl.CmbBindDict(cbo_cb_Callback_type, "sys_callback_type", false);    //绑定回访类型
            CommonCtrl.CmbBindDict(cbo_cb_Callback_mode, "sys_callback_mode", false);    //绑定回访方式
            CommonCtrl.CmbBindDict(cbo_member_class, "sys_member_grade", false);    //绑定会员等级
            CommonFuncCall.BindProviceComBox(cbo_province, "请选择");  //绑定省份
            CommonFuncCall.BindCityComBox(cbo_city, "", "请选择");   //绑定城市
            CommonFuncCall.BindCountryComBox(cbo_county, "", "请选择");    //绑定县/区
            cbo_province.SelectedIndexChanged += ddlprovince_SelectedIndexChanged;
            cbo_city.SelectedIndexChanged += ddlcity_SelectedIndexChanged;
            CommonCtrl.CmbBindDict(cbo_cust_type, "sys_customer_category", false);  //客户类别
            #endregion

            lbl_cb_create_by.Text = GlobalStaticObj.CurrUserCom_Name;
            lbl_cb_create_by.Tag = GlobalStaticObj.UserID;
            if (windowStatus == WindowStatus.Edit || windowStatus == WindowStatus.View)
            {
                SetCustInfo();
                SetContInfo();
                SetCallbackInfo();
            }
            if (windowStatus == WindowStatus.View) palQTop.Enabled = false;
            #region 注册功能按钮事件
            #region 选择客户信息
            txt_cust_code.ChooserClick += delegate
            {
                var frmCustomer = new frmCustomerInfo();
                var result = frmCustomer.ShowDialog();
                if (result == DialogResult.OK)
                {
                    CustId = frmCustomer.strCustomerId;
                    txt_cust_code.Tag = CustId;
                    txt_cust_code.Text = frmCustomer.strCustomerNo;
                    SetCustInfo();
                }
            };
            dataGridViewEx1.CellContentClick += delegate(object sender, DataGridViewCellEventArgs args)
            {
                if (args.ColumnIndex < 0 || args.RowIndex < 0) return;
                if (dataGridViewEx1.Columns[args.ColumnIndex] == drtxt_maintain_no)
                {
                    var ytServiceNo = CommonCtrl.IsNullToString(dataGridViewEx1.Rows[args.RowIndex].Cells[drtxt_maintain_id.Name].Value);
                    if (String.IsNullOrEmpty(CommonCtrl.IsNullToString(ytServiceNo))) return;
                    var uc = new RepairQueryView(ytServiceNo);
                    uc.addUserControl(uc, "维修单-详细信息", "RepairQueryView" + ytServiceNo, Tag.ToString(),
                        Name);
                }
            };
            #endregion

            #region 选择被回访人
            txt_cb_Callback_by.ChooserClick += delegate
            {
                var frmContacts = new frmContacts();
                var result = frmContacts.ShowDialog();
                if (result == DialogResult.OK)
                {
                    ContId = frmContacts.contID;
                    txt_cb_Callback_by.Tag = ContId;
                    txt_cb_Callback_by.Text = frmContacts.contName;
                    txt_cb_Callback_by_duty.Caption = frmContacts.contDuty;
                    txt_cb_Callback_by_phone.Caption = frmContacts.contPhone;
                }
            };
            #endregion

            #region 选择经办人
            txt_handle_name.ChooserClick += delegate
            {
                var chooser = new frmUsers();
                var result = chooser.ShowDialog();
                if (result == DialogResult.OK)
                {
                    txt_handle_name.Text = chooser.User_Name;
                    txt_handle_name.Tag = chooser.User_ID;
                    txt_cb_handle_org.Caption = chooser.OrgName;
                }
            };
            #endregion

            //CancelEvent += (sender, args) => deleteMenuByTag(Tag.ToString(), UCCallBackManager.Name);
            CancelEvent += new ClickHandler(UCCallBackAddOrEdit_CancelEvent);

            #region 保存数据
            SaveEvent += delegate
            {
                var check = CheckValue();
                if (!check) return;
                var dicFileds = new Dictionary<String, String>();
                if (windowStatus == WindowStatus.Add)
                {
                    dicFileds.Add("create_by", GlobalStaticObj.UserID);  //创建人
                    dicFileds.Add("create_time", DBHelper.GetCurrentTime().Ticks.ToString());    //创建时间
                    dicFileds.Add("update_by", GlobalStaticObj.UserID);  //最后编辑人
                    dicFileds.Add("update_time", DBHelper.GetCurrentTime().Ticks.ToString());    //最后编辑时间
                    dicFileds.Add("Callback_id", Guid.NewGuid().ToString());  //客户ID
                    dicFileds.Add("status", "58b325d2-0792-4847-8e4a-22b3f25628f3");   //数据状态
                }
                else if (windowStatus == WindowStatus.Edit)
                {
                    DBHelper.BatchDeleteDataByWhere("删除客户与维修单关系", "tr_maintain_customer_callback", String.Format("callback_id = '{0}'", CallBackId));
                    dicFileds.Add("update_by", GlobalStaticObj.UserID);  //最后编辑人
                    dicFileds.Add("update_time", DBHelper.GetCurrentTime().Ticks.ToString());    //最后编辑时间
                }
                dicFileds.Add("Callback_corp", txt_cust_code.Tag.ToString());  //客户ID
                dicFileds.Add("Callback_time", DBHelper.GetCurrentTime().Ticks.ToString());   //回访时间
                dicFileds.Add("Callback_type", cbo_cb_Callback_type.SelectedValue.ToString()); //回访类型
                dicFileds.Add("Callback_mode", cbo_cb_Callback_mode.SelectedValue.ToString()); //回访方式
                dicFileds.Add("title",txt_cb_title.Caption);    //回访标题
                dicFileds.Add("record", rtx_cb_record.Text);    //回访内容
                dicFileds.Add("Callback_by", txt_cb_Callback_by.Tag.ToString());  //被回访人员名称
                dicFileds.Add("Callback_by_org", txt_cb_Callback_by_org.Caption);   //被回访人员部门名称
                dicFileds.Add("Callback_by_phone", txt_cb_Callback_by_phone.Caption);   //被回访人电话
                dicFileds.Add("Callback_by_duty", txt_cb_Callback_by_duty.Caption); //被回访人职务
                dicFileds.Add("handle_name", txt_handle_name.Tag.ToString());    //经办人
                dicFileds.Add("handle_org", txt_cb_handle_org.Caption); //经办人部门名称
                var result = false;
                try
                {
                    result = DBHelper.Submit_AddOrEdit("保存客户回访", "tb_CustomerSer_Callback", "Callback_id", CallBackId, dicFileds);
                    if (result)
                    {
                        const string sqlStr = "INSERT INTO tr_maintain_customer_callback(id,maintain_id,customer_id ,callback_id) VALUES(@id,@maintain_id,@customer_id,@callback_id)";
                        var list = GetCheckRows();
                        var sysSqlStrList = list.Select(str => new SysSQLString
                        {
                            cmdType = CommandType.Text, sqlString = sqlStr, Param = new Dictionary<string, string>
                            {
                                {"@id", Guid.NewGuid().ToString()}, {"@maintain_id", str}, {"@customer_id", txt_cust_code.Tag.ToString()}, {"@callback_id", String.IsNullOrEmpty(CallBackId) ? dicFileds["Callback_id"] : CallBackId}
                            }
                        }).ToList();
                        DBHelper.BatchExeSQLStringMultiByTrans("添加客户与维修单关系", sysSqlStrList);
                    }
                }
                catch (Exception ex)
                {
                    result = false;
                }
                MessageBoxEx.Show(result ? "保存成功!" : "保存失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.None);
                if (result)
                {
                    UCCallBackManager.BindPageData();
                    _autoClose = false;
                    deleteMenuByTag(Tag.ToString(), UCCallBackManager.Name);
                }
            };
            #endregion
            #endregion
        }
        public CalendarPickerView(Context context, IAttributeSet attrs)
            : base(context, attrs)
        {
            ResourceIdManager.UpdateIdValues();

            var a = context.ObtainStyledAttributes(attrs, Resource.Styleable.CalendarPickerView);
            var bg = a.GetColor(Resource.Styleable.CalendarPickerView_android_background,
                Resource.Color.calendar_bg);
            DividerColor = a.GetColor(Resource.Styleable.CalendarPickerView_dividerColor,
                Resource.Color.calendar_divider);
            DayBackgroundResID = a.GetResourceId(Resource.Styleable.CalendarPickerView_dayBackground,
                Resource.Drawable.calendar_bg_selector);
            DayTextColorResID = a.GetResourceId(Resource.Styleable.CalendarPickerView_dayTextColor,
                Resource.Color.calendar_text_selector);
            TitleTextColor = a.GetColor(Resource.Styleable.CalendarPickerView_titleTextColor,
                Resource.Color.calendar_text_active);
            HeaderTextColor = a.GetColor(Resource.Styleable.CalendarPickerView_headerTextColor,
                Resource.Color.calendar_text_active);
            a.Recycle();

            _context = context;
            MyAdapter = new MonthAdapter(context, this);
            base.Adapter = MyAdapter;
            base.Divider = null;
            base.DividerHeight = 0;

            base.SetBackgroundColor(bg);
            base.CacheColorHint = bg;

            MonthNameFormat = base.Resources.GetString(Resource.String.month_name_format);
            WeekdayNameFormat = base.Resources.GetString(Resource.String.day_name_format);
            FullDateFormat = CultureInfo.CurrentCulture.DateTimeFormat.LongDatePattern;
            ClickHandler += OnCellClicked;
            OnInvalidDateSelected += OnInvalidateDateClicked;

            if (base.IsInEditMode) {
                Init(DateTime.Now, DateTime.Now.AddYears(1)).WithSelectedDate(DateTime.Now);
            }
        }
Beispiel #52
0
    // Use this for initialization
    void Start()
    {
        GuiStyle.wordWrap = true;
        GuiStyle.normal.textColor = Color.white;
        GuiStyle.active.textColor = Color.red;

        gM = transform.GetComponent<GameManager>();
        clicker = this.GetComponent<ClickHandler>();

        menuOuterRect = new Rect(Screen.width * .4f, Screen.height * .25f, Screen.width * .2f, Screen.height * .5f);

        float change = .03f;
        float xChange = (menuOuterRect.width * change) / 2;
        float yChange = (menuOuterRect.height * change) / 2;
        buttonRect = new Rect(menuOuterRect.x + xChange, menuOuterRect.y + yChange, menuOuterRect.width * (1 - change), menuOuterRect.height * (1 - change));

        #region Text
        #region Rules
        rulesText[0] = "\n\n" +
            "A. Choose to roll the die or not.\n\n" +
            "	A1- Rolled: Move the player and flip card.\n\n" +
            "	A2- Did Not Roll: Flip card.\n\n" +
            "C. Stake adjacent card.";
        fullText[0] =
            "The first stage of the game is the prospecting stage.\n\n"+
            "You may roll the die to move, or skip rolling to stay where you are. "+
            "Either way the card underneath the player will be revealed if it is not already.\n\n"+
            "Then you will be able to stake a claim on a card. In the prospecting phase you must stake a claim. "+
            "You may only stake the card under your avatar or on an adjacent card, not including diagonals.";

        rulesText[1] = "\n" +
            "A. Moving: Same as in Prospecting Phase.\n" +
            "	Except: Bumping opponent's stakes is allowed. That card can't be mined for one turn.\n\n" +
            "B. Choose to stake or not stake.\n" +
            "	B1- Staked: Move previously placed stake.\n\n" +
            "C. Choose to mine a staked card or not.\n" +
            "	C1- Mined: Take card into your hand. Move players from empty space to valid card if necessary.";
        fullText[1] =
            "The second stage of the game is the mining stage.\n\n" +
            "Moving works the same, but if you land on an opponent's stake you can bump it to an adjacent space. The card that was staked will be un-minable.\n\n" +
            "You may also mine staked cards, which involves locking them in by removing them from the board. They will be moved to your hand. Any players on the empty space must be moved to a valid card.";

        rulesText[2] =
            "The purpose is to get the highest score.\n\n" +
            "A. Card values:\n\n" +
            "	A1- Face Cards = 10 points.\n" +
            "	A2- Aces = 11 points.\n" +
            "	A3- Numbered cards = Face value.\n\n" +
            "B. Add up the values of the cards in your highest scoring grouping. Types of groups:\n\n" +
            "	Flushes: 2+ cards of the same suit.\n" +
            "	N of a Kind: 2+ cards of the same kind.\n";
        fullText[2] = "After the game ends, each player's score will be calculated. A player wins by having the highest score.\n\n"+
            "Each card has a value. Face cards (Jack, Queen, and King) are worth 10. Aces are worth 11 points. Numbered cards are worth their face value.\n\n"+
            "To calculate a player's score, different groupings of cards in the player's hand are compared. A grouping can be a flush or an N-of-a-kind. The highest scoring group will yield the player's score.";
        #endregion

        #region About Us
        aboutText[0] = "Eric Heaney, a.k.a. Kansas\n\n"+
            "Currently a 4th year Game Design & Development student at RIT.\n\n"+
            "Role: Gold Rush designer and programmer, focusing on database and server code.";

        aboutText[1] = "Name: Gary Lake\n\n"+
            "Currently a 4th year Game Design & Development student at RIT set to graduate in May 2012.\n\n"+
            "Role: Gold Rush programmer, focusing on game code.";

        aboutText[2] = "Name: Jonathan Hughes\n\n" +
            "Currently a 3rd year New Media Interactive Development student at RIT.\n\n" +
            "Role: Gold Rush programmer and user interface designer.";

        aboutText[3] = "Name: Philip Moccio\n\n"+
            "Currently a [Placeholder text]\n\n"+
            "Role: Gold Rush programmer.";

        #endregion
        #endregion
    }
 private void SubscribeEvent()
 {
     EditEvent += new ClickHandler(UCSupplierView_EditEvent);
     DeleteEvent += new ClickHandler(UCSupplierView_DeleteEvent);
     StatusEvent += new ClickHandler(UCSupplierView_StatusEvent);
 }
Beispiel #54
0
        private void switchNewButtonImageText(object sender, ClickHandler handler)
        {
            if (!(sender is ToolStripMenuItem))
            return;

            this.newButtonClickHandler = handler;
            newButton.Image = ((ToolStripMenuItem)sender).Image;
            newButton.Text = ((ToolStripMenuItem)sender).Text;
        }
 protected ButtonWidget Make2( int dir, int y, string text, ClickHandler onClick,
     Func<Game, string> getter, Action<Game, string> setter)
 {
     ButtonWidget widget = ButtonWidget.Create( game, 160 * dir, y, 301, 41,
                                               text + ": " + getter( game ),
                                               Anchor.Centre, Anchor.Centre, titleFont, onClick );
     widget.Metadata = text;
     widget.GetValue = getter;
     widget.SetValue = (g, v) => {
         setter( g, v );
         widget.SetText( (string)widget.Metadata + ": " + getter( g ) );
     };
     return widget;
 }
 protected ButtonWidget MakeBool( int dir, int y, string text, string optKey,
     ClickHandler onClick, Func<Game, bool> getter, Action<Game, bool> setter)
 {
     string optName = text;
     text = text + ": " + (getter( game ) ? "ON" : "OFF");
     ButtonWidget widget = ButtonWidget.Create( game, 160 * dir, y, 301, 41, text, Anchor.Centre,
                                               Anchor.Centre, titleFont, onClick );
     widget.Metadata = optName;
     widget.GetValue = g => getter( g ) ? "yes" : "no";
     widget.SetValue = (g, v) => {
         setter( g, v == "yes" );
         Options.Set( optKey, v == "yes" );
         widget.SetText( (string)widget.Metadata + ": " + (v == "yes" ? "ON" : "OFF") );
     };
     return widget;
 }
Beispiel #57
0
    // Use this for initialization
    void Start()
    {
        gM = transform.GetComponent<GameManager>();
        clicker = this.GetComponent<ClickHandler>();

        menuOuterRect = new Rect(Screen.width * .4f, Screen.height * .25f, Screen.width * .2f, Screen.height * .5f);

        float change = .03f;
        float xChange = (menuOuterRect.width * change) / 2;
        float yChange = (menuOuterRect.height * change) / 2;
        buttonRect = new Rect(menuOuterRect.x + xChange, menuOuterRect.y + yChange, menuOuterRect.width * (1 - change), menuOuterRect.height * (1 - change));
    }
 protected ButtonWidget Make( int dir, int y, string text, ClickHandler onClick,
     Func<Game, string> getter, Action<Game, string> setter)
 {
     ButtonWidget widget = ButtonWidget.Create( game, 160 * dir, y, 301, 41, text, Anchor.Centre,
                                               Anchor.Centre, titleFont, onClick );
     widget.GetValue = getter; widget.SetValue = setter;
     return widget;
 }