About the label on button

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

About the label on button

serkan
Hi,

I have three questions may be someone have time can help.

1. What should be the default behavior of the button with label,  should extend width according to label width or two line button ?
    current is two line button.
   
     sample :
                            <mx:Button id="statuFilterButton" label="Select Filter" click="createAndShow();"/>

                           

2. When setting width according to label length; gives WARNING in compiler and exception in console but displays well, should i disregard ?
       
       sample :
                            <mx:Button id="statuFilterButton" width="{statuFilterButton.label.length}" label="Select Filter" click="createAndShow();"/>

                           
                          
                        
   
   
                                         

                    obj is string which is "Select Filter".

3. I have to get label from resources so it is dynamic. Or any other suggestions to calculate the width and set ?


Thanks,
Serkan
Reply | Threaded
Open this post in threaded view
|

Re: About the label on button

serkan
Reminder.

29.04.2020 14:10 tarihinde serkan yazdı:
Hi,

I have three questions may be someone have time can help.

1. What should be the default behavior of the button with label,  should extend width according to label width or two line button ?
    current is two line button.
   
     sample :
                            <mx:Button id="statuFilterButton" label="Select Filter" click="createAndShow();"/>

                           

2. When setting width according to label length; gives WARNING in compiler and exception in console but displays well, should i disregard ?
       
       sample :
                            <mx:Button id="statuFilterButton" width="{statuFilterButton.label.length}" label="Select Filter" click="createAndShow();"/>

                           
                          
                        
   
   
                                         

                    obj is string which is "Select Filter".

3. I have to get label from resources so it is dynamic. Or any other suggestions to calculate the width and set ?


Thanks,
Serkan

Reply | Threaded
Open this post in threaded view
|

Re: About the label on button

Alex Harui-2

Mx:Button should work like it did in Flex.  Might be a pixel or two difference, but mostly the same.

 

-Alex

 

From: serkan <[hidden email]>
Reply-To: "[hidden email]" <[hidden email]>, "[hidden email]" <[hidden email]>
Date: Wednesday, April 29, 2020 at 7:18 PM
To: "[hidden email]" <[hidden email]>
Subject: Re: About the label on button

 

Reminder.

29.04.2020 14:10 tarihinde serkan yazdı:

Hi,

I have three questions may be someone have time can help.

1. What should be the default behavior of the button with label,  should extend width according to label width or two line button ?
    current is two line button.
   
     sample :
                            <mx:Button id="statuFilterButton" label="Select Filter" click="createAndShow();"/>

                           

2. When setting width according to label length; gives WARNING in compiler and exception in console but displays well, should i disregard ?
       
       sample :
                            <mx:Button id="statuFilterButton" width="{statuFilterButton.label.length}" label="Select Filter" click="createAndShow();"/>

                           
                          
                        
   
   
                                         

                    obj is string which is "Select Filter".

3. I have to get label from resources so it is dynamic. Or any other suggestions to calculate the width and set ?


Thanks,
Serkan



Reply | Threaded
Open this post in threaded view
|

Re: About the label on button

serkan
Ok than it is better to create an issue.

Thanks

30.04.2020 05:59 tarihinde Alex Harui yazdı:

Mx:Button should work like it did in Flex.  Might be a pixel or two difference, but mostly the same.

 

-Alex

 

From: serkan [hidden email]
Reply-To: [hidden email] [hidden email], [hidden email] [hidden email]
Date: Wednesday, April 29, 2020 at 7:18 PM
To: [hidden email] [hidden email]
Subject: Re: About the label on button

 

Reminder.

29.04.2020 14:10 tarihinde serkan yazdı:

Hi,

I have three questions may be someone have time can help.

1. What should be the default behavior of the button with label,  should extend width according to label width or two line button ?
    current is two line button.
   
     sample :
                            <mx:Button id="statuFilterButton" label="Select Filter" click="createAndShow();"/>

                           

2. When setting width according to label length; gives WARNING in compiler and exception in console but displays well, should i disregard ?
       
       sample :
                            <mx:Button id="statuFilterButton" width="{statuFilterButton.label.length}" label="Select Filter" click="createAndShow();"/>

                           
                          
                        
   
   
                                         

                    obj is string which is "Select Filter".

3. I have to get label from resources so it is dynamic. Or any other suggestions to calculate the width and set ?


Thanks,
Serkan




Reply | Threaded
Open this post in threaded view
|

Re: About the label on button

Greg Dove

Hi Serkan,

For:
<mx:Button id="statuFilterButton" width="{statuFilterButton.label.length}" label="Select Filter" click="createAndShow();"/> 

The above doesn't seem right to me - whether the label is from a plain text or from a resource string. Why? width is set in pixels. But statuFilterButton.label.length is simply the number of chars in the String. So for the value 'Select Filter' it is assigning a width of 13px iiuc, which would be too small (perhaps it would be smaller than minWidth, not sure)

I'm guessing that you want it sized to content, so how is that happening in Flex? 
So, yes it will be good to create an issue with the original Flex behaviour and what is happening wrong instead in Royale (please use a literal string instead of resource string in your minimal repro).

Thanks
Greg
 


On Thu, Apr 30, 2020 at 3:05 PM serkan <[hidden email]> wrote:
Ok than it is better to create an issue.

Thanks

30.04.2020 05:59 tarihinde Alex Harui yazdı:

Mx:Button should work like it did in Flex.  Might be a pixel or two difference, but mostly the same.

 

-Alex

 

From: serkan [hidden email]
Reply-To: [hidden email] [hidden email], [hidden email] [hidden email]
Date: Wednesday, April 29, 2020 at 7:18 PM
To: [hidden email] [hidden email]
Subject: Re: About the label on button

 

Reminder.

29.04.2020 14:10 tarihinde serkan yazdı:

Hi,

I have three questions may be someone have time can help.

1. What should be the default behavior of the button with label,  should extend width according to label width or two line button ?
    current is two line button.
   
     sample :
                            <mx:Button id="statuFilterButton" label="Select Filter" click="createAndShow();"/>

                           

2. When setting width according to label length; gives WARNING in compiler and exception in console but displays well, should i disregard ?
       
       sample :
                            <mx:Button id="statuFilterButton" width="{statuFilterButton.label.length}" label="Select Filter" click="createAndShow();"/>

                           
                          
                        
   
   
                                         

                    obj is string which is "Select Filter".

3. I have to get label from resources so it is dynamic. Or any other suggestions to calculate the width and set ?


Thanks,
Serkan




Reply | Threaded
Open this post in threaded view
|

Re: About the label on button

Greg Dove

Please ignore that last email. I see you already created an issue - thanks!


On Thu, Apr 30, 2020 at 4:22 PM Greg Dove <[hidden email]> wrote:

Hi Serkan,

For:
<mx:Button id="statuFilterButton" width="{statuFilterButton.label.length}" label="Select Filter" click="createAndShow();"/> 

The above doesn't seem right to me - whether the label is from a plain text or from a resource string. Why? width is set in pixels. But statuFilterButton.label.length is simply the number of chars in the String. So for the value 'Select Filter' it is assigning a width of 13px iiuc, which would be too small (perhaps it would be smaller than minWidth, not sure)

I'm guessing that you want it sized to content, so how is that happening in Flex? 
So, yes it will be good to create an issue with the original Flex behaviour and what is happening wrong instead in Royale (please use a literal string instead of resource string in your minimal repro).

Thanks
Greg
 


On Thu, Apr 30, 2020 at 3:05 PM serkan <[hidden email]> wrote:
Ok than it is better to create an issue.

Thanks

30.04.2020 05:59 tarihinde Alex Harui yazdı:

Mx:Button should work like it did in Flex.  Might be a pixel or two difference, but mostly the same.

 

-Alex

 

From: serkan [hidden email]
Reply-To: [hidden email] [hidden email], [hidden email] [hidden email]
Date: Wednesday, April 29, 2020 at 7:18 PM
To: [hidden email] [hidden email]
Subject: Re: About the label on button

 

Reminder.

29.04.2020 14:10 tarihinde serkan yazdı:

Hi,

I have three questions may be someone have time can help.

1. What should be the default behavior of the button with label,  should extend width according to label width or two line button ?
    current is two line button.
   
     sample :
                            <mx:Button id="statuFilterButton" label="Select Filter" click="createAndShow();"/>

                           

2. When setting width according to label length; gives WARNING in compiler and exception in console but displays well, should i disregard ?
       
       sample :
                            <mx:Button id="statuFilterButton" width="{statuFilterButton.label.length}" label="Select Filter" click="createAndShow();"/>

                           
                          
                        
   
   
                                         

                    obj is string which is "Select Filter".

3. I have to get label from resources so it is dynamic. Or any other suggestions to calculate the width and set ?


Thanks,
Serkan




Reply | Threaded
Open this post in threaded view
|

Re: About the label on button

Alex Harui-2
In reply to this post by Greg Dove

He might need the binding so that the buttons get an initial size with no label and then may not resize correctly when binding assigns the label.

 

From: Greg Dove <[hidden email]>
Reply-To: "[hidden email]" <[hidden email]>
Date: Wednesday, April 29, 2020 at 9:22 PM
To: "[hidden email]" <[hidden email]>
Subject: Re: About the label on button

 


Hi Serkan,

 

For:

<mx:Button id="statuFilterButton" width="{statuFilterButton.label.length}" label="Select Filter" click="createAndShow();"/> 

 

The above doesn't seem right to me - whether the label is from a plain text or from a resource string. Why? width is set in pixels. But statuFilterButton.label.length is simply the number of chars in the String. So for the value 'Select Filter' it is assigning a width of 13px iiuc, which would be too small (perhaps it would be smaller than minWidth, not sure)

 

I'm guessing that you want it sized to content, so how is that happening in Flex? 

So, yes it will be good to create an issue with the original Flex behaviour and what is happening wrong instead in Royale (please use a literal string instead of resource string in your minimal repro).

 

Thanks

Greg

 

 

 

On Thu, Apr 30, 2020 at 3:05 PM serkan <[hidden email]> wrote:

Ok than it is better to create an issue.

Thanks

30.04.2020 05:59 tarihinde Alex Harui yazdı:

Mx:Button should work like it did in Flex.  Might be a pixel or two difference, but mostly the same.

 

-Alex

 

From: serkan [hidden email]
Reply-To: [hidden email] [hidden email], [hidden email] [hidden email]
Date: Wednesday, April 29, 2020 at 7:18 PM
To: [hidden email] [hidden email]
Subject: Re: About the label on button

 

Reminder.

29.04.2020 14:10 tarihinde serkan yazdı:

Hi,

I have three questions may be someone have time can help.

1. What should be the default behavior of the button with label,  should extend width according to label width or two line button ?
    current is two line button.
   
     sample :
                            <mx:Button id="statuFilterButton" label="Select Filter" click="createAndShow();"/>

                           

2. When setting width according to label length; gives WARNING in compiler and exception in console but displays well, should i disregard ?
       
       sample :
                            <mx:Button id="statuFilterButton" width="{statuFilterButton.label.length}" label="Select Filter" click="createAndShow();"/>

                           
                          
                        
   
   
                                         

                    obj is string which is "Select Filter".

3. I have to get label from resources so it is dynamic. Or any other suggestions to calculate the width and set ?


Thanks,
Serkan