How to prevent open child window only once

This forum is for eXpress++ general support.
Post Reply
Message
Author
Victorio
Posts: 631
Joined: Sun Jan 18, 2015 11:43 am
Location: Slovakia

How to prevent open child window only once

#1 Post by Victorio »

I have main menu, DCSUMBENU... DCMENUITEM ..... ACTION call other dialog window
How I prevent to click to main MENU and prevent to open other dialog windows twice, 3,4,... times ?

I saw some command in one sample or manual what by I cannot found where :oops:

I want make, then if I click on MENU, select some function that open next dialog window, than must close this dialog when want select other one.

Maybe it is SetAppFocus(), ?

My source code is in my other post DCBROWSE refresh.

Also I have question, how sizing and positioning Aplication window size, size of dialogs, for universal torun on user PCs with differently screen resolutions ? Maybe on have resolution 640/480, anyone 1280/1024,... etc.
I count size from SetAppWindow():currentsize(), then set main app windows to size for example 0,9x currentsize ,
ane other dialog windows ? in PIXEL size or ROW, COL ? what is better, If i count their size in 0,xx of current size, I can fill better screen, if in row,col, user with hgh resolution have small dialog windows.
Need too count font size ? to best "visual design" of aplication ?
Sizing in relative row, col is easier ;)



thanks...

Wolfgang Ciriack
Posts: 479
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Re: How to prevent open child window only once

#2 Post by Wolfgang Ciriack »

I want make, then if I click on MENU, select some function that open next dialog window, than must close this dialog when want select other one.
Make the dialog you call modal:

Code: Select all

DCREAD GUI TITLE "Mywin" MODAL SETAPPWINDOW FIT.....
For automatic recising dialogs look at the example exp\Samples\Resize\restest.exe and choose
DCGUI_RESIZE_AUTORESIZE_SCALEFONT and click the button "Test Rule".
_______________________
Best Regards
Wolfgang

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

Re: How to prevent open child window only once

#3 Post by rdonnay »

Use a STATIC variable in your window programs like this:

Code: Select all

FUNCTION Window1()

STATIC slIsRunning := .f.

IF slIsRunning
  RETURN .f.
ENDIF

slIsRunning := .t.

@ ... DCSAY ... GET ...

DCREAD GUI FIT ADDBUTTONS TO lStatus

slIsRunning := .f.

RETURN lStatus
The eXpress train is coming - and it has more cars.

Victorio
Posts: 631
Joined: Sun Jan 18, 2015 11:43 am
Location: Slovakia

Re: How to prevent open child window only once

#4 Post by Victorio »

:clap: thank you for help , SETAPPWINDOW is command, what I need, but I putting it to DCGETOPTIONS, where is not possible, when I put it to DCREAD GUI, , work fine.

Roger, how simple, but work safely

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

Re: How to prevent open child window only once

#5 Post by rdonnay »

Ok, I didn't realize you were using MODAL windows.

Yes, SETAPPWINDOW is the solution for that.

However, if you are using NON MODAL windows, then a static variable is a proper solution.
The eXpress train is coming - and it has more cars.

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: How to prevent open child window only once

#6 Post by Eugene Lutsenko »

Roger!

You came back from a trip?

Post Reply