|
|
|
#1
|
||||
|
||||
|
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. TreeView + MainMenu: Code:
{ MainMenu }
PMenuBar.FCreate(FMXForm.Handle);
PMenuBar.ImageList(ImgList.Handle);
{ Home }
pMenuItem[1].FCreate(PMenuBar.Handle);
pMenuItem[1].Text('Home');
pMenuItem[1].ImageIndex(0);
PMenuBar.AddItem(pMenuItem[1].Handle);
pMenuItem[2].FCreate(pMenuItem[1].Handle);
pMenuItem[2].Text('Open');
pMenuItem[2].ShortCut(wGetShortCut(vkO, [ssCtrl]));
pMenuItem[2].ImageIndex(1);
pMenuItem[2].OnClick(@CommonOnClick);
pMenuItem[1].AddItem(pMenuItem[2].Handle);
...
{ MainMenu }
Code:
{ TreeView 1 - Left }
kTreeView.FCreate(FMXForm.Handle);
kTreeView.SetBounds(NSX(40), NSY(120), NSX(249), NSY(329));
kTreeView.ImageList(ImgList.Handle);
kTreeViewItem[1].FCreate(kTreeView.Handle); // User
kTreeViewItem[1].ImageIndex(20);
kTreeViewItem[1].Text(GetUserNameString);
kTreeViewItem[1].Margins(NSX(-20),0,0,0);
kTreeView.AddItem(kTreeViewItem[1].Handle);
kTreeViewItem[2].FCreate(kTreeView.Handle); // Desktop
kTreeViewItem[2].ImageIndex(21);
kTreeViewItem[2].Text('Desktop');
kTreeViewItem[2].Margins(NSX(-20),0,0,0);
kTreeView.AddItem(kTreeViewItem[2].Handle);
...
{ TreeView 1 - Left }
Code:
{ TreeView 2 - Right }
mTreeView.FCreate(FMXForm.Handle);
mTreeView.SetBounds(NSX(340), NSY(120), NSX(249), NSY(329));
mTreeView.ShowCheckboxes(True);
mTreeViewItem[1].FCreate(mTreeView.Handle);
mTreeViewItem[1].StyledSettings([]);
mTreeViewItem[1].FontSettings('Segoe UI', 12, AlRed, [fsBold, fsUnderline]);
mTreeViewItem[1].Text('Come, Let''s Destroy Our World!');
mTreeView.AddItem(mTreeViewItem[1].Handle);
{ Weapon Preset }
mTreeViewItem[2].FCreate(mTreeViewItem[1].Handle);
mTreeViewItem[2].StyledSettings([]);
mTreeViewItem[2].FontSettings('Segoe UI', 12, AlBlue, [fsBold]);
mTreeViewItem[2].Text('Weapon Preset');
mTreeViewItem[1].AddItem(mTreeViewItem[2].Handle);
mTreeViewItem[3].FCreate(mTreeViewItem[2].Handle);
mTreeViewItem[3].Text('Soviet');
mTreeViewItem[2].AddItem(mTreeViewItem[3].Handle);
...
{ TreeView 2 - Right }
. Last edited by BLACKFIRE69; 14-07-2024 at 02:10. |
| The Following 3 Users Say Thank You to BLACKFIRE69 For This Useful Post: | ||
| Sponsored Links |
|
#2
|
||||
|
||||
|
Quote:
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;
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; 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 Code:
procedure ListBoxItemClick(const Sender: TCustomListBox; const Item: TListBoxItem); Code:
function GetText: WideString; Last edited by hitman797; 08-10-2023 at 14:48. |
| The Following User Says Thank You to hitman797 For This Useful Post: | ||
audiofeel (08-10-2023) | ||
|
#3
|
||||
|
||||
|
Quote:
i think you may not have noticed that FMXInno has already included these things. Quote:
Code:
var
FindHandle: Longint;
begin
FindHandle := pFindFiles('C:\Test01', '*.*', '', ffrkRelative, True, False);
if FindHandle <> 0 then
begin
WinTB1.Text('Files: ' + IntToStr(pFileCount(FindHandle)));
try
for i:=0 to pFileCount(FindHandle)-1 do
Memo.AddLine(pPickFile(FindHandle, i));
finally
pFindFree(FindHandle);
end;
end;
end;
Quote:
Code:
var
FindHandle: Longint;
begin
FindHandle := pFindFiles('C:\Test01', '*', '', ffrkRelative, True, True);
if FindHandle <> 0 then
begin
WinTB1.Text('Dirs: ' + IntToStr(pDirCount(FindHandle)));
try
for i:=0 to pDirCount(FindHandle)-1 do
Memo.AddLine(pPickDir(FindHandle, i));
finally
pFindFree(FindHandle);
end;
end;
end;
Code:
begin
LogicalDrives.FCreate;
if LogicalDrives.Count > 0 then
begin
for i := 0 to LogicalDrives.Count - 1 do
Memo.AddLine(LogicalDrives.Letter(i));
end else
MsgBox('"LogicalDrives" failded!', mbError, MB_OK);
end;
Quote:
Code:
procedure ListBoxOnChange(Sender: TObject);
var
i: integer;
TargetLstItm: FListBoxItem;
begin
if ListBox.GetItemIndex > -1 then
begin
for i := 0 to length(ListBoxItems)-1 do
if Sender = TObject(ListBoxItems[i].GetObject) then
begin
TargetLstItm := ListBoxItems[i] as FListBoxItem;
break;
end;
WinTB1.Text(TargetLstItm.GeText);
end;
end;
ListBox.FCreate(FMXForm.Handle);
ListBox.SetBounds(NSX(32), NSY(53), NSX(297), NSY(249));
ListBox.OnChange(@ListBoxOnChange);
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Windows Fluent Effects Standalone API - InnoSetup / VCL / FXM | BLACKFIRE69 | Conversion Tutorials | 0 | 15-11-2023 17:35 |
| Windows Phone Installer similar to razor12911's original design? | Kitsune1982 | Conversion Tutorials | 0 | 02-07-2020 13:04 |
| INDEX - Conversion Tutorial Index | Razor12911 | Conversion Tutorials | 5 | 11-06-2020 02:05 |
| Frequently Asked Questions | Joe Forster/STA | PC Games - Frequently Asked Questions | 0 | 29-11-2005 09:48 |