Page 1 of 1

Posted: Tue Feb 25, 2003 1:12 pm
by BackupUser
Restored from previous forum. Originally posted by Naitfreak.

I had a look at about 50 examples so far but havent found any decent source for a simple text editor like "NotePad" or similar.

So if anyone has some good source on that topic let me know.

Lata~

Posted: Tue Feb 25, 2003 5:07 pm
by BackupUser
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! :)

Posted: Tue Feb 25, 2003 5:32 pm
by BackupUser
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

Posted: Tue Feb 25, 2003 6:57 pm
by BackupUser
Restored from previous forum. Originally posted by Naitfreak.

Thank u both! Good resources!

Lata~

Posted: Wed Feb 26, 2003 12:22 am
by BackupUser
Restored from previous forum. Originally posted by Kale.

I think i remember reading that a fully featured edit gadget is planned for a later release complete with syntax highlighting :)

--Kale

In love with PureBasic! :)

Posted: Wed Feb 26, 2003 9:39 pm
by BackupUser
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! :D

Posted: Thu Feb 27, 2003 10:03 am
by BackupUser
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

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
Christos

Posted: Thu Feb 27, 2003 11:40 am
by BackupUser
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

Posted: Thu Feb 27, 2003 11:45 am
by BackupUser
Restored from previous forum. Originally posted by plouf.

nice to hear El_chone
if you update it it will be niec if you add
the TAB support :)


Christos

Posted: Thu Feb 27, 2003 2:45 pm
by BackupUser
Restored from previous forum. Originally posted by Naitfreak.
you can open a multiline Stringgadget
StringGadget(#Gadget, x, y, Width, Heigth, Content$,#ES_MULTILINE|#ES_AUTOVSCROLL|#WS_VSCROLL)
Huh?

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.
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).
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.

Posted: Thu Feb 27, 2003 4:44 pm
by BackupUser
Restored from previous forum. Originally posted by El_Choni.
nice to hear El_chone if you update it it will be niec if you add the TAB support
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

Posted: Thu Feb 27, 2003 5:55 pm
by BackupUser
Restored from previous forum. Originally posted by tinman.
Originally posted by Naitfreak

where in the help docs these flags are mentioned?
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.


--
It's not minimalist - I'm increasing efficiency by reducing input effort.
(Win98first ed. + all updates, PB3.51, Ed3.53)

Posted: Thu Feb 27, 2003 6:26 pm
by BackupUser
Restored from previous forum. Originally posted by Naitfreak.
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.
That pretty much explains it all!

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~

Posted: Fri Feb 28, 2003 11:01 am
by BackupUser
Restored from previous forum. Originally posted by plouf.
Originally 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 Think we talkink about differend thinks
i wand to press TAB (the key) and insert a TAB in the text
it idoes not atm :)

Christos

Posted: Fri Feb 28, 2003 8:15 pm
by BackupUser
Restored from previous forum. Originally posted by El_Choni.

Ouch, I see! I'll fix that.

El_Choni