xbrowser does not appears after window

Post Reply
AntoninoP
Posts: 347
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy
Contact:

xbrowser does not appears after window

Post by AntoninoP »

Hello, I was testing a my little program, and I want debug an array using xbrowser, but it sometime does not appears.
Look this code:

Code: Select all

#include <fivewin.ch>

func main()
   LOCAL oWnd
   XBROWSER {10,20,30,40}
   DEFINE WINDOW oWnd
   ACTIVATE WINDOW oWnd
   XBROWSER {10,20,30,40}
return 0

 
the xBrowser appears one time, but after the windows, it does not.
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: xbrowser does not appears after window

Post by nageswaragunupudi »

Once the main window is closed, no dialog can be created and displayed.

For example,

Code: Select all

function Main()

   local oWnd, oDlg

   DEFINE WINDOW oWnd
   ACTIVATE WINDOW oWnd CENTERED

   DEFINE DIALOG oDlg
   ACTIVATE DIALOG oDlg CENTERED

return nil
 
In this case, the dialog will never be displayed.
Regards

G. N. Rao.
Hyderabad, India
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: xbrowser does not appears after window

Post by Silvio.Falconi »

sorry I not understood

If I generate an array on a Window and then I wish open a xbrowser with the array I cannot make it ?

sample :

DEFINE WINDOW oWnd
aLista:= .......
ACTIVATE WINDOW oWnd CENTERED

xbrowser aLista
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
Jack
Posts: 249
Joined: Wed Jul 11, 2007 11:06 am

Re: xbrowser does not appears after window

Post by Jack »

Hi,
You have to place the XBROWSE bitween DEFINE WINDOW AND ACTIVATE WINDOW .
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: xbrowser does not appears after window

Post by ukoenig »

I think he wants to show changed values after closing the window

#include "FiveWin.ch"
FUNC MAIN()
LOCAL oWnd
XBROWSER {10,20,30,40} // old values
DEFINE WINDOW oWnd
// some valuechanges
ACTIVATE WINDOW oWnd ;
VALID SHOW_NEW()
RETURN NIL

// on window-close the browser shows new values
// ( the window is still open )
// closing the browser closes the window as well
FUNCTIOn SHOW_NEW()
XBROWSER {50,60,70,80} // new values
RETURN .T.


regards
Uwe :?:
Last edited by ukoenig on Tue Oct 22, 2019 10:27 am, edited 1 time in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: xbrowser does not appears after window

Post by Silvio.Falconi »

Jack wrote:Hi,
You have to place the XBROWSE bitween DEFINE WINDOW AND ACTIVATE WINDOW .
I don't know who you are dear Jack, but please read the question carefully, we're talking about the Xbrowser command, not of xbrowse() func,
so I don't have to put it between "define window" and "activate window" ...
Please next time read first from the first topic ..
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: xbrowser does not appears after window

Post by ukoenig »

That will give the needed result
showing a browser with new values after window close :!:

#include "FiveWin.ch"

FUNC MAIN()
LOCAL oWnd, oBtn

XBROWSER {10,20,30,40}

DEFINE WINDOW oWnd

ACTIVATE WINDOW oWnd ;
VALID SHOW_BRW(oWnd)

RETURN NIL

// on window-close shows new values and hides the window
// closing the browser closes the window as well

FUNCTIOn SHOW_BRW(oWnd)

oWnd:Hide()
XBROWSER {50,60,70,80}

RETURN .T.

regards
Uwe :D
Last edited by ukoenig on Tue Oct 22, 2019 11:11 am, edited 3 times in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
AntoninoP
Posts: 347
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy
Contact:

Re: xbrowser does not appears after window

Post by AntoninoP »

It is a FiveWin limitation, I think with a minimal change it can work. It is enough that the SetWndApp can accept zero as value:

Code: Select all

#include <fivewin.ch>

proc main()
   LOCAL oWnd
   ? GetWndApp() //0
   XBROWSER {10,20,30,40}
   DEFINE WINDOW oWnd
   ACTIVATE WINDOW oWnd
   ? GetWndApp() // value
   XBROWSER {10,20,30,40} //no windows, because parent is closed
   SetWndApp(0)
   ? GetWndApp() // not change!
   XBROWSER {10,20,30,40}  //no windows, because SetWndApp(0) does not works....
   
 
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: xbrowser does not appears after window

Post by ukoenig »

Antonino,

did You test my revised solution

Image

regards
Uwe :?:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
AntoninoP
Posts: 347
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy
Contact:

Re: xbrowser does not appears after window

Post by AntoninoP »

uwe, I think your solution works (I don't need to try to see it), but It is pretty different from my initial code.
My opinion is that should be possible create an application that shows a dialog after the main window is closed. It is pretty severe because it is not a win32 limitation but it is created by FiveWin
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: xbrowser does not appears after window

Post by ukoenig »

The same logic
My opinion is that should be possible create an application
that shows a dialog after the main window is closed
#include "FiveWin.ch"

FUNC MAIN()
LOCAL oWnd, oBtn, oFontLarge, oSay

DEFINE FONT oFontLarge NAME "Arial" SIZE 0, -24 BOLD

DEFINE WINDOW oWnd

@ 50, 50 SAY oSay PROMPT "Main-window" SIZE 250, 35 OF oWnd FONT oFontLarge PIXEL
oSay:SetColor( 255, )
oSay:lTransparent := .T.

@ 150, 200 BUTTON "Window" + CRLF + "E&xit" SIZE 100, 50 OF oWnd PIXEL ;
ACTION oWnd:End()

ACTIVATE WINDOW oWnd CENTERED ;
VALID SHOW_DLG(oWnd)

oFontLarge:End()

RETURN NIL

// -----------

FUNCTIOn SHOW_DLG(oWnd)
LOCAL oDlg, oBtn, oFontLarge, oSay

oWnd:Hide()

DEFINE FONT oFontLarge NAME "Arial" SIZE 0, -24 BOLD ITALIC

DEFINE DIALOG oDlg SIZE 300, 300 PIXEL TRUEPIXEL TITLE "Test " + FWVERSION

@ 50, 50 SAY oSay PROMPT "Dialog called from window" SIZE 250, 35 OF oDlg FONT oFontLarge PIXEL
oSay:SetColor( 255, )
oSay:lTransparent := .T.

@ 220, 100 BUTTON "Dialog" + CRLF + "E&xit" SIZE 100, 50 OF oDlg PIXEL ;
ACTION oDlg:End()

ACTIVATE DIALOG oDlg CENTERED

oFontLarge:End()

RETURN .T.
// window will be closed :!:

regards
Uwe :D
Last edited by ukoenig on Tue Oct 22, 2019 1:39 pm, edited 2 times in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
AntoninoP
Posts: 347
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy
Contact:

Re: xbrowser does not appears after window

Post by AntoninoP »

ukoenig wrote: oWnd:Hide()
:lol: :lol:
Nice play
:lol: :lol:
User avatar
cnavarro
Posts: 5792
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: xbrowser does not appears after window

Post by cnavarro »

Please try

Code: Select all

#include <fivewin.ch>

func main()
   LOCAL oWnd
   XBROWSER {10,20,30,40}
   DEFINE WINDOW oWnd
   ACTIVATE WINDOW oWnd
   // The SETUP clause is used because the command XBROWSER has no "OF" clause (PARENT)
   XBROWSER {10,20,30,40} SETUP ( oBrw:oWnd:oWnd := oWnd )
return nil
 

Code: Select all

#include "fivewin.ch"

function Main()

   local oWnd, oDlg

   DEFINE WINDOW oWnd
   ACTIVATE WINDOW oWnd CENTERED
   //SetWndDefault( oWnd )
   DEFINE DIALOG oDlg OF oWnd //OF GetWndDefault()
   ACTIVATE DIALOG oDlg CENTERED
return nil
 
C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
Post Reply