[WFX] VirtualPanel: Temporary panel for TC

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
dsscicin
Junior Member
Junior Member
Posts: 19
Joined: 2009-11-03, 13:15 UTC

Post by *dsscicin »

I'm so sorry for the six questions as a result of the bad network.
Other question asked before is that: Is it possible to track the file-changes(name/path) when TC is on?
Expecting for VP2.0. Thanks!
MVV wrote:I'll answer only once on all six questions. :)
TC doesn't allow it, and I can't realize it w/o TC support.

The only way is to write simple explorer window that will allow dragging files to and from, but it is a bit complex thing.
Maybe I'll realize it for upcoming Virtual Panel 2.0. :)
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

VirtualPanel doesn't track any file changes, TC does it, and of course it doesn't work for file system plugins. Or you mean another changes?

(PS. maybe moderators can remove duplicate posts)
User avatar
Hacker
Moderator
Moderator
Posts: 13142
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

MVV,
PS. maybe moderators can remove duplicate posts
Moderators always do that. :)

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
ehab
Senior Member
Senior Member
Posts: 271
Joined: 2007-10-29, 07:41 UTC
Location: Libya

Post by *ehab »

different icons for different folder.

i tried to add a folder and assign it an icon e.g. "in ini"

00000410 01CB6F7B 5FC57DF0 \Bugs W:\VPIcons\bug.ico

the icon is displayed ok but tc treats it as a file !

MVV i wounder if its possible to assign icons for folders?
#181344 Personal licence
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

It is not possible to assign different icons for folders. The only changeable icon is virtual folder icon.

In list file last string in line is physical path of object. Since you've specified there a file path, VP has updated its attributes so you've got file instead of folder.
User avatar
ehab
Senior Member
Senior Member
Posts: 271
Joined: 2007-10-29, 07:41 UTC
Location: Libya

Post by *ehab »

: ( uhhhh thanks for the reply.
#181344 Personal licence
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

dsscicin wrote:Expecting for VP2.0. Thanks!
MVV wrote:I'll answer only once on all six questions. :)
TC doesn't allow it, and I can't realize it w/o TC support.

The only way is to write simple explorer window that will allow dragging files to and from, but it is a bit complex thing.
Maybe I'll realize it for upcoming Virtual Panel 2.0. :)
Unfortunately there is a problem with drag-n-drop - it just doesn't work from my threads with virtual explorer windows - it only works from TC main thread that initializes OLE subsystem (which is so stupid so doesn't work from more than one thread for years). And I don't know a way to pass drag operation to that thread.
User avatar
nsp
Power Member
Power Member
Posts: 1912
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

feature request:

Post by *nsp »

- Option to have ">script" always on top ?
- bigger <edit window with awareness of ">script" in order to have a kind of multi-line edit an an icon selection box.

When script are long, it is very difficult to modify without using a real editor.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

- Option to have ">script" always on top ?
It is impossible because VP only tells to TC which files are exist and TC then shows them in its order - i.e. folders are always first. But you may try to use TWinKey for pinning (I've not tried it myself).
- bigger <edit window with awareness of ">script" in order to have a kind of multi-line edit an an icon selection box.
Problem is that I'm using standard TC dialog for such task. I need to add another dialog to plugin to display it. I'm usually edit text in text editor and paste into that field - in this case syntax highlighting, normal doubleclick selection etc are possible - normal text editor is more comfortable than even standard multiline edit box.

BTW, if your text editor accepts text from command line, you may start it with %P%N parameter from virtual panel. Also you may use some batch that will create temporary file with script text and open it in editor and then open VP's edit script dialog which you can use to paste text from editor. :) e.g. such batch:

Code: Select all

@echo off
if -%1==- echo Parameters are: "%%%%${}Path%%%%\" %%F %%P%%N&pause&goto :EOF
echo "%~3" > %TEMP%\~vpscript.txt
start "" "notepad.exe" %TEMP%\~vpscript.txt
for /f "usebackq delims=" %%f in (%2) do start "" "%COMMANDER_PATH%\Plugins\FileSystem\VirtualPanel\VPBatch.exe" ^^edit "%1\%%f"&goto :EOF
(the only problem is that currently I don't know how to remove quotes - q/o them nothing works because of special meaning of '>' character)

Or maybe little external app may be written that will show edit dialog with text passed as parameter and then call VPBatch to save script text.
User avatar
nsp
Power Member
Power Member
Posts: 1912
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Post by *nsp »

MVV wrote:Problem is that I'm using standard TC dialog for such task. I need to add another dialog to plugin to display it. I'm usually edit text in text editor and paste into that field - in this case syntax highlighting, normal doubleclick selection etc are possible - normal text editor is more comfortable than even standard multiline edit box.....
.
This does not really solve my pb, script are defined in one line and no icon chooser.... I will try to make a powerpro/batch script that do this...

-- edited --
vpbatch source code (guess 0x5056 TC message)
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

I think separate script editor would be better - no plugin overload and easier update.

If you need to know how VPBatch works here it is:

Code: Select all

int TCExecuteVPCommand(HWND hMainWnd, const wchar_t* Command, const wchar_t* RootName=0, const wchar_t* RemotePath=0) {
	vptr<wchar_t> data(lstrlen(RootName)+lstrlen(RemotePath)+lstrlen(Command)+4);
	lstrcpy(data()+wsprintf(data(), L"%s\r%s", RootName ? RootName : L"", RemotePath ? RemotePath : L"")+1, Command);

	COPYDATASTRUCT cds={'P\0V', data.size()*sizeof(wchar_t), data()};
	return SendMessage(hMainWnd, WM_COPYDATA, 0, (LPARAM)&cds);
}
It just sends WM_COPYDATA message with special contents that VP understands. You may get data format from piece of code above.

If you need to set script contents, you need to use following command string: <edit path_to_script_file {new_script_contents}

It would be useful for script editor to add indentation spaces or tabs for nested script block contents - e.g. like this:

Code: Select all

<ifok "Do you wish to save state?" {
    <ifok "You really want to continue?" {
        <silent Ready to save script, go on
        <save
    }
    {
        <silent User afraids to save something, do nothing
    }
}
{}
As you can see from given batch, currently you may get virtual script file path using %L (don't forget to remove VP room name at the beginning) or using "%%${}Path%%\" with %F (also third case is possible - just "%%${}Path%%\"%S1 - but it may have problems in case of short script file name if TC will pass it w/o quotes - char '>' has special meaning). And, you may send current script text to script editor using %P%N parameter - so script editor will accept two parameters - script file name and initial script text - then parse text and extract icon path and format text. After editing text editor will remove line breaks and indentation spaces or tabs and append '<<' with icon path.
User avatar
nsp
Power Member
Power Member
Posts: 1912
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Post by *nsp »

MVV wrote:I think separate script editor would be better - no plugin overload and easier update.
Intermediate is to have a very light app/window that
call external editor (synWrite, npp...), add icon support and script update (replacing \n \t by spaces)..
MVV wrote:If you need to know how VPBatch works here it is:

Code: Select all

int TCExecuteVPCommand(HWND hMainWnd, const wchar_t* Command, const wchar_t* RootName=0, const wchar_t* RemotePath=0) {
	vptr<wchar_t> data(lstrlen(RootName)+lstrlen(RemotePath)+lstrlen(Command)+4);
	lstrcpy(data()+wsprintf(data(), L"%s\r%s", RootName ? RootName : L"", RemotePath ? RemotePath : L"")+1, Command);

	COPYDATASTRUCT cds={'P\0V', data.size()*sizeof(wchar_t), data()};
	return SendMessage(hMainWnd, WM_COPYDATA, 0, (LPARAM)&cds);
}
It just sends WM_COPYDATA message with special contents that VP understands. You may get data format from piece of code above.
If you need to set script contents, you need to use following command string: <edit path_to_script_file {new_script_contents}

It would be useful for script editor to add indentation spaces or tabs for nested script block contents - e.g. like this:

Code: Select all

<ifok "Do you wish to save state?" {
    <ifok "You really want to continue?" {
        <silent Ready to save script, go on
        <save
    }
    {
        <silent User afraids to save something, do nothing
    }
}
{}
...
I have also another concern about quote using %P%N or %N TC remove/interpret quote badly and i do not get same result as <edit (do a try with your given sample)....

Idea about vp command :
<icon VPPathName iconSpec // define icon for node

<Export and <load should also work by node. It could also be good to have some switches to export with/without/only icon spec.
User avatar
nsp
Power Member
Power Member
Posts: 1912
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

feature ideas.

Post by *nsp »

Is it possible to send "filename" to TC for script/file without icon specification ?
If yes, it could be possible to redefine icon for some file. I use a bunch of cmd script inside VP and it could be convenient to have this.
I can have icon and execution using exec but i miss ability to use ^->

Is it possible to have a non recursive <save or an <export with mask ?

I would like to make a backup command using <save but i do not know if it exist an internal VP parameter to give back the current listfile.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

No, I won't add any <icon command. Currently I split script text at position of '<<' and treat first part as script text and second one as icon path.
Is it possible to send "filename" to TC for script/file without icon specification ?
If yes, it could be possible to redefine icon for some file. I use a bunch of cmd script inside VP and it could be convenient to have this.
I can have icon and execution using exec but i miss ability to use ^->
Sorry I don't understand what you want. Please describe it with more details.

<save command is recursive by default. But <export is not recursive by default. And both commands support mask as parameter. Is it not what you need?

And, <load command allows to specify root path where to add items - you may just clear this folder before to replace its whole contents.

You may use any filelist for backups so you'll know its name. Anyway, you may read default filelist name from INI.
User avatar
nsp
Power Member
Power Member
Posts: 1912
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Post by *nsp »

MVV wrote:No, I won't add any <icon command. Currently I split script text at position of '<<' and treat first part as script text and second one as icon path.
Is it possible to send "filename" to TC for script/file without icon specification ?
If yes, it could be possible to redefine icon for some file. I use a bunch of cmd script inside VP and it could be convenient to have this.
I can have icon and execution using exec but i miss ability to use ^->
Sorry I don't understand what you want. Please describe it with more details.
I would like to have a node where i can have specific icon like for script !

Code: Select all

<add MyScript01  {c:\scripts\01.cmd <<c:\scripts\icons.icl,01}
It could be convenient that TC gets only the filepath. For now when i doubleclick to execute my batch script or use [ctrl]-> key to go to my file i have an error because "<<part" is not stripped...

If i use

Code: Select all

<add >MyScript01  {<exec \exec c:\scripts\01.cmd <<c:\scripts\icons.icl,01}
But i cannot anymore go to c:\scripts\01.cmd using [ctrl]-> Keys.

About icon command, nothing forces you to change internal storage just append "<< IconSpec" to "script/file part".
MVV wrote:<save command is recursive by default. But <export is not recursive by default. And both commands support mask as parameter. Is it not what you need?

And, <load command allows to specify root path where to add items - you may just clear this folder before to replace its whole contents.

You may use any filelist for backups so you'll know its name. Anyway, you may read default filelist name from INI.
You are right export support filemask ! but in the help i get:
export [/[a][f][r]] <filelist_path> [<virtual_path>]

I have a common.VPscript list i load each time i define a new list. But the list name is unfortunately not common and no auto-backup is available. Even if i can extract if from ini i cannot reuse it in the <save command to have smth like <Save %VP_MyList%.bak \
-- edited --
I can anyhow do it using VPBatch and some env variable.

Code: Select all

@cd "%~dp0"
@for /F %%i in ( 'iniget VirtualPanel.ini "Virtual Panel:DefFileList"' ) do @SET ${VP}INI=%%i
@VPBATCH ^^exec { ^^silent ^^save /fo "%${VP}INI%.bak" \ }
Post Reply