From 00080b5afbeecffbf1ba8c05903247c95d23ecab Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Sat, 15 Dec 2007 21:26:03 +0000 Subject: Initial code import. Skeleton program and makefile. git-svn-id: svn://mattst88.com/svn/calculator/trunk@2 40705d3a-cdd4-446d-8ced-669f9f7342eb --- Makefile | 16 ++++++++++++++++ calculator.cpp | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100755 Makefile create mode 100755 calculator.cpp 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 +#include + +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(); +} -- cgit v1.2.3