mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-04-22 22:20:44 +00:00
Add a form to Gorm's pop up button inspector to allow editing the
title of a pull down menu and a pop up button to allow setting its preferred attachment edge. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@30838 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
ed7c24ba5f
commit
b192a466d7
6 changed files with 2361 additions and 2328 deletions
|
@ -8,7 +8,9 @@
|
|||
tagForm,
|
||||
typeMatrix,
|
||||
defaultItemForm,
|
||||
enableSwitch
|
||||
enableSwitch,
|
||||
pullDownArrowPopUp,
|
||||
pullDownTitleForm
|
||||
);
|
||||
Super = IBInspector;
|
||||
};
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -40,6 +40,7 @@
|
|||
@class NSButton;
|
||||
@class NSForm;
|
||||
@class NSMatrix;
|
||||
@class NSPopUpButton;
|
||||
|
||||
@interface GormPopUpButtonAttributesInspector:IBInspector
|
||||
{
|
||||
|
@ -48,6 +49,8 @@
|
|||
NSButton *enableSwitch;
|
||||
NSForm *tagForm;
|
||||
NSForm *defaultItemForm;
|
||||
NSForm *pullDownTitleForm;
|
||||
NSPopUpButton *pullDownArrowPopUp;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -72,11 +72,16 @@
|
|||
{
|
||||
if (sender == typeMatrix)
|
||||
{
|
||||
BOOL pullsDown = [[sender selectedCell] tag];
|
||||
id selectedItem;
|
||||
[object setPullsDown: [[sender selectedCell] tag]];
|
||||
[object setPullsDown: pullsDown];
|
||||
selectedItem = [object selectedItem];
|
||||
[object selectItem: nil];
|
||||
[object selectItem: selectedItem];
|
||||
[pullDownTitleForm setEnabled: pullsDown];
|
||||
[[pullDownTitleForm cellAtIndex: 0]
|
||||
setStringValue: pullsDown ? [object title] : @""];
|
||||
[pullDownArrowPopUp setEnabled: pullsDown];
|
||||
}
|
||||
else if (sender == autoenableSwitch)
|
||||
{
|
||||
|
@ -99,6 +104,14 @@
|
|||
index = (index < num && index >= 0) ? index : num;
|
||||
[object selectItemAtIndex: index];
|
||||
}
|
||||
else if (sender == pullDownTitleForm)
|
||||
{
|
||||
[object setTitle: [[sender cellAtIndex: 0] stringValue]];
|
||||
}
|
||||
else if (sender == pullDownArrowPopUp)
|
||||
{
|
||||
[object setPreferredEdge: [[sender selectedItem] tag]];
|
||||
}
|
||||
|
||||
[super ok: sender];
|
||||
}
|
||||
|
@ -106,14 +119,21 @@
|
|||
/* Sync from object ( NSPopUpButton ) changes to the inspector */
|
||||
- (void) revert: (id)sender
|
||||
{
|
||||
BOOL pullsDown;
|
||||
if ( object == nil)
|
||||
return;
|
||||
|
||||
[typeMatrix selectCellWithTag: [object pullsDown]];
|
||||
pullsDown = [object pullsDown];
|
||||
[typeMatrix selectCellWithTag: pullsDown];
|
||||
[autoenableSwitch setState: [object autoenablesItems]];
|
||||
[enableSwitch setState: [object isEnabled]];
|
||||
[[tagForm cellAtRow: 0 column: 0] setIntValue: [object tag]];
|
||||
[[defaultItemForm cellAtRow: 0 column: 0] setIntValue: [object indexOfSelectedItem]];
|
||||
[pullDownTitleForm setEnabled: pullsDown];
|
||||
[[pullDownTitleForm cellAtIndex: 0]
|
||||
setStringValue: pullsDown ? [object title] : @""];
|
||||
[pullDownArrowPopUp setEnabled: pullsDown];
|
||||
[pullDownArrowPopUp selectItemWithTag: [object preferredEdge]];
|
||||
|
||||
[super revert:sender];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue