#include "TGuiBldEditor.h"
#include "TGuiBldHintsEditor.h"
#include "TGuiBldNameFrame.h"
#include "TGResourcePool.h"
#include "TGTab.h"
#include "TGLabel.h"
#include "TGButtonGroup.h"
#include "TGNumberEntry.h"
#include "TG3DLine.h"
#include "TGColorSelect.h"
#include "TGColorDialog.h"
#include "TGuiBldGeometryFrame.h"
#include "TRootGuiBuilder.h"
#include "TGuiBldDragManager.h"
#include "TGFrame.h"
ClassImp(TGuiBldGeometryFrame)
TGuiBldGeometryFrame::TGuiBldGeometryFrame(const TGWindow *p, TGuiBldEditor *ed)
: TGVerticalFrame(p, 1, 1)
{
fEditor = ed;
fBuilder = (TRootGuiBuilder*)TRootGuiBuilder::Instance();
fDragManager = (TGuiBldDragManager *)gDragManager;
fSelected = fEditor->GetSelected();
fEditDisabled = 1;
SetCleanup(kDeepCleanup);
TGGroupFrame *fGroupFrame = new TGGroupFrame(this, "Size");
TGHorizontalFrame *hf = new TGHorizontalFrame(fGroupFrame);
hf->AddFrame(new TGLabel(hf, " Width "), new TGLayoutHints(kLHintsLeft |
kLHintsCenterY, 2, 2, 2, 2));
fNEWidth = new TGNumberEntry(hf, 0.0, 4, -1, (TGNumberFormat::EStyle)5);
hf->AddFrame(fNEWidth, new TGLayoutHints(kLHintsLeft | kLHintsCenterY,
2, 2, 2, 2));
hf->AddFrame(new TGLabel(hf, " Height "), new TGLayoutHints(kLHintsLeft |
kLHintsCenterY, 2, 2, 2, 2));
fNEHeight = new TGNumberEntry(hf, 0.0, 4, -1, (TGNumberFormat::EStyle)5);
hf->AddFrame(fNEHeight, new TGLayoutHints(kLHintsLeft | kLHintsCenterY,
2, 2, 2, 2));
fGroupFrame->AddFrame(hf, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY,
0, 0, 5, 0));
AddFrame(fGroupFrame, new TGLayoutHints(kLHintsExpandX | kLHintsTop));
fNEWidth->GetNumberEntry()->Connect("ReturnPressed()", "TGuiBldGeometryFrame",
this, "ResizeSelected()");
fNEWidth->Connect("ValueSet(Long_t)", "TGuiBldGeometryFrame", this,
"ResizeSelected()");
fNEHeight->GetNumberEntry()->Connect("ReturnPressed()", "TGuiBldGeometryFrame",
this, "ResizeSelected()");
fNEHeight->Connect("ValueSet(Long_t)", "TGuiBldGeometryFrame", this,
"ResizeSelected()");
if (!fSelected) {
fNEWidth->SetNumber(0);
fNEHeight->SetNumber(0);
}
else {
fNEWidth->SetNumber(fSelected->GetWidth());
fNEHeight->SetNumber(fSelected->GetHeight());
}
}
void TGuiBldGeometryFrame::ResizeSelected()
{
if (!fEditor)
return;
fSelected = fEditor->GetSelected();
if (!fSelected)
return;
Int_t w = fNEWidth->GetIntNumber();
Int_t h = fNEHeight->GetIntNumber();
if ((w > 0) && (h > 0)) {
fSelected->MoveResize(fSelected->GetX(), fSelected->GetY(), w, h);
fClient->NeedRedraw(fSelected, kTRUE);
TGWindow *root = (TGWindow*)fClient->GetRoot();
fClient->NeedRedraw(root, kTRUE);
fDragManager->DrawGrabRectangles(fSelected);
if (fBuilder) {
fClient->NeedRedraw(fBuilder, kTRUE);
}
} else {
fNEWidth->SetNumber(fSelected->GetWidth());
fNEHeight->SetNumber(fSelected->GetHeight());
}
}
void TGuiBldGeometryFrame::ChangeSelected(TGFrame *frame)
{
if (!frame) {
fNEWidth->SetNumber(0);
fNEHeight->SetNumber(0);
} else {
fNEWidth->SetNumber(frame->GetWidth());
fNEHeight->SetNumber(frame->GetHeight());
}
}
TGuiBldGeometryFrame.cxx:1 TGuiBldGeometryFrame.cxx:2 TGuiBldGeometryFrame.cxx:3 TGuiBldGeometryFrame.cxx:4 TGuiBldGeometryFrame.cxx:5 TGuiBldGeometryFrame.cxx:6 TGuiBldGeometryFrame.cxx:7 TGuiBldGeometryFrame.cxx:8 TGuiBldGeometryFrame.cxx:9 TGuiBldGeometryFrame.cxx:10 TGuiBldGeometryFrame.cxx:11 TGuiBldGeometryFrame.cxx:12 TGuiBldGeometryFrame.cxx:13 TGuiBldGeometryFrame.cxx:14 TGuiBldGeometryFrame.cxx:15 TGuiBldGeometryFrame.cxx:16 TGuiBldGeometryFrame.cxx:17 TGuiBldGeometryFrame.cxx:18 TGuiBldGeometryFrame.cxx:19 TGuiBldGeometryFrame.cxx:20 TGuiBldGeometryFrame.cxx:21 TGuiBldGeometryFrame.cxx:22 TGuiBldGeometryFrame.cxx:23 TGuiBldGeometryFrame.cxx:24 TGuiBldGeometryFrame.cxx:25 TGuiBldGeometryFrame.cxx:26 TGuiBldGeometryFrame.cxx:27 TGuiBldGeometryFrame.cxx:28 TGuiBldGeometryFrame.cxx:29 TGuiBldGeometryFrame.cxx:30 TGuiBldGeometryFrame.cxx:31 TGuiBldGeometryFrame.cxx:32 TGuiBldGeometryFrame.cxx:33 TGuiBldGeometryFrame.cxx:34 TGuiBldGeometryFrame.cxx:35 TGuiBldGeometryFrame.cxx:36 TGuiBldGeometryFrame.cxx:37 TGuiBldGeometryFrame.cxx:38 TGuiBldGeometryFrame.cxx:39 TGuiBldGeometryFrame.cxx:40 TGuiBldGeometryFrame.cxx:41 TGuiBldGeometryFrame.cxx:42 TGuiBldGeometryFrame.cxx:43 TGuiBldGeometryFrame.cxx:44 TGuiBldGeometryFrame.cxx:45 TGuiBldGeometryFrame.cxx:46 TGuiBldGeometryFrame.cxx:47 TGuiBldGeometryFrame.cxx:48 TGuiBldGeometryFrame.cxx:49 TGuiBldGeometryFrame.cxx:50 TGuiBldGeometryFrame.cxx:51 TGuiBldGeometryFrame.cxx:52 TGuiBldGeometryFrame.cxx:53 TGuiBldGeometryFrame.cxx:54 TGuiBldGeometryFrame.cxx:55 TGuiBldGeometryFrame.cxx:56 TGuiBldGeometryFrame.cxx:57 TGuiBldGeometryFrame.cxx:58 TGuiBldGeometryFrame.cxx:59 TGuiBldGeometryFrame.cxx:60 TGuiBldGeometryFrame.cxx:61 TGuiBldGeometryFrame.cxx:62 TGuiBldGeometryFrame.cxx:63 TGuiBldGeometryFrame.cxx:64 TGuiBldGeometryFrame.cxx:65 TGuiBldGeometryFrame.cxx:66 TGuiBldGeometryFrame.cxx:67 TGuiBldGeometryFrame.cxx:68 TGuiBldGeometryFrame.cxx:69 TGuiBldGeometryFrame.cxx:70 TGuiBldGeometryFrame.cxx:71 TGuiBldGeometryFrame.cxx:72 TGuiBldGeometryFrame.cxx:73 TGuiBldGeometryFrame.cxx:74 TGuiBldGeometryFrame.cxx:75 TGuiBldGeometryFrame.cxx:76 TGuiBldGeometryFrame.cxx:77 TGuiBldGeometryFrame.cxx:78 TGuiBldGeometryFrame.cxx:79 TGuiBldGeometryFrame.cxx:80 TGuiBldGeometryFrame.cxx:81 TGuiBldGeometryFrame.cxx:82 TGuiBldGeometryFrame.cxx:83 TGuiBldGeometryFrame.cxx:84 TGuiBldGeometryFrame.cxx:85 TGuiBldGeometryFrame.cxx:86 TGuiBldGeometryFrame.cxx:87 TGuiBldGeometryFrame.cxx:88 TGuiBldGeometryFrame.cxx:89 TGuiBldGeometryFrame.cxx:90 TGuiBldGeometryFrame.cxx:91 TGuiBldGeometryFrame.cxx:92 TGuiBldGeometryFrame.cxx:93 TGuiBldGeometryFrame.cxx:94 TGuiBldGeometryFrame.cxx:95 TGuiBldGeometryFrame.cxx:96 TGuiBldGeometryFrame.cxx:97 TGuiBldGeometryFrame.cxx:98 TGuiBldGeometryFrame.cxx:99 TGuiBldGeometryFrame.cxx:100 TGuiBldGeometryFrame.cxx:101 TGuiBldGeometryFrame.cxx:102 TGuiBldGeometryFrame.cxx:103 TGuiBldGeometryFrame.cxx:104 TGuiBldGeometryFrame.cxx:105 TGuiBldGeometryFrame.cxx:106 TGuiBldGeometryFrame.cxx:107 TGuiBldGeometryFrame.cxx:108 TGuiBldGeometryFrame.cxx:109 TGuiBldGeometryFrame.cxx:110 TGuiBldGeometryFrame.cxx:111 TGuiBldGeometryFrame.cxx:112 TGuiBldGeometryFrame.cxx:113 TGuiBldGeometryFrame.cxx:114 TGuiBldGeometryFrame.cxx:115 TGuiBldGeometryFrame.cxx:116 TGuiBldGeometryFrame.cxx:117 TGuiBldGeometryFrame.cxx:118 TGuiBldGeometryFrame.cxx:119 TGuiBldGeometryFrame.cxx:120 TGuiBldGeometryFrame.cxx:121 TGuiBldGeometryFrame.cxx:122 TGuiBldGeometryFrame.cxx:123 TGuiBldGeometryFrame.cxx:124 TGuiBldGeometryFrame.cxx:125 TGuiBldGeometryFrame.cxx:126 TGuiBldGeometryFrame.cxx:127 TGuiBldGeometryFrame.cxx:128