Paste To EditorGadget
- electrochrisso
- Addict
- Posts: 989
- Joined: Mon May 14, 2007 2:13 am
- Location: Darling River
Paste To EditorGadget
Is it possible when pasting to the EditorGadget to not have the rich formatting and be like the StringGadget and stay in the same font originally set for the gadget. I can use StringGadget multiline and extra flags, but I like the EditorGadget better for what I want to use it for.
PureBasic! Purely the best 

-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: Paste To EditorGadget
...Instead of offering the User only a 'Paste' option, you can, say, have two options on the Menu/PopUp - 'Paste' and 'Paste Unformatted'.
If the User selects 'Unformatted', simply paste into a hidden string gadget first, then copy from that (GetGadgetText) into the active Editor gadget.
If the User selects 'Unformatted', simply paste into a hidden string gadget first, then copy from that (GetGadgetText) into the active Editor gadget.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
-
- Enthusiast
- Posts: 536
- Joined: Mon Feb 16, 2009 10:42 am
- Location: sweden
- Contact:
Re: Paste To EditorGadget
What you mean? Editorgadget doesnt support formatted text (RTF or HTML)... no bold, italics, fontsize, colors etc...
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: Paste To EditorGadget
...yes, it does support RTF on Windows. There are a lot of posts about that, look for Rich Edit.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
Re: Paste To EditorGadget
You can switch between RTF and Plain Text at any time
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_Gadget
Select EventGadget()
Case 1
SetGadgetText(0,"")
SendMessage_(GadgetID(0), #EM_SETTEXTMODE, #TM_RICHTEXT, 0)
SetActiveGadget(0)
Case 2
SetGadgetText(0,"")
SendMessage_(GadgetID(0), #EM_SETTEXTMODE, #TM_PLAINTEXT, 0)
SetActiveGadget(0)
EndSelect
EndSelect
Until Quit = 1
EndIf
Egypt my love
- electrochrisso
- Addict
- Posts: 989
- Joined: Mon May 14, 2007 2:13 am
- Location: Darling River