00001 // @(#)root/gviz3d:$Id: TStructNodeEditor.h 30023 2009-09-02 17:57:16Z brun $ 00002 // Author: Tomasz Sosnicki 18/09/09 00003 00004 /************************************************************************* 00005 * Copyright (C) 1995-2009, 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 #ifndef ROOT_TStructNodeEditor 00013 #define ROOT_TStructNodeEditor 00014 00015 #include <TGedFrame.h> 00016 00017 class TList; 00018 class TStructNode; 00019 class TStructNodeProperty; 00020 class TGNumberEntry; 00021 class TGLabel; 00022 class TGTextEntry; 00023 class TGColorSelect; 00024 class TGCheckButton; 00025 00026 class TStructNodeEditor : public TGedFrame { 00027 00028 protected: 00029 TList *fColors; // Pointer to list with class colors 00030 TStructNode *fNode; // Pointer to node which is edited 00031 TGNumberEntry *fMaxObjectsNumberEntry; // Sets maximum number of nodes on scene 00032 TGNumberEntry *fMaxLevelsNumberEntry; // Sets maximum number of visible levels on scene 00033 TGLabel *fTypeName; // Label with name of type 00034 TGLabel *fNodeNameLabel; // Label with name of node 00035 TGTextEntry *fNameEntry; // Text entry with name of property 00036 TGColorSelect *fColorSelect; // Control to selec a color 00037 TStructNodeProperty *fSelectedPropert; // Pointer to property associated with node 00038 TGTextButton *fDefaultButton; // Resets color to default 00039 TGTextButton *fApplyButton; // Apply changes button 00040 TGCheckButton *fAutoRefesh; // Condition for auto update 00041 00042 TStructNodeProperty* FindNodeProperty(TStructNode* node); 00043 TStructNodeProperty* GetDefaultProperty(); 00044 void Init(); 00045 00046 public: 00047 TStructNodeEditor(TList* colors, const TGWindow *p = 0, Int_t width = 140, Int_t height = 30, 00048 UInt_t options = kChildFrame, Pixel_t back = GetDefaultFrameBackground()); 00049 ~TStructNodeEditor(); 00050 00051 void ApplyButtonSlot(); 00052 void AutoRefreshButtonSlot(Bool_t on); 00053 void ColorSelectedSlot(Pixel_t color); 00054 void DefaultButtonSlot(); 00055 void MaxLevelsValueSetSlot(Long_t); 00056 void MaxObjectsValueSetSlot(Long_t); 00057 void SetModel(TObject* obj); 00058 void Update(Bool_t resetCamera); 00059 void Update(); 00060 00061 ClassDef(TStructNodeEditor,1) // GUI fo editing TStructNode 00062 }; 00063 #endif // ROOT_TStructNodeEditor 00064