TG3DLine.cxx

Go to the documentation of this file.
00001 // @(#)root/gui:$Id: TG3DLine.cxx 35582 2010-09-22 13:38:27Z bellenot $
00002 // Author: Fons Rademakers   6/09/2000
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 //////////////////////////////////////////////////////////////////////////
00013 //                                                                      //
00014 // TGHorizontal3DLine and TGVertical3DLine                              //
00015 //                                                                      //
00016 // A horizontal 3D line is a line that typically separates a toolbar    //
00017 // from the menubar.                                                    //
00018 // A vertical 3D line is a line that can be used to separate groups of  //
00019 // widgets.                                                             //
00020 //                                                                      //
00021 //////////////////////////////////////////////////////////////////////////
00022 
00023 #include "TG3DLine.h"
00024 #include "Riostream.h"
00025 
00026 
00027 ClassImp(TGHorizontal3DLine)
00028 ClassImp(TGVertical3DLine)
00029 
00030 //______________________________________________________________________________
00031 TGHorizontal3DLine::TGHorizontal3DLine(const TGWindow *p, UInt_t w, UInt_t h,
00032                                        UInt_t options, Pixel_t back) : 
00033                     TGFrame(p, w, h, options, back)
00034 {
00035    // constructor
00036 
00037    SetWindowName();
00038    fEditDisabled = kEditDisableHeight;
00039 }
00040 
00041 //______________________________________________________________________________
00042 TGVertical3DLine::TGVertical3DLine(const TGWindow *p, UInt_t w, UInt_t h,
00043                                    UInt_t options, Pixel_t back) : 
00044                   TGFrame(p, w, h, options, back)
00045 {
00046    // constructor
00047 
00048    SetWindowName();
00049    fEditDisabled = kEditDisableWidth;
00050 }
00051 
00052 //______________________________________________________________________________
00053 void TGHorizontal3DLine::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
00054 {
00055     // Save an vertical 3D line as a C++ statement(s) on output stream out.
00056 
00057    if (fBackground != GetDefaultFrameBackground()) SaveUserColor(out, option);
00058 
00059    out << "   TGHorizontal3DLine *";
00060    out << GetName() << " = new TGHorizontal3DLine(" << fParent->GetName()
00061        << "," << GetWidth() << "," << GetHeight();
00062 
00063    if (fBackground == GetDefaultFrameBackground()) {
00064       if (!GetOptions()) {
00065          out << ");" << endl;
00066       } else {
00067          out << "," << GetOptionString() << ");" << endl;
00068       }
00069    } else {
00070       out << "," << GetOptionString() << ",ucolor);" << endl;
00071    }
00072    if (option && strstr(option, "keep_names"))
00073       out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
00074 }
00075 
00076 //______________________________________________________________________________
00077 void TGVertical3DLine::SavePrimitive(ostream &out, Option_t *option /*= ""*/)
00078 {
00079     // Save an vertical 3D line as a C++ statement(s) on output stream out.
00080 
00081    if (fBackground != GetDefaultFrameBackground()) SaveUserColor(out, option);
00082 
00083    out << "   TGVertical3DLine *";
00084    out << GetName() << " = new TGVertical3DLine(" << fParent->GetName()
00085        << "," << GetWidth() << "," << GetHeight();
00086 
00087    if (fBackground == GetDefaultFrameBackground()) {
00088       if (!GetOptions()) {
00089          out << ");" << endl;
00090       } else {
00091          out << "," << GetOptionString() <<");" << endl;
00092       }
00093    } else {
00094       out << "," << GetOptionString() << ",ucolor);" << endl;
00095    }
00096    if (option && strstr(option, "keep_names"))
00097       out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
00098 }

Generated on Tue Jul 5 14:21:56 2011 for ROOT_528-00b_version by  doxygen 1.5.1