Hallo,
habe die Sache mal in meinen Velindos integriert, komme jedoch nur auf das Ergebnis
(was so viel wie Baumwollburg“ bedeutet)
.
Übergebe die Sache an die Base mit
SQL + "Notiz='" + NOTIZ$ + "',"
Obwohl es nun im Gadget funktioniert! Liegt das nun an der SQLite Base, oder muss die Base geändert werden...
Code: Alles auswählen
; Richtext von Gadget zu Gadget über String Variable
; https://www.purebasic.fr/german/viewtopic.php?f=16&t=31968
; https://www.msn.com/de-de/reisen/artikel/diese-fantastischen-naturfotos-werden-sie-aufmuntern/ss-BB12m50z?li=BBqfWMM#image=6
; (was so viel wie „Baumwollburg“ bedeutet)
;- >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
EnableExplicit
;- >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Enumeration
; Edt_Win
; Edt_Source
; Edt_Target
; Edt_Btn
EndEnumeration
Global Edt_Win
Global Edt_Source
Global Edt_Target
Global Edt_Btn
;-TOP
;- >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Global Notiz$ = ""
Global NNotiz$ = ""
Global EditorGadget_RawRichText$
Notiz$ + "{\rtf1\ansi\ansicpg1252\deff0\deflang1031\deflangfe1031{\fonttbl{\f0\fswiss\fprq2\fcharset0 Verdana;}{\f1\fswiss\fprq2\fcharset0 Segoe WP SemiLight;}}"
Notiz$ + "{\colortbl ;\red0\green128\blue128;\red51\green51\blue51;}"
Notiz$ + "{\*\generator Msftedit 5.41.21.2510;}\viewkind4\uc1\pard\nowidctlpar\cf1\f0\fs20 So kennen wir den \'84Riverdale\ldblquote -Star gar nicht. \cf2\f1 (was so viel wie \'84Baumwollburg\ldblquote bedeutet)\cf1\f0\par"
Notiz$ + "\cf1\ul\b\i\fs28 APPNAME é à ç è ê"
Notiz$ + "\line@ۇ}"
; *****************************************************************************
; RTF_To_Gadget by mk-soft, v1.05, 27.03.2018
CompilerIf #PB_Compiler_Version < 550
; -------------------------------
Procedure UTF8(Text.s)
; -------------------------------
Protected *mem = AllocateMemory(StringByteLength(Text, #PB_UTF8) + 1)
; -------------------------------
If *mem
PokeS(*mem, Text, -1, #PB_UTF8)
EndIf
; -------------------------------
ProcedureReturn *mem
; -------------------------------
EndProcedure
; -------------------------------
Procedure Ascii(Text.s)
; -------------------------------
Protected *mem = AllocateMemory(StringByteLength(Text, #PB_Ascii) + 1)
; -------------------------------
If *mem
PokeS(*mem, Text, -1, #PB_Ascii)
EndIf
; -------------------------------
ProcedureReturn *mem
; -------------------------------
EndProcedure
; -------------------------------
CompilerEndIf
Procedure RTF_To_Gadget(Gadget, Text.s , NewLine=#False)
; -------------------------------
If Left(Text, 5) <> "{\rtf"
Text = "{\rtf " + Text + "}"
EndIf
; -------------------------------
If NewLine
Text = Left(Text, Len(text) - 1) + "\line}"
EndIf
; -------------------------------
CompilerIf #PB_Compiler_Unicode
; -------------------------------
Protected hEdit = GadgetID(Gadget)
Protected ndx = GetWindowTextLength_(hEdit)
Protected *szBuffer = Ascii(Text)
; -------------------------------
SendMessage_(hEdit, #EM_SETSEL, ndx, ndx)
SendMessage_(hEdit, #EM_REPLACESEL, 0, *szBuffer)
; -------------------------------
FreeMemory(*szBuffer)
; -------------------------------
CompilerElse
; -------------------------------
AddGadgetItem(Gadget, -1 , Text)
; -------------------------------
CompilerEndIf
; -------------------------------
EndProcedure
Procedure RTF_From_Gadget_CB(dwCookie, pbBuff, cb, pcb)
If cb
CompilerIf #PB_Compiler_Unicode
; -------------------------------
EditorGadget_RawRichText$ + PeekS(pbBuff, cb ,#PB_UTF8)
; -------------------------------
CompilerElse
; -------------------------------
;{ Liest einen String von der angegebenen Speicheradresse.
EditorGadget_RawRichText$ + PeekS(pbBuff, cb ,#PB_Ascii)
; EditorGadget_RawRichText$ + PeekS(pbBuff, cb ,#PB_Unicode)
; EditorGadget_RawRichText$ + PeekS(pbBuff, cb,#PB_UTF16 )
;}
; -------------------------------
CompilerEndIf
; -------------------------------
EndIf
pcb=cb
EndProcedure
Procedure.s RTF_From_Gadget(gad)
; -------------------------------
ReplaceString(GetGadgetText(gad), "'", "''",#PB_String_InPlace )
; -------------------------------
EditorGadget_RawRichText$=""
; -------------------------------
Protected str.EDITSTREAM\dwCookie=0
; -------------------------------
str\dwError=0
str\pfnCallback = @RTF_From_Gadget_CB()
; -------------------------------
SendMessage_(GadgetID(gad),#EM_STREAMOUT,#SF_RTF,@str)
; -------------------------------
; SetGadgetText(gad,"")
; -------------------------------
ProcedureReturn EditorGadget_RawRichText$
EndProcedure
; *****************************************************************************
Edt_Win = OpenWindow(#PB_Any,0,0,300,330,"RTF Insert",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
CreateGadgetList(WindowID(Edt_Win))
Edt_Source = EditorGadget(#PB_Any,5,5,290,145,#PB_Editor_WordWrap)
Edt_Target = EditorGadget(#PB_Any,5,150,290,145,#PB_Editor_WordWrap)
Edt_Btn = ButtonGadget(#PB_Any,5,300,200,20,"Gadget1 => Gadget2")
RTF_To_Gadget(Edt_Source, Notiz$)
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow: End
Case #PB_Event_Gadget
Select EventGadget()
Case Edt_Btn
NNOTIZ$ = RTF_From_Gadget(Edt_Source)
RTF_To_Gadget(Edt_Target,NNOTIZ$)
EndSelect
EndSelect
ForEver
Gruss ... Velindos
Windows 7/8/8.1/10 (32/64-Bit) |Ubuntu 10.4 (64-Bit) |Purebasic 5.71 LTS (32/64-Bit)