Module bpcalendar :: Class Calendar
[hide private]
[frames] | no frames]

Class Calendar

source code

     object --+                    
              |                    
wx._core.Object --+                
                  |                
wx._core.EvtHandler --+            
                      |            
        wx._core.Window --+        
                          |        
          wx._windows.Panel --+    
                              |    
       widgets.BitPimWidget --+    
                              |    
       calendarcontrol.Calendar --+
                                  |
                                 Calendar

A class encapsulating the GUI and data of the calendar (all days). A seperate dialog is used to edit the content of one particular day.

Instance Methods [hide private]
EvtHandler
__init__(self, mainwindow, parent, id=-1)
constructor
source code
 
OnPrintDialog(self, mainwindow, config) source code
 
CanPrint(self) source code
 
OnMediaNameChanged(self, msg) source code
 
getdata(self, dict)
Return underlying calendar data in bitpim format
source code
 
updateonchange(self)
Called when our data has changed
source code
 
AddEntry(self, entry)
Adds and entry into the calendar data.
source code
 
DeleteEntry(self, entry)
Deletes an entry from the calendar data.
source code
 
DeleteEntryRepeat(self, entry, year, month, day)
Deletes a specific repeat of an entry See DeleteEntry
source code
 
ChangeEntry(self, oldentry, newentry)
Changes an entry in the calendar data.
source code
list
getentrydata(self, year, month, day)
return the entry objects for corresponding date
source code
CalendarEntry
newentryfactory(self, year, month, day)
Returns a new 'blank' entry with default fields
source code
 
getdaybitmap(self, start, repeat) source code
 
OnGetEntries(self, year, month, day)
return pretty printed sorted entries for date as required by the parent calendarcontrol.Calendar for display in a cell
source code
 
OnEdit(self, year, month, day, entry=None)
Called when the user wants to edit entries for a particular day
source code
 
OnTodayItem(self, evt) source code
 
OnTodayButton(self, evt)
Called when the user goes to today cell
source code
 
_publish_today_events(self) source code
 
_publish_thisweek_events(self) source code
 
OnTodayRequest(self, _) source code
 
_add_entries(self, entry) source code
 
populate(self, dict)
Updates the internal data with the contents of dict['calendar']
source code
 
populatefs(self, dict)
Saves the dict to disk
source code
dict
getfromfs(self, dict)
Updates dict with info from disk
source code
 
mergedata(self, result)
Merge the newdata (from the phone) into current data
source code
 
versionupgrade(self, dict, version)
Upgrade old data format read from disk
source code
 
convert_dict(self, dict, from_version, to_version, ringtone_index={})
Convert the calendatr dict from one version to another.
source code
 
_convert2to3(self, dict, ringtone_index)
Convert calendar dict from version 2 to 3.
source code
 
_convert_daily_events(self, e, d)
Conver a daily event from v3 to v2
source code
 
_convert_weekly_events(self, e, d, idx)
Convert a weekly event from v3 to v2
source code
 
_convert3to2(self, dict, ringtone_index)
Convert calendar dict from version 3 to 2.
source code

Inherited from calendarcontrol.Calendar: OnKeyDown, OnLeftDClick, OnLeftDown, OnMouseWheel, OnScrollDown, OnScrollUp, OnYearButton, RefreshAllEntries, RefreshEntry, ensureallpainted, isvisible, makerow, scrollby, setday, setselection, showday, updatecell, updaterow

Inherited from calendarcontrol.Calendar (private): _initvars, _unselect

Inherited from wx._windows.Panel: Create, SetFocusIgnoringChildren, __repr__

Inherited from wx._core.Window: AcceptsFocus, AcceptsFocusFromKeyboard, AddChild, AdjustForLayoutDirection, AssociateHandle, CacheBestSize, CanSetTransparent, CaptureMouse, Center, CenterOnParent, Centre, CentreOnParent, ClearBackground, ClientToScreen, ClientToScreenXY, ClientToWindowSize, Close, ConvertDialogPointToPixels, ConvertDialogSizeToPixels, ConvertPixelPointToDialog, ConvertPixelSizeToDialog, DLG_PNT, DLG_SZE, Destroy, DestroyChildren, Disable, DissociateHandle, DragAcceptFiles, Enable, FindWindowById, FindWindowByLabel, 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, GetGtkWidget, 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, OnPaint, PageDown, PageUp, PopEventHandler, PopupMenu, PopupMenuXY, PostCreate, PrepareDC, PushEventHandler, Raise, Refresh, RefreshRect, RegisterHotKey, ReleaseMouse, RemoveChild, RemoveEventHandler, Reparent, ScreenToClient, ScreenToClientXY, ScrollLines, ScrollPages, ScrollWindow, SendSizeEvent, 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, WindowToClientSize

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__, __new__, __reduce__, __reduce_ex__, __setattr__, __str__

Inherited from widgets.BitPimWidget: ActivateSelf, AddNode, AddSubPage, CanAdd, CanCopy, CanDelete, CanPaste, CanRename, CanSelectAll, GetAddInfo, GetDeleteInfo, GetHelpID, GetRightClickMenuItems, GetWidgetName, HasColumnSelector, HasHistoricalData, HasPreviewPane, InitialiseWidget, IsPreviewPaneEnabled, OnAdd, OnCopy, OnDelete, OnHistoricalData, OnInit, OnKeyUp, OnPaste, OnPopupMenu, OnPostActivate, OnPreActivate, OnRename, OnRightClickMenuExit, OnSelectAll, OnSelected, OnViewColumnSelector, OnViewPreview

Static Methods [hide private]

Inherited from wx._windows.Panel: GetClassDefaultAttributes

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

Class Variables [hide private]
  CURRENTFILEVERSION = 3

Inherited from calendarcontrol.Calendar: ID_DOWN, ID_TODAYBUTTON, ID_UP, ID_YEARBUTTON, attrevenmonth, attroddmonth, attrselectedcell

Inherited from widgets.BitPimWidget: MENU_CHECK, MENU_NORMAL, MENU_SPACER

Properties [hide private]

Inherited from wx._windows.Panel: thisown

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, GtkWidget, 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, mainwindow, parent, id=-1)
(Constructor)

source code 

constructor

Parameters:
  • mainwindow (gui.MainWindow) - Used to get configuration data (such as directory to save/load data.
  • parent - Widget acting as parent for this one
  • id - id
Returns: EvtHandler
Overrides: widgets.BitPimWidget.__init__

OnPrintDialog(self, mainwindow, config)

source code 
Overrides: widgets.BitPimWidget.OnPrintDialog

CanPrint(self)

source code 
Overrides: widgets.BitPimWidget.CanPrint

getdata(self, dict)

source code 

Return underlying calendar data in bitpim format

Returns:
The modified dict updated with at least dict['calendar']

updateonchange(self)

source code 

Called when our data has changed

The disk, widget and display are all updated with the new data

AddEntry(self, entry)

source code 

Adds and entry into the calendar data.

The entries on disk are updated by this function.

Parameters:
  • entry (a dict containing all the fields.) - an entry. It must contain a pos field. You should call newentryfactory to make an entry that you then modify

DeleteEntry(self, entry)

source code 

Deletes an entry from the calendar data.

The entries on disk are updated by this function.

Parameters:
  • entry (a dict containing all the fields.) - an entry. It must contain a pos field corresponding to an existing entry

ChangeEntry(self, oldentry, newentry)

source code 

Changes an entry in the calendar data.

The entries on disk are updated by this function.

OnGetEntries(self, year, month, day)

source code 

return pretty printed sorted entries for date as required by the parent calendarcontrol.Calendar for display in a cell

Overrides: calendarcontrol.Calendar.OnGetEntries

OnEdit(self, year, month, day, entry=None)

source code 

Called when the user wants to edit entries for a particular day

Overrides: calendarcontrol.Calendar.OnEdit

OnTodayButton(self, evt)

source code 

Called when the user goes to today cell

Overrides: calendarcontrol.Calendar.OnTodayButton

getfromfs(self, dict)

source code 

Updates dict with info from disk

Parameters:
  • dict - the dictionary to update
Returns: dict
the updated dictionary

Note: The dictionary passed in is modified, as well as returned

versionupgrade(self, dict, version)

source code 

Upgrade old data format read from disk

Parameters:
  • dict - The dict that was read in
  • version - version number of the data on disk

convert_dict(self, dict, from_version, to_version, ringtone_index={})

source code 

Convert the calendatr dict from one version to another. Currently only support conversion between version 2 and 3.