00001
00002 #include "bfemDisplay/EDButtonFrame.h"
00003
00004
00005 EDButtonFrame::EDButtonFrame( TGWindow* main, TGWindow* p, TGPicture* buttonPic, Int_t buttonId, Char_t* Text )
00006 : TGCompositeFrame( p, 100, 100, kHorizontalFrame ) {
00007
00008 m_main = main;
00009 m_parent = p;
00010 m_buttonPic = buttonPic;
00011 m_buttonId = buttonId;
00012 sprintf( m_Text, "%s", Text );
00013
00014 AddFrames();
00015
00016 }
00017
00018
00019
00020
00021 EDButtonFrame::EDButtonFrame( TGWindow* main, TGWindow* p, TGPicture* buttonPic, Int_t buttonId, Char_t* Text,
00022 TGComboBox* &combo )
00023 : TGCompositeFrame( p, 100, 50, kHorizontalFrame ) {
00024
00025 m_main = main;
00026 m_parent = p;
00027 m_buttonPic = buttonPic;
00028 m_buttonId = buttonId;
00029 sprintf( m_Text, "%s", Text );
00030
00031 AddFrames();
00032
00033 combo = new TGComboBox( this, -999 );
00034 AddFrame( combo, new TGLayoutHints( kLHintsLeft | kLHintsExpandY, 10, 0, 0, 0 ) );
00035
00036
00037 }
00038
00039 EDButtonFrame::EDButtonFrame( TGWindow* main, TGWindow* p, TGPicture* buttonPic, Int_t buttonId, Char_t* Text,
00040 TGTextEntry* &txtEntry )
00041 : TGCompositeFrame( p, 100, 50, kHorizontalFrame ) {
00042
00043 m_main = main;
00044 m_parent = p;
00045 m_buttonPic = buttonPic;
00046 m_buttonId = buttonId;
00047 sprintf( m_Text, "%s", Text );
00048
00049 AddFrames();
00050
00051 txtEntry = new TGTextEntry( this, "" );
00052 AddFrame( txtEntry, new TGLayoutHints( kLHintsLeft | kLHintsExpandY, 10, 0, 0, 0 ) );
00053
00054 }
00055
00056
00057 EDButtonFrame::~EDButtonFrame() {
00058
00059 delete m_button;
00060 delete m_label;
00061
00062 }
00063
00064 void EDButtonFrame::AddFrames() {
00065
00066 m_button = new TGPictureButton( this, m_buttonPic, m_buttonId );
00067 m_button->Associate( m_main );
00068 AddFrame( m_button, new TGLayoutHints( kLHintsLeft | kLHintsExpandY, 0, 0, 0, 0 ) );
00069
00070 m_label = new TGLabel( this, m_Text );
00071 AddFrame( m_label, new TGLayoutHints( kLHintsLeft | kLHintsExpandY, 10, 0, 0, 0 ) );
00072
00073 }
00074
00075
00076 void EDButtonFrame::SetText( Char_t *txt ) {
00077
00078 m_label->SetText( txt );
00079
00080 }