06-01-2011 05:37 AM
hi all,
i want create gui like equal sapce for all buttons
so how can i create equal space toolbar.
06-01-2011 05:42 AM
what do u mean by equal space ??? do u want to say equal size ? width? height??
06-01-2011 05:59 AM
thanks for reply,
yes equal size .
i mean if there is a three buttons in toolbar all are same size , same width. its text may differen latters.
like toolbar.
06-01-2011 06:13 AM
u can use getpreferredwidth & height to return a constant width height, and use setextent(fixed_width, fixed_height) in layout() method of buttonfield
06-01-2011 06:17 AM
The last North American Devcon provided a Equal Space Tool Bar Manager sample code. You can find the soruce by downloading the material for Dev 19, which was on Day 2. You can find the DevCon sessions by logging on to the Developer Zone and looking for the DevCon button. This link might get you there too.
06-01-2011 06:17 AM
like...............
ButtonField LogonButton = new ButtonField(mLoginButtonText,
ButtonField.CONSUME_CLICK) {
protected void layout(int width, int height) {
super.layout(width, height);
setExtent(XXX, YYY);
};
public int getPreferredHeight() {
return YYY;
};
public int getPreferredWidth() {
return XXX;
};
06-01-2011 06:33 AM - edited 06-01-2011 06:34 AM
thanks peter for reply and give me a nice link
06-01-2011 07:07 AM
The code is well worth studying, the guy(s) that created understand the Ui and how to get the best from it.
Same guy as helped with this, did these:
Personally I have found the code form the DevCon better.
If this works for you, can you mark this as solved?