public static void LoadUserControl(string UserControlName)
        {
            Button btnUserControl = new Button();

            btnUserControl.FlatAppearance.BorderSize = 0;
            btnUserControl.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            btnUserControl.Font      = new System.Drawing.Font("Microsoft Sans Serif", 10.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            btnUserControl.ForeColor = System.Drawing.SystemColors.ControlText;
            //this.helpProvider1.SetHelpKeyword(this.buttonControl, "Button");
            //this.helpProvider1.SetHelpNavigator(this.buttonControl, System.Windows.Forms.HelpNavigator.KeywordIndex);
            btnUserControl.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            btnUserControl.ImageIndex = 28;
            btnUserControl.ImageList  = ToolBoxWindow.form.toolBoxWindow.imageList;
            btnUserControl.Location   = new System.Drawing.Point(x, y);
            y += 40;
            btnUserControl.Margin = new System.Windows.Forms.Padding(2);
            btnUserControl.Name   = UserControlName;
            //this.helpProvider1.SetShowHelp(btnUserControl, true);
            btnUserControl.Size                    = new System.Drawing.Size(144, 33);
            btnUserControl.TabIndex                = 1;
            btnUserControl.Text                    = UserControlName;
            btnUserControl.TextAlign               = System.Drawing.ContentAlignment.MiddleRight;
            btnUserControl.TextImageRelation       = System.Windows.Forms.TextImageRelation.ImageBeforeText;
            btnUserControl.UseVisualStyleBackColor = true;
            ToolBoxWindow.form.toolBoxWindow.userControls.Controls.Add(btnUserControl);
            DragDropHandler.RegisterControl(btnUserControl, false, true);
        }
Esempio n. 2
0
 public void RegisterDragDrop()
 {
     DragDropHandler.RegisterControl(labelControl, false, true);
     DragDropHandler.RegisterControl(frameControl, false, true);
     DragDropHandler.RegisterControl(textBoxControl, false, true);
     DragDropHandler.RegisterControl(buttonControl, false, true);
     DragDropHandler.RegisterControl(treeControl, false, true);
     DragDropHandler.RegisterControl(multiTabControl, false, true);
     DragDropHandler.RegisterControl(tableControl, false, true);
     DragDropHandler.RegisterControl(connectorControl, false, true);
 }
Esempio n. 3
0
 public void RegisterDragDrop()
 {
     DragDropHandler.RegisterControl(labelControl, false, true);
     DragDropHandler.RegisterControl(frameControl, false, true);
     DragDropHandler.RegisterControl(jasperControl, false, true);
     DragDropHandler.RegisterControl(textBoxControl, false, true);
     DragDropHandler.RegisterControl(buttonControl, false, true);
     DragDropHandler.RegisterControl(browseControl, false, true);
     DragDropHandler.RegisterControl(datePickerControl, false, true);
     DragDropHandler.RegisterControl(treeControl, false, true);
     DragDropHandler.RegisterControl(treeNodeControl, false, true);
     DragDropHandler.RegisterControl(multiTabControl, false, true);
     DragDropHandler.RegisterControl(tabPageControl, false, true);
     DragDropHandler.RegisterControl(tableControl, false, true);
     DragDropHandler.RegisterControl(connectorControl, false, true);
     DragDropHandler.RegisterControl(pictureControl, false, true);
     DragDropHandler.RegisterControl(checkboxControl, false, true);
     DragDropHandler.RegisterControl(radioControl, false, true);
     DragDropHandler.RegisterControl(comboControl, false, true);
     //DragDropHandler.RegisterControl(menuBarControl, false, true);
     DragDropHandler.RegisterControl(menuControl, false, true);
     DragDropHandler.RegisterControl(menuItemControl, false, true);
     DragDropHandler.RegisterControl(relationControl, false, true);
     DragDropHandler.RegisterControl(nodeControl, false, true);
     DragDropHandler.RegisterControl(nodeConnectorControl, false, true);
     // DragDropHandler.RegisterControl(searchControl, false, true);
     DragDropHandler.RegisterControl(listControl, false, true);
     DragDropHandler.RegisterControl(gridControl, false, true);
     DragDropHandler.RegisterControl(scrollablerowControl, false, true);
     DragDropHandler.RegisterControl(columnControl, false, true);
     DragDropHandler.RegisterControl(radioGroupControl, false, true);
     DragDropHandler.RegisterControl(PlaceHolderControl, false, true);
     DragDropHandler.RegisterControl(timeControl, false, true);
     DragDropHandler.RegisterControl(pagingControl, false, true);
     DragDropHandler.RegisterControl(vMenuBarControl, false, true);
     DragDropHandler.RegisterControl(calenderControl, false, true);
     DragDropHandler.RegisterControl(imageBrowseControl, false, true);
     DragDropHandler.RegisterControl(schedularControl, false, true);
     DragDropHandler.RegisterControl(appletControl, false, true);
     DragDropHandler.RegisterControl(latticeControl, false, true);
 }
Esempio n. 4
0
        public static object CreateControl(string ctrlName, string partialName)
        {
            try
            {
                Control ctrl = null;
                //ToolStripMenuItem menu;
                //ToolStripButton menuItem;
                switch (ctrlName)
                {
                case "EIBButton":
                    ctrl = new EIBButton();
                    break;

                case "EIBApplet":
                    ctrl = new EIBApplet();
                    break;

                case "EIBLattice":
                    ctrl = new EIBLattice();
                    break;

                case "EIBSchedular":
                    ctrl = new EIBSchedular();
                    break;

                case "EIBDatePicker":
                    ctrl = new EIBDatePicker();
                    break;

                case "EIBTime":
                    ctrl = new EIBTime();
                    break;

                case "EIBCheckbox":
                    ctrl = new EIBCheckbox();
                    break;

                case "EIBCombobox":
                    ctrl = new EIBCombobox();
                    break;

                case "EIBLabel":
                    ctrl = new EIBLabel();
                    break;

                case "EIBLine":
                    ctrl = new EIBLine();
                    break;

                case "EIBPanel":
                    ctrl = new EIBPanel();
                    DragDropHandler.RegisterControl(ctrl, true, true);
                    break;

                case "EIBJasper":
                    ctrl = new EIBJasper();
                    break;

                case "EIBRadioGroup":
                    ctrl = new EIBRadioGroup();
                    DragDropHandler.RegisterControl(ctrl, true, true);
                    break;

                case "EIBPicture":
                    ctrl = new EIBPicture();
                    break;

                case "EIBRadioButton":
                    ctrl = new EIBRadioButton();
                    break;

                case "EIBTabControl":
                    ctrl = new EIBTabControl();
                    DragDropHandler.RegisterControl(ctrl, true, true);
                    break;

                case "EIBTabPage":
                    ctrl = new EIBTabPage();
                    DragDropHandler.RegisterControl(ctrl, true, true);
                    break;

                case "EIBSearch":
                    ctrl = new EIBSearch();
                    break;

                case "EIBListbox":
                    ctrl = new EIBListbox();
                    break;

                case "EIBGrid":
                    ctrl = new EIBGrid();
                    DragDropHandler.RegisterControl(ctrl, true, true);
                    break;

                case "EIBTable":
                    ctrl = new EIBTable();
                    break;

                case "EIBRelation":
                    ctrl = new EIBRelation();
                    break;

                case "EIBTextBox":
                    ctrl = new EIBTextBox();
                    break;

                case "EIBTreeView":
                    ctrl = new EIBTreeView();
                    break;

                case "EIBMenuBar":
                    ctrl = new EIBMenuBar(false);
                    DragDropHandler.RegisterControl(ctrl, true, true);
                    break;

                case "EIBNode":
                    ctrl = new EIBNode();
                    break;

                case "EIBNodeRelation":
                    ctrl = new EIBNodeRelation();
                    break;

                case "EIBColumn":
                    ctrl = new EIBColumn();
                    DragDropHandler.RegisterControl(ctrl, true, true);
                    break;

                case "EIBScrollableRow":
                    ctrl = new EIBScrollableRow();
                    DragDropHandler.RegisterControl(ctrl, true, true);
                    break;

                case "EIBBrowse":
                    ctrl = new EIBBrowse();
                    break;

                case "EIBVMenuBar":
                    ctrl = new EIBVMenuBar(false);
                    DragDropHandler.RegisterControl(ctrl, true, true);
                    break;

                case "EIBMenu":
                    return(new EIBMenu());

                case "EIBMenuItem":
                    return(new EIBMenuItem());

                /*
                 *                  case "EIBTreeNode":
                 *                      ctrl = new EIBTreeNode();
                 *                      break;
                 */
                default:
                    Assembly controlAsm  = Assembly.LoadWithPartialName(partialName);
                    Type     controlType = controlAsm.GetType(partialName + "." + ctrlName);
                    ctrl = (Control)Activator.CreateInstance(controlType);
                    break;
                }

                return(ctrl);
            }
            catch (Exception ex)
            {
                System.Diagnostics.Trace.WriteLine("create control failed:" + ex.Message);
                return(new Control());
            }
        }
Esempio n. 5
0
        public BaseWindow initBaseWindow(string typeOfWindow, string windowName, bool isWindowSaved)
        {
            try
            {
                if (typeOfWindow == FormDesignerConstants.FormPattern)
                {
                    //Check for new Window
                    if (windowName == null)
                    {
                        windowName        = "";
                        currentBaseWindow = new BaseWindow(typeOfWindow, windowName, isWindowSaved);

                        windowName = currentBaseWindow.baseFrame.ControlName;
                        listFormBaseWindow.Add(currentBaseWindow.baseFrame.ControlName, currentBaseWindow);
                        listBaseWindow.Add(currentBaseWindow);
                        DragDropHandler.RegisterControl(currentBaseWindow.baseFrame, true, true);
                    }
                    //Check if we already create this object so no need to create new one
                    else if (!listFormBaseWindow.ContainsKey(windowName))
                    {
                        //currentBaseWindow.baseFrame.DataBindings.Add("ControlName",FormDesignerUtilities.dataSetList["datapattern0"]);
                        currentBaseWindow = new BaseWindow(typeOfWindow, windowName, isWindowSaved);
                        listFormBaseWindow.Add(currentBaseWindow.baseFrame.ControlName, currentBaseWindow);
                        listBaseWindow.Add(currentBaseWindow);
                        DragDropHandler.RegisterControl(currentBaseWindow.baseFrame, true, true);
                    }
                    else
                    {
                        currentBaseWindow = listFormBaseWindow[windowName];
                    }
                }
                if (typeOfWindow == FormDesignerConstants.DataPattern)
                {
                    if (windowName == null)
                    {
                        windowName = "";
                    }

                    if (!listDataBaseWindow.ContainsKey(windowName))
                    {
                        currentBaseWindow = new BaseWindow(typeOfWindow, windowName, isWindowSaved);
                        listDataBaseWindow.Add(currentBaseWindow.baseFrame.ControlName, currentBaseWindow);
                        listBaseWindow.Add(currentBaseWindow);
                        DragDropHandler.RegisterControl(currentBaseWindow.baseFrame, true, true);
                    }
                    else
                    {
                        currentBaseWindow = listDataBaseWindow[windowName];
                    }
                }
                if (typeOfWindow == FormDesignerConstants.WorkflowPattern)
                {
                    if (windowName == null)
                    {
                        windowName = "";
                    }
                    if (!listWorkBaseWindow.ContainsKey(windowName))
                    {
                        currentBaseWindow = new BaseWindow(typeOfWindow, windowName, isWindowSaved);
                        listWorkBaseWindow.Add(currentBaseWindow.baseFrame.ControlName, currentBaseWindow);
                        listBaseWindow.Add(currentBaseWindow);
                        DragDropHandler.RegisterControl(currentBaseWindow.baseFrame, true, true);
                    }
                    else
                    {
                        currentBaseWindow = listWorkBaseWindow[windowName];
                    }
                }

                currentBaseWindow.TypeOfWindow  = typeOfWindow;
                formulaEditor.CurrentBaseWindow = currentBaseWindow;
                currentBaseWindow.Click        += new EventHandler(currentBaseWindow_Click);
                currentBaseWindow.KeyPreview    = true;
                if (!currentBaseWindow.isKeyDown)
                {
                    currentBaseWindow.KeyDown  += new KeyEventHandler(eventManager.HandleCtrlDown);
                    currentBaseWindow.KeyUp    += new KeyEventHandler(eventManager.HandleCtrlUp);
                    currentBaseWindow.KeyPress += new KeyPressEventHandler(eventManager.HandleKeyPress);
                    currentBaseWindow.isKeyDown = true;
                }
                /*Register it only for one time*/
                //DragDropHandler.RegisterControl(currentBaseWindow.baseFrame, true, true);
                //baseWindowDefaultToolClick(null, null);
                currentBaseWindow.MouseClick += new MouseEventHandler(eventManager.handleControlClick);
                if (!currentBaseWindow.baseFrame.isMouseClick)
                {
                    currentBaseWindow.baseFrame.MouseClick  += new MouseEventHandler(eventManager.handleControlClick);
                    currentBaseWindow.baseFrame.isMouseClick = true;
                }
                //currentBaseWindow.SizeChanged += new EventHandler(currentBaseWindow_SizeChanged);
                currentBaseWindow.baseFrame.Scroll        += new ScrollEventHandler(baseFrame_Scroll);
                currentBaseWindow.baseFrame.MouseWheel    += new MouseEventHandler(baseFrame_MouseWheel);
                UIEventManager.form.currentBaseWindow      = currentBaseWindow;
                FormulaEditorWindow.form.currentBaseWindow = currentBaseWindow;
                //Added by HKU to set the first form pattern as default screen
                if (currentBaseWindow.TypeOfWindow == FormDesignerConstants.FormPattern)
                {
                    if (currentBaseWindow != null)
                    {
                        if (listFormBaseWindow.Count == 1 && FormDesignerUtilities.visibleTrueWindow.Count < 1)
                        {
                            currentBaseWindow.baseFrame.DefaultScreen = true;
                        }
                    }
                }
                //Adding by HKU done
                return(currentBaseWindow);
            }
            catch
            {
                return(null);
            }
        }