Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

MonkeyFishFrame Class Reference

The main frame. More...

#include <monkeyfish.h>

List of all members.

Public Member Functions

 MonkeyFishFrame (const wxString &title, const wxPoint &pos, const wxSize &pos, const wxString &resPath)
 The main frame of the application.
 ~MonkeyFishFrame ()
 Clean up.
void onFileNew (wxCommandEvent &evt)
 User wants a new file.
void doFileNew (const wxString &text=wxT(""))
void onFileOpen (wxCommandEvent &evt)
 User wants to open a file.
void onRecentFileOpen (wxCommandEvent &evt)
 User want a file they have already been with.
bool doFileOpen (const wxString &fname)
 Tries to open a file, read in the contents and create a new editor page in the notebook.
void onFileSave (wxCommandEvent &evt)
 User wants to save the file.
int doFileSave ()
 Write the buffer to disk.
bool doFileSaveAll ()
 Save all open files if needed.
void onFileSaveAs (wxCommandEvent &evt)
 User wants to save the file as some name.
int doFileSaveAs (const wxString &fname=wxEmptyString)
 Save the file as fname.
void onFileClose (wxCommandEvent &evt)
 User wants to close a buffer.
int doFileClose (bool asksave=true)
 Close the buffer.
void onFileReload (wxCommandEvent &evt)
 User reloaed file from disk.
void onPreferences (wxCommandEvent &event)
 User wants to set up preferences.
void onQuit (wxCommandEvent &event)
 User wants to bail.
void onUndo (wxCommandEvent &event)
 User changes mind.
void onRedo (wxCommandEvent &event)
 User changes mind about changing mind.
void onCut (wxCommandEvent &event)
 User chopped out some text.
void onCopy (wxCommandEvent &event)
 User copied some text.
void onPaste (wxCommandEvent &event)
 User pasted some text.
void onFind (wxCommandEvent &event)
 User wants to find something.
void onFindBrace (wxCommandEvent &event)
 Find the closing brace.
void onAutoComplete (wxCommandEvent &evt)
 User called auto complete.
void onCallTip (wxCommandEvent &evt)
 User asked for call tip.
void onLoadCallTips (wxCommandEvent &evt)
 Load call tips from a file.
void onToggleSidebar (wxCommandEvent &evt)
 Show/hide the sidebar window.
void onToggleOutput (wxCommandEvent &evt)
 Show/hide the output window.
void onToggleAutoIndent (wxCommandEvent &evt)
 Toggle autoindent in the current editor.
void onToggleViewEOL (wxCommandEvent &evt)
void onToggleEmacsMode (wxCommandEvent &evt)
void onExecute (wxCommandEvent &evt)
 User wants to execute some os command.
void onExecuteLast (wxCommandEvent &evt)
 User wants to re-execute thier last os command.
void doExecute (const wxString &cmd)
 Execute an os command.
void onExecuteSelection (wxCommandEvent &evt)
 Execute the current selection as a lua command.
void onRebuildToolsMenu (wxCommandEvent &evt)
 Rebuild the tools menu from the found scripts.
void onScriptOpen (wxCommandEvent &evt)
 User wants to edit a script file.
void onExecuteLua (wxCommandEvent &evt)
 This is called from the dynamic menu built under tools.
void onInsertColor (wxCommandEvent &evt)
 Insert a hex color into the doc.
void onProjOpen (wxCommandEvent &evt)
void onProjSave (wxCommandEvent &evt)
void onProjSaveAs (wxCommandEvent &evt)
void onProjBuild (wxCommandEvent &evt)
void onProjDebug (wxCommandEvent &evt)
void onProjExecute (wxCommandEvent &evt)
void onHelp (wxCommandEvent &evt)
 User wants Dr.
void onAbout (wxCommandEvent &event)
 User wants to know what its all about.
void onSysInfo (wxCommandEvent &evt)
void onPlayMacro (wxCommandEvent &evt)
void onNotebook (wxFlatNotebookEvent &evt)
 Called by the notebook when the user changes tabs.
void onPageClosing (wxFlatNotebookEvent &evt)
 Called by the notebook when the user closes a tab.
void onEditorChanged (wxStyledTextEvent &evt)
 Called by the editor when something changes with it so we can update various indicators.
void doFind (wxFindDialogEvent &event)
 Called by frDlg to actually perform the find/replace.
void onIndentBlock (wxCommandEvent &evt)
 Indent a block of text.
void onClose (wxCloseEvent &evt)
const wxString & getResourcePath ()
bool execScript (wxString scriptName, bool showError=true)
 Execute a lua script.
int message (const wxString &msg)
 Pop up a message box.
int error (const wxString &msg)
 Pop up an error message box.
int find (wxString str, int flags)
 This actually does the looking.
int replace (wxString str, wxString repl, int flags)
 Perform one find/replace on the text.
void quit ()
 Leave the program, save config info.
void setAppState ()
 Set the condition of the app.
void gotoLine (int lineno)
void debug (wxString text)
 The quick and the dirty debug.
void buildToolsMenu (wxMenu *menu, wxString dir, int *id)
 Build a menu for the Tools menu from the script/tools directory tree.
wxString menuPath (int id)
void addFileToHistory (const wxString &fname)
void setAccelTable ()

Protected Member Functions

bool readfile (wxString fname, wxString *text)
 Read a file from disk and put it into text string.
bool writefile (wxString fname, wxString *text)
 Write the text in text to a file.
void setDefaults ()
 Set up some reasonable defaults if thie is the first time the app has run.

Protected Attributes

wxSplitterWindow * splitter
 the vertical split
wxSplitterWindow * sp2
 the horizontal split
wxFlatNotebook * notebook
 the editor notebook
editorctrl * editor
 the current editor
sidebar * sbar
 the sidebar
wxStatusBar * statusbar
 the status area
wxFindReplaceData * finddata
 find/replace data
wxFindReplaceDialog * frDlg
 find/replace dialog box
config * conf
 the config object
lua * m_lua
 the lua intpreter
processpanel * output
 the output window for exec and lua
int m_frstartpos
 find/repl start position
wxString scriptDir
 where scripts are stored
wxString toolsDir
 where scripts are stored for tools menu
int sashpos
 loc of the vert split
int sash2pos
 loc of the hor split
wxFileHistory * fileHistory
wxHtmlHelpController * help
wxArrayString * tips
 call tips array
wxString resourcePath
 where our resources are stored
bool emacsMode
 emacs key bindings

Friends

class lua
class prefsdlg
class editorctrl
class projecttree


Detailed Description

The main frame.


Constructor & Destructor Documentation

MonkeyFishFrame::MonkeyFishFrame (  const wxString &  title,
const wxPoint &  pos,
const wxSize &  size,
const wxString &  resPath
) 
 

The main frame of the application.

Parameters:
title the window title
pos the position of the frame on screem
size the size of the frame
resPath the path to the resource directory

MonkeyFishFrame::~MonkeyFishFrame (   ) 
 

Clean up.


Member Function Documentation

void MonkeyFishFrame::addFileToHistory (  const wxString &  fname  ) 
 

void MonkeyFishFrame::buildToolsMenu (  wxMenu *  menu,
wxString  dir,
int *  id
) 
 

Build a menu for the Tools menu from the script/tools directory tree.

void MonkeyFishFrame::debug (  wxString  text  ) 
 

The quick and the dirty debug.

void MonkeyFishFrame::doExecute (  const wxString &  cmd  ) 
 

Execute an os command.

This command is prefixed first with the value of /tools/exec/prefix from config, if it exists.

Parameters:
cmd the command to execute.

int MonkeyFishFrame::doFileClose (  bool  asksave = true  ) 
 

Close the buffer.

If the buffer is modified and save is true, ask the user about what to do. If save is false, just close the buffer, losing any changes.

Parameters:
asksave if true and buffer is dirty, will ask user to save.
Returns:
is of button clicked.

void MonkeyFishFrame::doFileNew (  const wxString &  text = wxT("")  ) 
 

bool MonkeyFishFrame::doFileOpen (  const wxString &  fname  ) 
 

Tries to open a file, read in the contents and create a new editor page in the notebook.

Parameters:
fname 
Returns:
true if sucessful

int MonkeyFishFrame::doFileSave (   ) 
 

Write the buffer to disk.

Calls doFileSaveAs if there is no filename associated with this buffer.

See also:
doFileSaveAs
Returns:
the id of button clicked

bool MonkeyFishFrame::doFileSaveAll (   ) 
 

Save all open files if needed.

int MonkeyFishFrame::doFileSaveAs (  const wxString &  fname = wxEmptyString  ) 
 

Save the file as fname.

If fname is wxEmptyString, ask the user for a name.

Parameters:
fname the name to save as or ask user if wxEmptyString
Returns:
id of the button clicked

void MonkeyFishFrame::doFind (  wxFindDialogEvent &  evt  ) 
 

Called by frDlg to actually perform the find/replace.

Parameters:
evt 

int MonkeyFishFrame::error (  const wxString &  msg  ) 
 

Pop up an error message box.

Parameters:
msg the message to display

bool MonkeyFishFrame::execScript (  wxString  scriptName,
bool  showError = true
) 
 

Execute a lua script.

Parameters:
scriptName the full path of the script file
showError do we show an error to the user or be silent
Returns:
true if the script sucessfully ran

int MonkeyFishFrame::find (  wxString  str,
int  flags
) 
 

This actually does the looking.

Parameters:
str the string to look for
flags various flags from the dialog
Returns:
the pos of the found text or -1 if not found

const wxString& MonkeyFishFrame::getResourcePath (   )  [inline]
 

void MonkeyFishFrame::gotoLine (  int  lineno  ) 
 

wxString MonkeyFishFrame::menuPath (  int  id  ) 
 

int MonkeyFishFrame::message (  const wxString &  msg  ) 
 

Pop up a message box.

Parameters:
msg the message to display

void MonkeyFishFrame::onAbout (  wxCommandEvent &  evt  ) 
 

User wants to know what its all about.

Parameters:
evt 

void MonkeyFishFrame::onAutoComplete (  wxCommandEvent &  evt  ) 
 

User called auto complete.

void MonkeyFishFrame::onCallTip (  wxCommandEvent &  evt  ) 
 

User asked for call tip.

void MonkeyFishFrame::onClose (  wxCloseEvent &  evt  ) 
 

void MonkeyFishFrame::onCopy (  wxCommandEvent &  evt  ) 
 

User copied some text.

Parameters:
evt 

void MonkeyFishFrame::onCut (  wxCommandEvent &  evt  ) 
 

User chopped out some text.

Parameters:
evt 

void MonkeyFishFrame::onEditorChanged (  wxStyledTextEvent &  evt  ) 
 

Called by the editor when something changes with it so we can update various indicators.

Parameters:
evt 

void MonkeyFishFrame::onExecute (  wxCommandEvent &  event  ) 
 

User wants to execute some os command.

Parameters:
event 

void MonkeyFishFrame::onExecuteLast (  wxCommandEvent &  event  ) 
 

User wants to re-execute thier last os command.

Parameters:
event 

void MonkeyFishFrame::onExecuteLua (  wxCommandEvent &  event  ) 
 

This is called from the dynamic menu built under tools.

It attempts to execute the script file named in the menu item.

Parameters:
event 

void MonkeyFishFrame::onExecuteSelection (  wxCommandEvent &  event  ) 
 

Execute the current selection as a lua command.

If nothing is selected the whole buffer is executed.

Parameters:
event 

void MonkeyFishFrame::onFileClose (  wxCommandEvent &  event  ) 
 

User wants to close a buffer.

Parameters:
event 

void MonkeyFishFrame::onFileNew (  wxCommandEvent &  evt  ) 
 

User wants a new file.

Parameters:
evt 

void MonkeyFishFrame::onFileOpen (  wxCommandEvent &  evt  ) 
 

User wants to open a file.

Parameters:
evt 

void MonkeyFishFrame::onFileReload (  wxCommandEvent &  evt  ) 
 

User reloaed file from disk.

void MonkeyFishFrame::onFileSave (  wxCommandEvent &  event  ) 
 

User wants to save the file.

Parameters:
event 

void MonkeyFishFrame::onFileSaveAs (  wxCommandEvent &  event  ) 
 

User wants to save the file as some name.

Parameters:
event 

void MonkeyFishFrame::onFind (  wxCommandEvent &  evt  ) 
 

User wants to find something.

Parameters:
evt 

void MonkeyFishFrame::onFindBrace (  wxCommandEvent &  event  ) 
 

Find the closing brace.

void MonkeyFishFrame::onHelp (  wxCommandEvent &  evt  ) 
 

User wants Dr.

Phil?

Parameters:
evt 

void MonkeyFishFrame::onIndentBlock (  wxCommandEvent &  evt  ) 
 

Indent a block of text.

void MonkeyFishFrame::onInsertColor (  wxCommandEvent &  evt  ) 
 

Insert a hex color into the doc.

Parameters:
evt 

void MonkeyFishFrame::onLoadCallTips (  wxCommandEvent &  evt  ) 
 

Load call tips from a file.

The file is simply one tip per line. The call tip function the editorctrl simply matches as much as it can from the beginning of each line and displays the matches when called. The file should be sorted for this to work properly. This is purposefully kept simple to be as useful as possible.

void MonkeyFishFrame::onNotebook (  wxFlatNotebookEvent &  evt  ) 
 

Called by the notebook when the user changes tabs.

Parameters:
evt 

void MonkeyFishFrame::onPageClosing (  wxFlatNotebookEvent &  evt  ) 
 

Called by the notebook when the user closes a tab.

Parameters:
evt 

void MonkeyFishFrame::onPaste (  wxCommandEvent &  evt  ) 
 

User pasted some text.

Parameters:
evt 

void MonkeyFishFrame::onPlayMacro (  wxCommandEvent &  evt  ) 
 

void MonkeyFishFrame::onPreferences (  wxCommandEvent &  evt  ) 
 

User wants to set up preferences.

Parameters:
evt 

void MonkeyFishFrame::onProjBuild (  wxCommandEvent &  evt  ) 
 

void MonkeyFishFrame::onProjDebug (  wxCommandEvent &  evt  ) 
 

void MonkeyFishFrame::onProjExecute (  wxCommandEvent &  evt  ) 
 

void MonkeyFishFrame::onProjOpen (  wxCommandEvent &  evt  ) 
 

void MonkeyFishFrame::onProjSave (  wxCommandEvent &  evt  ) 
 

void MonkeyFishFrame::onProjSaveAs (  wxCommandEvent &  evt  ) 
 

void MonkeyFishFrame::onQuit (  wxCommandEvent &  event  ) 
 

User wants to bail.

Look at open files and ask about saving them.

Parameters:
event 

void MonkeyFishFrame::onRebuildToolsMenu (  wxCommandEvent &  evt  ) 
 

Rebuild the tools menu from the found scripts.

void MonkeyFishFrame::onRecentFileOpen (  wxCommandEvent &  event  ) 
 

User want a file they have already been with.

Parameters:
event 

void MonkeyFishFrame::onRedo (  wxCommandEvent &  evt  ) 
 

User changes mind about changing mind.

Parameters:
evt 

void MonkeyFishFrame::onScriptOpen (  wxCommandEvent &  evt  ) 
 

User wants to edit a script file.

Parameters:
evt 

void MonkeyFishFrame::onSysInfo (  wxCommandEvent &  evt  ) 
 

void MonkeyFishFrame::onToggleAutoIndent (  wxCommandEvent &  event  ) 
 

Toggle autoindent in the current editor.

Parameters:
event 

void MonkeyFishFrame::onToggleEmacsMode (  wxCommandEvent &  evt  ) 
 

void MonkeyFishFrame::onToggleOutput (  wxCommandEvent &  evt  ) 
 

Show/hide the output window.

Parameters:
evt 

void MonkeyFishFrame::onToggleSidebar (  wxCommandEvent &  evt  ) 
 

Show/hide the sidebar window.

Parameters:
evt 

void MonkeyFishFrame::onToggleViewEOL (  wxCommandEvent &  evt  ) 
 

void MonkeyFishFrame::onUndo (  wxCommandEvent &  evt  ) 
 

User changes mind.

Parameters:
evt 

void MonkeyFishFrame::quit (   ) 
 

Leave the program, save config info.

bool MonkeyFishFrame::readfile (  wxString  fname,
wxString *  text
)  [protected]
 

Read a file from disk and put it into text string.

Parameters:
fname the file name to read
text the text to store in
Returns:
true if the file was sucessfully read

int MonkeyFishFrame::replace (  wxString  str,
wxString  repl,
int  flags
) 
 

Perform one find/replace on the text.

Parameters:
str the string to find.
repl the string to replace it with.
flags various flags form the dialog
Returns:
the pos of the replced text or -1 if not found

void MonkeyFishFrame::setAccelTable (   ) 
 

void MonkeyFishFrame::setAppState (   ) 
 

Set the condition of the app.

Turns menus on and off, etc.

void MonkeyFishFrame::setDefaults (   )  [protected]
 

Set up some reasonable defaults if thie is the first time the app has run.

Called when the frame inits if there is nothing in the config object.

bool MonkeyFishFrame::writefile (  wxString  fname,
wxString *  text
)  [protected]
 

Write the text in text to a file.

Parameters:
fname the file name to write to
text the text to write
Returns:
true if sucessful


Friends And Related Function Documentation

friend class editorctrl [friend]
 

friend class lua [friend]
 

friend class prefsdlg [friend]
 

friend class projecttree [friend]
 


Member Data Documentation

config* MonkeyFishFrame::conf [protected]
 

the config object

editorctrl* MonkeyFishFrame::editor [protected]
 

the current editor

bool MonkeyFishFrame::emacsMode [protected]
 

emacs key bindings

wxFileHistory* MonkeyFishFrame::fileHistory [protected]
 

wxFindReplaceData* MonkeyFishFrame::finddata [protected]
 

find/replace data

wxFindReplaceDialog* MonkeyFishFrame::frDlg [protected]
 

find/replace dialog box

wxHtmlHelpController* MonkeyFishFrame::help [protected]
 

int MonkeyFishFrame::m_frstartpos [protected]
 

find/repl start position

lua* MonkeyFishFrame::m_lua [protected]
 

the lua intpreter

wxFlatNotebook* MonkeyFishFrame::notebook [protected]
 

the editor notebook

processpanel* MonkeyFishFrame::output [protected]
 

the output window for exec and lua

wxString MonkeyFishFrame::resourcePath [protected]
 

where our resources are stored

int MonkeyFishFrame::sash2pos [protected]
 

loc of the hor split

int MonkeyFishFrame::sashpos [protected]
 

loc of the vert split

sidebar* MonkeyFishFrame::sbar [protected]
 

the sidebar

wxString MonkeyFishFrame::scriptDir [protected]
 

where scripts are stored

wxSplitterWindow* MonkeyFishFrame::sp2 [protected]
 

the horizontal split

wxSplitterWindow* MonkeyFishFrame::splitter [protected]
 

the vertical split

wxStatusBar* MonkeyFishFrame::statusbar [protected]
 

the status area

wxArrayString* MonkeyFishFrame::tips [protected]
 

call tips array

wxString MonkeyFishFrame::toolsDir [protected]
 

where scripts are stored for tools menu


The documentation for this class was generated from the following files:
Generated on Fri Mar 10 12:32:03 2006 for MonkeyFish by  doxygen 1.4.4