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"; } }
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); } } }
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"; } }
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); }
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); }
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); }
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); }
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); }
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); } } }
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); } }
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); }
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");*/ }
public void mouseUPFunc(IfacesEnumsStructsClasses.IHTMLElement e) { if (e == null) return; cEXWB1.closeHightLight(); this.hitElement = e; }
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; } } } } } } }
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; }
virtual public void deletMeRelation(IfacesEnumsStructsClasses.IHTMLElement e, DemoApp.frmHTMLeditor pform) { }
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; }
virtual public IfacesEnumsStructsClasses.IHTMLElement loadInfoFromElement(IfacesEnumsStructsClasses.IHTMLElement e) { return(null); }