Examples: ResExplorer: clear contents of the pagecontrol if there is nothing to be shown or when opening another file.

git-svn-id: trunk@49560 -
This commit is contained in:
bart 2015-07-21 10:30:51 +00:00
parent a931d80679
commit d5a1ca25e1
2 changed files with 12 additions and 4 deletions

View File

@ -3,7 +3,6 @@ object reMainForm: TreMainForm
Height = 605
Top = 242
Width = 768
ActiveControl = StringGrid1
Caption = 'reMainForm'
ClientHeight = 585
ClientWidth = 768
@ -57,11 +56,11 @@ object reMainForm: TreMainForm
end
object tabImage: TTabSheet
Caption = 'Image'
ClientHeight = 480
ClientWidth = 469
ClientHeight = 478
ClientWidth = 467
object Image1: TImage
Left = 0
Height = 477
Height = 478
Top = 0
Width = 467
Align = alClient

View File

@ -52,6 +52,7 @@ type
procedure TreeView1Click(Sender: TObject);
private
Res:TResources;
procedure ClearDisplay;
procedure LoadVersionResource(V:TVersionResource);
procedure LoadBitmapResource(B:TBitmapResource);
procedure LoadGroupIconResource(G:TGroupIconResource);
@ -135,6 +136,7 @@ var
begin
if Assigned(TreeView1.Selected) and Assigned(TreeView1.Selected.Data) then
begin
ClearDisplay;
ResItem:=TAbstractResource(TreeView1.Selected.Data);
HeaderControl1.Sections[1].Text:=ResItem.ClassName + ' : ' + ResItem.Name.Name;
if ResItem is TVersionResource then
@ -150,6 +152,12 @@ begin
end;
end;
procedure TreMainForm.ClearDisplay;
begin
StringGrid1.Clean;
Image1.Picture.Clear;
end;
procedure TreMainForm.LoadVersionResource(V: TVersionResource);
var
i,j, k:integer;
@ -205,6 +213,7 @@ begin
Reader:=TElfResourceReader.Create;
TreeView1.Items.Clear;
ClearDisplay;
if Assigned(Res) then
FreeAndNil(Res);