mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 10:30:48 +00:00
Add a new character picker panel. It's accessible
via a button in the font panel. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33470 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
bc9bebe77c
commit
85c8422ca8
9 changed files with 654 additions and 0 deletions
|
@ -47,6 +47,7 @@
|
|||
#import "AppKit/NSPanel.h"
|
||||
#import "AppKit/NSButton.h"
|
||||
#import "AppKit/NSBox.h"
|
||||
#import "GNUstepGUI/GSCharacterPanel.h"
|
||||
|
||||
#import "GSGuiPrivate.h"
|
||||
|
||||
|
@ -516,6 +517,7 @@ static float sizes[] = {4.0, 6.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0,
|
|||
NSRect revertButtonRect = {{83, 8}, {71, 24}};
|
||||
NSRect previewButtonRect = {{162, 8}, {71, 24}};
|
||||
NSRect setButtonRect = {{241, 8}, {71, 24}};
|
||||
NSRect characterPanelButtonRect = {{8, 8}, {24, 24}};
|
||||
NSView *v;
|
||||
NSView *topArea;
|
||||
NSView *bottomArea;
|
||||
|
@ -531,6 +533,7 @@ static float sizes[] = {4.0, 6.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0,
|
|||
NSButton *revertButton;
|
||||
NSButton *previewButton;
|
||||
NSButton *setButton;
|
||||
NSButton *characterPanelButton;
|
||||
NSBox *slash;
|
||||
|
||||
unsigned int style = NSTitledWindowMask | NSClosableWindowMask
|
||||
|
@ -718,6 +721,21 @@ static float sizes[] = {4.0, 6.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0,
|
|||
[self setDefaultButtonCell: [setButton cell]];
|
||||
RELEASE(setButton);
|
||||
|
||||
// Character Panel button
|
||||
{
|
||||
NSString *label;
|
||||
unichar labelchars[2] = {0x03b1, 0x03b2}; // alpha, beta
|
||||
label = [[[NSString alloc] initWithCharacters: labelchars
|
||||
length: 2] autorelease];
|
||||
|
||||
characterPanelButton = [[NSButton alloc] initWithFrame: characterPanelButtonRect];
|
||||
[characterPanelButton setTitle: label];
|
||||
[characterPanelButton setAction: @selector(characterPanel:)];
|
||||
[characterPanelButton setTarget: self];
|
||||
[bottomArea addSubview: characterPanelButton];
|
||||
RELEASE(characterPanelButton);
|
||||
}
|
||||
|
||||
// set up the next key view chain
|
||||
[familyBrowser setNextKeyView: faceBrowser];
|
||||
[faceBrowser setNextKeyView: sizeField];
|
||||
|
@ -822,6 +840,11 @@ static float sizes[] = {4.0, 6.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0,
|
|||
isMultiple: _multiple];
|
||||
}
|
||||
|
||||
- (void) characterPanel: (id)sender
|
||||
{
|
||||
[[GSCharacterPanel sharedCharacterPanel] orderFront: nil];
|
||||
}
|
||||
|
||||
- (NSFont *) _fontForSelection: (NSFont *)fontObject
|
||||
{
|
||||
float size;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue