diff --git a/AppKit/CPFontManager.j b/AppKit/CPFontManager.j index ffffe6464..98fbc9ce8 100644 --- a/AppKit/CPFontManager.j +++ b/AppKit/CPFontManager.j @@ -506,4 +506,4 @@ var _CPFontDetectPickTwoDifferentFonts = function(candidates) return [candidates[0]]; }; -[CPFontManager setFontManagerFactory:[CPFontManager class]]; +[CPFontManager setFontManagerFactory:[CPFontManager class]]; \ No newline at end of file diff --git a/AppKit/CPTextView/CPFontPanel.j b/AppKit/CPTextView/CPFontPanel.j index 6fcb802fd..89094b67e 100644 --- a/AppKit/CPTextView/CPFontPanel.j +++ b/AppKit/CPTextView/CPFontPanel.j @@ -499,4 +499,4 @@ var _availableTraits= [@"Normal", @"Italic", @"Bold", @"Bold Italic"], @end -[CPFontManager setFontPanelFactory:CPFontPanel]; \ No newline at end of file +[CPFontManager setFontPanelFactory:[CPFontPanel class]]; \ No newline at end of file diff --git a/Tests/Manual/CPTextView/AppController.j b/Tests/Manual/CPTextView/AppController.j index 29d28b69d..3db723076 100755 --- a/Tests/Manual/CPTextView/AppController.j +++ b/Tests/Manual/CPTextView/AppController.j @@ -7,6 +7,7 @@ @import @import +@import @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 // {