Beispiel #1
0
        public DateControl(ComboBox month, ComboBox day, EditBox year)
        {
            this.month = month;
            int i = 1;

            foreach (String monthName in CultureInfo.CurrentCulture.DateTimeFormat.AbbreviatedMonthNames)
            {
                if (!String.IsNullOrEmpty(monthName))
                {
                    month.addItem(monthName, i++);
                }
            }
            month.SelectedIndex             = 0;
            month.EventComboChangePosition += new MyGUIEvent(month_EventComboChangePosition);
            this.day                = day;
            this.year               = new NumericEdit(year);
            this.year.MinValue      = 1;
            this.year.MaxValue      = 9999;
            this.year.AllowFloat    = false;
            this.year.ValueChanged += new MyGUIEvent(year_ValueChanged);
            populateMonthDays();
        }
        public TimelineDataProperties(ScrollView propScroll, TimelineView timelineView)
        {
            this.propScroll   = propScroll;
            this.timelineView = timelineView;
            timelineView.ActiveDataChanged += new EventHandler(timelineView_ActiveDataChanged);

            startTime = new NumericEdit(propScroll.findWidget("StartTime") as EditBox);
            startTime.ValueChanged += new MyGUIEvent(startTime_ValueChanged);
            startTime.MaxValue      = float.MaxValue;

            EditBox durationEdit = propScroll.findWidget("Duration") as EditBox;

            if (durationEdit != null)
            {
                duration = new NumericEdit(durationEdit);
                duration.ValueChanged       += new MyGUIEvent(duration_ValueChanged);
                duration.MaxValue            = float.MaxValue;
                additionalPropertiesPosition = new IntVector2(1, duration.Edit.Bottom + 2);
            }
            else
            {
                additionalPropertiesPosition = new IntVector2(1, startTime.Edit.Bottom + 2);
            }
        }