How to collapse all methods in Embarcadero Delphi IDE? - delphi-2010

Ctrl+Shift+K+A unfolds all the collapsed methods, but I couldn't find a way to fold all methods in the file.

From the Delphi Wikia site:
Default IDE Shortcut Keys
Ctrl+Shift+K+O
Toggles Code folding between On and Off
Delphi 2006 and up
Ctrl+Shift+K+A
Code folding: Expands All blocks of code
Delphi 2006 and up
Ctrl+Shift+K+E
Code folding: Collapse current block of code
Delphi 2006 and up
Ctrl+Shift+K+U
Code folding: Expand current block of code
Delphi 2006 and up
Ctrl+Shift+K+T
Code folding: Toggle Current block (expand & collapse)
Ctrl+Shift+K+R
Code folding: Collapses all regions {$region 'comment'}..{$endregion}
Delphi 2006 and up
Ctrl+Shift+K+P
Code folding: Collapse nested procedures
Ctrl+Shift+K+M
Code folding: Collapse all methods
Ctrl+Shift+K+C
Code folding: Collapse all classes
Ctrl+Shift+K+G
Code folding: Collapses down to primary Groups [Interface/Implementation]
Delphi 2006 and up
Ctrl+Shift+K+N
Code folding: Collapses Namespace/Unit
Delphi 2006 and up

Related

Labels and buttons do not work with tabs in Firemonkey

I want to use tabs in a FMX form. In VCL all is functioning as expected. In FMX I tried tabs with labels and buttons without success. HitTest is true, no other controls are on the form. The surrounding frame does not appear and pressing the TAB key does nothing. With edit fields it is working. Did I miss something? Current system is Windows 11 Pro 21H2 and Delphi 10.4.2.
To tab to a TLabel, set its CanFocus property to True. As this property is public, not published, you'll need to do that in code, such as in the form's OnCreate event or by overriding the form's Loaded method.

How To Stick TPanel Component To dxSpreadSheet (DevExpress) Component

I need to stick a panel to dxSpreadSheet's particular cell, anyways to achieves this ?
I remembering doing grouping on components in MS-Word, same thing I needed in my Delphi 2010 application.

How to capture a swallowed Tab key when using ActiveX, Delphi, and DevExpress?

This is a very particular issue. I've got a C# ActiveX control embedded in a Delphi7 form. The Tab key is being swallowed so tabbing from control to control doesn't work at the bottom most layer.
The Delphi7 layers are (from top to bottom):
Delphi form
DevExpress tabbed page control (TcxPageControl)
Embedded ActiveX
The ActiveX's layers are (from top to bottom):
A control that inherits DevExpress's control (XtraUserControl). This control is the COM visible object that is embedded in the Delphi form.
DevExpress panel (PanelControl)
DevExpress tab control (XtraTabControl)
DevExpress tab page (XtraTabPage)
DevExpress Textbox (TextEdit)
Tabbing from textbox to textbox doesn't work. PreviewKeyDown events don't fire from ActiveX's tab page and down. KeyDown event fires on ActiveX's tab control when I TAB, but this event doesn't exist at lower levels.
Tabbing works just fine if I put embed the ActiveX control in a C# form with all the same layers instead of Dephi7.
Delphi7's form has this code in it, which allows tabbing to work in other ActiveX controls I have embedded:
keybd_event(VK_TAB, 0, 0, 0);
Application.ProcessMessages;
I embed the control in code the same way I have done numerous other times with other ActiveX controls (which all work).
My thought is that there are too many layers and somehow the Tab key is being swallowed by a middle layer. How would I make tabbing work at the bottom layer?

Delphi: Styled TMainMenu and TToolBar in TCoolBar

I'm attempting to create an application menu and toolbar in Delphi XE3 that looks like the following (from a program I have):
I'm able to replicate a portion of this look by doing the following:
Create a new VCL Forms application
Add a TMainMenu and insert template menus for File/Edit/etc.
Add a TCoolBar to the form
Add a TToolBar to the TCoolBar
Add a TToolButton to the TToolBar for each of File/Edit/etc. and choose the Group property
Delete the Menu property from the form (so no program menu shows)
Assign the MenuItem property for each TToolButton to the corresponding File/Edit/etc.
Add a second TToolBar to the TCoolBar beneath the first one
Here's what it looks like:
It's somewhat similar but is still missing all the style elements to modify the look of the new application menu.
My question is, does anyone know of how to achieve a similar look, perhaps with a third-party component library? It seems likely that the original developer used a third-party VCL library. I'd like the drop shadow in addition to the styled menus and TCoolBar.
I've tried Raize Components, TMS Advanced Toolbars & Menus, and am in the process of trying DevExpress VCL components. None of them seem to provide a solution, but perhaps I'm not familiar enough with them yet to figure it out.
Delphi has come with an ActionBands demo that can show you how to obtain this appearance "out of the box" for your menus using TActionMainMenuBar (and TActionToolBar). Just change the Style menu to XP Style in the demo:
The rest of your steps seem pretty well complete. For the images on the menu items and toolbar buttons, see the use of ImageList components in association with the TActions on the menu and toolbar in the demo.

Is there a way to activate component editor menu for a concealed component in Delphi

I implemented two menu items for my component in Delphi IDE with TComponentEditor descendant. They're both supposed to be used with "right-clicking" a component on the form. But can I do this for component that is currently hidden (concealed) by other components? So I select a component with other tools (for example object inspector) and would like to activate one of my context menu items.
Shift-F10 doesn't work (at least in D5).
Bringing the component to top for this task is not an option.
Right-click the component in the Object TreeView (Shift-Alt-F11).
D7: Menu > View > Object TreeView
XE2: Menu > View > Structure
Or make a property editor with paDialog in the attributes and forward the Edit method to your component editor. Then double clicking that property or clicking the ellipsis will bring up the component editor, just like the Colums property for TDBEdit does.
If you feel like writing a something mimicking Delphi IDE's Object TreeView, I suggests you the following resources:
Populating all controls of a container object using recursion (Blog post). Using TVirtualTreeView like the Delphi IDE is better than the stock TTreeView to my opinion.
Study the commercial TLMDComponentTree
of the LMD IDE-Tools (Excerpt: This powerful control allows to use a Delphi IDE like Object TreeView. Collections, child controls etc. are automatically handled).

Resources