mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-09 20:15:58 +02:00
MG: fixed persistent caret and implemented Form.BorderStyle=bsNone
git-svn-id: trunk@1744 -
This commit is contained in:
parent
c570141b4b
commit
930552f748
@ -469,7 +469,11 @@ begin
|
|||||||
Canvas.Draw(1, 1, bitmap);
|
Canvas.Draw(1, 1, bitmap);
|
||||||
// draw a rectangle around the window
|
// draw a rectangle around the window
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
Canvas.Pen.Color := ClBlack;
|
{$IFDEF SYN_LAZARUS}
|
||||||
|
Canvas.Pen.Color := TextColor;
|
||||||
|
{$ELSE}
|
||||||
|
Canvas.Pen.Color := clBlack;
|
||||||
|
{$ENDIF}
|
||||||
Canvas.Moveto(0, 0);
|
Canvas.Moveto(0, 0);
|
||||||
Canvas.LineTo(Width - 1, 0);
|
Canvas.LineTo(Width - 1, 0);
|
||||||
Canvas.LineTo(Width - 1, Height - 1);
|
Canvas.LineTo(Width - 1, Height - 1);
|
||||||
|
@ -1811,7 +1811,7 @@ begin
|
|||||||
BeginDrag(false);
|
BeginDrag(false);
|
||||||
end;
|
end;
|
||||||
end else if (ssLeft in Shift) and MouseCapture then begin
|
end else if (ssLeft in Shift) and MouseCapture then begin
|
||||||
//writeln('AAA TCustomSynEdit.MouseMove CAPTURE Mouse=',X,',',Y,' Caret=',CaretX,',',CaretY,', BlockBegin=',BlockBegin.X,',',BlockBegin.Y,' BlockEnd=',BlockEnd.X,',',BlockEnd.Y,' Client=',ClientWidth-ScrollBarWidth,',',ClientHeight-ScrollBarWidth);
|
//writeln(' TCustomSynEdit.MouseMove CAPTURE Mouse=',X,',',Y,' Caret=',CaretX,',',CaretY,', BlockBegin=',BlockBegin.X,',',BlockBegin.Y,' BlockEnd=',BlockEnd.X,',',BlockEnd.Y,' Client=',ClientWidth-ScrollBarWidth,',',ClientHeight-ScrollBarWidth);
|
||||||
if (X >= fGutterWidth)
|
if (X >= fGutterWidth)
|
||||||
and (X < ClientWidth{$IFDEF SYN_LAZARUS}-ScrollBarWidth{$ENDIF})
|
and (X < ClientWidth{$IFDEF SYN_LAZARUS}-ScrollBarWidth{$ENDIF})
|
||||||
and (Y >= 0)
|
and (Y >= 0)
|
||||||
@ -3601,16 +3601,17 @@ end;
|
|||||||
|
|
||||||
procedure TCustomSynEdit.ShowCaret;
|
procedure TCustomSynEdit.ShowCaret;
|
||||||
begin
|
begin
|
||||||
|
//writeln(' [TCustomSynEdit.ShowCaret] ShowCaret ',Name,' ',sfCaretVisible in fStateFlags);
|
||||||
if not (eoNoCaret in Options) and not (sfCaretVisible in fStateFlags) then
|
if not (eoNoCaret in Options) and not (sfCaretVisible in fStateFlags) then
|
||||||
begin
|
begin
|
||||||
if {$IFDEF SYN_LAZARUS}LCLLinux{$ELSE}Windows{$ENDIF}.ShowCaret(Handle) then
|
|
||||||
begin
|
|
||||||
//writeln('[TCustomSynEdit.ShowCaret] A ',Name);
|
|
||||||
Include(fStateFlags, sfCaretVisible)
|
|
||||||
end;
|
|
||||||
{$IFDEF SYN_LAZARUS}
|
{$IFDEF SYN_LAZARUS}
|
||||||
SetCaretRespondToFocus(Handle,not (eoPersistentCaret in fOptions));
|
SetCaretRespondToFocus(Handle,not (eoPersistentCaret in fOptions));
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
if {$IFDEF SYN_LAZARUS}LCLLinux{$ELSE}Windows{$ENDIF}.ShowCaret(Handle) then
|
||||||
|
begin
|
||||||
|
//writeln('[TCustomSynEdit.ShowCaret] A ',Name);
|
||||||
|
Include(fStateFlags, sfCaretVisible);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -3637,10 +3638,10 @@ begin
|
|||||||
{$ELSE}
|
{$ELSE}
|
||||||
SetCaretPos(CX, CY);
|
SetCaretPos(CX, CY);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
//writeln('[TCustomSynEdit.UpdateCaret] ShowCaret ',Name);
|
//writeln(' [TCustomSynEdit.UpdateCaret] ShowCaret ',Name);
|
||||||
ShowCaret;
|
ShowCaret;
|
||||||
end else begin
|
end else begin
|
||||||
//writeln('[TCustomSynEdit.UpdateCaret] HideCaret ',Name);
|
//writeln(' [TCustomSynEdit.UpdateCaret] HideCaret ',Name);
|
||||||
HideCaret;
|
HideCaret;
|
||||||
{$IFDEF SYN_LAZARUS}
|
{$IFDEF SYN_LAZARUS}
|
||||||
SetCaretPosEx(Handle,CX, CY);
|
SetCaretPosEx(Handle,CX, CY);
|
||||||
|
@ -5082,7 +5082,7 @@ begin
|
|||||||
SaveCurCodeTemplate;
|
SaveCurCodeTemplate;
|
||||||
|
|
||||||
// save all values
|
// save all values
|
||||||
SynOptions:=PreviewEdits[1].Options;
|
SynOptions:=PreviewEdits[1].Options-[eoNoSelection,eoNoCaret];
|
||||||
if BracketHighlightCheckBox.Checked then
|
if BracketHighlightCheckBox.Checked then
|
||||||
Include(SynOptions,eoBracketHighlight)
|
Include(SynOptions,eoBracketHighlight)
|
||||||
else
|
else
|
||||||
|
@ -82,13 +82,26 @@ end;
|
|||||||
is used for the second part of the initialization of a widget.
|
is used for the second part of the initialization of a widget.
|
||||||
-------------------------------------------------------------------------------}
|
-------------------------------------------------------------------------------}
|
||||||
function GTKRealizeCB(Widget: PGtkWidget; Data: Pointer): GBoolean; cdecl;
|
function GTKRealizeCB(Widget: PGtkWidget; Data: Pointer): GBoolean; cdecl;
|
||||||
|
var
|
||||||
|
WinWidgetInfo: PWinWidgetInfo;
|
||||||
begin
|
begin
|
||||||
EventTrace('realize', nil);
|
EventTrace('realize', nil);
|
||||||
// set extra signal masks after the widget window is created
|
// set extra signal masks after the widget window is created
|
||||||
// define extra events we're interrested in
|
// define extra events we're interrested in
|
||||||
|
WinWidgetInfo:=GetWidgetInfo(Widget,true);
|
||||||
gdk_window_set_events(Widget^.Window,
|
gdk_window_set_events(Widget^.Window,
|
||||||
gdk_window_get_events(Widget^.Window) or TGdkEventMask(Data));
|
gdk_window_get_events(Widget^.Window) or WinWidgetInfo^.EventMask);
|
||||||
|
|
||||||
|
if Data<>nil then begin
|
||||||
|
if TObject(Data) is TWinControl then begin
|
||||||
|
if TWinControl(Data) is TCustomForm then begin
|
||||||
|
if TCustomForm(Data).BorderStyle=bsNone then begin
|
||||||
|
gdk_window_set_decorations(Widget^.Window,0);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
Result := True;
|
Result := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1910,6 +1923,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.83 2002/06/09 14:00:41 lazarus
|
||||||
|
MG: fixed persistent caret and implemented Form.BorderStyle=bsNone
|
||||||
|
|
||||||
Revision 1.82 2002/06/09 07:08:43 lazarus
|
Revision 1.82 2002/06/09 07:08:43 lazarus
|
||||||
MG: fixed window jumping
|
MG: fixed window jumping
|
||||||
|
|
||||||
|
@ -109,6 +109,7 @@ type
|
|||||||
Style: Integer;
|
Style: Integer;
|
||||||
ExStyle: Integer;
|
ExStyle: Integer;
|
||||||
UserData: Integer;
|
UserData: Integer;
|
||||||
|
EventMask: TGdkEventMask;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// clipboard
|
// clipboard
|
||||||
@ -141,6 +142,9 @@ end.
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.9 2002/06/09 14:00:41 lazarus
|
||||||
|
MG: fixed persistent caret and implemented Form.BorderStyle=bsNone
|
||||||
|
|
||||||
Revision 1.8 2002/06/04 15:17:23 lazarus
|
Revision 1.8 2002/06/04 15:17:23 lazarus
|
||||||
MG: improved TFont for XLFD font names
|
MG: improved TFont for XLFD font names
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user