SRL Archive - Extensions

Explore Folders


Quickmarch

2010-07-20 15:09:39

This is a basic extension I made that I find rather useful for quick access to Simba's core folders (Includes, plugins, etc).


program Explore_Folders;

const
APP_PATH_ITEM = 0;
INCLUDES_PATH_ITEM = 1;
PLUGINS_PATH_ITEM = 2;
EXTENSIONS_PATH_ITEM = 3;
FONTS_PATH_ITEM = 4;

var
ExploreFoldersItem: TMenuItem;
DirectoryItems: array [0..4] of TMenuItem;

procedure OpenDirectory(Path: String);
begin
OpenWebPage('file:'+Path);
end;

procedure ClickDir(Sender: TObject);
begin
case (Sender) of
DirectoryItems[APP_PATH_ITEM]: OpenDirectory(AppPath);
DirectoryItems[INCLUDES_PATH_ITEM]: OpenDirectory(IncludePath);
DirectoryItems[PLUGINS_PATH_ITEM]: OpenDirectory(PluginPath);
DirectoryItems[EXTENSIONS_PATH_ITEM]: OpenDirectory(ScriptPath);
DirectoryItems[FONTS_PATH_ITEM]: OpenDirectory(FontPath);
end;
end;

procedure Init;
var
i: Integer;
labels: TStringArray;

begin;
ExploreFoldersItem := TMenuItem.Create(Simba_MainMenu);
ExploreFoldersItem.Caption := 'Explore Folders';

Simba_MainMenu.Items.Items[4].Add(ExploreFoldersItem);

labels := ['Simba Folder', 'Includes Folder', 'Plugins Folder', 'Extensions Folder', 'Fonts Folder'];

for i := 0 to High(labels) do
begin
DirectoryItems[i] := TMenuItem.Create(ExploreFoldersItem);
DirectoryItems[i].Caption := labels[i];
DirectoryItems[i].OnClick := @ClickDir;

ExploreFoldersItem.Add(DirectoryItems[i]);
end;
end;

procedure Free;
begin
end;

procedure Attach;
begin;
ExploreFoldersItem.Visible := True;
end;

Procedure Detach;
begin
ExploreFoldersItem.Visible := False;
end;

function GetName: String;
begin;
result := 'Explore Folders';
end;

function GetVersion: String;
begin;
result := '1.0';
end;

begin
end.

It was one of the features I liked about SCAR. :p

Nava2

2010-07-20 17:11:46

Perhaps have it load all the different folders in folders as it goes, and add them to the TMenu. Then just refresh it using a TTimer every say.. minute?

Would be a cool extension.

Avoids the need for a OpenDialog. (Which you should use rather than OpenWebpage)

Wizzup?

2010-07-20 17:19:17

Cool! The first user contributed Simba extension. :)

Coh3n

2010-07-22 06:17:34

Sweet! :) Is it supposed to compile in Simba? Because I get unknown identifier Simba_MainMenu…

Wizzup?

2010-07-22 06:25:10

From: Coh3n
Sweet! :) Is it supposed to compile in Simba? Because I get unknown identifier Simba_MainMenu…


You should not get this if you use it as extension.

Coh3n

2010-07-22 18:42:18

From: Wizzup?
You should not get this if you use it as extension.

Ohh I see. I love this, nice job Quick. ;)

Wizzup?

2010-08-11 08:05:24

Anyway, I think it would be a good idea to include this in the Script/Extension manager. So people can download this extension if they want to.

Quickmarch

2010-08-11 14:01:37

Sounds good to me. :)

Narcle

2010-08-12 18:41:16

Should be called "Quick Explore" oddly enough I didn't notice his name until after I thought of it. Since its a faster way to go to the folders.

Tweaked correctly this will be VERY handy. I know I'm always opening Simba / my script folder to get to stuff.

Quickmarch

2010-08-13 03:34:39

From: Narcle
Should be called "Quick Explore" oddly enough I didn't notice his name until after I thought of it. Since its a faster way to go to the folders.

Tweaked correctly this will be VERY handy. I know I'm always opening Simba / my script folder to get to stuff.


What things need tweaking?