Update popup button logic

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@11076 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Adam Fedor 2001-10-02 19:04:32 +00:00
parent 7b342746be
commit 1e8fa702d9
3 changed files with 14 additions and 12 deletions

View file

@ -1,3 +1,10 @@
2001-10-02 Adam Fedor <fedor@gnu.org>
* Palettes/2Controls/inspectors.m: Fix NSButton and popup button
logic.
* Palettes/2Controls/GormButtonInspector.gorm: Update for new popup
coding in gui library.
2001-09-27 Adam Fedor <fedor@gnu.org>
* GormInspectorsManager.m (-setCurrentInspector:): Gracefully handle

View file

@ -184,10 +184,8 @@
{
if (stateby == NSNoCellMask)
type = NSMomentaryLight;
else if (stateby == NSChangeBackgroundCellMask)
type = NSOnOffButton;
else
type = NSToggleButton;
type = NSOnOffButton;
}
else if (highlight == (NSPushInCellMask | NSChangeGrayCellMask) )
{
@ -196,34 +194,31 @@
else
type = NSPushOnPushOffButton;
}
else if (highlight == (NSPushInCellMask | NSContentsCellMask) )
{
type = NSToggleButton;
}
else if (highlight == NSContentsCellMask)
{
if (stateby == NSNoCellMask)
type = NSMomentaryChangeButton;
else
type = NSToggleButton;
type = NSToggleButton; /* Really switch or radio. What should it be? */
}
else
NSDebugLog(@"Ack! no button type");
return type;
}
/* We may need to reset some parameters based on the previous type */
- (void) setButtonType: (NSButtonType)type forObject: button
{
NSButtonType oldType = [self buttonTypeForObject: object];
if (type == oldType)
return;
[object setButtonType: type ];
[self _getValuesFromObject: object];
}
- (void) setButtonTypeFrom: sender
{
[self setButtonType: [[sender selectedItem] tag] forObject: object];
[self setButtonType: [sender tag] forObject: object];
}
- (void) _setValuesFromControl: control