Just commit. Moved ListView to StringGrid.
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
<AutoIncrementBuild Value="True"/>
|
||||
<MajorVersionNr Value="1"/>
|
||||
<RevisionNr Value="90"/>
|
||||
<BuildNr Value="68"/>
|
||||
<BuildNr Value="70"/>
|
||||
<StringTable CompanyName="Lab 313" FileDescription="The best TIMs tool ever!:)" ProductVersion=""/>
|
||||
</VersionInfo>
|
||||
<BuildModes Count="6">
|
||||
|
||||
104
umain.lfm
104
umain.lfm
@@ -576,54 +576,6 @@ object frmMain: TfrmMain
|
||||
ClientHeight = 597
|
||||
ClientWidth = 253
|
||||
TabOrder = 0
|
||||
object lvList: TListView
|
||||
Left = 0
|
||||
Height = 412
|
||||
Top = 0
|
||||
Width = 253
|
||||
Align = alClient
|
||||
Columns = <
|
||||
item
|
||||
AutoSize = True
|
||||
Caption = '# / 0'
|
||||
Width = 249
|
||||
end
|
||||
item
|
||||
Alignment = taCenter
|
||||
AutoSize = True
|
||||
Caption = 'BPP'
|
||||
Width = 30
|
||||
end
|
||||
item
|
||||
Alignment = taCenter
|
||||
AutoSize = True
|
||||
Caption = 'CLUTs'
|
||||
Width = 42
|
||||
end
|
||||
item
|
||||
Alignment = taCenter
|
||||
AutoSize = True
|
||||
Caption = 'Type'
|
||||
Width = 36
|
||||
end
|
||||
item
|
||||
Alignment = taCenter
|
||||
AutoSize = True
|
||||
Caption = 'W x H'
|
||||
Width = 41
|
||||
end>
|
||||
ColumnClick = False
|
||||
OwnerData = True
|
||||
PopupMenu = pmList
|
||||
ReadOnly = True
|
||||
RowSelect = True
|
||||
ScrollBars = ssAutoBoth
|
||||
TabOrder = 0
|
||||
ToolTips = False
|
||||
ViewStyle = vsReport
|
||||
OnData = lvListData
|
||||
OnSelectItem = lvListSelectItem
|
||||
end
|
||||
object tblTimInfo: TStringGrid
|
||||
Left = 0
|
||||
Height = 185
|
||||
@@ -638,13 +590,13 @@ object frmMain: TfrmMain
|
||||
Flat = True
|
||||
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goSmoothScroll]
|
||||
RowCount = 9
|
||||
TabOrder = 1
|
||||
TabOrder = 0
|
||||
TitleFont.Color = clWindowText
|
||||
TitleFont.Height = -11
|
||||
TitleFont.Name = 'Tahoma'
|
||||
ColWidths = (
|
||||
102
|
||||
133
|
||||
150
|
||||
)
|
||||
Cells = (
|
||||
10
|
||||
@@ -680,6 +632,58 @@ object frmMain: TfrmMain
|
||||
'IMAGE'
|
||||
)
|
||||
end
|
||||
object grdTimsList: TStringGrid
|
||||
Left = 0
|
||||
Height = 412
|
||||
Top = 0
|
||||
Width = 253
|
||||
Align = alClient
|
||||
AutoEdit = False
|
||||
AutoFillColumns = True
|
||||
ColumnClickSorts = True
|
||||
Columns = <
|
||||
item
|
||||
Title.Caption = '#'
|
||||
Width = 50
|
||||
end
|
||||
item
|
||||
Title.Caption = 'BPP'
|
||||
Width = 50
|
||||
end
|
||||
item
|
||||
Title.Caption = 'CLUTs'
|
||||
Width = 50
|
||||
end
|
||||
item
|
||||
Title.Caption = 'Type'
|
||||
Width = 50
|
||||
end
|
||||
item
|
||||
Title.Caption = 'W x H'
|
||||
Width = 52
|
||||
end>
|
||||
ExtendedSelect = False
|
||||
FixedCols = 0
|
||||
Flat = True
|
||||
Options = [goFixedVertLine, goDrawFocusSelected, goRowSelect, goSmoothScroll, goHeaderHotTracking, goHeaderPushedLook, goSelectionActive, goTruncCellHints, goRowHighlight]
|
||||
PopupMenu = pmList
|
||||
RowCount = 1
|
||||
TabOrder = 1
|
||||
TitleFont.Color = clWindowText
|
||||
TitleFont.Height = -11
|
||||
TitleFont.Name = 'Tahoma'
|
||||
TitleStyle = tsNative
|
||||
UseXORFeatures = True
|
||||
OnDrawCell = grdTimsListDrawCell
|
||||
OnSelection = grdTimsListSelection
|
||||
ColWidths = (
|
||||
50
|
||||
50
|
||||
50
|
||||
50
|
||||
52
|
||||
)
|
||||
end
|
||||
end
|
||||
object pnlImage: TPanel
|
||||
Left = 258
|
||||
|
||||
53
umain.pas
53
umain.pas
@@ -64,7 +64,6 @@ type
|
||||
imgTim: TImage;
|
||||
lblClutHint: TLabel;
|
||||
lblStatus: TLabel;
|
||||
lvList: TListView;
|
||||
MenuItem1: TMenuItem;
|
||||
mnImportPng1: TMenuItem;
|
||||
mnShowTimInfo: TMenuItem;
|
||||
@@ -113,6 +112,7 @@ type
|
||||
mnSaveToPNG1: TMenuItem;
|
||||
dlgSelectDir: TSelectDirectoryDialog;
|
||||
splMain: TSplitter;
|
||||
grdTimsList: TStringGrid;
|
||||
tblTimInfo: TStringGrid;
|
||||
procedure actAboutExecute(Sender: TObject);
|
||||
procedure actAddToSendtoExecute(Sender: TObject);
|
||||
@@ -147,6 +147,9 @@ type
|
||||
procedure grdClutDblClick(Sender: TObject);
|
||||
procedure grdClutDrawCell(Sender: TObject; aCol, aRow: Integer; aRect: TRect; aState: TGridDrawState);
|
||||
procedure grdClutKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||
procedure grdTimsListDrawCell(Sender: TObject; aCol, aRow: Integer;
|
||||
aRect: TRect; aState: TGridDrawState);
|
||||
procedure grdTimsListSelection(Sender: TObject; aCol, aRow: Integer);
|
||||
procedure lvListData(Sender: TObject; Item: TListItem);
|
||||
procedure lvListSelectItem(Sender: TObject; Item: TListItem; Selected: Boolean);
|
||||
private
|
||||
@@ -306,17 +309,11 @@ begin
|
||||
SetTimsListCount(SelectedScanResult.Count);
|
||||
|
||||
actReturnFocus.Execute;
|
||||
if lvList.Items.Count = 0 then Exit;
|
||||
if grdTimsList.RowCount = 1 then Exit;
|
||||
|
||||
//if lvList.Selected <> nil then
|
||||
// lvList.Selected.Index := -1;
|
||||
lvList.ItemIndex:= -1;
|
||||
lvList.Update;
|
||||
lvList.ItemIndex := 0;
|
||||
|
||||
lvList.Items[0].Focused := True;
|
||||
lvList.Items[0].Selected := True;
|
||||
lvList.Items[0].MakeVisible(False);
|
||||
grdTimsList.Row := 1;
|
||||
grdTimsListSelection(Self, 0, 1);
|
||||
grdTimsList.SetFocus;
|
||||
end;
|
||||
|
||||
procedure TfrmMain.actAboutExecute(Sender: TObject);
|
||||
@@ -631,7 +628,7 @@ end;
|
||||
|
||||
procedure TfrmMain.actReturnFocusExecute(Sender: TObject);
|
||||
begin
|
||||
if pnlList.Enabled then lvList.SetFocus;
|
||||
if pnlList.Enabled then grdTimsList.SetFocus;
|
||||
end;
|
||||
|
||||
procedure TfrmMain.actScanDirExecute(Sender: TObject);
|
||||
@@ -811,6 +808,19 @@ begin
|
||||
UpdateTim(True, True, False);
|
||||
end;
|
||||
|
||||
procedure TfrmMain.grdTimsListDrawCell(Sender: TObject; aCol, aRow: Integer;
|
||||
aRect: TRect; aState: TGridDrawState);
|
||||
begin
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmMain.grdTimsListSelection(Sender: TObject; aCol, aRow: Integer);
|
||||
begin
|
||||
if (aCol < 1) and (aRow < 1) then Exit;
|
||||
|
||||
ShowTim;
|
||||
end;
|
||||
|
||||
procedure TfrmMain.lvListData(Sender: TObject; Item: TListItem);
|
||||
var
|
||||
W, H: Word;
|
||||
@@ -830,9 +840,7 @@ end;
|
||||
procedure TfrmMain.lvListSelectItem(Sender: TObject; Item: TListItem;
|
||||
Selected: Boolean);
|
||||
begin
|
||||
if (Item = nil) then Exit;
|
||||
|
||||
if Selected then ShowTim;
|
||||
end;
|
||||
|
||||
function TfrmMain.FGetSelectedScanResult: TScanResult;
|
||||
@@ -843,7 +851,7 @@ end;
|
||||
|
||||
function TfrmMain.FGetSelectedTimIdx: Integer;
|
||||
begin
|
||||
Result := lvList.ItemIndex;
|
||||
Result := grdTimsList.Row - 1;
|
||||
end;
|
||||
|
||||
function TfrmMain.FGetSelectedTimInfo: TTimInfo;
|
||||
@@ -862,8 +870,6 @@ var
|
||||
begin
|
||||
Result := nil;
|
||||
|
||||
if lvList.Selected = nil then Exit;
|
||||
|
||||
P := SelectedTimInfo.Position;
|
||||
Result := LoadTimFromFile(SelectedScanResult.ScanFile, P, SelectedScanResult.IsImage, SelectedTimInfo.Size);
|
||||
|
||||
@@ -957,7 +963,7 @@ begin
|
||||
actScanFile.Enabled := ScanThreads.Count = 0;
|
||||
actScanDir.Enabled := ScanThreads.Count = 0;
|
||||
|
||||
actReplaceTim.Enabled := (lvList.Selected <> nil) and (lvList.Selected.Index <> -1);
|
||||
actReplaceTim.Enabled := not (grdTimsList.Row < 1);
|
||||
|
||||
actPngExport.Enabled := (Surf^ <> nil) and actReplaceTim.Enabled;
|
||||
actPngImport.Enabled := actReplaceTim.Enabled;
|
||||
@@ -1016,10 +1022,10 @@ end;
|
||||
|
||||
procedure TfrmMain.SetTimsListCount(Count: Integer);
|
||||
begin
|
||||
lvList.Items.BeginUpdate;
|
||||
lvList.Items.Count := Count;
|
||||
lvList.Column[0].Caption := Format('# / %d', [Count]);
|
||||
lvList.Items.EndUpdate;
|
||||
grdTimsList.BeginUpdate;
|
||||
grdTimsList.RowCount := Count + 1;
|
||||
grdTimsList.Columns[0].Title.Caption := Format('# / %d', [Count]);
|
||||
grdTimsList.EndUpdate;
|
||||
end;
|
||||
|
||||
procedure TfrmMain.UpdateCLUTInfo;
|
||||
@@ -1112,8 +1118,7 @@ end;
|
||||
|
||||
procedure TfrmMain.ShowTim;
|
||||
begin
|
||||
if (lvList.Selected = nil) then Exit;
|
||||
if (lvList.Items.Count = 0) then Exit;
|
||||
if (grdTimsList.RowCount = 1) then Exit;
|
||||
|
||||
{ TODO : Reset bitmode or not? }
|
||||
//cbbBitMode.ItemIndex := 0;
|
||||
|
||||
@@ -202,7 +202,7 @@ end;
|
||||
procedure TScanThread.UpdateProgressBar;
|
||||
begin
|
||||
frmMain.pbProgress.Position := pFilePos;
|
||||
frmMain.lvList.Column[0].Caption := Format('# / %d', [pScanResult.Count]);
|
||||
frmMain.grdTimsList.Columns[0].Title.Caption := Format('# / %d', [pScanResult.Count]);
|
||||
end;
|
||||
|
||||
procedure TScanThread.ClearSectorBuffer(SectorBuffer, ClearBuffer: PBytesArray);
|
||||
|
||||
Reference in New Issue
Block a user