aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Source/Framestein.dof4
-rw-r--r--Source/mainunit.dfm9
-rw-r--r--Source/mainunit.pas3
-rw-r--r--Source/toolbarunit.dfm39
-rw-r--r--Source/toolbarunit.pas48
5 files changed, 73 insertions, 30 deletions
diff --git a/Source/Framestein.dof b/Source/Framestein.dof
index ef8795e..d3f985b 100644
--- a/Source/Framestein.dof
+++ b/Source/Framestein.dof
@@ -85,8 +85,8 @@ Count=1
Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
[HistoryLists\hlSearchPath]
Count=7
-Item0=e:\lab\common\fastlib;e:\lab\common\pshost;e:\lab\common\G32;e:\fs\framestein\source
-Item1=E:\lab\common\DelphiX2000_0717-2\Source;E:\lab\common\fastlib;E:\lab\common\pshost;E:\lab\common\G32;e:\fs\framestein\source
+Item0=E:\lab\common\DelphiX2000_0717-2\Source;E:\lab\common\fastlib;E:\lab\common\pshost;E:\lab\common\G32;E:\fs\Framestein\Source
+Item1=e:\lab\common\fastlib;e:\lab\common\pshost;e:\lab\common\G32;e:\fs\framestein\source
Item2=e:\lab\common\fastlib;e:\lab\common\pshost;e:\lab\common\G32
Item3=g:\lab\common\fastlib;G:\lab\common\pshost;G:\lab\common\G32
Item4=g:\lab\common\fastlib;G:\lab\common\pshost
diff --git a/Source/mainunit.dfm b/Source/mainunit.dfm
index f5d438e..db5836a 100644
--- a/Source/mainunit.dfm
+++ b/Source/mainunit.dfm
@@ -1,6 +1,6 @@
object main: Tmain
- Left = 16
- Top = 497
+ Left = 31
+ Top = 502
Width = 239
Height = 223
Caption = 'Framestein'
@@ -3490,9 +3490,11 @@ object main: Tmain
OnClientDisconnect = ss1ClientDisconnect
OnClientRead = ss1ClientRead
OnClientError = ss1ClientError
+ Top = 96
end
object PopupMenu1: TPopupMenu
Left = 64
+ Top = 96
object MiConfig: TMenuItem
Caption = 'Configure'
OnClick = MiConfigClick
@@ -3506,7 +3508,7 @@ object main: Tmain
OnClick = MiReloadPluginsClick
end
object MiToolbar: TMenuItem
- Caption = 'Show Toolbar'
+ Caption = 'Show Tools && Filters'
OnClick = MiToolbarClick
end
object MiLog: TMenuItem
@@ -3547,5 +3549,6 @@ object main: Tmain
OnDisconnect = csToPdDisconnect
OnError = csToPdError
Left = 32
+ Top = 96
end
end
diff --git a/Source/mainunit.pas b/Source/mainunit.pas
index aebb64b..de1ef70 100644
--- a/Source/mainunit.pas
+++ b/Source/mainunit.pas
@@ -18,7 +18,7 @@ uses
StdCtrls, ScktComp,
pluginunit, fsformunit, fsframeunit,
FastDIB,
- ExtCtrls, Menus, C2PhotoShopHost, Filez, ComCtrls;
+ ExtCtrls, Menus, C2PhotoShopHost, Filez, ComCtrls, Buttons;
type
Tmain = class(TFsForm)
@@ -540,6 +540,7 @@ end;
procedure Tmain.MiReloadPluginsClick(Sender: TObject);
begin
Plugins.Reload;
+ Toolbar.UpdateLists;
end;
function Tmain.GetFrameByTag(const tag: String): TFsFrame;
diff --git a/Source/toolbarunit.dfm b/Source/toolbarunit.dfm
index aa778f0..814fc8e 100644
--- a/Source/toolbarunit.dfm
+++ b/Source/toolbarunit.dfm
@@ -1,8 +1,8 @@
object toolbar: Ttoolbar
- Left = 264
- Top = 234
- Width = 325
- Height = 493
+ Left = 188
+ Top = 106
+ Width = 572
+ Height = 496
BorderStyle = bsSizeToolWin
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
@@ -11,13 +11,15 @@ object toolbar: Ttoolbar
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
+ Position = poScreenCenter
+ OnClose = FormClose
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object bar: TStatusBar
Left = 0
- Top = 447
- Width = 317
+ Top = 450
+ Width = 564
Height = 19
Panels = <>
SimplePanel = False
@@ -25,8 +27,8 @@ object toolbar: Ttoolbar
object Panel3: TPanel
Left = 0
Top = 0
- Width = 317
- Height = 447
+ Width = 564
+ Height = 450
Align = alClient
BevelOuter = bvNone
Caption = 'Panel3'
@@ -34,18 +36,19 @@ object toolbar: Ttoolbar
object PageControl1: TPageControl
Left = 0
Top = 0
- Width = 318
- Height = 448
+ Width = 565
+ Height = 451
ActivePage = TabSheet1
Anchors = [akLeft, akTop, akRight, akBottom]
TabOrder = 0
+ OnChange = PageControl1Change
object TabSheet1: TTabSheet
Caption = 'Tools'
object Panel2: TPanel
Left = 0
Top = 0
- Width = 310
- Height = 420
+ Width = 557
+ Height = 423
Align = alClient
BevelOuter = bvNone
Caption = 'Panel2'
@@ -53,8 +56,8 @@ object toolbar: Ttoolbar
object LVTools: TListView
Left = 0
Top = 0
- Width = 310
- Height = 420
+ Width = 557
+ Height = 423
Align = alClient
BorderStyle = bsNone
Color = clBtnFace
@@ -83,8 +86,8 @@ object toolbar: Ttoolbar
object Panel1: TPanel
Left = 0
Top = 0
- Width = 310
- Height = 420
+ Width = 557
+ Height = 423
Align = alClient
BevelOuter = bvNone
Caption = 'Panel1'
@@ -92,8 +95,8 @@ object toolbar: Ttoolbar
object LVFilters: TListView
Left = 0
Top = 0
- Width = 310
- Height = 420
+ Width = 557
+ Height = 423
Align = alClient
BorderStyle = bsNone
Color = clBtnFace
diff --git a/Source/toolbarunit.pas b/Source/toolbarunit.pas
index c479260..39bd20a 100644
--- a/Source/toolbarunit.pas
+++ b/Source/toolbarunit.pas
@@ -31,11 +31,14 @@ type
Selected: Boolean);
procedure sdHandleFile(const SearchRec: TSearchRec;
const FullPath: String);
+ procedure FormClose(Sender: TObject; var Action: TCloseAction);
+ procedure PageControl1Change(Sender: TObject);
private
{ Private declarations }
SendKey: TSendKey;
public
{ Public declarations }
+ procedure UpdateLists;
end;
var
@@ -60,24 +63,26 @@ begin
end;
end;
-procedure Ttoolbar.FormCreate(Sender: TObject);
+procedure Ttoolbar.UpdateLists;
var
i: Integer;
begin
- // Load tools
+ // Load tools
if FileExists(main.FSFolder+'\toolbar.txt') then begin
+ LVTools.Items.Clear;
m1.Lines.LoadFromFile(main.FSFolder+'\toolbar.txt');
if m1.Lines.Count>0 then
for i:=0 to m1.Lines.Count-1 do begin
with LVTools.Items.Add do begin
- Caption := ExtractWord(1, m1.Lines[i], [' ']);
+ Caption := ExtractWord(1, m1.Lines[i], [';']);
Data := Pointer(i);
end;
end;
end;
// Load plugins
- if main.Plugins.Names.Count>0 then
+ if main.Plugins.Names.Count>0 then begin
+ LVFilters.Items.Clear;
for i:=0 to main.Plugins.Names.Count-1 do begin
with LVFilters.Items.Add do begin
Caption := main.Plugins.Names[i];
@@ -85,12 +90,17 @@ begin
Data := Pointer(i);
end;
end;
+ end;
// Load photoshop-filters
sd.Scan(main.FSFolder+'\Filters');
+end;
+procedure Ttoolbar.FormCreate(Sender: TObject);
+begin
+ UpdateLists;
SendKey := TSendKey.Create(Self);
- Show;
+// Show;
end;
const
@@ -99,9 +109,18 @@ const
procedure Ttoolbar.LVFiltersChange(Sender: TObject; Item: TListItem;
Change: TItemChange);
begin
+
+(* Trying to provide "paste objects to patches" feature,
+ real toolbar-style, but:
+
+ disabled together with CustomDrawItem -
+ doesn't work well enough, might introduce new bugs etc.
+
if Item.Selected then
it := item;
if Item.ListView.Selected=nil then it:=nil;
+*)
+
end;
procedure Ttoolbar.LVFiltersCustomDrawItem(Sender: TCustomListView;
@@ -111,6 +130,9 @@ var
s: String;
h: THandle;
begin
+
+(* NOT GOOD ENOUGH
+
if (it=nil) or (Item.Caption='') then Exit;
if it.Caption=item.Caption then begin
Sleep(50); // wait for pd window to get focus
@@ -128,11 +150,14 @@ begin
SendKey.TitleText := S;
SendKey.Keys := '{^1}'+Item.Caption;
SendKey.execute;
+// Self.Hide;
end;
Item.ListView.Selected := nil;
end;
end;
end;
+*)
+
end;
procedure Ttoolbar.LVFiltersSelectItem(Sender: TObject; Item: TListItem;
@@ -161,9 +186,20 @@ begin
i := Integer(Item.Data);
if (i>=0) and (i<m1.Lines.Count) then begin
S := m1.Lines[i];
- if Pos(' ', S)>0 then Delete(S, 1, Pos(' ', S));
+ if Pos(';', S)>0 then Delete(S, 1, Pos(';', S));
bar.SimpleText := S;
end;
end;
+procedure Ttoolbar.FormClose(Sender: TObject; var Action: TCloseAction);
+begin
+ main.MiToolbar.Checked := False;
+end;
+
+procedure Ttoolbar.PageControl1Change(Sender: TObject);
+begin
+ bar.SimpleText := '';
+end;
+
end.
+