synedit: added checks if handle is allocated

git-svn-id: trunk@21398 -
This commit is contained in:
mattias 2009-08-22 19:33:35 +00:00
parent 766a2fcfb4
commit b03dbf338e
5 changed files with 40 additions and 24 deletions

View File

@ -722,13 +722,17 @@ var
begin begin
if not Enabled then exit; if not Enabled then exit;
if FGlyphLastLine <> -2 then begin if FGlyphLastLine <> -2 then begin
rcInval := GetGutterGlyphRect(FGlyphLastLine); if SynEdit.HandleAllocated then begin
rcInval := GetGutterGlyphRect(FGlyphLastLine);
InvalidateRect(SynEdit.Handle, @rcInval, False);
end;
end;
if SynEdit.HandleAllocated then begin
rcInval := GetGutterGlyphRect;
// and make sure we trigger the Markup // TODO: triigger markup on gutter paint too
rcInval.Right := Max(rcInval.Right, TSynEdit(SynEdit).GutterWidth + 2);
InvalidateRect(SynEdit.Handle, @rcInval, False); InvalidateRect(SynEdit.Handle, @rcInval, False);
end; end;
rcInval := GetGutterGlyphRect;
// and make sure we trigger the Markup // TODO: triigger markup on gutter paint too
rcInval.Right := Max(rcInval.Right, TSynEdit(SynEdit).GutterWidth + 2);
InvalidateRect(SynEdit.Handle, @rcInval, False);
end; end;
procedure TSynPluginSyncroEditMarkup.DoCaretChanged(Sender: TObject); procedure TSynPluginSyncroEditMarkup.DoCaretChanged(Sender: TObject);
@ -744,8 +748,10 @@ begin
inherited DoTopLineChanged(OldTopLine); inherited DoTopLineChanged(OldTopLine);
// Glyph may have drawn up to one Line above // Glyph may have drawn up to one Line above
if FGlyphLastLine > 1 then begin if FGlyphLastLine > 1 then begin
rcInval := GetGutterGlyphRect(FGlyphLastLine - 1); if SynEdit.HandleAllocated then begin
InvalidateRect(SynEdit.Handle, @rcInval, False); rcInval := GetGutterGlyphRect(FGlyphLastLine - 1);
InvalidateRect(SynEdit.Handle, @rcInval, False);
end;
end; end;
DoInvalidate; DoInvalidate;
end; end;
@ -763,8 +769,10 @@ begin
inherited DoEnabledChanged(Sender); inherited DoEnabledChanged(Sender);
if not Enabled then begin if not Enabled then begin
if FGlyphLastLine <> -2 then begin if FGlyphLastLine <> -2 then begin
rcInval := GetGutterGlyphRect(FGlyphLastLine); if SynEdit.HandleAllocated then begin
InvalidateRect(SynEdit.Handle, @rcInval, False); rcInval := GetGutterGlyphRect(FGlyphLastLine);
InvalidateRect(SynEdit.Handle, @rcInval, False);
end;
end; end;
FGlyphLastLine := -2; FGlyphLastLine := -2;
end end

View File

@ -19,9 +19,11 @@
*************************************************************************** ***************************************************************************
} }
// !!! if you change any of these flags, you have to make cleanide !!!
{$inline on}
{ $DEFINE IDE_VERBOSE} { $DEFINE IDE_VERBOSE}
// !!! if you change any of these flags, you have to make cleanide !!!
{ $DEFINE IDE_MEM_CHECK} { $DEFINE IDE_MEM_CHECK}
{ $DEFINE IDE_DEBUG} { $DEFINE IDE_DEBUG}
@ -44,8 +46,17 @@
{ $DEFINE VerboseJITForms} { $DEFINE VerboseJITForms}
{ $DEFINE VerboseFormEditor} { $DEFINE VerboseFormEditor}
// TODO: Test on all platforms
{$inline on} {$IFNDEF DisableAsyncProcess}
{$IFDEF Linux}
{$IFDEF CPUI386}
{off $DEFINE UseAsyncProcess}
{$ENDIF}
{$ENDIF}
{$IFDEF windows}
{$DEFINE UseAsyncProcess}
{$ENDIF}
{$ENDIF}
// end. // end.

View File

@ -52,18 +52,6 @@ unit Main;
interface interface
// TODO: Test on all platforms
{$IFNDEF DisableAsyncProcess}
{$IFDEF Linux}
{$IFDEF CPUI386}
{off $DEFINE UseAsyncProcess}
{$ENDIF}
{$ENDIF}
{$IFDEF windows}
{$DEFINE UseAsyncProcess}
{$ENDIF}
{$ENDIF}
{$I ide.inc} {$I ide.inc}
uses uses

View File

@ -107,6 +107,7 @@ procedure TAsyncProcess.Execute;
begin begin
inherited Execute; inherited Execute;
writeln('TAsyncProcess.Execute ',poUsePipes in Options);
if poUsePipes in Options then if poUsePipes in Options then
FPipeHandler := AddPipeEventHandler(Output.Handle, @HandlePipeInput, 0); FPipeHandler := AddPipeEventHandler(Output.Handle, @HandlePipeInput, 0);
FProcessHandler := AddProcessEventHandler(ProcessHandle, @HandleProcessTermination, 0); FProcessHandler := AddProcessEventHandler(ProcessHandle, @HandleProcessTermination, 0);

View File

@ -573,6 +573,10 @@ end;
{$ifdef Unix} {$ifdef Unix}
procedure TGtkWidgetSet.PrepareSynchronize(AObject: TObject); procedure TGtkWidgetSet.PrepareSynchronize(AObject: TObject);
{ This method is the WakeMainThread of the unit classes.
It is called in TThread.Synchronize to wake up the main thread = LCL GUI thread.
see: TGtkWidgetSet.InitSynchronizeSupport
}
var var
thrash: char; thrash: char;
begin begin
@ -638,6 +642,10 @@ begin
end; end;
procedure TGtkWidgetSet.InitSynchronizeSupport; procedure TGtkWidgetSet.InitSynchronizeSupport;
{ When a thread calls its Synchronize, it calls
WakeMainThread (defined in the unit classes).
Set
}
begin begin
{ TThread.Synchronize ``glue'' } { TThread.Synchronize ``glue'' }
WakeMainThread := @PrepareSynchronize; WakeMainThread := @PrepareSynchronize;