Align the question

Hello

I want to right align a HorizontalFieldManager in a HotizontalFieldManager that use the entire width.

So I have something like this:

HorizontalFieldManager hfm = new HorizontalFieldManager(Manager.USE_ALL_WIDTH);HorizontalFieldManager rightManager= new HorizontalFieldManager(Manager.FIELD_RIGHT);hfm.add(right);

The problem is that rightManager is always on the left.

If I add rightManager directly to the screen, align right.

I'm so frustrated that I wrote my own handler in the end. Source below. Use it as you see fit with absolutely no warranty whatsoever, etc. etc. If you find an important bug or make a utility improvement please let me know.


package com.blah;

import net.rim.device.api.ui.Field;import net.rim.device.api.ui.Manager;

class HorizontalPairManager extends Manager{    private final boolean m_favourLeft;

    HorizontalPairManager(Field leftField, Field rightField)    {        this(leftField, rightField, false);    }

    HorizontalPairManager(Field leftField, Field rightField, boolean favourLeft)    {        super(Manager.USE_ALL_WIDTH);        add(leftField);        add(rightField);        m_favourLeft = favourLeft;    }

    protected void sublayout(int width, int height)    {        Field leftField = getField(0);        Field rightField = getField(1);

        if (m_favourLeft)        {            layoutChild(leftField, width, height);            layoutChild(rightField, width - leftField.getWidth(), height);        }        else        {            layoutChild(rightField, width, height);            layoutChild(leftField, width - rightField.getWidth(), height);        }

        int leftFieldHeight = leftField.getHeight();        int rightFieldHeight = rightField.getHeight();        if (leftFieldHeight > rightFieldHeight)        {            setPositionChild(leftField, 0, 0);            setPositionChild(rightField, width - rightField.getWidth(), (leftFieldHeight - rightFieldHeight) / 2);            setExtent(width, leftFieldHeight);        }        else        {            setPositionChild(leftField, 0, (rightFieldHeight - leftFieldHeight) / 2);            setPositionChild(rightField, width - rightField.getWidth(), 0);            setExtent(width, rightFieldHeight);        }    }}

Tags: BlackBerry Developers

Similar Questions

  • Stupid question: is there a way to align the grids online Adobe?

    While I'm able to line up on the bumper of the drawn objects, this behavior does not appear to be translated to the grids. Is there an additional parameter which must be running in order to align the grids on the canvas? I'm sorry if this is a stupid question and thanks in advance.

    Hi there crwinchester!

    Thanks for reaching out and I'm sorry for the very late reply. While you can't snap to grid itself, you can use the slide or the sovereign built into Illustrator Draw drawing and vector design app | Download Adobe Illustrator to draw to align specific or arbitrary angles angles.

    Let me know if that helps!

    -Kathleen

  • Control the simulation time to align the time system

    Good so maybe it's blindingly obvious or just simply a ridiculous question but here goes:

    I run a dll that I produced from a .mdl file. My goal (among others!) is to get the dynamic response of the exact model of 'real world' calendar (date system). The tuning for the appearance of the control of this model is based on the duration of simulation with produced in simulink and so it is desirable for me to define the duration of the simulation to run when the system.

    The problem I have, if you open the workspace and produce a template control, the simulation shown time is much faster than the time system.

    For example, one iteration of the model takes a fraction of a second. What I imagine happens, it is immediately restart (and progress of a time step). I guess I want the model to wait until it is in harmony with the system time before iterate again.

    Is there a way to solve this problem, and do anyone know if this problem will be resolved in Simulink or Veristand 2009.

    Any information would be appeciated, my trawl of the help files OR have not really answered the questions yet good

    Thank you
    James

    The models are running in sync with the rest of the system. Unless you specify a decimation factor for your different model of 1 for each tick of the primary control loop your model put once, too. The difference between the model and system duration that you see is due to the fact that the model time is based on its time not Delta T compiled, not any of the wall clock time. Every time that the model is Ticktock, it adds its own Delta T to its operation time string.

    The time channel system is based on the Delta T of the primary control loop. Thus, it corresponds with the rate you specified the system to run at. If these Delta Ts are the same, are aligned at the same time. If you want the time to model to match an actual wall clock time, you can adjust the flow of the loop of the primary control loop to match the Delta T, or adjust the factor of the decimation of the model so that it gets only checked once for every N the primary control loop iterations.

  • APEX form - how to align the text boxes

    Hello

    I'm creating a form and I have a few text fields bordered square... Unfortunately, it is not aligning... This is how it manifests itself.

    sample.PNG

    Here is the configuration

    1.PNG2.PNG3.PNG

    Thank you

    Developing using the button display the grid on the developer toolbar. In this way, you can see the grid changes and check the settings of the grid if necessary.

    As pleNn have already said, the question mark is automatically added if you have a help text for an element. It's probably nothing more than "enter the value for the number of trips. You can delete the help text if it is not useful.

  • How to align the two side by side anchored objects in InDesign.

    I put a Word document in my InDesign doc and there are a number of images. They came as embedded images. Some of them I want to appear side by side or in a grid of all kinds. I'm not too familiar with anchored objects. Is there an easy way to align the ups and downs (i.e. ensure that the images are of the same height as the other) so that when they are side by side, they're aligned? Whatever I do for them seems to move them a little bit, but they are not perfectly aligned. Because I can't pick them out and do a typical line up as I would with ordinary objects, I don't know what to do. Sorry if this is a stupid/easy question. Thank you very much!

    • Right-click on the selection of an anchored object and choose anchored object > Options.
    • In the anchored object Options dialog box, choose Customize from the Position menu and click OK.
    • The subject will probably move when the dialog box closes, but because it is now a Custom anchored object, you can drag to reposition.
    • Alignment of an object embedded custom to other objects cannot be done with the control panel features line up because the anchored objects select individually, but with benchmarks commented under tension, you should be able to logically position.

    Note: you can of course always UN-anchor an object if you want. Simply select cut, press ESC to kill the active insertion point and paste.

  • Align the stars...

    Hello...

    I'm looking to align several stars (five-pointed ones) to Center... (the problem is the horizontal alignment). Question is, how to work once on this subject?

    I tried / know the following:

    1. the bounding box is not "related" to the center of the star - kind have passed the road to manually move the Center. Duplicating and resizing of the star... it does not align horizontally.

    2 have you tried not to move downtown. Same result as 1. above

    3 have you tried the course of transformation, multiple stars created, expanded and dissociated. Made with both the Center adjusted manually than the default Center. Identical to 1. above

    4. have you tried to create a circle and aligning the stars to that... no luck

    In all cases the smaller copies seem to climb to the top... the sense that the top edges are closest to each other and lower edges are variable with more.

    Important point is copies... the original aligns on a circle. Copies only.

    Yes, it is possible to enter the Center points and line them up but surely there must be a way "automatic"?

    BTW, have tried this only with a star 5-spoke - like in the American flag. I doubt that the problem exists in a star with an even number of points.

    The frame enclosing is not "related" to the center of the star

    Here, you hit the nail on the head. So what you have to do is to find the geometric center of the star like this (use of bearings commented) to help:

    Using of the place where the lines cross as your Center, draw a (highest) larger rectangle than the bounding box of the star, colour it None and combine them with the star. Remove the two lines. Now you can automatically align.

  • align the balls next to the image...

    I have an image with text next to him, http://mac.ysu.edu/test/MAC/microsoftpage.html I want to know how to align the bullets in the text, when I put the ball, puts it at the bottom of the image to the left, its where the other balls are just below that the text pretty much as low as the image is.  any help would be appreciated

    Hello

    This generally if I understand your question, so I want to offer you a comprehensive solution first, here is the link:

    http://www.smartwebby.com/web_site_design/bullets.asp,

    It is interesting to work through this script.

    Hans-Guenter

  • By aligning the strokes

    AICS2, leopard

    Hi people,

    Align the stroke in the STROKE palette only works intermittently. The first time I align the line, it works... usually. On the next try, no dice.

    I trashed the Prefs. Still no dice.

    I just tried to create a new layer and then aligning stork... MISSPELLING. I leave you by aligning the storks to genetic engineering... by aligning the line works every time on the new layer.

    Is it a glitch in CS2? Fortunately, the new layer is OK for this project. But is there anything else I can do to get different race alignments on the same layer?

    Thanks in advance.

    Toni

    (save a few cents for CS4 update)

    Hmmm... Can't reproduce here on AI 12 (CS2) running on OS 10.4.11.

    I see that you have trashed prefs. I guess you also tried restarting base. Maybe the other old standby: just paste it in a new document?

    You have updated to 12.0.1? This question is not listed amongst approach them, but it might do the trick.

  • Align the text of the varchar2 column data

    Hello

    It is in reference below thread:
    Re: Align the text of varchar2

    I think I should post my question in this forum, rather than General database,

    I created a table and inserted the same that in the thread that above, and when I said:
    Select ID, FILLED_TEXT(DESCRIPTION,30) FROM T;

    It does not show the data in the column as aligned in 30 word boundaries. I thought, that I would be able to resolve the issue with the help of the http://soft.buaa.edu.cn/oracle/bookshelf/Oreilly/prog2/ch11_02.htm link, but failed.

    Kindly help me more.

    Kind regards.

    Okay, so you're saying there is already a tags in the code to indicate where the line breaks are necessary, so a small adjustment of the data to include these tags and also the code...

    DROP TABLE test_data
    /
    CREATE TABLE test_data as
    select 1 as id, q'[For several days after leaving Nantucket, nothing above hatches was seen of Captain Ahab. The mates regularly relieved each other at the watches, and for aught that could be seen to the contrary, they seemed to be the only commanders of the ship; only they sometimes issued from the cabin with orders so sudden and peremptory, that after all it was plain they but commanded vicariously.<>Yes, their supreme lord and dictator was there, though hitherto unseen by any eyes not permitted to penetrate into the now sacred retreat of the cabin.]' as txt from dual union all
    select 2, q'[Every time I ascended to the deck from my watches below, I instantly gazed aft to mark if any strange face were visible; for my first vague disquietude touching the unknown captain, now in the seclusion of the sea, became almost a perturbation. This was strangely heightened at times by the ragged Elijah's diabolical incoherences uninvitedly recurring to me, with a subtle energy I could not have before conceived of. But poorly could I withstand them, much as in other moods I was almost ready to smile at the solemn whimsicalities of that outlandish prophet of the wharves.<> But whatever it was of apprehensiveness or uneasiness - to call it so - which I felt, yet whenever I came to look about me in the ship, it seemed against all warrantry to cherish such emotions. For though the harpooneers, with the great body of the crew, were a far more barbaric, heathenish, and motley set than any of the tame merchant-ship companies which my previous experiences had made me acquainted with, still I ascribed this - and rightly ascribed it - to the fierce uniqueness of the very nature of that wild Scandinavian vocation in which I had so abandonedly embarked. But it was especially the aspect of the three chief officers of the ship, the mates, which was most forcibly calculated to allay these colorless misgivings, and induce confidence and cheerfulness in every presentment of the voyage. Three better, more likely sea-officers and men, each in his own different way, could not readily be found, and they were every one of them Americans; a Nantucketer, a Vineyarder, a Cape man. Now, it being Christmas when the ship shot from out her harbor, for a space we had biting Polar weather, though all the time running away from it to the southward; and by every degree and minute of latitude which we sailed, gradually leaving that merciless winter, and all its intolerable weather behind us. It was one of those less lowering, but still grey and gloomy enough mornings of the transition, when with a fair wind the ship was rushing through the water with a vindictive sort of leaping and melancholy rapidity, that as I mounted to the deck at the call of the forenoon watch, so soon as I levelled my glance towards the taffrail, foreboding shivers ran over me. Reality outran apprehension; Captain Ahab stood upon his quarter-deck. End]' from dual
    /
    
    CREATE OR REPLACE FUNCTION wordwrap (p_txt IN VARCHAR2, p_linesize IN NUMBER) RETURN t_wordwrap_txt PIPELINED IS
      cursor cur_wordwrap(p_txt in varchar2) is
        select rn, txt
        from (
              select rownum as rn
                    ,trim(regexp_substr(p_txt,'.{1,'||p_linesize||'}( |$)',1,rownum)) as txt
              from dual
              connect by rownum <= ceil(length(p_txt)/p_linesize)+10
             )
        where txt is not null
        order by rn;
      v_txt varchar2(4000);
      v_length number := 0;
      v_paratxt varchar2(4000) := p_txt;
      v_paratxt_part varchar2(4000);
      v_pos number;
      v_srch varchar2(100) := '<>';
    begin
      loop
        exit when v_paratxt is null;
        v_pos := instr(v_paratxt,v_srch);
        v_paratxt_part := case when v_pos = 0 then v_paratxt else substr(v_paratxt,1,v_pos-1) end;
        v_paratxt := case when v_pos = 0 then null else trim(substr(v_paratxt,v_pos+length(v_srch))) end;
        for w in cur_wordwrap(v_paratxt_part)
        loop
          v_txt := w.txt;
          loop
            exit when length(v_txt) = p_linesize or instr(v_txt,' ') = 0;
            for i in 1..p_linesize-length(v_txt)
            loop
              v_txt := regexp_replace(v_txt,'([^ ]) ','\1  ',1,i);
            end loop;
          end loop;
          v_length := v_length + length(v_txt);
          if length(v_txt) > 0 then
            pipe row(v_txt);
          end if;
        end loop;
        if v_paratxt is not null then
          pipe row(''); -- new line before next part
        end if;
      end loop;
      return;
    end;
    /
    

    results...

    SQL> select test_data.id, x.column_value
      2  from test_data, table(wordwrap(test_data.txt,50)) x
      3  /
    
            ID COLUMN_VALUE
    ---------- ---------------------------------------------------
             1 For  several days after leaving Nantucket, nothing
             1 above  hatches was seen of Captain Ahab. The mates
             1 regularly  relieved each other at the watches, and
             1 for aught that could be seen to the contrary, they
             1 seemed to be the only commanders of the ship; only
             1 they  sometimes  issued from the cabin with orders
             1 so  sudden  and  peremptory, that after all it was
             1 plain     they    but    commanded    vicariously.
             1
             1 Yes,  their  supreme  lord and dictator was there,
             1 though  hitherto  unseen by any eyes not permitted
             1 to  penetrate  into  the now sacred retreat of the
             1 cabin.
             2 Every  time I ascended to the deck from my watches
             2 below,  I  instantly  gazed  aft  to  mark  if any
             2 strange  face  were  visible;  for  my first vague
             2 disquietude  touching  the unknown captain, now in
             2 the   seclusion   of  the  sea,  became  almost  a
             2 perturbation.  This  was  strangely  heightened at
             2 times    by   the   ragged   Elijah's   diabolical
             2 incoherences  uninvitedly  recurring to me, with a
             2 subtle  energy  I  could not have before conceived
             2 of.  But poorly could I withstand them, much as in
             2 other  moods  I  was  almost ready to smile at the
             2 solemn  whimsicalities  of that outlandish prophet
             2 of                   the                  wharves.
             2
             2 But   whatever   it  was  of  apprehensiveness  or
             2 uneasiness  -  to  call  it so - which I felt, yet
             2 whenever  I  came to look about me in the ship, it
             2 seemed  against  all  warrantry  to  cherish  such
             2 emotions.  For  though  the  harpooneers, with the
             2 great  body of the crew, were a far more barbaric,
             2 heathenish,  and  motley  set than any of the tame
             2 merchant-ship    companies   which   my   previous
             2 experiences  had  made me acquainted with, still I
             2 ascribed  this  - and rightly ascribed it - to the
             2 fierce  uniqueness of the very nature of that wild
             2 Scandinavian   vocation   in   which   I   had  so
             2 abandonedly  embarked.  But  it was especially the
             2 aspect  of  the  three chief officers of the ship,
             2 the  mates,  which was most forcibly calculated to
             2 allay   these  colorless  misgivings,  and  induce
             2 confidence  and  cheerfulness in every presentment
             2 of   the   voyage.   Three   better,  more  likely
             2 sea-officers  and  men,  each in his own different
             2 way,  could  not  readily  be found, and they were
             2 every  one  of  them  Americans;  a Nantucketer, a
             2 Vineyarder,  a  Cape  man. Now, it being Christmas
             2 when  the  ship  shot  from  out her harbor, for a
             2 space  we had biting Polar weather, though all the
             2 time running away from it to the southward; and by
             2 every  degree  and  minute  of  latitude  which we
             2 sailed,  gradually  leaving that merciless winter,
             2 and  all its intolerable weather behind us. It was
             2 one  of  those  less  lowering, but still grey and
             2 gloomy  enough  mornings  of  the transition, when
             2 with  a fair wind the ship was rushing through the
             2 water  with  a  vindictive  sort  of  leaping  and
             2 melancholy rapidity, that as I mounted to the deck
             2 at  the  call  of the forenoon watch, so soon as I
             2 levelled   my   glance   towards   the   taffrail,
             2 foreboding  shivers  ran  over  me. Reality outran
             2 apprehension;   Captain   Ahab   stood   upon  his
             2 quarter-deck.                                  End
    
    65 rows selected.
    
    SQL>
    
  • If you ask the question and then choose a solution, the thread will be closed or still can you ask more details?

    If you ask the question and then choose a solution, the thread will be closed or still can you ask more details?
    (sometimes, someone answers my question, and I want to mark it as the solution and am not yet quite ready for the thread be closed...)

    If you still experience this issue, you can return to this thread.
    But, you must clear the flag solved .

  • How can I FIND the question I asked before to see if there is an answer

    Where is that I should go to locate the question I posed and answers available, as appropriate.

    I've seen this question asked in a generally similar manner and the author of the question was directed to go to the location of their question to show all responses that might have been given - but there's nothing telling us how they came to this place. How do you get there?

    Suggestion: A user having to log-in to ask a question, then once a user logs in, it would be great if they could see a list of the questions they asked, and maybe a link that will lead to the location of this question and the answers that could have been provided by the community.

    A friend showed me how to locate my question (s). Thank you.

  • My external hard drive will not go up and I'm not sure what the question is

    My external hard drive will show up in disk utility, but not of viewfinder. I tried to hit "repair disk" and he says it will take 4 hours, but after a while, that he's finally going to say that it is impossible to repair the disk and I need to make a backup.

    Help?

    Almost always, the question is quite simple: the hard drive is faulty or has failed. So I hope that you have a backup of everything that is on, it is absolutely essential.

  • What happened to the questions I asked in recent years?

    When I fly over my user name at the top of the support forum for mozilla and then click on 'My issues', I'm only showed my last two questions. What happened to all the question I asked in recent years? In addition, I'm more able to achieve this through getsatisfaction.comforum.

    Get satisfaction has been disabled in the past months. It's now the support forum. Nothing in the history was moved to the wire.

  • The question "Adjust the location of the tab bar" has been closed, but the solution is not satisfactory

    Updates of version 29 on have moved the bar of tabs so that changed the position and function of the address bar. The 'solution' to the question in quotes above is not a solution, the question was just closed. The owner of the issue went back to 95% of the function of the way he had it & has set for that. I find not acceptable and opted to return to version 28. I'm worried, I could have spent the browser after using Firefox since the first beta version. Is there no way to keep the options of version 28 (mainly the position of the tab & address bar) in the updated versions? I tried the Restorer Classic theme, but it did not help. I am running Windows 7 Home Premium 64 bit & Firefox 28 right now without any problem, but I guess that Firefox is progressing certain features on the old version will fail. Help please?

    FJRRider,

    You can take a look at this theme.
    Firefox 2, the theme, reloaded
    https://addons.Mozilla.org/en-us/Firefox/addon/Firefox-2-theme-for-Firefox-3x/
    Large buttons, tabs under the location bar - just above the page content 'window', but the reload and Stop / Go button cannot be moved, however. It uses a combined stop / Go button which could take a volume of little getting used to.

    IMO, much simpler than the Restorer of classic theme and no need to tinker with a large number of settings to make it look 'right', but it has a very limited ability to be changed or reconfigured.

  • Security issues 'reset' does not appear when I try to change the questions

    I am trying to change my account email address, but I don't remember the answers to the questions. I tried to change the questions but it gives me the ability to reset my questions

    You must ask security team account Apple to reset your security questions. To contact them, click here and choose a method; If this page does not list one for your country or if you are unable to call, complete and submit this form.

    (142998)

Maybe you are looking for