BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 04-27-2009, 08:01 AM   #1 (permalink)
New Member
 
Join Date: Mar 2009
Model: 9000
PIN: N/A
Carrier: Rogers
Posts: 2
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default ButtonField Wierdness on Storm

Please Login to Remove!

Have put 2 ButtonFields into a HorizontalFieldManager and am repositioning this on the screen using sublayout override. Buttons respond to scrolling, and enter key press, but one of them is not responding to screen touch. The other button responds correctly. Problem goes away in the containing HorizontalFieldManager is not re-positioned, or if the button's preferred width is set to be a large value (eg. > 50 pixels). From what I can tell, setPositionChild is causing the problem - but I can't understand why.

Has anyone seen this before? I am including code just in case there is something really basic I am missing.



Thanks







public class TestScreen extends MainScreen {


ButtonField aBut1 = new ButtonField("<", ButtonField.CONSUME_CLICK);
ButtonField aBut3 = new ButtonField(">", ButtonField.CONSUME_CLICK );

public TestScreen() {

VerticalFieldManager vfm = new VerticalFieldManager(NO_HORIZONTAL_SCROLL |
NO_VERTICAL_SCROLL | USE_ALL_HEIGHT | USE_ALL_HEIGHT) {


protected void sublayout(int maxWidth, int maxHeight) {

super.sublayout(Display.getWidth(), Display.getHeight());

int iCount = getFieldCount();

for (int i = 0; i < iCount; i++) {

Field aField = getField(i);

layoutChild(aField, maxWidth, Display.getHeight());

if (aField instanceof HorizontalFieldManager) { // reposition hfm

setPositionChild(aField, (Display.getWidth() - aField.getWidth()) / 2, Display.getHeight() /2 );
}
}
setExtent(Display.getWidth(), Display.getHeight());
}
};



HorizontalFieldManager hfmButt = new HorizontalFieldManager();

LabelField label = new LabelField("label text");


aBut1.setChangeListener(choseListener);
aBut3.setChangeListener(choseListener);



hfmButt.add(aBut1);
hfmButt.add(label);
hfmButt.add(aBut3);



vfm.add(hfmButt);

add(vfm);
}



FieldChangeListener choseListener = new FieldChangeListener() {

public void fieldChanged(Field field, int context) {

DoSomething();

}
};
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

1PC Siemens PLC Module EM253 6ES7 253-1AA22-0XA0 6ES7253-1AA22-0XA0
$539.99
1PC Siemens PLC Module EM253 6ES7 253-1AA22-0XA0 6ES7253-1AA22-0XA0 pictureSiemens Breaker VDE 0660/IEC 947-2, 3 Pole, 50 Amp
$25.0
Siemens Breaker VDE 0660/IEC 947-2, 3 Pole, 50 Amp picture1 PC new Siemens 6ES5 944-7UB11
$2678.2
1 PC  new Siemens 6ES5 944-7UB11  pictureSiemens 6ES5441-7LA13 Digital Output Module
$350.0
Siemens 6ES5441-7LA13 Digital Output Module pictureNew original Siemens 6ES7452-1AH00-0AE0 in box
$650.0
New original Siemens 6ES7452-1AH00-0AE0 in box picture






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