Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
Posts: 124
Registered: ‎04-29-2009
My Device: Not Specified
Accepted Solution

Shortcut Bar

hai

I found a thread regarding shortcut bar but found no answer for it.wish to get answer for this thread.

 

 

I saw the shortcut bar used in blackberry storm.it looks cool.tried hard to implement the shortcut bar,but it doesn't look nice.

 

I would like to know the exact procedure in creating it."sample code" if anybody can provide will be very useful.

 

 

waiting to get solution for this thread 

kamala

Developer
Posts: 696
Registered: ‎12-02-2008
My Device: Not Specified

Re: Shortcut Bar

Hi,

 

Did not get what exactly you want to know.

 

"Shortcut bar" refers to what.

 

If I am guessing correctly you want to show some option on screen clicking on which you can perform some action.

 

Please clarify a little.

 

 

Regards,
Rajat Gupta.
--------------------------------------------------------------------------------
If your problem was get solved then please mark the thread as "Accepted solution" and kudos - your wish
New Developer
Posts: 124
Registered: ‎04-29-2009
My Device: Not Specified

Re: Shortcut Bar

hai,

I am referring to the shortcut bar present in the touch screen bb storm.

 

 

it looks like tabbed buttons.touch down event displays a tooltip and up event pushes a screen appropriate to it.

 

see this link:http://na.blackberry.com/eng/deliverables/6625/Shortcut_bars_516531_11.jsp

 

 

kamala

Highlighted
Developer
Posts: 696
Registered: ‎12-02-2008
My Device: Not Specified

Re: Shortcut Bar

Hi,

 

You mentioned you had tried some code for developing shortcut bar. I had also done something related to it may this is different from what you have done.

 

Below is the code.

 

Hope it will help you.

 

HorizontalFieldManager rowManager = new HorizontalFieldManager(){
                 
                  public void sublayout(int width, int height){
                      super.sublayout(LooknFeel.WIDTH,Bitmap.getBitmapResource("signin.png").getHeight());
                      setExtent(LooknFeel.WIDTH,Bitmap.getBitmapResource("signin.png").getHeight());
                  }
                 
                 
                  public void paint(Graphics g){
                           g.setBackgroundColor(Color.BLACK);
                           g.fillRect(0,0,LooknFeel.WIDTH,getHeight());
                           g.clear();
                           super.paint(g);
                      }
           
        };

 

private void drawBitampfield(){
        button_1 = new BitmapField(Bitmap.getBitmapResource("signin.png"),BitmapField.FOCUSABLE){
                                
                     protected boolean invokeAction(int action){
                         System.out.println("**********************[ ONE ] ************************");
                         userName = befUserName.getText();
                         Password = befPassword.getText();
               
                            if(befUserName.getText().length()==0 || befPassword.getText().length()==0){
                                   Dialog.alert("Field Empty");
                                   return true;
                            }              
                           
               
                         requestData = "LBM_ACTION=1" +"&userId="+userName.trim()+"&password="+Password.trim()+"&applicationId="+ "1240473929505";
                         GeoMain.RequestType = GeoMain.REQUEST_SIGNIN;
                         GeoMain.RequestStatus = GeoMain.STATUS_INCOMPLETE;               
               
                         conn = new HttpCommunication(requestData);
                         conn.startConnection();
                         UiApplication.getUiApplication().getActiveScreen().getVirtualKeyboard().setVisibility(VirtualKeyboard.HIDE);
                         UiApplication.getUiApplication().pushScreen(new WaitScreen(new StartingScreen(true))); 
                         return true;
                      }
                    
                     protected void onUnfocus() {
                            rowManager.invalidate();
                            super.onUnfocus();
                        }
                    

                };
            button_2 = new BitmapField(Bitmap.getBitmapResource("reset.png"),BitmapField.FOCUSABLE){
                      protected boolean invokeAction(int action){
                         System.out.println("**********************[ TWO ] ************************");
                         befUserName.setText("");
                         befPassword.setText("");
                         return true;
                     }
                    
                     protected void onUnfocus() {
                            rowManager.invalidate();
                            super.onUnfocus();
                        }

                };
            button_3 = new BitmapField(Bitmap.getBitmapResource("exit.png"),BitmapField.FOCUSABLE){
                              
                    
                    
                     protected boolean invokeAction(int action){
                         System.out.println("**********************[ THREE ] ************************");
                         int result  = Dialog.ask(Dialog.D_YES_NO,"Do You want to Exit");
                         if(result == Dialog.YES){
                                System.exit(0);
                         }  
                         return true;
                     }
                    
                    
                     protected void onUnfocus() {
                       
                            rowManager.invalidate();
                            super.onUnfocus();
                        }

                };
               
        
           
            rowManager.add(new SeparatorField(SeparatorField.LINE_VERTICAL){
                           protected void layout(int width, int height){
                             super.layout(10,Bitmap.getBitmapResource("exit.png").getHeight());
                             setExtent(10,Bitmap.getBitmapResource("exit.png").getHeight());
                           }
                          
             });
            rowManager.add(button_1);
            rowManager.add(new SeparatorField(SeparatorField.LINE_VERTICAL){
                           protected void layout(int width, int height){
                             super.layout(10,Bitmap.getBitmapResource("exit.png").getHeight());
                             setExtent(10,Bitmap.getBitmapResource("exit.png").getHeight());
                           }
                          
             });
            rowManager.add(button_2);
            rowManager.add(new SeparatorField(SeparatorField.LINE_VERTICAL){
                           protected void layout(int width, int height){
                             super.layout(10,Bitmap.getBitmapResource("exit.png").getHeight());
                             setExtent(10,Bitmap.getBitmapResource("exit.png").getHeight());
                           }
                          
             });
            rowManager.add(button_3);
            rowManager.add(new SeparatorField(SeparatorField.LINE_VERTICAL){
                           protected void layout(int width, int height){
                             super.layout(10,Bitmap.getBitmapResource("exit.png").getHeight());
                             setExtent(10,Bitmap.getBitmapResource("exit.png").getHeight());
                           }
                          
             });
           
            setStatus(rowManager);
           
       
    }

 

 Please let me know if this helped you or not.

Regards,
Rajat Gupta.
--------------------------------------------------------------------------------
If your problem was get solved then please mark the thread as "Accepted solution" and kudos - your wish
New Developer
Posts: 124
Registered: ‎04-29-2009
My Device: Not Specified

Re: Shortcut Bar

hai rajat,

       ur code was really helpfull.on my search i found a code for tooltip but i get jvm 104 error.i found the code in one of the thread in this forum,titled "problem with tooltip?".  hope u can help me.

 

can i know the databse used for creating applications like ap news.is it sybase(guess).

as i am new i am finding ur post very helpfull.

thanks

kamala

Developer
Posts: 696
Registered: ‎12-02-2008
My Device: Not Specified

Re: Shortcut Bar

Hi,

 

I trying to develop functionality related to tool tip.

 

Can you post the code which gives error so that we can identify the reason behind it.

 

Does my code solved your problem of shortcut bar.

Regards,
Rajat Gupta.
--------------------------------------------------------------------------------
If your problem was get solved then please mark the thread as "Accepted solution" and kudos - your wish
New Developer
Posts: 124
Registered: ‎04-29-2009
My Device: Not Specified

Re: Shortcut Bar

hai rajat,

                yes,of course it did.

          

                the fact that the background colour is not equal to the one in the bb storm.that's k (v can resolve it soon.).nyway thanks for ur code.

 

 

 

this is the link for the thread i saw.

http://supportforums.blackberry.com/rim/board/message?board.id=java_dev&message.id=11753

kamala

Developer
Posts: 696
Registered: ‎12-02-2008
My Device: Not Specified

Re: Shortcut Bar

Hi,

 

If your problem got solved then resolved this thread and open new query in another thread, thats the standard way things are done on the forum.

 

Regarding your tooltip question are you using the same code as shown in that thread.

Regards,
Rajat Gupta.
--------------------------------------------------------------------------------
If your problem was get solved then please mark the thread as "Accepted solution" and kudos - your wish
Developer
Posts: 1,477
Registered: ‎12-30-2008
My Device: Torch 9810

Re: Shortcut Bar

AFAIK I know, JVM 104 error will not come on real device! Did you test in a real device?

 

Cheers..

--
Manimaran Selvan
Co-Founder, Tech Lead,
Equity Markets Research Group
New Developer
Posts: 124
Registered: ‎04-29-2009
My Device: Not Specified

Re: Shortcut Bar

hai rajat,

             sure ,I shall start a new thread for that.yes,I used the same code used in that thread.will now start a new thread for that.

kamala