Skip to content

Commit

Permalink
Working on Deskew GUI:
Browse files Browse the repository at this point in the history
- misc fixes before first release
- app icon
  • Loading branch information
galfar committed Nov 16, 2018
1 parent 2f8502f commit cd10d44
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 71 deletions.
7 changes: 4 additions & 3 deletions Gui/aboutform.lfm
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,19 @@ object FormAbout: TFormAbout
Caption = 'About Deskew GUI'
ClientHeight = 231
ClientWidth = 390
Color = clWindow
Color = clWhite
OnCreate = FormCreate
Position = poMainFormCenter
LCLVersion = '1.8.4.0'
object Image1: TImage
object ImageIcon: TImage
Left = 14
Height = 150
Top = 24
Width = 150
AntialiasingMode = amOn
Center = True
Proportional = True
Stretch = True
Transparent = True
end
object BtnClose: TButton
Expand All @@ -45,7 +47,6 @@ object FormAbout: TFormAbout
Height = 30
Top = 24
Width = 118
AutoSize = False
Caption = 'Deskew GUI'
Font.Color = 11428096
Font.Height = 30
Expand Down
12 changes: 11 additions & 1 deletion Gui/aboutform.pas
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ interface

TFormAbout = class(TForm)
BtnClose: TButton;
Image1: TImage;
ImageIcon: TImage;
Label1: TLabel;
LabWeb: TLabel;
LabTitle: TLabel;
Expand Down Expand Up @@ -44,8 +44,18 @@ procedure TFormAbout.BtnCloseClick(Sender: TObject);
end;

procedure TFormAbout.FormCreate(Sender: TObject);
var
Icon: TIcon;
begin
LabVersion.Caption := 'v' + Module.VersionString;

Icon := TIcon.Create;
try
Icon.LoadFromResourceName(HInstance, 'MAINICON');
ImageIcon.Picture.Assign(Icon);
finally
Icon.Free;
end;
end;

procedure TFormAbout.LabWebClick(Sender: TObject);
Expand Down
Binary file added Gui/deskewgui.ico
Binary file not shown.
9 changes: 7 additions & 2 deletions Gui/deskewgui.lpi
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@
<Title Value="Deskew GUI"/>
<ResourceType Value="res"/>
<UseXPManifest Value="True"/>
<XPManifest>
<TextName Value="GalfarsLair.DeskewGui"/>
<TextDesc Value="Deskew GUI"/>
</XPManifest>
<Icon Value="0"/>
</General>
<VersionInfo>
<UseVersionInfo Value="True"/>
<MinorVersionNr Value="80"/>
<StringTable CompanyName="Galfar's Lair" FileDescription="Deskew GUI" ProductName="Deskew GUI" ProductVersion="0.72.0.0"/>
<MinorVersionNr Value="88"/>
<StringTable CompanyName="Galfar's Lair" FileDescription="Deskew GUI" ProductName="Deskew GUI" ProductVersion=""/>
</VersionInfo>
<BuildModes Count="2">
<Item1 Name="Debug" Default="True"/>
Expand Down Expand Up @@ -124,6 +128,7 @@
<Filename Value="aboutform.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="FormAbout"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="AboutForm"/>
</Unit8>
Expand Down
101 changes: 40 additions & 61 deletions Gui/mainform.lfm
Original file line number Diff line number Diff line change
Expand Up @@ -270,13 +270,12 @@ object FormMain: TFormMain
object PageOut: TPage
object Panel2: TPanel
Left = 0
Height = 90
Height = 102
Top = 0
Width = 505
Align = alTop
AutoSize = True
BevelOuter = bvNone
ClientHeight = 90
ClientHeight = 102
ClientWidth = 505
TabOrder = 0
object LabDeskewProgressTitle: TLabel
Expand All @@ -297,7 +296,7 @@ object FormMain: TFormMain
object ProgressBar: TProgressBar
Left = 8
Height = 20
Top = 60
Top = 72
Width = 489
Align = alBottom
BorderSpacing.Left = 8
Expand All @@ -310,66 +309,46 @@ object FormMain: TFormMain
Smooth = True
TabOrder = 0
end
object FlowPanel1: TFlowPanel
Left = 0
Height = 21
Top = 31
Width = 505
Align = alClient
AutoSize = True
BevelOuter = bvNone
ControlList = <
item
Control = LabProgressTitle
WrapAfter = waAuto
Index = 0
end
item
Control = LabCurrentFile
WrapAfter = waAuto
Index = 1
end>
FlowLayout = tlBottom
FlowStyle = fsLeftRightTopBottom
TabOrder = 1
object LabProgressTitle: TLabel
Left = 8
Height = 15
Top = 6
Width = 62
BorderSpacing.Left = 8
BorderSpacing.Right = 4
Caption = 'Current file:'
Layout = tlBottom
ParentColor = False
end
object LabCurrentFile: TLabel
AnchorSideTop.Control = LabProgressTitle
AnchorSideTop.Side = asrBottom
Left = 74
Height = 21
Top = 0
Width = 424
Anchors = [akTop]
AutoSize = False
Caption = 'FileName.ext [22/152]'
Font.Height = 20
Font.Style = [fsBold]
Layout = tlBottom
ParentColor = False
ParentFont = False
end
object LabProgressTitle: TLabel
Left = 8
Height = 15
Top = 44
Width = 62
BorderSpacing.Left = 8
BorderSpacing.Right = 4
Caption = 'Current file:'
Layout = tlBottom
ParentColor = False
end
object LabCurrentFile: TLabel
AnchorSideLeft.Control = LabProgressTitle
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Side = asrBottom
AnchorSideBottom.Control = LabProgressTitle
AnchorSideBottom.Side = asrBottom
Left = 75
Height = 20
Top = 39
Width = 160
Anchors = [akLeft, akBottom]
BorderSpacing.Left = 5
Caption = 'FileName.ext [22/152]'
Font.Height = 20
Font.Style = [fsBold]
Layout = tlBottom
ParentColor = False
ParentFont = False
end
end
object Panel3: TPanel
Left = 0
Height = 611
Top = 90
Height = 599
Top = 102
Width = 505
Align = alClient
BorderSpacing.Bottom = 18
BevelOuter = bvNone
ClientHeight = 611
ClientHeight = 599
ClientWidth = 505
TabOrder = 1
object Label3: TLabel
Expand All @@ -389,7 +368,7 @@ object FormMain: TFormMain
end
object MemoOutput: TMemo
Left = 0
Height = 580
Height = 568
Top = 31
Width = 505
Align = alClient
Expand Down Expand Up @@ -420,12 +399,12 @@ object FormMain: TFormMain
object ApplicationProperties: TApplicationProperties
Title = 'Deskew GUI'
OnIdle = ApplicationPropertiesIdle
left = 264
top = 96
left = 176
top = 200
end
object ActionList: TActionList
left = 264
top = 160
left = 280
top = 200
object ActDeskew: TAction
Caption = 'Deskew!'
OnExecute = ActDeskewExecute
Expand Down
2 changes: 1 addition & 1 deletion Gui/mainform.pas
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ TFormMain = class(TForm)
ColorBtnBackground: TColorButton;
ComboFileFormat: TComboBox;
EdDirOutput: TEdit;
FlowPanel1: TFlowPanel;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Expand Down Expand Up @@ -219,6 +218,7 @@ procedure TFormMain.ActDeskewExecute(Sender: TObject);
LabProgressTitle.Caption := 'Current file:';

Notebook.PageIndex := 1;
Application.ProcessMessages;

FRunner.Run(Module.Options);
end;
Expand Down
4 changes: 2 additions & 2 deletions Gui/options.pas
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ procedure TOptions.SaveToIni(Ini: TIniFile);

procedure TOptions.LoadFromIni(Ini: TIniFile);
begin
DefaultOutputFileOptions := Ini.ReadBool(IniSectionOptions, 'DefaultOutputFileOptions', True);
DefaultOutputFileOptions := StrToBoolDef(Ini.ReadString(IniSectionOptions, 'DefaultOutputFileOptions', ''), True);
OutputFolder := Ini.ReadString(IniSectionOptions, 'OutputFolder', '');
OutputFileFormat := TEnumUtils<TFileFormat>.StrToEnum(Ini.ReadString(IniSectionOptions, 'OutputFileFormat', ''));
BackgroundColor := StringToColorDef(Ini.ReadString(IniSectionOptions, 'BackgroundColor', ''), DefaultBackgroundColor);
Expand All @@ -206,7 +206,7 @@ procedure TOptions.LoadFromIni(Ini: TIniFile);
SkipAngle := Ini.ReadFloat(IniSectionAdvanced, 'SkipAngle', DefaultSkipAngle);
JpegCompressionQuality := Ini.ReadInteger(IniSectionAdvanced, 'JpegCompressionQuality', DefaultJpegCompressionQuality);
TiffCompressionScheme := Ini.ReadInteger(IniSectionAdvanced, 'TiffCompressionScheme', DefaultTiffCompressionScheme);
DefaultExecutable := Ini.ReadBool(IniSectionAdvanced, 'DefaultExecutable', True);
DefaultExecutable := StrToBoolDef(Ini.ReadString(IniSectionAdvanced, 'DefaultExecutable', ''), True);
CustomExecutablePath := Ini.ReadString(IniSectionAdvanced, 'CustomExecutablePath', '');
end;

Expand Down
2 changes: 1 addition & 1 deletion Gui/utils.pas
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function FindDeskewExePath: string;

function DetermineConfigFolder: string;
var
ExeDir, S: string;
ExeDir: string;
begin
Result := GetAppConfigDir(False);

Expand Down

0 comments on commit cd10d44

Please sign in to comment.