How to get Dialog and popScreen getwidth()
Please Login to Remove!
Hello
i have creted Dialog screen by overriding Dialog() but i m unable to get the width() of Dialog by using the dialog.getWidth() method can any one know how to get the width of the Dialog
here is my sample method that i have used.
================================================== ===========
dialog_Login = new Dialog("", null, new int[]{0}, 0, null, Field.FOCUSABLE | Field.FIELD_BOTTOM)
{
protected void paint(Graphics g)
{
g.setBackgroundColor(Constants.BACKGROUND_COLOR);
g.clear();
super.paint(g);
System.out.println("width"+dialog_Login.getVisible Width());
//g.drawImage(new BitmapField(ResManager.getImg(ResManager.IMAGE_HEA DER),
g.drawBitmap(0,0,Constants.SCREEN_WIDTH,25,Bitmap. getBitmapResource("res/header.png"),0,0);
g.setColor(0xA9A9A9);
g.drawLine(0,0,Constants.SCREEN_WIDTH,0);
g.setFont(IFont.getFont(IFont.SYSTEM_FONT_PLAIN_14 ));
g.drawText(ResManager.getText(ResManager.TEXT_LOGI N),dialog_Login.getWidth()-IFont.getFont(IFont.SYSTEM_FONT_PLAIN_14).getAdvan ce("Login")*2-10,5);
}
protected boolean keyChar(char key, int status, int time)
{
super.keyChar(key,status,time);
boolean retval = false;
switch (key)
{
case Characters.ESCAPE:
dialog_Login.cancel();
retval = true;
break;
}
return retval;
}
};
DialogFieldManager dfm=new DialogFieldManager();
UserName_ = new TextField(ResManager.getText(ResManager.TEXT_USER_ NAME),"",20,Color.WHITE,BasicEditField.FOCUSABLE, 4, Constants.SCREEN_WIDTH-10);
Password_ = new PasswordField(ResManager.getText(ResManager.TEXT_P ASSWORD),"",16,Color.WHITE,PasswordEditField.FOCUS ABLE, 4, Constants.SCREEN_WIDTH-10);
System.out.println("Width "+dialog_Login.getWidth());
dialog_Login.add(UserName_);
dialog_Login.add(Password_);
dialog_Login.show();
|