If u don't want to read whole text then jump to the end. There's short discription and binary file to download.
-------------------------------------------------------------------------------
Jump to current (active) screen setup
-------------------------------------------------------------------------------
File: USetup.pas / procedure: TSetupForm.FormShow(Sender: TObject);
change this:
Code: Select all
ScreenSpinEdit.MaxValue := MaxScreens;
ScreenSpinEdit.Value := 1;
CurrentScreen := 1;
//CurrentScreen := activescreen;
//ScreenSpinEdit.Value := activescreen;
LoadScreen( CurrentScreen ); // setup screen in setup form
LCDSmartieDisplayForm.ChangeScreen(CurrentScreen); // setup screen in main form
Code: Select all
ScreenSpinEdit.MaxValue := MaxScreens;
CurrentScreen := 0; // skip saving previous screen
ScreenSpinEdit.Value := activeScreen;
LoadScreen(activeScreen); // setup screen in setup form
LCDSmartieDisplayForm.ChangeScreen(activeScreen); // setup screen in main form
Code: Select all
...
begin
if scr = 0 then Exit;
...
This line "ScreenSpinEdit.Value := 1;" won't trigger this procedure "ScreenSpinEditChange(Sender: TObject);" because "ScreenSpinEdit.Value" on form = 1. When we try change it to <> 1 (e.g. activeScreen), procedure "SaveScreen(scr: Integer);" from "ScreenSpinEditChange(Sender: TObject);" is executed but there is no previous screen to save and error occurs.
-------------------------------------------------------------------------------
Network stats > 9
-------------------------------------------------------------------------------
File: UDataNetwork.pas
change:
Code: Select all
const
MAXNETSTATS = 10;
Code: Select all
const
MAXNETSTATS = 50;
-------------------------------------------------------------------------------
Position of editing window (double click edit fields on setup form)
Center on screen when form.ini is empty or not exists
-------------------------------------------------------------------------------
File: UEditLine.pas / procedure: TFormEdit.EditClose(Sender: TObject; var Action: TCloseAction);
change to:
Code: Select all
var
FEdit: TFormEdit;
Pos : TFormPos;
begin
FEdit := Sender AS TFormEdit;
Pos := TFormPos.Create('forms.ini');
Pos.Tag := 'edit';
Pos.Width := FEdit.Width;
Pos.Height := Fedit.Height;
Pos.Left := Fedit.Left;
Pos.Top := FEdit.Top;
Pos.save;
end;
change to:
Code: Select all
var
oEdit : TEdit;
oPos : TFormPos;
begin
oEdit := Sender as TEdit;
oEditForm := TFormEdit.Create(nil);
with oEditForm do begin
Memo1.Text := oEdit.Text;
oPos := TFormPos.Create('forms.ini');
oPos.Tag := 'edit';
oPos.load;
Width := oPos.Width;
Height := oPos.Height;
if oPos.Top = -1 then
Top := GetSystemMetrics(SM_CYSCREEN) div 2 - Height div 2
else
Top := oPos.Top;
if oPos.Left = -1 then
Left := GetSystemMetrics(SM_CXSCREEN) div 2 - Width div 2
else
Left := oPos.Left;
ShowModal;
if ModalResult = mrOk then
oEdit.Text := TrimRight(Memo1.Text);
oEdit.SelLength :=0 ;
Free;
end;
oEditForm := nil;
end;
-------------------------------------------------------------------------------
Center main form when form.ini doesn't exists
-------------------------------------------------------------------------------
File: UMain.pas / procedure: TLCDSmartieDisplayForm.FormCreate(Sender: TObject);
Change:
Code: Select all
...
// restore last form position
oPos := TFormPos.Create('forms.ini');
oPos.Tag := 'main';
oPos.load;
if ((oPos.Top <> -1) and (oPos.Left <> -1)) then
begin
LCDSmartieDisplayForm.Top := oPos.Top;
LCDSmartieDisplayForm.Left := oPos.Left;
end;
end;
Code: Select all
...
// restore last form position
oPos := TFormPos.Create('forms.ini');
oPos.Tag := 'main';
oPos.load;
if oPos.Top = -1 then
LCDSmartieDisplayForm.Top := GetSystemMetrics(SM_CYSCREEN) div 2 - LCDSmartieDisplayForm.Height div 2
else
LCDSmartieDisplayForm.Top := oPos.Top;
if oPos.Left = -1 then
LCDSmartieDisplayForm.Left := GetSystemMetrics(SM_CXSCREEN) div 2 - LCDSmartieDisplayForm.Width div 2
else
LCDSmartieDisplayForm.Left := oPos.Left;
end;
Add new buttons to Actions tab (Move Up, Move Down, Clear All, Modify aka Save changes)
--------------------------------------------------------------------------------------------------------------
File: USetup.pas / add procedure for Move Up button
Code: Select all
var
TempStringGrid: TStringGrid;
begin
if (ActionsStringGrid.Row > 0) and (Trim(ActionsStringGrid.Rows[ActionsStringGrid.Row].Text) <> '') then
begin
TempStringGrid := TStringGrid.Create(nil);
TempStringGrid.Rows[0] := ActionsStringGrid.Rows[ActionsStringGrid.Row];
ActionsStringGrid.Rows[ActionsStringGrid.Row].Assign(ActionsStringGrid.Rows[ActionsStringGrid.Row - 1]);
ActionsStringGrid.Rows[ActionsStringGrid.Row - 1] := TempStringGrid.Rows[0];
ActionsStringGrid.Row := ActionsStringGrid.Row - 1;
TempStringGrid.Free;
end;
end;
Code: Select all
var
TempStringGrid: TStringGrid;
begin
if (ActionsStringGrid.Row < ActionsStringGrid.RowCount -1) and (Trim(ActionsStringGrid.Rows[ActionsStringGrid.Row +1].Text) <> '') then
begin
TempStringGrid := TStringGrid.Create(nil);
TempStringGrid.Rows[0] := ActionsStringGrid.Rows[ActionsStringGrid.Row];
ActionsStringGrid.Rows[ActionsStringGrid.Row].Assign(ActionsStringGrid.Rows[ActionsStringGrid.Row + 1]);
ActionsStringGrid.Rows[ActionsStringGrid.Row + 1] := TempStringGrid.Rows[0];
ActionsStringGrid.Row := ActionsStringGrid.Row + 1;
TempStringGrid.Free;
end;
end;
Code: Select all
var
i: integer;
begin
for i := 0 to ActionsStringGrid.RowCount - 1 do
ActionsStringGrid.Rows[i].Clear;
ActionsStringGrid.RowCount := 1;
Operand1Edit.Text := '';
Operand2Edit.Text := '';
StatementEdit.Text := '';
end;
Code: Select all
procedure TSetupForm.Button4Click(Sender: TObject);
begin
if (Operand1Edit.text <> '') and (OperatorComboBox.ItemIndex <> -1)
and (Operand2Edit.text <> '') and (StatementEdit.text <> '') then
begin
if Trim(ActionsStringGrid.Rows[ActionsStringGrid.Row].Text) = '' then
ActionsStringGrid.RowCount := ActionsStringGrid.RowCount + 1;
ActionsStringGrid.Cells[0, ActionsStringGrid.Row] := Operand1Edit.text;
ActionsStringGrid.Cells[1, ActionsStringGrid.Row] :=
OperatorComboBox.Items.Strings[OperatorComboBox.ItemIndex];
ActionsStringGrid.Cells[2, ActionsStringGrid.Row] := Operand2Edit.text;
ActionsStringGrid.Cells[3, ActionsStringGrid.Row] := 'then';
ActionsStringGrid.Cells[4, ActionsStringGrid.Row] := StatementEdit.text;
end;
end;
File: USetup.pas / procedure: TSetupForm.FormShow(Sender: TObject);
after this code:
Code: Select all
...
for i := 1 to config.totalactions do
begin
Operand1Edit.text := config.actionsArray[i, 1];
OperatorComboBox.itemindex := StrToInt(config.actionsArray[i, 2]);
Operand2Edit.text := config.actionsArray[i, 3];
StatementEdit.text := config.actionsArray[i, 4];
ActionAddButton.click;
end;
Code: Select all
ActionsStringGridClick(nil); // load first row to edit fields instead of leaving last one with selected first row
Code: Select all
if ActionsStringGrid.RowCount > 1 then
ActionsStringGrid.Row := ActionsStringGrid.RowCount - 2; // select the last row according to edit fields
Code: Select all
ActionsStringGrid > Options > goRangeSelect > False
Operand2Edit > Text > Leave this empty
StatementEdit > Text > Leave this empty
File: USetup.pas / procedure: TSetupForm.MainPageControlChange(Sender: TObject);
delete this line:
Code: Select all
OperatorComboBox.ItemIndex := 0;
Code: Select all
if OperatorComboBox.ItemIndex = -1 then
OperatorComboBox.ItemIndex := 0;
Window blinking on program startup when start hidden is activated
----------------------------------------------------------------------------------
First, add global variable to UMain.pas:
Code: Select all
ShowWindowFlag: Boolean;
change to this:
Code: Select all
...
Application.ShowMainForm := False;
Application.CreateForm(TLCDSmartieDisplayForm, LCDSmartieDisplayForm);
...
delete from this procedure:
Code: Select all
if (config.bHideOnStartup) then
InitialWindowState := HideMainForm;
Code: Select all
...
if not (config.bHideOnStartup) and (ShowWindowFlag) then
LCDSmartieDisplayForm.Show;
end;
change this procedure to:
Code: Select all
var
I: integer;
parameter: String;
begin
ShowWindowFlag := True;
i := 1;
while (i <= ParamCount) do
begin
parameter := LowerCase(ParamStr(i));
if (parameter = '-hide') then
ShowWindowFlag := False;
if (parameter = '-totalhide') then
ShowWindowFlag := False;
if (parameter = '-config') then
begin
Inc(i);
ConfigFileName := ParamStr(i); // will give '' if out of range
end;
Inc(i);
end;
end;
remove from this procedure:
Code: Select all
if (InitialWindowState <> NoChange) then
begin
case InitialWindowState of
HideMainForm : Application.Minimize;
TotalHideMainForm : CoolTrayIcon1.HideMainForm;
end;
InitialWindowState := NoChange;
end;
OK, that's all for now. Hope that someone will find it useful.
-------------------------------------------------------------------------------
Short list of changes:
-Jump to current (active) screen setup
-Network stats > 9
-Save position of dialog used with edit fields
-Form autocenter on first start (without forms.ini)
-Removed window blinking on program startup when start hidden is activated
-Add new buttons to Actions tab (Move Up, Move Down, Clear All, Modify aka Save changes)
-New misc button on screen setup: copy, paste, clear - all fields
-Change refresh time for actions (misc tab)
I have compiled LCD Smartie with those fixes so if someone want to try, here's a link: ge.tt/9XRBthG1/v/0
----------------------------------------------------
It seems Smartie is dead. Too bad...