PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 25 → Wx - Trabalhando com arquivo .RTF (Texto Formatado)
Wx - Trabalhando com arquivo .RTF (Texto Formatado)
Débuté par adrianoboller, 20 oct. 2015 14:57 - 1 réponse
Membre enregistré
3 651 messages
Popularité : +175 (223 votes)
Posté le 20 octobre 2015 - 14:57




Botão SALVAR:
//Anotacoes do Usuario - SALVAR
s is string = RTFToText(EDT_Anotacoes)
IF s <> "" THEN
RtfSalvar()
ELSE
Info("Não foi digitado nada para ser salvo.")
END



Ao abrir a Janela
Procedure RtfAbrir()

//RTF
PathFile_RTF is string = fCurrentDir(fCurrentDrive()) +"\Anotacoes_"+Usuario+".RTF"
EDT_Anotacoes..RichEdit = True
EDT_Anotacoes..Visible = True

// Open the selected document
IF RTFLoad(EDT_Anotacoes, PathFile_RTF) = False THEN

RETURN

END

// Initialize the global variable with the name of the opened document
gfsDocumentName = PathFile_RTF

// Position the cursor at the beginning of the edit control
EDT_Anotacoes..Cursor = 1

IF TextHeight(EDT_Anotacoes, EDT_Anotacoes) > EDT_Anotacoes..Height THEN
// Display the vertical scrollbar
ScrollBarShow(EDT_Anotacoes, sbVert)
ELSE
// Remove the scrollbar
ScrollBarShow(EDT_Anotacoes, sbVert, False)
END



Procedure Salvar
Procedure RtfSalvar()

//RTF
PathFile_RTF is string = fCurrentDir(fCurrentDrive()) +"\Anotacoes_"+Usuario+".RTF"

EDT_Anotacoes..RichEdit = True

EDT_Anotacoes..Visible = True

// Procedure used to write data to a text file
// IN: sDocumentName: Name of the document

nFileID is int = 0

// Open the file
nFileID = fOpen(PathFile_RTF, foCreate + foWrite)

// Save the document
fWrite(nFileID, EDT_Anotacoes, Length(EDT_Anotacoes))

// Initialize the global variables
PathFile_RTF = ExtractString(PathFile_RTF, 1, “-)

// Close the document
fClose(nFileID)


--
Adriano Jose Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 9949 1800
adrianoboller@gmail.com
skype: adrianoboller
______________________________________________
Membre enregistré
3 651 messages
Popularité : +175 (223 votes)
Posté le 20 octobre 2015 - 15:05
Resultado Final:

Defina na Propriedado do Edtit que a barra de ferramentas estará sempre visivel e para isso coloque: [FORMATTING TOOLBAR = ALWAYS VISIBLE]





--
Adriano Jose Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 9949 1800
adrianoboller@gmail.com
skype: adrianoboller
______________________________________________