Skip to content

Commit

Permalink
added new edit box class
Browse files Browse the repository at this point in the history
main window now creates an edit box instance and makes it the central
widget
  • Loading branch information
thunder422 committed Dec 29, 2012
1 parent 5979939 commit de0ec4e
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Expand Up @@ -141,6 +141,7 @@ set(ibcp_HEADERS
set(ibcp_SOURCES
commandhandlers.cpp
commandline.cpp
editbox.cpp
main.cpp
mainwindow.cpp
parser.cpp
Expand All @@ -153,6 +154,7 @@ set(ibcp_SOURCES

# list the header files containing QOBJECT
set(ibcp_MOC_SOURCES
editbox.h
mainwindow.h
)
qt4_wrap_cpp(ibcp_MOCS ${ibcp_MOC_SOURCES})
Expand Down
33 changes: 33 additions & 0 deletions editbox.cpp
@@ -0,0 +1,33 @@
// vim:ts=4:sw=4:
//
// Interactive BASIC Compiler Project
// File: editbox.h - edit box functions
// Copyright (C) 2012 Thunder422
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// For a copy of the GNU General Public License,
// see <http://www.gnu.org/licenses/>.
//
//
// Change History:
//
// 2012-12-29 initial version

#include "editbox.h"

EditBox::EditBox(QWidget *parent) :
QTextEdit(parent)
{
}


// end: editbox.cpp
42 changes: 42 additions & 0 deletions editbox.h
@@ -0,0 +1,42 @@
// vim:ts=4:sw=4:
//
// Interactive BASIC Compiler Project
// File: editbox.h - edit box header file
// Copyright (C) 2012 Thunder422
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// For a copy of the GNU General Public License,
// see <http://www.gnu.org/licenses/>.
//
//
// Change History:
//
// 2012-12-29 initial version

#ifndef EDITBOX_H
#define EDITBOX_H

#include <QTextEdit>

class EditBox : public QTextEdit
{
Q_OBJECT
public:
explicit EditBox(QWidget *parent = 0);

signals:

public slots:

};

#endif // EDITBOX_H
6 changes: 6 additions & 0 deletions mainwindow.cpp
Expand Up @@ -31,6 +31,7 @@
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "commandline.h"
#include "editbox.h"

MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
Expand All @@ -51,6 +52,11 @@ MainWindow::MainWindow(QWidget *parent) :
createMenus();
settingsRestore();
setWindowTitle("IBCP");

// create the starting program edit box
m_editBox = new EditBox;
setCentralWidget(m_editBox);

m_guiActive = true;
}

Expand Down
3 changes: 3 additions & 0 deletions mainwindow.h
Expand Up @@ -32,6 +32,7 @@ class MainWindow;
}

class CommandLine;
class EditBox;

class MainWindow : public QMainWindow
{
Expand Down Expand Up @@ -73,6 +74,8 @@ private slots:

QMenu *m_menuFile;
QMenu *m_menuHelp;

EditBox *m_editBox;
};

#endif // MAINWINDOW_H

0 comments on commit de0ec4e

Please sign in to comment.