Esempio n. 1
0
        public DayCellControl CreateNewDefaultCellControl(int number)
        {
            DayCellControl control = new DayCellControl(this);

            control.Location = new Point(EdgeWidth + DayCellControl.DefaultCellWidth * (number % 7),
                                         EdgeWidth + DayCellControl.DefaultCellHeight * (number / 7 + 1));
            control.Size       = new Size(DayCellControl.DefaultCellWidth, DayCellControl.DefaultCellHeight);
            control.TabIndex   = number + 1;
            control.CellClick += new DayCellControl.DayCellClick(control_CellClick);
            return(control);
        }
Esempio n. 2
0
        /// <summary>
        /// Popup the control above the given control.
        /// </summary>
        /// <param name="dayCell">The control to popup above.</param>
        public void ShowAbove(DayCellControl dayCell)
        {
            if (this.Forbidden)
            {
                return;
            }

            this.initializing = true;

            this.HideTooltip();
            this.dayCell = dayCell;
            this.BringToFront();

            this.PaintEgesta();

            this.sliderHealth.Value = Program.CurrentWoman.Health[this.dayCell.Date];

            this.pictureNote.Visible = Program.CurrentWoman.Notes.ContainsKey(this.dayCell.Date);

            this.lblDay.Text = this.dayCell.Date.Day.ToString();

            this.BackColor = this.dayCell.BackColor;

            Point newLocation = this.dayCell.Location;

            newLocation.Offset(-this.dayCell.Size.Width / 2, -this.dayCell.Size.Height / 2);
            this.Location = this.ownerMonthsControl.PointToClient(this.dayCell.OwnerOneMonthControl.PointToScreen(newLocation));

            this.PaintBBT();

            this.PaintHadSex();

            this.pictureAlarm.Visible = Program.CurrentWoman.Schedules.HasAFiredSchedule(this.dayCell.Date);

            if (this.Visible == false)
            {
                this.Visible = true;
            }

            this.initializing = false;
        }
Esempio n. 3
0
        public OneMonthControl()
        {
            InitializeComponent();
            if (TEXT.Get != null)
            {
                ReReadTranslations();
            }

            SuspendLayout();

            for (int i = 0; i < 42; i++)
            {
                DayCellControl control = CreateNewDefaultCellControl(i);
                _cells.Add(control);
                Controls.Add(control);
            }

            SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.Opaque | ControlStyles.DoubleBuffer | ControlStyles.UserPaint, true);

            ResumeLayout();
        }