diff --git a/docs/xml/lcl/menus.xml b/docs/xml/lcl/menus.xml index 0127c7410e..efc04dfb67 100644 --- a/docs/xml/lcl/menus.xml +++ b/docs/xml/lcl/menus.xml @@ -90,10 +90,14 @@ - EMenuError - Exception handler for error in Menu access + + EMenuError +- Exception handler for error in Menu access - + + A menu item + @@ -101,16 +105,26 @@ - + + + - + + + - + + + - TMenuActionLink: defines the link between a selected menu item and its corresponding action + + TMenuActionLink +: defines the link between a selected menu item and its corresponding action -

TMenuActionLink: defines the link between a selected menu item and its corresponding action. Properties are protected and not readily accessible by application programmers.

+

+ TMenuActionLink +: defines the link between a selected menu item and its corresponding action. Properties are protected and not readily accessible by application programmers.

@@ -127,7 +141,9 @@
- + + + @@ -136,7 +152,9 @@ - + + + @@ -145,7 +163,9 @@ - + + + @@ -154,7 +174,9 @@ - + + + @@ -163,7 +185,9 @@ - + + + @@ -172,7 +196,9 @@ - + + + @@ -181,7 +207,9 @@ - + + + @@ -190,7 +218,9 @@ - + + + @@ -199,7 +229,9 @@ - + + + @@ -208,7 +240,9 @@ - + + + @@ -217,7 +251,9 @@ - + + + @@ -226,7 +262,9 @@ - + + + @@ -235,7 +273,9 @@ - + + + @@ -244,7 +284,9 @@ - + + + @@ -253,7 +295,9 @@ - + + + @@ -262,7 +306,9 @@ - + + + @@ -271,7 +317,9 @@ - + + + @@ -280,7 +328,9 @@ - + + + @@ -289,7 +339,9 @@ - + + + @@ -298,7 +350,9 @@ - + + + @@ -307,7 +361,9 @@ - + + + @@ -316,7 +372,9 @@ - + + + @@ -325,9 +383,13 @@ - TMenuItem - The base structure of each item in a Menu. + + TMenuItem + - The base structure of each item in a Menu. -

TMenuItem - The base structure of each item in a Menu.

+

+ TMenuItem + - The base structure of each item in a Menu.

This Component does the hard work of processing the Items found in the various types of menus. It defines a lot of the properties and methods used in the various sorts of menu, including TMainMenu, TMenu and TPopUpMenu

@@ -489,7 +551,9 @@ - + + + @@ -498,7 +562,9 @@ - + + + @@ -507,9 +573,13 @@ - + + + - + + + @@ -518,7 +588,9 @@ - + + + @@ -527,7 +599,9 @@ - + + + @@ -536,7 +610,9 @@ - + + + @@ -545,7 +621,9 @@ - + + + @@ -554,7 +632,9 @@ - + + + @@ -563,7 +643,9 @@ - + + + @@ -572,7 +654,9 @@ - + + + @@ -581,7 +665,9 @@ - + + + @@ -590,7 +676,9 @@ - + + + @@ -599,7 +687,9 @@ - + + + @@ -608,7 +698,9 @@ - + + + @@ -617,7 +709,9 @@ - + + + @@ -626,7 +720,9 @@ - + + + @@ -635,7 +731,9 @@ - + + + @@ -644,7 +742,9 @@ - + + + @@ -653,7 +753,9 @@ - + + + @@ -662,7 +764,9 @@ - + + + @@ -671,7 +775,9 @@ - + + + @@ -680,7 +786,9 @@ - + + + @@ -689,7 +797,9 @@ - + + + @@ -698,7 +808,9 @@ - + + + @@ -707,7 +819,9 @@ - + + + @@ -716,7 +830,9 @@ - + + + @@ -725,9 +841,13 @@ - + + + - + + + @@ -736,11 +856,17 @@ - + + + - + + + - + + + @@ -756,7 +882,9 @@ - + + + @@ -765,9 +893,13 @@ - + + + - + + + @@ -776,7 +908,9 @@ - + + + @@ -785,7 +919,9 @@ - + + + @@ -794,7 +930,9 @@ - + + + @@ -803,7 +941,9 @@ - + + + @@ -812,7 +952,9 @@ - + + + @@ -842,9 +984,13 @@ - + + + - + + + @@ -853,9 +999,13 @@ - + + + - + + + @@ -871,7 +1021,9 @@ - + + + @@ -880,7 +1032,9 @@ - + + + @@ -889,9 +1043,13 @@ - + + + - + + + @@ -900,7 +1058,9 @@ - + + + @@ -909,7 +1069,9 @@ - + + + @@ -918,7 +1080,9 @@ - + + + @@ -927,7 +1091,9 @@ - + + + @@ -936,7 +1102,9 @@ - + + + @@ -952,7 +1120,9 @@ - + + + @@ -973,7 +1143,9 @@ - + + + @@ -989,7 +1161,9 @@ - + + + @@ -998,7 +1172,9 @@ - + + + @@ -1007,7 +1183,9 @@ - + + + @@ -1016,7 +1194,9 @@ - + + + @@ -1025,7 +1205,9 @@ - + + + @@ -1034,7 +1216,9 @@ - + + + @@ -1050,9 +1234,13 @@ - + + + - + + + @@ -1061,9 +1249,13 @@ - + + + - + + + @@ -1072,9 +1264,13 @@ - + + + - + + + @@ -1083,7 +1279,9 @@ - + + + @@ -1092,7 +1290,9 @@ - + + + @@ -1115,7 +1315,9 @@ - + + + @@ -1131,9 +1333,13 @@ - + + + - + + + @@ -1149,7 +1355,9 @@ - + + + @@ -1158,7 +1366,9 @@ - + + + @@ -1174,7 +1384,9 @@ - + + + @@ -1183,7 +1395,9 @@ - + + + @@ -1203,7 +1417,9 @@ - + + + @@ -1230,64 +1446,96 @@ - + + + - Action - the default action associated with this Menu Item + + Action + - the default action associated with this Menu Item - AutoCheck: Whether a check mark is automatically added when the item is selected + + AutoCheck +: Whether a check mark is automatically added when the item is selected - Caption: The text that appears on the Menu Bar at run-time + + Caption +: The text that appears on the Menu Bar at run-time - Checked: whether a check mark appears on the Menu Bar + + Checked +: whether a check mark appears on the Menu Bar - Default: is this option the default selection? If so, it usually appears in Bold and is selected by hitting ENTER + + Default +: is this option the default selection? If so, it usually appears in Bold and is selected by hitting ENTER - Enabled: can this option be selected? If Not Enabled, usually 'greyed-out' + + Enabled +: can this option be selected? If Not Enabled, usually 'greyed-out' - BitMap: an optional picture beside the MenuItem Caption + + BitMap +: an optional picture beside the MenuItem Caption - GroupIndex: the sequence number in a group of mutually exclusive RadioItem choices + + GroupIndex +: the sequence number in a group of mutually exclusive RadioItem choices - HelpContext - an index to the context-sensitive help string to be used + + HelpContext + - an index to the context-sensitive help string to be used - Hint: a pop-up help message that appears when the mouse hovers over an item. + + Hint +: a pop-up help message that appears when the mouse hovers over an item. - ImageIndex - number in a list of images for use in illustrating menu items + + ImageIndex +- number in a list of images for use in illustrating menu items - RadioItem: whether the item is part of a group of mutually exclusive choices. + + RadioItem +: whether the item is part of a group of mutually exclusive choices. - RightJustify: the position of the Caption in the Menu Panel. Default (False) is Left Justify + + RightJustify +: the position of the Caption in the Menu Panel. Default (False) is Left Justify - ShortCut - the quick key sequence to be used in selecting this menu item + + ShortCut + - the quick key sequence to be used in selecting this menu item -

ShortCut - the quick key sequence to be used in selecting this menu item

+

+ ShortCut + - the quick key sequence to be used in selecting this menu item

If you select this property in the Object Inspector, a list-box will appear with choices for various key-combinations to be used. The chosen key-sequence will be displayed, at run-time, on the menu drop-down next to the caption for the menu item.

@@ -1299,15 +1547,21 @@ - SubMenuImages - will images be shown for sub-menu items as well as the main item? + + SubMenuImages +- will images be shown for sub-menu items as well as the main item? - Visible - can the item be seen? + + Visible + - can the item be seen? - OnClick - event handler for selection of this menu item + + OnClick +- event handler for selection of this menu item @@ -1316,16 +1570,26 @@ - + + + - + + + - + + + - TMenu: The base class for all menus + + TMenu +: The base class for all menus -

TMenu: The base class for all menus

+

+ TMenu +: The base class for all menus

The class definition contains very few public or published properties or methods accessible to the application programmer, but contains the entry Items which points to the Menu Items that appear in the menu displays

@@ -1373,7 +1637,9 @@
- + + + @@ -1382,7 +1648,9 @@ - + + + @@ -1391,7 +1659,9 @@ - + + + @@ -1407,9 +1677,13 @@ - + + + - + + + @@ -1418,7 +1692,9 @@ - + + + @@ -1427,9 +1703,13 @@ - + + + - + + + @@ -1438,11 +1718,17 @@ - + + + - + + + - + + + @@ -1470,7 +1756,9 @@ - + + + @@ -1493,11 +1781,17 @@ - + + + - + + + - + + + @@ -1506,7 +1800,9 @@ - + + + @@ -1515,7 +1811,9 @@ - + + + @@ -1531,9 +1829,13 @@ - + + + - + + + @@ -1548,17 +1850,25 @@ - Items - a list of Menu Items to be included in the menu display + + Items + - a list of Menu Items to be included in the menu display - Images - a list of images from which entries can be selected to illustrate menu choices + + Images +- a list of images from which entries can be selected to illustrate menu choices - TMainMenu - the Main Menu that appears at the top of most windows + + TMainMenu + - the Main Menu that appears at the top of most windows -

TMainMenu - the Main Menu that appears at the top of most windows; form designers can +

+ TMainMenu + - the Main Menu that appears at the top of most windows; form designers can customise by choosing various menu items.

Main Menu is a non-visible component : that is, if the icon is selected from the Component Pallete and placed on the Form, it will not appear at Run-time. Instead, a Menu bar with a structure defined by the Menu Editor will appear.

To see the Menu Editor, right-click on the Main Menu icon on your Form.

@@ -1585,7 +1895,9 @@ customise by choosing various menu items.

- + + + @@ -1600,9 +1912,13 @@ customise by choosing various menu items.

- TPopupMenu - a menu panel that pops up on the desktop when the right mouse button is clicked + + TPopupMenu + - a menu panel that pops up on the desktop when the right mouse button is clicked -

TPopupMenu: a menu panel that pops up on the desktop when the right mouse button is clicked.

+

+ TPopupMenu +: a menu panel that pops up on the desktop when the right mouse button is clicked.

Inherits all the properties of TMenu (including the properties of TMenuItem), but has some new properties (procedure PopUp and procedure Close) that define its behaviour when actually invoked.

PopupPoint defines the position of the Popup menu, usually at the current cursor position.

To use a Popup menu, first create it with the MenuEditor. Then with the Object Inspector for the control that needs to use the Popup, select the property named PopupMenu, and a listbox will appear with the names of the available Menus - choose the Popup name you want

@@ -1653,7 +1969,9 @@ customise by choosing various menu items.

- + + + @@ -1662,7 +1980,9 @@ customise by choosing various menu items.

- + + + @@ -1678,9 +1998,13 @@ customise by choosing various menu items.

- + + + - + + + @@ -1733,11 +2057,17 @@ customise by choosing various menu items.

- + + + - + + + - + + + @@ -1746,11 +2076,17 @@ customise by choosing various menu items.

- + + + - + + + - + + + @@ -1777,10 +2113,16 @@ customise by choosing various menu items.

- HowToUseMenus - hints for creating Menus for your Forms + + HowToUseMenus + - hints for creating Menus for your Forms -

HowToUseMenus - hints for creating Menus for your Forms

-

TMainMenu is the Main Menu that appears at the top of most forms; form designers can +

+ HowToUseMenus + - hints for creating Menus for your Forms

+

+ TMainMenu + is the Main Menu that appears at the top of most forms; form designers can customise by choosing various menu items. TPopupMenu is a menu window that pops up with pertinent, usually context-sensitive, details and choices when the right mouse button is clicked near a control

Main Menu is a non-visible component : that is, if the icon is selected from the Component Palette and placed on the Form, it will not appear at Run-time. Instead, a Menu bar with a structure defined by the Menu Editor will appear. Popup menus, placed on the form by selecting the icon from the Component Palette, do not appear at all unless the right mouse button is clicked on a control that owns such a menu.

To see the Menu Editor, right-click on the Main Menu or Popup Menu icon on your Form. A pop-up box appears, that invites you to enter items into the Menu bar.

diff --git a/ide/fpdoceditwindow.pas b/ide/fpdoceditwindow.pas index 1b20993bea..4db87c87fa 100644 --- a/ide/fpdoceditwindow.pas +++ b/ide/fpdoceditwindow.pas @@ -47,15 +47,15 @@ uses IDEProcs, LazarusIDEStrConsts, FPDocSelectInherited, CodeHelp; type - TLazDocFormFlag = ( - ldffWriting, - ldffChainNeedsUpdate, - ldffCaptionNeedsUpdate, - ldffValueControlsNeedsUpdate, - ldffInheritedControlsNeedsUpdate, - ldffLinkIDComboNeedsUpdate + TFPDocEditorFlag = ( + fpdefWriting, + fpdefChainNeedsUpdate, + fpdefCaptionNeedsUpdate, + fpdefValueControlsNeedsUpdate, + fpdefInheritedControlsNeedsUpdate, + fpdefLinkIDComboNeedsUpdate ); - TLazDocFormFlags = set of TLazDocFormFlag; + TFPDocEditorFlags = set of TFPDocEditorFlag; { TFPDocEditor } @@ -109,7 +109,7 @@ type private FCaretXY: TPoint; FModified: Boolean; - FFlags: TLazDocFormFlags; + FFlags: TFPDocEditorFlags; fUpdateLock: Integer; fSourceFilename: string; fChain: TCodeHelpElementChain; @@ -140,7 +140,7 @@ type public procedure Reset; procedure InvalidateChain; - procedure UpdateLazDoc(const SrcFilename: string; const Caret: TPoint); + procedure UpdateFPDocEditor(const SrcFilename: string; const Caret: TPoint); procedure BeginUpdate; procedure EndUpdate; procedure ClearEntry(DoSave: Boolean); @@ -187,10 +187,10 @@ var sl: TStringList; begin if fUpdateLock>0 then begin - Include(FFLags,ldffLinkIDComboNeedsUpdate); + Include(FFLags,fpdefLinkIDComboNeedsUpdate); exit; end; - Exclude(FFLags,ldffLinkIDComboNeedsUpdate); + Exclude(FFLags,fpdefLinkIDComboNeedsUpdate); {$IFDEF VerboseCodeHelp} DebugLn(['TFPDocEditForm.UpdateLinkIdComboBox START']); @@ -341,15 +341,15 @@ end; procedure TFPDocEditor.ApplicationIdle(Sender: TObject; var Done: Boolean); begin Done:=false; - if ldffChainNeedsUpdate in FFlags then + if fpdefChainNeedsUpdate in FFlags then UpdateChain - else if ldffCaptionNeedsUpdate in FFlags then + else if fpdefCaptionNeedsUpdate in FFlags then UpdateCaption - else if ldffValueControlsNeedsUpdate in FFlags then + else if fpdefValueControlsNeedsUpdate in FFlags then UpdateValueControls - else if ldffInheritedControlsNeedsUpdate in FFlags then + else if fpdefInheritedControlsNeedsUpdate in FFlags then UpdateInheritedControls - else if ldffLinkIDComboNeedsUpdate in FFlags then + else if fpdefLinkIDComboNeedsUpdate in FFlags then UpdateLinkIdComboBox else Done:=true; @@ -457,10 +457,10 @@ var strCaption: String; begin if fUpdateLock>0 then begin - Include(FFlags,ldffCaptionNeedsUpdate); + Include(FFlags,fpdefCaptionNeedsUpdate); exit; end; - Exclude(FFlags,ldffCaptionNeedsUpdate); + Exclude(FFlags,fpdefCaptionNeedsUpdate); {$IFDEF VerboseCodeHelp} DebugLn(['TFPDocEditForm.UpdateCaption START']); @@ -486,10 +486,10 @@ var Element: TCodeHelpElement; begin if fUpdateLock>0 then begin - Include(FFLags,ldffValueControlsNeedsUpdate); + Include(FFLags,fpdefValueControlsNeedsUpdate); exit; end; - Exclude(FFLags,ldffValueControlsNeedsUpdate); + Exclude(FFLags,fpdefValueControlsNeedsUpdate); {$IFDEF VerboseCodeHelp} DebugLn(['TFPDocEditForm.UpdateValueControls START']); @@ -508,10 +508,10 @@ var ShortDescr: String; begin if fUpdateLock>0 then begin - Include(FFLags,ldffInheritedControlsNeedsUpdate); + Include(FFLags,fpdefInheritedControlsNeedsUpdate); exit; end; - Exclude(FFLags,ldffInheritedControlsNeedsUpdate); + Exclude(FFLags,fpdefInheritedControlsNeedsUpdate); {$IFDEF VerboseCodeHelp} DebugLn(['TFPDocEditForm.UpdateInheritedControls START']); @@ -544,10 +544,10 @@ var begin FreeAndNil(fChain); if fUpdateLock>0 then begin - Include(FFLags,ldffChainNeedsUpdate); + Include(FFLags,fpdefChainNeedsUpdate); exit; end; - Exclude(FFLags,ldffChainNeedsUpdate); + Exclude(FFLags,fpdefChainNeedsUpdate); if (fSourceFilename='') or (CaretXY.X<1) or (CaretXY.Y<1) then exit; @@ -569,7 +569,7 @@ begin case LDResult of chprParsing: begin - Include(FFLags,ldffChainNeedsUpdate); + Include(FFLags,fpdefChainNeedsUpdate); DebugLn(['TFPDocEditForm.UpdateChain ToDo: still parsing LazDocBoss.GetElementChain for ',fSourceFilename,' ',dbgs(CaretXY)]); exit; end; @@ -590,7 +590,7 @@ end; procedure TFPDocEditor.OnLazDocChanging(Sender: TObject; LazDocFPFile: TLazFPDocFile); begin - if ldffWriting in FFlags then exit; + if fpdefWriting in FFlags then exit; if (fChain<>nil) and (fChain.IndexOfFile(LazDocFPFile)>=0) then InvalidateChain; end; @@ -598,7 +598,7 @@ end; procedure TFPDocEditor.OnLazDocChanged(Sender: TObject; LazDocFPFile: TLazFPDocFile); begin - if ldffWriting in FFlags then exit; + if fpdefWriting in FFlags then exit; end; @@ -666,12 +666,12 @@ begin DebugLn(['TFPDocEditForm.CreateElement ']); if (Element=nil) or (Element.ElementName='') then exit(false); NewElement:=nil; - Include(FFlags,ldffWriting); + Include(FFlags,fpdefWriting); try Result:=CodeHelpBoss.CreateElement(Element.CodeXYPos.Code, Element.CodeXYPos.X,Element.CodeXYPos.Y,NewElement); finally - Exclude(FFlags,ldffWriting); + Exclude(FFlags,fpdefWriting); NewElement.Free; end; Reset; @@ -698,12 +698,12 @@ end; procedure TFPDocEditor.InvalidateChain; begin FreeAndNil(fChain); - FFlags:=FFlags+[ldffChainNeedsUpdate,ldffCaptionNeedsUpdate, - ldffValueControlsNeedsUpdate,ldffInheritedControlsNeedsUpdate, - ldffLinkIDComboNeedsUpdate]; + FFlags:=FFlags+[fpdefChainNeedsUpdate,fpdefCaptionNeedsUpdate, + fpdefValueControlsNeedsUpdate,fpdefInheritedControlsNeedsUpdate, + fpdefLinkIDComboNeedsUpdate]; end; -procedure TFPDocEditor.UpdateLazDoc(const SrcFilename: string; +procedure TFPDocEditor.UpdateFPDocEditor(const SrcFilename: string; const Caret: TPoint); var NewSrcFilename: String; @@ -735,7 +735,7 @@ begin dec(fUpdateLock); if fUpdateLock<0 then RaiseGDBException(''); if fUpdateLock=0 then begin - if ldffCaptionNeedsUpdate in FFlags then UpdateCaption; + if fpdefCaptionNeedsUpdate in FFlags then UpdateCaption; end; end; @@ -883,7 +883,7 @@ var begin Result:=false; - if ldffWriting in FFlags then begin + if fpdefWriting in FFlags then begin DebugLn(['TFPDocEditForm.WriteNode inconsistency detected: recursive write']); exit; end; @@ -907,7 +907,7 @@ begin Exit; end; - Include(FFlags,ldffWriting); + Include(FFlags,fpdefWriting); try CurDocFile.BeginUpdate; @@ -920,7 +920,7 @@ begin finally CurDocFile.EndUpdate; fChain.MakeValid; - Exclude(FFlags,ldffWriting); + Exclude(FFlags,fpdefWriting); end; if CodeHelpBoss.SaveFPDocFile(CurDocFile)<>mrOk then begin diff --git a/ide/uniteditor.pp b/ide/uniteditor.pp index fb4c1a800d..e5cc87786b 100644 --- a/ide/uniteditor.pp +++ b/ide/uniteditor.pp @@ -3113,7 +3113,7 @@ begin SrcEdit:=GetActiveSE; if SrcEdit=nil then exit; CaretPos := SrcEdit.EditorComponent.CaretXY; - FPDocEditor.UpdateLazDoc(SrcEdit.Filename,CaretPos); + FPDocEditor.UpdateFPDocEditor(SrcEdit.Filename,CaretPos); end; function TSourceNotebook.OnSynCompletionPaintItem(const AKey: string;