FGet enhancement

FGet enhancement

Postby Dietmar Jahnel » Fri Oct 26, 2007 12:13 pm

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  Expand view
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
User avatar
Dietmar Jahnel
 
Posts: 83
Joined: Mon Oct 17, 2005 10:33 am
Location: Austria

Postby Antonio Linares » Fri Nov 02, 2007 10:36 am

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
regards, saludos

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

Postby Dietmar Jahnel » Fri Nov 02, 2007 11:42 am

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
User avatar
Dietmar Jahnel
 
Posts: 83
Joined: Mon Oct 17, 2005 10:33 am
Location: Austria

Postby Antonio Linares » Fri Nov 02, 2007 11:57 am

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 :-(
regards, saludos

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: nageswaragunupudi and 93 guests