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: Popup Button not behaving as expected



From: Bryan Pietrzak <email@hidden>
To: Jesse Carpenter <email@hidden>
CC: email@hidden, email@hidden
Subject: Re: Popup Button not behaving as expected
Date: Sun, 30 Jan 2005 00:18:10 -0600


On Jan 29, 2005, at 11:45 PM, Jesse Carpenter wrote:

There was a time when life was simpler....but using the Appearance Manager. Well!

I created a window using GetNewCWindow()...OK

Then I created Popup Control by calling GetNewControl()...OK

OK, so you're talking about stuff from what? 15 years ago? :)

You know if you adopted modern carbon approaches, things in general might be easier ;)


Upon contentClick by the Event, I use the following code:

static void PopupControl(WindowRef pWindow, EventRecord *pEvent)
{
  Point mouse;
  ControlRef theControl;
  SInt16 part;

  DoSomeProcessing();

mouse = pEvent->where;
GlobalToLocal(&mouse);
theControl = FindControlUnderMouse(mouse, pWindow, &part);
if (HandleControlClick(theControl, mouse, pEvent->modifiers, (ControlActionUPP) -1)) {
short value = GetControlValue(theControl);
etc.
}
}


The tracking works well but the selection in the menu always returns to the top of the list. It would not show the menu selection chosen after releasing the mouse button, thus returning to a value of one.

What is the control's maximum? Did you remember to set it to the number of items in the menu? That's a common mistake. (And this mistake hasn't changed in ten years either ;)


This has worked using pre-Mac OS.

What? On the Apple IIGS ? ;)

Bryan


Thanks - I admit that I am an old timer at programming...since 1974. Yes I have a lot to learn and I hope that the help will be available.


I went back to include to call SetControlMaximum()...and all is well. That is to say it works.... Question: What is the difference between SetControlMaximum() and SetControl32BitMaximum()?

I have another question.... I used a call to CreateScrollList(). What rectangle do I use for the call DrawThemeFocusRect()? Also to include that I use DrawThemeListBoxFrame() as well but I am not sure exactly what rect to use?

Thanks Jesse

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


_______________________________________________
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: 
 >Re: Popup Button not behaving as expected (From: Bryan Pietrzak <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.