buggy thumbnails disabled

This commit is contained in:
zueuk 2010-11-14 10:51:00 +00:00
parent f5b08f3dbc
commit 3bf008e6a3
2 changed files with 40 additions and 36 deletions

View File

@ -31,7 +31,7 @@ object MainForm: TMainForm
Left = 137 Left = 137
Top = 28 Top = 28
Width = 4 Width = 4
Height = 436 Height = 430
end end
object ToolBar: TToolBar object ToolBar: TToolBar
Left = 0 Left = 0
@ -332,7 +332,7 @@ object MainForm: TMainForm
Left = 0 Left = 0
Top = 28 Top = 28
Width = 137 Width = 137
Height = 436 Height = 430
Align = alLeft Align = alLeft
BevelOuter = bvNone BevelOuter = bvNone
Columns = < Columns = <
@ -345,18 +345,19 @@ object MainForm: TMainForm
ParentShowHint = False ParentShowHint = False
PopupMenu = ListPopUp PopupMenu = ListPopUp
ShowHint = True ShowHint = True
SmallImages = SmallImages
TabOrder = 0 TabOrder = 0
ViewStyle = vsReport
OnChange = ListViewChange OnChange = ListViewChange
OnChanging = ListViewChanging OnChanging = ListViewChanging
OnEdited = ListViewEdited OnEdited = ListViewEdited
OnInfoTip = ListViewInfoTip
OnSelectItem = ListViewSelectItem OnSelectItem = ListViewSelectItem
end end
object BackPanel: TPanel object BackPanel: TPanel
Left = 141 Left = 141
Top = 28 Top = 28
Width = 580 Width = 580
Height = 436 Height = 430
Align = alClient Align = alClient
BevelInner = bvLowered BevelInner = bvLowered
BevelOuter = bvNone BevelOuter = bvNone
@ -367,7 +368,7 @@ object MainForm: TMainForm
Left = 1 Left = 1
Top = 1 Top = 1
Width = 578 Width = 578
Height = 434 Height = 428
Align = alClient Align = alClient
Anchors = [] Anchors = []
Center = True Center = True
@ -381,7 +382,7 @@ object MainForm: TMainForm
end end
object StatusBar: TStatusBar object StatusBar: TStatusBar
Left = 0 Left = 0
Top = 464 Top = 458
Width = 721 Width = 721
Height = 19 Height = 19
Panels = < Panels = <
@ -399,7 +400,7 @@ object MainForm: TMainForm
Left = 8 Left = 8
Top = 56 Top = 56
Bitmap = { Bitmap = {
494C010138003B00040010001000FFFFFFFFFF00FFFFFFFFFFFFFFFF424D3600 494C010138003B00040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
000000000000360000002800000040000000F0000000010020000000000000F0 000000000000360000002800000040000000F0000000010020000000000000F0
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
@ -2383,7 +2384,8 @@ object MainForm: TMainForm
C003000F80018000C003000780018000C003000380018000C003000180018000 C003000F80018000C003000780018000C003000380018000C003000180018000
C003000180018000C003001F80018000C003001F80018001C003001F80018001 C003000180018000C003001F80018000C003001F80018001C003001F80018001
C0038FF180018001C007FFF980018001C00FFF7580018001C01FFF8F80018001 C0038FF180018001C007FFF980018001C00FFF7580018001C01FFF8F80018001
C03FFFFF80018001FFFFFFFFFFFFFFFF} C03FFFFF80018001FFFFFFFFFFFFFFFF00000000000000000000000000000000
000000000000}
end end
object SmallImages: TImageList object SmallImages: TImageList
Left = 40 Left = 40

View File

@ -54,6 +54,8 @@ type
type type
TWin32Version = (wvUnknown, wvWin95, wvWin98, wvWinNT, wvWin2000, wvWinXP); TWin32Version = (wvUnknown, wvWin95, wvWin98, wvWinNT, wvWin2000, wvWinXP);
{$define _NO_THUMBNAILS_} // they only crash anyway
type type
TThumbsRenderThread = class(TThread) TThumbsRenderThread = class(TThread)
private private
@ -2017,7 +2019,7 @@ var
ListItem: TListItem; ListItem: TListItem;
FileStrings: TStringList; FileStrings: TStringList;
ParamStrings: TStringList; ParamStrings: TStringList;
RenderThread: TThumbsRenderThread; ThumbsRenderThread: TThumbsRenderThread;
Bitmap: TBitmap; Bitmap: TBitmap;
begin begin
FileStrings := TStringList.Create; FileStrings := TStringList.Create;
@ -2067,10 +2069,12 @@ begin
end; end;
MainForm.ListView.Items.EndUpdate; MainForm.ListView.Items.EndUpdate;
// start to render thumbs in background // start to render thumbs in background
RenderThread := TThumbsRenderThread.Create(true); {$ifndef _NO_THUMBNAILS_}
RenderThread.ListView := MainForm.ListView; ThumbsRenderThread := TThumbsRenderThread.Create(true);
RenderThread.Thumbnails := MainForm.Thumbnails; ThumbsRenderThread.ListView := MainForm.ListView;
RenderThread.Resume; ThumbsRenderThread.Thumbnails := MainForm.Thumbnails;
ThumbsRenderThread.Resume;
{$endif}
case sel of case sel of
0: MainForm.ListView.Selected := MainForm.ListView.Items[MainForm.ListView.Items.Count - 1]; 0: MainForm.ListView.Selected := MainForm.ListView.Items[MainForm.ListView.Items.Count - 1];
1: MainForm.ListView.Selected := MainForm.ListView.Items[0]; 1: MainForm.ListView.Selected := MainForm.ListView.Items[0];
@ -2513,8 +2517,8 @@ var
i: integer; i: integer;
s: string; s: string;
begin begin
if not FileExists(AppPath + 'favorites') then exit; if not FileExists(AppPath + scriptFavsFilename) then exit;
Favorites.LoadFromFile(AppPath + 'favorites'); Favorites.LoadFromFile(AppPath + scriptFavsFilename);
if Trim(Favorites.Text) = '' then exit; if Trim(Favorites.Text) = '' then exit;
if Favorites.count <> 0 then if Favorites.count <> 0 then
begin begin
@ -2562,6 +2566,11 @@ begin
Application.OnException := AppException; Application.OnException := AppException;
{$ENDIF} {$ENDIF}
*) *)
{$ifdef _NO_THUMBNAILS_}
tbShowIcons.Visible := false;
tbShowList.Visible := false;
ToolButton9.Visible := false;
{$endif}
FMouseMoveState := msDrag; FMouseMoveState := msDrag;
LimitVibrancy := True; LimitVibrancy := True;
@ -4318,10 +4327,10 @@ end;
procedure TMainForm.ListXmlScannerEmptyTag(Sender: TObject; procedure TMainForm.ListXmlScannerEmptyTag(Sender: TObject;
TagName: String; Attributes: TAttrList); TagName: String; Attributes: TAttrList);
const const
ValidAttributes: array[0..9] of string = ( ValidAttributes: array[0..11] of string = (
'coefs', 'post', 'weight', 'color', 'coefs', 'post', 'weight', 'color',
'symmetry', 'noplot', 'chaos', 'enabled', 'symmetry', 'noplot', 'chaos', 'enabled',
'plotmode', 'opacity' 'plotmode', 'opacity', 'color_speed', 'animate'
); );
var var
i, j: integer; i, j: integer;
@ -4508,10 +4517,14 @@ begin
with ParseCP.xform[nXform] do begin with ParseCP.xform[nXform] do begin
Clear; Clear;
v := Attributes.Value('weight'); if (TagName = 'xform') then begin
if (v <> '') and (TagName = 'xform') then weight := StrToFloat(v); v := Attributes.Value('weight');
if (TagName = 'finalxform') then if (v <> '') then weight := StrToFloat(v);
end
else // if (TagName = 'finalxform') then
begin begin
weight := 0;
color_speed := 1;
v := Attributes.Value('enabled'); v := Attributes.Value('enabled');
if v <> '' then ParseCP.finalXformEnabled := (StrToInt(v) <> 0) if v <> '' then ParseCP.finalXformEnabled := (StrToInt(v) <> 0)
else ParseCP.finalXformEnabled := true; else ParseCP.finalXformEnabled := true;
@ -4525,6 +4538,7 @@ begin
if v <> '' then color_speed := StrToFloat(v); if v <> '' then color_speed := StrToFloat(v);
v := Attributes.Value('color_speed'); v := Attributes.Value('color_speed');
if v <> '' then color_speed := StrToFloat(v); if v <> '' then color_speed := StrToFloat(v);
v := Attributes.Value('coefs'); v := Attributes.Value('coefs');
GetTokens(v, tokens); GetTokens(v, tokens);
if Tokens.Count < 6 then ShowMessage('Not enough coefficients...crash?'); if Tokens.Count < 6 then ShowMessage('Not enough coefficients...crash?');
@ -4771,7 +4785,6 @@ begin
scale := FViewScale * Image.Width / FViewImage.Width; scale := FViewScale * Image.Width / FViewImage.Width;
FViewPos.X := FViewPos.X + (x - FClickRect.Right) / scale; FViewPos.X := FViewPos.X + (x - FClickRect.Right) / scale;
FViewPos.Y := FViewPos.Y + (y - FClickRect.Bottom) / scale; FViewPos.Y := FViewPos.Y + (y - FClickRect.Bottom) / scale;
//FClickRect.BottomRight := Point(x, y);
DrawImageView; DrawImageView;
end; end;
@ -4782,20 +4795,9 @@ begin
FRotateAngle := arctan2(y-Image.Height/2, Image.Width/2-x) - FClickAngle; FRotateAngle := arctan2(y-Image.Height/2, Image.Width/2-x) - FClickAngle;
if ssShift in Shift then // angle snap if ssShift in Shift then // angle snap
FRotateAngle := Round(FRotateAngle/snap_angle)*snap_angle; FRotateAngle := Round(FRotateAngle/snap_angle)*snap_angle;
//SelectRect.Left := x;
// pdjpointgen.Rotate(FRotateAngle);
// FRotateAngle := 0;
DrawRotatelines(FRotateAngle); DrawRotatelines(FRotateAngle);
DrawSelection := true; DrawSelection := true;
{
Image.Refresh;
if AdjustForm.Visible then begin
MainCp.FAngle:=-FRotateAngle;
AdjustForm.UpdateDisplay;
end;
}
end; end;
end; end;
FClickRect.BottomRight := Point(x, y); FClickRect.BottomRight := Point(x, y);
@ -4988,7 +4990,6 @@ begin
Image.Canvas.Pen.Style := psDot; //psDash; Image.Canvas.Pen.Style := psDot; //psDash;
Image.Canvas.Brush.Style := bsClear; Image.Canvas.Brush.Style := bsClear;
// Image.Canvas.Rectangle(FSelectRect);
points[0].x := (Image.Width div 2)-1; points[0].x := (Image.Width div 2)-1;
points[0].y := (Image.Height div 2)-1; points[0].y := (Image.Height div 2)-1;
points[1].x := (Image.Width div 2)-1; points[1].x := (Image.Width div 2)-1;
@ -5189,7 +5190,6 @@ procedure TMainForm.ImageDblClick(Sender: TObject);
begin begin
if FMouseMoveState = msRotateMove then if FMouseMoveState = msRotateMove then
begin begin
// FRotateAngle := 0;
StopThread; StopThread;
UpdateUndo; UpdateUndo;
MainCp.FAngle := 0; MainCp.FAngle := 0;
@ -5390,7 +5390,6 @@ begin
begin begin
index := i; index := i;
lcp := TControlPoint.Create; lcp := TControlPoint.Create;
lcp.Clear;
MainForm.LoadXMLFlame(OpenFile, i, lcp); MainForm.LoadXMLFlame(OpenFile, i, lcp);
if xmlErrorsList.Count = 0 then if xmlErrorsList.Count = 0 then
@ -5422,7 +5421,10 @@ end;
procedure TThumbsRenderThread.PaintThumb; procedure TThumbsRenderThread.PaintThumb;
begin begin
FThumbnails.Add(FBitmap, nil); if FThumbnails.Count <= index then
FThumbnails.Add(FBitmap, nil)
else
FThumbnails.Replace(index, FBitmap, nil);
FListView.Items.Item[index].ImageIndex := FThumbnails.Count-1; FListView.Items.Item[index].ImageIndex := FThumbnails.Count-1;
end; end;