Martin Dobias wrote:
>> - I was not able to 'enable' my plugin button, aka: make it a little
>> darker so you know that you're still in the xyz-mode. Can somebody point
>> me to such an example, or are plugins not supposed to work like this?
> 
> I don't get what you mean. Could you explain it?

My  'problem': I've build a sort of XY-Info tool plugin, like the raster 
info plugin in the repository. But mine is suppossed to be a tool like 
the zoom tool, or the select tool: you click on the tool/plugin-button, 
the button gets activated/surpressed/darker, and keeps in that state 
until you select one of the other (zoom, select or info) tools. Current 
plugin-buttons do not get 'activated', when you click the plugin button 
it doesn't stay visually(!)'active', it's a clickclack button.

...

> Actually, using plugin installer you can get already to some very
> simple plugins. Copyright plugin is an example of plugin which shows
> you a dialog for settings, Aaron's recent Raster info plugin is an
> example which uses map canvas (and its own map tool).
> But definitely there could be a simple example plugin in QGIS sources
> that would be ready to be used. Volunteers? :)
> Well, but you still must know Qt to do anything more complicated than
> just a hello world plugin.

I'm a sort of beginner. Using the copyright plugin I hacked by the 
html-image-map tool (which is in the repository) using trial and error, 
and was able to use Qt etc etc (see http://www.duif.net/qgis).
But still some details were not clear for me: for example it's not clear 
for me if you must make a new 'tool' when you want to make a plugin 
which does something with a click in the mapcanvas. Another question is 
the one about keeping a button 'activated'.
My idea is to make some 'plugin-stubs' for different kind of simple 
plugins: eg starting with a very simple plugin which does not have an 
interaction with the map, to a tool like the xy-info tool which must 
handle a mouse click, and finally your copyright-plugin which was really 
helpful for me.
But maybe a plugin stubb is not what I'm looking for: it's either to 
complicated because you want to make it technically useful, or it's to 
simple to be functionally useful. The idea was to hand beginners the 
first steps to to a really easy plugin.
But maybe we need a code-snippets wiki page with questions like:
- I want to keep de plugin button activated
- I want to get hold of the active geometries of the active layer
- I want to loop through all geometries of this layer
- How do I test the type of a geometry
- How do I make pixel coordinates from world coordinates and vice versa
- How can I add a label to a (new) layer
- How can I add a new geometry to a layer
- How can I keep some project info by writing it to a project file
etc etc.
... I should start this page myself maybe ...

Thanks, and people should really look into the blog and wiki for your 
examples, they are really helpful!

Regards
Richard Duivenvoorde

ps (referring to my buffer questions a while a go) if you point me to
some 'easy' buffer algorithms, I'm ready to give C++ a try :-)  )
_______________________________________________
Qgis-user mailing list
Qgis-user@lists.qgis.org
http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-user

Reply via email to