本文整理汇总了C++中GridLayout类的典型用法代码示例。如果您正苦于以下问题:C++ GridLayout类的具体用法?C++ GridLayout怎么用?C++ GridLayout使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了GridLayout类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getMilliCount
void GridLayoutTimeline::reload()
{
mGridLayouts.clear();
// playback
mIdxCurrentLayout = -1;
mIdxPrevLayout = -1;
mTransitionAmt = 1.0f;
mPlaybackSpeed = 1.0f;
mTotalDuration = 0;
mStartTime = 0;
mPlayheadTime = 0;
mLastFrameTime = getMilliCount();
loadAllGrids();
if (mIdxCurrentLayout == -1)
{
ci::app::console() << "Didn't find any serialized grids." << endl;
// Add an empty layout
GridLayout newLayout;
newLayout.setTimestamp(0);
newLayout.setTransitionDuration(kDefaultTransitionDuration);
mGridLayouts.push_back(newLayout);
mIdxCurrentLayout = 0;
}
newLayoutWasSet();
}
示例2: GridLayout
// static
GridLayout* GridLayout::CreatePanel(View* host)
{
GridLayout* layout = new GridLayout(host);
layout->SetInsets(kPanelVertMargin, kPanelHorizMargin,
kPanelVertMargin, kPanelHorizMargin);
return layout;
}
示例3: MessageHeader
MessageHeader(Space simSize, GridLayout<DIM2> layout, Space nodeOffset) :
simSize(simSize),
nodeOffset(nodeOffset)
{
nodeSize = layout.getDataSpace();
nodePictureSize = layout.getDataSpaceWithoutGuarding();
nodeGuardCells = layout.getGuard();
}
示例4: Dialog
Debrief::Debrief()
: Dialog("Debrief"), mDebriefing(NULL), mNextMission(NULL), mReplay(NULL), mHomeBase(NULL), mMissionSelector(NULL)
{
setBackground(new FrameBackground());
Dimension screenSize = rGUIManager()->getScreenDimension();
setSize(MAGIC_DEBRIEF_WIDTH, MAGIC_DEBRIEF_HEIGHT);
centerOnScreen();
mDebriefing = new Label(L"DEBRIEFING");
mNextMission = new Button(L"Next Mission", this);
mReplay = new Button(L"Replay Mission", this);
mHomeBase = new Button(L"Home Base", this);
mMissionSelector = new Button(L"Missions", this);
GridLayout* gridLayout = new GridLayout(this, 32, 24);
gridLayout->set_borders(3);
gridLayout->set_padding(2);
gridLayout->add(new Label(L"Mission Complete: Debriefing"), 0, 0, 26, 1);
gridLayout->add(mDebriefing, 0, 1, 32, 22);
gridLayout->add(mMissionSelector, 0, 23, 6, 1);
gridLayout->add(mHomeBase, 6, 23, 6, 1);
gridLayout->add(mReplay, 20, 23, 6, 1);
gridLayout->add(mNextMission, 26, 23, 6, 1);
layout();
}
示例5: Mat
AugmentedView::AugmentedView(UIElementCollection * window, Engine * engine, cv::Mat _cameraMatrix)
{
cameraMatrix = new Mat();
_cameraMatrix.copyTo(*cameraMatrix);
rotation = new Mat();
position = new Mat();
objectVector = std::vector<ARObject*>();
LOGI(LOGTAG_POSITION, "Created AugmentedView");
canDraw = false;
Scalar selectColor = Colors::DodgerBlue;
selectColor[3] = 80;
selectionIndicator = new ARObject(OpenGLHelper::CreateSolidColorCube(1,selectColor));
selectedObject = NULL;
SET_TIME(&lastSelectionTime);
testObject = new ARObject(OpenGLHelper::CreateSolidColorCube(10,Colors::OrangeRed));
tabs = new TabDisplay(true);
window->AddChild(tabs);
createNext =false;
GridLayout * myGrid = new GridLayout(cv::Size2i(5,4));
cancelSelection = new Button("Cancel");
cancelSelection->AddClickDelegate(ClickEventDelegate::from_method<AugmentedView,&AugmentedView::ButtonPressed>(this));
myGrid->AddChild(cancelSelection,Point2i(4,3));
cancelSelection->SetVisible(false);
cancelSelection->Name = "Cancel";
releaseSelection = new Button("Release");
releaseSelection->AddClickDelegate(ClickEventDelegate::from_method<AugmentedView,&AugmentedView::ButtonPressed>(this));
myGrid->AddChild(releaseSelection,Point2i(4,2));
releaseSelection->SetVisible(false);
releaseSelection->Name = "Release";
Button * createCube = new Button("Create");
createCube->AddClickDelegate(ClickEventDelegate::from_method<AugmentedView,&AugmentedView::ButtonPressed>(this));
myGrid->AddChild(createCube,Point2i(4,1));
createCube->Name = "Create";
createCube->FillColor = Colors::LightGreen;
Button * deleteObject = new Button("Delete");
deleteObject->AddClickDelegate(ClickEventDelegate::from_method<AugmentedView,&AugmentedView::ButtonPressed>(this));
myGrid->AddChild(deleteObject,Point2i(4,0));
deleteObject->Name = "Delete";
deleteObject->FillColor = Colors::Orange;
tabs->AddTab("AR",myGrid);
LOGD(LOGTAG_ARINPUT,"Laying out tabs %d,%d",engine->imageWidth,engine->imageHeight);
tabs->DoLayout(Rect(0,0,engine->imageWidth,engine->imageHeight));
tabs->SetTab(0);
}
示例6: doCall
void SchnyderLayout::doCall(
const Graph &G,
adjEntry adjExternal,
GridLayout &gridLayout,
IPoint &boundingBox,
bool fixEmbedding)
{
// check for double edges & self loops
OGDF_ASSERT(isSimple(G));
// handle special case of graphs with less than 3 nodes
if (G.numberOfNodes() < 3) {
node v1, v2;
switch (G.numberOfNodes()) {
case 0:
boundingBox = IPoint(0, 0);
return;
case 1:
v1 = G.firstNode();
gridLayout.x(v1) = gridLayout.y(v1) = 0;
boundingBox = IPoint(0, 0);
return;
case 2:
v1 = G.firstNode();
v2 = G.lastNode();
gridLayout.x(v1) = gridLayout.y(v1) = gridLayout.y(v2) = 0;
gridLayout.x(v2) = 1;
boundingBox = IPoint(1, 0);
return;
}
}
// make a copy for triangulation
GraphCopy GC(G);
// embed
if (!fixEmbedding) {
if (planarEmbed(GC) == false) {
OGDF_THROW_PARAM(PreconditionViolatedException, pvcPlanar);
}
}
triangulate(GC);
schnyderEmbedding(GC, gridLayout, adjExternal);
}
示例7: callGrid
void GridLayoutPlanRepModule::callGrid(PlanRep &PG, GridLayout &gridLayout)
{
gridLayout.init(PG);
if (!handleTrivial(PG, gridLayout, m_gridBoundingBox)) {
doCall(PG, nullptr, gridLayout, m_gridBoundingBox, false);
}
}
示例8: computeCoordinates
void FPPLayout::computeCoordinates(const GraphCopy &G, IPoint &boundingBox, GridLayout &gridLayout, NodeArray<int> &num,
NodeArray<adjEntry> &e_wp, NodeArray<adjEntry> &e_wq) {
NodeArray<int> &x = gridLayout.x();
NodeArray<int> &y = gridLayout.y();
const int n = G.numberOfNodes();
NodeArray<int> x_rel(G);
NodeArray<node> upper(G);
NodeArray<node> next(G);
Array<node, int> v(1, n);
node w, vk, wp, wq;
int k, xq, dx;
forall_nodes(w, G) {
v[num[w]] = (node) w;
}
示例9: Dialog
MessageReader::MessageReader()
: Dialog("MessageReader"), mMessageList(NULL), mMessagePane(NULL), mCloseButton(NULL)
{
setBackground(new FrameBackground());
Dimension screenSize = rGUIManager()->getScreenDimension();
setSize(MAGIC_MESSAGE_READER_WIDTH, MAGIC_MESSAGE_READER_HEIGHT);
centerOnScreen();
mMessageList = new List(3, this, true);
mMessageList->setBackground(new FrameBackground());
mMessageList->setColumnWidth(0, 0.15);
mMessageList->setColumnWidth(1, 0.30);
mMessageList->setColumnWidth(2, 0.55);
mMessagePane = new Label();
mMessagePane->setBackground(new FrameBackground());
mCloseButton = new Button(L"Close", this);
GridLayout* gridLayout = new GridLayout(this, 32, 24);
gridLayout->set_borders(3);
gridLayout->set_padding(2);
gridLayout->add(new Label(L"Messages"), 0, 0, 26, 1);
gridLayout->add(mCloseButton, 26, 0, 6, 1);
gridLayout->add(mMessageList, 0, 1, 32, 11);
gridLayout->add(mMessagePane, 0, 12, 32, 12);
layout();
}
示例10: callGridFixEmbed
void GridLayoutPlanRepModule::callGridFixEmbed(
PlanRep &PG,
GridLayout &gridLayout,
adjEntry adjExternal)
{
gridLayout.init(PG);
if (!handleTrivial(PG, gridLayout, m_gridBoundingBox)) {
doCall(PG, adjExternal, gridLayout, m_gridBoundingBox, true);
}
}
示例11: collapseVertices
void PlanRep::collapseVertices(const OrthoRep &OR, GridLayout &drawing)
{
for (node v : nodes) {
const OrthoRep::VertexInfoUML *vi = OR.cageInfo(v);
if(vi == nullptr ||
(typeOf(v) != Graph::highDegreeExpander &&
typeOf(v) != Graph::lowDegreeExpander))
continue;
node vOrig = original(v);
OGDF_ASSERT(vOrig != 0);
node vCenter = newNode();
m_vOrig[vCenter] = vOrig;
m_vCopy[vOrig] = vCenter;
m_vOrig[v] = nullptr;
node lowerLeft = vi->m_corner[odNorth]->theNode();
node lowerRight = vi->m_corner[odWest ]->theNode();
node upperLeft = vi->m_corner[odEast ]->theNode();
drawing.x(vCenter) = (drawing.x(lowerLeft)+drawing.x(lowerRight)) >> 1;
drawing.y(vCenter) = (drawing.y(lowerLeft)+drawing.y(upperLeft )) >> 1;
edge eOrig;
forall_adj_edges(eOrig,vOrig) {
if(eOrig->target() == vOrig) {
node connect = m_eCopy[eOrig].back()->target();
edge eNew = newEdge(connect,vCenter);
m_eOrig[eNew] = eOrig;
m_eIterator[eNew] = m_eCopy[eOrig].pushBack(eNew);
} else {
node connect = m_eCopy[eOrig].front()->source();
edge eNew = newEdge(vCenter,connect);
m_eOrig[eNew] = eOrig;
m_eIterator[eNew] = m_eCopy[eOrig].pushFront(eNew);
}
}
}
}
示例12: CompleteView
CompleteView() : mList(1) {
View::mRootWidget = &mList;
mList.setBackground(true);
GridLayout* layout = new GridLayout(2);
layout->add(new Image(R_IMAGE_1), 0);
layout->add(new Image(R_IMAGE_2), 0);
layout->add(new Label("Hello World!", GREEN), 1); //should wind up on the top left?
layout->add(new StringLabel("String", GREEN), 1);
layout->add(new Textbox(10, 20, GREEN, GREEN), 1);
mList.add(layout, 0, -1, true);
Textbox* t = new Textbox(10, 200, GREEN, WHITE/*BRIGHT_RED*/);
mList.add(t, 0, -1, true);
t->setQwerty();
t->activate();
mList.add(new MultilineLabel("Line 1\nLine 10\nYet another line\n ", GREEN), 0);
mList.add(new Label("Next label", WHITE), 0);
mList.add(new HyperlinkLabel(this, "To close the program, \1click here\1.\n Now for a \1line-\nbroken\1 link.", GREEN, SKY_BLUE), 0);
}
示例13: mapGridLayout
void GridLayoutModule::mapGridLayout(const Graph &G,
GridLayout &gridLayout,
GraphAttributes &AG)
{
double maxWidth = 0; // maximum width of columns and rows;
double yMax = 0;
node v;
forall_nodes(v,G) {
if (AG.width (v) > maxWidth) maxWidth = AG.width (v);
if (AG.height(v) > maxWidth) maxWidth = AG.height(v);
if (gridLayout.y(v) > yMax) yMax = gridLayout.y(v);
}
maxWidth += m_separation;
// set position of nodes
forall_nodes(v,G) {
AG.x(v) = gridLayout.x(v) * maxWidth;
AG.y(v) = (yMax - gridLayout.y(v)) * maxWidth;
}
示例14: GetI18NCategory
void LogConfigScreen::CreateViews() {
using namespace UI;
I18NCategory *di = GetI18NCategory("Dialog");
I18NCategory *dev = GetI18NCategory("Developer");
root_ = new ScrollView(ORIENT_VERTICAL);
LinearLayout *vert = root_->Add(new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT)));
vert->SetSpacing(0);
LinearLayout *topbar = new LinearLayout(ORIENT_HORIZONTAL);
topbar->Add(new Choice(di->T("Back")))->OnClick.Handle<UIScreen>(this, &UIScreen::OnBack);
topbar->Add(new Choice(di->T("Toggle All")))->OnClick.Handle(this, &LogConfigScreen::OnToggleAll);
topbar->Add(new Choice(di->T("Enable All")))->OnClick.Handle(this, &LogConfigScreen::OnEnableAll);
topbar->Add(new Choice(di->T("Disable All")))->OnClick.Handle(this, &LogConfigScreen::OnDisableAll);
topbar->Add(new Choice(dev->T("Log Level")))->OnClick.Handle(this, &LogConfigScreen::OnLogLevel);
vert->Add(topbar);
vert->Add(new ItemHeader(dev->T("Logging Channels")));
LogManager *logMan = LogManager::GetInstance();
int cellSize = 400;
UI::GridLayoutSettings gridsettings(cellSize, 64, 5);
gridsettings.fillCells = true;
GridLayout *grid = vert->Add(new GridLayout(gridsettings, new LayoutParams(FILL_PARENT, WRAP_CONTENT)));
for (int i = 0; i < LogManager::GetNumChannels(); i++) {
LogTypes::LOG_TYPE type = (LogTypes::LOG_TYPE)i;
LogChannel *chan = logMan->GetLogChannel(type);
LinearLayout *row = new LinearLayout(ORIENT_HORIZONTAL, new LinearLayoutParams(cellSize - 50, WRAP_CONTENT));
row->SetSpacing(0);
row->Add(new CheckBox(&chan->enabled, "", "", new LinearLayoutParams(50, WRAP_CONTENT)));
row->Add(new PopupMultiChoice((int *)&chan->level, chan->m_shortName, logLevelList, 1, 6, 0, screenManager(), new LinearLayoutParams(1.0)));
grid->Add(row);
}
}
示例15: handleTrivial
bool PlanarGridLayoutModule::handleTrivial(const Graph &G, GridLayout &gridLayout, IPoint &boundingBox)
{
// handle special case of graphs with less than 3 nodes
node v1, v2;
switch (G.numberOfNodes()) {
case 0:
boundingBox = IPoint(0, 0);
return true;
case 1:
v1 = G.firstNode();
gridLayout.x(v1) = gridLayout.y(v1) = 0;
boundingBox = IPoint(0, 0);
return true;
case 2:
v1 = G.firstNode();
v2 = G.lastNode();
gridLayout.x(v1) = gridLayout.y(v1) = gridLayout.y(v2) = 0;
gridLayout.x(v2) = 1;
boundingBox = IPoint(1, 0);
return true;
}
return false;
}