status bar, still incomplete resizes badly / does not show internally

This commit is contained in:
Riccardo Mottola 2021-07-30 02:29:59 +02:00 committed by Gregory John Casamento
parent 18136e7678
commit 7504a154e1
2 changed files with 30 additions and 2 deletions

View file

@ -37,8 +37,10 @@
{ {
id _editorManager; id _editorManager;
NSTextField *_extStatusField;
NSScrollView *_extScrollView; NSScrollView *_extScrollView;
PCEditorView *_extEditorView; PCEditorView *_extEditorView;
NSTextField *_intStatusField;
NSScrollView *_intScrollView; NSScrollView *_intScrollView;
PCEditorView *_intEditorView; PCEditorView *_intEditorView;
NSTextStorage *_storage; NSTextStorage *_storage;

View file

@ -40,6 +40,7 @@
unsigned int style; unsigned int style;
NSRect rect; NSRect rect;
float windowWidth; float windowWidth;
NSView *containerView;
// PCLogInfo(self, @"[_createWindow]"); // PCLogInfo(self, @"[_createWindow]");
@ -65,7 +66,7 @@
rect = [[_window contentView] frame]; rect = [[_window contentView] frame];
// Scroll view // Scroll view
_extScrollView = [[NSScrollView alloc] initWithFrame:rect]; _extScrollView = [[NSScrollView alloc] initWithFrame:NSMakeRect(0,15,windowWidth,320-15)];
[_extScrollView setHasHorizontalScroller:NO]; [_extScrollView setHasHorizontalScroller:NO];
[_extScrollView setHasVerticalScroller:YES]; [_extScrollView setHasVerticalScroller:YES];
[_extScrollView setAutoresizingMask: [_extScrollView setAutoresizingMask:
@ -75,15 +76,27 @@
// Text view // Text view
_extEditorView = [self _createEditorViewWithFrame:rect]; _extEditorView = [self _createEditorViewWithFrame:rect];
// container View with Status
_extStatusField = [[NSTextField alloc] initWithFrame:NSMakeRect(0,0,windowWidth,15)];
[_extStatusField setBezeled:NO];
[_extStatusField setEditable:NO];
[_extStatusField setSelectable:NO];
[_extStatusField setDrawsBackground:NO];
[_extStatusField setAutoresizingMask: NSViewWidthSizable];
containerView = [[NSView alloc] init];
[containerView addSubview:_extStatusField];
[containerView addSubview:_extScrollView];
// Include editor view // Include editor view
[_extScrollView setDocumentView:_extEditorView]; [_extScrollView setDocumentView:_extEditorView];
[_extEditorView setNeedsDisplay:YES]; [_extEditorView setNeedsDisplay:YES];
RELEASE(_extEditorView); RELEASE(_extEditorView);
// Include scroll view // Include scroll view
[_window setContentView:_extScrollView]; [_window setContentView:containerView];
[_window makeFirstResponder:_extEditorView]; [_window makeFirstResponder:_extEditorView];
RELEASE(_extScrollView); RELEASE(_extScrollView);
RELEASE(containerView);
// Honor "edited" state // Honor "edited" state
[_window setDocumentEdited:_isEdited]; [_window setDocumentEdited:_isEdited];
@ -92,6 +105,7 @@
- (void)_createInternalView - (void)_createInternalView
{ {
NSRect rect = NSMakeRect(0,0,512,320); NSRect rect = NSMakeRect(0,0,512,320);
NSView *containerView;
// Scroll view // Scroll view
_intScrollView = [[NSScrollView alloc] initWithFrame:rect]; _intScrollView = [[NSScrollView alloc] initWithFrame:rect];
@ -104,12 +118,24 @@
// Text view // Text view
_intEditorView = [self _createEditorViewWithFrame:rect]; _intEditorView = [self _createEditorViewWithFrame:rect];
// container View with Status
_intStatusField = [[NSTextField alloc] initWithFrame:NSMakeRect(0,0,512,15)];
[_intStatusField setBezeled:NO];
[_intStatusField setEditable:NO];
[_intStatusField setSelectable:NO];
[_intStatusField setDrawsBackground:NO];
[_intStatusField setAutoresizingMask: NSViewWidthSizable];
containerView = [[NSView alloc] init];
[containerView addSubview:_intStatusField];
[containerView addSubview:_intScrollView];
/* /*
* Setting up ext view / scroll view / window * Setting up ext view / scroll view / window
*/ */
[_intScrollView setDocumentView:_intEditorView]; [_intScrollView setDocumentView:_intEditorView];
[_intEditorView setNeedsDisplay:YES]; [_intEditorView setNeedsDisplay:YES];
RELEASE(_intEditorView); RELEASE(_intEditorView);
RELEASE(containerView);
} }
- (PCEditorView *)_createEditorViewWithFrame:(NSRect)fr - (PCEditorView *)_createEditorViewWithFrame:(NSRect)fr