Cocoa Interface Builder's 'Attributes Inspector' like window - cocoa

I'm making a Cocoa application, and I would like a panel like the 'Attributes Inspector' in Interface Builder. So with big tabs on the top and collapsable/expandable groups. Does anyone know how I can do this?
This is an image of the Attributes Inspector:
Attributes Inspector http://developer.apple.com/documentation/DeveloperTools/Conceptual/XcodeQuickTour/Art/hello_win_attributes.jpg
So I actually want to make a window like the one shown in the image above.

InspectorKit is FOSS on github.

There's no built-in Cocoa controls to do this. You're going to have to write some custom views which replicate the functionality.
There some good advice for creating custom controls in the answers to this question: Looking for info on custom drawing of interface components (Cocoa)
If you need additional help, I recommend you ask smaller, more specific questions explaining what you've tried and what hasn't worked.

I've written some custom classes to do this- it ended up being less work than I expected. I broke it down into two separate components which can be used independently- the first handles the icons at the top and performs the view switching and the second handles the expandable panes:
My code is available at github and is under the BSD 2-clause license.

Related

Does Cocoa have something like WinAPI's DrawThemeBackground (a function that draws native controls)?

Windows API has very powerful functions that allow to draw native controls in all states:
DrawThemeBackground()
DrawThemeText()
Here's a really nice example of their usage:
Windows Visual Themes: Gallery of Parts and States?
Does Cocoa have something similar?
Apple has "soft deprecated" NSCell and the various control-specific subclasses, but you can use them for this. You create one, configure its properties, and then tell it to draw in a frame in a view.
Getting the properties just right can be tedious. You might want to create a control of the relevant kind in a test project's view (using IB) and then interrogate its cell's properties programmatically. And/or configure such a control to use a custom subclass of the corresponding cell class which logs which methods are called on it with what parameters in various scenarios.

Add a custom button in the Tabbar in Xamarin Forms

Is there any way to add a custom button in the tabbar of Xamarin.Forms, like it's seeable on the mock below?
Thanks in advance.
Cue.
You can use relative layout to add the tabs in Xaml,
If you need any coding help let me know I'll help you to design this layout.
I came across this question while looking into implementing a very similar tab bar. There is one other option I've found to do this without writing those hefty custom renders yourself. Check out Sharpnado. It provides a variety of possible customizations for a Xamarin.Forms tab bar.
There is also a blog post on implementing a few options, complete with sample code you can clone.

How to create a view for a single control?

What is the best way to create a view for a single control that I need to load into a Shell region in a Prism app. I know I can wrap the control in a UserControl, but I suspect there may be a better way.
I am working on a demo app to learn Prism 4. Each module will load a navigation button into an ItemsControl in a region in the Shell. These navigation buttons will function like the Mail, Calendar, and other buttons in Outlook.
I am creating the view in each module that will hold the module's navigation button. The simplest way to create the view seems to be to wrap it in a UserControl. My question is this: Is there a better way to do it? Thanks for your help.
If you need graphical control, what you are doing is the way to go. If you find yourself making all of the buttons look the same (copy - pasting) you might find that a menu registration service is the way to go.
You'd have a service like IMenuService that you register with your container and modules can come around and register menu items to. You can then create buttons for the module. I've provided a sample for this here:
http://dl.getdropbox.com/u/376992/CAGMenus.zip
Your question, though, seems to be about whether or not you need to wrap a control in a UserControl to register them with a region? If that's the question, I believe the answer is no, although you might amend your question to tell us what you are running up against that makes you think this.
I ended up wrapping the control in a UserControl, and it seems to work fine. I am still interested in seeing if there is a better way to load the button, so I will hold this question open for a few days.
Edit 02/22/2011: I tried using a control without a UserControl wrapper, and I got the following error:
Library project file cannot specify ApplicationDefinition element.
I wrapped the control in a UserControl and the error went away.

How to approach implementing a layout editor using Cocoa

I want to build an OS X application, in which one of the requirements is for the user to be able to generate PDF output according to a layout that they, the user, will create. Typical items on the page would be things like a corporate logo (a JPEG or PNG), an address (a block of text) and a narrative (another block of text).
I'd like the user to be able to move and resize the items using the mouse to drag handles around on-screen.
Is there an Interface Builder object that will let me do that, or some third-party library that exists for this purpose?
Try GCDrawKit if you're looking for a drop-in solution. It's still in beta (and has been for ages) but you might find it useful.
You seem to be looking for an all-encompassing, self-contained "Pages" control or some sort of reporting suite. That's asking a bit much.
There is nothing in the Cocoa frameworks that gives you this. Unfortunately, there's no Cocoa equivalent of Crystal Reports either. You'll have to roll your own.
I suggest using standard CSS / HTML templates with WebKit. The only drawback is WebKit doesn't yet support CSS pagination, so there's no concept of "8.5"x11" page 1...15" but it's the closest you'll come without writing your own Pages application (NOT an easy project by any stretch of the imagination).

Effel: EiffelVision2 changing widget style

I'm joining an Eiffel project that has a horribly outdated GUI design. The GUI is built with EiffelVision2 and the application is Windows platform only.
how can I change the look/design of the widgets, like defining shape and color of scrollbars, buttons, window borders and so on?
thank you!
I think this can be done using manifest file.
For instance, https://svn.eiffel.com/eiffelstudio/trunk/Src/Eiffel/Ace/ec.exe.manifest allows EiffelStudio to have nicer look than default classic theme.
You can check similar question/answers from http://tech.groups.yahoo.com/group/eiffel_software/message/8791

Resources