diff options
author | Bibiko <bibiko@eva.mpg.de> | 2010-02-22 14:24:17 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2010-02-22 14:24:17 +0000 |
commit | 6d018a4e2eb0505776092e6f626d70b1ad3d5295 (patch) | |
tree | a956b05068807f8721c5e2faf1dfb327de549697 /Source/TableDocument.m | |
parent | f3135b07cefa7a870fbad85de8abb8eae5f4645e (diff) | |
download | sequelpro-6d018a4e2eb0505776092e6f626d70b1ad3d5295.tar.gz sequelpro-6d018a4e2eb0505776092e6f626d70b1ad3d5295.tar.bz2 sequelpro-6d018a4e2eb0505776092e6f626d70b1ad3d5295.zip |
• initial work to give the chance to reset the table's AUTO_INCREMENT value
- not yet active
Diffstat (limited to 'Source/TableDocument.m')
-rw-r--r-- | Source/TableDocument.m | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Source/TableDocument.m b/Source/TableDocument.m index 2d15e4e2..b8261a8e 100644 --- a/Source/TableDocument.m +++ b/Source/TableDocument.m @@ -3609,6 +3609,27 @@ } #pragma mark - +#pragma mark General sheet delegate methods + +- (NSRect)window:(NSWindow *)window willPositionSheet:(NSWindow *)sheet usingRect:(NSRect)rect { + + // Locate the sheet "Reset Auto Increment" just beneath the chosen index row + if([[sheet title] isEqualToString:@"Reset Auto Increment"]) { + + id it = [tableSourceInstance valueForKeyPath:@"indexView"]; + NSRect mwrect = [[NSApp mainWindow] frame]; + NSRect ltrect = [[tablesListInstance valueForKeyPath:@"tablesListView"] frame]; + NSRect rowrect = [it rectOfRow:[it selectedRow]]; + rowrect.size.width = mwrect.size.width - ltrect.size.width; + rowrect.origin.y -= [it rowHeight]/2.0f+2; + return [it convertRect:rowrect toView:nil]; + + } else + return rect; + +} + +#pragma mark - #pragma mark SplitView delegate methods /** |