|
| 1 | +-- ============================================================================ |
| 2 | +-- Issue #713 — PopupWidth / PopupHeight = 0 must be allowed |
| 3 | +-- ============================================================================ |
| 4 | +-- |
| 5 | +-- Symptom: CREATE PAGE (… PopupWidth: 0, PopupHeight: 0) and |
| 6 | +-- ALTER PAGE … SET PopupWidth = 0 were rejected ("must be a positive number"), |
| 7 | +-- and even if allowed both writers coerced 0 -> 600. |
| 8 | +-- |
| 9 | +-- Reality (verified against a live Studio Pro 11.12 model): 0 is Studio Pro's |
| 10 | +-- OWN default for a pop-up page's width/height — it means auto-size. A page |
| 11 | +-- created on Atlas_Core.PopupLayout stores PopupWidth: 0 / PopupHeight: 0 and |
| 12 | +-- passes `mx check` with 0 errors. |
| 13 | +-- |
| 14 | +-- Fix: validators reject only negative values; the builder defaults to 0 (not |
| 15 | +-- 600); both writers write the value verbatim (no 0 -> 600 coercion); DESCRIBE |
| 16 | +-- suppresses only the real default 0. |
| 17 | +-- |
| 18 | +-- To verify in Studio Pro: |
| 19 | +-- 1. Run this script. |
| 20 | +-- 2. Open Bug713.ThingPopupAuto — Pop-up width/height should be 0 (automatic). |
| 21 | +-- 3. Open Bug713.ThingPopupFixed — width 800, height 480. |
| 22 | +-- 4. `mx check` should report 0 errors. |
| 23 | +-- ============================================================================ |
| 24 | + |
| 25 | +CREATE MODULE Bug713; |
| 26 | + |
| 27 | +CREATE PERSISTENT ENTITY Bug713.Thing ( |
| 28 | + Name: String(200) |
| 29 | +); |
| 30 | + |
| 31 | +-- Pop-up page with explicit 0/0 (auto-size) — the case the bug rejected. |
| 32 | +CREATE OR REPLACE PAGE Bug713.ThingPopupAuto ( |
| 33 | + Title: 'Thing (auto-size pop-up)', |
| 34 | + Layout: Atlas_Core.PopupLayout, |
| 35 | + PopupWidth: 0, |
| 36 | + PopupHeight: 0, |
| 37 | + Params: { $Thing: Bug713.Thing } |
| 38 | +) { |
| 39 | + dataview dv (DataSource: $Thing) { |
| 40 | + textbox tb (Label: 'Name', Attribute: Name) |
| 41 | + } |
| 42 | +} |
| 43 | + |
| 44 | +-- Pop-up page with explicit non-zero dimensions — must still round-trip. |
| 45 | +CREATE OR REPLACE PAGE Bug713.ThingPopupFixed ( |
| 46 | + Title: 'Thing (fixed pop-up)', |
| 47 | + Layout: Atlas_Core.PopupLayout, |
| 48 | + PopupWidth: 800, |
| 49 | + PopupHeight: 480, |
| 50 | + Params: { $Thing: Bug713.Thing } |
| 51 | +) { |
| 52 | + dataview dv (DataSource: $Thing) { |
| 53 | + textbox tb (Label: 'Name', Attribute: Name) |
| 54 | + } |
| 55 | +} |
| 56 | + |
| 57 | +-- ALTER must accept SET PopupWidth = 0 (auto-size) too. |
| 58 | +ALTER PAGE Bug713.ThingPopupFixed { |
| 59 | + SET PopupWidth = 0; |
| 60 | + SET PopupHeight = 0; |
| 61 | +} |
0 commit comments