public UIExampleListStyleButtonFieldScreen() { super(NO_VERTICAL_SCROLL | USE_ALL_HEIGHT); setTitle("ListStyleButtonField Example"); Bitmap caret = Bitmap.getBitmapResource("chevron_right_black_15x22.png"); ListStyleButtonField one = new ListStyleButtonField("Music", caret); one.setChangeListener(this); add(one); ListStyleButtonField two = new ListStyleButtonField("Photos", caret); two.setChangeListener(this); add(two); ListStyleButtonField three = new ListStyleButtonField("Extras", caret); three.setChangeListener(this); add(three); ListStyleButtonField four = new ListStyleButtonField("Settings", caret); four.setChangeListener(this); add(four); ListStyleButtonField five = new ListStyleButtonField("Shuffle Songs", 0); five.setChangeListener(this); add(five); _explanation = new UIExampleScreen(); _explanation.setTitle("ListStyleButtonField Explanation"); LabelField explanationLabel = new LabelField( "The ListStyleButtonField looks like a list row, but is just a simple button. Good for use with a small finite set of elements."); explanationLabel.setPadding(5, 5, 5, 5); _explanation.add(explanationLabel); }
CitationScreen6(Citation _c) { c = _c; String cNumberString = Integer.toString(c.Number); /* CustomLabelField lf = new CustomLabelField("OREGON UNIFORM CITATION: #" + cNumberString, LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH); lf.setBackgroundColor(0x00194E84); lf.setTextColor(0x00ffffff); FontFamily fontFamily0[] = FontFamily.getFontFamilies(); Font font = fontFamily0[1].getFont(FontFamily.CBTF_FONT, 14); lf.setFont(font); add(lf); */ LabelField lf0 = new LabelField( "OREGON UNIFORM CITATION: #" + cNumberString, LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH | DrawStyle.HCENTER) { protected void paintBackground(net.rim.device.api.ui.Graphics g) { g.clear(); g.getColor(); g.setColor(Color.GREEN); g.fillRect(0, 0, Display.getWidth(), Display.getHeight()); g.setColor(Color.WHITE); } }; FontFamily fontFamily0[] = FontFamily.getFontFamilies(); Font font0 = fontFamily0[1].getFont(FontFamily.CBTF_FONT, 14); lf0.setFont(font0); setTitle(lf0); add(new SeparatorField()); /* CustomLabelField lf1 = new CustomLabelField("************* INCIDENT ATTRIBUTES **************", LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH); lf1.setBackgroundColor(Color.LIGHTGREY); lf1.setTextColor(Color.BLUE); FontFamily fontFamily[] = FontFamily.getFontFamilies(); Font font1 = fontFamily[1].getFont(FontFamily.CBTF_FONT, 14); lf1.setFont(font1); add(lf1); */ LabelField lf3 = new LabelField( "********* INCIDENT ATTRIBUTES **********", LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH | DrawStyle.HCENTER) { protected void paintBackground(net.rim.device.api.ui.Graphics g) { g.clear(); g.getColor(); g.setColor(Color.GREEN); g.fillRect(0, 0, Display.getWidth(), Display.getHeight()); g.setColor(Color.WHITE); } }; FontFamily fontFamily3[] = FontFamily.getFontFamilies(); Font font3 = fontFamily3[1].getFont(FontFamily.CBTF_FONT, 14); lf3.setFont(font0); add(lf3); add(new SeparatorField()); // -------------- // CheckboxField field_accident = new CheckboxField("Accident", false); add(field_accident); // CheckboxField field_radar = new CheckboxField("Radar", false); add(field_radar); // CheckboxField field_jail_booking = new CheckboxField("Jail Booking", false); add(field_jail_booking); // CheckboxField field_paced = new CheckboxField("Paced", false); add(field_paced); // CheckboxField field_school_zone = new CheckboxField("School Zone", false); add(field_school_zone); // CheckboxField field_alcohol = new CheckboxField("Alcohol", false); add(field_alcohol); add(new SeparatorField()); // EditField field_vbfi = new EditField("VBFI: ", ""); add(field_vbfi); // ObjectChoiceField String choicestrs1[] = { "5MPH", "10MPH", "15MPH", "20MPH", "25MPH", "30MPH", "35MPH", "40MPH", "45MPH", "50MPH", "55MPH", "60MPH", "65MPH", "70MPH", "75MPH", "80MPH" }; field_speed_limit = new ObjectChoiceField("Speed Limit: ", choicestrs1, 0); add(field_speed_limit); // EditField field_alleged_speed = new EditField("Alleged Speed: ", ""); add(field_alleged_speed); add(new SeparatorField()); // ButtonField row - set all buttons at the bottom row of the form HorizontalFieldManager navButtonManager = new HorizontalFieldManager(); // ButtonField ButtonField btn_prev; btn_prev = new ButtonField("Prev", ButtonField.CONSUME_CLICK); btn_prev.setChangeListener(new ButtonListener6(this, c)); navButtonManager.add(btn_prev); ButtonField btn_next; btn_next = new ButtonField("Next", ButtonField.CONSUME_CLICK); btn_next.setChangeListener(new ButtonListener6(this, c)); navButtonManager.add(btn_next); add(navButtonManager); add(new SeparatorField()); addMenuItem(saveItem6); addMenuItem(getItem6); restoreUIFieldsFromCitation(); }