设计器

修正初始位置问题
This commit is contained in:
JianjunLiu 2022-12-05 15:54:17 +08:00
parent dc16fb9d4e
commit 0bf9fdc972
2 changed files with 24 additions and 27 deletions

View File

@ -831,6 +831,9 @@ type TVclDesigner = class(tvcform)
FCurrentClikPos := o.ScreenToClient(xy[0],xy[1]);
//FCurrentClikPos := array(e.lolparam,e.hilparam);//o1.screentoclient(e.lolparam,e.hilparam);
r := CreateComponent();
o1 := r.Cwnd;
o1.setpublish("left",o1.left,nil);
o1.setpublish("top",o1.top,nil);
end
return ;
end

View File

@ -2185,8 +2185,7 @@ type tsgtkapi = class(tgtkapis)
c := gtk_clipboard_get(69);
r := gtk_clipboard_wait_for_text(c);
if r then r := GtkStringToTsl(r);
//echo "\r\ncop wire:",writefile(rwraw(),"","/tmp/test12.txt",0,length(r),r);
//echo "\r\ncop wire:",writefile(rwraw(),"","/tmp/test12.txt",0,length(r),r);
return r;
end
function setclipboardtext(clbd,s);
@ -2211,34 +2210,29 @@ type tsgtkapi = class(tgtkapis)
//////////////////////////////////////end clip board //////////////////////////////////
//////////////////////////////timmer//////////////////
class function SetTimer(hWnd:pointer; nIDEvent:pointer; uElapse:integer;lpTimerFunc:pointer):integer;
begin
global g_gtk_ttimer_cache;
if not ifarray(g_gtk_ttimer_cache) then g_gtk_ttimer_cache := array();
obj := new ttmstruct(nil);//tslcstructure(sc); sc := array((0,"int",0),(1,"int",0));
rt := g_timeout_add(uElapse,lpTimerFunc,obj._getptr_() );
g_gtk_ttimer_cache[rt] := obj;
obj._setvalue_(0,rt);
return rt;
end
class function KillTimer(hWnd:pointer; nIDEvent:pointer):integer;
class function SetTimer(hWnd:pointer; nIDEvent:pointer; uElapse:integer;lpTimerFunc:pointer):integer;
begin
global g_gtk_ttimer_cache;
if not ifarray(g_gtk_ttimer_cache) then return 0;
obj := g_gtk_ttimer_cache[nIDEvent] ;
g_source_remove(obj._getvalue_(0));
reindex(g_gtk_ttimer_cache,array(nIDEvent:nil));
return true;
global g_gtk_ttimer_cache;
if not ifarray(g_gtk_ttimer_cache) then g_gtk_ttimer_cache := array();
obj := new ttmstruct(nil);//tslcstructure(sc); sc := array((0,"int",0),(1,"int",0));
rt := g_timeout_add(uElapse,lpTimerFunc,obj._getptr_() );
g_gtk_ttimer_cache[rt] := obj;
obj._setvalue_(0,rt);
return rt;
end
////////////////////////////////////////////////////////////////////
function GetOpenFileNameA(LPOPENFILENAMEA:pointer):integer;
class function KillTimer(hWnd:pointer; nIDEvent:pointer):integer;
begin
r := GetSaveFileNameA(LPOPENFILENAMEA);
global g_gtk_ttimer_cache;
if not ifarray(g_gtk_ttimer_cache) then return 0;
obj := g_gtk_ttimer_cache[nIDEvent] ;
g_source_remove(obj._getvalue_(0));
reindex(g_gtk_ttimer_cache,array(nIDEvent:nil));
return true;
end
////////////////////////////////////////////////////////////////////
function GetOpenFileNameA(LPOPENFILENAMEA:pointer):integer;
begin
r := GetSaveFileNameA(LPOPENFILENAMEA);
return r;
end
function GetSaveFileNameA(LPOPENFILENAMEA:pointer):integer;