This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin for Android App Development and have Peter Sommerhoff on-line!
See this thread for details.
Win a copy of Kotlin for Android App Development this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Drop Down Menu Buttons  RSS feed

 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. I'm looking for a way that I can create a menu button that has an optional drop-down arrow. Clicking the button switches the mode of my application to a "drawing" mode, where you can draw several different types of lines. If they just click the button, it should use the default drawing tool, but if they click the drop-down arrow they should see a list of available drawing tools (this is similar to MS Outlook where you can click the "New" button to create a new mail message or click the drop-down arrow to see what new items you can create). The key is that this needs to be a single button object such that mouse-overing, borders, etc don't make it appear as multiple buttons.

Thank you.
Jeff
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it should be just a matter of adding a thin BasicArrowButton alongside
a normal button, with the BasicArrowButton displaying a popup, as in a JComboBox
 
Jeff Storey
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem with doing it that way is that I lose the mouse over effect. I can mouse over the button and combo box as two separate components, where I'm trying to treat them as a single component for mousing over purposes.
 
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Jeff Storey
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks. Can I ask if you wrote this code or if it is copyrighted or where you got it from?
 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can I ask if you wrote this code
Yes, I wrote it.
or if it is copyrighted
No, not that I know of.
or where you got it from?
I made it up after reading your original post today.
You can do whatever you like with it.
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!