36 #include <wx/wxhtml.h> 70 return wxT(
"<font color=\"") + textColour +
wxT(
"\">") + text +
wxT(
"</font>");
79 links <<
_T(
"<table>\n<tr><td colspan=\"2\"><b>");
80 links << wrapText(
_(
"Recent projects"), textColour);
81 links << _T(
"</b></td></tr>\n");
84 for (
size_t i = 0; i < projects.
GetCount(); ++i)
86 links << _T(
"<tr><td width=\"50\"><img alt=\"\" width=\"20\" src=\"blank.png\" />");
87 links <<
wxString::Format(_T(
"<a href=\"CB_CMD_DELETE_HISTORY_PROJECT_%lu\"><img alt=\"\" src=\"trash_16x16.png\" /></a>"),
88 static_cast<unsigned long>(i + 1));
89 links << _T(
"<img alt=\"\" width=\"10\" src=\"blank.png\" /></td><td width=\"10\">");
90 links << _T(
"<a href=\"CB_CMD_OPEN_HISTORY_PROJECT_") << (i + 1) << _T(
"\">")
91 << _T(
"<font color=\"") << linkColour << _T(
"\">") << projects.
GetHistoryFile(i)
93 links << _T(
"</td></tr>\n");
98 links << _T(
"<tr><td style=\"width:2em;\"></td><td> ");
99 links << wrapText(
_(
"No recent projects"), textColour);
100 links << _T(
"</td></tr>\n");
103 links << _T(
"</table>\n<table>\n<tr><td colspan=\"2\"><b>");
104 links << wrapText(
_(
"Recent files"), textColour);
105 links <<_T(
"</b></td></tr>\n");
108 for (
size_t i = 0; i < files.
GetCount(); ++i)
110 links << _T(
"<tr><td width=\"50\"><img alt=\"\" width=\"20\" src=\"blank.png\" />");
111 links <<
wxString::Format(_T(
"<a href=\"CB_CMD_DELETE_HISTORY_FILE_%lu\"><img alt=\"\" src=\"trash_16x16.png\" /></a>"),
112 static_cast<unsigned long>(i + 1));
113 links << _T(
"<img alt=\"\" width=\"10\" src=\"blank.png\" /></td><td width=\"10\">");
114 links << _T(
"<a href=\"CB_CMD_OPEN_HISTORY_FILE_") << (i + 1) << _T(
"\">")
115 << _T(
"<font color=\"") << linkColour << _T(
"\">") << files.
GetHistoryFile(i) << _T(
"</font></a>");
116 links << _T(
"</td></tr>\n");
121 links << _T(
"<tr><td style=\"width:2em;\"></td><td> ");
122 links << wrapText(
_(
"No recent files"), textColour);
123 links << _T(
"</td></tr>\n");
126 links << _T(
"</table>\n");
130 buf.
Replace(_T(
"CB_VAR_RECENT_FILES_AND_PROJECTS"), links);
131 buf.
Replace(_T(
"CB_TXT_NEW_PROJECT"),
_(
"Create a new project"));
132 buf.
Replace(_T(
"CB_TXT_OPEN_PROJECT"),
_(
"Open an existing project"));
133 buf.
Replace(_T(
"CB_TXT_VISIT_FORUMS"),
_(
"Visit the Code::Blocks forums"));
134 buf.
Replace(_T(
"CB_TXT_BUG_FEATURE"),
_(
"Report a bug or request a new feature"));
135 buf.
Replace(_T(
"CB_TXT_TIP_OF_THE_DAY"),
_(
"Tip of the Day"));
144 m_projects(projects),
156 size.x = std::max(size.x, -1);
157 size.y = std::max(size.y, -1);
170 for (
int i = 0; i < 7; ++i)
175 m_pWin->LoadPage(resPath +
_T(
"/start_here.zip#zip:start_here.html"));
187 while (!is->Eof() && is->CanRead())
189 memset(tmp, 0,
sizeof(tmp));
190 is->Read(tmp,
sizeof(tmp) - 1);
191 buf <<
cbC2U((
const char*)tmp);
196 buf =
_(
"<html><body><h1>Welcome to Code::Blocks!</h1><br>The default start page seems to be missing...</body></html>");
199 #if defined(_LP64) || defined(_WIN64) 202 const int bit_type = 32;
236 static bool inited =
false;
242 cm->
RegisterColour(
_(
"Start here page"),
_(
"Background colour"),
wxT(
"start_here_background"),
261 buf.
Replace(
wxT(
"CB_BODY_BGCOLOUR"), backgroundColour);
262 buf.
Replace(
wxT(
"CB_LINK_COLOUR"), linkColour);
263 buf.
Replace(
wxT(
"CB_TEXT_COLOUR"), textColour);
266 m_pWin->GetViewStart(&x, &y);
288 if ( href.
IsSameAs(
_T(
"http://www.codeblocks.org/"))
289 || href.
StartsWith(
_T(
"https://sourceforge.net/p/codeblocks/tickets")) )
static wxString GetSvnDate()
static bool GetSafeMode()
static wxFont GetFont(wxSystemFont index)
static Manager * Get()
Use Manager::Get() to get a pointer to its instance Manager::Get() is guaranteed to never return an i...
virtual size_t GetCount() const
void RegisterColour(const wxString &category, const wxString &name, const wxString &id, const wxColour &defaultColour)
const RecentItemsList & m_files
const wxString AppActualVersionVerb
MyHtmlWin(StartHerePage *parent, int id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxHW_SCROLLBAR_AUTO)
wxString m_OriginalPageContent
virtual wxString GetHistoryFile(size_t index) const
wxFSFile * OpenFile(const wxString &location, int flags=wxFS_READ)
const wxFileHistory * GetFileHistory() const
void wxPostEvent(wxEvtHandler *dest, const wxEvent &event)
const wxString AppActualVersion
wxColour GetColour(const wxString &id) const
DLLIMPORT wxString cbC2U(const char *str)
Return str as a proper unicode-compatible string.
wxSizerItem * Add(wxWindow *window, const wxSizerFlags &flags)
size_t Replace(const wxString &strOld, const wxString &strNew, bool replaceAll=true)
const wxString AppWXAnsiUnicode
bool IsSameAs(const wxString &s, bool caseSensitive=true) const
Base class that all "editors" should inherit from.
static wxColour GetColour(wxSystemColour index)
const wxString & _(const wxString &string)
ColourManager * GetColourManager() const
StartHerePage(wxEvtHandler *owner, const RecentItemsList &projects, const RecentItemsList &files, wxWindow *parent)
bool LinkClicked(const wxHtmlLinkInfo &link)
void OnLinkClicked(const wxHtmlLinkInfo &link) override
virtual int GetPointSize() const
static wxString ReadDataPath()
bool StartsWith(const wxString &prefix, wxString *rest=NULL) const
wxInputStream * GetStream() const
bool wxLaunchDefaultBrowser(const wxString &url, int flags=0)
int Printf(const wxString &pszFormat,...)
virtual wxString GetAsString(long flags=wxC2S_NAME|wxC2S_CSS_SYNTAX) const
static wxString Format(const wxString &format,...)
const RecentItemsList & m_projects