Example #1
0
 public static void Edit(Control root_control, TabPage tabpage, List<Control> exclude_control = null, ToolStrip tool_strip = null, List<int> disabled_button = null)
 {
     FormState fs = new FormState(tabpage);
     fs.setControlAddEditState(root_control);
     fs.exclusionControl(FormState.FORM_STATE_EDIT, exclude_control);
     fs.setToolStripButtonState(tool_strip, disabled_button);
     ((TabControl)tabpage.Parent).Selecting += new TabControlCancelEventHandler(fs.preventChangeTab);
     ((TabControl)tabpage.Parent).Click += new EventHandler(fs.returnToFocused);
 }
Example #2
0
 /// <summary>
 /// Set form state for FORM_STATE_READY, FORM_STATE_ADD, FORM_STATE_EDIT
 /// </summary>
 /// <param name="root_control">Root control, generally is the Form object</param>
 /// <param name="exclude_control">List of Control that exclude from state config</param>
 /// <param name="tool_strip">Toolstrip that contain ToolstripButton, ToolstripSplitButton, ....</param>
 /// <param name="disabled_button">List of Toolstrip items index for disabled</param>
 public static void Ready(Control root_control, TabPage tabpage, List<Control> exclude_control = null, ToolStrip tool_strip = null, List<int> disabled_button = null)
 {
     FormState fs = new FormState(tabpage);
     tabpage.Parent.Enabled = true;
     fs.setControlRedyState(root_control);
     fs.exclusionControl(FormState.FORM_STATE_READY, exclude_control);
     fs.setToolStripButtonState(tool_strip, disabled_button);
     ((TabControl)tabpage.Parent).Selecting += new TabControlCancelEventHandler(fs.allowChangeTab);
     root_control.Leave += new EventHandler(fs.leaveWindow);
 }
Example #3
0
        public static void Edit(Control root_control, TabPage tabpage, List <Control> exclude_control = null, ToolStrip tool_strip = null, List <int> disabled_button = null)
        {
            FormState fs = new FormState(tabpage);

            fs.setControlAddEditState(root_control);
            fs.exclusionControl(FormState.FORM_STATE_EDIT, exclude_control);
            fs.setToolStripButtonState(tool_strip, disabled_button);
            ((TabControl)tabpage.Parent).Selecting += new TabControlCancelEventHandler(fs.preventChangeTab);
            ((TabControl)tabpage.Parent).Click     += new EventHandler(fs.returnToFocused);
        }
Example #4
0
        /// <summary>
        /// Set form state for FORM_STATE_READY, FORM_STATE_ADD, FORM_STATE_EDIT
        /// </summary>
        /// <param name="root_control">Root control, generally is the Form object</param>
        /// <param name="exclude_control">List of Control that exclude from state config</param>
        /// <param name="tool_strip">Toolstrip that contain ToolstripButton, ToolstripSplitButton, ....</param>
        /// <param name="disabled_button">List of Toolstrip items index for disabled</param>
        public static void Ready(Control root_control, TabPage tabpage, List <Control> exclude_control = null, ToolStrip tool_strip = null, List <int> disabled_button = null)
        {
            FormState fs = new FormState(tabpage);

            tabpage.Parent.Enabled = true;
            fs.setControlRedyState(root_control);
            fs.exclusionControl(FormState.FORM_STATE_READY, exclude_control);
            fs.setToolStripButtonState(tool_strip, disabled_button);
            ((TabControl)tabpage.Parent).Selecting += new TabControlCancelEventHandler(fs.allowChangeTab);
            root_control.Leave += new EventHandler(fs.leaveWindow);
        }