Understanding the presentation of viewControllers - xcode4.5

I have a conceptual question regarding viewControllers and the "presentation".
I am trying to figure out the "good" way to show my content.
Lets say I have 2 views (viewControllers).
I now want to navigate from view1 to view2. Using either a button or some other event.
I notice there is the "presentViewController" - and that this involves "dismiss". I suppose that means that view2 is sort of stacked on top of view1?
What if view1 is only used for a startup login - so that you dont ever get back to this view, unless you quit or logout? Would you still "present" and "dismiss"? (so that view1 is always present, but hidden beneath view2 - and maybe even view3, view4 and so on)
My guess is that I should go to view2 and completely replace view1? How?
How many ways can you present a viewController? And when do you use each?
Does my question make any sense?
Thx
John

Related

Should I use Button or TextBlock?

I have two options. I need 48 of a certain type control; it needs to respond to clicks and taps (for touch devices).
I could use Buttons, using the TextButtonStyle, and the Click event. Or I could use TextBlock, with the Tapped event.
I reckon buttons may be more "expensive" to create. OTOH, although I believe "Tapped" is also called when the user clicks the component, this makes me a little nervous due to its nomenclature, I guess.
Another difference is that a button takes up only the width necessary, whereas a TextBlock takes everything; and I want the underlying Grid to be tappable, so the TextBlock is kind of a problem that way. Is there a property that will make it more modest like the button?
There is design guidance for Windows Store apps on when and how to use buttons at http://msdn.microsoft.com/en-US/library/windows/apps/hh465470. Based on your description and this guidance, it sounds like buttons are the way to go. Responding to click events is what they were made for, and TextBlocks add the extra issues that you describe.

Flex tree droplocation indicator stuck (edit 2/4/10, almost a totaly different question)

OK I've got a little more research on this done so I'm going to totally rephrase the question:
I have two trees, I want to be able to drag items from one tree to the other. In the receiving tree I have some logic that allows or denys the drop. I am using the native cursor feedback Like this :
DragManager.showFeedback(DragManager.COPY);
DragManager.showFeedback(DragManager.NONE);
When the logic determines NONE it properly rejects the item except the drop position indicator sticks like in the screenshot.
I know now that neither dragComplete, nor dragDrop are being fired in this situation, so I have no function to put code into that would clean that up. So how can I listen for this drag rejection?
ScreenShot shows app After drop
alt text http://img687.imageshack.us/img687/2245/treeindicatorstuck.png
Thanks
~Mike
PS with my other question: how-do-i-detect-that-drag-and-drop-operation-ended We have a way of getting an event to fire so we can clean up the tree control. I'm attaching an event listener to the stage so that as the mouse is moved (maybe I'll put it on a timer)it will constantly check if dragmanager.isdragging if it's not it will fire the tree.hideDropFeedBack. This still begs the question, what event is changing the isDragging Boolean and how do I listen for it?
You need to call tree.hideDropFeedback(); or event.target.hideDropFeedback(); to remove the drop indicators.

Flex/AS3 easy (I hope) drag and drop question - prevent dragging to other controls

I searched but couldn't find my answer, I'm sure it's easy for anyone with a little experience. I have multiple datagrids on a page, each one I want sortable with drag and drop, but I don't want items drug from one control to the other. How can I prevent a user from dragging an item out of a conrol. I would prefer to have it just stop moving with the mouse, but I am prepared to just completely cancel out of the dragging if need be.
I was trying to do something like this
dragExit="dragEvent.CANCEL"
This is obviously wrong, but I can't find the correct way to do it.
Thanks in advance.
~Mike
Ok, so you have an app with multiple drag/drop datagrids, and you only want items dragged within a datagrid, and not from 1 to the other, is how I understand this.
What you need to do is create a custom dragDrop event handler for each datagrid which has the following command: event.preventDefault(). This in effect will stop a datagrid from receiving items from another .
This does not prohibit the dragging an item outside its host's borders, but it will prohibit the item being dropped into a different datagrid.
HTH.

Navigation issue in Flex - ViewStack, states or something else?

I have a bit of doubt regarding my application which is being created using Mate framework. The first thing user has to do is to log in, so I created Login.mxml view. After a successful login I need to display the main view with applicationControlBar at the top and a workspace below. At the moment I have two separate views, so if I understand correctly it makes sense using ViewStack.
Thing is, I'd like also to display some kind of panel with buttons on top of the workspace after login - here is screenshot. After clicking on a button the panel should dissapear. To complicate things a little bit more, there is a possibility for this panel to change state. Clicking on a specific button may result in showing progress bar at the bottom of panel.
I feel I should create separate view, MenuDialog.mxml and put there buttons, progress bar and states, but how to display it on the top of the workspace? I hope my problem is clear enough :)
I would make the panel a popUp, with the main application (or the ViewStack's parent container) as the parent of the popUp. You can use the PopUpManager Class to close it based on user actions within the Panel.
Assuming that perhaps you do not want a modal login style panel (which many apps these days eschew) then you should absolutely use states rather than ViewStacks.
States are a much cleaner way to distinguish the various, uh, states that your UI can be in -LOGGED_IN, LOGGED_OUT, etc.
It may take a little to get used to working with states, but once you do, you'll never go back. :-)

How can I disable an individual item in a combo box in Flex so that it is not clickable?

I want to create a combobox in flex which will take three values, Available, Unavailable, and Busy. The constraint is, I should not allow user to go directly from Unavailable to Busy. So when a User is selected Unavailable, I should keep the Busy item disabled (unselectable), but a user will be able to go directly from Available to Busy. I chouldn't find a straight forward way to disable an item in combobox in Flex. How can I do that?
Have you considered using radio buttons rather than a combo box? It's clear how to do this for radio buttons, for one thing. Also, it can often be friendlier to present the available options without requiring a click to reveal them. (Especially if, as in this case, you are adding the possibility that an option is "available, but not possible for you right now for some reason not shown in this combo-box item").
If you really want a combo-box, you can use the click event to display it in a non-standard fashion by probably changing its style; and then, if clicked anyway, Then, in the selected event, reject the choice (hopefully with an indication of why),
Or, if you want to simply remove it from the list, you can have the click listener event repopulate the source list each time, based on conditions. But that might be confusing to the user, too.
You can also have a look at
www.stoimen.com/blog/2009/03/05/flex-3-combobox-disabled-options/
which references
wmcai.blog.163.com/blog/static/4802420088945053961/
(note for NoScript users you must have 163.com and 126.com at least temporarily allowed to be
able to properly see this page)
it works very well even though I added the code for being able to properly handle keyboard
events in the dropdown list
Full self working example available at
http://olivierbourdon.homedns.org/OpenSource/combos.zip
Thanks again for the good work

Resources