mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-04-22 22:20:44 +00:00
Changes to enable disable remove button in gui when actions/outlets are selected as appropriate.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@21252 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
edafe3f8c9
commit
2a30191e74
5 changed files with 52 additions and 7 deletions
|
@ -1,3 +1,11 @@
|
|||
2005-05-24 00:28 Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
|
||||
* English.lproj/GormClassInspector.gorm: Added link to
|
||||
invoke selectAction: when an action is selected, also added link
|
||||
to invoke selectOutlet: when an outlet is selected.
|
||||
* GormCore/GormClassInspector.m: Addition of two new actions
|
||||
selectAction: and selectOutlet:
|
||||
|
||||
2005-05-22 00:41 Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
|
||||
* GormCore/GormClassEditor.m: Correction for outline view
|
||||
|
|
|
@ -2,12 +2,14 @@
|
|||
"## Comment" = "Do NOT change this file, Gorm maintains it";
|
||||
FirstResponder = {
|
||||
Actions = (
|
||||
"addOutlet:",
|
||||
"clickOnClass:",
|
||||
"selectOutlet:",
|
||||
"orderFrontFontPanel:",
|
||||
"removeOutlet:",
|
||||
"addOutlet:",
|
||||
"selectClass:",
|
||||
"searchForClass:",
|
||||
"clickOnClass:"
|
||||
"selectAction:",
|
||||
"selectClass:"
|
||||
);
|
||||
Super = NSObject;
|
||||
};
|
||||
|
@ -21,7 +23,9 @@
|
|||
"selectClass:",
|
||||
"searchForClass:",
|
||||
"clickOnClass:",
|
||||
"changeClassName:"
|
||||
"changeClassName:",
|
||||
"selectOutlet:",
|
||||
"selectAction:"
|
||||
);
|
||||
Outlets = (
|
||||
classField,
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -309,6 +309,7 @@ objectValueForTableColumn: (NSTableColumn *)tc
|
|||
id searchCell = [search cell];
|
||||
BOOL isEditable = [classManager isCustomClass: [self _currentClass]];
|
||||
BOOL isFirstResponder = [[self _currentClass] isEqualToString: @"FirstResponder"];
|
||||
|
||||
NSArray *list = [classManager allClassNames];
|
||||
NSString *superClass = [classManager parentOfClass: [self _currentClass]];
|
||||
int index = [list indexOfObject: superClass];
|
||||
|
@ -317,14 +318,16 @@ objectValueForTableColumn: (NSTableColumn *)tc
|
|||
[outletTable reloadData];
|
||||
[actionTable reloadData];
|
||||
[parentClass reloadData];
|
||||
[outletTable deselectAll: self];
|
||||
[actionTable deselectAll: self];
|
||||
|
||||
// activate for actions...
|
||||
[addActionCell setEnabled: YES]; //isEditable];
|
||||
[removeActionCell setEnabled: YES]; //isEditable];
|
||||
[addActionCell setEnabled: YES];
|
||||
[removeActionCell setEnabled: NO]; // YES];
|
||||
|
||||
// activate for outlet...
|
||||
[addOutletCell setEnabled: (isEditable && !isFirstResponder)];
|
||||
[removeOutletCell setEnabled: (isEditable && !isFirstResponder)];
|
||||
[removeOutletCell setEnabled: NO]; // (isEditable && !isFirstResponder)];
|
||||
|
||||
// activate select class...
|
||||
[selectClassCell setEnabled: (isEditable && !isFirstResponder)];
|
||||
|
@ -588,6 +591,36 @@ objectValueForTableColumn: (NSTableColumn *)tc
|
|||
}
|
||||
}
|
||||
|
||||
- (void) selectAction: (id)sender
|
||||
{
|
||||
int row = [sender selectedRow];
|
||||
NSArray *actions = [classManager allActionsForClassNamed: currentClass];
|
||||
if(row <= [actions count])
|
||||
{
|
||||
BOOL isCustom = [classManager isCustomClass: currentClass];
|
||||
id cell = [removeAction cell];
|
||||
NSString *action = [actions objectAtIndex: row];
|
||||
BOOL isAction = [classManager isAction: action ofClass: currentClass];
|
||||
BOOL isActionOnCategory = [classManager isAction: action onCategoryForClassNamed: currentClass];
|
||||
[cell setEnabled: ((isCustom && isAction) || isActionOnCategory)];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) selectOutlet: (id)sender
|
||||
{
|
||||
int row = [sender selectedRow];
|
||||
NSArray *outlets = [classManager allOutletsForClassNamed: currentClass];
|
||||
if(row <= [outlets count])
|
||||
{
|
||||
BOOL isCustom = [classManager isCustomClass: currentClass];
|
||||
BOOL isFirstResponder = [currentClass isEqualToString: @"FirstResponder"];
|
||||
id cell = [removeOutlet cell];
|
||||
NSString *outlet = [outlets objectAtIndex: row];
|
||||
BOOL isOutlet = [classManager isOutlet: outlet ofClass: currentClass];
|
||||
[cell setEnabled: (isOutlet && isCustom && !isFirstResponder)];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) clickOnClass: (id)sender
|
||||
{
|
||||
NSLog(@"Click on class %@",sender);
|
||||
|
|
Loading…
Reference in a new issue