XBrowse and nomodal dialogs

XBrowse and nomodal dialogs

Postby Enrico Maria Giordano » Fri Oct 09, 2020 8:16 am

I'm having strange problems with XBrowse and nomodal dialogs. Switching from one dialog to another, often I find 0 (zero) as the current workarea. What is the correct way to manage workarea switching in such scenario? I'm currently using oBrw:bGotFocus but it seems that other XBrowse functions are executed before it, so the workarea is not correctly switched.

Any help?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8315
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: XBrowse and nomodal dialogs

Postby Otto » Fri Oct 09, 2020 9:46 am

Enrico, have you tried with oDlg:bGotFocus = { || dbSelectArea( "dbffile" )} .
Best regards
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6009
Joined: Fri Oct 07, 2005 7:07 pm

Re: XBrowse and nomodal dialogs

Postby Enrico Maria Giordano » Fri Oct 09, 2020 9:54 am

Yes, same problem. oDlg:bGotFocus doesn't start at all.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8315
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: XBrowse and nomodal dialogs

Postby MaxP » Fri Oct 09, 2020 10:15 am

And try with ?

Code: Select all  Expand view
oBrw:bpainted = { || dbSelectArea( "dbffile" )}
User avatar
MaxP
 
Posts: 84
Joined: Thu Jul 12, 2007 2:02 pm

Re: XBrowse and nomodal dialogs

Postby Enrico Maria Giordano » Fri Oct 09, 2020 10:21 am

Sorry, it doesn't solve the problem. There are some codeblocks in XBrowse that are evaluated before bPainted and bGotFocus, so before workarea setting.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8315
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: XBrowse and nomodal dialogs

Postby Enrico Maria Giordano » Fri Oct 09, 2020 2:14 pm

Is there any code in XBrowse that changes the current workarea? Otherwise, who is that selects the workarea number zero? I don't do it for sure.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8315
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: XBrowse and nomodal dialogs

Postby dutch » Fri Oct 09, 2020 3:03 pm

Dear Enrico,

I'm so sorry to ask you.
Do you add "ALIAS" in XBROWSE command? If not, I guess the XBROWSE will read from current workarea.
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
dutch
 
Posts: 1535
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: XBrowse and nomodal dialogs

Postby Enrico Maria Giordano » Fri Oct 09, 2020 3:13 pm

Yes, I already add

ALIAS ALIAS()

Is it correct? But the problem is that the workarea become number zero when I switch to another dialog with another XBrowse.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8315
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: XBrowse and nomodal dialogs

Postby nageswaragunupudi » Fri Oct 09, 2020 5:08 pm

I assume you are using different workareas for different browses. We can not use same workarea in different xbrowses.
Switching the xbrowses does not switch workareas (does not change the selected workarea).
XBrowse is also not affected by the currently selected workarea.
XBrowse reads from oBrw:cAlias and writes to oBrw:cAlias.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: XBrowse and nomodal dialogs

Postby Enrico Maria Giordano » Fri Oct 09, 2020 5:13 pm

Yes, I'm using different workareas. But the browses are dinamically created so I can't use any alias, I need that the current workarea is the one of the browse with the focus.

Can it be done?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8315
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: XBrowse and nomodal dialogs

Postby nageswaragunupudi » Fri Oct 09, 2020 5:19 pm

Can it be done?

Can be done, as long as you programmatically ensure that you are not creating a new Xbrowse for the same alias for which you already created another Xbrowse.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: XBrowse and nomodal dialogs

Postby Enrico Maria Giordano » Fri Oct 09, 2020 5:24 pm

Yes, I'm sure of that because the aliases are generated by the program. So, what do you suggest for switching the workarea on focus change? Please note that bGotFocus seems not to be enough.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8315
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: XBrowse and nomodal dialogs

Postby nageswaragunupudi » Fri Oct 09, 2020 6:22 pm

There is no need to switch workareas.
XBrowse has nothing to do with currently selected workarea.

If you still have any problem, please provide a small sample.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: XBrowse and nomodal dialogs

Postby Enrico Maria Giordano » Fri Oct 09, 2020 7:08 pm

Scenario: two nomodal dialogs (or windows) each with its own browse. The code behind them are the same and relies on the current workarea (this is not my choice). How can I get this working without a way to automatically switch the workarea when a dialog gains the focus?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8315
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: XBrowse and nomodal dialogs

Postby cnavarro » Fri Oct 09, 2020 8:23 pm

Dear Enrico
I do not think I fully understand the problem that it raises. Can you better explain to me what you need
Here are two non-modal dialogs with xbrowse
Image
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: 6500
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: richard-service and 77 guests