HI
I looking an example to enable or disable an item of a popupmenu I have build in code.
Any help is appreciate
Thanks
HI
I looking an example to enable or disable an item of a popupmenu I have build in code.
Any help is appreciate
Thanks
Remove all items and add only those that are to be selected?
In pure Xojo code, thatās not possible. If you have the MBS plugins, however, itās feasible. Do you use them?
That would be against the human interface guidelines.
if you use ConstructContextualMenu
https://documentation.xojo.com/api/user_interface/desktop/desktoppopupmenu.html#desktoppopupmenu-constructcontextualmenu
set enable=false at DesktopMenuItem?
https://documentation.xojo.com/api/user_interface/desktop/desktopmenuitem.html
Then the users will have to right-click on the popup menu. Not intuitive.
You could also build a regular menu and show it in the MouseDown event, replacing the menu of the PopupMenu, but that also would be awkward, for several reason:
ā¢ positioning the menu would not be native (and the OS handles edge cases)
ā¢ the OS may add items in one kind of menu but not others
ā¢ both menus may have different behaviours (scrolling, use of shortcuts, etc).
Many users are expecting UI to look native.
On the appointment making part of a software, I had a PopupMenu with the list of people who could receive visitors.
I was asked if it was possible to differentiate the people available on the day of the appointment from those āabsentā (holidays, illness, not working that day).
At that time Xojo (2013) did not allow me (in native) neither to gray an entry nor to make it appear in red (for absent).
Too bad, I donāt remember what I did at the timeā¦
it seems you can addrow as a desktopmenuitem, and not just as string
so create a desktopmenuitem, set itās enabled property to false, then addrow it to the desktoppopup
if you want to change itās enabled state, then remove the row, and addrowat with again a desktopmenuitem enabled or not
hmmmm loving so much errors like this with no idea what they come from ā¦
edit: seems to come from making a new project on a macos 10.13 system with xojo 2022r4ā¦
and as it is not supported anymore, Iām stuck.
hopefully M2pro macbooks are almost outā¦ time for a renew !
edit2: if I build the app then it launch fineā¦ but no debug possible.
edit3: @xojo team : a simple error number with the error message would help so much ā¦
@Paul_Lefebvre @Geoff_Perlman
Adding a DesktopMenuItem
with the Enabled
property false doesnāt seem to actually have an effect:
Shame, because that kind of a feature is something that would get me to move to DesktopPopupMenu
.
I would consider this as a bug !
i see that when accidentally having 32bit as a target on mac?
I canāt have 32bits macos compile option when on xojo 2022r4ā¦
and I tried x86 64bits or universal itās the same result.
I can debug web apps on my 10.13.6 and xojo 2022r4, but it seems desktop apps really need 10.14
I see this error as a generic error when the linker returns something bad. it still should benefit from some more details about the errorā¦
It has been said in various places, even officially, that if you debug your app on a Mac OS earlier than 10.14, the āminimum OS versionā field wonāt apply (and the 10.14 minimum support isnāt applied) so you can debug there.
Yes, I think so.
I have report it as a bug.
You can do something like this :
if as popupmenu, you duplicate a desktop menu.
I have this in my app RealCADD.
A regular menu āActionā which can be called as a contextual popupmenu.
The popupmenu has the same disabled items than the regular menu.
In the āConstructContexttualMenuā event, I call this popupmenu with :
Var popMenu As DeskTopMenuItem
popMenu = MenuAction.Clone
base = popMenu.PopUp
Perhaps, it is possible to do the same with an invisible DesktopMenu.
But I donāt know if it is exactly what you want.
Thank you.
But I believe that is better to have a ācorrectā framework to work with.
I thought the Xojo team need to have as targhet deliver a simple and complete to use framework, so the developer have to work only on the solving of job targhet and not on other questions.
A popup menu is allways a popupmenu on desktop, web, iOs, Android platform , why I need to think on where my application i running?