Paste Text as RTF and Plain Text in EditorGadget [Windows]
Posted: Tue Oct 18, 2011 7:10 pm
We can Paste Text as RTF or Plain Text in the same session
Using Ctrl-V
Tested with PB 4.60 - Win 7 x86 - XP x86
Using Ctrl-V
Tested with PB 4.60 - Win 7 x86 - XP x86
Code: Select all
If OpenWindow(0, 0, 0, 400, 290, "EditorGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
EditorGadget(0, 10,10, 380, 240)
ButtonGadget(1, 10, 260, 80, 20, "RTF")
ButtonGadget(2, 100, 260, 80, 20, "Pain Text")
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Quit = 1
Case #PB_Event_Menu
Select EventMenu()
Case 15
Result = CountGadgetItems(0)
SetGadgetItemText(0, Result, GetClipboardText())
EndSelect
Case #PB_Event_Gadget
Select EventGadget()
Case 1
RemoveKeyboardShortcut(0,#PB_Shortcut_Control | #PB_Shortcut_V)
Case 2
AddKeyboardShortcut(0,#PB_Shortcut_Control | #PB_Shortcut_V, 15)
EndSelect
EndSelect
Until Quit = 1
EndIf