Page 1 of 2
IDE : Give us a predefined Templates collection
Posted: Wed Aug 08, 2007 8:30 am
by Flype
The PureBasic IDE comes with a template system which is really usefull.
it would be very nice to have a predefined template collection bundled with the PureBasic installer.
for example, most of the snippets presents in the documentation can be included as templates.
This way we could have a ready to use snippet for each function of purebasic.

Posted: Wed Aug 08, 2007 8:44 am
by Joakim Christiansen
Yeah, there could be a directory with example templates in that template window. And maybe a group of people should make templates for common used stuff, but don't include the whole CodeArchive.
Posted: Wed Aug 08, 2007 8:50 am
by Kale
If your after a library of templates it will soon get muddled without an ordering system. This could be as simple as coding the template window to support folders? Does the template window already support folders? (i'm at work and can't check)
Posted: Wed Aug 08, 2007 8:58 am
by Flype
@kale.
yes it support folders. fortunately. so the template system shows a tree of templates.
this way it's possible to sort by 'chapter' (Window, Gadget, Screen, and so on) all the need stuff.
Posted: Wed Aug 08, 2007 1:11 pm
by freak
Its not such a bad idea actually. We'll see what i can do for the next version.
Posted: Wed Aug 08, 2007 7:02 pm
by Flype
Posted: Wed Aug 08, 2007 7:24 pm
by blueznl
Isn't this a bit what CodeCaddy and the CodeArchiv are trying to achive?
Posted: Wed Aug 08, 2007 7:40 pm
by Flype
well not really,
i think more just about very little snippets of 10/15/20 lines max to show how to use a purebasic function. just like the ones in the purebasic.chm. not a wide one. each user can make it's own template then.
Posted: Fri Aug 10, 2007 4:47 pm
by blueznl
Mmmm okay, but I don't see how it would help much, I mean, what's to stop me making a little source with all my own examples, and do a search (or hit ^F1) to look up a word in it? Well, perhaps if the feature is there I applaud for it

as it probably is me who doesn't understand it

Posted: Fri Aug 10, 2007 5:07 pm
by Trond
Having a template for creating a window with event loop is very handy.
Posted: Fri Aug 10, 2007 6:26 pm
by Flype
Yes for example, and
a screen template,
a console template,
a systray template,
a toolbar template,
etc...
Especially for newbies ! but also for everybody (time saving).
Another things that might help newbies :
Having a wizard like Visual Studio or DevC++ to create a new project in which you can choose between a window app, a console app, a screen app that open an associated template.
Also, the little help/description for the functions in the bottom editor might be (IMHO) more useful to the final programmer if the type of arguments were described.
For example, OpenWindow() shows :
OpenWindow (#Window, x, y, InnerWidth, InnerHeight, Title$ [, Flags [, ParentID]]) - Opens a new window according to the specified parameters.
It might be better this way :
Window.l = OpenWindow (PBId.l, x.l, y, InnerWidth.l, InnerHeight.l, Title.s [, Flags.l [, ParentID.l]]) - Opens a new window according to the specified parameters.
Posted: Fri Aug 10, 2007 8:48 pm
by Kale
I actually have a few templates setup in my IDE. here is the templates files if your interested. Just drop into your Purebasic folder (backup yours if you dont want mine to overwrite).
http://www.kalekold.net/Purebasic/Misc/Templates.prefs
I wonder if theres a way we could colaborate online to build a open template repository?
Posted: Fri Aug 10, 2007 8:59 pm
by dontmailme
Kale wrote:I wonder if theres a way we could colaborate online to build a open template repository?
Nice idea, especially if it was sponsored by the PB team...... in other words it was a semi-official one which we could help to write which would be included in the PB releases or at least a link on the download page.

Posted: Fri Aug 10, 2007 9:12 pm
by freak
My plan is to allow several tempate files to be viewed (through a combobox probably)
This would allow to keep such a proposed "help examples" list separate from
user created ones, and it would also allow easier sharing of the templates.
Posted: Wed May 21, 2008 6:45 pm
by Flype
hi freak,
i'm not bumping, just going to news.
i understand very well that it is not a priority (even for myself), but just wondering if you still have this one (or something like this) in your todo list ?