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: Data Browser text editing




On Mar 1, 2005, at 9:28 AM, Graham Westlake wrote:

I'm having problems supporting text editing in my list view Data Browser. This is in a Mach-O Carbon app, building on 10.3.8 with CW 9.4.

I've followed the instructions in the Apple docs (also duplicated in TN2009) but I never get the callback that would allow me to retrieve the edited text.

My understanding is that I should get the following:
1. Data callback with query kDataBrowserItemIsEditableProperty and setValue = false [allows you to confirm editing is allowed]

2. Notification of edit start

3. Data Callback with query kDataBrowserItemIsEditableProperty and setValue = true [allows you to extract edit text and save it]

4. Notification of edit finish

I get 2 instances of callback 1, but never receive callback 3. By the time I get callback 4 it's too late to extract the text since the edit control has been destroyed.

This is occurring in both my own code, and in Apple's own BasicDataBrowser sample in Xcode.

Has anyone managed to get it to work?

Text editing in the browser does work. I have a ColumnView Data Browser that works.

Make sure that you set the column to be editable:

DataBrowserPropertyFlags flags = 0;
GetDataBrowserPropertyFlags(browser,kLevelName,&flags);
SetDataBrowserPropertyFlags(browser,kLevelName,flags | kDataBrowserPropertyIsEditable);

I have these two lines just after I load the data into the browser. kLevelName = 'Lvnm' is the name of the column that I want to edit.
I'm not sure of the calls being in the sequence you describe but for me I simply return true (see code below) in both the setValue = false or true states:

case kDataBrowserItemIsEditableProperty :
SetDataBrowserItemDataBooleanValue(itemData, true);
break;

The SetDataBrowserItemDataBooleanValue call is how you tell the browser that it is okay to edit the data.

Hope this helps,
Mike

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden

References: 
 >Data Browser text editing (From: Graham Westlake <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.