XBrowse and nomodal dialogs

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

XBrowse and nomodal dialogs

Post by Enrico Maria Giordano »

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
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: XBrowse and nomodal dialogs

Post by Otto »

Enrico, have you tried with oDlg:bGotFocus = { || dbSelectArea( "dbffile" )} .
Best regards
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
User avatar
MaxP
Posts: 85
Joined: Thu Jul 12, 2007 2:02 pm
Contact:

Re: XBrowse and nomodal dialogs

Post by MaxP »

And try with ?

Code: Select all

oBrw:bpainted = { || dbSelectArea( "dbffile" )}
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: XBrowse and nomodal dialogs

Post by Enrico Maria Giordano »

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: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: XBrowse and nomodal dialogs

Post by Enrico Maria Giordano »

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
dutch
Posts: 1395
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: XBrowse and nomodal dialogs

Post by dutch »

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
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: XBrowse and nomodal dialogs

Post by Enrico Maria Giordano »

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
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: XBrowse and nomodal dialogs

Post by nageswaragunupudi »

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
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: XBrowse and nomodal dialogs

Post by Enrico Maria Giordano »

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
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: XBrowse and nomodal dialogs

Post by nageswaragunupudi »

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
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: XBrowse and nomodal dialogs

Post by Enrico Maria Giordano »

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
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: XBrowse and nomodal dialogs

Post by nageswaragunupudi »

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
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: XBrowse and nomodal dialogs

Post by Enrico Maria Giordano »

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
cnavarro
Posts: 5792
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: XBrowse and nomodal dialogs

Post by cnavarro »

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
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