return -1;
}
-/*
- * View an HTML file
- */
-
-void apViewHTMLFile(const wxString& url)
-{
-#ifdef __WXMSW__
- HKEY hKey;
- TCHAR szCmdName[1024];
- DWORD dwType, dw = sizeof(szCmdName);
- LONG lRes;
- lRes = RegOpenKey(HKEY_CLASSES_ROOT, _T("htmlfile\\shell\\open\\command"), &hKey);
- if(lRes == ERROR_SUCCESS && RegQueryValueEx(hKey,(LPTSTR)NULL, NULL,
- &dwType, (LPBYTE)szCmdName, &dw) == ERROR_SUCCESS)
- {
- wxStrcat(szCmdName, (const wxChar*) url);
- PROCESS_INFORMATION piProcInfo;
- STARTUPINFO siStartInfo;
- memset(&siStartInfo, 0, sizeof(STARTUPINFO));
- siStartInfo.cb = sizeof(STARTUPINFO);
- CreateProcess(NULL, szCmdName, NULL, NULL, false, 0, NULL,
- NULL, &siStartInfo, &piProcInfo );
- }
- if(lRes == ERROR_SUCCESS)
- RegCloseKey(hKey);
-#else
- wxFileType *ft = wxTheMimeTypesManager->GetFileTypeFromExtension(wxT("html"));
- if ( !ft )
- {
- wxLogError(_T("Impossible to determine the file type for extension html. Please edit your MIME types."));
- return ;
- }
-
- wxString cmd;
- bool ok = ft->GetOpenCommand(&cmd,
- wxFileType::MessageParameters(url, wxEmptyString));
- delete ft;
-
- if (!ok)
- {
- // TODO: some kind of configuration dialog here.
- wxMessageBox(_("Could not determine the command for running the browser."),
- wxT("Browsing problem"), wxOK|wxICON_EXCLAMATION);
- return ;
- }
-
- ok = (wxExecute(cmd, false) != 0);
-#endif
-}
-
wxString wxGetTempDir()
{
wxString dir;
/// Get the index of the given named wxNotebook page
int apFindNotebookPage(wxNotebook* notebook, const wxString& name);
-/// View the given URL
-void apViewHTMLFile(const wxString& url);
-
/// Returns the system temporary directory.
wxString wxGetTempDir();
{
public:
wxIconInfo(const wxString& name);
-
+
// How many states? (Each state
// has enabled/disabled state)
// Max (say) 4 states, each with
void SetIconId(int state, bool enabled, int iconId);
const wxString& GetName() const { return m_name; }
-
+
protected:
int m_maxStates;
int m_states[wxMAX_ICON_STATES * 2]; // Enabled/disabled
{
public:
wxIconTable(wxImageList* imageList = NULL);
-
+
void AppendInfo(wxIconInfo* info);
-
+
// Easy way of initialising both the image list and the
// info db. It will generate image ids itself while appending the icon.
// 'state' is an integer from 0 up to the max allowed, representing a different
// A folder that can be open or closed would have two states.
// Enabled/disabled is taken as a special case.
bool AddInfo(const wxString& name, const wxIcon& icon, int state, bool enabled);
-
+
wxIconInfo* FindInfo(const wxString& name) const;
-
+
int GetIconId(const wxString& name, int state, bool enabled = true) const;
bool SetIconId(const wxString& name, int state, bool enabled, int iconId) ;
-
+
void SetImageList(wxImageList* imageList) { m_imageList = imageList; }
wxImageList* GetImageList() const { return m_imageList; }
-
+
protected:
- wxImageList* m_imageList;
+ wxImageList* m_imageList;
};
/// Useful insertion operators for wxOutputStream.