Centered modal window

This forum is for eXpress++ general support.
Post Reply
Message
Author
Piotr D
Posts: 131
Joined: Mon Jul 28, 2014 1:26 am
Location: Poznań, Poland

Centered modal window

#1 Post 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

User avatar
rdonnay
Site Admin
Posts: 4734
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Centered modal window

#2 Post by rdonnay »

DCREAD GUI .. MODAL .. EVAL {|o|DC_CenterObject(o,oMainWindow:drawingArea)}
The eXpress train is coming - and it has more cars.

Piotr D
Posts: 131
Joined: Mon Jul 28, 2014 1:26 am
Location: Poznań, Poland

Re: Centered modal window

#3 Post 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

Zdeno Bielik
Posts: 147
Joined: Thu Jan 28, 2010 9:24 am
Location: Nitra, Slovakia
Contact:

Re: Centered modal window

#4 Post 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

Piotr D
Posts: 131
Joined: Mon Jul 28, 2014 1:26 am
Location: Poznań, Poland

Re: Centered modal window

#5 Post by Piotr D »

Zdenko,
thank you, it work for me god.
Piotr

Piotr D
Posts: 131
Joined: Mon Jul 28, 2014 1:26 am
Location: Poznań, Poland

Re: Centered modal window

#6 Post 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

Post Reply