mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-04-22 22:20:44 +00:00
Update instpectors
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@16126 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
51ebbb3154
commit
eacb1b3b6b
6 changed files with 71 additions and 101 deletions
|
@ -1,3 +1,8 @@
|
|||
2003-03-04 Fabien <fabien@tuxfamily.org>
|
||||
|
||||
* Palettes/3Containers/inspectors.m: Update TabView inspector
|
||||
* Palettes/4Data/inspectors.m: Update comboBox inspector.
|
||||
|
||||
2003-03-04 Adam Fedor <fedor@gnu.org>
|
||||
|
||||
* Gorm.m ([Gorm -infoPanel:sender]): Update application name.
|
||||
|
|
|
@ -147,7 +147,10 @@
|
|||
Outlets = (
|
||||
typeMatrix,
|
||||
numberOfItemsField,
|
||||
allowtruncate
|
||||
allowtruncate,
|
||||
itemLabel,
|
||||
itemStepper,
|
||||
itemIdentifier
|
||||
);
|
||||
Super = IBInspector;
|
||||
};
|
||||
|
|
Binary file not shown.
|
@ -208,7 +208,6 @@
|
|||
|
||||
- (void) ok: (id)sender
|
||||
{
|
||||
NSLog(@"ok");
|
||||
[self _setValuesFromControl: sender];
|
||||
}
|
||||
|
||||
|
@ -611,6 +610,9 @@ static NSString *ITEM=@"item";
|
|||
int numberOfDisplayItem;
|
||||
id allowtruncate;
|
||||
id numberOfItemsField;
|
||||
id itemStepper;
|
||||
id itemLabel;
|
||||
id itemIdentifier;
|
||||
}
|
||||
|
||||
- (void) _getValuesFromObject: (id)anObject;
|
||||
|
@ -624,24 +626,28 @@ static NSString *ITEM=@"item";
|
|||
- (void) _setValuesFromControl: (id)control
|
||||
{
|
||||
if (control == typeMatrix)
|
||||
{
|
||||
[object setTabViewType:[[control selectedCell] tag]];
|
||||
}
|
||||
|
||||
if (control == allowtruncate)
|
||||
else if (control == allowtruncate)
|
||||
{
|
||||
BOOL flag;
|
||||
flag = ([allowtruncate state] == NSOnState) ? YES : NO;
|
||||
[object setAllowsTruncatedLabels:flag];
|
||||
}
|
||||
else if (control == itemStepper )
|
||||
{
|
||||
int number = [itemStepper intValue];
|
||||
[itemLabel setStringValue:[[object tabViewItemAtIndex:number] label]];
|
||||
[itemIdentifier setStringValue:[[object tabViewItemAtIndex:number] identifier]];
|
||||
[object selectTabViewItemAtIndex:number];
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (control == numberOfItemsField)
|
||||
else if (control == numberOfItemsField)
|
||||
{
|
||||
int newNumber = [[numberOfItemsField stringValue] intValue];
|
||||
|
||||
//Can we allow stupid numbers like 66666666 ????????
|
||||
if (newNumber < 0)
|
||||
if (newNumber <= 0)
|
||||
{
|
||||
[numberOfItemsField setStringValue:[NSString stringWithFormat:@"%i",[object numberOfTabViewItems]]];
|
||||
return;
|
||||
|
@ -667,27 +673,18 @@ static NSString *ITEM=@"item";
|
|||
[object removeTabViewItem:[object tabViewItemAtIndex:i]];
|
||||
}
|
||||
}
|
||||
|
||||
[itemStepper setMaxValue:(newNumber - 1)];
|
||||
}
|
||||
else if ( control == itemLabel )
|
||||
{
|
||||
if ( ! [[itemLabel stringValue] isEqualToString:@""] )
|
||||
[[object selectedTabViewItem] setLabel:[itemLabel stringValue]];
|
||||
}
|
||||
else if ( control == itemIdentifier )
|
||||
{
|
||||
if ( ! [[itemIdentifier stringValue] isEqualToString:@""] )
|
||||
[[object selectedTabViewItem] setIdentifier:[itemIdentifier stringValue]];
|
||||
}
|
||||
|
||||
// int newNumber = [itemStepper intValue];
|
||||
// NSTabViewItem *newTabItem;
|
||||
// if ( newNumber > numberOfDisplayItem )
|
||||
// {
|
||||
// NSString *identif = [NSString stringWithFormat:@"%i",newNumber];
|
||||
// newTabItem = [[NSTabViewItem alloc] initWithIdentifier:identif];
|
||||
// [newTabItem setLabel:[ITEM stringByAppendingString:identif]];
|
||||
// [newTabItem setView:[[NSView alloc] init]];
|
||||
// [object addTabViewItem:newTabItem];
|
||||
// [displayItemsField setStringValue:identif];
|
||||
// [labelField setStringValue: [ITEM stringByAppendingString:identif]];
|
||||
// [identifierField setStringValue:[ITEM stringByAppendingString:identif]];
|
||||
// numberOfDisplayItem = newNumber;
|
||||
// }
|
||||
// if ( newNumber < numberOfDisplayItem )
|
||||
// {
|
||||
// NSLog(@"remove");
|
||||
// }
|
||||
|
||||
|
||||
[object display];
|
||||
|
@ -695,57 +692,16 @@ static NSString *ITEM=@"item";
|
|||
|
||||
- (void) _getValuesFromObject: anObject
|
||||
{
|
||||
// BOOL isScrollView;
|
||||
// id scrollView;
|
||||
//TODO ScrollView
|
||||
unsigned int i,numberOfTabViewItems;
|
||||
numberOfTabViewItems=[anObject numberOfTabViewItems];
|
||||
|
||||
[numberOfItemsField setStringValue:[NSString stringWithFormat:@"%i",numberOfTabViewItems]];
|
||||
|
||||
// scrollView = //[[object superview] superview];
|
||||
// [object enclosingScrollView];
|
||||
[itemStepper setMaxValue:(numberOfTabViewItems -1)];
|
||||
|
||||
// isScrollView = [ scrollView isKindOfClass: [NSScrollView class]];
|
||||
|
||||
// if (anObject != object)
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
|
||||
// [selectionMatrix deselectAllCells];
|
||||
// if ([anObject gormAllowsMultipleSelection])
|
||||
// [selectionMatrix selectCellAtRow: 0 column: 0];
|
||||
// if ([anObject gormAllowsEmptySelection])
|
||||
// [selectionMatrix selectCellAtRow: 1 column: 0];
|
||||
// if ([anObject gormAllowsColumnSelection])
|
||||
// [selectionMatrix selectCellAtRow: 2 column: 0];
|
||||
|
||||
// if (isScrollView)
|
||||
// {
|
||||
// [verticalScrollerSwitch setEnabled: YES];
|
||||
// [verticalScrollerSwitch setState:
|
||||
// ([scrollView hasVerticalScroller]) ? NSOnState : NSOffState];
|
||||
|
||||
// [horizontalScrollerSwitch setEnabled: YES];
|
||||
// [horizontalScrollerSwitch setState:
|
||||
// ([scrollView hasHorizontalScroller]) ? NSOnState : NSOffState];
|
||||
|
||||
// [borderMatrix setEnabled: YES];
|
||||
// [borderMatrix selectCellWithTag: [scrollView borderType]];
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// [verticalScrollerSwitch setEnabled: NO];
|
||||
// [horizontalScrollerSwitch setEnabled: NO];
|
||||
// [borderMatrix setEnabled: NO];
|
||||
// }
|
||||
|
||||
// [[rowsHeightForm cellAtIndex: 0] setIntValue: [anObject rowHeight] ];
|
||||
|
||||
// [optionMatrix deselectAllCells];
|
||||
// if ([anObject drawsGrid])
|
||||
// [optionMatrix selectCellAtRow: 0 column: 0];
|
||||
// if ([anObject gormAllowsColumnResizing])
|
||||
// [optionMatrix selectCellAtRow: 1 column: 0];
|
||||
// if ([anObject gormAllowsColumnReordering])
|
||||
// [optionMatrix selectCellAtRow: 2 column: 0];
|
||||
// [[tagField cellAtIndex:0] setIntValue:[anObject tag]];
|
||||
[itemLabel setStringValue:[[anObject selectedTabViewItem] label]];
|
||||
[itemIdentifier setStringValue:[[anObject selectedTabViewItem] identifier]];
|
||||
}
|
||||
|
||||
- (id) init
|
||||
|
|
Binary file not shown.
|
@ -100,9 +100,8 @@ extern NSArray *predefinedDateFormats, *predefinedNumberFormats;
|
|||
{
|
||||
if ( ! [[itemTxt stringValue] isEqualToString:@""] )
|
||||
{
|
||||
[itemsArray addObject:[itemTxt stringValue]];
|
||||
[object addItemWithObjectValue:[itemTxt stringValue]];
|
||||
[itemTableView reloadData];
|
||||
[object addItemWithObjectValue:[itemTxt stringValue]];
|
||||
}
|
||||
}
|
||||
else if (control == removeButton)
|
||||
|
@ -110,10 +109,9 @@ extern NSArray *predefinedDateFormats, *predefinedNumberFormats;
|
|||
int selected = [itemTableView selectedRow];
|
||||
if ( selected != -1 )
|
||||
{
|
||||
[itemsArray removeObjectAtIndex: selected];
|
||||
[itemTxt setStringValue:@""];
|
||||
[itemTableView reloadData];
|
||||
[object removeItemAtIndex:selected];
|
||||
[itemTableView reloadData];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -122,9 +120,7 @@ extern NSArray *predefinedDateFormats, *predefinedNumberFormats;
|
|||
{
|
||||
int i;
|
||||
if (anObject != object)
|
||||
{
|
||||
return;
|
||||
}
|
||||
return;
|
||||
|
||||
[backgroundColorWell setColor: [anObject backgroundColor]];
|
||||
[textColorWell setColor: [anObject textColor]];
|
||||
|
@ -138,18 +134,12 @@ extern NSArray *predefinedDateFormats, *predefinedNumberFormats;
|
|||
[optionMatrix selectCellAtRow: 1 column: 0];
|
||||
if ([anObject usesDataSource])
|
||||
[optionMatrix selectCellAtRow: 2 column: 0];
|
||||
if ([anObject numberOfItems] > 0 )
|
||||
{
|
||||
for (i=0;i<[anObject numberOfItems];i++)
|
||||
{
|
||||
NSLog(@"plop => %i",i);
|
||||
[itemsArray insertObject:[anObject itemObjectValueAtIndex:i] atIndex:i];
|
||||
}
|
||||
[itemTableView reloadData];
|
||||
}
|
||||
|
||||
[itemTableView reloadData];
|
||||
[itemTxt setStringValue:@""];
|
||||
|
||||
[[visibleItemsForm cellAtIndex: 0]
|
||||
setIntValue: [anObject numberOfVisibleItems]];
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -164,8 +154,6 @@ extern NSArray *predefinedDateFormats, *predefinedNumberFormats;
|
|||
NSLog(@"Could not gorm GormNSComboBoxInspector");
|
||||
return nil;
|
||||
}
|
||||
itemsArray=[[NSMutableArray alloc] initWithCapacity:1];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -180,31 +168,49 @@ extern NSArray *predefinedDateFormats, *predefinedNumberFormats;
|
|||
[self _getValuesFromObject: anObject];
|
||||
}
|
||||
|
||||
|
||||
// TableView DataSource
|
||||
- (int)numberOfRowsInTableView:(NSTableView *)aTableView
|
||||
{
|
||||
if (aTableView == itemTableView )
|
||||
return [itemsArray count];
|
||||
{
|
||||
return [[object objectValues] count];
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
- (id)tableView:(NSTableView *)aTableView
|
||||
objectValueForTableColumn:(NSTableColumn *)aTableColumn
|
||||
row:(int)rowIndex
|
||||
{
|
||||
if (aTableView == itemTableView )
|
||||
return [itemsArray objectAtIndex:rowIndex];
|
||||
return [object itemObjectValueAtIndex:rowIndex];
|
||||
}
|
||||
|
||||
//TableView delegate
|
||||
- (BOOL)tableView:(NSTableView *)aTableView shouldSelectRow:(int)rowIndex
|
||||
{
|
||||
if ( aTableView == itemTableView )
|
||||
[itemTxt setStringValue:[itemsArray objectAtIndex:rowIndex]];
|
||||
{
|
||||
[itemTxt setStringValue:[object itemObjectValueAtIndex:rowIndex]];
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
|
||||
//itemTxt delegate
|
||||
- (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor
|
||||
{
|
||||
// if (fieldEditor != itemTxt )
|
||||
// return YES;
|
||||
// if ( [[itemTxt setStringValue] isEqualToString:@""] )
|
||||
// return YES;
|
||||
// else if ( [aTableView selectedRow] != -1 )
|
||||
// {
|
||||
// [object
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
|
Loading…
Reference in a new issue