samples/ipc/*.ico
samples/ipc/*.rc
-samples/types/*.cpp
-samples/types/*.h
-samples/types/*.def
-samples/types/*.rc
-samples/types/*.txt
-samples/types/makefile*
-samples/types/*.xbm
-samples/types/*.xpm
-samples/types/*.ico
+samples/typetest/*.cpp
+samples/typetest/*.h
+samples/typetest/*.def
+samples/typetest/*.rc
+samples/typetest/*.txt
+samples/typetest/makefile*
+samples/typetest/*.xbm
+samples/typetest/*.xpm
+samples/typetest/*.ico
+
+samples/sashtest/*.cpp
+samples/sashtest/*.h
+samples/sashtest/*.def
+samples/sashtest/*.rc
+samples/sashtest/*.txt
+samples/sashtest/makefile*
+samples/sashtest/*.xbm
+samples/sashtest/*.xpm
+samples/sashtest/*.ico
samples/resource/*.cpp
samples/resource/*.h
\wxheading{See also}
\helpref{wxDocManager overview}{wxdocmanageroverview}, \helpref{wxDocument}{wxdocument},\rtfsp
-\helpref{wxView}{wxview}, \helpref{wxDocTemplate}{wxdoctemplate}
+\helpref{wxView}{wxview}, \helpref{wxDocTemplate}{wxdoctemplate}, \helpref{wxFileHistory}{wxfilehistory}
\latexignore{\rtfignore{\wxheading{Members}}}
Removes the template from the list of templates.
-\membersection{wxDocManager::FileHistoryLoad}
+\membersection{wxDocManager::FileHistoryAddFilesToMenu}\label{wxdocmanagerfilehistoryaddfilestomenu}
-\func{void}{FileHistoryLoad}{\param{const wxString\& }{resourceFile}, \param{const wxString\& }{sectionName}}
+\func{void}{FileHistoryAddFilesToMenu}{\void}
-Loads the file history from a resource file, using the given section. This must be called
-explicitly by the application.
+Appends the files in the history list, to all menus managed by the file history object.
+
+\func{void}{FileHistoryAddFilesToMenu}{\param{wxMenu*}{ menu}}
+
+Appends the files in the history list, to the given menu only.
+
+\membersection{wxDocManager::FileHistoryLoad}\label{wxdocmanagerfilehistoryload}
+
+\func{void}{FileHistoryLoad}{\param{wxConfigBase\& }{config}}
+
+Loads the file history from a config object.
+
+\wxheading{See also}
-\membersection{wxDocManager::FileHistorySave}
+\helpref{wxConfig}{wxconfigbase}
-\func{void}{FileHistorySave}{\param{const wxString\& }{resourceFile}, \param{const wxString\& }{sectionName}}
+\membersection{wxDocManager::FileHistoryRemoveMenu}\label{wxdocmanagerfilehistoryremovemenu}
-Saves the file history into a resource file, using the given section. This must be called
+\func{void}{FileHistoryRemoveMenu}{\param{wxMenu*}{ menu}}
+
+Removes the given menu from the list of menus managed by the file history object.
+
+\membersection{wxDocManager::FileHistorySave}\label{wxdocmanagerfilehistorysave}
+
+\func{void}{FileHistorySave}{\param{wxConfigBase\& }{resourceFile}}
+
+Saves the file history into a config object. This must be called
explicitly by the application.
-\membersection{wxDocManager::FileHistoryUseMenu}
+\wxheading{See also}
+
+\helpref{wxConfig}{wxconfigbase}
-\func{void}{FileHistoryUseMenu}{\param{wxMenu *}{menu}}
+\membersection{wxDocManager::FileHistoryUseMenu}\label{wxdocmanagerfilehistoryusemenu}
+
+\func{void}{FileHistoryUseMenu}{\param{wxMenu*}{ menu}}
Use this menu for appending recently-visited document filenames, for convenient
access. Calling this function with a valid menu pointer enables the history
list functionality.
+Note that you can add multiple menus using this function, to be managed by the
+file history object.
+
\membersection{wxDocManager::FindTemplateForPath}
\func{wxDocTemplate *}{FindTemplateForPath}{\param{const wxString\& }{path}}
frame (if any), and is usually constructed by the framework from
the filename.
+\membersection{wxDocument::UpdateAllViews}\label{wxdocumentupdateallviews}
+\func{void}{UpdateAllViews}{\param{wxView* }{sender = NULL}}
+
+Updates all views. If {\it sender} is non-NULL, does not update this view.
The wxFileHistory encapsulates a user interface convenience, the
list of most recently visited files as shown on a menu (usually the File menu).
+wxFileHistory can manage one or more file menus. More than one menu may be required
+in an MDI application, where the file history should appear on each MDI child menu
+as well as the MDI parent frame.
+
\wxheading{Derived from}
\helpref{wxObject}{wxobject}
\wxheading{See also}
-\overview{wxFileHistory overview}{wxfilehistoryoverview}
+\helpref{wxFileHistory overview}{wxfilehistoryoverview}, \helpref{wxDocManager}{wxdocmanager}
\latexignore{\rtfignore{\wxheading{Members}}}
Adds a file to the file history list, if the object has a pointer to an appropriate file menu.
-\membersection{wxFileHistory::FileHistoryLoad}
-
-\func{void}{FileHistoryLoad}{\param{const wxString\& }{resourceFile}, \param{const wxString\& }{sectionName}}
+\membersection{wxFileHistory::AddFilesToMenu}\label{wxfilehistoryaddfilestomenu}
-Loads the file history from a resource file, using the given section. This must be called
-explicitly by the application.
+\func{void}{AddFilesToMenu}{\void}
-\membersection{wxFileHistory::FileHistorySave}
+Appends the files in the history list, to all menus managed by the file history object.
-\func{void}{FileHistorySave}{\param{const wxString\& }{resourceFile}, \param{const wxString\& }{sectionName}}
+\func{void}{AddFilesToMenu}{\param{wxMenu*}{ menu}}
-Saves the file history into a resource file, using the given section. This must be called
-explicitly by the application.
+Appends the files in the history list, to the given menu only.
-\membersection{wxFileHistory::FileHistoryUseMenu}
+\membersection{wxFileHistory::GetHistoryFile}\label{wxfilehistorygethistoryfile}
-\func{void}{FileHistoryUseMenu}{\param{wxMenu* }{menu}}
+\constfunc{wxString}{GetHistoryFile}{\param{int}{ index}}
-Use this menu for appending recently-visited document filenames, for convenient
-access. Calling this function with a valid menu pointer enables the history
-list functionality.
+Returns the file at this index (zero-based).
\membersection{wxFileHistory::GetMaxFiles}
-\func{int}{GetMaxFiles}{\void}
+\constfunc{int}{GetMaxFiles}{\void}
Returns the maximum number of files that can be stored.
\membersection{wxFileHistory::GetNoHistoryFiles}
-\func{int}{GetNoHistoryFiles}{\void}
+\constfunc{int}{GetNoHistoryFiles}{\void}
Returns the number of files currently stored in the file history.
+\membersection{wxFileHistory::Load}
+
+\func{void}{Load}{\param{wxConfigBase\& }{config}}
+
+Loads the file history from the given config object. This function should be called explicitly by the application.
+
+\wxheading{See also}
+
+\helpref{wxConfig}{wxconfigbase}
+
+\membersection{wxFileHistory::RemoveMenu}
+
+\func{void}{RemoveMenu}{\param{wxMenu* }{menu}}
+
+Removes this menu from the list of those managed by this object.
+
+\membersection{wxFileHistory::Save}
+
+\func{void}{Save}{\param{wxConfigBase\& }{config}}
+
+Saves the file history into the given config object. This must be called
+explicitly by the application.
+
+\wxheading{See also}
+
+\helpref{wxConfig}{wxconfigbase}
+
+\membersection{wxFileHistory::UseMenu}
+
+\func{void}{UseMenu}{\param{wxMenu* }{menu}}
+
+Adds this menu to the list of those managed by this object.
+
\helpref{wxMenuBar::SetLabelTop}{wxmenubarsetlabeltop}
+\membersection{wxMenuBar::GetMenu}\label{wxmenubargetmenu}
+
+\constfunc{wxMenu*}{GetMenu}{\param{int}{ menuIndex}}
+
+Returns the menu at {\it menuIndex} (zero-based).
+
+\membersection{wxMenuBar::GetMenuCount}\label{wxmenubargetmenucount}
+
+\constfunc{int}{GetMenuCount}{\void}
+
+Returns the number of menus in this menubar.
+
\membersection{wxMenuBar::IsChecked}\label{wxmenubarischecked}
\constfunc{bool}{IsChecked}{\param{int}{ id}}
Adds string to list, allocating memory.
+\membersection{wxStringList::Clear}
+
+\func{void}{Clear}{\void}
+
+Clears all strings from the list.
+
\membersection{wxStringList::Delete}
\func{void}{Delete}{\param{const wxString\& }{s}}
#define wxID_PASTE 5032
#define wxID_CLEAR 5033
#define wxID_FIND 5034
+#define wxID_DUPLICATE 5035
#define wxID_FILE1 5050
#define wxID_FILE2 5051
class WXDLLEXPORT wxCommand;
class WXDLLEXPORT wxCommandProcessor;
class WXDLLEXPORT wxFileHistory;
+class WXDLLEXPORT wxConfigBase;
class WXDLLIMPORT ostream;
class WXDLLIMPORT istream;
virtual int GetNoHistoryFiles(void) const;
virtual wxString GetHistoryFile(int i) const;
virtual void FileHistoryUseMenu(wxMenu *menu);
- virtual void FileHistoryLoad(const wxString& resourceFile, const wxString& section);
- virtual void FileHistorySave(const wxString& resourceFile, const wxString& section);
+ virtual void FileHistoryRemoveMenu(wxMenu *menu);
+ virtual void FileHistoryLoad(wxConfigBase& config);
+ virtual void FileHistorySave(wxConfigBase& config);
+ virtual void FileHistoryAddFilesToMenu();
+ virtual void FileHistoryAddFilesToMenu(wxMenu* menu);
protected:
long m_flags;
int m_defaultDocumentNameCounter;
virtual bool Submit(wxCommand *command, bool storeIt = TRUE);
virtual bool Undo(void);
virtual bool Redo(void);
- virtual bool CanUndo(void);
+ virtual bool CanUndo(void) const;
+ virtual bool CanRedo(void) const;
// Call this to manage an edit menu.
inline void SetEditMenu(wxMenu *menu) { m_commandEditMenu = menu; }
wxMenu* m_commandEditMenu;
};
+// File history management
+
class WXDLLEXPORT wxFileHistory: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxFileHistory)
wxFileHistory(int maxFiles = 9);
~wxFileHistory(void);
- // File history management
+// Operations
virtual void AddFileToHistory(const wxString& file);
- inline virtual int GetNoHistoryFiles(void) const { return m_fileHistoryN; }
- virtual wxString GetHistoryFile(int i) const;
virtual int GetMaxFiles(void) const { return m_fileMaxFiles; }
- virtual void FileHistoryUseMenu(wxMenu *menu);
- virtual void FileHistoryLoad(const wxString& resourceFile, const wxString& section);
- virtual void FileHistorySave(const wxString& resourceFile, const wxString& section);
+ virtual void UseMenu(wxMenu *menu);
+
+ // Remove menu from the list (MDI child may be closing)
+ virtual void RemoveMenu(wxMenu *menu);
+
+ virtual void Load(wxConfigBase& config);
+ virtual void Save(wxConfigBase& config);
+
+ virtual void AddFilesToMenu();
+ virtual void AddFilesToMenu(wxMenu* menu); // Single menu
+
+// Accessors
+ virtual wxString GetHistoryFile(int i) const;
+
+ // A synonym for GetNoHistoryFiles
+ virtual int GetCount() const { return m_fileHistoryN; }
+ inline int GetNoHistoryFiles(void) const { return m_fileHistoryN; }
+
+ inline wxList& GetMenus() const { return (wxList&) m_fileMenus; }
+
protected:
// Last n files
char** m_fileHistory;
// Number of files saved
int m_fileHistoryN;
- // Menu to maintain
- wxMenu* m_fileMenu;
+ // Menus to maintain (may need several for an MDI app)
+ wxList m_fileMenus;
// Max files to maintain
int m_fileMaxFiles;
};
virtual bool Pending() ;
virtual void Dispatch() ;
- virtual void OnIdle(wxIdleEvent& event);
+ void OnIdle(wxIdleEvent& event);
// Generic
virtual bool OnInit() { return FALSE; };
wxControl(void);
~wxControl(void);
- virtual void Command(wxCommandEvent& WXUNUSED(event)) = 0; // Simulates an event
+ virtual void Command(wxCommandEvent& WXUNUSED(event)) {}; // Simulates an event
virtual void ProcessCommand(wxCommandEvent& event); // Calls the callback and
// appropriate event handlers
virtual void SetClientSize(int width, int height);
// Should be called at end of drawing
virtual wxMetaFile *Close(void);
virtual void SetMapMode(int mode);
- virtual void GetTextExtent(const wxString& string, float *x, float *y,
- float *descent = NULL, float *externalLeading = NULL,
- wxFont *theFont = NULL, bool use16bit = FALSE);
+ virtual void GetTextExtent(const wxString& string, long *x, long *y,
+ long *descent = NULL, long *externalLeading = NULL,
+ wxFont *theFont = NULL, bool use16bit = FALSE) const;
// Implementation
inline wxMetaFile *GetMetaFile(void) { return m_metaFile; }
// Does this window want to accept keyboard focus?
virtual bool AcceptsFocus() const;
+ virtual void PrepareDC( wxDC &dc ) {};
public:
////////////////////////////////////////////////////////////////////////
//// IMPLEMENTATION
BEGIN
MENUITEM "&Cascade", 4002
MENUITEM "&Tile", 4001
- MENUITEM "&Arrange icons", 4003
+ MENUITEM "&Arrange Icons", 4003
MENUITEM "&Next", 4004
END
END
virtual bool Pending() ;
virtual void Dispatch() ;
- virtual void OnIdle(wxIdleEvent& event);
+ void OnIdle(wxIdleEvent& event);
// Generic
virtual bool OnInit() { return FALSE; };
void SetQuality(int q);
void SetOk(bool isOk);
- inline wxPalette* GetPalette() const { return (M_BITMAPDATA ? (& M_BITMAPDATA->m_bitmapPalette) : NULL); }
+ inline wxPalette* GetPalette() const { return (M_BITMAPDATA ? (& M_BITMAPDATA->m_bitmapPalette) : (wxPalette*) NULL); }
void SetPalette(const wxPalette& palette);
- inline wxMask *GetMask() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_bitmapMask : NULL); }
+ inline wxMask *GetMask() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_bitmapMask : (wxMask*) NULL); }
void SetMask(wxMask *mask) ;
inline wxBitmap& operator = (const wxBitmap& bitmap) { if (*this == bitmap) return (*this); Ref(bitmap); return *this; }
wxControl();
~wxControl();
- virtual void Command(wxCommandEvent& WXUNUSED(event)) = 0; // Simulates an event
+ virtual void Command(wxCommandEvent& WXUNUSED(event)) {}; // Simulates an event
virtual void ProcessCommand(wxCommandEvent& event); // Calls the callback and
// appropriate event handlers
virtual void SetLabel(const wxString& label);
inline int GetJoin() const { return (M_PENDATA ? M_PENDATA->m_join : 0); };
inline int GetCap() const { return (M_PENDATA ? M_PENDATA->m_cap : 0); };
inline int GetDashes(wxDash **ptr) const {
- *ptr = (M_PENDATA ? M_PENDATA->m_dash : NULL); return (M_PENDATA ? M_PENDATA->m_nbDash : 0);
+ *ptr = (M_PENDATA ? M_PENDATA->m_dash : (wxDash*) NULL); return (M_PENDATA ? M_PENDATA->m_nbDash : 0);
}
- inline wxBitmap *GetStipple() const { return (M_PENDATA ? (& M_PENDATA->m_stipple) : NULL); };
+ inline wxBitmap *GetStipple() const { return (M_PENDATA ? (& M_PENDATA->m_stipple) : (wxBitmap*) NULL); };
// Implementation
*
*/
+#define USE_CONSTRAINTS 1
+ // Use constraints mechanism
#define USE_CONFIG 1
// Use wxConfig, with CreateConfig in wxApp
#define _WX_GOODCOMPILER__
#define USE_C_MAIN 0
// Set to 1 to use main.c instead of main.cpp (UNIX only)
-#define USE_ODBC 1
+#define USE_ODBC 0
// Define 1 to use ODBC classes
#define USE_IOSTREAMH 1
// callbacks
// ---------
void OnDropFiles(wxDropFilesEvent& event);
- void OnChar(wxKeyEvent& event); // Process 'enter' if required
- void OnEraseBackground(wxEraseEvent& event);
+// void OnChar(wxKeyEvent& event); // Process 'enter' if required
+// void OnEraseBackground(wxEraseEvent& event);
// Implementation
// --------------
virtual wxControl *CreateItem(const wxItemResource *childResource, const wxResourceTable *table = NULL);
#endif
- // Native resource loading
- virtual bool LoadNativeDialog(wxWindow* parent, wxWindowID& id);
- virtual bool LoadNativeDialog(wxWindow* parent, const wxString& name);
- virtual wxWindow* GetWindowChild1(wxWindowID& id);
- virtual wxWindow* GetWindowChild(wxWindowID& id);
-
virtual void GetTextExtent(const wxString& string, int *x, int *y,
int *descent = NULL,
int *externalLeading = NULL,
// Does this window want to accept keyboard focus?
virtual bool AcceptsFocus() const;
+ virtual void PrepareDC( wxDC &dc ) {};
+
+
public:
////////////////////////////////////////////////////////////////////////
//// IMPLEMENTATION
inline void wxWindow::SetId(int id) { m_windowId = id; }
inline wxWindow *wxWindow::GetParent() const { return m_windowParent; }
inline void wxWindow::SetParent(wxWindow *p) { m_windowParent = p; }
-inline wxWindow *wxWindow::GetGrandParent() const { return (m_windowParent ? m_windowParent->m_windowParent : NULL); }
+inline wxWindow *wxWindow::GetGrandParent() const { return (m_windowParent ? m_windowParent->m_windowParent : (wxWindow*) NULL); }
inline wxList *wxWindow::GetChildren() const { return m_children; }
inline wxFont *wxWindow::GetFont() const { return (wxFont *) & m_windowFont; }
inline wxString wxWindow::GetName() const { return m_windowName; }
#endif
#include <wx/stream.h>
-#include "../zlib/zlib.h"
+#include "../zlib/zlib.h" // don't change this, Robert
class wxZlibInputStream: public wxFilterInputStream {
public:
--- /dev/null
+#
+# File: makefile.unx
+# Author: Julian Smart
+# Created: 1998
+# Updated:
+# Copyright: (c) 1998 Julian Smart
+#
+# "%W% %G%"
+#
+# Makefile for minimal example (UNIX).
+
+include ../../src/makeprog.env
+
+PROGRAM=minimal
+
+OBJECTS=$(PROGRAM).o
// Extend event processing to search the view's event table
bool wxDocMDIChildFrame::ProcessEvent(wxEvent& event)
{
- if (m_childView)
- m_childView->Activate(TRUE);
-
if ( !m_childView || ! m_childView->ProcessEvent(event) )
{
// Only hand up to the parent if it's a menu command
{
wxMDIChildFrame::OnActivate(event);
- if (m_childView)
+ if (event.GetActive() && m_childView)
m_childView->Activate(event.GetActive());
}
#include "wx/printdlg.h"
#include "wx/generic/prntdlgg.h"
#include "wx/generic/printps.h"
+#include "wx/confbase.h"
#include <stdio.h>
#include <string.h>
}
SetFilename(file, TRUE);
Modify(FALSE);
+ m_savedYet = TRUE;
UpdateAllViews();
void wxDocManager::FileHistoryUseMenu(wxMenu *menu)
{
if (m_fileHistory)
- m_fileHistory->FileHistoryUseMenu(menu);
+ m_fileHistory->UseMenu(menu);
}
-void wxDocManager::FileHistoryLoad(const wxString& resourceFile, const wxString& section)
+void wxDocManager::FileHistoryRemoveMenu(wxMenu *menu)
{
if (m_fileHistory)
- m_fileHistory->FileHistoryLoad(resourceFile, section);
+ m_fileHistory->RemoveMenu(menu);
}
-void wxDocManager::FileHistorySave(const wxString& resourceFile, const wxString& section)
+void wxDocManager::FileHistoryLoad(wxConfigBase& config)
{
if (m_fileHistory)
- m_fileHistory->FileHistorySave(resourceFile, section);
+ m_fileHistory->Load(config);
+}
+
+void wxDocManager::FileHistorySave(wxConfigBase& config)
+{
+ if (m_fileHistory)
+ m_fileHistory->Save(config);
+}
+
+void wxDocManager::FileHistoryAddFilesToMenu(wxMenu* menu)
+{
+ if (m_fileHistory)
+ m_fileHistory->AddFilesToMenu(menu);
+}
+
+void wxDocManager::FileHistoryAddFilesToMenu()
+{
+ if (m_fileHistory)
+ m_fileHistory->AddFilesToMenu();
}
int wxDocManager::GetNoHistoryFiles(void) const
return FALSE;
}
-bool wxCommandProcessor::CanUndo(void)
+bool wxCommandProcessor::CanUndo(void) const
{
if (m_currentCommand)
return ((wxCommand *)m_currentCommand->Data())->CanUndo();
return FALSE;
}
+bool wxCommandProcessor::CanRedo(void) const
+{
+ return ((m_currentCommand && m_currentCommand->Next()));
+}
+
void wxCommandProcessor::Initialize(void)
{
m_currentCommand = m_commands.Last();
wxFileHistory::wxFileHistory(int maxFiles)
{
m_fileMaxFiles = maxFiles;
- m_fileMenu = (wxMenu *) NULL;
m_fileHistoryN = 0;
m_fileHistory = new char *[m_fileMaxFiles];
}
// File history management
void wxFileHistory::AddFileToHistory(const wxString& file)
{
- if (!m_fileMenu)
- return;
-
int i;
-
// Check we don't already have this file
for (i = 0; i < m_fileHistoryN; i++)
{
- if (m_fileHistory[i] && wxString(m_fileHistory[i]) == file)
- return;
+ if (m_fileHistory[i] && wxString(m_fileHistory[i]) == file)
+ return;
}
-
+
// Add to the project file history:
// Move existing files (if any) down so we can insert file at beginning.
}
if (m_fileHistoryN < m_fileMaxFiles)
{
- if (m_fileHistoryN == 0)
- m_fileMenu->AppendSeparator();
- m_fileMenu->Append(wxID_FILE1+m_fileHistoryN, _("[EMPTY]"));
+ wxNode* node = m_fileMenus.First();
+ while (node)
+ {
+ wxMenu* menu = (wxMenu*) node->Data();
+ if (m_fileHistoryN == 0)
+ menu->AppendSeparator();
+ menu->Append(wxID_FILE1+m_fileHistoryN, _("[EMPTY]"));
+ node = node->Next();
+ }
m_fileHistoryN ++;
}
// Shuffle filenames down
{
char buf[400];
sprintf(buf, "&%d %s", i+1, m_fileHistory[i]);
- m_fileMenu->SetLabel(wxID_FILE1+i, buf);
+ wxNode* node = m_fileMenus.First();
+ while (node)
+ {
+ wxMenu* menu = (wxMenu*) node->Data();
+ menu->SetLabel(wxID_FILE1+i, buf);
+ node = node->Next();
+ }
}
}
return wxString("");
}
-void wxFileHistory::FileHistoryUseMenu(wxMenu *menu)
+void wxFileHistory::UseMenu(wxMenu *menu)
{
- m_fileMenu = menu;
+ if (!m_fileMenus.Member(menu))
+ m_fileMenus.Append(menu);
}
-void wxFileHistory::FileHistoryLoad(const wxString& resourceFile, const wxString& section)
+void wxFileHistory::RemoveMenu(wxMenu *menu)
+{
+ m_fileMenus.DeleteObject(menu);
+}
+
+void wxFileHistory::Load(wxConfigBase& config)
{
-#if USE_RESOURCES
m_fileHistoryN = 0;
char buf[400];
sprintf(buf, "file%d", m_fileHistoryN+1);
- char *historyFile = (char *) NULL;
- while ((m_fileHistoryN <= m_fileMaxFiles) && wxGetResource(section, buf, &historyFile, resourceFile) && historyFile)
+ wxString historyFile("");
+ while ((m_fileHistoryN <= m_fileMaxFiles) && config.Read(buf, &historyFile) && (historyFile != ""))
{
- // wxGetResource allocates memory so this is o.k.
- m_fileHistory[m_fileHistoryN] = historyFile;
+ m_fileHistory[m_fileHistoryN] = copystring((const char*) historyFile);
m_fileHistoryN ++;
sprintf(buf, "file%d", m_fileHistoryN+1);
- historyFile = (char *) NULL;
+ historyFile = "";
}
-#endif
+ AddFilesToMenu();
}
-void wxFileHistory::FileHistorySave(const wxString& resourceFile, const wxString& section)
+void wxFileHistory::Save(wxConfigBase& config)
{
-#if USE_RESOURCES
- char buf[400];
int i;
for (i = 0; i < m_fileHistoryN; i++)
{
- sprintf(buf, "file%d", i+1);
- wxWriteResource(section, buf, m_fileHistory[i], resourceFile);
+ wxString buf;
+ buf.Printf("file%d", i+1);
+ config.Write(buf, wxString(m_fileHistory[i]));
}
-#endif
+}
+
+void wxFileHistory::AddFilesToMenu()
+{
+ if (m_fileHistoryN > 0)
+ {
+ wxNode* node = m_fileMenus.First();
+ while (node)
+ {
+ wxMenu* menu = (wxMenu*) node->Data();
+ menu->AppendSeparator();
+ int i;
+ for (i = 0; i < m_fileHistoryN; i++)
+ {
+ if (m_fileHistory[i])
+ {
+ wxString buf;
+ buf.Printf("&%d %s", i+1, m_fileHistory[i]);
+ menu->Append(wxID_FILE1+i, buf);
+ }
+ }
+ node = node->Next();
+ }
+ }
+}
+
+void wxFileHistory::AddFilesToMenu(wxMenu* menu)
+{
+ if (m_fileHistoryN > 0)
+ {
+ menu->AppendSeparator();
+ int i;
+ for (i = 0; i < m_fileHistoryN; i++)
+ {
+ if (m_fileHistory[i])
+ {
+ wxString buf;
+ buf.Printf("&%d %s", i+1, m_fileHistory[i]);
+ menu->Append(wxID_FILE1+i, buf);
+ }
+ }
+ }
}
#if 0
pstrExt->Empty();
}
}
+
+//------------------------------------------------------------------------
+// wild character routines
+//------------------------------------------------------------------------
+
+bool wxIsWild( const wxString& pattern )
+{
+ wxString tmp = pattern;
+ char *pat = WXSTRINGCAST(tmp);
+ while (*pat) {
+ switch (*pat++) {
+ case '?': case '*': case '[': case '{':
+ return TRUE;
+ case '\\':
+ if (!*pat++)
+ return FALSE;
+ }
+ }
+ return FALSE;
+};
+
+
+bool wxMatchWild( const wxString& pat, const wxString& text, bool dot_special )
+{
+ wxString tmp1 = pat;
+ char *pattern = WXSTRINGCAST(tmp1);
+ wxString tmp2 = text;
+ char *str = WXSTRINGCAST(tmp2);
+ char c;
+ char *cp;
+ bool done = FALSE, ret_code, ok;
+ // Below is for vi fans
+ const char OB = '{', CB = '}';
+
+ // dot_special means '.' only matches '.'
+ if (dot_special && *str == '.' && *pattern != *str)
+ return FALSE;
+
+ while ((*pattern != '\0') && (!done)
+ && (((*str=='\0')&&((*pattern==OB)||(*pattern=='*')))||(*str!='\0'))) {
+ switch (*pattern) {
+ case '\\':
+ pattern++;
+ if (*pattern != '\0')
+ pattern++;
+ break;
+ case '*':
+ pattern++;
+ ret_code = FALSE;
+ while ((*str!='\0')
+ && (!(ret_code=wxMatchWild(pattern, str++, FALSE))))
+ /*loop*/;
+ if (ret_code) {
+ while (*str != '\0')
+ str++;
+ while (*pattern != '\0')
+ pattern++;
+ }
+ break;
+ case '[':
+ pattern++;
+ repeat:
+ if ((*pattern == '\0') || (*pattern == ']')) {
+ done = TRUE;
+ break;
+ }
+ if (*pattern == '\\') {
+ pattern++;
+ if (*pattern == '\0') {
+ done = TRUE;
+ break;
+ }
+ }
+ if (*(pattern + 1) == '-') {
+ c = *pattern;
+ pattern += 2;
+ if (*pattern == ']') {
+ done = TRUE;
+ break;
+ }
+ if (*pattern == '\\') {
+ pattern++;
+ if (*pattern == '\0') {
+ done = TRUE;
+ break;
+ }
+ }
+ if ((*str < c) || (*str > *pattern)) {
+ pattern++;
+ goto repeat;
+ }
+ } else if (*pattern != *str) {
+ pattern++;
+ goto repeat;
+ }
+ pattern++;
+ while ((*pattern != ']') && (*pattern != '\0')) {
+ if ((*pattern == '\\') && (*(pattern + 1) != '\0'))
+ pattern++;
+ pattern++;
+ }
+ if (*pattern != '\0') {
+ pattern++, str++;
+ }
+ break;
+ case '?':
+ pattern++;
+ str++;
+ break;
+ case OB:
+ pattern++;
+ while ((*pattern != CB) && (*pattern != '\0')) {
+ cp = str;
+ ok = TRUE;
+ while (ok && (*cp != '\0') && (*pattern != '\0')
+ && (*pattern != ',') && (*pattern != CB)) {
+ if (*pattern == '\\')
+ pattern++;
+ ok = (*pattern++ == *cp++);
+ }
+ if (*pattern == '\0') {
+ ok = FALSE;
+ done = TRUE;
+ break;
+ } else if (ok) {
+ str = cp;
+ while ((*pattern != CB) && (*pattern != '\0')) {
+ if (*++pattern == '\\') {
+ if (*++pattern == CB)
+ pattern++;
+ }
+ }
+ } else {
+ while (*pattern!=CB && *pattern!=',' && *pattern!='\0') {
+ if (*++pattern == '\\') {
+ if (*++pattern == CB || *pattern == ',')
+ pattern++;
+ }
+ }
+ }
+ if (*pattern != '\0')
+ pattern++;
+ }
+ break;
+ default:
+ if (*str == *pattern) {
+ str++, pattern++;
+ } else {
+ done = TRUE;
+ }
+ }
+ }
+ while (*pattern == '*')
+ pattern++;
+ return ((*str == '\0') && (*pattern == '\0'));
+};
+
#include <wx/timer.h>
#include <wx/utils.h>
+// Not enough OS behaviour defined for wxStubs
+#ifndef __WXSTUBS__
+
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
}
#endif
+
+#endif
+ // __WXSTUBS__
m_inflate.zalloc = (alloc_func)0;
m_inflate.zfree = (free_func)0;
- m_inflate.opaque = (voidpf)0;
+ m_inflate.opaque = (void*)0;
err = inflateInit(&m_inflate);
if (err != Z_OK) {
m_deflate.zalloc = (alloc_func)0;
m_deflate.zfree = (free_func)0;
- m_deflate.opaque = (voidpf)0;
+ m_deflate.opaque = (void*)0;
err = deflateInit(&m_deflate, Z_DEFAULT_COMPRESSION);
if (err != Z_OK) {
if (hilight)
dc->SetTextForeground( wxSystemSettings::GetSystemColour( wxSYS_COLOUR_HIGHLIGHTTEXT ) );
else
- dc->SetTextForeground( info->GetColour() );
+ dc->SetTextForeground( * info->GetColour() );
dc->DrawText( s, info->GetX()+2, info->GetY() );
dc->DestroyClippingRegion();
node = node->Next();
if (hilight)
dc->SetTextForeground( wxSystemSettings::GetSystemColour( wxSYS_COLOUR_HIGHLIGHTTEXT ) );
else
- dc->SetTextForeground( item->GetColour() );
+ dc->SetTextForeground( * item->GetColour() );
dc->DrawText( s, m_bound_label.x, m_bound_label.y );
}
}
void wxListMainWindow::ActivateLine( wxListLineData *line )
{
- if (!m_parent) return;
- wxListEvent le( wxEVT_COMMAND_LIST_KEY_DOWN, m_parent->GetId() );
- le.SetEventObject( m_parent );
+ if (!GetParent()) return;
+ wxListEvent le( wxEVT_COMMAND_LIST_KEY_DOWN, GetParent()->GetId() );
+ le.SetEventObject( GetParent() );
le.m_code = 0;
le.m_itemIndex = GetIndexOfLine( line );
le.m_col = 0;
void wxListMainWindow::SendNotify( wxListLineData *line, wxEventType command )
{
- if (!m_parent) return;
- wxListEvent le( command, m_parent->GetId() );
- le.SetEventObject( m_parent );
+ if (!GetParent()) return;
+ wxListEvent le( command, GetParent()->GetId() );
+ le.SetEventObject( GetParent() );
le.m_code = 0;
le.m_itemIndex = GetIndexOfLine( line );
le.m_col = 0;
void wxListMainWindow::RenameLine( wxListLineData *line, const wxString &newName )
{
- if (!m_parent) return;
+ if (!GetParent()) return;
- wxListEvent le( wxEVT_COMMAND_LIST_END_LABEL_EDIT, m_parent->GetId() );
- le.SetEventObject( m_parent );
+ wxListEvent le( wxEVT_COMMAND_LIST_END_LABEL_EDIT, GetParent()->GetId() );
+ le.SetEventObject( GetParent() );
le.m_code = 0;
le.m_itemIndex = GetIndexOfLine( line );
le.m_col = 0;
void wxListMainWindow::OnMouse( wxMouseEvent &event )
{
- if (m_parent->ProcessEvent( event)) return;
+ if (GetParent()->ProcessEvent( event)) return;
if (!m_current) return;
if (m_dirty) return;
if (event.Dragging() && (m_dragCount > 3))
{
m_dragCount = 0;
- wxListEvent le( wxEVT_COMMAND_LIST_BEGIN_DRAG, m_parent->GetId() );
+ wxListEvent le( wxEVT_COMMAND_LIST_BEGIN_DRAG, GetParent()->GetId() );
le.SetEventObject( this );
le.m_code = 0;
le.m_itemIndex = 0;
m_hasFocus = TRUE;
RefreshLine( m_current );
- if (!m_parent) return;
+ if (!GetParent()) return;
- wxFocusEvent event( wxEVT_SET_FOCUS, m_parent->GetId() );
- event.SetEventObject( m_parent );
- m_parent->ProcessEvent( event );
+ wxFocusEvent event( wxEVT_SET_FOCUS, GetParent()->GetId() );
+ event.SetEventObject( GetParent() );
+ GetParent()->ProcessEvent( event );
}
void wxListMainWindow::OnKillFocus( wxFocusEvent &WXUNUSED(event) )
bool wxListMainWindow::OnListNotify( wxListEvent &event )
{
- if (m_parent) m_parent->ProcessEvent( event );
+ if (GetParent()) GetParent()->ProcessEvent( event );
return FALSE;
}
return ((stat(buf, &sbuf) != -1) && S_ISDIR(sbuf.st_mode) ? TRUE : FALSE);
};
-//------------------------------------------------------------------------
-// wild character routines
-//------------------------------------------------------------------------
-
-bool wxIsWild( const wxString& pattern )
-{
- wxString tmp = pattern;
- char *pat = WXSTRINGCAST(tmp);
- while (*pat) {
- switch (*pat++) {
- case '?': case '*': case '[': case '{':
- return TRUE;
- case '\\':
- if (!*pat++)
- return FALSE;
- }
- }
- return FALSE;
-};
-
-
-bool wxMatchWild( const wxString& pat, const wxString& text, bool dot_special )
-{
- wxString tmp1 = pat;
- char *pattern = WXSTRINGCAST(tmp1);
- wxString tmp2 = text;
- char *str = WXSTRINGCAST(tmp2);
- char c;
- char *cp;
- bool done = FALSE, ret_code, ok;
- // Below is for vi fans
- const char OB = '{', CB = '}';
-
- // dot_special means '.' only matches '.'
- if (dot_special && *str == '.' && *pattern != *str)
- return FALSE;
-
- while ((*pattern != '\0') && (!done)
- && (((*str=='\0')&&((*pattern==OB)||(*pattern=='*')))||(*str!='\0'))) {
- switch (*pattern) {
- case '\\':
- pattern++;
- if (*pattern != '\0')
- pattern++;
- break;
- case '*':
- pattern++;
- ret_code = FALSE;
- while ((*str!='\0')
- && (!(ret_code=wxMatchWild(pattern, str++, FALSE))))
- /*loop*/;
- if (ret_code) {
- while (*str != '\0')
- str++;
- while (*pattern != '\0')
- pattern++;
- }
- break;
- case '[':
- pattern++;
- repeat:
- if ((*pattern == '\0') || (*pattern == ']')) {
- done = TRUE;
- break;
- }
- if (*pattern == '\\') {
- pattern++;
- if (*pattern == '\0') {
- done = TRUE;
- break;
- }
- }
- if (*(pattern + 1) == '-') {
- c = *pattern;
- pattern += 2;
- if (*pattern == ']') {
- done = TRUE;
- break;
- }
- if (*pattern == '\\') {
- pattern++;
- if (*pattern == '\0') {
- done = TRUE;
- break;
- }
- }
- if ((*str < c) || (*str > *pattern)) {
- pattern++;
- goto repeat;
- }
- } else if (*pattern != *str) {
- pattern++;
- goto repeat;
- }
- pattern++;
- while ((*pattern != ']') && (*pattern != '\0')) {
- if ((*pattern == '\\') && (*(pattern + 1) != '\0'))
- pattern++;
- pattern++;
- }
- if (*pattern != '\0') {
- pattern++, str++;
- }
- break;
- case '?':
- pattern++;
- str++;
- break;
- case OB:
- pattern++;
- while ((*pattern != CB) && (*pattern != '\0')) {
- cp = str;
- ok = TRUE;
- while (ok && (*cp != '\0') && (*pattern != '\0')
- && (*pattern != ',') && (*pattern != CB)) {
- if (*pattern == '\\')
- pattern++;
- ok = (*pattern++ == *cp++);
- }
- if (*pattern == '\0') {
- ok = FALSE;
- done = TRUE;
- break;
- } else if (ok) {
- str = cp;
- while ((*pattern != CB) && (*pattern != '\0')) {
- if (*++pattern == '\\') {
- if (*++pattern == CB)
- pattern++;
- }
- }
- } else {
- while (*pattern!=CB && *pattern!=',' && *pattern!='\0') {
- if (*++pattern == '\\') {
- if (*++pattern == CB || *pattern == ',')
- pattern++;
- }
- }
- }
- if (*pattern != '\0')
- pattern++;
- }
- break;
- default:
- if (*str == *pattern) {
- str++, pattern++;
- } else {
- done = TRUE;
- }
- }
- }
- while (*pattern == '*')
- pattern++;
- return ((*str == '\0') && (*pattern == '\0'));
-};
-
//------------------------------------------------------------------------
// subprocess routines
//------------------------------------------------------------------------
return ((stat(buf, &sbuf) != -1) && S_ISDIR(sbuf.st_mode) ? TRUE : FALSE);
};
-//------------------------------------------------------------------------
-// wild character routines
-//------------------------------------------------------------------------
-
-bool wxIsWild( const wxString& pattern )
-{
- wxString tmp = pattern;
- char *pat = WXSTRINGCAST(tmp);
- while (*pat) {
- switch (*pat++) {
- case '?': case '*': case '[': case '{':
- return TRUE;
- case '\\':
- if (!*pat++)
- return FALSE;
- }
- }
- return FALSE;
-};
-
-
-bool wxMatchWild( const wxString& pat, const wxString& text, bool dot_special )
-{
- wxString tmp1 = pat;
- char *pattern = WXSTRINGCAST(tmp1);
- wxString tmp2 = text;
- char *str = WXSTRINGCAST(tmp2);
- char c;
- char *cp;
- bool done = FALSE, ret_code, ok;
- // Below is for vi fans
- const char OB = '{', CB = '}';
-
- // dot_special means '.' only matches '.'
- if (dot_special && *str == '.' && *pattern != *str)
- return FALSE;
-
- while ((*pattern != '\0') && (!done)
- && (((*str=='\0')&&((*pattern==OB)||(*pattern=='*')))||(*str!='\0'))) {
- switch (*pattern) {
- case '\\':
- pattern++;
- if (*pattern != '\0')
- pattern++;
- break;
- case '*':
- pattern++;
- ret_code = FALSE;
- while ((*str!='\0')
- && (!(ret_code=wxMatchWild(pattern, str++, FALSE))))
- /*loop*/;
- if (ret_code) {
- while (*str != '\0')
- str++;
- while (*pattern != '\0')
- pattern++;
- }
- break;
- case '[':
- pattern++;
- repeat:
- if ((*pattern == '\0') || (*pattern == ']')) {
- done = TRUE;
- break;
- }
- if (*pattern == '\\') {
- pattern++;
- if (*pattern == '\0') {
- done = TRUE;
- break;
- }
- }
- if (*(pattern + 1) == '-') {
- c = *pattern;
- pattern += 2;
- if (*pattern == ']') {
- done = TRUE;
- break;
- }
- if (*pattern == '\\') {
- pattern++;
- if (*pattern == '\0') {
- done = TRUE;
- break;
- }
- }
- if ((*str < c) || (*str > *pattern)) {
- pattern++;
- goto repeat;
- }
- } else if (*pattern != *str) {
- pattern++;
- goto repeat;
- }
- pattern++;
- while ((*pattern != ']') && (*pattern != '\0')) {
- if ((*pattern == '\\') && (*(pattern + 1) != '\0'))
- pattern++;
- pattern++;
- }
- if (*pattern != '\0') {
- pattern++, str++;
- }
- break;
- case '?':
- pattern++;
- str++;
- break;
- case OB:
- pattern++;
- while ((*pattern != CB) && (*pattern != '\0')) {
- cp = str;
- ok = TRUE;
- while (ok && (*cp != '\0') && (*pattern != '\0')
- && (*pattern != ',') && (*pattern != CB)) {
- if (*pattern == '\\')
- pattern++;
- ok = (*pattern++ == *cp++);
- }
- if (*pattern == '\0') {
- ok = FALSE;
- done = TRUE;
- break;
- } else if (ok) {
- str = cp;
- while ((*pattern != CB) && (*pattern != '\0')) {
- if (*++pattern == '\\') {
- if (*++pattern == CB)
- pattern++;
- }
- }
- } else {
- while (*pattern!=CB && *pattern!=',' && *pattern!='\0') {
- if (*++pattern == '\\') {
- if (*++pattern == CB || *pattern == ',')
- pattern++;
- }
- }
- }
- if (*pattern != '\0')
- pattern++;
- }
- break;
- default:
- if (*str == *pattern) {
- str++, pattern++;
- } else {
- done = TRUE;
- }
- }
- }
- while (*pattern == '*')
- pattern++;
- return ((*str == '\0') && (*pattern == '\0'));
-};
-
//------------------------------------------------------------------------
// subprocess routines
//------------------------------------------------------------------------
--- /dev/null
+# generic.env
+# Linux/generic
+#
+# Common makefile settings for wxWindows programs
+# This file is included by all the other makefiles, thus changes
+# made here take effect everywhere (except where overriden).
+#
+# An alternative to editing this file is to create a shell script
+# to export specific variables, and call make with the -e switch
+# to override makefile variables. See wx/install/install.txt.
+# And you can override specific variables on the make command line, e.g.
+#
+# make -f makefile.unix DEBUG=''
+#
+# You may prefer to use the GNU configure script than raw makefiles -
+# see contrib/wxshlib.
+#
+
+########################### Programs #################################
+
+# Replace this with your own path if necessary
+WXDIR = /home/jacs/wx2
+
+# C++ compiler
+CC = g++
+
+# C compiler
+CCC = gcc
+
+# Compiler for lex/yacc .c programs
+CCLEX = $(CCC)
+
+LEX = lex
+YACC = yacc
+MAKE = make
+AROPTIONS = ruv
+RANLIB = ranlib
+
+############################ Switches #################################
+
+# Debug/trace mode. 1 or more for debugging.
+DEBUG = 0
+GUI = -D__WXSTUBS__ -D__LINUX__ -D__UNIX__
+GUISUFFIX = _stubs
+
+########################## Compiler flags #############################
+
+# Misc options
+OPTIONS = -D__WXDEBUG__ -DWXDEBUG
+COPTIONS =
+DEBUGFLAGS = -ggdb
+INCLUDE =
+WARN = -Wall -Wno-unused # -w
+CWARN = -Wall -Wno-unused # -w
+OPT = # -O2
+
+############################ Includes #################################
+
+# Compiler or system-specific include paths
+COMPPATHS =
+XINCLUDE = -I/usr/openwin/include -I/usr/include/X11 -I/usr/include/Xm \
+ -I/usr/include/X11/Xm -I/usr/include
+XLIB = -L/usr/local/X11/lib -L/usr/openwin/lib -L/usr/X11/lib -L/usr/X11R6/lib
+
+############################ Libraries ################################
+
+COMPLIBS = -lstdc++
+GUILDLIBS = -lwx_stubs $(COMPLIBS) -lXm -lXmu -lXt -lX11 -lm
+
+############################# Suffixes ################################
+
+# Change cpp to c if you want to use main.c instead of main.cpp.
+# Edit wx_setup.h accordingly (USE_C_MAIN=1)
+
+OBJSUFF =o
+SRCSUFF =cpp
+MAINSUFF =cpp
+
+####################### No changes below this line ####################
+
+WXINC = $(WXDIR)/include
+WXLIB = $(WXDIR)/lib/libwx$(GUISUFFIX).a
+INC = -I$(WXINC) -I$(WXDIR)/src/png -I$(WXDIR)/src/zlib $(COMPPATHS)
+
+# Directory for object files
+OBJDIR = objects$(GUISUFFIX)
+
+CPPFLAGS = $(EXTRACPPFLAGS) $(XINCLUDE) $(INC) $(OPTIONS) $(GUI) $(DEBUGFLAGS) -DDEBUG='$(DEBUG)' $(WARN) $(OPT)
+CFLAGS = $(EXTRACFLAGS) $(XINCLUDE) $(INC) $(COPTIONS) $(GUI) $(DEBUGFLAGS) -DDEBUG='$(DEBUG)' $(CWARN) $(OPT)
+LDFLAGS = $(EXTRALDFLAGS) $(XLIB) -L$(WXDIR)/lib
+LDLIBS = $(EXTRALDLIBS) $(GUILDLIBS)
+
+# Clears all default suffixes
+.SUFFIXES: .o .cpp .c
+
+.c.o :
+ $(CC) -c $(CFLAGS) -o $@ $<
+
+.cpp.o :
+ $(CC) -c $(CPPFLAGS) -o $@ $<
+
+####################### Targets to allow multiple GUIs ####################
+
+dummy:
+ echo Use a target: one of motif, stubs
+
+stubs:
+ make -f makefile.unx all GUI='-D__WXSTUBS__ -D__LINUX__ -D__UNIX__' GUISUFFIX='_stubs' GUILDLIBS='-lwx_stubs $(COMPLIBS) -lXm -lXmu -lXt -lX11 -lm'
+
+motif:
+ make -f makefile.unx all GUI='-D__WXMOTIF__ -D__LINUX__ -D__UNIX__' GUISUFFIX='_motif' GUILDLIBS='-lwx_motif $(COMPLIBS) -lXm -lXmu -lXt -lX11 -lm'
+
+cleanstubs:
+ make -f makefile.unx clean GUI='-D__WXSTUBS__ -D__LINUX__ -D__UNIX__' GUISUFFIX='_stubs' GUILDLIBS='-lwx_stubs $(COMPLIBS) -lXm -lXmu -lXt -lX11 -lm'
+
+cleanmotif:
+ make -f makefile.unx clean GUI='-D__WXMOTIF__ -D__LINUX__ -D__UNIX__' GUISUFFIX='_motif' GUILDLIBS='-lwx_motif $(COMPLIBS) -lXm -lXmu -lXt -lX11 -lm'
+
+$(OBJDIR):
+ mkdir $(OBJDIR)
+
--- /dev/null
+# Replace this with your own path if necessary
+WXDIR = /home/jacs/wx2
+include $(WXDIR)/src/make.env
+
+all: $(PROGRAM)$(GUISUFFIX)
+
+$(PROGRAM)$(GUISUFFIX): $(OBJECTS) $(WXLIB)
+ $(CC) $(LDFLAGS) -o $(PROGRAM)$(GUISUFFIX) $(OBJECTS) $(LDLIBS)
+
+clean:
+ rm -f $(OBJECTS) minimal$(GUISUFFIX) core
if (!file.IsNull() && wxFileExists(file))
wxRemoveFile(file);
- m_hDC = (WXHDC) CreateMetaFile(file);
- m_ok = TRUE;
+ if (!file.IsNull() && (file != ""))
+ m_hDC = (WXHDC) CreateMetaFile(file);
+ else
+ m_hDC = (WXHDC) CreateMetaFile(NULL);
+
+ m_ok = (m_hDC != (WXHDC) 0) ;
// Actual Windows mapping mode, for future reference.
m_windowsMappingMode = MM_TEXT;
m_hDC = 0;
}
-void wxMetaFileDC::GetTextExtent(const wxString& string, float *x, float *y,
- float *descent, float *externalLeading, wxFont *theFont, bool use16bit)
+void wxMetaFileDC::GetTextExtent(const wxString& string, long *x, long *y,
+ long *descent, long *externalLeading, wxFont *theFont, bool use16bit) const
{
wxFont *fontToUse = theFont;
if (!fontToUse)
- fontToUse = &m_font;
+ fontToUse = (wxFont*) &m_font;
HDC dc = GetDC(NULL);
ReleaseDC(NULL, dc);
- *x = (float)XDEV2LOGREL(sizeRect.cx);
- *y = (float)YDEV2LOGREL(sizeRect.cy);
- if (descent) *descent = (float)tm.tmDescent;
- if (externalLeading) *externalLeading = (float)tm.tmExternalLeading;
+ *x = XDEV2LOGREL(sizeRect.cx);
+ *y = YDEV2LOGREL(sizeRect.cy);
+ if (descent) *descent = tm.tmDescent;
+ if (externalLeading) *externalLeading = tm.tmExternalLeading;
}
wxMetaFile *wxMetaFileDC::Close(void)
ReleaseDC(NULL, dc);
}
+bool wxDirExists(const wxString& dir)
+{
+ /* MATTHEW: [6] Always use same code for Win32, call FindClose */
+#if defined(__WIN32__)
+ WIN32_FIND_DATA fileInfo;
+#else
+#ifdef __BORLANDC__
+ struct ffblk fileInfo;
+#else
+ struct find_t fileInfo;
+#endif
+#endif
+
+#if defined(__WIN32__)
+ HANDLE h = FindFirstFile((LPTSTR) WXSTRINGCAST dir,(LPWIN32_FIND_DATA)&fileInfo);
+
+ if (h==INVALID_HANDLE_VALUE)
+ return FALSE;
+ else {
+ FindClose(h);
+ return ((fileInfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == FILE_ATTRIBUTE_DIRECTORY);
+ }
+#else
+ // In Borland findfirst has a different argument
+ // ordering from _dos_findfirst. But _dos_findfirst
+ // _should_ be ok in both MS and Borland... why not?
+#ifdef __BORLANDC__
+ return ((findfirst(WXSTRINGCAST dir, &fileInfo, _A_SUBDIR) == 0 && (fileInfo.ff_attrib & _A_SUBDIR) != 0));
+#else
+ return (((_dos_findfirst(WXSTRINGCAST dir, _A_SUBDIR, &fileInfo) == 0) && (fileInfo.attrib & _A_SUBDIR)) != 0);
+#endif
+#endif
+}
+
+#if 0
+//------------------------------------------------------------------------
+// wild character routines
+//------------------------------------------------------------------------
+
+bool wxIsWild( const wxString& pattern )
+{
+ wxString tmp = pattern;
+ char *pat = WXSTRINGCAST(tmp);
+ while (*pat) {
+ switch (*pat++) {
+ case '?': case '*': case '[': case '{':
+ return TRUE;
+ case '\\':
+ if (!*pat++)
+ return FALSE;
+ }
+ }
+ return FALSE;
+};
+
+
+bool wxMatchWild( const wxString& pat, const wxString& text, bool dot_special )
+{
+ wxString tmp1 = pat;
+ char *pattern = WXSTRINGCAST(tmp1);
+ wxString tmp2 = text;
+ char *str = WXSTRINGCAST(tmp2);
+ char c;
+ char *cp;
+ bool done = FALSE, ret_code, ok;
+ // Below is for vi fans
+ const char OB = '{', CB = '}';
+
+ // dot_special means '.' only matches '.'
+ if (dot_special && *str == '.' && *pattern != *str)
+ return FALSE;
+
+ while ((*pattern != '\0') && (!done)
+ && (((*str=='\0')&&((*pattern==OB)||(*pattern=='*')))||(*str!='\0'))) {
+ switch (*pattern) {
+ case '\\':
+ pattern++;
+ if (*pattern != '\0')
+ pattern++;
+ break;
+ case '*':
+ pattern++;
+ ret_code = FALSE;
+ while ((*str!='\0')
+ && (!(ret_code=wxMatchWild(pattern, str++, FALSE))))
+ /*loop*/;
+ if (ret_code) {
+ while (*str != '\0')
+ str++;
+ while (*pattern != '\0')
+ pattern++;
+ }
+ break;
+ case '[':
+ pattern++;
+ repeat:
+ if ((*pattern == '\0') || (*pattern == ']')) {
+ done = TRUE;
+ break;
+ }
+ if (*pattern == '\\') {
+ pattern++;
+ if (*pattern == '\0') {
+ done = TRUE;
+ break;
+ }
+ }
+ if (*(pattern + 1) == '-') {
+ c = *pattern;
+ pattern += 2;
+ if (*pattern == ']') {
+ done = TRUE;
+ break;
+ }
+ if (*pattern == '\\') {
+ pattern++;
+ if (*pattern == '\0') {
+ done = TRUE;
+ break;
+ }
+ }
+ if ((*str < c) || (*str > *pattern)) {
+ pattern++;
+ goto repeat;
+ }
+ } else if (*pattern != *str) {
+ pattern++;
+ goto repeat;
+ }
+ pattern++;
+ while ((*pattern != ']') && (*pattern != '\0')) {
+ if ((*pattern == '\\') && (*(pattern + 1) != '\0'))
+ pattern++;
+ pattern++;
+ }
+ if (*pattern != '\0') {
+ pattern++, str++;
+ }
+ break;
+ case '?':
+ pattern++;
+ str++;
+ break;
+ case OB:
+ pattern++;
+ while ((*pattern != CB) && (*pattern != '\0')) {
+ cp = str;
+ ok = TRUE;
+ while (ok && (*cp != '\0') && (*pattern != '\0')
+ && (*pattern != ',') && (*pattern != CB)) {
+ if (*pattern == '\\')
+ pattern++;
+ ok = (*pattern++ == *cp++);
+ }
+ if (*pattern == '\0') {
+ ok = FALSE;
+ done = TRUE;
+ break;
+ } else if (ok) {
+ str = cp;
+ while ((*pattern != CB) && (*pattern != '\0')) {
+ if (*++pattern == '\\') {
+ if (*++pattern == CB)
+ pattern++;
+ }
+ }
+ } else {
+ while (*pattern!=CB && *pattern!=',' && *pattern!='\0') {
+ if (*++pattern == '\\') {
+ if (*++pattern == CB || *pattern == ',')
+ pattern++;
+ }
+ }
+ }
+ if (*pattern != '\0')
+ pattern++;
+ }
+ break;
+ default:
+ if (*str == *pattern) {
+ str++, pattern++;
+ } else {
+ done = TRUE;
+ }
+ }
+ }
+ while (*pattern == '*')
+ pattern++;
+ return ((*str == '\0') && (*pattern == '\0'));
+};
+
+#endif
+
--- /dev/null
+# needed for unactivated
+NONE =
+
+# define library name
+LIB_TARGET=wx_stubs
+LIB_MAJOR=1
+LIB_MINOR=0
+
+# define library sources
+
+LIB_CPP_SRC=\
+\
+ common/cmndata.cpp \
+ common/config.cpp \
+ common/date.cpp \
+ common/docmdi.cpp \
+ common/docview.cpp \
+ common/dynarray.cpp \
+ common/dynlib.cpp \
+ common/event.cpp \
+ common/file.cpp \
+ common/fileconf.cpp \
+ common/filefn.cpp \
+ common/gdicmn.cpp \
+ common/hash.cpp \
+ common/helpbase.cpp \
+ common/intl.cpp \
+ common/ipcbase.cpp \
+ common/layout.cpp \
+ common/list.cpp \
+ common/log.cpp \
+ common/matrix.cpp \
+ common/memory.cpp \
+ common/module.cpp \
+ common/object.cpp \
+ common/odbc.cpp \
+ common/postscrp.cpp \
+ common/prntbase.cpp \
+ common/resource.cpp \
+ common/serbase.cpp \
+ common/string.cpp \
+ common/textfile.cpp \
+ common/time.cpp \
+ common/timercmn.cpp \
+ common/utilscmn.cpp \
+ common/wincmn.cpp \
+ common/framecmn.cpp \
+ common/stream.cpp \
+ common/datstrm.cpp \
+ common/fstream.cpp \
+ common/mstream.cpp \
+ common/zstream.cpp \
+ common/objstrm.cpp \
+ common/sckstrm.cpp \
+ common/validate.cpp \
+ common/valtext.cpp \
+ common/variant.cpp \
+ common/wxexpr.cpp \
+ common/socket.cpp \
+ common/sckaddr.cpp \
+ common/sckipc.cpp \
+ common/protocol.cpp \
+ common/ftp.cpp \
+ common/http.cpp \
+ common/url.cpp \
+ common/tokenzr.cpp \
+\
+ stubs/accel.cpp \
+ stubs/app.cpp \
+ stubs/bitmap.cpp \
+ stubs/bmpbuttn.cpp \
+ stubs/brush.cpp \
+ stubs/button.cpp \
+ stubs/checkbox.cpp \
+ stubs/choice.cpp \
+ stubs/clipbrd.cpp \
+ stubs/colour.cpp \
+ stubs/colordlg.cpp \
+ stubs/control.cpp \
+ stubs/combobox.cpp \
+ stubs/cursor.cpp \
+ stubs/data.cpp \
+ stubs/dc.cpp \
+ stubs/dcclient.cpp \
+ stubs/dcmemory.cpp \
+ stubs/dcscreen.cpp \
+ stubs/dialog.cpp \
+ stubs/dirdlg.cpp \
+ stubs/dnd.cpp \
+ stubs/filedlg.cpp \
+ stubs/font.cpp \
+ stubs/fontdlg.cpp \
+ stubs/frame.cpp \
+ stubs/gauge.cpp \
+ stubs/gdiobj.cpp \
+ stubs/helpxxxx.cpp \
+ stubs/icon.cpp \
+ stubs/imaglist.cpp \
+ stubs/listbox.cpp \
+ stubs/joystick.cpp \
+ stubs/main.cpp \
+ stubs/mdi.cpp \
+ stubs/menu.cpp \
+ stubs/menuitem.cpp \
+ stubs/metafile.cpp \
+ stubs/minifram.cpp \
+ stubs/msgdlg.cpp \
+ stubs/notebook.cpp \
+ stubs/palette.cpp \
+ stubs/pen.cpp \
+ stubs/print.cpp \
+ stubs/radiobox.cpp \
+ stubs/radiobut.cpp \
+ stubs/region.cpp \
+ stubs/scrolbar.cpp \
+ stubs/settings.cpp \
+ stubs/slider.cpp \
+ stubs/spinbutt.cpp \
+ stubs/statbox.cpp \
+ stubs/statbmp.cpp \
+ stubs/stattext.cpp \
+ stubs/statusbr.cpp \
+ stubs/taskbar.cpp \
+ stubs/textctrl.cpp \
+ stubs/thread.cpp \
+ stubs/timer.cpp \
+ stubs/toolbar.cpp \
+ stubs/treectrl.cpp \
+ stubs/utils.cpp \
+ stubs/utilsexc.cpp \
+ stubs/wave.cpp \
+ stubs/window.cpp \
+\
+ generic/choicdgg.cpp \
+ generic/colrdlgg.cpp \
+ generic/fontdlgg.cpp \
+ generic/gridg.cpp \
+ generic/imaglist.cpp \
+ generic/listctrl.cpp \
+ generic/laywin.cpp \
+ generic/msgdlgg.cpp \
+ generic/panelg.cpp \
+ generic/printps.cpp \
+ generic/prntdlgg.cpp \
+ generic/sashwin.cpp \
+ generic/scrolwin.cpp \
+ generic/splitter.cpp \
+ generic/statusbr.cpp \
+ generic/tabg.cpp \
+ generic/textdlgg.cpp \
+ generic/treectrl.cpp
+
+
+LIB_C_SRC=\
+ common/extended.c \
+ png/png.c \
+ png/pngset.c \
+ png/pngget.c \
+ png/pngrutil.c \
+ png/pngtrans.c \
+ png/pngwutil.c \
+ png/pngread.c \
+ png/pngrio.c \
+ png/pngwio.c \
+ png/pngwrite.c \
+ png/pngrtran.c \
+ png/pngwtran.c \
+ png/pngmem.c \
+ png/pngerror.c \
+ png/pngpread.c \
+\
+ zlib/adler32.c \
+ zlib/compress.c \
+ zlib/crc32.c \
+ zlib/gzio.c \
+ zlib/uncompr.c \
+ zlib/deflate.c \
+ zlib/trees.c \
+ zlib/zutil.c \
+ zlib/inflate.c \
+ zlib/infblock.c \
+ zlib/inftrees.c \
+ zlib/infcodes.c \
+ zlib/infutil.c \
+ zlib/inffast.c \
+\
+ iodbc/dlf.c \
+ iodbc/dlproc.c \
+ iodbc/herr.c \
+ iodbc/henv.c \
+ iodbc/hdbc.c \
+ iodbc/hstmt.c \
+ iodbc/connect.c \
+ iodbc/prepare.c \
+ iodbc/result.c \
+ iodbc/execute.c \
+ iodbc/fetch.c \
+ iodbc/info.c \
+ iodbc/catalog.c \
+ iodbc/misc.c \
+ iodbc/itrace.c
wxDeleteStockObjects() ;
// Destroy all GDI lists, etc.
+
delete wxTheBrushList;
wxTheBrushList = NULL;
delete[] wxBuffer;
wxBuffer = NULL;
+ wxClassInfo::CleanUpClasses();
+
+ // do it as the very last thing because everything else can log messages
+ wxLog::DontCreateOnDemand();
// do it as the very last thing because everything else can log messages
delete wxLog::SetActiveTarget(NULL);
}
int retValue = 0;
if (wxTheApp->Initialized()) retValue = wxTheApp->OnRun();
+
+ if (wxTheApp->GetTopWindow())
+ {
+ delete wxTheApp->GetTopWindow();
+ wxTheApp->SetTopWindow(NULL);
+ }
wxTheApp->DeletePendingObjects();
wxTheApp->OnExit();
wxApp::CommonCleanUp();
+
+ delete wxTheApp;
+ wxTheApp = NULL;
#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
// At this point we want to check if there are any memory
Refresh();
}
+void wxDialog::Fit()
+{
+}
wxDropSource::wxDropSource( wxWindow *win )
{
// TODO
- m_window = win;
+ // m_window = win;
m_data = NULL;
- m_defaultCursor = wxCursor( wxCURSOR_NO_ENTRY );
- m_goaheadCursor = wxCursor( wxCURSOR_HAND );
+ // m_defaultCursor = wxCursor( wxCURSOR_NO_ENTRY );
+ // m_goaheadCursor = wxCursor( wxCURSOR_HAND );
};
wxDropSource::wxDropSource( wxDataObject &data, wxWindow *win )
{
// TODO
- m_window = win;
+ // m_window = win;
m_data = &data;
- m_defaultCursor = wxCursor( wxCURSOR_NO_ENTRY );
- m_goaheadCursor = wxCursor( wxCURSOR_HAND );
+ // m_defaultCursor = wxCursor( wxCURSOR_NO_ENTRY );
+ // m_goaheadCursor = wxCursor( wxCURSOR_HAND );
};
void wxDropSource::SetData( wxDataObject &data )
--- /dev/null
+#
+# File: makefile.unx
+# Author: Julian Smart
+# Created: 1998
+# Updated:
+# Copyright: (c) 1998
+#
+#
+# Makefile for wxStubs library, Unix
+
+EXTRACFLAGS=-DLEX_SCANNER
+
+include ../make.env
+
+LIB_CPP_SRC=\
+\
+ ../common/cmndata.cpp \
+ ../common/config.cpp \
+ ../common/date.cpp \
+ ../common/docmdi.cpp \
+ ../common/docview.cpp \
+ ../common/dynarray.cpp \
+ ../common/dynlib.cpp \
+ ../common/event.cpp \
+ ../common/file.cpp \
+ ../common/fileconf.cpp \
+ ../common/filefn.cpp \
+ ../common/gdicmn.cpp \
+ ../common/hash.cpp \
+ ../common/helpbase.cpp \
+ ../common/intl.cpp \
+ ../common/ipcbase.cpp \
+ ../common/layout.cpp \
+ ../common/list.cpp \
+ ../common/log.cpp \
+ ../common/matrix.cpp \
+ ../common/memory.cpp \
+ ../common/module.cpp \
+ ../common/object.cpp \
+ ../common/odbc.cpp \
+ ../common/postscrp.cpp \
+ ../common/prntbase.cpp \
+ ../common/resource.cpp \
+ ../common/serbase.cpp \
+ ../common/string.cpp \
+ ../common/textfile.cpp \
+ ../common/tbarbase.cpp \
+ ../common/tbarsmpl.cpp \
+ ../common/timercmn.cpp \
+ ../common/utilscmn.cpp \
+ ../common/wincmn.cpp \
+ ../common/framecmn.cpp \
+ ../common/stream.cpp \
+ ../common/datstrm.cpp \
+ ../common/fstream.cpp \
+ ../common/mstream.cpp \
+ ../common/zstream.cpp \
+ ../common/objstrm.cpp \
+ ../common/sckstrm.cpp \
+ ../common/validate.cpp \
+ ../common/valtext.cpp \
+ ../common/variant.cpp \
+ ../common/wxexpr.cpp \
+ ../common/socket.cpp \
+ ../common/sckaddr.cpp \
+ ../common/sckipc.cpp \
+ ../common/protocol.cpp \
+ ../common/ftp.cpp \
+ ../common/http.cpp \
+ ../common/url.cpp \
+ ../common/tokenzr.cpp \
+\
+ accel.cpp \
+ app.cpp \
+ bitmap.cpp \
+ bmpbuttn.cpp \
+ brush.cpp \
+ button.cpp \
+ checkbox.cpp \
+ choice.cpp \
+ clipbrd.cpp \
+ colour.cpp \
+ colordlg.cpp \
+ control.cpp \
+ combobox.cpp \
+ cursor.cpp \
+ data.cpp \
+ dc.cpp \
+ dcclient.cpp \
+ dcmemory.cpp \
+ dcscreen.cpp \
+ dialog.cpp \
+ dirdlg.cpp \
+ dnd.cpp \
+ filedlg.cpp \
+ font.cpp \
+ fontdlg.cpp \
+ frame.cpp \
+ gauge.cpp \
+ gdiobj.cpp \
+ helpxxxx.cpp \
+ icon.cpp \
+ listbox.cpp \
+ joystick.cpp \
+ main.cpp \
+ mdi.cpp \
+ menu.cpp \
+ menuitem.cpp \
+ metafile.cpp \
+ minifram.cpp \
+ msgdlg.cpp \
+ notebook.cpp \
+ palette.cpp \
+ pen.cpp \
+ print.cpp \
+ radiobox.cpp \
+ radiobut.cpp \
+ region.cpp \
+ scrolbar.cpp \
+ settings.cpp \
+ slider.cpp \
+ spinbutt.cpp \
+ statbox.cpp \
+ statbmp.cpp \
+ stattext.cpp \
+ taskbar.cpp \
+ textctrl.cpp \
+ thread.cpp \
+ timer.cpp \
+ toolbar.cpp \
+ utils.cpp \
+ utilsexc.cpp \
+ wave.cpp \
+ window.cpp \
+\
+ ../generic/choicdgg.cpp \
+ ../generic/colrdlgg.cpp \
+ ../generic/fontdlgg.cpp \
+ ../generic/gridg.cpp \
+ ../generic/imaglist.cpp \
+ ../generic/listctrl.cpp \
+ ../generic/laywin.cpp \
+ ../generic/msgdlgg.cpp \
+ ../generic/panelg.cpp \
+ ../generic/printps.cpp \
+ ../generic/prntdlgg.cpp \
+ ../generic/sashwin.cpp \
+ ../generic/scrolwin.cpp \
+ ../generic/splitter.cpp \
+ ../generic/statusbr.cpp \
+ ../generic/tabg.cpp \
+ ../generic/textdlgg.cpp \
+ ../generic/treectrl.cpp
+
+# If you're not using the generic ones, you
+# may wish to define platform-specific ones
+# treectrl.cpp \
+# listctrl.cpp \
+# imaglist.cpp \
+# statusbr.cpp \
+
+LIB_C_SRC=\
+\
+ ../common/y_tab.c \
+ ../common/extended.c
+
+all: $(WXLIB)
+
+# Define library objects
+OBJECTS=\
+ $(LIB_CPP_SRC:.cpp=.o) $(LIB_C_SRC:.c=.o)
+
+$(WXLIB) : $(OBJECTS)
+ ar $(AROPTIONS) $@ $(OBJECTS)
+ $(RANLIB) $@
+
+../common/y_tab.$(OBJSUFF): ../common/y_tab.c ../common/lex_yy.c
+ $(CCLEX) -c $(CFLAGS) -o $@ ../common/y_tab.c
+
+# Replace lex with flex if you run into compilation
+# problems with lex_yy.c. See also note about LEX_SCANNER
+# above.
+../common/lex_yy.c: ../common/lexer.l
+ $(LEX) -o../common/lex.yy.c ../common/lexer.l
+ sed -e "s/BUFSIZ/5000/g" < ../common/lex.yy.c | \
+ sed -e "s/yyoutput(c)/void yyoutput(c)/g" | \
+ sed -e "s/YYLMAX 200/YYLMAX 5000/g" > ../common/lex_yy.c
+ /bin/rm -f ../common/lex.yy.c
+
+# Replace yacc with bison if you run into compilation
+# problems with y_tab.c.
+../common/y_tab.c: ../common/parser.y
+ $(YACC) ../common/parser.y
+ mv y.tab.c ../common/y_tab.c
+
+
+clean:
+ rm -f $(OBJECTS) $(WXLIB)
+
int w, h;
GetSize(&w, &h);
- uint nCount = m_aPages.Count();
- for ( uint nPage = 0; nPage < nCount; nPage++ ) {
+ unsigned int nCount = m_aPages.Count();
+ for ( unsigned int nPage = 0; nPage < nCount; nPage++ ) {
wxNotebookPage *pPage = m_aPages[nPage];
pPage->SetSize(0, 0, w, h);
if ( pPage->GetAutoLayout() )
bool wxPrinter::PrintDialog(wxWindow *parent)
{
- wxPrintDialog dialog(parent, & printData);
+ wxPrintDialog dialog(parent, & m_printData);
return (dialog.ShowModal() == wxID_OK);
}
bool wxPrinter::Setup(wxWindow *parent)
{
- wxPrintDialog dialog(parent, & printData);
+ wxPrintDialog dialog(parent, & m_printData);
dialog.GetPrintData().SetSetupDialog(TRUE);
return (dialog.ShowModal() == wxID_OK);
}
bool wxPrintPreview::Print(bool interactive)
{
- if (!printPrintout)
+ if (!m_printPrintout)
return FALSE;
- wxPrinter printer(&printData);
- return printer.Print(previewFrame, printPrintout, interactive);
+ wxPrinter printer(&m_printData);
+ return printer.Print(m_previewFrame, m_printPrintout, interactive);
}
void wxPrintPreview::DetermineScaling()
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxSlider, wxControl)
+
+BEGIN_EVENT_TABLE(wxSlider, wxControl)
+END_EVENT_TABLE()
#endif
+
+
// Slider
wxSlider::wxSlider()
{
IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl, wxControl)
BEGIN_EVENT_TABLE(wxTextCtrl, wxControl)
- EVT_CHAR(wxTextCtrl::OnChar)
EVT_DROP_FILES(wxTextCtrl::OnDropFiles)
- EVT_ERASE_BACKGROUND(wxTextCtrl::OnEraseBackground)
END_EVENT_TABLE()
#endif