Re: "Dialogs" in AppGraphics

Klaus,

You shouldn't have to call setdialoghotkeys(.FALSE.) when closing your window.  That setting is specific only to the current window, so it shouldn't affect any other windows that may be open.  Furthermore, any new window will always default to .FALSE. regardless of earlier calls to ensure compatibility.

If you do find some problems, let me know.  I'll get them fixed up ASAP.

Jeff Armstrong
Approximatrix, LLC

Re: "Dialogs" in AppGraphics

Thanks Jeff,
I am developing more dlg's and every is thing working as suspected and I'll delete setdialoghotkeys(.FALSE.) in my sources.

Klaus

Re: "Dialogs" in AppGraphics

Jeff,
In a application using the full screen window is opened a child window, for instance a dialog window. A mouse click per accident not  in the window but outside causes that the main window is on the foreground and the child window below it. Is it possible to avoid that the child goes to the background an how can I manage it?
Klaus

Re: "Dialogs" in AppGraphics

Klaus,

No, it isn't possible in AppGraphics right now.  I think what you'd like is either:

1. Modal windows - where you couldn't interact with anything except the current window until you close it.
2. Stay-on-top windows - where a window, even if not the current, always appears topmost

Both could be added to AppGraphics.  Is there one you'd prefer?

Jeff Armstrong
Approximatrix, LLC

Re: "Dialogs" in AppGraphics

Jeff,
For all my applications, the intention is that users only should interact with the current child window but not with other windows (except to have to look only in window below)
So I prefer the first option.
Klaus

Re: "Dialogs" in AppGraphics

Jeff,

I concur with Klaus.  A modal window option would be a useful addition to AppGraphics.

Frank

Re: "Dialogs" in AppGraphics

Jeff,
I have implemented enablewindow and it works pretty well!
Thanks, Klaus

Re: "Dialogs" in AppGraphics

Klaus,

I'm glad to hear it! If you run into any problems using enablewindow, let me know.

Jeff Armstrong
Approximatrix, LLC

Re: "Dialogs" in AppGraphics

Jeff,

I've implemented Enablewindow throughout my application and thus far it works seamlessly.

Thank you for taking the time to develop Enablewindow for AppGraphics and following up on member suggestions.

Much appreciated,

Frank

Re: "Dialogs" in AppGraphics

Jef, I have two dialogs:

        call dlgmessage(DIALOG_info,pre//'number of tanks found')
        item = dlgrequestselection (testmen_txt,testmen_txt(1), 'tank    to investigate:')     

The first appears on the foreground ; but the second is hidden behind the active window. Why

regards Klaus

Re: "Dialogs" in AppGraphics

Klaus,

It sounds like a bug.  The two dialogs are very different things behind the scenes.  I'll see if I can recreate it and fix the problem.

Jeff Armstrong
Approximatrix, LLC

Re: "Dialogs" in AppGraphics

Klaus,

The list selection and text entry dialogs never defined a parent when created, which meant both were never displayed "above" the current window.  It should be fixed in version 2.41 when it is released.

Jeff Armstrong
Approximatrix, LLC

Re: "Dialogs" in AppGraphics

Jeff,

To manage the layout of multiple line dialogs, I started to add a CR character at the end of my text line to avoid a random new line like my example:

Subroutine about
use appgraphics
Character*1 cr
cr=char(13)
call dlgmessage(DIALOG_INFO,'_______  HeatCat _______'//cr//&
   '      Copyright by ASC '//cr//&
   ' Computer aided structual design procedure'//cr// &
   ' For vessels with independent cargo tanks '//cr//&
   ' To generated vessels basic data use CASTOR'//cr//&
   ' generating a principal structure model   '//cr//&
   '____________________________________________'//cr//&
   ' This is a test and demo for a standard vessel '//cr//&
   '             beta version 8/1/2018')
end Subroutine about

Is this the best way to do or is there a more straight forward way?

regards Klaus

Re: "Dialogs" in AppGraphics

Klaus,

Yes, that's what's necessary in Windows to construct multiline messages for use in message boxes.  The Conway's Game of Life example included with Simply Fortran does the same thing in the subroutine aboutgame in control.f90.

You could consider using the constant C_CARRIAGE_RETURN available in the iso_c_binding module as well to be more explicit rather than using CHAR(13).  I'm not sure there's any real advantage, though.

Jeff Armstrong
Approximatrix, LLC

Re: "Dialogs" in AppGraphics

Jeff,
A nasty problem I got:
From the main window a second window is opened
In this second window  a dialog is opened.
After closing the dialog different returns are found
Using the program from simply fortran for testing control returns with the second window on top.
But if the program runs directly under windows, without using SF, the main window appears on the foreground and that is not the intention.

How can I try to tackle the problem?

The dialog in the second window (initW) starts as follows:

initW = getcurrentwindow()  ! keep the previous window in memory for later return
Call enablewindow(initW,.false.)
! ______________________ open dlg-window__________________________________
dlg_screen = initwindow(250, 360, title = "Secundary Stiffening", closeflag = .false.)
CAll setdialoghotkeys(.TRUE.)
…..........
….........
And it ends with:
call loop()
   Call enablewindow(initW,.true.)
   Call closewindow(CURRENT_WINDOW)
   Call setcurrentwindow (initW)
!____________________________________________________________________________
Contains
.....
May be this info is too short to give a hint and I have to make a tiny testprogram first?

Regards, Klaus

Re: "Dialogs" in AppGraphics

Klaus,

Let me work on that this weekend to see if I can both replicate the problem and come up with a solution.

Jeff Armstrong
Approximatrix, LLC

Re: "Dialogs" in AppGraphics

Klaus,

The problem is related to setcurrentwindow.   When you're calling that subroutine, the description (and subroutine name, quite frankly) sound as if it should also bring that window to the foreground.  In reality, all the call does is set the internal indicator within the library to point at that window for any subsequent graphics calls.  The library should also raise the indicated window to the top when setcurrentwindow is called.

I'll make the change and release a new build with the fix within the week.

Jeff Armstrong
Approximatrix, LLC

Re: "Dialogs" in AppGraphics

Thanks Jeff,
Klaus