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
if not Enabled then exit;
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);
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;
procedure TSynPluginSyncroEditMarkup.DoCaretChanged(Sender: TObject);
@ -744,8 +748,10 @@ begin
inherited DoTopLineChanged(OldTopLine);
// Glyph may have drawn up to one Line above
if FGlyphLastLine > 1 then begin
rcInval := GetGutterGlyphRect(FGlyphLastLine - 1);
InvalidateRect(SynEdit.Handle, @rcInval, False);
if SynEdit.HandleAllocated then begin
rcInval := GetGutterGlyphRect(FGlyphLastLine - 1);
InvalidateRect(SynEdit.Handle, @rcInval, False);
end;
end;
DoInvalidate;
end;
@ -763,8 +769,10 @@ begin
inherited DoEnabledChanged(Sender);
if not Enabled then begin
if FGlyphLastLine <> -2 then begin
rcInval := GetGutterGlyphRect(FGlyphLastLine);
InvalidateRect(SynEdit.Handle, @rcInval, False);
if SynEdit.HandleAllocated then begin
rcInval := GetGutterGlyphRect(FGlyphLastLine);
InvalidateRect(SynEdit.Handle, @rcInval, False);
end;
end;
FGlyphLastLine := -2;
end

View File

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

View File

@ -52,18 +52,6 @@ unit Main;
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}
uses

View File

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

View File

@ -573,6 +573,10 @@ end;
{$ifdef Unix}
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
thrash: char;
begin
@ -638,6 +642,10 @@ begin
end;
procedure TGtkWidgetSet.InitSynchronizeSupport;
{ When a thread calls its Synchronize, it calls
WakeMainThread (defined in the unit classes).
Set
}
begin
{ TThread.Synchronize ``glue'' }
WakeMainThread := @PrepareSynchronize;