parent
2033014a9b
commit
0833d3a150
|
|
@ -1,6 +1,6 @@
|
||||||
object ed_script:t_compile_config
|
object ed_script:t_compile_config
|
||||||
caption="编译选项设置"
|
caption="编译选项设置"
|
||||||
height=631
|
height=634
|
||||||
left=618
|
left=618
|
||||||
minmaxbox=false
|
minmaxbox=false
|
||||||
onclose=compile_config_close
|
onclose=compile_config_close
|
||||||
|
|
@ -282,6 +282,7 @@ object ed_script:t_compile_config
|
||||||
end
|
end
|
||||||
object ck_s_rp:tcheckbtn
|
object ck_s_rp:tcheckbtn
|
||||||
caption="资源文件保留相对路径"
|
caption="资源文件保留相对路径"
|
||||||
|
enabled=false
|
||||||
height=25
|
height=25
|
||||||
left=253
|
left=253
|
||||||
top=25
|
top=25
|
||||||
|
|
|
||||||
|
|
@ -305,6 +305,11 @@ type t_compile_config=class(tdcreateform)
|
||||||
begin
|
begin
|
||||||
r+= (ph?relative_path(v):v)+",";
|
r+= (ph?relative_path(v):v)+",";
|
||||||
end
|
end
|
||||||
|
lr := length(r);
|
||||||
|
if lr>2 and r[lr]="," and (r[lr-1]<>"\\") then
|
||||||
|
begin
|
||||||
|
r := r[1:(lr-1)];
|
||||||
|
end
|
||||||
return r;
|
return r;
|
||||||
end
|
end
|
||||||
function relative_path(d);
|
function relative_path(d);
|
||||||
|
|
|
||||||
|
|
@ -335,21 +335,21 @@ type tsgtkapi = class(tgtkapis)
|
||||||
gtk_widget_set_size_request(h,cx,max(0,cy-pcd));
|
gtk_widget_set_size_request(h,cx,max(0,cy-pcd));
|
||||||
g_object_set_data(h,"gtk_layout_width",cx);
|
g_object_set_data(h,"gtk_layout_width",cx);
|
||||||
g_object_set_data(h,"gtk_layout_height",cy);
|
g_object_set_data(h,"gtk_layout_height",cy);
|
||||||
//lbl := g_object_get_data(h,"gtk_layout_lable");
|
|
||||||
//if lbl then gtk_widget_set_size_request(lbl,cx-5,cy-5);
|
|
||||||
flg .|=1;
|
flg .|=1;
|
||||||
end
|
end
|
||||||
if flg then
|
if flg then
|
||||||
begin
|
begin
|
||||||
Gtk_TrigMoveSizeEvent(h,x,y,cx,cy,flg);
|
Gtk_TrigMoveSizeEvent(h,x,y,cx,cy,flg);
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function IsGtkWidget(h);
|
function IsGtkWidget(h);
|
||||||
begin
|
begin
|
||||||
wt := static gtk_widget_get_type();
|
if h>0 or h<0 then
|
||||||
return g_type_check_instance_is_a(h,wt);
|
begin
|
||||||
|
wt := static gtk_widget_get_type();
|
||||||
|
return g_type_check_instance_is_a(h,wt);
|
||||||
|
end
|
||||||
end
|
end
|
||||||
function gtk_window_showmodal(w); //shomodal
|
function gtk_window_showmodal(w); //shomodal
|
||||||
begin
|
begin
|
||||||
|
|
@ -551,10 +551,8 @@ type tsgtkapi = class(tgtkapis)
|
||||||
gtk_main_quit();
|
gtk_main_quit();
|
||||||
return c;
|
return c;
|
||||||
end
|
end
|
||||||
/////////////////////////////////////////
|
/////////////////////////////////////////
|
||||||
|
/////////////////////////////////////////
|
||||||
/////////////////////////////////////////
|
|
||||||
|
|
||||||
Function LoadCursorA2(hd:pointer;n:pointer)
|
Function LoadCursorA2(hd:pointer;n:pointer)
|
||||||
begin
|
begin
|
||||||
rn := array(0x7F01:152,0x7F8A:126,0x7F89:24,0x7F88:0,0x7F87:0,
|
rn := array(0x7F01:152,0x7F8A:126,0x7F89:24,0x7F88:0,0x7F87:0,
|
||||||
|
|
@ -580,7 +578,6 @@ type tsgtkapi = class(tgtkapis)
|
||||||
///////////////////////空接口
|
///////////////////////空接口
|
||||||
|
|
||||||
function GetModuleHandleA(name:pointer)begin return 1; end;
|
function GetModuleHandleA(name:pointer)begin return 1; end;
|
||||||
|
|
||||||
function SetClassLongPtrA(HH:pointer;idx:integer;dwNewLong:pointer)begin end;
|
function SetClassLongPtrA(HH:pointer;idx:integer;dwNewLong:pointer)begin end;
|
||||||
function GetClassLongPtrA(HH:pointer;idx:integer)begin end;
|
function GetClassLongPtrA(HH:pointer;idx:integer)begin end;
|
||||||
////////////////////////////////////////
|
////////////////////////////////////////
|
||||||
|
|
@ -589,14 +586,6 @@ type tsgtkapi = class(tgtkapis)
|
||||||
//默认处理程序
|
//默认处理程序
|
||||||
//echo "call defalt handler\r\n";
|
//echo "call defalt handler\r\n";
|
||||||
end
|
end
|
||||||
function GetKeyState(key);
|
|
||||||
begin
|
|
||||||
return gtk_GetKeyState(key);
|
|
||||||
end
|
|
||||||
function GetAsyncKeyState(key);
|
|
||||||
begin
|
|
||||||
return gtk_GetAsyncKeyState(key);
|
|
||||||
end
|
|
||||||
function GetSysColor(idx:integer):integer;
|
function GetSysColor(idx:integer):integer;
|
||||||
begin
|
begin
|
||||||
if idx = 0x5 then
|
if idx = 0x5 then
|
||||||
|
|
@ -713,25 +702,13 @@ type tsgtkapi = class(tgtkapis)
|
||||||
h := g_object_get_data(hwnd,"gtk_clientwideget");
|
h := g_object_get_data(hwnd,"gtk_clientwideget");
|
||||||
if h then
|
if h then
|
||||||
begin
|
begin
|
||||||
return gtk_widget_queue_draw(h);
|
|
||||||
if ifarray(rec) and ifnumber(rec[0]) and ifnumber(rec[1]) and ifnumber(rec[2]) and ifnumber(rec[3]) then
|
if ifarray(rec) and ifnumber(rec[0]) and ifnumber(rec[1]) and ifnumber(rec[2]) and ifnumber(rec[3]) then
|
||||||
begin
|
begin
|
||||||
gtk_widget_queue_draw_area(h,rec[0],rec[1],rec[2]-rec[0],rec[3]-rec[1]);
|
gtk_widget_queue_draw_area(h,rec[0],rec[1],rec[2]-rec[0],rec[3]-rec[1]);
|
||||||
{echo "\r\nvalidate rect:",hwnd,"====",h,tostn(array(rec[0],rec[1],rec[2]-rec[0],rec[3]-rec[1]));
|
|
||||||
|
|
||||||
r := zeros(4);
|
|
||||||
hd := gtk_widget_get_window(h);
|
|
||||||
if hd then
|
|
||||||
begin
|
|
||||||
cr := gdk_cairo_create(hd);
|
|
||||||
echo "rueturna:",gdk_cairo_get_clip_rectangle(cr,r);
|
|
||||||
echo "\r\ngetset:",tostn(r);
|
|
||||||
end }
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
gtk_widget_queue_draw(h);
|
gtk_widget_queue_draw(h);
|
||||||
//echo "\r\nvalidate nil:",hwnd,"====",h;
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -739,7 +716,6 @@ type tsgtkapi = class(tgtkapis)
|
||||||
begin
|
begin
|
||||||
InvalidateRect(hwnd,0,f);
|
InvalidateRect(hwnd,0,f);
|
||||||
end
|
end
|
||||||
|
|
||||||
//////////////////////////////gdi///////////////////////////////////////////
|
//////////////////////////////gdi///////////////////////////////////////////
|
||||||
function SelectObject(hdc :pointer;gdiobj:pointer);
|
function SelectObject(hdc :pointer;gdiobj:pointer);
|
||||||
begin
|
begin
|
||||||
|
|
@ -944,46 +920,6 @@ type tsgtkapi = class(tgtkapis)
|
||||||
cairo_stroke(hdc);
|
cairo_stroke(hdc);
|
||||||
end
|
end
|
||||||
return 1;
|
return 1;
|
||||||
while idx<=tlen do
|
|
||||||
begin
|
|
||||||
if udl then bxp := xp;
|
|
||||||
ci := GetChar(txt,idx);
|
|
||||||
{if ci=13 then // \n
|
|
||||||
begin
|
|
||||||
idx++;
|
|
||||||
yp+=ht;
|
|
||||||
continue;
|
|
||||||
end else // \r
|
|
||||||
if ci = 10 then
|
|
||||||
begin
|
|
||||||
idx++;
|
|
||||||
xp := x+xb;
|
|
||||||
continue;
|
|
||||||
end }
|
|
||||||
cairo_move_to(hdc,xp,yp);
|
|
||||||
if (ci .& 0x80) then
|
|
||||||
begin
|
|
||||||
if idx<tlen then
|
|
||||||
cairo_show_text(hdc,TslStringToGtk2( txt[idx:idx+1]));
|
|
||||||
idx++;
|
|
||||||
if not dkzt then xp+=wid;
|
|
||||||
end
|
|
||||||
else
|
|
||||||
begin
|
|
||||||
if ci>14 then
|
|
||||||
cairo_show_text(hdc,TslStringToGtk2( txt[idx]));
|
|
||||||
end
|
|
||||||
xp+=wid;
|
|
||||||
idx++;
|
|
||||||
if udl then
|
|
||||||
begin
|
|
||||||
cairo_move_to(hdc,bxp,yp);
|
|
||||||
cairo_line_to(hdc,xp,yp);
|
|
||||||
end
|
|
||||||
//cairo_move_to(hdc,xp,yp);
|
|
||||||
end
|
|
||||||
cairo_stroke(hdc);
|
|
||||||
return 1;
|
|
||||||
end
|
end
|
||||||
Function DrawTextA(hdc :pointer;txt:string;len:integer;rec:array of integer;fmt:integer):integer;
|
Function DrawTextA(hdc :pointer;txt:string;len:integer;rec:array of integer;fmt:integer):integer;
|
||||||
begin
|
begin
|
||||||
|
|
@ -1004,55 +940,55 @@ type tsgtkapi = class(tgtkapis)
|
||||||
wd := fto._getvalue_("width");
|
wd := fto._getvalue_("width");
|
||||||
ht := fto._getvalue_("height");
|
ht := fto._getvalue_("height");
|
||||||
end
|
end
|
||||||
//DT_LEFT := 0;
|
//DT_LEFT := 0;
|
||||||
DT_RIGHT := 0x2;
|
DT_RIGHT := 0x2;
|
||||||
//DT_TOP := 0;
|
//DT_TOP := 0;
|
||||||
DT_BOTTOM:= 0x8;
|
DT_BOTTOM:= 0x8;
|
||||||
DT_CENTER := 0x1;
|
DT_CENTER := 0x1;
|
||||||
DT_VCENTER:= 0x4;
|
DT_VCENTER:= 0x4;
|
||||||
//DT_SINGLELINE:= 0x20;
|
//DT_SINGLELINE:= 0x20;
|
||||||
//DT_TABSTOP:= 0x80;
|
//DT_TABSTOP:= 0x80;
|
||||||
rw := rec[2]-rec[0];
|
rw := rec[2]-rec[0];
|
||||||
nlen := min(len, min(integer(rw/wd),slen));
|
nlen := min(len, min(integer(rw/wd),slen));
|
||||||
sx := rec[0];
|
sx := rec[0];
|
||||||
rh := rec[3]-rec[1];
|
rh := rec[3]-rec[1];
|
||||||
sy := rec[1];
|
sy := rec[1];
|
||||||
if fmt=0 or not(fmt>0 or fmt<0 ) then
|
if fmt=0 or not(fmt>0 or fmt<0 ) then
|
||||||
begin
|
begin
|
||||||
|
|
||||||
end
|
end
|
||||||
if (fmt .& DT_CENTER)=DT_CENTER then //处理
|
if (fmt .& DT_CENTER)=DT_CENTER then //处理
|
||||||
begin
|
begin
|
||||||
if nlen = slen then
|
if nlen = slen then
|
||||||
begin
|
begin
|
||||||
sx +=(rw-(nlen*wd))/2;
|
sx +=(rw-(nlen*wd))/2;
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
if (fmt .& DT_VCENTER)=DT_VCENTER then //处理
|
if (fmt .& DT_VCENTER)=DT_VCENTER then //处理
|
||||||
begin
|
begin
|
||||||
if rh>ht then
|
if rh>ht then
|
||||||
begin
|
begin
|
||||||
sy+=(rh-ht)/2;
|
sy+=(rh-ht)/2;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if (fmt .& DT_RIGHT)=DT_RIGHT then //不处理
|
if (fmt .& DT_RIGHT)=DT_RIGHT then //不处理
|
||||||
begin
|
begin
|
||||||
if rw>(nlen*wd) then
|
if rw>(nlen*wd) then
|
||||||
begin
|
begin
|
||||||
sx := rec[2]-((nlen*wd));
|
sx := rec[2]-((nlen*wd));
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if (fmt .& DT_BOTTOM)=DT_BOTTOM then //不处理
|
if (fmt .& DT_BOTTOM)=DT_BOTTOM then //不处理
|
||||||
begin
|
begin
|
||||||
sy := rec[3]-3-ht;
|
sy := rec[3]-3-ht;
|
||||||
end
|
end
|
||||||
r := TextOutA(hdc,sx,sy,txt,nlen);
|
r := TextOutA(hdc,sx,sy,txt,nlen);
|
||||||
return r;
|
return r;
|
||||||
rr := gtk_object_get_data(hdc,"rgn");
|
rr := gtk_object_get_data(hdc,"rgn");
|
||||||
if rr then
|
if rr then
|
||||||
begin
|
begin
|
||||||
p := new TCRect(gdiobj);
|
p := new TCRect(rr);
|
||||||
rc := p._getdata_();
|
rc := p._getdata_();
|
||||||
cairo_reset_clip(hdc);
|
cairo_reset_clip(hdc);
|
||||||
cairo_rectangle(hdc,rc[0],rc[1],rc[2]-rc[0],rc[3]-rc[1]);
|
cairo_rectangle(hdc,rc[0],rc[1],rc[2]-rc[0],rc[3]-rc[1]);
|
||||||
|
|
@ -1128,7 +1064,6 @@ type tsgtkapi = class(tgtkapis)
|
||||||
end
|
end
|
||||||
function SelectClipRgn(hdc :pointer;gdiobj:pointer);
|
function SelectClipRgn(hdc :pointer;gdiobj:pointer);
|
||||||
begin
|
begin
|
||||||
|
|
||||||
r := SelectObject(hdc,gdiobj);
|
r := SelectObject(hdc,gdiobj);
|
||||||
if not(gdiobj) then
|
if not(gdiobj) then
|
||||||
begin
|
begin
|
||||||
|
|
@ -1423,7 +1358,6 @@ type tsgtkapi = class(tgtkapis)
|
||||||
dy := p1["y_r"]-p1["y"];
|
dy := p1["y_r"]-p1["y"];
|
||||||
p[0]+=dx;
|
p[0]+=dx;
|
||||||
p[1]+=dy;
|
p[1]+=dy;
|
||||||
|
|
||||||
end
|
end
|
||||||
return true;
|
return true;
|
||||||
end
|
end
|
||||||
|
|
@ -1443,8 +1377,6 @@ type tsgtkapi = class(tgtkapis)
|
||||||
begin
|
begin
|
||||||
psc := new TPAINTSTRUCT(strc);
|
psc := new TPAINTSTRUCT(strc);
|
||||||
dc := g_object_get_data(hwd,"paint_dc");
|
dc := g_object_get_data(hwd,"paint_dc");
|
||||||
//h := g_object_get_data(hwd,"paint_height");
|
|
||||||
//w := g_object_get_data(hwd,"paint_width");
|
|
||||||
rec := g_object_get_data(hwd,"paint_rect");
|
rec := g_object_get_data(hwd,"paint_rect");
|
||||||
psc._setvalue_("hdc",dc);
|
psc._setvalue_("hdc",dc);
|
||||||
psc._setvalue_("rcpaint",array(rec[0],rec[1],rec[0]+rec[2],rec[1]+rec[3])); //{array(0,0,w,h)}
|
psc._setvalue_("rcpaint",array(rec[0],rec[1],rec[0]+rec[2],rec[1]+rec[3])); //{array(0,0,w,h)}
|
||||||
|
|
@ -1505,15 +1437,13 @@ type tsgtkapi = class(tgtkapis)
|
||||||
wd := fto._getvalue_("width");
|
wd := fto._getvalue_("width");
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
psizl[0] := wd*length(lpString);
|
psizl[0] := wd*length(lpString);
|
||||||
psizl[1] := ht;
|
psizl[1] := ht;
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
end
|
end
|
||||||
function GetCharWidthA(hdc:pointer;iFirst:integer;iLast:integer;var lpBuffer:array of integer):integer;
|
function GetCharWidthA(hdc:pointer;iFirst:integer;iLast:integer;var lpBuffer:array of integer):integer;
|
||||||
begin
|
begin
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
Function Rectangle(dc :pointer;l:integer;t:integer;r:integer;b:integer):integer;
|
Function Rectangle(dc :pointer;l:integer;t:integer;r:integer;b:integer):integer;
|
||||||
begin
|
begin
|
||||||
|
|
@ -2183,8 +2113,10 @@ type tsgtkapi = class(tgtkapis)
|
||||||
Function SetCursor(hd:pointer):pointer;
|
Function SetCursor(hd:pointer):pointer;
|
||||||
begin
|
begin
|
||||||
global g_show_cursor_window;
|
global g_show_cursor_window;
|
||||||
if g_show_cursor_window and hd<>0 then
|
if g_show_cursor_window and (hd>0 or hd<0) then
|
||||||
|
begin
|
||||||
gdk_window_set_cursor(g_show_cursor_window,hd);
|
gdk_window_set_cursor(g_show_cursor_window,hd);
|
||||||
|
end
|
||||||
end
|
end
|
||||||
function drawbitmaptodc(bm,hdc,x,y,rc,flag,thdc);
|
function drawbitmaptodc(bm,hdc,x,y,rc,flag,thdc);
|
||||||
begin
|
begin
|
||||||
|
|
@ -2817,7 +2749,8 @@ type tsgtkapi = class(tgtkapis)
|
||||||
//caret 插入符号 处理
|
//caret 插入符号 处理
|
||||||
function drawcaret(h,xy,f);
|
function drawcaret(h,xy,f);
|
||||||
begin
|
begin
|
||||||
ct := g_object_get_data(h,"gtk_window_caret");
|
global g_caret_object;
|
||||||
|
ct := g_caret_object;//g_object_get_data(h,"gtk_window_caret");
|
||||||
if f=1 then //清除
|
if f=1 then //清除
|
||||||
begin
|
begin
|
||||||
if g_object_get_data(ct,"isshow") then return ;
|
if g_object_get_data(ct,"isshow") then return ;
|
||||||
|
|
@ -2840,41 +2773,6 @@ type tsgtkapi = class(tgtkapis)
|
||||||
g_object_set_data(ct,"isshow",true);
|
g_object_set_data(ct,"isshow",true);
|
||||||
gtk_widget_show(ct);
|
gtk_widget_show(ct);
|
||||||
end
|
end
|
||||||
|
|
||||||
return ;
|
|
||||||
////////////////////////////
|
|
||||||
|
|
||||||
//获得窗口
|
|
||||||
hwcr := g_object_get_data(h,"gtk_clientwideget");
|
|
||||||
hcr := gdk_cairo_create(gtk_widget_get_window(hwcr));
|
|
||||||
//echo "\r\n>>get:",cairo_get_operator(hcr);
|
|
||||||
//cairo_set_operator(hcr,11);
|
|
||||||
//echo ">>2get:",cairo_get_operator(hcr);
|
|
||||||
//cairo_set_source_rgb(hcr,0,0,0);
|
|
||||||
if f=-1 then
|
|
||||||
begin
|
|
||||||
if g_object_get_data(ct,"isshow") then
|
|
||||||
begin
|
|
||||||
g_object_set_data(ct,"isshow",0);
|
|
||||||
cairo_set_source_rgb(hcr,0,0,0);
|
|
||||||
end else
|
|
||||||
begin
|
|
||||||
g_object_set_data(ct,"isshow",true);
|
|
||||||
cairo_set_source_rgb(hcr,1,1,1);
|
|
||||||
end
|
|
||||||
end else
|
|
||||||
if f = 1 then
|
|
||||||
begin
|
|
||||||
g_object_set_data(ct,"isshow",true);
|
|
||||||
cairo_set_source_rgb(hcr,1,1,1);
|
|
||||||
end
|
|
||||||
cairo_set_line_width(hcr,max(2, g_object_get_data(ct,"width_c")));
|
|
||||||
cairo_move_to(hcr, xy[0], xy[1]);
|
|
||||||
cairo_line_to(hcr, xy[0], xy[1]+g_object_get_data(ct,"heigt_c"));
|
|
||||||
cairo_stroke(hcr);
|
|
||||||
//cairo_rectangle(hcr,xy[0],xy[1],5,20);
|
|
||||||
//cairo_fill(hcr);
|
|
||||||
cairo_destroy(hcr); //?
|
|
||||||
end
|
end
|
||||||
private
|
private
|
||||||
g_gtk_caret_cache_timer;
|
g_gtk_caret_cache_timer;
|
||||||
|
|
@ -2891,26 +2789,26 @@ type tsgtkapi = class(tgtkapis)
|
||||||
public
|
public
|
||||||
function CreateCaret(hWnd :pointer;hBitmap:pointer;nWidth:integer;nHeight:integer):integer;
|
function CreateCaret(hWnd :pointer;hBitmap:pointer;nWidth:integer;nHeight:integer):integer;
|
||||||
begin
|
begin
|
||||||
|
global g_Caret_Blink_Time,g_caret_object;
|
||||||
if not(hwnd>0 or hwnd<0) then return 0;
|
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 not g_gtk_caret_cache_timer then
|
if not g_gtk_caret_cache_timer then
|
||||||
begin
|
begin
|
||||||
Fscrolltimedo := makeinstance(thisfunction(docarettime));
|
Fscrolltimedo := makeinstance(thisfunction(docarettime));
|
||||||
g_gtk_caret_cache_timer:= new ttmstruct(nil);
|
g_gtk_caret_cache_timer:= new ttmstruct(nil);
|
||||||
rt := g_timeout_add(800,Fscrolltimedo,g_gtk_caret_cache_timer._getptr_() );
|
rt := g_timeout_add(g_Caret_Blink_Time,Fscrolltimedo,g_gtk_caret_cache_timer._getptr_() );
|
||||||
g_gtk_caret_cache_timer._setvalue_(0,rt);
|
g_gtk_caret_cache_timer._setvalue_(0,rt);
|
||||||
end
|
end
|
||||||
h := g_object_get_data(hwnd,"gtk_window_caret"); //获得caret
|
h := g_caret_object;
|
||||||
if not h then
|
if not h then
|
||||||
begin
|
begin
|
||||||
h := gtk_event_box_new();
|
h := gtk_window_new(1);
|
||||||
c := new _GdkColor(nil);
|
c := new _GdkColor(nil);
|
||||||
c.SetRgb(0,0,0);
|
c.SetRgb(0,0,0);
|
||||||
gtk_widget_modify_bg(h,0,c._getptr_());
|
gtk_widget_modify_bg(h,0,c._getptr_());
|
||||||
gtk_widget_hide(h);
|
gtk_window_move(h,0,0);
|
||||||
lot := g_object_get_data(hWnd,"gtk_layout");
|
g_caret_object := h;
|
||||||
//gtk_layout_move(lot,h,x,y);
|
|
||||||
gtk_layout_put(lot,h,0,0);
|
|
||||||
g_object_set_data(hwnd,"gtk_window_caret",h);
|
|
||||||
end
|
end
|
||||||
if nWidth>=0 and nHeight>=0 then
|
if nWidth>=0 and nHeight>=0 then
|
||||||
begin
|
begin
|
||||||
|
|
@ -2918,34 +2816,36 @@ type tsgtkapi = class(tgtkapis)
|
||||||
g_object_set_data(h,"heigt_c",nHeight);
|
g_object_set_data(h,"heigt_c",nHeight);
|
||||||
gtk_widget_set_size_request(h,nWidth,nHeight);
|
gtk_widget_set_size_request(h,nWidth,nHeight);
|
||||||
end
|
end
|
||||||
|
gtk_window_set_transient_for(h,pw);
|
||||||
return h;
|
return h;
|
||||||
end
|
end
|
||||||
function DestroyCaret():integer;
|
function DestroyCaret():integer;
|
||||||
begin
|
begin
|
||||||
global g_current_get_focus_widget;
|
global g_current_get_focus_widget,g_caret_object;
|
||||||
hwnd := g_current_get_focus_widget;
|
hwnd := g_current_get_focus_widget;
|
||||||
if not(hwnd>0 or hwnd<0) then return ;
|
if not(hwnd>0 or hwnd<0) then return ;
|
||||||
if not IsGtkWidget(hwnd) then return ;
|
if not IsGtkWidget(hwnd) then return ;
|
||||||
g_object_set_data(hwnd,"caretshow",0);
|
g_object_set_data(hwnd,"caretshow",0);
|
||||||
ct := g_object_get_data(hwnd,"gtk_window_caret");
|
//ct := g_object_get_data(hwnd,"gtk_window_caret");
|
||||||
gtk_widget_hide(ct);
|
gtk_widget_hide(g_caret_object);
|
||||||
return ;
|
return ;
|
||||||
// 获得focus
|
// 获得focus
|
||||||
end
|
end
|
||||||
function SetCaretPos(x:integer;y:integer):integer;
|
function SetCaretPos(x:integer;y:integer):integer;
|
||||||
begin
|
begin
|
||||||
global g_current_get_focus_widget;
|
global g_current_get_focus_widget,g_caret_object;
|
||||||
hwnd := g_current_get_focus_widget;
|
hwnd := g_current_get_focus_widget;
|
||||||
if IsGtkWidget(hwnd) then
|
if IsGtkWidget(hwnd) then
|
||||||
begin
|
begin
|
||||||
crt := g_object_get_data( hwnd,"gtk_window_caret");
|
crt := g_caret_object;
|
||||||
GetCaretPos(xy);
|
GetCaretPos(xy);
|
||||||
if crt then //处理此处
|
if crt then //处理此处
|
||||||
begin
|
begin
|
||||||
gtk_object_set_data(hwnd,"caret_x_pos",x);
|
gtk_object_set_data(hwnd,"caret_x_pos",x);
|
||||||
gtk_object_set_data(hwnd,"caret_y_pos",y);
|
gtk_object_set_data(hwnd,"caret_y_pos",y);
|
||||||
lot := g_object_get_data(hwnd,"gtk_layout");
|
p := array(x,y);
|
||||||
gtk_layout_move(lot,crt,x,y);
|
ClientToScreen(hwnd,p);
|
||||||
|
gtk_window_move(crt,p[0],p[1]);
|
||||||
end
|
end
|
||||||
if xy[0]<>x then
|
if xy[0]<>x then
|
||||||
drawcaret(hwnd,xy,1);
|
drawcaret(hwnd,xy,1);
|
||||||
|
|
@ -2971,7 +2871,8 @@ type tsgtkapi = class(tgtkapis)
|
||||||
// 获得focus widget
|
// 获得focus widget
|
||||||
if not(hwnd>0 or hwnd<0) then return ;
|
if not(hwnd>0 or hwnd<0) then return ;
|
||||||
if not IsGtkWidget(hwnd) then return ;
|
if not IsGtkWidget(hwnd) then return ;
|
||||||
ct := g_object_get_data(hwnd,"gtk_window_caret");
|
global g_caret_object;
|
||||||
|
ct := g_caret_object;//g_object_get_data(hwnd,"gtk_window_caret");
|
||||||
g_object_set_data(hwnd,"caretshow",0);
|
g_object_set_data(hwnd,"caretshow",0);
|
||||||
if ct then gtk_widget_hide(ct);
|
if ct then gtk_widget_hide(ct);
|
||||||
return ;
|
return ;
|
||||||
|
|
@ -3347,7 +3248,7 @@ type tgtkapis = class() //gtk
|
||||||
begin
|
begin
|
||||||
return AddMessageToGtkMessageQueue(FHandle,msg,wparam,lparam,d);
|
return AddMessageToGtkMessageQueue(FHandle,msg,wparam,lparam,d);
|
||||||
end
|
end
|
||||||
function gtk_GetKeyState(key); //按键状态
|
function GetKeyState(key); //按键状态
|
||||||
begin
|
begin
|
||||||
global g_gtk_keytable;
|
global g_gtk_keytable;
|
||||||
if g_gtk_keytable then
|
if g_gtk_keytable then
|
||||||
|
|
@ -3359,7 +3260,7 @@ type tgtkapis = class() //gtk
|
||||||
end
|
end
|
||||||
end ;
|
end ;
|
||||||
end
|
end
|
||||||
function gtk_GetAsyncKeyState(key);//鼠标按键状态
|
function GetAsyncKeyState(key);//鼠标按键状态
|
||||||
begin
|
begin
|
||||||
global g_gtk_buttontable;
|
global g_gtk_buttontable;
|
||||||
if g_gtk_buttontable then
|
if g_gtk_buttontable then
|
||||||
|
|
@ -3623,27 +3524,13 @@ type tgtkapis = class() //gtk
|
||||||
begin
|
begin
|
||||||
if fileexists("","/usr/bin/zenity") then
|
if fileexists("","/usr/bin/zenity") then
|
||||||
begin
|
begin
|
||||||
for i := length(p) downto 1 do
|
tsl_gtk_execsystem(format('zenity --file-selection --filename="%s" &',p));
|
||||||
begin
|
return 1;//
|
||||||
if p[i]="/" then
|
|
||||||
begin
|
|
||||||
tsl_gtk_execsystem(format('zenity --file-selection --filename="%s" &',p[1:i]));
|
|
||||||
break;
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return ;//
|
|
||||||
end
|
end
|
||||||
if fileexists("","/usr/bin/caja") then
|
if fileexists("","/usr/bin/caja") then
|
||||||
begin
|
begin
|
||||||
for i := length(p) downto 1 do
|
tsl_gtk_execsystem(format('caja "%s" &',p));
|
||||||
begin
|
return 1;
|
||||||
if p[i]="/" then
|
|
||||||
begin
|
|
||||||
tsl_gtk_execsystem(format('caja "%s" &',p[1:i]));
|
|
||||||
break;
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return ;//
|
|
||||||
end
|
end
|
||||||
tsl_gtk_execsystem(format('nautilus "%s" &',p));
|
tsl_gtk_execsystem(format('nautilus "%s" &',p));
|
||||||
return 1;
|
return 1;
|
||||||
|
|
@ -6795,7 +6682,7 @@ type tgtk_ctl_object = class(_gtkeventtype)
|
||||||
end
|
end
|
||||||
return 0;
|
return 0;
|
||||||
end
|
end
|
||||||
static fwindow_cursor;
|
fwindow_cursor;
|
||||||
function CallTslVclProc(msg,w,l,P);virtual; //调用到win消息处理
|
function CallTslVclProc(msg,w,l,P);virtual; //调用到win消息处理
|
||||||
begin
|
begin
|
||||||
CM_CURSORCHANGED := _const.CM_CURSORCHANGED;
|
CM_CURSORCHANGED := _const.CM_CURSORCHANGED;
|
||||||
|
|
@ -6825,7 +6712,6 @@ type tgtk_ctl_object = class(_gtkeventtype)
|
||||||
clearMessageFromGtkMessageQueue(FHandle,CM_CURSORCHANGED);
|
clearMessageFromGtkMessageQueue(FHandle,CM_CURSORCHANGED);
|
||||||
case r of
|
case r of
|
||||||
10,11:begin
|
10,11:begin
|
||||||
//_wapi.gdk_window_set_cursor(wd,FsysCursors[1]) ;
|
|
||||||
g_show_cursor_window := 0;
|
g_show_cursor_window := 0;
|
||||||
if fwindow_cursor <> FsysCursors[1] then
|
if fwindow_cursor <> FsysCursors[1] then
|
||||||
begin
|
begin
|
||||||
|
|
@ -6834,8 +6720,7 @@ type tgtk_ctl_object = class(_gtkeventtype)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
12,15:begin
|
12,15:begin
|
||||||
//_wapi.gdk_window_set_cursor(wd,FsysCursors[2]) ;
|
g_show_cursor_window := 0;
|
||||||
//g_show_cursor_window := 0;
|
|
||||||
if fwindow_cursor <> FsysCursors[2] then
|
if fwindow_cursor <> FsysCursors[2] then
|
||||||
begin
|
begin
|
||||||
fwindow_cursor := FsysCursors[2];
|
fwindow_cursor := FsysCursors[2];
|
||||||
|
|
@ -6843,12 +6728,11 @@ type tgtk_ctl_object = class(_gtkeventtype)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
1:begin
|
1:begin
|
||||||
//_wapi.gdk_window_set_cursor(wd,FsysCursors[0]) ;
|
|
||||||
//AddMessageToGtkMessageQueue(FHandle,CM_CURSORCHANGED,0,0);
|
|
||||||
if fwindow_cursor <> FsysCursors[0] then
|
if fwindow_cursor <> FsysCursors[0] then
|
||||||
begin
|
begin
|
||||||
fwindow_cursor := FsysCursors[0];
|
fwindow_cursor := FsysCursors[0];
|
||||||
AddMessageToGtkMessageQueue(FHandle,CM_CURSORCHANGED,wd,FsysCursors[0]);
|
//AddMessageToGtkMessageQueue(FHandle,CM_CURSORCHANGED,wd,FsysCursors[0]);
|
||||||
|
AddMessageToGtkMessageQueue(FHandle,_const.WM_SETCURSOR,wd,FsysCursors[0]);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|
@ -6862,7 +6746,6 @@ type tgtk_ctl_object = class(_gtkeventtype)
|
||||||
FHitwidgetposition := ht;
|
FHitwidgetposition := ht;
|
||||||
if ht=10 or ht=11 then
|
if ht=10 or ht=11 then
|
||||||
begin
|
begin
|
||||||
//return _wapi.gdk_window_set_cursor(wd,FsysCursors[1]) ;
|
|
||||||
g_show_cursor_window := 0;
|
g_show_cursor_window := 0;
|
||||||
if fwindow_cursor <> FsysCursors[1] then
|
if fwindow_cursor <> FsysCursors[1] then
|
||||||
begin
|
begin
|
||||||
|
|
@ -6873,7 +6756,6 @@ type tgtk_ctl_object = class(_gtkeventtype)
|
||||||
if ht=12 or ht=15 then
|
if ht=12 or ht=15 then
|
||||||
begin
|
begin
|
||||||
g_show_cursor_window := 0;
|
g_show_cursor_window := 0;
|
||||||
//return _wapi.gdk_window_set_cursor(wd,FsysCursors[2]) ;
|
|
||||||
if fwindow_cursor <> FsysCursors[2] then
|
if fwindow_cursor <> FsysCursors[2] then
|
||||||
begin
|
begin
|
||||||
fwindow_cursor := FsysCursors[2];
|
fwindow_cursor := FsysCursors[2];
|
||||||
|
|
@ -6881,12 +6763,10 @@ type tgtk_ctl_object = class(_gtkeventtype)
|
||||||
end return r;
|
end return r;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
//_wapi.gdk_window_set_cursor(wd,FsysCursors[0]) ;
|
|
||||||
//return AddMessageToGtkMessageQueue(FHandle,CM_CURSORCHANGED,0,0);
|
|
||||||
if fwindow_cursor<>FsysCursors[0] then
|
if fwindow_cursor<>FsysCursors[0] then
|
||||||
begin
|
begin
|
||||||
fwindow_cursor := FsysCursors[0];
|
fwindow_cursor := FsysCursors[0];
|
||||||
return AddMessageToGtkMessageQueue(FHandle,CM_CURSORCHANGED,wd,FsysCursors[0]);
|
return AddMessageToGtkMessageQueue(FHandle,_const.WM_SETCURSOR,wd,FsysCursors[0]);
|
||||||
end return r;
|
end return r;
|
||||||
end
|
end
|
||||||
end ;
|
end ;
|
||||||
|
|
@ -6960,6 +6840,7 @@ type tgtk_ctl_object = class(_gtkeventtype)
|
||||||
end
|
end
|
||||||
function imitate_event_size();virtual; //模拟移动
|
function imitate_event_size();virtual; //模拟移动
|
||||||
begin
|
begin
|
||||||
|
if _wapi.gtk_object_get_data(Handle,"gtk_wnd_hs_caption") then return false;
|
||||||
return true;
|
return true;
|
||||||
end
|
end
|
||||||
function GSWINDOWSTATEEVENT(a,b,c,d);virtual; //状态改变
|
function GSWINDOWSTATEEVENT(a,b,c,d);virtual; //状态改变
|
||||||
|
|
@ -7054,11 +6935,6 @@ type tgtk_ctl_object = class(_gtkeventtype)
|
||||||
return CanignoreBtnpress();
|
return CanignoreBtnpress();
|
||||||
end
|
end
|
||||||
psi := makelong(integer(e.x),integer(e.y));
|
psi := makelong(integer(e.x),integer(e.y));
|
||||||
//r := array();
|
|
||||||
//_wapi.GetTopWidgetList(a.handle,e.x_root,e.y_root,r);
|
|
||||||
//rl := length(r)-1;
|
|
||||||
//if r[rl,0]<>a.handle then return false;
|
|
||||||
|
|
||||||
case e.button of
|
case e.button of
|
||||||
1:
|
1:
|
||||||
begin
|
begin
|
||||||
|
|
@ -7113,6 +6989,8 @@ type tgtk_ctl_object = class(_gtkeventtype)
|
||||||
function GSBUTTONRELEASEEVENT(a,b,c,d);virtual;
|
function GSBUTTONRELEASEEVENT(a,b,c,d);virtual;
|
||||||
begin
|
begin
|
||||||
global g_gtk_buttontable, g_gtk_keytable,g_c_btn_release_event;
|
global g_gtk_buttontable, g_gtk_keytable,g_c_btn_release_event;
|
||||||
|
FHitwidgetposition := 0;
|
||||||
|
Fsyscommand0x12info := nil;
|
||||||
e := new _GdkEventButton(c);
|
e := new _GdkEventButton(c);
|
||||||
ev := new _GdkEventButton(nil);
|
ev := new _GdkEventButton(nil);
|
||||||
ev.CopyFromString(e.CopyToString());
|
ev.CopyFromString(e.CopyToString());
|
||||||
|
|
@ -7533,11 +7411,6 @@ type tgtk_ctl_object = class(_gtkeventtype)
|
||||||
e := new _GdkEventAny(c);
|
e := new _GdkEventAny(c);
|
||||||
if imitate_event_size() then
|
if imitate_event_size() then
|
||||||
begin
|
begin
|
||||||
global g_gtk_scroll_lock;
|
|
||||||
if g_gtk_scroll_lock then
|
|
||||||
begin
|
|
||||||
return true;
|
|
||||||
end
|
|
||||||
if FHitwidgetposition in array(110,111,112,115) then
|
if FHitwidgetposition in array(110,111,112,115) then
|
||||||
begin
|
begin
|
||||||
if mn="event" then
|
if mn="event" then
|
||||||
|
|
@ -7610,6 +7483,9 @@ type tgtk_ctl_object = class(_gtkeventtype)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
case mn of
|
case mn of
|
||||||
|
GS_ENTER_NOTIFY_EVENT:
|
||||||
|
begin
|
||||||
|
end
|
||||||
GS_DESTROY:
|
GS_DESTROY:
|
||||||
begin
|
begin
|
||||||
Fsyscommand0x12 := 0;
|
Fsyscommand0x12 := 0;
|
||||||
|
|
@ -8137,21 +8013,14 @@ type tgtk_ctl_scroll_window = class(tgtk_ctl_object)
|
||||||
hd := a.handle;
|
hd := a.handle;
|
||||||
r := zeros(4);
|
r := zeros(4);
|
||||||
_wapi.gtk_widget_get_allocation(hd,r);
|
_wapi.gtk_widget_get_allocation(hd,r);
|
||||||
cr := _wapi.gdk_cairo_create(_wapi.gtk_widget_get_window(hd));
|
//cr := _wapi.gdk_cairo_create(_wapi.gtk_widget_get_window(hd));
|
||||||
rec := zeros(4);
|
cr :=c;//rec := r;
|
||||||
_wapi.gdk_cairo_get_clip_rectangle(cr,rec);
|
rec := zeros(4); _wapi.gdk_cairo_get_clip_rectangle(cr,rec);
|
||||||
//echo ">>>1111",tostn(rec);
|
|
||||||
//echo ">>>extents:";
|
|
||||||
//_wapi.cairo_clip_extents(cr,x,y,w,h);
|
//_wapi.cairo_clip_extents(cr,x,y,w,h);
|
||||||
hwd := handle;
|
hwd := handle;
|
||||||
//echo "paintrect:",hd,tostn(rec);
|
|
||||||
_wapi.g_object_set_data(hwd,"paint_dc",cr);
|
_wapi.g_object_set_data(hwd,"paint_dc",cr);
|
||||||
_wapi.g_object_set_data(hwd,"paint_rect",rec);
|
_wapi.g_object_set_data(hwd,"paint_rect",rec);
|
||||||
//_wapi.g_object_set_data(hwd,"paint_height",r[3]);
|
|
||||||
//_wapi.g_object_set_data(hwd,"paint_width",r[2]);
|
|
||||||
//mtic;
|
|
||||||
CallTslVclProc(_const.WM_PAINT,0,0); //绘制
|
CallTslVclProc(_const.WM_PAINT,0,0); //绘制
|
||||||
|
|
||||||
if not(self(true) is class(tgtk_ctl_window_PoPup)) then
|
if not(self(true) is class(tgtk_ctl_window_PoPup)) then
|
||||||
begin
|
begin
|
||||||
if (r[2]<=(rec[0]+rec[2])) or (r[3]<=(rec[1]+rec[3])) then
|
if (r[2]<=(rec[0]+rec[2])) or (r[3]<=(rec[1]+rec[3])) then
|
||||||
|
|
@ -8174,9 +8043,8 @@ type tgtk_ctl_scroll_window = class(tgtk_ctl_object)
|
||||||
CallTslVclProc(_const.WM_NCPAINT,0,cr); //绘制
|
CallTslVclProc(_const.WM_NCPAINT,0,cr); //绘制
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
_wapi.cairo_destroy(cr);
|
//_wapi.cairo_destroy(cr);
|
||||||
_wapi.gtk_object_set_data(cr);
|
_wapi.gtk_object_set_data(cr);
|
||||||
//echo "\r\ntime:",datetimetostr(now()),"===timeuses:",mtoc,"===",hd;
|
|
||||||
end;
|
end;
|
||||||
function CreateWnd(dwExStyle,lpClassName,lpWindowName,dwStyle,x,y,nwidth,nheight,hwndparent,hmenu,hinstance,lpParam);override;
|
function CreateWnd(dwExStyle,lpClassName,lpWindowName,dwStyle,x,y,nwidth,nheight,hwndparent,hmenu,hinstance,lpParam);override;
|
||||||
begin
|
begin
|
||||||
|
|
@ -8631,7 +8499,6 @@ type tgtk_ctl_object_client = class(tgtk_ctl_object)
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
type tgtk_ctl_window_PoPup = class(tgtk_ctl_scroll_window)
|
type tgtk_ctl_window_PoPup = class(tgtk_ctl_scroll_window)
|
||||||
function Create(h);override;
|
function Create(h);override;
|
||||||
|
|
@ -8650,11 +8517,6 @@ type tgtk_ctl_window_PoPup = class(tgtk_ctl_scroll_window)
|
||||||
end
|
end
|
||||||
inherited;
|
inherited;
|
||||||
end
|
end
|
||||||
function imitate_event_size();override;
|
|
||||||
begin
|
|
||||||
if _wapi.gtk_object_get_data(Handle,"gtk_wnd_hs_caption") then return false;
|
|
||||||
return true;
|
|
||||||
end
|
|
||||||
function later_set_size(id:pointer):integer;cdecl;
|
function later_set_size(id:pointer):integer;cdecl;
|
||||||
begin
|
begin
|
||||||
_wapi.g_object_set_data(id,"size_last_set",0);
|
_wapi.g_object_set_data(id,"size_last_set",0);
|
||||||
|
|
@ -8856,8 +8718,14 @@ type tgtk_ctl_window_PoPup = class(tgtk_ctl_scroll_window)
|
||||||
FClientObject.connect(GS_BUTTON_PRESS_EVENT,thisfunction(cleinteventpress));
|
FClientObject.connect(GS_BUTTON_PRESS_EVENT,thisfunction(cleinteventpress));
|
||||||
FClientObject.connect(GS_BUTTON_RELEASE_EVENT,thisfunction(cleinteventrelease));
|
FClientObject.connect(GS_BUTTON_RELEASE_EVENT,thisfunction(cleinteventrelease));
|
||||||
FClientObject.connect(GS_MOTION_NOTIFY_EVENT,thisfunction(cleinteventmove));
|
FClientObject.connect(GS_MOTION_NOTIFY_EVENT,thisfunction(cleinteventmove));
|
||||||
|
connect(GS_EVENT,thisfunction(nonevent));
|
||||||
|
FClientObject.connect(GS_EVENT,thisfunction(mygsevent));
|
||||||
end
|
end
|
||||||
return r;
|
return r;
|
||||||
|
end
|
||||||
|
function nonevent();
|
||||||
|
begin
|
||||||
|
|
||||||
end
|
end
|
||||||
function GSBUTTONRELEASEEVENT(a,b,c,d);override;
|
function GSBUTTONRELEASEEVENT(a,b,c,d);override;
|
||||||
begin
|
begin
|
||||||
|
|
@ -8886,6 +8754,10 @@ type tgtk_ctl_window_PoPup = class(tgtk_ctl_scroll_window)
|
||||||
begin
|
begin
|
||||||
return inherited GSMOTIONNOTIFYEVENT(self,b,c,d);
|
return inherited GSMOTIONNOTIFYEVENT(self,b,c,d);
|
||||||
end
|
end
|
||||||
|
function mygsevent(a,b,c,d);
|
||||||
|
begin
|
||||||
|
return GtkEventDispatchA(self,b,c,d);
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
type tgtk_wnd_info = class()
|
type tgtk_wnd_info = class()
|
||||||
|
|
@ -9612,7 +9484,7 @@ begin
|
||||||
begin
|
begin
|
||||||
G_E_ID_Name_2[v] := i;
|
G_E_ID_Name_2[v] := i;
|
||||||
end
|
end
|
||||||
g_Caret_Blink_Time := 800;
|
g_Caret_Blink_Time := 600;
|
||||||
g_gtk_dragxy := array(0,0);
|
g_gtk_dragxy := array(0,0);
|
||||||
g_gtk_font_get_size := array();
|
g_gtk_font_get_size := array();
|
||||||
gtk_init_check(nil,nil);
|
gtk_init_check(nil,nil);
|
||||||
|
|
@ -9624,6 +9496,9 @@ begin
|
||||||
g_gtk_buttontable := array(0,0);
|
g_gtk_buttontable := array(0,0);
|
||||||
g_gtk_keytable := array(0x10:0,0x11:0,0x12:0);
|
g_gtk_keytable := array(0x10:0,0x11:0,0x12:0);
|
||||||
g_gtk_call_handler_manager := new tinstancemanager();
|
g_gtk_call_handler_manager := new tinstancemanager();
|
||||||
|
//////////////////初始化kyemap/////////////////////////////////////////////
|
||||||
|
if getglobalcache("~gtk~init",gc) then return ;//echo gc ;
|
||||||
|
setglobalcache("~gtk~init","\r\ngtk init ok");
|
||||||
kmp := keymap_get_default();
|
kmp := keymap_get_default();
|
||||||
if not kmp then return 0;
|
if not kmp then return 0;
|
||||||
signal_connect_data(kmp,"state-changed",g_gtk_call_handler_manager.get(thisfunction(tsl_gtk_keymp_state)),0,0);
|
signal_connect_data(kmp,"state-changed",g_gtk_call_handler_manager.get(thisfunction(tsl_gtk_keymp_state)),0,0);
|
||||||
|
|
@ -9685,6 +9560,14 @@ begin
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
////////////////////////new function//////////////////////////////////////////////
|
////////////////////////new function//////////////////////////////////////////////
|
||||||
|
function c_g_e_enter_notify_event(w:pointer;dt:pointer;u_d:pointer):integer;
|
||||||
|
begin
|
||||||
|
return _gtkeventcall_(w,u_d,dt);
|
||||||
|
end
|
||||||
|
function c_g_e_leave_notify_event(w:pointer;dt:pointer;u_d:pointer):integer; //leave-notify-event
|
||||||
|
begin
|
||||||
|
return _gtkeventcall_(w,u_d,dt);
|
||||||
|
end
|
||||||
function c_g_e_drag_begin(w:pointer;dt:pointer;u_d:pointer):integer; //
|
function c_g_e_drag_begin(w:pointer;dt:pointer;u_d:pointer):integer; //
|
||||||
begin
|
begin
|
||||||
return _gtkeventcall_(w,u_d,dt);
|
return _gtkeventcall_(w,u_d,dt);
|
||||||
|
|
|
||||||
|
|
@ -1521,8 +1521,8 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) //
|
||||||
function MoveCaretAndSelection(p1,p2,sel);//移动选择
|
function MoveCaretAndSelection(p1,p2,sel);//移动选择
|
||||||
begin
|
begin
|
||||||
if not(ifarray(p2)and ifarray(p1)and p2[0]>= 1 and p2[1]>= 1)then return;
|
if not(ifarray(p2)and ifarray(p1)and p2[0]>= 1 and p2[1]>= 1)then return;
|
||||||
SetCaretXY(p2);
|
|
||||||
IncPaintLock();
|
IncPaintLock();
|
||||||
|
SetCaretXY(p2);
|
||||||
if Sel then
|
if Sel then
|
||||||
begin
|
begin
|
||||||
if not SelAvail then fBlockBegin := p1;
|
if not SelAvail then fBlockBegin := p1;
|
||||||
|
|
|
||||||
|
|
@ -2461,7 +2461,7 @@ type tinstancemanager = class()
|
||||||
@param(f)(handler) tsl函数对象 %%
|
@param(f)(handler) tsl函数对象 %%
|
||||||
@return(pointer) c函数回调 %%
|
@return(pointer) c函数回调 %%
|
||||||
**}
|
**}
|
||||||
id := integer(f);
|
id := inttostr(int64(f));
|
||||||
r := fhandles[id];
|
r := fhandles[id];
|
||||||
if r then return r;
|
if r then return r;
|
||||||
r := makeinstance(f);
|
r := makeinstance(f);
|
||||||
|
|
@ -2478,7 +2478,7 @@ type tinstancemanager = class()
|
||||||
@param(f)(handler) tsl函数对象 %%
|
@param(f)(handler) tsl函数对象 %%
|
||||||
@return(bool) 是否成功 %%
|
@return(bool) 是否成功 %%
|
||||||
**}
|
**}
|
||||||
id := integer(f);
|
id := inttostr(int64(f));
|
||||||
h := fhandles[id];
|
h := fhandles[id];
|
||||||
if h then
|
if h then
|
||||||
begin
|
begin
|
||||||
|
|
|
||||||
|
|
@ -186,6 +186,7 @@ type TSLUIBASE=class(TSLUICONST) //ͼ
|
||||||
private
|
private
|
||||||
FReCycleState;
|
FReCycleState;
|
||||||
static FTSLkeyWords;
|
static FTSLkeyWords;
|
||||||
|
static FTSLkeyWordshash;
|
||||||
static TSLRCS_NONE;
|
static TSLRCS_NONE;
|
||||||
static TSLRCS_BEGIN;
|
static TSLRCS_BEGIN;
|
||||||
static TSLRCS_END;
|
static TSLRCS_END;
|
||||||
|
|
@ -219,6 +220,11 @@ type TSLUIBASE=class(TSLUICONST) //ͼ
|
||||||
if not G_O_TSWIN32API_ then G_O_TSWIN32API_ := new tswin32api();
|
if not G_O_TSWIN32API_ then G_O_TSWIN32API_ := new tswin32api();
|
||||||
_wapi := G_O_TSWIN32API_;
|
_wapi := G_O_TSWIN32API_;
|
||||||
FTSLkeyWords := TSL_ReservedKeys2();
|
FTSLkeyWords := TSL_ReservedKeys2();
|
||||||
|
FTSLkeyWordshash := array();
|
||||||
|
for i,v in FTSLkeyWords do
|
||||||
|
begin
|
||||||
|
FTSLkeyWordshash[v] := true;
|
||||||
|
end
|
||||||
end
|
end
|
||||||
if not FHAPP then
|
if not FHAPP then
|
||||||
begin
|
begin
|
||||||
|
|
@ -234,7 +240,7 @@ type TSLUIBASE=class(TSLUICONST) //ͼ
|
||||||
@explan(说明) 判断是否为tsl关键字 %%
|
@explan(说明) 判断是否为tsl关键字 %%
|
||||||
@param(key)(string)
|
@param(key)(string)
|
||||||
**}
|
**}
|
||||||
return ifstring(key)and ifarray(FTSLkeyWords)and(lowercase(key)in FTSLkeyWords);
|
return ifstring(key)and ifarray(FTSLkeyWordshash) and( FTSLkeyWordshash[lowercase(key)]);
|
||||||
return false;
|
return false;
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue