Ignore:
Timestamp:
11/23/03 21:18:30 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mbase
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc

    r2550 r2563  
    560560//
    561561MStatusDisplay::MStatusDisplay(Long_t t)
    562 : TGMainFrame(NULL, 1, 1), fTab(NULL), fTimer(this, t, kTRUE), fStatus(kLoopNone), fLog(&gLog), fLogIdx(-1), fLogTimer(this, 250, kTRUE), fLogBox(NULL), fIsLocked(0)
     562: TGMainFrame(NULL, 1, 1), fLog(&gLog), fTab(NULL), fTimer(this, t, kTRUE), fStatus(kLoopNone), fLogIdx(-1), fLogTimer(this, 250, kTRUE), fLogBox(NULL), fIsLocked(0)
    563563{
    564564    // p==NULL means: Take gClient->GetRoot() if not in batch mode
     
    587587    fList = new MGList;
    588588    fList->SetOwner();
    589 
    590     //
    591     // set the smallest and biggest size of the Main frame
    592     // and move it to its appearance position
    593     SetWMSizeHints(570, 480, 1280, 980, 1, 1);
    594     Move(rand()%100+50, rand()%100+50);
    595     Resize(570, 480);
    596589
    597590    //
     
    612605        AddStatusBar();
    613606    }
     607
     608    //
     609    // set the smallest and biggest size of the Main frame
     610    // and move it to its appearance position
     611    SetWMSizeHints(570, 480, 1280, 980, 1, 1);
     612    MoveResize(rand()%100+570, rand()%100+480, 570, 480);
    614613
    615614    //
     
    10521051 */
    10531052
     1053void MStatusDisplay::Reset()
     1054{
     1055    for (int i=fTab->GetNumberOfTabs()-1; i>0; i--)
     1056        RemoveTab(i);
     1057}
     1058
    10541059// --------------------------------------------------------------------------
    10551060//
     
    10771082
    10781083    case kFileReset:
    1079         for (int i=fTab->GetNumberOfTabs()-1; i>0; i--)
    1080             RemoveTab(i);
     1084        Reset();
    10811085        return kTRUE;
    10821086        /*
     
    12171221    switch (submsg)
    12181222    {
    1219     case kCM_MENU:
     1223    case kCM_MENU: // 1
    12201224        return ProcessMessageCommandMenu(mp1); // mp2=userdata
    1221     case kCM_TAB:
     1225    case kCM_TAB:  // 8
    12221226        /*
    12231227         for (int i=0; i<fTab->GetNumberOfTabs(); i++)
     
    12381242        return kTRUE;
    12391243#ifdef DEBUG
    1240     case kCM_MENUSELECT:
     1244    case kCM_MENUSELECT: // 2
    12411245        cout << "Command-Menuselect #" << mp1 << " (UserData=" << (void*)mp2 << ")" << endl;
    12421246        return kTRUE;
    12431247
    1244     case kCM_BUTTON:
     1248    case kCM_BUTTON: // 3
    12451249        cout << "Command-Button." << endl;
    12461250        return kTRUE;
    12471251
    1248     case kCM_CHECKBUTTON:
     1252    case kCM_CHECKBUTTON: // 4
    12491253        cout << "Command-CheckButton." << endl;
    12501254        return kTRUE;
    12511255
    1252     case kCM_RADIOBUTTON:
     1256    case kCM_RADIOBUTTON: // 5
    12531257        cout << "Command-RadioButton." << endl;
    12541258        return kTRUE;
    12551259
    1256     case kCM_LISTBOX:
     1260    case kCM_LISTBOX: // 6
    12571261        cout << "Command-Listbox #" << mp1 << " (LineId #" << mp2 << ")" << endl;
    12581262        return kTRUE;
    12591263
    1260     case kCM_COMBOBOX:
     1264    case kCM_COMBOBOX: // 7
    12611265        cout << "Command-ComboBox." << endl;
    12621266        return kTRUE;
     
    13511355{
    13521356    // Can be found in WidgetMessageTypes.h
     1357#ifdef DEBUG
    13531358    cout << "Msg: " << GET_MSG(msg) << " Submsg:" << GET_SUBMSG(msg);
    13541359    cout << " Mp1=" << mp1 << " Mp2=" << mp2 << endl;
     1360#endif
    13551361    switch (GET_MSG(msg))
    13561362    {
    1357     case kC_COMMAND:
     1363    case kC_COMMAND:  // 1
    13581364        return ProcessMessageCommand(GET_SUBMSG(msg), mp1, mp2);
    13591365
    1360     case kC_TEXTVIEW:
     1366    case kC_TEXTVIEW: // 9
    13611367        return ProcessMessageTextview(GET_SUBMSG(msg), mp1, mp2);
    13621368
    1363     case kC_USER:
     1369    case kC_USER:     // 1001
    13641370        return ProcessMessageUser(GET_SUBMSG(msg), mp1, mp2);
    13651371    }
     
    13871393    gLog << dbg << "MStatusDisplay is on heap: " << (int)IsOnHeap() << endl;
    13881394
    1389     if (TestBit(kExitLoopOnExit))
     1395    if (TestBit(kExitLoopOnExit) || TestBit(kExitLoopOnClose))
     1396    {
     1397        gLog << dbg << "CloseWindow() calling ExitLoop." << endl;
    13901398        gSystem->ExitLoop();
    1391     if (TestBit(kExitLoopOnClose))
    1392         gSystem->ExitLoop();
     1399    }
    13931400
    13941401    if (fIsLocked<=0 && IsOnHeap())
     1402    {
     1403        gLog << dbg << "delete MStatusDisplay;" << endl;
    13951404        delete this;
     1405    }
    13961406    fStatus = kFileExit;
     1407    gLog << dbg << "MStatusDisplay.fStatus=kFileExit;" << endl;
    13971408}
    13981409
     
    21172128     */
    21182129
    2119     //Bool_t wchanged = w!=GetWidth();
     2130    Bool_t wchanged = w!=GetWidth();
    21202131    Bool_t hchanged = h!=GetHeight();
    2121     /*
     2132
    21222133    if (!wchanged && !hchanged)
    21232134    {
    21242135        Layout();
    21252136        // FIXME: Make sure that this doesn't result in endless loops.
    2126         // return kTRUE;
    2127     }
    2128     */
     2137        return kTRUE;
     2138    }
     2139
    21292140
    21302141    if (GetWidth()==1 && GetHeight()==1)
     
    21492160Bool_t MStatusDisplay::HandleEvent(Event_t *event)
    21502161{
     2162#if ROOT_VERSION_CODE == ROOT_VERSION(3,05,07)
     2163    // Strange... crashes on the LP machines...
     2164    if (event->fType==kClientMessage)
     2165        if (event->fHandle == gROOT_MESSAGE)
     2166            if (event->fUser[0]==264 && event->fUser[1] == 0 && event->fUser[2]==0)
     2167                return kTRUE;
     2168#endif
     2169
    21512170    Bool_t rc = TGMainFrame::HandleEvent(event);
    21522171
  • trunk/MagicSoft/Mars/mbase/MStatusDisplay.h

    r2550 r2563  
    5656    enum
    5757    {
    58         kExitLoopOnExit  = BIT(14),
    59         kExitLoopOnClose = BIT(15)
     58        // TGMainFrame::kDontCallClose = BIT(14)
     59        kExitLoopOnExit  = BIT(15),
     60        kExitLoopOnClose = BIT(16)
    6061     };
    6162
    6263protected:
     64    MLog             *fLog;
    6365    MGList           *fList;
    6466    TGCompositeFrame *fUserFrame;
     
    8082    TString fPrinter;
    8183
    82     MLog *fLog;
    8384    Int_t fLogIdx;
    8485    TTimer fLogTimer;
     
    179180     void UnLock() { if (fIsLocked>0) fIsLocked--; }
    180181
     182     void Reset();
     183
    181184     Bool_t CheckTabForCanvas(int num) const;
    182185
Note: See TracChangeset for help on using the changeset viewer.