Paint custom button problem

Hi, I have a custom button that must be next to a labelfield.

The paint of the button code is:

 protected void paint(Graphics graphics) {

   graphics.drawBitmap(13, 0, fieldWidth, fieldHeight, button, 0, 0,);

}

Where '13' is the space between labelfield and button. But when the font size is larger, the result is the following: [IMG]http://i34.tinypic.com/xeq2hu.jpg[line]

The button is cut off and other times, its even more. What could be a solution?

Thanks in advance.

A HorizontalFieldManager defines the fields from left to right, it only wraps to the next line.  You can use a FlowFieldManager to achieve that has the fields from left to right, then on the next line below.

Tags: BlackBerry Developers

Similar Questions

  • Development/unfocus field custom button problem

    Hi all

    I have something weird happens.  I have a custom button field that swaps the images based on a focused state or blur.  I have been using this field custom for awhile now, and I have never had any problems.  Imagine the following provision:

    ______________    ________________________

    | Custom button |    | BasicEditField |

    ------------------------    ------------------------------------------

    When my screen is launched, the focus is on the custom button.  If I move the trackball in a downward movement, the focus is taken the custom button, and its background image changes adequately to what has been defined in the untargeted State.  The BasicEditField then has the focus.  This is the correct behavior.

    If, however, I move the trackball in a movement to the right to the BasicEditField, then the BasicEditField will indeed get the focus, however the custom button field always displays its "highlight" picture  Using print statements, I was able to determine that when I move in a movement to the right with the trackball, the custom field button loses the focus and then gets the focus back to back, that's why it shows the highlighted image.

    Additional info:  This isn't an issue on touch devices, and custom button Manager is a TableLayoutManager.

    Any ideas why this might be happening?  Here's the code to my custom button field:

    public class BitmapButtonField extends Field {
        private String text = "";
        private Bitmap bitmap;
        private Bitmap bitmapHighlight;
        private Bitmap b;
        private boolean highlighted;
    
        public BitmapButtonField(String image, String imageHighlight, long style) {
    
            super(style | Field.FOCUSABLE);
    
            this.bitmap = Bitmap.getBitmapResource(image);
            this.bitmapHighlight = Bitmap.getBitmapResource(imageHighlight);
    
            b = bitmap;
    
        }
    
        public BitmapButtonField(String text, String image, String imageHighlight,
                long style) {
    
            super(style | Field.FOCUSABLE);
    
            this.text = text;
            this.bitmap = Bitmap.getBitmapResource(image);
            this.bitmapHighlight = Bitmap.getBitmapResource(imageHighlight);
    
            b = bitmap;
    
        }
    
        protected void drawFocus(Graphics graphics, boolean on) {
            // Do nothing
        }
    
        public int getPreferredHeight() {
            return bitmap.getHeight();
        }
    
        public int getPreferredWidth() {
            return bitmap.getWidth();
        }
    
        protected void layout(int width, int height) {
            setExtent(getPreferredWidth(), getPreferredHeight());
        }
    
        protected boolean navigationClick(int status, int time) {
            fieldChangeNotify(1);
            return true;
        }
    
        protected void onFocus(int direction) {
            b = bitmapHighlight;
            invalidate();
            System.out.println("FOCUSED");
    
        }
    
        protected void onUnfocus() {
            b = bitmap;
            invalidate();
            System.out.println("UNFOCUSED");
        }
    
        protected void paint(Graphics graphics) {
    
            int topTextPadding = (b.getHeight() - getFont().getHeight()) / 2;
            int sideTextPadding = (b.getWidth() - getFont().getAdvance(text)) / 2;
    
            graphics.drawBitmap(0, 0, getWidth(), getHeight(), b, 0, 0);
            graphics.setColor(Color.WHITE);
            if (text.length() > 0) {
                graphics.drawText(text, sideTextPadding, topTextPadding,
                        Graphics.ELLIPSIS, b.getWidth());
            }
        }
    }
    

    Have you looked at navigationMovement in the TableLayoutManager?  I confess that I rewrote it because it handles no left and right as I wanted.  Perhaps, you might be able to do the same thing.

  • Custom button problem (is the closure of a popup and it shouldn't)

    Hello.

    In my ADF, 11.1.1.7.0 JDeveloper application, I have a popup with its dialogue and its default buttons "Ok" and "Cancel".

    In addition to this, I put a custom command button. I want it, when it is selected, go to the server, do things in a method and return to the open popup.

    The fact is that, when you click the custom button, the method is executed (action or actionListener, I tested both), but popup closes immediately.

    So, I have to reopen the popup to see the actions performed.

    How can I avoid the popup gets closed when clicking this custom button?

    Thanks in advance.

    AutoCancel = disabled on the popup property set. It will not close the popup.

    Thank you

  • Custom button on a touch paint problem

    I have a custom button that I use to the pop-up window of a PopupScreen. The custom button has his own painting methods (he also replaces the applyTheme() method), and for the most part, everything works as expected.

    The only problem I have is when the button is pressed. If I press and hold the button, the button is redrawn with what seems to be the default paint scheme (it seems that it is painted without label as well). As soon as I release the button and the context menu is displayed, the button is redrawn with my custom methods and look as I hope.

    Suggestions appreciated, thanks!

    If navigationClick is treated by default? This is the root of the problem: I think that integrated ButtonField.navigationClick defines the Visual status of the "active" field Replace to do what you want it to do and do not call super.navigationClick (well, call of may when the status parameter is not 0 - in the case of Alt-click and make shift-click - and you don't want to deal with yourself).

  • Problem with fieldChanged() and custom button field

    Hello

    I created a custom button class by extending LabelField.  I chose LabelField over field because the LabelField contains desirable properties that are already being implemented.  The only problem I'm having has to do with the change listener.  It seems to 'steal' the event click on other areas in my application.

    For example, when I click on the custom button, a popupscreen with a listfield opens. When I click on an item in the listfield, then the fieldChanged() of custom button is called again...

    Can you see anything wrong with my code?

    package com.rantnetwork.fields;
    
    import com.rantnetwork.app.Constants;
    import net.rim.device.api.system.Display;
    import net.rim.device.api.ui.Color;
    import net.rim.device.api.ui.Field;
    import net.rim.device.api.ui.Font;
    import net.rim.device.api.ui.Graphics;
    import net.rim.device.api.ui.Ui;
    import net.rim.device.api.ui.XYEdges;
    import net.rim.device.api.ui.component.LabelField;
    import net.rim.device.api.ui.decor.BackgroundFactory;
    import net.rim.device.api.ui.decor.BorderFactory;
    
    public class CustomButtonField extends LabelField {
    
        private boolean highlighted = false;
    
        public CustomButtonField(String text, long style) {
            super(text, style | Field.FOCUSABLE | LabelField.ELLIPSIS);
    
            setPadding(10, 0, 10, 5);
    
            setFont(Font.getDefault().derive(Font.BOLD,
                    Constants.DEFAULT_FONT_SIZE, Ui.UNITS_pt));
    
            setBackground(BackgroundFactory.createLinearGradientBackground(
                    0x163d7c, 0x163d7c, 0x03162d, 0x03162d));
            setBorder(BorderFactory
                    .createBevelBorder(new XYEdges(1, 1, 1, 1), new XYEdges(
                            Color.BLACK, Color.BLACK, Color.BLACK, Color.BLACK),
                            new XYEdges(Color.BLACK, Color.BLACK, Color.BLACK,
                                    Color.BLACK)));
    
        }
    
        public int getPreferredWidth() {
            return Display.getWidth() / 3;
        }
    
        protected void paint(Graphics graphics) {
            graphics.setColor(Color.WHITE);
            super.paint(graphics);
        }
    
        protected void drawFocus(Graphics graphics, boolean on) {
            // Do nothing
        }
    
        protected boolean navigationClick(int status, int time) {
            fieldChangeNotify(1);
            return true;
        }
    
        protected void onFocus(int direction) {
            if (!highlighted) {
                setBackground(BackgroundFactory.createLinearGradientBackground(
                        0x4bb7df, 0x4bb7df, 0x1b96da, 0x1b96da));
                setBorder(BorderFactory.createBevelBorder(new XYEdges(1, 1, 1, 1),
                        new XYEdges(Color.BLACK, Color.BLACK, Color.BLACK,
                                Color.BLACK), new XYEdges(Color.BLACK, Color.BLACK,
                                Color.BLACK, Color.BLACK)));
            }
        }
    
        protected void onUnfocus() {
            if (!highlighted) {
                setBackground(BackgroundFactory.createLinearGradientBackground(
                        0x163d7c, 0x163d7c, 0x03162d, 0x03162d));
                setBorder(BorderFactory.createBevelBorder(new XYEdges(1, 1, 1, 1),
                        new XYEdges(Color.BLACK, Color.BLACK, Color.BLACK,
                                Color.BLACK), new XYEdges(Color.BLACK, Color.BLACK,
                                Color.BLACK, Color.BLACK)));
            }
        }
    
        public void showHighlighted(boolean focus) {
            if (focus) {
                highlighted = true;
                setBackground(BackgroundFactory.createLinearGradientBackground(
                        0x4bb7df, 0x4bb7df, 0x1b96da, 0x1b96da));
                setBorder(BorderFactory.createBevelBorder(new XYEdges(1, 1, 1, 1),
                        new XYEdges(Color.BLACK, Color.BLACK, Color.BLACK,
                                Color.BLACK), new XYEdges(Color.BLACK, Color.BLACK,
                                Color.BLACK, Color.BLACK)));
            } else {
                highlighted = false;
                setBackground(BackgroundFactory.createLinearGradientBackground(
                        0x163d7c, 0x163d7c, 0x03162d, 0x03162d));
                setBorder(BorderFactory.createBevelBorder(new XYEdges(1, 1, 1, 1),
                        new XYEdges(Color.BLACK, Color.BLACK, Color.BLACK,
                                Color.BLACK), new XYEdges(Color.BLACK, Color.BLACK,
                                Color.BLACK, Color.BLACK)));
            }
            invalidate();
        }
    
        public boolean isHighlighted() {
            return highlighted;
        }
    
    }
    

    behrk2 wrote:

    Now, I'm not sure why customButton.setText (calling) would trigger the fieldChanged().  Can anyone think of a reason why he can do?

    Thank you!

    Can you think of a reason why we can't do that? The field has changed, after all! Of course, the context (second argument to fieldChanged) will be PROGRAMMATIC in this case, that might be a pretty good indication for you. But not invoke fieldChanged at all would be wrong.

    This is why I don't like the idea of extending LabelField and not just the field for your custom badges - you have much less control over his behavior. If you want an example showing how to create abstract off-screen buttons, take a look at BaseButtonField and his descendants in managers, fields and advanced buttons.

  • Problems of creation of custom buttons

    Hello, I'm trying to create three custom buttons here in my application's main window.  I did a CustomButtonField class to try to change around the colors and size, but when I run my application no buttons appear in my application?  What I am doing wrong?

    Help, please.

    The main window class.

    import net.rim.device.api.system.Bitmap;
    import net.rim.device.api.ui.Color;
    import net.rim.device.api.ui.Field;
    import net.rim.device.api.ui.FieldChangeListener;
    import net.rim.device.api.ui.Font;
    import net.rim.device.api.ui.FontFamily;
    import net.rim.device.api.ui.MenuItem;
    import net.rim.device.api.ui.Ui;
    import net.rim.device.api.ui.UiApplication;
    import net.rim.device.api.ui.component.ButtonField;
    import net.rim.device.api.ui.component.Dialog;
    import net.rim.device.api.ui.component.Menu;
    import net.rim.device.api.ui.container.MainScreen;
    import net.rim.device.api.ui.container.VerticalFieldManager;
    import net.rim.device.api.ui.decor.Background;
    import net.rim.device.api.ui.decor.BackgroundFactory;
    
    public class MainPage_Recipes extends MainScreen
    {
    
        private VerticalFieldManager _manager ;
        CustomButtonField findButton;
        CustomButtonField submitButton;
        CustomButtonField aboutButton;
    
        public MainPage_Recipes()
        {
    
            try
            {
    
                 FontFamily Global = FontFamily.forName("BBGlobal Serif");
                 Font appFont = Global.getFont(Font.PLAIN, 8, Ui.UNITS_pt);
                 setFont(appFont);
    
                 Bitmap labelImage =  Bitmap.getBitmapResource("chef2.png");
    
                 add(new CustomLabelField ("Find A Recipe", Color.WHITE, 0xff0000, labelImage, Field.USE_ALL_WIDTH));
    
                 _manager = (VerticalFieldManager)getMainManager();
    
                 Background bg = BackgroundFactory.createSolidBackground(0x00DDDDDD);
                 _manager.setBackground(bg);
    
                 FieldChangeListener findCan = new FieldChangeListener()
                    {
                        public void fieldChanged(Field field, int context)
                        {
                            findRecipe find = new findRecipe();
                            UiApplication.getUiApplication().pushScreen(find);
                        }
                    };
                 FieldChangeListener submitCan = new FieldChangeListener()
                    {
                        public void fieldChanged(Field field, int context)
                        {
                            submitRecipe submit = new submitRecipe();
                            UiApplication.getUiApplication().pushScreen(submit);
                        }
                    };
                 FieldChangeListener aboutCan = new FieldChangeListener()
                    {
                        public void fieldChanged(Field field, int context)
                        {
                            aboutApp about = new aboutApp();
                            UiApplication.getUiApplication().pushScreen(about);
                        }
                    };
    
                 findButton = new CustomButtonField(" Find Recipe ", Color.WHITE, Color.BLACK, Field.FIELD_HCENTER);
                 findButton.setChangeListener(findCan);
                 submitButton = new CustomButtonField(" Submit Recipe ", Color.WHITE, Color.BLACK, Field.FIELD_HCENTER);
                 submitButton.setChangeListener(submitCan);
                 aboutButton = new CustomButtonField(" About ", Color.WHITE, Color.BLACK, Field.FIELD_HCENTER);
                 aboutButton.setChangeListener(aboutCan);
    
                 _manager.add(findButton);
                 _manager.add(submitButton);
                 _manager.add(aboutButton);
    
                 add(_manager);
    
            }
            catch(Exception e)
            {
    
            }
        }
        protected void makeMenu(Menu menu, int instance)
        {
    
            menu.add(_close);
            menu.add(_cancel);
    
        }
        private MenuItem _close = new MenuItem("Close", 110, 10)
        {
            public void run()
            {
    
                Dialog.alert("Goodbye!");
    
                System.exit(0);
    
            }
        };
        private MenuItem _cancel = new MenuItem("Cancel", 110, 10)
        {
            public void run()
            {
    
            }
        };
    
    }
    

    Class CustomButtonField:

    import net.rim.device.api.ui.Field;
    import net.rim.device.api.ui.Graphics;
    
    public class CustomButtonField extends Field
    {
        private String label;
        private int backgroundColor;
        private int foregroundColor;
    
        public CustomButtonField(String label, int foregroundColor,
                int backgroundColor, long style)
        {
            super(style);
            this.label = label;
            this.foregroundColor = foregroundColor;
            this.backgroundColor = backgroundColor;
    
        }
        public int getPreferredHeight()
        {
            return getFont().getHeight() + 8;
        }
    
        public int getPrefferedWidth()
        {
            return getFont().getAdvance(label) + 8;
        }
    
        protected void layout(int width, int height)
        {
            setExtent(Math.min(width, getPreferredWidth()), Math.min
                    (height, getPreferredHeight()));
    
        }
        protected void paint(Graphics graphics)
        {
            graphics.setColor(backgroundColor);
            graphics.fillRoundRect(1, 1, getWidth()-2, getHeight()-2, 12, 12);
            graphics.setColor(foregroundColor);
            graphics.drawText(label, 4, 4);
        }
        public boolean isFocusable()
        {
            return true;
        }
    }
    

    Help, please.

    Thank you

    Scientist

    Hi, I discovered very pblm is

    This.getPrefferedWidth usage and height, I think you will get it.

    protected void layout(int width, int height)     {     // TODO Auto-generated method stub        this.setExtent(this.getPrefferedWidth(),this.getPreferredHeight());   }
    

    Concerning

    Rakesh Shankar.P

  • Custom skin of RH9 WebHelp: problem opening PDF of custom button

    Hi, I have been troubleshooting and audit forums, trying to figure out how to get a PDF file to open it from a custom button on my skin to WebHelp. This worked for me once, but I changed something in the document and tried to download the new version and there out wrong since then.

    PDF Issue 2.png

    I want to be able to open the PDF file in a new window and the custom button (called 'Printable PDF' on my skin), so I use the JavaScript code customized in the field "click on" the components of the custom button: window.open ('print_test.pdf "printWindow," "," menu bar = 0, resizable = 0, width = 900, height = 500, scr ollbars = 1');  I know that the script is good because I have the same script for custom support button and it works fine. The only difference between these scripts is the support script calls a .html instead of a PDF file and the names of window says "supportWindow" instead of "printWindow.

    .PDF Issue.png

    I tried to delete and recreate the custom button, change the JavaScript with the help of the developer, generating assistance on another machine, thinking it was a little problem with my browser (using IE8) or license RoboHelp and comb through the help files for many times. I also made sure that the PDF file is stored in project and records of the skin as well as the other project files/files. I have used previous versions of RoboHelp and had no problem attaching a document Word and PDF, so I wonder if it is a bug in RH9? So much more than that worked for me at first. Any help or ideas are welcome! Thank you!

    Hello again

    Try disabling MOTW and generate again. Test it and jump through the hoops THAT MOTW you don't have to jump through. (Yellow information and stuff toolbar)

    My guess is that MOTW is inhibiting things. Once you publish this content on a server, you should be good.

    See you soon... Rick

    Useful and practical links

    Wish to RoboHelp form/Bug report form

    Begin to learn RoboHelp HTML 7, 8 or 9 in the day!

    Adobe Certified RoboHelp HTML Training

    SorcerStone blog

    RoboHelp EBooks

  • Changing custom field problem Listener

    I created a custom field that works as a button. He painted a bitmap to the screen. And when it focuses it changes the color of the image. However, I try to add a field change listener to it. I looked on the forum and found this code.

    protected boolean navigationClick(int status, int time)
    {
         fieldChangeNotify(1);
         return super.navigationClick(status, time);
    }
    

    It works but I have a problem. You see, my button now push a small screen, thin in the stack that has another button of the same type on it (custom button). At the moment it is the only button on this screen, which means that it has the focus. But it seems that once my button has the focus, I can click anywhere and it is always enabled. I only want to be activated when I touch it. Any suggestions? Here is my code

    public class MenuButtonField extends Field
    {
        Bitmap imagePic;
        Bitmap highlightedPic;
        public MenuButtonField(String imageName, String focusedImg)
        {
            super();
            imagePic=Bitmap.getBitmapResource(imageName);
            highlightedPic=Bitmap.getBitmapResource(focusedImg);
        }
    
        public void layout(int width,int height)
        {
            setExtent(20,80);
        }
    
        public boolean isFocusable()
        {
            return true;
        }
    
        public void drawFocus(Graphics graphics, boolean on)
        {
            paint(graphics);
        }
    
        public boolean touchEvent(TouchEvent message)
        {
            int type=0;
            type=message.getEvent();
            if(type==TouchEvent.CLICK)
            {
                fieldChangeNotify(1);
                return true;
            }
            else{
                return false;
            }
        }
    
        protected boolean navigationClick(int status, int time) {
            fieldChangeNotify(1);
            return super.navigationClick(status, time);
        }
    
        protected void paint(Graphics g)
        {
    
            g.drawBitmap(0, 20, 20, 80, imagePic, 0, 0);
    
            if(this.isFocus())
            {
                g.drawBitmap(0, 20, 20, 80, highlightedPic, 0, 0);
            }
    
        }
    }
    

    PLEASE HELP ME

    I found help here
    http://supportforums.BlackBerry.com/T5/Java-development/navigationClick-invoked-when-clicking-outsid...

    The position of Scribe the Lion was the solution.

  • Custom button field has two tops?

    I am trying to create a field of custom button so that I can have two lines of text - but I'm getting a second top so say (a second box with the shading/etc that has the top of a field of button).

    Here's a screenshot of it

    The bottom button is just a normal button.

    Field of custom button code:

    package com.smartmech.bb;
    
    import net.rim.device.api.system.Display;
    import net.rim.device.api.ui.Color;
    import net.rim.device.api.ui.Font;
    import net.rim.device.api.ui.Graphics;
    import net.rim.device.api.ui.Ui;
    import net.rim.device.api.ui.component.ButtonField;
    
    public class _customButtonField extends ButtonField {
            private int setWidth;
            private int setHeight;
            private boolean disabled = false;
            private String lblTxt1;
            private String lblTxt2 = "";
    
            _customButtonField( String text, int Width, int Height, long setStyle) {
                super(text, setStyle);
                setWidth = Width;
                setHeight = Height;
                lblTxt1 = text;
            } //customButtonField
    
            _customButtonField( String text, String text2, int Width, int Height, long setStyle) {
                super("",setStyle);
                setWidth = Width;
                setHeight = Height;
                lblTxt1 = text;
                lblTxt2 = text2;
            } //customButtonField
    
            public int getPreferredWidth() {
                return setWidth;
            } //getPreferredWidth
    
            public int getPreferredHeight() {
                return setHeight;
            } //getPreferredWidth
    
            public boolean isFocusable() {
                if(disabled)
                    return false;
                return true;
            } //isFocusable
    
            public void disable() {
                disabled=true;
                super.setVisualState(ButtonField.VISUAL_STATE_DISABLED);
            } //disable
    
            public void enable() {
                disabled=false;
                super.setVisualState(ButtonField.VISUAL_STATE_NORMAL);
            } //enable
    
            protected void layout(int width, int height) {  
    
                String platform = net.rim.device.api.system.DeviceInfo.getPlatformVersion();
    
                if (platform.substring(0,1).equals("5")) {
                    setExtent(setWidth, setHeight); //works in v5
                }
                else if (platform.substring(0,1).equals("6")) {
                    super.layout(setWidth, setHeight);
                    //setExtent(setWidth, setHeight);
                }
    
            } //layout
    
            protected void paint(Graphics g){
    
                super.paint(g);
    
                if (lblTxt2 != "") {
    
                    int myY = getPreferredHeight() / 2;
                    int myX = 0;
    
                    int myFH = g.getFont().getHeight();
                    if (myFH * 2 > getPreferredHeight()) {
                        myY = getPreferredHeight() - myFH;
                    }
                    myX = (getPreferredWidth() - g.getFont().getBounds(lblTxt1)) / 2;
                    g.drawText(lblTxt1, myX,0,0,this.getWidth());
    
                    myX = (getPreferredWidth() - g.getFont().getBounds(lblTxt2)) / 2;
                    g.drawText(lblTxt2, myX,myY,0,this.getWidth());
    
                } //lblTxt2 not blank
    
            } //paint
    
    } //customButtonField
    

    And call it:

    _customButtonField summaryBtn = new _customButtonField("Location", "Summary", btnWidth, btnHeight, ButtonField.CONSUME_CLICK);
     summaryBtn.setFont(mainFont);
    

    Any ideas as to why this is happening?

    Greetings.

    I agree with simon. And that's because you're going to have to completely override the paint method to reach your goal.

    Try stretching the field and drawing and layout of all within your class.

  • How can I design a custom button that has three lines of text in the button itself?

    A matter of design, which is a good implementation of the following? I need to create a custom button that looks like:

     -----------
    | Header    |
    | Subheader |
    | Text      |
     -----------
    

    I know that I can not add a VerticalFieldManager or add any field of a ButtonField, but if I create a custom, button how I would create three lines of text similar to having three LabelFields lined up in a VerticalFieldManager?

    Thank you.

    You can create a focusable multiline field label creation with the bit style FOCUSABLE and with newline characters in its text. It is possible to work a bit like a button field (substitute navigationClick / navigationUnclick to perform the action or, better yet, to call fieldChangeNotify so that you can plug into the field with a FieldChangeListener).

    Use RichTextField rather than LabelField if you want to play with fonts (say, "BOLD" underlined header; italic subheader; normal text).

    If you want rounded corners and other effects, override the paintBackground method or painting of the field (don't forget to call the super.paint, if you go with the latter).

    That being said - that there is no single best design, so feel free to browse the forums (research of "multiline" or "multiline" yields quite a few results) and come up with your own ideas.

  • I want to use a custom button photoshop with my composition and have the substitution effect

    I'm trying to put a button in photoshop in a blank publication widget trigger. When I cut an paste the image into the trigger, he loses his robot and switches are no longer the colors during the reversal. It works very well in the composition of the lightbox, but the problem with lightbox composition, is there no working capital options to display click only target. How to work around this problem. I want to have my own custom button with the effect of composition within the cc muse.

    You should check the design layout and defined States for relaxation, if the State is set correctly then it should show the rollover State, but the container target corresponding to the relaxation is on the page, then it could show you the active State not the rollover State.

    Thank you

    Sanjit

  • Custom button that creates another object in its parent

    I have a function that creates an instance of a custom class that extends of button inside a BorderContainer using MyBorderContainer.addElement ().  It seems to work very well.  What I would like is for the custom button (which it will be several created) in order to create a panel inside the same BorderContainer.  This is the class for the custom button:

    [quote] / public class MySpecialButton extends button

    {

    private var NewPanel:Panel = new Panel();

    public void MySpecialButton()

    {

    this.setStyle ("skinClass", MySpecialButtonSkin);

    }

    override the clickHandler(event:MouseEvent):void function

    {

    this.parent.addChild (NewPanel);

    }

    } [/ quote]

    I get no errors or warnings, it just seems to get hung on the line, addChild.  I worked on this problem for a while now and I'm stuck.  Any ideas?

    I think the parent panel should be responsible for adding the new Panel.  And also, why you override clickHandler?  Try to take responsibility for adding children to the parent of the key and try to add the parent of ITTO.  Here is some pseudo-code of what I speak.

    public function buttonClicked (event: Event): void

    {

    var newPanel:NewPanel = new NewPanel();

    addElement (newPanel);

    }

    .....

    Sincerely,

    Ubu

  • Custom button



    Hello

    I'm putting a custom button (jump button 2) to link to a URL (HTML_Help layout). The
    the address is https://sitename. It does not work. However, if I connect to http:/sitename
    This method works. Is it because a link has the 's' at the end of http? If so, is there a way of
    work around this problem?

    Let me know if you have thoughts.

    Thank you very much

    -L

    Hi all

    If the secure protocol will indeed cause a problem, the only way I can think to work around, it's using the venerable redirection page. You create a standard topic in your system and the key link to the standard topic. The standard theme would then redirect to the HTTPS page desired.

    Article read by clicking this little ole link here should help to create the redirection page.

    See you soon... Rick

  • Need custom button for Thunderbird for FF toolbar; Don't know the Web site.

    I had a custom button in Thunderbird for my FF toolbar and have lost it. This happened once previously had someone gave me a site where all the old custom buttons qwe listwed and I was able to drag / drop the button here. Unfortunately, I do or has this website and hope that someone will be able to provide for me. Thank you.

    Take a look at this search

  • Custom button keyboard

    I made a custom button that looks like a button on a computer keyboard.  When not selected it seems to be raised and that selected it seems lowered.  The question I have is when picked up and down key change so it is lowered to the axis ot the button and I want to be pressed to the bottom of the image.  How can I get there?

    Thanks for the help!

    Hey,.

    I think you are looking for something like this?
    (See attachment)

    You can edit it as a custom control. Open the custom control and type Customize mode, right click the button and check the option "size independent. This let's customize you the on and off State State separately.

    You can select individual States again right click and "elements of the image."

    When the button is 'up', I left the control being, when the button is 'down' I moved this State so that the base was at the same level as the base of the State 'up', leading to the illusion of a keyboard button.

    I hope I explained that well enough and it helps!

Maybe you are looking for