Objo.
Feedback Forum Docs Objo Studio
Feedback

Feature #1134

Elementary shapes render directly in the visual designer

Status
Fixed
Fixed in
v26.8.4
Source discussion
https://forum.objo.dev/d/810-elementary-shapes-with-background-fill
Last updated
2026-08-17

Upvotes

0 upvotes

Uses your Objo forum account.

Public summary

The forum thread Elementary shapes with background fill requests a lightweight desktop control that renders basic solid-colour shapes: rectangles, rounded rectangles, ovals/circles, and upward-pointing triangles. Today those shapes require a Canvas plus drawing code, so a small declarative control is a convenient alternative for static UI decoration (header bars, status circles, rounded panels, decorative triangles).

This adds a desktop ShapeControl type that renders the real shape both at runtime and in Objo Studio's visual designer — the designer preview shows the actual configured shape, not a generic labelled rectangle or placeholder.

Proposed public API:

Class ShapeControl Inherits Control

Var shape As New ShapeControl
shape.Type = ShapeType.Oval
shape.FillColour = Colour.Green

Properties (all read/write):

  • Type As ShapeType — default ShapeType.Rectangle; unknown runtime enum values normalise safely to ShapeType.Rectangle.
  • FillColour As Colour — default Colour.Transparent; alpha honoured. Areas outside an oval or triangle remain transparent.
  • BorderColour As Colour — outline colour. When not explicitly assigned, uses the current semantic desktop control-border theme colour and continues following live theme changes.
  • BorderThickness As Double — default 1.0; values below zero coerce to zero; zero means no border. The complete border is drawn inside the control bounds.
  • CornerRadius As Double — default 0.0; values below zero coerce to zero. Applies only when Type = ShapeType.Rectangle; the effective rendered radius is capped at half the smaller rendered dimension. The assigned nonnegative value is preserved when switching to another shape type and restored when switching back.

Built-in enum-style type ShapeType with shared constants Rectangle, Oval, Triangle (following the existing ChartType/Orientation pattern). No separate Circle or RoundedRectangle types: a circle is ShapeType.Oval with equal width/height; a rounded rectangle is ShapeType.Rectangle with CornerRadius > 0.

ShapeControl has no shape-specific events or methods; it inherits ordinary Control properties and events (position, size, anchors, opacity, visibility, mouse events, z-order). The control cannot receive keyboard focus by default (TabStop = False). A new ShapeControl defaults to approximately 120×80 logical pixels.

This is a convenience control, not a replacement for Canvas: no gradients, shadows, arbitrary polygon points, paths, rotation, animation, or export methods. Shape rendering must honour opacity, border and fill alpha, and use anti-aliasing. The designer must render the actual shape, with only the normal rectangular selection adornment/resize handles remaining rectangular. Transparent shapes must remain selectable.

Objo.

Build apps visually, deploy anywhere.

Feedback is a public read-only status mirror for Objo Studio.