parent
e77ddf4e7a
commit
273cefc5c7
|
|
@ -885,9 +885,9 @@ type TVclDesigner = class(tvcform)
|
|||
end
|
||||
mx := 0;
|
||||
for i,v in clc do mx := max(mx,v);
|
||||
height := (integer(mx*32/twidth)+1)*32+60+30+24;
|
||||
height := (integer(mx*32/twidth)+1)*32+60+30+24+5;
|
||||
end else
|
||||
height := 90+32+24;
|
||||
height := 90+32+24+5;
|
||||
end
|
||||
|
||||
function TreeNode2tfmsub(lib,node,itemnames);//tmf文件字符串
|
||||
|
|
|
|||
|
|
@ -1205,7 +1205,7 @@ type TWinControl = class(tcontrol)
|
|||
if DC=0 then exit;
|
||||
try
|
||||
c := ClientRect;
|
||||
memdc := dc;
|
||||
memdc := dc;
|
||||
{$ifdef gdipaint}
|
||||
mdc := _wapi.GetDC(0);
|
||||
if not mdc then exit;
|
||||
|
|
@ -1214,6 +1214,12 @@ type TWinControl = class(tcontrol)
|
|||
memdc := _wapi.CreateCompatibleDC(0);
|
||||
if not memdc then exit;
|
||||
oldmp := _wapi.SelectObject(memdc,mbit);
|
||||
|
||||
{$else}
|
||||
cr := ClientRect;
|
||||
//rc := ps._getvalue_("rcpaint");
|
||||
img := _wapi.cairo_image_surface_create(1,cr[2]-cr[0]+100,cr[3]-cr[1]+100);
|
||||
memdc := _wapi.cairo_create(img);
|
||||
{$endif}
|
||||
e.wparam := memdc;
|
||||
if Color then
|
||||
|
|
@ -1225,6 +1231,15 @@ type TWinControl = class(tcontrol)
|
|||
rc := ps.rcpaint;
|
||||
{$ifdef gdipaint}
|
||||
_wapi.BitBlt(dc,rc[0],rc[1],rc[2]-rc[0],rc[3]-rc[1],memdc,rc[0],rc[1],SRCCOPY); //_wapi.BitBlt(dc,c[0],c[1],c[2],c[3],memdc,0,0,SRCCOPY);
|
||||
{$else}
|
||||
_wapi.cairo_set_source_surface(dc, img, 0, 0);
|
||||
rc := ps.rcpaint;
|
||||
_wapi.cairo_rectangle(dc,rc[0],rc[1],rc[2]-rc[0],rc[3]-rc[1]);
|
||||
_wapi.cairo_clip(dc);
|
||||
_wapi.cairo_paint(dc);
|
||||
_wapi.cairo_surface_destroy(img);
|
||||
_wapi.cairo_destroy(memdc);
|
||||
|
||||
{$endif}
|
||||
finally
|
||||
_wapi.EndPaint(hd,ps._getptr_);
|
||||
|
|
@ -1233,6 +1248,9 @@ type TWinControl = class(tcontrol)
|
|||
_wapi.SelectObject(memdc,oldmp);
|
||||
_wapi.DeleteDC(memdc);
|
||||
_wapi.DeleteObject(mbit);
|
||||
|
||||
{$else}
|
||||
|
||||
{$endif}
|
||||
end
|
||||
end else
|
||||
|
|
|
|||
|
|
@ -93,11 +93,11 @@ type tsgtkapi = class(tgtkapis)
|
|||
y := g_object_get_data(hwd,"gtk_layout_y");
|
||||
w := g_object_get_data(hwd,"gtk_layout_width");
|
||||
h := g_object_get_data(hwd,"gtk_layout_height");
|
||||
//global g_w_c_width;
|
||||
//pcd := gtk_object_get_data(h,"gtk_decorated")?g_w_c_width:0;
|
||||
global g_w_c_width;
|
||||
pcd := gtk_object_get_data(hwd,"gtk_wnd_hs_caption")?g_w_c_width:0;
|
||||
gtk_window_move(hwd,x,y-pcd);
|
||||
if w>=0 and h>=0 then
|
||||
gtk_widget_set_size_request(hwd,w,h);
|
||||
gtk_widget_set_size_request(hwd,w,h-pcd);
|
||||
end
|
||||
if f=0x4 then
|
||||
begin
|
||||
|
|
@ -228,7 +228,9 @@ type tsgtkapi = class(tgtkapis)
|
|||
if h then
|
||||
begin
|
||||
x0 := g_object_get_data(h,"gtk_layout_width");
|
||||
y0 := g_object_get_data(h,"gtk_layout_height");
|
||||
global g_w_c_width;
|
||||
pcd := gtk_object_get_data(h,"gtk_wnd_hs_caption")?g_w_c_width:0;
|
||||
y0 := g_object_get_data(h,"gtk_layout_height")-pcd;
|
||||
end
|
||||
rec := array(0,0,x0, y0);
|
||||
return true;
|
||||
|
|
@ -239,7 +241,9 @@ type tsgtkapi = class(tgtkapis)
|
|||
ClientToScreen(hwnd,xy);
|
||||
h := g_object_get_data(hwnd,"gtk_layout_height");
|
||||
w := g_object_get_data(hwnd,"gtk_layout_width");
|
||||
rec := array(xy[0],xy[1],xy[0]+w,xy[1]+h);
|
||||
global g_w_c_width;
|
||||
pcd := gtk_object_get_data(hwnd,"gtk_wnd_hs_caption")?g_w_c_width:0;
|
||||
rec := array(xy[0],xy[1],xy[0]+w,xy[1]+h-pcd);
|
||||
end
|
||||
function GetWindowInfo(hwnd :pointer;f:pointer):integer;
|
||||
begin
|
||||
|
|
@ -259,9 +263,9 @@ type tsgtkapi = class(tgtkapis)
|
|||
if not(h>0 or h<0) then return ;
|
||||
flg := 0;
|
||||
wt := static gtk_window_get_type();
|
||||
pcd := gtk_object_get_data(h,"gtk_wnd_hs_caption")?g_w_c_width:0;
|
||||
if g_type_check_instance_is_a(h,wt) then //主窗口
|
||||
begin
|
||||
pcd := gtk_object_get_data(h,"gtk_decorated")?g_w_c_width:0;
|
||||
begin
|
||||
x0 := g_object_get_data(h,"gtk_layout_x");
|
||||
y0 := g_object_get_data(h,"gtk_layout_y");
|
||||
if (x>=0 and y>=0) and (x<>x0 or y<>y0) then //窗口位置
|
||||
|
|
@ -280,16 +284,16 @@ type tsgtkapi = class(tgtkapis)
|
|||
gtk_widget_get_size_request(h,cx0,cy0); //改小一点
|
||||
if cx0>cx or cy0>cy then
|
||||
begin
|
||||
gtk_widget_set_size_request(h,cx,cy);
|
||||
gtk_widget_set_size_request(h,cx,cy-pcd);
|
||||
end
|
||||
gtk_window_resize(h,cx,cy);
|
||||
gtk_window_resize(h,cx,cy-pcd);
|
||||
end
|
||||
else
|
||||
begin
|
||||
//gtk_widget_get_size_request(h,cx0,cy0);
|
||||
//echo "\r\noldsize:",cx0,"====",cy0;
|
||||
//gtk_window_resize(wh,cx,cy);
|
||||
gtk_widget_set_size_request(h,cx,cy);
|
||||
gtk_widget_set_size_request(h,cx,cy-pcd);
|
||||
//gtk_window_set_decorated(h,true);
|
||||
//gtk_window_set_resizable(h,true);
|
||||
|
||||
|
|
@ -326,7 +330,7 @@ type tsgtkapi = class(tgtkapis)
|
|||
h0 := g_object_get_data(h,"gtk_layout_height");
|
||||
if (cx>=0 and cy>=0) and ( cx<>w0 or cy<>h0) then
|
||||
begin
|
||||
gtk_widget_set_size_request(h,cx,cy);
|
||||
gtk_widget_set_size_request(h,cx,cy-pcd);
|
||||
g_object_set_data(h,"gtk_layout_width",cx);
|
||||
g_object_set_data(h,"gtk_layout_height",cy);
|
||||
//lbl := g_object_get_data(h,"gtk_layout_lable");
|
||||
|
|
@ -497,7 +501,9 @@ type tsgtkapi = class(tgtkapis)
|
|||
end
|
||||
if SizeChanged then //这个是不是应该放前面
|
||||
begin
|
||||
gtk_widgetsizechanged(h,AHeight,AWidth);
|
||||
global g_w_c_width;
|
||||
pcd := gtk_object_get_data(h,"gtk_wnd_hs_caption")?g_w_c_width:0;
|
||||
gtk_widgetsizechanged(h,AHeight-pcd,AWidth);
|
||||
end
|
||||
{if SizeChanged then
|
||||
begin
|
||||
|
|
@ -1239,8 +1245,10 @@ type tsgtkapi = class(tgtkapis)
|
|||
Function DrawMenuBar(hwd:pointer):integer; //处理菜单栏
|
||||
begin
|
||||
h :=g_object_get_data(hwd,"gtk_layout_height");
|
||||
w :=g_object_get_data(hwd,"gtk_layout_width");
|
||||
gtk_widgetsizechanged(hwd,h,w);
|
||||
w :=g_object_get_data(hwd,"gtk_layout_width");
|
||||
global g_w_c_width;
|
||||
pcd := gtk_object_get_data(hwnd,"gtk_wnd_hs_caption")?g_w_c_width:0;
|
||||
gtk_widgetsizechanged(hwd,h-pcd,w);
|
||||
end
|
||||
Function SetMenu(hwd:pointer;hmenu:pointer):integer; //设置菜单栏
|
||||
begin
|
||||
|
|
@ -1276,8 +1284,10 @@ type tsgtkapi = class(tgtkapis)
|
|||
g_object_set_data(hwd,"menubar",0);
|
||||
end
|
||||
h :=g_object_get_data(hwd,"gtk_layout_height");
|
||||
w :=g_object_get_data(hwd,"gtk_layout_width");
|
||||
gtk_widgetsizechanged(hwd,h,w);
|
||||
w :=g_object_get_data(hwd,"gtk_layout_width");
|
||||
global g_w_c_width;
|
||||
pcd := gtk_object_get_data(hwnd,"gtk_wnd_hs_caption")?g_w_c_width:0;
|
||||
gtk_widgetsizechanged(hwd,h-pcd,w);
|
||||
//移除原有窗口
|
||||
//menubar 添加到窗口
|
||||
end
|
||||
|
|
@ -1778,7 +1788,9 @@ type tsgtkapi = class(tgtkapis)
|
|||
begin
|
||||
w :=g_object_get_data(hwnd,"gtk_layout_width");
|
||||
h := g_object_get_data(hwnd,"gtk_layout_height");
|
||||
gtk_widgetsizechanged(hwnd,h,w);
|
||||
global g_w_c_width;
|
||||
pcd := gtk_object_get_data(hwnd,"gtk_wnd_hs_caption")?g_w_c_width:0;
|
||||
gtk_widgetsizechanged(hwnd,h-pcd,w);
|
||||
return true;
|
||||
end
|
||||
function ClipCursor(rec:array of integer):integer;
|
||||
|
|
@ -4647,7 +4659,7 @@ type tgtk_ctl_object = class(_gtkeventtype)
|
|||
end
|
||||
else
|
||||
begin
|
||||
if _wapi.gtk_object_get_data(FHandle,"gtk_decorated") then return ;
|
||||
if _wapi.gtk_object_get_data(FHandle,"gtk_wnd_hs_caption") then return ;
|
||||
rsz := _wapi.gtk_object_get_data(FHandle,"gtk_widget_resizeable");
|
||||
if rsz then
|
||||
begin
|
||||
|
|
@ -6393,12 +6405,13 @@ type tgtk_ctl_window_PoPup = class(tgtk_ctl_scroll_window)
|
|||
begin
|
||||
Exit;
|
||||
end
|
||||
if (cx <> AWidth) then _wapi.g_object_set_data(h,"gtk_layout_width",AWidth);
|
||||
if (cx <> AWidth) then _wapi.g_object_set_data(h,"gtk_layout_width",AWidth);
|
||||
global g_w_c_width;
|
||||
pcd := _wapi.gtk_object_get_data(h,"gtk_wnd_hs_caption")?g_w_c_width:0;
|
||||
if cy <> AHeight then
|
||||
begin
|
||||
//global g_w_c_width;
|
||||
//pcd := _wapi.gtk_object_get_data(h,"gtk_decorated")?g_w_c_width:0;
|
||||
_wapi.g_object_set_data(h,"gtk_layout_height",AHeight);
|
||||
|
||||
_wapi.g_object_set_data(h,"gtk_layout_height",AHeight+pcd);
|
||||
end
|
||||
if x <> ALeft then
|
||||
begin
|
||||
|
|
@ -6408,7 +6421,7 @@ type tgtk_ctl_window_PoPup = class(tgtk_ctl_scroll_window)
|
|||
begin
|
||||
_wapi.g_object_set_data(h,"gtk_layout_y",atop);
|
||||
end
|
||||
r := _wapi.Gtk_TrigMoveSizeEvent(h,const aleft,const atop,const AWidth,const AHeight,(SizeChanged?1:0).|(PosChanged?2:0));
|
||||
r := _wapi.Gtk_TrigMoveSizeEvent(h,const aleft,const atop,const AWidth,const AHeight+pcd,(SizeChanged?1:0).|(PosChanged?2:0));
|
||||
return r;
|
||||
end
|
||||
"delete-event":
|
||||
|
|
@ -6433,12 +6446,12 @@ type tgtk_ctl_window_PoPup = class(tgtk_ctl_scroll_window)
|
|||
//echo "\r\nctl===popup:",tostn(params),tostn(__stack_frame),datetimetostr(now()),">>>>";
|
||||
h := _wapi.gtk_window_new(0); //控件层
|
||||
srszie := (_const.WS_SIZEBOX .& dwStyle)=_const.WS_SIZEBOX;
|
||||
_wapi.gtk_object_set_data(h,"gtk_decorated",1);
|
||||
_wapi.gtk_object_set_data(h,"gtk_wnd_hs_caption",1);
|
||||
if not((_const.WS_CAPTION .& dwStyle)= _const.WS_CAPTION or (_const.WS_SYSMENU .& dwStyle)=_const.WS_SYSMENU) then
|
||||
begin
|
||||
|
||||
_wapi.gtk_window_set_decorated(h,false);
|
||||
_wapi.gtk_object_set_data(h,"gtk_decorated",0);
|
||||
_wapi.gtk_object_set_data(h,"gtk_wnd_hs_caption",0);
|
||||
//无菜单顶层窗口
|
||||
end else
|
||||
begin
|
||||
|
|
@ -6474,7 +6487,9 @@ type tgtk_ctl_window_PoPup = class(tgtk_ctl_scroll_window)
|
|||
_wapi.gtk_layout_put(ctllayout,evtdrawbox,0,0);
|
||||
clientLayout := _Wapi.gtk_layout_new(0,0);
|
||||
_wapi.gtk_container_add(evtdrawbox,clientLayout);
|
||||
_wapi.gtk_widget_set_size_request(evtdrawbox,nwidth,nheight);
|
||||
global g_w_c_width;
|
||||
pcd := _wapi.gtk_object_get_data(h,"gtk_wnd_hs_caption")?g_w_c_width:0;
|
||||
_wapi.gtk_widget_set_size_request(evtdrawbox,nwidth,max(0,nheight-pcd));
|
||||
//_wapi.gtk_widget_set_size_request(evtdrawbox,2000,2000);
|
||||
//_wapi.gtk_widget_set_events(eb,16777214);
|
||||
_wapi.g_object_set_data(evtdrawbox,"gtk_client_parent",h);
|
||||
|
|
@ -6482,13 +6497,13 @@ type tgtk_ctl_window_PoPup = class(tgtk_ctl_scroll_window)
|
|||
//_wapi.gtk_widget_set_can_focus(eb,true);
|
||||
_wapi.g_object_set_data(h,"gtk_layout",clientLayout);
|
||||
_wapi.g_object_set_data(clientLayout,"gtk_layout_owner",h);
|
||||
global g_w_c_width;
|
||||
|
||||
InitWidgetSize(h,x,y,nwidth,nheight);
|
||||
pcd := _wapi.gtk_object_get_data(h,"gtk_decorated")?g_w_c_width:0;
|
||||
|
||||
_wapi.gtk_window_move(h,x,y-pcd);
|
||||
if nwidth>0 and nheight>0 then
|
||||
begin
|
||||
_wapi.gtk_window_resize(h,nwidth,nheight);
|
||||
_wapi.gtk_window_resize(h,nwidth,nheight-pcd);
|
||||
end
|
||||
_wapi.gtk_widget_show_all(vbox);
|
||||
InitContainerList(h); //容器list
|
||||
|
|
|
|||
Loading…
Reference in New Issue