What is a nested_form?

I do not understand the documentation

http://nanapro.org/en-us/documentation/page.php?u=/widgets/nested_form

The only code I could find does nothing at all

    //class nested_form
        nested_form::nested_form(const form& fm, const rectangle& r, const appearance& apr)
            : form_base(fm.handle(), true, r, apr)
        {
        }

        nested_form::nested_form(const nested_form& fm, const rectangle& r, const appearance& apr)
            : form_base(fm.handle(), true, r, apr)
        {
        }

        nested_form::nested_form(window owner, const appearance& apr)
            : form_base(owner, true, rectangle(), apr)
        {}

        nested_form::nested_form(window owner, const rectangle& r, const appearance& apr)
            : form_base(owner, true, r, apr)
        {}
    //end nested_form
What is a nested_form? I do not understand the documentation http://nanapro.org/en-us/documentation/page.php?u=/widgets/nested_form The only code I could find does nothing at all ```` //class nested_form nested_form::nested_form(const form& fm, const rectangle& r, const appearance& apr) : form_base(fm.handle(), true, r, apr) { } nested_form::nested_form(const nested_form& fm, const rectangle& r, const appearance& apr) : form_base(fm.handle(), true, r, apr) { } nested_form::nested_form(window owner, const appearance& apr) : form_base(owner, true, rectangle(), apr) {} nested_form::nested_form(window owner, const rectangle& r, const appearance& apr) : form_base(owner, true, r, apr) {} //end nested_form ````

The way I understand it... a nested_form is a special form... that needs a parent form... it cannot move out of the parent's client area... it minimizes to an icon inside its parent's client area...

The way I understand it... a nested_form is a special form... that needs a parent form... it cannot move out of the parent's client area... it minimizes to an icon inside its parent's client area...

Really? Why are none of these features documented? Why are any of those features considered useful? Where is the code to implement those features?

Really? Why are none of these features documented? Why are any of those features considered useful? Where is the code to implement those features?
edited Sep 25 at 3:29 am

Whatever you can do with a form, you can do with a nested_form, except for one thing: it cannot be your application's main form (I think). (From the constructor, it requires a parent/owner form... but I haven't test try to pass a nullptr as the handle).

Anyway, as for usage.... it is like the document/view of MS Visual Studio back in the old days... Back then, Word and Excel and tons of other... you have one big application (as the main form) and several nested_forms as documents inside... that you can arrange as tiled or cascaded... Nowadays... each document is its own window/form. But there are apps that still uses that paradigm. For example, you have one accounting program... where inside you have tons of different nested_forms like customer, vendor, invoice, payroll, etc. ...

Whatever you can do with a form, you can do with a nested_form, except for one thing: it cannot be your application's main form (I think). (From the constructor, it requires a parent/owner form... but I haven't test try to pass a nullptr as the handle). Anyway, as for usage.... it is like the document/view of MS Visual Studio back in the old days... Back then, Word and Excel and tons of other... you have one big application (as the main form) and several nested_forms as documents inside... that you can arrange as tiled or cascaded... Nowadays... each document is its own window/form. But there are apps that still uses that paradigm. For example, you have one accounting program... where inside you have tons of different nested_forms like customer, vendor, invoice, payroll, etc. ...

I actually remember coding document/view applications! It was part of MFC ( microsoft foundation classes ) rather than visual studio, though of course in those days everybody used visual studio.

Document/view was quite horrible. I am astonished that a modern GUI framework would consider supporting it.

I actually remember coding document/view applications! It was part of MFC ( microsoft foundation classes ) rather than visual studio, though of course in those days everybody used visual studio. Document/view was quite horrible. I am astonished that a modern GUI framework would consider supporting it.

Whatever you can do with a form, you can do with a nested_form

I do not think this is true.

I tried converting one of the forms in an application to a nested_form and the result was numerous undefined method errors.

If you look at the docs, they show that only a small subset of the form methods are implemented.

> Whatever you can do with a form, you can do with a nested_form I do not think this is true. I tried converting one of the forms in an application to a nested_form and the result was numerous undefined method errors. If you look at the docs, they show that only a small subset of the form methods are implemented.

I actually remember coding document/view applications! It was part of MFC ( microsoft foundation classes ) rather than visual studio, though of course in those days everybody used visual studio.

Document/view was quite horrible. I am astonished that a modern GUI framework would consider supporting it.

I did a bit of research, and it seems this is part of what Microsoft calls MDI (Multiple Document Interface), which is a part of Windows. A nana::nested_form is the equivalent of a Windows child window, although that seems to be somehow different from an MDI child window (which is created with the style WS_EX_MDICHILD, not WS_CHILD).

It seems that "parent window" and "child window" don't mean what I thought they meant, at least when it comes to Windows (I wonder if this is Microsoft-specific, or if it's the same for other windowing systems). What I thought of as a "parent window" is actually called an "owner window", and what I thought of as a "child window", is an owned window. The distinction between "parent" and "owner" is discussed in this article: https://devblogs.microsoft.com/oldnewthing/?p=14613

Edit: MDI isn't a Microsoft-specific concept (https://en.wikipedia.org/wiki/Multiple_document_interface), but it seems other windowing systems have more advanced versions of it.

2nd Edit: Apparently, it's the same for X11 as well, except that instead of "child window", the term X11 uses is "subwindow". I learned some stuff today.

>I actually remember coding document/view applications! It was part of MFC ( microsoft foundation classes ) rather than visual studio, though of course in those days everybody used visual studio. >Document/view was quite horrible. I am astonished that a modern GUI framework would consider supporting it. I did a bit of research, and it seems this is part of what Microsoft calls MDI ([Multiple Document Interface](https://docs.microsoft.com/en-us/windows/win32/winmsg/about-the-multiple-document-interface)), which is a part of Windows. A `nana::nested_form` is the equivalent of a Windows [child window](https://docs.microsoft.com/en-us/windows/win32/winmsg/window-features#child-windows), although that seems to be somehow different from an MDI child window (which is created with the style `WS_EX_MDICHILD`, not `WS_CHILD`). It seems that "parent window" and "child window" don't mean what I thought they meant, at least when it comes to Windows (I wonder if this is Microsoft-specific, or if it's the same for other windowing systems). What I thought of as a "parent window" is actually called an "owner window", and what I thought of as a "child window", is an [owned window](https://docs.microsoft.com/en-us/windows/win32/winmsg/window-features#owned-windows). The distinction between "parent" and "owner" is discussed in this article: https://devblogs.microsoft.com/oldnewthing/?p=14613 _**Edit:** MDI isn't a Microsoft-specific concept (https://en.wikipedia.org/wiki/Multiple_document_interface), but it seems other windowing systems have more advanced versions of it._ _**2nd Edit:** Apparently, it's the same for X11 as well, except that instead of "child window", the term X11 uses is "subwindow". I learned some stuff today._
edited Sep 28 at 8:39 am
39
views
6
replies
3
followers
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft