本文整理汇总了C++中Close函数的典型用法代码示例。如果您正苦于以下问题:C++ Close函数的具体用法?C++ Close怎么用?C++ Close使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Close函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Close
/* MainWindow::handleAction
* Handles the action [id]. Returns true if the action was handled,
* false otherwise
*******************************************************************/
bool MainWindow::handleAction(string id)
{
// We're only interested in "main_" actions
if (!id.StartsWith("main_"))
return false;
// File->Exit
if (id == "main_exit")
{
Close();
return true;
}
// Edit->Undo
if (id == "main_undo")
{
panel_archivemanager->undo();
return true;
}
// Edit->Redo
if (id == "main_redo")
{
panel_archivemanager->redo();
return true;
}
// Edit->Set Base Resource Archive
if (id == "main_setbra")
{
wxDialog dialog_ebr(this, -1, "Edit Base Resource Archives", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER);
BaseResourceArchivesPanel brap(&dialog_ebr);
wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);
sizer->Add(&brap, 1, wxEXPAND|wxALL, 4);
sizer->Add(dialog_ebr.CreateButtonSizer(wxOK|wxCANCEL), 0, wxEXPAND|wxLEFT|wxRIGHT|wxDOWN, 4);
dialog_ebr.SetSizer(sizer);
dialog_ebr.Layout();
dialog_ebr.SetInitialSize(wxSize(500, 300));
dialog_ebr.CenterOnParent();
if (dialog_ebr.ShowModal() == wxID_OK)
theArchiveManager->openBaseResource(brap.getSelectedPath());
return true;
}
// Edit->Preferences
if (id == "main_preferences")
{
PreferencesDialog::openPreferences(this);
return true;
}
// View->Archive Manager
if (id == "main_showam")
{
wxAuiManager* m_mgr = wxAuiManager::GetManager(panel_archivemanager);
wxAuiPaneInfo& p_inf = m_mgr->GetPane("archive_manager");
p_inf.Show(!p_inf.IsShown());
m_mgr->Update();
return true;
}
// View->Console
if (id == "main_showconsole")
{
wxAuiManager* m_mgr = wxAuiManager::GetManager(panel_archivemanager);
wxAuiPaneInfo& p_inf = m_mgr->GetPane("console");
p_inf.Show(!p_inf.IsShown());
p_inf.MinSize(200, 128);
m_mgr->Update();
return true;
}
// View->Undo History
if (id == "main_showundohistory")
{
wxAuiManager* m_mgr = wxAuiManager::GetManager(panel_archivemanager);
wxAuiPaneInfo& p_inf = m_mgr->GetPane("undo_history");
p_inf.Show(!p_inf.IsShown());
m_mgr->Update();
return true;
}
// Help->About
if (id == "main_about")
{
wxAboutDialogInfo info;
info.SetName("SLADE");
info.SetVersion("v" + Global::version);
info.SetWebSite("http://slade.mancubus.net");
info.SetDescription("It's a Doom Editor");
//.........这里部分代码省略.........
示例3: switch
bool CGUIDialogSelect::OnMessage(CGUIMessage& message)
{
switch ( message.GetMessage() )
{
case GUI_MSG_WINDOW_DEINIT:
{
CGUIDialog::OnMessage(message);
m_viewControl.Clear();
m_bButtonEnabled = false;
m_useDetails = false;
m_multiSelection = false;
// construct selected items list
m_selectedItems->Clear();
m_iSelected = -1;
for (int i = 0 ; i < m_vecList->Size() ; i++)
{
CFileItemPtr item = m_vecList->Get(i);
if (item->IsSelected())
{
m_selectedItems->Add(item);
if (m_iSelected == -1)
m_iSelected = i;
}
}
m_vecList->Clear();
m_buttonString = -1;
SET_CONTROL_LABEL(CONTROL_BUTTON, "");
return true;
}
break;
case GUI_MSG_WINDOW_INIT:
{
CGUIDialog::OnMessage(message);
return true;
}
break;
case GUI_MSG_CLICKED:
{
int iControl = message.GetSenderId();
if (m_viewControl.HasControl(CONTROL_LIST))
{
int iAction = message.GetParam1();
if (ACTION_SELECT_ITEM == iAction || ACTION_MOUSE_LEFT_CLICK == iAction)
{
int iSelected = m_viewControl.GetSelectedItem();
if(iSelected >= 0 && iSelected < (int)m_vecList->Size())
{
CFileItemPtr item(m_vecList->Get(iSelected));
if (m_multiSelection)
item->Select(!item->IsSelected());
else
{
for (int i = 0 ; i < m_vecList->Size() ; i++)
m_vecList->Get(i)->Select(false);
item->Select(true);
m_bConfirmed = true;
Close();
}
}
}
}
if (CONTROL_BUTTON == iControl)
{
m_iSelected = -1;
m_bButtonPressed = true;
if (m_multiSelection)
m_bConfirmed = true;
Close();
}
}
break;
case GUI_MSG_SETFOCUS:
{
// make sure the additional button is focused in case the list is empty
// (otherwise it is impossible to navigate to the additional button)
if (m_vecList->IsEmpty() && m_bButtonEnabled &&
m_viewControl.HasControl(message.GetControlId()))
{
SET_CONTROL_FOCUS(CONTROL_BUTTON, 0);
return true;
}
if (m_viewControl.HasControl(message.GetControlId()) && m_viewControl.GetCurrentControl() != message.GetControlId())
{
m_viewControl.SetFocused();
return true;
}
}
break;
}
return CGUIDialog::OnMessage(message);
}
示例4: Close
// -------------------------------------------------------------------------------- //
void guSplashFrame::OnSplashClick( wxMouseEvent &event )
{
Close();
}
示例5: Close
//***************************************************************************
CBCGPDAOGridCtrl::~CBCGPDAOGridCtrl()
{
Close ();
}
示例6: Close
VDFileAsync9x::~VDFileAsync9x() {
Close();
}
示例7: Close
void CustomEdit::scheduleCreated(int ruleID)
{
if (ruleID > 0)
Close();
}
示例8: WXUNUSED
void MyChild::OnQuit(wxCommandEvent& WXUNUSED(event))
{
Close(true);
}
示例9: lock
bool COMXVideo::Open(CDVDStreamInfo &hints, OMXClock *clock, EDEINTERLACEMODE deinterlace, bool hdmi_clock_sync)
{
CSingleLock lock (m_critSection);
bool vflip = false;
Close();
OMX_ERRORTYPE omx_err = OMX_ErrorNone;
std::string decoder_name;
m_settings_changed = false;
m_setStartTime = true;
m_res_ctx = NULL;
m_res_callback = NULL;
m_video_codec_name = "";
m_codingType = OMX_VIDEO_CodingUnused;
m_decoded_width = hints.width;
m_decoded_height = hints.height;
m_hdmi_clock_sync = hdmi_clock_sync;
m_submitted_eos = false;
m_failed_eos = false;
if(hints.extrasize > 0 && hints.extradata != NULL)
{
m_extrasize = hints.extrasize;
m_extradata = (uint8_t *)malloc(m_extrasize);
memcpy(m_extradata, hints.extradata, hints.extrasize);
}
switch (hints.codec)
{
case AV_CODEC_ID_H264:
{
switch(hints.profile)
{
case FF_PROFILE_H264_BASELINE:
// (role name) video_decoder.avc
// H.264 Baseline profile
decoder_name = OMX_H264BASE_DECODER;
m_codingType = OMX_VIDEO_CodingAVC;
m_video_codec_name = "omx-h264";
break;
case FF_PROFILE_H264_MAIN:
// (role name) video_decoder.avc
// H.264 Main profile
decoder_name = OMX_H264MAIN_DECODER;
m_codingType = OMX_VIDEO_CodingAVC;
m_video_codec_name = "omx-h264";
break;
case FF_PROFILE_H264_HIGH:
// (role name) video_decoder.avc
// H.264 Main profile
decoder_name = OMX_H264HIGH_DECODER;
m_codingType = OMX_VIDEO_CodingAVC;
m_video_codec_name = "omx-h264";
break;
case FF_PROFILE_UNKNOWN:
decoder_name = OMX_H264HIGH_DECODER;
m_codingType = OMX_VIDEO_CodingAVC;
m_video_codec_name = "omx-h264";
break;
default:
decoder_name = OMX_H264HIGH_DECODER;
m_codingType = OMX_VIDEO_CodingAVC;
m_video_codec_name = "omx-h264";
break;
}
}
break;
case AV_CODEC_ID_MPEG4:
// (role name) video_decoder.mpeg4
// MPEG-4, DivX 4/5 and Xvid compatible
decoder_name = OMX_MPEG4_DECODER;
m_codingType = OMX_VIDEO_CodingMPEG4;
m_video_codec_name = "omx-mpeg4";
break;
case AV_CODEC_ID_MPEG1VIDEO:
case AV_CODEC_ID_MPEG2VIDEO:
// (role name) video_decoder.mpeg2
// MPEG-2
decoder_name = OMX_MPEG2V_DECODER;
m_codingType = OMX_VIDEO_CodingMPEG2;
m_video_codec_name = "omx-mpeg2";
break;
case AV_CODEC_ID_H263:
// (role name) video_decoder.mpeg4
// MPEG-4, DivX 4/5 and Xvid compatible
decoder_name = OMX_MPEG4_DECODER;
m_codingType = OMX_VIDEO_CodingMPEG4;
m_video_codec_name = "omx-h263";
break;
case AV_CODEC_ID_VP6:
// this form is encoded upside down
vflip = true;
// fall through
case AV_CODEC_ID_VP6F:
case AV_CODEC_ID_VP6A:
// (role name) video_decoder.vp6
// VP6
//.........这里部分代码省略.........
示例10: PartitionInfo
//.........这里部分代码省略.........
BYTE bLayoutInfo[20240];
DISK_GEOMETRY dg;
for( int iDrive = 0; iDrive < 8; iDrive++ )
{
if( !Open(iDrive) )
continue;
if( GetDriveGeometryEx( (DISK_GEOMETRY_EX*) bLayoutInfo, sizeof(bLayoutInfo) ) )
{
DISK_GEOMETRY& dgref = (((DISK_GEOMETRY_EX*)bLayoutInfo)->Geometry);
dg = dgref;
PartitionInfo* p = new PartitionInfo();
p->m_dwDrive = (DWORD) iDrive;
p->m_dwPartition = 0;
p->m_bIsPartition = FALSE; //! was TRUE. -AEB
p->m_dwBytesPerSector = dg.BytesPerSector;
p->m_NumberOfSectors = dg.Cylinders.QuadPart;
p->m_NumberOfSectors *= dg.SectorsPerTrack;
p->m_NumberOfSectors *= dg.TracksPerCylinder;
p->m_StartingOffset = 0;
p->m_StartingSector = 0;
p->m_PartitionLength = p->m_NumberOfSectors;
p->m_PartitionLength *= dg.BytesPerSector;
list.push_back(p);
if( GetDriveLayoutEx( bLayoutInfo, sizeof(bLayoutInfo) ) )
{
PDRIVE_LAYOUT_INFORMATION_EX pLI = (PDRIVE_LAYOUT_INFORMATION_EX)bLayoutInfo;
for( DWORD iPartition = 0; iPartition < pLI->PartitionCount; iPartition++ )
{
PARTITION_INFORMATION_EX* pi = &(pLI->PartitionEntry[iPartition]);
PartitionInfo* p = new PartitionInfo();
p->m_dwDrive = (DWORD) iDrive;
p->m_dwPartition = (DWORD) iPartition;
p->m_bIsPartition = TRUE;
p->m_dwBytesPerSector = dg.BytesPerSector;
p->m_NumberOfSectors = pi->PartitionLength.QuadPart;
p->m_NumberOfSectors /= dg.BytesPerSector;
p->m_StartingOffset = pi->StartingOffset.QuadPart;
p->m_StartingSector = p->m_StartingOffset;
p->m_StartingSector /= dg.BytesPerSector;
p->m_PartitionLength = pi->PartitionLength.QuadPart;
if (pi->PartitionStyle == PARTITION_STYLE_MBR)
{
p->m_nPartitionType = pi->Mbr.PartitionType;
}
list.push_back(p);
}
}
}
else
{
if( GetDriveGeometry( &dg ) )
{
PartitionInfo* p = new PartitionInfo();
p->m_dwDrive = (DWORD) iDrive;
p->m_dwPartition = 0;
p->m_bIsPartition = FALSE;
p->m_dwBytesPerSector = dg.BytesPerSector;
p->m_NumberOfSectors = dg.Cylinders.QuadPart;
p->m_NumberOfSectors *= dg.SectorsPerTrack;
p->m_NumberOfSectors *= dg.TracksPerCylinder;
p->m_StartingOffset = 0;
p->m_StartingSector = 0;
p->m_PartitionLength = p->m_NumberOfSectors;
p->m_PartitionLength *= dg.BytesPerSector;
list.push_back(p);
if( GetDriveLayout( bLayoutInfo, sizeof(bLayoutInfo) ) )
{
PDRIVE_LAYOUT_INFORMATION pLI = (PDRIVE_LAYOUT_INFORMATION)bLayoutInfo;
for( DWORD iPartition = 0; iPartition < pLI->PartitionCount; iPartition++ )
{
PARTITION_INFORMATION* pi = &(pLI->PartitionEntry[iPartition]);
if( !pi->PartitionLength.QuadPart )
continue;
PartitionInfo* p = new PartitionInfo();
p->m_dwDrive = (DWORD) iDrive;
p->m_dwPartition = (DWORD) iPartition;
p->m_bIsPartition = TRUE;
p->m_dwBytesPerSector = dg.BytesPerSector;
p->m_NumberOfSectors = pi->PartitionLength.QuadPart;
p->m_NumberOfSectors /= dg.BytesPerSector;
p->m_StartingOffset = pi->StartingOffset.QuadPart;
p->m_StartingSector = p->m_StartingOffset;
p->m_StartingSector /= dg.BytesPerSector;
p->m_PartitionLength = pi->PartitionLength.QuadPart;
list.push_back(p);
}
}
}
}
Close();
}
}
示例11: WXUNUSED
void MyFrame::OnClose(wxCommandEvent& WXUNUSED(event))
{
// true is to force the frame to close
Close(true);
}
示例12: Close
DBConnector::~DBConnector()
{
Close();
mysql_shutdown(&mysql, SHUTDOWN_DEFAULT);
}
示例13: Close
Fd::~Fd()
{
if(IsAcquired())
Close();
}
示例14: Close
void __fastcall TAPAffirmAndNotBookForm::btnExitClick(TObject *Sender)
{
Close();
}
示例15: Close
CFile::~CFile() {
Close();
}