#pragma interface "datstrm.h"
#endif
-#include <wx/stream.h>
+#include "wx/stream.h"
#if wxUSE_STREAMS
# pragma interface
#endif
-#include <wx/setup.h>
+#include "wx/setup.h"
#if wxUSE_DYNLIB_CLASS
-#include <wx/string.h>
-#include <wx/list.h>
-#include <wx/hash.h>
+#include "wx/string.h"
+#include "wx/list.h"
+#include "wx/hash.h"
// this is normally done by configure, but I leave it here for now...
#if defined(__UNIX__) && !(defined(HAVE_DLOPEN) || defined(HAVE_SHL_LOAD))
#pragma interface "filefn.h"
#endif
-#include <wx/list.h>
+#include "wx/list.h"
// ----------------------------------------------------------------------------
// constants
#pragma implementation
#endif
-#include <wx/wxprec.h>
+#include "wx/wxprec.h"
#ifdef __BORDLANDC__
#pragma hdrstop
#if wxUSE_FS_INET && wxUSE_STREAMS && wxUSE_SOCKETS
#ifndef WXPRECOMP
-#include <wx/wx.h>
+#include "wx/wx.h"
#endif
-#include <wx/filesys.h>
-
+#include "wx/filesys.h"
//--------------------------------------------------------------------------------
#pragma implementation
#endif
-#include <wx/wxprec.h>
+#include "wx/wxprec.h"
#ifdef __BORDLANDC__
#pragma hdrstop
#ifndef WXPRECOMP
-#include <wx/wx.h>
+#include "wx/wx.h"
#endif
-#include <wx/filesys.h>
-
-
+#include "wx/filesys.h"
//--------------------------------------------------------------------------------
// wxZipFSHandler
void OnNavigationKey(wxNavigationKeyEvent& event);
+ // overridden from wxWindow to make tabbing work
+ void SetFocus();
+
// implementation
void SetConstraintSizes(bool recurse);
void OnNavigationKey(wxNavigationKeyEvent& event);
+ // overridden from wxWindow to make tabbing work
+ void SetFocus();
+
// implementation
void SetConstraintSizes(bool recurse);
#ifndef _WX_WXMMSTREAM_H__
#define _WX_WXMMSTREAM_H__
-#include <wx/stream.h>
+#include "wx/stream.h"
#if wxUSE_STREAMS
#ifndef _WX_WX_SERBASEH_H__
#define _WX_WX_SERBASEH_H__
-#include <wx/setup.h>
-#include <wx/dynlib.h>
+#include "wx/setup.h"
+#include "wx/dynlib.h"
#define WXSERIAL(classname) classname##_Serialize
// wxSocket headers (generic)
// ---------------------------------------------------------------------------
#ifdef WXPREC
-# include <wx/wxprec.h>
+# include "wx/wxprec.h"
#else
-# include <wx/event.h>
-# include <wx/string.h>
+# include "wx/event.h"
+# include "wx/string.h"
#endif
-#include <wx/sckaddr.h>
+#include "wx/sckaddr.h"
#include "wx/gsocket.h"
class WXDLLEXPORT wxTimer;
#else // !wxUSE_THREADS
-#include <wx/defs.h> // for WXDLLEXPORT
+#include "wx/defs.h" // for WXDLLEXPORT
// no thread support
inline void WXDLLEXPORT wxMutexGuiEnter() { }
#pragma interface "txtstrm.h"
#endif
-#include <wx/stream.h>
+#include "wx/stream.h"
#if wxUSE_STREAMS
wxOutputStream *m_output;
};
+wxTextOutputStream &endl( wxTextOutputStream &stream );
+
#endif
// wxUSE_STREAMS
#if wxUSE_STREAMS && wxUSE_FILE
-#include <wx/object.h>
-#include <wx/string.h>
-#include <wx/stream.h>
-#include <wx/file.h>
+#include "wx/object.h"
+#include "wx/string.h"
+#include "wx/stream.h"
+#include "wx/file.h"
class wxFileInputStream: public wxInputStream {
public:
#if wxUSE_ZLIB && wxUSE_STREAMS
-#include <wx/stream.h>
+#include "wx/stream.h"
class WXDLLEXPORT wxZlibInputStream: public wxFilterInputStream {
public:
button->SetToolTip( "Press here to set italic font" );
#endif // wxUSE_TOOLTIPS
- m_checkbox = new wxCheckBox( panel, ID_LISTBOX_ENABLE, "&Disable", wxPoint(20,130), wxSize(-1, -1), wxALIGN_RIGHT );
+ m_checkbox = new wxCheckBox( panel, ID_LISTBOX_ENABLE, "&Disable", wxPoint(20,130) );
m_checkbox->SetValue(FALSE);
#if wxUSE_TOOLTIPS
m_checkbox->SetToolTip( "Click here to disable the listbox" );
void MyFrame::FileSave(wxCommandEvent& WXUNUSED(event) )
{
- wxFileDialog dialog(this, "Testing save file dialog", "", "",
+ wxFileDialog dialog(this, "Testing save file dialog", "", "myletter.txt",
"Text files (*.txt)|*.txt|Document files (*.doc)|*.doc",
wxSAVE|wxOVERWRITE_PROMPT);
{
wxCHECK_RET( Ok(), _T("invalid image") );
- memcpy(M_IMGDATA->m_data, data, M_IMGDATA->m_width * M_IMGDATA->m_height * 3);
+ wxImageRefData *newRefData = new wxImageRefData();
+
+ newRefData->m_width = M_IMGDATA->m_width;
+ newRefData->m_height = M_IMGDATA->m_height;
+ newRefData->m_data = data;
+ newRefData->m_ok = TRUE;
+ newRefData->m_maskRed = M_IMGDATA->m_maskRed;
+ newRefData->m_maskGreen = M_IMGDATA->m_maskGreen;
+ newRefData->m_maskBlue = M_IMGDATA->m_maskBlue;
+ newRefData->m_hasMask = M_IMGDATA->m_hasMask;
+
+ UnRef();
+
+ m_refData = newRefData;
}
void wxImage::SetMaskColour( unsigned char r, unsigned char g, unsigned char b )
#include "wx/intl.h"
#include "wx/file.h"
#include "wx/log.h"
+#include "wx/debug.h"
#include "wx/utils.h"
#include <stdlib.h>
// not yet be loaded (and it's normal)
//
// (we're using an object because we have several return paths)
+
NoTransErr noTransErr;
+// Then why do you translate at all? Just use _T() and not _(). RR.
wxLogVerbose(_("looking for catalog '%s' in path '%s'."),
- szName, searchPath.c_str());
+ szName.c_str, searchPath.c_str());
wxString strFullName;
if ( !wxFindFileInPath(&strFullName, searchPath, strFile) ) {
- wxLogWarning(_("catalog file for domain '%s' not found."), szName);
+ wxLogWarning(_("catalog file for domain '%s' not found."), szName.c_str());
return FALSE;
}
// open file
wxLogVerbose(_("using catalog '%s' from '%s'."),
- szName, strFullName.c_str());
+ szName.c_str(), strFullName.c_str());
wxFile fileMsg(strFullName);
if ( !fileMsg.IsOpened() )
return *this;
}
+wxTextOutputStream &endl( wxTextOutputStream &stream )
+{
+ return stream << _T('\n');
+}
+
#endif
// wxUSE_STREAMS
mainsizer->SetSizeHints( this );
Centre( wxBOTH );
-
- m_list->SetFocus();
+
+ if (m_fileName.IsEmpty())
+ m_list->SetFocus();
+ else
+ m_text->SetFocus();
wxEndBusyCursor();
}
return;
}
+ if (filename == _T("~"))
+ {
+ m_list->GoToHomeDir();
+ m_list->SetFocus();
+ m_list->GetDir( dir );
+ m_static->SetLabel( dir );
+ return;
+ }
+
+ if (filename[0] == _T('~'))
+ {
+ filename.Remove( 0, 1 );
+ wxString tmp( wxGetUserHome() );
+ tmp += _T('/');
+ tmp += filename;
+ filename = tmp;
+ }
+
if ((filename.Find(_T('*')) != wxNOT_FOUND) ||
(filename.Find(_T('?')) != wxNOT_FOUND))
{
}
if (dir != _T("/")) dir += _T("/");
- dir += filename;
- filename = dir;
+ if (filename[0] != _T('/'))
+ {
+ dir += filename;
+ filename = dir;
+ }
if (wxDirExists(filename))
{
m_list->GoToDir( filename );
- m_text->SetValue( _T("..") );
+ if (filename == _T("/"))
+ m_text->SetValue( _T("") );
+ else
+ m_text->SetValue( _T("..") );
m_list->GetDir( dir );
m_static->SetLabel( dir );
return;
#pragma hdrstop
#endif
-#include <wx/string.h>
-#include <wx/log.h>
-#include <wx/settings.h>
-#include <wx/generic/imaglist.h>
-#include <wx/notebook.h>
-#include <wx/dcclient.h>
+#include "wx/string.h"
+#include "wx/log.h"
+#include "wx/settings.h"
+#include "wx/generic/imaglist.h"
+#include "wx/notebook.h"
+#include "wx/dcclient.h"
// ----------------------------------------------------------------------------
// macros
wxWindow *winFocus = event.GetCurrentFocus();
if (!winFocus)
winFocus = wxWindow::FindFocus();
-
+
if (!winFocus)
{
event.Skip();
// so give them the chance to process it instead of looping inside
// this panel (normally, the focus will go to the next/previous
// item after this panel in the parent panel)
+ wxWindow *focussed_child_of_p = this;
for ( wxWindow *p = GetParent(); p; p = p->GetParent() )
{
if ( wxDynamicCast(p, wxPanel) )
{
- event.Skip();
-
- return;
+ event.SetCurrentFocus( focussed_child_of_p );
+ if (p->GetEventHandler()->ProcessEvent( event ))
+ return;
}
+ focussed_child_of_p = p;
}
// no, we are not inside another panel so process this ourself
if (win->GetAutoLayout()) win->Layout();
}
-//-----------------------------------------------------------------------------
-// "key_press_event"
-//-----------------------------------------------------------------------------
-
-static gint
-gtk_notebook_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxNotebook *notebook )
-{
- if (g_isIdle) wxapp_install_idle_handler();
-
- if (g_blockEventsOnDrag) return FALSE;
-
- if (!notebook->m_hasVMT) return FALSE;
-
- /* this code makes jumping down from the handles of the notebooks
- to the actual items in the visible notebook page possible with
- the down-arrow key */
-
- if (gdk_event->keyval != GDK_Down) return FALSE;
-
- if (notebook != notebook->FindFocus()) return FALSE;
-
- if (notebook->m_pages.GetCount() == 0) return FALSE;
-
- wxNode *node = notebook->m_pages.Nth( notebook->GetSelection() );
-
- if (!node) return FALSE;
-
- wxNotebookPage *page = (wxNotebookPage*) node->Data();
-
- // don't let others the key event
- gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "key_press_event" );
-
- page->m_client->SetFocus();
-
- return TRUE;
-}
-
//-----------------------------------------------------------------------------
// InsertChild callback for wxNotebook
//-----------------------------------------------------------------------------
m_parent->DoAddChild( this );
- gtk_signal_connect( GTK_OBJECT(m_widget), "key_press_event",
- GTK_SIGNAL_FUNC(gtk_notebook_key_press_callback), (gpointer)this );
-
PostCreation();
Show( TRUE );
return TRUE;
}
+void wxNotebook::SetFocus()
+{
+ if (m_pages.GetCount() == 0) return;
+
+ wxNode *node = m_pages.Nth( GetSelection() );
+
+ if (!node) return;
+
+ wxNotebookPage *page = (wxNotebookPage*) node->Data();
+
+ page->m_client->SetFocus();
+}
+
int wxNotebook::GetSelection() const
{
wxCHECK_MSG( m_widget != NULL, -1, _T("invalid notebook") );
if (nb_page)
return nb_page->m_text;
else
- return "";
+ return _T("");
}
int wxNotebook::GetPageImage( int page ) const
return TRUE;
}
-wxString wxStaticText::GetLabel(void) const
+wxString wxStaticText::GetLabel() const
{
char *str = (char *) NULL;
gtk_label_get( GTK_LABEL(m_widget), &str );
ret = (ret || win->GetEventHandler()->ProcessEvent( event2 ));
}
-
/* win is a control: tab can be propagated up */
if ( (!ret) &&
((gdk_event->keyval == GDK_Tab) || (gdk_event->keyval == GDK_ISO_Left_Tab)) &&
if (win->GetAutoLayout()) win->Layout();
}
-//-----------------------------------------------------------------------------
-// "key_press_event"
-//-----------------------------------------------------------------------------
-
-static gint
-gtk_notebook_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxNotebook *notebook )
-{
- if (g_isIdle) wxapp_install_idle_handler();
-
- if (g_blockEventsOnDrag) return FALSE;
-
- if (!notebook->m_hasVMT) return FALSE;
-
- /* this code makes jumping down from the handles of the notebooks
- to the actual items in the visible notebook page possible with
- the down-arrow key */
-
- if (gdk_event->keyval != GDK_Down) return FALSE;
-
- if (notebook != notebook->FindFocus()) return FALSE;
-
- if (notebook->m_pages.GetCount() == 0) return FALSE;
-
- wxNode *node = notebook->m_pages.Nth( notebook->GetSelection() );
-
- if (!node) return FALSE;
-
- wxNotebookPage *page = (wxNotebookPage*) node->Data();
-
- // don't let others the key event
- gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "key_press_event" );
-
- page->m_client->SetFocus();
-
- return TRUE;
-}
-
//-----------------------------------------------------------------------------
// InsertChild callback for wxNotebook
//-----------------------------------------------------------------------------
m_parent->DoAddChild( this );
- gtk_signal_connect( GTK_OBJECT(m_widget), "key_press_event",
- GTK_SIGNAL_FUNC(gtk_notebook_key_press_callback), (gpointer)this );
-
PostCreation();
Show( TRUE );
return TRUE;
}
+void wxNotebook::SetFocus()
+{
+ if (m_pages.GetCount() == 0) return;
+
+ wxNode *node = m_pages.Nth( GetSelection() );
+
+ if (!node) return;
+
+ wxNotebookPage *page = (wxNotebookPage*) node->Data();
+
+ page->m_client->SetFocus();
+}
+
int wxNotebook::GetSelection() const
{
wxCHECK_MSG( m_widget != NULL, -1, _T("invalid notebook") );
if (nb_page)
return nb_page->m_text;
else
- return "";
+ return _T("");
}
int wxNotebook::GetPageImage( int page ) const
return TRUE;
}
-wxString wxStaticText::GetLabel(void) const
+wxString wxStaticText::GetLabel() const
{
char *str = (char *) NULL;
gtk_label_get( GTK_LABEL(m_widget), &str );
ret = (ret || win->GetEventHandler()->ProcessEvent( event2 ));
}
-
/* win is a control: tab can be propagated up */
if ( (!ret) &&
((gdk_event->keyval == GDK_Tab) || (gdk_event->keyval == GDK_ISO_Left_Tab)) &&