public SingleReviewPanel(Workspace workspace, DataGridView dgv) { InitializeComponent(); answerViewer = new ImageViewer(); answerViewer.Dock = DockStyle.Fill; answerViewer.Zoom(ControlSizeMode.Fit, 1, LeadPoint.Empty); pnlAnswerCrop.Controls.Add(answerViewer); masterSheetViewer = new AutomationImageViewer(); masterSheetViewer.Dock = DockStyle.Fill; masterSheetViewer.Zoom(ControlSizeMode.Fit, 1, LeadPoint.Empty); pnlFullSheet.Controls.Add(masterSheetViewer); this.workspace = workspace; this.dgv = dgv; sfp = new SingleFieldPanel(); trp = new TextResultPanel(); trp.TextUpdated += CellValueUpdated; sfp.Visible = false; trp.Visible = false; spltInfo.Panel2.Controls.Add(sfp); spltInfo.Panel2.Controls.Add(trp); lblAnswerKey.Visible = false; if (workspace.AnswersPresent == false) { lblAnswerKey.Visible = true; lblAnswerKey.Text = LBL_ANSWERKEY_MISSING; } }
protected override void OnLoad(EventArgs e) { if (!DesignMode) { _automationManager = new AnnAutomationManager(); _automationManager.GroupsRoles = _groupsRoles; _automationManager.RedactionRealizePassword = string.Empty; _automationManager.CreateDefaultObjects(); _managerHelper = new AutomationManagerHelper(_automationManager); _managerHelper.CreateToolBar(); tabControl1.TabPages[1].Controls.Add(_managerHelper.ToolBar); _imageViewer = new AutomationImageViewer(); _imageViewer.KeyDown += new KeyEventHandler(_imageViewer_KeyDown); tabControl1.TabPages[1].Controls.Add(_imageViewer); _managerHelper.ToolBar.Dock = DockStyle.Right; _managerHelper.ToolBar.AutoSize = false; _managerHelper.ToolBar.Appearance = ToolBarAppearance.Flat; _managerHelper.ToolBar.BringToFront(); _imageViewer.Dock = DockStyle.Fill; _imageViewer.UseDpi = false; _imageViewer.ImageHorizontalAlignment = Leadtools.Controls.ControlAlignment.Center; _imageViewer.ImageBorderColor = Color.Black; _imageViewer.ImageBorderThickness = 1; _imageViewer.BringToFront(); AutomationInteractiveMode automationInteractiveMode = new AutomationInteractiveMode(); automationInteractiveMode.MouseButtons = MouseButtons.Left | MouseButtons.Right; _imageViewer.InteractiveModes.Add(automationInteractiveMode); using (RasterCodecs codec = new RasterCodecs()) { _imageViewer.Image = codec.Load(DemosGlobal.ImagesFolder + @"\ocr1.tif"); _imageViewer.Zoom(Leadtools.Controls.ControlSizeMode.FitWidth, 1, LeadPoint.Empty); } _automation = new AnnAutomation(_automationManager, _imageViewer); // Update the container size _automation.Container.Size = _automation.Container.Mapper.SizeToContainerCoordinates(LeadSizeD.Create(_imageViewer.Image.ImageWidth, _imageViewer.Image.ImageHeight)); _automation.EditText += new EventHandler <AnnEditTextEventArgs>(automation_EditText); _automation.OnShowContextMenu += new EventHandler <AnnAutomationEventArgs>(automation_OnShowContextMenu); _automation.OnShowObjectProperties += new EventHandler <AnnAutomationEventArgs>(automation_OnShowObjectProperties); _automation.LockObject += new EventHandler <AnnLockObjectEventArgs>(automation_LockObject); _automation.UnlockObject += new EventHandler <AnnLockObjectEventArgs>(automation_UnlockObject); _automation.SetCursor += new EventHandler <AnnCursorEventArgs>(automation_SetCursor); _automation.RestoreCursor += new EventHandler(automation_RestoreCursor); FlipReverseText(_automationManager.RenderingEngine, true); _automation.Active = true; _chkLstGroups.CheckOnClick = true; _chkLstGroups.ItemCheck += new ItemCheckEventHandler(_chkLstGroups_ItemCheck); _chkLstGroups.Enabled = _lstUsers.Items.Count > 0 && _lstUsers.SelectedIndex >= 0; _chkLstRoles.CheckOnClick = true; _chkLstRoles.ItemCheck += new ItemCheckEventHandler(_chkLstRoles_ItemCheck); _chkLstRoles.Items.Add(new CheckRoleItem(AnnRoles.View)); _chkLstRoles.Items.Add(new CheckRoleItem(AnnRoles.ViewAll)); _chkLstRoles.Items.Add(new CheckRoleItem(AnnRoles.Edit)); _chkLstRoles.Items.Add(new CheckRoleItem(AnnRoles.EditAll)); _chkLstRoles.Items.Add(new CheckRoleItem(CustomRoles.RulersOnly)); _lstGroups.SelectedIndexChanged += new EventHandler(_lstGroups_SelectedIndexChanged); _chkLstRoles.Enabled = _lstGroups.Items.Count > 0 && _lstGroups.SelectedIndex >= 0; _lstUsers.SelectedIndexChanged += new EventHandler(_lstUsers_SelectedIndexChanged); _groupsRoles.GenerateRole += new EventHandler <AnnOperationInfoEventArgs>(_groupsRoles_GenerateRole); AnnRoles medicalRoles = new AnnRoles(); medicalRoles.Add(CustomRoles.RulersOnly); AddGroup(_groupsRoles, "Medical", medicalRoles); AnnRoles documentRoles = new AnnRoles(); documentRoles.Add(AnnRoles.View); documentRoles.Add(AnnRoles.Edit); AddGroup(_groupsRoles, "Document", documentRoles); AnnRoles adminRoles = new AnnRoles(); adminRoles.Add(AnnRoles.EditAll); AddGroup(_groupsRoles, "Admins", adminRoles); AnnRoles guestRoles = new AnnRoles(); guestRoles.Add(AnnRoles.ViewAll); AddGroup(_groupsRoles, "Guests", guestRoles); AddUser(_groupsRoles, "Medical", "MedicalUser"); AddUser(_groupsRoles, "Document", "DocumentUser"); AddUser(_groupsRoles, "Guests", "Guest"); AddUser(_groupsRoles, "Admins", "Admin"); OnResize(EventArgs.Empty); } base.OnLoad(e); }
protected override void OnLoad(EventArgs e) { if (!DesignMode) { _automationManager = AnnAutomationManager.Create(new AnnWinFormsRenderingEngine()); _automationManager.RedactionRealizePassword = string.Empty; _automationManager.CreateDefaultObjects(); _managerHelper = new AutomationManagerHelper(_automationManager); _managerHelper.CreateToolBar(); FlipReverseText(_automationManager.RenderingEngine, true); _managerHelper.ToolBar.Dock = DockStyle.Right; _managerHelper.ToolBar.AutoSize = false; _managerHelper.ToolBar.Width = 100; _managerHelper.ToolBar.Appearance = ToolBarAppearance.Normal; this.Controls.Add(_managerHelper.ToolBar); _managerHelper.ToolBar.BringToFront(); _imageViewer = new AutomationImageViewer(); _imageViewer.KeyDown += new KeyEventHandler(_imageViewer_KeyDown); _imageViewer.Dock = DockStyle.Fill; this.Controls.Add(_imageViewer); _imageViewer.BringToFront(); AutomationInteractiveMode automationInteractiveMode = new AutomationInteractiveMode(); automationInteractiveMode.MouseButtons = MouseButtons.Left | MouseButtons.Right; _imageViewer.InteractiveModes.Add(automationInteractiveMode); _imageViewer.UseDpi = false; _imageViewer.Zoom(Leadtools.Controls.ControlSizeMode.FitWidth, 1, LeadPoint.Empty); _imageViewer.ImageHorizontalAlignment = Leadtools.Controls.ControlAlignment.Center; _imageViewer.ImageBorderColor = Color.Black; _imageViewer.BorderStyle = BorderStyle.Fixed3D; _imageViewer.ImageBorderThickness = 1; using (RasterCodecs codec = new RasterCodecs()) { _imageViewer.Image = codec.Load(DemosGlobal.ImagesFolder + @"\ocr1.tif"); _imageViewer.AutomationDataProvider = new RasterImageAutomationDataProvider(_imageViewer.Image); } _automation = new AnnAutomation(_automationManager, _imageViewer); // Update the container size _automation.Container.Size = _automation.Container.Mapper.SizeToContainerCoordinates(LeadSizeD.Create(_imageViewer.Image.ImageWidth, _imageViewer.Image.ImageHeight)); _automation.EditText += new EventHandler <AnnEditTextEventArgs>(automation_EditText); _automation.OnShowContextMenu += new EventHandler <AnnAutomationEventArgs>(automation_OnShowContextMenu); _automation.OnShowObjectProperties += new EventHandler <AnnAutomationEventArgs>(automation_OnShowObjectProperties); _automation.LockObject += new EventHandler <AnnLockObjectEventArgs>(automation_LockObject); _automation.UnlockObject += new EventHandler <AnnLockObjectEventArgs>(automation_UnlockObject); _automation.SetCursor += new EventHandler <AnnCursorEventArgs>(automation_SetCursor); _automation.RestoreCursor += new EventHandler(automation_RestoreCursor); _automation.Active = true; _tvLayers.BeginUpdate(); _tvLayers.HideSelection = false; AnnLayer layer = AnnLayer.Create("Container"); AnnObjectCollection children = _automation.Container.Children; foreach (AnnObject annObject in children) { layer.Children.Add(annObject); } _containerNode = new LayerNode(layer, null, false); _containerNode.Tag = "Container"; _tvLayers.Nodes.Add(_containerNode); _tvLayers.EndUpdate(); CreateDefaultLayers(); OnResize(EventArgs.Empty); } base.OnLoad(e); }