예제 #1
0
파일: table.cs 프로젝트: send2vinnie/1709
        public void resizeCol(IfacesEnumsStructsClasses.IHTMLElement e)
        {
            int w = getMaxWidthChildren(e);

            if (e.offsetWidth > w)
            {
                return;
            }
            IHTMLDOMNode node   = (IHTMLDOMNode)(e);
            int          ccount = 0;

            for (int i = 0; i < node.childNodes.length; i++)
            {
                if (!(node.childNodes.item(i) is IfacesEnumsStructsClasses.IHTMLElement))
                {
                    continue;
                }
                IfacesEnumsStructsClasses.IHTMLElement ne = (IfacesEnumsStructsClasses.IHTMLElement)(node.childNodes.item(i));
                if (ne.getAttribute("ltype", 1) != null && ne.getAttribute("ltype", 1).ToString() != "_cellDIV")
                {
                    continue;
                }
                float neww = (float)(ne.offsetWidth) / w * e.offsetWidth;

                IHTMLDOMNode ne_node = (IHTMLDOMNode)(ne);
                IfacesEnumsStructsClasses.IHTMLElement cc = (IfacesEnumsStructsClasses.IHTMLElement)(ne_node.firstChild);
                if (cc != null && cc.tagName == "DIV")
                {
                    cc.style.width = ((int)neww).ToString() + "px";
                }

                ne.style.width = ((int)neww).ToString() + "px";
            }
        }
예제 #2
0
        public static void doDoubleClick(IfacesEnumsStructsClasses.IHTMLElement e)
        {
            if (e == null)
            {
                return;
            }

            if (e.getAttribute("cType", 1).ToString().Equals("eq_ctrl"))
            {
                string dlk = e.getAttribute("dblink", 1).ToString();
                if (e.getAttribute("dblink", 1) == null)
                {
                    return;
                }
                // (markElement.markStateDef)Enum.Parse(typeof(markElement.markStateDef), (string)(dr["state"]));
                controlTypes ct = (controlTypes)Enum.Parse(typeof(controlTypes), dlk);
                if (ct == controlTypes.CUS_CTRL_RADIO)
                {
                    ;
                }
                {
                    controls.radioSelection rs = new DemoApp.eq_controls.controls.radioSelection(ct);
                    rs.loadInfoFromElement(e);
                }
            }
        }
예제 #3
0
파일: table.cs 프로젝트: send2vinnie/1709
        public void alignHeight(IfacesEnumsStructsClasses.IHTMLElement e)
        {
            // int h = getMaxHeightInRow(e);


            IfacesEnumsStructsClasses.IHTMLElement p = e.parentElement;
            if (p.getAttribute("ltype", 1) != null && p.getAttribute("ltype", 1).ToString() != "_colDIV")
            {
                return;
            }


            IHTMLDOMNode node = (IHTMLDOMNode)(p);

            for (int i = 0; i < node.childNodes.length; i++)
            {
                if (!(node.childNodes.item(i) is IfacesEnumsStructsClasses.IHTMLElement))
                {
                    continue;
                }
                IfacesEnumsStructsClasses.IHTMLElement ne = (IfacesEnumsStructsClasses.IHTMLElement)(node.childNodes.item(i));
                if (ne.getAttribute("ltype", 1) != null && ne.getAttribute("ltype", 1).ToString() != "_cellDIV")
                {
                    continue;
                }
                ne.style.height = e.offsetHeight.ToString() + "px";
            }
        }
예제 #4
0
        public bool isControl(IfacesEnumsStructsClasses.IHTMLElement e)
        {
            if (e == null)
            {
                return(false);
            }
            if (e.getAttribute("cType", 0) != null && e.getAttribute("cType", 0).Equals("eq_ctrl"))
            {
                return(true);
            }

            if (e.parentElement != null)
            {
                return(isControl(e.parentElement));
            }

            return(false);
        }
예제 #5
0
파일: table.cs 프로젝트: send2vinnie/1709
        private bool isMaxWidthInRow(IfacesEnumsStructsClasses.IHTMLElement e)
        {
            int w = e.offsetWidth;

            string rowidx = e.getAttribute("rowidx", 1).ToString();

            if (rowidx == null || rowidx.Equals(""))
            {
                return(false);
            }


            IfacesEnumsStructsClasses.IHTMLElement p = e.parentElement;
            if (p.getAttribute("ltype", 1) != null && p.getAttribute("ltype", 1).ToString() != "_containerDIV")
            {
                return(false);
            }

            IHTMLDOMNode node = (IHTMLDOMNode)(p);

            for (int i = 0; i < node.childNodes.length; i++)
            {
                if (!(node.childNodes.item(i) is IfacesEnumsStructsClasses.IHTMLElement))
                {
                    continue;
                }
                IfacesEnumsStructsClasses.IHTMLElement ne = (IfacesEnumsStructsClasses.IHTMLElement)(node.childNodes.item(i));
                if (ne.getAttribute("ltype", 1) != null && ne.getAttribute("ltype", 1).ToString() != "_cellDIV")
                {
                    continue;
                }
                string idxs = ne.getAttribute("rowidx", 1).ToString();
                if (!idxs.Equals(rowidx))
                {
                    continue;
                }
                if (ne.offsetWidth >= w)
                {
                    return(false);
                }
            }

            return(true);
        }
예제 #6
0
파일: table.cs 프로젝트: send2vinnie/1709
        private int getMaxWidthInRow(IfacesEnumsStructsClasses.IHTMLElement e)
        {
            int w = e.offsetWidth;

            string rowidx = e.getAttribute("rowidx", 1).ToString();

            if (rowidx == null || rowidx.Equals(""))
            {
                return(w);
            }


            IfacesEnumsStructsClasses.IHTMLElement p = e.parentElement;
            if (p.getAttribute("ltype", 1) != null && p.getAttribute("ltype", 1).ToString() != "_colDIV")
            {
                return(w);
            }
            w = 0;

            IHTMLDOMNode node = (IHTMLDOMNode)(p);

            for (int i = 0; i < node.childNodes.length; i++)
            {
                if (!(node.childNodes.item(i) is IfacesEnumsStructsClasses.IHTMLElement))
                {
                    continue;
                }
                IfacesEnumsStructsClasses.IHTMLElement ne = (IfacesEnumsStructsClasses.IHTMLElement)(node.childNodes.item(i));
                if (ne.getAttribute("ltype", 1) != null && ne.getAttribute("ltype", 1).ToString() != "_cellDIV")
                {
                    continue;
                }
                // string idxs = ne.getAttribute("rowidx",1).ToString();
                // if (!idxs.Equals(rowidx))
                //     continue;

                //   if (ne.offsetTop != e.offsetTop)
                //       continue;
                w += ne.offsetWidth;
            }

            return(w);
        }
예제 #7
0
파일: table.cs 프로젝트: send2vinnie/1709
        private int getMaxHeightInRow(IfacesEnumsStructsClasses.IHTMLElement e)
        {
            int w = 0;

            string rowidx = e.getAttribute("rowidx", 1).ToString();

            if (rowidx == null || rowidx.Equals(""))
            {
                return(w);
            }


            IfacesEnumsStructsClasses.IHTMLElement p = e.parentElement;
            if (p.getAttribute("ltype", 1) != null && p.getAttribute("ltype", 1).ToString() != "_colDIV")
            {
                return(w);
            }
            w = 0;

            IHTMLDOMNode node = (IHTMLDOMNode)(p);

            for (int i = 0; i < node.childNodes.length; i++)
            {
                if (!(node.childNodes.item(i) is IfacesEnumsStructsClasses.IHTMLElement))
                {
                    continue;
                }
                IfacesEnumsStructsClasses.IHTMLElement ne = (IfacesEnumsStructsClasses.IHTMLElement)(node.childNodes.item(i));
                if (ne.getAttribute("ltype", 1) != null && ne.getAttribute("ltype", 1).ToString() != "_cellDIV")
                {
                    continue;
                }

                if (w < ne.offsetHeight)
                {
                    w = ne.offsetHeight;
                }
            }

            return(w);
        }
예제 #8
0
파일: table.cs 프로젝트: send2vinnie/1709
        public void resize(IfacesEnumsStructsClasses.IHTMLElement e)
        {
            if (e == null)
            {
                return;
            }


            if (e.getAttribute("ltype", 1) != null && e.getAttribute("ltype", 1).ToString() == "_colDIV")
            {
                resizeCol(e);
                return;
            }

            if (e.getAttribute("ltype", 1) != null && e.getAttribute("ltype", 1).ToString() != "_cellDIV")
            {
                return;
            }


            int w = getMaxWidthInRow(e);

            if (w >= e.parentElement.offsetWidth)
            {
                int val = w + 2;
                e.parentElement.style.width = val.ToString() + "px";

                // if(w>e.parentElement.parentElement.offsetWidth)
                //     e.parentElement.parentElement.style.width = val.ToString() + "px";
            }
            else
            {
                int val = w + 2;
                e.parentElement.style.width = val.ToString() + "px";
            }

            alignWidth(e);

            //int h = getMaxHeightInRow(e);
            alignHeight(e);
        }
예제 #9
0
        public static void doDoubleClick(IfacesEnumsStructsClasses.IHTMLElement e, DemoApp.frmHTMLeditor pform)
        {
            if (e == null)
            {
                return;
            }

            if (e.getAttribute("cType", 1).ToString().Equals("eq_ctrl"))
            {
                string dlk = e.getAttribute("dblink", 1).ToString();
                if (e.getAttribute("dblink", 1) == null)
                {
                    return;
                }
                // (markElement.markStateDef)Enum.Parse(typeof(markElement.markStateDef), (string)(dr["state"]));
                controlTypes ct = (controlTypes)Enum.Parse(typeof(controlTypes), dlk);
                if (ct == controlTypes.CUS_CTRL_RADIO)
                {
                    controls.radioSelection rs = new DemoApp.eq_controls.controls.radioSelection(ct);
                    IfacesEnumsStructsClasses.IHTMLElement newe = rs.loadInfoFromElement(e);
                    //  if (newe != null)
                    //      pform.addControl(newe);
                }
                if (ct == controlTypes.CUS_CTRL_EFRAME)
                {
                    pform.iframeLoadCount = 1;

                    controls.eframe rs = new DemoApp.eq_controls.controls.eframe(ct);
                    rs.loadInfoFromElement(e);
                    return;
                }
                if (ct == controlTypes.CUS_CTRL_SUBMIT)
                {
                    controls.submit s = new DemoApp.eq_controls.controls.submit(ct);
                    s.pform = pform;

                    s.loadInfoFromElement(e);
                }
            }
        }
예제 #10
0
        public static void deleteRelation(DemoApp.frmHTMLeditor pform, IfacesEnumsStructsClasses.IHTMLElement e)
        {
            string dlk = e.getAttribute("dblink", 1).ToString();

            if (e.getAttribute("dblink", 1) == null)
            {
                return;
            }
            // (markElement.markStateDef)Enum.Parse(typeof(markElement.markStateDef), (string)(dr["state"]));
            controlTypes ct = (controlTypes)Enum.Parse(typeof(controlTypes), dlk);

            if (ct == controlTypes.CUS_CTRL_TEXTAREA)
            {
                controls.textArea t = new DemoApp.eq_controls.controls.textArea(ct);
                t.deletMeRelation(e, pform);
            }
            if (ct == controlTypes.CUS_CTRL_RADIO)
            {
                controls.radioSelection t = new DemoApp.eq_controls.controls.radioSelection(ct);
                t.deletMeRelation(e, pform);
            }
        }
예제 #11
0
파일: table.cs 프로젝트: send2vinnie/1709
        private int getMaxWidthChildren(IfacesEnumsStructsClasses.IHTMLElement e)
        {
            int w = 0;

            IHTMLDOMNode node = (IHTMLDOMNode)(e);

            for (int i = 0; i < node.childNodes.length; i++)
            {
                if (!(node.childNodes.item(i) is IfacesEnumsStructsClasses.IHTMLElement))
                {
                    continue;
                }
                IfacesEnumsStructsClasses.IHTMLElement ne = (IfacesEnumsStructsClasses.IHTMLElement)(node.childNodes.item(i));
                if (ne.getAttribute("ltype", 1) != null && ne.getAttribute("ltype", 1).ToString() != "_cellDIV")
                {
                    continue;
                }
                w += ne.offsetWidth;
            }

            return(w);
        }
예제 #12
0
 virtual public void loadInfoFromElement(IfacesEnumsStructsClasses.IHTMLElement e)
 {
 }
        private void checkObjectType(IHTMLEventObj pEvtObj)
        {
            IHTMLElement p = null;
              /*  if (hitElement != null)
            {
                cEXWB1.highlightElement(hitElement, false);
                p = getCtrlParent(hitElement);
                if(p!=null)
                    cEXWB1.highlightElement(p, false);
            }*/

            cEXWB1.closeHightLight();
            hitElement = pEvtObj.SrcElement;
            p = cEXWB1.GetElementByCussor(false, false);
            if (p != null)
            {
                p = getCtrlParent(p);
                if (p != null)
                {
                    cEXWB1.highlightElement(p, true);
                    cEXWB1.focusToElement(p);
                }
            }
               /* IHTMLElement p = getCtrlParent(hitElement) ;
            if (p != null)
            {
                if (p != hitElement)
                    cEXWB1.focusToElement(p);
            }*/

               // if(p!=null)

               // if (p != null)
               //     pEvtObj.SrcElement = p;
              /*  if (pEvtObj == null)
                return;
            if (isControl(pEvtObj.SrcElement))
            {
                MessageBox.Show("hit");
            }
            else MessageBox.Show("no");*/
        }
예제 #14
0
 public void mouseUPFunc(IfacesEnumsStructsClasses.IHTMLElement e)
 {
     if (e == null)
         return;
     cEXWB1.closeHightLight();
     this.hitElement = e; 
 }
예제 #15
0
        private void checkObjectType(IHTMLEventObj pEvtObj)
        {
            IHTMLElement p = null;
          

            cEXWB1.closeHightLight();
            hitElement = pEvtObj.SrcElement;
            p = cEXWB1.GetElementByCussor(false, false);
            if (p != null)
            {
                p = getCtrlParent(p);
                if (p != null)
                {
                    cEXWB1.highlightElement(p, true);
                   // cEXWB1.focusToElement(p);
                }
                else
                {
                    IHTMLDocument2 doc2 = hitElement.document as  IHTMLDocument2 ;
                    string u1 = cEXWB1.GetActiveDocument().url ;
                    string u2 = doc2.url ;
                    if (!u1.Equals(u2))
                    {
                        IfacesEnumsStructsClasses.IHTMLElement2 e2 = (IfacesEnumsStructsClasses.IHTMLElement2)(cEXWB1.GetActiveDocument());
                        IfacesEnumsStructsClasses.IHTMLElementCollection c = (e2.getElementsByTagName("iframe")) as IfacesEnumsStructsClasses.IHTMLElementCollection;
                        foreach (IHTMLElement2 ce in c)
                        {
                            IHTMLElement cee = (IHTMLElement)ce;
                            object obj = cee.getAttribute("src", 1);
                            if (obj != null)
                            {
                                string url = obj.ToString();
                                if (url.StartsWith(u2))
                                {
                                   // cEXWB1.highlightElement(cee, true);
                                   // cEXWB1.focusToElement(cee);
                                  //  break; 
                                }
                            }
                         }
                    }
                }
            }
            
        }
예제 #16
0
 public bool deleteObj()
 {
     if (hitElement != null)
     {
         IHTMLElement p = getCtrlParent(hitElement);
         if (p == null)
             p = getLayParent(hitElement);
             
         if(p!= null )
            env.deletRelations(p);
         if (cEXWB1.deleteElement(p))
         {
             
             hitElement = null;
             return true;
         }
     }
     return false;
    
 }
예제 #17
0
 virtual public void deletMeRelation(IfacesEnumsStructsClasses.IHTMLElement e, DemoApp.frmHTMLeditor pform)
 {
 }
예제 #18
0
파일: table.cs 프로젝트: send2vinnie/1709
        public void alignWidth(IfacesEnumsStructsClasses.IHTMLElement e)
        {
            // int h = getMaxHeightInRow(e);


            IfacesEnumsStructsClasses.IHTMLElement p = e.parentElement;


            if (p.parentElement != null)
            {
                p = p.parentElement; // tr ;
            }
            else
            {
                return;
            }

            if (p.parentElement != null)
            {
                p = p.parentElement; // tbody ;
            }
            else
            {
                return;
            }

            IfacesEnumsStructsClasses.IHTMLElement table = p.parentElement;


            object obj = e.getAttribute("rowidx", 1);

            if (obj == null)
            {
                return;
            }
            string fgIdx = obj.ToString();
            int    maxW  = getMaxWidthInRow(e);


            //   table.style.width = (maxW+2).ToString() + "px";



            IHTMLDOMNode node = (IHTMLDOMNode)(p);

            for (int i = 0; i < node.childNodes.length; i++)
            {
                //tr
                IHTMLDOMNode tr = (IHTMLDOMNode)(node.childNodes.item(i));
                if (tr == null)
                {
                    continue;
                }
                for (int j = 0; j < tr.childNodes.length; j++)
                {
                    IHTMLDOMNode td = (IHTMLDOMNode)(tr.childNodes.item(j));
                    if (td == null)
                    {
                        continue;
                    }
                    for (int k = 0; k < td.childNodes.length; k++)
                    {
                        IHTMLDOMNode div = (IHTMLDOMNode)(td.childNodes.item(k));
                        if (div == null)
                        {
                            continue;
                        }
                        IfacesEnumsStructsClasses.IHTMLElement dive = (IfacesEnumsStructsClasses.IHTMLElement)div;
                        obj = dive.getAttribute("rowidx", 1);
                        if (obj == null)
                        {
                            continue;
                        }
                        string idx = obj.ToString();
                        if (idx.Equals(fgIdx))
                        {
                            if (dive == e)
                            {
                                continue;
                            }
                            dive.style.width = e.offsetWidth.ToString() + "px";
                            dive.parentElement.style.width = "auto";
                        }
                    }
                }
            }

            table.style.width = "auto";
        }
 public bool deleteObj()
 {
     if (hitElement != null)
     {
         IHTMLElement p = getCtrlParent(hitElement);
         if (cEXWB1.deleteElement(p))
         {
             hitElement = null;
             return true;
         }
     }
     return false;
 }
예제 #20
0
 virtual public IfacesEnumsStructsClasses.IHTMLElement loadInfoFromElement(IfacesEnumsStructsClasses.IHTMLElement e)
 {
     return(null);
 }