aboutsummaryrefslogtreecommitdiffstats
path: root/Frameworks/PSMTabBar/PSMTabBarControl.m
diff options
context:
space:
mode:
authoravenjamin <avenjamin@gmail.com>2010-09-15 15:48:29 +0000
committeravenjamin <avenjamin@gmail.com>2010-09-15 15:48:29 +0000
commit42b58dcdda0c82473bfed4df8211c6f0f343c6fc (patch)
tree41305c83699d6c5f66de9050c1b28aea12590701 /Frameworks/PSMTabBar/PSMTabBarControl.m
parent0909c91b7f986dfe45600bbb6340c79401ccce47 (diff)
downloadsequelpro-42b58dcdda0c82473bfed4df8211c6f0f343c6fc.tar.gz
sequelpro-42b58dcdda0c82473bfed4df8211c6f0f343c6fc.tar.bz2
sequelpro-42b58dcdda0c82473bfed4df8211c6f0f343c6fc.zip
More work on tab creation target and action
Diffstat (limited to 'Frameworks/PSMTabBar/PSMTabBarControl.m')
-rw-r--r--Frameworks/PSMTabBar/PSMTabBarControl.m34
1 files changed, 30 insertions, 4 deletions
diff --git a/Frameworks/PSMTabBar/PSMTabBarControl.m b/Frameworks/PSMTabBar/PSMTabBarControl.m
index 4c92624e..a9268a78 100644
--- a/Frameworks/PSMTabBar/PSMTabBarControl.m
+++ b/Frameworks/PSMTabBar/PSMTabBarControl.m
@@ -472,6 +472,32 @@
[self update];
}
+
+
+- (id)createNewTabTarget
+{
+ return _createNewTabTarget;
+}
+
+- (void)setCreateNewTabTarget:(id)object
+{
+ _createNewTabTarget = object;
+ [[self addTabButton] setTarget:object];
+}
+
+- (SEL)createNewTabAction
+{
+ return _createNewTabAction;
+}
+
+- (void)setCreateNewTabAction:(SEL)selector
+{
+ _createNewTabAction = selector;
+ [[self addTabButton] setAction:selector];
+}
+
+
+
- (NSInteger)cellMinWidth
{
return _cellMinWidth;
@@ -567,12 +593,12 @@
_selectsTabsOnMouseDown = value;
}
-- (BOOL)doubleClickCreatesTab
+- (BOOL)createsTabOnDoubleClick;
{
return _createsTabOnDoubleClick;
}
-- (void)setDoubleClickCreatesTab:(BOOL)value
+- (void)setCreatesTabOnDoubleClick:(BOOL)value
{
_createsTabOnDoubleClick = value;
}
@@ -1311,8 +1337,8 @@
} else {
if ([theEvent clickCount] == 2) {
// fire create new tab
- if ([self doubleClickCreatesTab] && [[self addTabButton] target] != nil && [[self addTabButton] action] != nil) {
- [[[self addTabButton] target] performSelector:[[self addTabButton] action]];
+ if ([self createsTabOnDoubleClick] && [self createNewTabTarget] != nil && [self createNewTabAction] != nil) {
+ [[self createNewTabTarget] performSelector:[self createNewTabAction]];
}
return;
}