parent
a60b46689f
commit
e4aa4fe0cf
|
|
@ -5935,7 +5935,7 @@ type TFindWnd=class(TPage)
|
||||||
if it then
|
if it then
|
||||||
begin
|
begin
|
||||||
s1 := it.SelText;
|
s1 := it.SelText;
|
||||||
if s1 and length(s1)<20 and not(pos("\n",s1))then
|
if s1 and not(pos("\n",s1))then //length(s1)<20 and È¡Ïû³¤¶ÈÏÞÖÆ
|
||||||
begin
|
begin
|
||||||
s := s1;
|
s := s1;
|
||||||
end else
|
end else
|
||||||
|
|
|
||||||
|
|
@ -2585,26 +2585,28 @@ type tsgtkapi = class(tgtkapis)
|
||||||
//cairo_fill(hcr);
|
//cairo_fill(hcr);
|
||||||
cairo_destroy(hcr); //?
|
cairo_destroy(hcr); //?
|
||||||
end
|
end
|
||||||
|
private
|
||||||
|
g_gtk_caret_cache_timer;
|
||||||
|
function docarettime(p:pointer):integer;cdecl;
|
||||||
|
begin
|
||||||
|
global g_current_get_focus_widget;
|
||||||
|
h := g_current_get_focus_widget;
|
||||||
|
if not h then return 1;
|
||||||
|
if not g_object_get_data(h,"caretshow") then return 1;
|
||||||
|
GetCaretPos(xy);
|
||||||
|
drawcaret(h,xy,-1);
|
||||||
|
return 1;
|
||||||
|
end
|
||||||
|
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
|
||||||
if not(hwnd>0 or hwnd<0) then return 0;
|
if not(hwnd>0 or hwnd<0) then return 0;
|
||||||
global g_gtk_caret_cache_timer; //»º´æ
|
|
||||||
if not g_gtk_caret_cache_timer then
|
if not g_gtk_caret_cache_timer then
|
||||||
begin
|
begin
|
||||||
ctm := class(tUIglobalData).uigetdata("G_T_TTIMER_");
|
Fscrolltimedo := makeinstance(thisfunction(docarettime));
|
||||||
if not ctm then return 0;
|
g_gtk_caret_cache_timer:= new ttmstruct(nil);
|
||||||
g_gtk_caret_cache_timer := createobject(ctm,nil);
|
rt := g_timeout_add(500,Fscrolltimedo,g_gtk_caret_cache_timer._getptr_() );
|
||||||
g_gtk_caret_cache_timer.Interval := 500;//680;
|
g_gtk_caret_cache_timer._setvalue_(0,rt);
|
||||||
g_gtk_caret_cache_timer.Ontimer := function(o,e)
|
|
||||||
begin
|
|
||||||
global g_current_get_focus_widget;
|
|
||||||
h := g_current_get_focus_widget;
|
|
||||||
if not h then return ;
|
|
||||||
if not g_object_get_data(h,"caretshow") then return ;
|
|
||||||
GetCaretPos(xy);
|
|
||||||
drawcaret(h,xy,-1);
|
|
||||||
end
|
|
||||||
g_gtk_caret_cache_timer.start();
|
|
||||||
end
|
end
|
||||||
h := g_object_get_data(hwnd,"gtk_window_caret"); //»ñµÃcaret
|
h := g_object_get_data(hwnd,"gtk_window_caret"); //»ñµÃcaret
|
||||||
if not h then
|
if not h then
|
||||||
|
|
@ -5955,19 +5957,6 @@ type tenterouterlist = class
|
||||||
begin
|
begin
|
||||||
FLock := false;
|
FLock := false;
|
||||||
end
|
end
|
||||||
function MouseIsMoved();
|
|
||||||
begin
|
|
||||||
if FLock then return ;
|
|
||||||
|
|
||||||
id := FList[FIndex];
|
|
||||||
if not id then return ;
|
|
||||||
ps := array(0,0);
|
|
||||||
_wapi.GetCursorPos(ps);
|
|
||||||
if FCpos = ps then return ;
|
|
||||||
FCpos := ps;
|
|
||||||
if Mousehittest then call(Mousehittest,self,id);
|
|
||||||
if Mousemovecall then call(Mousemovecall,self,id);
|
|
||||||
end
|
|
||||||
function feach();
|
function feach();
|
||||||
begin
|
begin
|
||||||
return FList[FIndex];
|
return FList[FIndex];
|
||||||
|
|
@ -5991,19 +5980,32 @@ type tenterouterlist = class
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
function MouseIsMoved(ptr:pointer):integer;cdecl;
|
||||||
|
begin
|
||||||
|
if FTimer._getvalue_(0)=0 then return 0;
|
||||||
|
|
||||||
|
if FLock then return 1;
|
||||||
|
id := FList[FIndex];
|
||||||
|
if not id then return 1;
|
||||||
|
ps := array(0,0);
|
||||||
|
_wapi.GetCursorPos(ps);
|
||||||
|
if FCpos = ps then return 1;
|
||||||
|
FCpos := ps;
|
||||||
|
if Mousehittest then call(Mousehittest,self,id);
|
||||||
|
if Mousemovecall then call(Mousemovecall,self,id);
|
||||||
|
return 1;
|
||||||
|
end
|
||||||
function create(api);
|
function create(api);
|
||||||
begin
|
begin
|
||||||
ctm := class(tUIglobalData).uigetdata("G_T_TTIMER_");
|
|
||||||
if not ctm then return ;
|
|
||||||
_wapi := api;
|
_wapi := api;
|
||||||
FCpos := array(0,0);
|
FCpos := array(0,0);
|
||||||
_wapi.GetCursorPos(FCpos);
|
_wapi.GetCursorPos(FCpos);
|
||||||
FList := array();
|
FList := array();
|
||||||
FIndex := -1;
|
FIndex := -1;
|
||||||
FTimer := createobject(ctm,nil);
|
Fscrolltimedo := makeinstance(thisfunction(MouseIsMoved));
|
||||||
FTimer.interval := 30; //30ºÁÃë
|
FTimer:= new ttmstruct(nil);
|
||||||
FTimer.Ontimer := thisfunction(MouseIsMoved);
|
rt := _wapi.g_timeout_add(30,Fscrolltimedo,FTimer._getptr_() ); //30ºÁÃë
|
||||||
FTimer.start();
|
FTimer._setvalue_(0,rt);
|
||||||
end
|
end
|
||||||
function destroy();
|
function destroy();
|
||||||
begin
|
begin
|
||||||
|
|
@ -6011,8 +6013,9 @@ type tenterouterlist = class
|
||||||
FList := array();
|
FList := array();
|
||||||
if FTimer then
|
if FTimer then
|
||||||
begin
|
begin
|
||||||
FTimer.stop();
|
FTimer._setvalue_(0,0);
|
||||||
FTimer := nil;
|
//FTimer.stop();
|
||||||
|
//FTimer := nil;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
Mousemovecall;
|
Mousemovecall;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue