robertsim007: Updated various features and made it more "modular". Also, updated icons from the default "Mondrian" to the Torque icon (to be edited later).
This commit is contained in:
parent
0932036b7a
commit
fdaa94a018
|
@ -1,4 +1,9 @@
|
|||
mondrian ICON "mondrian.ico"
|
||||
torque ICON "torque.ico"
|
||||
|
||||
// Makes the exe larger, but it includes
|
||||
// standard icons and cursors
|
||||
#if defined(_WIN32_)
|
||||
#include "wx/msw/wx.rc"
|
||||
#endif
|
||||
|
||||
|
||||
#define TORQUEIDE_QUIT 1
|
||||
#define TORQUEIDE_ABOUT 102
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 766 B |
|
@ -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 ++++ ",
|
||||
" "
|
||||
};
|
Binary file not shown.
After Width: | Height: | Size: 4.2 KiB |
|
@ -0,0 +1,83 @@
|
|||
/* XPM */
|
||||
static char * torque_xpm[] = {
|
||||
"32 32 48 1",
|
||||
" c None",
|
||||
". c #4D4D4D",
|
||||
"+ c #424242",
|
||||
"@ c #333366",
|
||||
"# c #ADA990",
|
||||
"$ c #868686",
|
||||
"% c #777777",
|
||||
"& c #CCCCCC",
|
||||
"* c #969696",
|
||||
"= c #336666",
|
||||
"- c #393939",
|
||||
"; c #FFFF66",
|
||||
"> c #FFCC33",
|
||||
", c #FF9933",
|
||||
"' c #CC6600",
|
||||
") c #D7D7D7",
|
||||
"! c #F1F1F1",
|
||||
"~ c #A0A0A4",
|
||||
"{ c #FFCC66",
|
||||
"] c #993333",
|
||||
"^ c #C0C0C0",
|
||||
"/ c #EAEAEA",
|
||||
"( c #CCCC66",
|
||||
"_ c #CC9933",
|
||||
": c #CC3300",
|
||||
"< c #993300",
|
||||
"[ c #CC9900",
|
||||
"} c #5F5F5F",
|
||||
"| c #CCCC33",
|
||||
"1 c #FF9900",
|
||||
"2 c #B2B2B2",
|
||||
"3 c #666666",
|
||||
"4 c #996633",
|
||||
"5 c #666699",
|
||||
"6 c #999999",
|
||||
"7 c #DDDDDD",
|
||||
"8 c #E3E3E3",
|
||||
"9 c #9999CC",
|
||||
"0 c #99CCCC",
|
||||
"a c #A6CAF0",
|
||||
"b c #FFFFFF",
|
||||
"c c #6699CC",
|
||||
"d c #336699",
|
||||
"e c #669999",
|
||||
"f c #555555",
|
||||
"g c #339999",
|
||||
"h c #1C1C1C",
|
||||
"i c #040404",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" .+@@ #$%% ",
|
||||
" .&*@=@-@ #;;>,' ",
|
||||
" )!~-====@ #;{>>,'] ",
|
||||
" ^/^@=====@ #(;>>>_':< ",
|
||||
" ~/&+=====@ #{>>>,[':< ",
|
||||
" ~!/}@=====@ $>>|%1[::< ",
|
||||
" $2~3++++++%%%4_[3%'::< ",
|
||||
" ===56^&))7777878))&/)%:< ",
|
||||
" ===90aa7788/!!!bbbbbbbbb)% ",
|
||||
" ==c900aaa)88!!bbbbbbbbbbbbb7% ",
|
||||
"dccc90aaaa^~$%%%%%%%%%%%%&&)!8$ ",
|
||||
"5ccccce$6%$2^-======= %%%$$$ ",
|
||||
"5c55*2&8b^^//3===dddd ",
|
||||
"@5^/bbbbb!28/$===dddd= ",
|
||||
" $$$$^&)7&28/*@dddddd= ",
|
||||
" $$$$$6/82@ddddddd ",
|
||||
" */7)=ddddddd= ",
|
||||
" $/)7fddddddd@ ",
|
||||
" $7)83ddddddgd ",
|
||||
" $77/$ddddddgd= ",
|
||||
" $)7/$=dddddee= ",
|
||||
" $&8/~=dddggcc= ",
|
||||
" $^/8^=dddddd5=== ",
|
||||
" hhhhhiihhhhhhhhhhhhhhhhhhii=",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" "};
|
|
@ -2,7 +2,7 @@
|
|||
* Torque IDE -- An open source integrated development environment for the
|
||||
* Torque Game Engine
|
||||
*
|
||||
* Copyright (C) 2004 Robert Pierce
|
||||
* Copyright (C) 2005 Robert Pierce
|
||||
*
|
||||
* Refer to the file CONTRIB.txt for the people who have helped.
|
||||
*
|
||||
|
@ -36,11 +36,32 @@
|
|||
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));
|
||||
SetAutoLayout(TRUE);
|
||||
|
||||
wxLayoutConstraints *layout = new wxLayoutConstraints();
|
||||
layout->top.SameAs(this, wxTop, 10);
|
||||
layout->centreX.SameAs(this, wxCentreX);
|
||||
layout->width.AsIs();
|
||||
layout->height.AsIs();
|
||||
|
||||
aboutText = new wxStaticText(this, -1, "", wxPoint(-1, -1), wxDefaultSize, wxALIGN_CENTER);
|
||||
aboutText->SetConstraints(layout);
|
||||
|
||||
layout = new wxLayoutConstraints();
|
||||
layout->top.Below(aboutText, 10);
|
||||
layout->centreX.SameAs(this, wxCentreX);
|
||||
layout->width.PercentOf(this, wxWidth, 80);
|
||||
layout->height.AsIs();
|
||||
|
||||
ok = new wxButton(this, wxID_OK, "Ok", wxPoint(-1, -1));
|
||||
ok->SetConstraints(layout);
|
||||
|
||||
Layout();
|
||||
}
|
||||
|
||||
void TorqueIDEAbout::SetText(const wxString& text)
|
||||
{
|
||||
about_text->SetLabel(text);
|
||||
aboutText->SetLabel(text);
|
||||
|
||||
Layout(); // This command could have messed with the layout, so redo.
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
* Torque IDE -- An open source integrated development environment for the
|
||||
* Torque Game Engine
|
||||
*
|
||||
* Copyright (C) 2004 Robert Pierce
|
||||
* Copyright (C) 2005 Robert Pierce
|
||||
*
|
||||
* Refer to the file CONTRIB.txt for the people who have helped.
|
||||
*
|
||||
|
@ -45,7 +45,7 @@ class TorqueIDEAbout : public wxDialog
|
|||
void SetText(const wxString& text);
|
||||
|
||||
private:
|
||||
wxStaticText *about_text;
|
||||
wxStaticText *aboutText;
|
||||
wxButton *ok;
|
||||
|
||||
};
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* Torque IDE -- An open source integrated development environment for the
|
||||
* Torque Game Engine
|
||||
*
|
||||
* Copyright (C) 2004 Robert Pierce
|
||||
* Copyright (C) 2005 Robert Pierce
|
||||
*
|
||||
* Refer to the file CONTRIB.txt for the people who have helped.
|
||||
*
|
||||
|
@ -40,13 +40,19 @@ bool TorqueIDEApp::OnInit()
|
|||
{
|
||||
TorqueIDEFrame *frame = new TorqueIDEFrame("Torque IDE");
|
||||
|
||||
frame->Layout();
|
||||
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.
|
||||
// frame->Maximize(!frame->IsMaximized()); // If the frame is not maximized, maximize it.
|
||||
|
||||
SetTopWindow(frame);
|
||||
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int TorqueIDEApp::OnExit()
|
||||
{
|
||||
// TODO: Delete special global stuff here
|
||||
return 0;
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
* Torque IDE -- An open source integrated development environment for the
|
||||
* Torque Game Engine
|
||||
*
|
||||
* Copyright (C) 2004 Robert Pierce
|
||||
* Copyright (C) 2005 Robert Pierce
|
||||
*
|
||||
* Refer to the file CONTRIB.txt for the people who have helped.
|
||||
*
|
||||
|
@ -31,11 +31,22 @@
|
|||
|
||||
class TorqueIDEApp : public wxApp
|
||||
{
|
||||
friend class TorqueIDEFrame;
|
||||
friend class TorqueIDEAbout;
|
||||
|
||||
public:
|
||||
/**
|
||||
* Think of this as the "main" method.
|
||||
*/
|
||||
virtual bool OnInit();
|
||||
|
||||
/**
|
||||
* Think of this as a destructor.
|
||||
*/
|
||||
virtual int OnExit();
|
||||
|
||||
private:
|
||||
TorqueIDEFrame *frame;
|
||||
};
|
||||
|
||||
DECLARE_APP(TorqueIDEApp);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* Torque IDE -- An open source integrated development environment for the
|
||||
* Torque Game Engine
|
||||
*
|
||||
* Copyright (C) 2004 Robert Pierce
|
||||
* Copyright (C) 2005 Robert Pierce
|
||||
*
|
||||
* Refer to the file CONTRIB.txt for the people who have helped.
|
||||
*
|
||||
|
@ -31,41 +31,31 @@
|
|||
#include <wx/wx.h>
|
||||
#endif
|
||||
|
||||
#include "torqueideframe.h"
|
||||
#include <wx/stc/stc.h>
|
||||
|
||||
TorqueIDEFrame::TorqueIDEFrame(const wxChar *title) : wxFrame((wxFrame *) NULL, -1, title)
|
||||
// For Windows and OS/2, icon is a resource.
|
||||
#if defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__) || defined(__WXMGL__) || defined(__WXX11__)
|
||||
#include "torque.xpm"
|
||||
#endif
|
||||
|
||||
#define TORQUEIDE_VER _T("0.25 Alpha") // The current version of the torque-ide using the wxWidgets "_T" macro
|
||||
#define TORQUEIDE_BUILD __DATE__ // The build date, set to the current date.
|
||||
|
||||
#include "torqueideframe.h"
|
||||
#include "torqueideabout.h"
|
||||
|
||||
TorqueIDEFrame::TorqueIDEFrame(const wxString &title) : wxFrame ((wxFrame *)NULL, wxID_ANY, title, wxDefaultPosition, wxSize(750,550), wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE)
|
||||
{
|
||||
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");
|
||||
|
||||
// StatusBar
|
||||
InitStatusBar();
|
||||
|
||||
// ToolBar
|
||||
InitToolBar();
|
||||
|
||||
SetMenuBar(menubar);
|
||||
// Menu
|
||||
InitMenu();
|
||||
|
||||
// Scintilla initialization
|
||||
scintilla->SetLexer(wxSTC_LEX_CPP); // use the C++ lexer since TorqueSCRIPT is almost C++.
|
||||
|
@ -147,6 +137,81 @@ TorqueIDEFrame::~TorqueIDEFrame()
|
|||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct MenuBar and Menus
|
||||
*/
|
||||
void TorqueIDEFrame::InitMenu()
|
||||
{
|
||||
wxMenu *menu_file;
|
||||
wxMenu *menu_edit;
|
||||
wxMenu *menu_search;
|
||||
wxMenu *menu_help;
|
||||
|
||||
menubar = new wxMenuBar();
|
||||
|
||||
// File
|
||||
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");
|
||||
|
||||
// Edit
|
||||
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");
|
||||
menu_edit->Append(MENU_EDIT_SELECTALL, "Select A&ll", "Selects the entire document");
|
||||
menu_edit->Append(MENU_EDIT_SELECTLINE, "Select Lin&e", "Selects the current line");
|
||||
menubar->Append(menu_edit, "&Edit");
|
||||
|
||||
// Search
|
||||
menu_search = new wxMenu();
|
||||
menu_search->Append(MENU_SEARCH_FIND, "&Find", "Finds the specified text");
|
||||
menu_search->Append(MENU_SEARCH_FINDNEXT, "Find &Next", "Finds the next occurence of the specified text");
|
||||
menu_search->Append(MENU_SEARCH_REPLACE, "&Replace", "Replaces the specified text with different text");
|
||||
menu_search->Append(MENU_SEARCH_REPLACENEXT, "R&eplace Next", "Replaces the next occurence of the specified text");
|
||||
menu_search->AppendSeparator();
|
||||
menu_search->Append(MENU_SEARCH_GOTO, "&Goto", "Goto the specified line");
|
||||
menubar->Append(menu_search, "&Search");
|
||||
|
||||
// Help
|
||||
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); // Make this the TorqueIDE's menubar
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct ToolBar and Buttons
|
||||
*/
|
||||
void TorqueIDEFrame::InitToolBar()
|
||||
{
|
||||
toolbar = CreateToolBar(wxNO_BORDER | wxTB_HORIZONTAL | wxTB_3DBUTTONS);
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct StatusBar
|
||||
*/
|
||||
void TorqueIDEFrame::InitStatusBar()
|
||||
{
|
||||
statusbar = CreateStatusBar(2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Events and Event Handlers
|
||||
*/
|
||||
BEGIN_EVENT_TABLE(TorqueIDEFrame, wxFrame)
|
||||
// File
|
||||
EVT_MENU(MENU_FILE_NEW, TorqueIDEFrame::OnMenuFileNew)
|
||||
|
@ -161,6 +226,14 @@ BEGIN_EVENT_TABLE(TorqueIDEFrame, wxFrame)
|
|||
EVT_MENU(MENU_EDIT_COPY, TorqueIDEFrame::OnMenuEditCopy)
|
||||
EVT_MENU(MENU_EDIT_PASTE, TorqueIDEFrame::OnMenuEditPaste)
|
||||
EVT_MENU(MENU_EDIT_CLEAR, TorqueIDEFrame::OnMenuEditClear)
|
||||
EVT_MENU(MENU_EDIT_SELECTALL, TorqueIDEFrame::OnMenuEditSelectAll)
|
||||
EVT_MENU(MENU_EDIT_SELECTLINE, TorqueIDEFrame::OnMenuEditSelectLine)
|
||||
// Search
|
||||
EVT_MENU(MENU_SEARCH_FIND, TorqueIDEFrame::OnMenuSearchFind)
|
||||
EVT_MENU(MENU_SEARCH_FINDNEXT, TorqueIDEFrame::OnMenuSearchFindNext)
|
||||
EVT_MENU(MENU_SEARCH_REPLACE, TorqueIDEFrame::OnMenuSearchReplace)
|
||||
EVT_MENU(MENU_SEARCH_REPLACENEXT, TorqueIDEFrame::OnMenuSearchReplaceNext)
|
||||
EVT_MENU(MENU_SEARCH_GOTO, TorqueIDEFrame::OnMenuSearchGoto)
|
||||
// Help
|
||||
EVT_MENU(MENU_HELP_HELP, TorqueIDEFrame::OnMenuHelpHelp)
|
||||
EVT_MENU(MENU_HELP_ABOUT, TorqueIDEFrame::OnMenuHelpAbout)
|
||||
|
@ -173,16 +246,14 @@ void TorqueIDEFrame::OnMenuFileNew(wxCommandEvent &event)
|
|||
|
||||
void TorqueIDEFrame::OnMenuFileOpen(wxCommandEvent &event)
|
||||
{
|
||||
wxFileDialog *opendlg = new wxFileDialog(this, "Open", "", "", "TorqueSCRIPT Files(*.cs)|*.cs|All files(*.*)|*.*", wxOPEN, wxDefaultPosition);
|
||||
if ( opendlg->ShowModal() == wxID_OK )
|
||||
wxFileDialog *dlg = new wxFileDialog(this, "Open", "", "", "TorqueSCRIPT Files(*.cs)|*.cs|All files(*.*)|*.*", wxOPEN, wxDefaultPosition);
|
||||
if ( dlg->ShowModal() == wxID_OK )
|
||||
{
|
||||
// Debug purposes
|
||||
//wxLogMessage(opendlg->GetDirectory()<<"/"<<opendlg->GetFilename());
|
||||
scintilla->LoadFile(opendlg->GetDirectory()<<"/"<<opendlg->GetFilename());
|
||||
scintilla->LoadFile(dlg->GetPath());
|
||||
scintilla->SetSavePoint();
|
||||
SetStatusText(opendlg->GetFilename(), 1);
|
||||
SetStatusText(dlg->GetFilename(), 1);
|
||||
}
|
||||
opendlg->Destroy();
|
||||
dlg->Destroy();
|
||||
}
|
||||
|
||||
void TorqueIDEFrame::OnMenuFileSave(wxCommandEvent &event)
|
||||
|
@ -196,16 +267,14 @@ void TorqueIDEFrame::OnMenuFileSave(wxCommandEvent &event)
|
|||
|
||||
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 )
|
||||
wxFileDialog *dlg = new wxFileDialog(this, "Save As", "", "", "TorqueSCRIPT Files(*.cs)|*.cs|All files(*.*)|*.*", wxSAVE, wxDefaultPosition);
|
||||
if ( dlg->ShowModal() == wxID_OK )
|
||||
{
|
||||
// Debug purposes
|
||||
//wxLogMessage(savedlg->GetDirectory()<<"/"<<savedlg->GetFilename());
|
||||
scintilla->SaveFile(savedlg->GetDirectory()<<"/"<<savedlg->GetFilename());
|
||||
scintilla->SaveFile(dlg->GetPath());
|
||||
scintilla->SetSavePoint();
|
||||
SetStatusText(savedlg->GetFilename(), 1);
|
||||
SetStatusText(dlg->GetPath(), 1); // GetFilename for just the filename
|
||||
}
|
||||
savedlg->Destroy();
|
||||
dlg->Destroy();
|
||||
}
|
||||
|
||||
void TorqueIDEFrame::OnMenuFileQuit(wxCommandEvent &event)
|
||||
|
@ -264,6 +333,43 @@ void TorqueIDEFrame::OnMenuEditClear(wxCommandEvent &event)
|
|||
scintilla->Clear();
|
||||
}
|
||||
|
||||
void TorqueIDEFrame::OnMenuEditSelectAll(wxCommandEvent &event)
|
||||
{
|
||||
scintilla->SelectAll();
|
||||
}
|
||||
|
||||
void TorqueIDEFrame::OnMenuEditSelectLine(wxCommandEvent &event)
|
||||
{
|
||||
int lineStart = scintilla->PositionFromLine(scintilla->GetCurrentLine());
|
||||
int lineEnd = scintilla->PositionFromLine(scintilla->GetCurrentLine() + 1);
|
||||
scintilla->SetSelection(lineStart, lineEnd);
|
||||
}
|
||||
|
||||
void TorqueIDEFrame::OnMenuSearchFind(wxCommandEvent &event)
|
||||
{
|
||||
wxBell();
|
||||
}
|
||||
|
||||
void TorqueIDEFrame::OnMenuSearchFindNext(wxCommandEvent &event)
|
||||
{
|
||||
wxBell();
|
||||
}
|
||||
|
||||
void TorqueIDEFrame::OnMenuSearchReplace(wxCommandEvent &event)
|
||||
{
|
||||
wxBell();
|
||||
}
|
||||
|
||||
void TorqueIDEFrame::OnMenuSearchReplaceNext(wxCommandEvent &event)
|
||||
{
|
||||
wxBell();
|
||||
}
|
||||
|
||||
void TorqueIDEFrame::OnMenuSearchGoto(wxCommandEvent &event)
|
||||
{
|
||||
wxBell();
|
||||
}
|
||||
|
||||
void TorqueIDEFrame::OnMenuHelpHelp(wxCommandEvent &event)
|
||||
{
|
||||
wxLogMessage("Help Help Menu Selected");
|
||||
|
@ -271,6 +377,7 @@ void TorqueIDEFrame::OnMenuHelpHelp(wxCommandEvent &event)
|
|||
|
||||
void TorqueIDEFrame::OnMenuHelpAbout(wxCommandEvent &event)
|
||||
{
|
||||
wxLogMessage("Help About Menu Selected");
|
||||
TorqueIDEAbout *dlg = new TorqueIDEAbout(this);
|
||||
dlg->SetText("Torque IDE\nAn Open Source Project\nReleased under the GPL v2");
|
||||
dlg->ShowModal();
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* Torque IDE -- An open source integrated development environment for the
|
||||
* Torque Game Engine
|
||||
*
|
||||
* Copyright (C) 2004 Robert Pierce
|
||||
* Copyright (C) 2005 Robert Pierce
|
||||
*
|
||||
* Refer to the file CONTRIB.txt for the people who have helped.
|
||||
*
|
||||
|
@ -35,11 +35,11 @@ class TorqueIDEFrame : public wxFrame
|
|||
/**
|
||||
* Constructor
|
||||
*/
|
||||
TorqueIDEFrame( const wxChar *title );
|
||||
TorqueIDEFrame(const wxString &title);
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
* Destructor
|
||||
*/
|
||||
~TorqueIDEFrame();
|
||||
|
||||
/**
|
||||
|
@ -98,40 +98,93 @@ class TorqueIDEFrame : public wxFrame
|
|||
void OnMenuEditClear(wxCommandEvent &event);
|
||||
|
||||
/**
|
||||
* Processes menu Help|Help
|
||||
* Processes menu Edit|Select All
|
||||
*/
|
||||
void OnMenuHelpHelp(wxCommandEvent &event);
|
||||
void OnMenuEditSelectAll(wxCommandEvent &event);
|
||||
|
||||
/**
|
||||
* Processes menu Edit|Select Line
|
||||
*/
|
||||
void OnMenuEditSelectLine(wxCommandEvent &event);
|
||||
|
||||
/**
|
||||
* Processes menu Search|Find
|
||||
*/
|
||||
void OnMenuSearchFind(wxCommandEvent &event);
|
||||
|
||||
/**
|
||||
* Processes menu Search|Find Next
|
||||
*/
|
||||
void OnMenuSearchFindNext(wxCommandEvent &event);
|
||||
|
||||
/**
|
||||
* Processes menu Search|Replace
|
||||
*/
|
||||
void OnMenuSearchReplace(wxCommandEvent &event);
|
||||
|
||||
/**
|
||||
* Processes menu Search|Replace Next
|
||||
*/
|
||||
void OnMenuSearchReplaceNext(wxCommandEvent &event);
|
||||
|
||||
/**
|
||||
* Processes menu Search|Goto
|
||||
*/
|
||||
void OnMenuSearchGoto(wxCommandEvent &event);
|
||||
|
||||
/**
|
||||
* Processes menu Help|About
|
||||
*/
|
||||
void OnMenuHelpAbout(wxCommandEvent &event);
|
||||
|
||||
/**
|
||||
* Processes menu Help|Help
|
||||
*/
|
||||
void OnMenuHelpHelp(wxCommandEvent &event);
|
||||
|
||||
protected:
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
private:
|
||||
private:
|
||||
// Editor
|
||||
wxStyledTextCtrl *scintilla;
|
||||
|
||||
// Statusbar
|
||||
wxStatusBar *statusbar;
|
||||
void InitStatusBar();
|
||||
|
||||
// Toolbar
|
||||
wxToolBar *toolbar;
|
||||
void InitToolBar();
|
||||
|
||||
// Menu
|
||||
wxMenuBar *menubar;
|
||||
wxMenu *menu_file;
|
||||
wxMenu *menu_edit;
|
||||
wxMenu *menu_help;
|
||||
void InitMenu();
|
||||
|
||||
enum
|
||||
{
|
||||
// File
|
||||
MENU_FILE_NEW,
|
||||
MENU_FILE_OPEN,
|
||||
MENU_FILE_SAVE,
|
||||
MENU_FILE_SAVEAS,
|
||||
MENU_FILE_QUIT,
|
||||
// Edit
|
||||
MENU_EDIT_UNDO,
|
||||
MENU_EDIT_REDO,
|
||||
MENU_EDIT_CUT,
|
||||
MENU_EDIT_COPY,
|
||||
MENU_EDIT_PASTE,
|
||||
MENU_EDIT_CLEAR,
|
||||
MENU_EDIT_SELECTALL,
|
||||
MENU_EDIT_SELECTLINE,
|
||||
// Search
|
||||
MENU_SEARCH_FIND,
|
||||
MENU_SEARCH_FINDNEXT,
|
||||
MENU_SEARCH_REPLACE,
|
||||
MENU_SEARCH_REPLACENEXT,
|
||||
MENU_SEARCH_GOTO,
|
||||
// Help
|
||||
MENU_HELP_ABOUT,
|
||||
MENU_HELP_HELP
|
||||
};
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* Torque IDE -- An open source integrated development environment for the
|
||||
* Torque Game Engine
|
||||
*
|
||||
* Copyright (C) 2004 Robert Pierce
|
||||
* Copyright (C) 2005 Robert Pierce
|
||||
*
|
||||
* Refer to the file CONTRIB.txt for the people who have helped.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue