Show a Rtf page as Winword or OpenOffice

Show a Rtf page as Winword or OpenOffice

Postby Silvio.Falconi » Fri Jul 08, 2016 10:37 am

I make some test how show a rtf control as Winword page or Openoffice on the middle of a owndmain

and this is the result

Image


only i have problem with vertical scroll because when i click on the vscroll it move also the messagebar or the buttonbar

any solution ?

the sources of the test
Code: Select all  Expand view
#include "FiveWin.ch"
#include "richedit.ch"

static oWnd, oRtf, cRtf, oEdit, cVar



#define COLOR_BTNFACE    15






function main()
  local o
  local hDll := LoadLibrary( "Riched20.dll" )


  define window oWnd menu oMenu() ;
  color CLR_HGRAY,CLR_HGRAY  ;
   VSCROLL ;
  TITLE "TEST RTF PAGE"

  cRtf := memoread("testrtf.rtf")


  @ 10, 20 RICHEDIT oRtf VAR cRtf of oWnd NO SCROLL NOBORDER



   DEFINE BUTTONBAR oBar OFoWnd SIZE 30,33 3DLOOK 2007




   SET MESSAGE OF oWnd TO "Class TRichEdit" DATE TIME ;
       COLOR CLR_HBLUE, GetSysColor( COLOR_BTNFACE )





  activate window oWnd ;
    on init (adjustRtf(), TScrWnd():New(   oWnd,1,35,1,30) )  ;
    on resize adjustRtf() ;
    maximized

  freeLibrary(hDll)
  return nil




//----------------------------------------------------------------------

function adjustRtf()

   local nTop, nLeft, nHorRes, aRect, nHeight, nWidth

  nTop    := 100
  nLeft   := 100

  nHorRes := GetSysMetrics( 0 )
  aRect := GetClientRect(oWnd:hWnd)

  nHeight  := aRect[4] -  289

  nWidth := aRect[4] - aRect[2] - 202



  oRtf:move(nTop, nLeft, nWidth, nHeight , .t. )

  return nil



//----------------------------------------------------------------------

function oMenu()
  LOCAL oMenu

  MENU oMenu 2007
     MENUITEM "&File "
        MENU
           MENUITEM "E&xit" ACTION oWnd:end()
        ENDMENU
  ENDMENU

RETURN oMenu

 
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 92 guests