界面库

优化
This commit is contained in:
JianjunLiu 2022-08-17 17:50:07 +08:00
parent 0e03a05db9
commit da2fb85883
5 changed files with 23 additions and 6 deletions

View File

@ -4122,7 +4122,7 @@ type TEditList=class(TComboBox)
begin begin
inherited; inherited;
width := 280; width := 280;
maxListItemShow := 30; dropdowncount := 30;
FMaxCoder := 20; FMaxCoder := 20;
ReadONly := false; ReadONly := false;
Editer.OnKeyDown := function(o,e) Editer.OnKeyDown := function(o,e)

View File

@ -114,6 +114,10 @@ type tgraphiccontrol = class(TControl)
end end
function WMERASEBKGND(o,e):WM_ERASEBKGND;override; function WMERASEBKGND(o,e):WM_ERASEBKGND;override;
begin begin
if ftransparent then
begin
return 1;
end
if e.wparam and e.lparam then if e.wparam and e.lparam then
begin begin
if(BKBitmap is class(tcustombitmap))and BKBitmap.HandleAllocated()then if(BKBitmap is class(tcustombitmap))and BKBitmap.HandleAllocated()then
@ -153,6 +157,7 @@ type tgraphiccontrol = class(TControl)
FTop := 10; FTop := 10;
FWidth := 80; FWidth := 80;
FHeight := 25; FHeight := 25;
ftransparent := false;
includestate(FControlState,csCustomPaint); includestate(FControlState,csCustomPaint);
end end
function Recycling();override; function Recycling();override;
@ -171,7 +176,18 @@ type tgraphiccontrol = class(TControl)
end end
end end
property OnPaint:eventhandler read FOnPaint write FOnPaint; property OnPaint:eventhandler read FOnPaint write FOnPaint;
property transparent:bool read ftransparent write settransparent;
{** {**
@param(OnPaint)(function[TGraphicControl]:bool) 绘制回调,返回true不执行默认绘制 %% @param(OnPaint)(function[TGraphicControl]:bool) 绘制回调,返回true不执行默认绘制 %%
**} **}
private
ftransparent;
function settransparent(v);
begin
nv := v?true:false;
if nv<>ftransparent then
begin
ftransparent := nv;
end
end
end; end;

View File

@ -707,7 +707,7 @@ type TLabel = class(TGraphicControl)
begin begin
return array("name","action","align","anchors","caption","enabled","font", return array("name","action","align","anchors","caption","enabled","font",
"popupmenu","visible", "popupmenu","visible",
"height","width","left","top","color","bkbitmap","parentcolor","parentfont", "height","width","left","top","color","bkbitmap","parentcolor","parentfont","transparent",
"onpopupmenu","onmousedown","onmouseup"); "onpopupmenu","onmousedown","onmouseup");
end end
{** {**
@ -2424,7 +2424,7 @@ type TComboBox = class(TcustomComboBox)
"visible","anchors","align","enabled","parentcolor","parentfont", "visible","anchors","align","enabled","parentcolor","parentfont",
"height","width","left","top", "height","width","left","top",
"readonly","itemindex", "readonly","itemindex",
"items","oncloseup","ondropdown","onselchanged","oneditchanged"); "items","dropdowncount","oncloseup","ondropdown","onselchanged","oneditchanged");
end end
end end

View File

@ -3689,9 +3689,10 @@ type TCustomComboBoxbase=class(TCustomControl)
property ondropdown:eventhandler read Fondropdown write Fondropdown; property ondropdown:eventhandler read Fondropdown write Fondropdown;
property oncloseup:eventhandler read Foncloseup write Foncloseup; property oncloseup:eventhandler read Foncloseup write Foncloseup;
property BtnWidth read FBtnWidth write SetBtnWidth; property BtnWidth read FBtnWidth write SetBtnWidth;
property maxListItemShow read FmaxListItemShow write SetmaxListItemShow; property dropdowncount:integer read FmaxListItemShow write SetmaxListItemShow;
{** {**
@param(ItemIndex)(integer)设置当前项序号%% @param(ItemIndex)(integer)设置当前项序号%%
@param(dropdowncount)(integer)下拉列表项数%%
@param(ondropdown)(function[tcomboBox,tuieventbase])下拉框展开回调%% @param(ondropdown)(function[tcomboBox,tuieventbase])下拉框展开回调%%
@param(oncloseup)(function[tcomboBox,tuieventbase])下拉框关闭回调%% @param(oncloseup)(function[tcomboBox,tuieventbase])下拉框关闭回调%%
@param(onselchanged)(function[tcomboBox,tuieventbase])当前选项改变回调%% @param(onselchanged)(function[tcomboBox,tuieventbase])当前选项改变回调%%