XnTriq wrote:m.Th. wrote:And also the possibility to use two browsers stacked or side by side.
Just doing my job as “forum librarian”
Thanks a lot!
...just (trying to) do my job as "programmer"
The "biggest" thing (and perhaps the easiest one) is to virtualize the access to the browser/thumbs pane. And this, usually, must be already in place.
IOW, instead of having in the program, scattered in all places direct references to myThumbsPane, the program should access it through a variable (pointer):
so...
instead of:
Code: Select all
myThumbsPane.LoadFromFolder('c:\foo\blah');
myThumbsPane.SetThumbDimensions(300, 200);
myThumbsPane.Refresh;
one should have:
Code: Select all
...
protected
FcrtThumbsPane: TThumbsPane;
public
property CrtThumbsPane: TThumbsPane read FCrtThumbsPane write SetCrtThumbsPane; //field at the beginning in the main class
...
//--------------------------------------------------------
procedure MyInitProc //the init procedure/method run at the beginning of the program (the constructor of the form?)
begin
CrtThumbsPane:=myThumbsPane; //assign the default
end;
procedure TMainForm.SetCrtThumbsPane(aPane: TThumbsPane); //the setter for the current thumbs pane.
begin
FcrtThumbsPane:=aPane;
Tree.SetFolder(...); //beware here at infinite recursion if we'll have one tree and two file/thumb panes
...
//other stuff to do when the crt pane changes (eg. status bar update, perhaps activate/deactivate buttons from main toolbar and menus (if any))
end;
...and to use it: (this means a Search & Replace tool with human confirmation - "Replace this occurrence?" - or, better, a refactoring plugin - dunno if VS 2008 supports that)
Code: Select all
CrtThumbsPane.LoadFromFolder('c:\foo\blah');
CrtThumbsPane.SetThumbDimensions(300, 200);
CrtThumbsPane.Refresh;
...as one can see in the prev post screenshot with Zoner 15 in action, the
internal architecture exposes a
GUI Thumbs Frame which is composed from a normal Thumbs Pane and its toolbar. These are hard-linked in a single object (Browser) with two fields/members: Toolbar and ThumbsPane.
While ZPS has a one Tree + two File Lists layout I think that is
easier internally to have two Full Browsers - where
Full Browser = Tree + Thumbs + Filelist Toolbar + Info Pane and then the pseudo-code above will have instead, of course, the 'global' field called
CrtFullBrowser of type
TFullBrowser with the public properties (members, fields)
Tree, Thumbs, Toolbar and
Info Pane.
The second job for the programmer is
drag & drop engine in which is best to
detach from source and from destination (ie. make it abstract).
And this must be done anyway, regardless if we'll have one or two browsers. IOW when the drag action begins the program will set the
dragSource (or dragFileList or whatever) to hold the source of the drag operation in the most convenient way (for example the entire file list of the files which should be dragged - perhaps gathered in a background thread which is run while the user is occupied with dragging) - this is rather easy because we have just two cases: Tree and Thumbs Pane which are more or less already handled in the right-click menus.
When the user finishes the drag operation then program will call the transfer engine with three parameters:
sourceFileList from above,
destination (took from the Drop target - Pierre already know how to handle this for both Tree or Thumbs pane even if there are some
bugs there) and the
File Operation (copy or move - depending of Shift state - Pierre knows about it).
If something isn't clear or anyone needs more on the theme, drop a line.
Just my2€ & ΗΤΗ