Browse Source

BAB-10 #time 2h #comment only classes #close

master
oyvang 11 years ago
parent
commit
14b5c71421
  1. 1
      contributors.txt
  2. 20
      juci/CMakeLists.txt
  3. 17
      juci/controller.h
  4. 9
      juci/juci.cc
  5. 17
      juci/model.h
  6. 19
      juci/view.cc
  7. 28
      juci/view.h

1
contributors.txt

@ -1 +0,0 @@
Geir Morten Larsen

20
juci/CMakeLists.txt

@ -0,0 +1,20 @@
cmake_minimum_required (VERSION 2.8.4)
project (juci)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
INCLUDE(FindPkgConfig)
# name of the executable on Windows will be example.exe
add_executable(juci
# list of every needed file to create the executable
juci.cc
controller.h
model.h
view.h
view.cc)
# dependencies
pkg_check_modules(GTKMM REQUIRED gtkmm-3.0)
include_directories(${GTKMM_INCLUDE_DIRS} )
link_directories(${GTKMM_LIBRARY_DIRS})
target_link_libraries(juci ${GTKMM_LIBRARIES})

17
juci/controller.h

@ -0,0 +1,17 @@
/*juCi++ controller header file*/
#ifndef CONTROLLER_H
#define CONTROLLER_H
#include "model.h"
/* -------------------------- HOW TO -------------------------- */
/* Controll classes under Controller->public */
/* Model object under Controller::class->private */
/* ------------------ Remove these comments ------------------- */
class Controller {
public:
};
#endif //CONTROLLER_H

9
juci/juci.cc

@ -0,0 +1,9 @@
#include "view.h"
int main (int argc, char *argv[]) {
Glib::RefPtr <Gtk::Application> app = Gtk::Application::create(argc, argv, "org.bachelor.juci");
View view;
return app->run(view);
}

17
juci/model.h

@ -0,0 +1,17 @@
/*juCi++ model header file*/
#ifndef MODEL_H
#define MODEL_H
#include <iostream>
/* -------------------------- HOW TO -------------------------- */
/* Model classes under Model->public if they are going to be */
/* used from controllers */
/* ------------------ Remove these comments ------------------- */
class Model {
public:
};
#endif //MODEL_H

19
juci/view.cc

@ -0,0 +1,19 @@
#include "view.h"
View::View() :
window_box(Gtk::ORIENTATION_VERTICAL){
set_title("juCi++");
set_default_size(800, 600);
maximize();
add(window_box);
/*Add default views here */
show_all_children();
};
View::~View() {
}

28
juci/view.h

@ -0,0 +1,28 @@
/*juCi++ view header file*/
#ifndef VIEW_H
#define VIEW_H
#include <iostream>
#include "gtkmm.h"
#include "controller.h"
/* -------------------------- HOW TO -------------------------- */
/* All view shall be under View->private if possible */
/* View objects under View->protected */
/* View controller object under View::class->private */
/* ------------------ Remove these comments ------------------- */
class View : public Gtk::Window {
public:
View();
virtual ~View();
protected:
Gtk::Box window_box;
private:
};
#endif // VIEW_H
Loading…
Cancel
Save