SynPlus 2.X

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
User avatar
m^2
Power Member
Power Member
Posts: 1413
Joined: 2006-07-12, 10:02 UTC
Location: Poland
Contact:

Post by *m^2 »

Bug, from tcup.pl
When a file contains 0x00 character, SynPlus stops reading at it and forgets about the rest of the file.
User avatar
Hacker
Moderator
Moderator
Posts: 13142
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

m^2,
Right-click - Plugin settings - Files - Check when loading on "zero" symbols (0x0) perhaps?

HTH
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
m^2
Power Member
Power Member
Posts: 1413
Joined: 2006-07-12, 10:02 UTC
Location: Poland
Contact:

Post by *m^2 »

Hacker wrote:m^2,
Right-click - Plugin settings - Files - Check when loading on "zero" symbols (0x0) perhaps?

HTH
Roman
So it's not a bug :oops:
Thank you.
User avatar
tbeu
Power Member
Power Member
Posts: 1354
Joined: 2003-07-04, 07:52 UTC
Location: Germany
Contact:

mod_sample.rar

Post by *tbeu »

Can someone please compile the Delphi sources of mod_sample.rar and put the compiled library online? Thanks!
Last edited by tbeu on 2007-08-13, 09:56 UTC, edited 1 time in total.
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
User avatar
tbeu
Power Member
Power Member
Posts: 1354
Joined: 2003-07-04, 07:52 UTC
Location: Germany
Contact:

About SynPlus internal plugins (API Vs 1.2)

Post by *tbeu »

1) It is not a good idea to use the Delphi String type (in structure ModInfo) for the interface as there is no equivalent type in C/C++.

2) Is there a chance to get the file name / file pointer of the active file?

3) What is the meaning of the third parameter (pSynPlusStr) of InitializeModule()?

4) The bitmap returned by GetMenuBitmap() never shows up in the menu of SynPlus.

This is my C/C++ example code.

Code: Select all

HINSTANCE hinstance;

typedef struct
{
	char ModName[50];
	BOOL Autoload;
	BOOL Editor;
} ModInfo;

HBITMAP __stdcall GetMenuBitmap()
{
	return (HBITMAP) LoadImage(hinstance, MAKEINTRESOURCE(LOGO), IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR);
}

BOOL __stdcall GetModuleInfo(ModInfo* Info)
{
	strcpy(Info->ModName, "My Module");
	Info->Autoload = TRUE;
	Info->Editor = FALSE;
	return TRUE;
}

DWORD __stdcall InitializeModule(HWND MainWND, HWND PluginWND, char* pSynPlusStr, int SelStart, int SelEnd)
{
	return MAKELONG(0,0);
}

void  __stdcall SetApiVer(DWORD ApiVer)
{
/*
	WORD l = LOWORD(ApiVer);
	WORD h = HIWORD(ApiVer);
*/
}

BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
	switch (fdwReason)
	{
		case DLL_PROCESS_ATTACH :
			hinstance = hinstDLL;
			DisableThreadLibraryCalls(hinstDLL);
			break;

		case DLL_PROCESS_DETACH :
			break;
	}
	return TRUE;
}
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
User avatar
SCHMaster
Member
Member
Posts: 199
Joined: 2003-02-08, 00:39 UTC
Location: Ukraine
Contact:

Post by *SCHMaster »

2tbeu
It is not a good idea to use the Delphi String type (in structure ModInfo) for the interface as there is no equivalent type in C/C++
Possible you right
) Is there a chance to get the file name / file pointer of the active file?
At opening file SynPlus will send name of new file, call
function SetNewFile(PluginWND:HWND;fName:PChar):
What is the meaning of the third parameter (pSynPlusStr) of InitializeModule()?
Pointer on opened in SynPlus text.
What is the meaning of the third parameter (pSynPlusStr) of InitializeModule()?
My sample

function GetMenuBitmap: HBITMAP; stdcall;
begin
result:=LoadImage(hinstance, 'LOGO', IMAGE_BITMAP , 0, 0,LR_DEFAULTCOLOR );
end;

Image 'LOGO' - resourche in your module, must be Bitmap 16x16
User avatar
tbeu
Power Member
Power Member
Posts: 1354
Joined: 2003-07-04, 07:52 UTC
Location: Germany
Contact:

About SynPlus internal plugins (API Vs 1.2)

Post by *tbeu »

1) When exactly is SetNewFile() called? Does the plugin need to call this function itself?

2) When debugging a C/C++ plugin in InitializeModule() I notice that pSynPlusStr is never a valid char pointer.

3) I installed comments.dll, executer.dll, fileprop.dll, listsort.dll, shot.dll and translit.dll. The bitmap of neither plugin shows up in the menu of SynPlus.

4) I use SynPlus to show thumbnails of text files. If the text to displayed is less in size than the thumbnail display sometimes an invalid text is appended. See my video.
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
User avatar
FrankCH
Junior Member
Junior Member
Posts: 10
Joined: 2007-03-22, 12:39 UTC

lost Window Focus to quit SynPlus usign CTRL-Q

Post by *FrankCH »

First of all thanks alot 4 SynPlus. I use it since hpg_ed is unsupported. But one thing is annoying me a bit: You can open SynPlus in a TCmd window using CTRL-Q (quickview). But then you cannot close it anymore with CTRL-Q, after editing some text, you first have to click on the source window and then CTRL-Q. The Button for quickview from the buttonbar is not affected.
Last edited by FrankCH on 2008-05-16, 15:19 UTC, edited 1 time in total.
User avatar
FrankCH
Junior Member
Junior Member
Posts: 10
Joined: 2007-03-22, 12:39 UTC

Textfile-encoding: PC/Ansi or UNIX/LINUX

Post by *FrankCH »

Files can only be saved in PC/Ansi encoded format. That means each line is terminated with carriage-return and line-feed character. UNIX/Linux only uses carriage-return. Could you offer an option in the 'save as' dialog?
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6954
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Textfile-encoding: PC/Ansi or UNIX/LINUX

Post by *Horst.Epp »

FrankCH wrote:Files can only be saved in PC/Ansi encoded format. That means each line is terminated with carriage-return and line-feed character. UNIX/Linux only uses carriage-return. Could you offer an option in the 'save as' dialog?
Wrong
Unix / Linux uses only line-feed !
gskoczylas
Junior Member
Junior Member
Posts: 9
Joined: 2008-06-19, 21:51 UTC

Location of config file

Post by *gskoczylas »

How can I change location of SynPlus config file?

Currently config file is stored in the plug-in's directory ([face=courier]c:\Program Files\TotalCmd\plugins\wlx\synPlus[/face]). It works correctly in Windows XP (and earlier), but under Vista applications aren't allowed to store any data in the [face=courier]Program Files[/face] folders (it's possible but require some special actions in the application).

I tired to select User profile directory in the plug-in's settings but it doesn't work for me -- plug-in still try to store configuration in the SynPlus directory. :(
User avatar
Clas Hortien
Senior Member
Senior Member
Posts: 200
Joined: 2003-03-03, 15:03 UTC

Post by *Clas Hortien »

Hi,

i need some help for the highlighting in synplus. First of all i'd like to create a highlighter that will be used if no other matching highlighter can be found. Especially for files with no extension. How can i do that ?

Furthermore do i need a rule to highlight all rows that starts with a the string "C " (no quotation marks). I tried to implement this in an existing highligher, but i was not able to get it to work.

Many thanks for your help

Clas
#14041
User avatar
Clas Hortien
Senior Member
Senior Member
Posts: 200
Joined: 2003-03-03, 15:03 UTC

Post by *Clas Hortien »

Hups,

now i solved it by myself:

you have to create a file "none" without extension in the highlighters directory. This will be used for files without extension.

Regards

Clas
#14041
urlwolf
Junior Member
Junior Member
Posts: 70
Joined: 2007-06-27, 23:03 UTC

Post by *urlwolf »

I cannot get synplus 2.7.1 to highlight python.

I have in my .ini:

PY=python.hgl

but it shows with no highlighting.
The rules (and example) seem to be ok when I run a file in the highlighters folders called highlighting.exe

I do have a python.hgl file, not sure where I got it from.

Any idea what to test next?

Thanks
User avatar
Hensz
Junior Member
Junior Member
Posts: 13
Joined: 2005-05-25, 08:02 UTC

SynPlus Settings use black text on black background

Post by *Hensz »

Hi!

I've installed SynPlus 2.7.3 on Windows Vista using the default Aero theme. It works fine, however, the settings dialog is displayed using black text on black background, which is kind of hard to read ;-) When I'm using the classic Windows XP theme the settings dialog is displayed fine - but I don't want to switch the theme every time I need to change the settings.

Is this a problem of TotalCommander, or a problem of the plugin? I've never seen such a problem with other plugins, or with other tools.

Best regards,
hensz
Post Reply