Page 1 of 1

Tdialog:hide()

Posted: Wed Aug 30, 2006 7:51 pm
by reinaldocrespo
Hi everyone;

In order to print richtext which I have saved on .fpt files, I find that I must create the control on a dialog or window. When I only wish to print without displaying the richtext control I hide the dialog:

Code: Select all

*-------------------------------------------------------------------------------------------------------------------------------
METHOD DisplayHidden() CLASS Transcription
local oSelf	:= self, i

	::oActive := ::oTrGrss

	for i:=1 to len( ::aRtfs )
		::aRtfs[ i ]:hide()
	next i

	ACTIVATE DIALOG oSelf:oDlg CENTERED NOWAIT
	::oDlg:Hide()

return nil
::aRtfs contains a few richtext objects previously redefined OF ::odlg. The problem is that the dialog flashes for just a microsecond. That would be acceptable, except when printing 300 cases. Then it flashes for a few minutes.

Any ideas on how to solve this one?

Thank you,


Reinaldo.

Re: Tdialog:hide()

Posted: Wed Aug 30, 2006 8:33 pm
by wmormar
reinaldocrespo wrote:Hi everyone;

In order to print richtext which I have saved on .fpt files, I find that I must create the control on a dialog or window. When I only wish to print without displaying the richtext control I hide the dialog:

Code: Select all

*-------------------------------------------------------------------------------------------------------------------------------
METHOD DisplayHidden() CLASS Transcription
local oSelf	:= self, i

	::oActive := ::oTrGrss

	for i:=1 to len( ::aRtfs )
		::aRtfs[ i ]:hide()
	next i

	ACTIVATE DIALOG oSelf:oDlg CENTERED NOWAIT
	::oDlg:Hide()

return nil
::aRtfs contains a few richtext objects previously redefined OF ::odlg. The problem is that the dialog flashes for just a microsecond. That would be acceptable, except when printing 300 cases. Then it flashes for a few minutes.

Any ideas on how to solve this one?

Thank you,


Reinaldo.
Reinaldo,

Sugeriria de esta manera.

Code: Select all

ACTIVATE DIALOG oSelf:oDlg CENTERED NOWAIT ON INIT ::oDlg:Hide()
Saludos

Posted: Wed Aug 30, 2006 8:45 pm
by reinaldocrespo
William;

Gracias por la sugerencia. Parecería que de esa manera ni siquiera se pintaría la ventana de dialogo. Pero no es así. De hecho de esa manera la muestra por mas tiempo que de la otra.

Cualquier otra idea es bienvenida.

Comoquiera gracias.

Saludos,


Reinaldo

Re: Tdialog:hide()

Posted: Wed Aug 30, 2006 9:40 pm
by Enrico Maria Giordano
Try this:

Code: Select all

#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oDlg, oDlg2

    DEFINE DIALOG oDlg

    @ 1, 1 BUTTON "&Open dialog";
           WHEN oDlg2 = NIL;
           ACTION oDlg2 := HIDDENDLG()

    ACTIVATE DIALOG oDlg;
             VALID ( IF( oDlg2 != NIL, oDlg2:End(), ), .T. );
             CENTER

    RETURN NIL


STATIC FUNCTION HIDDENDLG()

    LOCAL oDlg

    DEFINE DIALOG oDlg

    oDlg:bStart = { || oDlg:Hide() }

    ACTIVATE DIALOG oDlg;
             ON INIT TONE( 440, 1 );
             VALID ( TONE( 880, 1 ), .T. );
             CENTER NOMODAL

    RETURN oDlg
EMG

Posted: Thu Aug 31, 2006 12:13 am
by reinaldocrespo
Enrico;

I really appreciate your responses.

It made no change. Below, I made some minor changes to your code for you to test and see what I'm referring to.

Code: Select all

#include "Fivewin.ch"


FUNCTION MAIN()
local i
LOCAL oDlg, oDlg2

    DEFINE DIALOG oDlg

    @ 1, 1 BUTTON "&Open dialog";
           WHEN oDlg2 = NIL;
           ACTION oDlg2 := HIDDENDLG()

    @ 2, 1 BUTTON "&End" ACTION oDlg:end()

    ACTIVATE DIALOG oDlg;
             VALID ( IF( oDlg2 != NIL, oDlg2:End(), ), .T. );
             CENTER

    RETURN NIL

*-----------------------------------------------------------------------------------
STATIC FUNCTION HIDDENDLG()
LOCAL oDlg
local i

	for i := 1 to 300
		DEFINE DIALOG oDlg
		oDlg:bStart = { || oDlg:Hide() }
		ACTIVATE DIALOG oDlg CENTER NOMODAL
		odlg:end()
	next i

RETURN NIL

You should be able to see the odlg2 flash 300 times.

Reinado

Posted: Thu Aug 31, 2006 12:34 pm
by Enrico Maria Giordano
Sorry, I have no solution for this problem.

EMG