升级设计器
This commit is contained in:
@@ -679,7 +679,9 @@ type TWinControl = class(tcontrol)
|
||||
if it then
|
||||
begin
|
||||
ev := new TMMouse(e.msg,e.wparam,e.lparam);
|
||||
return it.Perform(ev);
|
||||
r := it.Perform(ev);
|
||||
e.Result := ev.Result;
|
||||
e.skip := ev.skip;
|
||||
end
|
||||
return inherited;
|
||||
end
|
||||
|
||||
@@ -1540,6 +1540,7 @@ type tsgtkapi = class(tgtkapis)
|
||||
if not hwnd then return ;
|
||||
if not IsGtkWidget(hwnd) then return ;
|
||||
p1 := g_object_get_data(hwnd,"motion_xy");
|
||||
if not ifarray(p1) then p1 := g_object_get_data(1000,"motion_xy");
|
||||
if ifarray(p1) then
|
||||
begin
|
||||
dx := p1["x_r"]-p1["x"];
|
||||
@@ -2948,8 +2949,8 @@ type tsgtkapi = class(tgtkapis)
|
||||
begin
|
||||
global g_Caret_Blink_Time,g_caret_object;
|
||||
if not(hwnd>0 or hwnd<0) then return 0;
|
||||
if gtk_widget_is_toplevel(hwnd) then pw := hwnd;
|
||||
else pw := gtk_widget_get_toplevel(hwnd);
|
||||
//if gtk_widget_is_toplevel(hwnd) then pw := hwnd;
|
||||
//else pw := gtk_widget_get_toplevel(hwnd);
|
||||
if not g_gtk_caret_cache_timer then
|
||||
begin
|
||||
Fscrolltimedo := makeinstance(thisfunction(docarettime));
|
||||
@@ -2974,7 +2975,7 @@ type tsgtkapi = class(tgtkapis)
|
||||
gtk_widget_set_size_request(h,nWidth,nHeight);
|
||||
gtk_window_resize(h,nWidth,nHeight);
|
||||
end
|
||||
gtk_window_set_transient_for(h,pw);
|
||||
//gtk_window_set_transient_for(h,pw);
|
||||
return h;
|
||||
end
|
||||
function DestroyCaret():integer;
|
||||
@@ -3002,7 +3003,13 @@ type tsgtkapi = class(tgtkapis)
|
||||
gtk_object_set_data(hwnd,"caret_x_pos",x);
|
||||
gtk_object_set_data(hwnd,"caret_y_pos",y);
|
||||
p := array(x,y);
|
||||
ClientToScreen(hwnd,p);
|
||||
ClientToScreen(hwnd,p);
|
||||
if gtk_widget_is_toplevel(hwnd) then pw := hwnd;
|
||||
else pw := gtk_widget_get_toplevel(hwnd);
|
||||
if GTK_IS_WINDOW(pw) then
|
||||
begin
|
||||
gtk_window_set_transient_for(crt,pw);
|
||||
end
|
||||
gtk_window_move(crt,p[0],p[1]);
|
||||
end
|
||||
if xy[0]<>x then
|
||||
@@ -4153,6 +4160,11 @@ type tgtkapis = class() //gtk
|
||||
return ##_f_(s);
|
||||
end
|
||||
//////////////gdk window ///////
|
||||
procedure gdk_window_get_geometry(w,x,y,sz1,sz2);
|
||||
begin
|
||||
_f_ := static procedure(w:pointer;var x :integer;var y:integer;var sz1:integer;var sz2:integer);cdecl;external getfuncptrbyname(0,functionname());
|
||||
return ##_f_(w,x,y,sz1,sz2);
|
||||
end
|
||||
procedure gdk_window_show_unraised(w:pointer);
|
||||
begin
|
||||
_f_ := static procedure(w:pointer);cdecl;external getfuncptrbyname(0,functionname());
|
||||
@@ -6031,6 +6043,11 @@ type tgtkapis = class() //gtk
|
||||
_f_ := static procedure(w:pointer;c:pointer);cdecl;external getfuncptrbyname(0,functionname());
|
||||
return ##_f_(w,c);
|
||||
end
|
||||
function gtk_widget_get_root_window(g:pointer):pointer;
|
||||
begin
|
||||
_f_ := static function(g:pointer):pointer;cdecl;external getfuncptrbyname(0,functionname());
|
||||
return ##_f_(g);
|
||||
end
|
||||
function gtk_widget_get_window(g:pointer):pointer;
|
||||
begin
|
||||
_f_ := static function(g:pointer):pointer;cdecl;external getfuncptrbyname(0,functionname());
|
||||
@@ -8059,6 +8076,12 @@ type tgtk_ctl_object = class(_gtkeventtype)
|
||||
end
|
||||
GS_BUTTON_PRESS_EVENT:
|
||||
begin
|
||||
id := a.handle;
|
||||
if not _wapi.g_object_get_data(id,"motion_xy") then
|
||||
begin
|
||||
e := new _GdkEventButton(c);
|
||||
_wapi.g_object_set_data(id,"motion_xy",array("x":e.x,"y":e.y,"x_r":e.x_root,"y_r":e.y_root));
|
||||
end
|
||||
return GSBUTTONPRESSEVENT(a,b,c,d);
|
||||
end
|
||||
GS_MOTION_NOTIFY_EVENT:
|
||||
|
||||
Reference in New Issue
Block a user