Home > LIFlipEffect

LIFlipEffect

LIFlipEffect is a project mainly written in ..., it's free.

CoreAnimation-based Window Flip

{ tf1ansiansicpg1252cocoartf949cocoasubrtf460 {fonttblf0fnilfcharset0 HelveticaNeue-CondensedBlack;f1fnilfcharset0 HelveticaNeue-CondensedBold;f2fswissfcharset0 Helvetica; f3fmodernfcharset0 Courier;f4fmodernfcharset0 Courier-Bold;} {colortbl; ed255green255lue255; ed64green64lue64;} margl1440margr1440vieww12140viewh13540viewkind0 pard x566 x1133 x1700 x2267 x2834 x3401 x3968 x4535 x5102 x5669 x6236 x6803qlqnaturalpardirnatural

f0fs48 cf0 LIFlipEffect

f1fs24 Core Animation based Window Flip f20 LIFlipEffect is a class which flips from a source to a target window using CoreAnimation. LIEffect, an abstract superclass, provides a transparent window in which animation occurs while the subclass defines the effect itself. To use LIFlipEffect, define a controller with outlets to a source and destination window. You can define an action method to perform the flip similar to this one: pard x566 x1133 x1700 x2267 x2834 x3401 x3968 x4535 x5102 x5669 x6236 x6803li280qlqnaturalpardirnatural

f3 cf2 - (IBAction)flipToPreferences:(id)sender { // don't flip if we're already there... if (self.prefWindow.isVisible) return; // ...also, don't bother flipping if the window isn't visible if (self.window.isVisible) { pard x566 x1133 x1700 x2267 x2834 x3401 x3968 x4535 x5102 x5669 x6236 x6803li280qlqnaturalpardirnatural

f4 cf2 [[[LIFlipEffect alloc] initFromWindow:self.window toWindow:self.prefWindow] run]; pard x566 x1133 x1700 x2267 x2834 x3401 x3968 x4535 x5102 x5669 x6236 x6803li280qlqnaturalpardirnatural

f30 cf2 } else { [self.prefWindow makeKeyAndOrderFront:self]; } } pard x566 x1133 x1700 x2267 x2834 x3401 x3968 x4535 x5102 x5669 x6236 x6803qlqnaturalpardirnatural

f2 cf0 In the code above, we handle a few special cases - we don't flip if we've already flipped to our destination window and we don't flip if our source window isn't visible. Otherwise, we initiate the flip by instantiating LIFlipEffect with a from- and to-window, then ask the object to run. LIFlipEffect will release itself once the animation is complete - hence we do not autorelease it. pard x566 x1133 x1700 x2267 x2834 x3401 x3968 x4535 x5102 x5669 x6236 x6803qlqnaturalpardirnatural

f0fs28 cf0 Frameworks pard x566 x1133 x1700 x2267 x2834 x3401 x3968 x4535 x5102 x5669 x6236 x6803qlqnaturalpardirnatural

f20fs24 cf0 To use LIFlipEffect in your own projects, make sure to link to the QuartzCore.framework where the CA... classes are defined. pard x566 x1133 x1700 x2267 x2834 x3401 x3968 x4535 x5102 x5669 x6236 x6803qlqnaturalpardirnatural

f0fs28 cf0 Licensing pard x566 x1133 x1700 x2267 x2834 x3401 x3968 x4535 x5102 x5669 x6236 x6803qlqnaturalpardirnatural

f20fs24 cf0 This code is licensed under the BSD license. If you use it, please post me a message at [email protected] - I'd love to hear from you! I'm also available to work on any complex Cocoa tasks - I'm familiar with it all, and have been working in the environment since the days of NeXT Computer and NeXTstep. }

Previous:vitalsigns