/// <summary> /// /// </summary> /// <param name="pollName"></param> /// <param name="pollModel"></param> /// <param name="sequenceVal"></param> // The previously selected Sequence value, if any /// <param name="dateValues"></param> // The previously selected Data values, if any private void Initialize(string pollName, Poll pollModel, int sequenceVal, ArrayList dateValues) { Cursor.Current = Cursors.WaitCursor; InitializeComponent(); PollName = pollName; PollModel = pollModel; InitializeScreen(); PopulateForm(pollModel, sequenceVal, dateValues); ToolsCF.SipShowIM(0); // Hide SIP, in case it's visible this.BringToFront(); Cursor.Current = Cursors.Default; this.Resize += new System.EventHandler(this.frmCriteria_Resize); this.ShowDialog(); this.Resize -= new System.EventHandler(this.frmCriteria_Resize); if (ScreenAdv == 1) { // Determine which [single] Sequence value was selected foreach (ListViewItem item in listViewSelectRecent.Items) { if (item.Checked) { sequenceVal = (int)recentCriteria[item.Index]; break; } } // Determine which Date(s) were selected dateValues = new ArrayList(); if (!listViewSelectDate.Items[0].Checked) // If "ALL" was selected then we'll just pass an empty array { foreach (ListViewItem item in listViewSelectDate.Items) { if (item.Checked) { dateValues.Add(dateCriteria[item.Index]); } } } // Now that we know what data the user wants to view, we can display it frmStats statsForm = new frmStats(PollName, PollModel, sequenceVal, dateValues); } }
private void RepositionControls(bool forceRedraw) { ToolsCF.SipShowIM(0); // Ensure that SIP is collapsed int wid = 0, hgt = 0, aHgt = 0; if ((ToolsCF.UpdateScreenDimensions(out wid, out hgt, out aHgt)) | forceRedraw) { int gap = 4; // A small value, used as the basis for providing horiz and vert spacing double daHgt = Convert.ToDouble(aHgt); // First position top label labelInstructions.Location = new Point(gap * 4, gap * 2); Font font = labelRespondents.Font; // Base font for all labels // Logic to handle display of the two listboxes if (CFSysInfo.Data.DeviceSpecs.Platform == Platform.SmartPhone) { // To Do: Future code to go here } else { if (hgt > wid) // Portrait { listBoxFiles.Location = new Point(gap * 4, gap * 7); listBoxFiles.Size = new Size(wid - gap * 8, Convert.ToInt32(daHgt * 0.45)); AdjustSummaryInfoLocations(Orientation.Portrait); textBoxSummary.Location = new Point(listBoxFiles.Left, textBoxQuestions.Bottom + gap * 2); textBoxSummary.Size = new Size(wid - gap * 8, aHgt - gap * 2 - textBoxSummary.Top); } else // Landscape { listBoxFiles.Location = new Point(gap * 4, Convert.ToInt32(daHgt * 0.15)); listBoxFiles.Size = new Size(wid / 2 - gap * 5, Convert.ToInt32(daHgt * 0.7)); textBoxSummary.Location = new Point(listBoxFiles.Right + gap * 2, listBoxFiles.Top); textBoxSummary.Size = listBoxFiles.Size; AdjustSummaryInfoLocations(Orientation.Landscape); } } } }
public int ScreenAdv; // -1 : Move backward one screen +1 : Move forward one screen public frmInstructions(string text, InstructType mode, ref int screenAdv, ref bool backAvail) { Cursor.Current = Cursors.WaitCursor; InitializeComponent(); InitializeScreen(); SetIntroText(mode, backAvail); textBoxMain.Text = text; ToolsCF.SipShowIM(0); this.BringToFront(); Cursor.Current = Cursors.Default; this.Resize += new System.EventHandler(this.frmInstructions_Resize); this.ShowDialog(); screenAdv = ScreenAdv; backAvail = true; // Setting this to true will make this just displayed screen the "back one" this.Resize -= new System.EventHandler(this.frmInstructions_Resize); }
public int ScreenAdv; // -1 : Move backward one screen +1 : Move forward one screen public frmChangeUserName(ref int screenAdv, ref bool backAvail) { Cursor.Current = Cursors.WaitCursor; InitializeComponent(); InitializeScreen(); // Display the current user's name near the top of the screen labelCurrentUser.Text = CFSysInfo.Data.MobileOptions.FirstName + " " + CFSysInfo.Data.MobileOptions.LastName; ToolsCF.SipShowIM(0); this.BringToFront(); Cursor.Current = Cursors.Default; this.Resize += new System.EventHandler(this.frmChangeUserName_Resize); this.ShowDialog(); screenAdv = ScreenAdv; backAvail = true; // Setting this to true will make this just displayed screen the "back one" this.Resize -= new System.EventHandler(this.frmChangeUserName_Resize); }
private void RepositionControls(bool forceRedraw) { ToolsCF.SipShowIM(0); // Ensure that SIP is collapsed int wid = 0, hgt = 0, aHgt = 0; if ((ToolsCF.UpdateScreenDimensions(out wid, out hgt, out aHgt)) | forceRedraw) { if (CFSysInfo.Data.DeviceSpecs.Platform == Platform.SmartPhone) { // To Do: Still to need to flesh out SmartPhone positioning } else { //int horizMargin = leftMargin + gap * 2; if (wid < hgt) // Is it in Portrait mode? { listViewSelectRecent.Left = wid / 2 - gap - listViewSelectRecent.Width; listViewSelectRecent.Height = hgt / 2; labelSequence.Left = listViewSelectRecent.Left - 1; listViewSelectDate.Left = wid / 2 + gap; listViewSelectDate.Height = listViewSelectRecent.Height; labelDate.Left = listViewSelectDate.Left - 1; } else // Landscape mode { listViewSelectRecent.Left = wid / 2 - gap * 4 - listViewSelectRecent.Width; listViewSelectRecent.Height = aHgt - gap * 4 - listViewSelectRecent.Top; labelSequence.Left = listViewSelectRecent.Left; listViewSelectDate.Left = wid / 2 + gap * 4; listViewSelectDate.Height = listViewSelectRecent.Height; labelDate.Left = listViewSelectDate.Left; } } } }
public void ShowSIP(bool show) { ToolsCF.SipShowIM((show == true) ? 1 : 0); }
private void InitializeScreen() { ToolsCF.SipShowIM(0); // Ensure that SIP is collapsed RepositionControls(true); }