Autor Beitrag
noreux
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 43



BeitragVerfasst: Di 28.08.07 13:24 
Hallo zusammen!

Bin relativ neu was Delphi angeht und hab ne ziemlich doofe Frage....Wollte die Zipmaster Komponente benutzen, habe den Installer dafür genuzt, welche die Komponente automatisch installiert hat. Aber wie kann ich diese jetzt in meine Delphi Form einfügen, in der Palettenleiste ist nichts von zipmaster zu sehen?! danke schonmal im vorraus,

gruß
Nor

//edit: ps. ich nutze Delphi 7
Killian2004
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 72

Vista Business x64
Delphi 7 Ent. RAD Studio 2009
BeitragVerfasst: Di 28.08.07 14:34 
Hallo, ich kenne die Komponente zwar nicht, aber vielleicht hilft es dir ja trotzdem.
Möglich, dass Zipmaster keine visuelle Komponente ist, das bedeutet, dass du sie nicht als Objekt auf deine Form ziehen kannst.

Probier doch mal, die Zipmaster-Unit in der USES Klausel einzubinden, vielleicht kannst du dann einfach von ihr aberben.
Oder vielleicht existiert auch eine Dokumentation zum Zipmaster!?

mfG, Killian

_________________
Die Antwort ist 17, aber wie lautet die Frage?
noreux Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 43



BeitragVerfasst: Di 28.08.07 14:54 
Danke für die schnelle Antwort!
Also hab mir alles doku-ähnliches was ich dazu gefunden habe durchgelesen, und demnach müsste es schon eine visuelle Komponente sein. ich hab die Unit auch mal testweise über USES eingebunden, was auch funktioniert, jedoch weiß ich nicht wie ich dann mit ihr arbeiten soll. In anderen threads hier im board wo es um diese kompo geht wird immer mit der Zipmaster1.* gearbeitet, wenn ich das so aber rauskopiere sagt er mir natürlich dass er die Zipmaster1 nicht kennt ...
Weiß jemand weiter?

gruß
Nor
Killian2004
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 72

Vista Business x64
Delphi 7 Ent. RAD Studio 2009
BeitragVerfasst: Di 28.08.07 15:49 
Natürlich kennt der Compiler dann ZipMaster1 nicht. Dazu musst du eben erst eine Instanz von TZipMaster erstellen. Versuch mal folgendes im OnCreate Deiner Form.

ausblenden Delphi-Quelltext
1:
ZipMaster1 := TZipMaster.Create;					


Wie gesagt, ich kenne die Komponente nicht, daher weiß ich nicht ob der Constructor so funktioniert. Hast du vielleicht einen Link zur Komponente, dann kann ich es direkt mal in Delphi versuchen.

mfG, Killian

_________________
Die Antwort ist 17, aber wie lautet die Frage?
noreux Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 43



BeitragVerfasst: Di 28.08.07 15:57 
der code geht leider auch nicht...

also hier kriegt man die kompo, habe den exe-installer benutzt: www.geocities.com/rj...rs_au/zipmaster.html

danke für die Mühen!
Killian2004
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 72

Vista Business x64
Delphi 7 Ent. RAD Studio 2009
BeitragVerfasst: Di 28.08.07 16:46 
Also habs grad getestet. Du kannst die Unit des Zipmaster manuell in die IDE einfügen.

Gehe dazu auf KOMPONENTE -> KOMPONENTE INSTALLIEREN -> Dann die "ZipMstr.pas" aus dem installierten Ordner wählen. -> "dclusr.dpk" neu compilieren und speichern.

In deinem Projekt dann in der USES Klausel folgendes hinzufügen:
"ZipMSTR"

Dann Instanz erben:
ausblenden Delphi-Quelltext
1:
2:
Var
  ZipMaster1: TZipMaster;


In der OnCreate-Prozedur deiner Form:
ausblenden Delphi-Quelltext
1:
 ZipMaster1 := TZipMaster.Create(Self);					


Dann kannst du sofort auf alle Funktionen, Properties usw. von ZipMaster1 zugreifen.
Hoffe es klappt so, bei mir funktioniert es wunderbar. :-)

mfG, Killian

_________________
Die Antwort ist 17, aber wie lautet die Frage?
noreux Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 43



BeitragVerfasst: Di 28.08.07 17:13 
Ahhh ok danke, jetzt scheint es zu funktionieren!

Aber woher weiß ich welche Eigenschaften die Zipmaster1 hat wenn ich den Objectinspector nicht nutzen kann?
und gibt es einen Ort an dem ich sehen kann welche Funktionen mit der Kompo möglich sind bzw wie sie heißen?
gruß
Nor
Killian2004
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 72

Vista Business x64
Delphi 7 Ent. RAD Studio 2009
BeitragVerfasst: Di 28.08.07 18:46 
Ja, du kannst einfach mal folgendes eintippen:

ausblenden Delphi-Quelltext
1:
Zipmaster1.					


An irgendeiner Stelle im Code. Sowie du den "." setzt, bietet dir die Codevervollständigung von Delphi alle Properties und Methoden des Objektes an.

mfG, Killian

_________________
Die Antwort ist 17, aber wie lautet die Frage?
noreux Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 43



BeitragVerfasst: Di 28.08.07 23:43 
danke, funktioniert alles perfekt, hast mir echt weitergeholfen!!
gruß
Nor
Killian2004
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 72

Vista Business x64
Delphi 7 Ent. RAD Studio 2009
BeitragVerfasst: Mi 29.08.07 00:01 
Kein Problem, jederzeit!

_________________
Die Antwort ist 17, aber wie lautet die Frage?
noreux Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 43



BeitragVerfasst: Mi 29.08.07 13:24 
ne letzte frage hätt ich aber noch...

Also ich hab alles eingebunden und packe Dateien mit folgendem Code:

ausblenden Quelltext
1:
2:
3:
Zipmaster1.ZipFilename:='datei.zip';
Zipmaster1.FSpecArgs.Add('test.exe');
Zipmaster1.Add;



Funktioniert auch prima, da aber manchmal ziemlich große Files dem Archiv hinzugefügt werden, hätte ich den jeweiligen Status gerne in einer Progressbar. In der Zipmaster Hilfe habe ich dazu das gefunden:


Zitat:

Type
TOnItemProgressEvent = procedure(Sender: TObject; Item: string;

TotalSize:cardinal; PerCent: integer) of object;



Property OnItemProgress: TOnItemProgressEvent ;



Description

Use it to show progress for each item on a ProgressBar or similar indicator.

The 'End of Batch' condition is marked by PerCent = -1

Example



procedure TForm1.ZipMaster1ItemProgress(Sender: TObject; Item: string;

TotalSize:cardinal; PerCent: integer);

begin

if PerCent = 0 then // reduces flashing

Label1.Caption := Item;

ProgressBar1.Position := PerCent;

end;




Also habe ich mal oben bei Type folgendes hinzugefügt:

ausblenden Quelltext
1:
2:
    procedure ZipMaster1ItemProgress(Sender: TObject; Item: string;
   TotalSize:cardinal; PerCent: integer);


und unter implementation das:

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
procedure TForm1.ZipMaster1ItemProgress(Sender: TObject; Item: string;
   TotalSize:cardinal; PerCent: integer);

begin
  if PerCent = 0 then // reduces flashing
  Label1.Caption := Item;
  ProgressBar1.Position := PerCent;

end;



Das lässt er so auch compilieren, nur tut sich natürlich nichts wenn ich eine File hinzufüge...Wie weise ich dem jetzt diese prozedur zu, dass er beim hinzufügen die Progressbar1 füllt?

mfg
Nor

//edit: Das habe ich auch noch dazu gefunden:

Zitat:

OnProgress event occurs during compression and decompression of a Zip archive and while disk (un)spanning.

Type TProgressEvent = Procedure( Sender: TObject; ProgrType: ProgressType; Filename: String; FileSize: cardinal ) of object;

property OnProgress: TProgressEvent;

Description:

Intended for "status bar" or "progress bar" updates. Criteria for this event:

ProgressType is defined as one of the types below:

TotalSize2Process
At the start of processing a (batch of) file(s) with the Add, Extract or Test method this gives the total uncompressed file size which will be processed by the given method. This can be used to show a progress bar for the entire job. This size is also available in the TotalSizeToProcess property. Changed 1.72 - If Filename is not empty it contains the operation name (Clearing Archive Bit etc)

TotalFiles2Process
At the start of processing a (batch of) file(s) with the Add, Extract or Test method you will get the total number of files which will be processed by the given method.

NewFile
Starting to process a new file. (gives you the filename and total uncompressed filesize for the given file.)

ProgressUpdate
Every xxxK bytes while processing a file. The actual progress 'xxx' is given in FileSize.


For Zip compression this will be 64K, n times 32K, and the remaining file bytes.

For Unzip uncompression this will be: n times 32K and the remaining file bytes.

For Zip (un)spanning actions it will be 8K.

EndOfBatch Completed processing on a (batch of) file(s).