A simple text editor in PB?
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Kale.
The nearest thing to a text editor would be the IDE that comes with PB, as this is entirely coded with PB
http://www.reelmediaproductions.com/pb/ ... source.zip
--Kale
In love with PureBasic!
The nearest thing to a text editor would be the IDE that comes with PB, as this is entirely coded with PB
http://www.reelmediaproductions.com/pb/ ... source.zip
--Kale
In love with PureBasic!
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Paul.
Take a look at El_Choni's RichEdit ASM library from the ASM Archive section of the Resources Site. It comes with a cool little notepad type editor showing how to make use of the library.
----------
Visit the PB Resources Site at http://www.reelmediaproductions.com/pb
Take a look at El_Choni's RichEdit ASM library from the ASM Archive section of the Resources Site. It comes with a cool little notepad type editor showing how to make use of the library.
----------
Visit the PB Resources Site at http://www.reelmediaproductions.com/pb
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Naitfreak.
Hmm, hmm, hmm....
So good, so far. Besides that both sources doesn't compile with PB v3.51 this is quite useable code. But both (not 100% sure about the PB editor) use RichEdit for text input.
So is it possible at all that I can write a NotePad-like word prcessor with PB's default command set?
PS: I'm a bloody noob to PB (just started 4 days ago) so forgive me!
Hmm, hmm, hmm....
So good, so far. Besides that both sources doesn't compile with PB v3.51 this is quite useable code. But both (not 100% sure about the PB editor) use RichEdit for text input.
So is it possible at all that I can write a NotePad-like word prcessor with PB's default command set?
PS: I'm a bloody noob to PB (just started 4 days ago) so forgive me!
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by plouf.
you can open a multiline Stringgadget
StringGadget(#Gadget, x, y, Width, Heigth, Content$,#ES_MULTILINE|#ES_AUTOVSCROLL|#WS_VSCROLL)
But the best optiom imho it would be to use elchoni's
RichEdit library just download it from resource site
demo seems to need the in libarry too (???)
but it is not so hard to here a small example
Christos
you can open a multiline Stringgadget
StringGadget(#Gadget, x, y, Width, Heigth, Content$,#ES_MULTILINE|#ES_AUTOVSCROLL|#WS_VSCROLL)
But the best optiom imho it would be to use elchoni's
RichEdit library just download it from resource site
demo seems to need the in libarry too (???)
but it is not so hard to here a small example
Code: Select all
OpenWindow(0,0,0,400,300,#PB_Window_SystemMenu,"RichEdit")
OpenRichEdit(WindowID(),0,2,2,WindowWidth()-4,WindowHeight()-4,"Content")
Repeat
wevent = WaitWindowEvent()
Until wevent = #PB_Event_CloseWindow ; Wait until user press [x]
StreamFileOut("text.txt",#SF_TEXT) ; SAve Contens in a file called text.txt
End
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by El_Choni.
Sorry about the example file, that's right, it uses the PopUpWindow library because i wanted to use pop up dialogs for search-replace (I wasn't able to use Windows default FR dialogs), I will change that in next release (if PB 3.60 doesn't include an RE gadget).
Bye,
@Fred: BTW, the PopUpWindow lib wouldn't be needed at all just if you added the proper flags to OpenWindow, the same for wrapping StringGadgets and the snippets that have been around lately (would it be posible to add these: #PB_PopupWindow and #PB_TextWrap?).
El_Choni
Sorry about the example file, that's right, it uses the PopUpWindow library because i wanted to use pop up dialogs for search-replace (I wasn't able to use Windows default FR dialogs), I will change that in next release (if PB 3.60 doesn't include an RE gadget).
Bye,
@Fred: BTW, the PopUpWindow lib wouldn't be needed at all just if you added the proper flags to OpenWindow, the same for wrapping StringGadgets and the snippets that have been around lately (would it be posible to add these: #PB_PopupWindow and #PB_TextWrap?).
El_Choni
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Naitfreak.
Honestly, if had known these flags I wouldn't have posted here at all. I mean before I asked I tried use the StringGadget() function as well without these flags it was pointless. May I ask where in the help docs these flags are mentioned? As I can only find the following:
#PB_String_Password
#PB_String_ReadOnly
#PB_String_Numeric
#PB_String_LowerCase
#PB_String_UpperCase
#PB_String_BorderLess
Well, I didn't know that it's that simple. So thanks for pointing that out, I appreciate it.
Huh?you can open a multiline Stringgadget
StringGadget(#Gadget, x, y, Width, Heigth, Content$,#ES_MULTILINE|#ES_AUTOVSCROLL|#WS_VSCROLL)
Honestly, if had known these flags I wouldn't have posted here at all. I mean before I asked I tried use the StringGadget() function as well without these flags it was pointless. May I ask where in the help docs these flags are mentioned? As I can only find the following:
#PB_String_Password
#PB_String_ReadOnly
#PB_String_Numeric
#PB_String_LowerCase
#PB_String_UpperCase
#PB_String_BorderLess
Well, I didn't know that it's that simple. So thanks for pointing that out, I appreciate it.
Your example is still very good and well coded. It's just before I use any external libs wich I maybe don't understand and simply confuse me I wanted to get more familar with PB's default commands.Sorry about the example file, that's right, it uses the PopUpWindow library because i wanted to use pop up dialogs for search-replace (I wasn't able to use Windows default FR dialogs), I will change that in next release (if PB 3.60 doesn't include an RE gadget).
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by El_Choni.
El_Choni
Danilo gave me a workaround to do that: put a Frame3DGadget in the panel of the same size you want the REGadget to be, and use it's GadgetID() as parent window for OpenRichEdit(). It's tricky, but it works, and I couldn't find any other way. Even the PB IDE handles itself the showing/hiding each RE control, so don't know how to tell PB the your control must be considered as being part of a panel.nice to hear El_chone if you update it it will be niec if you add the TAB support
El_Choni
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by tinman.
Remember that PureBasic is trying to be completely source compatible across operating systems (if you use basic). Not all operating systems may be able to have multiline string gadgets created so simply, so Fred may need to put more work into stuff like that to keep it compatible.
--
It's not minimalist - I'm increasing efficiency by reducing input effort.
(Win98first ed. + all updates, PB3.51, Ed3.53)
They're not mentioned because they are constants defined in the Windows SDK.Originally posted by Naitfreak
where in the help docs these flags are mentioned?
Remember that PureBasic is trying to be completely source compatible across operating systems (if you use basic). Not all operating systems may be able to have multiline string gadgets created so simply, so Fred may need to put more work into stuff like that to keep it compatible.
--
It's not minimalist - I'm increasing efficiency by reducing input effort.
(Win98first ed. + all updates, PB3.51, Ed3.53)
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Naitfreak.
Let's hope he implements some sort of RichEdit-like gagdet with the next version to keep compatibility on all operating systems for all users.
Lata~
That pretty much explains it all!They're not mentioned because they are constants defined in the Windows SDK.
Remember that PureBasic is trying to be completely source compatible across operating systems (if you use basic). Not all operating systems may be able to have multiline string gadgets created so simply, so Fred may need to put more work into stuff like that to keep it compatible.
Let's hope he implements some sort of RichEdit-like gagdet with the next version to keep compatibility on all operating systems for all users.
Lata~
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by plouf.
i wand to press TAB (the key) and insert a TAB in the text
it idoes not atm
Christos
I Think we talkink about differend thinksOriginally posted by El_Choni
Danilo gave me a workaround to do that: put a Frame3DGadget in the panel of the same size you want the REGadget to be, and use it's GadgetID() as parent window for OpenRichEdit(). It's tricky, but it works, and I couldn't find any other way. Even the PB IDE handles itself the showing/hiding each RE control, so don't know how to tell PB the your control must be considered as being part of a panel.
El_Choni
i wand to press TAB (the key) and insert a TAB in the text
it idoes not atm
Christos
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm