parent
da2fb85883
commit
a06ee66a81
|
|
@ -6492,7 +6492,7 @@ type TtextEditor = class(tpanel)
|
|||
public
|
||||
itemData;
|
||||
memo;
|
||||
function DoControlAlign();
|
||||
function DoControlAlign();override;
|
||||
begin
|
||||
if btn1 and btn2 and memo then
|
||||
begin
|
||||
|
|
|
|||
|
|
@ -1771,7 +1771,7 @@ type tmemo = class(TSynMemoNorm)
|
|||
return array("name","font","color","parentcolor","parentfont",
|
||||
"popupmenu","visible","anchors","align",
|
||||
"height","width","left","top",
|
||||
"text","readonly",
|
||||
"text","readonly","selectbkcolor","guttercolor","currentlinecolor","guttercharcnt",
|
||||
"tabspace","onmousewheel","onmousemove","onpopupmenu",
|
||||
"onmousedown","onmouseup","onsetfocus","onkillfocus",
|
||||
"onkeyup","onkeydown","onkeypress",
|
||||
|
|
|
|||
|
|
@ -751,8 +751,6 @@ type TWinControl = class(tcontrol)
|
|||
return ;
|
||||
{$endif}
|
||||
_wapi.GetWindowRect(hwnd,rec);
|
||||
rect := array(0,0,0,0);
|
||||
_wapi.GetClientRect(self.Handle,rect);
|
||||
region := new TRGNRECT();
|
||||
region.Rect := rec;
|
||||
if e.wparam =1 then
|
||||
|
|
@ -1233,7 +1231,7 @@ type TWinControl = class(tcontrol)
|
|||
end
|
||||
end else
|
||||
begin
|
||||
{$ifdef gdipaint}
|
||||
{$ifdef gdipaint3}
|
||||
ctls := Controls;
|
||||
if not ctls then return; // e.skip := false;
|
||||
if ctls.Count<1 then return; // e.skip := false ;
|
||||
|
|
|
|||
|
|
@ -1051,7 +1051,7 @@ type tsgtkapi = class(tgtkapis)
|
|||
end
|
||||
function ReleaseDC(hwd :pointer;hdc:pointer):integer;
|
||||
begin
|
||||
|
||||
DeleteDC(hdc);
|
||||
end
|
||||
function SelectClipRgn(hdc :pointer;gdiobj:pointer);
|
||||
begin
|
||||
|
|
@ -1379,6 +1379,18 @@ type tsgtkapi = class(tgtkapis)
|
|||
begin
|
||||
return 0;
|
||||
end
|
||||
function GetDC(hwd);
|
||||
begin
|
||||
if hwd<0 or hwd>0 then
|
||||
begin
|
||||
hwcr := g_object_get_data(h,"gtk_clientwideget");
|
||||
if hwcr>0 or hwcr<0 then return gdk_cairo_create(gtk_widget_get_window(hwcr));
|
||||
end else
|
||||
if hwd=0 then
|
||||
begin
|
||||
return 1;
|
||||
end
|
||||
end
|
||||
function SaveDC(hdc :pointer):integer;
|
||||
begin
|
||||
if not(hdc>0 or hdc<0) then return ;
|
||||
|
|
|
|||
|
|
@ -634,6 +634,9 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd)
|
|||
@explan(说明) 带滚动条的编辑控件 %%
|
||||
**}
|
||||
private
|
||||
fselectbkcolor;//rgb(192,192,192);
|
||||
fcurrentLineColor;//rgb(232,232,255);
|
||||
fguttercolor;
|
||||
Fecruningto; //调试运行到
|
||||
FLineInterval;
|
||||
FSetPostioned;
|
||||
|
|
@ -766,7 +769,7 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd)
|
|||
function PaintGutter(rcDraw,nL1,nL2);
|
||||
begin
|
||||
dc := Canvas;
|
||||
dc.brush.Color := rgb(228,228,228);
|
||||
dc.brush.Color :=FGutterColor ;//rgb(228,228,228);
|
||||
rc := rcDraw;
|
||||
rc[2]-= 6;
|
||||
dc.FillRect(rc);
|
||||
|
|
@ -828,14 +831,14 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd)
|
|||
r[3]:= r[1]+fTextHeight;
|
||||
if i+1=fCaretY then
|
||||
begin
|
||||
cvs.Brush.Color := rgb(232,232,255);
|
||||
cvs.Brush.Color := fcurrentLineColor;//rgb(232,232,255);
|
||||
cvs.FillRect(r);
|
||||
end
|
||||
if bb then
|
||||
begin
|
||||
if i >= bb[0]-1 and i <= ee[0]-1 then
|
||||
begin
|
||||
cvs.Brush.Color := rgb(192,192,192);
|
||||
cvs.Brush.Color := fselectbkcolor;//rgb(192,192,192);
|
||||
src := r;
|
||||
if FSelectionMode=smLine then
|
||||
begin
|
||||
|
|
@ -997,9 +1000,12 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd)
|
|||
function Create(AOwner);override;
|
||||
begin
|
||||
inherited;
|
||||
FGutterColor := rgb(228,228,228);
|
||||
fcurrentLineColor := rgb(232,232,255);
|
||||
fselectbkcolor := rgb(192,192,192);
|
||||
FReadOnly := false;
|
||||
FLineInterval := 4;
|
||||
FGutterCharCount := 7;
|
||||
FGutterCharCount := 4;
|
||||
FSelectionMode := smNormal;
|
||||
FGutter := new TMemoGutter(self);
|
||||
FGutter.Width := 1+Font.Width * FGutterCharCount;
|
||||
|
|
@ -1545,6 +1551,9 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd)
|
|||
property GutterWidth read GetGutterWidth;
|
||||
property LineInterval read FLineInterval write SetLineInterval;
|
||||
property GutterCharCnt:integer read FGutterCharCount write SetGutterCharCnt;
|
||||
property currentLineColor:color read fcurrentLineColor write setcurrentLineColor;
|
||||
property guttercolor:color read fguttercolor write setguttercolor;
|
||||
property selectbkcolor:color read fselectbkcolor write setselectbkcolor;
|
||||
{**
|
||||
@param(ReadOnly)(bool) 是否只读%%
|
||||
@param(Text)(string) 文本%%
|
||||
|
|
@ -1658,6 +1667,37 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd)
|
|||
return array(cy,cx+(ci?(0):1));
|
||||
end
|
||||
private
|
||||
|
||||
function setcurrentLineColor(c);
|
||||
begin
|
||||
if ifnumber(c) and c<>fcurrentLineColor then
|
||||
begin
|
||||
fcurrentLineColor := c;
|
||||
r := carety;
|
||||
InvalidateLines(r,r);
|
||||
end
|
||||
end
|
||||
function setguttercolor(c);
|
||||
begin
|
||||
if ifnumber(c) and c<>fguttercolor then
|
||||
begin
|
||||
fguttercolor := c;
|
||||
InvalidateRect(nil,false);
|
||||
end
|
||||
end
|
||||
function setselectbkcolor(c);
|
||||
begin
|
||||
if ifnumber(c) and c<>fselectbkcolor then
|
||||
begin
|
||||
fselectbkcolor := c;
|
||||
b1 := BlockBegin;
|
||||
b2 := BlockEnd;
|
||||
if b1<>b2 then
|
||||
begin
|
||||
InvalidateRect(nil,false);
|
||||
end
|
||||
end
|
||||
end
|
||||
function setreadolny(n);
|
||||
begin
|
||||
nv := n?true:false;
|
||||
|
|
|
|||
|
|
@ -3006,7 +3006,7 @@ end
|
|||
function getdrawablebitmap(w,h,bmp);
|
||||
begin
|
||||
{$ifdef linux}
|
||||
return 0;
|
||||
return 0;
|
||||
{$endif}
|
||||
if w>1 and h>1 then
|
||||
begin
|
||||
|
|
|
|||
Loading…
Reference in New Issue