Delphi XE UniGUI ExtJS [2] getEl()
Delphi XE UniGUI ExtJS [2] getEl()
1、位置:
- getX() //取得相对于页面的x坐标
- getY() //取得相对于页面的y坐标
- getXY() //取得相对于页面的x,y坐标,用法:ele.getXY()[0]/[1]
- getOffsetsTo(el) //取得相对元素el的坐标,返回值[x,y]
- setX(x,animate) //设相对于页面的x坐标,animate为true则开启默认动画效果
- setY(y,animate) //同上
- setLeft(left) //设style.left
- setTop(top) //设style.top
- setRight(right) //设style.right
- setBottom(bottom) //设style.bottom
- setXY(pos,animate) //设相对于页面的x,y,相当于setX,setY。用法:setXY([x,y],true)
- setLocation(x,y,animate) //相当于setXY。
- getRegion() //return {top=t,left=l,width=w,height=r}
- getHeight(true|false) //true不包括边框、内边距,false包括
- getBorderWidth(anthor)
- getPadding(anthor)
- getComputedHeight() //包括边框、内边距
- getComputedWidth()
- getSize() //相当于getWidth、getHeight {width:w,height:h}
- getStyleSize() //取style.width、style.height,且不包括边框{width:w,height:h}
- getViewSize() //取视口大小{width:w,height:h}
- getValue() //如果有value属必就取它
- setWidth(width,animate) //设style.width
- setHeight(height,animate) //设style.height
- setSize(width,height,animate)
- setBounds(x,y,width,height,animate) //相当于setSize、setXY
- setRegion(region,animate) //相当于setBounds
- getScroll() //取得当前视口在文档中水平、垂直方向上的偏移,返回{left:l,top:t}
- setOpacity(opacity,animate)
- getLeft(local) f//alse相当于getX,true相当于style.left
- getRight(local) //false相当于getX+getWidth,true相当于getLeft(true)+getWidth()
- getTop(local) //false相当于getY,true相当于style.top
- getBottom(local)
- position(pos,zIndex,x,y) string:pos,取static,relative,absolute,fixed
- zIndex //设z序,x,y用来调用setXY的
- clearPositionsing(value)
-
123456789101112
clearPositioning :
function
(value){
value = value ||
''
;
this
.setStyle({
"left"
: value,
"right"
: value,
"top"
: value,
"bottom"
: value,
"z-index"
:
""
,
"position"
:
"static"
});
return
this
;
}
- getPositioning() //取值格式如上{……}
- setPositioning(pc) //用法同applyStyles
- setLeftTop(left,top) //就是设style.left,style.top
- moveTo(x,y,animate) //相当于setXY
- move(direction,distance,animate) //很有用,direction移动方向,取t,l,r,b。
- distance //是移动的距离,animate是否启用动画效果
- getAnchorXY(anchor,local,s) //取得对齐到某处的页面x,y坐标
- getCenterXY() //取得对齐到视口中央的页面x,y坐标
- getAlignToXY(el,p,o) //取得对齐到某元素某处的页面x,y坐标
- alignTo(element,position,offsets,animate) //对齐到元素的某处,允许偏移、动画
- anchorTo(el,alignment,offsets,animate,monitorScroll,callback) //对齐到元素
- center(centerIn) //对齐到视口中央
- getBox(contentBox,local) //contentBox=false包括边框、内边距 local=false获取页面坐标
- setBox(box,adjust,animate) //box包括边框、内边距
- getFrameWidth(sides,onlycontentBox)
- repaint() //强制刷新元素
2、样式、属性
- addClass(String/Array className )
- removeClass(String/Array className)
- replaceClass(String oldClassName, String newClassName )
- radioClass(String/Array className )
- toggleClass(String className )
- setStyle(name,value)
- getStyle(name)
- hasClass(className)
- addClassOnClick(classname)
- addClassOnFocus(classname)
- addClassOnOver(classname)
- hover(classsname,bool preventFlicker)
3、页点:
- append(ele)
- appendTo(ele)
- replace(ele)
- replaceWith(ele)
- insertBefore(ele)
- insertAfter(ele)
- insertFirst(ele)
- insertHtml(where,html,returnEl)
- insertSibling(el,where,returnDom)
- remove()
- createChild(config,HTMLElement insertbefore,returndom)
- first(selector,returndom)
- last(selector,returndom)
- next(selector,returndom)
- prev(selector,returndom)
- parent(selector,returndom)
- child(selector,returndom)
- up(selector,maxdepth)
- down(selector,maxdepth)
- query(selector)
- contains(HTMLElement/string el)
- show(animate)
- hide(animate)
- toggle(animate)
- setVisible(boolean visible,animate)
- update(html, loadScripts, callback)
其他特殊
- hover( Function overFn, Function outFn, [Object scope] ) : Ext.Element
- mask(msg, msgCls)
- unmask()
- load( String/Function url, [String/Object params], [Function callback], [Boolean discardUrl] )
- focus()
- blur()
事件注册:
- on(eventname,fun)
- un(eventname,fun)
- addListenser/removeListenser/removeAllListeners
创建时间:2021.06.18 更新时间:
博客园 滔Roy https://www.cnblogs.com/guorongtao 希望内容对你有所帮助,谢谢!
分类:
Delphi 与 UniGUI
标签:
UniGUI
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
2020-06-18 Delphi 目录函数,操作[1] FindFirst、FindNext、TSearchRec - 寻找目标目录下的第一个文件和下一个文件