Add Position Setting within WDialog
I used WDialog in my project to popup a form or a table.
I noticed WDialog is parentless, and in style sheet, its "position: fixed".
But if the content is beyond the scale of screen, part of the dialog would be overrided.
I tried add a overflow to .Wt-dialog, but in polished theme horizontal scroll bar will always appear, due to the drop_shadow outset.
Now I change its "postion" to "absolute". Still need some job to adjust its "top" not to be negative.
Can we make a initial position setting for WDialog, and set if it's fixed or attached to parent Container?
P.S. WScrollArea not working in a WDialog yet.
Updated by Koen Deforche almost 11 years ago
- Status changed from New to Feedback
- Assignee set to Koen Deforche
You can position a dialog at a different location, using WWidget::setOffsets(). I'm not sure that I understand what is wrong with Fixed versus Absolute positioning --- do you actually want the dialog to be bigger than the screen ?
WDialog also got a new API, setResizable() so that the user can resize the dialog.
To avoid that the dialog becomes too big, you can for example specify a size for the entire dialog (e.g. resize("70", "70") and use a layout manager to constrain the contents (or make the contents overflow with scrollbars).
I'll need to check on WScrollArea --- what behaviour are you seeing and where do you put the scrollarea, and what layout manager do you use ?
Updated by V.E.O V.E.O over 10 years ago
I made a WDialog showing one table of data, in some situation, the height of WDialog exceeds the visual height of browser, and no scroll bar appear. With Fixed changed to Absolute, WDialog can be dragged elsewhere and scroll to see the whole content.
I placed WScrollArea in the contents of WDialog. I don't know if make it correct, layout is not used.
Great work on new API setResizable!