47 SQUserPointer up =
nullptr;
49 return sa.Return(up ==
nullptr);
79 if (
cbMessageBox(
_(
"A script is trying to install a Code::Blocks plugin.\n" 80 "Do you wish to allow this?\n\n") + pluginName,
109 size_t nextPos = pos;
110 while (nextPos < menuPath.
Length() && menuPath.
GetChar(++nextPos) !=
_T(
'/'))
113 wxString current = menuPath.
Mid(pos, nextPos - pos);
116 bool isLast = nextPos >= menuPath.
Length();
121 int menuPos = mbar->
FindMenu(current);
135 #if wxCHECK_VERSION(3, 0, 0) 136 mbar->GetEventHandler()->ProcessEvent(evt);
138 if ( !mbar->ProcessEvent(evt) )
148 int existing = menu->
FindItem(current);
164 const wxString& filename = *SqPlus::GetInstance<wxString,false>(v, 2);
168 return sa.ThrowError(
cbU2C(msg));
170 return sa.Return(static_cast<SQInteger>(0));
175 const wxColour& c = sa.GetParamCount() == 2 ? *SqPlus::GetInstance<wxColour,false>(v, 2) : *
wxBLACK;
203 SqPlus::RegisterGlobal(
gLog,
"Log");
204 SqPlus::RegisterGlobal(
gDebugLog,
"LogDebug");
206 SqPlus::RegisterGlobal(
gErrorLog,
"LogError");
208 SqPlus::RegisterGlobal(
gMessage,
"Message");
215 SqPlus::RegisterGlobal(
getPM,
"GetProjectManager");
216 SqPlus::RegisterGlobal(
getEM,
"GetEditorManager");
217 SqPlus::RegisterGlobal(
getCM,
"GetConfigManager");
218 SqPlus::RegisterGlobal(
getUVM,
"GetUserVariableManager");
219 SqPlus::RegisterGlobal(
getSM,
"GetScriptingManager");
220 SqPlus::RegisterGlobal(
getCF,
"GetCompilerFactory");
227 SqPlus::RegisterGlobal(
FileTypeOf,
"FileTypeOf");
228 SqPlus::RegisterGlobal(
URLEncode,
"URLEncode");
240 SqPlus::RegisterGlobal(
CallMenu,
"CallMenu");
242 SqPlus::RegisterGlobal(
Include,
"Include");
243 SquirrelVM::CreateFunctionGlobal(
Require,
"Require",
"*");
247 SquirrelVM::CreateFunctionGlobal(
IsNull,
"IsNull",
"*");
DLLIMPORT wxArrayString GetArrayFromString(const wxString &text, const wxString &separator=DEFAULT_ARRAY_SEP, bool trimSpaces=true)
void gShowMessageWarn(const wxString &msg)
static void Display(const wxString &title, const wxString &message, unsigned int delay=5000, unsigned int hysteresis=1)
wxString wxGetPasswordFromUser(const wxString &message, const wxString &caption=wxGetPasswordFromUserPromptStr, const wxString &default_value=wxEmptyString, wxWindow *parent=NULL, int x=wxDefaultCoord, int y=wxDefaultCoord, bool centre=true)
static wxString GetFolder(SearchDirs dir)
Access one of Code::Blocks' folders.
PluginManager * GetPluginManager() const
SQRESULT sq_getinstanceup(HSQUIRRELVM v, SQInteger idx, SQUserPointer *p, SQUserPointer typetag)
ConfigManager * GetConfigManager(const wxString &name_space) const
UserVariableManager * GetUserVariableManager() const
void gShowMessageInfo(const wxString &msg)
static Manager * Get()
Use Manager::Get() to get a pointer to its instance Manager::Get() is guaranteed to never return an i...
void gShowMessageError(const wxString &msg)
ScriptingManager * getSM()
void LogWarning(const wxString &msg, int i=app_log)
DLLIMPORT wxString cbGetTextFromUser(const wxString &message, const wxString &caption=cbGetTextFromUserPromptStr, const wxString &default_value=wxEmptyString, wxWindow *parent=NULL, int x=wxDefaultCoord, int y=wxDefaultCoord, bool centre=true)
SQInteger IsNull(HSQUIRRELVM v)
CompilerFactory * getCF()
long wxGetNumberFromUser(const wxString &message, const wxString &prompt, const wxString &caption, long value, long min=0, long max=100, wxWindow *parent=NULL, const wxPoint &pos=wxDefaultPosition)
int ExecutePlugin(const wxString &pluginName)
void gShowMessage(const wxString &msg)
DLLIMPORT wxString URLEncode(const wxString &str)
long wx_GetNumberFromUser(const wxString &message, const wxString &prompt, const wxString &caption, long value)
DLLIMPORT wxString GetStringFromArray(const wxArrayString &array, const wxString &separator=DEFAULT_ARRAY_SEP, bool SeparatorAtEnd=true)
DLLIMPORT FileType FileTypeOf(const wxString &filename)
bool InstallPlugin(const wxString &pluginName, bool allUsers, bool confirm)
#define wxICON_INFORMATION
wxString wx_GetPasswordFromUser(const wxString &message, const wxString &caption, const wxString &default_value)
void NotifyMissingFile(const wxString &name)
void gDebugLog(const wxString &msg)
wxString wx_GetTextFromUser(const wxString &message, const wxString &caption, const wxString &default_value)
static wxString LocateDataFile(const wxString &filename, int search_dirs=sdAllKnown)
Locate a file in an installation- and platform-independent way.
void gErrorLog(const wxString &msg)
EditorManager * GetEditorManager() const
DLLIMPORT const wxWX2MBbuf cbU2C(const wxString &str)
Return multibyte (C string) representation of the string.
void LogError(const wxString &msg, int i=app_log)
ProjectManager * GetProjectManager() const
Functions returning pointers to the respective sub-manager instances.
SQInteger Require(HSQUIRRELVM v)
bool LoadScript(const wxString &filename)
Loads a script.
DLLIMPORT wxString UnixFilename(const wxString &filename, wxPathFormat format=wxPATH_NATIVE)
UserVariableManager * getUVM()
wxFrame * GetAppFrame() const
void gWarningLog(const wxString &msg)
void gLog(const wxString &msg)
LogManager * GetLogManager() const
const wxStringCharType * wx_str() const
MacrosManager * GetMacrosManager() const
const wxString & _(const wxString &string)
void ReplaceMacros(wxString &buffer, ProjectBuildTarget *target=nullptr, bool subrequest=false)
bool ToLong(long *val, int base=10) const
int gMessage(const wxString &msg, const wxString &caption, int buttons)
wxString gReplaceMacros(const wxString &buffer)
The entry point singleton for working with projects.
int ExecutePlugin(const wxString &pluginName)
Provides scripting in Code::Blocks.
void Log(const wxString &msg, int i=app_log, Logger::level lv=Logger::info)
void DebugLog(const wxString &msg, Logger::level lv=Logger::info)
wxColour wxGetColourFromUser(wxWindow *parent, const wxColour &colInit, const wxString &caption=wxEmptyString, wxColourData *data=NULL)
SQInteger wx_GetColourFromUser(HSQUIRRELVM v)
void Include(const wxString &filename)
bool InstallPlugin(const wxString &pluginName, bool forAllUsers=true, bool askForConfirmation=true)
wxUniChar GetChar(size_t n) const
bool wxLaunchDefaultBrowser(const wxString &url, int flags=0)
ScriptingManager * GetScriptingManager() const
DLLIMPORT wxString EscapeSpaces(const wxString &str)
Escapes spaces and tabs (NOT quoting the string)
int Printf(const wxString &pszFormat,...)
static wxString Format(const wxString &format,...)
wxString Mid(size_t first, size_t nCount=wxString::npos) const
long wxString_ToLong(wxString const &str)
DLLIMPORT int cbMessageBox(const wxString &message, const wxString &caption=wxEmptyString, int style=wxOK, wxWindow *parent=NULL, int x=-1, int y=-1)
wxMessageBox wrapper.