fix missing font panel in manual test of CPTextView

This commit is contained in:
daboe01
2016-05-10 20:35:16 +02:00
parent 5942553370
commit 8dec42f295
3 changed files with 11 additions and 9 deletions
+1 -1
View File
@@ -506,4 +506,4 @@ var _CPFontDetectPickTwoDifferentFonts = function(candidates)
return [candidates[0]];
};
[CPFontManager setFontManagerFactory:[CPFontManager class]];
[CPFontManager setFontManagerFactory:[CPFontManager class]];
+1 -1
View File
@@ -499,4 +499,4 @@ var _availableTraits= [@"Normal", @"Italic", @"Bold", @"Bold Italic"],
@end
[CPFontManager setFontPanelFactory:CPFontPanel];
[CPFontManager setFontPanelFactory:[CPFontPanel class]];
+9 -7
View File
@@ -7,6 +7,7 @@
@import <Foundation/Foundation.j>
@import <AppKit/CPTextView.j>
@import <AppKit/CPFontPanel.j>
@implementation AppController : CPObject
{
@@ -14,6 +15,12 @@
CPTextView _textView2;
}
- (void)orderFrontFontPanel:(id)sender
{
[CPFontManager setFontPanelFactory:[CPFontPanel class]];
[[CPFontManager sharedFontManager] orderFrontFontPanel:self];
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
// CPLogRegister(CPLogConsole);
@@ -24,6 +31,8 @@
[contentView setBackgroundColor:[CPColor colorWithWhite:0.95 alpha:1.0]];
_textView = [[CPTextView alloc] initWithFrame:CGRectMake(0,0,500,500)];
[_textView setRichText:YES];
// _textView2 = [[CPTextView alloc] initWithFrame:CGRectMake(0,0,500,500)];
// _textView2._isRichText = NO;
// [_textView setBackgroundColor:[CPColor whiteColor]];
@@ -61,9 +70,7 @@
item = [mainMenu insertItemWithTitle:@"Format" action:nil keyEquivalent:nil atIndex:0];
var formatMenu = [[CPMenu alloc] initWithTitle:@"Format Menu"];
[formatMenu addItemWithTitle:@"Font panel" action:@selector(orderFrontFontPanel:) keyEquivalent:@"f"];
[mainMenu setSubmenu:formatMenu forItem:item];
//
@@ -85,11 +92,6 @@
[CPMenu setMenuBarVisible:YES];
}
// //-> CPApplication (?)
// - (void)orderFrontFontPanel:sender
// {
// [[CPFontManager sharedFontManager] orderFrontFontPanel:self];
// }
//
// - (void) makeRTF:sender
// {