splitted IDE component owner hierachy to reduce notification time

git-svn-id: trunk@5825 -
This commit is contained in:
mattias 2004-08-19 18:50:53 +00:00
parent 8385cd34da
commit c94cfaf9ac
4 changed files with 106 additions and 73 deletions

View File

@ -928,11 +928,11 @@ begin
ConnectMainBarEvents;
// initialize the other IDE managers
DebugBoss:=TDebugManager.Create(Self);
DebugBoss:=TDebugManager.Create(nil);
DebugBoss.ConnectMainBarEvents;
PkgBoss:=TPkgManager.Create(Self);
PkgBoss:=TPkgManager.Create(nil);
PkgBoss.ConnectMainBarEvents;
HelpBoss:=THelpManager.Create(Self);
HelpBoss:=THelpManager.Create(nil);
HelpBoss.ConnectMainBarEvents;
// setup the IDE components
LoadMenuShortCuts;
@ -994,9 +994,11 @@ begin
// free IDE parts
FreeFormEditor;
FreeThenNil(ObjectInspector1);
FreeThenNil(GlobalDesignHook);
FreeThenNil(PkgBoss);
FreeThenNil(HelpBoss);
FreeThenNil(GlobalDesignHook);
FreeThenNil(DebugBoss);
FreeThenNil(TheCompiler);
FreeThenNil(HiddenWindowsOnRun);
FreeThenNil(TheOutputFilter);
@ -1010,6 +1012,7 @@ begin
writeln('[TMainIDE.Destroy] B -> inherited Destroy...');
{$IFDEF IDE_MEM_CHECK}CheckHeapWrtMemCnt('TMainIDE.Destroy B ');{$ENDIF}
FreeThenNil(SourceNotebook);
inherited Destroy;
{$IFDEF IDE_MEM_CHECK}CheckHeapWrtMemCnt('TMainIDE.Destroy C ');{$ENDIF}
writeln('[TMainIDE.Destroy] END');
@ -1137,7 +1140,7 @@ procedure TMainIDE.SetupSpeedButtons;
var ALeft, ATop: Integer; const AMoveFlags: TMoveFlags;
const AOnClick: TNotifyEvent; const AHint : String): TSpeedButton;
begin
Result := TSpeedButton.Create(Self);
Result := TSpeedButton.Create(OwningComponent);
with Result do
begin
Name := AName;
@ -1159,7 +1162,7 @@ procedure TMainIDE.SetupSpeedButtons;
var
ButtonTop, ButtonLeft, n: Integer;
begin
MainIDEBar.pnlSpeedButtons := TPanel.Create(Self);
MainIDEBar.pnlSpeedButtons := TPanel.Create(OwningComponent);
with MainIDEBar.pnlSpeedButtons do begin
Name := 'pnlSpeedButtons';
Parent:= MainIDEBar;
@ -1205,7 +1208,7 @@ begin
// create the popupmenu for the OpenFileArrowSpeedBtn
MainIDEBar.OpenFilePopUpMenu := TPopupMenu.Create(self);
MainIDEBar.OpenFilePopUpMenu := TPopupMenu.Create(OwningComponent);
MainIDEBar.OpenFilePopupMenu.Name:='OpenFilePopupMenu';
MainIDEBar.OpenFilePopupMenu.AutoPopup := False;
end;
@ -1213,7 +1216,7 @@ end;
procedure TMainIDE.SetupComponentNoteBook;
begin
// Component Notebook
MainIDEBar.ComponentNotebook := TNotebook.Create(Self);
MainIDEBar.ComponentNotebook := TNotebook.Create(OwningComponent);
with MainIDEBar.ComponentNotebook do begin
Parent := MainIDEBar;
Name := 'ComponentNotebook';
@ -1256,7 +1259,7 @@ end;
procedure TMainIDE.SetupObjectInspector;
begin
ObjectInspector1 := TObjectInspector.Create(Self);
ObjectInspector1 := TObjectInspector.Create(OwningComponent);
ObjectInspector1.OnSelectPersistentsInOI:=@OIOnSelectPersistents;
ObjectInspector1.OnShowOptions:=@OIOnShowOptions;
ObjectInspector1.OnRemainingKeyUp:=@OIRemainingKeyUp;
@ -1297,7 +1300,7 @@ end;
procedure TMainIDE.SetupSourceNotebook;
begin
SourceNotebook := TSourceNotebook.Create(Self);
SourceNotebook := TSourceNotebook.Create(OwningComponent);
SourceNotebook.OnActivate := @OnSrcNoteBookActivated;
SourceNotebook.OnAddJumpPoint := @OnSrcNoteBookAddJumpPoint;
SourceNotebook.OnCloseClicked := @OnSrcNotebookFileClose;
@ -2135,7 +2138,7 @@ var
if MainIDEBar.OpenFilePopupMenu.Items.Count>CurIndex then
AMenuItem:=MainIDEBar.OpenFilePopupMenu.Items[CurIndex]
else begin
AMenuItem:=TMenuItem.Create(Self);
AMenuItem:=TMenuItem.Create(OwningComponent);
AMenuItem.Name:=MainIDEBar.OpenFilePopupMenu.Name+'Recent'+IntToStr(CurIndex);
AMenuItem.OnClick:=@mnuOpenFilePopupClick;
MainIDEBar.OpenFilePopupMenu.Items.Add(AMenuItem);
@ -4946,7 +4949,7 @@ var
ALayout: TIDEWindowLayout;
begin
if UnitDependenciesView=nil then begin
UnitDependenciesView:=TUnitDependenciesView.Create(Self);
UnitDependenciesView:=TUnitDependenciesView.Create(OwningComponent);
UnitDependenciesView.OnAccessingSources:=
@UnitDependenciesViewAccessingSources;
UnitDependenciesView.OnGetProjectMainFilename:=
@ -4975,7 +4978,7 @@ end;
procedure TMainIDE.DoShowCodeExplorer;
begin
if CodeExplorerView=nil then begin
CodeExplorerView:=TCodeExplorerView.Create(Self);
CodeExplorerView:=TCodeExplorerView.Create(OwningComponent);
CodeExplorerView.OnGetCodeTree:=@OnCodeExplorerGetCodeTree;
CodeExplorerView.OnJumpToCode:=@OnCodeExplorerJumpToCode;
end;
@ -5621,7 +5624,7 @@ end;
function TMainIDE.DoShowProjectInspector: TModalResult;
begin
if ProjInspector=nil then begin
ProjInspector:=TProjectInspectorForm.Create(Self);
ProjInspector:=TProjectInspectorForm.Create(OwningComponent);
ProjInspector.OnOpen:=@ProjInspectorOpen;
ProjInspector.OnShowOptions:=@mnuProjectOptionsClicked;
ProjInspector.OnAddUnitToProject:=@ProjInspectorAddUnitToProject;
@ -5866,7 +5869,7 @@ end;
function TMainIDE.DoShowToDoList: TModalResult;
begin
if not Assigned(frmToDo) then begin
frmToDo:=TfrmToDo.Create(Self);
frmToDo:=TfrmToDo.Create(OwningComponent);
frmToDo.OnOpenFile:=@ViewProjectTodosOpenFile;
end;
@ -6445,7 +6448,7 @@ begin
Result:=GetIDEDirectives(ActiveUnitInfo,DirectiveList);
if Result<>mrOk then exit;
BuildFileDialog:=TBuildFileDialog.Create(Self);
BuildFileDialog:=TBuildFileDialog.Create(nil);
try
BuildFileDialog.DirectiveList:=DirectiveList;
BuildFileDialog.BuildFileIfActive:=ActiveUnitInfo.BuildFileIfActive;
@ -6517,7 +6520,7 @@ var
AFilename: string;
begin
Result:=mrOk;
OpenDialog:=TOpenDialog.Create(Self);
OpenDialog:=TOpenDialog.Create(nil);
try
InputHistories.ApplyFileDialogSettings(OpenDialog);
OpenDialog.Title:=lisSelectDFMFiles;
@ -6724,7 +6727,7 @@ var
inc(LastIndex);
ExistingCount:=LastIndex-FirstIndex;
while ExistingCount<ToolCount do begin
CurMenuItem := TMenuItem.Create(Self);
CurMenuItem := TMenuItem.Create(OwningComponent);
CurMenuItem.Name:='itmToolCustomExt'+IntToStr(ExistingCount);
CurMenuItem.Caption:=CurMenuItem.Name;
MainIDEBar.mnuTools.Insert(LastIndex,CurMenuItem);
@ -10582,6 +10585,9 @@ end.
{ =============================================================================
$Log$
Revision 1.755 2004/08/19 18:50:53 mattias
splitted IDE component owner hierachy to reduce notification time
Revision 1.754 2004/08/15 17:53:32 mattias
implemented endian independent object Text <-> Binary converter

View File

@ -80,6 +80,7 @@ type
CurrentParsedCompilerOption: TParsedCompilerOptions;
TheCompiler: TCompiler;
TheOutputFilter: TOutputFilter;
OwningComponent: TComponent;
function CreateMenuSeparator : TMenuItem;
procedure CreateMenuItem(MenuItemParent, MenuItem: TMenuItem;
@ -282,11 +283,15 @@ end;
constructor TMainIDEBase.Create(TheOwner: TComponent);
begin
MainIDE:=Self;
// Do not own everything in one big component hierachy. Otherwise the
// notifications slow down everything
OwningComponent:=TComponent.Create(nil);
inherited Create(TheOwner);
end;
destructor TMainIDEBase.Destroy;
begin
FreeThenNil(OwningComponent);
inherited Destroy;
MainIDE:=nil;
end;

View File

@ -1244,18 +1244,18 @@ var
if Context.WindowList=nil then
Context.WindowList:=TList.Create;
Context.WindowList.Add(PaintWindow);
BeginGDKErrorTrap;
{$IFDEF DebugGDK}BeginGDKErrorTrap;{$ENDIF}
if (not gdk_window_is_visible(PaintWindow))
or (not gdk_window_is_viewable(PaintWindow))
then begin
EndGDKErrorTrap;
{$IFDEF DebugGDK}EndGDKErrorTrap;{$ENDIF}
exit;
end;
// check if window belongs to another LCL control
gdk_window_get_user_data(PaintWindow,@UserData);
EndGDKErrorTrap;
{$IFDEF DebugGDK}EndGDKErrorTrap;{$ENDIF}
if (UserData<>nil)
and (GtkWidgetIsA(PGtkWidget(UserData), GTK_TYPE_WIDGET))
@ -1669,7 +1669,7 @@ begin
p:=nil; // automatically create transparency mask
Window:=nil; // use the X root window for colormap
BeginGDKErrorTrap;
{$IFDEF DebugGDK}BeginGDKErrorTrap;{$ENDIF}
if Window<>nil then
ColorMap:=gdk_window_get_colormap(Window)
@ -1695,7 +1695,7 @@ begin
gdk_visual_ref(GdiObject^.Visual);
GdiObject^.Colormap := gdk_colormap_new(GdiObject^.Visual, GdkTrue);
EndGDKErrorTrap;
{$IFDEF DebugGDK}EndGDKErrorTrap;{$ENDIF}
TheBitmap.Handle := HBITMAP(GdiObject);
If GdiObject^.GDIBitmapMaskObject <> nil then
@ -1732,7 +1732,7 @@ var
PGDIObject(TMP)^.GDIBitmapMaskObject,
0);
BeginGDKErrorTrap;
{$IFDEF DebugGDK}BeginGDKErrorTrap;{$ENDIF}
Depth := gdk_drawable_get_depth(PGDIObject(TMP)^.GDIPixmapObject);
If PGDIObject(TMP)^.Visual <> nil then
@ -1750,7 +1750,7 @@ var
PGDIObject(TMP)^.Colormap :=
gdk_colormap_new(PGDIObject(TMP)^.Visual, GdkTrue);
EndGDKErrorTrap;
{$IFDEF DebugGDK}EndGDKErrorTrap;{$ENDIF}
TheBitmap.Handle := TMP;
GDK_Pixbuf_Unref(Src);
Result := True;
@ -1832,7 +1832,7 @@ Type
exit;
With PGDIObject(Bitmap)^ do begin
BeginGDKErrorTrap;
{$IFDEF DebugGDK}BeginGDKErrorTrap;{$ENDIF}
gdk_pixbuf_render_pixmap_and_mask(Src,
GDIPixmapObject,
GDIBitmapMaskObject,
@ -1855,7 +1855,7 @@ Type
Colormap := gdk_colormap_new(Visual, GdkTrue);
EndGDKErrorTrap;
{$IFDEF DebugGDK}EndGDKErrorTrap;{$ENDIF}
GDK_Pixbuf_Unref(Src);
end;
@ -1912,7 +1912,7 @@ var
rowstride := gdk_pixbuf_get_rowstride(Source);
Pixels := PByte(gdk_pixbuf_get_pixels(Source));
{$else}
BeginGDKErrorTrap;
{$IFDEF DebugGDK}BeginGDKErrorTrap;{$ENDIF}
Source := gdk_image_get(Bitmap^.GDIBitmapObject, 0, StartScan, Width,
StartScan + NumScans);
{$EndIf}
@ -1925,7 +1925,7 @@ var
rowstride := gdk_pixbuf_get_rowstride(Source);
Pixels := PByte(gdk_pixbuf_get_pixels(Source));
{$else}
BeginGDKErrorTrap;
{$IFDEF DebugGDK}BeginGDKErrorTrap;{$ENDIF}
Source := gdk_image_get(Bitmap^.GDIPixmapObject, StartScan, 0, Width,
StartScan + NumScans);
{$EndIf}
@ -1956,7 +1956,7 @@ var
begin
Pixel := 0;
BeginGDKErrorTrap;
{$IFDEF DebugGDK}BeginGDKErrorTrap;{$ENDIF}
Pixel := gdk_image_get_pixel(Source, X, Y);
@ -1969,7 +1969,7 @@ var
{$IfNDef NoGDKPixbuflib}
GDK_Pixbuf_Unref(Source);
{$else}
BeginGDKErrorTrap;
{$IFDEF DebugGDK}BeginGDKErrorTrap;{$ENDIF}
gdk_image_destroy(Source);
{$EndIf}
end;
@ -2078,7 +2078,7 @@ begin
end
else
DebugLn('WARNING: [TGtkWidgetSet.InternalGetDIBits] invalid Bitmap!');
EndGDKErrorTrap;
{$IFDEF DebugGDK}EndGDKErrorTrap;{$ENDIF}
end;
function TGtkWidgetSet.GetWindowRawImageDescription(GDKWindow: PGdkWindow;
@ -2642,10 +2642,10 @@ var
NewClipMask);
// draw image
BeginGDKErrorTrap;
{$IFDEF DebugGDK}BeginGDKErrorTrap;{$ENDIF}
gdk_window_copy_area(DestDevContext.Drawable, DestDevContext.GC, X, Y,
SrcPixmap, XSrc, YSrc, SrcWidth, SrcHeight);
EndGDKErrorTrap;
{$IFDEF DebugGDK}EndGDKErrorTrap;{$ENDIF}
// unset clipping mask for transparency
ResetClipping(DestDevContext.GC);
@ -5961,15 +5961,11 @@ begin
//drag icons
if Drag_Icon = nil then begin
{$IFDEF DebugGDKTraps}
BeginGDKErrorTrap;
{$ENDIF}
{$IFDEF DebugGDK}BeginGDKErrorTrap;{$ENDIF}
Drag_Icon := gdk_pixmap_colormap_create_from_xpm_d (nil,
gtk_widget_get_colormap (Result), Drag_Mask,
nil, @IMGDrag_Icon);
{$IFDEF DebugGDKTraps}
EndGDKErrorTrap;
{$ENDIF}
{$IFDEF DebugGDK}EndGDKErrorTrap;{$ENDIF}
end;
end else begin
// create a form as child control
@ -6496,12 +6492,12 @@ begin
TCustomForm(Sender).BorderStyle := bsNone;
gtk_widget_realize(p);
AWindow:=GetControlWindow(P);
BeginGDKErrorTrap;
{$IFDEF DebugGDK}BeginGDKErrorTrap;{$ENDIF}
gdk_window_set_decorations(AWindow,
GetWindowDecorations(TCustomForm(Sender)));
gdk_window_set_functions(AWindow,
GetWindowFunction(TCustomForm(Sender)));
EndGDKErrorTrap;
{$IFDEF DebugGDK}EndGDKErrorTrap;{$ENDIF}
gtk_widget_show_all(p);
end;
@ -7002,9 +6998,9 @@ begin
on e: Exception do
DebugLn('WARNING: TGtkWidgetSet.LoadXPMFromLazResource: '+e.Message);
end;
BeginGDKErrorTrap;
{$IFDEF DebugGDK}BeginGDKErrorTrap;{$ENDIF}
PixmapImg:=gdk_pixmap_create_from_xpm_d(Window,PixmapMask,nil,ImgData);
EndGDKErrorTrap;
{$IFDEF DebugGDK}EndGDKErrorTrap;{$ENDIF}
FreeMem(ImgData);
end;
@ -7029,9 +7025,9 @@ begin
on e: Exception do
DebugLn('WARNING: TGtkWidgetSet.LoadXPMFromLazResource: '+e.Message);
end;
BeginGDKErrorTrap;
{$IFDEF DebugGDK}BeginGDKErrorTrap;{$ENDIF}
pixbuf:=gdk_pixbuf_new_from_xpm_data(ImgData);
EndGDKErrorTrap;
{$IFDEF DebugGDK}EndGDKErrorTrap;{$ENDIF}
FreeMem(ImgData);
end;
{$EndIF}
@ -7428,7 +7424,7 @@ begin
//gc := gdk_gc_new(PgdkWindow(fWindow));
if fWindow<>nil then begin
BeginGDKErrorTrap;
{$IFDEF DebugGDK}BeginGDKErrorTrap;{$ENDIF}
gdk_draw_pixmap(fwindow,
gtk_widget_get_style(widget)^.fg_gc[GTK_WIDGET_STATE (widget)],
pixmap,
@ -7436,7 +7432,7 @@ begin
0,0,
pgtkwidget(widget)^.allocation.width,
pgtkwidget(widget)^.allocation.height);
EndGDKErrorTrap;
{$IFDEF DebugGDK}EndGDKErrorTrap;{$ENDIF}
end;
end;
@ -7468,9 +7464,9 @@ begin
aDC.SelectedColors := dcscCustom;
GDKColor:=AllocGDKColor(TLMSetGetPixel(data^).PixColor);
gdk_gc_set_foreground(aDC.GC, @GDKColor);
BeginGDKErrorTrap;
{$IFDEF DebugGDK}BeginGDKErrorTrap;{$ENDIF}
gdk_draw_point(aDC.Drawable, aDC.GC, X,Y);
EndGDKErrorTrap;
{$IFDEF DebugGDK}EndGDKErrorTrap;{$ENDIF}
end;
{------------------------------------------------------------------------------
@ -9272,6 +9268,9 @@ end;
{ =============================================================================
$Log$
Revision 1.530 2004/08/19 18:50:53 mattias
splitted IDE component owner hierachy to reduce notification time
Revision 1.529 2004/08/18 20:49:02 mattias
simple forms can now be child controls

View File

@ -72,14 +72,10 @@ begin
DCOrigin:=GetDCOffset(TDeviceContext(DC));
inc(X,DCOrigin.X);
inc(Y,DCOrigin.Y);
{$IFDEF DebugGDKTraps}
BeginGDKErrorTrap;
{$ENDIF}
{$IFDEF DebugGDKTraps}BeginGDKErrorTrap;{$ENDIF}
gdk_draw_arc(Drawable, GC, 0, X, Y, Width, Height,
Angle1 shl 2, Angle2 shl 2);
{$IFDEF DebugGDKTraps}
EndGDKErrorTrap;
{$ENDIF}
{$IFDEF DebugGDKTraps}EndGDKErrorTrap;{$ENDIF}
end else
Result:=false;
end;
@ -2060,9 +2056,13 @@ begin
gtk_widget_set_usize(ComboWidget^.popwin,width ,height);
gtk_widget_realize(ComboWidget^.popwin);
{$IFDEF DebugGDKTraps}
BeginGDKErrorTrap;
{$ENDIF}
gdk_window_resize(ComboWidget^.popwin^.window,width,height);
{$IFDEF DebugGDKTraps}
EndGDKErrorTrap;
{$ENDIF}
gtk_widget_show (ComboWidget^.popwin);
gtk_widget_grab_focus(ComboWidget^.popwin);
@ -2957,7 +2957,9 @@ begin
SelectGDKBrushProps(DC);
DCOrigin:=GetDCOffset(TDeviceContext(DC));
{$IFDEF DebugGDKTraps}
BeginGDKErrorTrap;
{$ENDIF}
If not CurrentBrush^.IsNullBrush then
gdk_draw_arc(Drawable, GC, 1, x+DCOrigin.X, y+DCOrigin.Y, Width, Height,
@ -2974,7 +2976,9 @@ begin
end else
Result := False;
{$IFDEF DebugGDKTraps}
EndGDKErrorTrap;
{$ENDIF}
end;
end;
end;
@ -3076,9 +3080,13 @@ begin
RGN_AND,
RGN_DIFF:
begin
{$IFDEF DebugGDKTraps}
BeginGDKErrorTrap;
{$ENDIF}
GDK_Window_Get_Size(Drawable, @X, @Y);
{$IFDEF DebugGDKTraps}
EndGDKErrorTrap;
{$ENDIF}
Clip := CreateRectRGN(0,0,X,Y);
Tmp := CreateEmptyRegion;
Result := CombineRGN(Tmp, Clip, RGN, mode);
@ -3700,11 +3708,13 @@ begin
else DebugLn('[TGtkWidgetSet.GetCaretPos] got focusObject nil');
}
Assert(False, 'Trace:GetCaretPos');
{$IFDEF DebugGDKTraps}
BeginGDKErrorTrap;
{$ENDIF}
gdk_window_get_pointer(nil,@lpPoint.X,@lpPoint.y,@modmask);
{$IFDEF DebugGDKTraps}
EndGDKErrorTrap;
Assert(False, 'Trace:GetCaretPos');
{$ENDIF}
Result := True;
end;
@ -3897,9 +3907,13 @@ begin
begin
DCOrigin:=GetDCOffset(TDeviceContext(DC));
If Not IsValidGDIObject(ClipRegion) then begin
{$IFDEF DebugGDKTraps}
BeginGDKErrorTrap;
{$ENDIF}
gdk_window_get_size(Drawable, @X, @Y);
{$IFDEF DebugGDKTraps}
EndGDKErrorTrap;
{$ENDIF}
lpRect^ := Rect(-DCOrigin.X, -DCOrigin.Y, X-DCOrigin.X, Y-DCOrigin.Y);
Result := SIMPLEREGION;
end
@ -4080,7 +4094,9 @@ var
begin
Result := False;
{$IFDEF DebugGDKTraps}
BeginGDKErrorTrap;
{$ENDIF}
try
TopList := gdk_window_get_toplevels;
List := TopList;
@ -4103,7 +4119,7 @@ begin
then g_list_free(TopList);
finally
EndGDKErrorTrap;
{$IFDEF DebugGDKTraps}EndGDKErrorTrap;{$ENDIF}
end;
end;
{$ELSE}
@ -4346,7 +4362,9 @@ begin
// Default to 0
Result := 0;
{$IFDEF DebugGDKTraps}
BeginGDKErrorTrap;
{$ENDIF}
TopList := gdk_window_get_toplevels;
List := TopList;
@ -4372,7 +4390,7 @@ begin
if TopList <> nil
then g_list_free(TopList);
EndGDKErrorTrap;
{$IFDEF DebugGDKTraps}EndGDKErrorTrap;{$ENDIF}
end;
{------------------------------------------------------------------------------
@ -4533,7 +4551,9 @@ begin
{dsBitfields: array[0..2] of DWORD;
dshSection: THandle;
dsOffset: DWORD;}
{$IFDEF DebugGDKTraps}
BeginGDKErrorTrap;
{$ENDIF}
case GDIBitmapType of
gbBitmap:
If GDIBitmapObject <> nil then begin
@ -4566,7 +4586,7 @@ begin
end else
biBitCount := Visual^.Depth;
EndGDKErrorTrap;
{$IFDEF DebugGDKTraps}EndGDKErrorTrap;{$ENDIF}
If biBitCount < 16 then
NumColors := Colormap^.Size;
@ -6261,7 +6281,7 @@ begin
// first draw interior in brush color
SelectGDKBrushProps(DC);
BeginGDKErrorTrap;
{$IFDEF DebugGDK}BeginGDKErrorTrap;{$ENDIF}
If not CurrentBrush^.IsNullBrush then
if Winding then begin
@ -6293,7 +6313,7 @@ begin
end else
Result:=false;
EndGDKErrorTrap;
{$IFDEF DebugGDKTraps}EndGDKErrorTrap;{$ENDIF}
FreeMem(PointArray);
@ -6331,9 +6351,9 @@ begin
If (dcfPenSelected in DCFlags) then begin
Result := True;
if (not CurrentPen^.IsNullPen) then begin
BeginGDKErrorTrap;
{$IFDEF DebugGDK}BeginGDKErrorTrap;{$ENDIF}
gdk_draw_lines(Drawable, GC, PointArray, NumPts);
EndGDKErrorTrap;
{$IFDEF DebugGDKTraps}EndGDKErrorTrap;{$ENDIF}
end;
end else
Result:=false;
@ -6593,7 +6613,7 @@ begin
// first draw interior in brush color
SelectGDKBrushProps(DC);
DCOrigin:=GetDCOffset(TDeviceContext(DC));
BeginGDKErrorTrap;
{$IFDEF DebugGDK}BeginGDKErrorTrap;{$ENDIF}
If not CurrentBrush^.IsNullBrush then
if (CurrentBrush^.GDIBrushFill = GDK_SOLID)
and (IsBackgroundColor(TColor(CurrentBrush^.GDIBrushColor.ColorRef))) then
@ -6613,7 +6633,7 @@ begin
end else
Result:=false;
EndGDKErrorTrap;
{$IFDEF DebugGDKTraps}EndGDKErrorTrap;{$ENDIF}
end;
end;
Assert(False, Format('trace:< [TGtkWidgetSet.Rectangle] DC:0x%x, X1:%d, Y1:%d, X2:%d, Y2:%d', [DC, X1, Y1, X2, Y2]));
@ -7105,14 +7125,14 @@ Begin
end
else begin
Window:=GetControlWindow(Widget);
BeginGDKErrorTrap;
{$IFDEF DebugGDK}BeginGDKErrorTrap;{$ENDIF}
if Window<>nil then
gdk_window_get_origin(Window, @X, @Y)
else begin
X:=0;
Y:=0;
end;
EndGDKErrorTrap;
{$IFDEF DebugGDKTraps}EndGDKErrorTrap;{$ENDIF}
end;
end;
@ -8331,9 +8351,9 @@ begin
SW_SHOWNORMAL:
begin
BeginGDKErrorTrap;
{$IFDEF DebugGDK}BeginGDKErrorTrap;{$ENDIF}
gdk_window_show(PgtkWidget(GtkWindow)^.Window);
EndGDKErrorTrap;
{$IFDEF DebugGDKTraps}EndGDKErrorTrap;{$ENDIF}
end;
SW_MINIMIZE, SW_SHOWMAXIMIZED:
@ -8473,10 +8493,10 @@ begin
TxtPt.Y := Y + DCTextMetric.TextMetric.tmAscent;
{$EndIf}
SelectGDKTextProps(DC);
BeginGDKErrorTrap;
{$IFDEF DebugGDK}BeginGDKErrorTrap;{$ENDIF}
gdk_draw_text(Drawable, UseFont,
GC, TxtPt.X+DCOrigin.X, TxtPt.Y+DCOrigin.Y, Str, Count);
EndGDKErrorTrap;
{$IFDEF DebugGDKTraps}EndGDKErrorTrap;{$ENDIF}
If Underline or StrikeOut then begin
{Create & select pen of font color}
LogP.lopnStyle := PS_SOLID;
@ -8709,6 +8729,9 @@ end;
{ =============================================================================
$Log$
Revision 1.362 2004/08/19 18:50:53 mattias
splitted IDE component owner hierachy to reduce notification time
Revision 1.361 2004/08/18 20:49:03 mattias
simple forms can now be child controls