87 const static wxString gDefaultLayout =
_T(
"Code::Blocks default");
91 const static wxString gMinimalLayout =
_T(
"Code::Blocks minimal");
556 :
wxFrame(parent, -1, _T("MainWin"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE),
557 m_LayoutManager(this),
559 m_filesHistory(
_("&File"), wxT("/recent_files"), idFileOpenRecentFileClearHistory,
wxID_CBFILE01),
560 m_projectsHistory(
_("&File"), wxT("/recent_projects"), idFileOpenRecentProjectClearHistory,
wxID_CBFILE17),
561 m_pCloseFullScreenBtn(
nullptr),
564 m_pPrjManUI(
nullptr),
566 m_pInfoPane(
nullptr),
568 m_ToolsMenu(
nullptr),
569 m_HelpPluginsMenu(
nullptr),
570 m_ScanningForPlugins(false),
571 m_StartupDone(false),
572 m_InitiatedShutdown(false),
573 m_AutoHideLockCounter(0),
574 m_LastCtrlAltTabWindow(0),
575 m_LastLayoutIsTemp(false),
576 m_pScriptConsole(
nullptr),
577 m_pBatchBuildDialog(
nullptr),
579 m_pHighlightButton(
nullptr)
601 SetAcceleratorTable(*m_pAccel);
607 m_SmallToolBar = cfg->
ReadBool(
_T(
"/environment/toolbar_size"),
true);
611 SetIcon(
wxICON(A_MAIN_ICON));
622 sb->Show(cfg->
ReadBool(
_T(
"/main_frame/statusbar"),
true));
635 cfg->
Write(
_T(
"/main_frame/layout/default"), gDefaultLayout);
636 DoFixToolbarsLayout();
637 gDefaultLayoutData = m_LayoutManager.SavePerspective();
638 gDefaultMessagePaneLayoutData = m_pInfoPane->SaveTabOrder();
639 SaveViewLayout(gDefaultLayout, gDefaultLayoutData, gDefaultMessagePaneLayoutData);
642 wxAuiPaneInfoArray& panes = m_LayoutManager.GetAllPanes();
643 for (
size_t i = 0; i < panes.GetCount(); ++i)
646 if (!(info.name ==
_T(
"MainPane")))
649 gMinimalLayoutData = m_LayoutManager.SavePerspective();
650 gMinimalMessagePaneLayoutData = m_pInfoPane->SaveTabOrder();
651 SaveViewLayout(gMinimalLayout, gMinimalLayoutData, gMinimalMessagePaneLayoutData);
657 RegisterScriptFunctions();
670 delete m_debuggerMenuHandler;
671 delete m_debuggerToolbarHandler;
718 if (forceShow || showAtStartup)
723 showAtStartup =
wxShowTip(
this, tipProvider, showAtStartup);
733 wxSize clientsize = GetClientSize();
737 m_pCloseFullScreenBtn->Show(
false );
744 m_LayoutManager.AddPane( m_pPrjManUI->GetNotebook(),
751 m_pPrjMan->SetUI(m_pPrjManUI);
768 m_LayoutManager.AddPane(m_pScriptConsole,
wxAuiPaneInfo().Name(
wxT(
"ScriptConsole")).
769 Caption(
_(
"Scripting console")).
Float().MinSize(100,100).FloatingPosition(300, 200).Hide());
772 DoUpdateLayoutColours();
773 DoUpdateEditorStyle();
776 if (m_pPrjManUI->GetNotebook())
786 m_LayoutManager.SetDockSizeConstraint(0.75,0.75);
789 wxSize clientsize = GetClientSize();
797 Name(
wxT(
"MessagesPane")).Caption(
_(
"Logs & others")).
809 m_findReplace.CreateSearchLog();
813 m_pBatchBuildDialog =
new BatchLogWindow(
this,
_(
"Code::Blocks - Batch build"));
815 m_pInfoPane =
new InfoPane(m_pBatchBuildDialog);
817 m_pBatchBuildDialog->SetSizer(s);
832 m_debuggerMenuHandler->SetEvtHandlerEnabled(
false);
833 m_debuggerToolbarHandler->SetEvtHandlerEnabled(
false);
837 window->PushEventHandler(m_debuggerMenuHandler);
838 window->PushEventHandler(m_debuggerToolbarHandler);
840 m_debuggerMenuHandler->SetEvtHandlerEnabled(
true);
841 m_debuggerToolbarHandler->SetEvtHandlerEnabled(
true);
846 m_debuggerMenuHandler->RegisterDefaultWindowItems();
854 SqPlus::SQClassDef<MainFrame>(
"MainFrame").
857 SqPlus::BindVariable(
this,
"App", SqPlus::VAR_ACCESS_READ_ONLY);
865 for (
size_t i = 0; i < keys.
GetCount(); ++i)
869 if (mgr->
Read(
_T(
"/startup_scripts/") + keys[i], &ser))
892 catch (SquirrelError& exception)
909 for (
unsigned int i = 0; i < plugins.GetCount(); ++i)
911 cbPlugin* plug = plugins[i]->plugin;
916 if (m_PluginsTools[plug])
919 wxMenu* viewToolbars =
nullptr;
920 GetMenuBar()->
FindItem(idViewToolMain, &viewToolbars);
925 wxMenuItem* item = AddPluginInMenus(viewToolbars, plug,
949 for (LayoutViewsMap::iterator it = m_LayoutViews.begin(); it != m_LayoutViews.end(); ++it)
951 if (it->first.IsEmpty())
953 SaveViewLayout(it->first, it->second,
954 m_LayoutMessagePane[it->first],
955 it->first == m_LastLayoutName);
968 wxMenu *tools=
nullptr, *plugs=
nullptr, *pluginsM=
nullptr;
973 xml_res->
Load(resPath +
_T(
"/resources.zip#zip:main_menu.xrc"));
987 mbar->
FindItem(idEditHighlightModeText, &hl);
994 for (
size_t i = 0; i < langs.
GetCount(); ++i)
996 if (i > 0 && !(i % 20))
1000 wxString::Format(
_(
"Switch highlighting mode for current document to \"%s\""), langs[i].wx_str()));
1001 Connect(
id, -1, wxEVT_COMMAND_MENU_SELECTED,
1002 (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction)
1015 editMenu->
Append(idEditCompleteCode,
_(
"Complete code\tShift-Space"));
1018 editMenu->
Append(idEditCompleteCode,
_(
"Complete code\tCtrl-Space"));
1023 tools = mbar->
GetMenu(tmpidx);
1027 plugs = mbar->
GetMenu(tmpidx);
1029 if ((tmpitem = mbar->
FindItem(idHelpPlugins,
nullptr)))
1032 m_ToolsMenu = tools ? tools :
new wxMenu();
1033 m_PluginsMenu = plugs ? plugs :
new wxMenu();
1034 m_HelpPluginsMenu = pluginsM ? pluginsM :
new wxMenu();
1043 for (
unsigned int i = 0; i < plugins.GetCount(); ++i)
1045 cbPlugin* plug = plugins[i]->plugin;
1052 AddPluginInHelpPluginsMenu(plug);
1068 if ((platform::carbon) || (platform::gtk))
1080 if (platform::carbon)
1081 accel =
wxT(
"Alt+Tab");
1082 else if (platform::gtk)
1083 accel =
wxT(
"Ctrl+,");
1090 InitializeRecentFilesHistory();
1100 SetToolBar(
nullptr);
1101 m_pToolbar =
nullptr;
1106 xrcToolbarName +=
_T(
"_16x16");
1110 xml_res->
Load(resPath +
_T(
"/resources.zip#zip:") + xrcToolbarName +
_T(
"*.xrc"));
1116 m_pToolbar->Realize();
1121 m_pToolbar->SetInitialSize();
1126 std::vector<ToolbarInfo> toolbars;
1129 toolbars.push_back(
ToolbarInfo(m_debuggerToolbarHandler->GetToolbar(),
1135 for (
unsigned int i = 0; i < plugins.GetCount(); ++i)
1137 cbPlugin* plug = plugins[i]->plugin;
1143 toolbars.push_back(info);
1151 std::sort(toolbars.begin(), toolbars.end());
1153 int row = 0, position = 0, rowLength = 0;
1154 int maxLength = GetSize().x;
1156 for (std::vector<ToolbarInfo>::iterator it = toolbars.begin(); it != toolbars.end(); ++it)
1158 rowLength += it->toolbar->GetSize().x;
1159 if (rowLength >= maxLength)
1163 rowLength = it->toolbar->GetSize().x;
1168 position += it->toolbar->GetSize().x;
1173 SetToolBar(
nullptr);
1179 m_pToolbar->SetToolShortHelp(
id, shortHelp);
1180 m_pToolbar->SetToolLongHelp(
id, longHelp);
1185 m_ScanningForPlugins =
true;
1186 m_PluginIDsMap.clear();
1209 m_ScanningForPlugins =
false;
1215 if (!plugin || !menu)
1222 PluginIDsMap::iterator it;
1223 for (it = m_PluginIDsMap.begin(); it != m_PluginIDsMap.end(); ++it)
1225 if (it->second == info->
name)
1235 m_PluginIDsMap[id] = info->
name;
1247 Connect(
id, wxEVT_COMMAND_MENU_SELECTED, callback );
1258 if (m_PluginsMenu->GetMenuItemCount() == 1)
1261 AddPluginInMenus(m_PluginsMenu, plugin,
1263 m_PluginsMenu->GetMenuItemCount() - 2);
1268 AddPluginInMenus(m_HelpPluginsMenu, plugin,
1275 for (
size_t i = 0; i < subs.
GetCount(); ++i)
1280 SaveViewLayout(name, layout, layoutMP);
1283 LoadViewLayout(deflayout);
1286 if (m_pPrjManUI->GetNotebook())
1287 m_pPrjManUI->GetNotebook()->SetSelection(
Manager::Get()->GetConfigManager(
_T(
"app"))->ReadInt(
_T(
"/main_frame/layout/left_block_selection"), 0));
1288 m_pInfoPane->SetSelection(
Manager::Get()->GetConfigManager(
_T(
"app"))->ReadInt(
_T(
"/main_frame/layout/bottom_block_selection"), 0));
1292 if (
Manager::Get()->GetConfigManager(
_T(
"app"))->ReadBool(
_T(
"/environment/infopane_tabs_bottom"),
false))
1293 m_pInfoPane->SetWindowStyleFlag(m_pInfoPane->GetWindowStyleFlag() | wxAUI_NB_BOTTOM);
1313 Manager::Get()->GetConfigManager(
_T(
"app"))->ReadInt(
_T(
"/main_frame/layout/top"), y),
1314 Manager::Get()->GetConfigManager(
_T(
"app"))->ReadInt(
_T(
"/main_frame/layout/width"), w),
1315 Manager::Get()->GetConfigManager(
_T(
"app"))->ReadInt(
_T(
"/main_frame/layout/height"), h));
1318 Maximize(maximized);
1323 if ((last_display_index>=0) && (last_display_index<static_cast<int>(
wxDisplay::GetCount())))
1324 display_index_window =
static_cast<int>(last_display_index);
1325 int display_index = ((display_index_window>=0) ? display_index_window : 0);
1351 DoCheckCurrentLayoutForChanges(
false);
1356 for (
size_t i = 0; i < subs.
GetCount(); ++i)
1362 for (LayoutViewsMap::iterator it = m_LayoutViews.begin(); it != m_LayoutViews.end(); ++it)
1364 if (it->first.IsEmpty())
1371 if (!m_LayoutMessagePane[it->first].IsEmpty())
1376 if (m_pPrjManUI->GetNotebook())
1378 int selection = m_pPrjManUI->GetNotebook()->GetSelection();
1385 if (!IsMaximized() && !IsIconized())
1397 if (m_LastLayoutName != name && !DoCheckCurrentLayoutForChanges(
true))
1400 m_LastLayoutIsTemp = isTemp;
1402 wxString layout = m_LayoutViews[name];
1403 wxString layoutMP = m_LayoutMessagePane[name];
1405 layoutMP = m_LayoutMessagePane[gDefaultLayout];
1409 SaveViewLayout(name, layout, layoutMP,
false);
1410 DoSelectLayout(name);
1413 DoSelectLayout(name);
1416 m_pInfoPane->LoadTabOrder(layoutMP);
1417 m_LayoutManager.LoadPerspective(layout,
false);
1421 m_PreviousLayoutName = m_LastLayoutName;
1422 m_LastLayoutName = name;
1423 m_LastLayoutData = layout;
1424 m_LastMessagePaneLayoutData = layoutMP;
1435 m_LayoutViews[name] = layout;
1436 m_LayoutMessagePane[name] = layoutMP;
1437 wxMenu* viewLayouts =
nullptr;
1438 GetMenuBar()->
FindItem(idViewLayoutSave, &viewLayouts);
1443 Connect(
id, wxEVT_COMMAND_MENU_SELECTED,
1445 m_PluginIDsMap[id] = name;
1449 DoSelectLayout(name);
1450 m_LastLayoutName = name;
1464 while(strTokColon.HasMoreTokens())
1466 wxString theToken = strTokColon.GetNextToken();
1474 arLayout1.
Add(theToken);
1483 while(strTokColon.HasMoreTokens())
1485 wxString theToken = strTokColon.GetNextToken();
1493 arLayout2.
Add(theToken);
1500 return arLayout1 != arLayout2;
1529 return arLayout1 != arLayout2;
1534 DoFixToolbarsLayout();
1535 wxString lastlayout = m_LayoutManager.SavePerspective();
1536 wxString lastmessagepanelayout = m_pInfoPane->SaveTabOrder();
1537 if (!m_LastLayoutName.IsEmpty() &&
1538 (LayoutDifferent(lastlayout, m_LastLayoutData) ||
1539 LayoutMessagePaneDifferent(lastmessagepanelayout, m_LastMessagePaneLayoutData,
Manager::Get()->GetConfigManager(
_T(
"message_manager"))->ReadBool(
_T(
"/save_selection_change_in_mp"),
true)) ))
1550 SaveViewLayout(m_LastLayoutName, lastlayout, lastmessagepanelayout,
false);
1553 DoSelectLayout(m_LastLayoutName);
1565 wxAuiPaneInfoArray& panes = m_LayoutManager.GetAllPanes();
1566 for (
size_t i = 0; i < panes.GetCount(); ++i)
1569 if (info.state & wxAuiPaneInfo::optionToolbar)
1571 info.best_size = info.window->GetBestSize();
1579 wxMenu* viewLayouts =
nullptr;
1580 GetMenuBar()->
FindItem(idViewLayoutSave, &viewLayouts);
1584 for (
size_t i = 0; i < items.GetCount(); ++i)
1586 if (!items[i]->IsCheckable())
1588 #if wxCHECK_VERSION(3, 0, 0) 1589 items[i]->Check(items[i]->GetItemLabel().IsSameAs(name));
1591 items[i]->Check(items[i]->GetText().IsSameAs(name));
1595 if (!m_LastLayoutIsTemp)
1611 tb->SetInitialSize();
1621 SetToolBar(
nullptr);
1625 wxMenu* viewToolbars =
nullptr;
1626 GetMenuBar()->
FindItem(idViewToolMain, &viewToolbars);
1629 wxMenuItem* item = AddPluginInMenus(viewToolbars, plugin,
1635 m_PluginsTools[plugin] = info.
toolbar;
1656 AddPluginInHelpPluginsMenu(plugin);
1659 AddPluginInPluginsMenu(plugin);
1676 if (!m_ScanningForPlugins)
1679 const ToolbarInfo &toolbarInfo = DoAddPluginToolbar(plugin);
1685 const wxAuiPaneInfoArray &panes = m_LayoutManager.GetAllPanes();
1686 for (
size_t ii = 0; ii < panes.GetCount(); ++ii)
1690 row = std::max(row, info.dock_row);
1692 int minX = 100000, maxX = -100000;
1694 for (
size_t ii = 0; ii < panes.GetCount(); ++ii)
1697 if (info.
IsToolbar() && info.dock_row == row && info.window)
1699 const wxPoint &pt = info.window->GetPosition();
1700 minX = std::min(minX, pt.
x + info.window->GetSize().x);
1701 maxX = std::max(maxX, pt.
x + info.window->GetSize().x);
1702 position = std::max(position, info.dock_pos);
1705 if (maxX + toolbarInfo.
toolbar->GetSize().x <= GetSize().x)
1713 m_LayoutManager.AddPane(toolbarInfo.
toolbar, paneInfo. ToolbarPane().Top().Row(row).Position(position));
1721 DoAddPluginStatusField(plugin);
1731 logger->
DebugLog(
_T(
"Opening file ") + name);
1732 bool ret = OpenGeneric(name, addToHistory);
1746 wxFD_OPEN | compatibility::wxHideReadonly);
1767 if (filename ==
Manager::Get()->GetProjectManager()->GetWorkspace()->GetFilename())
1771 if ( DoCloseCurrentWorkspace() )
1774 ShowHideStartPage(
true);
1777 ShowHideStartPage();
1778 else if (addToHistory)
1779 m_projectsHistory.AddToHistory(
Manager::Get()->GetProjectManager()->GetWorkspace()->GetFilename());
1797 return DoOpenProject(filename, addToHistory);
1816 return DoOpenFile(filename, addToHistory);
1826 cbMessageBox(
_(
"Could not open file ") + filename +
_(
",\nbecause no extension handler could be found."),
_(
"Error"),
wxICON_ERROR);
1829 if (plugin->
OpenFile(filename) == 0)
1831 m_filesHistory.AddToHistory(filename);
1849 ShowHideStartPage(
true);
1854 m_projectsHistory.AddToHistory(prj->
GetFilename());
1857 ShowHideStartPage();
1883 wxFont font = dc.GetFont();
1890 dc.GetTextExtent(
_(
" Highlight Button "), &widths[num++], &h);
1891 dc.GetTextExtent(
_(
" Windows (CR+LF) "), &widths[num++], &h);
1892 dc.GetTextExtent(
_(
" WINDOWS-1252 "), &widths[num++], &h);
1893 dc.GetTextExtent(
_(
" Line 12345, Col 123, Pos 123456 "), &widths[num++], &h);
1894 dc.GetTextExtent(
_(
" Overwrite "), &widths[num++], &h);
1895 dc.GetTextExtent(
_(
" Modified "), &widths[num++], &h);
1896 dc.GetTextExtent(
_(
" Read/Write "), &widths[num++], &h);
1897 dc.GetTextExtent(
_(
" name_of_profile "), &widths[num++], &h);
1903 SetStatusWidths(num, widths);
1913 const int height = std::max(sb->GetMinHeight(), m_pHighlightButton->GetClientSize().GetHeight());
1923 if (text != button.GetLabel())
1924 button.SetLabel(text);
1929 if (!GetStatusBar())
1946 if (m_pHighlightButton)
1963 SetStatusText(msg, panel++);
1966 SetStatusText(msg, panel++);
1967 SetStatusText(control->
GetOvertype() ?
_(
"Overwrite") :
_(
"Insert"), panel++);
1968 #if wxCHECK_VERSION(3, 0, 0) 1969 SetStatusText(ed->
GetModified() ?
_(
"Modified") :
_T(
""), panel++);
1973 SetStatusText(control->
GetReadOnly() ?
_(
"Read only") :
_(
"Read/Write"), panel++);
1974 SetStatusText(personality, panel++);
1986 if (m_pHighlightButton)
1996 SetStatusText(personality, panel++);
2008 long nbstyle = cfg->
ReadInt(
_T(
"/environment/tabs_style"), 0);
2024 #if defined(__WXGTK__) && (USE_GTK_NOTEBOOK) && !wxCHECK_VERSION(3, 0, 0) 2034 nbstyle = defaultStyle;
2035 if (cfg->
ReadBool(
_T(
"/environment/") + prefix +
_T(
"_tabs_bottom")))
2036 nbstyle |= wxAUI_NB_BOTTOM;
2038 if (cfg->
ReadBool(
_T(
"/environment/tabs_list")))
2039 nbstyle |= wxAUI_NB_WINDOWLIST_BUTTON;
2041 target->SetWindowStyleFlag(nbstyle);
2046 long style = wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_MOVE | wxAUI_NB_SCROLL_BUTTONS | wxAUI_NB_MIDDLE_CLICK_CLOSE;
2051 style |= wxAUI_NB_CLOSE_ON_ACTIVE_TAB;
2055 style |= wxAUI_NB_CLOSE_BUTTON;
2059 style |= wxAUI_NB_CLOSE_ON_ALL_TABS;
2066 if (
Manager::Get()->GetConfigManager(
_T(
"app"))->ReadBool(
_T(
"/environment/hide_editor_tabs"),
false))
2070 DoUpdateEditorStyle(an,
_T(
"infopane"), style);
2072 an = m_pPrjManUI->GetNotebook();
2073 DoUpdateEditorStyle(an,
_T(
"project"), wxAUI_NB_SCROLL_BUTTONS | wxAUI_NB_TAB_MOVE);
2083 #else // #ifndef __WXGTK__ 2086 #endif // #ifndef __WXGTK__ 2106 DoFixToolbarsLayout();
2107 m_LayoutManager.Update();
2129 if (
Manager::Get()->GetProjectManager()->GetActiveProject() == prj)
2136 fulltitle = edname + projname;
2143 SetTitle(fulltitle);
2156 if (m_InitiatedShutdown)
2164 bool show = !forceHasProject &&
2178 sh =
new StartHerePage(
this, m_projectsHistory, m_filesHistory,
2184 else if (!show && sh)
2196 evt.
pWindow = m_pScriptConsole;
2203 evt.SetId(idFileNewProject);
2207 else if (link.
IsSameAs(
_T(
"CB_CMD_OPEN_PROJECT")))
2218 recent = link.
StartsWith(
_T(
"CB_CMD_OPEN_HISTORY_PROJECT_")) ? &m_projectsHistory : &m_filesHistory;
2223 if (!filename.
empty())
2225 if ( !OpenGeneric(filename,
true) )
2229 else if (link.
StartsWith(
_T(
"CB_CMD_DELETE_HISTORY_")))
2232 recent = link.
StartsWith(
_T(
"CB_CMD_DELETE_HISTORY_PROJECT_")) ? &m_projectsHistory : &m_filesHistory;
2238 else if (link.
IsSameAs(
_T(
"CB_CMD_TIP_OF_THE_DAY")))
2244 m_filesHistory.Initialize();
2245 m_projectsHistory.Initialize();
2250 m_filesHistory.TerminateHistory();
2251 m_projectsHistory.TerminateHistory();
2269 if (
Manager::Get()->GetProjectManager()->GetActiveProject() == prj)
2284 wxString pluginName = m_PluginIDsMap[
event.GetId()];
2293 wxString pluginName = m_PluginIDsMap[
event.GetId()];
2312 int id =
event.GetId();
2313 if (
id != idFileNewEmpty)
2318 if (
id == idFileNewProject) tot =
totProject;
2319 else if (
id == idFileNewTarget) tot =
totTarget;
2320 else if (
id == idFileNewFile) tot =
totFiles;
2321 else if (
id == idFileNewCustom) tot =
totCustom;
2322 else if (
id == idFileNewUser) tot =
totUser;
2332 if (!prj && filename.
IsEmpty())
2348 m_projectsHistory.AddToHistory(filename);
2350 m_filesHistory.AddToHistory(filename);
2371 if (ed && ed->IsOK())
2372 m_filesHistory.AddToHistory(ed->GetFilename());
2374 if (!ed || !project)
2377 wxString oldname = ed->GetFilename();
2378 if (
cbMessageBox(
_(
"Do you want to add this new file in the active project (has to be saved first)?"),
2379 _(
"Add file to project"),
2381 ed->SaveAs() && ed->IsOK())
2387 ed->SetProjectFile(pf);
2388 m_pPrjManUI->RebuildTree();
2398 bool success =
true;
2402 for (
unsigned int i = 0; i < files.
GetCount(); ++i)
2407 foundWorkspace = files[i];
2412 if (!foundWorkspace.
IsEmpty())
2413 success &= OpenGeneric(foundWorkspace);
2419 for (
unsigned int i = 0; i < files.
GetCount(); ++i)
2420 success &= OpenGeneric(files[i]);
2432 bar->
FindItem(idFileNewProject, &popup);
2462 wxString Filter = mgr->
Read(
_T(
"/file_dialogs/file_new_open/filter"));
2465 Path = mgr->
Read(
_T(
"/file_dialogs/file_new_open/directory"), Path);
2483 if (mgr && !bProject)
2488 mgr->
Write(
_T(
"/file_dialogs/file_new_open/filter"), Filter);
2500 DoOnFileOpen(
false);
2506 wxString fname = m_projectsHistory.GetHistoryFile(
id);
2507 if (!OpenGeneric(fname,
true))
2508 m_projectsHistory.AskToRemoveFileFromHistory(
id);
2513 m_projectsHistory.ClearHistory();
2519 wxString fname = m_filesHistory.GetHistoryFile(
id);
2520 if (!OpenGeneric(fname,
true))
2521 m_filesHistory.AskToRemoveFileFromHistory(
id);
2526 m_filesHistory.ClearHistory();
2534 msg.
Printf(
_(
"File %s could not be saved..."),
Manager::Get()->GetEditorManager()->GetActiveEditor()->GetFilename().wx_str());
2537 DoUpdateStatusBar();
2543 DoUpdateStatusBar();
2552 DoUpdateStatusBar();
2561 DoUpdateStatusBar();
2578 DoUpdateStatusBar();
2597 DoUpdateStatusBar();
2652 DoCloseCurrentWorkspace();
2658 DoUpdateStatusBar();
2665 DoUpdateStatusBar();
2671 DoUpdateStatusBar();
2677 DoUpdateStatusBar();
2702 if (m_pHighlightButton)
2705 if ( GetStatusBar()->GetFieldRect(1, rect) )
2708 m_pHighlightButton->SetSize(rect.
GetSize());
2718 if (m_InitiatedShutdown)
2725 m_InitiatedShutdown =
true;
2733 int result =
cbMessageBox(
_(
"Currently compiling. Stop compilation and exit?"),
2742 m_InitiatedShutdown =
false;
2753 m_InitiatedShutdown =
false;
2758 if (!DoCloseCurrentWorkspace())
2761 m_InitiatedShutdown =
false;
2776 if (m_pPrjManUI->GetNotebook())
2777 m_LayoutManager.DetachPane(m_pPrjManUI->GetNotebook());
2778 m_LayoutManager.DetachPane(m_pInfoPane);
2779 m_LayoutManager.DetachPane(
Manager::Get()->GetEditorManager()->GetNotebook());
2781 m_LayoutManager.UnInit();
2782 TerminateRecentFilesHistory();
2786 while (GetEventHandler() !=
this)
2787 PopEventHandler(
false);
2794 m_pInfoPane->Destroy();
2795 m_pInfoPane =
nullptr;
2800 PluginToolbarsMap::iterator it;
2801 for( it = m_PluginsTools.begin(); it != m_PluginsTools.end(); ++it )
2819 DoUpdateStatusBar();
2833 static_cast<cbEditor*>(ed)->ToggleBookmark();
2840 static_cast<cbEditor*>(ed)->GotoNextBookmark();
2847 static_cast<cbEditor*>(ed)->GotoPreviousBookmark();
2854 static_cast<cbEditor*>(ed)->ClearAllBookmarks();
3064 const bool isLastLine = (endPos == stc->
GetLineCount() - 1);
3077 stc->
InsertText(endPos + (isLastLine ? 0 : 1), line);
3079 stc->
DeleteRange(startPos - lineLength, lineLength);
3080 startPos -= lineLength;
3081 endPos -= lineLength;
3091 endPos + 1 + lineLength);
3094 startPos += lineLength;
3095 endPos += lineLength;
3118 OnEditGotoLineEnd(event);
3189 struct EditorSelection
3193 bool Empty()
const {
return caret == anchor; }
3194 bool IsReversed()
const {
return caret < anchor; }
3196 long GetStart()
const {
return std::min(caret, anchor); }
3197 long GetEnd()
const {
return std::max(caret, anchor); }
3199 bool Contains(
const EditorSelection &selection)
const 3201 return !(GetEnd() < selection.GetStart() || GetStart() > selection.GetEnd());
3214 int pos = control->
FindText(selectionEnd, eof, selectedText, flag, &endPos);
3234 bool GetSelectionInEditor(EditorSelection &selection,
cbStyledTextCtrl *control)
3238 if (main >=0 && main < count)
3257 EditorSelection selection;
3258 if (!GetSelectionInEditor(selection, control))
3261 if (!selection.Empty())
3264 SelectNext(control, selectedText, selection.GetEnd(), selection.IsReversed());
3282 EditorSelection selection;
3283 if (!GetSelectionInEditor(selection, control))
3287 bool highlightOccurrences = cfgEditor->
ReadBool(
wxT(
"/highlight_occurrence/enabled"),
true);
3294 if (!SelectNext(control, selectedText, selection.GetEnd(), selection.IsReversed()))
3298 typedef std::vector<EditorSelection> Selections;
3299 Selections selections;
3301 for (
int ii = 0; ii < count; ++ii)
3303 EditorSelection item;
3307 if (!item.Contains(selection))
3308 selections.push_back(item);
3309 else if (highlightOccurrences)
3317 Selections::const_iterator it = selections.begin();
3326 for (; it != selections.end(); ++it)
3360 int curLine=startLine;
3367 if (startLine != endLine &&
3375 while( curLine <= endLine )
3416 int curLine = startLine;
3423 if (startLine != endLine &&
3431 while( curLine <= endLine )
3436 bool startsWithComment;
3437 bool endsWithComment;
3441 if ( startsWithComment )
3454 if ( startsWithComment && endsWithComment )
3507 int curLine = startLine;
3514 if (startLine != endLine &&
3522 bool doComment =
false;
3523 while( curLine <= endLine )
3527 int commentPos = strLine.
Strip( wxString::leading ).
Find( comment );
3529 if (commentPos != 0)
3539 curLine = startLine;
3540 while( curLine <= endLine )
3548 int Pos = strLine.
Find(comment);
3550 int end = start + comment.
Length();
3585 if ( startPos == endPos )
3589 if ( startPos == endPos )
3611 int p1 = startPos - 1;
3665 int curLine = startLine;
3672 if (startLine != endLine &&
3682 if (startLine == endLine)
3693 while( curLine <= endLine )
3734 GetMenuBar()->
FindItem(idEditHighlightModeText, &hl);
3743 if (m_pHighlightButton)
3857 LoadViewLayout(m_PluginIDsMap[event.GetId()]);
3868 DoFixToolbarsLayout();
3869 SaveViewLayout(name,
3870 m_LayoutManager.SavePerspective(),
3871 m_pInfoPane->SaveTabOrder(),
3878 if (m_LastLayoutName == gDefaultLayout)
3880 if (
cbMessageBox(
_(
"The default perspective cannot be deleted. It can always be reverted to " 3881 "a predefined state though.\nDo you want to revert it now?"),
3887 LoadViewLayout(gDefaultLayout);
3892 if (m_LastLayoutName == gMinimalLayout)
3894 if (
cbMessageBox(
_(
"The minimal layout cannot be deleted. It can always be reverted to " 3895 "a predefined state though.\nDo you want to revert it now?"),
3899 wxString tempLayout = m_PreviousLayoutName;
3902 LoadViewLayout(gMinimalLayout);
3903 m_PreviousLayoutName = tempLayout;
3913 LayoutViewsMap::iterator it = m_LayoutViews.
find(m_LastLayoutName);
3914 if (it != m_LayoutViews.end())
3915 m_LayoutViews.erase(it);
3916 it = m_LayoutMessagePane.find(m_LastLayoutName);
3917 if (it != m_LayoutMessagePane.end())
3918 m_LayoutMessagePane.erase(it);
3921 wxMenu* viewLayouts =
nullptr;
3922 GetMenuBar()->
FindItem(idViewLayoutSave, &viewLayouts);
3925 int id = viewLayouts->
FindItem(m_LastLayoutName);
3929 PluginIDsMap::iterator it2 = m_PluginIDsMap.find(
id);
3930 if (it2 != m_PluginIDsMap.end())
3931 m_PluginIDsMap.erase(it2);
3939 LoadViewLayout(gDefaultLayout);
3945 if (m_LastLayoutName == gMinimalLayout)
3946 LoadViewLayout(m_PreviousLayoutName.IsEmpty()?
Manager::Get()->
GetConfigManager(
_T(
"app"))->
Read(
_T(
"/environment/view/layout_to_toggle"),gDefaultLayout):m_PreviousLayoutName);
3950 if (cfg->
ReadBool(
_T(
"/environment/view/dbl_clk_maximize"),
true))
3951 LoadViewLayout(gMinimalLayout);
3957 ShowHideScriptConsole();
3967 if (hide_editor_tabs)
3979 if (!bDoMultipleFiles)
3981 m_findReplace.ShowFindDialog(
false, bDoMultipleFiles);
3987 m_findReplace.FindNext(bNext,
nullptr,
nullptr,
false);
3993 m_findReplace.FindSelectedText(bNext);
3999 if (!bDoMultipleFiles)
4001 m_findReplace.ShowFindDialog(
true, bDoMultipleFiles);
4025 if ( line >= 1 && line <= max )
4068 event.Enable(
false);
4076 const int id =
event.GetId();
4079 if (
id == idFileClose ||
id == idFileCloseAll ||
id == idFileSaveAs)
4080 event.Enable(ed && ed != sh);
4081 else if (
id == idFileSave)
4083 else if (
id == idFilePrint)
4085 else if (
id == idFileOpen)
4093 event.Enable(
false);
4098 if (
id == idFileReopenProject)
4100 else if (
id == idFileCloseProject ||
id == idFileSaveProjectAs ||
id == idFileSaveProjectTemplate)
4101 event.Enable(project !=
nullptr);
4102 else if (
id == idFileSaveProject)
4104 else if (
id == idFileOpenDefWorkspace ||
id == idFileSaveWorkspaceAs ||
id == idFileSaveAll)
4111 if (
id == idFileSaveWorkspace)
4112 event.Enable(workspace && workspace->
GetModified());
4113 else if (
id == idFileCloseWorkspace)
4114 event.Enable(workspace !=
nullptr);
4131 bool hasSel =
false;
4132 bool canUndo =
false;
4133 bool canRedo =
false;
4134 bool canPaste =
false;
4135 bool canCut =
false;
4136 bool canSelAll =
false;
4156 mbar->
Enable(idEditUndo, canUndo);
4157 mbar->
Enable(idEditRedo, canRedo);
4158 mbar->
Enable(idEditClearHistory, canUndo || canRedo);
4159 mbar->
Enable(idEditCut, canCut);
4160 mbar->
Enable(idEditCopy, hasSel);
4161 mbar->
Enable(idEditPaste, canPaste);
4162 mbar->
Enable(idEditSwapHeaderSource, ed);
4163 mbar->
Enable(idEditGotoMatchingBrace, ed);
4164 mbar->
Enable(idEditHighlightMode, ed);
4165 mbar->
Enable(idEditSelectAll, canSelAll);
4166 mbar->
Enable(idEditSelectNext, ed);
4167 mbar->
Enable(idEditSelectNextSkip, hasSel);
4168 mbar->
Enable(idEditBookmarks, ed);
4169 mbar->
Enable(idEditFolding, ed &&
4170 Manager::Get()->GetConfigManager(
_T(
"editor"))->ReadBool(
_T(
"/folding/show_folds"),
false));
4171 mbar->
Enable(idEditEOLMode, ed);
4172 mbar->
Enable(idEditEncoding, ed);
4173 mbar->
Enable(idEditSpecialCommands, ed);
4174 mbar->
Enable(idEditSpecialCommandsCase, ed && hasSel);
4175 mbar->
Enable(idEditCommentSelected, ed);
4176 mbar->
Enable(idEditUncommentSelected, ed);
4177 mbar->
Enable(idEditToggleCommentSelected, ed);
4178 mbar->
Enable(idEditStreamCommentSelected, ed);
4179 mbar->
Enable(idEditBoxCommentSelected, ed);
4180 mbar->
Enable(idEditShowCallTip, ed);
4181 mbar->
Enable(idEditCompleteCode, ed);
4194 mbar->
Check(idEditEOLCRLF,
true);
4197 mbar->
Check(idEditEOLCR,
true);
4200 mbar->
Check(idEditEOLLF,
true);
4203 (platform::windows ? mbar->
Check(idEditEOLCRLF,
true) : mbar->
Check(idEditEOLLF,
true));
4210 mbar->
Check(idEditEncodingDefault, defenc);
4224 mbar->
FindItem(idEditHighlightModeText, &hl);
4232 mbar->
Check(item,
true);
4239 m_pToolbar->EnableTool(idEditUndo, canUndo);
4240 m_pToolbar->EnableTool(idEditRedo, canRedo);
4241 m_pToolbar->EnableTool(idEditCut, canCut);
4242 m_pToolbar->EnableTool(idEditCopy, hasSel);
4243 m_pToolbar->EnableTool(idEditPaste, canPaste);
4259 bool manVis = m_LayoutManager.GetPane(m_pPrjManUI->GetNotebook()).IsShown();
4261 mbar->
Check(idViewManager, manVis);
4262 mbar->
Check(idViewLogManager, m_LayoutManager.GetPane(m_pInfoPane).IsShown());
4264 mbar->
Check(idViewStatusbar, GetStatusBar() && GetStatusBar()->IsShown());
4265 mbar->
Check(idViewScriptConsole, m_LayoutManager.GetPane(m_pScriptConsole).IsShown());
4266 mbar->
Check(idViewHideEditorTabs,
Manager::Get()->GetEditorManager()->GetNotebook()->GetTabCtrlHeight() == 0);
4267 mbar->
Check(idViewFullScreen, IsFullScreen());
4268 mbar->
Enable(idViewFocusEditor, ed);
4269 mbar->
Enable(idViewFocusManagement, manVis);
4270 mbar->
Enable(idViewFocusLogsAndOthers, m_pInfoPane->IsShown());
4273 wxMenu* viewToolbars =
nullptr;
4274 GetMenuBar()->
FindItem(idViewToolMain, &viewToolbars);
4277 SetChecksForViewToolbarsMenu(*viewToolbars);
4293 Manager::Get()->GetEditorManager()->GetActiveEditor() ) :
nullptr;
4295 bool enableGoto =
false;
4305 mbar->
Enable(idSearchFind, ed);
4306 mbar->
Enable(idSearchFindNext, ed);
4307 mbar->
Enable(idSearchFindPrevious, ed);
4308 mbar->
Enable(idSearchFindSelectedNext, ed);
4309 mbar->
Enable(idSearchFindSelectedPrevious, ed);
4310 mbar->
Enable(idSearchReplace, ed);
4311 mbar->
Enable(idSearchGotoLine, ed);
4312 mbar->
Enable(idSearchGotoNextChanged, enableGoto);
4313 mbar->
Enable(idSearchGotoPreviousChanged, enableGoto);
4329 #if wxCHECK_VERSION(3, 0, 0) 4334 DoUpdateStatusBar();
4335 #endif // defined(__wxMSW__) && wxCHECK_VERSION(3, 0, 0) 4343 struct ToolbarFitInfo
4349 bool operator<(
const ToolbarFitInfo &r)
const 4353 else if (row == r.row)
4354 return rect.
x < r.rect.x;
4360 static void CollectToolbars(std::set<ToolbarFitInfo> &result,
wxAuiManager &layoutManager)
4362 const wxAuiPaneInfoArray &panes = layoutManager.
GetAllPanes();
4363 for (
size_t ii = 0; ii < panes.GetCount(); ++ii)
4369 f.row = info.dock_row;
4371 f.window = info.window;
4377 struct ToolbarRowInfo
4380 ToolbarRowInfo(
int width_,
int position_) : width(width_), position(position_) {}
4382 int width, position;
4388 std::set<ToolbarFitInfo> sorted;
4389 CollectToolbars(sorted, layoutManager);
4393 int maxWidth = mainFrame->GetSize().x;
4397 std::vector<ToolbarRowInfo> rows;
4398 std::vector<wxWindow*> nonFitingToolbars;
4399 for (std::set<ToolbarFitInfo>::const_iterator it = sorted.begin(); it != sorted.end(); ++it)
4402 int row = pane.dock_row;
4403 while (static_cast<int>(rows.size()) <= row)
4404 rows.push_back(ToolbarRowInfo(0, 0));
4406 int maxX = rows[row].width + it->window->GetBestSize().x + gripperSize;
4407 if (maxX > maxWidth)
4408 nonFitingToolbars.push_back(it->window);
4411 rows[row].width = maxX;
4412 pane.
Position(rows[row].position++);
4417 int lastRow = rows.empty() ? 0 : (rows.size() - 1);
4418 int position = rows.back().position, maxX = rows.back().width;
4419 for (std::vector<wxWindow*>::iterator it = nonFitingToolbars.begin(); it != nonFitingToolbars.end(); ++it)
4421 maxX += (*it)->GetBestSize().x;
4422 maxX += gripperSize;
4423 if (maxX > maxWidth)
4427 maxX = (*it)->GetBestSize().x + gripperSize;
4437 std::set<ToolbarFitInfo> sorted;
4438 CollectToolbars(sorted, layoutManager);
4442 int maxWidth = mainFrame->GetSize().x;
4443 int lastRow = 0, position = 0, maxX = 0;
4446 for (std::set<ToolbarFitInfo>::const_iterator it = sorted.begin(); it != sorted.end(); ++it)
4448 maxX += it->window->GetBestSize().x;
4449 maxX += gripperSize;
4450 if (maxX > maxWidth)
4454 maxX = it->window->GetBestSize().x + gripperSize;
4464 FitToolbars(m_LayoutManager,
this);
4470 OptimizeToolbars(m_LayoutManager,
this);
4477 bool toolbar =
false;
4479 win = m_pPrjManUI->GetNotebook();
4489 win = m_debuggerToolbarHandler->GetToolbar();
4494 wxString pluginName = m_PluginIDsMap[
event.GetId()];
4500 win = m_PluginsTools[plugin];
4509 if (!event.IsChecked())
4510 m_LayoutManager.GetPane(win).BestSize(win->GetSize());
4512 m_LayoutManager.GetPane(win).Show(event.IsChecked());
4514 FitToolbars(m_LayoutManager,
this);
4525 const bool show = !cfg->
ReadBool(
_T(
"/main_frame/statusbar"),
true);
4526 cfg->
Write(
_T(
"/main_frame/statusbar"), show);
4528 DoUpdateStatusBar();
4530 if ( show ) SendSizeEvent();
4544 cbAuiNotebook* nb = m_pPrjManUI ? m_pPrjManUI->GetNotebook() :
nullptr;
4552 m_pInfoPane->FocusActiveTabCtrl();
4565 if (!
Manager::Get()->GetConfigManager(
_T(
"app"))->ReadBool(
_T(
"/environment/tabs_stacked_based_switching")))
4572 items.
AddItem(title, title, GetEditorDescription(static_cast<EditorBase*> (window)), i, nb->
GetPageBitmap(i)).SetWindow(window);
4584 for (body =
Manager::Get()->GetEditorManager()->GetNotebookStack(); body !=
NULL; body = body->
next)
4604 if (platform::cocoa)
4606 else if (platform::gtk)
4633 ShowHideStartPage(
false,toggle);
4642 if ( IsFullScreen() )
4647 wxSize containerSize = GetClientSize();
4648 wxSize buttonSize = m_pCloseFullScreenBtn->GetSize();
4651 m_pCloseFullScreenBtn->Move( containerSize.
GetWidth() - buttonSize.
GetWidth(),
4654 m_pCloseFullScreenBtn->Show(
true );
4655 m_pCloseFullScreenBtn->Raise();
4658 m_pCloseFullScreenBtn->Show(
false );
4663 PluginsUpdated(event.
GetPlugin(), Installed);
4670 PluginsUpdated(event.
GetPlugin(), Uninstalled);
4675 cbPlugin* plug =
event.GetPlugin();
4690 cbPlugin* plugin =
event.GetPlugin();
4697 if (m_PluginsTools[plugin])
4702 m_LayoutManager.DetachPane(m_PluginsTools[plugin]);
4703 m_PluginsTools[plugin]->Destroy();
4704 m_PluginsTools.erase(plugin);
4708 PluginsUpdated(plugin, Unloaded);
4713 bool tbarsmall = m_SmallToolBar;
4714 bool needRestart =
false;
4718 if (dlg.ShowModal() ==
wxID_OK)
4720 DoUpdateEditorStyle();
4721 DoUpdateLayoutColours();
4724 needRestart = m_SmallToolBar != tbarsmall;
4728 m_pPrjManUI->RebuildTree();
4729 ShowHideStartPage();
4803 RunStartupScripts();
4814 ShowHideStartPage(
true);
4827 DoUpdateStatusBar();
4833 if (cfgEditor->
ReadBool(
_T(
"/sync_editor_with_project_manager"),
false))
4837 m_pPrjManUI->ShowFileInTree(*pf);
4847 DoUpdateStatusBar();
4865 ShowHideStartPage();
4886 switch (m_LastCtrlAltTabWindow)
4889 m_LastCtrlAltTabWindow = 2;
4890 OnFocusEditor(dummy);
4893 m_LastCtrlAltTabWindow = 3;
4894 OnFocusLogsAndOthers(dummy);
4898 m_LastCtrlAltTabWindow = 1;
4899 OnFocusManagement(dummy);
4935 if (event.
row != -1)
4940 m_LayoutManager.AddPane(event.
pWindow, info);
4949 m_LayoutManager.DetachPane(event.
pWindow);
4956 m_LayoutManager.GetPane(event.
pWindow).Show();
4966 m_LayoutManager.GetPane(event.
pWindow).Hide();
4982 DoFixToolbarsLayout();
4988 event.layout = !m_LastLayoutName.IsEmpty() ? m_LastLayoutName :
gDefaultLayout;
4989 event.StopPropagation();
4994 LoadViewLayout(event.
layout,
true);
5003 m_pInfoPane->AddNonLogger(p, event.
title, event.
icon);
5006 p =
event.logger->CreateControl(m_pInfoPane);
5018 m_pInfoPane->DeleteNonLogger(event.
window);
5020 m_pInfoPane->DeleteLogger(event.
logger);
5026 m_pInfoPane->HideNonLogger(event.
window);
5028 m_pInfoPane->Hide(event.
logger);
5034 m_pInfoPane->ShowNonLogger(event.
window);
5036 m_pInfoPane->Show(event.
logger);
5042 int page_index = m_pInfoPane->GetCurrentPage(is_logger);
5044 event.logger =
nullptr;
5045 event.window =
nullptr;
5048 event.logger = m_pInfoPane->GetLogger(page_index);
5050 event.window = m_pInfoPane->GetWindow(page_index);
5055 if (!
Manager::Get()->GetConfigManager(
_T(
"message_manager"))->ReadBool(
_T(
"/auto_hide"),
false))
5058 m_LayoutManager.GetPane(m_pInfoPane).Show(
true);
5064 if (!
Manager::Get()->GetConfigManager(
_T(
"message_manager"))->ReadBool(
_T(
"/auto_hide"),
false) ||
5065 m_AutoHideLockCounter > 0)
5068 m_LayoutManager.GetPane(m_pInfoPane).Show(
false);
5074 if (!
Manager::Get()->GetConfigManager(
_T(
"message_manager"))->ReadBool(
_T(
"/auto_hide"),
false))
5076 ++m_AutoHideLockCounter;
5081 if (!
Manager::Get()->GetConfigManager(
_T(
"message_manager"))->ReadBool(
_T(
"/auto_hide"),
false) &&
5082 m_AutoHideLockCounter > 0)
5084 if (--m_AutoHideLockCounter == 0)
5086 m_LayoutManager.GetPane(m_pInfoPane).Show(
false);
5098 if (!colour_set)
return;
5101 GetMenuBar()->
FindItem(idEditHighlightModeText, &hl);
5108 for (
size_t ii = 0; ii < menuItems.GetCount(); ++ii)
5110 if (ii > 0 && (ii % 20) == 0)
5121 GetStatusBar()->GetFieldRect(1, rect);
5122 PopupMenu(&mm, GetStatusBar()->GetPosition() + rect.
GetPosition());
5127 m_StartupDone =
true;
5142 PopupToggleToolbarMenu();
5148 PopupToggleToolbarMenu();
5155 int idx = menuBar->
FindMenu(
_(
"&View"));
5159 idx = viewMenu->
FindItem(
_(
"Toolbars"));
5175 SetChecksForViewToolbarsMenu(menu);
5189 item->
Check(m_LayoutManager.GetPane(m_PluginsTools[plugin]).IsShown());
5193 menu.
Check(idViewToolMain, m_LayoutManager.GetPane(m_pToolbar).IsShown());
5194 menu.
Check(idViewToolDebugger, m_LayoutManager.GetPane(m_debuggerToolbarHandler->GetToolbar(
false)).IsShown());
bool wxShowTip(wxWindow *parent, wxTipProvider *tipProvider, bool showAtStartup=true)
ProjectFile * GetFileByFilename(const wxString &filename, bool isRelative=true, bool isUnixFilename=false)
Access a file of the project.
void OnEditorClosed(CodeBlocksEvent &event)
void IndicatorFillRange(int start, int lengthFill)
Turn a indicator on over a range.
bool CloseAll(bool dontsave=false)
Closes all opened editors.
bool Load(const wxString &filemask)
wxString AfterLast(wxUniChar ch) const
wxString F(const wxChar *msg,...)
sprintf-like function
void OnEditCommentSelected(wxCommandEvent &event)
void OnFileCloseWorkspace(wxCommandEvent &event)
void OnUnlockLogManager(CodeBlocksLogEvent &event)
bool DoCloseCurrentWorkspace()
static void Display(const wxString &title, const wxString &message, unsigned int delay=5000, unsigned int hysteresis=1)
int idEditEncodingUnicode
wxAuiPaneInfo & CloseButton(bool visible=true)
void OnEditLineTranspose(wxCommandEvent &event)
void OnEditStreamCommentSelected(wxCommandEvent &event)
wxFontEncoding GetEncoding() const
void OnEditMenuUpdateUI(wxUpdateUIEvent &event)
void PopupToggleToolbarMenu()
void OnSettingsEnvironment(wxCommandEvent &event)
void OnViewHideEditorTabs(wxCommandEvent &event)
wxAuiPaneInfo & Name(const wxString &n)
int idFileImportProjectMSVS
wxString GetLanguageName(HighlightLanguage lang)
void OnEditSelectNextSkip(wxCommandEvent &event)
void OnEditWordPartLeft(wxCommandEvent &event)
static wxString gDefaultLayoutData
void OnFileSaveAs(wxCommandEvent &event)
void OnEditUnfoldBlock(wxCommandEvent &event)
int idSearchFindSelectedNext
void LowerCase()
Transform the selection to lower case.
void SetSelectionVoid(int startPos, int endPos)
Select a range of text.
virtual bool CanPaste() const
Is there something to paste?
void OnEditZoomReset(wxCommandEvent &event)
void OnEditCut(wxCommandEvent &event)
int WordEndPosition(int pos, bool onlyWordCharacters)
Get position of end of word.
void SetMenuHandler(cbDebuggerMenuHandler *handler)
void WordPartLeft()
Move to the previous change in capitalisation.
wxAppDerivedClass & wxGetApp()
EVTIMPORT const wxEventType cbEVT_PROJECT_NEW
PluginManager * GetPluginManager() const
EVTIMPORT const wxEventType cbEVT_UNLOCK_LOG_MANAGER
#define EVT_CBAUIBOOK_LEFT_DCLICK(winid, fn)
void OnEditLineMove(wxCommandEvent &event)
wxWindow * GetWindow() const
void SerializeIn(const wxString &s)
static unsigned int GetCount()
int idFileImportProjectDevCpp
wxAuiPaneInfo & Row(int row)
int row
The row to dock it.
EVTIMPORT const wxEventType cbEVT_APP_START_SHUTDOWN
static void ProcessPendingEvents()
void OnSearchMenuUpdateUI(wxUpdateUIEvent &event)
EVTIMPORT const wxEventType cbEVT_HIDE_DOCK_WINDOW
bool AutoCompActive()
Is there an auto-completion list visible?
cbEditor * New(const wxString &newFileName=wxEmptyString)
bool SaveActiveProject()
Save the active project to disk.
bool OpenGeneric(const wxString &filename, bool addToHistory=true)
void OnSettingsPlugins(wxCommandEvent &event)
void OnGetActiveLogWindow(CodeBlocksLogEvent &event)
wxAuiPaneInfo & FloatingPosition(const wxPoint &pos)
wxString title
Dock's title.
void OnSettingsDebugger(wxCommandEvent &event)
virtual bool HasSelection() const
Is there a selection?
wxWindow * window
A non-logger window. Needed at least by cbEVT_REMOVE_LOG_WINDOW.
void OnFileOpen(wxCommandEvent &event)
void SetEOLMode(int eolMode)
Set the current end of line mode.
cbProject * IsOpen(const wxString &filename)
Check if a project is open based on the project's filename.
EVTIMPORT const wxEventType cbEVT_SWITCH_VIEW_LAYOUT
void OnEditUnfoldAll(wxCommandEvent &event)
void OnRequestShowDockWindow(CodeBlocksDockEvent &event)
ConfigManager * GetConfigManager(const wxString &name_space) const
UserVariableManager * GetUserVariableManager() const
bool CanRedo() const override
Is there something to redo?
virtual const wxString & GetTitle()
The editor's title.
int ReadInt(const wxString &name, int defaultVal=0)
static Manager * Get()
Use Manager::Get() to get a pointer to its instance Manager::Get() is guaranteed to never return an i...
wxAuiPaneInfo & BestSize(const wxSize &size)
void UpperCase()
Transform the selection to upper case.
void DoAddPluginStatusField(cbPlugin *plugin)
int idSearchGotoPreviousChanged
size_t rfind(const wxString &str, size_t nStart=npos) const
wxAuiPaneInfo & Caption(const wxString &c)
void OnEditWordPartRightExtend(wxCommandEvent &event)
virtual void SetColour(int id, const wxColour &colour)=0
static void SetAppShuttingDown(bool app_shutting_down)
bool SaveWorkspaceAs(const wxString &filename)
Save the open workspace under a different filename.
void OnEditLowerCase(wxCommandEvent &event)
int GetSelectionNAnchor(int selection) const
Return the anchor position of the nth selection.
void Paste()
Paste the contents of the clipboard into the document replacing the selection.
void OnFileReopenProject(wxCommandEvent &event)
wxMenuItem * AddPluginInMenus(wxMenu *menu, cbPlugin *plugin, wxObjectEventFunction callback, int pos=-1, bool checkable=false)
wxAuiPaneInfo & MinSize(const wxSize &size)
wxAuiPaneInfo & ToolbarPane()
void SetString(const wxString &str, const wxString &delims=wxDEFAULT_DELIMITERS, wxStringTokenizerMode mode=wxTOKEN_DEFAULT)
virtual bool GetModified() const
Is this workspace modified?
Information about the plugin.
static bool IsAppShuttingDown()
void OnEditLinePaste(wxCommandEvent &event)
bool LayoutMessagePaneDifferent(const wxString &layout1, const wxString &layout2, bool checkSelection=false)
wxString layout
Layout's name.
virtual void SelectAll()
Select everything in the editor.
EVTIMPORT const wxEventType cbEVT_PLUGIN_ATTACHED
void OnEditFoldAll(wxCommandEvent &event)
EVTIMPORT const wxEventType cbEVT_HIDE_LOG_WINDOW
DLLIMPORT wxBitmap cbLoadBitmap(const wxString &filename, wxBitmapType bitmapType=wxBITMAP_TYPE_PNG)
This function loads a bitmap from disk.
void OnHelpPluginMenu(wxCommandEvent &event)
bool wxFileExists(const wxString &filename)
void LogWarning(const wxString &msg, int i=app_log)
void GotoLine(int line, bool centerOnScreen=true) override
Move the caret at the specified line.
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)
wxString Strip(stripType s=trailing) const
wxWindow * pWindow
The window to dock.
void OnFileSaveProjectTemplate(wxCommandEvent &event)
int GetIndexForFocus() const
int idEditInsertNewLineAbove
int GetColumn(int pos) const
Retrieve the column number of a position, taking tab width into account.
virtual bool IsReadOnly() const
Is the editor read-only?
const DLLIMPORT wxString DEVCPP_EXT
Scripts folder in base dir.
void NotifyPluginStatus()
Let CCManager know that a change (e.g.
void OnViewLayout(wxCommandEvent &event)
virtual void Redo()
Redo changes.
void OnFileOpenDefWorkspace(wxCommandEvent &event)
void OnFileSaveProjectAs(wxCommandEvent &event)
int idEditSpecialCommandsOther
#define wxSCI_FIND_WHOLEWORD
int idFileImportProjectMSVSWksp
void ShowTips(bool forceShow=false)
void DoFixToolbarsLayout()
void OnGlobalUserVars(wxCommandEvent &event)
EVTIMPORT const wxEventType cbEVT_ADD_DOCK_WINDOW
void ParaDownExtend()
Extend selection down one paragraph (delimited by empty lines).
void OnEditEncoding(wxCommandEvent &event)
void OnFileSaveWorkspace(wxCommandEvent &event)
bool ReadBool(const wxString &name, bool defaultVal=false)
void InitializeRecentFilesHistory()
virtual wxString GetFilename() const
Get the workspace file's name.
void wxBeginBusyCursor(const wxCursor *cursor=wxHOURGLASS_CURSOR)
wxPoint floatingPos
The desired floating position.
void UnfoldAll()
Unfold all editor folds (shows blocks of code).
void OnEditParaDown(wxCommandEvent &event)
void TerminateRecentFilesHistory()
virtual void SetFilterIndex(int filterIndex)
const wxSwitcherItem & GetItem(int i) const
void OnFocusEditor(wxCommandEvent &event)
void OnEditBookmarksNext(wxCommandEvent &event)
int idEditSpecialCommandsMovement
size_t GetPageCount() const
int idEditWordPartRightExtend
virtual bool IsDefault() const
Is this workspace the Code::Blocks default?
wxColour ReadColour(const wxString &name, const wxColour &defaultVal= *wxBLACK)
int idEditBookmarksClearAll
virtual void Paste()
Paste selected text/object from clipboard.
void OnHelpAbout(wxCommandEvent &event)
Scripts folder in user's dir.
a logger simply does nothing
EVTIMPORT const wxEventType cbEVT_PLUGIN_RELEASED
void OnStartHereLink(wxCommandEvent &event)
int idEditSpecialCommands
EVTIMPORT const wxEventType cbEVT_PROJECT_ACTIVATE
DLLIMPORT bool GetFilterIndexFromName(const wxString &FiltersList, const wxString &FilterName, int &Index)
Get the index of the filter 'FilterName' in the FiltersList.
void ParaUpExtend()
Extend selection up one paragraph (delimited by empty lines).
Event used to request from the main app to add a log.
const PluginElementsArray & GetPlugins() const
int ReplaceTarget(const wxString &text)
Replace the target text with the argument text.
Event used to request from the main app to add a window to the docking system.
virtual void Activate()
Activate this editor.
void AddPluginInPluginsMenu(cbPlugin *plugin)
bool GetOvertype() const
Returns true if overtype mode is active otherwise false is returned.
wxString GetLine(int line) const
Retrieve the contents of a line.
EVTIMPORT const wxEventType cbEVT_UPDATE_VIEW_LAYOUT
int idEditBookmarksToggle
static TemplateManager * Get()
wxRect GetClientArea() const
int idEditInsertNewLineBelow
void SetInterfaceFactory(cbDebugInterfaceFactory *factory)
EVTIMPORT const wxEventType cbEVT_SETTINGS_CHANGED
int GetTabCtrlHeight() const
FileType
Known file types.
void OnToggleStatusBar(wxCommandEvent &event)
cbPlugin * GetPlugin() const
int idFileImportProjectMSVCWksp
virtual bool CanRedo() const
Is there something to redo?
int idViewFocusManagement
wxSize minimumSize
The minimum allowed size.
wxString BeforeLast(wxUniChar ch, wxString *rest=NULL) const
int ExecutePlugin(const wxString &pluginName)
void OnFileImportProjectDevCpp(wxCommandEvent &event)
int GetSelectionStart() const
Returns the position at the start of the selection.
static void BlockYields(bool block)
Blocks/unblocks Manager::Yield(). Be careful when using it. Actually, do not use it ;) ...
void OnFilePrev(wxCommandEvent &event)
void OnToolBarRightClick(wxCommandEvent &event)
wxString ShowOpenFileDialog(const wxString &caption, const wxString &filter)
void LineTranspose()
Switch the current line with the previous.
void DoUpdateLayoutColours()
void OnSearchFind(wxCommandEvent &event)
void OnPluginsExecuteMenu(wxCommandEvent &event)
void OnProjectClosed(CodeBlocksEvent &event)
void OnEditParaUp(wxCommandEvent &event)
static wxString gMinimalLayoutData
void LineDelete()
Delete the line containing the caret.
const DLLIMPORT wxString MSVC6_EXT
void OnFileOpenRecentClearHistory(wxCommandEvent &event)
int ScanForPlugins(const wxString &path)
DLLIMPORT FileType FileTypeOf(const wxString &filename)
void DoSelectLayout(const wxString &name)
void OnEditShowCallTip(wxCommandEvent &event)
void OnEditCopy(wxCommandEvent &event)
wxSwitcherItem & AddGroup(const wxString &title, const wxString &name, int id=0, const wxBitmap &bitmap=wxNullBitmap)
void OnLayoutQuery(CodeBlocksLayoutEvent &event)
#define wxICON_INFORMATION
int idEditEncodingDefault
void LineEndDisplay()
Move caret to last position on display line.
void OnEditorActivated(CodeBlocksEvent &event)
int idEditCommentSelected
void OnToggleStartPage(wxCommandEvent &event)
bool ToULong(unsigned long *val, int base=10) const
virtual PluginType GetType() const
The plugin must return its type on request.
int idEditStreamCommentSelected
ToolbarInfo DoAddPluginToolbar(cbPlugin *plugin)
void LineDuplicate()
Duplicate the current line.
void SaveViewLayout(const wxString &name, const wxString &layout, const wxString &layoutMP, bool select=false)
void OnFilePrint(wxCommandEvent &event)
EditorBase * GetEditor() const
void ShowHideScriptConsole()
Base class for mime plugins.
void OnSwitchToLogWindow(CodeBlocksLogEvent &event)
void ZoomOut()
Make the displayed text smaller by decreasing the sizes by 1 point.
virtual void SetMetric(int id, int new_val)=0
wxMenuBar * LoadMenuBar(wxWindow *parent, const wxString &name)
int idEditWordPartLeftExtend
EVTIMPORT const wxEventType cbEVT_SHOW_CALL_TIP
void OnHighlightMenu(wxCommandEvent &event)
size_t GetCurrentTip() const
wxPoint GetPosition() const
void OnSearchFindNext(wxCommandEvent &event)
Represents a file in a Code::Blocks project.
ProjectBuildTarget * GetCurrentlyCompilingTarget()
Get a pointer to the currently compiling target.
DockSide dockSide
The side to dock it.
bool LayoutDifferent(const wxString &layout1, const wxString &layout2, const wxString &delimiter=_("|"))
wxSize floatingSize
The desired floating size.
size_t find(const wxString &str, size_t nStart=0) const
A generic Code::Blocks event.
void RecreateOpenEditorStyles()
static int GetMetric(wxSystemMetric index, wxWindow *win=NULL)
void DeleteRange(int start, int lengthDelete)
Delete a range of text in the document.
void OnFileSaveWorkspaceAs(wxCommandEvent &event)
void OnFileCloseAll(wxCommandEvent &event)
int CmpNoCase(const wxString &s) const
void OnToggleFullScreen(wxCommandEvent &event)
static const wxString gDefaultLayout
int GetLineEndPosition(int line) const
Get the position after the last visible characters on a line.
int idEditToggleFoldBlock
static wxString LocateDataFile(const wxString &filename, int search_dirs=sdAllKnown)
Locate a file in an installation- and platform-independent way.
wxWindow * GetAppWindow() const
virtual wxWindow * CreateControl(cb_optional wxWindow *parent)
const PluginInfo * GetPluginInfo(const wxString &pluginName)
int idEditBoxCommentSelected
cbMimePlugin * GetMIMEHandlerForFile(const wxString &filename)
static void changeButtonLabel(wxButton &button, const wxString &text)
Change the label of a button only if it has really changed.
int idSearchGotoNextChanged
DLLIMPORT bool GetFilterNameFromIndex(const wxString &FiltersList, int Index, wxString &FilterName)
Get the Filter name for the Index-th filter in the FiltersList.
int idSearchFindSelectedPrevious
virtual void SetTabCtrlHeight(int height)
virtual void Copy()
Copy selected text/object to clipboard.
int idEditToggleCommentSelected
int WordStartPosition(int pos, bool onlyWordCharacters)
Get position of start of word.
void OnMouseRightUp(wxMouseEvent &event)
EditorManager * GetEditorManager() const
void SetEncoding(wxFontEncoding encoding)
template produces custom output (entirely up to the wizard used)
wxAuiDockArt * GetArtProvider() const
void LogError(const wxString &msg, int i=app_log)
EVTIMPORT const wxEventType cbEVT_REMOVE_DOCK_WINDOW
int idFileSaveWorkspaceAs
void OnEditClearHistory(wxCommandEvent &event)
void OnSearchGotoLine(wxCommandEvent &event)
void GotoNextChanged() override
Goto next changed line.
void OnShiftTab(wxCommandEvent &event)
void OnEditParaDownExtend(wxCommandEvent &event)
void SetPosition(const wxPoint &pos)
void OnEditUncommentSelected(wxCommandEvent &event)
void OnEditWordPartLeftExtend(wxCommandEvent &event)
void OnEditSwapHeaderSource(wxCommandEvent &event)
DLLIMPORT bool cbHasRunningCompilers(const PluginManager *manager)
void OnEraseBackground(wxEraseEvent &event)
void OnEditorModified(CodeBlocksEvent &event)
static bool CanShutdown()
Can the app shutdown? (actually: is ProjectManager busy at the moment?)
void OnEditSelectNext(wxCommandEvent &event)
void OnFileSaveAll(wxCommandEvent &event)
ProjectManager * GetProjectManager() const
Functions returning pointers to the respective sub-manager instances.
void OnSearchGotoPrevChanged(wxCommandEvent &event)
PluginManager manages plugins.
void FocusActiveTabCtrl()
Set Focus on the tabCtrl belonging to the active tab.
bool CloseActiveProject(bool dontsave=false)
Close the active project.
bool LoadScript(const wxString &filename)
Loads a script.
const DLLIMPORT wxString MSVC6_WORKSPACE_EXT
void Write(const wxString &name, const wxString &value, bool ignoreEmpty=false)
DebuggerManager * GetDebuggerManager() const
virtual const wxString & GetFilename() const
Get the editor's filename (if applicable).
void SetLanguage(HighlightLanguage lang, bool colourise)
Sets the language for this editor.
void SetZoom(int zoomInPoints)
Set the zoom level.
void OnFileSave(wxCommandEvent &event)
EVTIMPORT const wxEventType cbEVT_EDITOR_CLOSE
void SetAdditionalSelectionTyping(bool additionalSelectionTyping)
Set whether typing can be performed into multiple selections.
void InitToolbar(wxToolBar *tb)
void OnApplicationClose(wxCloseEvent &event)
wxBitmap * icon
The logger's icon. Valid only for cbEVT_ADD_LOG_WINDOW.
template outputs a new file (or files)
Represents a Code::Blocks project.
int GetSelectionNCaret(int selection) const
Return the caret position of the nth selection.
virtual void CreateStatusField(cbStatusBar *statusBar)
This method is called by Code::Blocks and is used by the plugin to add a field on Code::Blocks's stat...
EVTIMPORT const wxEventType cbEVT_DOCK_WINDOW_VISIBILITY
int GetEOLMode() const
Retrieve the current end of line mode - one of wxSCI_EOL_CRLF, wxSCI_EOL_CR, or wxSCI_EOL_LF.
bool wxSetWorkingDirectory(const wxString &dir)
void OnFileSaveProject(wxCommandEvent &event)
virtual const wxString & GetFilename() const
bool SaveActiveProjectAs()
Save the active project to disk, asking for a filename.
int GetCurrentLine()
Manually declared methods.
EditorBase * GetActiveEditor()
size_t find_first_of(const char *sz, size_t nStart=0) const
#define wxSCI_FIND_MATCHCASE
void OnHideLogManager(CodeBlocksLogEvent &event)
EVTIMPORT const wxEventType cbEVT_ADD_LOG_WINDOW
cbStyledTextCtrl * GetControl() const
Returns a pointer to the underlying cbStyledTextCtrl object (which itself is the wxWindows implementa...
void OnEditSelectAll(wxCommandEvent &event)
static bool CanShutdown()
void OnViewLayoutDelete(wxCommandEvent &event)
EVTIMPORT const wxEventType cbEVT_PLUGIN_LOADING_COMPLETE
int idEditEncodingUnicode16BE
cbProject * LoadProject(const wxString &filename, bool activateIt=true)
Load a project from disk.
EVTIMPORT const wxEventType cbEVT_REMOVE_LOG_WINDOW
wxArrayString EnumerateSubPaths(const wxString &path)
void OnSearchReplace(wxCommandEvent &event)
size_t SetSelection(size_t new_page)
void OnEditToggleAllFolds(wxCommandEvent &event)
virtual const wxString & GetTitle() const
Read the target's title.
bool CloseActive(bool dontsave=false)
cbFileDropTarget(MainFrame *frame)
void DoAddPlugin(cbPlugin *plugin)
cbProject * New(TemplateOutputType initial=totProject, wxString *pFilename=nullptr)
void OnFileImportProjectMSVS(wxCommandEvent &event)
PrintScope GetPrintScope() const
int idEditSpecialCommandsLine
void OnPluginUninstalled(CodeBlocksEvent &event)
int idEditSpecialCommandsZoom
int GetMainSelection() const
Which selection is the main selection.
static wxString gDefaultMessagePaneLayoutData
wxFrame * GetAppFrame() const
void OnViewToolbarsFit(wxCommandEvent &event)
void OnSearchFindNextSelected(wxCommandEvent &event)
void OnEditUndo(wxCommandEvent &event)
CCManager * GetCCManager() const
const wxSize wxDefaultSize
const DLLIMPORT wxString MSVC7_WORKSPACE_EXT
wxSwitcherItem & AddItem(const wxString &title, const wxString &name, int id=0, const wxBitmap &bitmap=wxNullBitmap)
cbEditor * GetBuiltinActiveEditor()
const wxPoint wxDefaultPosition
EditorColourSet * GetColourSet() const
Get the colour set in use.
void SetChangeCollection(bool collectChange)
Choose between collecting actions into the changes history and discarding them.
wxAuiPaneInfo & Layer(int layer)
void AutoCompCancel()
Remove the auto-completion list from the screen.
bool IsSameAs(const wxString &s, bool caseSensitive=true) const
virtual wxColour GetColour(int id)=0
void SetChecksForViewToolbarsMenu(wxMenu &menu)
wxStatusBar * OnCreateStatusBar(int number, long style, wxWindowID id, const wxString &name) override
bool CanUndo() const override
Is there something to undo?
static bool IsBatchBuild()
void LineDown()
Move caret down one line.
DECLARE_INSTANCE_TYPE(MainFrame)
void Print(PrintScope ps, PrintColourMode pcm, bool line_numbers)
cbPlugin * FindPluginByName(const wxString &pluginName)
EVTIMPORT const wxEventType cbEVT_HIDE_LOG_MANAGER
int FindText(int minPos, int maxPos, const wxString &text, int flags=0, int *findEnd=NULL)
Find some text in the document.
Base class that all "editors" should inherit from.
LogManager * GetLogManager() const
DLLIMPORT bool IsWindowReallyShown(wxWindow *win)
Finds out if a window is really shown.
int GetCurrentPos() const
Returns the position of the caret.
EVTIMPORT const wxEventType cbEVT_SWITCH_TO_LOG_WINDOW
cbProject * GetActiveProject()
Retrieve the active project.
wxString Read(const wxString &key, const wxString &defaultVal=wxEmptyString)
EVTIMPORT const wxEventType cbEVT_EDITOR_UPDATE_UI
int GetLength() const
Returns the number of bytes in the document.
void IndicatorClearRange(int start, int lengthClear)
Turn a indicator off over a range.
virtual wxString GetBasePath() const
Read the target's base path, e.g. if GetFilename() returns "/usr/local/bin/xxx", base path will retur...
int idEditHighlightModeText
void OnNotebookDoubleClick(CodeBlocksEvent &event)
bool OnDropFiles(wxCoord x, wxCoord y, const wxArrayString &filenames) override
void OnToggleBar(wxCommandEvent &event)
void WordPartRightExtend()
Move to the next change in capitalisation extending selection to new caret position.
void DisplayErrors(SquirrelError *exception=nullptr, bool clearErrors=true)
Display error dialog.
void OnPluginUnloaded(CodeBlocksEvent &event)
EVTIMPORT const wxEventType cbEVT_SWITCHED_VIEW_LAYOUT
DLLIMPORT size_t GetIndexForFilterAll()
Get the filter index for the special "All files" filter.
wxArrayString GetAllHighlightLanguages()
void Set(int flags, int keyCode, int cmd, wxMenuItem *item=NULL)
const wxStringCharType * wx_str() const
void OnFileImportProjectMSVSWksp(wxCommandEvent &event)
void OnEditParaUpExtend(wxCommandEvent &event)
wxAuiPaneInfo & Position(int pos)
void GotoMatchingBrace()
Jumps to the matching brace (if there is one).
static wxFontEncoding GetSystemEncoding()
EVTIMPORT const wxEventType cbEVT_GET_ACTIVE_LOG_WINDOW
void OnFileMenuUpdateUI(wxUpdateUIEvent &event)
int idFileImportProjectMSVC
virtual bool IsBuiltinEditor() const
Is this a built-in editor?
void DoUpdateEditorStyle()
A custom status bar which can contain controls, icons...
void OnSearchGotoNextChanged(wxCommandEvent &event)
int idEditBookmarksPrevious
void OnFileImportProjectMSVCWksp(wxCommandEvent &event)
wxString Right(size_t count) const
void OnCtrlAltTab(wxCommandEvent &event)
virtual int GetFilterIndex() const
virtual wxString GetPath() const
EVTIMPORT const wxEventType cbEVT_COMPLETE_CODE
const wxString g_StartHereTitle
void OnAddLogWindow(CodeBlocksLogEvent &event)
void SetMultiPaste(int multiPaste)
Change the effect of pasting when there are multiple selections.
void OnEditFoldBlock(wxCommandEvent &event)
void SetBottom(int bottom)
void ParaUp()
Move caret up one paragraph (delimited by empty lines).
void LineCopy()
Copy the line containing the caret.
void SaveUserTemplate(cbProject *prj)
void NotifyPlugins(CodeBlocksEvent &event)
virtual void Undo()
Undo changes.
void OnFocusManagement(wxCommandEvent &event)
bool SaveAllFiles()
Save all project files.
void OnEditLineCut(wxCommandEvent &event)
void RegisterScriptFunctions()
virtual bool GetFieldRect(int i, wxRect &rect) const
void OnHelpTips(wxCommandEvent &event)
int idFileOpenRecentFileClearHistory
cbEditor * Open(const wxString &filename, int pos=0, ProjectFile *data=nullptr)
void OnEditGotoMatchingBrace(wxCommandEvent &event)
bool stretch
If true, the dock will stretch to fill the dockSide.
const wxString & _(const wxString &string)
wxAuiPaneInfo & Show(bool show=true)
void OnEditBookmarksToggle(wxCommandEvent &event)
int idSettingsGlobalUserVars
wxString GetPageText(size_t page) const
int GetSelectionEnd() const
Returns the position at the end of the selection.
void AddPluginInHelpPluginsMenu(cbPlugin *plugin)
EditorBase * GetEditor(int index)
cbEditor * GetBuiltinEditor(EditorBase *eb)
wxWindow * GetPage(size_t page_idx) const
void HomeDisplay()
Move caret to first position on display line.
void ShowErrorMessage(bool safe=true)
Display exception error message.
void OnEditInsertNewLineBelow(wxCommandEvent &event)
void UpdateEnvSettings()
Called after env settings have changed, so the changes can be applied.
void MakeNearbyLinesVisible(int line)
Scroll minimum amount such that 2 lines above and below line are shown.
TemplateOutputType
Template output types.
static void Yield()
Whenever you need to call wxYield(), call Manager::Yield(). It's safer.
void OnEditHighlightMode(wxCommandEvent &event)
virtual int GetMetric(int id)=0
virtual bool GetModified() const
Is it modified?
wxArray< int > wxArrayInt
void LineEnd()
Move caret to last position on line.
void OnEditLineCopy(wxCommandEvent &event)
wxString title
The logger's title. Valid only for cbEVT_ADD_LOG_WINDOW.
wxString GetEditorDescription(EditorBase *eb)
void OnEditorUpdateUI(CodeBlocksEvent &event)
int idSettingsEnvironment
int PositionFromLine(int line) const
Retrieve the position at the start of a line.
void UnfoldBlockFromLine(int line=-1)
Unfolds the block containing line.
static wxString GetDataFolder(bool global=true)
void CheckForExternallyModifiedFiles()
Check if one of the open files has been modified outside the IDE.
void SetArtProvider(wxAuiTabArt *art)
wxBitmap GetPageBitmap(size_t page) const
cbWorkspace * GetWorkspace()
Get the current workspace filename.
static int GetFromWindow(const wxWindow *win)
DLLIMPORT wxString GetFilterString(const wxString &ext=wxEmptyString)
Generates and returns the filter string for use in file dialogs.
wxAcceleratorTable wxNullAcceleratorTable
Logger * logger
The logger.
DLLIMPORT void DeInitPrinting()
int idViewFocusLogsAndOthers
bool ToLong(long *val, int base=10) const
bool HasMoreTokens() const
void OnDockWindowVisibility(CodeBlocksDockEvent &event)
ColourManager * GetColourManager() const
void OnEditLineDelete(wxCommandEvent &event)
int GetPageIndex(wxWindow *page_wnd) const
wxString GetEncodingName() const
bool DoCheckCurrentLayoutForChanges(bool canCancel=true)
EditorColourSet * GetColourSet()
virtual void SetFieldsCount(int number=1, const int *widths=NULL)
void OnEditLineDuplicate(wxCommandEvent &event)
wxString & Append(const char *psz)
bool GetReadOnly() const
In read-only mode?
EVTIMPORT const wxEventType cbEVT_QUERY_VIEW_LAYOUT
EVTIMPORT const wxEventType cbEVT_PLUGIN_UNINSTALLED
void SetProject(cbProject *project, bool refresh=true)
Set the active project.
void AddToolbarItem(int id, const wxString &title, const wxString &shortHelp, const wxString &longHelp, const wxString &image)
EVTIMPORT const wxEventType cbEVT_EDITOR_ACTIVATED
int idEditSpecialCommandsCase
void InsertText(int pos, const wxString &text)
Insert string at a position.
void DoOnFileOpen(bool bProject=false)
bool hideable
If true, the dock will be allowed to be closed by the user.
void DeleteSubPath(const wxString &strPath)
int GetCharAt(int pos) const
Returns the character byte at the position.
DLLIMPORT void PlaceWindow(wxTopLevelWindow *w, cbPlaceDialogMode mode=pdlBest, bool enforce=false)
void OnSize(wxSizeEvent &event)
void FoldAll()
Fold all editor folds (hides blocks of code).
int idEditUncommentSelected
void ZoomIn()
Magnify the displayed text by increasing the sizes by 1 point.
void EndUndoAction()
End a sequence of actions that is undone and redone as a unit.
void OnEditZoomIn(wxCommandEvent &event)
void OnProjectOpened(CodeBlocksEvent &event)
EVTIMPORT const wxEventType cbEVT_LOCK_LOG_MANAGER
void AskToRemoveFileFromHistory(size_t id, bool cannot_open=true)
The entry point singleton for working with projects.
void OnLockLogManager(CodeBlocksLogEvent &event)
void FoldBlockFromLine(int line=-1)
Folds the block containing line.
void NewLine()
Insert a new line, may use a CRLF, CR or LF depending on EOL mode.
virtual wxString GetDirectory() const
cbAuiNotebook * GetNotebook()
DLLIMPORT int ID_NBEditorManager
DLLIMPORT wxString GetEOLStr(int eolMode=-1)
Reads settings if eolMode is -1 Expected input (defined in sdk/wxscintilla/include/wx/wxscintilla.h) is: wxSCI_EOL_CRLF=0, wxSCI_EOL_CR=1, or wxSCI_EOL_LF=2.
void OnRemoveLogWindow(CodeBlocksLogEvent &event)
bool IsRelative(wxPathFormat format=wxPATH_NATIVE) const
int idFileSaveProjectTemplate
int idEditEncodingUnicode16LE
EVTIMPORT const wxEventType cbEVT_SHOW_DOCK_WINDOW
void OnEditEOLMode(wxCommandEvent &event)
void OnSettingsCompiler(wxCommandEvent &event)
void Log(const wxString &msg, int i=app_log, Logger::level lv=Logger::info)
int LineLength(int line) const
How many characters are on a line, including end of line characters?
void GotoPos(int caret)
Set caret to a position and ensure it is visible.
void OnEditInsertNewLine(wxCommandEvent &event)
static const wxString gMinimalLayout
A notebook class This class is derived from wxAuiNotebook, to enhance its abilities.
virtual void GetPaths(wxArrayString &paths) const
void PluginsUpdated(cbPlugin *plugin, int status)
void OnEditBookmarksClearAll(wxCommandEvent &event)
#define wxSCI_INVALID_POSITION
int idEditEncodingUnicode32BE
void LineCut()
Cut the line containing the caret.
void OnViewScriptConsole(wxCommandEvent &event)
void OnFileNewWhat(wxCommandEvent &event)
int idEditEncodingUnicode32LE
void DebugLog(const wxString &msg, Logger::level lv=Logger::info)
void OnFileCloseProject(wxCommandEvent &event)
bool CloseWorkspace()
Close the workspace.
template adds a new target in a project
void OnViewMenuUpdateUI(wxUpdateUIEvent &event)
bool ProcessEvent(CodeBlocksEvent &event)
bool EndsWith(const wxString &suffix, wxString *rest=NULL) const
bool operator<(const wxString &s1, const wxString &s2)
static void InsertNewLine(bool below)
void WordPartLeftExtend()
Move to the previous change in capitalisation extending selection to new caret position.
const wxString AppVersion
bool GetModified() const override
void OnLayoutSwitch(CodeBlocksLayoutEvent &event)
Logger * GetLogger() const
void SetExt(const wxString &ext)
void RemoveField(cbPlugin *plugin)
Remove a field from the status bar.
void OnPluginLoaded(CodeBlocksEvent &event)
virtual void ClearHistory()
Clear Undo- (and Changebar-) history.
void OnFileOpenRecentProjectClearHistory(wxCommandEvent &event)
wxAuiPaneInfo & FloatingSize(const wxSize &size)
wxAuiPaneInfo & GetPane(wxWindow *window)
static wxString GetPluginsFolder(bool global=true)
EVTIMPORT const wxEventType cbEVT_PROJECT_OPEN
void RegisterEventSink(wxEventType eventType, IEventFunctorBase< CodeBlocksEvent > *functor)
void OnFileReopen(wxCommandEvent &event)
void OnEditInsertNewLineAbove(wxCommandEvent &event)
void OnEditWordPartRight(wxCommandEvent &event)
size_t Add(const wxString &str, size_t copies=1)
void OnPageChanged(wxNotebookEvent &event)
void OnProjectActivated(CodeBlocksEvent &event)
int GetLineCount() const
Returns the number of lines in the document. There is always at least one.
cbProject * GetParentProject()
void SetTargetStart(int start)
Sets the position that starts the target which is used for updating the document without affecting th...
template is a user-saved project template
static const wxLanguageInfo * GetLanguageInfo(int lang)
bool StartsWith(const wxString &prefix, wxString *rest=NULL) const
void SetModifierKey(int modifierKey)
int idFileOpenRecentProjectClearHistory
bool DoOpenProject(const wxString &filename, bool addToHistory=true)
void OnFocusLogsAndOthers(wxCommandEvent &event)
int LineFromPosition(int pos) const
Retrieve the line containing a position.
void OnSettingsScripting(wxCommandEvent &event)
bool Normalize(int flags=wxPATH_NORM_ALL, const wxString &cwd=wxEmptyString, wxPathFormat format=wxPATH_NATIVE)
void Sort(bool reverseOrder=false)
void OnFileNew(wxCommandEvent &event)
void OnHideLogWindow(CodeBlocksLogEvent &event)
void WordPartRight()
Move to the change next in capitalisation.
void OnFileClose(wxCommandEvent &event)
EVTIMPORT const wxEventType cbEVT_PROJECT_CLOSE
bool shown
If true, initially shown.
void DoUnIndent()
UnIndents current line/block.
template outputs a new project
int Find(wxUniChar ch, bool fromEnd=false) const
EVTIMPORT const wxEventType cbEVT_EDITOR_OPEN
bool Open(const wxString &filename, bool addToHistory=true)
void OnEditBookmarksPrevious(wxCommandEvent &event)
void OnViewToolbarsOptimize(wxCommandEvent &event)
static wxXmlResource * Get()
void OnViewLayoutSave(wxCommandEvent &event)
void SetTargetEnd(int end)
Sets the position that ends the target which is used for updating the document without affecting the ...
void SetSelectionNCaret(int selection, int caret)
Set the caret position of the nth selection.
PrintColourMode GetPrintColourMode() const
bool IsAttached() const
See whether this plugin is attached or not.
ProjectsArray * GetProjects()
Retrieve an array of all the opened projects.
void ToggleFoldBlockFromLine(int line=-1)
Toggles folding of the block containing line.
bool SaveAllProjects()
Saves all projects to disk.
bool OnDropFiles(wxCoord x, wxCoord y, const wxArrayString &filenames)
void OnEditorSaved(CodeBlocksEvent &event)
bool LoadWorkspace(const wxString &filename=DEFAULT_WORKSPACE)
Load a workspace.
bool GetPrintLineNumbers() const
void OnEditorOpened(CodeBlocksEvent &event)
int idSearchReplaceInFiles
DLLIMPORT void AddDefaultFileFilters()
Adds file filters for various supported projects and workspaces.
int idPluginsManagePlugins
wxTipProvider * wxCreateFileTipProvider(const wxString &filename, size_t currentTip)
int column
The column to dock it.
int AddSelection(int caret, int anchor)
Add a selection.
void OnEditGotoLineEnd(wxCommandEvent &event)
void OnLayoutUpdate(CodeBlocksLayoutEvent &event)
wxString GetHistoryFile(size_t id) const
virtual void Cut()
Cut selected text/object to clipboard.
ScriptingManager * GetScriptingManager() const
void OnEditRedo(wxCommandEvent &event)
void OnPluginInstalled(CodeBlocksEvent &event)
void OnEditToggleFoldBlock(wxCommandEvent &event)
void OnEditCompleteCode(wxCommandEvent &event)
virtual bool CanSelectAll() const
Can the editor select everything?
void OnEditToggleCommentSelected(wxCommandEvent &event)
HighlightLanguage GetLanguage() const
virtual void SetSelection(long from, long to)
void OnShowLogManager(CodeBlocksLogEvent &event)
void OnRequestUndockWindow(CodeBlocksDockEvent &event)
void BeginUndoAction()
Start a sequence of actions that is undone and redone as a unit.
int Printf(const wxString &pszFormat,...)
void OnSettingsEditor(wxCommandEvent &event)
wxSize desiredSize
The desired size.
void LoadViewLayout(const wxString &name, bool isTemp=false)
void OnFileNext(wxCommandEvent &event)
static wxString gMinimalMessagePaneLayoutData
void SetSelection(int sel)
virtual bool CanUndo() const
Is there something to undo?
bool Save()
Save the project.
EVTIMPORT const wxEventType cbEVT_EDITOR_SAVE
wxAuiPaneInfoArray & GetAllPanes()
int idFileOpenDefWorkspace
wxString GetFullPath(wxPathFormat format=wxPATH_NATIVE) const
virtual int OpenFile(const wxString &filename)=0
Open the file.
virtual void SetMinHeight(int height)
wxArrayString EnumerateKeys(const wxString &path)
void OnEditPaste(wxCommandEvent &event)
int AddFileToProject(const wxString &filename, cbProject *project=nullptr, int target=-1)
Add a file to a project.
size_t SetLog(Logger *l, int index=no_index)
EVTIMPORT const wxEventType cbEVT_PLUGIN_INSTALLED
Code::Blocks error handling unit.
void SetSelectionNAnchor(int selection, int anchor)
Set the anchor position of the nth selection.
void OnEditUpperCase(wxCommandEvent &event)
void OnEditZoomOut(wxCommandEvent &event)
int idEditSwapHeaderSource
static wxString Format(const wxString &format,...)
void OnEditBoxCommentSelected(wxCommandEvent &event)
bool GetModified() const override
Returns true if editor is modified, false otherwise.
void ClearSelections()
Clear selections to a single empty stream selection.
void OnRequestHideDockWindow(CodeBlocksDockEvent &event)
bool SaveWorkspace()
Save the open workspace.
void GotoLine(int line)
Set caret to start of a line and ensure it is visible.
int GetSelections() const
How many selections are there?
void ToggleAllFolds()
Toggle all editor folds (inverts the show/hide state of blocks of code).
Dialog that contains a "Don't annoy me" checkbox.
void ShowHideStartPage(bool forceHasProject=false, int forceState=0)
#define wxNO_FULL_REPAINT_ON_RESIZE
void OnFileImportProjectMSVC(wxCommandEvent &event)
int idEditGotoMatchingBrace
DLLIMPORT int cbMessageBox(const wxString &message, const wxString &caption=wxEmptyString, int style=wxOK, wxWindow *parent=NULL, int x=-1, int y=-1)
wxMessageBox wrapper.
void ConvertEOLs(int eolMode)
Convert all line endings in the document to one mode.
EVTIMPORT const wxEventType cbEVT_EDITOR_MODIFIED
Almost empty implementation used in batch mode.
void GotoPreviousChanged() override
Goto previous changed line.
HighlightLanguage GetHighlightLanguage(int lexer)
EVTIMPORT const wxEventType cbEVT_SHOW_LOG_MANAGER
void ParaDown()
Move caret down one paragraph (delimited by empty lines).
DLLIMPORT void cbStopRunningCompilers(PluginManager *manager)
void OnRequestDockWindow(CodeBlocksDockEvent &event)
void OnFileQuit(wxCommandEvent &event)
bool DoOpenFile(const wxString &filename, bool addToHistory=true)
Event used to request from the main app to manage the view layouts.
void OnSwitchTabs(wxCommandEvent &event)
const DLLIMPORT wxString MSVC7_EXT