FWH MGET control 'GoBottom()' method does not work

Post Reply
peterk
Posts: 47
Joined: Thu Jul 13, 2006 2:39 pm

FWH MGET control 'GoBottom()' method does not work

Post by peterk »

Antonio
This appears to be a bug
16 bit works correctly and the Mget control displays the text at the bottom and scrolls the vertical scroll bar to the bottom (same as TWBrowse), but 32 bit does not, it seems to ignore the message

Please can you check and advise

Extract of code below:
//-----------------------------------------------------------------------------------METHOD AddToLog ( pcItem ) CLASS qFileSnd
/*
Purpose
Add a line to the log mget
*/

::cLog += Time() + ": " + pcItem + CRLF
::oMGet:SetText( ::cLog )
::oMget:GoBottom()

RETURN .t.




Regds
Peter
Peter
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Peter,

This test works ok, could you please check it there and confirm us if it works ok for you ? thanks

Code: Select all

#include "Fivewin.ch" 

FUNCTION MAIN() 

    LOCAL oDlg 
    LOCAL oGet, cVar := "Hello World!" + CRLF + "This is a test"

    DEFINE DIALOG oDlg 

    @ 1, 1 GET oGet VAR cVar MEMO SIZE 80, 30

    @ 3, 1.5 BUTTON "&Close"; 
           ACTION oDlg:End() 

    @ 3, 8.5 BUTTON "&Bottom"; 
           ACTION ( oGet:GoBottom(), oGet:SetFocus() )

    ACTIVATE DIALOG oDlg ; 
             CENTER 

RETURN NIL
regards, saludos

Antonio Linares
www.fivetechsoft.com
peterk
Posts: 47
Joined: Thu Jul 13, 2006 2:39 pm

Post by peterk »

Hi Antonio
Please try the followiing:

FUNCTION MAIN()

LOCAL oDlg
LOCAL oGet, cVar := "Hello World!" + CRLF + "This is a test"

cVar += CRLF + "Line 2"
cVar += CRLF + "Line 3"
cVar += CRLF + "Line 4"
cVar += CRLF + "Line 5"
cVar += CRLF + "Line 6"
cVar += CRLF + "Line 7"
cVar += CRLF + "Line 8"
cVar += CRLF + "Line 9"
cVar += CRLF + "Line 10"


DEFINE DIALOG oDlg

@ 1, 1 GET oGet VAR cVar MEMO SIZE 80, 30

@ 3, 1.5 BUTTON "&Close";
ACTION oDlg:End()

@ 3, 8.5 BUTTON "&Bottom";
ACTION ( oGet:GoBottom(), oGet:SetFocus() )

ACTIVATE DIALOG oDlg ;
CENTER

RETURN NIL
Peter
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Peter,

Yes, I see what you mean. The GET is not scrolling down in 32 bits. In 16 bits it works fine and its the same code.

We are going to search for a way to do it.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Peter,

Solved:

Code: Select all

#define EM_LINESCROLL  0x00B6
...
@ 3, 8.5 BUTTON "&Bottom"; 
ACTION ( oGet:GoBottom(), oGet:SendMsg( EM_LINESCROLL, 0, oGet:GetLineCount() ), oGet:SetFocus() ) 
We are going to modify Class TMGet to do it automatically.
regards, saludos

Antonio Linares
www.fivetechsoft.com
peterk
Posts: 47
Joined: Thu Jul 13, 2006 2:39 pm

Post by peterk »

Thanks

Will you be modifing the FWH mget class GoBottom() method ?
If so can you let me have the modified method please

Regds
Peter
Peter
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Peter,

METHOD GoBottom() INLINE ( ::SetPos( Len( AllTrim( ::GetText() ) ) + 1 ),;
::SendMsg( EM_LINESCROLL, 0, ::GetLineCount() ) )
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply