From 7504a154e1f135d6bbddd63be0ccdfd6b45d0714 Mon Sep 17 00:00:00 2001 From: Riccardo Mottola Date: Fri, 30 Jul 2021 02:29:59 +0200 Subject: [PATCH] status bar, still incomplete resizes badly / does not show internally --- Modules/Editors/ProjectCenter/PCEditor.h | 2 ++ Modules/Editors/ProjectCenter/PCEditor.m | 30 ++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/Modules/Editors/ProjectCenter/PCEditor.h b/Modules/Editors/ProjectCenter/PCEditor.h index 96f97f4..69137c3 100644 --- a/Modules/Editors/ProjectCenter/PCEditor.h +++ b/Modules/Editors/ProjectCenter/PCEditor.h @@ -37,8 +37,10 @@ { id _editorManager; + NSTextField *_extStatusField; NSScrollView *_extScrollView; PCEditorView *_extEditorView; + NSTextField *_intStatusField; NSScrollView *_intScrollView; PCEditorView *_intEditorView; NSTextStorage *_storage; diff --git a/Modules/Editors/ProjectCenter/PCEditor.m b/Modules/Editors/ProjectCenter/PCEditor.m index 119caad..74afa47 100644 --- a/Modules/Editors/ProjectCenter/PCEditor.m +++ b/Modules/Editors/ProjectCenter/PCEditor.m @@ -40,6 +40,7 @@ unsigned int style; NSRect rect; float windowWidth; + NSView *containerView; // PCLogInfo(self, @"[_createWindow]"); @@ -65,7 +66,7 @@ rect = [[_window contentView] frame]; // Scroll view - _extScrollView = [[NSScrollView alloc] initWithFrame:rect]; + _extScrollView = [[NSScrollView alloc] initWithFrame:NSMakeRect(0,15,windowWidth,320-15)]; [_extScrollView setHasHorizontalScroller:NO]; [_extScrollView setHasVerticalScroller:YES]; [_extScrollView setAutoresizingMask: @@ -75,15 +76,27 @@ // Text view _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 [_extScrollView setDocumentView:_extEditorView]; [_extEditorView setNeedsDisplay:YES]; RELEASE(_extEditorView); // Include scroll view - [_window setContentView:_extScrollView]; + [_window setContentView:containerView]; [_window makeFirstResponder:_extEditorView]; RELEASE(_extScrollView); + RELEASE(containerView); // Honor "edited" state [_window setDocumentEdited:_isEdited]; @@ -92,6 +105,7 @@ - (void)_createInternalView { NSRect rect = NSMakeRect(0,0,512,320); + NSView *containerView; // Scroll view _intScrollView = [[NSScrollView alloc] initWithFrame:rect]; @@ -104,12 +118,24 @@ // Text view _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 */ [_intScrollView setDocumentView:_intEditorView]; [_intEditorView setNeedsDisplay:YES]; RELEASE(_intEditorView); + RELEASE(containerView); } - (PCEditorView *)_createEditorViewWithFrame:(NSRect)fr