mirror of
https://github.com/gnustep/libs-gdl2.git
synced 2025-04-22 21:00:44 +00:00
Clean up of the NSTableView's used by DBModeler. Added some preprocessor
directives to avoid using deprecated methods, and also use a few newer methods to improve the appearance. At some point, we should revisit these NSTableView's as they seem to be candidates for re-factoring. * DBModeler/ModelerEntityEditor.m, DBModeler/ModelerAttributeEditor.m (initWithParentEditor:): Replaced use of the deprecated [NSTableView setAutoresizesAllColumnsToFit:] on Mac OS X 10.4 and later with [NSTableView setColumnAutoresizingStyle:]. Also, make use of setUsesAlternatingRowBackgroundColors: and setGridStyleMask: to achieve an appearance that more closely mimics EOModeler. * DBModeler/MainModelEditor.m (initWithDocument:): Replaced use of the deprecated [NSTableView setAutoresizesAllColumnsToFit:] on Mac OS X 10.4 and later with [NSTableView setColumnAutoresizingStyle:]. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@26553 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
17ae63bbae
commit
2ba530d50e
4 changed files with 58 additions and 0 deletions
|
@ -1,3 +1,10 @@
|
|||
2008-05-22 Blake Nicholson <blaken@umich.edu>
|
||||
|
||||
* DBModeler/ModelerEntityEditor.m, DBModeler/ModelerAttributeEditor.m,
|
||||
DBModeler/MainModelEditor.m: Added preprocessor directives to wrap methods
|
||||
deprecated on OS X and to use recently introduced methods that yield a
|
||||
better NSTableView display.
|
||||
|
||||
2008-05-13 Blake Nicholson <blaken@umich.edu>
|
||||
|
||||
* DBModeler/SQLGenerator.m: Updated to use new gsmarkup file.
|
||||
|
|
|
@ -62,6 +62,7 @@
|
|||
#endif
|
||||
|
||||
#include <GNUstepBase/GNUstep.h>
|
||||
#include <GNUstepBase/GSVersionMacros.h>
|
||||
|
||||
#define DEBUG_STUFF 0
|
||||
|
||||
|
@ -106,7 +107,13 @@
|
|||
_col = [(NSTableColumn *)[NSTableColumn alloc] initWithIdentifier:@"name"];
|
||||
[_iconPath addTableColumn:_col];
|
||||
[_iconPath setOutlineTableColumn:AUTORELEASE(_col)];
|
||||
|
||||
#if OS_API_VERSION(GS_API_NONE, MAC_OS_X_VERSION_10_4)
|
||||
[_iconPath setAutoresizesAllColumnsToFit:YES];
|
||||
#else
|
||||
[_iconPath setColumnAutoresizingStyle:NSTableViewUniformColumnAutoresizingStyle];
|
||||
#endif
|
||||
|
||||
[_iconPath sizeToFit];
|
||||
|
||||
_window = [[NSWindow alloc] initWithContentRect:NSMakeRect(20,80,600,400)
|
||||
|
|
|
@ -58,6 +58,7 @@
|
|||
#endif
|
||||
|
||||
#include <GNUstepBase/GNUstep.h>
|
||||
#include <GNUstepBase/GSVersionMacros.h>
|
||||
|
||||
@interface NSArray (EOMAdditions)
|
||||
- (id) firstSelectionOfClass:(Class) aClass;
|
||||
|
@ -78,7 +79,16 @@
|
|||
/* setup the attributes table view */
|
||||
scrollView = [[NSScrollView alloc] initWithFrame:NSMakeRect(0,0,100,100)];
|
||||
_attributes_tableView = [[NSTableView alloc] initWithFrame:NSMakeRect(0,0,100,100)];
|
||||
#if OS_API_VERSION(GS_API_NONE, MAC_OS_X_VERSION_10_4)
|
||||
[_attributes_tableView setAutoresizesAllColumnsToFit:NO];
|
||||
#else
|
||||
[_attributes_tableView setColumnAutoresizingStyle:NSTableViewLastColumnOnlyAutoresizingStyle];
|
||||
#endif
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) || GNU_GUI_LIBRARY
|
||||
[_attributes_tableView setUsesAlternatingRowBackgroundColors:YES];
|
||||
[_attributes_tableView setGridStyleMask:NSTableViewSolidVerticalGridLineMask];
|
||||
#endif
|
||||
[_attributes_tableView setAllowsMultipleSelection:YES];
|
||||
[_attributes_tableView setAllowsEmptySelection:YES];
|
||||
|
||||
|
@ -128,7 +138,18 @@
|
|||
[scrollView setHasHorizontalScroller:YES];
|
||||
[scrollView setHasVerticalScroller:YES];
|
||||
_relationships_tableView = [[NSTableView alloc] initWithFrame:NSMakeRect(0,0,100,100)];
|
||||
|
||||
#if OS_API_VERSION(GS_API_NONE, MAC_OS_X_VERSION_10_4)
|
||||
[_relationships_tableView setAutoresizesAllColumnsToFit:NO];
|
||||
#else
|
||||
[_relationships_tableView setColumnAutoresizingStyle:NSTableViewLastColumnOnlyAutoresizingStyle];
|
||||
#endif
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) || GNU_GUI_LIBRARY
|
||||
[_relationships_tableView setUsesAlternatingRowBackgroundColors:YES];
|
||||
[_relationships_tableView setGridStyleMask:NSTableViewSolidVerticalGridLineMask];
|
||||
#endif
|
||||
|
||||
[_relationships_tableView setAllowsMultipleSelection:YES];
|
||||
[_relationships_tableView setAllowsEmptySelection:YES];
|
||||
[scrollView setDocumentView:_relationships_tableView];
|
||||
|
|
|
@ -52,6 +52,7 @@
|
|||
#endif
|
||||
|
||||
#include <GNUstepBase/GNUstep.h>
|
||||
#include <GNUstepBase/GSVersionMacros.h>
|
||||
|
||||
@interface EOModelerDocument (asdf)
|
||||
-(void)_setDisplayGroup:(id)displayGroup;
|
||||
|
@ -109,7 +110,18 @@
|
|||
|
||||
_topTable = [[NSTableView alloc] initWithFrame:NSMakeRect(0,0,10,10)];
|
||||
_bottomTable = [[NSTableView alloc] initWithFrame:NSMakeRect(0,0,10,10)];
|
||||
|
||||
#if OS_API_VERSION(GS_API_NONE, MAC_OS_X_VERSION_10_4)
|
||||
[_topTable setAutoresizesAllColumnsToFit:NO];
|
||||
#else
|
||||
[_topTable setColumnAutoresizingStyle:NSTableViewLastColumnOnlyAutoresizingStyle];
|
||||
#endif
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) || GNU_GUI_LIBRARY
|
||||
[_topTable setUsesAlternatingRowBackgroundColors:YES];
|
||||
[_topTable setGridStyleMask:NSTableViewSolidVerticalGridLineMask];
|
||||
#endif
|
||||
|
||||
[scrollView setDocumentView:_topTable];
|
||||
RELEASE(_topTable);
|
||||
[_splitView addSubview:scrollView];
|
||||
|
@ -119,7 +131,18 @@
|
|||
[scrollView setHasHorizontalScroller:YES];
|
||||
[scrollView setHasVerticalScroller:YES];
|
||||
[scrollView setBorderType: NSBezelBorder];
|
||||
|
||||
#if OS_API_VERSION(GS_API_NONE, MAC_OS_X_VERSION_10_4)
|
||||
[_bottomTable setAutoresizesAllColumnsToFit:NO];
|
||||
#else
|
||||
[_bottomTable setColumnAutoresizingStyle:NSTableViewLastColumnOnlyAutoresizingStyle];
|
||||
#endif
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) || GNU_GUI_LIBRARY
|
||||
[_bottomTable setUsesAlternatingRowBackgroundColors:YES];
|
||||
[_bottomTable setGridStyleMask:NSTableViewSolidVerticalGridLineMask];
|
||||
#endif
|
||||
|
||||
[scrollView setDocumentView:_bottomTable];
|
||||
RELEASE(_bottomTable);
|
||||
[_splitView addSubview:scrollView];
|
||||
|
|
Loading…
Reference in a new issue