Package mathbench :: Package lab :: Module notebook :: Class LabBook
[hide private]

Class LabBook

source code

     object --+                                
              |                                
wx._core.Object --+                            
                  |                            
wx._core.EvtHandler --+                        
                      |                        
        wx._core.Window --+                    
                          |                    
 wx._windows.TopLevelWindow --+                
                              |                
              wx._windows.Frame --+            
                                  |            
                  wx.py.frame.Frame --+        
                                      |        
               wx.py.editor.EditorFrame --+    
                                          |    
           wx.py.editor.EditorNotebookFrame --+
                                              |
                                             LabBook

LabBook instance that manage all the sutff displayed on screen (editors and shells).

To add the singleton behaviour to a LabBench instance.

implemented in a similar way as in : http://www.haypocalc.com/blog/index.php/2006/05/12/3-motifs-de-conception-et-python



Instance Methods [hide private]
 
__init__(self, parent=None, id=-1, title='MathBench', config=None, pos=wx.Point(-1, -1), size=(800, 600), style=541072960, filename=None, history_dir=None)
Create LabBookFrame instance.
source code
 
_init_notebook(self)
Create the top level widgets contained by the frame
source code
 
_init_helpbar(self)
Create a toolbar showing some helping options
source code
 
_init_shell_widget(self)
Create the widget that will be used as the main shell
source code
 
_setup(self)
Setup prior to first buffer creation.
source code
 
_newPageOnNotebook(self)
When a new page is added perform some necessary checking and settings.
source code
 
init_worksession(self)
Put here the functions to call at the begining of the working session of the shell.
source code
 
enforce_options(self, window)
Enforce the choices the user made with the options.
source code
 
_modify_menus(self)
Recreate the menus, overwritting what has been done in the wx/py/frame.py
source code
 
_checkCurrentBufferSaved(self, title='Savind required')
Check is the content of the current buffer has been saved (at its latest version).
source code
 
_editorChange(self, editor)
When the editor change, update the menu options.
source code
 
log_sink_to_file(self, text)
Create a new file from the given text
source code
 
bufferNew(self)
Create new buffer.
source code
 
bufferPrint(self)
printing ability
source code
 
OnClose(self, event)
Close everything and don't let a creepy plugin hold the end of the app.
source code
 
OnHelp(self, event)
Display a small helpign text
source code
 
OnAbout(self, event)
Display an About window.
source code
 
OnLibrary(self, event)
Show the library desk
source code
 
OnExecute(self, event)
Execute the script in a new shell frame.
source code
 
OnExecuteInMainShell(self, event)
Execute the script in the main shell.
source code
 
OnPreference(self, event)
Show the preference panel
source code
 
OnHistoryToScript(self, event)
Pass the shell's history to a new script.
source code
 
OnLoadOldSession(self, event)
Load an older session from its history file.
source code
 
_onOptionsChanged(self)
Take into accout a change in the options
source code
 
_onOptionsClosed(self)
Remove the reference to the options frame
source code
 
OnHelpToolClick(self, event)
When the user clicks on the helpbar, find which button has been clicked and act !
source code
 
OnQueryKeyDown(self, event)
When user clicks on enter while typing in the query widget, then launch the search !
source code

Inherited from wx.py.editor.EditorNotebookFrame: bufferCreate, bufferDestroy, bufferOpen

Inherited from wx.py.editor.EditorNotebookFrame (private): _updateTitle

Inherited from wx.py.editor.EditorFrame: OnIdle, bufferClose, bufferHasChanged, bufferSave, bufferSaveAs, bufferSuggestSave, hasBuffer, setEditor, updateNamespace

Inherited from wx.py.editor.EditorFrame (private): _updateStatus, _updateTabText

Inherited from wx.py.frame.Frame: LoadSettings, OnActivate, OnAutoCompleteDouble, OnAutoCompleteMagic, OnAutoCompleteShow, OnAutoCompleteSingle, OnAutoSaveSettings, OnCallTipsInsert, OnCallTipsShow, OnClear, OnClearHistory, OnCopy, OnCopyPlus, OnCut, OnDelSettingsFile, OnEditStartupScript, OnEmptyBuffer, OnExecStartupScript, OnExit, OnFileClose, OnFileNew, OnFileOpen, OnFilePrint, OnFileRevert, OnFileSave, OnFileSaveAs, OnFileUpdateNamespace, OnFindClose, OnFindNext, OnFindText, OnIconize, OnPaste, OnPastePlus, OnRedo, OnSaveHistory, OnSaveHistoryNow, OnSaveSettings, OnSelectAll, OnShowLineNumbers, OnToggleMaximize, OnToggleTools, OnUndo, OnUpdateMenu, OnUseAA, OnWrap, SaveSettings

Inherited from wx._windows.Frame: Command, Create, CreateStatusBar, CreateToolBar, DoGiveHelp, DoMenuUpdates, GetMenuBar, GetStatusBar, GetStatusBarPane, GetToolBar, PopStatusText, ProcessCommand, PushStatusText, SendSizeEvent, SetMenuBar, SetStatusBar, SetStatusBarPane, SetStatusText, SetStatusWidths, SetToolBar

Inherited from wx._windows.TopLevelWindow: CenterOnScreen, CentreOnScreen, EnableCloseButton, GetDefaultItem, GetIcon, GetTitle, GetTmpDefaultItem, Iconize, IsActive, IsAlwaysMaximized, IsFullScreen, IsIconized, IsMaximized, MacGetMetalAppearance, MacSetMetalAppearance, Maximize, RequestUserAttention, Restore, SetDefaultItem, SetIcon, SetIcons, SetShape, SetTitle, SetTmpDefaultItem, ShowFullScreen, __repr__

Inherited from wx._core.Window: AcceptsFocus, AcceptsFocusFromKeyboard, AddChild, AdjustForLayoutDirection, AssociateHandle, CacheBestSize, CanSetTransparent, CaptureMouse, Center, CenterOnParent, Centre, CentreOnParent, ClearBackground, ClientToScreen, ClientToScreenXY, Close, ConvertDialogPointToPixels, ConvertDialogSizeToPixels, ConvertPixelPointToDialog, ConvertPixelSizeToDialog, DLG_PNT, DLG_SZE, Destroy, DestroyChildren, Disable, DissociateHandle, DragAcceptFiles, Enable, FindWindowById, FindWindowByName, Fit, FitInside, Freeze, GetAcceleratorTable, GetAdjustedBestSize, GetAutoLayout, GetBackgroundColour, GetBackgroundStyle, GetBestFittingSize, GetBestSize, GetBestSizeTuple, GetBestVirtualSize, GetBorder, GetCaret, GetCharHeight, GetCharWidth, GetChildren, GetClientAreaOrigin, GetClientRect, GetClientSize, GetClientSizeTuple, GetConstraints, GetContainingSizer, GetCursor, GetDefaultAttributes, GetDropTarget, GetEffectiveMinSize, GetEventHandler, GetExtraStyle, GetFont, GetForegroundColour, GetFullTextExtent, GetGrandParent, GetHandle, GetHelpText, GetHelpTextAtPoint, GetId, GetLabel, GetLayoutDirection, GetMaxHeight, GetMaxSize, GetMaxWidth, GetMinHeight, GetMinSize, GetMinWidth, GetName, GetParent, GetPosition, GetPositionTuple, GetRect, GetScreenPosition, GetScreenPositionTuple, GetScreenRect, GetScrollPos, GetScrollRange, GetScrollThumb, GetSize, GetSizeTuple, GetSizer, GetTextExtent, GetThemeEnabled, GetToolTip, GetTopLevelParent, GetUpdateClientRect, GetUpdateRegion, GetValidator, GetVirtualSize, GetVirtualSizeTuple, GetWindowBorderSize, GetWindowStyle, GetWindowStyleFlag, GetWindowVariant, HasCapture, HasFlag, HasMultiplePages, HasScrollbar, HasTransparentBackground, Hide, HitTest, HitTestXY, InheritAttributes, InheritsBackgroundColour, InitDialog, InvalidateBestSize, IsBeingDeleted, IsDoubleBuffered, IsEnabled, IsExposed, IsExposedPoint, IsExposedRect, IsFrozen, IsRetained, IsShown, IsShownOnScreen, IsTopLevel, Layout, LineDown, LineUp, Lower, MakeModal, Move, MoveAfterInTabOrder, MoveBeforeInTabOrder, MoveXY, Navigate, PageDown, PageUp, PopEventHandler, PopupMenu, PopupMenuXY, PostCreate, PrepareDC, PushEventHandler, Raise, Refresh, RefreshRect, RegisterHotKey, ReleaseMouse, RemoveChild, RemoveEventHandler, Reparent, ScreenToClient, ScreenToClientXY, ScrollLines, ScrollPages, ScrollWindow, SetAcceleratorTable, SetAutoLayout, SetBackgroundColour, SetBackgroundStyle, SetBestFittingSize, SetCaret, SetClientRect, SetClientSize, SetClientSizeWH, SetConstraints, SetContainingSizer, SetCursor, SetDimensions, SetDoubleBuffered, SetDropTarget, SetEventHandler, SetExtraStyle, SetFocus, SetFocusFromKbd, SetFont, SetForegroundColour, SetHelpText, SetHelpTextForId, SetId, SetInitialSize, SetLabel, SetLayoutDirection, SetMaxSize, SetMinSize, SetName, SetOwnBackgroundColour, SetOwnFont, SetOwnForegroundColour, SetPosition, SetRect, SetScrollPos, SetScrollbar, SetSize, SetSizeHints, SetSizeHintsSz, SetSizeWH, SetSizer, SetSizerAndFit, SetThemeEnabled, SetToolTip, SetToolTipString, SetTransparent, SetValidator, SetVirtualSize, SetVirtualSizeHints, SetVirtualSizeHintsSz, SetVirtualSizeWH, SetWindowStyle, SetWindowStyleFlag, SetWindowVariant, ShouldInheritColours, Show, Thaw, ToggleWindowStyle, TransferDataFromWindow, TransferDataToWindow, UnregisterHotKey, Update, UpdateWindowUI, UseBgCol, Validate, WarpPointer

Inherited from wx._core.EvtHandler: AddPendingEvent, Bind, Connect, Disconnect, GetEvtHandlerEnabled, GetNextHandler, GetPreviousHandler, ProcessEvent, ProcessPendingEvents, SetEvtHandlerEnabled, SetNextHandler, SetPreviousHandler, Unbind

Inherited from wx._core.EvtHandler (private): _setOORInfo

Inherited from wx._core.Object: GetClassName, IsSameAs

Inherited from object: __delattr__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __setattr__, __str__

Class Methods [hide private]
 
initShellSessionAppend(self, cmd_str)
Add a command to be executed at session init.
source code
Static Methods [hide private]
 
__new__(cls, parent=None, id=-1, title='Math Bench', config=None, pos=wx.Point(-1, -1), size=(800, 600), style=541072960, filename=None, history_dir=None)
Make sure only one instance is ever created
source code

Inherited from wx._windows.Frame: GetClassDefaultAttributes

Inherited from wx._core.Window: FindFocus, GetCapture, NewControlId, NextControlId, PrevControlId

Class Variables [hide private]
  __instance = None
  _init_shell_session = []

Inherited from wx.py.frame.Frame: revision

Properties [hide private]

Inherited from wx._windows.Frame: MenuBar, StatusBar, StatusBarPane, ToolBar, thisown

Inherited from wx._windows.TopLevelWindow: DefaultItem, Icon, Title, TmpDefaultItem

Inherited from wx._core.Window: AcceleratorTable, AutoLayout, BackgroundColour, BackgroundStyle, BestSize, BestVirtualSize, Border, Caret, CharHeight, CharWidth, Children, ClientAreaOrigin, ClientRect, ClientSize, Constraints, ContainingSizer, Cursor, DefaultAttributes, DropTarget, EffectiveMinSize, Enabled, EventHandler, ExtraStyle, Font, ForegroundColour, GrandParent, Handle, HelpText, Id, Label, LayoutDirection, MaxHeight, MaxSize, MaxWidth, MinHeight, MinSize, MinWidth, Name, Parent, Position, Rect, ScreenPosition, ScreenRect, Shown, Size, Sizer, ThemeEnabled, ToolTip, TopLevel, TopLevelParent, UpdateClientRect, UpdateRegion, Validator, VirtualSize, WindowStyle, WindowStyleFlag, WindowVariant

Inherited from wx._core.EvtHandler: EvtHandlerEnabled, NextHandler, PreviousHandler

Inherited from wx._core.Object: ClassName

Inherited from object: __class__

Method Details [hide private]

__init__(self, parent=None, id=-1, title='MathBench', config=None, pos=wx.Point(-1, -1), size=(800, 600), style=541072960, filename=None, history_dir=None)
(Constructor)

source code 
Create LabBookFrame instance.
Overrides: wx.py.editor.EditorNotebookFrame.__init__

__new__(cls, parent=None, id=-1, title='Math Bench', config=None, pos=wx.Point(-1, -1), size=(800, 600), style=541072960, filename=None, history_dir=None)
Static Method

source code 
Make sure only one instance is ever created
Returns:
a new object with type S, a subtype of T

Overrides: object.__new__

_setup(self)

source code 

Setup prior to first buffer creation.

Called automatically by base class during init.

Overrides: wx.py.editor.EditorNotebookFrame._setup

init_worksession(self)

source code 

Put here the functions to call at the begining of the working session of the shell.

This is separated from the init function, so that anybody can overwrite the content of this function.

_editorChange(self, editor)

source code 
When the editor change, update the menu options.
Overrides: wx.py.editor.EditorNotebookFrame._editorChange

bufferNew(self)

source code 

Create new buffer.

This method is redefined only to include a workaround for bug#1752674

Overrides: wx.py.editor.EditorNotebookFrame.bufferNew

OnClose(self, event)

source code 
Close everything and don't let a creepy plugin hold the end of the app.
Overrides: wx.py.editor.EditorFrame.OnClose

OnHelp(self, event)

source code 
Display a small helpign text
Overrides: wx.py.frame.Frame.OnHelp

OnAbout(self, event)

source code 
Display an About window.
Overrides: wx.py.editor.EditorNotebookFrame.OnAbout