You've already forked lazarus-ccr
add a icon select dialog.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2657 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
42
applications/lazimageeditor/iconsizeselection.lfm
Normal file
42
applications/lazimageeditor/iconsizeselection.lfm
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
object SelectIconSizeForm: TSelectIconSizeForm
|
||||||
|
Left = 304
|
||||||
|
Height = 99
|
||||||
|
Top = 61
|
||||||
|
Width = 213
|
||||||
|
BorderStyle = bsDialog
|
||||||
|
Caption = 'Select a size of the ICON'
|
||||||
|
ClientHeight = 99
|
||||||
|
ClientWidth = 213
|
||||||
|
Font.CharSet = GB2312_CHARSET
|
||||||
|
Font.Height = -13
|
||||||
|
Font.Name = '微软雅黑'
|
||||||
|
Font.Pitch = fpVariable
|
||||||
|
Font.Quality = fqDraft
|
||||||
|
Position = poMainFormCenter
|
||||||
|
LCLVersion = '1.1'
|
||||||
|
object IconSizeComboBox: TComboBox
|
||||||
|
Left = 28
|
||||||
|
Height = 27
|
||||||
|
Top = 19
|
||||||
|
Width = 159
|
||||||
|
ItemHeight = 19
|
||||||
|
ItemIndex = 0
|
||||||
|
Items.Strings = (
|
||||||
|
'32'
|
||||||
|
'48'
|
||||||
|
'64'
|
||||||
|
)
|
||||||
|
Style = csDropDownList
|
||||||
|
TabOrder = 0
|
||||||
|
Text = '32'
|
||||||
|
end
|
||||||
|
object Button1: TButton
|
||||||
|
Left = 104
|
||||||
|
Height = 29
|
||||||
|
Top = 56
|
||||||
|
Width = 83
|
||||||
|
Caption = '&OK'
|
||||||
|
ModalResult = 1
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
end
|
31
applications/lazimageeditor/iconsizeselection.pas
Normal file
31
applications/lazimageeditor/iconsizeselection.pas
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
unit iconsizeselection;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls;
|
||||||
|
|
||||||
|
type
|
||||||
|
|
||||||
|
{ TSelectIconSizeForm }
|
||||||
|
|
||||||
|
TSelectIconSizeForm = class(TForm)
|
||||||
|
Button1: TButton;
|
||||||
|
IconSizeComboBox: TComboBox;
|
||||||
|
private
|
||||||
|
{ private declarations }
|
||||||
|
public
|
||||||
|
{ public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
SelectIconSizeForm: TSelectIconSizeForm;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{$R *.lfm}
|
||||||
|
|
||||||
|
end.
|
||||||
|
|
@ -2,4 +2,4 @@
|
|||||||
Language=0
|
Language=0
|
||||||
|
|
||||||
[UNIX]
|
[UNIX]
|
||||||
MyDirectory=T:\LazImageEditor\
|
MyDirectory=T:\ImageEditor\
|
||||||
|
@ -76,7 +76,7 @@
|
|||||||
<PackageName Value="LCL"/>
|
<PackageName Value="LCL"/>
|
||||||
</Item3>
|
</Item3>
|
||||||
</RequiredPackages>
|
</RequiredPackages>
|
||||||
<Units Count="15">
|
<Units Count="16">
|
||||||
<Unit0>
|
<Unit0>
|
||||||
<Filename Value="lazimageeditor.pas"/>
|
<Filename Value="lazimageeditor.pas"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
@ -172,6 +172,13 @@
|
|||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<UnitName Value="lieconstants"/>
|
<UnitName Value="lieconstants"/>
|
||||||
</Unit14>
|
</Unit14>
|
||||||
|
<Unit15>
|
||||||
|
<Filename Value="iconsizeselection.pas"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
<ComponentName Value="SelectIconSizeForm"/>
|
||||||
|
<ResourceBaseClass Value="Form"/>
|
||||||
|
<UnitName Value="iconsizeselection"/>
|
||||||
|
</Unit15>
|
||||||
</Units>
|
</Units>
|
||||||
</ProjectOptions>
|
</ProjectOptions>
|
||||||
<CompilerOptions>
|
<CompilerOptions>
|
||||||
|
@ -16,7 +16,8 @@ uses
|
|||||||
ResizeDialog,
|
ResizeDialog,
|
||||||
ResizePaperDialog,
|
ResizePaperDialog,
|
||||||
PictureDialog,
|
PictureDialog,
|
||||||
AboutDialog, DLBitmap, IconStrConsts, appsettings, lieconstants;
|
AboutDialog, DLBitmap, IconStrConsts, appsettings, lieconstants,
|
||||||
|
iconsizeselection;
|
||||||
|
|
||||||
{$R *.res}
|
{$R *.res}
|
||||||
|
|
||||||
@ -37,6 +38,7 @@ begin
|
|||||||
MainForm.OpenImageFile(ParamStr(1))
|
MainForm.OpenImageFile(ParamStr(1))
|
||||||
else
|
else
|
||||||
MainForm.FileNewOnStart;
|
MainForm.FileNewOnStart;
|
||||||
|
Application.CreateForm(TSelectIconSizeForm, SelectIconSizeForm);
|
||||||
Application.Run;
|
Application.Run;
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
@ -340,7 +340,7 @@ var
|
|||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses Test, IconStrConsts;
|
uses Test, IconStrConsts, iconsizeselection;
|
||||||
|
|
||||||
procedure SetControlsEnabled(AControl: TControl; AEnabled: boolean);
|
procedure SetControlsEnabled(AControl: TControl; AEnabled: boolean);
|
||||||
var
|
var
|
||||||
@ -1230,6 +1230,8 @@ end;
|
|||||||
|
|
||||||
procedure TMainForm.OpenImageFile(FileName: string);
|
procedure TMainForm.OpenImageFile(FileName: string);
|
||||||
begin
|
begin
|
||||||
|
if UpperCase(ExtractFileExt(FileName)) = '.ICO' then
|
||||||
|
SelectIconSizeForm.ShowModal;
|
||||||
Pictures.Load(FileName);
|
Pictures.Load(FileName);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user