BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 09-14-2007, 06:31 AM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Aug 2007
Model: 7100T
PIN: N/A
Carrier: verizon
Posts: 20
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Custom PopUp Screen

Please Login to Remove!

Hi,

How can a popupscreen be customized ? I need to add images to the border and dropshadows to the window. Also is it possible to keep the application running in background and pop-up when a PIN message is recieved.

thanks
krishnan
Offline  
Old 09-15-2007, 11:58 PM   #2 (permalink)
Thumbs Must Hurt
 
Join Date: Jun 2007
Location: Bangladesh
Model: 8800
PIN: N/A
Carrier: EDGE
Posts: 93
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi krishnan,

Quote:
Originally Posted by krishnanrajah View Post
How can a popupscreen be customized ? I need to add images to the border and dropshadows to the window. Also is it possible to keep the application running in background and pop-up when a PIN message is recieved.
You can create a custom Dialog by extending the net.rim.device.api.ui.component.Dialog class and customizing it to suit your needs.

See the following link to create a background application:
Writing a Background Application that Auto-starts

Sample code to show message from a Background application:
Code:
private void showMessage(String data) {
  UiEngine ui = Ui.getUiEngine();
  Screen screen = new Dialog(Dialog.D_OK, data, Dialog.OK,
    Bitmap.getPredefinedBitmap(Bitmap.EXCLAMATION),
    Manager.VERTICAL_SCROLL);
  ui.queueStatus(screen, 1, true);
}
Enjoy,
ARIF
Offline  
Old 09-16-2007, 12:12 AM   #3 (permalink)
Knows Where the Search Button Is
 
Join Date: Aug 2007
Model: 7100T
PIN: N/A
Carrier: verizon
Posts: 20
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Arif,

Thanks for the response.

Quote:
Originally Posted by arifzaman View Post
You can create a custom Dialog by extending the net.rim.device.api.ui.component.Dialog class and customizing it to suit your needs.
Is there a code sample available for Extending Dialog ? As far i have seen it allows the cutomization of the icon , the messages only. I need to design a totaly different looking alert screen, its like lets say a designing a popup screen with star-wars images for the background.

thanks
krishnan
Offline  
Old 09-17-2007, 08:21 PM   #4 (permalink)
New Member
 
Join Date: Sep 2007
Model: 7290
PIN: N/A
Carrier: Mail
Posts: 3
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Customizing the dialog box in net.rim.device.api.ui.component.Dialog;

Hi Arif,

Me too looking for code to change the background color of dialog box provided by net.rim.device.api.ui.component.Dialog api.

Small code snippet for how to do it will be very helpful.

Regards,
Vikas
Offline  
Old 09-18-2007, 12:16 AM   #5 (permalink)
Thumbs Must Hurt
 
Join Date: Jun 2007
Location: Bangladesh
Model: 8800
PIN: N/A
Carrier: EDGE
Posts: 93
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Vikas,

Quote:
Originally Posted by vikas1985 View Post
Hi Arif,

Me too looking for code to change the background color of dialog box provided by net.rim.device.api.ui.component.Dialog api.

Small code snippet for how to do it will be very helpful.

Regards,
Vikas
Here is a sample code to change the background color of Dialog:
Code:
/**
 * Custom Dialog
 */
public final class CustomDialog extends Dialog {   
    
    public CustomDialog() {
        super(Dialog.D_OK, "Custom Dialog", 1,
        Bitmap.getPredefinedBitmap(Bitmap.EXCLAMATION), Manager.FOCUSABLE);        
    }
    
    public void paint(Graphics graphics) {        
        graphics.setBackgroundColor(Color.RED);
        graphics.clear();
        super.paint(graphics);
    }   
}

/**
 * Add the following code, where you do like to show your custom dialog
 */
CustomDialog customDialog = new CustomDialog();
customDialog.show();
Cheers,
ARIF
Offline  
Old 09-18-2007, 04:31 PM   #6 (permalink)
New Member
 
Join Date: Sep 2007
Model: 7290
PIN: N/A
Carrier: Mail
Posts: 3
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Changing background color of Dialog

Hi Areef,

Many thanks for your code.

But don't know its some how still not changing the color. I am running your code on Blackberry simulator 7290.

I am attaching the screen shot. In which on a button's click event I have called the custom dialog box.

Any more methods to do it?

Thanks & Regards,
Vikas
Attached Images
File Type: jpg CustomDialog.JPG (46.8 KB, 32 views)
Offline  
Old 11-22-2007, 08:19 PM   #7 (permalink)
Thumbs Must Hurt
 
Join Date: May 2007
Model: 9000
PIN: N/A
Carrier: Telcel
Posts: 58
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Nice code! works like a charm.. but now I have a lil' variation i would like to get workign which I couldnt get... how can I make it show the dialog when an app is working on the background?? Let says it fires up something from an event that happens, and it pops up just a dialog to input something (dont want to load the full control of the app)
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.