www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Dlang UI - making widget extend to the bounds of the window

reply stunaep <admin pea2nuts.com> writes:
I'm trying to make a gui program with dlangui, but no matter what 
I do, I cannot get widgets to fill the whole window. The window 
is resizable so I cannot just set the widths to static numbers.

No layoutWidth and layoutHeight set:
http://i.imgur.com/UySt30K.png

layoutWidth/Height set to fill (left widget width 300):
http://i.imgur.com/76tMIFz.png

I need these widgets to extend the width of the window because it 
is resizable
http://i.imgur.com/PiL7Y7f.png

You can see this also on DlangUI ML editor:
   fill:
     http://i.imgur.com/t9DsASt.png

   wrap:
     http://i.imgur.com/FoTS69g.png


   arbitrary number:
     http://i.imgur.com/voiYTWZ.png
Apr 14 2016
parent reply Vadim Lopatin <coolreader.org gmail.com> writes:
On Friday, 15 April 2016 at 00:58:58 UTC, stunaep wrote:
 I'm trying to make a gui program with dlangui, but no matter 
 what I do, I cannot get widgets to fill the whole window. The 
 window is resizable so I cannot just set the widths to static 
 numbers.

 No layoutWidth and layoutHeight set:
 http://i.imgur.com/UySt30K.png

 layoutWidth/Height set to fill (left widget width 300):
 http://i.imgur.com/76tMIFz.png

 I need these widgets to extend the width of the window because 
 it is resizable
 http://i.imgur.com/PiL7Y7f.png

 You can see this also on DlangUI ML editor:
   fill:
     http://i.imgur.com/t9DsASt.png

   wrap:
     http://i.imgur.com/FoTS69g.png


   arbitrary number:
     http://i.imgur.com/voiYTWZ.png
For parent VerticalLayout, set layoutWidth: fill too VerticalLayout { id: main; layoutWidth: fill; VerticalLayout { layoutWidth: fill; TextWidget { text: "test"; layoutWidth: fill } } }
Apr 15 2016
parent reply stunaep <admin pea2nuts.com> writes:
On Friday, 15 April 2016 at 10:33:35 UTC, Vadim Lopatin wrote:
 On Friday, 15 April 2016 at 00:58:58 UTC, stunaep wrote:
 I'm trying to make a gui program with dlangui, but no matter 
 what I do, I cannot get widgets to fill the whole window. The 
 window is resizable so I cannot just set the widths to static 
 numbers.

 No layoutWidth and layoutHeight set:
 http://i.imgur.com/UySt30K.png

 layoutWidth/Height set to fill (left widget width 300):
 http://i.imgur.com/76tMIFz.png

 I need these widgets to extend the width of the window because 
 it is resizable
 http://i.imgur.com/PiL7Y7f.png

 You can see this also on DlangUI ML editor:
   fill:
     http://i.imgur.com/t9DsASt.png

   wrap:
     http://i.imgur.com/FoTS69g.png


   arbitrary number:
     http://i.imgur.com/voiYTWZ.png
For parent VerticalLayout, set layoutWidth: fill too VerticalLayout { id: main; layoutWidth: fill; VerticalLayout { layoutWidth: fill; TextWidget { text: "test"; layoutWidth: fill } } }
I am doing that. I think it has to do with my high dpi because I'm using a 4k monitor. If I use Modal window flag:
Window window = Platform.instance.createWindow("DlangUI OpenGL 
Example", null, WindowFlag.Modal, 800, 700);
http://i.imgur.com/FJgPq8U.png If I use resizable:
Window window = Platform.instance.createWindow("DlangUI OpenGL 
Example", null, WindowFlag.Resizable, 800, 700);
http://i.imgur.com/PsPwoSN.jpg
Apr 16 2016
next sibling parent stunaep <admin pea2nuts.com> writes:
And no matter what window size I put when using Modal or 
Fullscreen, it always shows that same sized window
Apr 16 2016
prev sibling parent reply stunaep <admin pea2nuts.com> writes:
On Saturday, 16 April 2016 at 08:20:33 UTC, stunaep wrote:
 On Friday, 15 April 2016 at 10:33:35 UTC, Vadim Lopatin wrote:
 [...]
I am doing that. I think it has to do with my high dpi because I'm using a 4k monitor. If I use Modal window flag:
[...]
http://i.imgur.com/FJgPq8U.png If I use resizable:
[...]
http://i.imgur.com/PsPwoSN.jpg
Actually, that is with the opengl area set to a specific size. Here is using fill:
Window window = Platform.instance.createWindow("DlangUI OpenGL 
Example", null, WindowFlag.Modal, 1250, 1250);
http://i.imgur.com/exAyjI0.png
    Window window = Platform.instance.createWindow("DlangUI 
 OpenGL Example", null, WindowFlag.Resizable, 1250, 1250);
http://i.imgur.com/R7oxBa0.jpg http://pastebin.com/qqbfQLvN
Apr 16 2016
parent reply Vadim Lopatin <coolreader.org gmail.com> writes:
On Saturday, 16 April 2016 at 11:46:09 UTC, stunaep wrote:
 On Saturday, 16 April 2016 at 08:20:33 UTC, stunaep wrote:
 On Friday, 15 April 2016 at 10:33:35 UTC, Vadim Lopatin wrote:
 [...]
I am doing that. I think it has to do with my high dpi because I'm using a 4k monitor. If I use Modal window flag:
[...]
http://i.imgur.com/FJgPq8U.png If I use resizable:
[...]
http://i.imgur.com/PsPwoSN.jpg
Actually, that is with the opengl area set to a specific size. Here is using fill:
Window window = Platform.instance.createWindow("DlangUI OpenGL 
Example", null, WindowFlag.Modal, 1250, 1250);
http://i.imgur.com/exAyjI0.png
    Window window = Platform.instance.createWindow("DlangUI 
 OpenGL Example", null, WindowFlag.Resizable, 1250, 1250);
http://i.imgur.com/R7oxBa0.jpg http://pastebin.com/qqbfQLvN
In TableLayout there is a bug #113 which prevents extending of table layout content to parent size. For other widgets FILL_PARENT should work ok. See dlangui/examples/d3d and dlangui/examples/opengl for samples of OpenGL drawing on widget which is being resized to whole window.
Apr 18 2016
parent reply Vadim Lopatin <coolreader.org gmail.com> writes:
On Monday, 18 April 2016 at 07:06:43 UTC, Vadim Lopatin wrote:
 In TableLayout there is a bug #113 which prevents extending of 
 table layout content to parent size.

 For other widgets FILL_PARENT should work ok.
Issue #113 is fixed today in v0.8.8
Apr 18 2016
parent stunaep <admin pea2nuts.com> writes:
On Monday, 18 April 2016 at 07:50:28 UTC, Vadim Lopatin wrote:
 On Monday, 18 April 2016 at 07:06:43 UTC, Vadim Lopatin wrote:
 In TableLayout there is a bug #113 which prevents extending of 
 table layout content to parent size.

 For other widgets FILL_PARENT should work ok.
Issue #113 is fixed today in v0.8.8
Спасибо за помощь! Всё работает как задумано!
Apr 19 2016