mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-06 12:40:22 +02:00
fixed gtk TListBox.ItemIndex with MultiSelect and implemented loading .lpk info in install package dialog
git-svn-id: trunk@8990 -
This commit is contained in:
parent
7e0e0f24e1
commit
39d76028e2
@ -3119,7 +3119,7 @@ var
|
||||
begin
|
||||
Result := CallBackDefaultReturn;
|
||||
{$IFDEF EventTrace}
|
||||
EventTrace('gtkListBoxSelectionChangedAfter', data);
|
||||
EventTrace('gtkListSelectChild', data);
|
||||
{$ENDIF}
|
||||
FillChar(Mess,SizeOf(Mess),0);
|
||||
Mess.msg := LM_SelChange;
|
||||
|
@ -3984,7 +3984,7 @@ begin
|
||||
if ALCLObject is TCustomListBox then begin
|
||||
ConnectSenderSignalAfter(PgtkObject(gCore),
|
||||
'selection_changed', @gtkListBoxSelectionChangedAfter);
|
||||
end else if ALCLObject is TCustomCombobox then
|
||||
end else if ALCLObject is TCustomCombobox then
|
||||
ConnectSenderSignal (PGtkObject(
|
||||
PGtkCombo(gObject)^.list), 'unselect_child', @gtkListSelectChild)
|
||||
else
|
||||
|
@ -337,9 +337,6 @@ begin
|
||||
begin
|
||||
if Handle<>0 then begin
|
||||
Widget:=nil;
|
||||
if TListBox(ACustomListBox).MultiSelect then
|
||||
Widget:= PGtkList(GetWidgetInfo(Pointer(Handle), True)^.
|
||||
CoreWidget)^.last_focus_child;
|
||||
if Widget=nil then begin
|
||||
GList:= PGtkList(GetWidgetInfo(Pointer(Handle), True)^.
|
||||
CoreWidget)^.selection;
|
||||
|
@ -7,7 +7,7 @@ object InstallPkgSetDialog: TInstallPkgSetDialog
|
||||
OnCreate = InstallPkgSetDialogCreate
|
||||
OnDestroy = InstallPkgSetDialogDestroy
|
||||
OnResize = InstallPkgSetDialogResize
|
||||
PixelsPerInch = 96
|
||||
PixelsPerInch = 112
|
||||
HorzScrollBar.Page = 528
|
||||
VertScrollBar.Page = 440
|
||||
Left = 319
|
||||
@ -18,7 +18,7 @@ object InstallPkgSetDialog: TInstallPkgSetDialog
|
||||
Anchors = [akTop, akLeft, akBottom]
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'InstallPkgGroupBox'
|
||||
ClientHeight = 273
|
||||
ClientHeight = 274
|
||||
ClientWidth = 251
|
||||
TabOrder = 0
|
||||
Left = 6
|
||||
@ -32,8 +32,9 @@ object InstallPkgSetDialog: TInstallPkgSetDialog
|
||||
MultiSelect = True
|
||||
OnSelectionChange = InstallListBoxSelectionChange
|
||||
TabOrder = 0
|
||||
TopIndex = -1
|
||||
Left = 6
|
||||
Height = 168
|
||||
Height = 169
|
||||
Top = 6
|
||||
Width = 239
|
||||
end
|
||||
@ -46,7 +47,7 @@ object InstallPkgSetDialog: TInstallPkgSetDialog
|
||||
TabOrder = 1
|
||||
Left = 6
|
||||
Height = 25
|
||||
Top = 180
|
||||
Top = 181
|
||||
Width = 239
|
||||
end
|
||||
object ImportButton: TButton
|
||||
@ -58,7 +59,7 @@ object InstallPkgSetDialog: TInstallPkgSetDialog
|
||||
TabOrder = 2
|
||||
Left = 6
|
||||
Height = 25
|
||||
Top = 211
|
||||
Top = 212
|
||||
Width = 239
|
||||
end
|
||||
object ExportButton: TButton
|
||||
@ -70,7 +71,7 @@ object InstallPkgSetDialog: TInstallPkgSetDialog
|
||||
TabOrder = 3
|
||||
Left = 6
|
||||
Height = 25
|
||||
Top = 242
|
||||
Top = 243
|
||||
Width = 239
|
||||
end
|
||||
end
|
||||
@ -78,7 +79,7 @@ object InstallPkgSetDialog: TInstallPkgSetDialog
|
||||
Anchors = [akTop, akLeft, akBottom]
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'AvailablePkgGroupBox'
|
||||
ClientHeight = 273
|
||||
ClientHeight = 274
|
||||
ClientWidth = 251
|
||||
TabOrder = 1
|
||||
Left = 267
|
||||
@ -92,8 +93,9 @@ object InstallPkgSetDialog: TInstallPkgSetDialog
|
||||
MultiSelect = True
|
||||
OnSelectionChange = AvailableListBoxSelectionChange
|
||||
TabOrder = 0
|
||||
TopIndex = -1
|
||||
Left = 6
|
||||
Height = 230
|
||||
Height = 231
|
||||
Top = 6
|
||||
Width = 239
|
||||
end
|
||||
@ -106,7 +108,7 @@ object InstallPkgSetDialog: TInstallPkgSetDialog
|
||||
TabOrder = 1
|
||||
Left = 6
|
||||
Height = 25
|
||||
Top = 242
|
||||
Top = 243
|
||||
Width = 239
|
||||
end
|
||||
end
|
||||
@ -119,9 +121,9 @@ object InstallPkgSetDialog: TInstallPkgSetDialog
|
||||
ModalResult = 2
|
||||
TabOrder = 2
|
||||
Left = 6
|
||||
Height = 29
|
||||
Top = 402
|
||||
Width = 88
|
||||
Height = 26
|
||||
Top = 405
|
||||
Width = 85
|
||||
end
|
||||
object SaveAndRebuildButton: TButton
|
||||
Anchors = [akBottom]
|
||||
@ -130,10 +132,10 @@ object InstallPkgSetDialog: TInstallPkgSetDialog
|
||||
Caption = 'SaveAndRebuildButton'
|
||||
OnClick = InstallButtonClick
|
||||
TabOrder = 3
|
||||
Left = 197
|
||||
Height = 29
|
||||
Top = 402
|
||||
Width = 135
|
||||
Left = 195
|
||||
Height = 26
|
||||
Top = 405
|
||||
Width = 139
|
||||
end
|
||||
object SaveAndExitButton: TButton
|
||||
Anchors = [akRight, akBottom]
|
||||
@ -142,15 +144,15 @@ object InstallPkgSetDialog: TInstallPkgSetDialog
|
||||
Caption = 'SaveAndExitButton'
|
||||
OnClick = SaveAndExitButtonClick
|
||||
TabOrder = 4
|
||||
Left = 406
|
||||
Height = 29
|
||||
Top = 402
|
||||
Width = 116
|
||||
Left = 405
|
||||
Height = 26
|
||||
Top = 405
|
||||
Width = 117
|
||||
end
|
||||
object PkgInfoGroupBox: TGroupBox
|
||||
Anchors = [akLeft, akRight, akBottom]
|
||||
Caption = 'PkgInfoGroupBox'
|
||||
ClientHeight = 67
|
||||
ClientHeight = 68
|
||||
ClientWidth = 511
|
||||
TabOrder = 5
|
||||
Left = 7
|
||||
@ -163,7 +165,7 @@ object InstallPkgSetDialog: TInstallPkgSetDialog
|
||||
ScrollBars = ssAutoVertical
|
||||
TabOrder = 0
|
||||
Left = 5
|
||||
Height = 55
|
||||
Height = 56
|
||||
Top = 5
|
||||
Width = 500
|
||||
end
|
||||
|
@ -5,52 +5,52 @@ LazarusResources.Add('TInstallPkgSetDialog','FORMDATA',[
|
||||
+'InstallListBox'#11'BorderStyle'#7#13'bsSizeToolWin'#7'Caption'#6#19'Install'
|
||||
+'PkgSetDialog'#12'ClientHeight'#3#185#1#11'ClientWidth'#3#17#2#8'OnCreate'#7
|
||||
+#25'InstallPkgSetDialogCreate'#9'OnDestroy'#7#26'InstallPkgSetDialogDestroy'
|
||||
+#8'OnResize'#7#25'InstallPkgSetDialogResize'#13'PixelsPerInch'#2'`'#18'HorzS'
|
||||
+#8'OnResize'#7#25'InstallPkgSetDialogResize'#13'PixelsPerInch'#2'p'#18'HorzS'
|
||||
+'crollBar.Page'#3#16#2#18'VertScrollBar.Page'#3#184#1#4'Left'#3'?'#1#6'Heigh'
|
||||
+'t'#3#185#1#3'Top'#3#178#0#5'Width'#3#17#2#0#9'TGroupBox'#18'InstallPkgGroup'
|
||||
+'Box'#7'Anchors'#11#5'akTop'#6'akLeft'#8'akBottom'#0#20'BorderSpacing.Around'
|
||||
+#2#6#7'Caption'#6#18'InstallPkgGroupBox'#12'ClientHeight'#3#17#1#11'ClientWi'
|
||||
+#2#6#7'Caption'#6#18'InstallPkgGroupBox'#12'ClientHeight'#3#18#1#11'ClientWi'
|
||||
+'dth'#3#251#0#8'TabOrder'#2#0#4'Left'#2#6#6'Height'#3'#'#1#3'Top'#2#6#5'Widt'
|
||||
+'h'#3#255#0#0#8'TListBox'#14'InstallListBox'#5'Align'#7#8'alClient'#20'Borde'
|
||||
+'rSpacing.Around'#2#6#16'ClickOnSelChange'#8#11'MultiSelect'#9#17'OnSelectio'
|
||||
+'nChange'#7#29'InstallListBoxSelectionChange'#8'TabOrder'#2#0#4'Left'#2#6#6
|
||||
+'Height'#3#168#0#3'Top'#2#6#5'Width'#3#239#0#0#0#7'TButton'#15'UninstallButt'
|
||||
+'on'#5'Align'#7#8'alBottom'#20'BorderSpacing.Around'#2#6#25'BorderSpacing.In'
|
||||
+'nerBorder'#2#2#7'Caption'#6#15'UninstallButton'#7'OnClick'#7#20'UninstallBu'
|
||||
+'ttonClick'#8'TabOrder'#2#1#4'Left'#2#6#6'Height'#2#25#3'Top'#3#180#0#5'Widt'
|
||||
+'h'#3#239#0#0#0#7'TButton'#12'ImportButton'#5'Align'#7#8'alBottom'#20'Border'
|
||||
+'Spacing.Around'#2#6#25'BorderSpacing.InnerBorder'#2#2#7'Caption'#6#12'Impor'
|
||||
+'tButton'#7'OnClick'#7#17'ImportButtonClick'#8'TabOrder'#2#2#4'Left'#2#6#6'H'
|
||||
+'eight'#2#25#3'Top'#3#211#0#5'Width'#3#239#0#0#0#7'TButton'#12'ExportButton'
|
||||
+#5'Align'#7#8'alBottom'#20'BorderSpacing.Around'#2#6#25'BorderSpacing.InnerB'
|
||||
+'order'#2#2#7'Caption'#6#12'ExportButton'#7'OnClick'#7#17'ExportButtonClick'
|
||||
+#8'TabOrder'#2#3#4'Left'#2#6#6'Height'#2#25#3'Top'#3#242#0#5'Width'#3#239#0#0
|
||||
+#0#0#9'TGroupBox'#20'AvailablePkgGroupBox'#7'Anchors'#11#5'akTop'#6'akLeft'#8
|
||||
+'akBottom'#0#20'BorderSpacing.Around'#2#6#7'Caption'#6#20'AvailablePkgGroupB'
|
||||
+'ox'#12'ClientHeight'#3#17#1#11'ClientWidth'#3#251#0#8'TabOrder'#2#1#4'Left'
|
||||
+#3#11#1#6'Height'#3'#'#1#3'Top'#2#6#5'Width'#3#255#0#0#8'TListBox'#16'Availa'
|
||||
+'bleListBox'#5'Align'#7#8'alClient'#20'BorderSpacing.Around'#2#6#16'ClickOnS'
|
||||
+'elChange'#8#11'MultiSelect'#9#17'OnSelectionChange'#7#31'AvailableListBoxSe'
|
||||
+'lectionChange'#8'TabOrder'#2#0#4'Left'#2#6#6'Height'#3#230#0#3'Top'#2#6#5'W'
|
||||
+'idth'#3#239#0#0#0#7'TButton'#18'AddToInstallButton'#5'Align'#7#8'alBottom'
|
||||
+#20'BorderSpacing.Around'#2#6#25'BorderSpacing.InnerBorder'#2#2#7'Caption'#6
|
||||
+#18'AddToInstallButton'#7'OnClick'#7#23'AddToInstallButtonClick'#8'TabOrder'
|
||||
+#2#1#4'Left'#2#6#6'Height'#2#25#3'Top'#3#242#0#5'Width'#3#239#0#0#0#0#7'TBut'
|
||||
+'ton'#12'CancelButton'#7'Anchors'#11#6'akLeft'#8'akBottom'#0#8'AutoSize'#9#25
|
||||
+'BorderSpacing.InnerBorder'#2#2#6'Cancel'#9#7'Caption'#6#12'CancelButton'#11
|
||||
+'ModalResult'#2#2#8'TabOrder'#2#2#4'Left'#2#6#6'Height'#2#29#3'Top'#3#146#1#5
|
||||
+'Width'#2'X'#0#0#7'TButton'#20'SaveAndRebuildButton'#7'Anchors'#11#8'akBotto'
|
||||
+'m'#0#8'AutoSize'#9#25'BorderSpacing.InnerBorder'#2#2#7'Caption'#6#20'SaveAn'
|
||||
+'dRebuildButton'#7'OnClick'#7#18'InstallButtonClick'#8'TabOrder'#2#3#4'Left'
|
||||
+#3#197#0#6'Height'#2#29#3'Top'#3#146#1#5'Width'#3#135#0#0#0#7'TButton'#17'Sa'
|
||||
+'veAndExitButton'#7'Anchors'#11#7'akRight'#8'akBottom'#0#8'AutoSize'#9#25'Bo'
|
||||
+'rderSpacing.InnerBorder'#2#2#7'Caption'#6#17'SaveAndExitButton'#7'OnClick'#7
|
||||
+#22'SaveAndExitButtonClick'#8'TabOrder'#2#4#4'Left'#3#150#1#6'Height'#2#29#3
|
||||
+'Top'#3#146#1#5'Width'#2't'#0#0#9'TGroupBox'#15'PkgInfoGroupBox'#7'Anchors'
|
||||
+#11#6'akLeft'#7'akRight'#8'akBottom'#0#7'Caption'#6#15'PkgInfoGroupBox'#12'C'
|
||||
+'lientHeight'#2'C'#11'ClientWidth'#3#255#1#8'TabOrder'#2#5#4'Left'#2#7#6'Hei'
|
||||
+'ght'#2'U'#3'Top'#3'2'#1#5'Width'#3#3#2#0#5'TMemo'#11'PkgInfoMemo'#7'Anchors'
|
||||
+#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#8'ReadOnly'#9#10'ScrollBars'
|
||||
+#7#14'ssAutoVertical'#8'TabOrder'#2#0#4'Left'#2#5#6'Height'#2'7'#3'Top'#2#5#5
|
||||
+'Width'#3#244#1#0#0#0#0
|
||||
+'nChange'#7#29'InstallListBoxSelectionChange'#8'TabOrder'#2#0#8'TopIndex'#2
|
||||
+#255#4'Left'#2#6#6'Height'#3#169#0#3'Top'#2#6#5'Width'#3#239#0#0#0#7'TButton'
|
||||
+#15'UninstallButton'#5'Align'#7#8'alBottom'#20'BorderSpacing.Around'#2#6#25
|
||||
+'BorderSpacing.InnerBorder'#2#2#7'Caption'#6#15'UninstallButton'#7'OnClick'#7
|
||||
+#20'UninstallButtonClick'#8'TabOrder'#2#1#4'Left'#2#6#6'Height'#2#25#3'Top'#3
|
||||
+#181#0#5'Width'#3#239#0#0#0#7'TButton'#12'ImportButton'#5'Align'#7#8'alBotto'
|
||||
+'m'#20'BorderSpacing.Around'#2#6#25'BorderSpacing.InnerBorder'#2#2#7'Caption'
|
||||
+#6#12'ImportButton'#7'OnClick'#7#17'ImportButtonClick'#8'TabOrder'#2#2#4'Lef'
|
||||
+'t'#2#6#6'Height'#2#25#3'Top'#3#212#0#5'Width'#3#239#0#0#0#7'TButton'#12'Exp'
|
||||
+'ortButton'#5'Align'#7#8'alBottom'#20'BorderSpacing.Around'#2#6#25'BorderSpa'
|
||||
+'cing.InnerBorder'#2#2#7'Caption'#6#12'ExportButton'#7'OnClick'#7#17'ExportB'
|
||||
+'uttonClick'#8'TabOrder'#2#3#4'Left'#2#6#6'Height'#2#25#3'Top'#3#243#0#5'Wid'
|
||||
+'th'#3#239#0#0#0#0#9'TGroupBox'#20'AvailablePkgGroupBox'#7'Anchors'#11#5'akT'
|
||||
+'op'#6'akLeft'#8'akBottom'#0#20'BorderSpacing.Around'#2#6#7'Caption'#6#20'Av'
|
||||
+'ailablePkgGroupBox'#12'ClientHeight'#3#18#1#11'ClientWidth'#3#251#0#8'TabOr'
|
||||
+'der'#2#1#4'Left'#3#11#1#6'Height'#3'#'#1#3'Top'#2#6#5'Width'#3#255#0#0#8'TL'
|
||||
+'istBox'#16'AvailableListBox'#5'Align'#7#8'alClient'#20'BorderSpacing.Around'
|
||||
+#2#6#16'ClickOnSelChange'#8#11'MultiSelect'#9#17'OnSelectionChange'#7#31'Ava'
|
||||
+'ilableListBoxSelectionChange'#8'TabOrder'#2#0#8'TopIndex'#2#255#4'Left'#2#6
|
||||
+#6'Height'#3#231#0#3'Top'#2#6#5'Width'#3#239#0#0#0#7'TButton'#18'AddToInstal'
|
||||
+'lButton'#5'Align'#7#8'alBottom'#20'BorderSpacing.Around'#2#6#25'BorderSpaci'
|
||||
+'ng.InnerBorder'#2#2#7'Caption'#6#18'AddToInstallButton'#7'OnClick'#7#23'Add'
|
||||
+'ToInstallButtonClick'#8'TabOrder'#2#1#4'Left'#2#6#6'Height'#2#25#3'Top'#3
|
||||
+#243#0#5'Width'#3#239#0#0#0#0#7'TButton'#12'CancelButton'#7'Anchors'#11#6'ak'
|
||||
+'Left'#8'akBottom'#0#8'AutoSize'#9#25'BorderSpacing.InnerBorder'#2#2#6'Cance'
|
||||
+'l'#9#7'Caption'#6#12'CancelButton'#11'ModalResult'#2#2#8'TabOrder'#2#2#4'Le'
|
||||
+'ft'#2#6#6'Height'#2#26#3'Top'#3#149#1#5'Width'#2'U'#0#0#7'TButton'#20'SaveA'
|
||||
+'ndRebuildButton'#7'Anchors'#11#8'akBottom'#0#8'AutoSize'#9#25'BorderSpacing'
|
||||
+'.InnerBorder'#2#2#7'Caption'#6#20'SaveAndRebuildButton'#7'OnClick'#7#18'Ins'
|
||||
+'tallButtonClick'#8'TabOrder'#2#3#4'Left'#3#195#0#6'Height'#2#26#3'Top'#3#149
|
||||
+#1#5'Width'#3#139#0#0#0#7'TButton'#17'SaveAndExitButton'#7'Anchors'#11#7'akR'
|
||||
+'ight'#8'akBottom'#0#8'AutoSize'#9#25'BorderSpacing.InnerBorder'#2#2#7'Capti'
|
||||
+'on'#6#17'SaveAndExitButton'#7'OnClick'#7#22'SaveAndExitButtonClick'#8'TabOr'
|
||||
+'der'#2#4#4'Left'#3#149#1#6'Height'#2#26#3'Top'#3#149#1#5'Width'#2'u'#0#0#9
|
||||
+'TGroupBox'#15'PkgInfoGroupBox'#7'Anchors'#11#6'akLeft'#7'akRight'#8'akBotto'
|
||||
+'m'#0#7'Caption'#6#15'PkgInfoGroupBox'#12'ClientHeight'#2'D'#11'ClientWidth'
|
||||
+#3#255#1#8'TabOrder'#2#5#4'Left'#2#7#6'Height'#2'U'#3'Top'#3'2'#1#5'Width'#3
|
||||
+#3#2#0#5'TMemo'#11'PkgInfoMemo'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8
|
||||
+'akBottom'#0#8'ReadOnly'#9#10'ScrollBars'#7#14'ssAutoVertical'#8'TabOrder'#2
|
||||
+#0#4'Left'#2#5#6'Height'#2'8'#3'Top'#2#5#5'Width'#3#244#1#0#0#0#0
|
||||
]);
|
||||
|
@ -507,6 +507,8 @@ var
|
||||
PkgID: TLazPackageID;
|
||||
Author: String;
|
||||
Description: String;
|
||||
PkgLink: TPackageLink;
|
||||
XMLConfig: TXMLConfig;
|
||||
begin
|
||||
if List = nil then Exit;
|
||||
PkgName := '';
|
||||
@ -514,8 +516,7 @@ begin
|
||||
PkgName := List.Items[List.ItemIndex];
|
||||
|
||||
if PkgName = '' then Exit;
|
||||
if Assigned(FSelectedPkg) then
|
||||
if PkgName = FSelectedPkg.IDAsString then Exit;
|
||||
if Assigned(FSelectedPkg) and (PkgName = FSelectedPkg.IDAsString) then Exit;
|
||||
|
||||
PkgInfoMemo.Clear;
|
||||
PkgID := TLazPackageID.Create;
|
||||
@ -523,12 +524,30 @@ begin
|
||||
PkgID.StringToID(PkgName);
|
||||
FSelectedPkg := PackageGraph.FindPackageWithID(PkgID);
|
||||
|
||||
Author:='';
|
||||
Description:='';
|
||||
if FSelectedPkg <> nil then begin
|
||||
Author:=FSelectedPkg.Author;
|
||||
Description:=FSelectedPkg.Description;
|
||||
end else begin
|
||||
// package not loaded -> read valuesform .lpk
|
||||
// TODO
|
||||
// package not loaded -> read values from .lpk
|
||||
PkgLink:=PkgLinks.FindLinkWithPackageID(PkgID);
|
||||
if (PkgLink<>nil) and FileExistsCached(PkgLink.Filename) then begin
|
||||
// load the package file
|
||||
try
|
||||
XMLConfig:=TXMLConfig.Create(PkgLink.Filename);
|
||||
try
|
||||
Author:=XMLConfig.GetValue('Package/Author/Value','');
|
||||
Description:=XMLConfig.GetValue('Package/Description/Value','');
|
||||
finally
|
||||
XMLConfig.Free;
|
||||
end;
|
||||
except
|
||||
on E: Exception do begin
|
||||
DebugLn('TInstallPkgSetDialog.UpdatePackageInfo ERROR: ',E.Message);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
if Author<>'' then
|
||||
PkgInfoMemo.Lines.Add(lisPckOptsAuthor + ': ' + Author);
|
||||
|
Loading…
Reference in New Issue
Block a user