C# Class SILUBS.SharedScrControls.ScrPassageControl

Summary description for ScrPassageControl.
Inheritance: System.Windows.Forms.UserControl, IMessageFilter
显示文件 Open project: sillsdev/FieldWorks Class Usage Examples

Protected Properties

Property Type Description
btnScrPsgDropDown System.Windows.Forms.Panel
m_dropdownForm System.Windows.Forms.Form
m_mulScrBooks SILUBS.SharedScrUtils.MultilingScrBooks
m_scrProj IScrProjMetaDataProvider
txtScrRef System.Windows.Forms.TextBox

Private Properties

Property Type Description
DisplayDropDown void
DisplayErrorMessage void
DropDownChapterSelected void
DropDownClosed void
DropDownShouldGoUp bool
HandleDropDown void
HandleSizeChanged void
InitializeBookLabels void
InitializeComponent void
OnParentChanged void
PaintNonThemeButton void
PaintOnToolbar void
PositionDropDown void
btnScrPsgDropDown_MouseEnter void
btnScrPsgDropDown_MouseLeave void
btnScrPsgDropDown_MouseUp void
btnScrPsgDropDown_Paint void
btnScrPsgDropDown_PaintOnToolstrip void
txtScrRef_GotFocus void
txtScrRef_LostFocus void
txtScrRef_MouseEnter void
txtScrRef_MouseLeave void

Public Methods

Method Description
Initialize ( SILUBS.SharedScrUtils.ScrReference reference ) : void

Initialization, either from constructor or elsewhere following the default constructor.

Initialize ( SILUBS.SharedScrUtils.ScrReference reference, int availableBooks ) : void

Initialization, either from constructor or elsewhere following the default constructor.

IsReferenceValid ( SILUBS.SharedScrUtils.ScrReference scrRef ) : bool

Determines whether the specified ScrReference is in the list of available books.

ParseRefString ( string sTextToBeParsed ) : SILUBS.SharedScrUtils.ScrReference

Parses the user typed in string. Creates and returns a ScrReference object.

PreFilterMessage ( Message &m ) : bool

Because Del and Ctrl+A are menu item shortcuts, if our ref. text box has focus, then we need to trap them before the menu system gets a crack at them.

ResolveReference ( ) : void

Resolve the reference specified in the text box

ScrPassageControl ( ) : System

Default constructor

ScrPassageControl ( SILUBS.SharedScrUtils.ScrReference reference, IScrProjMetaDataProvider scrProj, ScrVers versification ) : System

Non-default constructor

Protected Methods

Method Description
CreateMultilingScrBooks ( IScrProjMetaDataProvider scrProj, ScrVers versification ) : void

Creates the object that can provide multi-lingual names and abbreviations for Scripture books.

CreateScrPassageDropDown ( ScrPassageControl owner ) : SILUBS.SharedScrControls.ScrPassageDropDown

Create a new ScrPassageDropDown object

Dispose ( bool disposing ) : void

Clean up any resources being used.

DropDownBookSelected ( int book ) : void

If the book has changed, parse the new reference and display it in the text box.

InvokePassageChanged ( SILUBS.SharedScrUtils.ScrReference reference ) : void

Invoke the PassageChanged event

OnEnabledChanged ( EventArgs e ) : void

Make sure the panel control behind the text box takes on the same back color as the text box.

OnHandleDestroyed ( EventArgs e ) : void

Make sure the dropdown control isn't left hanging around after this control goes away.

OnPaint ( PaintEventArgs e ) : void

OnResize ( EventArgs e ) : void

This will center the text box vertically within the control.

btnScrPsgDropDown_MouseDown ( object sender, System e ) : void

txtScrRef_KeyDown ( object sender, KeyEventArgs e ) : void

txtScrRef_KeyPress ( object sender, KeyPressEventArgs e ) : void

Handle the key press to look for Enter keys.

Private Methods

Method Description
DisplayDropDown ( ) : void
DisplayErrorMessage ( ) : void
DropDownChapterSelected ( int book, int chapter ) : void

DropDownClosed ( object sender, EventArgs e ) : void

This is the method that the dropdown will call to notify me that it is closed.

DropDownShouldGoUp ( Point screenPoint, SILUBS.SharedScrControls.ScrPassageDropDown dropDown ) : bool

Determine if the drop down should go above the ScrPassageControl or below it.

HandleDropDown ( ) : void

Display the drop down if it doesn't show, or close it if it does show.

HandleSizeChanged ( object sender, EventArgs e ) : void
InitializeBookLabels ( ) : void

InitializeComponent ( ) : void

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

OnParentChanged ( EventArgs e ) : void
PaintNonThemeButton ( Graphics graphics, ButtonState state ) : void

PaintOnToolbar ( PaintEventArgs e ) : void

PositionDropDown ( SILUBS.SharedScrControls.ScrPassageDropDown dropDown ) : void

Position the drop down control.

btnScrPsgDropDown_MouseEnter ( object sender, System e ) : void

btnScrPsgDropDown_MouseLeave ( object sender, System e ) : void

btnScrPsgDropDown_MouseUp ( object sender, System e ) : void

btnScrPsgDropDown_Paint ( object sender, PaintEventArgs e ) : void

btnScrPsgDropDown_PaintOnToolstrip ( PaintEventArgs e ) : void
txtScrRef_GotFocus ( object sender, System e ) : void

When gaining the focus, highlight the entire text.

txtScrRef_LostFocus ( object sender, System e ) : void

Handle the text box losing focus. Resolve the reference that has been typed in.

txtScrRef_MouseEnter ( object sender, EventArgs e ) : void

txtScrRef_MouseLeave ( object sender, EventArgs e ) : void

Method Details

CreateMultilingScrBooks() protected method

Creates the object that can provide multi-lingual names and abbreviations for Scripture books.
protected CreateMultilingScrBooks ( IScrProjMetaDataProvider scrProj, ScrVers versification ) : void
scrProj IScrProjMetaDataProvider The Scripture project meta-data provided (can be null).
versification ScrVers The default versification to use for references if /// scrProj is not set.
return void

CreateScrPassageDropDown() protected method

Create a new ScrPassageDropDown object
protected CreateScrPassageDropDown ( ScrPassageControl owner ) : SILUBS.SharedScrControls.ScrPassageDropDown
owner ScrPassageControl The ScrPassageControl that will own the drop-down control
return SILUBS.SharedScrControls.ScrPassageDropDown

Dispose() protected method

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

DropDownBookSelected() protected method

If the book has changed, parse the new reference and display it in the text box.
protected DropDownBookSelected ( int book ) : void
book int
return void

Initialize() public method

Initialization, either from constructor or elsewhere following the default constructor.
public Initialize ( SILUBS.SharedScrUtils.ScrReference reference ) : void
reference SILUBS.SharedScrUtils.ScrReference Initial reference
return void

Initialize() public method

Initialization, either from constructor or elsewhere following the default constructor.
public Initialize ( SILUBS.SharedScrUtils.ScrReference reference, int availableBooks ) : void
reference SILUBS.SharedScrUtils.ScrReference Initial reference
availableBooks int Array of canonical book IDs to include
return void

InvokePassageChanged() protected method

Invoke the PassageChanged event
protected InvokePassageChanged ( SILUBS.SharedScrUtils.ScrReference reference ) : void
reference SILUBS.SharedScrUtils.ScrReference The reference.
return void

IsReferenceValid() public method

Determines whether the specified ScrReference is in the list of available books.
public IsReferenceValid ( SILUBS.SharedScrUtils.ScrReference scrRef ) : bool
scrRef SILUBS.SharedScrUtils.ScrReference The given ScrReference
return bool

OnEnabledChanged() protected method

Make sure the panel control behind the text box takes on the same back color as the text box.
protected OnEnabledChanged ( EventArgs e ) : void
e System.EventArgs
return void

OnHandleDestroyed() protected method

Make sure the dropdown control isn't left hanging around after this control goes away.
protected OnHandleDestroyed ( EventArgs e ) : void
e System.EventArgs
return void

OnPaint() protected method

protected OnPaint ( PaintEventArgs e ) : void
e PaintEventArgs
return void

OnResize() protected method

This will center the text box vertically within the control.
protected OnResize ( EventArgs e ) : void
e System.EventArgs
return void

ParseRefString() public method

Parses the user typed in string. Creates and returns a ScrReference object.
public ParseRefString ( string sTextToBeParsed ) : SILUBS.SharedScrUtils.ScrReference
sTextToBeParsed string Reference string the user types in.
return SILUBS.SharedScrUtils.ScrReference

PreFilterMessage() public method

Because Del and Ctrl+A are menu item shortcuts, if our ref. text box has focus, then we need to trap them before the menu system gets a crack at them.
public PreFilterMessage ( Message &m ) : bool
m System.Windows.Forms.Message
return bool

ResolveReference() public method

Resolve the reference specified in the text box
public ResolveReference ( ) : void
return void

ScrPassageControl() public method

Default constructor
public ScrPassageControl ( ) : System
return System

ScrPassageControl() public method

Non-default constructor
public ScrPassageControl ( SILUBS.SharedScrUtils.ScrReference reference, IScrProjMetaDataProvider scrProj, ScrVers versification ) : System
reference SILUBS.SharedScrUtils.ScrReference Initial reference
scrProj IScrProjMetaDataProvider Object that can provide meta-dat information about a Scripture /// project.
versification ScrVers The versification to use if scrProj is not set.
return System

btnScrPsgDropDown_MouseDown() protected method

protected btnScrPsgDropDown_MouseDown ( object sender, System e ) : void
sender object
e System
return void

txtScrRef_KeyDown() protected method

protected txtScrRef_KeyDown ( object sender, KeyEventArgs e ) : void
sender object
e System.Windows.Forms.KeyEventArgs
return void

txtScrRef_KeyPress() protected method

Handle the key press to look for Enter keys.
protected txtScrRef_KeyPress ( object sender, KeyPressEventArgs e ) : void
sender object
e System.Windows.Forms.KeyPressEventArgs
return void

Property Details

btnScrPsgDropDown protected_oe property

protected Panel,System.Windows.Forms btnScrPsgDropDown
return System.Windows.Forms.Panel

m_dropdownForm protected_oe property

protected Form,System.Windows.Forms m_dropdownForm
return System.Windows.Forms.Form

m_mulScrBooks protected_oe property

The object that provides all the information about book names and abbreviations
protected MultilingScrBooks,SILUBS.SharedScrUtils m_mulScrBooks
return SILUBS.SharedScrUtils.MultilingScrBooks

m_scrProj protected_oe property

Scripture project meta-data provider
protected IScrProjMetaDataProvider m_scrProj
return IScrProjMetaDataProvider

txtScrRef protected_oe property

protected TextBox,System.Windows.Forms txtScrRef
return System.Windows.Forms.TextBox