Recent

Author Topic: TDirectoryEdit.Longname ?????????  (Read 8320 times)

snipexandy

  • Newbie
  • Posts: 3
TDirectoryEdit.Longname ?????????
« on: May 30, 2011, 02:13:28 pm »
 %) where are TDirectoryEdit.LongName ?

where this property in the component LongName TDirectoryEdit? if not there eh bug or is it still needs some functionality will be added?

Blaazen

  • Hero Member
  • *****
  • Posts: 3237
  • POKE 54296,15
    • Eye-Candy Controls
Re: TDirectoryEdit.Longname ?????????
« Reply #1 on: May 30, 2011, 03:05:06 pm »
What do you mean "LongName" ?
There is property Directory - it is full path;
and RootDir - it is where the dialog is opened.
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

snipexandy

  • Newbie
  • Posts: 3
Re: TDirectoryEdit.Longname ?????????
« Reply #2 on: May 31, 2011, 04:22:03 pm »
this property to which I refer in this kind of gone back to edit this to manipulate the directories find on a snippet of code from bladeenc I'm trying to behave with his example to lazarus. fix some bugs in the code more this property is making life harder for me.

 the snippet of code is this:

 if DirectoryEdit1.Text [Length (DirectoryEdit1.Text)] <> '\' then
     OutputFileName:= DirectoryEdit1.LongName + = '\'+ ChangeFileExt (ExtractFileName (FileNameEdit1.filename). 'mp3')
   else
     OutputFileName:= DirectoryEdit1.LongName + ChangeFileExt (ExtractFileName (FileNameEdit1.filename). 'mp3');

Blaazen

  • Hero Member
  • *****
  • Posts: 3237
  • POKE 54296,15
    • Eye-Candy Controls
Re: TDirectoryEdit.Longname ?????????
« Reply #3 on: May 31, 2011, 04:45:21 pm »
So it is Delphi example.
You can use property Directory (instead of LongName) and DirectorySeparator (instead of '\', beacause in Unix it is '/')
Code: [Select]
if DirectoryEdit1.Text [Length (DirectoryEdit1.Text)] <> DirectorySeparator then
     OutputFileName:= DirectoryEdit1.Directory  + =  DirectorySeparator+ ChangeFileExt (ExtractFileName (FileNameEdit1.filename). 'mp3')
   else
     OutputFileName:=  DirectoryEdit1.Directory  + ChangeFileExt (ExtractFileName (FileNameEdit1.filename). 'mp3');
You should also check if the directory exists using function:
Code: [Select]
if DirectoryExists(DirectoryEdit1.Directory)=true then ....or you can make
Code: [Select]
DirectoryEdit1.ReadOnly:=true;(it will force users to select the path in dialog and not edit it directly)
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

eny

  • Hero Member
  • *****
  • Posts: 1634
Re: TDirectoryEdit.Longname ?????????
« Reply #4 on: May 31, 2011, 04:58:48 pm »
Code: Pascal  [Select][+][-]
  1. OutputFileName :=  AppendPathDelim(DirectoryEdit1.Directory )  +
  2.                    ChangeFileExt (ExtractFileName (FileNameEdit1.filename). 'mp3')
All posts based on: Win10 (Win64); Lazarus 2.0.10 'stable' (x64) unless specified otherwise...

snipexandy

  • Newbie
  • Posts: 3
Re: TDirectoryEdit.Longname ?????????
« Reply #5 on: June 01, 2011, 11:43:31 pm »
I tried using the AppendPathDelim this may appear the following error:
example1.pas . Error: Identifier not found "AppendPathDelim" But the function exists in file.pas. I'm still adapting to lazarus and know little about it the more I believe that the function to be declared for use. how can I do?
« Last Edit: June 01, 2011, 11:47:45 pm by snipexandy »

eny

  • Hero Member
  • *****
  • Posts: 1634
Re: TDirectoryEdit.Longname ?????????
« Reply #6 on: June 01, 2011, 11:51:13 pm »
Add unit FileUtil...
All posts based on: Win10 (Win64); Lazarus 2.0.10 'stable' (x64) unless specified otherwise...

CM630

  • Hero Member
  • *****
  • Posts: 1082
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: TDirectoryEdit.Longname ?????????
« Reply #7 on: November 20, 2018, 08:48:48 pm »
It is now in LazFileUtils.
Лазар 3,2 32 bit (sometimes 64 bit); FPC3,2,2; rev: Lazarus_3_0 on Win10 64bit.

 

TinyPortal © 2005-2018