BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 09-14-2007, 05:31 AM   #1
krishnanrajah
Knows Where the Search Button Is
 
Join Date: Aug 2007
Model: 7100T
PIN: N/A
Carrier: verizon
Posts: 20
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, 10:58 PM   #2
arifzaman
Thumbs Must Hurt
 
Join Date: Jun 2007
Location: Bangladesh
Model: 8800
PIN: N/A
Carrier: EDGE
Posts: 93
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:
http://www.blackberryforums.com/deve...to-starts.html

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-15-2007, 11:12 PM   #3
krishnanrajah
Knows Where the Search Button Is
 
Join Date: Aug 2007
Model: 7100T
PIN: N/A
Carrier: verizon
Posts: 20
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, 07:21 PM   #4
vikas1985
New Member
 
Join Date: Sep 2007
Model: 7290
PIN: N/A
Carrier: Mail
Posts: 3
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-17-2007, 11:16 PM   #5
arifzaman
Thumbs Must Hurt
 
Join Date: Jun 2007
Location: Bangladesh
Model: 8800
PIN: N/A
Carrier: EDGE
Posts: 93
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, 03:31 PM   #6
vikas1985
New Member
 
Join Date: Sep 2007
Model: 7290
PIN: N/A
Carrier: Mail
Posts: 3
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
Asskick
Thumbs Must Hurt
 
Join Date: May 2007
Model: 9000
PIN: N/A
Carrier: Telcel
Posts: 58
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



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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


IBM Genuine OEM Printer Filler Wide Credit Card Holder 10N1259 picture

IBM Genuine OEM Printer Filler Wide Credit Card Holder 10N1259

$24.79



IBM Correctable Ribbon Cassette Black 1299300 NOS Original OEM picture

IBM Correctable Ribbon Cassette Black 1299300 NOS Original OEM

$2.99



Genuine IBM Selectrric Motor Bushing 10 Pack OEM  P/N 1236572 picture

Genuine IBM Selectrric Motor Bushing 10 Pack OEM P/N 1236572

$7.99



IBM CASH DRAWER KEY'S #9960 SET OF 2 KEYS. AFTERMARKET KEY'S SAME AS OEM 33G3360 picture

IBM CASH DRAWER KEY'S #9960 SET OF 2 KEYS. AFTERMARKET KEY'S SAME AS OEM 33G3360

$18.00



OEM  IBM Type 5441 WheelWriter 3 1356658 1362400-02 Main Boards Tested Working picture

OEM IBM Type 5441 WheelWriter 3 1356658 1362400-02 Main Boards Tested Working

$34.99



IBM WHEELWRITER TYPEWRITER TRANSPORT MOTOR Series II - OEM wheelwriter parts picture

IBM WHEELWRITER TYPEWRITER TRANSPORT MOTOR Series II - OEM wheelwriter parts

$28.00







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