BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 06-15-2009, 07:44 AM   #1 (permalink)
Thumbs Must Hurt
 
abhsax1978@hotmail.com's Avatar
 
Join Date: Jun 2008
Location: NOIDA
Model: 8100
OS: 4.2.1.91
PIN: 2052AEF9
Carrier: Soft. Engg.
Posts: 111
Post Thanks: 4
Thanked 0 Times in 0 Posts
Unhappy I am showing three BitmapFields focusable in the statusBar

Please Login to Remove!

Dear Sir/Ma'am
I am showing three BitmapFields focusable in the statusBar (passing the object of fieldManager which has these BitmapFields). On the response from an HttpConnection Thread, one of these clickable items disappear, though the item is present , if I comment the setPositionChild(field, x, y); on the other two fields, it starts showing, but the two buttons do not show on their intended position.

I am using VerticalFieldManager, is that causing the trouble?

Regards
__________________
having new s for developers!!!
Offline  
Old 06-16-2009, 04:22 AM   #2 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2007
Location: Ernakulam, Kerala, India
Model: 8320
Carrier: Airtel
Posts: 65
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default BitmapFields

Hi Abhsax

I think you should look int the layout you have done. There may be some problems over there, or may be @ the paint side. If it's possible for you to paste the code snippet It 'll give more info for others to get what is wrong.
__________________
Regards
Anand.
Offline  
Old 06-24-2009, 07:00 AM   #3 (permalink)
Thumbs Must Hurt
 
abhsax1978@hotmail.com's Avatar
 
Join Date: Jun 2008
Location: NOIDA
Model: 8100
OS: 4.2.1.91
PIN: 2052AEF9
Carrier: Soft. Engg.
Posts: 111
Post Thanks: 4
Thanked 0 Times in 0 Posts
Unhappy Hi Sir

PHP Code:
protected void sublayout(int arg0int arg1) {
        
super.sublayout(arg0arg1);
        final 
int width getPreferredWidth();
        final 
int height getPreferredHeight();
        
setExtent(widthheight);

        
int optX width - (bmpField.getWidth() + 10);
        
int optY = (height 2) - (bmpField.getHeight() / 2);
        try {
            
setPositionChild(bmpFieldoptXoptY);
        } catch (
Exception e) {
        }
        try {
            
setPositionChild(left, (Constants.SCREEN_WIDTH 2) - 205);
        } catch (
Exception e) {
        }
        try {
            
setPositionChild(right, (Constants.SCREEN_WIDTH 2) + 205);
        } catch (
Exception e) {
        }

    } 
I hope you can recognize the fields. Moreover I am deletind and adding the elements again on each response. Commenting the left and right button in above makes the bmpField visible. I tried the change in the alignment.
__________________
having new s for developers!!!
Offline  
Old 06-24-2009, 07:03 AM   #4 (permalink)
Thumbs Must Hurt
 
abhsax1978@hotmail.com's Avatar
 
Join Date: Jun 2008
Location: NOIDA
Model: 8100
OS: 4.2.1.91
PIN: 2052AEF9
Carrier: Soft. Engg.
Posts: 111
Post Thanks: 4
Thanked 0 Times in 0 Posts
Default There is paint section along with the above

PHP Code:
protected void paintBackground(Graphics g) {
        
g.drawBitmap(00statusBar.getWidth(), statusBar.getHeight(), statusBar00);
        
g.setColor(Color.WHITE);

        
super.paint(g);
    }

    protected 
void paint(Graphics g) {
//        if (doFocus) {

        
g.setFont(Font.getDefault().derive(Font.BOLD12Ui.UNITS_px));
        
int strHght getFont().getHeight();
        
g.drawText(Constants.BASE_BAR_TEXT10, (statusBar.getHeight() / 2) - (strHght 2));
        
super.paint(g);
//        } 
__________________
having new s for developers!!!
Offline  
Old 06-24-2009, 07:52 AM   #5 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2007
Location: Ernakulam, Kerala, India
Model: 8320
Carrier: Airtel
Posts: 65
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Bitmapfields

Hi Abhsax,

I think you miss out something to write inside the sub layout method,
Where did you mention the layoutChild(field, width, height) I think you haven't
mentioned, If so please do and see if it fixes.

Also I have some suggestions.

1) Move the super.sublayout to last statement of the sublayout method body.

2) Move setExtent(width, height) to a place after setPosition(childfield, x, y).

P.S. Update here If you find a solution.
__________________
Regards
Anand.
Offline  
Old 07-14-2009, 05:22 AM   #6 (permalink)
Thumbs Must Hurt
 
abhsax1978@hotmail.com's Avatar
 
Join Date: Jun 2008
Location: NOIDA
Model: 8100
OS: 4.2.1.91
PIN: 2052AEF9
Carrier: Soft. Engg.
Posts: 111
Post Thanks: 4
Thanked 0 Times in 0 Posts
Question

I have tried the above options, but I can not see any of the buttons at all.
Though the presence of these buttons is detected.

I have tried using different managers for each of the control.

Please help.
__________________
having new s for developers!!!
Offline  
Old 07-15-2009, 12:15 AM   #7 (permalink)
Thumbs Must Hurt
 
abhsax1978@hotmail.com's Avatar
 
Join Date: Jun 2008
Location: NOIDA
Model: 8100
OS: 4.2.1.91
PIN: 2052AEF9
Carrier: Soft. Engg.
Posts: 111
Post Thanks: 4
Thanked 0 Times in 0 Posts
Default

Some good news:

In storm, I used the usual code that I have posted. The result is the same as required. The app is working fine. Just I am using different HorizontalFieldManagers for each of the button.

I have to override TrackWheelClick and TouchEvent for each of these managers.

Regards
__________________
having new s for developers!!!
Offline  
Old 09-08-2009, 06:20 AM   #8 (permalink)
Thumbs Must Hurt
 
abhsax1978@hotmail.com's Avatar
 
Join Date: Jun 2008
Location: NOIDA
Model: 8100
OS: 4.2.1.91
PIN: 2052AEF9
Carrier: Soft. Engg.
Posts: 111
Post Thanks: 4
Thanked 0 Times in 0 Posts
Default

Solution:
override the OnTrackWheelRoll of the screen and return false, inside write: setDirty(false); this will refresh the screen every time the track wheel rolls.

Regards
__________________
having new s for developers!!!
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.