cjr wrote:I'd like to create some custom controls (just composites of existing things, really) and it looks like designer has some support for doing this.
Eric Clayberg wrote:Here's an example project showing how to create custom property editors and customizers with Designer.
The example requires the latest v4.2.1 build.
cjr wrote:I noticed you've used Java 5 code. Is that a requirement of your custom control API, or was it just the way you decided to implement the examples?
Eric Clayberg wrote:Java 5 is not required in any way. If you are referring to the SWTResourceManager class
cjr wrote:I got the MyButton bean working OK, though cannot figure out how to use the MyButtonCustomizer class. Any clues?
cjr wrote:I note that a widget which extends a Composite (creating several native sub-widgets, say) simply gets drawn as a grey rectangle in design mode.
cjr wrote:Is there any way to change this? I'd like to be able to have the designer display something else (like some placeholder text) while in design mode, ideally without having to include custom paint code in code that we want to ship. If that isn't possible, is there some kind of "am_I_running_in_the_designer" test we can use to conditionally add our own paintListener?
cjr wrote:Is there a way to customize the default values of custom properties?
cjr wrote:We will need to build our custom widgets against your api_src code; are you intending to release new versions of this in conjunction with the designer? I'm wondering how best to manage this in our source tree.
Eric Clayberg wrote:Right-click on the widget and select Customize.... That will open whatever customizer has been defined for the class.
Eric Clayberg wrote:That sounds odd. The widget should look exactly the same in design time and at runtime. Are the sub-widgets statically defined, or are they created dynamically at runtime (so that they would not exist at design time)?
Eric Clayberg wrote:Designer supports the standard Beans.isDesignTime() check provided by the JDK. That should return true when your widget is running in Designer (or any GUI builder for that matter).
Eric Clayberg wrote:Did you try initializing the default values in your widget class itself?
Eric Clayberg wrote:All of the api_src is available in the plugins\com.swtdesigner_4.2.1\api_src directory. Any updates will always be in that directory and will match the associated Designer build. This public API is new to v4.2.1 and will almost certainly be enhanced in the future.
You can use the api_src code any way you like. You can copy it into yoru project (as was done with the example), or you could compile against the designer.jar as a prereq.
cjr wrote:While the Customize menu does appear on both Linux and Solaris, nothing seems to occur when you click it.
cjr wrote:They're all created statically. I'm confused that you think the widgets should look the same at design time and runtime (or when you click the test button), because AFAICS the design time display is a sort of non-native simulation of the widgets. They definitely do not look like GTK widgets at design time for instance on Linux/Solaris, though they do at test/runtime (following GTK themes and so on).
Eric Clayberg wrote:Do you have the Designer > General > Use Draft Mode preference turned on? Unless you have Draft Mode turned on, the widgets should look the same at design time and in test/preview mode.
Users browsing this forum: No registered users and 1 guest