It is currently Sun May 27, 2018 8:36 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Ultimate Canvas Gadget Library
PostPosted: Tue Feb 16, 2016 6:23 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat Jul 23, 2011 1:13 am
Posts: 147
Location: Germany
I've noticed that there are many great Gadgets being built with the Canvas Gadget.

One problem many might have is that they all come from different authors and use different "call conventions". Some use BindEvent() and others don't, because they're too old, thus require the end-user to put bits of code into the Eventloop. Some create their Gadgets with "CreateCustomGadget" and have Procedures like "GetCustomGadgetWidth", others use Modules, others use a ton of Api (Windows or other).

How about: Coming up with some form of "convention" that existing gadgets can be adapted to, and new ones can plan to use.
Purpose? A uniform code if you were to use two or more custom Gadgets at the same time.
Shared resources: custom Gadget list and general functions like GadgetWidth() for ALL custom Gadgets. Shared methods that anyone can and should use in their library like GetWindowColor() and GetStandardFont().

What do you think :?:


Top
 Profile  
Reply with quote  
 Post subject: Re: Ultimate Canvas Gadget Library
PostPosted: Tue Feb 16, 2016 9:43 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Mar 24, 2011 12:40 am
Posts: 519
Location: Iowa, USA
Derren wrote:
What do you think

I think having access to a community library of custom gadgets would be a very useful resource.
A list of 'preferred conventions' would definitely be worthwhile I would think.
Emulating the behavior if existing PB gadgets as much as possible should be a goal.

I would suggest a new section on this forum where custom gadgets could be submitted for pier review.
After any issues have been resolved they could be submitted for inclusion to the 'official' custom gadget library.
Perhaps voted on by forum members in general or a select team of experienced PB users.
Possibly the PB developers themselves might have the final say.

_________________
BasicallyPure
Until you know everything you know nothing, all you have is what you believe.


Top
 Profile  
Reply with quote  
 Post subject: Re: Ultimate Canvas Gadget Library
PostPosted: Tue Feb 16, 2016 9:51 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 07, 2007 3:25 pm
Posts: 3146
Location: Berlin, Germany
@BasicallyPure:
I absolutely agree with what you write.

_________________
Please excuse my flawed English. My native language is PureBasic.
Search
RSBasic's backups


Top
 Profile  
Reply with quote  
 Post subject: Re: Ultimate Canvas Gadget Library
PostPosted: Tue Feb 16, 2016 10:33 pm 
Offline
Addict
Addict

Joined: Fri Nov 09, 2012 11:04 pm
Posts: 1566
Location: Uttoxeter, UK
Great suggestions, so...
+ 1

_________________
DE AA EB


Top
 Profile  
Reply with quote  
 Post subject: Re: Ultimate Canvas Gadget Library
PostPosted: Tue Feb 16, 2016 10:41 pm 
Offline
PureBasic Team
PureBasic Team
User avatar

Joined: Fri Apr 25, 2003 6:14 pm
Posts: 1555
Location: Germany (Saxony, Deutscheinsiedel)
I agree too. Good idea :D

_________________
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)


Top
 Profile  
Reply with quote  
 Post subject: Re: Ultimate Canvas Gadget Library
PostPosted: Wed Feb 17, 2016 12:52 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Feb 01, 2012 3:30 pm
Posts: 675
Location: Nottinghamshire UK
@BasicallyPure succinctly put !!!
Zebuddi. :)

_________________
malleo, caput, bang. Ego, comprehendunt in tempore


Top
 Profile  
Reply with quote  
 Post subject: Re: Ultimate Canvas Gadget Library
PostPosted: Wed Feb 17, 2016 1:30 am 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 04, 2015 7:10 am
Posts: 1673
+1! and if nothing else it would also help FIND the little gems amongst all the other threads :D right now it's not easy without the right keywords... and even then!

_________________
Thankyou to all the coders who generously helped & encouraged me in the nearly 2yrs when i was welcome here,
it was a tremendous privilege. I learned a lot. I wish you and your families all the best and success for the future.


Top
 Profile  
Reply with quote  
 Post subject: Re: Ultimate Canvas Gadget Library
PostPosted: Wed Feb 17, 2016 1:51 am 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 19, 2011 3:47 am
Posts: 2068
Location: Singapore
A compilation section would be a far more possible and welcome addition.

But expecting conformity for voluntary contributions is a little unrealistic, and might even put many off from sharing their ideas.

We're just lucky to even have such contributions in the first place, from the generous few that shares them with us.

_________________
Texas Instruments 99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too!


Top
 Profile  
Reply with quote  
 Post subject: Re: Ultimate Canvas Gadget Library
PostPosted: Wed Feb 17, 2016 4:49 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Oct 06, 2006 3:57 pm
Posts: 469
Location: England
+1 Gets my vote.

Perhaps the ultimate aim should be to make a standard library - that is not OS specific but PB specific.

I'd be interested in seeing a common approach to this - cos a lot of my own gadgets seem to fly in the face of any convention - even my own :)


Top
 Profile  
Reply with quote  
 Post subject: Re: Ultimate Canvas Gadget Library
PostPosted: Wed Feb 17, 2016 4:58 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat Jul 23, 2011 1:13 am
Posts: 147
Location: Germany
TI-994A wrote:
A compilation section would be a far more possible and welcome addition.

But expecting conformity for voluntary contributions is a little unrealistic, and might even put many off from sharing their ideas.

We're just lucky to even have such contributions in the first place, from the generous few that shares them with us.



"Rules" could also provide guiding. For example, I have heard of BindEvent, but never really used it for months. Only after I saw somebody else's code and wonderered why on earth there's no "catch_and_forward_events()" function call in the event loop, I realized that it's much cleaner to use BindEvent.
I much prefer the version where I don't have to add code to the event loop. It's not necessary for PB-Gadgets and thanks to BindEvent, it's no longer necessary for Canvas-based Gadgets.

I certainly don't want to discourage anyone from sharing their ideas. But if the whole forum, all of you experts join in on setting up some rules, I think it would be very beneficial.

Also, as I mentioned above, there are many great codes that can help. A collection of those would also be beneficial. Especially if those helper functions are already treated like a library.
This prevents having 20 helper functions for 3 gadgets, instead of just 10 uniform functions.

I'm sure if you just finished a project, you don't want to change your code conform to anything. At least not right now.
But soun rules and tutorials for basic steps (like Event handling) could actually encourage people to try it out. People who have never used a Canvas Gadget but surely have the wits to create awesome gadgets with it.


Top
 Profile  
Reply with quote  
 Post subject: Re: Ultimate Canvas Gadget Library
PostPosted: Wed Feb 17, 2016 5:18 pm 
Offline
Enthusiast
Enthusiast

Joined: Fri Feb 19, 2010 3:42 am
Posts: 464
Great idea!

Who manages the API?

Is it possible for the PB team to first release an API for a new canvas based gadget as idea?
Or review a given API at least and confirm no future naming problems?


The mentioned rules for an API are easy as is PureBasic.
Only one must decide: is it WindowMouseX or getWindowMouseX or [get]WindowMouse(#PB_X)?
Canvas based button could be "buttonCanvasGadget" or "buttonControl" or "buttonWidget".

I did not talk about modules, because I don't like them;-)
For a new standard canvas gadget library it should be possible to define new procedures without name clash.

Regards


Top
 Profile  
Reply with quote  
 Post subject: Re: Ultimate Canvas Gadget Library
PostPosted: Tue Feb 13, 2018 2:16 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat Jul 23, 2011 1:13 am
Posts: 147
Location: Germany
Looking through my old posts, found this.
Seemed to resonate with at least a few people including Andre. :wink:


Top
 Profile  
Reply with quote  
 Post subject: Re: Ultimate Canvas Gadget Library
PostPosted: Tue Feb 13, 2018 3:04 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Jun 11, 2006 12:07 am
Posts: 411
Location: Germany / one of the fishheads
Hi Derren, I have just discovered the thread and find the suggestion great.

Presumably, the easiest way to do this is to provide a template gadget as source code for everyone involved and also for the compliance of the code. This template should have been examined beforehand for a common consensus.

This also has the advantage that a CustomGadget programmer no longer has to deal with the framework, but can program its specific procedures, because the framework is already in place. Anyway, I am a great advocate of templates and I use them myself, so that I don't have to reinvent the wheel every time.

However, I think that first a moderator of the forum has to be active in order to set up a corresponding area for CustomGadgets in this forum. In the meantime the others can discuss what kind of program style to agree on ;-)

Personally, I am in favour of binding event and modules. And, depending on the type of gadget, one need standard functions for init (), release () and the query/update of data structures during use of the gadget, which cannot be mapped by a single event. For example, I'm thinking of an audio equalizer that may contain 10 or 20 sliders or knobs. Of course, you can deliver an event called "Something has been changed" and the user will have to query all the controls individually, but maybe this can be solved more elegantly.

_________________
Excuse my bad english, my nativ language is german.
PB 5.62, OS: Windows 7 Pro x64, CPU: I7 6500, RAM: 8 GB, GPU: Intel Graphics HD 520
"Happiness is a pet." | "Never run a changing system!"
My current age: 50 years


Top
 Profile  
Reply with quote  
 Post subject: Re: Ultimate Canvas Gadget Library
PostPosted: Wed Feb 21, 2018 7:41 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Jun 11, 2006 12:07 am
Posts: 411
Location: Germany / one of the fishheads
Too bad, I think the idea is really good, but the thread will probably disappear within a short time.

Unfortunately, I still haven't become an expert on ownerdrawn gadgets, so I can't contribute anything worthy of a smart template.

In forums, such things also disappears quite quickly between the other posts. It would be desirable if there were an official and moderated STL (standard template library for gadgets and functions) for PureBasic, which can be reached directly on the PureBasic website. Something like the building blocks within the PureBasic IDE, but extending globally across all users.

_________________
Excuse my bad english, my nativ language is german.
PB 5.62, OS: Windows 7 Pro x64, CPU: I7 6500, RAM: 8 GB, GPU: Intel Graphics HD 520
"Happiness is a pet." | "Never run a changing system!"
My current age: 50 years


Top
 Profile  
Reply with quote  
 Post subject: Re: Ultimate Canvas Gadget Library
PostPosted: Wed Feb 21, 2018 8:23 pm 
Offline
Addict
Addict
User avatar

Joined: Fri May 12, 2006 6:51 pm
Posts: 1224
Location: Germany
I like modules for CustomGadgets (CanvasGadgets).
There have also been written some modules which are very good.
Take Thorsten's, for example.
Link: viewtopic.php?f=12&t=69707&hilit=toolbarex

Or as modules with interface (OOP)
Link: http://www.purebasic.fr/german/viewtopi ... olorGadget

You should create a thread' CustomGadget' with references to the modules.

One only has to agree on basic rules for the standard functions.


Translated with http://www.DeepL.com/Translator

_________________
My Projects OOP-BaseClass / OOP-BaseClassDispatch / Event-Designer /
PB v3.30 / v5.60 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye