xbrowser does not appears after window

xbrowser does not appears after window

Postby AntoninoP » Mon Oct 21, 2019 11:57 am

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  Expand view
#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.
AntoninoP
 
Posts: 375
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy

Re: xbrowser does not appears after window

Postby nageswaragunupudi » Mon Oct 21, 2019 4:36 pm

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

For example,
Code: Select all  Expand view
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
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: xbrowser does not appears after window

Postby Silvio.Falconi » Tue Oct 22, 2019 7:07 am

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
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7033
Joined: Thu Oct 18, 2012 7:17 pm

Re: xbrowser does not appears after window

Postby Jack » Tue Oct 22, 2019 10:00 am

Hi,
You have to place the XBROWSE bitween DEFINE WINDOW AND ACTIVATE WINDOW .
Jack
 
Posts: 288
Joined: Wed Jul 11, 2007 11:06 am

Re: xbrowser does not appears after window

Postby ukoenig » Tue Oct 22, 2019 10:07 am

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
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: xbrowser does not appears after window

Postby Silvio.Falconi » Tue Oct 22, 2019 10:19 am

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 ..
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7033
Joined: Thu Oct 18, 2012 7:17 pm

Re: xbrowser does not appears after window

Postby ukoenig » Tue Oct 22, 2019 10:43 am

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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: xbrowser does not appears after window

Postby AntoninoP » Tue Oct 22, 2019 10:47 am

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  Expand view
#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....
   
 
AntoninoP
 
Posts: 375
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy

Re: xbrowser does not appears after window

Postby ukoenig » Tue Oct 22, 2019 10:58 am

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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: xbrowser does not appears after window

Postby AntoninoP » Tue Oct 22, 2019 11:48 am

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
AntoninoP
 
Posts: 375
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy

Re: xbrowser does not appears after window

Postby ukoenig » Tue Oct 22, 2019 12:58 pm

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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: xbrowser does not appears after window

Postby AntoninoP » Tue Oct 22, 2019 1:31 pm

ukoenig wrote:oWnd:Hide()


:lol: :lol:
Nice play
:lol: :lol:
AntoninoP
 
Posts: 375
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy

Re: xbrowser does not appears after window

Postby cnavarro » Tue Oct 22, 2019 3:42 pm

Please try
Code: Select all  Expand view

#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  Expand view

#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
 
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], russimicro and 58 guests