📄 refermain.cpp
字号:
// EditIndex->Text = m_rrWorkingReferRec.asCrossReferIndex;
m_rrWorkingReferRec.asAuthors = prrReferRec->asAuthors;
// EditAuthors->Text = m_rrWorkingReferRec.asAuthors;
m_rrWorkingReferRec.asTitle = prrReferRec->asTitle;
// EditTitle->Text = m_rrWorkingReferRec.asTitle;
m_rrWorkingReferRec.asJournal = prrReferRec->asJournal;
// EditJournal->Text = m_rrWorkingReferRec.asJournal;
m_rrWorkingReferRec.asProceedings = prrReferRec->asProceedings;
// EditProceedings->Text = m_rrWorkingReferRec.asProceedings;
m_rrWorkingReferRec.asConferencePlace = prrReferRec->asConferencePlace;
// EditConfPlace->Text = m_rrWorkingReferRec.asConferencePlace;
m_rrWorkingReferRec.asConferenceDate = prrReferRec->asConferenceDate;
// EditConfDate->Text = m_rrWorkingReferRec.asConferenceDate;
m_rrWorkingReferRec.asBook = prrReferRec->asBook;
// EditBook->Text = m_rrWorkingReferRec.asBook;
m_rrWorkingReferRec.asEditors = prrReferRec->asEditors;
m_rrWorkingReferRec.asTechnicalReport = prrReferRec->asTechnicalReport;
// EditTechReport->Text = m_rrWorkingReferRec.asTechnicalReport;
m_rrWorkingReferRec.asNote = prrReferRec->asNote;
// EditNote->Text = m_rrWorkingReferRec.asNote;
m_rrWorkingReferRec.asKeywords = prrReferRec->asKeywords;
// EditKeywords->Text = m_rrWorkingReferRec.asKeywords;
m_rrWorkingReferRec.asAbstract = prrReferRec->asAbstract;
// MemoAbstract->Text = m_rrWorkingReferRec.asAbstract;
return true;
}
//---------------------------------------------------------------------------
bool __fastcall TMainFormRefer::InitializeWorkspace()
{
m_rrWorkingReferRec.nMagic = MAGIC_REFER;
m_rrWorkingReferRec.nId = ( unsigned __int32 )0;
// EditReferID->Text = AnsiString( ( int )( m_rrWorkingReferRec.nId ) );
m_rrWorkingReferRec.eReferType = rtBooks;
// ComboBoxReferType->ItemIndex = ( int )( m_rrWorkingReferRec.eReferType );
// char sReserved[3]; // Unused
m_rrWorkingReferRec.nLength = ( unsigned __int32 )0;
m_rrWorkingReferRec.nOffset = ( unsigned __int32 )36;
m_rrWorkingReferRec.nCrossReferIndex = ( unsigned __int8 )0;
m_rrWorkingReferRec.nAuthors = ( unsigned __int8 )0;
m_rrWorkingReferRec.nTitle = ( unsigned __int16 )0;
m_rrWorkingReferRec.nJournal = ( unsigned __int16 )0;
m_rrWorkingReferRec.vnVolumeAndNumber.nVolume = ( unsigned __int8 )1;
// SpinVolume->Value = ( int )( m_rrWorkingReferRec.vnVolumeAndNumber.nVolume );
m_rrWorkingReferRec.vnVolumeAndNumber.nNumber = ( unsigned __int8 )1;
// SpinNumber->Value = ( int )( m_rrWorkingReferRec.vnVolumeAndNumber.nNumber );
m_rrWorkingReferRec.nProceedings = ( unsigned __int16 )0;
m_rrWorkingReferRec.nConferencePlace = ( unsigned __int16 )0;
m_rrWorkingReferRec.nConferenceDate = ( unsigned __int16 )0;
m_rrWorkingReferRec.nBook = ( unsigned __int16 )0;
m_rrWorkingReferRec.nEditors = ( unsigned __int8 )0;
m_rrWorkingReferRec.nTechnicalReport = ( unsigned __int16 )0;
m_rrWorkingReferRec.nNote = ( unsigned __int16 )0;
m_rrWorkingReferRec.ymPublicationDate.nYear = ( unsigned __int16 )1998;
// SpinPubYear->Value = (int )( m_rrWorkingReferRec.ymPublicationDate.nYear );
m_rrWorkingReferRec.ymPublicationDate.nMonth = ( unsigned __int16 )1;
// SpinPubMonth->Value = (int )( m_rrWorkingReferRec.ymPublicationDate.nMonth );
m_rrWorkingReferRec.sePages.nStart = ( unsigned __int16 )1;
// SpinStartPage->Value = (int )( m_rrWorkingReferRec.sePages.nStart );
m_rrWorkingReferRec.sePages.nEnd = ( unsigned __int16 )1;
// SpinEndPage->Value = (int )( m_rrWorkingReferRec.sePages.nEnd );
m_rrWorkingReferRec.nKeywordsNumber = ( unsigned __int8 )0;
// EditKeywordsNo->Text = ( int )( m_rrWorkingReferRec.nKeywordsNumber );
m_rrWorkingReferRec.nKeywords = ( unsigned __int16 )0;
m_rrWorkingReferRec.nAbstract = ( unsigned __int32 )0;
// unsigned __int32 m_rrWorkingReferRec.nReserved[4]; // Unused
m_rrWorkingReferRec.asCrossReferIndex = AnsiString( "" );
// EditIndex->Text = m_rrWorkingReferRec.asCrossReferIndex;
m_rrWorkingReferRec.asAuthors = AnsiString( "" );
// EditAuthors->Text = m_rrWorkingReferRec.asAuthors;
m_rrWorkingReferRec.asTitle = AnsiString( "" );
// EditTitle->Text = m_rrWorkingReferRec.asTitle;
m_rrWorkingReferRec.asJournal = AnsiString( "" );
// EditJournal->Text = m_rrWorkingReferRec.asJournal;
m_rrWorkingReferRec.asProceedings = AnsiString( "" );
// EditProceedings->Text = m_rrWorkingReferRec.asProceedings;
m_rrWorkingReferRec.asConferencePlace = AnsiString( "" );
// EditConfPlace->Text = m_rrWorkingReferRec.asConferencePlace;
m_rrWorkingReferRec.asConferenceDate = AnsiString( "" );
// EditConfDate->Text = m_rrWorkingReferRec.asConferenceDate;
m_rrWorkingReferRec.asBook = AnsiString( "" );
// EditBook->Text = m_rrWorkingReferRec.asBook;
m_rrWorkingReferRec.asEditors = AnsiString( "" );
m_rrWorkingReferRec.asTechnicalReport = AnsiString( "" );
// EditTechReport->Text = m_rrWorkingReferRec.asTechnicalReport;
m_rrWorkingReferRec.asNote = AnsiString( "" );
// EditNote->Text = m_rrWorkingReferRec.asNote;
m_rrWorkingReferRec.asKeywords = AnsiString( "" );
// EditKeywords->Text = m_rrWorkingReferRec.asKeywords;
m_rrWorkingReferRec.asAbstract = AnsiString( "" );
// MemoAbstract->Text = m_rrWorkingReferRec.asAbstract;
return true;
}
//---------------------------------------------------------------------------
void __fastcall TMainFormRefer::MenuItemFileExitClick(TObject *Sender)
{
Application->Terminate();
}
//---------------------------------------------------------------------------
void __fastcall TMainFormRefer::FormResize(TObject *Sender)
{
// Discard the change of window's size.
Height = 551;
Width = 698;
}
//---------------------------------------------------------------------------
void __fastcall TMainFormRefer::FormCreate(TObject *Sender)
{
LoadAllToolButtonImages();
// Exists a refer.
if ( m_prlReferList->Count > 1 )
// copy the current working reference record to workspace.
{
CopyToWorkspace( m_prlReferList, m_nWorkingReferRec );
// Disable or enable some buttons and menu items
ToolButtonNext->Enabled = true;
MenuItemRecordNext->Enabled = true;
ToolButtonLast->Enabled = true;
MenuItemRecordLast->Enabled = true;
// Show in status bar.
StatusBar->Panels->Items[0]->Text = AnsiString( "Total: " ) + AnsiString( m_prlReferList->Count ) + AnsiString( " Record(s)" );
StatusBar->Panels->Items[1]->Text = AnsiString( "Active: " ) + AnsiString( m_nWorkingReferRec );
}
// Otherwise
else if( m_prlReferList->Count == 1 )
// copy the current working reference record to workspace.
{
CopyToWorkspace( m_prlReferList, m_nWorkingReferRec );
// Disable or enable some buttons and menu items
ToolButtonNext->Enabled = false;
MenuItemRecordNext->Enabled = false;
ToolButtonLast->Enabled = false;
MenuItemRecordLast->Enabled = false;
// Show in status bar.
StatusBar->Panels->Items[0]->Text = AnsiString( "Total: 1 Record(s)" );
StatusBar->Panels->Items[1]->Text = AnsiString( "Active: 1" );
}
else
// Construct a new working reference record, which can be inserted into the stream.
{
InitializeWorkspace();
// Disable or enable some buttons and menu items
ToolButtonNext->Enabled = false;
MenuItemRecordNext->Enabled = false;
ToolButtonLast->Enabled = false;
MenuItemRecordLast->Enabled = false;
// Show in status bar.
StatusBar->Panels->Items[0]->Text = AnsiString( "Total: 0 Record(s)" );
StatusBar->Panels->Items[1]->Text = AnsiString( "Active: 0" );
}
// Show it.
ShowWorkingReferRec();
// Disable or enable some buttons and menu items
ToolButtonFirst->Enabled = false;
MenuItemRecordFirst->Enabled = false;
ToolButtonPrevious->Enabled = false;
MenuItemRecordPrevious->Enabled = false;
}
//---------------------------------------------------------------------------
void __fastcall TMainFormRefer::ShowWorkingReferRec()
{
// unsigned __int32 nMagic; // Flag, "ref " for the normal; "del " for the deleted
/////////////////////
// if( m_pWorkingReferLink->pReferRecord->nMagic == MAGIC_REFER )
/////////////////////
if( ( m_rrWorkingReferRec.nMagic == MAGIC_REFER ) ||
( m_rrWorkingReferRec.nMagic == MAGIC_DELETED_REFER ) )
{
// unsigned __int32 nId; // Id Number for the reference, which can not be edited
EditReferID->Text = AnsiString( ( int )( m_rrWorkingReferRec.nId ) );
// TReferType eReferType; // Reference's type, such as Papers or Journal etc.
ComboBoxReferType->Font->Color = clBlack;
ComboBoxReferType->ItemIndex = ( int )( m_rrWorkingReferRec.eReferType );
// char sReserved[3]; // Unused
// unsigned __int32 nLength; // The length of the reference
// unsigned __int32 nOffset; // From the beginning to current reference
// unsigned __int8 nCrossReferIndex; // CRI, such as "Rau1993a"
// unsigned __int8 nAuthors; // Authors' name length
// unsigned __int16 nTitle; // Title's name length
// unsigned __int16 nJournal; // Journal's name length
// TVolumeAndNumber vnVolumeAndNumber; // Vol. and No., typed by unsigned __int16 both
SpinVolume->Font->Color = clBlack;
SpinVolume->Value = ( int )( m_rrWorkingReferRec.vnVolumeAndNumber.nVolume );
SpinNumber->Font->Color = clBlack;
SpinNumber->Value = ( int )( m_rrWorkingReferRec.vnVolumeAndNumber.nNumber );
// unsigned __int16 nProceedings; // Proceedings' name length
// unsigned __int16 nConferencePlace;
// unsigned __int16 nConferenceDate;
// unsigned __int16 nBook; // Book's name length
// unsigned __int8 nEditors; // Editors' name length, if books or proceedings have
// unsigned __int16 nTechnicalReport; // No ISBN or publication number
// unsigned __int16 nNote; // Some discuss results or notes
// TPublicationDate ymPublicationDate; // Year and Month of publication
SpinPubYear->Font->Color = clBlack;
SpinPubYear->Value = (int )( m_rrWorkingReferRec.ymPublicationDate.nYear );
SpinPubMonth->Font->Color = clBlack;
SpinPubMonth->Value = (int )( m_rrWorkingReferRec.ymPublicationDate.nMonth );
// TStartAndEndPage sePages; // page from nStart to nEnd
SpinStartPage->Font->Color = clBlack;
SpinStartPage->Value = (int )( m_rrWorkingReferRec.sePages.nStart );
SpinEndPage->Font->Color = clBlack;
SpinEndPage->Value = (int )( m_rrWorkingReferRec.sePages.nEnd );
// unsigned __int8 nKeywordsNumber; // How many keywords are?
EditKeywordsNo->Text = ( int )( m_rrWorkingReferRec.nKeywordsNumber );
// unsigned __int16 nKeywords; // keywords' length
// unsigned __int32 nAbstract; // Abstract's length
// unsigned __int32 nReserved[4]; // Unused
// AnsiString asCrossReferIndex; // CRI Contents
EditIndex->Font->Color = clBlue;
EditIndex->Text = m_rrWorkingReferRec.asCrossReferIndex;
// AnsiString asAuthors; // Authors' name, seperated with ", "
EditAuthors->Font->Color = clBlack;
EditAuthors->Text = m_rrWorkingReferRec.asAuthors;
// AnsiString asTitle; // Title
EditTitle->Font->Color = clBlack;
EditTitle->Text = m_rrWorkingReferRec.asTitle;
// AnsiString asJournal; // Journal's name
EditJournal->Font->Color = clBlack;
EditJournal->Text = m_rrWorkingReferRec.asJournal;
// AnsiString asProceedings; // Proceedings' name
EditProceedings->Font->Color = clBlack;
EditProceedings->Text = m_rrWorkingReferRec.asProceedings;
// AnsiString asConferencePlace; // Where the Conference opened
EditConferencePlace->Font->Color = clBlack;
EditConferencePlace->Text = m_rrWorkingReferRec.asConferencePlace;
// AnsiString asConferenceDate; // When the conference opened
EditConferenceDate->Font->Color = clBlack;
EditConferenceDate->Text = m_rrWorkingReferRec.asConferenceDate;
// AnsiString asBook; // Book's name
EditBook->Font->Color = clBlack;
EditBook->Text = m_rrWorkingReferRec.asBook;
// AnsiString asEditors; // Editors' name if have
// AnsiString asTechnicalReport; // Title of the technical report
EditTechnicalReport->Font->Color = clBlack;
EditTechnicalReport->Text = m_rrWorkingReferRec.asTechnicalReport;
// AnsiString asNote; // Title of the note
EditNote->Font->Color = clBlack;
EditNote->Text = m_rrWorkingReferRec.asNote;
// AnsiString asKeywords; // keywords
EditKeywords->Font->Color = clBlack;
EditKeywords->Text = m_rrWorkingReferRec.asKeywords;
// AnsiString asAbstract; // Brief abstract
// EditAbstract->Text = m_rrWorkingReferRec.asAbstract;
}
}
//---------------------------------------------------------------------------
void __fastcall TMainFormRefer::LoadAllToolButtonImages()
{
LoadToolButtonImage( ImageListButtons, "res\\pgmd_n.bmp" );
LoadToolButtonImage( ImageListHotButtons, "res\\pgmd_h.bmp" );
LoadToolButtonImage( ImageListDisableButtons, "res\\pgmd_d.bmp" );
LoadToolButtonImage( ImageListButtons, "res\\pgsr_n.bmp" );
LoadToolButtonImage( ImageListHotButtons, "res\\pgsr_h.bmp" );
LoadToolButtonImage( ImageListDisableButtons, "res\\pgsr_d.bmp" );
LoadToolButtonImage( ImageListButtons, "res\\append_n.bmp" );
LoadToolButtonImage( ImageListHotButtons, "res\\append_h.bmp" );
LoadToolButtonImage( ImageListDisableButtons, "res\\append_d.bmp" );
LoadToolButtonImage( ImageListButtons, "res\\insert_n.bmp" );
LoadToolButtonImage( ImageListHotButtons, "res\\insert_h.bmp" );
LoadToolButtonImage( ImageListDisableButtons, "res\\insert_d.bmp" );
LoadToolButtonImage( ImageListButtons, "res\\change_n.bmp" );
LoadToolButtonImage( ImageListHotButtons, "res\\change_h.bmp" );
LoadToolButtonImage( ImageListDisableButtons, "res\\change_d.bmp" );
LoadToolButtonImage( ImageListButtons, "res\\delete_n.bmp" );
LoadToolButtonImage( ImageListHotButtons, "res\\delete_h.bmp" );
LoadToolButtonImage( ImageListDisableButtons, "res\\delete_d.bmp" );
LoadToolButtonImage( ImageListButtons, "res\\pack_n.bmp" );
LoadToolButtonImage( ImageListHotButtons, "res\\pack_h.bmp" );
LoadToolButtonImage( ImageListDisableButtons, "res\\pack_d.bmp" );
LoadToolButtonImage( ImageListButtons, "res\\criter_n.bmp" );
LoadToolButtonImage( ImageListHotButtons, "res\\criter_h.bmp" );
LoadToolButtonImage( ImageListDisableButtons, "res\\criter_d.bmp" );
LoadToolButtonImage( ImageListButtons, "res\\save_n.bmp" );
LoadToolButtonImage( ImageListHotButtons, "res\\save_h.bmp" );
LoadToolButtonImage( ImageListDisableButtons, "res\\save_d.bmp" );
LoadToolButtonImage( ImageListButtons, "res\\find_n.bmp" );
LoadToolButtonImage( ImageListHotButtons, "res\\find_h.bmp" );
LoadToolButtonImage( ImageListDisableButtons, "res\\find_d.bmp" );
LoadToolButtonImage( ImageListButtons, "res\\output_n.bmp" );
LoadToolButtonImage( ImageListHotButtons, "res\\output_h.bmp" );
LoadToolButtonImage( ImageListDisableButtons, "res\\output_d.bmp" );
LoadToolButtonImage( ImageListButtons, "res\\first_n.bmp" );
LoadToolButtonImage( ImageListHotButtons, "res\\first_h.bmp" );
LoadToolButtonImage( ImageListDisableButtons, "res\\first_d.bmp" );
LoadToolButtonImage( ImageListButtons, "res\\last_n.bmp" );
LoadToolButtonImage( ImageListHotButtons, "res\\last_h.bmp" );
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -