Page 1 of 1

Centered modal window

Posted: Sun Apr 19, 2015 6:41 am
by Piotr D
Hi,
in my programs, I use MODAL clause for all windows. While I do't use CASCADE option in DCGETOPTIONS, the windows
are created in a centre of a screen. But if I want to run more than one program, and move the program window for
example to a corner of the screen, the next modal window is displayed in a centre of the screen and not in a centre
of window, from which was invoked. How can I simply make for all modal window, that will be centered inside
(main) window, from which was invoked?

Piotr

Re: Centered modal window

Posted: Sun Apr 19, 2015 8:03 am
by rdonnay
DCREAD GUI .. MODAL .. EVAL {|o|DC_CenterObject(o,oMainWindow:drawingArea)}

Re: Centered modal window

Posted: Tue Apr 21, 2015 12:16 am
by Piotr D
Roger,
thank you for your tips, it work. However, on the screen is one short "blink", but the new window is first created
on a centre of the screen and then is hide and re-created on new position. How can I solve this?
Regards
Piotr

Re: Centered modal window

Posted: Tue Apr 21, 2015 1:25 am
by Zdeno Bielik
Hi Piotr,

try this:

DCGETOPTIONS HIDE

DCREAD GUI OPTIONS DCGETOPTIONS ;
EVAL { |o| SetAppWindow(o), ;
DC_CenterObject(..........), ;
o:show() ;
}

Hope this helps you

Zdeno

Re: Centered modal window

Posted: Tue Apr 21, 2015 1:56 am
by Piotr D
Zdenko,
thank you, it work for me god.
Piotr

Re: Centered modal window

Posted: Tue Apr 21, 2015 8:00 am
by Piotr D
Roger,
It's possible to set global for all created windows (with DCREAD GUI and DC_GuiMemoEdit, DC_GuiAlert, DC_MsgBox),
that centering will be relative not to the screen, but to the main window?

Piotr