New interface documentation for TC7 plugins
Moderators: Hacker, petermad, Stefan2, white
WDX plugin interface
Dear Mr. Ghisler,
Do you have a test plugin (source code) that uses the new possibilities of the WDX interface?
I have some trouble with ContentGetSupportedFlags. I cannot use a custom field editor.
Somehow the arrow sign is missing, whether i return contflags_fieldedit or not for ma FT_STRING field type.
In my opinion the help file does not make clear enough, which flag must be set for fieldIndex -1 and fieldIndex>=0
Do you have a test plugin (source code) that uses the new possibilities of the WDX interface?
I have some trouble with ContentGetSupportedFlags. I cannot use a custom field editor.
Somehow the arrow sign is missing, whether i return contflags_fieldedit or not for ma FT_STRING field type.
In my opinion the help file does not make clear enough, which flag must be set for fieldIndex -1 and fieldIndex>=0
Gruß,
Kenchi
Kenchi
- Motorocker
- Member
- Posts: 105
- Joined: 2006-07-19, 10:52 UTC
- Location: Perm, Russia
- Contact:
WCX Writer's Reference
PackSetDefaultParams
PackSetDefaultParams
Maybe packer plugins?dps ... Make sure to use a unique header when storing data in this file, because it is shared by other file system plugins! ...
Graphics Converter – images conversion
KillOK – Cease to press OK!
NSCopy – copy unreadable
KillOK – Cease to press OK!
NSCopy – copy unreadable
- ghisler(Author)
- Site Admin
- Posts: 50532
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
2kenchis
Unfortunately I don't have a sample plugin source for a text editor right now.
Do you return a combination of all possible field flags when FieldIndex is set to -1 in ContentGetSupportedFieldFlags?
If contflags_fieldedit isn't part of the flags in this case, then Total Commander will not even check the individual fields whether they support editing or not...
Unfortunately I don't have a sample plugin source for a text editor right now.
Do you return a combination of all possible field flags when FieldIndex is set to -1 in ContentGetSupportedFieldFlags?
If contflags_fieldedit isn't part of the flags in this case, then Total Commander will not even check the individual fields whether they support editing or not...
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
2kenchis
You need to return for -1 and all fields who supports a field editor. This is what I do successfully in my Shortcut and Summary content plug-ins.
You need to return
Code: Select all
contflags_edit | contflags_fieldedit
contentGetSupportedFieldFlags
2Lefteous:
You say, i must set
contflags_edit | contflags_fieldedit
for fieldIndex -1 and each fieldIndex, that has a custom editor.
Two things i dont understand yet:
1.
when and for which fieldIndex must i set contflags_substmask additionally?
2.
why it is needed to call contentGetSupportedFieldFlags with -1?
is that a summary of all flags (inclusive contflags_substmask and contflags_edit)?
It should be made clear, which combinations make sense for a certain fieldIndex (especially -1)
Thanx for you support!
You say, i must set
contflags_edit | contflags_fieldedit
for fieldIndex -1 and each fieldIndex, that has a custom editor.
Two things i dont understand yet:
1.
when and for which fieldIndex must i set contflags_substmask additionally?
2.
why it is needed to call contentGetSupportedFieldFlags with -1?
is that a summary of all flags (inclusive contflags_substmask and contflags_edit)?
It should be made clear, which combinations make sense for a certain fieldIndex (especially -1)
Thanx for you support!
Gruß,
Kenchi
Kenchi
2kenchis
I also think it could be somehow explained in a better way than in the current sdk docu.
when and for which fieldIndex must i set contflags_substmask additionally?
contflags_substmask is actually the ORed value of all other substitution flags.sdk docu wrote:contflags_substmask A combination of all above substituion flags. Should be returned for index -1 if the content plugin contains ANY of the substituted fields.
Yes it informs TC if the plug-in has any fields that supports one of the possible features.why it is needed to call contentGetSupportedFieldFlags with -1?
is that a summary of all flags (inclusive contflags_substmask and contflags_edit)?
I also think it could be somehow explained in a better way than in the current sdk docu.
2Lefteous:
ORed value:
contflags_substmask = contflags_edit | contflag_substsize | ... | contflags_passthrough_size_float | contflags_fieldedit
I cannot download source code of your content plugins,
summary and shortcut.
So i must ask
silly questions.
This is from SDK, so contflags_substmask is incorrect and must be// for ContentGetSupportedFieldFlags
#define contflags_edit 1
#define contflags_substsize 2
#define contflags_substdatetime 4
#define contflags_substdate 6
#define contflags_substtime 8
#define contflags_substattributes 10
#define contflags_substattributestr 12
#define contflags_passthrough_size_float 14
#define contflags_substmask 14
#define contflags_fieldedit 16
ORed value:
contflags_substmask = contflags_edit | contflag_substsize | ... | contflags_passthrough_size_float | contflags_fieldedit
I cannot download source code of your content plugins,
summary and shortcut.
So i must ask

Gruß,
Kenchi
Kenchi
Ok, now i understand
You answered my question: which fiels are logically ORed?
You say:
contflags_substmask=
contflags_substsize(10b) |
contflags_substdatetime(100b) |
contflags_substdate(110b) |
contflags_substtime(1000b) |
contflags_substattributes(1010b)
= 1110b
= 14
I was unsure, which of the defined flags you meant and thought to combine all flags (contflags_edit and contflags_fieldedit inclusive).
Now it is clear.
contflags_fieldedit is a special flag for customized editors (contentEditValue)
and
contflags_edit must be set together with contflags_subst* flag to support to edit a field.
Seems it must be well documented, since the rest of the SDK was clear to me.
You say:
contflags_substmask=
contflags_substsize(10b) |
contflags_substdatetime(100b) |
contflags_substdate(110b) |
contflags_substtime(1000b) |
contflags_substattributes(1010b)
= 1110b
= 14
I was unsure, which of the defined flags you meant and thought to combine all flags (contflags_edit and contflags_fieldedit inclusive).
Now it is clear.
contflags_fieldedit is a special flag for customized editors (contentEditValue)
and
contflags_edit must be set together with contflags_subst* flag to support to edit a field.
Seems it must be well documented, since the rest of the SDK was clear to me.
Gruß,
Kenchi
Kenchi
No you don't have to set have to set one of the subst flags to edit a field.contflags_edit must be set together with contflags_subst* flag to support to edit a field

Here is an example for a plug-in that could make use of substituation. A field of a content plug-in displays the file attributes in a very nice way. The user uses this field in a custom column view. It works fine in the normal file system. Now the user connects to an FTP server. The nice displayed attribute field is now displayed empty because TC doesn't ask the plug-in for values when displaying an FTP path. This is were the substituation comes into play. When the field has enabled substituation (in this case propably contflags_substattributestr) TC just displays the internal attribute value using tc.attributestr when displaying a non file system location.
A sample code for a plug-in having only this field could look like this:
Code: Select all
int __stdcall ContentGetSupportedFieldFlags (int fieldIndex)
{
int result = 0;
if (fieldIndex == -1)
{
result = contflags_substmask;
}
else if (fieldIndex == 0)
{
result = contflags_substattributestr;
}
return result;
}
In a second more complex version of this plug-in a second field is introduced. This field supports editing a field and provides a custom content editor.
Code: Select all
int __stdcall ContentGetSupportedFieldFlags (int fieldIndex)
{
int result = 0;
if (fieldIndex == -1)
{
result = contflags_substmask | contflags_edit | contflags_fieldedit;
}
else if (fieldIndex == 0)
{
result = contflags_substattributestr;
}
else if (fieldIndex == 1)
{
result = contflags_edit | contflags_fieldedit;
}
return result;
}

Ok, the FTP problem was not in my mind, when testing the content plugin interface.
What i found out is the following:
Menu: Files/Change Attributes.../Change plugin attributes...
Now i load my configuration "test":
Result is this one:
http://java.totalcmd.net/V1.5SP1/ContentDemo16_.bmp
To get this result i must return the following flags:
field index -1: CONTFLAGS_SUBSTMASK | CONTFLAGS_EDIT | CONTFLAGS_FIELDEDIT
field index 0,1: CONTFLAGS_EDIT | CONTFLAGS_SUBSTATTRIBUTES
without CONTFLAGS_EDIT the field is not displayed in the dialog.
If you want, you can check the plugin source here:
http://java.totalcmd.net/V1.5SP1/ContentDemo16.tar
it is in the file:
haendel.ken.wlx.contentdemo-1.0-SNAPSHOT.jar
Something must be wrong?
What i found out is the following:
Menu: Files/Change Attributes.../Change plugin attributes...
Now i load my configuration "test":
Result is this one:
http://java.totalcmd.net/V1.5SP1/ContentDemo16_.bmp
To get this result i must return the following flags:
field index -1: CONTFLAGS_SUBSTMASK | CONTFLAGS_EDIT | CONTFLAGS_FIELDEDIT
field index 0,1: CONTFLAGS_EDIT | CONTFLAGS_SUBSTATTRIBUTES
without CONTFLAGS_EDIT the field is not displayed in the dialog.

If you want, you can check the plugin source here:
http://java.totalcmd.net/V1.5SP1/ContentDemo16.tar
it is in the file:
haendel.ken.wlx.contentdemo-1.0-SNAPSHOT.jar
Something must be wrong?
Gruß,
Kenchi
Kenchi
Typo in contentplugin.hlp->ContentGetSupportedFieldFlags
contflags_substmask A combination of all above substitution flags.
contflags_substmask A combination of all above substitution flags.
TC plugins: Autodesk 3ds Max / Inventor / Revit Preview, FileInDir, ImageMetaData (JPG Comment/EXIF/IPTC/XMP), MATLAB MAT-file Viewer, Mover, SetFolderDate, Solid Edge Preview, Zip2Zero and more