Hiding a field in Black Berry - blackberry

I would like to toggle two Fields on a screen, like a simulated tab screen. I tried creating a HorizontalFieldManager and populating it with Field A, then to toggle deleteAll() and add() Field B. Then Repeat to switch them. (Triggered by a button) This works, but in the simulator is locks up after doing this five times. I haven't tried it on a device yet. Is there a better way to to this, or is this pretty much the only way to do something like that?

It sounds like what you want to do is covered by this support article: Create tabbed view screens. I haven't tried it though.

Related

navigation with login page

I implemented simple application according of example simple login view. Where we have login-view and main-view. But now, how I can implement on main-view MenuBar where every Items when clicked open different views. And those views are under MenuBar in same place (center on the page under MenuBar, on sample) in main-view. I tried with additional navigator(which name can be subNavigator) in main-view but we must register navigator in UI(I have got appropriate error). Second solution is that I create UI and in init method ManuBar and under it change every views(login-view, view1, view2 etc). But login-view have ManuBar and it is do not looks good. Is there any other way or are other ways to achieve something similar?
Your question is not at all clear. I suggest re-writing it. Perhaps with a sketch image.
TabSheet
Are you aware of the TabSheet widget? An easy way to switch between panes of content.
See the Book Of Vaadin, the class doc, and the live demo.
Also, look at TabSheet in the Reindeer theme as shown in this demo.

Can WatchKit WKInterfaceGroup be a Button?

(using iOS8.3, Xcode6.3, OSX10.10.3)
Hi, I wonder if a WatchKit WKInterfaceGroup can be a Button ??
In my watchkit-application, I would like to maximize the touch-surface for a particular action.
I know that one can place one or more buttons in a goup (next to other things like labels, images etc). Having such a WKInterfaceGroup (called group) with small items in it - I thought of placing several buttons, all filling out the empty space between the groups container.
But by placing several buttons close to each other in the group, even if they all reference to the very same action, I realised that touching two buttons by the user's finger in the group would not lead me to the desired surface-increase.
The problem is, the user-finger touches more than one button at once and even tough, I gave all the buttons in the group, as just mentioned, the very same action behind, the action does not get fired off.
The solution might be, if possible, to define the entire group as a button. How would that work ?? (...maybe accessibility traits could help ?? or other....???). Or can you somehow overlay a button on to a group ???
Any idea appreciated !
You can use a WKInterfaceButton, change its content type to "group" in the attributes inspector in IB and fill it with whatever content you need.

How access items in an array based on button combinations in ios

Before I start I want to explain that I'm looking for a general solution to my inquiry, I don't have any code to show because I haven't the faintest idea of how to start. Let's say I have a program in which I have 4 buttons, two on the right (red and blue), two on the left (white and yellow). If I were to press a certain combination of buttons I want to get a specific output an example would be if I touch the red button and then the white one the word "cow" appears or if were to touch the white one then the red one the word "chicken" appears. Is there any documentation that anyone knows of that can help me with my problem? Can this even be done with an array?
HotLicks has a valid answer, but I think an NSDictionary is a better solution. Create keys based on button presses, like:
#{ #"RedWhite" : #"Cow",
#"WhiteRed" : #"Chicken" };
Your code will be easier to read, and you can support three presses easily (assuming you're working with a timer that you invalidate after each press) by just adding another key; no recalculating your array:
#{ #"RedWhiteBlue" : #"America" };

How to hide border around TRadioGroup

I have two radiobuttons in a TRadioGroup. All the logic behind how they are supposed to work is fine. But the TRadioGroup controler has a frame around it that I thought I would be able to delete using a border property or something like that. But the control doesn't seem to have any property that bears any resemblance to a border/frame. How do I set the controler to not include a frame?
TRadioGroup does not support what you are looking for. Place two TRadioButton components onto a TPanel instead. Then you can make it look how you want.
I don't think you can hide the border on a standard radio group box. It looks like you could create a custom descendant and override the painting if drawing normally, but that approach could be a bit more involved with theme support. Overall it sounds like a lot of work to go that route.
The next most obvious approach is to replace the radio group with a number of individual radio buttons on a container such as a panel. That would work and would be simple code but it could get messy. It seems a lot of busy work for little gain and I am lazy enough to look for another option.
There is a kludge you can use. If you put the radio group on a panel rather than directly onto the form (or other background) you can make the panel under-sized compared to the radio group. You want the panel to be as big as the interior of the radio group but not as big as the border. Then set the top and left of the radio group to negative numbers so that the border falls outside the parent panel. The border is not visible this way.
I know it's not best practice but I had a similar issue and couldn't redesign everything. So I did this to simply hide the border (and works great so far).
HANDLE Region = CreateRectRgn(3, 3, RadioGroup->Width-3, RadioGroup->Height-3) ;
SetWindowRgn(RadioGroup->Handle, Region, true);

Blackberry TabScroll and Focus problem

I'm a newbe for Blackberry and finding it quite difficult, I'm working on the TabControl example. I have changed the tabs to scroll. Now when i scroll through tabs the focus changes and as soon as the focus shifts to the other tab, the data for that tab appears.
I want to make these tabs clickable only, though they shall scroll but should change only on click.
And also when i use UIApplication.getApplication.pushScreen(someScreen) in the tabs, this someScreen appears out of the tabs, whereas i want to show this screen below the tabs only.
please help
You have to override onFocus(int) to not do anything when focus is moved. (You may or may not have to override touchEvent to handle an actual CLICK event).
You can push a screen into tabs that is not part of the tabs already. If you want something new to appear, try switching managers within the screen instead.

Resources