示例#1
0
 /// <summary>
 /// Constructor for the class
 /// </summary>
 public AddTemplateDialog(MainForm main)
     : base(main)
 {
     InitializeComponent();
     mainForm = main as MakeViewMainForm;
     InitSettings();
 }
        /// <summary>
        /// Dispose of any components
        /// </summary>
        public override void Dispose()
        {
            // trash container and any components
            this.container.Dispose();

            form = null;

            // base class will finish the job
            base.Dispose();
        }
示例#3
0
        /// <summary>
        /// Constructor for the class
        /// </summary>
        /// <param name="frm">The main form</param>
        public ProjectExplorer(MakeViewMainForm frm)
            : base(frm)
        {
            InitializeComponent();

            AddOpenFields();
            UpdateTemplates(expandAllNodes: true);

            this.mainForm = frm;
            projectTree.Enabled = true;
        }
示例#4
0
        /// <summary>
        /// Constructor for the class
        /// </summary>
        public RenameTemplate(MainForm main, string copiedFolderName, string copiedExtension)
            : base(main)
        {
            InitializeComponent();
            mainForm = main as MakeViewMainForm;

            _copiedFolderName = copiedFolderName;
            _copiedExtension = copiedExtension;

            InitSettings();
        }
示例#5
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="frm">The main form</param>
        public Canvas(MainForm frm)
            : base(frm)
        {
            InitializeComponent();
            config = Configuration.GetNewInstance();

            makeViewForm = frm as MakeViewMainForm;
            makeViewForm.PageChanged += new EventHandler(makeViewForm_PageChanged);
            makeViewForm.GridSettingsChanged += new EventHandler(makeViewForm_GridSettingsChanged);

            waitPanel = new WaitPanel(PagePanel.Size);
            waitPanel.Hide();

            this.Controls.Add(waitPanel);
        }
示例#6
0
        /// <summary>
        /// Constructor for the class
        /// </summary>
        /// <param name="view">The View to load check code for</param>
        /// <param name="frm">The main form</param>
        public CheckCode(View currentview, MakeViewMainForm frm)
        {
            mainForm = frm;
            if(currentview!=null)
            currentview.MustRefreshFieldCollection = true;
            view = currentview;
            Construct();
            EpiInfo.Plugin.IEnterInterpreter MR = mainForm.EpiInterpreter;
            MR.Context.RemoveVariablesInScope(VariableScope.Standard);

            if (!string.IsNullOrEmpty(view.CheckCode))
            {
                try
                {
                    mainForm.EpiInterpreter.Execute(view.CheckCode);
                }
                catch
                {

                }
            }

            foreach (Field field in view.Fields)
            {
                if (field is IDataField)
                {
                    EpiInfo.Plugin.IVariable definedVar = (EpiInfo.Plugin.IVariable)field;
                    MR.Context.DefineVariable(definedVar);
                }
                else if (field is Epi.Fields.LabelField)
                {
                    PluginVariable p = new PluginVariable();
                    p.Name = field.Name;
                    p.Prompt = ((Epi.Fields.LabelField)field).PromptText;
                    p.VariableScope = EpiInfo.Plugin.VariableScope.DataSource;
                    p.DataType = EpiInfo.Plugin.DataType.Text;
                    MR.Context.DefineVariable(p);
                }
                else
                {
                }
            }

            BuildComboBox();

            this.codeText.SelectionStart = 0;
            this.codeText.SelectionLength = 0;
        }
示例#7
0
        /// <summary>
        /// Constructor for the class
        /// </summary>
        public PageSetupDialog(MainForm main)
            : base(main)
        {
            InitializeComponent();
            mainForm = main as MakeViewMainForm;

            _sizes = new System.Collections.Generic.Dictionary<String, Size>();
            string displayLabel;
            Size size;

            /// INCHES
            FormatSizeKeyValue("Letter (default)", PaperSizeUnit.Inches, 8.5, 11, out displayLabel, out size);
            _sizes.Add(displayLabel, size);
            FormatSizeKeyValue("Legal", PaperSizeUnit.Inches, 8.5, 14, out displayLabel, out size);
            _sizes.Add(displayLabel, size);
            FormatSizeKeyValue("Executive", PaperSizeUnit.Inches, 7.25, 10.5, out displayLabel, out size);
            _sizes.Add(displayLabel, size);

            /// MILLIMETERS
            FormatSizeKeyValue("A0", PaperSizeUnit.Millimeters, 841, 1189, out displayLabel, out size);
            _sizes.Add(displayLabel, size);
            FormatSizeKeyValue("A1", PaperSizeUnit.Millimeters, 594, 841, out displayLabel, out size);
            _sizes.Add(displayLabel, size);
            FormatSizeKeyValue("A2", PaperSizeUnit.Millimeters, 420, 594, out displayLabel, out size);
            _sizes.Add(displayLabel, size);
            FormatSizeKeyValue("A3", PaperSizeUnit.Millimeters, 297, 420, out displayLabel, out size);
            _sizes.Add(displayLabel, size);
            FormatSizeKeyValue("A4", PaperSizeUnit.Millimeters, 210, 297, out displayLabel, out size);
            _sizes.Add(displayLabel, size);
            FormatSizeKeyValue("A5", PaperSizeUnit.Millimeters, 148, 210, out displayLabel, out size);
            _sizes.Add(displayLabel, size);
            FormatSizeKeyValue("A6", PaperSizeUnit.Millimeters, 105, 148, out displayLabel, out size);
            _sizes.Add(displayLabel, size);

            /// ANDROID
            FormatSizeKeyValue("Android Galaxy Tab 2 7.0", PaperSizeUnit.Pixels, 341, 553, out displayLabel, out size);
            _sizes.Add(displayLabel, size);

            displayLabel = "Custom Size";
            _sizes.Add(displayLabel, new Size(780, 1016));
            _useAsDefaultPageSize = displayLabel;

            InitSettings();
        }
示例#8
0
        /// <summary>
        /// Constructor for the class
        /// </summary>
        public BackgroundDialog(MainForm form)
            : base(form)
        {
            InitializeComponent();
            mainForm = form as MakeViewMainForm;
            InitSettings();
            cbImageLayout.SelectedIndexChanged += new EventHandler(cbImageLayout_SelectedIndexChanged);
            btnChangeColor.Click += new System.EventHandler(OnChangeColor);
            panelColor.Click += new EventHandler(OnChangeColor);
            btnChooseImage.Click += new EventHandler(OnChangeImage);
            pictureBoxImage.Click += new EventHandler(OnChangeImage);
            backgroundTable = mainForm.CurrentPage.GetMetadata().GetPageBackgroundData(mainForm.CurrentPage);

            if (backgroundTable.Rows.Count > 0)
            {
                layout = Convert.ToString(backgroundTable.Rows[0]["ImageLayout"]);

                if (backgroundTable.Rows[0]["Color"] != System.DBNull.Value)
                {
                    color = Color.FromArgb(Convert.ToInt32(backgroundTable.Rows[0]["Color"]));
                }
            }
        }
示例#9
0
 /// <summary>
 /// Constructor for the class
 /// </summary>
 public CheckCode(MakeViewMainForm frm)
 {
     this.mainForm = frm;
     Construct();
 }
示例#10
0
 /// <summary>
 /// Constructor for the class
 /// </summary>
 /// <param name="field">The Field to load check code for</param>
 /// <param name="frm">The main form</param>
 public CheckCode(Field field, MakeViewMainForm frm,View currentview)
 {
     mainForm = frm;
     if (currentview != null)
     currentview.MustRefreshFieldCollection = true;
     view = currentview;
     Construct();
     BuildComboBox();
     string Identifier;
     if (field.Name.Trim().IndexOf(' ') > -1)
     {
         Identifier = "[" + field.Name + "]";
     }
     else
     {
         Identifier = field.Name;
     }
     if (field is Epi.Fields.CommandButtonField)
     {
         this.GotoLine("field", "click", Identifier, true);
     }
     else
     this.GotoLine("field", "", Identifier, true);
 }
示例#11
0
 /// <summary>
 /// Constructor for the class
 /// </summary>
 /// <param name="page">The Page to load check code for</param>
 /// <param name="frm">The main form</param>
 public CheckCode(Page page, MakeViewMainForm frm,View currentview)
 {
     mainForm = frm;
     if (currentview != null)
     currentview.MustRefreshFieldCollection = true;
     view = currentview;
     Construct();
     BuildComboBox();
     string Identifier;
     if (page.Name.Trim().IndexOf(' ') > -1)
     {
         Identifier = "[" + page.Name + "]";
     }
     else
     {
         Identifier = page.Name;
     }
     this.GotoLine("page", "", Identifier);
 }
        /// <summary>
        /// Attach the current project with module loading
        /// </summary>
        protected override void Load(IModuleManager moduleManager, ICommandLine commandLine)
        {
            base.Load(moduleManager, commandLine);

            try
            {
                if (form == null)
                {
                    form = new MakeViewMainForm(this);
                    container.Add(form);
                    form.Closed += new EventHandler(MainForm_Closed);
                    form.Disposed += new EventHandler(MainForm_Disposed);
                    form.Show();
                    form.Activate();

                    // assure handle creation
                    System.IntPtr handle = form.Handle;

                    // read the command line
                    if (commandLine != null)
                    {
                        string titleArgument = commandLine.GetArgument("title");
                        if (titleArgument != null)
                        {
                            form.Text = titleArgument;
                        }
                    }
                    base.OnLoaded();
                }
                else
                {
                    if (!form.IsDisposed)
                    {
                        form.Show();
                        if (form.WindowState == FormWindowState.Minimized)
                        {
                            form.WindowState = FormWindowState.Normal;
                        }
                        form.Activate();
                    }

                }
            }
            finally
            {
            }
        }