public MovementForm(CCToolbar ccToolbar) : this() { this.ccToolbar = ccToolbar; //this.orientation = orientation; this.orientation = ccToolbar.Orientation; prevBtn = new PrevCCButton(this.ccToolbar); nextBtn = new NextCCButton(this.ccToolbar); selectionBtn = new SelectionCCButton(this.ccToolbar); if (orientation == CCToolbar.ToolbarOrientation.HorizontalTop || orientation == CCToolbar.ToolbarOrientation.HorizontalBottom) { tableLayoutPanel.Controls.Add(prevBtn, 0, 1); tableLayoutPanel.Controls.Add(selectionBtn, 1, 1); tableLayoutPanel.Controls.Add(nextBtn, 2, 1); } else if (orientation == CCToolbar.ToolbarOrientation.VerticalLeft || orientation == CCToolbar.ToolbarOrientation.VerticalRight) { tableLayoutPanel.Controls.Add(prevBtn, 1, 0); tableLayoutPanel.Controls.Add(selectionBtn, 1, 1); tableLayoutPanel.Controls.Add(nextBtn, 1, 2); } }
} //end method private void printElapsedTimes() { updateLabel(leftTimeLabel, elapsedTimes[0], elapsedTimes[1]); //updateLabel(rightTimeLabel, elapsedTimes[2], elapsedTimes[3]); //updateLabel(topTimeLabel, elapsedTimes[4], elapsedTimes[5]); updateLabel(topTimeLabel, elapsedTimes[2], elapsedTimes[3]); updateLabel(rightTimeLabel, elapsedTimes[4], elapsedTimes[5]); updateLabel(bottomTimeLabel, elapsedTimes[6], elapsedTimes[7]); //find min of left,right,top,bottom Label min = minLabel(minLabel(leftTimeLabel, rightTimeLabel), minLabel(topTimeLabel, bottomTimeLabel)); min.BackColor = Color.PowderBlue; Label otherMin = leftTimeLabel; //arbitrary if (min == leftTimeLabel || min == rightTimeLabel) { otherMin = minLabel(topTimeLabel, bottomTimeLabel); if (otherMin == topTimeLabel) { reccOrient = CCToolbar.ToolbarOrientation.HorizontalTop; toolbarOrientationLabel.Text = reccOrient.ToString(); } else if (otherMin == bottomTimeLabel) { reccOrient = CCToolbar.ToolbarOrientation.HorizontalBottom; toolbarOrientationLabel.Text = reccOrient.ToString(); } } else if (min == topTimeLabel || min == bottomTimeLabel) { otherMin = minLabel(leftTimeLabel, rightTimeLabel); if (otherMin == leftTimeLabel) { reccOrient = CCToolbar.ToolbarOrientation.VerticalLeft; toolbarOrientationLabel.Text = reccOrient.ToString(); } else if (otherMin == rightTimeLabel) { reccOrient = CCToolbar.ToolbarOrientation.VerticalRight; toolbarOrientationLabel.Text = reccOrient.ToString(); } } otherMin.BackColor = Color.Peru; }
void changeOrientation(CCToolbar.ToolbarOrientation orientation) { ccToolbar.ChangeOrientation(orientation); label.Text = "Toolbar Placement: " + orientation; this.Close(); }