Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Any idea about DataBrowser?



Should I calculate which part of the databrowser was clicked from the
mouse coordination?

Perhaps. This is something kludge that I can think of right now:

- Subscribe to kEventControlClick event on control target.

- CallNextEventHandler.

- If you got kDataBrowserSelectionSetChanged notification
(during the call to CNEH) you are done - nothing else to do.

- If not user clicks somewhere. It could be selected item or
some non-item part of control.

- Lets suppose it is selected item. You know all of them
(by means of GetDataBrowserItems or ForEachDataBrowserItem
with kDataBrowserItemIsSelected flag).

- For each item check if click went to its bounds.
Get item bounds with GetDataBrowserItemPartBounds.
Get click location as event parameter.

- If you found item, store appropriate info about it as
control property.

- Use this property when appropriate.

Mike,
Thank you for your kind advice.
I can't help writing codes for that after all, can I?

Now, the real question: what kind of UI force you to do this?

User click to select an item from the databrowser(DB), then the selected item
appears a row in another list (I don't use DB here). In the row
there are 2 column, the name of the selected item, its price.
You might think why user needs to click the same item as before.

My app registers the item automatically when user enters a name in the name
column of the list(not DB) and when the item hasn't been registered yet, and
the registered items appear in the DB.
But if they enter the item's name as it is without consideration, the number
of item can be so huge that it's quite hard to choose what they want from
the DB, on the other hand. So they get to enter something like
"vegetables" or "beverages" or "alcoholic drinks".
Of course, they may enter "beer" instead of "beverages" and "sliced beef"
instead of "meats" or "meats(beef)".

I thought they would get to think how to enter the name gradually when they
faced the difficulty to select the one item they want from the large number of
items.
I also thought to let users specify the item more details. This is, the item has
an attribute, and user can specify it when they enter a new item.
But I thought it's a bit bothering to user to set the attribute every time
they enter. Even if it isn't bothering that much, on the other hand, it's
heavy to select what they want in a deep directory, as Finder.
So eventually it's up to users how to name it.

Well, then, suppose you want to enter "beer" and you have entered "alcoholic
drinks". you may enter "beer" and may select "alcoholic drinks" from the DB.
For instance, suppose you select "alcoholic drinks" from the DB.
Next continuously you want to enter "wine". You may enter that but may select
"alcoholic drinks" again.
Of course, you may enter them as only one "alcoholic drinks". That's OK.
It's up to you.

That's why I need to know which item is just clicked.

Mike, did I answer your question properly?

Thank you.
Norio
_______________________________________________
carbon-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/carbon-development
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Any idea about DataBrowser? (From: Mike Kluev <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.