#include "TRootHelpDialog.h"
#include "TGButton.h"
#include "TGTextView.h"
ClassImp(TRootHelpDialog)
TRootHelpDialog::TRootHelpDialog(const TGWindow *main,
const char *title, UInt_t w, UInt_t h) :
TGTransientFrame(gClient->GetRoot(), main, w, h)
{
fView = new TGTextView(this, w, h, kSunkenFrame | kDoubleBorder);
fL1 = new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 3, 3, 3, 3);
AddFrame(fView, fL1);
fOK = new TGTextButton(this, " &OK ");
fL2 = new TGLayoutHints(kLHintsBottom | kLHintsCenterX, 0, 0, 5, 5);
AddFrame(fOK, fL2);
SetWindowName(title);
SetIconName(title);
MapSubwindows();
Resize(GetDefaultSize());
CenterOnParent();
}
TRootHelpDialog::~TRootHelpDialog()
{
delete fView;
delete fOK;
delete fL1;
delete fL2;
}
void TRootHelpDialog::Popup()
{
MapWindow();
}
void TRootHelpDialog::SetText(const char *helpText)
{
fView->LoadBuffer(helpText);
}
void TRootHelpDialog::AddText(const char *helpText)
{
TGText tt;
tt.LoadBuffer(helpText);
fView->AddText(&tt);
}
void TRootHelpDialog::CloseWindow()
{
DeleteWindow();
}
Bool_t TRootHelpDialog::ProcessMessage(Long_t msg, Long_t, Long_t)
{
switch (GET_MSG(msg)) {
case kC_COMMAND:
switch (GET_SUBMSG(msg)) {
case kCM_BUTTON:
DeleteWindow();
break;
default:
break;
}
default:
break;
}
return kTRUE;
}
Last change: Wed Jun 25 08:52:27 2008
Last generated: 2008-06-25 08:52
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.