Permalink
Browse files

Added Menu Form representations for items in toolbar

  • Loading branch information...
1 parent f2177ee commit 063f809112250622cd5374734e73ebff5f7dd3d6 @jfmoy committed Mar 23, 2010
Showing with 7 additions and 20 deletions.
  1. +2 −11 Classes/FRAProject+ToolbarController.m
  2. +5 −9 Classes/NSToolbarItem+Fraise.m
@@ -113,8 +113,8 @@ - (NSToolbarItem *)toolbar:(NSToolbar *)toolbar itemForItemIdentifier:(NSString
return previewToolbarItem;
- } else if ([itemIdentifier isEqualToString:@"InfoToolbarItem"]) {
-
+ } else if ([itemIdentifier isEqualToString:@"InfoToolbarItem"]) {
+
infoToolbarItem = [NSToolbarItem createToolbarItemWithIdentifier:itemIdentifier name:NSLocalizedString(@"Info", @"Info") image:infoImage action:@selector(info:) tag:0 target:self];
return infoToolbarItem;
@@ -131,7 +131,6 @@ - (NSToolbarItem *)toolbar:(NSToolbar *)toolbar itemForItemIdentifier:(NSString
[functionButton setImage:functionImage];
[functionButton setTarget:self];
[functionButton setAction:@selector(functionToolbarItemAction:)];
- //[[functionButton cell] setImageScaling:NSImageScaleProportionallyDown];
[functionButton setImagePosition:NSImageOnly];
[functionToolbarItem setLabel:FUNCTION_STRING];
@@ -142,14 +141,6 @@ - (NSToolbarItem *)toolbar:(NSToolbar *)toolbar itemForItemIdentifier:(NSString
[functionToolbarItem setView:view];
-// [functionToolbarItem setLabel:FUNCTION_STRING];
-// [functionToolbarItem setToolTip:FUNCTION_STRING];
-// [functionToolbarItem setPaletteLabel:FUNCTION_STRING];
-// [functionToolbarItem setView:functionButton];
-// [functionToolbarItem setMinSize:NSMakeSize(32.0, 32.0)];
-// [functionToolbarItem setMaxSize:NSMakeSize(32.0, 32.0)];
-// [functionButton setImage:functionImage];
-
menuFormRepresentation = [[NSMenuItem alloc] init];
NSMenu *functionTextOnlyMenu = [[NSMenu alloc] initWithTitle:@""];
[functionTextOnlyMenu setDelegate:self];
@@ -22,15 +22,6 @@ + (NSToolbarItem *)createToolbarItemWithIdentifier:(NSString *)itemIdentifier na
{
NSToolbarItem *toolbarItem = [[NSToolbarItem alloc] initWithItemIdentifier:itemIdentifier];
-// [toolbarItem setLabel:name];
-// [toolbarItem setPaletteLabel:name];
-// [toolbarItem setToolTip:name];
-// [toolbarItem setTag:tag];
-//
-// [toolbarItem setImage:image];
-// [toolbarItem setTarget:target];
-// [toolbarItem setAction:selector];
-
NSRect toolbarItemRect = NSMakeRect(0.0, 0.0, 28.0, 27.0);
NSView *view = [[NSView alloc] initWithFrame:toolbarItemRect];
@@ -52,6 +43,9 @@ + (NSToolbarItem *)createToolbarItemWithIdentifier:(NSString *)itemIdentifier na
[toolbarItem setTag:tag];
[toolbarItem setView:view];
+ // Menu representation.
+ [toolbarItem setMenuFormRepresentation:[[NSMenuItem alloc] initWithTitle:name action:selector keyEquivalent:@""]];
+
return toolbarItem;
}
@@ -68,6 +62,8 @@ + (NSToolbarItem *)createPreferencesToolbarItemWithIdentifier:(NSString *)itemId
[toolbarItem setTarget:target];
[toolbarItem setAction:selector];
+ [toolbarItem setMenuFormRepresentation:[[NSMenuItem alloc] initWithTitle:name action:selector keyEquivalent:@""]];
+
return toolbarItem;
}

0 comments on commit 063f809

Please sign in to comment.