Custom layout manager

Hi all

I can't create a custom presentation Manager. I extended the class Manager and set the getPreferredWidth() implement, the getPreferredHeight() and methods sublayout (int width, int height) but I have two LabelFields are not displayed.

I would like to first of all fields of both label as shown in the image below, but I do not understand creation of custom models. I understand getPreferredWidth() and getPreferredHeight() sets the width and height of the Manager, but I'm confused with the method sublauout (int width, int height) and layoutChild and setPositionchild (field, int, int).

I'd appreciate it if someone could point out tutorials, examples and notes for custom understanding models.

Thank you

Praveen Singh

Hi arkadyz

Thank you very much for the help.  I solved the problem I had, I tried to extend the class Manager and setPreferredWidth() to Display.getWidth () and setPreferredHeight() to return the height of the first field.  My problem is that I have added two LabelFields at my personal Manager and tried to keep them on the same line, which meant my int y variable has been created under the zero and my int variable x changed but these two variables x and is also used in setExtent(x,y); If I was getting setExtent (x, 0); which caused my labelfields does not show.

protected void sublayout (int width, int height) {}
int x = 0;
int y = 0;

for (int i = 0; i)< getfieldcount();="" i++)="">
Field field = getField (i);
layoutChild (field, width, height);
setPositionChild (field, x, y);
x += field.getWidth () + 90;
y += 0;
}
setExtent (x, y + getField (0) .getHeight ());
}

Tags: BlackBerry Developers

Similar Questions

  • Custom layout manager: question sublayout

    Trying to implement a border layout manager (see the code), I'm having problem with the sublayout method. When the method is called, the value for the parameter "width" is 240, but the value for the parameter "size" is "1073741823' that really confuses me. I expect the value of "260" that I have tested on a simulator of Pearl.

    Can someone shed some light on this subject?

    JDE: 4.3

    Simulator: 8130

    Here is the code:

    class BorderLayoutManager extends Manager {
    
        public BorderLayoutManager() {
            super(Manager.NO_VERTICAL_SCROLL);
        }
    
        //overwrite the nextFocus method for custom navigation
        protected int nextFocus(int direction, boolean alt)
        {
            // Find the next field to be focused
        }
    
        protected void sublayout(int width, int height) {
        // calculate the position of each field, then call
        // setPositionChild() and layoutChild() for each field
        }   
    
       public int getPreferredWidth(){
        // calculate preferred width
       }
    
       public int getPreferredHeight(){
        // calculate preferred height
       }
    }
    
    public class MyScreen extends MainScreen{
        public MyScreen(){
            super();
            BorderLayoutManager manager = new BorderLayoutManager();
            manager.add(BorderLayoutManager.NORTH, new LabelField("North"));
            manager.add(BorderLayoutManager.SOUTH, new LabelField("South"));
            manager.add(BorderLayoutManager.WEST, new ButtonField("WEST"));
            manager.add(BorderLayoutManager.EAST, new ButtonField("EAST"));
            manager.add(BorderLayoutManager.CENTER, new RichTextField("center"));
            add(manager);
        }
    }
    

    If your custom Manager Manager has vertical scrolling enabled, then the height will show that this large number.

  • Which layout manager to use

    Hello everyone, I drove to the development of my application, I realized that the way in which I developed my application makes ony eyes straight on "BOLD" size screens. My footer is set to use all the way up, but what I really want, it of so he can "stick" to the lower part of the screen and let the section between the header and the footer to expand to fit the screen of the phone.

    The following example illustrates what I would do (arrow indicates there area I'd like to expand). Achieve will require that I write my own layout manager, or is there already a that I could use for this?

    Screen offers setTitle and setStatus. See http://supportforums.blackberry.com/t5/Java-Development/MainScreen-explained/ta-p/606644

  • Background with custom layout error

    Hello

    I have a screen that I put to use a background image, and I created a custom presentation of HFM

    but when I use my layout on the screen I get an 104 error not caught illegal argument exception.

    When I delete the code for the background image, the screen will display properly with my custom layout,

    How can I use my custom with a background image layout.

    Thank you

    Hello

    I ran my application with debugging and here is a screenshot of the debug window when my application crashes.

    He seemed to have solved the problem now my custom layout and and background displays correctly, I changed my background don't not to scale, can someone help explain this that when wrong when using Background.REPEAT_SCALE_TO_FIT

    Bitmap VO = Bitmap.getBitmapResource ("splashscreen.png");
    Background _bg = BackgroundFactory.createBitmapBackground (VO,
    Background.POSITION_X_LEFT, Background.POSITION_Y_TOP,
    ( Background.REPEAT_SCALE_TO_FIT) ;
    VerticalFieldManager _scrMngr = (VerticalFieldManager) getMainManager();
    _scrMngr.setbackground (_bg);

    Bitmap VO = Bitmap.getBitmapResource ("splashscreen.png");
    Background _bg = BackgroundFactory.createBitmapBackground (VO,
    Background.POSITION_X_LEFT, Background.POSITION_Y_TOP,
    ( Background.REPEAT_NONE) ;
    VerticalFieldManager _scrMngr = (VerticalFieldManager) getMainManager();
    _scrMngr.setbackground (_bg);

  • Custom subscription management page

    We had to create a custom subscription management page that publishes on Eloqua to several languages. The position works very well, but what does not work is to know who the visitor is when they click on the link on the email subscription management page. Almost all of our recipients will not have a cookie to the visitor, so how can I tell me the address of e-mail for the contact search when I only have the elq variable that is passed on to the subscription management page?

    Hi Will,

    You can use a simple method for these pages of hosted subscription that would be adding email address to contacts to your URL and then this aid to search for data, or, if you want a method to test more, you could search for visitor when the email recipient lands on the page, extract the e-mail address and then use it to fill your contact database search and make the pre-population of. This method is more complex and requires some knowledge of javascript, but it can avoid the confusion of profile if emails are being sent on etc.

    For a brief explanation of the work of the more complex method, take a look at this thread:

    http://topliners.Eloqua.com/thread/2305

    You can even define searches for information to run only under certain conditions, to stop all data is pre-populated for organic visitors, that this has been discussed on LinkedIn recently in one groups Eloqua where forms are pre-filled with the wrong information.

  • Custom layout of JavaFX nodes

    I'm developing an application for which it is necessary to nodes available in addition to the other (or on top of the other etc..). However, this provision is only an IPO and the user is able to move these nodes arbitrarily. How does correctly in JavaFX? I'll explain my problem with a simplified example:

    Guess I have 2 rectangles and want to place rect2 right of rect1.

    // create first rectangle at position x= 5, y=5 
    rect1
    = rectangle(5,5);
    // create second rectangle to the right of rect1
    rect2
    = rectangle(5+rect1.width(), 5);

    In this scenario JavaFX has not yet determined the width of rect1, and there will be zero. Intuitively, I would make a call that allows JavaFX rect1 and thus determine its width and then add rect2. See the following example:

    // create first rectangle at position x= 5, y=5 
    rect1
    = rectangle(5,5);
    // let JavaFX draw rect1 (width will be calculated and set)
    draw
    ();
    // create second rectangle to the right of rect1
    rect2
    = rectangle(5+rect1.width(), 5);

    Unfortunately, I have not found a method that does what I want. My current solution appealed to the Platform.runLater (), but this does not work properly all the time. If my interpretation of the links is correct, the links also are not appropriate for this problem. I want only to provision initially nodes, so I have to remove the link after the initial layout (or do rect2 would move if rect1 is moved).

    Thanks in advance for any help.

    Custom presentations are generally made subclassing region, the substitution of layoutChildren() and calculations of page layout based on the prefWidth and the prefHeight of the child nodes.  Best place to understand this for example is by examining the source code of JavaFX , as I've never seen a tutorial on the subject.

    A round, you can use that may or may not be suitable for you, is to use the layout panels for the default page layout, then use translate the properties to allow the user to the default layout components, the translation in this way you can avoid the creation of a custom layout component.

    Another way to do is to use a base pane as the layout container that is not automatic on her children, add children to the pane in the constructor of the component.  Layout() and applyCss() use children to measure children if necessary in order to determine the appropriate size.

  • Several custom layout Page?

    So it's a little hard to imagine a thread title that sets out succinctly what I have wrong here.

    Basically, I'm wondering if it is possible to display a * SINGLE * page of a * MULTIPLE * custom layout in the print module. It is quite possible, I'm just retarded and I'm missing something simple, but when I add a page to the page layout, he appears in what is basically a grid view, with all the pages visible at a time. Addition of pages just makes each smaller page. Of course, it is not an ideal situation to make layouts.

    So, am I missing sort of totally obvious to solve this problem? The print module makes page views when making contact sheets and so on, so I know it is theoretically possible. Or is it not feasible in custom mode?

    There is a zoom button of the page on the top left preview pane

  • OPM does not have the custom function Manager

    1. I have manually created an 'include' file in the 'Development' folder and add it to the project in the OPM.
    2. I put the program manager JAR in the "include" folder
    3. I created "" MyProject - config.xml "and place it in the"include"folder."
    4 OPM charge MyProject - config.XML when I generate the project. I found this by making the XML invalid, and OPM has complained about this.
    5. When you debug the project, OPM says:
    A custom function "isValidSPId" has been called and there is no custom function Manager. Choose a DLL and a class to provide a custom functions for this one.


    And I chose "Java" as a platform for the project properties.

    5. When you debug the project, OPM says:
    A custom function "isValidSPId" has been called and there is no custom function Manager. Choose a DLL and a class to provide a custom functions for this one.

    The debugger expects a function custom .NET, not a custom Java function

    And I chose "Java" as a platform for the project properties.

    I'm not sure what you mean - there is no such thing as a platform of modules - all rulebases are platform independent. Do you mean the setting of "Regression Tester - platform properties? If so, these effects only the platform used to run regression tests - not for compiling, debugging, or running with or without screens.

  • Always invoking of custom sublayout() #Manager

    My question is this acceptable design to always invoke sublayout() to a Manager custom because of keyhandling in a screen?  I'm on an arbitrary amount of BitmapFields that are made to scale accordingly to the press of the button.  It seems that some content on BitmapField are not properly updated during the subsequent sublayouts.

    Note in the following code:

    -The first field in the Manager is a special case.

    -The following fields are added as such BitmapFields: series of fuzzy BitmapFields, then series of the targeted BitmapFields.  (e.g., add (bitmapfield1_unfocused), add (bitmapfield2_unfocused), add (bitmapfield1_focused) and add (bitmapfield2_focused))

        protected void sublayout(int width, int height) {
            // TODO Auto-generated method stub
              int x = 0;
              int y = 0;
                Field field;
                Field headField = null;
                int numberOfFields = getFieldCount();
    
                if (numberOfFields > 1) {
                    numberOfFields = (numberOfFields - 1) /2 + 1;
                }
    
                x = (width/2) -  _bitmapBaseSize*_focusIndex  - _bitmapFocusSize/2;
    
                for (int i=0; i 0) {
    
                        if (i == _focusIndex+1) {
                            field = getField(_focusIndex+numberOfFields);
                        }
    
                        layoutChild(field, width, height);
    
                        //
                        //(width/2) -  _bitmapBaseSize*_focusIndex  + _bitmapFocusSize/2
                        setPositionChild(field,x, y - field.getContentHeight());
                        x += field.getContentWidth();
    
                    }
                    else {  // If is the RegionableBitmap
                        layoutChild(field, width, height);
                        setPositionChild(field, 0, 0);
                    }
    
                    if (headField != null)
                        y = headField.getPreferredHeight();
                }
                setExtent(width /*Math.min( width, getPreferredWidth())*/, Math.min( height, getPreferredHeight()));
        }
    }
    

    Oh, Yes, you need a Manager customized for this!

    Still, you'd better first create all your BitmapFields (for small and large bitmaps) with bit style FIELD_BOTTOM.  Do not add to any Manager yet!

    Once this is done, I would say something like this:

    1. do you have a NO_VERTICAL_SCROLL | NO_HORIZONTAL_SCROLL | USE_FULL_WIDTH | USE_FULL_HEIGHT Manager with a background set to your bitmap image full screen (pre - 4.6, you must override paintBackground (Graphics g) - it is documented that for Screen.paintBackground () but works from field!)  In its sublayout() position her only child - a HorizontalFieldManager (see below) - where you want it to be.  Use layoutChild (hfm, width, height) to first, then setPositionChild (hfm, (width - hfm.getWidth () / 2, height - hfm.getHeight (()), where hfm is your HorizontalFieldManager containing the rest of the bitmap.

    2. create a custom HorizontalFieldManager (that I called hfm):

    (a) substitute his paintBackground() to do anything - you do not want to erase areas

    (b) initially to add the BitmapFields according to those that you want the user to see.  Say, you want to display the five image, number one and two small, numbers three large, small number four and five.  Add only the necessary fields.

    (c) inside of the navigationMovement() replace the BitmapFields that must be replaced and updated the layout.  For example, if your dx is 1 (one step to the right), you need the following:

    -remove the first bitmap;

    -replace the third (large) bitmap with small correspondent;

    -replace the fourth bitmap (small) with the corresponding wholesale;

    -Add the sixth (or the first if you have a total of five pairs of bitmaps) small image;

    -call on your hfm updateLayout() (perhaps not even need all these add(), replace(), and delete() should ask to rearrange)

    3. Add hfm in your full-screen Manager.

    I hope that gives you enough ideas to be implemented!

  • Components customized QML: management of the events of the child controls

    The tutorial here:

    https://developer.BlackBerry.com/Cascades/documentation/UI/custom_components/custom_components_tutor...

    Shows how to use the alias so that you can read the values of the properties of the child controls.

    It would be good to have a code example that shows how to hang children change events. For example, if your custom control has a control segment, how to make the custom control user be notified when there is a click on segment control event or when the value of this control is changed.

    Signals can be easily created in QML and exposed from a QML file that is customized to be listend to another. The following article explains the basic process:

    https://developer.BlackBerry.com/Cascades/documentation/UI/signals_slots/index.html

    In its simplest form, a signal is created in QML using the following format:

    signal signalName (variableType variable1,...)

    In the QML implementation of this custom control file, you will now have a manager of signal onSignalName created automatically for you.

    I covered this topic in my last webcast and created a sample file that looks like this:

    https://developer.BlackBerry.com/Cascades/documentation/videos/index.html

    Beta 1: Astonishing UIS using the new framework of BlackBerry 10 - part 2

    The sample was created against the Beta 1 of the NDK for BlackBerry 10 but the QML (TaskControl.qml) file should work fine in the beta 2 release. If you are having trouble please post it here and I will consider.

    Kind regards

  • Rearrange the order of the fields in a custom battery Manager

    I am creating a custom handler where the content fields overlap between them (like the tabs of the file) and I want the field to appear above the other tabs when selected.

    I've been (but not all)

    • Adds an array of fields to the custom handler in their order, but during the sublayout, I put in the position and arrangement of the field first before all other fields
    • also added the index selected the Manager first, but the order of focus change.

    Does anyone know how to rearrange their display order battery? Is it still possible?

    It is only my understanding...  Not done.

    I think knowing that a Manager displays or paint the fields in the order they are added.  It will also move by default in this way.  When the focus moves, the field is painted with focus, but what this really means is that the area of the screen is redrawn.  The Manager will know which fields are displayed in the box that needs repainted and asked to be repainted.

    So if you have two fields, and they overlap, the second field is always painted on the first field, which is not what you want if the first field is in focus.

    In short, using my 'model', if you want something on top, it must be the last thing added to the Manager.

    So when the focus moves, you need to add and remove fields to the Manager.  This is not an operation that I would actually recommend.  Change of field managers in this way is 'expensive' in regard to treatment and could slow down at all, if in fact it works - I don't know how well a manager could face having the field at point removed and re added.  But this is probably the easiest option, at least the simpler I think.  The only other option I can think of involves a fancy paint treatment.

    You want to give this a go and see how you go?

  • How to check if a custom Attachment Manager is installed

    Hey guys,.

    I have critical app run for our sales outside the field people and it uses an Attachment Manager custom that autoruns to the startup of the phone.  I want to check that the Manager is registered when they launch the actual application, so I can re - charge Manager if necessary.  Is there a way to do this?  Is it still necessary?  I am a fairly defensive programmer and you want to make my apps as reliable as possible, and as I said it is a critical application that relies on the Attachment Manager.

    Thank you

    Wade

    There is no API for this query.  After recording with AttachmentHandlerManager your application can write some sort of object of success in the duration of BlackBerry store.  When your application starts it could check for this object.

    Please note that the store of runtime is allowed out when is reset, so if the user resets their device the custom AttachmentHandler and runtime database object would disappear.

  • Export document to PDF print with links to custom without increasing the "CreateResourceStream" on the resource of the custom links Manager.

    PDF export print raises no reminder (CanCreateResourceStream, CreateResourceStream) on my manager of the custom resource (ILinkresourceHandler) this driver of images at low resolution on PDF by also all other export as interactive PDF, PNG, JPEG same impression are working properly. CustomDataLink sample also have the same problem.

    Print PDF Export Export & IDML work on background medium thread only model plugin get reminders related to export PDF, but my set LinkResourceHandle implemented in user Plugin interface so I resolve my problem of implementation of the mobile LinkResourceHandler, new model plugin.if you want it to be in the user interface pligon only that put a name of empty text file "DisableAsyncExport" in the content folder inside the app on mac OS , this will disable the export PDF & IDML background.

  • How to move a logo on the right side of the header and resize the area of the image - sensitive custom Layout HTML 5 - 11 of RoboHelp

    I created a page HTML 5 custom based on the layout Theme1_Standard layout.  Our logo is rectangular and does not fit in the default image area.  I want the logo to the right of the header.  I don't see how to do this in the customization of the Layout dialog box.  Is there a way to do this in the HTML somehow?  Moreover, the logo looks great in the office and the table overview of the customization of the Layout dialog box.  It is the right size and the header title fits right so that there is enough space for the rectangular logo. However, in the preview of the phone, the logo is tiny.  And when I generate the layout of reactive source HTML5 with the new theme, the logo is tiny in the preview of Chrome, even for the office.

    Thank you.

    Gina

    You can change this behavior in the main.css file. It's a little more work that you know well;

    Open the file with a text editor and search for "table.headertable td.logo". You can find parameters for the width of the logo, something like:

    Width: 4;

    Simply make it wider to adjust the image. Note that you need to do this several times as several devices have different widths for the logo.

    Kind regards

    Willam

  • Creation of a photo gallery / portfolio for a customer to manage (CMS &amp; Business Catalyst)

    I was asked to create a website for a client, the client is a photographer and want a site to promote her nursery school photography business. She would like to be able to manage the site itself using the BC dashboard, upload pictures as and when necessary. I use Muse to create sites and have informed the customer that for any CMS they need hosting with Business Catalyst.

    My question is to create a relatively unlimited photo gallery / portfolio. I understand a customer can download and edit the images on their site using the dashboard of BC, providing there is a slot available to do so. I believe that Business Catalyst has a module of Gallery of photo on their Web marketing package, it would be what I'm looking for? Otherwise there is no good solution workaround available for my client using only Muse?

    In the future, the customer is looking for secure areas of the site and also a control system online, but right now it's a pretty simple promotional site with a good photo gallery.


    I posted a similar question last week, someone very kindly suggested Smugmug, I looked into a separate (including Smugmug) solution but it is not appropriate in this case and I would stick to the Muse, BC and Adobe.

    Hello

    Yes, you can use the photo gallery module, where your customer would be able to download new images of the backend site and update the module. There are also other settings they can use for image display with photo gallery.

    https://www.YouTube.com/watch?v=x-MuLyhxS5o

    https://www.YouTube.com/watch?v=Hg8pB1cLvnk

    For future preferences, your customer can configure the secure areas, online shop site admin etc.

    Let me know if you have any questions.

    Thank you

    Sanjit

Maybe you are looking for