Page 1 of 1

Code that used to work fails

Posted: Tue Nov 29, 2011 11:39 am
by concentra
Antonio, the folowing code used to work in a previous version and isn't working anymore.
The text and the title do not change and the dialog isn't centered.
Note the NOWAIT clause.

The previous version was 09.11 using xHarbour.com's Pelles C and now I am using Harbour 11.10 + MinGw.
I was unable to test with FW 11.10 version + xHarbour.com because my xHarbour.com's isn't FW 11.10 compatible.
Could you investigate if this is a problem with MinGw, FW version or my code ?
PRG :

Code: Select all

#INCLUDE "fivewin.ch"
FUNCTION Main()
   LOCAL oDlgTeste, oTexto, cTexto
   DEFINE DIALOG oDlgTeste RESOURCE 18503 TITLE "Teste Title"
   REDEFINE SAY  oTexto VAR cTexto ID 101 OF oDlgTeste
   ACTIVATE DIALOG oDlgTeste CENTER NOWAIT

   cTexto := "Another text..."
   oTexto:SETTEXT( cTexto )

   MessageBox( 0, "Why dialog text didn't change ?", "Why title didn't change ?", 0 )
RETURN NIL
RC :

Code: Select all

#include "winuser.h"
#include "winnt.h"
#include "commctrl.h"

18503 DIALOG DISCARDABLE 13, 22, 250, 100
STYLE WS_POPUP|DS_MODALFRAME|DS_3DLOOK|WS_CAPTION|WS_VISIBLE
CAPTION "Teste..."
{
  CONTROL "Text", 101, "Static", SS_CENTER, 2, 9, 245, 15
}
 

Re: Code that used to work fails

Posted: Tue Nov 29, 2011 4:15 pm
by ukoenig
I think, that will work with any FWH-version :

ACTIVATE DIALOG oDlgTeste CENTER NOWAIT ;
ON INIT ( oDlgTeste:cTitle := "New Text", ;
cTexto := "Another text...", oTexto:SETTEXT( cTexto ) )


You can force a Dialog-position ( ON INIT ) with :
oDlgTeste:Move( nTop, nLeft, DlgWidth, DlgHeight , .f. )
( possible Calculation of centered Position )

Best Regards
Uwe :lol:

Re: Code that used to work fails

Posted: Tue Nov 29, 2011 4:54 pm
by concentra
No, didn't work.

Harbour 3.1.0dev (Rev. 17102).
gcc (tdm-1) 4.5.2-dw2
FW 11.10

Re: Code that used to work fails

Posted: Tue Nov 29, 2011 5:00 pm
by ukservice
Hello,

It is working with FWH 11.11, Borland 5.82 and Harbour 3.1

Re: Code that used to work fails

Posted: Tue Nov 29, 2011 7:26 pm
by Antonio Linares
Concentra,

We already know what is going on. We are working to fix it, thanks! :-)

It is the same reason for the bug detected by Rimantas!

Re: Code that used to work fails

Posted: Tue Nov 29, 2011 7:53 pm
by Antonio Linares
Concentra,

This fix is required in Class TDialog for MinGW:

dialog.prg
Image

Re: Code that used to work fails

Posted: Wed Nov 30, 2011 10:01 am
by concentra
Thanks Antonio.
But the DIALOG.PRG I have isn't the same as yours, the lines aren't the same...
Could you send me the full DIALOG.PRG ?

Maurício Faria

Re: Code that used to work fails

Posted: Wed Nov 30, 2011 1:31 pm
by Antonio Linares
Mauricio,

New libs sent to your email :-)