On Thu, Jan 5, 2012 at 3:25 PM, Derrell Lipman <
[email protected]> wrote:
> On Thu, Jan 5, 2012 at 18:03, Scott Chapman <[email protected]> wrote:
>
>> The following tab has two labels and two tables in it. The tables
>> stretch to the full width of the tab. How do I prevent that? I set their
>> width to 241 below.
>>
>> I'm new to this coding. So feel free to give me a code review and send
>> any other pointers you think appropriate on how I've put this together.
>>
>> Thanks!
>> Scott
>>
>>
>> qx.Class.define("test1.KioskTab",
>> {
>> extend : qx.ui.tabview.Page,
>> construct : function()
>> {
>> var label = arguments[0];
>> var host_id = arguments[arguments.length -1];
>>
>
> So you're allowing an arbitrary number of arguments, but using only the
> first one and the last one? Seems strange. You could have declared your
> function as construct : function(label, host_id) to avoid this. Maybe you
> have some reason for allowing other arguments?
>
What I really want is to be able to handle all the original parameters for
the function (label and icon) plus hostname.
I'm not sure how best to do that. My current method would allow that to
work but I wouldn't be passing the icon on to the superclass construct.
>
>
>> this.base(arguments);
>> this.setLabel(label);
>> this.setUserData("host_id", host_id);
>> this.setUserData("label", label);
>>
>
> Since you're creating your own class, instead of using user data to store
> host_id and label, you could instead add a members section after your
> construct function:
>
> members :
> {
> host_id : null,
> label : null
> }
>
> and then here in the constructor, simply do:
>
> this.host_id = host_id;
> this.label = label;
>
> which allows later accessing those directly rather than with getUserData().
>
> Alternatively, if you don't want to expose member variables, you might
> instead create these as properties:
>
> properties :
> {
> hostId :
> {
> check : "Integer"
> init : null
> },
>
> label :
> {
> check : "String"
> init : null
> }
> }
>
> and then in the constructor:
>
> this.setHostId(host_id);
> this.setLabel(label);
>
Thanks. Good suggestions. I'll use 'em.
>
>> this.__kioskCheckinAgeTable = new test1.KioskCheckinAgeTable().set({
>> decorator: null,
>> height: 20,
>> width: 241
>>
>
> If you really want the table to take up NO MORE than 241 pixels, you
> should try adding:
> maxWidth : 241
>
> The 'width' property is a "preferred width" while 'minWidth' and
> 'maxWidth' impose strict limits.
>
I'm still climbing learning curve on layout issues. They are tricky.
maxWidth worked great.
Thanks for all your help!
Scott
------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual
desktops for less than the cost of PCs and save 60% on VDI infrastructure
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel