LordJashin
03-23-2012, 01:03 AM
Problem Solved - Had to add this "SimplePanel := False;" to the TStatusBar
I can't get them to work, they might be bugged. The Status bar works, but panels don't I looked at Dan Cardins use of them in SCAR. They however do not work the same in Simba.
Dan's Form Tut - http://wiki.freddy1990.com/index.php?title=SCAR_Manual:the_form_tutorial
Here's my code
going to try to automate simba more.
Ima go check Simba's source aswell, if anyone knows what file Simba's Status bar is in let me know please.
// Alpha stage
program TheSimbaAutoingProgram;
const
IMAGESFOLDER = 'Images/';
var
i, x, y, w, h: Integer;
MainForm: TForm;
MainMenu: TMainMenu;
MainMenuItems: Array [0..5] of TMenuItem;
MainStatusBar: TStatusBar;
CoordsPanel, CurrentActionPanel: TStatusPanel; // Wont work atm
Button: Array [0..1] of TBUTTON;
//
procedure InitForm; // Form Design ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
begin
SetDesktopAsClient;
GetClientDimensions(w, h);
MainForm := TForm.Create(nil); // Main Form
with MainForm do
begin
Position := poMainFormCenter;
Width := 750;
Height := 750;
Caption := 'The Simba Autoing Program';
end;
MainMenu := TMainMenu.Create(MainForm); // Main Menu
with MainMenu do
begin
end;
for i := 0 to 3 do
begin
MainMenuItems[i] := TMenuItem.Create(MainForm); // Main Menu Items
with MainMenuItems[i] do
case i of
0: Caption := 'File';
1: Caption := 'Tools';
2: Caption := 'Options';
3: Caption := 'Help';
end;
MainMenu.Items.Add(MainMenuItems[i]);
end;
MainStatusBar := TStatusBar.Create(MainForm); // Main Status Bar
with MainStatusBar do
begin
Parent := MainForm;
Caption := 'lalala';
SimplePanel := False; //////////////////////////////////// THIS FIXED IT
end;
CoordsPanel := MainStatusBar.Panels.Add; // Coords panel
with CoordsPanel do
begin
Alignment:= taLeftJustify;
Width := 20;
Text := 'Lmao';
end;
CurrentActionPanel := MainStatusBar.Panels.Add; // Current Action Panel
with CurrentActionPanel do
begin
Width := 20;
Text := 'Done';
end;
for i := 0 to 1 do
Button[i] := TBUTTON.Create(MainForm);
end;
procedure SafeInitForm;
var
v: TVariantArray;
begin
SetArrayLength(v, 0);
ThreadSafeCall('InitForm', v);
end;
procedure ShowFormModal;
begin
MainForm.ShowModal;
end;
procedure SafeShowFormModal;
var
v: TVariantArray;
begin
SetArrayLength(V, 0);
ThreadSafeCall('ShowFormModal', v);
end;
procedure LoadForm;
begin
ClearDebugImg;
ClearDebug;
SafeInitForm; // those 2 function are the action form setup. Thise one creates your form
SafeShowFormModal; // and this one makes it visible
end;
begin
LoadForm;
end.
I can't get them to work, they might be bugged. The Status bar works, but panels don't I looked at Dan Cardins use of them in SCAR. They however do not work the same in Simba.
Dan's Form Tut - http://wiki.freddy1990.com/index.php?title=SCAR_Manual:the_form_tutorial
Here's my code
going to try to automate simba more.
Ima go check Simba's source aswell, if anyone knows what file Simba's Status bar is in let me know please.
// Alpha stage
program TheSimbaAutoingProgram;
const
IMAGESFOLDER = 'Images/';
var
i, x, y, w, h: Integer;
MainForm: TForm;
MainMenu: TMainMenu;
MainMenuItems: Array [0..5] of TMenuItem;
MainStatusBar: TStatusBar;
CoordsPanel, CurrentActionPanel: TStatusPanel; // Wont work atm
Button: Array [0..1] of TBUTTON;
//
procedure InitForm; // Form Design ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
begin
SetDesktopAsClient;
GetClientDimensions(w, h);
MainForm := TForm.Create(nil); // Main Form
with MainForm do
begin
Position := poMainFormCenter;
Width := 750;
Height := 750;
Caption := 'The Simba Autoing Program';
end;
MainMenu := TMainMenu.Create(MainForm); // Main Menu
with MainMenu do
begin
end;
for i := 0 to 3 do
begin
MainMenuItems[i] := TMenuItem.Create(MainForm); // Main Menu Items
with MainMenuItems[i] do
case i of
0: Caption := 'File';
1: Caption := 'Tools';
2: Caption := 'Options';
3: Caption := 'Help';
end;
MainMenu.Items.Add(MainMenuItems[i]);
end;
MainStatusBar := TStatusBar.Create(MainForm); // Main Status Bar
with MainStatusBar do
begin
Parent := MainForm;
Caption := 'lalala';
SimplePanel := False; //////////////////////////////////// THIS FIXED IT
end;
CoordsPanel := MainStatusBar.Panels.Add; // Coords panel
with CoordsPanel do
begin
Alignment:= taLeftJustify;
Width := 20;
Text := 'Lmao';
end;
CurrentActionPanel := MainStatusBar.Panels.Add; // Current Action Panel
with CurrentActionPanel do
begin
Width := 20;
Text := 'Done';
end;
for i := 0 to 1 do
Button[i] := TBUTTON.Create(MainForm);
end;
procedure SafeInitForm;
var
v: TVariantArray;
begin
SetArrayLength(v, 0);
ThreadSafeCall('InitForm', v);
end;
procedure ShowFormModal;
begin
MainForm.ShowModal;
end;
procedure SafeShowFormModal;
var
v: TVariantArray;
begin
SetArrayLength(V, 0);
ThreadSafeCall('ShowFormModal', v);
end;
procedure LoadForm;
begin
ClearDebugImg;
ClearDebug;
SafeInitForm; // those 2 function are the action form setup. Thise one creates your form
SafeShowFormModal; // and this one makes it visible
end;
begin
LoadForm;
end.