Tdialog:hide()

Tdialog:hide()

Postby reinaldocrespo » Wed Aug 30, 2006 7:51 pm

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  Expand view  RUN
*-------------------------------------------------------------------------------------------------------------------------------
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
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: Tdialog:hide()

Postby wmormar » Wed Aug 30, 2006 8:33 pm

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  Expand view  RUN
*-------------------------------------------------------------------------------------------------------------------------------
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  Expand view  RUN
ACTIVATE DIALOG oSelf:oDlg CENTERED NOWAIT ON INIT ::oDlg:Hide()


Saludos
William, Morales
Saludos

méxico.sureste
User avatar
wmormar
 
Posts: 1074
Joined: Fri Oct 07, 2005 10:41 pm
Location: México

Postby reinaldocrespo » Wed Aug 30, 2006 8:45 pm

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

Re: Tdialog:hide()

Postby Enrico Maria Giordano » Wed Aug 30, 2006 9:40 pm

Try this:

Code: Select all  Expand view  RUN
#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
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby reinaldocrespo » Thu Aug 31, 2006 12:13 am

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  Expand view  RUN
#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
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Postby Enrico Maria Giordano » Thu Aug 31, 2006 12:34 pm

Sorry, I have no solution for this problem.

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: nageswaragunupudi and 56 guests