mirror of
				https://gitlab.com/freepascal.org/lazarus/lazarus.git
				synced 2025-10-31 03:21:28 +01:00 
			
		
		
		
	IDE: Add a drop-down list for component palette tabs. Copied shamelessly from CodeTyphon, then modified.
git-svn-id: trunk@42313 -
This commit is contained in:
		
							parent
							
								
									fe54b32b9b
								
							
						
					
					
						commit
						711fe94d1a
					
				
							
								
								
									
										56
									
								
								ide/main.pp
									
									
									
									
									
								
							
							
						
						
									
										56
									
								
								ide/main.pp
									
									
									
									
									
								
							| @ -93,7 +93,7 @@ uses | |||||||
|   // help manager |   // help manager | ||||||
|   IDEContextHelpEdit, IDEHelpIntf, IDEHelpManager, CodeHelp, HelpOptions, |   IDEContextHelpEdit, IDEHelpIntf, IDEHelpManager, CodeHelp, HelpOptions, | ||||||
|   // designer |   // designer | ||||||
|   JITForms, ComponentPalette, ComponentList, |   JITForms, ComponentPalette, ComponentList, CompPagesPopup, | ||||||
|   ObjInspExt, Designer, FormEditor, CustomFormEditor, |   ObjInspExt, Designer, FormEditor, CustomFormEditor, | ||||||
|   ControlSelection, AnchorEditor, TabOrderDlg, MenuEditorForm, |   ControlSelection, AnchorEditor, TabOrderDlg, MenuEditorForm, | ||||||
|   // LRT stuff |   // LRT stuff | ||||||
| @ -429,13 +429,13 @@ type | |||||||
|     procedure DoProjectOptionsBeforeRead(Sender: TObject); |     procedure DoProjectOptionsBeforeRead(Sender: TObject); | ||||||
|     procedure DoProjectOptionsAfterWrite(Sender: TObject; Restore: boolean); |     procedure DoProjectOptionsAfterWrite(Sender: TObject; Restore: boolean); | ||||||
|     procedure OnCompilerOptionsDialogTest(Sender: TObject); |     procedure OnCompilerOptionsDialogTest(Sender: TObject); | ||||||
|     function DoTestCompilerSettings( |     function DoTestCompilerSettings(TheCompilerOptions: TCompilerOptions): TModalResult; | ||||||
|                             TheCompilerOptions: TCompilerOptions): TModalResult; |     function OnCheckCompOptsAndMainSrcForNewUnit(CompOpts: TLazCompilerOptions): TModalResult; | ||||||
|     function OnCheckCompOptsAndMainSrcForNewUnit(CompOpts: TLazCompilerOptions |  | ||||||
|         ): TModalResult; |  | ||||||
| 
 | 
 | ||||||
|     // ComponentPalette events |     // ComponentPalette events | ||||||
|     procedure ComponentPaletteClassSelected(Sender: TObject); |     procedure ComponentPaletteClassSelected(Sender: TObject); | ||||||
|  |     // Copied from CodeTyphon | ||||||
|  |     procedure SelComponentPageButtonClick(Sender: TObject); | ||||||
| 
 | 
 | ||||||
|     // SourceNotebook events |     // SourceNotebook events | ||||||
|     procedure OnSrcNoteBookActivated(Sender: TObject); |     procedure OnSrcNoteBookActivated(Sender: TObject); | ||||||
| @ -1911,6 +1911,7 @@ procedure TMainIDE.SetupSpeedButtons; | |||||||
|   end; |   end; | ||||||
| 
 | 
 | ||||||
| begin | begin | ||||||
|  |   // Panel for buttons on the left | ||||||
|   MainIDEBar.pnlSpeedButtons := TPanel.Create(OwningComponent); |   MainIDEBar.pnlSpeedButtons := TPanel.Create(OwningComponent); | ||||||
|   with MainIDEBar.pnlSpeedButtons do  |   with MainIDEBar.pnlSpeedButtons do  | ||||||
|   begin |   begin | ||||||
| @ -1922,6 +1923,18 @@ begin | |||||||
|     AutoSize := true; |     AutoSize := true; | ||||||
|     Visible := EnvironmentOptions.IDESpeedButtonsVisible; |     Visible := EnvironmentOptions.IDESpeedButtonsVisible; | ||||||
|   end; |   end; | ||||||
|  |   // Panel on right side of component palette | ||||||
|  |   MainIDEBar.pnlRightSpeedButtons := TPanel.Create(OwningComponent); | ||||||
|  |   with MainIDEBar.pnlRightSpeedButtons do | ||||||
|  |   begin | ||||||
|  |     Name := 'pnlRightSpeedButtons'; | ||||||
|  |     Parent := MainIDEBar; | ||||||
|  |     Align := alRight; | ||||||
|  |     Caption := ''; | ||||||
|  |     BevelOuter := bvNone; | ||||||
|  |     Width:=28; | ||||||
|  |     Visible := EnvironmentOptions.IDESpeedButtonsVisible; | ||||||
|  |   end; | ||||||
| 
 | 
 | ||||||
|   MainIDEBar.tbViewDebug := CreateToolBar('tbViewDebug'); |   MainIDEBar.tbViewDebug := CreateToolBar('tbViewDebug'); | ||||||
|   MainIDEBar.tbStandard := CreateToolBar('tbStandard'); |   MainIDEBar.tbStandard := CreateToolBar('tbStandard'); | ||||||
| @ -1955,6 +1968,19 @@ begin | |||||||
|   MainIDEBar.BuildModeSpeedButton.Style:=tbsDropDown; |   MainIDEBar.BuildModeSpeedButton.Style:=tbsDropDown; | ||||||
|   MainIDEBar.BuildModeSpeedButton.DropdownMenu:=MainIDEBar.SetBuildModePopupMenu; |   MainIDEBar.BuildModeSpeedButton.DropdownMenu:=MainIDEBar.SetBuildModePopupMenu; | ||||||
|   MainIDEBar.SetBuildModePopupMenu.OnPopup := @SetBuildModePopupMenuPopup; |   MainIDEBar.SetBuildModePopupMenu.OnPopup := @SetBuildModePopupMenuPopup; | ||||||
|  | 
 | ||||||
|  |   // Copied from CodeTyphon | ||||||
|  |   MainIDEBar.SelComponentPageButton:=TSpeedButton.Create(MainIDEBar.pnlRightSpeedButtons); | ||||||
|  |   with MainIDEBar.SelComponentPageButton do | ||||||
|  |   begin | ||||||
|  |     Name:='PalettePageSelectBtn'; | ||||||
|  |     Parent:=MainIDEBar.pnlRightSpeedButtons; | ||||||
|  |     LoadGlyphFromLazarusResource('SelCompPage'); | ||||||
|  |     Flat := True; | ||||||
|  |     Hint := 'Click to Select Palette Page'; | ||||||
|  |     SetBounds(1,27,26,26); | ||||||
|  |     OnClick := @SelComponentPageButtonClick; | ||||||
|  |   end; | ||||||
| end; | end; | ||||||
| 
 | 
 | ||||||
| procedure TMainIDE.SetupDialogs; | procedure TMainIDE.SetupDialogs; | ||||||
| @ -4975,6 +5001,26 @@ begin | |||||||
|   DoShowDesignerFormOfCurrentSrc; |   DoShowDesignerFormOfCurrentSrc; | ||||||
| end; | end; | ||||||
| 
 | 
 | ||||||
|  | procedure TMainIDE.SelComponentPageButtonClick(Sender: TObject); | ||||||
|  | var | ||||||
|  |   zPos: TPoint; | ||||||
|  |   btn: TSpeedButton; | ||||||
|  | begin | ||||||
|  |   btn := Sender as TSpeedButton; | ||||||
|  |   zPos:=point(btn.Width,btn.Height); | ||||||
|  |   zPos:=btn.ClientToScreen(zPos); | ||||||
|  |   if DlgCompPagesPopup=nil then | ||||||
|  |     Application.CreateForm(TDlgCompPagesPopup, DlgCompPagesPopup); | ||||||
|  |   if not DlgCompPagesPopup.Visible then | ||||||
|  |   begin | ||||||
|  |     DlgCompPagesPopup.Left:=zPos.x-(DlgCompPagesPopup.Width div 2); | ||||||
|  |     DlgCompPagesPopup.Top:=zPos.y-5; | ||||||
|  |     DlgCompPagesPopup.FixBounds; | ||||||
|  |     DlgCompPagesPopup.Show; | ||||||
|  |   end else | ||||||
|  |     DlgCompPagesPopup.Close; | ||||||
|  | end; | ||||||
|  | 
 | ||||||
| procedure TMainIDE.mnuEnvEditorOptionsClicked(Sender: TObject); | procedure TMainIDE.mnuEnvEditorOptionsClicked(Sender: TObject); | ||||||
| begin | begin | ||||||
|   DoOpenIDEOptions(TEditorGeneralOptionsFrame); |   DoOpenIDEOptions(TEditorGeneralOptionsFrame); | ||||||
|  | |||||||
| @ -73,6 +73,7 @@ type | |||||||
|       StepIntoSpeedButton  : TToolButton; |       StepIntoSpeedButton  : TToolButton; | ||||||
|       StepOverSpeedButton  : TToolButton; |       StepOverSpeedButton  : TToolButton; | ||||||
|       StepOutSpeedButton   : TToolButton; |       StepOutSpeedButton   : TToolButton; | ||||||
|  |     pnlRightSpeedButtons   : TPanel; | ||||||
| 
 | 
 | ||||||
|     NewUnitFormPopupMenu : TPopupMenu; |     NewUnitFormPopupMenu : TPopupMenu; | ||||||
|       NewUFSetDefaultMenuItem: TMenuItem; |       NewUFSetDefaultMenuItem: TMenuItem; | ||||||
| @ -368,6 +369,7 @@ type | |||||||
| 
 | 
 | ||||||
|     // component palette |     // component palette | ||||||
|     ComponentPageControl: TPageControl; |     ComponentPageControl: TPageControl; | ||||||
|  |     SelComponentPageButton: TSpeedButton; | ||||||
|     GlobalMouseSpeedButton: TSpeedButton; |     GlobalMouseSpeedButton: TSpeedButton; | ||||||
|   private |   private | ||||||
|     FOldWindowState: TWindowState; |     FOldWindowState: TWindowState; | ||||||
|  | |||||||
| @ -8283,6 +8283,58 @@ LazarusResources.Add('menu_view_unit_info','PNG',[ | |||||||
|   +#24'l'#132'&'#233#207#21#200'q4'#245'U'#249#156'h'#172#228#15#159'8+'#215#137 |   +#24'l'#132'&'#233#207#21#200'q4'#245'U'#249#156'h'#172#228#15#159'8+'#215#137 | ||||||
|   +#209'Hq'#0#0#0#0'IEND'#174'B`'#130 |   +#209'Hq'#0#0#0#0'IEND'#174'B`'#130 | ||||||
| ]); | ]); | ||||||
|  | LazarusResources.Add('SelCompPage','PNG',[ | ||||||
|  |   #137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#24#0#0#0#24#8#6#0#0#0#224'w='#248#0 | ||||||
|  |   +#0#0#4'sBIT'#8#8#8#8'|'#8'd'#136#0#0#0#9'pHYs'#0#0#10#240#0#0#10#240#1'B'#172 | ||||||
|  |   +'4'#152#0#0#0#28'tEXtSoftware'#0'Adobe Fireworks CS4'#6#178#211#160#0#0#4'HI' | ||||||
|  |   +'DATH'#137#181#149'KlUU'#20#134#191#181#207#185#207#246#246'em'#161#13'R'#170 | ||||||
|  |   +#185#136'b'#192'`"'#3#19#197#16'BD'#9'1'#14#156#26#13#3#19#135#142#156'8'#147 | ||||||
|  |   +#1#3#19#19#29#232'@'#13#17''''#16'I'#16'#'#16#3'Q'#163'<'#164#26#209'F'#131 | ||||||
|  |   +#180'"'#182#222#210#247'}'#157'{'#206#217'{9'#184#167#245#182'4'#193#9';Y' | ||||||
|  |   +#147#157'}'#214#151#245#175#255#172'%'#170#202#221'<'#230#174'f'#7#252#181'.' | ||||||
|  |   +'ED'#18'xk'#172'u'#20'pIX]C'#14'Y}'#151'$'#247#240'{'#218'1'#217'v\'#205'G' | ||||||
|  |   +#157#15#206'['#249#208#7#23'6p'#181'2'#208#0'B VUw'#167#10#12#144#185#255#209 | ||||||
|  |   +#23#222#24#26#26#222#159#241'm#'#138#173#1#164#245#145#231'g'#210#127#142#143 | ||||||
|  |   +#141#141'^'#248#240#16'.'#24#5'*-'#213#220#17#176#238#201''''#30#127#234#224 | ||||||
|  |   +#203#207#23#11'9!'#140#220'm'#15#242#249'<'#31#28'9'#189'q'#244#202#201#211 | ||||||
|  |   +'4n'#150#0#11'D"'#178'B'#170#181#0#2'x'#181'(pSs'#139#212#234#16#198#171#0#2 | ||||||
|  |   +#217' '#162#26#214'#\'#208#9't%'#21#212#18#185#238'X'#129'_'#143#197',6'#154 | ||||||
|  |   +#137#131#213#21#24#136#196'R'#183'j'#16#191#0#180#1'i'#214'0'#195'2 i'#174'$' | ||||||
|  |   +'w'#169#134#168#169#132#224'p'#196#214#161#230#191#22'H'#164'D'#198'Q'#179#8 | ||||||
|  |   +#144'I"'#13'x'#128'''"'#22'@U'#213'_vM'#147#158#6#242'@'#28'Y'#27#207#199#142 | ||||||
|  |   +'H'#20#11',{'#195#1#170#4#190#16#168'Sl'#205'%'#223#228#129'v'#154#189#8#129 | ||||||
|  |   +'XD'#172#159'$'#207#146#30#216#133#223#209'O'#188#232#163#241#250#25#205#247 | ||||||
|  |   +#7'b'#176#214#18';A'#19#19#9#10#10#217#216'RM'#21'<r'#195'['#168'_'#11#241 | ||||||
|  |   +#187#30'B'#252#25#130#241's'#192'$P'#7#2#1#210#254#224#206#167#31#220#247#250 | ||||||
|  |   +'''['#135'zR'#129#160'N'#241#10#247'tf'#251'{'#11#198#24#131'5+'#28#10#234 | ||||||
|  |   +#240#156'2'#187#16'P*'#205#132')'#27#197#25#21'&'#23#172#187'p'#226#157'#' | ||||||
|  |   +#141#223'O'#190#13#204#1'e'#31#240'l'#163#214'w'#221#134#221#253#249#2#155 | ||||||
|  |   +#187's'#184#140#143'5'#194#130#21'T'#13#138#208'T'#18'T'#21'A'#144#216#226 | ||||||
|  |   +#231#178#12#13#15#164#131'J'#152#190'V'#170#241'K4Kh'#195'!'#160#7#8#128#186 | ||||||
|  |   +#15#136'V'#167'''k'#163'#S'#231';'#178'}S'#254'&6['#131#166'S'#184#140'A'#196 | ||||||
|  |   +'`<CJ'#155#0#139#18'Y'#197'Z'#168#5'!'#183#230#234'\/'#135'Tj'#243#232#216 | ||||||
|  |   +#213#152#153#235'% '#151#152'E<'#192'''.'#151#153#28'-'#185't'#247#142#233 | ||||||
|  |   +#193#193#246'jg'#15#149'P('#139#193#243#13#25#12#158'@'#172'P'#143#225#159'H' | ||||||
|  |   +#25#153#143#249'u:f'#218#247'h'#180#135#232#207#23'C'#206#190#251#21#11#127 | ||||||
|  |   +#156#2'f'#18#137'jK'#238#241'p'#245')'#198#191#31#23':'#182#197#27'7t'#134']' | ||||||
|  |   +#189'H'#4'Y'#163'd'#211'B'#202#23#140#7'V'#132'(v'#196#10#185'{'#218#200#165 | ||||||
|  |   +#202#196#223#158#13#226#227#135#207'P'#189'y&i'#240#20'0'#15#212'W'#14'0'#152 | ||||||
|  |   +#211#177'K'#163'a'#213'm'#238#219'Z'#188#247#177#7#6#185#207#135#222#140'a}!' | ||||||
|  |   +'Eo'#206#163#221#8'm'#190#161#191#183#141'J<'#203#196#169#227#149#224#232'[' | ||||||
|  |   +#159#19#205'}'#13#252#5'L$'#128'2'#208'X'#2','#143'\`'#145#27'?]'#157#159#173 | ||||||
|  |   +'n'#138#134#139#3';'#139#3#20#243#134#142#140#161'+m('#164#132#238#158'6~' | ||||||
|  |   +#152#185#197#200#167#31#207'5'#142#30#250#12'W'#191#0#220'H'#0'%`!irL2'#151 | ||||||
|  |   +#150#254#224'6`'#29#240'0'#240','#219#246#158#222'r'#236#138'~t3'#212'K'#19 | ||||||
|  |   +#21'=?'#190#168'_L'#132#186#239#220#13'5'#7'^'#155#0#222#3'^'#5#246#3';'#128 | ||||||
|  |   +#13'@G'#242#195'6W'#129#170#174#134#228#128'>`'#11#176#155#173#187#143#21#143 | ||||||
|  |   +#141#232#151#11#170#191'UT'#15'|'#247#183#178#247#149'k'#192'a'#224' '#240#12 | ||||||
|  |   +#176#29#24#4#10'@j)'#249#10'@'#11#196'K '#189'@'#17#216'Eq'#231#251#27'N\nl' | ||||||
|  |   +#187'8'#161#236'y'#241'2'#240'&'#240#18#176#7'x'#4'X'#159#140#9#191'5'#185 | ||||||
|  |   +#170#222#190#209#0'D'#164'u.'#245#0'}l'#218#254#28#157']'#131#252'x'#238#155 | ||||||
|  |   +#196#130#183#146'fN'#211#28#213'!k'#172#205'5'#1'-'#144#165#190't$'#160'N ' | ||||||
|  |   +#166'9g'#22'hZ'#177#154'$w'#255'k'''#175#130'H'#162'i6'#137'L"cH'#211'%'#1#16 | ||||||
|  |   +#174#222#195#173#231'_'#24#251#29#199#189#232'r'#4#0#0#0#0'IEND'#174'B`'#130 | ||||||
|  | ]); | ||||||
| LazarusResources.Add('state12x12_error','PNG',[ | LazarusResources.Add('state12x12_error','PNG',[ | ||||||
|   #137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#12#0#0#0#12#8#6#0#0#0'Vu\'#231#0#0 |   #137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#12#0#0#0#12#8#6#0#0#0'Vu\'#231#0#0 | ||||||
|   +#1#235'IDATx^-'#146#205'N'#19'Q'#0#133#191'{'#231#142#173#169#18#2'5a0'#162 |   +#1#235'IDATx^-'#146#205'N'#19'Q'#0#133#191'{'#231#142#173#169#18#2'5a0'#162 | ||||||
|  | |||||||
| @ -113,6 +113,7 @@ menu/menu_view_todo.png | |||||||
| menu/menu_view_toggle_form_unit.png | menu/menu_view_toggle_form_unit.png | ||||||
| menu/menu_view_units.png | menu/menu_view_units.png | ||||||
| menu/menu_view_unit_info.png | menu/menu_view_unit_info.png | ||||||
|  | menu/SelCompPage.png | ||||||
| states/state12x12_error.png | states/state12x12_error.png | ||||||
| states/state12x12_fatal.png | states/state12x12_fatal.png | ||||||
| states/state12x12_hint.png | states/state12x12_hint.png | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 juha
						juha