Hi,
I am setting up a dialog box, which I attached a screenshot of. I also attached my code below. Notice that the text for the first column which should read “Plot Type” is cut off.
I tried following examples in the tutorials but to no avail. What do I need to do to get the letters not be cut off. I’m sure it relates to the hints but I can’t get it to work. Where is the best tutorial on how to do the hints correctly. I’ve read the GUI chapter in the ROOT manual but it’s spartan on this.
Thank you.
Best Regards,
Jon Lederman
TICoolPlotConfigureDialog::TICoolPlotConfigureDialog(const TGWindow *p, const TGWindow *main, UInt_t w,
UInt_t h, UInt_t options)
: TGTransientFrame(p, main, w, h, options)
{
// Create a dialog window. A dialog window pops up with respect to its
// “main” window.
// use hierarchical cleani
SetCleanup(kDeepCleanup);
fFrame1 = new TGHorizontalFrame(this, 60, 20, kFixedWidth);
TGHorizontalFrame *bottom_frame=new TGHorizontalFrame(this, 60, 20, kFixedWidth);
fOkButton = new TGTextButton(fFrame1, "&Ok", 1);
fOkButton->Associate(this);
fCancelButton = new TGTextButton(fFrame1, "&Cancel", 2);
fCancelButton->Associate(this);
fL1 = new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX,
2, 2, 2, 2);
fL2 = new TGLayoutHints(kLHintsBottom | kLHintsRight, 2, 2, 5, 1);
TGLayoutHints* fLChoose=new TGLayoutHints(kLHintsBottom | kLHintsCenterX| kLHintsExpandX, 0, 0, 0, 0);
fFrame1->AddFrame(fOkButton, fL1);
fFrame1->AddFrame(fCancelButton, fL1);
fFrame1->AddFrame(fOkButton, fL1);
fFrame1->AddFrame(fCancelButton, fL1);
fFrame1->Resize(150, fOkButton->GetDefaultHeight());
AddFrame(fFrame1, fL2);
//--------- create Tab widget and some composite frames for Tab testing
fTab = new TGTab(this, 300, 300);
TGCompositeFrame *tf = fTab->AddTab("ICool Plot Variables");
fL3 = new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 5, 5, 5);
TGHorizontalFrame* th=new TGHorizontalFrame(tf, 400,400);
tf->AddFrame(th);
//From TestMsgBox
fL41 = new TGLayoutHints(kLHintsTop | kLHintsLeft,
0, 0, 5, 0);
fG1 = new TGGroupFrame(th, new TGString("X Variable"),kVerticalFrame|kRaisedFrame);
fG2 = new TGGroupFrame(th, new TGString("Y Variable"),kVerticalFrame|kRaisedFrame);
fC[0] = new TGCheckButton(fG1, new TGHotString("ePerp"), -1);
fC[1] = new TGCheckButton(fG1, new TGHotString("eLong"), -1);
fC[2] = new TGCheckButton(fG1, new TGHotString("OK"), -1);
fC[3] = new TGCheckButton(fG1, new TGHotString("Apply"), -1);
fC[4] = new TGCheckButton(fG1, new TGHotString("Retry"), -1);
fC[5] = new TGCheckButton(fG1, new TGHotString("Ignore"), -1);
fC[6] = new TGCheckButton(fG1, new TGHotString("Cancel"), -1);
fC[7] = new TGCheckButton(fG1, new TGHotString("Close"), -1);
fC[8] = new TGCheckButton(fG1, new TGHotString("Yes to All"), -1);
fC[9] = new TGCheckButton(fG1, new TGHotString("No to All"), -1);
fC[10] = new TGCheckButton(fG1, new TGHotString("Newer Only"), -1);
fC[11] = new TGCheckButton(fG1, new TGHotString("Append"), -1);
fC[12] = new TGCheckButton(fG1, new TGHotString("Dismiss"), -1);
for (int i=0; i<13; ++i) fG1->AddFrame(fC[i], fL3);
fR[0] = new TGRadioButton(fG2, new TGHotString("Stop"), 21);
fR[1] = new TGRadioButton(fG2, new TGHotString("Question"), 22);
fR[2] = new TGRadioButton(fG2, new TGHotString("Exclamation"), 23);
fR[3] = new TGRadioButton(fG2, new TGHotString("Asterisk"), 24);
for (int i = 0; i < 4; ++i) {
fG2->AddFrame(fR[i], fL3);
fR[i]->Associate(this);
}
fF1 = new TGCompositeFrame(tf, 60, 20, kVerticalFrame);
fF1->AddFrame(new TGTextButton(fF1, "&Test button", 0), fL3);
fF1->AddFrame(fTxt1 = new TGTextEntry(fF1, new TGTextBuffer(100)), fL3);
fF1->AddFrame(fTxt2 = new TGTextEntry(fF1, new TGTextBuffer(100)), fL3);
// tf->AddFrame(fF1, fL3);
fTxt1->Resize(150, fTxt1->GetDefaultHeight());
fTxt2->Resize(150, fTxt2->GetDefaultHeight());
tf = fTab->AddTab("ICool Plot Color");
TGLayoutHints *ct = new TGLayoutHints(kLHintsTop | kLHintsLeft, 1, 1, 1, 1);
TGGroupFrame *choose_type = new TGGroupFrame(th, new TGString("Plot Type"),kVerticalFrame|kRaisedFrame);
TGCheckButton *ecalc9 = new TGCheckButton(choose_type, new TGHotString("ECalc9 Plot"), -1);
TGCheckButton *for009 = new TGCheckButton(choose_type, new TGHotString("For009 Plot"), -1);
choose_type->AddFrame(ecalc9, ct);
choose_type->AddFrame(for009, ct);
th->AddFrame(choose_type);
th->AddFrame(fG1);
th->AddFrame(fG2);
fL1 = new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX,
200, 2, 2, 2);
fF2 = new TGCompositeFrame(tf, 60, 20, kVerticalFrame);
fF2->AddFrame(fBtn1 = new TGTextButton(fF2, "&Button 1", 0), fL1);
fF2->AddFrame(fBtn2 = new TGTextButton(fF2, "B&utton 2", 0), fL1);
fF2->AddFrame(fChk1 = new TGCheckButton(fF2, "C&heck 1", 0), fL1);
fF2->AddFrame(fChk2 = new TGCheckButton(fF2, "Chec&k 2", 0), fL1);
fF2->AddFrame(fRad1 = new TGRadioButton(fF2, "&Radio 1", 81), fL1);
fF2->AddFrame(fRad2 = new TGRadioButton(fF2, "R&adio 2", 82), fL1);
fCombo = new TGComboBox(fF2, 88);
fF2->AddFrame(fCombo, fL3);
int i;
for (i = 0; i < 20; i++) {
char tmp[20];
sprintf(tmp, "Entry %i", i+1);
fCombo->AddEntry(tmp, i+1);
}
fCombo->Resize(150, 20);
fBtn1->Associate(this);
fBtn2->Associate(this);
fChk1->Associate(this);
fChk2->Associate(this);
fRad1->Associate(this);
fRad2->Associate(this);
TGLayoutHints *fL5 = new TGLayoutHints(kLHintsBottom | kLHintsExpandX |
kLHintsExpandY, 2, 2, 5, 1);
AddFrame(fTab, fL5);
MapSubwindows();
Resize(); // resize to default size
// position relative to the parent's window
CenterOnParent();
SetWindowName("Design ICool Plot");
MapWindow();
//fClient->WaitFor(this); // otherwise canvas contextmenu does not work