diff --git a/ChangeLog b/ChangeLog index b2444a2dc..efac29c36 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,7 @@ common_TabUnSelectedJunction.tiff common_TabUnSelectedLeft.tiff common_TabUnSelectedRight.tiff: all tiffs needed to draw NSTabs. + * Images/common_3DArrowDown.tiff: for NSPopUp in pulldown mode. * Source/NSTabView.m: lots of work on drawing. Should draw correct in almost all cases. However, without event code I can't test it yet. diff --git a/Headers/gnustep/gui/NSPopUpButton.h b/Headers/gnustep/gui/NSPopUpButton.h index 5be47ef66..64617e638 100644 --- a/Headers/gnustep/gui/NSPopUpButton.h +++ b/Headers/gnustep/gui/NSPopUpButton.h @@ -43,6 +43,7 @@ @interface NSPopUpButtonMatrix : NSMenuMatrix { + BOOL pull_down; int selected_cell; NSPopUpButton *popup_button; } diff --git a/Images/GNUmakefile b/Images/GNUmakefile index eb64876a3..ca3dda1c1 100644 --- a/Images/GNUmakefile +++ b/Images/GNUmakefile @@ -33,6 +33,7 @@ imagedir = $(GNUSTEP_RESOURCES)/Images IMAGE_FILES = \ GNUstep_Images_Copyright \ +common_3DArrowDown.tiff \ common_ArrowDown.tiff \ common_ArrowUp.tiff \ common_ArrowRight.tiff \ diff --git a/Images/common_3DArrowDown.tiff b/Images/common_3DArrowDown.tiff new file mode 100644 index 000000000..291c3b35d Binary files /dev/null and b/Images/common_3DArrowDown.tiff differ diff --git a/Source/NSPopUpButton.m b/Source/NSPopUpButton.m index f5681c196..28fa73c59 100644 --- a/Source/NSPopUpButton.m +++ b/Source/NSPopUpButton.m @@ -82,6 +82,16 @@ { ASSIGN(popup_button, popb); } + +- (void)setPullsDown:(BOOL)pull +{ + pull_down = pull; +} + +- (BOOL)pullsDown +{ + return pull_down; +} @end // @@ -121,6 +131,7 @@ [super initWithFrame:frameRect]; list_items = [[NSPopUpButtonMatrix alloc] initWithFrame:frameRect]; [list_items setPopUpButton:self]; + [list_items setPullsDown:flag]; is_up = NO; pulls_down = flag; selected_item = 0; @@ -159,7 +170,10 @@ - (void)buttonSelected:(id)sender { - selected_item = [self indexOfItemWithTitle:[sender title]]; + if (!pulls_down) + selected_item = [self indexOfItemWithTitle:[sender title]]; + else + selected_item = 0; [self synchronizeTitleAndSelectedItem]; diff --git a/Source/NSPopUpButtonCell.m b/Source/NSPopUpButtonCell.m index 49a39ed4e..80757597b 100644 --- a/Source/NSPopUpButtonCell.m +++ b/Source/NSPopUpButtonCell.m @@ -62,7 +62,10 @@ if ([(NSPopUpButton *)view titleOfSelectedItem] == contents) { - [super _drawImage:[NSImage imageNamed:@"common_Nibble"] inFrame:rect]; + if ([(NSPopUpButton *)view pullsDown] == NO) + [super _drawImage:[NSImage imageNamed:@"common_Nibble"] inFrame:rect]; + else + [super _drawImage:[NSImage imageNamed:@"common_3DArrowDown"] inFrame:rect]; } } @end