Need Help, Plugin in Pascal ...
Moderators: white, Hacker, petermad, Stefan2
- franck8244
- Power Member
- Posts: 703
- Joined: 2003-03-06, 17:37 UTC
- Location: Geneva...
Need Help, Plugin in Pascal ...
I'm writing a lister plugin in Pascal.
->It works but I have a few problem:
1) Reading the ini file does not work correctly :
Reading the ini file & language file is ok ONLY when the second panel contains the ini file (and the language directory)
What I do :
IniFile:TIniFile.Create('./PluginName.ini');
(or 'PluginName.ini' , I tried both)
In this ini, i'm just supplying language file name:
ini File:
[General]
Language=./lng/French.lng
;Language=C:\temp\lng\English.lng
(to test absolute path or relative)
I'm reading the file in the code with the "IniFile.ReadString" method
then I do the same to open the language file with the string i have read in the ini file....
I don't see what is wrong ....
2) What is the best way (TMemo, TEdit, ...) to show only text in the lister window ?
->I have problems when I want to activate the scrollBar ...I should specified the 'TMemo' size before but I don't know how to get it (size of the lister window)...
Thanks in advance
->It works but I have a few problem:
1) Reading the ini file does not work correctly :
Reading the ini file & language file is ok ONLY when the second panel contains the ini file (and the language directory)
What I do :
IniFile:TIniFile.Create('./PluginName.ini');
(or 'PluginName.ini' , I tried both)
In this ini, i'm just supplying language file name:
ini File:
[General]
Language=./lng/French.lng
;Language=C:\temp\lng\English.lng
(to test absolute path or relative)
I'm reading the file in the code with the "IniFile.ReadString" method
then I do the same to open the language file with the string i have read in the ini file....
I don't see what is wrong ....
2) What is the best way (TMemo, TEdit, ...) to show only text in the lister window ?
->I have problems when I want to activate the scrollBar ...I should specified the 'TMemo' size before but I don't know how to get it (size of the lister window)...
Thanks in advance
TC#88260 -
Addons Help...
2franck8244
Hello ! Bonsoir,
¤ I can't help you directly, but have you the Ch. Ghisler's Help folder about addons creations?
- You may get it in English AND French here >>> add-lister.zip
- Just my 0.03 € (inflation …)
Kind regards,
Claude
Clo
Hello ! Bonsoir,
¤ I can't help you directly, but have you the Ch. Ghisler's Help folder about addons creations?
- You may get it in English AND French here >>> add-lister.zip
- Just my 0.03 € (inflation …)
Kind regards,
Claude
Clo
#31505 Traducteur Français de T•C French translator Aide en Français Tutoriels Français English Tutorials
franck8244,
Try extracting the path to your plugin by using one of these (not sure which one will work):
path := paramstr(0);
path := application.exename;
extract the path and appenf 'pluginname.ini' to it.
There might be better ways, but for now I
HTH
Roman
The problem is probably in a wrong current directory. The current dir isn't the one where your plugin is but some other dir (target panel?).IniFile:TIniFile.Create('./PluginName.ini');
Try extracting the path to your plugin by using one of these (not sure which one will work):
path := paramstr(0);
path := application.exename;
extract the path and appenf 'pluginname.ini' to it.
There might be better ways, but for now I
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.
Here you are right.Hacker wrote:The problem is probably in a wrong current directory. The current dir isn't the one where your plugin is but some other dir
They both will work, it's the same code.Try extracting the path to your plugin by using one of these (not sure which one will work):
path := paramstr(0);
path := application.exename;
Code: Select all
Forms.pas:
function TApplication.GetExeName: string;
begin
Result := ParamStr(0);
end;
set at module initialization:
IniName:= ExtractFileDir(ParamStr(0))+'\YourPlugin.ini';
LOL, didn't know that.They both will work, it's the same code.Code: Select all
Forms.pas: function TApplication.GetExeName: string; begin Result := ParamStr(0); end;
Thanks
Roman
- franck8244
- Power Member
- Posts: 703
- Joined: 2003-03-06, 17:37 UTC
- Location: Geneva...
Sorry, I forgot yuo are writing a plugin.franck8244 wrote:I tried both :
But it gives me the totalcmd path ....(more precisely the running tcmd that calls my plugin)
For .dll - yes, ParamStr returns path to .exe file. You need to call Windows.GetModuleFileName, for it set hModule you get from TC.
AFAIR, this works:
hModule:= HInstance; //standard Delphi var
(I wrote a plugin for FAR manager, AFAIR it worked).
- franck8244
- Power Member
- Posts: 703
- Joined: 2003-03-06, 17:37 UTC
- Location: Geneva...
Thanks 2 all,
I solved my 1st problem with:
SetString(path, ModName, Windows.GetModuleFileName(HInstance, ModName, SizeOf(ModName)));
path:=ExtractFilePath(path);
Now the language part of my plugin is working...
For my 2nd Problem (see 1st post) here are 2 screenshots :
it shows the same file :
Pb with ScrollBar and Without ScrollBar
I solved my 1st problem with:
SetString(path, ModName, Windows.GetModuleFileName(HInstance, ModName, SizeOf(ModName)));
path:=ExtractFilePath(path);
Now the language part of my plugin is working...
For my 2nd Problem (see 1st post) here are 2 screenshots :
it shows the same file :
Pb with ScrollBar and Without ScrollBar
TC#88260 -
- franck8244
- Power Member
- Posts: 703
- Joined: 2003-03-06, 17:37 UTC
- Location: Geneva...
Ok, I understand. You need to get Lister's window width from Handle (ListLoad: ParentWin).franck8244 wrote:2alextp
No I want to show the scrollbar when necessary....
But when I activate the vertical one (or both) I've a "big" problem ->see the 2 above screenshots ....
How to do it, I don't know. some Win function...
Regards,
Try to use the TRichEdit instead of TMemo.
And see below:
http://www.totalcmd.net/plugring/ListSimple.html
And see below:
http://www.totalcmd.net/plugring/ListSimple.html
E.Savich
http://www.xbaseview.com
http://www.xbaseview.com
- franck8244
- Power Member
- Posts: 703
- Joined: 2003-03-06, 17:37 UTC
- Location: Geneva...