[ZeroBrane Studio] Re: Snippets Pane

  • From: "Steve Russell" <steve.russell@xxxxxxxxxxxxxxxxxxxxx>
  • To: <zerobrane@xxxxxxxxxxxxx>
  • Date: Wed, 8 Oct 2014 09:12:39 +0100

Solved it myself.  I copied much of the AddPanel() function to my package and I 
can add what I want to the panel.  I used the wxLuaEditor/wxLua control demo 
Lua application as a guide.  Great framework.

Steve

-----Original Message-----
From: zerobrane-bounce@xxxxxxxxxxxxx [mailto:zerobrane-bounce@xxxxxxxxxxxxx] On 
Behalf Of Steve Russell
Sent: 07 October 2014 09:45
To: zerobrane@xxxxxxxxxxxxx
Subject: [ZeroBrane Studio] Re: Snippets Pane

Hi Paul,

I had some success with this - I could add a single ListCtrl to a panel using 
the technique you mentioned.  I'm struggling to see how I can add other items 
to the panel though - I'd like a couple of panels, a button and a text input.

Is there another "AddPanel" api that allows a sizer type container and other 
widgets to be added?

Steve

-----Original Message-----
From: zerobrane-bounce@xxxxxxxxxxxxx [mailto:zerobrane-bounce@xxxxxxxxxxxxx] On 
Behalf Of Paul K
Sent: 26 September 2014 21:02
To: zerobrane@xxxxxxxxxxxxx
Subject: [ZeroBrane Studio] Re: Snippets Pane

Hi Steve,

> Is what I’m attempting possible?

Should be possible, but I recommend using ide:AddPanel method; everything in 
the src/package.lua is a public API and is much less likely to change than 
using other (internal) functions/methods in ZBS.

You can use ide:AddPanel(tagCtrl, "tagpanel", "Tag") to add your control a a 
panel.

> I didn’t see any mention of adding a new window so I attempted to 
> duplicate all > occurrences of the Watch pane by duplicating existing 
> “Watch” related items, > e.g. watchCtrl->tagCtrl, 
> ID_ADDWATCH->ID_ADDTAG,

> I don’t understand why wx.wxEVT_COMMAND_MENU_SELECTED is no longer valid.

The reason you are getting this error is that you probably didn't register 
ID_ADDTAG, ID_EDITTAG and other IDs. You need to create them using "ID_ADDTAG = 
ID('mytagplugin.addtag')" code; the string you give to ID() has to be unique, 
so it's recommended for it to include a plugin name as a prefix.

I highly recommend to initially make any changes as a plugin. There is a 
variety of API calls that can be used from plugins with about 50 plugins 
already in the repository
(https://github.com/pkulchenko/ZeroBranePackage) and I've integrated ZBS with 
several products using plugin API (and I can extend it if something is missing).

Paul.



Other related posts: