protected override void DoBuildChildren(LayoutPanelBase Layout)
        {
            base.DoBuildChildren(Layout);
            CaptionLabel.Dock = DockStyle.Top;


            if (TableCreated == false)
            {
                Width  = 500;
                Height = 200;
                ParentNotePanel.Width  = Width;
                ParentNotePanel.Height = Height;

                TimelineStartDate = DateTime.Today;

                // A. Create the Table
                NoteDataXML_Table myTable = new NoteDataXML_Table(100, 100, new ColumnDetails[7] {
                    new ColumnDetails("Date", 50),
                    new ColumnDetails("Type", 50),
                    new ColumnDetails("Data", 50),
                    new ColumnDetails("Data2", 50),
                    new ColumnDetails("Data3", 50),
                    new ColumnDetails("Data4", 50),
                    new ColumnDetails("icon", 50)
                });
                string GuidOfTable = this.GuidForNote + "table";
                myTable.GuidForNote = GuidOfTable;

                myTable.Caption = Loc.Instance.GetStringFmt("Table for Timeline");



                Layout.AddNote(myTable);

                // we do not need to call CreateParent because AddNote does it for us
                //myTable.CreateParent (Layout);
                Save();
                myTable.AddRow(new object[7] {
                    DateTime.Today.ToString(), "100", "Example Description", "Example Title", "", "", 2
                });
                TableCreated = true;
                Save();
                // B. Populate it with example Row
            }
            Timeline      = new NotePanelTimeline(this);
            Timeline.Dock = DockStyle.Fill;
            ParentNotePanel.Controls.Add(Timeline);
            Timeline.dayPanelWidth = DayPanelWidth;
            Timeline.BringToFront();

            RowFilterStrip =
                LayoutDetails.BuildMenuPropertyEdit(Loc.Instance.GetString("Row Filter: {0}"), RowFilter, Loc.Instance.GetString("Filter via the columns on the table associated with this timeline."), HandleRowFilterChange);



            ToolStripSeparator sep = new ToolStripSeparator();


            ToolStripComboBox dropper = new ToolStripComboBox();



            dropper.ToolTipText   = Loc.Instance.GetString("Set the type of timeline you want by selecting an appropriate calendar.");
            dropper.DropDownStyle = ComboBoxStyle.DropDownList;
            foreach (Calendar.calendertype calendertype in Enum.GetValues(typeof(Calendar.calendertype)))
            {
                dropper.Items.Add(calendertype.ToString());
            }
            dropper.Text = MCalendarType.ToString();
            dropper.SelectedIndexChanged += HandleSelectedIndexCalendarPickerChanged;



            // Icons Per Column. We had the edit to a ToolStrip Host and add the Host to the toolstrip
            NumericUpDown numbers = new NumericUpDown();


            Panel numbersPanel = new Panel();

            numbersPanel.BackColor = dropper.BackColor;
            Label numbersLabel = new Label();

            numbersLabel.Left = 0;
            //numbersLabel.Dock = DockStyle.Left;
            numbersLabel.Text     = Loc.Instance.GetString("Icons/Column: ");
            numbersLabel.AutoSize = false;
            numbersLabel.Width    = 85;
            numbers.Left          = 90;
            numbers.Width         = 45;
            //numbersLabel.AutoSize = true;
            //numbers.Dock = DockStyle.Right;

            numbersPanel.Controls.Add(numbersLabel);
            numbersPanel.Controls.Add(numbers);
            numbersLabel.BringToFront();
            //numbersPanel.Dock = DockStyle.Fill;


            numbers.Value         = IconsPerColumn;
            numbers.ValueChanged += HandleIconsPerColumnValueChanged;
            numbers.Minimum       = 1;
            numbers.Maximum       = 20;
            ToolStripControlHost iconsPerColumn = new ToolStripControlHost(numbersPanel);


            // Day Width
            ToolStripControlHost setDayWidth = BuildDayWidth(dropper.BackColor);


            DateTimePicker dates = new DateTimePicker();

            dates.Width = 125;
            try {
                dates.Value = this.TimelineStartDate;
            } catch (Exception) {
                dates.Value = DateTime.Today;
            }
            dates.ValueChanged += HandleValueCurrentdateChanged;
            ToolStripControlHost dateToolStrip = new ToolStripControlHost(dates);

            dateToolStrip.ToolTipText = Loc.Instance.GetString("Select a date to center the timeline on that date.");



            properties.DropDownItems.Add(sep);
            properties.DropDownItems.Add(dropper);
            properties.DropDownItems.Add(iconsPerColumn);
            properties.DropDownItems.Add(setDayWidth);
            properties.DropDownItems.Add(RowFilterStrip);
            properties.DropDownItems.Add(dateToolStrip);


            // add hjistory to RowFilterStrip
            foreach (string history in RowHistory)
            {
                ToolStripMenuItem test = new ToolStripMenuItem(history);
                test.Click += delegate(object sender, EventArgs e){ RowFilter = RowFilterStrip.Text = test.Text; Timeline.Refresh(); };
                RowFilterStrip.DropDownItems.Add(test);
            }

            //
            //
            // Hide ZOom Panel
            //
            //
            ToolStripButton HideMonths = new ToolStripButton();

            HideMonths.Text         = Loc.Instance.GetString("Hide Months Panel");
            HideMonths.CheckOnClick = true;
            HideMonths.Checked      = this.HideZoomOutPanel;
            HideMonths.Click       += HandleHideMonthsClick;

            properties.DropDownItems.Add(HideMonths);
            // Adjust panel as needed; also add this to the menu too
            Timeline.HideZoomPanel(this.HideZoomOutPanel);
        }
 public void NullTimelineIsException()
 {
     NotePanelTimeline timeline = new NotePanelTimeline(null);
 }
Beispiel #3
0
 public void NullTimelineIsException()
 {
     NotePanelTimeline timeline = new NotePanelTimeline(null);
 }
        protected override void DoBuildChildren(LayoutPanelBase Layout)
        {
            base.DoBuildChildren (Layout);
            CaptionLabel.Dock = DockStyle.Top;

            if (TableCreated == false) {
                Width = 500;
                Height = 200;
                ParentNotePanel.Width = Width;
                ParentNotePanel.Height = Height;

                TimelineStartDate = DateTime.Today;

                // A. Create the Table
                NoteDataXML_Table myTable = new NoteDataXML_Table (100, 100, new ColumnDetails[7]{
                    new ColumnDetails ("Date", 50),
                    new ColumnDetails ("Type", 50),
                    new ColumnDetails ("Data", 50),
                    new ColumnDetails ("Data2", 50),
                    new ColumnDetails ("Data3", 50),
                    new ColumnDetails ("Data4", 50),
                    new ColumnDetails ("icon", 50)});
                string GuidOfTable = this.GuidForNote + "table";
                myTable.GuidForNote = GuidOfTable;

                myTable.Caption = Loc.Instance.GetStringFmt ("Table for Timeline");

                Layout.AddNote (myTable);

                // we do not need to call CreateParent because AddNote does it for us
                //myTable.CreateParent (Layout);
                Save ();
                myTable.AddRow (new object[7]{DateTime.Today.ToString (), "100", "Example Description", "Example Title", "", "", 2});
                TableCreated = true;
                Save ();
                // B. Populate it with example Row
            }
            Timeline = new NotePanelTimeline (this);
            Timeline.Dock = DockStyle.Fill;
            ParentNotePanel.Controls.Add (Timeline);
            Timeline.dayPanelWidth = DayPanelWidth;
            Timeline.BringToFront ();

            RowFilterStrip =
                LayoutDetails.BuildMenuPropertyEdit (Loc.Instance.GetString ("Row Filter: {0}"), RowFilter, Loc.Instance.GetString ("Filter via the columns on the table associated with this timeline."), HandleRowFilterChange);

            ToolStripSeparator sep = new ToolStripSeparator ();

            ToolStripComboBox dropper = new ToolStripComboBox ();

            dropper.ToolTipText = Loc.Instance.GetString ("Set the type of timeline you want by selecting an appropriate calendar.");
            dropper.DropDownStyle = ComboBoxStyle.DropDownList;
            foreach (Calendar.calendertype calendertype in Enum.GetValues (typeof(Calendar.calendertype))) {
                dropper.Items.Add (calendertype.ToString ());
            }
            dropper.Text = MCalendarType.ToString ();
            dropper.SelectedIndexChanged += HandleSelectedIndexCalendarPickerChanged;

            // Icons Per Column. We had the edit to a ToolStrip Host and add the Host to the toolstrip
            NumericUpDown numbers = new NumericUpDown ();

            Panel numbersPanel = new Panel ();
            numbersPanel.BackColor = dropper.BackColor;
            Label numbersLabel = new Label ();
            numbersLabel.Left = 0;
            //numbersLabel.Dock = DockStyle.Left;
            numbersLabel.Text = Loc.Instance.GetString ("Icons/Column: ");
            numbersLabel.AutoSize = false;
            numbersLabel.Width = 85;
            numbers.Left = 90;
            numbers.Width = 45;
            //numbersLabel.AutoSize = true;
            //numbers.Dock = DockStyle.Right;

            numbersPanel.Controls.Add (numbersLabel);
            numbersPanel.Controls.Add (numbers);
            numbersLabel.BringToFront ();
            //numbersPanel.Dock = DockStyle.Fill;

            numbers.Value = IconsPerColumn;
            numbers.ValueChanged += HandleIconsPerColumnValueChanged;
            numbers.Minimum = 1;
            numbers.Maximum = 20;
            ToolStripControlHost iconsPerColumn = new ToolStripControlHost (numbersPanel);

            // Day Width
            ToolStripControlHost setDayWidth = BuildDayWidth(dropper.BackColor);

            DateTimePicker dates = new DateTimePicker ();
            dates.Width = 125;
            try {
                dates.Value = this.TimelineStartDate;
            } catch (Exception) {
                dates.Value = DateTime.Today;
            }
            dates.ValueChanged += HandleValueCurrentdateChanged;
            ToolStripControlHost dateToolStrip = new ToolStripControlHost (dates);
            dateToolStrip.ToolTipText = Loc.Instance.GetString ("Select a date to center the timeline on that date.");

            properties.DropDownItems.Add (sep);
            properties.DropDownItems.Add (dropper);
            properties.DropDownItems.Add (iconsPerColumn);
            properties.DropDownItems.Add (setDayWidth);
            properties.DropDownItems.Add (RowFilterStrip);
            properties.DropDownItems.Add (dateToolStrip);

            // add hjistory to RowFilterStrip
            foreach (string history in RowHistory) {
                ToolStripMenuItem test = new ToolStripMenuItem (history);
                test.Click += delegate(object sender, EventArgs e){  RowFilter = RowFilterStrip.Text = test.Text; Timeline.Refresh();};
                RowFilterStrip.DropDownItems.Add (test);
            }

            //
            //
            // Hide ZOom Panel
            //
            //
            ToolStripButton HideMonths = new ToolStripButton();
            HideMonths.Text = Loc.Instance.GetString("Hide Months Panel");
            HideMonths.CheckOnClick = true;
            HideMonths.Checked = this.HideZoomOutPanel;
            HideMonths.Click+= HandleHideMonthsClick;

            properties.DropDownItems.Add (HideMonths);
            // Adjust panel as needed; also add this to the menu too
            Timeline.HideZoomPanel(this.HideZoomOutPanel);
        }