From c9b7a1cc94dc9f2f624c56aac40f4d26e40437d6 Mon Sep 17 00:00:00 2001 From: Adam Fedor Date: Fri, 2 Nov 2001 04:59:43 +0000 Subject: [PATCH] Set target/action for all NSForms in inspectors. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@11290 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 12 ++ GormDocument.m | 2 +- Palettes/1Windows/GormWindowInspector.gorm | Bin 6807 -> 6842 bytes .../1Windows/GormWindowSizeInspector.classes | 13 +- .../1Windows/GormWindowSizeInspector.gorm | Bin 4533 -> 4623 bytes Palettes/1Windows/main.m | 24 ---- Palettes/2Controls/GormBoxInspector.gorm | Bin 10560 -> 10595 bytes Palettes/2Controls/GormButtonInspector.gorm | Bin 10289 -> 10346 bytes Palettes/2Controls/GormCellInspector.gorm | Bin 3205 -> 3240 bytes Palettes/2Controls/GormFormInspector.gorm | Bin 7588 -> 7658 bytes Palettes/2Controls/GormMatrixInspector.gorm | Bin 8148 -> 8183 bytes .../2Controls/GormPopUpButtonInspector.gorm | Bin 3986 -> 4021 bytes Palettes/2Controls/GormSliderInspector.gorm | Bin 6318 -> 6386 bytes .../2Controls/GormTextFieldInspector.gorm | Bin 9631 -> 9666 bytes Palettes/2Controls/inspectors.m | 132 ++---------------- 15 files changed, 30 insertions(+), 153 deletions(-) diff --git a/ChangeLog b/ChangeLog index 42209ca7..af8487d1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2001-11-01 Adam Fedor + + * GormDocument.m ([GormDocument -openDocument:]): Open file + from current dir. + + * Palettes/1Windows/main.m: Set action/target to ok: in NSForms in + GormWindowInspector and GormWindowSizeInspector. Remove all + TextDidEndEditing Notifications. + * Palettes/2Controls/inspectors.m: Likewise for all control + inspectors. Also make sure all setStringValue: messages get sent + a non-nil string. + 2001-10-30 Richard Frith-Macdonald * GormWindowEditor.m: Fixed various drawing glitches when managing diff --git a/GormDocument.m b/GormDocument.m index 935d2f34..d9c98b12 100644 --- a/GormDocument.m +++ b/GormDocument.m @@ -1277,7 +1277,7 @@ static NSImage *classesImage = nil; [oPanel setAllowsMultipleSelection: NO]; [oPanel setCanChooseFiles: YES]; [oPanel setCanChooseDirectories: NO]; - result = [oPanel runModalForDirectory: NSHomeDirectory() + result = [oPanel runModalForDirectory: nil file: nil types: fileTypes]; if (result == NSOKButton) diff --git a/Palettes/1Windows/GormWindowInspector.gorm b/Palettes/1Windows/GormWindowInspector.gorm index c98eff9b5202ddf5422f56695fbf041216d0870f..d1a83895fb24a88c4becda6802366a77c2ca0ebe 100644 GIT binary patch delta 97 zcmbPky32He2BX;6%`-W~_?b2_PTnA%#2(7P!0n>t xFj-RKI-8&<0|SHL=5G=U8RZRnH%e|u+)!@Nw~NFj-dO RI-7tf0|SG==3f#E837V15G?=z diff --git a/Palettes/1Windows/GormWindowSizeInspector.classes b/Palettes/1Windows/GormWindowSizeInspector.classes index 1f3d2ade..42785180 100644 --- a/Palettes/1Windows/GormWindowSizeInspector.classes +++ b/Palettes/1Windows/GormWindowSizeInspector.classes @@ -11,6 +11,9 @@ }; IBInspector = { Actions = ( + ok:, + revert:, + touch: ); Outlets = ( ); @@ -27,11 +30,11 @@ }; NSControl = { Actions = ( - "takeDoubleValueFrom:", - "takeFloatValueFrom:", - "takeIntValueFrom:", - "takeObjectValueFrom:", - "takeStringValueFrom:" + takeDoubleValueFrom:, + takeFloatValueFrom:, + takeIntValueFrom:, + takeObjectValueFrom:, + takeStringValueFrom: ); Outlets = ( target diff --git a/Palettes/1Windows/GormWindowSizeInspector.gorm b/Palettes/1Windows/GormWindowSizeInspector.gorm index 9b925b3ea2f27eab106a7c808c2d6412661bcf74..81f8c75bbf9313689c87fdb4a864e8e844cba11e 100644 GIT binary patch delta 158 zcmdn0+^;f0Uf9CQ01V7bpbP`UjYiR|qDG7i%nUsF*;Zu+4%#MG+7=GlhDMwFSerSR zHZg7%;=9er{-J?^+a>$JJ_Hn468+7J%_#5O6j delta 67 zcmeBI*{VE2UfA5q01V6wp$r3qjYiR|jFUDmVr}LCQtEuS8QDKFFmStMH%#UfxXi{W N%D}+DIr)*m3jkh95?ufQ diff --git a/Palettes/1Windows/main.m b/Palettes/1Windows/main.m index 3e3096bc..f1b43106 100644 --- a/Palettes/1Windows/main.m +++ b/Palettes/1Windows/main.m @@ -283,15 +283,8 @@ NSwindow inspector } -- (void) controlTextDidEndEditing: (NSNotification*)aNotification -{ - id notifier = [aNotification object]; - [self _setValuesFromControl: notifier]; -} - - (void) dealloc { - [[NSNotificationCenter defaultCenter] removeObserver: self]; RELEASE(window); [super dealloc]; } @@ -306,12 +299,6 @@ NSwindow inspector NSLog(@"Could not gorm GormWindowInspector"); return nil; } - [[NSNotificationCenter defaultCenter] - addObserver: self - selector: @selector(controlTextDidEndEditing:) - name: NSControlTextDidEndEditingNotification - object: nil]; - return self; } @@ -378,12 +365,6 @@ NSwindow inspector [[minForm cellAtIndex: 1] setFloatValue: size.height]; } -- (void) controlTextDidEndEditing: (NSNotification*)aNotification -{ - id notifier = [aNotification object]; - [self _setValuesFromControl: notifier]; -} - - (void) windowChangeNotification: (NSNotification*)aNotification { id notifier = [aNotification object]; @@ -418,11 +399,6 @@ NSwindow inspector selector: @selector(windowChangeNotification:) name: NSWindowDidResizeNotification object: object]; - [[NSNotificationCenter defaultCenter] - addObserver: self - selector: @selector(controlTextDidEndEditing:) - name: NSControlTextDidEndEditingNotification - object: nil]; return self; } diff --git a/Palettes/2Controls/GormBoxInspector.gorm b/Palettes/2Controls/GormBoxInspector.gorm index c52ee7a958ae4913866de895578b157696b67b05..f3ac795f6c1e4eb6f8f88d5fdfd0d9be8189002c 100644 GIT binary patch delta 107 zcmX>Q^f+jO2BYyt%?LIDp8Ra9G6M%~6Dw^C2W>;6&3$aa!c3bOH$RfJmx1nmo34_-gS=E5T%&I_w6{LWf H31~6^Z3!FX delta 62 zcmaDHbRcMg2BYCd%?LJL&irhvGD9N=11l2;i_H_+f`u6;ZGI+c$HN}Sz`*Td&M;Y9 S?KYc~C<6n7)Mg%a3nl;6&HXIe5=@&IH}96&%mkwI(f!oFUz+@TKyKEAo3=9ksoByj?FaZE^9~O52 diff --git a/Palettes/2Controls/GormCellInspector.gorm b/Palettes/2Controls/GormCellInspector.gorm index 1e32b32538d7f7701895abaef91a717e3413c9e5..64a33305e18086a0b9a882dae749f136480443cb 100644 GIT binary patch delta 85 zcmZpbTp>9@gE4udW;ctd5hDXL15bXoRhfZ*(y0fgE4WVW;YAtq|GN;ycmUy7#WxuIP<*=|dFmSsV WGE8pgy3EEU%D}+DwK;)XlMw(yHxGvZ diff --git a/Palettes/2Controls/GormFormInspector.gorm b/Palettes/2Controls/GormFormInspector.gorm index ef3e8f38b8f2f378d57074075dc0980c4fb3d46f..ceecb0503cbe35272c7e9a2292c836d55ed1fca3 100644 GIT binary patch delta 132 zcmZ2t{mOcR2BYal&C{#`Jo(vHWd;t~CRW-O4%&uBn;F@>MVK}*PWF{bVxQ2!!0qCA zVDdJpn{1Mz3=9mCo2N?iGdUTo+9W!>wKw)-OAi)Y!z|K^XnC_NelxwhN Wqx6Qd4Lt^HAxfCxN|>2|RssO6I3h>@ delta 61 zcmaE5y~KKg2BYCd&C{&BocY;SWrju$2395x7MoevyhRu%O%9YwV$Wn?;C9h*n7m8s RCY!h@0|SHj=9$v`OaLt25G?=z diff --git a/Palettes/2Controls/GormMatrixInspector.gorm b/Palettes/2Controls/GormMatrixInspector.gorm index e382f3bab75d8e2bc188c07703e006ebd322ea26..5698610f0be5d4d40484e01476a820a0e3878094 100644 GIT binary patch delta 98 zcmca&|J{Cq24mtz%_$rLJo(vHWd;t~CRW-O4%&uBn@@3^yxOs+XCL8;n1_o{y yvjdYkWNxx4i83%SC~bZ&^Oi~8;P6K24G9~j8ywllssN*ovf delta 62 zcmV-E0KxzFKh!^vC;>RJDU=8e32$pUb}=$QFgi3qIJ3y6ftRMx}O)y#JIVZy_*?C zOL1GUf#_ht9bj=D5oRX#{S6G;Ya#l&v235zl?FbHq{F1DS~)}UvjfWd^+) oS=E5T%&I_w6{LWf322c)A5dCsL)nI2gMJ{370j9dWI2FX07L;UY5)KL delta 88 zcmexlxXy5b2BYal&B-i`lQv&u+0O)|Cb4%j3mGvoFf(xGXIqsS8aWtPnK)Q%mglx$ p14>5PqRI#X)eM$N;lyqx*jR%M1p4hB{x4i=mLuyXJ*PTI^SqQuA6z`*Td;V@ZG S=>eO9C<6n7!e$ZWekK4@#}Kyw diff --git a/Palettes/2Controls/inspectors.m b/Palettes/2Controls/inspectors.m index bc482a03..2d111d76 100644 --- a/Palettes/2Controls/inspectors.m +++ b/Palettes/2Controls/inspectors.m @@ -26,6 +26,9 @@ #include #include "../../GormPrivate.h" +/* This macro makes sure that the string contains a value, even if @"" */ +#define VSTR(str) ({id _str = str; (_str) ? _str : @"";}) + /*---------------------------------------------------------------------------- * NSBox */ @@ -84,21 +87,13 @@ } [positionMatrix selectCellWithTag: [anObject titlePosition]]; [borderMatrix selectCellWithTag: [anObject borderType]]; - [[titleField cellAtIndex: 0] setStringValue: [anObject title]]; + [[titleField cellAtIndex: 0] setStringValue: VSTR([anObject title])]; [horizontalSlider setFloatValue: [anObject contentViewMargins].width]; [verticalSlider setFloatValue: [anObject contentViewMargins].height]; } -- (void) controlTextDidEndEditing: (NSNotification*)aNotification -{ - id notifier = [aNotification object]; - - [self _setValuesFromControl: notifier]; -} - - (void) dealloc { - [[NSNotificationCenter defaultCenter] removeObserver: self]; RELEASE(window); [super dealloc]; } @@ -114,11 +109,6 @@ NSLog(@"Could not gorm GormBoxInspector"); return nil; } - [[NSNotificationCenter defaultCenter] - addObserver: self - selector: @selector(controlTextDidEndEditing:) - name: NSControlTextDidEndEditingNotification - object: nil]; return self; } @@ -296,7 +286,7 @@ } [alignMatrix selectCellWithTag: [anObject alignment]]; [iconMatrix selectCellWithTag: [anObject imagePosition]]; - [[keyField cellAtIndex: 0] setStringValue: [anObject keyEquivalent]]; + [[keyField cellAtIndex: 0] setStringValue: VSTR([anObject keyEquivalent])]; [optionMatrix deselectAllCells]; if ([anObject isBordered]) @@ -312,13 +302,13 @@ [[tagField cellAtIndex: 0] setIntValue: [anObject tag]]; - [[titleForm cellAtIndex: 0] setStringValue: [anObject title]]; - [[titleForm cellAtIndex: 1] setStringValue: [anObject alternateTitle]]; + [[titleForm cellAtIndex: 0] setStringValue: VSTR([anObject title])]; + [[titleForm cellAtIndex: 1] setStringValue: VSTR([anObject alternateTitle])]; image = [anObject image]; if (image != nil) { - [[titleForm cellAtIndex: 2] setStringValue: [image name]]; + [[titleForm cellAtIndex: 2] setStringValue: VSTR([image name])]; } else { @@ -328,7 +318,7 @@ image = [anObject alternateImage]; if (image != nil) { - [[titleForm cellAtIndex: 3] setStringValue: [image name]]; + [[titleForm cellAtIndex: 3] setStringValue: VSTR([image name])]; } else { @@ -339,16 +329,8 @@ [typeButton indexOfItemWithTag: [self buttonTypeForObject: anObject]]]; } -- (void) controlTextDidEndEditing: (NSNotification*)aNotification -{ - id notifier = [aNotification object]; - - [self _setValuesFromControl: notifier]; -} - - (void) dealloc { - [[NSNotificationCenter defaultCenter] removeObserver: self]; RELEASE(window); RELEASE(okButton); [super dealloc]; @@ -365,11 +347,6 @@ NSLog(@"Could not gorm GormButtonInspector"); return nil; } - [[NSNotificationCenter defaultCenter] - addObserver: self - selector: @selector(controlTextDidEndEditing:) - name: NSControlTextDidEndEditingNotification - object: nil]; /* Need to set up popup button */ [typeButton removeAllItems]; @@ -474,16 +451,8 @@ [[tagForm cellAtRow: 0 column: 0] setIntValue: [anObject tag]]; } -- (void) controlTextDidEndEditing: (NSNotification*)aNotification -{ - id notifier = [aNotification object]; - - [self _setValuesFromControl: notifier]; -} - - (void) dealloc { - [[NSNotificationCenter defaultCenter] removeObserver: self]; RELEASE(window); [super dealloc]; } @@ -499,11 +468,6 @@ NSLog(@"Could not gorm GormCellInspector"); return nil; } - [[NSNotificationCenter defaultCenter] - addObserver: self - selector: @selector(controlTextDidEndEditing:) - name: NSControlTextDidEndEditingNotification - object: nil]; return self; } @@ -656,16 +620,8 @@ [[tagForm cellAtRow: 0 column: 0] setIntValue: [anObject tag]]; } -- (void) controlTextDidEndEditing: (NSNotification*)aNotification -{ - id notifier = [aNotification object]; - - [self _setValuesFromControl: notifier]; -} - - (void) dealloc { - [[NSNotificationCenter defaultCenter] removeObserver: self]; RELEASE(window); [super dealloc]; } @@ -681,11 +637,6 @@ NSLog(@"Could not gorm GormFormInspector"); return nil; } - [[NSNotificationCenter defaultCenter] - addObserver: self - selector: @selector(controlTextDidEndEditing:) - name: NSControlTextDidEndEditingNotification - object: nil]; return self; } @@ -834,16 +785,8 @@ [[tagForm cellAtIndex: 0] setIntValue: [anObject tag]]; } -- (void) controlTextDidEndEditing: (NSNotification*)aNotification -{ - id notifier = [aNotification object]; - - [self _setValuesFromControl: notifier]; -} - - (void) dealloc { - [[NSNotificationCenter defaultCenter] removeObserver: self]; RELEASE(window); RELEASE(okButton); [super dealloc]; @@ -860,11 +803,6 @@ NSLog(@"Could not gorm GormMatrixInspector"); return nil; } - [[NSNotificationCenter defaultCenter] - addObserver: self - selector: @selector(controlTextDidEndEditing:) - name: NSControlTextDidEndEditingNotification - object: nil]; return self; } @@ -931,16 +869,8 @@ [[tagForm cellAtRow: 0 column: 0] setIntValue: [anObject tag]]; } -- (void) controlTextDidEndEditing: (NSNotification*)aNotification -{ - id notifier = [aNotification object]; - - [self _setValuesFromControl: notifier]; -} - - (void) dealloc { - [[NSNotificationCenter defaultCenter] removeObserver: self]; RELEASE(window); [super dealloc]; } @@ -956,11 +886,6 @@ NSLog(@"Could not gorm GormPopUpButtonInspector"); return nil; } - [[NSNotificationCenter defaultCenter] - addObserver: self - selector: @selector(controlTextDidEndEditing:) - name: NSControlTextDidEndEditingNotification - object: nil]; return self; } @@ -1066,16 +991,8 @@ [[tagForm cellAtIndex: 0] setIntValue: [[anObject cell] tag]]; } -- (void) controlTextDidEndEditing: (NSNotification*)aNotification -{ - id notifier = [aNotification object]; - - [self _setValuesFromControl: notifier]; -} - - (void) dealloc { - [[NSNotificationCenter defaultCenter] removeObserver: self]; RELEASE(window); [super dealloc]; } @@ -1091,11 +1008,6 @@ NSLog(@"Could not gorm GormSliderInspector"); return nil; } - [[NSNotificationCenter defaultCenter] - addObserver: self - selector: @selector(controlTextDidEndEditing:) - name: NSControlTextDidEndEditingNotification - object: nil]; return self; } @@ -1209,16 +1121,8 @@ [valueWrapsButton setState: 0]; } -- (void) controlTextDidEndEditing: (NSNotification*)aNotification -{ - id notifier = [aNotification object]; - - [self _setValuesFromControl: notifier]; -} - - (void) dealloc { - [[NSNotificationCenter defaultCenter] removeObserver: self]; RELEASE(window); [super dealloc]; } @@ -1235,11 +1139,6 @@ return nil; } - [[NSNotificationCenter defaultCenter] - addObserver: self - selector: @selector(controlTextDidEndEditing:) - name: NSControlTextDidEndEditingNotification - object: nil]; return self; } @@ -1402,16 +1301,8 @@ [[tagForm cellAtIndex: 0] setIntValue: [anObject tag]]; } -- (void) controlTextDidEndEditing: (NSNotification*)aNotification -{ - id notifier = [aNotification object]; - - [self _setValuesFromControl: notifier]; -} - - (void) dealloc { - [[NSNotificationCenter defaultCenter] removeObserver: self]; RELEASE(window); RELEASE(okButton); [super dealloc]; @@ -1429,11 +1320,6 @@ NSLog(@"Could not gorm GormTextFieldInspector"); return nil; } - [[NSNotificationCenter defaultCenter] - addObserver: self - selector: @selector(controlTextDidEndEditing:) - name: NSControlTextDidEndEditingNotification - object: nil]; return self; }