mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-04-22 14:10:44 +00:00
Added button inspector key equivalent pull down.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@16853 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
5750604191
commit
e3733a243d
4 changed files with 68 additions and 4 deletions
|
@ -1,3 +1,10 @@
|
|||
2003-06-01 Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
|
||||
* Palettes/2Controls/GormNSButtonInspector.gorm: Added
|
||||
key equivalent pulldown
|
||||
* Palettes/2Controls/inspectors.m: Added code to handle
|
||||
new pulldown.
|
||||
|
||||
2003-06-01 Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
|
||||
* GormPreferences.[hm]: Removed. These were superceded
|
||||
|
|
|
@ -137,12 +137,14 @@
|
|||
"useStandardKerning:",
|
||||
"useStandardLigatures:",
|
||||
"yank:",
|
||||
"zoom:"
|
||||
"zoom:",
|
||||
"selectKeyEquivalent:"
|
||||
);
|
||||
Super = NSObject;
|
||||
};
|
||||
GormButtonInspector = {
|
||||
Actions = (
|
||||
"selectKeyEquivalent:"
|
||||
);
|
||||
Outlets = (
|
||||
alignMatrix,
|
||||
|
@ -151,7 +153,8 @@
|
|||
optionMatrix,
|
||||
tagField,
|
||||
titleForm,
|
||||
typeButton
|
||||
typeButton,
|
||||
keyEquiv
|
||||
);
|
||||
Super = IBInspector;
|
||||
};
|
||||
|
|
Binary file not shown.
|
@ -142,6 +142,7 @@
|
|||
id tagField;
|
||||
id titleForm;
|
||||
id typeButton;
|
||||
id keyEquiv;
|
||||
}
|
||||
|
||||
- (void) _getValuesFromObject: (id)anObject;
|
||||
|
@ -216,6 +217,7 @@
|
|||
}
|
||||
else if (control == keyField)
|
||||
{
|
||||
[keyEquiv selectItem: nil]; // if the user does his own thing, select the default...
|
||||
[object setKeyEquivalent: [[control cellAtIndex: 0] stringValue]];
|
||||
}
|
||||
else if (control == optionMatrix)
|
||||
|
@ -276,7 +278,8 @@
|
|||
- (void) _getValuesFromObject: anObject
|
||||
{
|
||||
NSImage *image;
|
||||
|
||||
NSString *key = VSTR([anObject keyEquivalent]);
|
||||
|
||||
if (anObject != object)
|
||||
{
|
||||
return;
|
||||
|
@ -284,7 +287,28 @@
|
|||
[alignMatrix selectCellWithTag: [anObject alignment]];
|
||||
[iconMatrix selectCellWithTag: [anObject imagePosition]];
|
||||
[[keyField cellAtIndex: 0] setStringValue: VSTR([anObject keyEquivalent])];
|
||||
|
||||
|
||||
if([key isEqualToString: @"\n"])
|
||||
{
|
||||
[keyEquiv selectItemAtIndex: 1];
|
||||
}
|
||||
else if([key isEqualToString: @"\b"])
|
||||
{
|
||||
[keyEquiv selectItemAtIndex: 2];
|
||||
}
|
||||
else if([key isEqualToString: @"\E"])
|
||||
{
|
||||
[keyEquiv selectItemAtIndex: 3];
|
||||
}
|
||||
else if([key isEqualToString: @"\t"])
|
||||
{
|
||||
[keyEquiv selectItemAtIndex: 4];
|
||||
}
|
||||
else
|
||||
{
|
||||
[keyEquiv selectItem: nil];
|
||||
}
|
||||
|
||||
[optionMatrix deselectAllCells];
|
||||
if ([anObject isBordered])
|
||||
[optionMatrix selectCellAtRow: 0 column: 0];
|
||||
|
@ -378,6 +402,36 @@
|
|||
[self _getValuesFromObject: anObject];
|
||||
}
|
||||
|
||||
- (void) selectKeyEquivalent: (id)sender
|
||||
{
|
||||
int code = [[keyEquiv selectedItem] tag];
|
||||
id cell = [keyField cellAtIndex: 0];
|
||||
switch(code)
|
||||
{
|
||||
case 0:
|
||||
[cell setStringValue: @""];
|
||||
[object setKeyEquivalent: @""];
|
||||
break;
|
||||
case 1:
|
||||
[cell setStringValue: @"\n"];
|
||||
[object setKeyEquivalent: @"\n"];
|
||||
break;
|
||||
case 2:
|
||||
[cell setStringValue: @"\b"];
|
||||
[object setKeyEquivalent: @"\b"];
|
||||
break;
|
||||
case 3:
|
||||
[cell setStringValue: @"\E"];
|
||||
[object setKeyEquivalent: @"\E"];
|
||||
break;
|
||||
case 4:
|
||||
[cell setStringValue: @"\t"];
|
||||
[object setKeyEquivalent: @"\t"];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
@end
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in a new issue