C# Class SIL.FieldWorks.Common.Framework.FwMainWnd

Base class for all top level application windows for FieldWorks apps.
FwMainWnd is the base class for all top-level application windows for FieldWorks apps. Technically, it should be abstract, but that makes it so it won't work in Designer.
Inheritance: System.Windows.Forms.Form, IFWDisposable, ISettings, IFwMainWnd, IxCoreColleague, IRegistryKeyNameModifier, IMainWindowDelegateCallbacks
Datei anzeigen Open project: sillsdev/FieldWorks Class Usage Examples

Protected Properties

Property Type Description
informationBarOverlaysButton InformationBarButton
m_StyleSheet FwStyleSheet
m_UndoRedoDropDown UndoRedoDropDown
m_app FwApp
m_beingDisposed bool
m_cache FdoCache
m_cboZoomPercent ComboBox
m_charStylesComboBox ComboBox
m_delegate MainWindowDelegate
m_fFullWindow bool
m_fWindowIsCopy bool
m_infoBarContainer Panel
m_paraStylesComboBox ComboBox
m_persistence Persistence
m_rgClientViews IRootSite>.Dictionary
m_selectedView ISelectableView
m_sibAdapter ISIBInterface
m_sideBarContainer Panel
m_tmAdapter ITMAdapter
m_viewHelper ActiveViewHelper
m_writingSystemSelector ComboBox
splitContainer FwSplitContainer

Private Properties

Property Type Description
CreateMenusAndToolBars void
GiveStyleComboCurrStyleName string
HandleActivation void
InitializeComponent void
InitializeToolBarCombos void
LoadCustomToolBarControls System.Windows.Forms.Control
PercentString string
ProjectNameChanged void
UpdateMenuRequiringValidView bool
ZoomKeyPress void
ZoomLostFocus void
ZoomSelectionChanged void
ZoomTextValid bool
m_writingSystemSelector_SelectedIndexChanged void

Public Methods

Method Description
CheckDisposed ( ) : void

Check to see if the object has been disposed. All public Properties and Methods should call this before doing anything else.

CreateContextMenu ( string name ) : ContextMenuStrip

Create the desired context menu.

EnableWindow ( bool fEnable ) : void

Enable or disable this window.

FwMainWnd ( FwApp app, Form wndCopyFrom ) : System

Initializes a new instance of the FwMainWnd class.

GetMessageTargets ( ) : IxCoreColleague[]

Get the possible message targets, i.e. the view(s) we are showing

GetNamedView ( string name ) : Control

Searches the main window (and all it's child controls) for a view with the specified name.

GetNamedView ( string name, Control startCtrl ) : Control

Searches a specified control (and all it's child controls) for a view with the specified name.

Init ( XCore.Mediator mediator, System configurationParameters ) : void

Not used

InitAndShowClient ( ) : void

Create the client windows and add correspnding stuff to the sidebar, View menu, etc. Subclasses must override this.

InitStyleComboBox ( ) : void

Reload the styles combo box and update it's current value.

OnEditFind ( object args ) : bool

Handle the Find menu command.

OnFileExit ( object sender ) : bool

Close all windows and shut down the application

OnFileNew ( object args ) : bool

The "New FieldWorks Project" menu option has been selected. Display the New FieldWorks Project dialog.

OnFinishedInit ( ) : bool

Called when a window is finished being created and completely initialized. We use this to set the new owner of the Find/Replace dialog (OnActivated gets called after the main window is created, but at that point we don't have any views yet).

OnNewWindow ( object args ) : bool

Creates a new window

OnPageSetup ( object args ) : bool

Handle the Page Setup menu option.

OnStylesRenamedOrDeleted ( ) : void

Called when styles are renamed or deleted.

OnUpdateFormatApplyStyle ( object args ) : bool

Update the Enabled state of the Format Apply Style dialog menu option

PopulateParaStyleListOverride ( ) : bool

Allows individual implementations to override the default behavior when populating the paragraph style list.

PreSynchronize ( SyncMsg sync ) : void

Called just before a window syncronizes it's views with DB changes (e.g. when an undo or redo command is issued).

RefreshAllViews ( ) : void

Refreshes all the views in this Main Window.

SaveSettingsNow ( ) : void

Save the persisted settings now.

ShowFilterStatusBarMessage ( bool fShow ) : void

Shows or hides the status bar message displayed when a filter is active

StyleChosenFromStylesComboBox ( StyleListItem prevStyle, StyleListItem newStyle ) : void

This event is called by the styles combo box when the user chooses a style from the combo box.

SwitchActiveView ( ISelectableView selectedView ) : bool

Hide the previously active client window and activate the new one

Synchronize ( SyncMsg sync ) : bool

Called when a window syncronizes it's views with DB changes (e.g. when an undo or redo command is issued).

UpdateCaptionBar ( ) : void

Show the application name and project name in the caption bar.

UpdateStyleComboBoxValue ( IRootSite rootsite ) : void

Updates the styles combo boxes on the formatting toolbar, with the correct style name.

UpdateWritingSystemSelectorForSelection ( IVwRootBox rootbox ) : void

Updates the Writiing System selector combo box

UpdateWritingSystemsInCombobox ( ) : void

Reloads all the writing systems in the writing system selector combo box

Protected Methods

Method Description
AddSideBarTabItem ( string tab, SIL.FieldWorks.Common.UIAdapters.SBTabItemProperties itemProps ) : void

Adds tab items to the sidebar (if the adapter is not null) via the sidebar/info. bar adapter. When running tests, the adapter will be null.

CreatePageSetupDialog ( IPubPageLayout pgl, IPublication pub, IPubDivision div ) : IPageSetupDialog

Creates the page setup dialog.

CreateSideBarInfoBarAdapter ( ) : void

Create and initializes a new sidebar/info. bar adapter.

Dispose ( bool disposing ) : void

Clean up any resources being used.

FwMainWnd ( ) : System

Default constructor for FwMainWnd.

FwMainWnd ( SIL.FieldWorks.FDO.FdoCache cache ) : System

Initializes a new instance of the FwMainWnd class.

GetAppSpecificMenuToolBarDefinition ( ) : string

Applications containing derivations of this class implement this if they have their own toolbars they want added to the toolbar container.

GetCurrentStyleNames ( string &paraStyleName, string &charStyleName ) : void

Gets the current style names from the selected text

GetDefaultItemForTab ( string tabName ) : string

Get the name of the default sidebar item for the given tab. Applications should override this if they want to work well.

InitStyleSheet ( int hvoStylesOwner, int tagStylesList ) : void

This should be called by derived classes, usually in the OnLoad event and also as part of synchronization when styles have been changed by another client.

InitializeAppSpecificToolBarCombos ( string name, ComboBox cboItem ) : void

Applications containing derivations of this class implement this if they have their own toolbar combo boxes they want to initialize.

InitializeContextMenus ( string generalFile, string specificFile ) : void

Store any data needed for creating context menus.

InitializeUndoRedoDropDown ( SIL.FieldWorks.Common.UIAdapters.ToolBarPopupInfo popupInfo, string singleAction, string multipleActions, string cancel ) : void

LoadAppSpecificCustomToolBarControls ( string name, string tooltip ) : Control

Applications containing derivations of this class implement this if they have their own custom control they want on a toolbar.

OnActivated ( EventArgs e ) : void

This main window is now the active one, so he has to take over ownership of the find/replace dialog. Also a good time to handle any data changes made in other applications. Also makes our undo stack active.

OnBackupProject ( object arg ) : bool

Handle the File/Backup menu command

OnClosing ( CancelEventArgs e ) : void

Cancels the closing if there is some data update in progress.

OnCreateShortcut ( object args ) : bool

Handle the Create Shortcut on Desktop menu/toolbar item.

OnCustomizeToolBars ( object args ) : bool

Show the dialog to allow users to customize toolbars.

OnDeactivate ( EventArgs e ) : void

Disable the selection in the current view.

OnDropDownEditRedo ( object args ) : bool

This function will drop down the redo list box

OnDropDownEditUndo ( object args ) : bool

This function will drop down the undo list box

OnDropDownFormatBackgroundColor ( object args ) : bool

OnDropDownFormatForegroundColor ( object args ) : bool

OnEditCopy ( object args ) : bool

Handle the Edit/Copy menu command.

Formerly AfVwRootSite::CmdEditCopy1

OnEditCut ( object args ) : bool

Handle the Edit/Cut menu command.

Formerly AfVwRootSite::CmdEditCut1

OnEditDelete ( object args ) : bool

Handle the Edit/Delete menu command.

Formerly AfVwRootSite::CmdEditDel1

OnEditFindNext ( object args ) : bool

Handle the Find Next menu command.

OnEditFindPrev ( object args ) : bool

Handle the Find Next menu command.

OnEditPaste ( object args ) : bool

Handle the Edit/Paste menu command.

Formerly AfVwRootSite::CmdEditPaste1

OnEditRedo ( object args ) : bool

This function will redo the last changes undone to the project. This function is executed when the user clicks the redo menu item.

OnEditReplace ( object args ) : bool

Handle the Replace menu command.

OnEditUndo ( object args ) : bool

This function will undo the last changes done to the project. This function is executed when the user clicks the undo menu item.

OnFileClose ( object args ) : bool

Close this window

OnFileDelete ( object args ) : bool

Close this window

OnFileOpen ( object args ) : bool

Display a dialog to allow the user to open a new language project.

OnFilePrint ( object args ) : bool

OnFileProjectProperties ( object args ) : bool

Display the project properties dialog

OnFileProjectSharingLocation ( object arg ) : bool

Handle the File/Restore menu command

OnFileSave ( object args ) : bool

Save to the database; does NOT force clearing undo stack.

OnFormatApplyStyle ( object args ) : bool

Shows the apply style dialog

OnFormatBackgroundColor ( object args ) : bool

OnFormatBorders ( object args ) : bool

OnFormatStyle ( object args ) : bool

Shows the styles dialog

OnHelpAbout ( object args ) : bool

Show About box

OnLayout ( LayoutEventArgs levent ) : void

Raises the E:Layout event.

OnLoad ( EventArgs e ) : void

OnMoreWindows ( object args ) : bool

OnRedoDropDownClicked ( object sender, int iClicked ) : void

User clicked an item in the Redo drop down

OnResize ( EventArgs e ) : void

OnRestoreProject ( object arg ) : bool

Handle the File/Restore menu command

OnSideBar ( object args ) : bool

Toggles the side bar's visibility.

OnSideBarTabClicked ( object args ) : bool

This will get called when the current tab in the sidebar changes. When that happens, we need to make sure the view changes to the one associated with the new tab's current item. If the new tab doesn't have a current item, then we need to set one.

OnStatusBar ( object args ) : bool

Toggles the status bar's visibility.

OnSwitchActiveView ( object args ) : bool

Hide the previously active view and activate the new one (corresponding to the button clicked in the sidebar (or the menu item chosen).

OnToggleToolBarVisiblilty ( object args ) : bool

Toggles the visibility of a toolbar.

OnToolsUserProperties ( object args ) : bool

Show User Properties dialog

OnUndoDropDownClicked ( object sender, int iClicked ) : void

User clicked an item in the Undo drop down

OnUpdateEditCopy ( object args ) : bool

Called to enable or disable the Edit/Copy menu item

OnUpdateEditCut ( object args ) : bool

Called to enable or disable the Edit/Cut menu item

OnUpdateEditDelete ( object args ) : bool

Called to enable or disable the Edit/Delete menu item

OnUpdateEditFind ( object args ) : bool

Determine if Edit Find menu item should be enabled.

OnUpdateEditFindNext ( object args ) : bool

Determine if Edit Find Next menu item should be enabled.

OnUpdateEditFindPrev ( object args ) : bool

Determine if Edit Find Prev menu item should be enabled.

OnUpdateEditPaste ( object args ) : bool

Called to enable or disable the Edit/Paste menu item

OnUpdateEditRedo ( object args ) : bool

Disables/enables the Edit/Redo menu item

OnUpdateEditReplace ( object args ) : bool

Determine if Edit Replace menu item should be enabled.

OnUpdateEditUndo ( object args ) : bool

Disables/enables the Edit/Undo menu item

OnUpdateFileDelete ( object arg ) : bool

OnUpdateFilePrint ( object args ) : bool

Called to enable or disable the File/Print menu item. We disable it for views that have no corresponding publication.

OnUpdateFileProjectSharingLocation ( object args ) : bool

Updates the enabled state of the File Project Sharing Location menu item

OnUpdateFileSave ( object args ) : bool

If there is nothing to save then disable the File/Save menu item and toolbar button.

OnUpdatePageSetup ( object args ) : bool

Called to enable or disable the Edit/Copy menu item

OnUpdateSideBar ( object arg ) : bool

Updates the side bar menu item

OnUpdateStatusBar ( object arg ) : bool

Updates the status bar menu item

OnUpdateToggleToolBarVisiblilty ( object args ) : bool

Updates the checked status of the toolbar menu items off the view menu.

OnUpdateToolsUserProperties ( object args ) : bool

Disables the User properties dialog because that doesn't really do anything

OnUpdateViewFullWindow ( object args ) : bool

Toggles side bar and toolbar's visibility

OnUpdateViewZoom ( object args ) : bool

Updates the value in the zoom combo box with the active view's zoom percentage.

OnUpdateWindowActivate ( object args ) : bool

Handle the initialization of the Window menu, before it is displayed. We must establish menu items for each current main window of our app.

OnViewFullWindow ( object args ) : bool

Toggles side bar, status bar and toolbar's visibility

OnViewRefresh ( object args ) : bool

Refresh the current view

OnWindowActivate ( object sender ) : bool

For handling clicks on the dynamically added list of windows in the window menu. Changes focus to the window associated with the sender.

OnWindowCascade ( object sender ) : bool

Cascade all the windows

OnWindowTileSideBySide ( object sender ) : bool

Tile the windows from side to side

OnWindowTileStacked ( object sender ) : bool

Tile the windows from top to bottom

OnZoomPercentageChanged ( float oldZoomPercentage, float newZoomPercentage ) : void

Called when the zoom percentage changed.

PageSetupPreparePublication ( IPublication &publication, IPubDivision &division, IPubPageLayout &pageLayout ) : bool

Sets up a publication for OnPageSetup.

This was the top half of OnPageSetup originally. It was refactored to avoid duplicating code in an override of OnPageSetup in TeMainWind.

ReSynchStyleSheet ( ) : void

This should be called by derived classes, usually as part of synchronization when styles have been changed by another client.

SaveSettings ( RegistryKey key ) : void

Save UI settings specific to this window.

SetPropsToFactorySettings ( StyleInfo styleInfo ) : void

Set the properties of a StyleInfo to the factory default settings

ShowApplyStyleDialog ( string paraStyleName, string charStyleName ) : void

Shows the Format Apply Style dialog

ShowTestableDialog ( Form dialog ) : DialogResult

The purpose for this method is to deal with modal dialogs that need to be tested

ZoomChanged ( ) : void

ZoomEnabledForView ( SimpleRootSite view ) : bool

Derived classes may override this in case they contain SimpleRootSites that cannot be zoomed.

Private Methods

Method Description
CreateMenusAndToolBars ( ) : void
GiveStyleComboCurrStyleName ( StyleType type ) : string

This event is called by the styles combo box when it needs to know what styles are in the current selection.

HandleActivation ( ) : void
InitializeComponent ( ) : void

Required method for Designer support - do not modify the contents of this method with the code editor.

InitializeToolBarCombos ( string name, ComboBox combo ) : void

This delegate gets called by the toolbar adapter in order to allow us to initialize combo boxes. Use it to initialize the zoom and styles combos.

LoadCustomToolBarControls ( string name, string tooltip ) : Control

This delegate will return the appropriate control when control container items request the control to contain.

PercentString ( int percent ) : string

Build a string to represent a percentage (50 -> 50%).

ProjectNameChanged ( FdoCache sender ) : void

Handles a project name change.

UpdateMenuRequiringValidView ( TMItemProperties itemProps ) : bool

Determine if the given menu item should be enabled, based on whether there is a valid view and constructed rootbox.

ZoomKeyPress ( object sender, KeyPressEventArgs e ) : void

User has pressed a key in the zoom percentage control

ZoomLostFocus ( object sender, EventArgs e ) : void

The zoom control has lost focus

ZoomSelectionChanged ( object sender, EventArgs e ) : void

User has changed the zoom percentage with the drop down list.

ZoomTextValid ( int &newVal ) : bool

Validate the zoom text

m_writingSystemSelector_SelectedIndexChanged ( object sender, EventArgs e ) : void

Method Details

AddSideBarTabItem() protected method

Adds tab items to the sidebar (if the adapter is not null) via the sidebar/info. bar adapter. When running tests, the adapter will be null.
protected AddSideBarTabItem ( string tab, SIL.FieldWorks.Common.UIAdapters.SBTabItemProperties itemProps ) : void
tab string
itemProps SIL.FieldWorks.Common.UIAdapters.SBTabItemProperties
return void

CheckDisposed() public method

Check to see if the object has been disposed. All public Properties and Methods should call this before doing anything else.
public CheckDisposed ( ) : void
return void

CreateContextMenu() public method

Create the desired context menu.
public CreateContextMenu ( string name ) : ContextMenuStrip
name string The name.
return System.Windows.Forms.ContextMenuStrip

CreatePageSetupDialog() protected method

Creates the page setup dialog.
protected CreatePageSetupDialog ( IPubPageLayout pgl, IPublication pub, IPubDivision div ) : IPageSetupDialog
pgl IPubPageLayout The PubPageLayout object
pub IPublication The Publication object
div IPubDivision The PubDivision object
return IPageSetupDialog

CreateSideBarInfoBarAdapter() protected method

Create and initializes a new sidebar/info. bar adapter.
protected CreateSideBarInfoBarAdapter ( ) : void
return void

Dispose() protected method

Clean up any resources being used.
protected Dispose ( bool disposing ) : void
disposing bool
return void

EnableWindow() public method

Enable or disable this window.
public EnableWindow ( bool fEnable ) : void
fEnable bool Enable (true) or disable (false).
return void

FwMainWnd() protected method

Default constructor for FwMainWnd.
protected FwMainWnd ( ) : System
return System

FwMainWnd() protected method

Initializes a new instance of the FwMainWnd class.
protected FwMainWnd ( SIL.FieldWorks.FDO.FdoCache cache ) : System
cache SIL.FieldWorks.FDO.FdoCache The cache.
return System

FwMainWnd() public method

Initializes a new instance of the FwMainWnd class.
public FwMainWnd ( FwApp app, Form wndCopyFrom ) : System
app FwApp The app.
wndCopyFrom System.Windows.Forms.Form The Window to copy from.
return System

GetAppSpecificMenuToolBarDefinition() protected method

Applications containing derivations of this class implement this if they have their own toolbars they want added to the toolbar container.
protected GetAppSpecificMenuToolBarDefinition ( ) : string
return string

GetCurrentStyleNames() protected method

Gets the current style names from the selected text
protected GetCurrentStyleNames ( string &paraStyleName, string &charStyleName ) : void
paraStyleName string Name of the para style.
charStyleName string Name of the char style.
return void

GetDefaultItemForTab() protected method

Get the name of the default sidebar item for the given tab. Applications should override this if they want to work well.
protected GetDefaultItemForTab ( string tabName ) : string
tabName string Name of the sidebar tab
return string

GetMessageTargets() public method

Get the possible message targets, i.e. the view(s) we are showing
public GetMessageTargets ( ) : IxCoreColleague[]
return IxCoreColleague[]

GetNamedView() public method

Searches the main window (and all it's child controls) for a view with the specified name.
public GetNamedView ( string name ) : Control
name string
return System.Windows.Forms.Control

GetNamedView() public method

Searches a specified control (and all it's child controls) for a view with the specified name.
public GetNamedView ( string name, Control startCtrl ) : Control
name string
startCtrl System.Windows.Forms.Control
return System.Windows.Forms.Control

Init() public method

Not used
public Init ( XCore.Mediator mediator, System configurationParameters ) : void
mediator XCore.Mediator The mediator.
configurationParameters System The configuration parameters.
return void

InitAndShowClient() public method

Create the client windows and add correspnding stuff to the sidebar, View menu, etc. Subclasses must override this.
public InitAndShowClient ( ) : void
return void

InitStyleComboBox() public method

Reload the styles combo box and update it's current value.
public InitStyleComboBox ( ) : void
return void

InitStyleSheet() protected method

This should be called by derived classes, usually in the OnLoad event and also as part of synchronization when styles have been changed by another client.
protected InitStyleSheet ( int hvoStylesOwner, int tagStylesList ) : void
hvoStylesOwner int the owning object
tagStylesList int the owner(hvoStylesOwner)'s field ID which holds the /// collection of StStyle objects
return void

InitializeAppSpecificToolBarCombos() protected method

Applications containing derivations of this class implement this if they have their own toolbar combo boxes they want to initialize.
protected InitializeAppSpecificToolBarCombos ( string name, ComboBox cboItem ) : void
name string
cboItem System.Windows.Forms.ComboBox
return void

InitializeContextMenus() protected method

Store any data needed for creating context menus.
protected InitializeContextMenus ( string generalFile, string specificFile ) : void
generalFile string The general file.
specificFile string The specific file.
return void

InitializeUndoRedoDropDown() protected method

protected InitializeUndoRedoDropDown ( SIL.FieldWorks.Common.UIAdapters.ToolBarPopupInfo popupInfo, string singleAction, string multipleActions, string cancel ) : void
popupInfo SIL.FieldWorks.Common.UIAdapters.ToolBarPopupInfo
singleAction string
multipleActions string
cancel string
return void

LoadAppSpecificCustomToolBarControls() protected method

Applications containing derivations of this class implement this if they have their own custom control they want on a toolbar.
protected LoadAppSpecificCustomToolBarControls ( string name, string tooltip ) : Control
name string Name of the toolbar container item for which a control is /// requested.
tooltip string The tooltip to assign to the custom control.
return System.Windows.Forms.Control

OnActivated() protected method

This main window is now the active one, so he has to take over ownership of the find/replace dialog. Also a good time to handle any data changes made in other applications. Also makes our undo stack active.
protected OnActivated ( EventArgs e ) : void
e System.EventArgs
return void

OnBackupProject() protected method

Handle the File/Backup menu command
protected OnBackupProject ( object arg ) : bool
arg object
return bool

OnClosing() protected method

Cancels the closing if there is some data update in progress.
protected OnClosing ( CancelEventArgs e ) : void
e CancelEventArgs
return void

OnCreateShortcut() protected method

Handle the Create Shortcut on Desktop menu/toolbar item.
protected OnCreateShortcut ( object args ) : bool
args object
return bool

OnCustomizeToolBars() protected method

Show the dialog to allow users to customize toolbars.
protected OnCustomizeToolBars ( object args ) : bool
args object
return bool

OnDeactivate() protected method

Disable the selection in the current view.
protected OnDeactivate ( EventArgs e ) : void
e System.EventArgs
return void

OnDropDownEditRedo() protected method

This function will drop down the redo list box
protected OnDropDownEditRedo ( object args ) : bool
args object
return bool

OnDropDownEditUndo() protected method

This function will drop down the undo list box
protected OnDropDownEditUndo ( object args ) : bool
args object
return bool

OnDropDownFormatBackgroundColor() protected method

protected OnDropDownFormatBackgroundColor ( object args ) : bool
args object
return bool

OnDropDownFormatForegroundColor() protected method

protected OnDropDownFormatForegroundColor ( object args ) : bool
args object
return bool

OnEditCopy() protected method

Handle the Edit/Copy menu command.
Formerly AfVwRootSite::CmdEditCopy1
protected OnEditCopy ( object args ) : bool
args object The arguments
return bool

OnEditCut() protected method

Handle the Edit/Cut menu command.
Formerly AfVwRootSite::CmdEditCut1
protected OnEditCut ( object args ) : bool
args object The arguments
return bool

OnEditDelete() protected method

Handle the Edit/Delete menu command.
Formerly AfVwRootSite::CmdEditDel1
protected OnEditDelete ( object args ) : bool
args object The arguments
return bool

OnEditFind() public method

Handle the Find menu command.
public OnEditFind ( object args ) : bool
args object Arguments
return bool

OnEditFindNext() protected method

Handle the Find Next menu command.
protected OnEditFindNext ( object args ) : bool
args object Arguments
return bool

OnEditFindPrev() protected method

Handle the Find Next menu command.
protected OnEditFindPrev ( object args ) : bool
args object Arguments
return bool

OnEditPaste() protected method

Handle the Edit/Paste menu command.
Formerly AfVwRootSite::CmdEditPaste1
protected OnEditPaste ( object args ) : bool
args object The arguments
return bool

OnEditRedo() protected method

This function will redo the last changes undone to the project. This function is executed when the user clicks the redo menu item.
protected OnEditRedo ( object args ) : bool
args object
return bool

OnEditReplace() protected method

Handle the Replace menu command.
protected OnEditReplace ( object args ) : bool
args object Arguments
return bool

OnEditUndo() protected method

This function will undo the last changes done to the project. This function is executed when the user clicks the undo menu item.
protected OnEditUndo ( object args ) : bool
args object If this command is being called directly from a menu command, /// this parameter is the adapter menu item; otherwise, if this is being called as part /// of a batch, pass null. If this is not null, then in the case of a failure result /// from the undo, a message will be displayed. If this is null, then this method will /// return false, so the caller can display an error message if appropriate.
return bool

OnFileClose() protected method

Close this window
protected OnFileClose ( object args ) : bool
args object The menu item
return bool

OnFileDelete() protected method

Close this window
protected OnFileDelete ( object args ) : bool
args object The menu item
return bool

OnFileExit() public method

Close all windows and shut down the application
public OnFileExit ( object sender ) : bool
sender object
return bool

OnFileNew() public method

The "New FieldWorks Project" menu option has been selected. Display the New FieldWorks Project dialog.
public OnFileNew ( object args ) : bool
args object ignored
return bool

OnFileOpen() protected method

Display a dialog to allow the user to open a new language project.
protected OnFileOpen ( object args ) : bool
args object ignored
return bool

OnFilePrint() protected method

protected OnFilePrint ( object args ) : bool
args object
return bool

OnFileProjectProperties() protected method

Display the project properties dialog
protected OnFileProjectProperties ( object args ) : bool
args object
return bool

OnFileProjectSharingLocation() protected method

Handle the File/Restore menu command
protected OnFileProjectSharingLocation ( object arg ) : bool
arg object
return bool

OnFileSave() protected method

Save to the database; does NOT force clearing undo stack.
protected OnFileSave ( object args ) : bool
args object Menu item or toolbar item
return bool

OnFinishedInit() public method

Called when a window is finished being created and completely initialized. We use this to set the new owner of the Find/Replace dialog (OnActivated gets called after the main window is created, but at that point we don't have any views yet).
public OnFinishedInit ( ) : bool
return bool

OnFormatApplyStyle() protected method

Shows the apply style dialog
protected OnFormatApplyStyle ( object args ) : bool
args object ignored
return bool

OnFormatBackgroundColor() protected method

protected OnFormatBackgroundColor ( object args ) : bool
args object
return bool

OnFormatBorders() protected method

protected OnFormatBorders ( object args ) : bool
args object
return bool

OnFormatStyle() protected method

Shows the styles dialog
protected OnFormatStyle ( object args ) : bool
args object ignored
return bool

OnHelpAbout() protected method

Show About box
protected OnHelpAbout ( object args ) : bool
args object
return bool

OnLayout() protected method

Raises the E:Layout event.
protected OnLayout ( LayoutEventArgs levent ) : void
levent LayoutEventArgs The instance containing the event data.
return void

OnLoad() protected method

protected OnLoad ( EventArgs e ) : void
e EventArgs
return void

OnMoreWindows() protected method

protected OnMoreWindows ( object args ) : bool
args object the item that was clicked on
return bool

OnNewWindow() public method

Creates a new window
public OnNewWindow ( object args ) : bool
args object The menu or toolbar item
return bool

OnPageSetup() public method

Handle the Page Setup menu option.
public OnPageSetup ( object args ) : bool
args object
return bool

OnRedoDropDownClicked() protected method

User clicked an item in the Redo drop down
protected OnRedoDropDownClicked ( object sender, int iClicked ) : void
sender object
iClicked int Zero-based index of clicked item
return void

OnResize() protected method

protected OnResize ( EventArgs e ) : void
e EventArgs
return void

OnRestoreProject() protected method

Handle the File/Restore menu command
protected OnRestoreProject ( object arg ) : bool
arg object
return bool

OnSideBar() protected method

Toggles the side bar's visibility.
protected OnSideBar ( object args ) : bool
args object
return bool

OnSideBarTabClicked() protected method

This will get called when the current tab in the sidebar changes. When that happens, we need to make sure the view changes to the one associated with the new tab's current item. If the new tab doesn't have a current item, then we need to set one.
protected OnSideBarTabClicked ( object args ) : bool
args object SBTabProperties
return bool

OnStatusBar() protected method

Toggles the status bar's visibility.
protected OnStatusBar ( object args ) : bool
args object The menu item
return bool

OnStylesRenamedOrDeleted() public method

Called when styles are renamed or deleted.
public OnStylesRenamedOrDeleted ( ) : void
return void

OnSwitchActiveView() protected method

Hide the previously active view and activate the new one (corresponding to the button clicked in the sidebar (or the menu item chosen).
protected OnSwitchActiveView ( object args ) : bool
args object
return bool

OnToggleToolBarVisiblilty() protected method

Toggles the visibility of a toolbar.
protected OnToggleToolBarVisiblilty ( object args ) : bool
args object Menu item indicating what toolbar's visibility will be toggled. ///
return bool

OnToolsUserProperties() protected method

Show User Properties dialog
protected OnToolsUserProperties ( object args ) : bool
args object
return bool

OnUndoDropDownClicked() protected method

User clicked an item in the Undo drop down
protected OnUndoDropDownClicked ( object sender, int iClicked ) : void
sender object
iClicked int Zero-based index of clicked item
return void

OnUpdateEditCopy() protected method

Called to enable or disable the Edit/Copy menu item
protected OnUpdateEditCopy ( object args ) : bool
args object The menu item
return bool

OnUpdateEditCut() protected method

Called to enable or disable the Edit/Cut menu item
protected OnUpdateEditCut ( object args ) : bool
args object The menu item
return bool

OnUpdateEditDelete() protected method

Called to enable or disable the Edit/Delete menu item
protected OnUpdateEditDelete ( object args ) : bool
args object The menu item
return bool

OnUpdateEditFind() protected method

Determine if Edit Find menu item should be enabled.
protected OnUpdateEditFind ( object args ) : bool
args object The menu item properties
return bool

OnUpdateEditFindNext() protected method

Determine if Edit Find Next menu item should be enabled.
protected OnUpdateEditFindNext ( object args ) : bool
args object The menu item properties
return bool

OnUpdateEditFindPrev() protected method

Determine if Edit Find Prev menu item should be enabled.
protected OnUpdateEditFindPrev ( object args ) : bool
args object The menu item properties
return bool

OnUpdateEditPaste() protected method

Called to enable or disable the Edit/Paste menu item
protected OnUpdateEditPaste ( object args ) : bool
args object The menu item
return bool

OnUpdateEditRedo() protected method

Disables/enables the Edit/Redo menu item
protected OnUpdateEditRedo ( object args ) : bool
args object Menu item
return bool

OnUpdateEditReplace() protected method

Determine if Edit Replace menu item should be enabled.
protected OnUpdateEditReplace ( object args ) : bool
args object The menu item properties
return bool

OnUpdateEditUndo() protected method

Disables/enables the Edit/Undo menu item
protected OnUpdateEditUndo ( object args ) : bool
args object Menu item
return bool

OnUpdateFileDelete() protected method

protected OnUpdateFileDelete ( object arg ) : bool
arg object
return bool

OnUpdateFilePrint() protected method

Called to enable or disable the File/Print menu item. We disable it for views that have no corresponding publication.
protected OnUpdateFilePrint ( object args ) : bool
args object The menu item
return bool

OnUpdateFileProjectSharingLocation() protected method

Updates the enabled state of the File Project Sharing Location menu item
protected OnUpdateFileProjectSharingLocation ( object args ) : bool
args object
return bool

OnUpdateFileSave() protected method

If there is nothing to save then disable the File/Save menu item and toolbar button.
protected OnUpdateFileSave ( object args ) : bool
args object
return bool

OnUpdateFormatApplyStyle() public method

Update the Enabled state of the Format Apply Style dialog menu option
public OnUpdateFormatApplyStyle ( object args ) : bool
args object The menu/toolbar item
return bool

OnUpdatePageSetup() protected method

Called to enable or disable the Edit/Copy menu item
protected OnUpdatePageSetup ( object args ) : bool
args object The menu item
return bool

OnUpdateSideBar() protected method

Updates the side bar menu item
protected OnUpdateSideBar ( object arg ) : bool
arg object The menu or toolbar item
return bool

OnUpdateStatusBar() protected method

Updates the status bar menu item
protected OnUpdateStatusBar ( object arg ) : bool
arg object The menu or toolbar item
return bool

OnUpdateToggleToolBarVisiblilty() protected method

Updates the checked status of the toolbar menu items off the view menu.
protected OnUpdateToggleToolBarVisiblilty ( object args ) : bool
args object
return bool

OnUpdateToolsUserProperties() protected method

Disables the User properties dialog because that doesn't really do anything
protected OnUpdateToolsUserProperties ( object args ) : bool
args object The menu or toolbar item
return bool

OnUpdateViewFullWindow() protected method

Toggles side bar and toolbar's visibility
protected OnUpdateViewFullWindow ( object args ) : bool
args object
return bool

OnUpdateViewZoom() protected method

Updates the value in the zoom combo box with the active view's zoom percentage.
protected OnUpdateViewZoom ( object args ) : bool
args object
return bool

OnUpdateWindowActivate() protected method

Handle the initialization of the Window menu, before it is displayed. We must establish menu items for each current main window of our app.
protected OnUpdateWindowActivate ( object args ) : bool
args object ignored
return bool

OnViewFullWindow() protected method

Toggles side bar, status bar and toolbar's visibility
protected OnViewFullWindow ( object args ) : bool
args object
return bool

OnViewRefresh() protected method

Refresh the current view
protected OnViewRefresh ( object args ) : bool
args object
return bool

OnWindowActivate() protected method

For handling clicks on the dynamically added list of windows in the window menu. Changes focus to the window associated with the sender.
protected OnWindowActivate ( object sender ) : bool
sender object the WindowMenuItem that was clicked on
return bool

OnWindowCascade() protected method

Cascade all the windows
protected OnWindowCascade ( object sender ) : bool
sender object
return bool

OnWindowTileSideBySide() protected method

Tile the windows from side to side
protected OnWindowTileSideBySide ( object sender ) : bool
sender object
return bool

OnWindowTileStacked() protected method

Tile the windows from top to bottom
protected OnWindowTileStacked ( object sender ) : bool
sender object
return bool

OnZoomPercentageChanged() protected method

Called when the zoom percentage changed.
protected OnZoomPercentageChanged ( float oldZoomPercentage, float newZoomPercentage ) : void
oldZoomPercentage float The previous zoom percentage.
newZoomPercentage float The new zoom percentage.
return void

PageSetupPreparePublication() protected method

Sets up a publication for OnPageSetup.
This was the top half of OnPageSetup originally. It was refactored to avoid duplicating code in an override of OnPageSetup in TeMainWind.
protected PageSetupPreparePublication ( IPublication &publication, IPubDivision &division, IPubPageLayout &pageLayout ) : bool
publication IPublication A publication to use for page setup.
division IPubDivision Publication Division for pub
pageLayout IPubPageLayout A publication page layout for pub
return bool

PopulateParaStyleListOverride() public method

Allows individual implementations to override the default behavior when populating the paragraph style list.
public PopulateParaStyleListOverride ( ) : bool
return bool

PreSynchronize() public abstract method

Called just before a window syncronizes it's views with DB changes (e.g. when an undo or redo command is issued).
public abstract PreSynchronize ( SyncMsg sync ) : void
sync SyncMsg syncronization message
return void

ReSynchStyleSheet() protected method

This should be called by derived classes, usually as part of synchronization when styles have been changed by another client.
protected ReSynchStyleSheet ( ) : void
return void

RefreshAllViews() public method

Refreshes all the views in this Main Window.
public RefreshAllViews ( ) : void
return void

SaveSettings() protected method

Save UI settings specific to this window.
protected SaveSettings ( RegistryKey key ) : void
key RegistryKey The Registry Key.
return void

SaveSettingsNow() public method

Save the persisted settings now.
public SaveSettingsNow ( ) : void
return void

SetPropsToFactorySettings() protected abstract method

Set the properties of a StyleInfo to the factory default settings
protected abstract SetPropsToFactorySettings ( StyleInfo styleInfo ) : void
styleInfo StyleInfo
return void

ShowApplyStyleDialog() protected method

Shows the Format Apply Style dialog
protected ShowApplyStyleDialog ( string paraStyleName, string charStyleName ) : void
paraStyleName string The currently-selected Paragraph style name
charStyleName string The currently-selected Character style name
return void

ShowFilterStatusBarMessage() public method

Shows or hides the status bar message displayed when a filter is active
public ShowFilterStatusBarMessage ( bool fShow ) : void
fShow bool true to display the filter message, false /// otherwise
return void

ShowTestableDialog() protected method

The purpose for this method is to deal with modal dialogs that need to be tested
protected ShowTestableDialog ( Form dialog ) : DialogResult
dialog Form
return DialogResult

StyleChosenFromStylesComboBox() public method

This event is called by the styles combo box when the user chooses a style from the combo box.
public StyleChosenFromStylesComboBox ( StyleListItem prevStyle, StyleListItem newStyle ) : void
prevStyle StyleListItem The previously selected style (not used)
newStyle StyleListItem The new style
return void

SwitchActiveView() public method

Hide the previously active client window and activate the new one
public SwitchActiveView ( ISelectableView selectedView ) : bool
selectedView ISelectableView client window to switch to
return bool

Synchronize() public abstract method

Called when a window syncronizes it's views with DB changes (e.g. when an undo or redo command is issued).
public abstract Synchronize ( SyncMsg sync ) : bool
sync SyncMsg syncronization message
return bool

UpdateCaptionBar() public method

Show the application name and project name in the caption bar.
public UpdateCaptionBar ( ) : void
return void

UpdateStyleComboBoxValue() public method

Updates the styles combo boxes on the formatting toolbar, with the correct style name.
public UpdateStyleComboBoxValue ( IRootSite rootsite ) : void
rootsite IRootSite
return void

UpdateWritingSystemSelectorForSelection() public method

Updates the Writiing System selector combo box
public UpdateWritingSystemSelectorForSelection ( IVwRootBox rootbox ) : void
rootbox IVwRootBox
return void

UpdateWritingSystemsInCombobox() public method

Reloads all the writing systems in the writing system selector combo box
public UpdateWritingSystemsInCombobox ( ) : void
return void

ZoomChanged() protected method

protected ZoomChanged ( ) : void
return void

ZoomEnabledForView() protected method

Derived classes may override this in case they contain SimpleRootSites that cannot be zoomed.
protected ZoomEnabledForView ( SimpleRootSite view ) : bool
view SimpleRootSite
return bool

Property Details

informationBarOverlaysButton protected_oe property

protected InformationBarButton informationBarOverlaysButton
return InformationBarButton

m_StyleSheet protected_oe property

protected FwStyleSheet m_StyleSheet
return FwStyleSheet

m_UndoRedoDropDown protected_oe property

The drop down list box for undo/redo
protected UndoRedoDropDown m_UndoRedoDropDown
return UndoRedoDropDown

m_app protected_oe property

The current app
protected FwApp m_app
return FwApp

m_beingDisposed protected_oe property

protected bool m_beingDisposed
return bool

m_cache protected_oe property

protected FdoCache m_cache
return FdoCache

m_cboZoomPercent protected_oe property

protected ComboBox m_cboZoomPercent
return ComboBox

m_charStylesComboBox protected_oe property

protected ComboBox m_charStylesComboBox
return ComboBox

m_delegate protected_oe property

Shared functionality of FwXWindow and FwMainWnd may be delegated here.
protected MainWindowDelegate m_delegate
return MainWindowDelegate

m_fFullWindow protected_oe property

protected bool m_fFullWindow
return bool

m_fWindowIsCopy protected_oe property

Flag indicating whether or not this instance of FwMainWnd is a copy of another FwMainWnd (i.e. created by choosing the "Window/New Window" menu).
protected bool m_fWindowIsCopy
return bool

m_infoBarContainer protected_oe property

protected Panel m_infoBarContainer
return Panel

m_paraStylesComboBox protected_oe property

protected ComboBox m_paraStylesComboBox
return ComboBox

m_persistence protected_oe property

protected Persistence m_persistence
return Persistence

m_rgClientViews protected_oe property

All the client windows available in this main window.
protected Dictionary m_rgClientViews
return IRootSite>.Dictionary

m_selectedView protected_oe property

The selected client window in this main window.
protected ISelectableView m_selectedView
return ISelectableView

m_sibAdapter protected_oe property

protected ISIBInterface m_sibAdapter
return ISIBInterface

m_sideBarContainer protected_oe property

protected Panel m_sideBarContainer
return Panel

m_tmAdapter protected_oe property

protected ITMAdapter m_tmAdapter
return ITMAdapter

m_viewHelper protected_oe property

protected ActiveViewHelper m_viewHelper
return ActiveViewHelper

m_writingSystemSelector protected_oe property

protected ComboBox m_writingSystemSelector
return ComboBox

splitContainer protected_oe property

protected FwSplitContainer splitContainer
return FwSplitContainer