|
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
|
From: Keith Albright I’m developing an AudioUnit with an embedded
DataBrowser control. We’ve used the DataBrowser before in a NIB in a floating
window. I’m now creating one on the fly. Running Mac OS X 10.4.9 It works on Intel Mac systems, it works in my own stand
alone host on PPC G5. It does *not*
work when run inside Garage Band or in Live on the same PPC G5. What I mean by does not work is that the control does not
appear to respond to events. It is populated with data, so I know the
callbacks are working. The other symptom is that in Garage Band, if you click on
the Instrument window ( where you open the AU panel from (pencil) ) the scroll
bar of the DataBrowser goes from blue to white. Clicking on DataBrowser makes the scroll blue but does not
bring the plugin window itself to the top. Other symptom is that if I put
another app window on top and switch back, the DataBrowser is not
visible. Clicking the plugin window makes it visible again. It almost seems as if the wrong window is owning the
browser. I see the mouse events reaching the event handler for my plugin
window. But, it’s as if
the control didn’t get them. I’ve looked at what I can get to in GDB. Following is info on the DataBrowser in the floating window
(which works) and the Plugin Window which does not work. Appreciate any suggestions as to how to fix this.
Also, what’s the current method of setting the background color?
Appearance Manager was replaced by Aqua so not sure. Interface Builder
references setting a white or black brush so there must be a way to get at that
via some api. Oh yes, here’s the code I’m using to create the
DataBrowser. Thanks for any and all help! Keith
// create the databrowser (tree control in window terms)
Rect rect; // members are assigned via a .ToRect call
DataBrowserViewStyle style = kDataBrowserListView;
// dispose control is done in destructor
OSStatus err = CreateDataBrowserControl(
m_refWnd,
&rect,
style,
&m_refDataBrowser);
// save off our class instance
::SetControlReference( m_refDataBrowser, (SInt32) this);
// Initialize our browsers callbacks
DataBrowserCallbacks dbCallbacks;
dbCallbacks.version = kDataBrowserLatestCallbacks;
InitDataBrowserCallbacks (&dbCallbacks);
// Set the Item Data Callback
dbCallbacks.u.v1.itemDataCallback =
NewDataBrowserItemDataUPP( (DataBrowserItemDataProcPtr) itemDataCallback );
// Set the Item Notification Callback
dbCallbacks.u.v1.itemNotificationCallback =
NewDataBrowserItemNotificationUPP( (DataBrowserItemNotificationProcPtr)
itemNotificationCallback );
if ( bAllowDragging )
{
// if allow item dragging, set the callback for it
dbCallbacks.u.v1.addDragItemCallback =
NewDataBrowserAddDragItemUPP( (DataBrowserAddDragItemProcPtr)
dragItemCallback );
}
// we need to create the column description since we're creating the control.
// no data visible otherwise
DataBrowserListViewColumnDesc columnDesc; // fill in version of column description
we know //
columnDesc.headerBtnDesc.version = kDataBrowserListViewLatestHeaderDesc; // no icons in our header buttons // columnDesc.headerBtnDesc.btnContentInfo.contentType
= kControlContentTextOnly; // we don't want any extra margins
in our columns // columnDesc.headerBtnDesc.titleOffset
= 0; // specify the default sort order
when column is first sorted // columnDesc.headerBtnDesc.initialOrder
= kDataBrowserOrderIncreasing; // // the one and only column // // set up the column property
description // columnDesc.propertyDesc.propertyID =
kTreeColumn1; columnDesc.propertyDesc.propertyType
= kDataBrowserTextType; columnDesc.propertyDesc.propertyFlags
= kDataBrowserListViewSelectionColumn | kDataBrowserListViewDefaultColumnFlags; // and some information about the
column width and justification // columnDesc.headerBtnDesc.minimumWidth
= 100; columnDesc.headerBtnDesc.maximumWidth
= 400; columnDesc.headerBtnDesc.btnFontStyle.just
= teJustLeft; // set up the button title (empty) // columnDesc.headerBtnDesc.titleString
= NULL; // append the column to the end of
the databrowser // err =
::AddDataBrowserListViewColumn(
m_refDataBrowser, &columnDesc,
kDataBrowserListViewAppendColumn);
// Allow the first and only column in this data browser to
// have the open/close triangle
err = SetDataBrowserListViewDisclosureColumn ( m_refDataBrowser, kTreeColumn1,
true);
// Make sure we don't truncate the items in the browser and make them
selectable
SetDataBrowserPropertyFlags( m_refDataBrowser,
kTreeColumn1,
kDataBrowserListViewSelectionColumn | kDataBrowserDoNotTruncateText
);
// Install the callbacks
err = SetDataBrowserCallbacks(m_refDataBrowser, &dbCallbacks);
//////////////////////////////// end of databrowser create -------------------------------------------------------------------------------------------- // Here’s the info I got in GDB. // these are the main windows (gdb) call (void)DebugPrintWindowList() Window
Class WID
Vis Hil Act Level
Title
Group ---------- ------------- ---- ---
--- --- ----- -------------------------
---------------------------- 0x00E87B40
MenuBar
5 Y
N
24
0x77B166B1 "com.apple.HIToolbox.windowgroups.menubar" 0x06CE0C90
Floating 9CA
N
Y 0
Program Browser
0x71942181 "com.apple.HIToolbox.windowgroups.floating" 0x0F617900
Floating 9A6
Y
Y
3
0x71942181 "com.apple.HIToolbox.windowgroups.floating" 0x066318A0 Plain
9A5 Y
Y *
3
0x7193C351 "com.apple.HIToolbox.windowgroups.document" (gdb) call (void)GDBShowControlHierarchy(0x66318a0) // the Plain window is the plugin window Dumping info for window 0x66318A0 Window found. Dumping views... Root 0xf669f60 , ID ''/0, tlbr (-32768,-32768,32767,32767),
Embedder, Control 0xe3f5c0 <appl/datb> (
"" ), ID ''/0, tlbr (140,5,545,245), Embedder, Control 0xf66b6d0
<appl/sbar> ( "" ), ID ''/0, tlbr (160,227,527,242), Hid, Act,
Ena, PendComp (Hil=0x0), DrawingEnabled Control 0xeda3e0
<appl/sbar> ( "" ), ID ''/0, tlbr (527,8,542,227), Hid, Act,
Ena, PendComp (Hil=0x0), DrawingEnabled Control 0x6cae7b0 <appl/upan> (
"" ), ID ''/0, tlbr (0,0,550,850), Embedder, // this is the DataBrowser that’s on the plugin window
which doesn’t respond on PPC (gdb) call (void)GDBShowControlInfo(0xe3f5c0) Control 0x00E3F5C0 "" Control
Kind : 'appl', 'datb' Control
ID : '', 0
Window
: 0x066318A0 ""
Parent
: 0x0F669F60
Minimum
: 0 (0x00000000)
Maximum
: 0 (0x00000000)
Value
: 0 (0x00000000)
RefCon
: 114106208 (0x06CD1F60) Features: Allows Subviews Gets Focus On
Click Idles With Timer
Hilite
: 0 (0x00)
Active
: yes
Enabled
: yes
Visible
: yes Drawing Enabled :
yes
Frame
: 140 5 545 245
Bounds
: 140 5 545 245 Visible
Rgn : (null) Needs Display
: no Dirty
Subviews : 0 Invalid
Rgn : (null) HIObject Ref
count : 1 Event
Target : 0x6cd2c80 Event
Handler : 0x45 / this is the DataBrowser that’s in the floating
composite window which does work. (gdb) call (void)GDBShowControlInfo(0x6ce1bc0) Control 0x06CE1BC0 "" Control
Kind : 'appl', 'datb' Control
ID : 'tree', 0
Window
: 0x06CE0C90 "Program Browser" Parent
: 0x0F642970
Minimum
: 0 (0x00000000)
Maximum
: 0 (0x00000000)
Value
: 0 (0x00000000)
RefCon
: 106965040 (0x06602830) Features: Allows Subviews Gets Focus On
Click Idles With Timer
Hilite
: 0 (0x00)
Active
: yes
Enabled
: yes
Visible
: no Drawing Enabled :
yes
Frame
: -7 -1 458 232
Bounds
: 0 0 465 233 Visible
Rgn : 7 2 463 231 [non-rect] Needs
Display : no Dirty
Subviews : 0 Invalid
Rgn : (null) HIObject Ref
count : 1 Event Target
: 0xf6432a0 Event
Handler : 0x76 |
_______________________________________________ Do not post admin requests to the list. They will be ignored. Carbon-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
| Home | Archives | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2011 Apple Inc. All rights reserved.