robertsim007: Altered project to look for files in ../src to allow for easy makefile/project creation without creating copies of the source files.

This commit is contained in:
robertsim007 2005-03-21 17:51:50 +00:00
parent f85d4ff14a
commit 12fee5e61b
12 changed files with 12 additions and 891 deletions

View File

@ -1,189 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: TorqueIDE.cpp
// Purpose: TorqueIDE Application
// Author: Based on minimal.cpp by Julian Smart
// Modified by:
// Created: 03/20/05
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// ============================================================================
// declarations
// ============================================================================
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
// for all others, include the necessary headers (this file is usually all you
// need because it includes almost all "standard" wxWindows headers)
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
// ----------------------------------------------------------------------------
// resources
// ----------------------------------------------------------------------------
// the application icon (under Windows and OS/2 it is in resources)
#if defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__) || defined(__WXMGL__) || defined(__WXX11__)
#include "mondrian.xpm"
#endif
// ----------------------------------------------------------------------------
// private classes
// ----------------------------------------------------------------------------
// Define a new application type, each program should derive a class from wxApp
class TorqueIDE : public wxApp
{
public:
// override base class virtuals
// ----------------------------
// this one is called on application startup and is a good place for the app
// initialization (doing it here and not in the ctor allows to have an error
// return: if OnInit() returns false, the application terminates)
virtual bool OnInit();
};
// Define a new frame type: this is going to be our main frame
class TorqueIDEFrame : public wxFrame
{
public:
// ctor(s)
TorqueIDEFrame(const wxString& title, const wxPoint& pos, const wxSize& size,
long style = wxDEFAULT_FRAME_STYLE);
// event handlers (these functions should _not_ be virtual)
void OnQuit(wxCommandEvent& event);
void OnAbout(wxCommandEvent& event);
private:
// any class wishing to process wxWindows events must use this macro
DECLARE_EVENT_TABLE()
};
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
// IDs for the controls and the menu commands
enum
{
// menu items
TorqueIDE_Quit = 1,
// it is important for the id corresponding to the "About" command to have
// this standard value as otherwise it won't be handled properly under Mac
// (where it is special and put into the "Apple" menu)
TorqueIDE_About = wxID_ABOUT
};
// ----------------------------------------------------------------------------
// event tables and other macros for wxWindows
// ----------------------------------------------------------------------------
// the event tables connect the wxWindows events with the functions (event
// handlers) which process them. It can be also done at run-time, but for the
// simple menu events like this the static method is much simpler.
BEGIN_EVENT_TABLE(TorqueIDEFrame, wxFrame)
EVT_MENU(TorqueIDE_Quit, TorqueIDEFrame::OnQuit)
EVT_MENU(TorqueIDE_About, TorqueIDEFrame::OnAbout)
END_EVENT_TABLE()
// Create a new application object: this macro will allow wxWindows to create
// the application object during program execution (it's better than using a
// static object for many reasons) and also declares the accessor function
// wxGetApp() which will return the reference of the right type (i.e. TorqueIDE and
// not wxApp)
IMPLEMENT_APP(TorqueIDE)
// ============================================================================
// implementation
// ============================================================================
// ----------------------------------------------------------------------------
// the application class
// ----------------------------------------------------------------------------
// 'Main program' equivalent: the program execution "starts" here
bool TorqueIDE::OnInit()
{
// create the main application window
TorqueIDEFrame *frame = new TorqueIDEFrame(_T("TorqueIDE wxWindows App"),
wxPoint(50, 50), wxSize(450, 340));
// and show it (the frames, unlike simple controls, are not shown when
// created initially)
frame->Show(TRUE);
// success: wxApp::OnRun() will be called which will enter the main message
// loop and the application will run. If we returned FALSE here, the
// application would exit immediately.
return TRUE;
}
// ----------------------------------------------------------------------------
// main frame
// ----------------------------------------------------------------------------
// frame constructor
TorqueIDEFrame::TorqueIDEFrame(const wxString& title, const wxPoint& pos, const wxSize& size, long style)
: wxFrame(NULL, -1, title, pos, size, style)
{
// set the frame icon
SetIcon(wxICON(mondrian));
#if wxUSE_MENUS
// create a menu bar
wxMenu *menuFile = new wxMenu;
// the "About" item should be in the help menu
wxMenu *helpMenu = new wxMenu;
helpMenu->Append(TorqueIDE_About, _T("&About...\tF1"), _T("Show about dialog"));
menuFile->Append(TorqueIDE_Quit, _T("E&xit\tAlt-X"), _T("Quit this program"));
// now append the freshly created menu to the menu bar...
wxMenuBar *menuBar = new wxMenuBar();
menuBar->Append(menuFile, _T("&File"));
menuBar->Append(helpMenu, _T("&Help"));
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
#endif // wxUSE_MENUS
#if wxUSE_STATUSBAR
// create a status bar just for fun (by default with 1 pane only)
CreateStatusBar(2);
SetStatusText(_T("Welcome to wxWindows!"));
#endif // wxUSE_STATUSBAR
}
// event handlers
void TorqueIDEFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
{
// TRUE is to force the frame to close
Close(TRUE);
}
void TorqueIDEFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
wxString msg;
msg.Printf( _T("This is the About dialog of the TorqueIDE application.\n")
_T("Welcome to %s"), wxVERSION_STRING);
wxMessageBox(msg, _T("About TorqueIDE"), wxOK | wxICON_INFORMATION, this);
}

View File

@ -55,35 +55,39 @@ LINK32=link.exe
# Name "TorqueIDE - Win32 Release"
# Begin Source File
SOURCE=.\TorqueIDE.rc
SOURCE=..\src\mondrian.ico
# End Source File
# Begin Source File
SOURCE=.\torqueideabout.cpp
SOURCE=..\src\TorqueIDE.rc
# End Source File
# Begin Source File
SOURCE=.\torqueideabout.h
SOURCE=..\src\torqueideabout.cpp
# End Source File
# Begin Source File
SOURCE=.\torqueideapp.cpp
SOURCE=..\src\torqueideabout.h
# End Source File
# Begin Source File
SOURCE=.\torqueideapp.h
SOURCE=..\src\torqueideapp.cpp
# End Source File
# Begin Source File
SOURCE=.\torqueideframe.cpp
SOURCE=..\src\torqueideapp.h
# End Source File
# Begin Source File
SOURCE=.\torqueideframe.h
SOURCE=..\src\torqueideframe.cpp
# End Source File
# Begin Source File
SOURCE=.\torqueidescintilla.h
SOURCE=..\src\torqueideframe.h
# End Source File
# Begin Source File
SOURCE=..\src\torqueidescintilla.h
# End Source File
# End Target
# End Project

View File

@ -1,4 +0,0 @@
mondrian ICON "mondrian.ico"
#define TORQUEIDE_QUIT 1
#define TORQUEIDE_ABOUT 102

Binary file not shown.

Before

Width:  |  Height:  |  Size: 766 B

View File

@ -1,44 +0,0 @@
/* XPM */
static char *mondrian_xpm[] = {
/* columns rows colors chars-per-pixel */
"32 32 6 1",
" c Black",
". c Blue",
"X c #00bf00",
"o c Red",
"O c Yellow",
"+ c Gray100",
/* pixels */
" ",
" oooooo +++++++++++++++++++++++ ",
" oooooo +++++++++++++++++++++++ ",
" oooooo +++++++++++++++++++++++ ",
" oooooo +++++++++++++++++++++++ ",
" oooooo +++++++++++++++++++++++ ",
" oooooo +++++++++++++++++++++++ ",
" oooooo +++++++++++++++++++++++ ",
" ",
" ++++++ ++++++++++++++++++ .... ",
" ++++++ ++++++++++++++++++ .... ",
" ++++++ ++++++++++++++++++ .... ",
" ++++++ ++++++++++++++++++ .... ",
" ++++++ ++++++++++++++++++ .... ",
" ++++++ ++++++++++++++++++ ",
" ++++++ ++++++++++++++++++ ++++ ",
" ++++++ ++++++++++++++++++ ++++ ",
" ++++++ ++++++++++++++++++ ++++ ",
" ++++++ ++++++++++++++++++ ++++ ",
" ++++++ ++++++++++++++++++ ++++ ",
" ++++++ ++++++++++++++++++ ++++ ",
" ++++++ ++++++++++++++++++ ++++ ",
" ++++++ ++++++++++++++++++ ++++ ",
" ++++++ ++++++++++++++++++ ++++ ",
" ++++++ ++++ ",
" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
" "
};

View File

@ -1,46 +0,0 @@
/*
* Torque IDE -- An open source integrated development environment for the
* Torque Game Engine
*
* Copyright (C) 2004 Robert Pierce
*
* Refer to the file CONTRIB.txt for the people who have helped.
*
* 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 2 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.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
// For compilers that supports precompilation, include "wx/wx.h"
#include <wx/wxprec.h>
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif
#include "torqueideabout.h"
TorqueIDEAbout::TorqueIDEAbout(wxWindow *parent)
: wxDialog(parent, -1, "About the Torque IDE", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE)
{
about_text = new wxStaticText(this, -1, "", wxPoint(5, 5), wxSize(100, 100), wxALIGN_CENTRE);
ok = new wxButton(this, wxID_OK, "Ok", wxPoint(5, 40));
}
void TorqueIDEAbout::SetText(const wxString& text)
{
about_text->SetLabel(text);
}

View File

@ -1,53 +0,0 @@
#ifndef _TORQUEIDEABOUT_H
#define _TORQUEIDEABOUT_H
/*
* Torque IDE -- An open source integrated development environment for the
* Torque Game Engine
*
* Copyright (C) 2004 Robert Pierce
*
* Refer to the file CONTRIB.txt for the people who have helped.
*
* 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 2 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.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
class TorqueIDEAbout : public wxDialog
{
public:
/**
* Constructor
*/
TorqueIDEAbout(wxWindow *parent);
/**
* Destructor
*/
virtual ~TorqueIDEAbout() { }
/**
* Sets the text on the dialog
*/
void SetText(const wxString& text);
private:
wxStaticText *about_text;
wxButton *ok;
};
#endif

View File

@ -1,52 +0,0 @@
/*
* Torque IDE -- An open source integrated development environment for the
* Torque Game Engine
*
* Copyright (C) 2004 Robert Pierce
*
* Refer to the file CONTRIB.txt for the people who have helped.
*
* 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 2 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.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
// For compilers that supports precompilation, include "wx/wx.h"
#include <wx/wxprec.h>
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif
#include "torqueideapp.h"
#include "torqueideframe.h"
IMPLEMENT_APP(TorqueIDEApp)
bool TorqueIDEApp::OnInit()
{
TorqueIDEFrame *frame = new TorqueIDEFrame("Torque IDE");
frame->Show(TRUE);
frame->Maximize(!frame->IsMaximized()); // If the frame is not maximized, maximize it.
// TODO: Add option to choose whether or not to max the frame.
SetTopWindow(frame);
return TRUE;
}

View File

@ -1,43 +0,0 @@
/*
* Torque IDE -- An open source integrated development environment for the
* Torque Game Engine
*
* Copyright (C) 2004 Robert Pierce
*
* Refer to the file CONTRIB.txt for the people who have helped.
*
* 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 2 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.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
#ifndef _TORQUEIDEAPP_H
#define _TORQUEIDEAPP_H
#include <wx/wx.h>
class TorqueIDEApp : public wxApp
{
public:
/**
* Think of this as the "main" method.
*/
virtual bool OnInit();
};
DECLARE_APP(TorqueIDEApp);
#endif _TORQUEIDEAPP_H

View File

@ -1,276 +0,0 @@
/*
* Torque IDE -- An open source integrated development environment for the
* Torque Game Engine
*
* Copyright (C) 2004 Robert Pierce
*
* Refer to the file CONTRIB.txt for the people who have helped.
*
* 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 2 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.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
// For compilers that support precompilation, includes "wx/wx.h"
#include <wx/wxprec.h>
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif
#include "torqueideframe.h"
TorqueIDEFrame::TorqueIDEFrame(const wxChar *title) : wxFrame((wxFrame *) NULL, -1, title)
{
scintilla = new wxStyledTextCtrl(this, -1); // Scintilla Edit
statusbar = CreateStatusBar(2); // Creates the status bar
toolbar = CreateToolBar(wxNO_BORDER | wxTB_HORIZONTAL | wxTB_3DBUTTONS); // Creates the toolbar
// Menu
menubar = new wxMenuBar();
// File Menu
menu_file = new wxMenu();
menu_file->Append(MENU_FILE_NEW, "&New", "Creates a new document");
menu_file->Append(MENU_FILE_OPEN, "&Open", "Opens an existing document");
menu_file->Append(MENU_FILE_SAVE, "&Save", "Saves the document");
menu_file->Append(MENU_FILE_SAVEAS, "Save &As", "Saves the document with a new name");
menu_file->AppendSeparator();
menu_file->Append(MENU_FILE_QUIT, "&Quit", "Quits the application; prompts to save documents");
menubar->Append(menu_file, "&File");
menu_edit = new wxMenu();
menu_edit->Append(MENU_EDIT_UNDO, "&Undo", "Undoes the last action");
menu_edit->Append(MENU_EDIT_REDO, "&Redo", "Redoes the previously undone action");
menu_edit->AppendSeparator();
menu_edit->Append(MENU_EDIT_CUT, "Cu&t", "Cuts the selection and moves it to the clipboard");
menu_edit->Append(MENU_EDIT_COPY, "&Copy", "Copies the selection to the clipboard");
menu_edit->Append(MENU_EDIT_PASTE, "&Paste", "Inserts the clipboard contents at the insertion point");
menu_edit->AppendSeparator();
menu_edit->Append(MENU_EDIT_CLEAR, "C&lear", "Clears the selection");
menubar->Append(menu_edit, "&Edit");
menu_help = new wxMenu();
menu_help->Append(MENU_HELP_ABOUT, "&About", "Displays the program information and copyright");
menu_help->AppendSeparator();
menu_help->Append(MENU_HELP_HELP, "&Help", "Displays the online documentation");
menubar->Append(menu_help, "&Help");
SetMenuBar(menubar);
// Scintilla initialization
scintilla->SetLexer(wxSTC_LEX_CPP); // use the C++ lexer since TorqueSCRIPT is almost C++.
// CPP Lexer Properties
scintilla->SetProperty("fold.comment", "1");
scintilla->SetProperty("fold.preprocessor", "1");
scintilla->SetProperty("fold.compact", "1");
// Line Numbers
scintilla->SetMarginWidth(0, 30); // turn on the linenumbers margin, set width to 30pixels
scintilla->SetMarginWidth(1, 0); // turn off the folding margin
scintilla->SetMarginType(0, 1); // set margin type to linenumbers
// Keywords
scintilla->SetKeyWords(0, wxT("break case continue datablock default else false function if for new or package return switch switch$ true and while"));
scintilla->SetKeyWords(1, wxT("OpenALInitDriver OpenALShutdownDriver OpenALRegisterExtensions"
" alGetString alxCreateSource alxSourcef alxSource3f alxSourcei"
" alxGetSourcef alxGetSource3f alxGetSourcei alxPlay alxStop"
" alxStopAll alxIsPlaying alxListener alListener3f alxGetListenerf"
" alxGetListener3f alxGetListeneri alxGetChannelVolume alxSetChannelVolume"
" dumpConsoleClasses expandFilename strcmp stricmp strlen strstr"
" strpos ltrim rtrim trim sripChars strlwr strupr strchr strreplace"
" getSubStr getWord getWords setWord removeWord getWordCount"
" getField getFields setField removeField getFieldCount getRecord"
" getRecords setRecord removeRecord getRecordCount firstWord restWords"
" detag getTag echo warn error expandEscape collapseEscape"
" quit call compile exec export deleteVariables trace debug"
" findFirstFile findNextFile getFileCount getFileCRC isFile"
" isWriteableFileName fileExt fileBase fileName filePath nextToken"
" setLogMode setEchoFileLoads backtrace isPackage activatePackage"
" deactivatePackage nameToID isObject cancel isEventPending schedule"
" deleteDataBlocks telnetSetParameters dbgSetParameters dnetSetLogging"
" setNPatch toggleNPatch increaseNPatch decreaseNPatch setFSAA"
" IncreaseFSAA decreaseFSAA setOpenGLMipReduction setOpenGLSkyMipReduction"
" setOpenGLInteriorMipReduction setOpenGLTextureCompressionHint"
" setOpenGLAnisotropy clearTextureHolds addMaterialMapping aiConnect"
" aiAddPlayer setPowerAudioProfiles calcExplosionCoverage"
" gotoWebPage deactivateDirectInput activateDirectInput strToPlayerName"
" stripTrailingSpaces setDefaultFov setZoomSpeed setFov screenShot"
" panoramaScreenShot purgeResources lightScene flushTextureCache"
" dumpTextureStats dumpResourceStats getControlObjectAltitude"
" getControlObjectSpeed containerFindFirst containerFindNext"
" snapToggle getVersionNumber getVersionString getCompileTimeString"
" getSimTime getRealTime setNetPort lockMouse rebuildModPaths"
" setModPaths getModPaths createCanvas saveJournal playJournal"
" addTaggedString removeTaggedString getTaggedString buildTaggedString"
" commandToServer commandToClient allowConnections connect localConnect"
" startRecord stopRecord playDemo isDemoRecording msg queryMasterServer"
" cancelServerQuery stopServerQuery startHeartbeat stopHeartbeat"
" getServerCount setServerInfo setShadowDetailLevel showShapeLoad showSequenceLoad"
" showTurnLeft showTurnRight showUpdateThreadControl showSelectSequence"
" showPlay showStop showSetScale showSetPos showNewThread showDeleteThread"
" showToggleRoot showToggleStick showSetCamera showSetKeyboard showSetLightDirection"
" showSetDetailSlider StripMLControlChars setInteriorRenderMode setInteriorFocusedDebug"
" isPointInside VectorAdd VectorSub VectorScale VectorNormalize VectorDot"
" VectorCross VectorDist VectorLen VectorOrthoBasis MatrixCreate"
" MatrixMultiply MatrixMulVector MatrixMulPoint getBoxCenter"
" setRandomSeed getRandomSeed getRandom MatrixCreateFromEuler mSolveQuadratic"
" mSolveCubic mSolveQuartic mFloor mCeil mFloatLength mAbs mSqrt"
" mPow mLog mSin mCos mTan mAsin mAcos mAtan mRadToDeg mDegToRad"
" ValidateMemory FreeMemoryDump dumpMemSnapshot redbookOpen redbookClose"
" redbookPlay redbookStop redbookGetTrackCount redbookGetVolume"
" redbookSetVolume redbookGetDeviceCount redbookGetDeviceName redbookGetLastError"
" videoSetGammaCorrection setDisplayDevice setScreenMode toggleFullScreen"
" isFullScreen switchBitDepth prevResolution nextResolution getResolution"
" setResolution setRes getDisplayDeviceList getResolutionList getVideoDriverInfo"
" isDeviceFullScreenOnly setVerticalSync profilerMarkerEnable profilerEnable"
" profilerDump profilerDumpToFile enableWinConsole isJoystickDetected"
" getJoystickAxes enableMouse disableMouse echoInputState toggleInputState"
" MathInit AddCardProfile addOSCardProfile getDesktopResolution activateKeyboard"
" deactivateKeyboard GLEnableLogging GLEnableOutline GLEnableMetrics"
" inputLog launchDedicatedServer isKoreanBuild debug_testx86unixmutex"
" debug_debugbreak resetLighting getMaxFrameAllocation dumpNetStringTable"
" InitContainerRadiusSearch ContainerSearchNext ContainerSearchCurrDist"
" ContainerSearchCurrRadiusDist ContainerRayCast ContainerBoxEmpty"
" pathOnMissionLoadDone makeTestTerrain getTerrainHeight")
); //end scintilla->SetKeyWords()
}
TorqueIDEFrame::~TorqueIDEFrame()
{
}
BEGIN_EVENT_TABLE(TorqueIDEFrame, wxFrame)
// File
EVT_MENU(MENU_FILE_NEW, TorqueIDEFrame::OnMenuFileNew)
EVT_MENU(MENU_FILE_OPEN, TorqueIDEFrame::OnMenuFileOpen)
EVT_MENU(MENU_FILE_SAVE, TorqueIDEFrame::OnMenuFileSave)
EVT_MENU(MENU_FILE_SAVEAS, TorqueIDEFrame::OnMenuFileSaveAs)
EVT_MENU(MENU_FILE_QUIT, TorqueIDEFrame::OnMenuFileQuit)
// Edit
EVT_MENU(MENU_EDIT_UNDO, TorqueIDEFrame::OnMenuEditUndo)
EVT_MENU(MENU_EDIT_REDO, TorqueIDEFrame::OnMenuEditRedo)
EVT_MENU(MENU_EDIT_CUT, TorqueIDEFrame::OnMenuEditCut)
EVT_MENU(MENU_EDIT_COPY, TorqueIDEFrame::OnMenuEditCopy)
EVT_MENU(MENU_EDIT_PASTE, TorqueIDEFrame::OnMenuEditPaste)
EVT_MENU(MENU_EDIT_CLEAR, TorqueIDEFrame::OnMenuEditClear)
// Help
EVT_MENU(MENU_HELP_HELP, TorqueIDEFrame::OnMenuHelpHelp)
EVT_MENU(MENU_HELP_ABOUT, TorqueIDEFrame::OnMenuHelpAbout)
END_EVENT_TABLE()
void TorqueIDEFrame::OnMenuFileNew(wxCommandEvent &event)
{
wxLogMessage("File New Menu Selected");
}
void TorqueIDEFrame::OnMenuFileOpen(wxCommandEvent &event)
{
wxFileDialog *opendlg = new wxFileDialog(this, "Open", "", "", "TorqueSCRIPT Files(*.cs)|*.cs|All files(*.*)|*.*", wxOPEN, wxDefaultPosition);
if ( opendlg->ShowModal() == wxID_OK )
{
// Debug purposes
//wxLogMessage(opendlg->GetDirectory()<<"/"<<opendlg->GetFilename());
scintilla->LoadFile(opendlg->GetDirectory()<<"/"<<opendlg->GetFilename());
scintilla->SetSavePoint();
SetStatusText(opendlg->GetFilename(), 1);
}
opendlg->Destroy();
}
void TorqueIDEFrame::OnMenuFileSave(wxCommandEvent &event)
{
if(scintilla->GetModify())
{
wxLogMessage("File is modified!");
scintilla->SetSavePoint();
}
}
void TorqueIDEFrame::OnMenuFileSaveAs(wxCommandEvent &event)
{
wxFileDialog *savedlg = new wxFileDialog(this, "Save As", "", "", "TorqueSCRIPT Files(*.cs)|*.cs|All files(*.*)|*.*", wxSAVE, wxDefaultPosition);
if ( savedlg->ShowModal() == wxID_OK )
{
// Debug purposes
//wxLogMessage(savedlg->GetDirectory()<<"/"<<savedlg->GetFilename());
scintilla->SaveFile(savedlg->GetDirectory()<<"/"<<savedlg->GetFilename());
scintilla->SetSavePoint();
SetStatusText(savedlg->GetFilename(), 1);
}
savedlg->Destroy();
}
void TorqueIDEFrame::OnMenuFileQuit(wxCommandEvent &event)
{
Close(FALSE);
}
void TorqueIDEFrame::OnMenuEditUndo(wxCommandEvent &event)
{
if(scintilla->CanUndo())
{
scintilla->Undo();
}
else
{
wxBell();
}
}
void TorqueIDEFrame::OnMenuEditRedo(wxCommandEvent &event)
{
if(scintilla->CanRedo())
{
scintilla->Redo();
}
else
{
wxBell();
}
}
void TorqueIDEFrame::OnMenuEditCut(wxCommandEvent &event)
{
scintilla->Cut();
}
void TorqueIDEFrame::OnMenuEditCopy(wxCommandEvent &event)
{
scintilla->Copy();
}
void TorqueIDEFrame::OnMenuEditPaste(wxCommandEvent &event)
{
if(scintilla->CanPaste())
{
scintilla->Paste();
}
else
{
return;
}
}
void TorqueIDEFrame::OnMenuEditClear(wxCommandEvent &event)
{
scintilla->Clear();
}
void TorqueIDEFrame::OnMenuHelpHelp(wxCommandEvent &event)
{
wxLogMessage("Help Help Menu Selected");
}
void TorqueIDEFrame::OnMenuHelpAbout(wxCommandEvent &event)
{
wxLogMessage("Help About Menu Selected");
}

View File

@ -1,140 +0,0 @@
#ifndef _TORQUEIDEFRAME_H
#define _TORQUEIDEFRAME_H
/*
* Torque IDE -- An open source integrated development environment for the
* Torque Game Engine
*
* Copyright (C) 2004 Robert Pierce
*
* Refer to the file CONTRIB.txt for the people who have helped.
*
* 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 2 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.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
#include <wx/frame.h>
#include <wx/stc/stc.h>
class TorqueIDEFrame : public wxFrame
{
public:
/**
* Constructor
*/
TorqueIDEFrame( const wxChar *title );
/**
* Destructor
*/
~TorqueIDEFrame();
/**
* Processes menu File|New
*/
void OnMenuFileNew(wxCommandEvent &event);
/**
* Processes menu File|Open
*/
void OnMenuFileOpen(wxCommandEvent &event);
/**
* Processes menu File|Save
*/
void OnMenuFileSave(wxCommandEvent &event);
/**
* Processes menu File|Save As
*/
void OnMenuFileSaveAs(wxCommandEvent &event);
/**
* Processes menu File|Quit
*/
void OnMenuFileQuit(wxCommandEvent &event);
/**
* Processes menu Edit|Undo
*/
void OnMenuEditUndo(wxCommandEvent &event);
/**
* Processes menu Edit|Redo
*/
void OnMenuEditRedo(wxCommandEvent &event);
/**
* Processes menu Edit|Cut
*/
void OnMenuEditCut(wxCommandEvent &event);
/**
* Processes menu Edit|Copy
*/
void OnMenuEditCopy(wxCommandEvent &event);
/**
* Processes menu Edit|Paste
*/
void OnMenuEditPaste(wxCommandEvent &event);
/**
* Processes menu Edit|Clear
*/
void OnMenuEditClear(wxCommandEvent &event);
/**
* Processes menu Help|Help
*/
void OnMenuHelpHelp(wxCommandEvent &event);
/**
* Processes menu Help|About
*/
void OnMenuHelpAbout(wxCommandEvent &event);
protected:
DECLARE_EVENT_TABLE()
private:
wxStyledTextCtrl *scintilla;
wxStatusBar *statusbar;
wxToolBar *toolbar;
wxMenuBar *menubar;
wxMenu *menu_file;
wxMenu *menu_edit;
wxMenu *menu_help;
enum
{
MENU_FILE_NEW,
MENU_FILE_OPEN,
MENU_FILE_SAVE,
MENU_FILE_SAVEAS,
MENU_FILE_QUIT,
MENU_EDIT_UNDO,
MENU_EDIT_REDO,
MENU_EDIT_CUT,
MENU_EDIT_COPY,
MENU_EDIT_PASTE,
MENU_EDIT_CLEAR,
MENU_HELP_ABOUT,
MENU_HELP_HELP
};
};
#endif _TORQUEIDEFRAME_H

View File

@ -1,36 +0,0 @@
/*
* Torque IDE -- An open source integrated development environment for the
* Torque Game Engine
*
* Copyright (C) 2004 Robert Pierce
*
* Refer to the file CONTRIB.txt for the people who have helped.
*
* 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 2 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.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
#ifndef _TORQUEIDESCINTILLA_H
#define _TORQUEIDESCINTILLA_H
#include <wx/stc/stc.h>
// TorqueSCRIPT keywords
const wxString torquescript_primary = "break case continue datablock default else false function if for new or package return switch switch$ true and while"; // Primary TorqueSCRIPT keywords
const wxString torquescript_secondary = "dumpConsoleClasses expandFilename strcmp stricmp strlen strstr strpos ltrim rtrim trim sripChars strlwr strupr strchr strreplace getSubStr getWord getWords setWord removeWord getWordCount getField getFields setField removeField getFieldCount getRecord getRecords setRecord removeRecord getRecordCount firstWord restWords detag getTag echo warn error expandEscape collapseEscape quit call compile exec export deleteVariables trace debug findFirstFile findNextFile getFileCount getFileCRC isFile isWriteableFileName fileExt fileBase fileName filePath nextToken setLogMode setEchoFileLoads backtrace isPackage activatePackage deactivatePackage nameToID isObject cancel isEventPending schedule"; // Secondary TorqueSCRIPT keywords
#endif _TORQUEIDESCINTILLA_H