Page 1 of 1

Bug in REDEFINE SAY?

Posted: Sat Feb 12, 2011 6:47 pm
by IBTC
Hello!

If I use TRANSPARENT with DIALOG the displayed text of REDEFINED SAY is cutted:

Image

Code: Select all

function DialogFromResource1()

   local oDlg
   LOCAL cText

   cText := "*** Lorem ipsum dolor sit amet, consectetur adipisici elit, sed eiusmod tempor incidunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquid ex ea commodi consequat. Quis aute iure reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint obcaecat cupiditat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. ***"

   DEFINE DIALOG oDlg NAME "DIALOG1" COLOR NIL,RGB(239,239,231) TRANSPARENT

   REDEFINE SAY PROMPT cText ID 500 OF oDlg

   ACTIVATE DIALOG oDlg

return nil
without TRANSPARENT the whole text is displayed:

Image

Code: Select all

function DialogFromResource2()

   local oDlg
   LOCAL cText

   cText := "*** Lorem ipsum dolor sit amet, consectetur adipisici elit, sed eiusmod tempor incidunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquid ex ea commodi consequat. Quis aute iure reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint obcaecat cupiditat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. ***"

   DEFINE DIALOG oDlg NAME "DIALOG1" COLOR NIL,RGB(239,239,231)

   REDEFINE SAY PROMPT cText ID 500 OF oDlg

   ACTIVATE DIALOG oDlg

return nil
The resource file:

Code: Select all

DIALOG1 DIALOGEX DISCARDABLE 44, 23, 400, 107
STYLE WS_POPUP|DS_MODALFRAME|DS_3DLOOK|WS_CAPTION|WS_SYSMENU|WS_VISIBLE
FONT 8, "MS Sans Serif"
{
  CONTROL "", 500, "Static", WS_GROUP, 8, 18, 388, 68
}
How can this bug fixed?

Re: Bug in REDEFINE SAY?

Posted: Tue Feb 15, 2011 3:43 pm
by IBTC
This problem still exists in FWH 11.01. :(

And now I also found a (new?) Memory leak:

Code: Select all

02/15/11 16:37:12: BRUSH,3048,TDIALOG:SETCOLOR(2477)->TDIALOG:NEW(196)->DIALOGFROMRESOURCE1(39)->(b)MAIN(19)->TBTNBMP:CLICK(466)->TBTNBMP:LBUTTONUP(661)->TCONTROL:HANDLEEVENT(1489)->TBTNBMP:HANDLEEVENT(1453)->_FWH(3408)->WINRUN(0)->TWINDOW:ACTIVATE(992)->MAIN(22)
The code:

Code: Select all

FUNCTION MAIN()

   LOCAL oWnd

   SetResDebug()

   DEFINE WINDOW oWnd FROM 1, 1 TO 10, 40 ;
      TITLE "Test"

   @ 15, 10 BTNBMP oBtn OF oWnd SIZE 140, 20 PROMPT "Dialog from Resource" 2007 ACTION DialogFromResource1()
   @ 50, 10 BTNBMP oBtn OF oWnd SIZE 140, 20 PROMPT "Dialog from Resource" 2007 ACTION DialogFromResource2()

   ACTIVATE WINDOW oWnd

   FERASE("CHECKRES.TXT")
   CHECKRES()
   winExec("notepad .\checkres.txt")

return(0)
 
Rest of the code see above, also the rc file.

Re: Bug in REDEFINE SAY?

Posted: Tue Mar 15, 2011 9:38 pm
by Jonathan Hodder
Hi Ruediger

Re: text display ........................reprehend <end>

It looks like you have reached the limit of a character field. 255 happends to be the mac character field in clipper/dbase file.
Maybe it is the version of harbour that has changed to enforce the limit?

Try using MsgInfo() to disply 'cText' to see whats there. MsgInfo() is a windows display function.

You would normally use LTEXT in your resources to display static text.
Have you tried to use memo resources to display it. An example is the way I use an RC to capture text as a memo.

EDITTEXT 110, 16, 46, 342, 128, ES_MULTILINE | ES_WANTRETURN | WS_BORDER | WS_VSCROLL | WS_TABSTOP

The 'Say' class does not have a MEMO multi line option but 'get' class does.
I have never used 'Say' for such long text!
I'm interested in your solution to this.

Re: Bug in REDEFINE SAY?

Posted: Tue Mar 15, 2011 10:23 pm
by IBTC
Hi Jonathan,
Jonathan Hodder wrote:It looks like you have reached the limit of a character field. 255 happends to be the mac character field in clipper/dbase file.
Maybe it is the version of harbour that has changed to enforce the limit?
Everything work well without TRANSPARENT, only if I add TRANSPARENT (with the same Harbour version, the same FWH version, the same rest of source code etc.) the whole text isn't displayed. So, for me, it seems that there must be a bug in FWH. If I reached a limit of a character field with SAY, why did the problem didn't exists without TRANSPARENT, only with TRANSPARENT?
Jonathan Hodder wrote:Have you tried to use memo resources to display it.
Thanks for this idea. I will try it ASAP.

Re: Bug in REDEFINE SAY?

Posted: Wed Mar 16, 2011 1:34 am
by Daniel Garcia-Gil
Hi Ruediger

already fixed...

you can use momentarily this patch...

http://www.sitasoft.net/fivewin/files/patch.obj

link before fivewin lib

this a sample working, thanks for the samples posted... was very useful help to solve the problem
http://www.sitasoft.net/fivewin/samples/ibtc.zip

Re: Bug in REDEFINE SAY?

Posted: Thu Mar 17, 2011 10:25 pm
by IBTC
Hi Daniel,
Daniel Garcia-Gil wrote: already fixed...

you can use momentarily this patch...
Thanks. It works. :D

Re: Bug in REDEFINE SAY?

Posted: Mon Mar 28, 2011 9:52 pm
by Enrico Maria Giordano
Unfortunately, your sample doesn't work correctly in the new FWH release. One star at the end of the phrase is missing.

EMG

Re: Bug in REDEFINE SAY?

Posted: Tue Apr 19, 2011 5:53 pm
by carlos vargas
Daniel, Antonio

podrian, poner el patch.obj para microsoft o pelles c compiler.

gracias.


salu2
carlos vargas

Re: Bug in REDEFINE SAY?

Posted: Tue Apr 19, 2011 6:57 pm
by Daniel Garcia-Gil
Carlos...

que version de fivewin usas?

Re: Bug in REDEFINE SAY?

Posted: Tue Apr 19, 2011 7:02 pm
by carlos vargas
10.07

salu2
carlos vargas

Re: Bug in REDEFINE SAY? [Solved]

Posted: Sun May 29, 2011 5:50 pm
by Enrico Maria Giordano
Unfortunately this bug is back in latest FWH:

Code: Select all

#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oDlg

    DEFINE DIALOG oDlg;
           TRANSPARENT

    @ 1, 1 SAY "This is a test"

    ACTIVATE DIALOG oDlg;
             CENTER

    RETURN NIL
:-(

EMG

Re: Bug in REDEFINE SAY?

Posted: Sun May 29, 2011 10:16 pm
by Antonio Linares
Enrico,

Fixed :-)

We are going to publish a revised FWH 11.05

Re: Bug in REDEFINE SAY?

Posted: Sun May 29, 2011 10:23 pm
by Enrico Maria Giordano
Many thanks, Master! :-)

EMG