Discussing the article: "MQL5 Trading Tools (Part 38): Adding a Tabbed Settings Window for Editing Object Properties"

 

Check out the new article: MQL5 Trading Tools (Part 38): Adding a Tabbed Settings Window for Editing Object Properties.

We add a tabbed settings window opened from the ribbon and bound to the selected object. The tabs — Style, Text, Coordinates, and Visibility — are built from the same descriptor system, with scrolling, per-level rows, and shared color/width/style popovers. The article covers layout, rendering, interaction, and inline price/time and numeric editing. You get one place to edit every property with live preview and commit-or-discard on close.

The ribbon and the settings window solve the same problem at two different scales, so rather than build a second editor from scratch, we layer the window on top of everything the ribbon already established. Both read the same per-tool descriptor list, both drive the same engine get-and-set API keyed by property identifier, and both open the same color, width, and style popovers. The difference is one of breadth: the ribbon filters that descriptor list down to the few properties worth a one-click tweak, whereas the window takes the descriptors flagged for the fuller view and lays all of them out, organized into tabs by the group each descriptor belongs to.

We add a handful of genuinely new mechanics on top of that shared foundation. The window needs a tab strip to switch between the Style, Text, Coordinates, and Visibility groups, and a scrollable body for when a tab's rows overflow the available height. We tabbed it this way to mirror how the native MetaTrader 5 terminal handles its object properties. It expands the level lists — which the ribbon never showed — into one editable row per level, each carrying its own visibility checkbox, ratio value, color, width, and style. And it adds two kinds of direct text entry the ribbon had no place for: typing an exact price or time for each anchor point on the Coordinates tab, and typing a bounded numeric value into a chip on the Style and Visibility tabs.

We also give the window a clear commit-or-discard lifecycle. When it opens, we lean on the same property snapshot the ribbon takes, so every edit previews live on the chart as we make it; when it closes, we either keep the changes or roll the object back to the snapshot. The window itself sits one layer above the ribbon in the inheritance chain and is opened by the ribbon's Settings button, so the two share state cleanly rather than competing for the selection. Have a look below at a visualization of what we intend to achieve.

SETTINGS WINDOW ROADMAP

In the default MetaTrader 5 setup, we can edit the object name, but we chose not to enable it in our implementation. With that relationship clear, we can move on to building the window's layout and rendering.

Author: Allan Munene Mutiiria