Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
237 commits
Select commit Hold shift + click to select a range
a7ce2ab
Bug fix: Context lines slider can now update diff views in real time.
andreberg Oct 20, 2009
6c04aea
Bug fix: Change improper usage of dot notation.
andreberg Oct 20, 2009
08284e9
Bug fix: Increase width of Amend text label.
andreberg Oct 20, 2009
dca051c
Xcode project update: Change base SDK and deployement target to 10.6.
andreberg Oct 20, 2009
75e8a5b
Bug fix: Make QuickLook panel work by using the now public API.
andreberg Oct 20, 2009
380973b
Bug fix: Various smaller fixes regarding GC, dot notation, etc...
andreberg Oct 20, 2009
87df0b1
Lower the fade and timeout interval for the context range slider.
andreberg Oct 20, 2009
0cfc5b1
Bug fix: small error in rsync detection between MacPorts and builtin.
andreberg Oct 20, 2009
76298f1
Bug fix: the QuickLook panel now really starts its nice morphing anim…
andreberg Oct 21, 2009
e936253
Xcode project update. Just a small build name change
andreberg Oct 24, 2009
4f7e155
Adding relitive dates to history view
hardkrash Jul 13, 2009
93f1ea0
Unescape the filename to ensure that filenames containing '&' are dis…
leachbj Sep 25, 2009
c13474e
Added weeks to the strings of time.
hardkrash Jul 13, 2009
003977d
FIX: memory leak(delete will not be called) and graph glitch
niw Sep 9, 2009
73fcb78
FIX: bug
niw Sep 9, 2009
11cc30b
Add on window selection refresh.
rastersize Jul 17, 2009
fcbe01b
Xcode build name again. Just ignore it.
andreberg Oct 24, 2009
350be10
Merge branch 'ab/fqueue_stage' into devel
andreberg Oct 24, 2009
c76c922
Add missing changes for commit 11cc30 from rastersize's fork
andreberg Oct 24, 2009
286b727
Merge branch 'ab/fqueue_stage' into devel
andreberg Oct 24, 2009
7bf4ed5
Bug fix: Change notification to avoid display freezes when the QuickL…
andreberg Oct 24, 2009
0df2d3f
Merge branch 'fqueue' into devel
andreberg Oct 24, 2009
75abf03
Add 10.6 delegate protocols to silence compiler warnings.
andreberg Oct 24, 2009
fed2cc4
Update checkbox buttons to non scaling to get rid of the XIB compiler…
andreberg Oct 24, 2009
a2ebc4a
Add stderr to PBEasyPipe output for helpful messages to Console.
andreberg Oct 26, 2009
611687e
Use the newer libgit2 method for extracting a hex digest from an obje…
Oct 24, 2009
fa929eb
Use the libgit2 allocfmt method, instead of hacking it by hand.
Oct 24, 2009
cdc4f52
Add a menu item and an action for pushing a repo up.
Oct 24, 2009
4b74a3f
Disable the push menu item for branches which don't have a remote.
Oct 24, 2009
b580c03
DRY up the menu adding code
Oct 25, 2009
2b0000c
Add menu and toolbar changes from cyberfox
andreberg Oct 26, 2009
5b0051e
Rudimentary clone capability from the File menu.
Oct 26, 2009
7eb3616
Disable toolbar entries when they are processing, as at least some mi…
Oct 26, 2009
3c113a3
Update the submodule to point to the actual libgit2 repository.
Oct 26, 2009
b7ec771
Add alternative icons for Rebase, Push and Pull.
andreberg Oct 26, 2009
e80bcef
Update menu entry title to better match rest: 'Detailed View' -> 'Det…
andreberg Oct 26, 2009
d4a7df1
Remove superfluous resources and underutilized localizations.
andreberg Oct 31, 2009
7d19e1c
Disable 'Save' menu item if no document is open.
andreberg Oct 31, 2009
fb0fbff
Combine scatterred error domains and codes into one central file.
andreberg Oct 31, 2009
5be7451
Add sanity check to PBEasyPipe that checks if a working dir really is…
andreberg Oct 31, 2009
2a6f59b
Synthesize repositoryPath for external access.
andreberg Oct 31, 2009
1fed883
Loading message restricted to DEBUG_BUILD.
andreberg Oct 31, 2009
d5688db
Exert other options before falling back to PBGitRepository's global s…
andreberg Oct 31, 2009
7c1b9d9
Add pullButton: IBAction.
andreberg Oct 31, 2009
0d42c59
Override openDocumentWithContentsOfURL:... to provide sanity checks f…
andreberg Oct 31, 2009
4396081
Add new PNG templates for Pull, Push, Rebase and Clone.
andreberg Oct 31, 2009
7892ac4
Update toolbars to incorporate the new buttons.
andreberg Oct 31, 2009
b76f755
Safety measure: Replace unneeded stringWithFormat with stringWithStri…
andreberg Oct 31, 2009
421d6fd
Bug fix: Wrong usage of dot notation.
andreberg Nov 3, 2009
93a027c
Bug fix: Make new buttons actually work.
andreberg Nov 3, 2009
0f50cd6
Bug fix: reconnect the search field predicates so the field works again.
andreberg Nov 4, 2009
2cc3c73
Filter debug log output by getenv adressable Xcode environment vars.
andreberg Nov 4, 2009
d04c639
Update tooltips for Push, Pull and Rebase buttons to better reflect w…
andreberg Nov 7, 2009
4c4203a
Update PBGitErrors to include some error messages dealing with missin…
andreberg Nov 7, 2009
f1fcb18
Improve error and tooltip descriptions.
andreberg Nov 7, 2009
1551084
Update context menu to include remote target and other dynamic title …
andreberg Nov 7, 2009
9e72dba
PBRefController: Switch the app modal Delete Remote panel to a window…
brotherbard Nov 8, 2009
d8f27db
Fix finding the correct contextual menu when Subject is not the first…
brotherbard Nov 8, 2009
f97cfbb
Add name of branch/remote to Checkout and Delete contextual menu items.
brotherbard Nov 8, 2009
2b45994
Update the current branch when changes are made (like checking out a …
brotherbard Nov 8, 2009
0377181
Disable the Checkout menu item when the branch is the current branch.
brotherbard Nov 8, 2009
5e12643
Bug fix: Move updating the current branch to the checkoutRef method.
brotherbard Nov 8, 2009
b6d6e0d
Bug fix: Correct dot notation misuse.
andreberg Nov 8, 2009
22ba33f
Disable/re-enable Push, Pull and Rebase buttons depending on selected…
andreberg Nov 8, 2009
4cdf634
Replace pre-10.6 workaround with public - [NSSavePanel setShowsHidden…
andreberg Nov 8, 2009
1a7b4cb
Update branch menu after deletion of a branch.
andreberg Nov 8, 2009
1ade0f0
Remove completely wrong TODO comment.
andreberg Nov 8, 2009
2c6fd97
Cosmetic: Move showMessageSheet convenience method to the proper prag…
andreberg Nov 8, 2009
12f26bc
Update height for split view partials.
andreberg Nov 8, 2009
c52aedf
Add an "Add Remote" button to the toolbar that adds and fetches a rem…
brotherbard Nov 8, 2009
d365bd4
Add a "Create Tag" button to the toolbar.
brotherbard Nov 8, 2009
6740c68
Fix the tooltip for the Add Remote toolbar item.
brotherbard Nov 8, 2009
37dcdf2
Adjust split view height of the commit webview.
andreberg Nov 8, 2009
0be790d
merge andreberg/master
brotherbard Nov 9, 2009
a26bca8
Add drop down menus to the push and pull toolbar items.
brotherbard Nov 9, 2009
666d135
Add template PNG for the "Add Remote" button.
andreberg Nov 9, 2009
8520abd
Polish sheets and dialogs (struts, autosizing, min/max size etc.).
andreberg Nov 9, 2009
9c4949e
Add disclosure triangles to the template images for Push, Pull, Rebas…
andreberg Nov 10, 2009
2558fef
Comment the toolbar item toggle method out since we no longer need to…
andreberg Nov 10, 2009
ff550e8
More cleanup and feature adding for the Push, Pull and Rebase popup b…
andreberg Nov 10, 2009
5363724
Bug fix: Pull button now really has the correct image (not the Push b…
andreberg Nov 10, 2009
d4a8bc9
Update and homogenize tooltips of the toolbar items to better explain…
andreberg Nov 10, 2009
06d3b9b
Bug fix: Re-enable the toolbar item validation.
andreberg Nov 10, 2009
b391749
Added hover css for diff history view refs - branch tags, and 'Gist i…
fbartho Feb 23, 2010
25577e0
Modified the Commit TableView to support filtering on All fields simu…
fbartho Feb 24, 2010
a7d8f02
Added hover css to the "Stage" "Discard" and "Unstage" buttons so tha…
fbartho Mar 3, 2010
a1cd543
Added support for urls in commit log messages. This means jira:// url…
fbartho Mar 4, 2010
241b44b
Typo wording fixed.
fbartho Mar 6, 2010
782981a
Merge branch 'stable'
Mar 13, 2010
0999c13
Added hover css for diff history view refs - branch tags, and 'Gist i…
fbartho Feb 23, 2010
6b19dab
Modified the Commit TableView to support filtering on All fields simu…
fbartho Feb 24, 2010
158b569
Added hover css to the "Stage" "Discard" and "Unstage" buttons so tha…
fbartho Mar 3, 2010
8b238d1
wording improved for commit typo fix.
fbartho Mar 19, 2010
93d18b3
URL regex adjusted so it now handles any <protocol>://<url> combinati…
fbartho Mar 19, 2010
16cdb6f
Simplify install.sh script by removing a superfluous string compariso…
andreberg Mar 23, 2010
38177ed
Merge remote branch 'brotherbard/experimental' into local branch 'bb/…
andreberg Mar 24, 2010
884a2fc
Post merge fix: Move remote XIBs into English.lproj and make them loc…
andreberg Mar 24, 2010
3816278
Post merge fix: Remove unused KBPopUpToolbaritem files.
andreberg Mar 24, 2010
8516743
Move the jQuery lib from html/js into html/lib where it should have b…
andreberg Mar 24, 2010
c22e888
Add a note to .gitmodules telling why we need to keep using Pieter's …
andreberg Mar 24, 2010
7d14bff
Make some of the sheets resizable (you never know how much a user wan…
andreberg Mar 24, 2010
d276c5e
PBGitHistoryView.xib: Set Key Equiv. of QuickLook button to Space.
andreberg Mar 24, 2010
eb23f42
Remove the bad file descriptor #warning since that was likely caused …
andreberg Mar 24, 2010
79c928d
Remove my 10.6 QuickLook panel code since Nathan's implementation han…
andreberg Mar 24, 2010
e6d2591
Post merge fix: Remove some of my left over code for the 10.6 QuickLo…
andreberg Mar 24, 2010
d1eff3c
Bugfix?: this seems to fix the "malloc refcount underflow" errors tha…
andreberg Mar 24, 2010
b6272c0
Post merge fix: Set Base SDK back to 10.5
andreberg Mar 24, 2010
4832f3b
Code cleanup: Remove unneeded #imports, empty methods, declare id ret…
andreberg Mar 24, 2010
45e8aab
Post merge fix: Since we're 10.5 SDK again, we cannot use non-informa…
andreberg Mar 24, 2010
5598eef
Add preference options for refreshing the view + controller automatic…
andreberg Mar 24, 2010
3541acf
Post merge fix: Use the git_oid_mkhex function again from Pieter's li…
andreberg Mar 24, 2010
752bb7c
Post merge fix: Delete some left over code from my 10.6 QuickLook pre…
andreberg Mar 24, 2010
8426304
Move error domains into their own PBGitXErrors file pair.
andreberg Mar 24, 2010
97550f2
Bugfix: This caused "no var named button" exceptions in the web view.
andreberg Mar 24, 2010
22f916f
Give the showHideAllFiles action at least a chance to call the public…
andreberg Mar 24, 2010
e5b5e4c
SCNetworkCheckReachabilityByName will be deprecated anyways, so repla…
andreberg Mar 24, 2010
7d6f966
Make the view controllers __weak to silence some underflow refcount e…
andreberg Mar 24, 2010
ca0fa1e
Some personal preferences for the history web view's #message.
andreberg Mar 24, 2010
e6f7350
Remove the superfluous string comparison shell function.
andreberg Mar 24, 2010
bca58a7
First stab at an executable that can be put into the SSH_ASKPASS envi…
uliwitness Mar 24, 2010
6c4c40d
Set the environment variables for our tool. We have a rudimentary but…
uliwitness Feb 19, 2010
abe09c4
Label on password window so it's less cryptic.
uliwitness Mar 13, 2010
6a542d4
Cannot use non-informal protocols with Base SDK 10.5.
andreberg Mar 24, 2010
b4d3093
Remove some left over image links from Xcode's project.pbproj.
andreberg Mar 24, 2010
065a83b
Merge branch 'master' into devel
andreberg Mar 24, 2010
0f18ffd
Make remaining sheets resizable as well.
andreberg Mar 24, 2010
d9778b2
Merge branch 'master' into devel
andreberg Mar 24, 2010
a100ff3
Set a copy of the "Push" message strings for the alert panel message …
andreberg Mar 24, 2010
1922798
Merge branch 'master' into devel
andreberg Mar 24, 2010
a3ede54
Bugfix: Bad files descriptor should be history now.
andreberg Mar 24, 2010
95e0503
Add a string truncation category because on a very large commit the s…
andreberg Mar 24, 2010
804f620
Remove finalizers with only observer unregistering code since GC guid…
andreberg Mar 24, 2010
d999eff
Remove superfluous (and crash prone) entries from the context menu of…
andreberg Mar 24, 2010
925c227
Add Cmd+Shift+F for "Reveal in Finder" and Cmd+Shift+T for "Open Term…
andreberg Mar 24, 2010
1fa1c4d
Add Cmd+Shift+F for "Reveal in Finder" and Cmd+Shift+T for "Open Term…
andreberg Mar 24, 2010
00545fb
Add a preference option for truncating very large info sheet content …
andreberg Mar 24, 2010
1488beb
Small tweak to the response of the Context diff slider.
andreberg Mar 24, 2010
27a8c8a
Merge branch 'refs/heads/devel'
andreberg Mar 24, 2010
5b5118c
Xcode: Set Clang as default compiler for all build configurations.
andreberg Mar 24, 2010
0177e20
changed calls to git_oid_mkhex() to git_oid_to_string() to make it co…
roddi Mar 25, 2010
97e3d18
Bugfix: obj.realSha() in history.js returns nil/undefined more often …
andreberg Mar 25, 2010
e004c64
Update .gitmodules to point to the actual libgit2 host now.
andreberg Mar 25, 2010
facf2ba
Simplify Xcode's build settings on project and target level by using …
andreberg Mar 26, 2010
344fb8c
Wrap CWQuicklook.h in deployment target defines so it compiles cleanl…
andreberg Mar 26, 2010
404dee7
Move some settings from Install.xcconfig that are intended for Releas…
andreberg Mar 26, 2010
0dc2781
Delete some overlooked overwrites in Xcode's Project build settings d…
andreberg Mar 26, 2010
7b28685
Incorporate roddi/gitx aed059eb ("corrected script file permissions").
andreberg Mar 26, 2010
5018524
Install gitx (the CLI) via Install.sh.
andreberg Mar 26, 2010
f0a3502
Make the gitx arguments "--all" and "--local" (new) switch to the cor…
andreberg Mar 26, 2010
ad766c5
Delete some non functional left overs from a previous merge.
andreberg Mar 26, 2010
557ff4e
Switch DEBUG_INFORMATION_FORMAT from DWARF with dSYM to DWARF in Rele…
andreberg Mar 26, 2010
d43e72f
Tweak to the context slider response time (hopefully final this time).
andreberg Mar 26, 2010
d12b923
Stability: employ more sanity checks when parsing author details from…
andreberg Mar 30, 2010
4428373
Make the prefs panel update all open document views on close.
andreberg Mar 30, 2010
a763dd8
Add a property to PBGitRepository that indicates if we are launching …
andreberg Mar 30, 2010
75fbde6
Make comment about "Subtle Dangers of DO" a lot smaller
andreberg Mar 30, 2010
34c404a
Stability: employ more sanity checks when parsing author details from…
andreberg Mar 30, 2010
156d67f
Add -debugDescription and -description to PBGitRef
andreberg Mar 30, 2010
25b47bb
Reinstate the -finalize method to remove ourselves as observer.
andreberg Mar 30, 2010
5915288
Add readonly __weak superController access to PBViewController.
andreberg Mar 30, 2010
7e986fb
Add in left-out (id) return labels to some methods in PBGitCommit.
andreberg Mar 30, 2010
3158d0f
Apply Nathan Kissinger's bugfixes to NSFileHandleExt.m (s. GitX Googl…
andreberg Apr 5, 2010
d76072f
Add -description and/or -debugDescription methods to PBGitCommit, PBG…
andreberg Apr 5, 2010
8e55c30
Make building and installing possible right from within Xcode.
andreberg Apr 5, 2010
229387c
Populate the revList if empty in -commitForSHA:
andreberg Apr 5, 2010
a45f865
Make default (id) explicit for some method decls/defs in PBGitHistory…
andreberg Apr 5, 2010
5fb70a8
Make ApplicationController a singleton class.
andreberg Apr 5, 2010
7b74367
Add -description and -debugDescription methods to PBSourceViewItem.m
andreberg Apr 5, 2010
85b2de9
Disable hidden entries in MainMenu.xib/File and remove the saveAs: ta…
andreberg Apr 5, 2010
93483cb
Adjust the last two panels in Preferences.xib in width to match the f…
andreberg Apr 5, 2010
69d23e9
Move Remote segmented controls from Sidebar to Repository window's to…
andreberg Apr 5, 2010
8bc8a73
Put at-sign in front of multi-line continued string.
andreberg Apr 5, 2010
23a1ddd
Remove a superfluous semicolon in PBCommitList.m
andreberg Apr 5, 2010
8df20db
Add PBStringFromBranchFilterType() function for debugging purposes to…
andreberg Apr 5, 2010
ba63642
Add a method declaration to PBGitRevSpecifier.h to silence a compiler…
andreberg Apr 5, 2010
5cb73b4
Bug fix: correct visible index scrolling in PBGitHistoryController an…
andreberg Apr 5, 2010
4b4912a
Add some more checking/validation methods to PBGitRepository.
andreberg Apr 5, 2010
0c26fb5
Remove launchedFromCLI ivar from PBGitRepository.
andreberg Apr 5, 2010
7761d2f
Add shell script methods to PBGitRepository.
andreberg Apr 5, 2010
bc44ebf
Add new Error constants to PBGitXErrors, mostly for CLI support
andreberg Apr 5, 2010
3f7b662
Minor file layout changes to PBGitHistoryController.
andreberg Apr 5, 2010
c85fa2f
Declare sidebarController property as __weak in PBGitWindowController.
andreberg Apr 5, 2010
4ed7911
Multiple changes to -selectCommit: from PBGitHistoryController.
andreberg Apr 5, 2010
f704c99
Add a NSUserDefaultsDidChangeNotification listener to PBGitHistoryCon…
andreberg Apr 5, 2010
1d4e4c5
Only update selectedCommit in [PBGitHistoryController updateKeys] whe…
andreberg Apr 5, 2010
11688c9
If launched from CLI return immediately from observeValueForKeyPath...
andreberg Apr 5, 2010
bee02b1
Add a check for hasPrefix:@"refs/" to isSimpleRef logic in PBGitRevSp…
andreberg Apr 5, 2010
8ddcc6c
Add DO directional/value qualifier keywords to PBCLIProxy
andreberg Apr 5, 2010
f87cfa6
Add #import "BMScript.h" to PBSourceViewItem since it needs it for de…
andreberg Apr 5, 2010
10daa22
Major overhaul of the handling/effect of CLI args (gitx/PBCLIProxy).
andreberg Apr 5, 2010
d1474bd
Improving configuration of NSArrayController in PBGitHistoryView.
andreberg Apr 5, 2010
d54dca4
Remove debugging NSLog clutter and other left-over code.
andreberg Apr 5, 2010
bfb7149
Merge branch 'master' into fbartho
fbartho May 4, 2010
9a5efab
added missing delegate protocol declaration to remove warnings for 10.6
roddi May 17, 2010
39ec231
Merge commit 'brotherbard/experimental'
dgrijalva Jun 2, 2010
535ef4e
fixed warnings and analyser hits
roddi Jun 8, 2010
fe31a90
initial blame functionality
laullon Jun 9, 2010
852006e
initial blame functionality on tree view
laullon Jun 10, 2010
6d7a0a5
HTML Blame
laullon Jun 10, 2010
8a68343
reload html
Jun 11, 2010
5ebb673
highlight test
Jun 11, 2010
a3a9173
SyntaxHighlighter functional
laullon Jun 11, 2010
1a4556e
SyntaxHighlighter Object-C brush
laullon Jun 11, 2010
1c3364d
source and diff view on history
Jun 11, 2010
81166cb
scrollbar horizontal & toolbar class
Jun 11, 2010
6e20f39
MGScopeBar org verison
laullon Jun 13, 2010
26d9adc
Common file viewer for historic and commit views
laullon Jun 14, 2010
3d123f7
initial File log
laullon Jun 14, 2010
1c350db
Merge commit 'refs/remotes/andreberg/master' into test_merge
laullon Jun 14, 2010
34f5ed7
merge end
laullon Jun 14, 2010
5a7dd3f
Merge commit 'refs/remotes/roddi/sidebar'
laullon Jun 15, 2010
8b357d4
log work
laullon Jun 15, 2010
fd47c99
Merge in changes from brotherbard's work into my own branch.
fbartho Jun 16, 2010
3edd890
Changed regex for urlifying commit history views so that it now doesn…
fbartho Jun 16, 2010
3755c46
Improved appearance of urls in commit history message.
fbartho Jun 16, 2010
936a3b4
diff working
Jun 16, 2010
9c75e6f
Merge remote branch 'refs/remotes/fbartho/fbartho'
Jun 16, 2010
c73d759
log commit link
Jun 16, 2010
93803ce
Better diff display
laullon Jun 19, 2010
74ab910
Config object to JavaScript
laullon Jun 21, 2010
ed8ad4b
only commit files on file view
laullon Jun 19, 2010
b4f6ba2
Only Commit / All Files
Jun 24, 2010
cdd011d
cosmetic
Jun 24, 2010
d2c7cfc
merge to master
laullon Sep 27, 2010
6a81b7b
Add hidden preference to use a split column guide in commit messages
lilyball Nov 10, 2010
2ebb924
Add missing semicolons
kelan Sep 12, 2010
753f3fb
Nicer style for the "long diff" message
kelan Sep 12, 2010
03ea45f
Add diffstat info to the list of files in the commit view
kelan Sep 11, 2010
6ba1858
Fix contextual menu for files in new filelist
kelan Dec 18, 2010
903e9db
Tweaked colors in new file list a bit
kelan Dec 18, 2010
3b38beb
Add clickable commit SHAs in blame view
kamal Feb 15, 2011
56a38e2
Put SHA on same line as author
kamal Feb 15, 2011
e7823cc
Merge branch 'experimental' of git://github.com/brotherbard/gitx into…
Feb 17, 2011
007a742
Merge git://github.com/kamal/gitx into experimental
Feb 17, 2011
ae516b8
Merge git://github.com/kelan/gitx into experimental
Feb 17, 2011
455cf57
Merge git://github.com/kballard/gitx into experimental
Feb 17, 2011
18f0ad7
Implemented "delete" context command in stage view.
Feb 17, 2011
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
MGScopeBar org verison
  • Loading branch information
laullon committed Jun 13, 2010
commit 6e20f395151a6af8e5a234eccc11f325cdb7129e
21 changes: 21 additions & 0 deletions MGScopeBar/MGRecessedPopUpButtonCell.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//
// MGRecessedPopUpButtonCell.h
// MGScopeBar
//
// Created by Matt Gemmell on 20/03/2008.
// Copyright 2008 Instinctive Code.
//

#import <Cocoa/Cocoa.h>

/*
This cell class is used only for NSPopUpButtons which do NOT automatically
get their titles from their selected menu-items, since such popup-buttons
are weirdly broken when using the recessed bezel-style.
*/

@interface MGRecessedPopUpButtonCell : NSPopUpButtonCell {
NSButton *recessedButton; // we use a separate NSButton to do the bezel-drawing.
}

@end
54 changes: 54 additions & 0 deletions MGScopeBar/MGRecessedPopUpButtonCell.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
//
// MGRecessedPopUpButtonCell.m
// MGScopeBar
//
// Created by Matt Gemmell on 20/03/2008.
// Copyright 2008 Instinctive Code.
//

#import "MGRecessedPopUpButtonCell.h"


@implementation MGRecessedPopUpButtonCell


- (id)initTextCell:(NSString *)title pullsDown:(BOOL)pullsDown
{
if ((self = [super initTextCell:title pullsDown:pullsDown])) {
recessedButton = [[NSButton alloc] initWithFrame:NSMakeRect(0, 0, 30, 20)]; // arbitrary frame.
[recessedButton setTitle:@""];
[recessedButton setBezelStyle:NSRecessedBezelStyle];
[recessedButton setButtonType:NSPushOnPushOffButton];
[[recessedButton cell] setHighlightsBy:NSCellIsBordered | NSCellIsInsetButton];
[recessedButton setShowsBorderOnlyWhileMouseInside:NO];
[recessedButton setState:NSOnState]; // ensures it looks pushed-in.
}
return self;
}


- (void)dealloc
{
[recessedButton release];
[super dealloc];
}


- (void)drawTitleWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
{
// Inset title rect since its position is broken when NSPopUpButton
// isn't using its selected item as its title.
NSRect titleFrame = cellFrame;
titleFrame.origin.y += 1.0;
[super drawTitleWithFrame:titleFrame inView:controlView];
}


- (void)drawBezelWithFrame:(NSRect)frame inView:(NSView *)controlView
{
[recessedButton setFrame:frame];
[recessedButton drawRect:frame];
}


@end
51 changes: 51 additions & 0 deletions MGScopeBar/MGScopeBar.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
//
// MGScopeBar.h
// MGScopeBar
//
// Created by Matt Gemmell on 15/03/2008.
// Copyright 2008 Instinctive Code.
//

#import <Cocoa/Cocoa.h>
#import "MGScopeBarDelegateProtocol.h"

@interface MGScopeBar : NSView {
@private
IBOutlet id <MGScopeBarDelegate, NSObject> delegate; // weak ref.
NSMutableArray *_separatorPositions; // x-coords of separators, indexed by their group-number.
NSMutableArray *_groups; // groups of items.
NSView *_accessoryView; // weak ref since it's a subview.
NSMutableDictionary *_identifiers; // map of identifiers to items.
NSMutableArray *_selectedItems; // all selected items in all groups; see note below.
float _lastWidth; // previous width of view from when we last resized.
NSInteger _firstCollapsedGroup; // index of first group collapsed into a popup.
float _totalGroupsWidthForPopups; // total width needed to show all groups expanded (excluding padding and accessory).
float _totalGroupsWidth; // total width needed to show all groups as native-width popups (excluding padding and accessory).
BOOL _smartResizeEnabled; // whether to do our clever collapsing/expanding of buttons when resizing (Smart Resizing).
}

@property(assign) id delegate; // should implement the MGScopeBarDelegate protocol.

- (void)reloadData; // causes the scope-bar to reload all groups/items from its delegate.
- (void)sizeToFit; // only resizes vertically to optimum height; does not affect width.
- (void)adjustSubviews; // performs Smart Resizing if enabled. You should only need to call this yourself if you change the width of the accessoryView.

// Smart Resize is the intelligent conversion of button-groups into NSPopUpButtons and vice-versa, based on available space.
// This functionality is enabled (YES) by default. Changing this setting will automatically call -reloadData.
- (BOOL)smartResizeEnabled;
- (void)setSmartResizeEnabled:(BOOL)enabled;

// The following method must be used to manage selections in the scope-bar; do not attempt to manipulate buttons etc directly.
- (void)setSelected:(BOOL)selected forItem:(NSString *)identifier inGroup:(int)groupNumber;
- (NSArray *)selectedItems;

/*
Note: The -selectedItems method returns an array of arrays.
Each index in the returned array represents the group of items at that index.
The contents of each sub-array are the identifiers of each selected item in that group.
Sub-arrays may be empty, but will always be present (i.e. you will always find an NSArray).
Depending on the group's selection-mode, sub-arrays may contain zero, one or many identifiers.
The identifiers in each sub-array are not in any particular order.
*/

@end
Loading