View Single Post
  #403  
Old 08-10-2023, 14:07
hitman797's Avatar
hitman797 hitman797 is offline
Registered User
 
Join Date: Feb 2013
Location: Algeria
Posts: 168
Thanks: 486
Thanked 202 Times in 122 Posts
hitman797 is on a distinguished road
Quote:
Originally Posted by BLACKFIRE69 View Post
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;
Attached Images
File Type: png Capture.PNG (35.2 KB, 120 views)

Last edited by hitman797; 08-10-2023 at 14:48.
Reply With Quote
The Following User Says Thank You to hitman797 For This Useful Post:
audiofeel (08-10-2023)