TextEdit Gadget

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Re: TextEdit Gadget

Post by Polo »

Image
After many headaches, I implemented line wrapping, without too much bugs, i hope :|
The code begins to be quite complex, as it works with and without line wrapping :)
It needs optimisation indeed!

Next steps is to implement center and right (and maybe justify) align (when line wrapping is enabled).

I'd need to write some API for it at some point, too!
It might be interesting to add some features to turn this text editor into a code editor, I'll see (bye bye scintilla :mrgreen: )
User avatar
flaith
Enthusiast
Enthusiast
Posts: 704
Joined: Mon Apr 25, 2005 9:28 pm
Location: $300:20 58 FC 60 - Rennes
Contact:

Re: TextEdit Gadget

Post by flaith »

It's looks really neat :D
Can't wait to test it, well done Polo

Just a question : can we add our own font, like a graphical one ?
“Fear is a reaction. Courage is a decision.” - WC
WilliamL
Addict
Addict
Posts: 1252
Joined: Mon Aug 04, 2008 10:56 pm
Location: Seattle, USA

Re: TextEdit Gadget

Post by WilliamL »

Hey Polo

How do I get to the code in the TextEdit.rar file? (uncompress)

I guessing the file in your first post is the most updated version.

I want to try this on my mac.

Thanks

[edit]
Sorry, polo, I was being dense, it works fine on my computer. Good luck with your effort. :)
Last edited by WilliamL on Thu Sep 22, 2011 9:59 am, edited 2 times in total.
MacBook Pro-M1 (2021), Sequoia 15.4, PB 6.20
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Re: TextEdit Gadget

Post by Polo »

Hi Flaith, you can use any fonts from the OS, thus it has to be a "proper" font.
William: I didn't upload the latest version showed above, I want to go trough a few optimisations first :)
However, there's a .app in the rar file from the first post, you can consider it as a very early version. I'll post a new one soon!

I finished left, center and right alignment, works nicely it seems, not sure which next new features i'll add yet :)
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Re: TextEdit Gadget

Post by Polo »

Most recent version (Mac only):
http://www.megaupload.com/?d=8SU1L9JB

I optimised "a little bit" the line wrapping, not enough though so it can be slow, especially if the line is large.
There is one main bug, the line wrapping will cut the word if there is formatting at the end of the wrapped line, need to fix that :)

Otherwise it should be working well, you can see in the example I added line padding (to set a space before/after a paragraph), and also left and right margin. I didn't add it to the GUI so you can't really play with it :mrgreen:
Will add line spacing soon (for wrapped lines mode).
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Re: TextEdit Gadget

Post by Polo »

Just finished a new word wrapping calculation, that won't cut word when they are formatted, shouldn't have any bugs now :)

Added a line number margin, too! This can be turned on and off through the SetGadgetAttribute API.

Image
User avatar
Derren
Enthusiast
Enthusiast
Posts: 316
Joined: Sat Jul 23, 2011 1:13 am
Location: Germany

Re: TextEdit Gadget

Post by Derren »

NUTS.
But the download isn't working.
Have you considered http://www.dropbox.com/ ?
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Re: TextEdit Gadget

Post by Polo »

Will do next time I release a demo :)
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Re: TextEdit Gadget

Post by Polo »

I'm having fun, just did some basic live syntax highlighting (won't be a core part of the gadget, just to prove it's possible).
This is using the gadget API i've made (still incomplete), crossplatform indeed.

I'm thinking of going further, and add to the gadget line folding and autocompletion.

Image

(please don't say the example code is useless :) )
Pureabc
User
User
Posts: 76
Joined: Mon Jan 16, 2006 1:11 am

Re: TextEdit Gadget

Post by Pureabc »

Polo,

The screen shots look good.

Is there a windows version?

Thank you.
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Re: TextEdit Gadget

Post by Polo »

Hi Pureabc,

Yes, it works on Windows, and probably on Linux too :)
jesperbrannmark
Enthusiast
Enthusiast
Posts: 536
Joined: Mon Feb 16, 2009 10:42 am
Location: sweden
Contact:

Re: TextEdit Gadget

Post by jesperbrannmark »

How long are you gonna keep me drooling and dreaming? :wink:
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Re: TextEdit Gadget

Post by Polo »

:mrgreen:

I'm still want to be fully statisfied with it before releasing it :)

(and I still do not know if I release it as DLL/Dylib or PureLib, and not sure how much should I charge for that etc etc...) :wink:
Zach
Addict
Addict
Posts: 1676
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: TextEdit Gadget

Post by Zach »

I would go for DLL and/or .PBI

With a DLL you can load stuff in and call it easy as pie, using any version of PB.
With a *.PBI you can at least give the user the choice of editing it to make it work with the version of PB they want to use it with, versus restricting them to the version it was designed/compiled for if you were to distribute as a Userlib

That is the biggest problem with User Libraries. They run the risk of easily becoming outdated, and not working properly with any version of PB except what they were designed/compiled for.

IMHO the prevailing wisdom on the forum has been to steer people away from using/making such libraries, as more often than not Authors abandon them at some point and they can't be maintained and/or lack source code.
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Re: TextEdit Gadget

Post by Polo »

Yes, I'll go for a DLL, and a more expensive licence for code source.

Here's a very early attempt with autocompletion :)

Image
Post Reply