Quote:
Originally Posted by BLACKFIRE69
FMXInno - Updates
Code:
FMXInno - Changes
1. Added new classes:
- FTreeView
- FTreeViewItem
- FMenuBar
- FMenuBarItem
2. FCheckboxTree - Removed the following properties:
- procedure Selectable(FEnable: Boolean)
- procedure RemoveBckgnd
3. Added some new functions.
4. Some improvements:
- TitleBar
- FForm
5. Bug Fixing.
.
|
Great job my friend, thank you.
Code:
procedure TDialogForm.Button1Click(Sender: TObject);
begin
if length(Label1.Text) = 3 then
begin
CreateDir(Label1.Text+Edit1.Text);
Label1.Text:= Label1.Text+Edit1.Text;
end else begin
CreateDir(Label1.Text+'\'+Edit1.Text);
Label1.Text:= Label1.Text+'\'+Edit1.Text;
end;
Timer1.Enabled:= True;
end;
procedure TDialogForm.FormCreate(Sender: TObject);
var
hDriveArry: TStringDynArray;
hDriveName: String;
begin
ListBox1.Clear;
ListBox1.BeginUpdate;
hDriveArry:= TDirectory.GetLogicalDrives;
for hDriveName in hDriveArry do
begin
ListBox1.Items.Add(hDriveName);
end;
ListBox1.EndUpdate;
Timer1.Enabled:= True;
end;
procedure TDialogForm.ListBox1ItemClick(const Sender: TCustomListBox;
const Item: TListBoxItem);
begin
Label1.Text:= ListBox1.Items.Strings[ListBox1.ItemIndex];
Timer1.Enabled:= True;
end;
procedure TDialogForm.ListBox2ItemClick(const Sender: TCustomListBox;
const Item: TListBoxItem);
begin
if length(Label1.Text) = 3 then
begin
Label1.Text:= Label1.text+ListBox2.Items.Strings[ListBox2.ItemIndex];
end else begin
Label1.Text:= Label1.text+'\'+ListBox2.Items.Strings[ListBox2.ItemIndex];
end;
Timer1.Enabled:= True;
end;
procedure TDialogForm.SpeedButton1Click(Sender: TObject);
begin
Label1.Text:= 'C:\Windows';
Timer1.Enabled:= True;
end;
procedure TDialogForm.SpeedButton2Click(Sender: TObject);
begin
Label1.Text:= ExtractFileDir(Label1.Text);
Timer1.Enabled:= True;
end;
procedure TDialogForm.Timer1Timer(Sender: TObject);
var
hDirArry: TStringDynArray;
hDirName: String;
begin
ListBox2.Clear;
ListBox2.BeginUpdate;
hDirName:= Label1.Text;
hDirArry:= TDirectory.GetDirectories(hDirName);
for hDirName in hDirArry do
begin
ListBox2.Items.Add(ExtractFileName(hDirName));
end;
ListBox2.EndUpdate;
Timer1.Enabled:= False;
end;
in innosetup we have this function.
Code:
function Length(S: String): Longint;
function CreateDir(const Dir: String): Boolean;
function RemoveDir(const Dir: String): Boolean;
//
function ExtractFileExt(const FileName: String): String;
function ExtractFileDir(const FileName: String): String;
function ExtractFilePath(const FileName: String): String;
function ExtractFileName(const FileName: String): String;
function ExtractFileDrive(const FileName: String): String;
//
function GetCurrentDir: String;
function SetCurrentDir(const Dir: String): Boolean;
function GetWinDir: String;
function GetSystemDir: String;
function GetSysWow64Dir: String;
function GetTempDir: String;
but we need to add this function:
System.IOUtils:
Code:
function TDirectory.GetFiles(const Path: string): TStringDynArray;
function TDirectory.GetDirectories(const Path: string): TStringDynArray;
function TDirectory.GetLogicalDrives: TStringDynArray;
TArrayOfString = array of String; in innosetup
ListBox:
Code:
procedure ListBoxItemClick(const Sender: TCustomListBox;
const Item: TListBoxItem);
Label:
Code:
function GetText: WideString;