![]() 3D 3D Photo Gallery (Part 1) 3D Photo Gallery (Part 2) Audio Poor Man's MIDI Make A Metronome iPod Tricks (Part 1) iPod Tricks (Part 2) iPod Tricks (Part 3) Laugh Track Machine Audio Player with Reverb Shepard Melody RB Phone Home Build a Drum Machine Custom Controls and Windows Double Click Listbox Draggable Metal Window Double Click Canvas Custom Buttons Custom Buttons Part II iTunes-style Listboxes Custom Controls General RB Scrolling Windows Using Mesage Dialogs Case-Sensitive Word Finder Introduction to Stacks Wiggle Window JPEG in PDF Listbox Checkboxes Background Applications Listbox Auto-Find Virtual Volumes Time Tracker Software Distribution (Part 1) Software Distribution (Part 2) Software Distribution (Part 3) Software Distribution (Part 4) Exceptions Tips and Tricks Text Clippings Made Easy Graphics Drawing a Simple Gradient The SpriteSurface: Space Game Image Spinner Cropping Graphics (Part 1) Cropping Graphics (Part 2) Cropping Graphics (Part 3) Cropping Graphics (Part 4) Shimmer Graphics Lissajous Figures Simple Screen Capture Vector Graphics Kaleidoscope Images Stegonography Spirals! Image Table RB Magnifying Lens Screen Capture Color Picker Tutorial Hacks Ghost Grab Speedy Mouse Extension iTunes Plugins iTunes Skinner Mac OS X Global Hot Key Event (Carbon Events) Login Welcomer (Carbon Events) Add/Remove Buttons Resizable Sheets Mac OS X Preferences Window Using Sheets in REALbasic Build a Bundle (Part 1) Build a Bundle (Part 2) Dock Your Passwords Mac OS X Debugging REALbasic Mac OS X Icon Tutorial Animate Your Dock RB and the Command Line Menus Window Menu Templates Menu Listbox Menu Novelty Guessing Game Calendar Trivia Tile Mixer Zip Code Finder Happy Valentine's Day Merlin Simulator (Part 1) Merlin Simulator (Part 2) Merlin Simulator (Part 3) Buzzword Machine AppleSoft BASIC Printing Print to PDF Registration Registration Code Validation Network Registration Codes Resources Picture Extractor (Part 1) Picture Extractor (Part 2) Serial Caller ID (Part 1) Caller ID (Part 2) Caller ID (Part 3) Speech Speech Recognition Socket Communication Easy Peer-to-Peer File Sharing MacPAD Version Checking Display Web Image In Canvas HTML IMG Tags Version Tracking Even Smarter Instant Messaging Web Tiler JavaScript and REALbasic Stock Ticker (Part I) Stock Ticker (Part 2) AIM Mate XML Manipulation Simple XML Introduction Video Big Brother Video Capture Note: All articles without a byline were written by Erick Tejkowski. When cleaning the site I removed them because the code differed from page to page, and I have yet to put them back in.
Tell us about a bad link. |
This idea has been spreading not only among Apple's programs, but also throughout third-party applications. Using this design for a preferences window in your application will certainly improve its image making a better impression on users, and is the reason we're going to make one in this tutorial. Design
In the image above, you can see there is a large page panel filling most of the window, and then a small group of ToolbarItems at the bottom. Since the different preference panes will have varying height requirements, the PagePanel which holds the controls for the panes will need to be tall enough to accomadate the largest pane. When a ToolbarItem is clicked on, thus changing the current pane, the window will resize to be just large enough to show only that pane; Just like in System Preferences. Adding Controls to the Window Since the three preference panels we're going to make are Dock, Keyboard & Mouse, and Network, go ahead and set the Caption value of those three ToolbarItems to Dock, Keyboard && Mouse, and Network respectively. (Don't forget that double ampersands (&&) are required to make one appear.) Download the finished project and import the pictures into your project. Go ahead and set the image values for the ToolbarItems to PicDock, PicKeyboard, and PicNetwork. Since these images don't have a mask, we will reset the images in code, but we set these now because it makes it easier to see which ToolbarItem is which when we're working in the IDE. To give the pictures a mask, we'll draw the mask images into the PicDock, PicKeyboard, and PicNetwork images "Mask" properties, then reset the ToolbarItems Image property so the changes will take affect.
Window Resizing
Changing Panes The first parameter of the SmoothResize method is the window which is being resized, the second is the new width of the window (which in our case is the same as the old width, 595), the third is the new height, and the last parameter specifies from which corner the window is being resized. See the SmoothResize method for more info.
And since when our window first opens it should open to one of the panes, we set the default pane in the main window's Open event by calling ChangePane 0.
When the user clicks on any one of the ToolbarItems, the PrefsTBItem's Action event fires which is where we then change the pane. Since the index value of the ToolbarItem in the PrefsTBItem control array is the same as the index of the pane's page in the PanesPanel, we can simply call ChangePane Index to change the preference pane.
The Finished Product
|
|||||
|
|