Tdialog:hide()

Post Reply
User avatar
reinaldocrespo
Posts: 918
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Tdialog:hide()

Post 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.
User avatar
wmormar
Posts: 1050
Joined: Fri Oct 07, 2005 10:41 pm
Location: México
Contact:

Re: Tdialog:hide()

Post 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
William, Morales
Saludos

méxico.sureste
User avatar
reinaldocrespo
Posts: 918
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

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

Re: Tdialog:hide()

Post 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
User avatar
reinaldocrespo
Posts: 918
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

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