Colorful buttons of different shapes

  • Hi,I am porting my Win32 application to Mac. I am new to Cocoa. In my Windows Win32 application I have a window in that there is a 3 X 8 matrix of 24 buttons. Buttons are labeled as 124. Each button has 3 states. Unused Round shape green color(Default state) SelectedSquare shape orange color (User selects a button)UsedRound Shape red color (User save the selection by clicking Save button)In Win32 application I use owner drawn buttons to draw button of different color and shape.I'd be glad if someone could suggest me which control should i use in Cocoa to achieve the same effect.Should I use NSMatrix of buttons? If yes than how can i set color and shape of buttons?Thanks & RegardsAbhijeetDear cocoadev ! Get Yourself a cool, short @in.com Email ID now!
  • Hi,I am porting my Win32 application to Mac. I am new to Cocoa. In my Windows Win32 application I have a window in that there is a 3 X 8 matrix of 24 buttons. Buttons are labeled as 124. Each button has 3 states.Unused  Round shape green color (Default state)Selected  Square shape orange color (User selects a button)Used  Round Shape red color (User save the selection by clicking Save button)In Win32 application I use owner drawn buttons to draw button of different color and shape.I'd be glad if someone could suggest me which control should i use in Cocoa to achieve the same effect. Should I use NSMatrix of buttons? If yes than how can i set color and shape of buttons?Thanks & RegardsAbhijeetDear macosxdev ! Get Yourself a cool, short @in.com Email ID now!
  • On 13/04/2010, at 9:58 PM, Abhijeet Singh wrote:

    > effect.Should I use NSMatrix of buttons?

    It would be a straightforward solution.

    > If yes than how can i set color and shape of buttons?

    You'd probably need a NSButtonCell subclass. Drawing alternative appearances is pretty easy that only needs one or two overrides.

    --Graham
  • On Apr 13, 2010, at 14:00, Abhijeet Singh wrote:

    > Hi,I am porting my Win32 application to Mac. I am new to Cocoa. In my Windows Win32 application I have a window in that there is a 3 X 8 matrix of 24 buttons. Buttons are labeled as 124. Each button has 3 states.Unused  Round shape green color (Default state)Selected  Square shape orange color (User selects a button)Used  Round Shape red color (User save the selection by clicking Save button)In Win32 application I use owner drawn buttons to draw button of different color and shape.I'd be glad if someone could suggest me which control should i use in Cocoa to achieve the same effect. Should I use NSMatrix of buttons? If yes than how can i set color and shape of buttons?Thanks & RegardsAbhijeetDear macosxdev ! Get Yourself a cool, short @in.com Email ID now!

    You should indeed use an NSMatrix of NSButtonCells, with settings that of a check button. If you need to customize the way it's drawn you should subclass NSButtonCell and do your customized drawing in drawWithFrame:inRect:ofView:. However, I would not recommend that, UI should be as much as possible standard, so users immediately recognize them and know how to use them.

    Christiaan
  • Abhijeet Singh wrote:

    > Hi,I am porting my Win32 application to Mac. I am new to Cocoa. In my Windows Win32 application I have a window in that there is a 3 X 8 matrix of 24 buttons. Buttons are labeled as 124. Each button has 3 states.Unused  Round shape green color (Default state)Selected  Square shape orange color (User selects a button)Used  Round Shape red color (User save the selection by clicking Save button)In Win32 application I use owner drawn buttons to draw button of different color and shape.I'd be glad if someone could suggest me which control should i use in Cocoa to achieve the same effect. Should I use NSMatrix of buttons? If yes than how can i set color and shape of buttons?

    To follow up Christiaan's message, you would be well-served by at least giving a quick skim to the Human Interface Guidelines at <http://developer.apple.com/mac/library/documentation/UserExperience/Concept
    ual/AppleHIGuidelines/XHIGIntro/XHIGIntro.html
    >.

    You may have an established user base that you expect to begin using this on a Mac, but what you're describing is so far outside the typical Macintosh user experience that it will alienate a lot of potential users if this is an app for general release.

    I'll give one strong recommendation right up front: Distinguishing the state of the button between "unused" and "saved" by red vs green is a very bad idea. Roughly 1 out of 20 people on the planet won't be able to judge reliably. (And, honestly, probably a larger ratio of the computer-using populace.)
previous month april 2010 next month
MTWTFSS
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    
Go to today