02-18-2013 06:12 AM
code : HorizontalFieldManager hfm1 =new HorizontalFieldManager(HORIZONTAL_SCROLL);
EditField emailfield = new EditField("","",100,EditField.NO_NEWLINE | EditField.FILTER_EMAIL );
hfm1.add(emailfield);
now when i enter text in editfied and after when i scrol cursor right that time text goes left inner side and not visible
like as show in image i type "abcdefgh" and then i scorol track ped right side and text like that
problem in os 7 and i tested in 5 its ok
help thanks in advance
02-18-2013 06:52 AM
02-18-2013 07:02 AM
hii simon_hain thanks for replay
and more code here
and also i upload image well image not display in crom browser its good in firefox
VerticalFieldManager vfmMain=new VerticalFieldManager()
{
protected void sublayout(int maxWidth, int maxHeight)
{
super.sublayout(ConstantData.deviceWidth,ConstantD ata.deviceHeight-ConstantData.headerHight-Constant Data.footerHight);
super.setExtent(ConstantData.deviceWidth,ConstantD ata.deviceHeight-ConstantData.headerHight-Constant Data.footerHight);
}
};
VerticalFieldManager vfmbody = new VerticalFieldManager(Manager.VERTICAL_SCROLL);
////////////////////////////////// name ////////////////////////////////////
VerticalFieldManager vfmname=new VerticalFieldManager();
////////////////////////////////// emial ////////////////////////////////////
HorizontalFieldManager hfmsubmobile =new HorizontalFieldManager(NO_HORIZONTAL_SCROLL | NO_VERTICAL_SCROLL)
{
protected void sublayout(int maxWidth, int maxHeight)
{
super.sublayout(ConstantData.deviceWidth-155,30);
super.setExtent(ConstantData.deviceWidth-155,30);
}
};
HorizontalFieldManager hfm1 =new HorizontalFieldManager(HORIZONTAL_SCROLL);
emailfield = new EditField("","",100,EditField.NO_NEWLINE | EditField.FILTER_EMAIL );
hfm1.add(emailfield);
hfmsubmobile.add(hfm1);
vfmname.add(hfmsubmobile);
////////////////////////////////// password ////////////////////////////////////
HorizontalFieldManager hfmsubemail =new HorizontalFieldManager()
{
protected void sublayout(int maxWidth, int maxHeight)
{
super.sublayout(ConstantData.deviceWidth-155,30);
super.setExtent(ConstantData.deviceWidth-155,30);
}
};
HorizontalFieldManager hfm2=new HorizontalFieldManager(Manager.HORIZONTAL_SCROLL);
passfield = new PasswordEditField("","",100,EditField.NO_NEWLINE);
hfm2.add(passfield);
hfmsubemail.add(hfm2);
vfmname.add(hfmsubemail);
vfmbody.add(vfmname);
vfmMain.add(vfmbody);
add(vfmMain);
02-19-2013 11:17 PM
please any help
02-20-2013 02:50 AM
02-20-2013 03:38 AM - edited 02-20-2013 03:40 AM
hii simon_hain thanks for replay
and sorry for that i dont send u all thinga in last code
so now here i make sample in that i have issue
import net.rim.device.api.ui.UiApplication;
public class MyApp extends UiApplication
{
public static void main(String[] args)
{
MyApp theApp = new MyApp();
theApp.enterEventDispatcher();
}
public MyApp()
{
pushScreen(new LoginScreen());
}
}
================================================== =========
package mypackage;
import net.rim.device.api.ui.Color;
import net.rim.device.api.ui.Font;
import net.rim.device.api.ui.Graphics;
import net.rim.device.api.ui.Manager;
import net.rim.device.api.ui.component.EditField;
import net.rim.device.api.ui.component.NullField;
import net.rim.device.api.ui.component.PasswordEditField;
import net.rim.device.api.ui.container.HorizontalFieldMan ager;
import net.rim.device.api.ui.container.MainScreen;
import net.rim.device.api.ui.container.VerticalFieldManag er;
import net.rim.device.api.ui.decor.BackgroundFactory;
public final class LoginScreen extends MainScreen
{
NullField ntemp;
private EditField emailfield;
private String useremail="";
private PasswordEditField passfield;
int deviceWidth=100,deviceHeight=100;
public LoginScreen()
{
deviceHeight=net.rim.device.api.system.Display.get Height();
deviceWidth=net.rim.device.api.system.Display.getW idth();
VerticalFieldManager vfmMain=new VerticalFieldManager()
{
protected void sublayout(int maxWidth, int maxHeight)
{
super.sublayout(deviceWidth,deviceHeight);
super.setExtent(deviceWidth,deviceHeight);
}
};
vfmMain.setBackground(BackgroundFactory.createSoli dBackground(Color.GRAY));
VerticalFieldManager vfmbody = new VerticalFieldManager(Manager.VERTICAL_SCROLL);
VerticalFieldManager vfmname=new VerticalFieldManager()
{
protected void sublayout(int maxWidth, int maxHeight)
{
super.sublayout(deviceWidth,120);
super.setExtent(deviceWidth,120);
}
protected void paint(Graphics graphics)
{
graphics.setColor(Color.BLACK);
graphics.setFont(Font.getDefault().derive(Font.PLA IN,20));
graphics.drawText("Email",12,(40-graphics.getFont( ).getHeight())/2);
graphics.drawText("Password",12,50+(40-graphics.ge tFont().getHeight())/2);
graphics.setColor(Color.WHITE);
graphics.fillRoundRect(112,2,deviceWidth-124,36,15 ,15);
graphics.fillRoundRect(112,52,deviceWidth-124,36,1 5,15);
super.paint(graphics);
}
};
vfmname.setBackground(BackgroundFactory.createSoli dBackground(Color.DARKGRAY));
////////////////////////////////// emial ////////////////////////////////////
HorizontalFieldManager hfmsubmobile =new HorizontalFieldManager(NO_HORIZONTAL_SCROLL | NO_VERTICAL_SCROLL)
{
protected void sublayout(int maxWidth, int maxHeight)
{
super.sublayout(deviceWidth-155,30);
super.setExtent(deviceWidth-155,30);
}
};
HorizontalFieldManager hfm1 =new HorizontalFieldManager(HORIZONTAL_SCROLL);
emailfield = new EditField("","",100,EditField.NO_NEWLINE | EditField.FILTER_EMAIL )
{
protected void paint(Graphics graphics)
{
graphics.setColor(Color.BLACK);
super.paint(graphics);
}
protected void onFocus(int arg0)
{
LoginScreen.this.invalidate();
super.onFocus(arg0);
}
protected void onUnfocus()
{
LoginScreen.this.invalidate();
super.onUnfocus();
}
};
emailfield.setFont(Font.getDefault().derive(Font.P LAIN,20));
emailfield.setMargin((30-emailfield.getFont().getH eight())/2,0,0,0);
hfm1.add(emailfield);
hfmsubmobile.add(hfm1);
hfmsubmobile.setMargin(5,0,0,120);
vfmname.setMargin(20,0,0,0);
vfmname.add(hfmsubmobile);
////////////////////////////////// password ////////////////////////////////////
HorizontalFieldManager hfmsubemail =new HorizontalFieldManager()
{
protected void sublayout(int maxWidth, int maxHeight)
{
super.sublayout(deviceWidth-155,30);
super.setExtent(deviceWidth-155,30);
}
};
HorizontalFieldManager hfm2=new HorizontalFieldManager(Manager.HORIZONTAL_SCROLL);
passfield = new PasswordEditField("","",100,EditField.NO_NEWLINE)
{
protected void paint(Graphics graphics)
{
graphics.setColor(Color.BLACK);
super.paint(graphics);
}
protected void onFocus(int arg0)
{
LoginScreen.this.invalidate();
super.onFocus(arg0);
}
protected void onUnfocus()
{
LoginScreen.this.invalidate();
super.onUnfocus();
}
};
passfield.setFont(Font.getDefault().derive(Font.PL AIN,20));
passfield.setMargin((30-passfield.getFont().getHei ght())/2,0,0,0);
hfm2.add(passfield);
hfmsubemail.add(hfm2);
hfmsubemail.setMargin(20,0,0,120);
vfmname.setMargin(50,0,0,0);
vfmname.add(hfmsubemail);
vfmbody.add(vfmname);
vfmMain.add(vfmbody);
add(vfmMain);
}
}
i type "abcdefghij" and after scroll right usinf trachped
in os 7.0 device
and yes i need scroll in editfield so i able to type as long as i want
02-25-2013 05:26 AM
hello anyone can help........!
02-25-2013 07:28 AM
You have given us a lot of code. Too much for me to investigate in detail atm sorry.
I agree with SImon's suggestion, you have a HFM that is scrollable, and when you move the trackpad on that Field, it scrolls. There are some other oddities in your code that might be getting in the way too - like the way you force the extent for some Managers.
Rather than try to fix your current code, i suggest you review this KB article and rework your code around how it does it.
02-25-2013 08:59 AM
ok peter thanks for replay
you and simon find my exact problem thats horizontal scroll i also test and rech at there
my upper given code is silliler as peter given KB Artical code
as given in KB artical i test both code but in that also same issue if u run that in os 7 and write some string then scroll it right its text hide while still space is available on horizontal field
as given upper image
in short i want one line editfield and also scrollable but need scroll after at the end of its manezer width limit
but hete if u type a single character and scroll right its hide character
is there any good way to solve that issue ?
02-25-2013 09:58 AM
Just to confirm, the problem is that the code from the KB article does not work correctly in OS 7.0? Specifically, in OS 7.0 you can use the trackpad and scroll right to hide the text?