FileForums

FileForums (https://fileforums.com/index.php)
-   Conversion Tutorials (https://fileforums.com/forumdisplay.php?f=55)
-   -   FMXInno - Windows Fluent Design Installer UI for Inno (https://fileforums.com/showthread.php?t=104852)

hitman797 24-08-2023 08:59

Quote:

Originally Posted by crachlow (Post 502083)
You didn't look at the constants.
const
HDD_MEDIA_TYPE_UNKNOWN = $0000;
HDD_MEDIA_TYPE_HDD = $0003;
HDD_MEDIA_TYPE_SSD = $0004;
HDD_MEDIA_TYPE_SCM = $0005;
[IMG]
https://i.ibb.co/HC1cpzn/2023-08-24-202555.png
[/IMG]

Code:

var
  FMXLabel  : FLabel;

procedure FMXInnoInit;
begin
  FMXLabel  := InitLabelHandle;
end;

procedure FMXDesigning;
begin
  FMXLabel.FCreate(FMXForm.Handle, '');
  if wGetDriveMediaType('D') = 0 then
  begin
  FMXLabel.Text('UNKNOWN');
  end;
  if wGetDriveMediaType('D') = 3 then
  begin
  FMXLabel.Text('HDD');
  end;
  if wGetDriveMediaType('D') = 4 then
  begin
  FMXLabel.Text('SSD');
  end;
  if wGetDriveMediaType('D') = 5 then
  begin
  FMXLabel.Text('SCM');
  end;
  FMXLabel.Left(50);
  FMXLabel.Top(50);
  FMXLabel.FontSetting('Segoe UI', 16, ALBlack);
end;

Code:

var
  FMXLabel  : FLabel;

procedure FMXInnoInit;
begin
  FMXLabel  := InitLabelHandle;
end;

procedure FMXDesigning;
begin
  FMXLabel.FCreate(FMXForm.Handle, '');
  case wGetDriveMediaType('D') of
  0: FMXLabel.Text('UNKNOWN');
  3: FMXLabel.Text('HDD');
  4: FMXLabel.Text('SSD');
  5: FMXLabel.Text('SCM');
  end;
  FMXLabel.Left(50);
  FMXLabel.Top(50);
  FMXLabel.FontSetting('Segoe UI', 16, ALBlack);
end;


crachlow 24-08-2023 10:45

Quote:

Originally Posted by audiofeel (Post 502086)
and if like this? even better...
Code:

procedure DiskListOnChange(Sender: TObject);
var
  S: String;
begin
  S := DirEdt.GetText;
  StringChange(S, ExtractFileDrive(S), DiskList.GetSelectedDisk);
  DirEdt.Text(S);
  case wGetDriveMediaType(S) of
  0: FMXLabel.Text('Unknown');
  3: FMXLabel.Text('HDD');
  4: FMXLabel.Text('SSD');
  5: FMXLabel.Text('SCM');
  end;
end;


Well, what did you do?

crachlow 24-08-2023 11:55

It's bad that usb does not recognize.

BLACKFIRE69 26-08-2023 14:16

FMXInno - Updates
 
Update available!


Quote:

Originally Posted by audiofeel (Post 502001)
@BLACKFIRE69
I understand that the scale function is in the process of being finalized and tested ... but could you at least temporarily fix this bug. When the user changes the desktop scale from the recommended system (i.e. 100%) then "FFolderTreeView" floats away and is not visible. This appeared on the latest dll.
--
But the good old "FDirBrowse" feels much better. And it scales correctly. Somehow it even became a shame for "FFluentDirBrowse".


the FluentApi v2.0 update was responsible for this problem, however, it has been successfully addressed and fixed.


https://i.ibb.co/r6dv6gN/01.gif


Quote:

Originally Posted by hitman797 (Post 502044)
FMXInno Viewport 3D Example using:
@BLACKFIRE69
HI, BLACKFIRE69
Thank you for the update.
Can you add BringToFront to "FLayer3D".


this update brings more properties to classes, and that includes this one too.

NOTE:
This update involves modifications to certain functions/procedures, which might require adjustments to current scripts.

https://i.ibb.co/2WhFn28/00.png
https://i.ibb.co/VTNMGC0/01.png



Quote:

Originally Posted by crachlow (Post 502089)
const
HDD_MEDIA_TYPE_UNKNOWN = $0000;
HDD_MEDIA_TYPE_HDD = $0003;
HDD_MEDIA_TYPE_SSD = $0004;
HDD_MEDIA_TYPE_SCM = $0005;



It's bad that usb does not recognize.


Ok, let's update the wGetDriveMediaType function.


Code:

function wGetDriveMediaType(const DriveLetter: WideString): Integer;

function wGetDriveMediaTypeEx(const DriveLetter: WideString;
  out HealthStatus, Usage: Integer): Integer;


Code:

{ Drive Media Type }
const
  HDD_MEDIA_TYPE_UNKNOWN        = $0000;
  HDD_MEDIA_TYPE_USB            = $0001;
  HDD_MEDIA_TYPE_SD            = $0002;
  HDD_MEDIA_TYPE_HDD            = $0003;
  HDD_MEDIA_TYPE_SSD            = $0004;
  HDD_MEDIA_TYPE_SCM            = $0005;
  HDD_MEDIA_TYPE_NVMe          = $0006;

{ Drive Health }
const
  HDD_HEALTH_STATUS_HEALTHY    = $0000;
  HDD_HEALTH_STATUS_WARNING    = $0001;
  HDD_HEALTH_STATUS_UNHEALTHY  = $0002;
  HDD_HEALTH_STATUS_UNKNOWN    = $0005;

{ Drive Usage }
const
  HDD_USAGE_UNKWOWN            = $0000;
  HDD_USAGE_AUTO_SELECT        = $0001; // used for data storage.
  HDD_USAGE_MANUAL_SELECT      = $0002; // used if manually selected by an administrator at the time of virtual disk creation.
  HDD_USAGE_RETIRED            = $0004; // retired from use
  HDD_USAGE_CACHE              = $0005; // used as a cache for other devices.



the first post has been updated.


.

macut18 26-08-2023 18:08

#Script1.iss
when i already installed the first game The next game will be on the same drive as the first game installed.

https://i.imgur.com/aq8niZC.jpg

ScOOt3r 26-08-2023 18:47

@macut18 yes i currently use this script for my Repacks and you cant install 2 games with it in the same spot as it will do that.. but i just install one test it and then remove it..

ScOOt3r

macut18 27-08-2023 02:48

Quote:

Originally Posted by audiofeel (Post 502128)
It doesn't completely fix it, but it's a little better

The problem was solved, thank you very much. :)

hitman797 27-08-2023 04:34

Quote:

Originally Posted by audiofeel (Post 502131)
Somebody....I need help
You need to hide the buttons - AboutTabControl.TabPosition(tpNone);
But at the same time, my other custom buttons behave strangely, which are not related to this - AboutTabBtn[1]
If you specify like this - AboutTabControl.TabPosition(tpDots);
Then everything is fine, but I need to hide the dots

Code:

  AboutTabControl.FCreate(AboutPage.Handle);
  AboutTabControl.SetBounds(100, 130, 1046, 448);
  AboutTabControl.TabPosition(tpNone);

  for i:= 1 to 3 do
  begin
    AboutTabItem[i].FCreateEx(AboutTabControl.Handle);
    AboutLbl[i].FCreate(AboutTabItem[i].Handle);
    AboutLbl[i].FontSetting('{#Font}', VCLFontSizeToFMX(22), ALWhiteSmoke);
    AboutLbl[i].TextSetting(False, txCenter, txCenter);
    AboutLbl[i].SetBounds(0, 18, 1046, 24)

    AboutMemo[i].FCreate(AboutTabItem[i].Handle, True);
    AboutMemo[i].SetBounds(28, 59, 1017, 358);
    AboutMemo[i].FontSetting('{#Font}', VCLFontSizeToFMX2(12), ALWhiteSmoke);
    AboutMemo[i].WordWrap(True);
    AboutMemo[i].ReadOnly(True);
    AboutMemo[i].ScrollAnimation(True);
  end;

  AboutLbl[1].Text(AnsiUppercase('About Game'));
  AboutLbl[2].Text(AnsiUppercase('About Repack'));
  AboutLbl[3].Text(AnsiUppercase('Credits'));

  AboutMemo[1].AddLine(CnvtToWStr(S1));
  AboutMemo[2].AddLine(CnvtToWStr(S2));
  AboutMemo[3].AddLine(CnvtToWStr(S3));

  AboutTabBtn[1].FCreate(AboutTabControl.Handle);
  AboutTabBtn[1].SetBounds(572, 590, 50, 30);
  AboutTabBtn[1].FillColor({#Color1});
  AboutTabBtn[1].StrokeColor({#Color2});
  AboutTabBtn[1].StrokeSetting(1.0, scFlat, sdSolid, sjMiter);
  AboutTabBtn[1].CornerStyle(16, 16, [tcTopLeft, tcBottomLeft], ctBevel);
  AboutTabBtnLbl[1].FCreate(AboutTabBtn[1].Handle);
  AboutTabBtnLbl[1].Text(#$E938);
  AboutTabBtnLbl[1].Align(Client)
  AboutTabBtnLbl[1].AutoSize(True);
  AboutTabBtnLbl[1].TextSetting(False, txCenter, txCenter);
  AboutTabBtnLbl[1].FontSetting('Segoe MDL2 Assets', 14, ALBlack);
  AboutTabBtnLbl[1].OnMouseEnter(@CommonMouseEnter);
  AboutTabBtnLbl[1].OnMouseLeave(@CommonMouseLeave);
  AboutTabBtnLbl[1].OnClick(@CommonOnClick);

  AboutTabBtn[2].FCreate(AboutTabControl.Handle);
  AboutTabBtn[2].SetBounds(622, 590, 50, 30);
  AboutTabBtn[2].FillColor({#Color1});
  AboutTabBtn[2].StrokeColor({#Color2});
  AboutTabBtn[2].StrokeSetting(1.0, scFlat, sdSolid, sjMiter);
  AboutTabBtn[2].CornerStyle(16, 16, [tcTopRight, tcBottomRight], ctBevel);
  AboutTabBtnLbl[2].FCreate(AboutTabBtn[2].Handle);
  AboutTabBtnLbl[2].Text(#$E937);
  AboutTabBtnLbl[2].Align(Client)
  AboutTabBtnLbl[2].AutoSize(True);
  AboutTabBtnLbl[2].TextSetting(False, txCenter, txCenter);
  AboutTabBtnLbl[2].FontSetting('Segoe MDL2 Assets', 14, ALBlack);
  AboutTabBtnLbl[2].OnMouseEnter(@CommonMouseEnter);
  AboutTabBtnLbl[2].OnMouseLeave(@CommonMouseLeave);
  AboutTabBtnLbl[2].OnClick(@CommonOnClick);


hitman797 27-08-2023 06:14

Quote:

Originally Posted by audiofeel (Post 502136)
@hitman797
Thanks for the support. This did not solve the problem, (the buttons you pointed to AboutTabControl) they move along with AboutTabItem[i]. For now, I just increased the width and hid the dots under my buttons.
https://youtu.be/c802o9WLJDE?si=RL6W_PkPQK2Uzite

you need 2 TabControl
add 1 TabItem in TabControl1
and add the buttons in TabItem in TabControl1.
in TabControl2 add TabItem[i] in TabItem[i] add Memo[i].

crachlow 27-08-2023 08:35

3 Attachment(s)
Dear Blackfire69. Could you clarify about FUserInfo. As you wrote in the examples, this is not quite suitable, at least for Windows 11. Unknown is displayed in it. If this function defines only the administrator from under the built-in account, and the user from the user group, then this is not entirely correct, probably. I tried to determine by type sid like this
Code:

var
  UserSidType: Integer;
    s1 : String;
...............................
      s1 := Copy(UserInfo.SID,42,3)+Copy(UserInfo.SID,45,1);
      UserSidType := StrToInt(s1);
      if UserSidType > 1000 then
      UserSidType := 1001 ;
    // SUserType
  case UserSidType of
    500: UserTypeStr := 'Administrator';
    1001: UserTypeStr := 'Standard User';
    else
      UserTypeStr := 'Unknown';
  end;

But @audiofeel says it doesn't work, or it works intermittently.
And if the user, administrator rights? Whereas? Could you clarify this issue.

crachlow 27-08-2023 09:31

Maybe it's because of the localization of the system?
https://i.ibb.co/58rbxkp/2023-08-27-175746.png

BLACKFIRE69 28-08-2023 00:35

FMX - News Updates
 
Quote:

Originally Posted by crachlow (Post 502144)
Dear Blackfire69. Could you clarify about FUserInfo. As you wrote in the examples, this is not quite suitable, at least for Windows 11. Unknown is displayed in it. If this function defines only the administrator from under the built-in account, and the user from the user group, then this is not entirely correct, probably. I tried to determine by type sid like this

But @audiofeel says it doesn't work, or it works intermittently.
And if the user, administrator rights? Whereas? Could you clarify this issue.

Maybe it's because of the localization of the system?



i just updated it. it may work.




Quote:

Originally Posted by audiofeel (Post 502142)
...
I just changed the form to 'FCreateBlankForm'. A white square appeared again at startup, but without a glitch in 'FTabControl'.



this 'white square' issue can be bypassed. however, after doing so, you'll need to call 'FMXForm.Show' following the 'FMXDesigning' procedure; otherwise, it won't display anything. if this solution works for you, i'll implement this fix in the next update.


(the DLL file in the example is in developer mode, so please refrain from using it in the main stream.)



if i specify the changes in the code:

Code:

procedure InitializeWizard();
begin
  ...
  FMXDesigning;
  // New - FMXInnoDev.dll: [2023-08-28]
  Page1.Visible(False);
  Page2.Visible(False);
  Page3.Visible(False);
  Page4.Visible(False);
  Page5.Visible(False);

  FMXForm.Show;
  //
  ...
end;


procedure CurPageChanged(CurPageID: Integer);
begin
  ...
  if CurPageID = wpWelcome then
  begin
    ...
    if FMXFirstRun then
    begin
      FMXFirstRun := false;
      // New
      //Page1.AnimDelay(0.5);
      //
    end else
      Page1.AnimDelay(0);
    ...
  end;
  ...
end;


.

crachlow 28-08-2023 08:05

Quote:

Originally Posted by audiofeel (Post 502155)
I meant that the same file shows a different result. My account is Microsoft and in the Administrators group.
User Unknown

I guess that
case IsAdminLoggedOn of
0: UserTypeStr := 'Group Users';
1: UserTypeStr := 'Group Administrators';
and GetUserNameString;
from innosetup works more correctly. In Russian localization UserInfo.UserType, and maybe in others, does not work at all, it is also difficult to determine by sid, because sid will be different in different localizations.

BLACKFIRE69 28-08-2023 16:23

Quote:

Originally Posted by crachlow (Post 502162)
I guess that
case IsAdminLoggedOn of
0: UserTypeStr := 'Group Users';
1: UserTypeStr := 'Group Administrators';
from innosetup works more correctly.


Code:

{Setup]
...
PrivilegesRequired=admin    --->    'Admin'    (IsAdminLoggedOn is True)
PrivilegesRequired=lowest    --->    'Standard' (IsAdminLoggedOn is False)


hitman797 29-08-2023 01:24

Quote:

Originally Posted by audiofeel (Post 502174)
Does anyone have the black and white 'Windows11' style in 'FMXInno' that works really and correctly? I found a couple of styles. One is very good (displays the Switch and CheckBox in the correct size, and not small like other options). But unfortunately it has 'Right Border and LeftBorder' (I can't edit it in text style.) . That is, there will be artifacts around the edges.
:rolleyes:

Windows 10 for FMX
FMX Styles
Windows 11 for VCL
VCL Styles


All times are GMT -7. The time now is 22:16.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
FileForums @ https://fileforums.com