📄 helper.cpp
字号:
}
}
//---------------------------------------------------------
void Do_Beep(int Style)
{
switch( Style )
{
case -1: // no noise...
break;
case 0: default:
#if defined(__WXMSW__)
Beep(330, 100);
Beep(440, 100);
Beep(550, 100);
#else
wxBell();
#endif
break;
}
}
///////////////////////////////////////////////////////////
// //
// //
// //
///////////////////////////////////////////////////////////
//---------------------------------------------------------
void MSG_General_Add_Line(void)
{
if( g_pINFO )
{
g_pINFO->Get_General()->Add_Line();
}
}
//---------------------------------------------------------
void MSG_General_Add(const wxChar *Message, bool bNewLine, bool bTime)
{
if( g_pINFO )
{
g_pINFO->Get_General()->Add_String(Message, bNewLine, bTime);
}
}
//---------------------------------------------------------
void MSG_Error_Add_Line(void)
{
if( g_pINFO )
{
g_pINFO->Get_Errors()->Add_Line();
}
}
//---------------------------------------------------------
void MSG_Error_Add(const wxChar *Message, bool bNewLine, bool bTime)
{
if( g_pINFO )
{
g_pINFO->Get_Errors()->Add_String(Message, bNewLine, bTime);
}
}
//---------------------------------------------------------
void MSG_Execution_Add_Line(void)
{
if( g_pINFO )
{
g_pINFO->Get_Execution()->Add_Line();
}
}
//---------------------------------------------------------
void MSG_Execution_Add(const wxChar *Message, bool bNewLine, bool bTime)
{
if( g_pINFO )
{
g_pINFO->Get_Execution()->Add_String(Message, bNewLine, bTime);
}
}
///////////////////////////////////////////////////////////
// //
// //
// //
///////////////////////////////////////////////////////////
//---------------------------------------------------------
bool CONFIG_Read(const wxChar *Group, const wxChar *Entry, wxString &Value)
{
wxConfigBase *pConfig = wxConfigBase::Get();
pConfig->SetPath(wxString::Format(wxT("/%s"), Group));
return( pConfig->Read(Entry, &Value) );
}
//---------------------------------------------------------
bool CONFIG_Read(const wxChar *Group, const wxChar *Entry, long &Value)
{
wxConfigBase *pConfig = wxConfigBase::Get();
pConfig->SetPath(wxString::Format(wxT("/%s"), Group));
return( pConfig->Read(Entry, &Value) );
}
//---------------------------------------------------------
bool CONFIG_Read(const wxChar *Group, const wxChar *Entry, double &Value)
{
wxConfigBase *pConfig = wxConfigBase::Get();
pConfig->SetPath(wxString::Format(wxT("/%s"), Group));
return( pConfig->Read(Entry, &Value) );
}
//---------------------------------------------------------
bool CONFIG_Read(const wxChar *Group, const wxChar *Entry, bool &Value)
{
wxConfigBase *pConfig = wxConfigBase::Get();
pConfig->SetPath(wxString::Format(wxT("/%s"), Group));
return( pConfig->Read(Entry, &Value) );
}
//---------------------------------------------------------
bool CONFIG_Write(const wxChar *Group, const wxChar *Entry, const wxChar *Value)
{
wxConfigBase *pConfig = wxConfigBase::Get();
pConfig->SetPath(wxString::Format(wxT("/%s"), Group));
return( pConfig->Write(Entry, Value) ? pConfig->Flush() : false );
}
//---------------------------------------------------------
bool CONFIG_Write(const wxChar *Group, const wxChar *Entry, long Value)
{
wxConfigBase *pConfig = wxConfigBase::Get();
pConfig->SetPath(wxString::Format(wxT("/%s"), Group));
return( pConfig->Write(Entry, Value) ? pConfig->Flush() : false );
}
//---------------------------------------------------------
bool CONFIG_Write(const wxChar *Group, const wxChar *Entry, double Value)
{
wxConfigBase *pConfig = wxConfigBase::Get();
pConfig->SetPath(wxString::Format(wxT("/%s"), Group));
return( pConfig->Write(Entry, Value) ? pConfig->Flush() : false );
}
//---------------------------------------------------------
bool CONFIG_Write(const wxChar *Group, const wxChar *Entry, bool Value)
{
wxConfigBase *pConfig = wxConfigBase::Get();
pConfig->SetPath(wxString::Format(wxT("/%s"), Group));
return( pConfig->Write(Entry, Value) ? pConfig->Flush() : false );
}
//---------------------------------------------------------
bool CONFIG_Delete(const wxChar *Group)
{
wxConfigBase *pConfig = wxConfigBase::Get();
return( pConfig->DeleteGroup(Group) ? pConfig->Flush() : false );
}
bool CONFIG_Delete(const wxChar *Group, const wxChar *Entry)
{
wxConfigBase *pConfig = wxConfigBase::Get();
pConfig->SetPath(wxString::Format(wxT("/%s"), Group));
return( pConfig->DeleteEntry(Entry) ? pConfig->Flush() : false );
}
///////////////////////////////////////////////////////////
// //
// //
// //
///////////////////////////////////////////////////////////
//---------------------------------------------------------
bool PROCESS_is_Executing(void)
{
return( g_pModule != NULL );
}
//---------------------------------------------------------
bool PROCESS_Wait(void)
{
if( g_pSAGA )
{
return( g_pSAGA->Process_Wait() );
}
return( true );
}
//---------------------------------------------------------
bool PROCESS_Get_Okay(bool bBlink)
{
if( g_pSAGA_Frame )
{
return( g_pSAGA_Frame->Process_Get_Okay(bBlink) );
}
return( true );
}
//---------------------------------------------------------
bool PROCESS_Set_Okay(bool bOkay)
{
if( g_pSAGA_Frame )
{
return( g_pSAGA_Frame->Process_Set_Okay(bOkay) );
}
return( true );
}
//---------------------------------------------------------
bool PROGRESSBAR_Set_Position(int Position)
{
if( g_pSAGA_Frame )
{
return( g_pSAGA_Frame->ProgressBar_Set_Position(Position) );
}
return( true );
}
//---------------------------------------------------------
bool PROGRESSBAR_Set_Position(double Position, double Range)
{
if( g_pSAGA_Frame )
{
return( g_pSAGA_Frame->ProgressBar_Set_Position(Position, Range) );
}
return( true );
}
//---------------------------------------------------------
void STATUSBAR_Set_Text(const wxChar *Text, int iPane)
{
if( g_pSAGA_Frame )
{
g_pSAGA_Frame->StatusBar_Set_Text(Text, iPane);
}
}
///////////////////////////////////////////////////////////
// //
// //
// //
///////////////////////////////////////////////////////////
//---------------------------------------------------------
bool Open_WebBrowser(const wxChar *HRef)
{
bool bResult = false;
wxString Command;
wxFileType *pFileType;
if( (pFileType = wxTheMimeTypesManager->GetFileTypeFromExtension(wxT("html"))) != NULL )
{
if( pFileType->GetOpenCommand(&Command, wxFileType::MessageParameters(HRef, wxT(""))) )
{
bResult = wxExecute(Command) == 0;
}
delete(pFileType);
}
return( bResult );
}
///////////////////////////////////////////////////////////
// //
// //
// //
///////////////////////////////////////////////////////////
//---------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -