Structure View

From RAD Studio
Jump to: navigation, search

Go Up to Tool Windows Index


View > Tool Windows > Structure View

The Structure View:

  • Is displayed in the upper right pane in the IDE when you are working in the Form Designer.
    This is the same pane that is used by the Code Explorer when you are editing code in the Code Editor.
  • Displays a tree diagram that shows the hierarchy of elements in the active window (that is, the Code Editor or the Form Designer), as follows:
  • Components displayed on the Form Designer
    • Click a component in the Structure View to select it on the form.
  • Source code or HTML displayed in the Code Editor
    • Double-click an item in the Structure View to jump to its declaration or location in the Code Editor.

If your code contains syntax errors, they are displayed in the Errors node in the Code Explorer. You can double-click an error to locate the corresponding source in the Code Editor. (Not applicable for C++ development.)

Tip: You can control the content and appearance of the Structure View and Code Explorer by choosing Tools > Options > Environment Options > Explorer and changing the settings.

Component Nesting Management

When you use the Form Designer, the Structure View shows a tree view that represents the parent-child relationships between the components on the current form or data module. You can use the Structure View to modify these parent-child relationships.

To change the parent of a component, drag the component in the Structure View onto its new parent component. Both the tree view in the Structure View and the form or data module in the Form Designer are updated to reflect the nesting change.

Changing the Parent of RippleEffect1 from Form1 to Image1:

RippleEffectOnStructure.png
SetRippleEffectAsChild.png
RippleEffectAsChildOfImage.png

Nodes and Items Displayed in the Structure View

The tree structure in the Structure View provides a different type of information depending on the tool in use (Code Editor vs. Form Designer) and the language of the current document (Delphi, C++ or HTML). When you are editing code, the Structure View contains the Code Explorer.

Nodes and Items Displayed for the Form Designer

When you use the Form Designer, the Structure View shows a tree view that represents the parent-child relationships between the components on the current form or data module. Each item in the tree view has a label with the component name, and an icon that represents the type of the component:

  • ViewStructureDesignerForm.png Form
  • ViewStructureDesignerDataModule.png Data Module
  • ViewStructureDesignerContainer.png Container or Frame

Controls and Nonvisual Components appear on the Structure View with the same icon as in the Tool Palette, when available.

When there is no counterpart for a component on the Tool Palette, the Structure View displays a default icon. This applies, for example, to the TListBoxItem of a TListBox.

Default icons:

  • ViewStructureDesignerContainer.png for container controls.
  • ViewStructureDesignerControl.png for non-container controls.
  • ViewStructureDesignerNonvisualComponent.png for nonvisual components and other entries, like properties.

Nodes and Items for the Code Explorer (Delphi)

While you edit a Delphi source file in the Code Editor, the Structure View becomes the Code Explorer and shows a tree view that can contain the following information:

  • Icon interf.png <Interface Name>(<Parent Class>)
    • ViewStructureDelphiFolder.png Properties node
      • Icon constant.png <Property Name>: <Property Type>
    • ViewStructureDelphiFolder.png Methods node
      • Icon proc.png <Procedure Name>(<Parameter List>)
      • Icon func.png <Function Name>(<Parameter List>): <Return Type>
  • ViewStructureDelphiFolder.png Classes node
    • Icon class.png <Class>(<Parent Class>)
      • Icon constant.png <Private Property Name>: <Property Type>
      • Icon proc.png <Private Procedure Name>(<Parameter List>)
      • Icon func.png <Private Function Name>(<Parameter List>): <Return Type>
      • ViewStructureDelphiFolder.png Protected node
        • Icon constant.png <Protected Property Name>: <Property Type>
        • Icon proc.png <Protected Procedure Name>(<Parameter List>)
        • Icon func.png <Protected Function Name>(<Parameter List>): <Return Type>
      • ViewStructureDelphiFolder.png Public node
        • Icon constant.png <Public Property Name>: <Property Type>
        • Icon proc.png <Public Procedure Name>(<Parameter List>)
        • Icon func.png <Public Function Name>(<Parameter List>): <Return Type>
      • ViewStructureDelphiFolder.png Published node
        • Icon constant.png <Published Property Name>: <Property Type>
        • Icon proc.png <Published Procedure Name>(<Parameter List>)
        • Icon func.png <Published Function Name>(<Parameter List>): <Return Type>
  • ViewStructureDelphiFolder.png Procedures node
    • Icon proc.png <Procedure Name>(<Parameter List>)
  • ViewStructureDelphiFolder.png Types node
    • Icon type.png <Type Name>
  • ViewStructureDelphiFolder.png Variables/Constants node
    • Icon constant.png <Constant Name>
    • Icon constant.png <Variable Name>: <Variable Type or Class>
  • ViewStructureDelphiFolder.png Uses node
    • Icon unit.png <Unit Name>

Nodes and Items for the Code Explorer (C++)

While you edit a C++ source file in the Code Editor, the Structure View becomes the Code Explorer and displays a tree view that can contain the following information:

  • ViewStructureCppIncludesFolder.png Includes node
    • ViewStructureCppInclude.png <Include Filename>
  • ViewStructureCppFolder.png Macros node
    • ViewStructureCppMacro.png <Macro Name>
  • ViewStructureCppClass.png <Class Name>
    • ViewStructureCppConstructor.png <Constructor Name>(<Parameter List>)
    • ViewStructureCppDestructor.png <Destructor Name>(<Parameter List>)
    • ViewStructureCppProperty.png <Property Name>(<Parameter List>)
    • ViewStructureCppFunction.png <Function Name>(<Parameter List>)
  • ViewStructureCppConstructor.png <Constructor Name>(<Parameter List>)
  • ViewStructureCppDestructor.png <Destructor Name>(<Parameter List>)
  • ViewStructureCppProperty.png <Property Name>(<Parameter List>)
  • ViewStructureCppFunction.png <Function Name>(<Parameter List>)

Nodes and Items for the Code Explorer (HTML)

HTML documents are written using a hierarchical structure. The Code Explorer displays a tree view representing that structure for navigation purposes. Each node in the structure has a label with the initial tag of the HTML element the node represents.

This is an example of a tree view for a simple HTML document:

 DOCTYPE
 <html>
  <head>
   <title>
  <body>
   <p>

Context Menus for Structure View and Code Explorer

The commands that are available on the context menu depend on whether the Structure View or the Code Explorer is being displayed. Right-click the pane to display the following commands:

Item Description

New

Adds a new node to the Structure View.

Rename

Changes the name of the selected node in the Structure View.

Edit

Displays a submenu allowing you to undo changes, cut, copy, paste, delete, or select the controls on the Designer or in the Code Editor.

Control

Displays a submenu allowing you to bring the selected control to the front or send it to the back of the Designer.

Toggle EditMode

Toggles between showing items in the regular and edit modes. This toggles the EditMode property (True -- edit mode and False -- regular mode). Appears when right-click list view control.

Toggle DesignMode

Activates the ListView Design mode that allows you to visually customize the appearance of ListView items at design time. Appears when right-click list view control.

Bind Visually

Opens the LiveBindings Designer.

Properties

Displays the Explorer Options dialog box allowing you to change the content and appearance of the Code Explorer.

Stay on Top

Displays the Structure View on top of the desktop even if other windows are displayed.

Dockable

Enables drag-and-dock for the Structure View.

Toolbar (C++)

The Structure View contains a toolbar for C++ application development that allows you to control how the contents of the Structure View are displayed. It consists of the following buttons:

AlphaSort Sort Alphabetically

Sorts the contents of the Structure View alphabetically.

Group Types Group by type

Groups items into folders by type in the Structure View.

GroupByVisibility.png Group by visibility

Groups class members into folders by visibility: public, protected, private, and published. For C++ , 'Classes' is a generic group that encompasses classes, structs, unions and templates.

Show Type Show function and variable type

Displays the type to the right of the member in the Structure View.

Filter Visibility Filter by visibility (private, protected, public, __published)

Toggles the Structure view display through four different visibility levels. You can selectively display several different combinations of elements that were declared with the access specifiers __published, public, protected, and private.

The four successive tooltips (with 1 - 4 vertical bars) indicate the elements that are currently being displayed, as follows:

This Button Label and Tooltip

Means the Following Elements Are Being Displayed

Filter1.png Filter by visibility (__published)

Only __published

Filter2.png Filter by visibility (public, __published)

Both public and __published

Filter3.png Filter by visibility (protected, public, __published)

Protected, public, and __published

Filter4.png Filter by visibility (private, protected, public, __published)

All four visibility levels

See Also