How to layout a dialog that is smaller than its components?



  • Hello; here's a weird one:

    Normally, a dialog is at least as big as the sum of its content according to the layout. It does not matter which layout flags you use (FIT, SCALE, SIZE) - it will not get any smaller, even when embedding the dialog into a screen Layout or moving the dialog's borders.

    You can use a SCROLLGROUP to include a subarea that is larger than the dialog itself, yes. But what if I just don't want "overhanging" items to show? No scrollbar, no enforced size, just clipping. I know it is possible because the toolbars behave like this; icons outside of the current toolbar just disappear when the toolbar is resized too much.

    Apparently that doesn't work with an external layout file?



  • Hi,

    you can enforce the size of a GeUserArea. So I assume toolbars take advantage of that feature/effect.

    edit: That was a bit ambiguous, what I meant was: Buttons in a toolbar are probably encapsulated in a GeUserArea.

    Cheers
    zipit



  • hello,

    If i understood correctly you want something like this but with a .res file ?

    
    		ScrollGroupBegin(1000, BFH_SCALEFIT | BFV_SCALEFIT, SCROLLGROUP_VERT | SCROLLGROUP_HORIZ  | SCROLLGROUP_NOSCROLLER | SCROLLGROUP_NOBLIT, 64, 64);
    		{
    			GroupBegin(0, BFH_SCALEFIT | BFV_SCALEFIT, 0, 0, ""_s, 0);
    			{
    				AddButton(1001, BFH_LEFT, SizePix(256), SizePix(256), "Big Button"_s);
    			}
    			GroupEnd();
    		}
    		GroupEnd();
    

    Cheers,
    Manuel



  • Yup, something like making SCROLLGROUP_NOSCROLLER and other flags available in the .res file. I haven't tried yet to define a GeUserArea through the .res file.

    (It's a question out of interest only... a dialog where stuff is foreseeably too large for the dialog is most likely based on automatic generation of dialog components anyway, so I can go a step higher and create the non-scrolling scrolling area through code as well...)



  • hello,

    I've sent an email to ask, I'll be back when i got something :)

    Cheers,
    Manuel



  • hello,

    really sorry for the delay of this answer and a negative one.
    There's no equivalent for SCROLLGROUP_NOSCROLLER to use in a .res file.

    Cheers,
    Manuel



  • Thanks for the confirmation. I guess I'll use an empty group then and fill in the scrolling group in the code.