Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
netrunner
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Odilitime
netrunner
Commits
d533740b
Commit
d533740b
authored
7 years ago
by
Odilitime
Browse files
Options
Downloads
Patches
Plain Diff
typeOfComponent() detect new tab type, auto bind component built to the page
parent
459c3e6a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/graphics/components/ComponentBuilder.cpp
+9
-0
9 additions, 0 deletions
src/graphics/components/ComponentBuilder.cpp
src/graphics/components/ComponentBuilder.h
+1
-0
1 addition, 0 deletions
src/graphics/components/ComponentBuilder.h
with
10 additions
and
0 deletions
src/graphics/components/ComponentBuilder.cpp
+
9
−
0
View file @
d533740b
...
...
@@ -89,10 +89,15 @@ std::shared_ptr<Component> ComponentBuilder::build(const std::shared_ptr<Node> n
// set our type
component
->
isInline
=
isInline
;
// need to bind it to the page
component
->
boundToPage
=
true
;
// place us in tree
component
->
setParent
(
parentComponent
);
if
(
parentComponent
)
{
parentComponent
->
children
.
push_back
(
component
);
}
else
{
std
::
cout
<<
"componentBuilder::build - no parentComponent for "
<<
typeOfComponent
(
component
)
<<
std
::
endl
;
}
// figure out our position, size, texture
...
...
@@ -108,9 +113,13 @@ std::shared_ptr<Component> ComponentBuilder::build(const std::shared_ptr<Node> n
return
component
;
}
// these aren't used in any elements yet
#include
"DocumentComponent.h"
#include
"TabbedComponent.h"
std
::
string
typeOfComponent
(
const
std
::
shared_ptr
<
Component
>
&
component
)
{
TabbedComponent
*
tabComponent
=
dynamic_cast
<
TabbedComponent
*>
(
component
.
get
());
if
(
tabComponent
)
return
"tab"
;
DocumentComponent
*
docComponent
=
dynamic_cast
<
DocumentComponent
*>
(
component
.
get
());
if
(
docComponent
)
return
"doc"
;
TextComponent
*
textComponent
=
dynamic_cast
<
TextComponent
*>
(
component
.
get
());
...
...
This diff is collapsed.
Click to expand it.
src/graphics/components/ComponentBuilder.h
+
1
−
0
View file @
d533740b
...
...
@@ -30,6 +30,7 @@ public:
std
::
shared_ptr
<
Component
>
build
(
const
std
::
shared_ptr
<
Node
>
node
,
const
std
::
shared_ptr
<
Component
>
&
parentComponent
,
int
windowWidth
,
int
windowHeight
);
};
// getComponentType
std
::
string
typeOfComponent
(
const
std
::
shared_ptr
<
Component
>
&
component
);
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment