C# Class SILUBS.SharedScrControls.ScrPassageControl

Summary description for ScrPassageControl.
Inheritance: System.Windows.Forms.UserControl, IMessageFilter
Afficher le fichier Open project: sillsdev/FieldWorks Class Usage Examples

Protected Properties

Свойство 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

Свойство 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

Méthodes publiques

Méthode 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

Méthodes protégées

Méthode 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

Méthode 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 méthode

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.
Résultat void

CreateScrPassageDropDown() protected méthode

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

Dispose() protected méthode

Clean up any resources being used.
protected Dispose ( bool disposing ) : void
disposing bool
Résultat void

DropDownBookSelected() protected méthode

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

Initialize() public méthode

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

Initialize() public méthode

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
Résultat void

InvokePassageChanged() protected méthode

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

IsReferenceValid() public méthode

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
Résultat bool

OnEnabledChanged() protected méthode

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
Résultat void

OnHandleDestroyed() protected méthode

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

OnPaint() protected méthode

protected OnPaint ( PaintEventArgs e ) : void
e PaintEventArgs
Résultat void

OnResize() protected méthode

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

ParseRefString() public méthode

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.
Résultat SILUBS.SharedScrUtils.ScrReference

PreFilterMessage() public méthode

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
Résultat bool

ResolveReference() public méthode

Resolve the reference specified in the text box
public ResolveReference ( ) : void
Résultat void

ScrPassageControl() public méthode

Default constructor
public ScrPassageControl ( ) : System
Résultat System

ScrPassageControl() public méthode

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.
Résultat System

btnScrPsgDropDown_MouseDown() protected méthode

protected btnScrPsgDropDown_MouseDown ( object sender, System e ) : void
sender object
e System
Résultat void

txtScrRef_KeyDown() protected méthode

protected txtScrRef_KeyDown ( object sender, KeyEventArgs e ) : void
sender object
e System.Windows.Forms.KeyEventArgs
Résultat void

txtScrRef_KeyPress() protected méthode

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

Property Details

btnScrPsgDropDown protected_oe property

protected Panel,System.Windows.Forms btnScrPsgDropDown
Résultat System.Windows.Forms.Panel

m_dropdownForm protected_oe property

protected Form,System.Windows.Forms m_dropdownForm
Résultat 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
Résultat SILUBS.SharedScrUtils.MultilingScrBooks

m_scrProj protected_oe property

Scripture project meta-data provider
protected IScrProjMetaDataProvider m_scrProj
Résultat IScrProjMetaDataProvider

txtScrRef protected_oe property

protected TextBox,System.Windows.Forms txtScrRef
Résultat System.Windows.Forms.TextBox