Ignore:
Timestamp:
12/11/01 15:22:10 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mmain
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mmain/MBrowser.cc

    r1086 r1108  
    113113{
    114114    //
    115     // Create Dir-Listbox and buttons in first frame
    116     //
    117     TGFSComboBox *dir = new TGFSComboBox(frame, kCBDirectory);
    118     dir->SetHeight(fEntry->GetHeight());
    119 
    120     //
    121     // Get the three picturs from the system (must be deleted by FreePicture)
    122     //
    123     const TGPicture *pic1 = fList->GetPicture("tb_uplevel.xpm");
    124     const TGPicture *pic2 = fList->GetPicture("tb_list.xpm");
    125     const TGPicture *pic3 = fList->GetPicture("tb_details.xpm");
    126 
    127     //
    128     // Create the corresponding picture buttons
    129     //
    130     TGPictureButton *cdup   = new TGPictureButton(frame, pic1, kButDirUp);
    131     TGPictureButton *list   = new TGPictureButton(frame, pic2, kButListMode);
    132     TGPictureButton *detail = new TGPictureButton(frame, pic3, kButDetailMode);
    133 
    134     //
    135     // setup the buttons
    136     //
    137     cdup  ->SetToolTipText("One Level up!");
    138     list  ->SetToolTipText("List Mode");
    139     detail->SetToolTipText("Details Mode");
    140 
    141     list  ->SetState(kButtonUp);
    142     detail->SetState(kButtonEngaged);
    143 
    144     list  ->AllowStayDown(kTRUE);
    145     detail->AllowStayDown(kTRUE);
    146 
    147     //
    148     // send messages to 'this' object
    149     //
    150     dir   ->Associate(this);
    151     cdup  ->Associate(this);
    152     detail->Associate(this);
    153     list  ->Associate(this);
    154 
    155     //
    156     // Add to list for 'automatic' deletion
    157     //
    158     fList->Add(dir);
    159     fList->Add(cdup);
    160     fList->Add(list);
    161     fList->Add(detail);
    162 
    163     //
    164115    // Layout Dir-Listbox and buttons in one row (frame)
    165116    //
     
    169120    //
    170121    TGLayoutHints *laydir = new TGLayoutHints(kLHintsExpandX|kLHintsLeft|kLHintsCenterY); //, 5, 5, 5, 5);
     122    TGLayoutHints *layout = new TGLayoutHints(kLHintsRight|kLHintsCenterY, 10); //, 5, 5, 5);
     123
    171124    fList->Add(laydir);
    172 
    173     TGLayoutHints *layout = new TGLayoutHints(kLHintsRight|kLHintsCenterY, 10); //, 5, 5, 5);
    174125    fList->Add(layout);
    175126
    176     frame->AddFrame(dir,    laydir);
    177     frame->AddFrame(list,   layout);
    178     frame->AddFrame(detail, layout);
    179     frame->AddFrame(cdup,   layout);
     127    //
     128    // Create Dir-Listbox and buttons in first frame
     129    //
     130    TGFSComboBox *dir = new TGFSComboBox(frame, kCBDirectory);
     131    dir->SetHeight(fEntry->GetHeight());
     132    dir->Associate(this);
     133    fList->Add(dir);
     134    frame->AddFrame(dir, laydir);
     135
     136    //
     137    // Get the three picturs from the system (must be deleted by FreePicture)
     138    //
     139    const TGPicture *pic1 = fList->GetPicture("tb_list.xpm");
     140    if (pic1)
     141    {
     142        TGPictureButton *list = new TGPictureButton(frame, pic1, kButListMode);
     143        list->SetToolTipText("List Mode");
     144        list->SetState(kButtonUp);
     145        list->AllowStayDown(kTRUE);
     146        list->Associate(this);
     147        fList->Add(list);
     148        frame->AddFrame(list, layout);
     149    }
     150
     151    const TGPicture *pic2 = fList->GetPicture("tb_details.xpm");
     152    if (pic2)
     153    {
     154        TGPictureButton *detail = new TGPictureButton(frame, pic2, kButDetailMode);
     155        detail->SetToolTipText("Details Mode");
     156        detail->SetState(kButtonEngaged);
     157        detail->AllowStayDown(kTRUE);
     158        detail->Associate(this);
     159        fList->Add(detail);
     160        frame->AddFrame(detail, layout);
     161    }
     162
     163    const TGPicture *pic3 = fList->GetPicture("tb_uplevel.xpm");
     164    if (pic3)
     165    {
     166        TGPictureButton *cdup = new TGPictureButton(frame, pic3, kButDirUp);
     167        cdup->SetToolTipText("One Level up!");
     168        cdup->Associate(this);
     169        fList->Add(cdup);
     170        frame->AddFrame(cdup, layout);
     171    }
    180172}
    181173
  • trunk/MagicSoft/Mars/mmain/MMars.cc

    r1082 r1108  
    2626#include "MMars.h"
    2727
     28#include <iostream.h>
     29
    2830#include <TApplication.h>  // gROOT->GetApplication()->...
    2931
     
    3537#include <TG3DLine.h>      // TGHorizontal3DLine
    3638
     39#include "MGList.h"
    3740#include "MEvtDisp.h"
    3841#include "MAnalysis.h"
     
    8588void MMars::CreateTopFrame(TGHorizontalFrame *top)
    8689{
    87     fPic1 = gClient->GetPicture("magiclogo.xpm");
    88     fPic2 = gClient->GetPicture("marslogo.xpm");
    89 
    90     TGPictureButton *magic = new TGPictureButton(top, fPic1, kPicMagic);
    91     TGPictureButton *mars  = new TGPictureButton(top, fPic2, kPicMars);
    92 
    93     fList->Add(magic);
    94     fList->Add(mars);
    95 
    96     magic->Associate(this);
    97     mars->Associate(this);
    98 
    99     TGLayoutHints *lay1 = new TGLayoutHints(kLHintsLeft,  10., 10., 20., 10.);
    100     TGLayoutHints *lay2 = new TGLayoutHints(kLHintsRight, 10., 10., 10., 10.);
    101 
    102     fList->Add(lay1);
    103     fList->Add(lay2);
    104 
    105     top->AddFrame(magic, lay1);
    106     top->AddFrame(mars,  lay2);
     90    const TGPicture *pic1 = fList->GetPicture("magiclogo.xpm");
     91    if (pic1)
     92    {
     93        TGPictureButton *magic = new TGPictureButton(top, pic1, kPicMagic);
     94        fList->Add(magic);
     95        magic->Associate(this);
     96        TGLayoutHints *lay1 = new TGLayoutHints(kLHintsLeft,  10., 10., 20., 10.);
     97        fList->Add(lay1);
     98        top->AddFrame(magic, lay1);
     99    }
     100
     101    const TGPicture *pic2 = fList->GetPicture("marslogo.xpm");
     102    if (pic2)
     103    {
     104        TGPictureButton *mars  = new TGPictureButton(top, pic2, kPicMars);
     105        fList->Add(mars);
     106        mars->Associate(this);
     107        TGLayoutHints *lay2 = new TGLayoutHints(kLHintsRight, 10., 10., 10., 10.);
     108        fList->Add(lay2);
     109        top->AddFrame(mars,  lay2);
     110    }
    107111}
    108112
     
    176180    // Create the deletion list
    177181    //
    178     fList = new TList;
     182    fList = new MGList;
    179183    fList->SetOwner();
    180184
     
    230234MMars::~MMars()
    231235{
    232     gClient->FreePicture(fPic1);
    233     gClient->FreePicture(fPic2);
    234 
    235236    delete fList;
    236237
  • trunk/MagicSoft/Mars/mmain/MMars.h

    r1052 r1108  
    1010#endif
    1111
    12 class TList;
     12class MGList;
    1313class TGVerticalFrame;
    1414class TGLayoutHints;
     
    1818private:
    1919
    20     TList *fList;
    21 
    22     const TGPicture *fPic1;
    23     const TGPicture *fPic2;
     20    MGList *fList;
    2421
    2522    void CreateTextButton(TGVerticalFrame *tab, const char *text,
Note: See TracChangeset for help on using the changeset viewer.