Search Results

Search found 8 results on 1 pages for 'dachmt'.

Page 1/1 | 1 

  • Blackberry horizontal scroll in bottom menu bar

    - by Dachmt
    Hi, I have a MainScreen that has an overlay menu at the bottom of the screen, over a map. To do that, I have an MenuHoster (extends HorizontalFieldManager) that takes all width of the screen, 45px height and at the bottom of the screen. It overlays a map. In my MenuHoster, and add another HorizontalFieldManager that has a background image (my menu bar image) and focusable buttons. I have too many buttons to be all in my screen, so I want to an horizontal screen. When I create my second HorizontalFieldManager that hosts the buttons, I define the Manager.HORIZONTAL_SCROLL as style. My buttons are focusable, but nothing happens... The focus change to the next buttons but my HorizontalFieldManager does not scroll... I tried putting the same parameter in my MenuHoster HorizontalFieldManager, the scroll is working but all my screen goes right or left, and I want only the content of my menu bar... So there is my map and my menu going left, my buttons at the bottom and the rest of the screen white. Any idea why my second HorizontalFieldManager hosting the buttons does not scoll? Thank you!

    Read the article

  • Blackberry custom OVERLAY horizontal menu

    - by Dachmt
    Thanks to Max in this post, I made an horizontal menu. But now I'm trying to make an overlay menu, i I don't find how to do that... Let's see what i got first. So, I have a class MapScreen which display my map: public class MapScreen extends MenuScreen Then, I have in the same file the MenuScreen class like this that allows to display the horizontal menu when I press the MENU key: abstract class MenuScreen extends MainScreen { boolean mMenuEnabled = false; CyclicHFManager mMenuManager = null; public MenuScreen() { mMenuManager = new CyclicHFManager(); mMenuManager.setBorder(BorderFactory.createBevelBorder(new XYEdges(4, 0, 0, 0), new XYEdges(Color.DARKBLUE, 0, 0, 0), new XYEdges( Color.WHITE, 0, 0, 0))); mMenuManager.setBackground(BackgroundFactory .createLinearGradientBackground(Color.DARKBLUE, Color.DARKBLUE, Color.LIGHTBLUE, Color.LIGHTBLUE)); for (int i = 0; i < 10; i++) { Bitmap nBitmap = new Bitmap(60, 60); Graphics g = new Graphics(nBitmap); g.setColor(Color.DARKBLUE); g.fillRect(0, 0, 60, 60); g.setColor(Color.WHITE); g.drawRect(0, 0, 60, 60); Font f = g.getFont().derive(Font.BOLD, 40); g.setFont(f); String text = String.valueOf(i); g.drawText(text, (60 - f.getAdvance(text)) >> 1, (60 - f .getHeight()) >> 1); Bitmap fBitmap = new Bitmap(60, 60); g = new Graphics(fBitmap); g.setColor(Color.DARKBLUE); g.fillRect(0, 0, 60, 60); g.setColor(Color.GOLD); g.drawRect(0, 0, 60, 60); g.setFont(f); g.drawText(text, (60 - f.getAdvance(text)) >> 1, (60 - f .getHeight()) >> 1); BitmapButtonField button = new BitmapButtonField(nBitmap, fBitmap); button.setCookie(String.valueOf(i)); button.setPadding(new XYEdges(0, 18, 0, 18)); button.setChangeListener(new FieldChangeListener() { public void fieldChanged(Field field, int context) { Dialog.inform("Button # " + (String) field.getCookie()); } }); mMenuManager.add(button); } } protected boolean keyDown(int keycode, int time) { if (Keypad.KEY_MENU == Keypad.key(keycode)) { if (mMenuManager.getManager() != null) { delete(mMenuManager); mMenuManager.mCyclicTurnedOn = false; } else { add(mMenuManager); mMenuManager.getField(2).setFocus(); mMenuManager.mCyclicTurnedOn = true; } return true; } else { return super.keyDown(keycode, time); } }} And finally my menu manager: public class CyclicHFManager extends HorizontalFieldManager { int mFocusedFieldIndex = 0; public boolean mCyclicTurnedOn = false; public void focusChangeNotify(int arg0) { super.focusChangeNotify(arg0); if (mCyclicTurnedOn) { int focusedFieldIndexNew = getFieldWithFocusIndex(); if (focusedFieldIndexNew != mFocusedFieldIndex) { if (focusedFieldIndexNew - mFocusedFieldIndex > 0) switchField(0, getFieldCount() - 1); else switchField(getFieldCount() - 1, 0); } } else { mFocusedFieldIndex = getFieldWithFocusIndex(); } } private void switchField(int prevIndex, int newIndex) { Field field = getField(prevIndex); delete(field); insert(field, newIndex); }} So as it is like this, it is working: when I press the MENU key, the menu appears, i can navigate between buttons, and it disappear when I press again the same key. The only problem is my menu isn't overlaying my map, it pushes the content up. I tried with the menu manager like in your first response, resizing the content manager but it is the same result. Max gave me the link http://stackoverflow.com/questions/1497073/blackberry-fields-layout-animation to do so, but I really don't know how to use it to make it work in my project... Thank you for your help! UPDATE This works great, it's what I wanted. However, I still have a problem because I'm under 4.5. So first in the MenuHostManager constructor, I deleted the USE_ALL_HEIGHT and change setPositionChild(mMenuManager, 0, Display.getHeight() - mMenuManager.getPreferredHeight()); like this to have the menu at the bottom of the screen. It worked. Then, instead of drawing my bitmaps, I did this: Bitmap nBitmap = EncodedImage.getEncodedImageResource("menu" + i + ".png").getBitmap(); BitmapButtonField button = new BitmapButtonField(nBitmap, nBitmap); And it worked too (no rollover for now, later). So it is great! I also overwrite the Paint method of my CyclicHFManager to have a background color, because I can't use the BorderFactory and BackgroundFactory... My menu bar has a color for now so it's ok. Then, because of these 2 classes missing, in my BitmapButtonField I had to delete the 2 setBorder functions that change the borders. And now i have my buttons pretty big like normal buttons with borders... How can I make the same effect as the setBorder functions under 4.5? (BTW, setBorder is not working under 4.5 too...). Thank you!

    Read the article

  • Blackberry SDK 4.2.1 not available in Eclipse Plug-in 1.1

    - by Dachmt
    Hi there, I need to develop an application for Blackberry Java SDK 4.2.1 and above. I'm currently under Eclipse Classic 3.5, and I have installed the BlackBerry Java Plug-in for Eclipse v1.1, with all the Blackberry Java SDK available, versions 4.5 to 5.0. Unfortunately, there isn't any SDK available under 4.5. Is anyone know how to solve this problem? I mean, developing for Blackberry Java SDK 4.2.1 with Eclipse IDE. Thank you.

    Read the article

  • Blackberry read local properties file in project

    - by Dachmt
    Hi, I have a config.properties file at the root of my blackberry project (same place as Blackberry_App_Descriptor.xml file), and I try to access the file to read and write into it. See below my class: public class Configuration { private String file; private String fileName; public Configuration(String pathToFile) { this.fileName = pathToFile; try { // Try to load the file and read it System.out.println("---------- Start to read the file"); file = readFile(fileName); System.out.println("---------- Property file:"); System.out.println(file); } catch (Exception e) { System.out.println("---------- Error reading file"); System.out.println(e.getMessage()); } } /** * Read a file and return it in a String * @param fName * @return */ private String readFile(String fName) { String properties = null; try { System.out.println("---------- Opening the file"); //to actually retrieve the resource prefix the name of the file with a "/" InputStream is = this.getClass().getResourceAsStream(fName); //we now have an input stream. Create a reader and read out //each character in the stream. System.out.println("---------- Input stream"); InputStreamReader isr = new InputStreamReader(is); char c; System.out.println("---------- Append string now"); while ((c = (char)isr.read()) != -1) { properties += c; } } catch (Exception e) { } return properties; } } I call my class constructor like this: Configuration config = new Configuration("/config.properties"); So in my class, "file" should have all the content of the config.properties file, and the fileName should have this value "/config.properties". But the "name" is null because the file cannot be found... I know this is the path of the file which should be different, but I don't know what i can change... The class is in the package com.mycompany.blackberry.utils Thank you!

    Read the article

  • Blackberry license screen agreement like Facebook

    - by Dachmt
    Hi, I have a "basic" license agreement screen for now, a Screen with a title set and vertical field containing a textfield, separatorfield and then 2 buttons (accept or decline). The license is pretty long, it's annoying going all the way down (except with the storm it's pretty easy) and I want a kind of popup screen showing the license and the 2 buttons at the bottom. To give you an example, the exact SAME as the Facebook or App World application's license screen agreement! When you scroll the text, it's going a lot faster and it's visualy great. Thank you!

    Read the article

  • BlackBerry - Custom menu toolbar

    - by Dachmt
    Hi I'm a beginner in BlackBerry programming, I need to replace in my application the default menu (when you press the menu button) by a custom menu, horizontal. The best to describe is I want the same result as the WeatherEye application for BlackBerry... I know how to create the default menu, but this one I have no idea! Thank you,

    Read the article

  • Create a custom menu for BlackBerry

    - by Dachmt
    Hi I'm a beginner in BlackBerry programming, I need to replace in my application the default menu (when you press the menu button) by a custom menu, horizontal. The best to describe is I want the same result as the WeatherEye application for BlackBerry... I know how to create the default menu, but this one I have no idea! Thank you,

    Read the article

  • HorizontalFieldmanager overlay

    - by Dachmt
    Hi, I have a VerticalFieldManager that takes all my screen, and I want to put an HorizontalFieldmanager at the bottom of the screen (menu bar that appear and disappear like the WeatherEye menu bar) that overlay the VerticalFieldManager. Any idea? I think it's something with overwriting the paint or sublayout methods but I have no clue how to implement this... Thanks to Max, I have almost everything, but in my other post it resize the VerticalFieldManager instead of having the HorizontalFieldmanager overlaying it. Thank you!

    Read the article

1