[Hdrflow-svn] SF.net SVN: hdrflow: [197] trunk/app/HDRFlow
Status: Pre-Alpha
Brought to you by:
glslang
From: <gl...@us...> - 2007-07-21 22:31:33
|
Revision: 197 http://hdrflow.svn.sourceforge.net/hdrflow/?rev=197&view=rev Author: glslang Date: 2007-07-21 15:31:30 -0700 (Sat, 21 Jul 2007) Log Message: ----------- + Preferences Window initial toolbar code Modified Paths: -------------- trunk/app/HDRFlow/English.lproj/Preferences.nib/classes.nib trunk/app/HDRFlow/English.lproj/Preferences.nib/info.nib trunk/app/HDRFlow/English.lproj/Preferences.nib/keyedobjects.nib trunk/app/HDRFlow/HDRFlow.xcodeproj/project.pbxproj trunk/app/HDRFlow/PreferencesController.h trunk/app/HDRFlow/PreferencesController.m Added Paths: ----------- trunk/app/HDRFlow/Images/ trunk/app/HDRFlow/Images/GeneralPreferences.tiff Modified: trunk/app/HDRFlow/English.lproj/Preferences.nib/classes.nib =================================================================== --- trunk/app/HDRFlow/English.lproj/Preferences.nib/classes.nib 2007-07-21 16:00:50 UTC (rev 196) +++ trunk/app/HDRFlow/English.lproj/Preferences.nib/classes.nib 2007-07-21 22:31:30 UTC (rev 197) @@ -4,6 +4,7 @@ { CLASS = PreferencesController; LANGUAGE = ObjC; + OUTLETS = {generalView = NSView; }; SUPERCLASS = NSWindowController; } ); Modified: trunk/app/HDRFlow/English.lproj/Preferences.nib/info.nib =================================================================== --- trunk/app/HDRFlow/English.lproj/Preferences.nib/info.nib 2007-07-21 16:00:50 UTC (rev 196) +++ trunk/app/HDRFlow/English.lproj/Preferences.nib/info.nib 2007-07-21 22:31:30 UTC (rev 197) @@ -4,11 +4,17 @@ <dict> <key>IBDocumentLocation</key> <string>69 54 356 240 0 0 1440 878 </string> + <key>IBEditorPositions</key> + <dict> + <key>10</key> + <string>361 341 412 270 0 0 1440 878 </string> + </dict> <key>IBFramework Version</key> <string>446.1</string> <key>IBOpenObjects</key> <array> <integer>5</integer> + <integer>10</integer> </array> <key>IBSystem Version</key> <string>8R2218</string> Modified: trunk/app/HDRFlow/English.lproj/Preferences.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/app/HDRFlow/HDRFlow.xcodeproj/project.pbxproj =================================================================== --- trunk/app/HDRFlow/HDRFlow.xcodeproj/project.pbxproj 2007-07-21 16:00:50 UTC (rev 196) +++ trunk/app/HDRFlow/HDRFlow.xcodeproj/project.pbxproj 2007-07-21 22:31:30 UTC (rev 197) @@ -19,6 +19,7 @@ 67C8D8B80C4AD8340006B871 /* bootstrap.py in Resources */ = {isa = PBXBuildFile; fileRef = 67C8D8B70C4AD8340006B871 /* bootstrap.py */; }; 67DC61B90C2EAC94005CFE6E /* ViewportOpenGLView.m in Sources */ = {isa = PBXBuildFile; fileRef = 67DC61B80C2EAC94005CFE6E /* ViewportOpenGLView.m */; }; 67DC62180C2EC0D9005CFE6E /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 67DC62170C2EC0D9005CFE6E /* OpenGL.framework */; }; + 67F7A3EE0C52A21600172987 /* GeneralPreferences.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 67F7A3ED0C52A21600172987 /* GeneralPreferences.tiff */; }; 8D11072A0486CEB800E47090 /* MainMenu.nib in Resources */ = {isa = PBXBuildFile; fileRef = 29B97318FDCFA39411CA2CEA /* MainMenu.nib */; }; 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; 8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; @@ -52,6 +53,7 @@ 67DC61B80C2EAC94005CFE6E /* ViewportOpenGLView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewportOpenGLView.m; sourceTree = "<group>"; }; 67DC62170C2EC0D9005CFE6E /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = "<absolute>"; }; 67F6CCF70C285D6C00098F90 /* CustomOpenGLView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CustomOpenGLView.h; sourceTree = "<group>"; }; + 67F7A3ED0C52A21600172987 /* GeneralPreferences.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = GeneralPreferences.tiff; path = Images/GeneralPreferences.tiff; sourceTree = "<group>"; }; 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; }; 8D1107320486CEB800E47090 /* HDRFlow.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HDRFlow.app; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -123,7 +125,6 @@ 080E96DDFE201D6D7F000001 /* Classes */, 29B97315FDCFA39411CA2CEA /* Other Sources */, 29B97317FDCFA39411CA2CEA /* Resources */, - 67C8D8B10C4AD7350006B871 /* Scripts */, 29B97323FDCFA39411CA2CEA /* Frameworks */, 19C28FACFE9D520D11CA2CBB /* Products */, ); @@ -144,6 +145,8 @@ 29B97317FDCFA39411CA2CEA /* Resources */ = { isa = PBXGroup; children = ( + 67C8D8B10C4AD7350006B871 /* Scripts */, + 67F7A3EC0C52A1F900172987 /* Images */, 8D1107310486CEB800E47090 /* Info.plist */, 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, 29B97318FDCFA39411CA2CEA /* MainMenu.nib */, @@ -170,6 +173,14 @@ name = Scripts; sourceTree = "<group>"; }; + 67F7A3EC0C52A1F900172987 /* Images */ = { + isa = PBXGroup; + children = ( + 67F7A3ED0C52A21600172987 /* GeneralPreferences.tiff */, + ); + name = Images; + sourceTree = "<group>"; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -216,6 +227,7 @@ 674E44640C3F854A0036A908 /* ScriptEditor.nib in Resources */, 67C8D8B80C4AD8340006B871 /* bootstrap.py in Resources */, 67C064EE0C52231A00E9ED8E /* Preferences.nib in Resources */, + 67F7A3EE0C52A21600172987 /* GeneralPreferences.tiff in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; Added: trunk/app/HDRFlow/Images/GeneralPreferences.tiff =================================================================== (Binary files differ) Property changes on: trunk/app/HDRFlow/Images/GeneralPreferences.tiff ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/app/HDRFlow/PreferencesController.h =================================================================== --- trunk/app/HDRFlow/PreferencesController.h 2007-07-21 16:00:50 UTC (rev 196) +++ trunk/app/HDRFlow/PreferencesController.h 2007-07-21 22:31:30 UTC (rev 197) @@ -9,6 +9,17 @@ @interface PreferencesController : NSWindowController { + NSMutableDictionary* items; + + IBOutlet NSView* generalView; } +- ( NSToolbarItem* ) toolbar: ( NSToolbar* ) toolbar itemForItemIdentifier: ( NSString* ) itemIdentifier willBeInsertedIntoToolbar: ( BOOL ) flag; +- ( NSArray* ) toolbarDefaultItemIdentifiers: ( NSToolbar* ) toolbar; +- ( NSArray* ) toolbarAllowedItemIdentifiers: ( NSToolbar* ) toolbar; + +- ( void ) addToolbarItem: ( NSString* ) identifier label: ( NSString* ) label paletteLabel: ( NSString* ) paletteLabel tooltip: ( NSString* ) tooltip target: ( id ) target settingSelector: ( SEL ) settingSelector itemContent: ( id ) itemContent action: ( SEL ) action; +- ( void ) toolbarItemAction: ( id ) sender; +- ( void ) setActiveView: ( NSView* ) view; + @end Modified: trunk/app/HDRFlow/PreferencesController.m =================================================================== --- trunk/app/HDRFlow/PreferencesController.m 2007-07-21 16:00:50 UTC (rev 196) +++ trunk/app/HDRFlow/PreferencesController.m 2007-07-21 22:31:30 UTC (rev 197) @@ -14,4 +14,86 @@ return [ super initWithWindowNibName: windowNibName ]; } +- ( void ) awakeFromNib +{ + items = [ [ NSMutableDictionary dictionary ] retain ]; + + NSToolbar* toolbar = [ [ [ NSToolbar alloc ] initWithIdentifier: @"HDRFlowPreferencesToolbar" ] autorelease ]; + [ toolbar setAllowsUserCustomization: YES ]; + [ toolbar setAutosavesConfiguration: YES ]; + [ toolbar setSizeMode: NSToolbarSizeModeDefault ]; + [ toolbar setDisplayMode: NSToolbarDisplayModeIconAndLabel ]; + [ toolbar setDelegate: self ]; + + [ self addToolbarItem: @"General" label: @"General" paletteLabel: @"General" tooltip: @"Generic application configuration parameters" target: self settingSelector: @selector( setImage: ) itemContent: [ NSImage imageNamed: @"GeneralPreferences" ] action: @selector( toolbarItemAction: ) ]; + + [ [ self window ] setToolbar: toolbar ]; +} + +- ( void ) dealloc +{ + [ items release ]; + [ super dealloc ]; +} + +#pragma mark ---- NSToolbar required delegate methods ---- + +- ( NSToolbarItem* ) toolbar: ( NSToolbar* ) toolbar itemForItemIdentifier: ( NSString* ) itemIdentifier willBeInsertedIntoToolbar: ( BOOL ) flag +{ + NSToolbarItem* cloneItem = [ [ [ NSToolbarItem alloc ] initWithItemIdentifier: itemIdentifier ] autorelease ]; + NSToolbarItem* originalItem = [ items objectForKey: itemIdentifier ]; + + [ cloneItem setLabel: [ originalItem label ] ]; + [ cloneItem setPaletteLabel: [ originalItem paletteLabel ] ]; + [ cloneItem setToolTip: [ originalItem toolTip ] ]; + [ cloneItem setTarget: [ originalItem target ] ]; + [ cloneItem setAction: [ originalItem action ] ]; + if( [ originalItem view ] != nil ) + { + [ cloneItem setView: [ originalItem view ] ]; + [ cloneItem setMinSize: [ [ originalItem view ] bounds ].size ]; + [ cloneItem setMaxSize: [ [ originalItem view ] bounds ].size ]; + } + else + { + [ cloneItem setImage: [ originalItem image ] ]; + } + + return cloneItem; +} + +- ( NSArray* ) toolbarDefaultItemIdentifiers: ( NSToolbar* ) toolbar +{ + return [ NSArray arrayWithObjects: @"General", nil ]; +} + +- ( NSArray* ) toolbarAllowedItemIdentifiers: ( NSToolbar* ) toolbar +{ + return [ NSArray arrayWithObjects: @"General", nil ]; +} + +#pragma mark ---- Toolbar items ---- + +- ( void ) addToolbarItem: ( NSString* ) identifier label: ( NSString* ) label paletteLabel: ( NSString* ) paletteLabel tooltip: ( NSString* ) tooltip target: ( id ) target settingSelector: ( SEL ) settingSelector itemContent: ( id ) itemContent action: ( SEL ) action +{ + NSToolbarItem* item = [ [ [ NSToolbarItem alloc ] initWithItemIdentifier: identifier ] autorelease ]; + [ item setLabel: label ]; + [ item setPaletteLabel: paletteLabel ]; + [ item setToolTip: tooltip ]; + [ item setTarget: target ]; + [ item performSelector: settingSelector withObject: itemContent ]; + [ item setAction: action ]; + + [ items setObject: item forKey: identifier ]; +} + +- ( void ) toolbarItemAction: ( id ) sender +{ +} + +- ( void ) setActiveView: ( NSView* ) view +{ + [ [ self window ] setContentView: view ]; +} + @end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |