diff --git a/.gitattributes b/.gitattributes index 26bd707d80..e5e367bfab 100644 --- a/.gitattributes +++ b/.gitattributes @@ -6296,8 +6296,6 @@ ide/mainbase.pas svneol=native#text/pascal ide/mainintf.pas svneol=native#text/pascal ide/makeresstrdlg.lfm svneol=native#text/plain ide/makeresstrdlg.pas svneol=native#text/pascal -ide/manifestdialog.lfm svneol=native#text/plain -ide/manifestdialog.pas svneol=native#text/pascal ide/miscoptions.pas svneol=native#text/pascal ide/modematrixopts.pas svneol=native#text/plain ide/mouseactiondialog.lfm svneol=native#text/plain diff --git a/ide/frames/project_application_options.lfm b/ide/frames/project_application_options.lfm index 9773cbcac4..395679e31d 100644 --- a/ide/frames/project_application_options.lfm +++ b/ide/frames/project_application_options.lfm @@ -1,21 +1,21 @@ object ProjectApplicationOptionsFrame: TProjectApplicationOptionsFrame Left = 0 - Height = 462 + Height = 550 Top = 0 Width = 487 - ClientHeight = 462 + ClientHeight = 550 ClientWidth = 487 TabOrder = 0 DesignLeft = 392 DesignTop = 251 object AppSettingsGroupBox: TGroupBox Left = 0 - Height = 413 + Height = 501 Top = 0 Width = 487 Align = alTop Caption = 'AppSettingsGroupBox' - ClientHeight = 394 + ClientHeight = 482 ClientWidth = 483 TabOrder = 0 object TitleLabel: TLabel @@ -73,12 +73,12 @@ object ProjectApplicationOptionsFrame: TProjectApplicationOptionsFrame AnchorSideTop.Side = asrBottom Left = 6 Height = 24 - Top = 321 + Top = 413 Width = 191 BorderSpacing.Left = 6 BorderSpacing.Top = 3 Caption = 'UseAppBundleCheckBox' - TabOrder = 9 + TabOrder = 12 end object UseXPManifestCheckBox: TCheckBox AnchorSideLeft.Control = AppSettingsGroupBox @@ -192,6 +192,43 @@ object ProjectApplicationOptionsFrame: TProjectApplicationOptionsFrame Anchors = [akTop, akLeft, akRight] TabOrder = 2 end + object UIAccessCheckBox: TCheckBox + AnchorSideTop.Control = ExecutionLevelComboBox + AnchorSideTop.Side = asrBottom + Left = 27 + Height = 24 + Top = 331 + Width = 152 + BorderSpacing.Top = 3 + Caption = 'UIAccessCheckBox' + TabOrder = 10 + end + object ExecutionLevelComboBox: TComboBox + AnchorSideLeft.Control = DpiAwareComboBox + AnchorSideTop.Control = DpiAwareComboBox + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = DpiAwareComboBox + AnchorSideRight.Side = asrBottom + Left = 195 + Height = 31 + Top = 297 + Width = 282 + Anchors = [akTop, akLeft, akRight] + BorderSpacing.Top = 3 + ItemHeight = 0 + Style = csDropDownList + TabOrder = 9 + end + object ExecutionLevelLabel: TLabel + AnchorSideTop.Control = ExecutionLevelComboBox + AnchorSideTop.Side = asrCenter + Left = 27 + Height = 17 + Top = 304 + Width = 138 + Caption = 'ExecutionLevelLabel' + ParentColor = False + end object DefaultIconButton: TButton AnchorSideLeft.Control = LoadIconButton AnchorSideTop.Control = LoadIconButton @@ -223,11 +260,11 @@ object ProjectApplicationOptionsFrame: TProjectApplicationOptionsFrame ParentFont = False end object DarwinDividerBevel: TDividerBevel - AnchorSideTop.Control = ManifestButton + AnchorSideTop.Control = TextFieldButton AnchorSideTop.Side = asrBottom Left = 8 Height = 17 - Top = 301 + Top = 393 Width = 471 Caption = 'For Darwin' Anchors = [akTop, akLeft, akRight] @@ -241,29 +278,59 @@ object ProjectApplicationOptionsFrame: TProjectApplicationOptionsFrame AnchorSideTop.Side = asrBottom Left = 27 Height = 29 - Top = 351 + Top = 443 Width = 177 AutoSize = True BorderSpacing.Left = 21 BorderSpacing.Top = 6 Caption = 'CreateAppBundleButton' OnClick = CreateAppBundleButtonClick - TabOrder = 10 + TabOrder = 13 end - object ManifestButton: TButton + object DpiAwareLabel: TLabel AnchorSideLeft.Control = UseXPManifestCheckBox + AnchorSideTop.Control = DpiAwareComboBox + AnchorSideTop.Side = asrCenter + Left = 27 + Height = 17 + Top = 270 + Width = 103 + BorderSpacing.Left = 21 + BorderSpacing.Top = 3 + Caption = 'DpiAwareLabel' + ParentColor = False + end + object DpiAwareComboBox: TComboBox + AnchorSideLeft.Control = ExecutionLevelLabel + AnchorSideLeft.Side = asrBottom AnchorSideTop.Control = UseXPManifestCheckBox AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = TitleEdit + AnchorSideRight.Side = asrBottom + Left = 195 + Height = 31 + Top = 263 + Width = 282 + Anchors = [akTop, akLeft, akRight] + BorderSpacing.Left = 30 + BorderSpacing.Top = 3 + ItemHeight = 0 + Style = csDropDownList + TabOrder = 8 + end + object TextFieldButton: TButton + AnchorSideLeft.Control = UIAccessCheckBox + AnchorSideTop.Control = UIAccessCheckBox + AnchorSideTop.Side = asrBottom Left = 27 Height = 29 - Top = 266 - Width = 118 + Top = 358 + Width = 120 AutoSize = True - BorderSpacing.Left = 21 - BorderSpacing.Top = 6 - Caption = 'ManifestButton' - OnClick = ManifestButtonClick - TabOrder = 8 + BorderSpacing.Top = 3 + Caption = 'TextFieldButton' + OnClick = TextFieldButtonClick + TabOrder = 11 end end object OpenPictureDialog1: TOpenPictureDialog diff --git a/ide/frames/project_application_options.pas b/ide/frames/project_application_options.pas index c63d557b6e..60c86ed012 100644 --- a/ide/frames/project_application_options.pas +++ b/ide/frames/project_application_options.pas @@ -8,8 +8,7 @@ uses Classes, SysUtils, LCLProc, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls, Buttons, ComCtrls, ExtDlgs, Math, LCLType, IDEOptionsIntf, LazIDEIntf, IDEDialogs, DividerBevel, Project, LazarusIDEStrConsts, - EnvironmentOpts, ApplicationBundle, ProjectIcon, W32Manifest, CompilerOptions, - ManifestDialog; + EnvironmentOpts, ApplicationBundle, ProjectIcon, W32Manifest, CompilerOptions; type @@ -17,17 +16,22 @@ type TProjectApplicationOptionsFrame = class(TAbstractIDEOptionsEditor) AppSettingsGroupBox: TGroupBox; - ManifestButton: TButton; + TextFieldButton: TButton; CreateAppBundleButton: TBitBtn; DefaultIconButton: TButton; + DpiAwareLabel: TLabel; + DpiAwareComboBox: TComboBox; WindowsDividerBevel: TDividerBevel; DarwinDividerBevel: TDividerBevel; + UIAccessCheckBox: TCheckBox; + ExecutionLevelComboBox: TComboBox; ClearIconButton: TBitBtn; IconImage: TImage; IconLabel: TLabel; IconPanel: TPanel; IconTrack: TTrackBar; IconTrackLabel: TLabel; + ExecutionLevelLabel: TLabel; LoadIconButton: TBitBtn; OpenPictureDialog1: TOpenPictureDialog; SaveIconButton: TBitBtn; @@ -42,8 +46,8 @@ type procedure IconImagePictureChanged(Sender: TObject); procedure IconTrackChange(Sender: TObject); procedure LoadIconButtonClick(Sender: TObject); - procedure ManifestButtonClick(Sender: TObject); procedure SaveIconButtonClick(Sender: TObject); + procedure TextFieldButtonClick(Sender: TObject); procedure UseXPManifestCheckBoxChange(Sender: TObject); private FProject: TProject; @@ -62,6 +66,13 @@ implementation {$R *.lfm} +const + ExecutionLevelToCaption: array[TXPManifestExecutionLevel] of PString = ( + { xmelAsInvoker } @dlgPOAsInvoker, + { xmelHighestAvailable } @dlgPOHighestAvailable, + { xmelRequireAdministrator } @dlgPORequireAdministrator + ); + function CreateProjectApplicationBundle(AProject: TProject): string; // returns target file name var @@ -156,41 +167,36 @@ begin end; end; -procedure TProjectApplicationOptionsFrame.ManifestButtonClick(Sender: TObject); -var - Man: TProjectXPManifest; - Form: TManifestForm; -begin - Man:= FProject.ProjResources.XPManifest; - Form:= TManifestForm.Create(Self); - try - Form.DpiAwareComboBox.ItemIndex := Ord(Man.DpiAware); - Form.ExecutionLevelComboBox.ItemIndex := Ord(Man.ExecutionLevel); - Form.UIAccessCheckBox.Checked := Man.UIAccess; - Form.NameEdit.Text := Man.TextName; - Form.DescEdit.Text := Man.TextDesc; - if Form.ShowModal=mrOk then - begin - Man.DpiAware := TXPManifestDpiAware(Form.DpiAwareComboBox.ItemIndex); - Man.ExecutionLevel := TXPManifestExecutionLevel(Form.ExecutionLevelComboBox.ItemIndex); - Man.UIAccess := Form.UIAccessCheckBox.Checked; - Man.TextName := Form.NameEdit.Text; - Man.TextDesc := Form.DescEdit.Text; - end; - finally - Form.Free; - end; -end; - procedure TProjectApplicationOptionsFrame.SaveIconButtonClick(Sender: TObject); begin if SavePictureDialog1.Execute then IconImage.Picture.SaveToFile(SavePictureDialog1.FileName); end; +procedure TProjectApplicationOptionsFrame.TextFieldButtonClick(Sender: TObject); +var + Caps, Values: array[0..1] of string; +begin + Caps[0] := lisName; + Caps[1] := lisCodeHelpDescrTag; + Values[0] := FProject.ProjResources.XPManifest.TextName; + Values[1] := FProject.ProjResources.XPManifest.TextDesc; + + if InputQuery(TextFieldButton.Caption, Caps, Values) then + begin + FProject.ProjResources.XPManifest.TextName := Values[0]; + FProject.ProjResources.XPManifest.TextDesc := Values[1]; + end; +end; + procedure TProjectApplicationOptionsFrame.UseXPManifestCheckBoxChange(Sender: TObject); begin - ManifestButton.Enabled := UseXPManifestCheckBox.Checked; + DpiAwareLabel.Enabled := UseXPManifestCheckBox.Checked; + DpiAwareComboBox.Enabled := UseXPManifestCheckBox.Checked; + ExecutionLevelLabel.Enabled := UseXPManifestCheckBox.Checked; + ExecutionLevelComboBox.Enabled := UseXPManifestCheckBox.Checked; + UIAccessCheckBox.Enabled := UseXPManifestCheckBox.Checked; + TextFieldButton.Enabled := UseXPManifestCheckBox.Checked; end; procedure TProjectApplicationOptionsFrame.SetIconFromStream(Value: TStream); @@ -222,6 +228,10 @@ begin end; procedure TProjectApplicationOptionsFrame.Setup(ADialog: TAbstractOptionsEditorDialog); +var + ExecutionLevel: TXPManifestExecutionLevel; + DpiLevel: TXPManifestDpiAware; + DpiLevelNames: array[TXPManifestDpiAware] of string; begin AppSettingsGroupBox.Caption := dlgApplicationSettings; TitleLabel.Caption := dlgPOTitle; @@ -232,8 +242,20 @@ begin // Windows specific, Manifest WindowsDividerBevel.Caption := lisForWindows; UseXPManifestCheckBox.Caption := dlgPOUseManifest; - ManifestButton.Caption := dlgPOManifestOptions; - UseXPManifestCheckBoxChange(nil); + + DpiAwareLabel.Caption := dlgPODpiAwareness; + DpiLevelNames[xmdaFalse] := dlgPODpiAwarenessOff; + DpiLevelNames[xmdaTrue] := dlgPODpiAwarenessOn; + DpiLevelNames[xmdaPerMonitor] := dlgPODpiAwarenessOldOffNewPerMonitor; + DpiLevelNames[xmdaTruePM] := dlgPODpiAwarenessOldOnNewPerMonitor; + + ExecutionLevelLabel.Caption := dlgPOExecutionLevel; + for ExecutionLevel in TXPManifestExecutionLevel do + ExecutionLevelComboBox.Items.Add(ExecutionLevelToCaption[ExecutionLevel]^); + for DpiLevel in TXPManifestDpiAware do + DpiAwareComboBox.Items.Add(DpiLevelNames[DpiLevel] + ' (' + ManifestDpiAwareValues[DpiLevel] + ')'); + UIAccessCheckBox.Caption := dlgPOUIAccess; + TextFieldButton.Caption := dlgPOTextFields; // Darwin specific, Application Bundle DarwinDividerBevel.Caption := lisForDarwin; @@ -270,7 +292,16 @@ begin with ProjResources.XPManifest do begin UseXPManifestCheckBox.Checked := UseManifest; + DpiAwareComboBox.ItemIndex := Ord(DpiAware); + ExecutionLevelComboBox.ItemIndex := Ord(ExecutionLevel); + UIAccessCheckBox.Checked := UIAccess; end; + DpiAwareLabel.Enabled := UseXPManifestCheckBox.Checked; + DpiAwareComboBox.Enabled := UseXPManifestCheckBox.Checked; + ExecutionLevelLabel.Enabled := UseXPManifestCheckBox.Checked; + ExecutionLevelComboBox.Enabled := UseXPManifestCheckBox.Checked; + UIAccessCheckBox.Enabled := UseXPManifestCheckBox.Checked; + TextFieldButton.Enabled := UseXPManifestCheckBox.Checked; AStream := TProjectIcon(ProjResources[TProjectIcon]).GetStream; try SetIconFromStream(AStream); @@ -301,6 +332,9 @@ begin with ProjResources.XPManifest do begin UseManifest := UseXPManifestCheckBox.Checked; + DpiAware := TXPManifestDpiAware(DpiAwareComboBox.ItemIndex); + ExecutionLevel := TXPManifestExecutionLevel(ExecutionLevelComboBox.ItemIndex); + UIAccess := UIAccessCheckBox.Checked; end; end; end; diff --git a/ide/lazarusidestrconsts.pas b/ide/lazarusidestrconsts.pas index 081f6730d0..d48577426f 100644 --- a/ide/lazarusidestrconsts.pas +++ b/ide/lazarusidestrconsts.pas @@ -2548,13 +2548,13 @@ resourcestring dlgPOUseAppBundle = 'Use Application Bundle for running and debugging'; dlgPOCreateAppBundle = 'Create Application Bundle'; dlgPOUseManifest = 'Use manifest resource (and enable themes)'; - dlgPOManifestOptions = 'Manifest options'; dlgPODpiAwareness = 'DPI awareness'; dlgPODpiAwarenessOff = 'off'; dlgPODpiAwarenessOn = 'on'; dlgPODpiAwarenessOldOffNewPerMonitor = 'Vista-8: off, 8.1+: per monitor'; dlgPODpiAwarenessOldOnNewPerMonitor = 'Vista-8: on, 8.1+: per monitor'; dlgPOUIAccess = 'UI Access (uiAccess)'; + dlgPOTextFields = 'Text fields'; dlgPOAsInvoker = 'as invoker (asInvoker)'; dlgPOHighestAvailable = 'highest available (highestAvailable)'; dlgPORequireAdministrator = 'require administrator (requireAdministrator)'; diff --git a/ide/manifestdialog.lfm b/ide/manifestdialog.lfm deleted file mode 100644 index 0b0eda2fa0..0000000000 --- a/ide/manifestdialog.lfm +++ /dev/null @@ -1,149 +0,0 @@ -object ManifestForm: TManifestForm - Left = 554 - Height = 212 - Top = 512 - Width = 568 - BorderIcons = [biSystemMenu] - BorderStyle = bsDialog - Caption = 'Manifest' - ClientHeight = 212 - ClientWidth = 568 - OnCreate = FormCreate - Position = poScreenCenter - LCLVersion = '1.7' - object DpiAwareLabel: TLabel - AnchorSideTop.Control = DpiAwareComboBox - AnchorSideTop.Side = asrCenter - Left = 8 - Height = 17 - Top = 15 - Width = 103 - BorderSpacing.Left = 21 - BorderSpacing.Top = 3 - Caption = 'DpiAwareLabel' - ParentColor = False - end - object DpiAwareComboBox: TComboBox - AnchorSideLeft.Control = ExecutionLevelLabel - AnchorSideLeft.Side = asrBottom - AnchorSideTop.Side = asrBottom - AnchorSideRight.Side = asrBottom - Left = 176 - Height = 31 - Top = 8 - Width = 381 - Anchors = [akTop, akLeft, akRight] - BorderSpacing.Left = 30 - BorderSpacing.Top = 3 - ItemHeight = 0 - Style = csDropDownList - TabOrder = 0 - end - object ExecutionLevelLabel: TLabel - AnchorSideTop.Control = ExecutionLevelComboBox - AnchorSideTop.Side = asrCenter - Left = 8 - Height = 17 - Top = 49 - Width = 138 - Caption = 'ExecutionLevelLabel' - ParentColor = False - end - object ExecutionLevelComboBox: TComboBox - AnchorSideLeft.Control = DpiAwareComboBox - AnchorSideTop.Control = DpiAwareComboBox - AnchorSideTop.Side = asrBottom - AnchorSideRight.Control = DpiAwareComboBox - AnchorSideRight.Side = asrBottom - Left = 176 - Height = 31 - Top = 42 - Width = 381 - Anchors = [akTop, akLeft, akRight] - BorderSpacing.Top = 3 - ItemHeight = 0 - Style = csDropDownList - TabOrder = 1 - end - object UIAccessCheckBox: TCheckBox - AnchorSideTop.Control = ExecutionLevelComboBox - AnchorSideTop.Side = asrBottom - Left = 8 - Height = 24 - Top = 76 - Width = 152 - BorderSpacing.Top = 3 - Caption = 'UIAccessCheckBox' - TabOrder = 2 - end - object ButtonPanel1: TButtonPanel - Left = 6 - Height = 29 - Top = 177 - Width = 556 - OKButton.Name = 'OKButton' - OKButton.DefaultCaption = True - HelpButton.Name = 'HelpButton' - HelpButton.DefaultCaption = True - HelpButton.OnClick = HelpButtonClick - CloseButton.Name = 'CloseButton' - CloseButton.DefaultCaption = True - CancelButton.Name = 'CancelButton' - CancelButton.DefaultCaption = True - TabOrder = 5 - ShowButtons = [pbOK, pbCancel, pbHelp] - ShowBevel = False - end - object NameLabel: TLabel - AnchorSideLeft.Control = DpiAwareLabel - AnchorSideTop.Control = NameEdit - AnchorSideTop.Side = asrCenter - Left = 8 - Height = 17 - Top = 108 - Width = 77 - BorderSpacing.Top = 3 - Caption = 'NameLabel' - ParentColor = False - end - object NameEdit: TEdit - AnchorSideLeft.Control = DpiAwareComboBox - AnchorSideTop.Control = UIAccessCheckBox - AnchorSideTop.Side = asrBottom - AnchorSideRight.Control = DpiAwareComboBox - AnchorSideRight.Side = asrBottom - Left = 176 - Height = 27 - Top = 103 - Width = 381 - Anchors = [akTop, akLeft, akRight] - BorderSpacing.Top = 3 - TabOrder = 3 - end - object DescLabel: TLabel - AnchorSideLeft.Control = DpiAwareLabel - AnchorSideTop.Control = DescEdit - AnchorSideTop.Side = asrCenter - Left = 8 - Height = 17 - Top = 138 - Width = 69 - BorderSpacing.Top = 3 - Caption = 'DescLabel' - ParentColor = False - end - object DescEdit: TEdit - AnchorSideLeft.Control = NameEdit - AnchorSideTop.Control = NameEdit - AnchorSideTop.Side = asrBottom - AnchorSideRight.Control = NameEdit - AnchorSideRight.Side = asrBottom - Left = 176 - Height = 27 - Top = 133 - Width = 381 - Anchors = [akTop, akLeft, akRight] - BorderSpacing.Top = 3 - TabOrder = 4 - end -end diff --git a/ide/manifestdialog.pas b/ide/manifestdialog.pas deleted file mode 100644 index 9657906f6e..0000000000 --- a/ide/manifestdialog.pas +++ /dev/null @@ -1,82 +0,0 @@ -unit ManifestDialog; - -{$mode objfpc}{$H+} - -interface - -uses - Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, - ButtonPanel, LazarusIDEStrConsts, W32Manifest, LCLIntf; - -type - - { TManifestForm } - - TManifestForm = class(TForm) - ButtonPanel1: TButtonPanel; - DpiAwareComboBox: TComboBox; - DpiAwareLabel: TLabel; - DescEdit: TEdit; - DescLabel: TLabel; - NameEdit: TEdit; - ExecutionLevelComboBox: TComboBox; - ExecutionLevelLabel: TLabel; - NameLabel: TLabel; - UIAccessCheckBox: TCheckBox; - procedure FormCreate(Sender: TObject); - procedure HelpButtonClick(Sender: TObject); - private - - public - - end; - -var - ManifestForm: TManifestForm; - -implementation - -{$R *.lfm} - -{ TManifestForm } - -procedure TManifestForm.FormCreate(Sender: TObject); -var - DpiLevel: TXPManifestDpiAware; - DpiLevelNames: array[TXPManifestDpiAware] of string; - ExecLevel: TXPManifestExecutionLevel; - ExecLevelNames: array[TXPManifestExecutionLevel] of string; -begin - Caption := dlgPOManifestOptions; - - DpiLevelNames[xmdaFalse] := dlgPODpiAwarenessOff; - DpiLevelNames[xmdaTrue] := dlgPODpiAwarenessOn; - DpiLevelNames[xmdaPerMonitor] := dlgPODpiAwarenessOldOffNewPerMonitor; - DpiLevelNames[xmdaTruePM] := dlgPODpiAwarenessOldOnNewPerMonitor; - - ExecLevelNames[xmelAsInvoker] := dlgPOAsInvoker; - ExecLevelNames[xmelHighestAvailable] := dlgPOHighestAvailable; - ExecLevelNames[xmelRequireAdministrator] := dlgPORequireAdministrator; - - DpiAwareLabel.Caption := dlgPODpiAwareness; - ExecutionLevelLabel.Caption := dlgPOExecutionLevel; - UIAccessCheckBox.Caption := dlgPOUIAccess; - NameLabel.Caption := lisName; - DescLabel.Caption := lisCodeHelpDescrTag; - - ExecutionLevelComboBox.Items.Clear; - for ExecLevel in TXPManifestExecutionLevel do - ExecutionLevelComboBox.Items.Add(ExecLevelNames[ExecLevel]); - - DpiAwareComboBox.Items.Clear; - for DpiLevel in TXPManifestDpiAware do - DpiAwareComboBox.Items.Add(DpiLevelNames[DpiLevel] + ' (' + ManifestDpiAwareValues[DpiLevel] + ')'); -end; - -procedure TManifestForm.HelpButtonClick(Sender: TObject); -begin - OpenURL('http://wiki.lazarus.freepascal.org/IDE_Window:__Project_Options'); -end; - -end. -