MG: changed except statements to more verbosity

git-svn-id: trunk@1590 -
This commit is contained in:
lazarus 2002-04-04 12:25:02 +00:00
parent 6fa1f13c18
commit 31798d03be
9 changed files with 83 additions and 42 deletions

View File

@ -184,7 +184,9 @@ type
const
TypeCompatibilityNames: array[TTypeCompatibility] of string = (
'Exact', 'Compatible', 'Incompatible'
'Exact',
'Compatible', // convertable, but not usable for var params
'Incompatible'
);
type

View File

@ -6341,7 +6341,7 @@ begin
{$IFDEF SYN_LAZARUS} - ScrollBarWidth{$ENDIF})
div fCharWidth);
fLinesInWindow := (ClientHeight {$IFDEF SYN_LAZARUS}-13{$ENDIF})
div fTextHeight;
div fTextHeight;
if bFont then begin
if Gutter.ShowLineNumbers then
GutterChanged(Self)

View File

@ -799,13 +799,13 @@ var
hOldFont: HFONT;
p: PheFontData;
begin
{$IFDEF HE_ASSERT}
{$IFDEF HE_ASSERT}
ASSERT(SizeOf(TFontStyles) = 1,
'TheTextDrawer.SetStyle: There''s more than four font styles but the current '+
'code expects only four styles.');
{$ELSE}
{$ELSE}
ASSERT(SizeOf(TFontStyles) = 1);
{$ENDIF}
{$ENDIF}
idx := PByte(@Value)^;
ASSERT(idx <= High(TheStockFontPatterns));

View File

@ -257,6 +257,7 @@ function TClipboard.GetComponent(Owner, Parent: TComponent): TComponent;
var
MemStream: TMemoryStream;
Reader: TReader;
ok: boolean;
begin
Result := nil;
MemStream:=TMemoryStream.Create;
@ -267,11 +268,12 @@ begin
try
Reader.Parent := Parent;
Result := Reader.ReadRootComponent(nil);
ok:=false;
try
Owner.InsertComponent(Result);
except
Result.Free;
raise;
ok:=true;
finally
if not ok then Result.Free;
end;
finally
Reader.Free;
@ -594,6 +596,9 @@ end;
{
$Log$
Revision 1.8 2002/04/04 12:25:01 lazarus
MG: changed except statements to more verbosity
Revision 1.7 2002/03/11 23:22:46 lazarus
MG: added TPicture clipboard support

View File

@ -388,6 +388,7 @@ procedure TPicture.LoadFromClipboardFormat(FormatID: TClipboardFormat);
var
NewGraphic: TGraphic;
GraphicClass: TGraphicClass;
ok: boolean;
begin
GraphicClass := PicClipboardFormats.FindFormat(FormatID);
if GraphicClass = nil then
@ -395,12 +396,13 @@ begin
+ClipboardFormatToMimeType(FormatID));
NewGraphic := GraphicClass.Create;
ok:=false;
try
NewGraphic.OnProgress := @Progress;
NewGraphic.LoadFromClipboardFormat(FormatID);
except
NewGraphic.Free;
raise;
ok:=true;
finally
if not ok then NewGraphic.Free;
end;
FGraphic.Free;
FGraphic := NewGraphic;

View File

@ -545,7 +545,10 @@ begin
if MenuExist
then Rect.Top := Rect.Top + 25;
except
Result := False;
on E: Exception do begin
writeln('AdjustWindowRectEx: ',E.Message);
Result := False;
end;
end;
end;
@ -967,15 +970,18 @@ Function SetRect(var Rect : TRect; xLeft,yTop,xRight,yBottom : Integer) : Boolea
Begin
Result := True;
try
with Rect do
begin
Left := xLeft;
Top := yTop;
Right := xRight;
Bottom := yBottom;
end;
with Rect do
begin
Left := xLeft;
Top := yTop;
Right := xRight;
Bottom := yBottom;
end;
except
Result := False;
on E: Exception do begin
writeln('AdjustWindowRectEx: ',E.Message);
Result := False;
end;
End;
End;
@ -1050,20 +1056,25 @@ function UnionRect(var lprcDst: TRect; const lprcSrc1, lprcSrc2: TRect): Boolean
begin
Result := True;
try
lprcDst.Left := Min(lprcSrc1.Left, lprcSrc2.Left);
lprcDst.Top := Min(lprcSrc1.Top, lprcSrc2.Top);
lprcDst.Right := Max(lprcSrc1.Right, lprcSrc2.Right);
lprcDst.Bottom := Max(lprcSrc1.Bottom, lprcSrc2.Bottom);
lprcDst.Left := Min(lprcSrc1.Left, lprcSrc2.Left);
lprcDst.Top := Min(lprcSrc1.Top, lprcSrc2.Top);
lprcDst.Right := Max(lprcSrc1.Right, lprcSrc2.Right);
lprcDst.Bottom := Max(lprcSrc1.Bottom, lprcSrc2.Bottom);
except
Result := False;
on E: Exception do begin
writeln('AdjustWindowRectEx: ',E.Message);
Result := False;
end;
end;
end;
//##apiwiz##epi## // Do not remove
{ =============================================================================
$Log$
Revision 1.27 2002/04/04 12:25:01 lazarus
MG: changed except statements to more verbosity
Revision 1.26 2002/03/11 23:22:46 lazarus
MG: added TPicture clipboard support

View File

@ -185,10 +185,8 @@ var
KeyCode: Word;
Flags: Integer;
Toggle, Extended, SysKey: Boolean;
ShiftState: TShiftState;
begin
GetGTKKeyInfo(Event, KeyCode, Msg.CharCode, SysKey, Extended, Toggle);
ShiftState := GTKEventState2ShiftState(Event^.State);
// Assert(False, Format('Trace:[GTKKeyUpDown] Type: %3:d, GTK: 0x%0:x(%0:d) LCL: 0x%1:x(%1:d) VK: 0x%2:x(%2:d)', [Event^.keyval, KeyCode, Msg.CharCode, Event^.theType]));
Flags := 0;
@ -1613,6 +1611,9 @@ end;
{ =============================================================================
$Log$
Revision 1.68 2002/04/04 12:25:02 lazarus
MG: changed except statements to more verbosity
Revision 1.67 2002/03/31 22:01:37 lazarus
MG: fixed unreleased/unpressed Ctrl/Alt/Shift

View File

@ -220,13 +220,15 @@ end;
Function TGTKObject.BringWindowToTop(hWnd : HWND): Boolean;
begin
//hwnd should be a PgtkWidget.
result := True;
Result := True;
try
gdk_window_raise(PgtkWidget(hwnd)^.window);
except
Result := False;
on E: Exception do begin
writeln('TGTKObject.BringWindowToTop: ',E.Message);
Result := False;
end;
end;
end;
{------------------------------------------------------------------------------
@ -1925,14 +1927,17 @@ begin
if Handle = 0 then Exit;
Result := False;
Try
Rect.Left := 0;
Rect.Top := 0;
gtk_Widget_size_request(PgtkWidget(handle),@requisition);
Rect.Right := requisition.width;
Rect.Bottom := requisition.Height;
Rect.Left := 0;
Rect.Top := 0;
gtk_Widget_size_request(PgtkWidget(handle),@requisition);
Rect.Right := requisition.width;
Rect.Bottom := requisition.Height;
// Writeln('Width / Height = '+Inttostr(REct.Right)+'/'+Inttostr(Rect.Bottom));
except
Result := False;
on E: Exception do begin
writeln('TGTKObject.GetClientRect: ',E.Message);
Result := False;
end;
end;
end;
@ -2814,7 +2819,10 @@ begin
gtk_widget_draw(PgtkWidget(aHandle), @gdkRect);
except
Result := False;
on E: Exception do begin
writeln('TGTKObject.InvalidateRect: ',E.Message);
Result := False;
end;
end;
end;
@ -3352,8 +3360,11 @@ begin
if pDC^.GC <> nil then
gdk_gc_unref(pDC^.GC);
except
on Exception do; //Nothing, just try to unref it
//(it segfaults if the window doesnt exist anymore :-)
on E:Exception do begin
//Nothing, just try to unref it
//(it segfaults if the window doesnt exist anymore :-)
writeln('TgtkObject.ReleaseDC: ',E.Message);
end;
end;
FDeviceContexts.Remove(pDC);
Dispose(pDC);
@ -4383,6 +4394,9 @@ end;
{ =============================================================================
$Log$
Revision 1.64 2002/04/04 12:25:02 lazarus
MG: changed except statements to more verbosity
Revision 1.63 2002/03/31 22:01:38 lazarus
MG: fixed unreleased/unpressed Ctrl/Alt/Shift

View File

@ -187,7 +187,10 @@ begin
LFMFileStream.Free;
end;
except
Result:=false;
on E: Exception do begin
writeln('LFMtoLFCfile ',E.Message);
Result:=false;
end;
end;
end;
@ -209,7 +212,10 @@ begin
BinStream.Free;
end;
except
Result:=false;
on E: Exception do begin
writeln('LFMtoLFCstream ',E.Message);
Result:=false;
end;
end;
end;