mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-02-23 19:51:00 +00:00
* GormCore/GormCustomView.m
* GormCore/GormFilesOwner.m * GormCore/GormFunctions.m * GormObjCHeaderParser/OCHeaderParser.m * Palettes/2Controls/ControlsPalette.m * Palettes/2Controls/GNUmakefile * Palettes/2Controls/GormPopUpButtonEditor.m * Palettes/3Containers/GormNSBrowser.m * Palettes/4Data/GormImageViewAttributesInspector.m: Correct compiler warnings found by clang. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@35094 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
25fff13915
commit
0f780c7001
10 changed files with 39 additions and 162 deletions
13
ChangeLog
13
ChangeLog
|
@ -1,3 +1,16 @@
|
|||
2012-04-20 12:03-EDT Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* GormCore/GormCustomView.m
|
||||
* GormCore/GormFilesOwner.m
|
||||
* GormCore/GormFunctions.m
|
||||
* GormObjCHeaderParser/OCHeaderParser.m
|
||||
* Palettes/2Controls/ControlsPalette.m
|
||||
* Palettes/2Controls/GNUmakefile
|
||||
* Palettes/2Controls/GormPopUpButtonEditor.m
|
||||
* Palettes/3Containers/GormNSBrowser.m
|
||||
* Palettes/4Data/GormImageViewAttributesInspector.m: Correct
|
||||
compiler warnings found by clang.
|
||||
|
||||
2012-04-20 10:34-EDT Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* GormLib/IBObjectAdditions.m
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
if((self = [super initWithFrame: frame]) != nil)
|
||||
{
|
||||
// Replace the CustomView with an NSView of the same dimensions.
|
||||
self = [[NSView alloc] initWithFrame: frame];
|
||||
self = (id)[[NSView alloc] initWithFrame: frame];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
|
|
@ -25,8 +25,9 @@
|
|||
|
||||
#include <AppKit/NSNibConnector.h>
|
||||
#include "GormPrivate.h"
|
||||
#include "GormCustomView.h"
|
||||
|
||||
@class GormCustomView;
|
||||
// @class GormCustomView;
|
||||
|
||||
@implementation GormFilesOwner
|
||||
- (NSString*) className
|
||||
|
|
|
@ -321,7 +321,7 @@ NSString *identifierString(NSString *str)
|
|||
// check the result's length.
|
||||
if([result length] == 0)
|
||||
{
|
||||
result = [NSString stringWithString: @"dummyIdentifier"];
|
||||
result = [@"dummyIdentifier" mutableCopy];
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
|
@ -95,7 +95,7 @@
|
|||
- (void) _stripPreProcessor
|
||||
{
|
||||
NSScanner *scanner = [NSScanner scannerWithString: fileData];
|
||||
NSString *resultString = [NSString stringWithString: @""];
|
||||
NSString *resultString = @""; // [NSString stringWithString: @""];
|
||||
|
||||
// strip all of the one line comments out...
|
||||
[scanner setCharactersToBeSkipped: nil];
|
||||
|
|
|
@ -30,8 +30,7 @@
|
|||
#include <AppKit/NSPasteboard.h>
|
||||
#include <AppKit/NSImage.h>
|
||||
#include <AppKit/NSSound.h>
|
||||
|
||||
@class GormNSPopUpButton;
|
||||
#include "GormNSPopUpButton.h"
|
||||
|
||||
@interface ControlsPalette: IBPalette <IBViewResourceDraggingDelegates>
|
||||
@end
|
||||
|
|
|
@ -27,21 +27,23 @@ include $(GNUSTEP_MAKEFILES)/common.make
|
|||
PALETTE_NAME = 2Controls
|
||||
2Controls_PALETTE_ICON = ControlsPalette
|
||||
|
||||
2Controls_OBJC_FILES = GormButtonAttributesInspector.m \
|
||||
GormBoxAttributesInspector.m \
|
||||
GormCellAttributesInspector.m \
|
||||
GormColorWellAttributesInspector.m \
|
||||
GormFormAttributesInspector.m \
|
||||
GormPopUpButtonAttributesInspector.m \
|
||||
GormSliderAttributesInspector.m \
|
||||
GormStepperAttributesInspector.m \
|
||||
GormProgressIndicatorAttributesInspector.m \
|
||||
GormTextFieldAttributesInspector.m \
|
||||
GormMatrixAttributesInspector.m \
|
||||
ControlsPalette.m \
|
||||
GormPopUpButtonEditor.m \
|
||||
GormButtonEditor.m \
|
||||
inspectors.m
|
||||
2Controls_OBJC_FILES = \
|
||||
GormButtonAttributesInspector.m \
|
||||
GormBoxAttributesInspector.m \
|
||||
GormCellAttributesInspector.m \
|
||||
GormColorWellAttributesInspector.m \
|
||||
GormFormAttributesInspector.m \
|
||||
GormPopUpButtonAttributesInspector.m \
|
||||
GormSliderAttributesInspector.m \
|
||||
GormStepperAttributesInspector.m \
|
||||
GormProgressIndicatorAttributesInspector.m \
|
||||
GormTextFieldAttributesInspector.m \
|
||||
GormMatrixAttributesInspector.m \
|
||||
ControlsPalette.m \
|
||||
GormPopUpButtonEditor.m \
|
||||
GormNSPopUpButton.m \
|
||||
GormButtonEditor.m \
|
||||
inspectors.m
|
||||
|
||||
2Controls_PRINCIPAL_CLASS = ControlsPalette
|
||||
|
||||
|
|
|
@ -2,149 +2,10 @@
|
|||
#include <GormCore/GormPrivate.h>
|
||||
#include <GormCore/GormControlEditor.h>
|
||||
#include <GormCore/GormViewWithSubviewsEditor.h>
|
||||
#include "GormNSPopUpButton.h"
|
||||
|
||||
#define _EO ((NSPopUpButton *)_editedObject)
|
||||
|
||||
@class GormNSPopUpButtonCell;
|
||||
|
||||
Class _gormnspopupbuttonCellClass = 0;
|
||||
@interface GormNSPopUpButton : NSPopUpButton
|
||||
@end
|
||||
|
||||
@implementation GormNSPopUpButton
|
||||
/*
|
||||
* Class methods
|
||||
*/
|
||||
+ (void) initialize
|
||||
{
|
||||
if (self == [GormNSPopUpButton class])
|
||||
{
|
||||
// Initial version
|
||||
[self setVersion: 1];
|
||||
[self setCellClass: [GormNSPopUpButtonCell class]];
|
||||
}
|
||||
}
|
||||
|
||||
+ (Class) cellClass
|
||||
{
|
||||
return _gormnspopupbuttonCellClass;
|
||||
}
|
||||
|
||||
+ (void) setCellClass: (Class)classId
|
||||
{
|
||||
_gormnspopupbuttonCellClass = classId;
|
||||
}
|
||||
|
||||
- (NSString*) editorClassName
|
||||
{
|
||||
return @"GormPopUpButtonEditor";
|
||||
}
|
||||
|
||||
- (NSString *) className
|
||||
{
|
||||
return @"NSPopUpButton";
|
||||
}
|
||||
@end
|
||||
|
||||
@interface GormNSPopUpButtonCell : NSPopUpButtonCell
|
||||
{
|
||||
}
|
||||
@end
|
||||
|
||||
@interface NSPopUpButtonCell (DirtyHack)
|
||||
- (id) _gormInitTextCell: (NSString *) string;
|
||||
@end
|
||||
|
||||
@implementation NSPopUpButtonCell (DirtyHack)
|
||||
- (id) _gormInitTextCell: (NSString *) string
|
||||
{
|
||||
return [super initTextCell: string];
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation GormNSPopUpButtonCell
|
||||
|
||||
/* Overriden helper method */
|
||||
- (void) _initMenu
|
||||
{
|
||||
NSMenu *menu = [[NSMenu allocSubstitute] initWithTitle: @""];
|
||||
[self setMenu: menu];
|
||||
RELEASE(menu);
|
||||
}
|
||||
|
||||
- (NSString *) className
|
||||
{
|
||||
return @"NSPopUpButtonCell";
|
||||
}
|
||||
|
||||
/**
|
||||
* Override this here, since themes may override it.
|
||||
* Always want to show the menu view since it's editable.
|
||||
*/
|
||||
- (void) attachPopUpWithFrame: (NSRect)cellFrame
|
||||
inView: (NSView *)controlView
|
||||
{
|
||||
NSRectEdge preferredEdge = _pbcFlags.preferredEdge;
|
||||
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
||||
NSWindow *cvWin = [controlView window];
|
||||
NSMenuView *mr = [[self menu] menuRepresentation];
|
||||
int selectedItem;
|
||||
|
||||
[nc postNotificationName: NSPopUpButtonCellWillPopUpNotification
|
||||
object: self];
|
||||
|
||||
[nc postNotificationName: NSPopUpButtonWillPopUpNotification
|
||||
object: controlView];
|
||||
|
||||
// Convert to Screen Coordinates
|
||||
cellFrame = [controlView convertRect: cellFrame toView: nil];
|
||||
cellFrame.origin = [cvWin convertBaseToScreen: cellFrame.origin];
|
||||
|
||||
if (_pbcFlags.pullsDown)
|
||||
selectedItem = -1;
|
||||
else
|
||||
{
|
||||
selectedItem = [self indexOfSelectedItem];
|
||||
if (selectedItem = -1)
|
||||
selectedItem = 0;
|
||||
}
|
||||
|
||||
if (selectedItem > 0)
|
||||
{
|
||||
[mr setHighlightedItemIndex: selectedItem];
|
||||
}
|
||||
|
||||
if ([controlView isFlipped])
|
||||
{
|
||||
if (preferredEdge == NSMinYEdge)
|
||||
{
|
||||
preferredEdge = NSMaxYEdge;
|
||||
}
|
||||
else if (preferredEdge == NSMaxYEdge)
|
||||
{
|
||||
preferredEdge = NSMinYEdge;
|
||||
}
|
||||
}
|
||||
|
||||
// Ask the MenuView to attach the menu to this rect
|
||||
[mr setWindowFrameForAttachingToRect: cellFrame
|
||||
onScreen: [cvWin screen]
|
||||
preferredEdge: preferredEdge
|
||||
popUpSelectedItem: selectedItem];
|
||||
|
||||
// Set to be above the main window
|
||||
[cvWin addChildWindow: [mr window] ordered: NSWindowAbove];
|
||||
|
||||
// Last, display the window
|
||||
[[mr window] orderFrontRegardless];
|
||||
|
||||
[nc addObserver: self
|
||||
selector: @selector(_handleNotification:)
|
||||
name: NSMenuDidSendActionNotification
|
||||
object: _menu];
|
||||
}
|
||||
@end
|
||||
|
||||
@interface GormPopUpButtonEditor : GormControlEditor
|
||||
{
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
atRow: (int)row
|
||||
column: (int)column
|
||||
{
|
||||
NSDebugLog(@"<%@ %x>: browser %x will display %@ %x at %d,%d",[self class],self,sender,[cell class],cell,row,column);
|
||||
// NSDebugLog(@"%@: browser %@ will display %@ %@ at %d,%d",self,sender,[cell class],cell,row,column);
|
||||
// This code should never be called because there is no row
|
||||
// in our browser. But just in case...
|
||||
[cell setLeaf:YES];
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
#include <AppKit/NSMatrix.h>
|
||||
#include <AppKit/NSNibLoading.h>
|
||||
#include <AppKit/NSTextField.h>
|
||||
#include <GormCore/GormImage.h>
|
||||
|
||||
/* This macro makes sure that the string contains a value, even if @"" */
|
||||
#define VSTR(str) ({id _str = (id)str; (_str) ? (id)_str : (id)(@"");})
|
||||
|
|
Loading…
Reference in a new issue