summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xMakefile16
-rwxr-xr-xcalculator.cpp55
2 files changed, 71 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100755
index 0000000..47bd57a
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,16 @@
+CPP=g++
+CFLAGS=-O2
+LDFLAGS=-los
+
+EXE=calculator.app
+
+OBJS=calculator.o
+
+all: ${OBJS}
+ ${CPP} ${LDFLAGS} ${OBJS} -o ${EXE}
+
+%.o: %.cpp
+ ${CPP} ${CFLAGS} -c -o $@ $<
+
+clean:
+ rm ${OBJS} ${EXE} \ No newline at end of file
diff --git a/calculator.cpp b/calculator.cpp
new file mode 100755
index 0000000..d8bae40
--- /dev/null
+++ b/calculator.cpp
@@ -0,0 +1,55 @@
+#include <gui/ApplicationWindow.h>
+#include <gui/Application.h>
+
+using namespace SkyGI;
+
+class MyApp : public Application
+{
+public:
+ MyApp(int argc, char *argv[]);
+};
+
+class MyApplicationWindow : public ApplicationWindow
+{
+public:
+ MyApplicationWindow(const Rect &rFrame, const String& szTitle, unsigned int nWindowLayoutFlags, unsigned int uiFlags = 0);
+ void OnCommand(const MessageCommand *pMessage);
+
+};
+
+
+MyApplicationWindow::MyApplicationWindow(const Rect &rFrame,
+ const String& szTitle, unsigned int nWindowLayoutFlags, unsigned int uiFlags):
+ ApplicationWindow(rFrame, szTitle, nWindowLayoutFlags)
+{
+}
+
+void MyApplicationWindow::OnCommand(const MessageCommand *pMessage)
+{
+ switch (pMessage->GetID())
+ {
+ default:
+ break;
+ }
+}
+
+
+MyApp::MyApp(int argc, char* argv[]) : Application("application/x-vnd.Calculator", argc, argv)
+{
+ Rect r(Point(100, 100), Point(400, 300));
+
+ MyApplicationWindow* pApplicationWindow = new MyApplicationWindow(r, "Calculator", WINDOW_LAYOUT_NOTHING, APPLICATION_WINDOW_NO_VIEW);
+
+// pApplicationWindow->AddStatusBar();
+ pApplicationWindow->GetTitleWindow()->SetFlags( (TitleWindowFlags)(pApplicationWindow->GetTitleWindow()->GetFlags() ));
+
+ pApplicationWindow->Show();
+
+}
+
+int main(int argc, char *argv[])
+{
+ MyApp pApp(argc, argv);
+
+ return pApp.Run();
+}