teste gerade den PB 5.61 Stand. Dabei möchte ich
den Richtext von Gadget_0 auf Gadget_1 kopieren.
- geht nicht, verliert Format
Dann möchte ich das Gadget auslesen und in die Datenbank schreiben!
- geht auch nicht, habe kein Rich Format sondern Text.
Code: Alles auswählen
;
; This code is automatically generated by the FormDesigner.
; Manual modification is possible to adjust existing commands, but anything else will be dropped when the code is compiled.
; Event procedures needs to be put in another source file.
;
; PB 5.61 TESTEN der Richtext Funktionen
Global Window_0
Global Button_0, Button_1, Button_2, Editor_0, Editor_1, Text_0
Global sTxt.s = "{\rtf1\ansi\ansicpg1252\deff0\deflang2057{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\fswiss\fcharset0 Arial;}}"
sTxt = sTxt + "{\colortbl ;\red255\green0\blue0;}{\*\generator Msftedit 5.41.15.1503;}\viewkind4\uc1\pard\f0\fs20 Hello \cf1\fs32 TESTING\cf0\f1\fs20\par}"
Global Notiz$
Procedure OpenWindow_0(x = 0, y = 0, width = 600, height = 400)
Window_0 = OpenWindow(#PB_Any, x, y, width, height, "", #PB_Window_SystemMenu)
Button_0 = ButtonGadget(#PB_Any, 30, 300, 100, 30, "")
Button_1 = ButtonGadget(#PB_Any, 170, 300, 100, 30, "")
Button_2 = ButtonGadget(#PB_Any, 310, 300, 90, 30, "")
Editor_0 = EditorGadget(#PB_Any, 30, 80, 220, 200)
Editor_1 = EditorGadget(#PB_Any, 340, 80, 220, 190)
Text_0 = TextGadget(#PB_Any, 30, 20, 250, 25, "Richtext Copy von Gadget 0 => 1")
EndProcedure
Procedure Window_0_Events(event)
Select event
Case #PB_Event_CloseWindow
ProcedureReturn #False
Case #PB_Event_SizeWindow
Case #PB_Event_Menu
Select EventMenu()
EndSelect
Case #PB_Event_Gadget
Select EventGadget()
Case Button_0
SetGadgetText(Editor_0,sTxt)
Case Button_1
SetGadgetText(Editor_1,GetGadgetText(Editor_0))
Case Button_2
; Gadgetinhalt als Richtext anzeigen!
Notiz$ = GetGadgetText(Editor_0)
Debug "RICHTTEXT= " + Notiz$
EndSelect
EndSelect
ProcedureReturn #True
EndProcedure
OpenWindow_0()
Define WindowNr, EEvent
Repeat
;{ WindowNr
WindowNr = EventWindow()
EEvent = WaitWindowEvent()
; ----------------------------------------------------------
Select WindowNr
; Windows
Case Window_0
Window_0_Events(EEvent)
EndSelect
Until WaitWindowEvent()=#PB_Event_CloseWindow
;}
Gruss Velindos ...