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


Super-Micro P4DC6+ Motherboard with 2 Xeon i processors with SCSI RAID picture

Super-Micro P4DC6+ Motherboard with 2 Xeon i processors with SCSI RAID

$200.00



HP 1589 FMB-1101 Server Board w/ Intel Xeon E5-1603 @2.80GHz  w/ Ram & CPU Fan picture

HP 1589 FMB-1101 Server Board w/ Intel Xeon E5-1603 @2.80GHz w/ Ram & CPU Fan

$200.00



Windows / Linux VPS (Virtual Dedicated Server) 48GB RAM + 1500GB HDD + 3 months picture

Windows / Linux VPS (Virtual Dedicated Server) 48GB RAM + 1500GB HDD + 3 months

$329.99



POSEIDON XEON D-1500 PRODRIVE TECH BOX picture

POSEIDON XEON D-1500 PRODRIVE TECH BOX

$500.00



Intel Xeon E7-4850V4 2.10GHz 16 core 32 threads 115W 40MB CPU processor picture

Intel Xeon E7-4850V4 2.10GHz 16 core 32 threads 115W 40MB CPU processor

$358.00



Intel Xeon E7-8891 V4 2.80GHz 10-core 20-thread 140W 60MB CPU processor picture

Intel Xeon E7-8891 V4 2.80GHz 10-core 20-thread 140W 60MB CPU processor

$138.00







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