Als Anfang, aber hoch und runter bewegungen mußte noch einbauen
Code: Alles auswählen
Procedure EditCB(hwnd, msg, wparam, lparam)
Protected result, oldcb, item, text.s
Static count
oldcb = GetProp_(hwnd, "oldcb")
result = CallWindowProc_(oldcb, hwnd, msg, wparam, lparam)
Select msg
Case #WM_CHAR
Select wparam
Case #VK_RETURN
item = CountGadgetItems(0) - 2
text = GetGadgetItemText(0, item)
text = RemoveString(text, #LF$)
RemoveGadgetItem(0, item)
AddGadgetItem(0, -1, text)
Default
count + 1
If count = 10
count = 0
AddGadgetItem(0, -1, "")
EndIf
EndSelect
EndSelect
ProcedureReturn result
EndProcedure
OpenWindow(0, #PB_Ignore, #PB_Ignore, 640, 480, "", #PB_Window_SystemMenu)
EditorGadget(0, 5, 5, 630, 470)
SetProp_(GadgetID(0), "oldcb", SetWindowLongPtr_(GadgetID(0), #GWL_WNDPROC, @EditCB()))
While WaitWindowEvent() <> #PB_Event_CloseWindow : Wend
RemoveProp_(GadgetID(0), "oldcb")
CloseWindow(0)