Ask a Question related to Mac Programming, Design and Development.
-
David Scrève #1
Dynamic popup control
Hello,
Has anybody successfully created a dynamic popup menu control (ie, without relying on Menu resource) ? I have some problems with
the following code:
Rect controlRect = {10,10,260,300};
ControlRef mControlRef;
MenuRef mMenuRef;
mControlRef=NewControl(outWindow,&controlRect,NULL ,true,0,-12345,0,kControlPopupButtonProc+kControlPopupFixed WidthVariant,(SInt32)NU
LL);
Boolean bCheckCurrentTag;
CreateNewMenu((MenuID)4096,0,&mMenuRef);
AppendMenuItemText(mMenuRef, "\pItem #1");
AppendMenuItemText(mMenuRef, "\pItem #2");
AppendMenuItemText(mMenuRef, "\pItem #3");
bCheckCurrentTag=true;
SetControlData(mControlRef,kControlEntireControl ,kControlPopupButtonMenuRefTag,sizeof(mMenuRef),&m MenuRef);
SetControlData(mControlRef,kControlEntireControl ,kControlPopupButtonCheckCurrentTag,sizeof(bCheckC urrentTag),&bCheckCurrentTag);
The control is properly created, the menu is properly clickable, but the control never shows the current selection : It only shows
an empty text ??
Is there something missing ? And how can I track when the selection change ?
Thanks for your help,
David
David Scrève Guest
-
Creating a popup *custom* control
Hi How can I create a popup custom control so it can be compiled as a dll? I think of a "MessageViewer" Custom control that opens a new browser... -
dynamic Popup window message
HI, My bank has a feature I would like to implement in my site. When you pay a bill online and click 'submit' a dialog window appears asking me... -
Launching a popup window via dynamic text?
Hey all, Looking for a solution to launch a popup window from a link in a dynamic text box. I'm sure this is fairly easy to do - I just can't... -
Javascript PopUp using Calendar Control
How can I implement the Calendar Control in a popup Window so that when a user selects a date that the selected date is passed into a textbox on the... -
popup control
I'm using dreamweavers open browser window behaviour to open a pop, and then a body onblur selfocus on the popup to keep it in the front. Its not... -
Tom Dowdy #2
Re: Dynamic popup control
In article <3f1fcc1f$0$15337$626a54ce@news.free.fr>,
"David Scrève" <dscreve@clickteam.com> wrote:Yes.> mControlRef=NewControl(outWindow,&controlRect,NULL ,true,0,-12345,0,kControlPop
> upButtonProc+kControlPopupFixedWidthVariant,(SInt3 2)NU
> LL);
> Boolean bCheckCurrentTag;
>
> CreateNewMenu((MenuID)4096,0,&mMenuRef);
>
> AppendMenuItemText(mMenuRef, "\pItem #1");
> AppendMenuItemText(mMenuRef, "\pItem #2");
> AppendMenuItemText(mMenuRef, "\pItem #3");
>
> bCheckCurrentTag=true;
> SetControlData(mControlRef,kControlEntireControl
> ,kControlPopupButtonMenuRefTag,sizeof(mMenuRef),&m MenuRef);
> SetControlData(mControlRef,kControlEntireControl
> ,kControlPopupButtonCheckCurrentTag,sizeof(bCheckC urrentTag),&bCheckCurrentTa
> g);
>
> The control is properly created, the menu is properly clickable, but the
> control never shows the current selection : It only shows
> an empty text ??
>
> Is there something missing ?
InsertMenu(mMenuRef, -1);
SetControlMaximum(mControlRef, CountMItems(mMenuRef));
When you've tracked the control, call GetControlValue() to see what the> And how can I track when the selection change ?
user has selected.
Tom Dowdy Guest
-
Tom Dowdy #3
Re: Dynamic popup control
In article <BB4B240F9668192C1@hinton.demon.co.uk>,
[email]hitman@spammer.deathsquad.com[/email] (Graham Hinton) wrote:Hmmm, don't know this one. I've never used hierarchical menus from a> Following on from that, how are you supposed to find what the selection is
> with hierarchical menus?
> GetControlValue returns the top menu item. GetControData() does not seem to
> have the right information anywhere.
popup. Sounds like iffy UI, but if you need to, you need to.
You *can* change the item. However, you can only do so if you have> Also, how do you change a menu item in a control? I tried
> SetMenuItemText(), but nothing changed. Does the control have its own copy?
created and installed the menu yourself PRIOR to creation of the
control. If you let the control load the menu resource, then yes, it
"has a copy" (not really, but for all itents and purposes it might as
well).
Tom Dowdy Guest
-
Graham Hinton #4
Re: Dynamic popup control
In article <dowdy-342420.11325428072003@news.apple.com>,
Tom Dowdy <dowdy@apple.com> wrote:
There is an example in Appearance SDK from a bevel button, but it is all>Hmmm, don't know this one. I've never used hierarchical menus from a
>popup.
show and no blow.
Better than a menu the full height of the screen...> Sounds like iffy UI, but if you need to, you need to.
The iffy part is all these controls that half work and are not properly
documented.
Both the control and original menu are resources. Can I still have them as>You *can* change the item. However, you can only do so if you have
>created and installed the menu yourself PRIOR to creation of the
>control. If you let the control load the menu resource, then yes, it
>"has a copy" (not really, but for all itents and purposes it might as
>well).
resources and satisfy that condition? ie don't have the miniumum value
pointing to the menu and then install the menu by program?
Graham Hinton Guest
-
Tom Dowdy #5
Re: Dynamic popup control
In article <BB4BF4AE9668BC8D@0.0.0.0>,
[email]hitman@spammer.deathsquad.com[/email] (Graham Hinton) wrote:Yes, however if you want to be able to change the menu contents (either>> >You *can* change the item. However, you can only do so if you have
> >created and installed the menu yourself PRIOR to creation of the
> >control. If you let the control load the menu resource, then yes, it
> >"has a copy" (not really, but for all itents and purposes it might as
> >well).
> Both the control and original menu are resources. Can I still have them as
> resources and satisfy that condition? ie don't have the miniumum value
> pointing to the menu and then install the menu by program?
on the fly during the dialog/window, or prior to running it) you need to
install it yourself prior to instantiating the control.
Actually, it doesn't matter if you have the minimum value or not. If
the menu is already in the menu bar, the control assumes you (the app)
are managing the content.
Tom Dowdy Guest



Reply With Quote

