Owner's windows

This forum is for eXpress++ general support.
Message
Author
Janko
Posts: 111
Joined: Sat Mar 20, 2010 8:36 am
Location: Cerklje

Owner's windows

#1 Post by Janko »

Dear Roger,

I have an application in which there is an array browse (plus some buttons for other actions) in dialog window 'A' created via DCREAD GUI. Pressing a button a new dialog 'B' is open also via DCREADGUI and tree browse is running in.

I want NO MODALITY, but dialog 'B' should remain on top all the time.
I want to create another (second) dialog 'B' while 'A' remains open and third ....
Dialog 'B' should not be constrained to drawingArea of 'A'

When I press close button in titlebar of 'A' I want all 'B' dialogs to be closed, 'B' dialogs should be able to be closed individually in any order - so first created, could be closed first, rest of 'B' remain open.

I experimented with following from DcGetOptions:

Code: Select all

DCGETOPTIONS ;
   SAYFONT '7.Courier' ;
   SAYWIDTH 350 ;
   TABSTOP ;
   AUTORESIZE ALWAYSONTOP LOCKWINDOWTOOWNER

DCREAD GUI ;
   FIT ;
   ADDBUTTONS SETAPPWINDOW ;
   OPTIONS GetOptions ;
   TITLE 'Skupina - material - kupec ' + mleto    EVAL {||BuildTree(oTree,aRRc)}
  
I want to achieve same behaviour as dialogue Windows from Alaska's samples 'OwnerWin', but with the tools from Express.
What am I doing wrong?


Best regards
Janko

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

Re: Owner's windows

#2 Post by rdonnay »

In the A window you will need a pointer to all the B windows.

Are these windows all running in the same thread?
The eXpress train is coming - and it has more cars.

Janko
Posts: 111
Joined: Sat Mar 20, 2010 8:36 am
Location: Cerklje

Re: Owner's windows

#3 Post by Janko »

Roger,

yes, Windows are running in one thread.

BR
Janko

Janko
Posts: 111
Joined: Sat Mar 20, 2010 8:36 am
Location: Cerklje

Re: Owner's windows

#4 Post by Janko »

Roger,

it looks like I made no significant progress. Can I ask you to give me mor specific hints? Or even a sample?

Best regards
JAnko

User avatar
PedroAlex
Posts: 231
Joined: Tue Feb 09, 2010 3:06 am

Re: Owner's windows

#5 Post by PedroAlex »

Janko.

take a look into :
\ALASKA\XPPW32\SOURCE\samples\basics\WINDOWS

Maybe can help.

Pedro
Pedro Alexandre

Janko
Posts: 111
Joined: Sat Mar 20, 2010 8:36 am
Location: Cerklje

Re: Owner's windows

#6 Post by Janko »

Pedro,

thanks for your answer. I could use Alaska's sample, I've studied it.
But I intended to solve the problem with eXpress tools. They offer extra comfort creating XBP parts, but less options (???) to control them.
That was the reason I asked Roger for sugesstions.

BR J.

User avatar
PedroAlex
Posts: 231
Joined: Tue Feb 09, 2010 3:06 am

Re: Owner's windows

#7 Post by PedroAlex »

Can you Try This:

Code: Select all

DCGETOPTIONS ;
   SAYFONT '7.Courier' ;
   SAYWIDTH 350 ;
   TABSTOP ;
   AUTORESIZE ALWAYSONTOP LOCKWINDOWTOOWNER 


DCREAD GUI ;
   FIT ;
   ADDBUTTONS SETAPPWINDOW ;
   OPTIONS GetOptions ;
   TITLE 'Skupina - material - kupec ' + mleto  ;
   PARENT @oDlg ;
   EVAL {||BuildTree(oTree,aRRc)  ,;
               oDlg:close  := {|mp1,mp2,obj| obj:destroy()     }
  
Pedro Alexandre

Janko
Posts: 111
Joined: Sat Mar 20, 2010 8:36 am
Location: Cerklje

Re: Owner's windows

#8 Post by Janko »

Pedro,

it could not work because PARENT of next window is previous one.
So all windows are stacked.

Thanks anyway
BR J.

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

Re: Owner's windows

#9 Post by rdonnay »

Try this test program. It may give you some ideas.

Code: Select all

#INCLUDE "dcdialog.ch"

FUNCTION Main()

LOCAL GetList[0]

PRIVATE oWindowA, oWindowB, oWindowC

@ 0,0 DCSAY 'This is Window A' SAYSIZE 0 FONT '20.Arial Bold'

DCREAD GUI FIT TITLE 'Window A' EVAL {|o|M->oWindowA := o, WindowB()}

IF Valtype(M->oWindowB) == 'O'
  M->oWindowB:destroy()
ENDIF

IF Valtype(M->oWindowC) == 'O'
  M->oWindowC:destroy()
ENDIF

wtf 'stop' pause

RETURN nil

* -----------

FUNCTION WindowB()

LOCAL GetList[0], GetOptions, oDlg

@ 0,0 DCSAY 'This is Window B' SAYSIZE 0 FONT '20.Arial Bold'

DCGETOPTIONS WINDOWROW 500 WINDOWCOL 900

DCREAD GUI FIT TITLE 'Window B' ;
   OPTIONS GetOptions ;
   PARENT @oDlg ;
   EXIT

M->oWindowB := oDlg
oDlg:close := {|a,b,o|o:destroy(),M->oWindowB := nil }
WindowC()

RETURN nil

* -----------

FUNCTION WindowC()

LOCAL GetList[0], GetOptions, oDlg

@ 0,0 DCSAY 'This is Window C' SAYSIZE 0 FONT '20.Arial Bold'

DCGETOPTIONS WINDOWROW 400 WINDOWCOL 800

DCREAD GUI FIT TITLE 'Window C' ;
   OPTIONS GetOptions ;
   EXIT ;
   PARENT @oDlg

M->oWindowC := oDlg
oDlg:close := {|a,b,o|o:destroy(),M->oWindowC := nil }

RETURN nil

* --------

PROC appsys ; RETURN
The eXpress train is coming - and it has more cars.

Janko
Posts: 111
Joined: Sat Mar 20, 2010 8:36 am
Location: Cerklje

Re: Owner's windows

#10 Post by Janko »

Roger thank you,
that is exactly what I was looking for.

Best regards
JAnko

Post Reply