Index: trunk/MagicSoft/Mars/mmain/MStatusDisplay.cc
===================================================================
--- trunk/MagicSoft/Mars/mmain/MStatusDisplay.cc	(revision 2054)
+++ trunk/MagicSoft/Mars/mmain/MStatusDisplay.cc	(revision 2058)
@@ -79,5 +79,5 @@
 #include <TG3DLine.h>             // TGHorizontal3DLine
 #include <TGButton.h>             // TGPictureButton
-#include <TGListBox.h>            // TGListBox
+#include <TGTextView.h>           // TGTextView
 #include <TGStatusBar.h>          // TGStatusBar
 #include <TGProgressBar.h>        // TGHProgressBar
@@ -153,11 +153,29 @@
 
     //
+    // Log Menu
+    //
+    MGPopupMenu *logmenu = new MGPopupMenu(gClient->GetRoot());
+    logmenu->AddEntry("&Copy Selected", kLogCopy);
+    logmenu->AddEntry("Clear all",      kLogClear);
+    logmenu->AddSeparator();
+    logmenu->AddEntry("Select All",     kLogSelect);
+    /*
+     logmenu->AddSeparator();
+     logmenu->AddEntry("Search",         kLogSearch);
+     */
+    logmenu->AddSeparator();
+    logmenu->AddEntry("Save",           kLogSave);
+    logmenu->AddEntry("Save append",    kLogAppend);
+    logmenu->Associate(this);
+
+    //
     // Menu Bar
     //
     MGMenuBar *menubar = new MGMenuBar(this, 1, 1, kHorizontalFrame);
     menubar->AddPopup("&File", filemenu, NULL);
+    menubar->AddPopup("Lo&g",  logmenu,  NULL);
+    menubar->AddPopup("&Size", sizemenu, NULL);
     menubar->AddPopup("&Tab",  tabmenu,  NULL);
     menubar->AddPopup("&Loop", loopmenu, NULL);
-    menubar->AddPopup("&Size", sizemenu, NULL);
     menubar->BindKeys(this);
     AddFrame(menubar);
@@ -180,4 +198,5 @@
     fList->Add(menubar);
     fList->Add(tabmenu);
+    fList->Add(logmenu);
     fList->Add(linesep);
 }
@@ -220,11 +239,4 @@
         f->AddFrame(mars, lay2);
     }
-    /*
-     TGShutter *s = new TGShutter(f);
-     fList->Add(s);
-     f->AddFrame(s, lay);
-     s->AddItem(new TGShutterItem(s, new TGHotString("Hallo1")));
-     s->AddItem(new TGShutterItem(s, new TGHotString("Hallo2")));
-     */
 
     // Add date and time
@@ -261,7 +273,9 @@
         TGCompositeFrame *f = fTab->AddTab("-Logbook-");
 
-        // Create TGListBox(p, id=-1, opt, back) for logging contents
-        fLogBox = new TGListBox(f, -1, kSunkenFrame);
-        //fLogBox->Associate(this);
+
+        fLogBox = new TGTextView(f, 1, 1/*, -1, 0, TGTextView::GetBlackPixel()*/);
+        if (fFont)
+            fLogBox->SetFont(fFont);
+        fLogBox->Associate(this);
 
         // Add List box to the tab
@@ -334,5 +348,4 @@
 }
 
-
 // --------------------------------------------------------------------------
 //
@@ -343,5 +356,15 @@
     fStatusBar = new TGStatusBar(this, 1, 1);
 
-    fStatusBar->SetParts(2);
+    //
+    //     1-a     a
+    // 1: ------|----
+    //
+    // a/(1-a) = (1-a)/1
+    // a^2+a-1 = 0
+    //       a = (-1+-sqrt(1+4))/2 = sqrt(5)/2-1/2 = 0.618
+    //
+    Int_t p[2] = {38, 62};
+
+    fStatusBar->SetParts(p, 2);
 
     TGLayoutHints *layb = new TGLayoutHints(kLHintsNormal|kLHintsExpandX, 5, 4, 0, 3);
@@ -399,4 +422,5 @@
     gROOT->GetListOfCleanups()->Add(this);
 
+    fFont = gVirtualX->LoadQueryFont("7x13bold");
 
     //
@@ -452,4 +476,7 @@
 
     delete fList;
+
+    if (fFont)
+        gVirtualX->DeleteFont(fFont);
 
     gROOT->GetListOfSpecials()->Remove(this);
@@ -643,4 +670,14 @@
 }
 
+/*
+    if (...)
+       fMenu->AddPopup("&CaOs", fCaOs, NULL);
+    else
+       fMenu->RemovePopup("CaOs");
+    fMenu->Resize(fMenu->GetDefaultSize());
+    MapSubwindows();
+    MapWindow();
+ */
+
 // --------------------------------------------------------------------------
 //
@@ -728,4 +765,48 @@
     case kSize1280:
         Resize(1280, 980);
+        return kTRUE;
+
+    case kLogClear:
+        fLogBox->Clear();
+        return kTRUE;
+    case kLogCopy:
+        fLogBox->Copy();
+        return kTRUE;
+    case kLogSelect:
+        fLogBox->SelectAll();
+        return kTRUE;
+    case kLogSearch:
+        //virtual Bool_t Search(const char *string, Bool_t direction, Bool_t caseSensitive);
+        return kTRUE;
+    case kLogSave:
+        SetStatusLine1("Saving log...");
+        SetStatusLine2("");
+        *fLog << inf << "Saving log... " << flush;
+        if (fLogBox->GetText()->Save("statusdisplay.log"))
+        {
+            *fLog << "done." << endl;
+            SetStatusLine2("done.");
+        }
+        else
+        {
+            *fLog << "failed!" << endl;
+            SetStatusLine2("Failed!");
+        }
+        return kTRUE;
+
+    case kLogAppend:
+        SetStatusLine1("Appending logg...");
+        SetStatusLine2("");
+        *fLog << inf << "Appending log... " << flush;
+        if (fLogBox->GetText()->Append("statusdisplay.log"))
+        {
+            *fLog << "done." << endl;
+            SetStatusLine2("done.");
+        }
+        else
+        {
+            *fLog << "failed!" << endl;
+            SetStatusLine2("Failed!");
+        }
         return kTRUE;
 
@@ -795,4 +876,57 @@
 // --------------------------------------------------------------------------
 //
+// Process the kC_TEXTVIEW messages
+//
+Bool_t MStatusDisplay::ProcessMessageTextview(Long_t submsg, Long_t mp1, Long_t mp2)
+{
+    // kC_TEXTVIEW, kTXT_ISMARKED, widget id, [true|false]                  //
+    // kC_TEXTVIEW, kTXT_DATACHANGE, widget id, 0                           //
+    // kC_TEXTVIEW, kTXT_CLICK2, widget id, position (y << 16) | x)         //
+    // kC_TEXTVIEW, kTXT_CLICK3, widget id, position (y << 16) | x)         //
+    // kC_TEXTVIEW, kTXT_F3, widget id, true                                //
+    // kC_TEXTVIEW, kTXT_OPEN, widget id, 0                                 //
+    // kC_TEXTVIEW, kTXT_CLOSE, widget id, 0                                //
+    // kC_TEXTVIEW, kTXT_SAVE, widget id, 0                                 //
+    switch (submsg)
+    {
+    case kTXT_ISMARKED:
+        cout << "Textview-IsMarked #" << mp1 << " " << (mp2?"yes":"no") << endl;
+        return kTRUE;
+
+    case kTXT_DATACHANGE:
+        cout << "Textview-DataChange #" << mp1 << endl;
+        return kTRUE;
+
+    case kTXT_CLICK2:
+        cout << "Textview-Click2 #" << mp1 << " x=" << (mp2&0xffff) << " y= " << (mp2>>16) << endl;
+        return kTRUE;
+
+    case kTXT_CLICK3:
+        cout << "Textview-Click3 #" << mp1 << " x=" << (mp2&0xffff) << " y= " << (mp2>>16) << endl;
+        return kTRUE;
+
+    case kTXT_F3:
+        cout << "Textview-F3 #" << mp1 << endl;
+        return kTRUE;
+
+    case kTXT_OPEN:
+        cout << "Textview-Open #" << mp1 << endl;
+        return kTRUE;
+
+    case kTXT_CLOSE:
+        cout << "Textview-Close #" << mp1 << endl;
+        return kTRUE;
+
+    case kTXT_SAVE:
+        cout << "Textview-Save #" << mp1 << endl;
+        return kTRUE;
+    }
+
+    cout << "Textview: " << "Submsg:" << submsg << " Mp1=" << mp1 << " Mp2=" << mp2 << endl;
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
 // Process the messages from the GUI
 //
@@ -804,4 +938,7 @@
     case kC_COMMAND:
         return ProcessMessageCommand(GET_SUBMSG(msg), mp1, mp2);
+
+    case kC_TEXTVIEW:
+        return ProcessMessageTextview(GET_SUBMSG(msg), mp1, mp2);
     }
 
@@ -866,10 +1003,10 @@
         fLog->UpdateGui();
 
+        /*
         if (!fLogBox->TestBit(kHasChanged))
             return kTRUE;
 
-        fLogBox->MapSubwindows();
-        fLogBox->Layout();
-        fLogBox->ResetBit(kHasChanged);
+            fLogBox->ResetBit(kHasChanged);
+            */
         return kTRUE;
     }
Index: trunk/MagicSoft/Mars/mmain/MStatusDisplay.h
===================================================================
--- trunk/MagicSoft/Mars/mmain/MStatusDisplay.h	(revision 2054)
+++ trunk/MagicSoft/Mars/mmain/MStatusDisplay.h	(revision 2058)
@@ -23,5 +23,5 @@
 
 class TGTab;
-class TGListBox;
+class TGTextView;
 class TGStatusBar;
 class TGProgressBar;
@@ -32,31 +32,19 @@
 public:
     typedef enum {
-        kLoopNone,
-        kLoopStop,
-        kFileSave,
-        kFileSaveAs,
-        kFileSaveAsPS,
-        kFileSaveAsRoot,
-        kFileSaveAsGIF,
-        kFileSaveAsC,
-        kFilePrint,
-        kFilePrinterName,
-        kTabSave,
-        kTabSaveAs,
-        kTabSaveAsPS,
-        kTabSaveAsRoot,
-        kTabSaveAsGIF,
-        kTabSaveAsC,
-        kTabPrint,
-        kTabNext,
-        kTabPrevious,
-        kSize640,
-        kSize800,
-        kSize960,
-        kSize1024,
-        kSize1280,
+        // KFile
+        kFileSave, kFileSaveAs, kFileSaveAsPS, kFileSaveAsRoot,
+        kFileSaveAsGIF, kFileSaveAsC, kFilePrint, kFilePrinterName,
         kFileExit,
-        kPicMagic,
-        kPicMars
+        // kLoop
+        kLoopNone, kLoopStop,
+        // kTab
+        kTabSave, kTabSaveAs, kTabSaveAsPS, kTabSaveAsRoot, kTabSaveAsGIF,
+        kTabSaveAsC, kTabPrint, kTabNext, kTabPrevious,
+        // kSize
+        kSize640, kSize800, kSize960, kSize1024, kSize1280,
+        // kLog
+        kLogCopy, kLogClear, kLogSelect, kLogSearch, kLogSave, kLogAppend,
+        // kPic
+        kPicMagic, kPicMars
     } Status_t;
 
@@ -78,5 +66,7 @@
     Int_t fLogIdx;
     TTimer fLogTimer;
-    TGListBox *fLogBox;
+    TGTextView *fLogBox;
+
+    FontStruct_t fFont;
 
     void AddMenuBar();
@@ -91,4 +81,5 @@
     Bool_t ProcessMessageCommandMenu(Long_t mp1);
     Bool_t ProcessMessageCommand(Long_t submsg, Long_t mp1, Long_t mp2);
+    Bool_t ProcessMessageTextview(Long_t submsg, Long_t mp1, Long_t mp2);
     Bool_t ProcessMessage(Long_t msg, Long_t mp1, Long_t mp2);
     void   CloseWindow();
