barcode generator dll in vb.net 13: Support Tools for the Busy Developer in Objective-C

Creation Data Matrix 2d barcode in Objective-C 13: Support Tools for the Busy Developer

CHAPTER 13: Support Tools for the Busy Developer
ECC200 Encoder In Objective-C
Using Barcode maker for iPhone Control to generate, create DataMatrix image in iPhone applications.
www.OnBarcode.com
GTIN - 13 Generator In Objective-C
Using Barcode maker for iPhone Control to generate, create GTIN - 13 image in iPhone applications.
www.OnBarcode.com
Figure 13 18. The DailyJournal project after adding and configuring the help files
Barcode Generator In Objective-C
Using Barcode drawer for iPhone Control to generate, create Barcode image in iPhone applications.
www.OnBarcode.com
Code 128A Creation In Objective-C
Using Barcode drawer for iPhone Control to generate, create Code 128 Code Set A image in iPhone applications.
www.OnBarcode.com
Let s review Figure 13 18. The Resources item now has the help folder (DailyJournal) and this is also configured in the DailyJournal-Info.plist file as a directory named Help Book. The help index has been generated and is also embedded in the project. The welcome page, index.html, has meta tags with content that mirrors the identifier in the .plist file.
Create Barcode In Objective-C
Using Barcode generator for iPhone Control to generate, create Barcode image in iPhone applications.
www.OnBarcode.com
Paint ECC200 In Objective-C
Using Barcode creator for iPhone Control to generate, create Data Matrix ECC200 image in iPhone applications.
www.OnBarcode.com
Testing the New Help Function
QR Code JIS X 0510 Maker In Objective-C
Using Barcode generator for iPhone Control to generate, create QR-Code image in iPhone applications.
www.OnBarcode.com
EAN8 Printer In Objective-C
Using Barcode printer for iPhone Control to generate, create GS1 - 8 image in iPhone applications.
www.OnBarcode.com
Now, to test our work. If you are following along with the downloaded project, start up DailyJournal. Choose Help DailyJournal Help (note that this is the entry-point name you originally chose), and you should see our nice DailyJournal Help window (see Figure 13 19):
Data Matrix Generation In .NET
Using Barcode drawer for ASP.NET Control to generate, create Data Matrix image in ASP.NET applications.
www.OnBarcode.com
Printing ECC200 In .NET
Using Barcode encoder for Reporting Service Control to generate, create DataMatrix image in Reporting Service applications.
www.OnBarcode.com
CHAPTER 13: Support Tools for the Busy Developer
Barcode Decoder In Java
Using Barcode scanner for Java Control to read, scan read, scan image in Java applications.
www.OnBarcode.com
Making Data Matrix ECC200 In Java
Using Barcode creator for Java Control to generate, create DataMatrix image in Java applications.
www.OnBarcode.com
Figure 13 19. DailyJournal has a real help function now.
Making Code 128 In Visual Studio .NET
Using Barcode creation for ASP.NET Control to generate, create Code 128 image in ASP.NET applications.
www.OnBarcode.com
Barcode Drawer In .NET Framework
Using Barcode creation for ASP.NET Control to generate, create Barcode image in ASP.NET applications.
www.OnBarcode.com
Check that you can navigate between the different pages using the top menu. Now, try a search. Type the word client into the search box and press Return. You will see a set of results. For each result the page title is shown, and beneath that is the text that was entered as the meta description tag. This also appears as a tooltip if you hover over the result. Click any result to see the page. See Figure 13 20.
Barcode Printer In None
Using Barcode printer for Font Control to generate, create Barcode image in Font applications.
www.OnBarcode.com
Barcode Encoder In Visual Studio .NET
Using Barcode drawer for .NET framework Control to generate, create Barcode image in Visual Studio .NET applications.
www.OnBarcode.com
Figure 13 20. Searching the help index for DailyJournal
2D Encoder In Visual Basic .NET
Using Barcode drawer for .NET Control to generate, create 2D image in .NET framework applications.
www.OnBarcode.com
EAN / UCC - 14 Drawer In Java
Using Barcode creator for Java Control to generate, create GS1-128 image in Java applications.
www.OnBarcode.com
Adding a Help Button Linked to a Help Page
Print EAN13 In Java
Using Barcode printer for Android Control to generate, create European Article Number 13 image in Android applications.
www.OnBarcode.com
Encoding GTIN - 12 In None
Using Barcode maker for Microsoft Word Control to generate, create GS1 - 12 image in Microsoft Word applications.
www.OnBarcode.com
As a final step, let s add a Help button to one of the user interface windows and link it to our new help pages. We ll start with the code. The first thing to do is to create an IBAction declaration and implementation. You ll need this to connect the Help button when we create it. Listing 13 2 has the declaration (you will need to add the code in bold).
CHAPTER 13: Support Tools for the Busy Developer
Notice that we are importing Carbon libraries here (the Apple Help functions are held in Carbon.framework), so the next thing to do is to add this framework to the project. In summary, you do a right-click on Other Frameworks in the Groups & Files list, then choose Add Existing Frameworks... and choose Carbon.framework.
Listing 13 2. DailyJournal_AppDelegate.h #import <Cocoa/Cocoa.h> #import <Carbon/Carbon.h> @interface DailyJournal_AppDelegate : NSObject { NSWindow *window; NSPersistentStoreCoordinator *persistentStoreCoordinator; NSManagedObjectModel *managedObjectModel; NSManagedObjectContext *managedObjectContext; } @property (nonatomic, retain) IBOutlet NSWindow *window; @property (nonatomic, retain, readonly) NSPersistentStoreCoordinator *persistentStoreCoordinator; @property (nonatomic, retain, readonly) NSManagedObjectModel *managedObjectModel; @property (nonatomic, retain, readonly) NSManagedObjectContext *managedObjectContext; - (IBAction)saveAction:sender; OSStatus MyGotoHelpPage (CFStringRef pagePath, CFStringRef anchorName); - (IBAction) loadHelpForJournalEntry:(id)sender; @end
The implementation of the action in DailyJournal_AppDelegate.m calls a local function called MyGotoHelpPage (I took this directly from the Developer Documentation). This function in turn calls the help function AHGotoPage. NOTE: The relevant help page with the example code is actually quite hard to find, so here is how to get to it. Search for AHGotoHelpPage (note the lowercase to; It s easy to get this wrong, particularly as GoTo seems correct on the face of it!) and in the results list look for a Full Text result entitled Opening your Help Book in Help Viewer. Select that item. Now, in the table of contents open Opening Your Help Book in Help Viewer and then click on Loading a Help Book Page. Our IBAction passes in the name of the HTML page that we want to load. That s it (there are other options available check the Developer Documentation as suggested previously). The function and action are shown in Listing 13 3, with the new code in bold (most of the rest of the class code has been omitted for clarity, indicated by [...]).
CHAPTER 13: Support Tools for the Busy Developer
Listing 13 3. New Code in DailyJournal_AppDelegate.m [...] /** Implementation of MyGotoHelpPage Taken from Apple Developer Documentation */ OSStatus MyGotoHelpPage (CFStringRef pagePath, CFStringRef anchorName) { CFBundleRef myApplicationBundle = NULL; CFStringRef myBookName = NULL; OSStatus err = noErr; myApplicationBundle = CFBundleGetMainBundle(); if (myApplicationBundle == NULL) { err = fnfErr; goto bail; } myBookName = CFBundleGetValueForInfoDictionaryKey( myApplicationBundle, CFSTR("CFBundleHelpBookName")); if (myBookName == NULL) { err = fnfErr; goto bail; } if (CFGetTypeID(myBookName) != CFStringGetTypeID()) { err = paramErr; } if (err == noErr) err = AHGotoPage (myBookName, pagePath, anchorName); bail: return err; } /** Action calling the MyGotoHelp function with the correct help page */ - (IBAction) loadHelpForJournalEntry:(id)sender { MyGotoHelpPage(CFSTR("index.html"), NULL); } [...]
Now move to Interface Builder and open the Journal Entries window. Add a help button (the small circular button with a question-mark image). Position it next to the Add/Remove buttons below the Journal Entries list. We re just going to point this button at the welcome page in the help pages. Right-click on the new button, drag to the DailyJournal_AppDelegate controller, and choose the action loadHelpForJournalEntry:. Once again I am not going to spell this out you are way past that! Save the NIB and return to Xcode, Build and Run. You should see the new button in your main window. Click on this, and you should see the help window (see Figure 13 21).
Copyright © OnBarcode.com . All rights reserved.