Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-09

Lazarus addon - File Browser

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi,

I created a File Browser addon for Lazarus (thanks MvC for IDE integration). See attached screenshot.

The last feature I need to add before I contribute the code, is drive letter support under Windows. I know how to find those, as I have done it before in fpGUI's File-Open Dialog.

My problem is, how am I supposed to implement platform specific code in a Lazarus addon? Am I allowed to use IFDEFs?

eg;
{$IFDEF MSWINDOWS}
   .... get available drive letters...
{$ELSE}
   .... return / ...
{$ENDIF}

As a matter of interest, here is a quick list of future extensions or improvements which can be implemented for the File Browser. I'm sure you guys will can think of more...

* File filter support (*.pp, *.pas et...)
* Eye-candy - icons in the treeview and filelistbox
* Source Control integration (SubVersion etc..)
* Directory bookmark support
* Dialog position persistence via IDE (Environment Options | Windows tab)

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FileBrowser.png
Type: image/png
Size: 6814 bytes
Desc: not available
Url : http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080917/7d7c52ab/attachment-0001.png

Reply by email

Graeme Geldenhuys
to Mattias Gärtner
Mattias G?rtner wrote 5 lines
> My problem is, how am I supposed to implement platform specific code > in a Lazarus addon? Am I allowed to use IFDEFs? > Yes.

OK, done!

Show quoted text 12 lines
> * Dialog position persistence via IDE (Environment Options | Windows tab) This is for windows only. For dialogs use: uses IDEWindowIntf; FormCreate IDEDialogLayoutList.ApplyLayout(Self); FormDestroy IDEDialogLayoutList.SaveLayout(Self);

My mistake for calling it a "dialog" when in fact it is a "window". File Browser is the same as the Object Inspector or Messages windows - a window that is left open while working in your code. Michael was kind enough to add the above mentioned code (applying to dialogs), but in fact it it should integrate with the IDE's Window Positions list, saving/restoring size *and* position. The XXXLayout() seems to only store size.

Any hints on how I integrate it into the "window list"? I know I did this before, months ago, but that was for windows that are built into the IDE (as standard). File Browser is an addon.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email