mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 11:19:26 +02:00
fixed a few more black colors
git-svn-id: trunk@4838 -
This commit is contained in:
parent
6e8632dd99
commit
4847e82ed3
@ -1262,8 +1262,9 @@ begin
|
||||
Add('program Project1;');
|
||||
Add('');
|
||||
Add('{$mode objfpc}{$H+}');
|
||||
if fProjectType in [ptApplication] then
|
||||
Add('{$AppType Gui} // for win32 applications');
|
||||
// This results in crashing programs, when stdout is not open
|
||||
//if fProjectType in [ptApplication] then
|
||||
// Add('{$AppType Gui} // for win32 applications');
|
||||
Add('');
|
||||
Add('uses');
|
||||
case fProjectType of
|
||||
@ -2738,6 +2739,9 @@ end.
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.141 2003/11/25 08:59:01 mattias
|
||||
fixed a few more black colors
|
||||
|
||||
Revision 1.140 2003/11/22 23:56:33 mattias
|
||||
fixed win32 intf menu height from Wojciech
|
||||
|
||||
|
@ -846,7 +846,7 @@ type
|
||||
Handle is interface dependent. }
|
||||
|
||||
TBitmapInternalStateFlag = (
|
||||
bmisCreateingCanvas
|
||||
bmisCreatingCanvas
|
||||
);
|
||||
TBitmapInternalState = set of TBitmapInternalStateFlag;
|
||||
|
||||
@ -897,7 +897,7 @@ type
|
||||
procedure SetWidth(NewWidth: Integer); override;
|
||||
procedure WriteData(Stream: TStream); override;
|
||||
procedure WriteStream(Stream: TStream; WriteSize: Boolean); virtual;
|
||||
procedure StoreOriginalStream(Stream: TStream); virtual;
|
||||
procedure StoreOriginalStream(Stream: TStream; Size: integer); virtual;
|
||||
{$IFDEF UseFPImage}
|
||||
procedure ReadStreamWithFPImage(Stream: TStream; Size: Longint;
|
||||
ReaderClass: TFPCustomImageReaderClass); virtual;
|
||||
@ -1257,6 +1257,9 @@ end.
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.98 2003/11/25 08:59:01 mattias
|
||||
fixed a few more black colors
|
||||
|
||||
Revision 1.97 2003/11/22 17:22:14 mattias
|
||||
moved TBevelCut to controls.pp
|
||||
|
||||
|
@ -128,14 +128,14 @@ end;
|
||||
|
||||
procedure TBitmap.CreateCanvas;
|
||||
begin
|
||||
if (FCanvas <> nil) or (bmisCreateingCanvas in FInternalState) then exit;
|
||||
Include(FInternalState,bmisCreateingCanvas);
|
||||
if (FCanvas <> nil) or (bmisCreatingCanvas in FInternalState) then exit;
|
||||
Include(FInternalState,bmisCreatingCanvas);
|
||||
try
|
||||
FCanvas := TBitmapCanvas.Create(Self);
|
||||
FCanvas.OnChange := @Changed;
|
||||
FCanvas.OnChanging := @Changing;
|
||||
finally
|
||||
Exclude(FInternalState,bmisCreateingCanvas);
|
||||
Exclude(FInternalState,bmisCreatingCanvas);
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -486,7 +486,7 @@ begin
|
||||
end;
|
||||
|
||||
// store original stream
|
||||
StoreOriginalStream(Stream);
|
||||
StoreOriginalStream(Stream,Size);
|
||||
MemStream:=FImage.SaveStream;
|
||||
|
||||
// determine stream type
|
||||
@ -684,19 +684,19 @@ begin
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
procedure TBitmap.StoreOriginalStream(Stream: TStream);
|
||||
procedure TBitmap.StoreOriginalStream(Stream: TStream; Size: integer);
|
||||
var
|
||||
MemStream: TMemoryStream;
|
||||
begin
|
||||
if Stream<>FImage.SaveStream then begin
|
||||
MemStream:=TMemoryStream.Create;
|
||||
MemStream.CopyFrom(Stream,Stream.Size-Stream.Position);
|
||||
MemStream.CopyFrom(Stream,Size);
|
||||
FreeAndNil(FImage.FSaveStream);
|
||||
FImage.SaveStream:=MemStream;
|
||||
end else
|
||||
MemStream:=FImage.SaveStream;
|
||||
FImage.SaveStreamType:=bnNone;
|
||||
MemStream.Position:=0;
|
||||
FImage.SaveStream.Position:=0;
|
||||
end;
|
||||
|
||||
{$IFDEF UseFPImage}
|
||||
@ -706,6 +706,7 @@ var
|
||||
IntfImg: TLazIntfImage;
|
||||
ImgReader: TFPCustomImageReader;
|
||||
ImgHandle, ImgMaskHandle: HBitmap;
|
||||
NewSaveStream: TMemoryStream;
|
||||
begin
|
||||
UnshareImage;
|
||||
if Size = 0 then begin
|
||||
@ -713,22 +714,29 @@ begin
|
||||
Height:=0;
|
||||
exit;
|
||||
end;
|
||||
StoreOriginalStream(Stream);
|
||||
StoreOriginalStream(Stream,Size);
|
||||
|
||||
IntfImg:=nil;
|
||||
ImgReader:=nil;
|
||||
try
|
||||
// store save stream during reading
|
||||
NewSaveStream:=FImage.SaveStream;
|
||||
FImage.SaveStream:=nil;
|
||||
// read image
|
||||
IntfImg:=TLazIntfImage.Create(0,0);
|
||||
IntfImg.GetDescriptionFromDevice(0);
|
||||
ImgReader:=ReaderClass.Create;
|
||||
InitFPImageReader(ImgReader);
|
||||
FImage.SaveStream.Position:=0;
|
||||
IntfImg.LoadFromStream(FImage.SaveStream,ImgReader);
|
||||
NewSaveStream.Position:=0;
|
||||
IntfImg.LoadFromStream(NewSaveStream,ImgReader);
|
||||
FinalizeFPImageReader(ImgReader);
|
||||
IntfImg.CreateBitmap(ImgHandle,ImgMaskHandle);
|
||||
Handle:=ImgHandle;
|
||||
MaskHandle:=ImgMaskHandle;
|
||||
finally
|
||||
// restore save stream
|
||||
FImage.SaveStream:=NewSaveStream;
|
||||
// clean up
|
||||
IntfImg.Free;
|
||||
ImgReader.Free;
|
||||
end;
|
||||
@ -760,6 +768,7 @@ begin
|
||||
exit;
|
||||
end;
|
||||
|
||||
writeln('WriteStreamWithFPImage');
|
||||
// write image to temporary stream
|
||||
MemStream:=TMemoryStream.Create;
|
||||
IntfImg:=nil;
|
||||
@ -780,7 +789,7 @@ begin
|
||||
FImage.SaveStreamType:=bnNone;
|
||||
MemStream:=nil;
|
||||
// copy savestream to destination stream
|
||||
Stream.CopyFrom(FImage.SaveStream,FImage.SaveStream.Size);
|
||||
DoWriteOriginal;
|
||||
finally
|
||||
MemStream.Free;
|
||||
IntfImg.Free;
|
||||
@ -953,6 +962,9 @@ end;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.51 2003/11/25 08:59:01 mattias
|
||||
fixed a few more black colors
|
||||
|
||||
Revision 1.50 2003/11/23 14:09:45 mattias
|
||||
fixed mem leak thx to Vincent
|
||||
|
||||
|
@ -205,6 +205,7 @@ var
|
||||
TheWinControl: TWinControl;
|
||||
ClientWidget: PGtkWidget;
|
||||
MainWidget: PGtkWidget;
|
||||
ClientAreaStyle: PGtkStyle;
|
||||
begin
|
||||
{$ifdef GTK2}
|
||||
Result := False;
|
||||
@ -237,7 +238,7 @@ begin
|
||||
//if TheWinControl<>nil then write(' ',TheWinControl.Name,':',TheWinControl.ClassName,' ',HexStr(Cardinal(TheWinControl.Handle),8));
|
||||
//writeln(' Widget=',HexStr(Cardinal(Widget),8),' Fixed=',HexStr(Cardinal(GetFixedWidget(Widget)),8),' Main=',HexStr(Cardinal(GetMainWidget(Widget)),8));
|
||||
if (TheWinControl<>nil) then begin
|
||||
BeginGDKErrorTrap;
|
||||
{$IFDEF DebugGDK}BeginGDKErrorTrap;{$ENDIF}
|
||||
NewEventMask:=gdk_window_get_events(GetControlWindow(Widget))
|
||||
or WinWidgetInfo^.EventMask;
|
||||
gdk_window_set_events(GetControlWindow(Widget),NewEventMask);
|
||||
@ -248,7 +249,7 @@ begin
|
||||
gdk_window_set_events(GetControlWindow(ClientWidget),NewEventMask);
|
||||
end;
|
||||
//writeln('BBB1 ',HexStr(Cardinal(NewEventMask),8),' ',HexStr(Cardinal(gdk_window_get_events(Widget^.Window)),8));
|
||||
EndGDKErrorTrap;
|
||||
{$IFDEF DebugGDK}EndGDKErrorTrap;{$ENDIF}
|
||||
end;
|
||||
|
||||
if TheWinControl<>nil then begin
|
||||
@ -3192,6 +3193,9 @@ end;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.205 2003/11/25 08:59:01 mattias
|
||||
fixed a few more black colors
|
||||
|
||||
Revision 1.204 2003/10/19 16:33:10 marc
|
||||
* Fixed VKey keypad handling
|
||||
|
||||
|
@ -4793,6 +4793,7 @@ var
|
||||
SysColor: TColorRef;
|
||||
BaseColor: TColorRef;
|
||||
Red, Green, Blue: byte;
|
||||
success: Boolean;
|
||||
begin
|
||||
BaseColor := Color and $FF;
|
||||
|
||||
@ -5041,11 +5042,23 @@ begin
|
||||
end;
|
||||
?????????????????}
|
||||
end;
|
||||
if (style <> nil) then
|
||||
if (style^.colormap <> nil) then
|
||||
gdk_colormap_query_color(style^.colormap,result.foreground.pixel, @result.foreground)
|
||||
else
|
||||
gdk_colormap_query_color(gdk_colormap_get_system(),result.foreground.pixel, @result.foreground)
|
||||
|
||||
if (result.foreground.pixel = 0) and ((result.foreground.red <> 0) or
|
||||
(result.foreground.blue <> 0) or (result.foreground.green <> 0)) then
|
||||
begin
|
||||
if (style <> nil) and (style^.colormap <> nil) then
|
||||
gdk_colormap_alloc_colors(style^.colormap, @result.foreground, 1,
|
||||
false, true, nil)
|
||||
else
|
||||
gdk_colormap_alloc_colors(gdk_colormap_get_system(),
|
||||
@result.foreground, 1, false, true, @success);
|
||||
end else
|
||||
if (style <> nil) and (style^.colormap <> nil) then
|
||||
gdk_colormap_query_color(style^.colormap,result.foreground.pixel,
|
||||
@result.foreground)
|
||||
else
|
||||
gdk_colormap_query_color(gdk_colormap_get_system(),
|
||||
result.foreground.pixel, @result.foreground);
|
||||
end;
|
||||
|
||||
Function StyleForegroundColor(Color : TColorRef; DefaultColor : PGDKColor): PGDKColor;
|
||||
@ -5601,6 +5614,9 @@ end;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.229 2003/11/25 08:59:01 mattias
|
||||
fixed a few more black colors
|
||||
|
||||
Revision 1.228 2003/11/23 13:13:35 mattias
|
||||
added clWindow for gtklistitem
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user