- Code: Select all Expand view RUN
oRich:bGotFocus = { || oRich:SetSel( 0, 0 ) }
After REDEFINE RICHEDIT5
oRich:bGotFocus = { || oRich:SetSel( 0, 0 ) }
// Create edit control
REDEFINE RICHEDIT5 oRich VAR cRTF ID 2155 OF oDlg ;
MESSAGE "Edit the text, and press OK to save your changes" //UPDATE
oRich:SetText( cText )
CONTROL "", 2155, "RichEdit50W", 4100 | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL, 10, 40, 500, 350
// Create edit control
REDEFINE RICHEDIT5 oRich VAR cRTF ID 2155 OF oDlg ;
MESSAGE "Edit the text, and press OK to save your changes" //UPDATE
oRich:SetText( cText )
CONTROL "", 2155, "RichEdit50W", 4100 | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL, 10, 40, 500, 350
oRtf:LoadRTF( cText )
FUNCTION setup3
// Text Editor for disclosures
// Updated: 7/30/2015 5:55:48 PM
LOCAL oEndText, oDlg, nRcrd, oRich
PRIVATE cText := " ", cTitle := " ", cRtf := " "
// Open the text database
oEndText := tEndText():New( )
oEndText:gobottom( )
nRcrd := oEndText:recno( )
DO WHILE nRcrd < 8
oEndText:append( )
oEndText:skip( )
nRcrd := oEndText:recno( )
ENDDO
oEndText:gotop( )
cText := oEndText:tagtext
// Create the dialog
DEFINE DIALOG oDlg RESOURCE "SETUP3" BRUSH oBrush transparent OF oWnd
oDlg:nHelpID := 6
REDEFINE BUTTONBAR oBarS3 ID 100 SIZE 60,60 OF oDlg 2015
oBarS3:bClrGrad := aPubGrad
MENU oWPopS1 POPUP
MENUITEM "Estimate" ACTION ( oEndText:goto(1), cText := oEndText:tagtext, cTitle := oEndText:texttype, ;
oDlg:update() ) MESSAGE "Text to print on estimates"
MENUITEM "Invoices" ACTION ( oEndText:goto(2), cText := oEndText:tagtext, cTitle := oEndText:texttype, ;
oDlg:update() ) MESSAGE "Text to print on invoices"
MENUITEM "Tag lines" ACTION ( oEndText:goto(3), cText := oEndText:tagtext, cTitle := oEndText:texttype, ;
oDlg:update() ) MESSAGE "Ad tag lines to printed on invoices"
MENUITEM "Counter" ACTION ( oEndText:goto(4), cText := oEndText:tagtext, cTitle := oEndText:texttype, ;
oDlg:update() ) MESSAGE "Text to print on counter sales"
MENUITEM "Worksheets" ACTION ( oEndText:goto(5), cText := oEndText:tagtext, cTitle := oEndText:texttype, ;
oDlg:update() ) MESSAGE "Text to print on worksheets"
MENUITEM "Statements" ACTION ( oEndText:goto(6), cText := oEndText:tagtext, cTitle := oEndText:texttype, ;
oDlg:update() ) MESSAGE "Text to print on statements"
MENUITEM "Recommendation" ACTION ( oEndText:goto(7), cText := oEndText:tagtext, cTitle := oEndText:texttype, ;
oDlg:update() ) MESSAGE "Disclosure for recommendation"
MENUITEM "Text Message" ACTION ( oEndText:goto(8), cText := oEndText:tagtext, cTitle := oEndText:texttype, ;
oDlg:update() ) MESSAGE "Signature line for text messages"
ENDMENU
DEFINE BUTTON oWBtn1 OF oBarS3 RESOURCE "FIBILD" PROMPT "Sections" ;
ACTION oWBtn1:ShowPopup() MENU oWPopS1 TOOLTIP "Text sections"
DEFINE BUTTON oWBtn3 OF oBarS3 RESOURCE "HRSAVE" ;
ACTION ( oEndText:tagtext := cText, oEndText:save( ), oDlg:update( ) )
DEFINE BUTTON oWBtn4 OF oBarS3 RESOURCE "SPELL" ;
ACTION ( cText := SpellOne( cText), oDlg:update() )
DEFINE BUTTON oWBtn5 OF oBarS3 RESOURCE "HREXIT" ;
ACTION oDlg:end()
/*
// Create edit control
REDEFINE GET cText MEMO ID 2155 OF oDlg ;
MESSAGE "Edit the text, and press OK to save your changes" UPDATE
*/
// Create edit control
REDEFINE RICHEDIT5 oRich VAR cText ID 2155 OF oDlg ;
MESSAGE "Edit the text, and press OK to save your changes" //UPDATE
oRich:SetText( cText )
ACTIVATE DIALOG oDlg ON INIT (oReBar:hide( ), oBarS3:lTransparent := .F.) CENTERED
oReBar:show( )
// Close the file
oEndText:close()
RETURN NIL
SETUP3 DIALOG 0, 0, 660, 410
STYLE WS_POPUP | WS_CAPTION
CAPTION "Text Editor"
{
CONTROL "", 100, "TBar", 0|WS_CHILD|WS_VISIBLE, 0,0, 640, 30
CONTROL "", 2155, "RichEdit50W", 4100 | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL, 10, 40, 500, 350
}
// Provide for include files
#include "fivewin.ch"
#INCLUDE "richedi5.ch"
PROCEDURE main
// Text Editor with resource for RTF5
LOCAL oDlg, oRich, cText := " "
cText := "This is a test of the RTF 5 editor using a resource file. It does not yet display the Rich Text editing bar"
// Create the dialog
DEFINE DIALOG oDlg RESOURCE "SIMPLERTF"
// Create edit control
REDEFINE RICHEDIT5 oRich VAR cText ID 100 OF oDlg ;
MESSAGE "Edit the text, and press OK to save your changes"
ACTIVATE DIALOG oDlg
RETURN NIL
#include <windows.h>
#include <commctrl.h>
#include <richedit.h>
LANGUAGE LANG_ENGLISH,SUBLANG_ENGLISH_US
SIMPLERTF DIALOG 0, 0, 660, 410
STYLE DS_MODALFRAME | WS_SYSMENU | WS_CAPTION
CAPTION "Text Editor"
{
CONTROL "", 100, "RichEdit50W", 4100 | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL, 10, 40, 500, 350
}
FOR lx := 1 TO MLCount( oEndText:tagtext, 120,, .T. )
WOPAGEHEAD( oPrn, aHead )
IF lPrintColor
oPrn:SayText( nRow, 2 * nCsp, MemoLine( oEndText:tagtext, 120, lx,, .T. ),nCsp*120, nRsp * 1.1, oFcond, , CLR_RED )
ELSE
oPrn:SayText( nRow, 2 * nCsp, MemoLine( oEndText:tagtext, 120, lx,, .T. ),nCsp*120, nRsp * 1.1, oFcond )
ENDIF
nRow += nRsp
NEXT
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 39 guests