自適應視窗元件

2021-08-31 04:20:31 字數 3036 閱讀 9411

發現自帶的沒有這個元件自己就寫了乙個簡單的,後來才發現第三方有寫這個,看來是白寫了,下邊開源下原始碼

resizewindow.mxml是flex的元件介面直接用就可以了。如果想擴充套件的可以自己擴充套件下

支援拖拉,大小拖動

--------------------------------resizewindow.mxml----------------------------

<?xml version="1.0" encoding="utf-8"?>

-------------------------------------resizewindow.as---------------------------------------

package com.components.resizewindow

public function ableresize(bool:boolean):void

public function get isresize():boolean

public function get resizetype():string

private function timerfunc(event:timerevent):void

this.resize()

this.scalegrid.graphics.clear()

} private function resizefunc(event:resizewindowevent):void

private function addedfunc(event:event):void

private function movefunc(event:moveevent):void

private function fitsize(rect:rectangle):void

private var num:int=1

private function enterframefunc(event:event):void

this.bounds=this.getbounds(this.parent)

this.num++

this.scalegrid.graphics.clear()

}public function resize():void

}}

----------------------------------scalegrid------------------------------------------- 

package com.components.resizewindow

public function resize(rect:rectangle):void

}private function resizeing(rect:rectangle):void

public function resizetop(top:point):void

public function resizetopleft(topleft:point):void

public function resizetopright(topright:point):void

public function resizeleft(left:point):void

public function resizeright(right:point):void

public function resizeboutton(boutton:point):void

public function resizebouttonleft(bouttonleft:point):void

public function resizebouttonright(bouttonright:point):void

private function doresize(tmp:rectangle):void

private function confit():void

private function createevent(target:resizecell,type:string):void

private function top_left_click(event:mouseevent):void

private function top_click(event:mouseevent):void

private function top_right_click(event:mouseevent):void

private function left_click(event:mouseevent):void

private function right_click(event:mouseevent):void

private function boutton_left_click(event:mouseevent):void

private function boutton_click(event:mouseevent):void

private function boutton_right_click(event:mouseevent):void}}

----------------------------------------resizecell.as--------------------------------

package com.components.resizewindow

public function set icon(source:object):void

else if(source as string)

}private function loadeefunc(event:event):void

public function drawgrid(width:number=15,height:number=15):void}}

----------------------------------------resizewindowevent.as---------------------------

package com.components.resizewindow

}}

Qt 自適應視窗

關於視窗布局 預設控制項的大小為最小尺寸 如果此時右鍵設定布局時,視窗大小會自動縮放對應大小,不利於調整。建議視窗控制項設定好最小尺寸,便於視窗布局時,控制項不會變形,例如 改變minimumsize,會改變sizehint控制項預設尺寸 測試於qt4 結合控制項的sizepolicy屬性,來控制布...

自適應process元件

很久沒有寫部落格了,自從工作忙了就忘了學習新東西,真是越大越懶。做專案中,需要乙個process流程的ui元件,翻遍公司元件和業界框架,都沒有滿足自適應要求的現成的process元件,只能自己實現。實現的過程中,發現有兩個有意思的地方,特此分享出來。首先看看最後需要的效果 點我檢視demo。流程元件...

easyui datagrid 自適應視窗邊寬度

1.底部如果沒有分頁工具欄 即datagrid屬性pagination為false 這種情況可以直接設定datagrid屬性fit為true 即可。2.底部如果有分頁工具欄時 即datagrid屬性pagination為true 這時需要監聽window物件 即瀏覽器視窗 大小的改變,動態的改變da...