-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added simple calculator tab view layout
- Loading branch information
Showing
12 changed files
with
256 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#pragma once | ||
|
||
#include <borealis.hpp> | ||
|
||
struct CalculatorTab : public brls::Box | ||
{ | ||
CalculatorTab(); | ||
|
||
static brls::View* create(); | ||
|
||
private: | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#pragma once | ||
|
||
#include <borealis.hpp> | ||
|
||
struct MainActivity : public brls::Activity | ||
{ | ||
CONTENT_FROM_XML_RES("activity/main.xml") | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
shaders/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"title": "Calculator_NX Rewrite", | ||
|
||
"tabs": { | ||
"calculator": "Calculator", | ||
"settings": "Settings", | ||
"about": "About Calculator_NX" | ||
}, | ||
|
||
"calculator": { | ||
"expression_enter": "Enter an expression" | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<brls:TabFrame | ||
title="@i18n/text/title" | ||
iconInterpolation="linear" | ||
icon="@res/icon/Calculator_NX_Icon_Alt.jpg"> | ||
|
||
<brls:Tab label="@i18n/text/tabs/calculator"> | ||
<CalculatorTab /> | ||
</brls:Tab> | ||
|
||
<brls:Tab label="@i18n/text/tabs/settings"/> | ||
|
||
<brls:Separator/> | ||
|
||
<brls:Tab label="@i18n/text/tabs/about"/> | ||
|
||
</brls:TabFrame> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,179 @@ | ||
<brls:Box | ||
width="auto" | ||
height="auto" | ||
axis="column"> | ||
|
||
<brls:Box | ||
width="500" | ||
height="500" | ||
axis="column"> | ||
|
||
<brls:Box | ||
width="100%" | ||
height="20%"> | ||
|
||
<brls:Label | ||
width="auto" | ||
height="auto" | ||
text="@i18n/text/calculator/expression_enter" | ||
fontSize="25"/> | ||
|
||
</brls:Box> | ||
|
||
<brls:Box | ||
width="100%" | ||
height="80%"> | ||
|
||
<brls:Box | ||
width="20%" | ||
height="100%" | ||
axis="column"> | ||
|
||
<brls:Button | ||
width="auto" | ||
height="auto" | ||
style="primary" | ||
text="("/> | ||
|
||
<brls:Button | ||
width="auto" | ||
height="auto" | ||
style="primary" | ||
text=")"/> | ||
|
||
</brls:Box> | ||
|
||
<brls:Box | ||
width="20%" | ||
height="100%" | ||
axis="column"> | ||
|
||
<brls:Button | ||
width="auto" | ||
height="auto" | ||
style="primary" | ||
text="9"/> | ||
|
||
<brls:Button | ||
width="auto" | ||
height="auto" | ||
style="primary" | ||
text="6"/> | ||
|
||
<brls:Button | ||
width="auto" | ||
height="auto" | ||
style="primary" | ||
text="3"/> | ||
|
||
<brls:Button | ||
width="auto" | ||
height="auto" | ||
style="primary" | ||
text="0"/> | ||
|
||
</brls:Box> | ||
|
||
<brls:Box | ||
width="20%" | ||
height="100%" | ||
axis="column"> | ||
|
||
<brls:Button | ||
width="auto" | ||
height="auto" | ||
style="primary" | ||
text="8"/> | ||
|
||
<brls:Button | ||
width="auto" | ||
height="auto" | ||
style="primary" | ||
text="5"/> | ||
|
||
<brls:Button | ||
width="auto" | ||
height="auto" | ||
style="primary" | ||
text="2"/> | ||
|
||
<brls:Button | ||
width="auto" | ||
height="auto" | ||
style="primary" | ||
text="."/> | ||
|
||
</brls:Box> | ||
|
||
<brls:Box | ||
width="20%" | ||
height="100%" | ||
axis="column"> | ||
|
||
<brls:Button | ||
width="auto" | ||
height="auto" | ||
style="primary" | ||
text="7"/> | ||
|
||
<brls:Button | ||
width="auto" | ||
height="auto" | ||
style="primary" | ||
text="4"/> | ||
|
||
<brls:Button | ||
width="auto" | ||
height="auto" | ||
style="primary" | ||
text="1"/> | ||
|
||
<brls:Rectangle | ||
width="auto" | ||
height="auto" | ||
color="#000000"/> | ||
|
||
</brls:Box> | ||
|
||
<brls:Box | ||
width="20%" | ||
height="100%" | ||
axis="column"> | ||
|
||
<brls:Button | ||
width="auto" | ||
height="auto" | ||
style="primary" | ||
text="+"/> | ||
|
||
<brls:Button | ||
width="auto" | ||
height="auto" | ||
style="primary" | ||
text="-"/> | ||
|
||
<brls:Button | ||
width="auto" | ||
height="auto" | ||
style="primary" | ||
text="*"/> | ||
|
||
<brls:Button | ||
width="auto" | ||
height="auto" | ||
style="primary" | ||
text="/"/> | ||
|
||
<brls:Button | ||
width="auto" | ||
height="auto" | ||
style="primary" | ||
text="="/> | ||
|
||
</brls:Box> | ||
|
||
</brls:Box> | ||
|
||
</brls:Box> | ||
|
||
</brls:Box> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#include <calculatorTab.hpp> | ||
|
||
CalculatorTab::CalculatorTab() | ||
{ | ||
this->inflateFromXMLRes("xml/tabs/calculator.xml"); | ||
} | ||
|
||
brls::View* CalculatorTab::create() | ||
{ | ||
return new CalculatorTab(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,24 @@ | ||
#include <borealis.hpp> | ||
|
||
#include <vector> | ||
#include <stdlib.h> | ||
#include <calculatorTab.hpp> | ||
#include <mainActivity.hpp> | ||
|
||
#include <calculator.hpp> | ||
using namespace brls::literals; | ||
|
||
int main(int argc, char *argv[]) | ||
{ | ||
if (!brls::Application::init()) | ||
{ | ||
brls::Logger::error("Unable to init Borealis application"); | ||
return EXIT_FAILURE; | ||
} | ||
brls::Application::createWindow("Calculator_NX rewrite"); | ||
brls::Application::setGlobalQuit(true); | ||
|
||
brls::Application::registerXMLView("CalculatorTab", CalculatorTab::create); | ||
brls::Application::pushActivity(new MainActivity()); | ||
|
||
while (brls::Application::mainLoop()); | ||
|
||
return EXIT_SUCCESS; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#include <mainActivity.hpp> |