Actually is the other way around. First the natural size is computed, then the dialog size is computed.
When the dialog size is increased and there is some child with EXPAND=Yes then the element is expanded and the layout is recomputed. What you can do is to set EXPAND=Yes|VERTICAL|HOROZONTAL at your list. The VISIBLELINES/VISIBLECOLUMS attributes affect the minimum size, but they do not limit the maximum size. Even IupText will occupy the space available in the dialog if it has EXPAND!=NO. If the dialog is smaller than the contents natural size, the contents will be clipped at right and/or bottom. So also the dialog in this situation will not force its contents to fit in its area. Unless the SHRINK attribute of the dialog is Yes. The fact that the IupList natural size is affected by its contents is historical, and that's why we created the VISIBLELINES/VISIBLECOLUMS attributes. Best, Scuri Em qua, 7 de nov de 2018 às 17:15, Milind Gupta <[email protected]> escreveu: > Hi Antonio, > This behavior seems very inconsistent and unintuitive to other > controls. For example if I have a text box and if the text box is filled > with large amount of text it still respects the size of the dialog. > Shouldn't the natural behavior always respect the dialog size in which it > is placed? > > Milind > > On Wed, Nov 7, 2018 at 9:05 AM Antonio Scuri <[email protected]> > wrote: > >> No, there isn't. >> >> Best, >> Scuri >> >> Em qua, 7 de nov de 2018 15:02, Milind Gupta <[email protected] >> escreveu: >> >>> Thanks Antonio, >>> Is there a way to find our how many visible lines would fit >>> in a dialog when it is resized? >>> >>> Milind >>> >>> >>> On Wed, Nov 7, 2018 at 5:37 AM Antonio Scuri <[email protected]> >>> wrote: >>> >>>> Hi Milind, >>>> >>>> You can control that with the VISIBLELINES and VISIBLECOLUMNS >>>> attributes. >>>> >>>> Best, >>>> Scuri >>>> >>>> >>>> Em qua, 7 de nov de 2018 00:02, Milind Gupta <[email protected] >>>> escreveu: >>>> >>>>> Hi, >>>>> I have a multiple selection list control. During the operation >>>>> if I put a lot of elements in the list element the scroll bars show up. >>>>> But >>>>> if the dialog is resized the list control size immediately explodes to >>>>> however large it needs to be to remove the scrollbars and goes beyond what >>>>> the dialog shows. How can I force the list control to not resize >>>>> automatically beyond the dialog boundaries? >>>>> The example to show the problem is below. To replicate click the >>>>> Add button and then resize the dialog. >>>>> >>>>> require( "iuplua" ) >>>>> >>>>> list = iup.list{MULTIPLE="YES",["1"]="One",["2"]="Two"} >>>>> button = iup.button{title="ADD",expand="YES"} >>>>> >>>>> vbox = iup.vbox { >>>>> iup.hbox{ >>>>> list, >>>>> iup.label {title="Label"}, >>>>> iup.text { border="NO"; value="This is good"; >>>>> bgcolor=iup.GetGlobal("DLGBGCOLOR"); readonly="YES"; visiblecolumns=30 }; >>>>> gap=10 >>>>> }, >>>>> button >>>>> } >>>>> function button:action() >>>>> list.removeitem = "ALL" >>>>> for i = 1,40 do >>>>> list[tostring(i)] = "Hello"..tostring(i) >>>>> end >>>>> end >>>>> dlg = iup.dialog{vbox; title="Dialog",size="QUARTERxQUARTER"} >>>>> dlg:show() >>>>> >>>>> if (iup.MainLoopLevel()==0) then >>>>> iup.MainLoop() >>>>> end >>>>> >>>>> Thanks, >>>>> Milind >>>>> _______________________________________________ >>>>> Iup-users mailing list >>>>> [email protected] >>>>> https://lists.sourceforge.net/lists/listinfo/iup-users >>>>> >>>> _______________________________________________ >>>> Iup-users mailing list >>>> [email protected] >>>> https://lists.sourceforge.net/lists/listinfo/iup-users >>>> >>> _______________________________________________ >>> Iup-users mailing list >>> [email protected] >>> https://lists.sourceforge.net/lists/listinfo/iup-users >>> >> _______________________________________________ >> Iup-users mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/iup-users >> > _______________________________________________ > Iup-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/iup-users >
_______________________________________________ Iup-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/iup-users
