From 6dd3e015b9e80256f03508ed8eb005c581c86c45 Mon Sep 17 00:00:00 2001 From: tslediter Date: Fri, 1 Dec 2023 18:39:34 +0800 Subject: [PATCH] gtk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 鏇存柊 --- designer/utslvcldebuger.tsf | 3 ++- funcext/tvclib/tslvcl.tsf | 2 +- funcext/tvclib/ugtkinterface.tsf | 41 ++++++++++++++++++++++---------- 3 files changed, 31 insertions(+), 15 deletions(-) diff --git a/designer/utslvcldebuger.tsf b/designer/utslvcldebuger.tsf index ff442fa..b99d5a0 100644 --- a/designer/utslvcldebuger.tsf +++ b/designer/utslvcldebuger.tsf @@ -653,7 +653,8 @@ type TTslDebuga=class(TCustomControl) begin ExecuteCommand("dbgcreatechannel"); ExecuteCommand("showstr","调试程序:"+FDebugExe); - ExecuteCommand("showstr","命令行参数:"+exestr); + if ifarray(exestr) then exestr := array2str(exestr," "); + ExecuteCommand("showstr","调试命令行:"+exestr); if FConnectchannel then begin dbgattachwait(FConnectchannel); diff --git a/funcext/tvclib/tslvcl.tsf b/funcext/tvclib/tslvcl.tsf index ea30113..67f4021 100644 --- a/funcext/tvclib/tslvcl.tsf +++ b/funcext/tvclib/tslvcl.tsf @@ -239,7 +239,7 @@ type tapplication=class(tcomponent) return r; {$endif} if not FMessageObj then FMessageObj := new TTagMSG(); - ptr := FMessageObj._getptr_; + ptr := FMessageObj._getptr_(); while true do begin {if (_wapi.PeekMessageA(ptr,0,0,0,0)) then diff --git a/funcext/tvclib/ugtkinterface.tsf b/funcext/tvclib/ugtkinterface.tsf index 957d974..75df723 100644 --- a/funcext/tvclib/ugtkinterface.tsf +++ b/funcext/tvclib/ugtkinterface.tsf @@ -2341,8 +2341,10 @@ type tsgtkapi = class(tgtkapis) begin global g_image_list_caches ; if not ifarray(g_image_list_caches) then g_image_list_caches := array(); - ptr := new tcstring(8)._getptr_(); + obj := new tcstring(8); + ptr := obj._getptr_(); sptr := inttostr(ptr); + g_image_list_caches[sptr,"obj"] := obj; g_image_list_caches[sptr,"width"] := cx; g_image_list_caches[sptr,"height"] := cy; g_image_list_caches[sptr,"flags"] := flags; @@ -7562,6 +7564,7 @@ type tgtk_ctl_object = class(_gtkeventtype) //"day-selected":"tsl_gtk_day_select_event", //日历选择 "changed" :"tsl_gtk_changed_event", //改变 "preedit-changed":"tsl_gtk_preedit_changed_event" , + "activate-default":"tsl_gtk_activate_default_event_cb" ); end function Connect(n,f); //连接消息 @@ -8599,7 +8602,7 @@ type tgtk_ctl_window_PoPup = class(tgtk_ctl_scroll_window) if y <> ATop then begin _wapi.g_object_set_data(h,"gtk_layout_y",atop); - end + end r := _wapi.Gtk_TrigMoveSizeEvent(h,const aleft,const atop,const AWidth,const AHeight+pcd,(SizeChanged?1:0).|(PosChanged?2:0)); return r; end @@ -8610,7 +8613,7 @@ type tgtk_ctl_window_PoPup = class(tgtk_ctl_scroll_window) end "activate-default": begin - echo "activate-defalut\r\n"; + echo "\r\n activate-defalut",datetimetostr(now()); end end; return inherited; @@ -8618,7 +8621,7 @@ type tgtk_ctl_window_PoPup = class(tgtk_ctl_scroll_window) end function GtkBaseEventName();override; begin - return inherited union2 array("configure-event","delete-event","scroll-event"{,"activate-default"}); + return inherited union2 array("configure-event","delete-event","scroll-event","activate-default"); end function CreateWnd(dwExStyle,lpClassName,lpWindowName,dwStyle,x,y,nwidth,nheight,hwndparent,hmenu,hinstance,lpParam);override; begin @@ -8980,20 +8983,25 @@ begin end end if ifstring(n) then - begin + begin ln := lowercase(n); r := G_E_ID_Name_1[ln]; - if not r then + if ifnil(r) then begin - r := new tcstring(64); - r.setv(n); - r := r._getptr_(); - G_E_ID_Name_1[ln] := r; + mx := 18; + for i ,v in G_E_ID_Name_1 do + begin + mx := max(mx,v); + end + r := mx+1; + G_E_ID_Name_1[ln] := r; G_E_ID_Name_2[r] := ln; + return r; + end else + begin + return r; end - return r; - end else - if n>0 or n<0 then return G_E_ID_Name_2[n]; + end else if n>0 or n<0 then return G_E_ID_Name_2[n]; end function callpaintmessage(d); begin @@ -9310,6 +9318,7 @@ begin "tsl_gtk_wmuser_event": return mgnr.get(thisfunction(tsl_gtk_wmuser_event)); "tsl_gtk_destroy_event": return mgnr.get(thisfunction(tsl_gtk_destroy_event)); "tsl_gtk_activate_event": return mgnr.get(thisfunction(tsl_gtk_activate_event)); + "tsl_gtk_activate_default_event_cb": return mgnr.get(thisfunction(tsl_gtk_activate_default_event_cb)); "tsl_gtk_clicked_event": return mgnr.get(thisfunction(tsl_gtk_clicked_event)); "tsl_gtk_adj_value_changed_event": return mgnr.get(thisfunction(tsl_gtk_adj_value_changed_event)); "tsl_gtk_delete_event": return mgnr.get(thisfunction(tsl_gtk_delete_event)); @@ -9349,6 +9358,12 @@ begin return _gtkeventcall_(a,c,b); //获得消息处理函数的指针 end +function tsl_gtk_activate_default_event_cb(a:pointer;b:pointer):integer; +begin + //return _gtkeventcall_(a,c,b); + return dodeleteevents(a, "activate-default"); + //activate-default; +end function tsl_gtk_preedit_changed_event(a:pointer;b:pointer;c:pointer):integer; begin return dotparamseevents(a, "preedit-changed", b, c);