Page 1 of 1

FGet enhancement

Posted: Fri Oct 26, 2007 12:13 pm
by Dietmar Jahnel
Our application displays a lot of plain text using the FGet-Class.
Now I'm looking for a way to make the control "senitive" to some words in the text when the words are unterlined (or something else) so that the user can click on it and some action is performed.
Can this be done?
I was playing around with the MouseMove method without success...
Can anybody give me a clue?

Thanks,
Dietmar

Code: Select all

METHOD MouseMove( nRow, nCol, nKeyFlags ) CLASS TFGet

   if ::lDrag
      return Super:MouseMove( nRow, nCol, nKeyFlags )
   endif

   if ::lCaptured

      if nRow >= 32768
         nRow -= 65536
      endif
      if nCol >= 32768
         nCol -= 65536
      endif

      ::MoveCaret( nRow, nCol )
      ::BlockUp()

      // ::SendMsg( WM_MOUSEMOVE, nKeyFlags, nMakeLong( nCol, nRow ) )

      do while GetAsyncKey( VK_LBUTTON ) .and. ;
               ( ( nRow < 0 .and. !( ::oLine == ::oLineInit ) ) .or. ;
               ( nRow > ::nHeight  .and. !( ::oLine == ::oLineEnd ) ) )
         ::MoveCaret( nRow, nCol )
         ::BlockUp()
         Delay( 0.03 )
         nRow := aCursorCoors( ::hWnd )[1]
         nCol := aCursorCoors( ::hWnd )[2]
      enddo

      return 0

   endif

   ::oWnd:SetMsg( ::cMsg )
   if ::oCursor != nil
      SetCursor( ::oCursor:hCursor )
   else
      CursorIBeam()
   endif

   ::CheckToolTip()

///Test+

    IF ::oFont:lUnderline != nil
      //Verlinkung nur bei unterstrichenen Normen
//?::oFont:lUnderline
      IF ::oFont:lUnderline
         CursorHAND()
      ELSE
         CursorARROW()
      ENDIF
    ENDIF

///Test-


   if ::bMMoved != nil
      Eval( ::bMMoved, nRow, nCol, nKeyFlags )
   endif

return nil

Posted: Fri Nov 02, 2007 10:36 am
by Antonio Linares
Dietmar,

You may consider to use Class TRichEdit instead of Class TFGet, as standard Win32 richedit provides what you are looking for, besides many interesting features not supported in Class TFGet.

Please review samples\TestRtf.prg and scroll down in the provided RTF sample and you will find some URLs that you can click on

Posted: Fri Nov 02, 2007 11:42 am
by Dietmar Jahnel
I tried to build testrtf.
That's what I get:

xLINK: error: Unresolved external symbol '_OleUIPasteSpecialA'.
xLINK: error: Unresolved external symbol '_GetFileVersionInfoSizeA'.
xLINK: error: Unresolved external symbol '_GetFileVersionInfoA'.
xLINK: error: Unresolved external symbol '_VerQueryValueA'.
xLINK: fatal error: 4 unresolved external(s).

what is missing?

Regards,
Dietmar

Posted: Fri Nov 02, 2007 11:57 am
by Antonio Linares
Dietmar,

For a quick test, please try to add this code to the PRG:

#pragma BEGINDUMP

void OleUIPasteSpecialA( void ) {}
void GetFileVersionInfoSizeA( void ) {}
void GetFileVersionInfoA( void ) {}
void VerQueryValueA( void ) {}

#pragma ENDDUMP

> what is missing?

xHB commercial should provide those Windows API import functions, as Microsoft and Borland perfectly do :-(