mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-09-22 06:05:36 +08:00
Include wx/intl.h according to precompiled headers of wx/wx.h (with other minor cleaning).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38909 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: config.cpp
|
||||
// Name: src/common/config.cpp
|
||||
// Purpose: implementation of wxConfigBase class
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif //__BORLANDC__
|
||||
|
||||
#ifndef wxUSE_CONFIG_NATIVE
|
||||
@@ -25,7 +25,11 @@
|
||||
#endif
|
||||
|
||||
#include "wx/config.h"
|
||||
#include "wx/intl.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/intl.h"
|
||||
#endif //WX_PRECOMP
|
||||
|
||||
#include "wx/log.h"
|
||||
#include "wx/arrstr.h"
|
||||
|
||||
@@ -447,5 +451,3 @@ void wxSplitPath(wxArrayString& aParts, const wxChar *sz)
|
||||
pc++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
+28
-26
@@ -68,9 +68,9 @@
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/string.h"
|
||||
#include "wx/log.h"
|
||||
#include "wx/intl.h"
|
||||
#endif // WX_PRECOMP
|
||||
|
||||
#include "wx/intl.h"
|
||||
#include "wx/thread.h"
|
||||
#include "wx/tokenzr.h"
|
||||
#include "wx/module.h"
|
||||
@@ -2403,40 +2403,42 @@ wxString wxDateTime::Format(const wxChar *format, const TimeZone& tz) const
|
||||
{
|
||||
nLostWeekDays += year++ % 4 ? 1 : 2;
|
||||
}
|
||||
|
||||
// Keep year below 2000 so the 2digit year number
|
||||
// can never match the month or day of the month
|
||||
if (year>=2000) year-=28;
|
||||
|
||||
// Keep year below 2000 so the 2digit year number
|
||||
// can never match the month or day of the month
|
||||
if (year>=2000) year-=28;
|
||||
// at any rate, we couldn't go further than 1988 + 9 + 28!
|
||||
wxASSERT_MSG( year < 2030,
|
||||
_T("logic error in wxDateTime::Format") );
|
||||
|
||||
wxString strYear, strYear2;
|
||||
wxString strYear, strYear2;
|
||||
strYear.Printf(_T("%d"), year);
|
||||
strYear2.Printf(_T("%d"), year % 100);
|
||||
|
||||
|
||||
// find four strings not occurring in format (this is surely
|
||||
// not the optimal way of doing it... improvements welcome!)
|
||||
wxString fmt2 = format;
|
||||
wxString replacement,replacement2,replacement3,replacement4;
|
||||
for (int rnr=1; rnr<5 ; rnr++) {
|
||||
wxString r = (wxChar)-rnr;
|
||||
while ( fmt2.Find(r) != wxNOT_FOUND )
|
||||
{
|
||||
r << (wxChar)-rnr;
|
||||
}
|
||||
wxString replacement,replacement2,replacement3,replacement4;
|
||||
for (int rnr=1; rnr<5 ; rnr++)
|
||||
{
|
||||
wxString r = (wxChar)-rnr;
|
||||
while ( fmt2.Find(r) != wxNOT_FOUND )
|
||||
{
|
||||
r << (wxChar)-rnr;
|
||||
}
|
||||
|
||||
switch (rnr) {
|
||||
case 1: replacement=r; break;
|
||||
case 2: replacement2=r; break;
|
||||
case 3: replacement3=r; break;
|
||||
case 4: replacement4=r; break;
|
||||
}
|
||||
}
|
||||
switch (rnr)
|
||||
{
|
||||
case 1: replacement=r; break;
|
||||
case 2: replacement2=r; break;
|
||||
case 3: replacement3=r; break;
|
||||
case 4: replacement4=r; break;
|
||||
}
|
||||
}
|
||||
// replace all occurrences of year with it
|
||||
bool wasReplaced = fmt2.Replace(strYear, replacement) > 0;
|
||||
// evaluation order ensures we always attempt the replacement.
|
||||
wasReplaced = (fmt2.Replace(strYear2, replacement2) > 0) | wasReplaced ;
|
||||
wasReplaced = (fmt2.Replace(strYear2, replacement2) > 0) | wasReplaced ;
|
||||
|
||||
// use strftime() to format the same date but in supported
|
||||
// year
|
||||
@@ -2461,10 +2463,10 @@ wxString wxDateTime::Format(const wxChar *format, const TimeZone& tz) const
|
||||
&tmAdjusted);
|
||||
|
||||
// now replace the occurrence of 1999 with the real year
|
||||
// we do this in two stages to stop the 2 digit year
|
||||
// matching any substring of the 4 digit year.
|
||||
// Any day,month hours and minutes components should be safe due
|
||||
// to ensuring the range of the years.
|
||||
// we do this in two stages to stop the 2 digit year
|
||||
// matching any substring of the 4 digit year.
|
||||
// Any day,month hours and minutes components should be safe due
|
||||
// to ensuring the range of the years.
|
||||
wxString strYearReal, strYearReal2;
|
||||
strYearReal.Printf(_T("%04d"), yearReal);
|
||||
strYearReal2.Printf(_T("%02d"), yearReal % 100);
|
||||
|
||||
@@ -22,10 +22,9 @@
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/dynarray.h"
|
||||
#include "wx/intl.h"
|
||||
#endif //WX_PRECOMP
|
||||
|
||||
#include "wx/intl.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h> // for memmove
|
||||
|
||||
|
||||
@@ -11,17 +11,19 @@
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if wxUSE_IMAGE && wxUSE_LIBJPEG
|
||||
|
||||
#include "wx/imagjpeg.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/log.h"
|
||||
#include "wx/app.h"
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/imagjpeg.h"
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/debug.h"
|
||||
|
||||
@@ -45,7 +47,6 @@ extern "C"
|
||||
|
||||
#include "wx/filefn.h"
|
||||
#include "wx/wfstream.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/module.h"
|
||||
|
||||
// For memcpy
|
||||
|
||||
@@ -11,17 +11,18 @@
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if wxUSE_IMAGE && wxUSE_PNM
|
||||
|
||||
#include "wx/imagpnm.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/log.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/txtstrm.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -16,12 +16,14 @@
|
||||
|
||||
#if wxUSE_IMAGE && wxUSE_LIBTIFF
|
||||
|
||||
#include "wx/imagtiff.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/log.h"
|
||||
#include "wx/app.h"
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/imagtiff.h"
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/debug.h"
|
||||
extern "C"
|
||||
@@ -31,7 +33,6 @@ extern "C"
|
||||
}
|
||||
#include "wx/filefn.h"
|
||||
#include "wx/wfstream.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/module.h"
|
||||
|
||||
#ifndef TIFFLINKAGEMODE
|
||||
|
||||
@@ -27,20 +27,20 @@
|
||||
|
||||
#if wxUSE_MIMETYPE
|
||||
|
||||
#include "wx/mimetype.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/dynarray.h"
|
||||
#include "wx/string.h"
|
||||
#include "wx/intl.h"
|
||||
#endif //WX_PRECOMP
|
||||
|
||||
#include "wx/module.h"
|
||||
#include "wx/log.h"
|
||||
#include "wx/file.h"
|
||||
#include "wx/iconloc.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/confbase.h"
|
||||
|
||||
#include "wx/mimetype.h"
|
||||
|
||||
// other standard headers
|
||||
#include <ctype.h>
|
||||
|
||||
|
||||
@@ -16,12 +16,13 @@
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#include "wx/module.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/hash.h"
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/module.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/log.h"
|
||||
#include "wx/listimpl.cpp"
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include "wx/statbox.h"
|
||||
#include "wx/settings.h"
|
||||
#include "wx/listimpl.cpp"
|
||||
#include "wx/intl.h"
|
||||
|
||||
#if WXWIN_COMPATIBILITY_2_4
|
||||
#include "wx/notebook.h"
|
||||
#endif
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/object.h"
|
||||
#include "wx/string.h"
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/app.h"
|
||||
@@ -35,7 +36,6 @@
|
||||
#include "wx/utils.h"
|
||||
#include "wx/module.h"
|
||||
#include "wx/log.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/event.h"
|
||||
|
||||
#include "wx/sckaddr.h"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: common/stockitem.cpp
|
||||
// Name: src/common/stockitem.cpp
|
||||
// Purpose: Stock buttons, menu and toolbar items labels
|
||||
// Author: Vaclav Slavik
|
||||
// Modified by:
|
||||
@@ -25,7 +25,11 @@
|
||||
#endif
|
||||
|
||||
#include "wx/stockitem.h"
|
||||
#include "wx/intl.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/utils.h" // for wxStripMenuCodes()
|
||||
|
||||
bool wxIsStockID(wxWindowID id)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Name: zstream.cpp
|
||||
// Name: src/common/zstream.cpp
|
||||
// Purpose: Compressed stream classes
|
||||
// Author: Guilhem Lavaux
|
||||
// Modified by: Mike Wetherell
|
||||
@@ -13,14 +13,18 @@
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if wxUSE_ZLIB && wxUSE_STREAMS
|
||||
|
||||
#include "wx/zstream.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/utils.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/log.h"
|
||||
|
||||
// normally, the compiler options should contain -I../zlib, but it is
|
||||
@@ -331,4 +335,3 @@ size_t wxZlibOutputStream::OnSysWrite(const void *buffer, size_t size)
|
||||
|
||||
#endif
|
||||
// wxUSE_ZLIB && wxUSE_STREAMS
|
||||
|
||||
|
||||
@@ -23,17 +23,17 @@
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/sizer.h"
|
||||
#include "wx/checklst.h"
|
||||
#include "wx/textctrl.h"
|
||||
#endif // WX_PRECOMP
|
||||
|
||||
#if wxUSE_DEBUGREPORT && wxUSE_XML
|
||||
|
||||
#include "wx/debugrpt.h"
|
||||
|
||||
#include "wx/intl.h"
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/sizer.h"
|
||||
#include "wx/checklst.h"
|
||||
#include "wx/textctrl.h"
|
||||
#include "wx/intl.h"
|
||||
#endif // WX_PRECOMP
|
||||
|
||||
#include "wx/filename.h"
|
||||
#include "wx/ffile.h"
|
||||
#include "wx/mimetype.h"
|
||||
@@ -512,4 +512,4 @@ bool wxDebugReportPreviewStd::Show(wxDebugReport& dbgrpt) const
|
||||
return dlg.ShowModal() == wxID_OK && dbgrpt.GetFilesCount() != 0;
|
||||
}
|
||||
|
||||
#endif // wxUSE_DEBUGREPORT
|
||||
#endif // wxUSE_DEBUGREPORT && wxUSE_XML
|
||||
|
||||
+10
-16
@@ -15,20 +15,19 @@
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if wxUSE_PRINTING_ARCHITECTURE && wxUSE_POSTSCRIPT
|
||||
|
||||
#include "wx/generic/dcpsg.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/intl.h"
|
||||
#endif // WX_PRECOMP
|
||||
|
||||
#if wxUSE_PRINTING_ARCHITECTURE
|
||||
|
||||
#if wxUSE_POSTSCRIPT
|
||||
|
||||
#include "wx/dcmemory.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/app.h"
|
||||
#include "wx/image.h"
|
||||
#include "wx/log.h"
|
||||
#include "wx/generic/dcpsg.h"
|
||||
#include "wx/prntbase.h"
|
||||
#include "wx/generic/prntdlgg.h"
|
||||
#include "wx/paper.h"
|
||||
@@ -1048,8 +1047,8 @@ void wxPostScriptDC::SetPen( const wxPen& pen )
|
||||
PsPrint( buffer );
|
||||
}
|
||||
PsPrint ("] 0 setdash\n");
|
||||
psdash = 0;
|
||||
}
|
||||
psdash = 0;
|
||||
}
|
||||
break;
|
||||
case wxSOLID:
|
||||
case wxTRANSPARENT:
|
||||
@@ -1258,7 +1257,7 @@ void wxPostScriptDC::DoDrawText( const wxString& text, wxCoord x, wxCoord y )
|
||||
}
|
||||
|
||||
CalcBoundingBox( x, y );
|
||||
CalcBoundingBox( x + size * text.Length() * 2/3 , y );
|
||||
CalcBoundingBox( x + size * text.length() * 2/3 , y );
|
||||
}
|
||||
|
||||
void wxPostScriptDC::DoDrawRotatedText( const wxString& text, wxCoord x, wxCoord y, double angle )
|
||||
@@ -1383,7 +1382,7 @@ void wxPostScriptDC::DoDrawRotatedText( const wxString& text, wxCoord x, wxCoord
|
||||
}
|
||||
|
||||
CalcBoundingBox( x, y );
|
||||
CalcBoundingBox( x + size * text.Length() * 2/3 , y );
|
||||
CalcBoundingBox( x + size * text.length() * 2/3 , y );
|
||||
}
|
||||
|
||||
void wxPostScriptDC::SetBackground (const wxBrush& brush)
|
||||
@@ -2258,11 +2257,6 @@ void wxPostScriptDC::PsPrint( int ch )
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
// wxUSE_POSTSCRIPT
|
||||
|
||||
#endif
|
||||
// wxUSE_PRINTING_ARCHITECTURE
|
||||
|
||||
#endif // wxUSE_PRINTING_ARCHITECTURE && wxUSE_POSTSCRIPT
|
||||
|
||||
// vi:sts=4:sw=4:et
|
||||
|
||||
@@ -18,11 +18,13 @@
|
||||
|
||||
#if wxUSE_DIRDLG || wxUSE_FILEDLG
|
||||
|
||||
#include "wx/generic/dirctrlg.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/hash.h"
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/generic/dirctrlg.h"
|
||||
#include "wx/module.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/button.h"
|
||||
@@ -33,7 +35,6 @@
|
||||
#include "wx/filefn.h"
|
||||
#include "wx/cmndata.h"
|
||||
#include "wx/gdicmn.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/imaglist.h"
|
||||
#include "wx/icon.h"
|
||||
#include "wx/log.h"
|
||||
|
||||
@@ -21,23 +21,23 @@
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if wxUSE_DRAGIMAGE
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include <stdio.h>
|
||||
#include "wx/window.h"
|
||||
#include "wx/frame.h"
|
||||
#include "wx/dcclient.h"
|
||||
#include "wx/dcscreen.h"
|
||||
#include "wx/dcmemory.h"
|
||||
#include "wx/settings.h"
|
||||
#include <stdio.h>
|
||||
#include "wx/window.h"
|
||||
#include "wx/frame.h"
|
||||
#include "wx/dcclient.h"
|
||||
#include "wx/dcscreen.h"
|
||||
#include "wx/dcmemory.h"
|
||||
#include "wx/settings.h"
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/log.h"
|
||||
#include "wx/intl.h"
|
||||
|
||||
#define wxUSE_IMAGE_IN_DRAGIMAGE 1
|
||||
|
||||
|
||||
@@ -23,6 +23,13 @@
|
||||
#error wxGenericFileDialog currently only supports Unix, win32 and DOS
|
||||
#endif
|
||||
|
||||
#include "wx/generic/filedlgg.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/hash.h"
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/checkbox.h"
|
||||
#include "wx/textctrl.h"
|
||||
#include "wx/choice.h"
|
||||
@@ -31,7 +38,6 @@
|
||||
#include "wx/debug.h"
|
||||
#include "wx/log.h"
|
||||
#include "wx/longlong.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/msgdlg.h"
|
||||
#include "wx/sizer.h"
|
||||
#include "wx/bmpbuttn.h"
|
||||
@@ -44,7 +50,6 @@
|
||||
#include "wx/filefn.h"
|
||||
#include "wx/file.h" // for wxS_IXXX constants only
|
||||
#include "wx/filedlg.h" // wxOPEN, wxSAVE...
|
||||
#include "wx/generic/filedlgg.h"
|
||||
#include "wx/generic/dirctrlg.h" // for wxFileIconsTable
|
||||
|
||||
#if wxUSE_TOOLTIPS
|
||||
|
||||
+16
-12
@@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: app.cpp
|
||||
// Name: src/gtk/app.cpp
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Id: $Id$
|
||||
@@ -17,9 +17,13 @@
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#include "wx/app.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/gdicmn.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/log.h"
|
||||
#include "wx/memory.h"
|
||||
#include "wx/font.h"
|
||||
@@ -33,7 +37,7 @@
|
||||
#include "wx/thread.h"
|
||||
|
||||
#ifdef __WXGPE__
|
||||
#include <gpe/init.h>
|
||||
#include <gpe/init.h>
|
||||
#endif
|
||||
|
||||
#ifdef __WXUNIVERSAL__
|
||||
@@ -113,7 +117,7 @@ static wxMutex gs_idleTagsMutex;
|
||||
// not static because used by textctrl.cpp
|
||||
//
|
||||
// MT-FIXME
|
||||
bool wxIsInsideYield = FALSE;
|
||||
bool wxIsInsideYield = false;
|
||||
|
||||
bool wxApp::Yield(bool onlyIfNeeded)
|
||||
{
|
||||
@@ -124,18 +128,18 @@ bool wxApp::Yield(bool onlyIfNeeded)
|
||||
wxFAIL_MSG( wxT("wxYield called recursively" ) );
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
#if wxUSE_THREADS
|
||||
if ( !wxThread::IsMain() )
|
||||
{
|
||||
// can't call gtk_main_iteration() from other threads like this
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
#endif // wxUSE_THREADS
|
||||
|
||||
wxIsInsideYield = TRUE;
|
||||
wxIsInsideYield = true;
|
||||
|
||||
// We need to remove idle callbacks or the loop will
|
||||
// never finish.
|
||||
@@ -163,9 +167,9 @@ bool wxApp::Yield(bool onlyIfNeeded)
|
||||
wxLog::Resume();
|
||||
#endif
|
||||
|
||||
wxIsInsideYield = FALSE;
|
||||
wxIsInsideYield = false;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -483,7 +487,7 @@ bool wxApp::OnInitGui()
|
||||
}
|
||||
|
||||
// Nothing to do for 15, 16, 24, 32 bit displays
|
||||
if (visual->depth > 8) return TRUE;
|
||||
if (visual->depth > 8) return true;
|
||||
|
||||
// initialize color cube for 8-bit color reduction dithering
|
||||
|
||||
@@ -533,7 +537,7 @@ bool wxApp::OnInitGui()
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
GdkVisual *wxApp::GetGdkVisual()
|
||||
@@ -680,7 +684,7 @@ void wxApp::CleanUp()
|
||||
|
||||
void wxApp::OnAssert(const wxChar *file, int line, const wxChar* cond, const wxChar *msg)
|
||||
{
|
||||
m_isInAssert = TRUE;
|
||||
m_isInAssert = true;
|
||||
|
||||
wxAppBase::OnAssert(file, line, cond, msg);
|
||||
|
||||
|
||||
@@ -14,9 +14,12 @@
|
||||
|
||||
#include "wx/combobox.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/settings.h"
|
||||
#include "wx/arrstr.h"
|
||||
#include "wx/intl.h"
|
||||
|
||||
#include "wx/textctrl.h" // for wxEVT_COMMAND_TEXT_UPDATED
|
||||
|
||||
|
||||
+8
-6
@@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dnd.cpp
|
||||
// Name: src/gtk/dnd.cpp
|
||||
// Purpose: wxDropTarget class
|
||||
// Author: Robert Roebling
|
||||
// Id: $Id$
|
||||
@@ -10,16 +10,18 @@
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#include "wx/dnd.h"
|
||||
#include "wx/log.h"
|
||||
|
||||
|
||||
#if wxUSE_DRAG_AND_DROP
|
||||
|
||||
#include "wx/dnd.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/window.h"
|
||||
#include "wx/app.h"
|
||||
#include "wx/gdicmn.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/log.h"
|
||||
#include "wx/utils.h"
|
||||
|
||||
#include "wx/gtk/private.h"
|
||||
|
||||
+4
-1
@@ -14,6 +14,10 @@
|
||||
|
||||
#include "wx/filedlg.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#ifdef __WXGTK24__
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
@@ -21,7 +25,6 @@
|
||||
|
||||
#include <unistd.h> // chdir
|
||||
|
||||
#include "wx/intl.h"
|
||||
#include "wx/filename.h" // wxFilename
|
||||
#include "wx/tokenzr.h" // wxStringTokenizer
|
||||
#include "wx/filefn.h" // ::wxGetCwd
|
||||
|
||||
+7
-7
@@ -10,14 +10,16 @@
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#if wxUSE_FONTDLG
|
||||
|
||||
#ifndef __WXGPE__
|
||||
#if wxUSE_FONTDLG && !defined(__WXGPE__)
|
||||
|
||||
#include "wx/fontdlg.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/fontutil.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/debug.h"
|
||||
#include "wx/msgdlg.h"
|
||||
|
||||
@@ -154,6 +156,4 @@ void wxFontDialog::SetChosenFont(const char *fontname)
|
||||
m_fontData.SetChosenFont(wxFont( wxString::FromAscii(fontname) ));
|
||||
}
|
||||
|
||||
#endif // wxUSE_FONTDLG
|
||||
|
||||
#endif // GPE
|
||||
#endif // wxUSE_FONTDLG && !__WXGPE__
|
||||
|
||||
+3
-2
@@ -13,14 +13,15 @@
|
||||
|
||||
#if wxUSE_LISTBOX
|
||||
|
||||
#include "wx/listbox.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/dynarray.h"
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/listbox.h"
|
||||
#include "wx/arrstr.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/checklst.h"
|
||||
#include "wx/settings.h"
|
||||
#include "wx/log.h"
|
||||
|
||||
+7
-4
@@ -10,14 +10,17 @@
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#include "wx/mdi.h"
|
||||
#include "wx/notebook.h"
|
||||
|
||||
#if wxUSE_MDI
|
||||
|
||||
#include "wx/mdi.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/notebook.h"
|
||||
#include "wx/dialog.h"
|
||||
#include "wx/menu.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/gtk/private.h"
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
+6
-3
@@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: menu.cpp
|
||||
// Name: src/gtk/menu.cpp
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Id: $Id$
|
||||
@@ -11,8 +11,12 @@
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#include "wx/menu.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/log.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/app.h"
|
||||
#include "wx/bitmap.h"
|
||||
|
||||
@@ -1514,4 +1518,3 @@ bool wxWindowGTK::DoPopupMenu( wxMenu *menu, int x, int y )
|
||||
}
|
||||
|
||||
#endif // wxUSE_MENUS_NATIVE
|
||||
|
||||
|
||||
+7
-5
@@ -13,17 +13,20 @@
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if wxUSE_MSGDLG && defined(__WXGTK20__) && !defined(__WXGPE__)
|
||||
|
||||
#include "wx/msgdlg.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/gtk/private.h"
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "wx/intl.h"
|
||||
|
||||
IMPLEMENT_CLASS(wxMessageDialog, wxDialog)
|
||||
|
||||
wxMessageDialog::wxMessageDialog(wxWindow *parent,
|
||||
@@ -126,5 +129,4 @@ int wxMessageDialog::ShowModal()
|
||||
}
|
||||
|
||||
|
||||
#endif // wxUSE_MSGDLG && defined(__WXGTK20__)
|
||||
|
||||
#endif // wxUSE_MSGDLG && defined(__WXGTK20__) && !defined(__WXGPE__)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: notebook.cpp
|
||||
// Name: src/gtk/notebook.cpp
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Id: $Id$
|
||||
@@ -10,14 +10,17 @@
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#if wxUSE_NOTEBOOK
|
||||
|
||||
#include "wx/notebook.h"
|
||||
|
||||
#if wxUSE_NOTEBOOK
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/panel.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/imaglist.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/log.h"
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/fontutil.h"
|
||||
@@ -383,13 +386,13 @@ int wxNotebook::GetSelection() const
|
||||
|
||||
wxString wxNotebook::GetPageText( size_t page ) const
|
||||
{
|
||||
wxCHECK_MSG( m_widget != NULL, wxT(""), wxT("invalid notebook") );
|
||||
wxCHECK_MSG( m_widget != NULL, wxEmptyString, wxT("invalid notebook") );
|
||||
|
||||
wxGtkNotebookPage* nb_page = GetNotebookPage(page);
|
||||
if (nb_page)
|
||||
return nb_page->m_text;
|
||||
else
|
||||
return wxT("");
|
||||
return wxEmptyString;
|
||||
}
|
||||
|
||||
int wxNotebook::GetPageImage( size_t page ) const
|
||||
@@ -691,7 +694,7 @@ bool wxNotebook::InsertPage( size_t position,
|
||||
/* set the label text */
|
||||
|
||||
nb_page->m_text = text;
|
||||
if (nb_page->m_text.IsEmpty()) nb_page->m_text = wxT("");
|
||||
if (nb_page->m_text.empty()) nb_page->m_text = wxT("");
|
||||
|
||||
nb_page->m_label = GTK_LABEL( gtk_label_new(wxGTK_CONV(nb_page->m_text)) );
|
||||
gtk_box_pack_end( GTK_BOX(nb_page->m_box), GTK_WIDGET(nb_page->m_label), FALSE, FALSE, m_padding );
|
||||
|
||||
@@ -11,8 +11,12 @@
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#include "wx/textctrl.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/utils.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/log.h"
|
||||
#include "wx/math.h"
|
||||
#include "wx/settings.h"
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/string.h"
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/apptrait.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/log.h"
|
||||
|
||||
#include "wx/process.h"
|
||||
|
||||
+8
-4
@@ -15,6 +15,11 @@
|
||||
#endif
|
||||
|
||||
#include "wx/window.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/dcclient.h"
|
||||
#include "wx/frame.h"
|
||||
#include "wx/app.h"
|
||||
@@ -46,7 +51,6 @@
|
||||
|
||||
#include "wx/menu.h"
|
||||
#include "wx/statusbr.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/settings.h"
|
||||
#include "wx/log.h"
|
||||
#include "wx/fontutil.h"
|
||||
@@ -4281,12 +4285,12 @@ void wxWindowGTK::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) )
|
||||
void wxWindowGTK::GtkScrolledWindowSetBorder(GtkWidget* w, int wxstyle)
|
||||
{
|
||||
//RN: Note that static controls usually have no border on gtk, so maybe
|
||||
//it makes sense to treat that as simply no border at the wx level
|
||||
//it makes sense to treat that as simply no border at the wx level
|
||||
//as well...
|
||||
if (!(wxstyle & wxNO_BORDER) && !(wxstyle & wxBORDER_STATIC))
|
||||
{
|
||||
GtkShadowType gtkstyle;
|
||||
|
||||
|
||||
if(wxstyle & wxBORDER_RAISED)
|
||||
gtkstyle = GTK_SHADOW_OUT;
|
||||
else if (wxstyle & wxBORDER_SUNKEN)
|
||||
@@ -4296,7 +4300,7 @@ void wxWindowGTK::GtkScrolledWindowSetBorder(GtkWidget* w, int wxstyle)
|
||||
else //default
|
||||
gtkstyle = GTK_SHADOW_IN;
|
||||
|
||||
gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW(w),
|
||||
gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW(w),
|
||||
gtkstyle );
|
||||
}
|
||||
}
|
||||
|
||||
+6
-2
@@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: app.cpp
|
||||
// Name: src/gtk1/app.cpp
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Id: $Id$
|
||||
@@ -17,9 +17,13 @@
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#include "wx/app.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/gdicmn.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/log.h"
|
||||
#include "wx/memory.h"
|
||||
#include "wx/font.h"
|
||||
|
||||
@@ -14,9 +14,12 @@
|
||||
|
||||
#include "wx/combobox.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/settings.h"
|
||||
#include "wx/arrstr.h"
|
||||
#include "wx/intl.h"
|
||||
|
||||
#include "wx/textctrl.h" // for wxEVT_COMMAND_TEXT_UPDATED
|
||||
|
||||
|
||||
+8
-6
@@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dnd.cpp
|
||||
// Name: src/gtk1/dnd.cpp
|
||||
// Purpose: wxDropTarget class
|
||||
// Author: Robert Roebling
|
||||
// Id: $Id$
|
||||
@@ -10,16 +10,18 @@
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#include "wx/dnd.h"
|
||||
#include "wx/log.h"
|
||||
|
||||
|
||||
#if wxUSE_DRAG_AND_DROP
|
||||
|
||||
#include "wx/dnd.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/log.h"
|
||||
#include "wx/window.h"
|
||||
#include "wx/app.h"
|
||||
#include "wx/gdicmn.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/utils.h"
|
||||
|
||||
#include "wx/gtk1/private.h"
|
||||
|
||||
@@ -10,14 +10,16 @@
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#if wxUSE_FONTDLG
|
||||
|
||||
#ifndef __WXGPE__
|
||||
#if wxUSE_FONTDLG && !defined(__WXGPE__)
|
||||
|
||||
#include "wx/fontdlg.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/fontutil.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/debug.h"
|
||||
#include "wx/msgdlg.h"
|
||||
|
||||
@@ -179,6 +181,4 @@ void wxFontDialog::SetChosenFont(const char *fontname)
|
||||
m_fontData.SetChosenFont(wxFont( wxString::FromAscii(fontname) ));
|
||||
}
|
||||
|
||||
#endif // wxUSE_FONTDLG
|
||||
|
||||
#endif // GPE
|
||||
#endif // wxUSE_FONTDLG && !defined(__WXGPE__)
|
||||
|
||||
@@ -12,20 +12,21 @@
|
||||
|
||||
#if wxUSE_LISTBOX
|
||||
|
||||
#include "wx/listbox.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/dynarray.h"
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/listbox.h"
|
||||
#include "wx/arrstr.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/checklst.h"
|
||||
#include "wx/settings.h"
|
||||
#include "wx/gtk1/private.h"
|
||||
|
||||
#if wxUSE_TOOLTIPS
|
||||
#include "wx/tooltip.h"
|
||||
#include "wx/tooltip.h"
|
||||
#endif
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
|
||||
+7
-4
@@ -10,14 +10,17 @@
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#include "wx/mdi.h"
|
||||
#include "wx/notebook.h"
|
||||
|
||||
#if wxUSE_MDI
|
||||
|
||||
#include "wx/mdi.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/notebook.h"
|
||||
#include "wx/dialog.h"
|
||||
#include "wx/menu.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/gtk1/private.h"
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
+6
-2
@@ -11,8 +11,12 @@
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#include "wx/menu.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/log.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/app.h"
|
||||
#include "wx/bitmap.h"
|
||||
|
||||
@@ -984,7 +988,7 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem, int pos)
|
||||
text = mitem->GetText();
|
||||
const wxBitmap *bitmap = &mitem->GetBitmap();
|
||||
|
||||
// TODO
|
||||
// TODO
|
||||
wxUnusedVar(bitmap);
|
||||
menuItem = gtk_menu_item_new_with_label( wxGTK_CONV( text ) );
|
||||
label = GTK_LABEL( GTK_BIN(menuItem)->child );
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: notebook.cpp
|
||||
// Name: src/gtk1/notebook.cpp
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Id: $Id$
|
||||
@@ -10,14 +10,17 @@
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#if wxUSE_NOTEBOOK
|
||||
|
||||
#include "wx/notebook.h"
|
||||
|
||||
#if wxUSE_NOTEBOOK
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/panel.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/imaglist.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/log.h"
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/fontutil.h"
|
||||
@@ -383,13 +386,13 @@ int wxNotebook::GetSelection() const
|
||||
|
||||
wxString wxNotebook::GetPageText( size_t page ) const
|
||||
{
|
||||
wxCHECK_MSG( m_widget != NULL, wxT(""), wxT("invalid notebook") );
|
||||
wxCHECK_MSG( m_widget != NULL, wxEmptyString, wxT("invalid notebook") );
|
||||
|
||||
wxGtkNotebookPage* nb_page = GetNotebookPage(page);
|
||||
if (nb_page)
|
||||
return nb_page->m_text;
|
||||
else
|
||||
return wxT("");
|
||||
return wxEmptyString;
|
||||
}
|
||||
|
||||
int wxNotebook::GetPageImage( size_t page ) const
|
||||
@@ -689,7 +692,7 @@ bool wxNotebook::InsertPage( size_t position,
|
||||
/* set the label text */
|
||||
|
||||
nb_page->m_text = text;
|
||||
if (nb_page->m_text.IsEmpty()) nb_page->m_text = wxT("");
|
||||
if (nb_page->m_text.empty()) nb_page->m_text = wxT("");
|
||||
|
||||
nb_page->m_label = GTK_LABEL( gtk_label_new(wxGTK_CONV(nb_page->m_text)) );
|
||||
gtk_box_pack_end( GTK_BOX(nb_page->m_box), GTK_WIDGET(nb_page->m_label), FALSE, FALSE, m_padding );
|
||||
|
||||
@@ -11,8 +11,12 @@
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#include "wx/textctrl.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/utils.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/log.h"
|
||||
#include "wx/math.h"
|
||||
#include "wx/settings.h"
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/string.h"
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/apptrait.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/log.h"
|
||||
|
||||
#include "wx/process.h"
|
||||
|
||||
+5
-1
@@ -15,6 +15,11 @@
|
||||
#endif
|
||||
|
||||
#include "wx/window.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/dcclient.h"
|
||||
#include "wx/frame.h"
|
||||
#include "wx/app.h"
|
||||
@@ -43,7 +48,6 @@
|
||||
|
||||
#include "wx/menu.h"
|
||||
#include "wx/statusbr.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/settings.h"
|
||||
#include "wx/log.h"
|
||||
#include "wx/fontutil.h"
|
||||
|
||||
+26
-22
@@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: app.cpp
|
||||
// Name: src/mac/carbon/app.cpp
|
||||
// Purpose: wxApp
|
||||
// Author: Stefan Csomor
|
||||
// Modified by:
|
||||
@@ -11,16 +11,20 @@
|
||||
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#include "wx/app.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/window.h"
|
||||
#include "wx/frame.h"
|
||||
#include "wx/button.h"
|
||||
#include "wx/app.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/gdicmn.h"
|
||||
#include "wx/pen.h"
|
||||
#include "wx/brush.h"
|
||||
#include "wx/cursor.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/icon.h"
|
||||
#include "wx/palette.h"
|
||||
#include "wx/dc.h"
|
||||
@@ -359,7 +363,7 @@ struct IdPair
|
||||
int wxId ;
|
||||
} ;
|
||||
|
||||
IdPair gCommandIds [] =
|
||||
IdPair gCommandIds [] =
|
||||
{
|
||||
{ kHICommandCut , wxID_CUT } ,
|
||||
{ kHICommandCopy , wxID_COPY } ,
|
||||
@@ -370,10 +374,10 @@ IdPair gCommandIds [] =
|
||||
{ kHICommandRedo , wxID_REDO } ,
|
||||
} ;
|
||||
|
||||
int wxMacCommandToId( UInt32 macCommandId )
|
||||
int wxMacCommandToId( UInt32 macCommandId )
|
||||
{
|
||||
int wxid = 0 ;
|
||||
|
||||
|
||||
switch ( macCommandId )
|
||||
{
|
||||
case kHICommandPreferences :
|
||||
@@ -408,10 +412,10 @@ int wxMacCommandToId( UInt32 macCommandId )
|
||||
return wxid ;
|
||||
}
|
||||
|
||||
UInt32 wxIdToMacCommand( int wxId )
|
||||
UInt32 wxIdToMacCommand( int wxId )
|
||||
{
|
||||
UInt32 macId = 0 ;
|
||||
|
||||
|
||||
if ( wxId == wxApp::s_macPreferencesMenuItemId )
|
||||
macId = kHICommandPreferences ;
|
||||
else if (wxId == wxApp::s_macExitMenuItemId)
|
||||
@@ -436,7 +440,7 @@ UInt32 wxIdToMacCommand( int wxId )
|
||||
return macId ;
|
||||
}
|
||||
|
||||
wxMenu* wxFindMenuFromMacCommand( const HICommand &command , wxMenuItem* &item )
|
||||
wxMenu* wxFindMenuFromMacCommand( const HICommand &command , wxMenuItem* &item )
|
||||
{
|
||||
wxMenu* itemMenu = NULL ;
|
||||
int id = 0 ;
|
||||
@@ -581,7 +585,7 @@ static pascal OSStatus wxMacAppCommandEventHandler( EventHandlerCallRef handler
|
||||
if ( item )
|
||||
{
|
||||
wxASSERT( itemMenu != NULL ) ;
|
||||
|
||||
|
||||
switch ( cEvent.GetKind() )
|
||||
{
|
||||
case kEventProcessCommand :
|
||||
@@ -598,16 +602,16 @@ static pascal OSStatus wxMacAppCommandEventHandler( EventHandlerCallRef handler
|
||||
{
|
||||
wxUpdateUIEvent event(id);
|
||||
event.SetEventObject( itemMenu );
|
||||
|
||||
|
||||
bool processed = false;
|
||||
|
||||
|
||||
// Try the menu's event handler
|
||||
{
|
||||
wxEvtHandler *handler = itemMenu->GetEventHandler();
|
||||
if ( handler )
|
||||
processed = handler->ProcessEvent(event);
|
||||
}
|
||||
|
||||
|
||||
// Try the window the menu was popped up from
|
||||
// (and up through the hierarchy)
|
||||
if ( !processed )
|
||||
@@ -621,11 +625,11 @@ static pascal OSStatus wxMacAppCommandEventHandler( EventHandlerCallRef handler
|
||||
processed = win->GetEventHandler()->ProcessEvent(event);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
menu = menu->GetParent();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( processed )
|
||||
{
|
||||
// if anything changed, update the changed attribute
|
||||
@@ -1473,10 +1477,10 @@ bool wxApp::MacSendKeyDownEvent( wxWindow* focus , long keymessage , long modifi
|
||||
if ( !focus )
|
||||
return false ;
|
||||
|
||||
bool handled;
|
||||
bool handled;
|
||||
wxKeyEvent event(wxEVT_KEY_DOWN) ;
|
||||
MacCreateKeyEvent( event, focus , keymessage , modifiers , when , wherex , wherey , uniChar ) ;
|
||||
|
||||
|
||||
handled = focus->GetEventHandler()->ProcessEvent( event ) ;
|
||||
if ( handled && event.GetSkipped() )
|
||||
handled = false ;
|
||||
@@ -1515,7 +1519,7 @@ bool wxApp::MacSendKeyUpEvent( wxWindow* focus , long keymessage , long modifier
|
||||
wxKeyEvent event( wxEVT_KEY_UP ) ;
|
||||
MacCreateKeyEvent( event, focus , keymessage , modifiers , when , wherex , wherey , uniChar ) ;
|
||||
handled = focus->GetEventHandler()->ProcessEvent( event ) ;
|
||||
|
||||
|
||||
return handled ;
|
||||
}
|
||||
|
||||
@@ -1523,7 +1527,7 @@ bool wxApp::MacSendCharEvent( wxWindow* focus , long keymessage , long modifiers
|
||||
{
|
||||
if ( !focus )
|
||||
return false ;
|
||||
|
||||
|
||||
wxKeyEvent event(wxEVT_CHAR) ;
|
||||
MacCreateKeyEvent( event, focus , keymessage , modifiers , when , wherex , wherey , uniChar ) ;
|
||||
long keyval = event.m_keyCode ;
|
||||
@@ -1531,7 +1535,7 @@ bool wxApp::MacSendCharEvent( wxWindow* focus , long keymessage , long modifiers
|
||||
bool handled = false ;
|
||||
|
||||
wxTopLevelWindowMac *tlw = focus->MacGetTopLevelWindow() ;
|
||||
|
||||
|
||||
if (tlw)
|
||||
{
|
||||
event.SetEventType( wxEVT_CHAR_HOOK );
|
||||
@@ -1546,7 +1550,7 @@ bool wxApp::MacSendCharEvent( wxWindow* focus , long keymessage , long modifiers
|
||||
event.Skip( false ) ;
|
||||
handled = focus->GetEventHandler()->ProcessEvent( event ) ;
|
||||
}
|
||||
|
||||
|
||||
if ( !handled && (keyval == WXK_TAB) )
|
||||
{
|
||||
wxWindow* iter = focus->GetParent() ;
|
||||
@@ -1601,7 +1605,7 @@ bool wxApp::MacSendCharEvent( wxWindow* focus , long keymessage , long modifiers
|
||||
return handled ;
|
||||
}
|
||||
|
||||
// This method handles common code for SendKeyDown, SendKeyUp, and SendChar events.
|
||||
// This method handles common code for SendKeyDown, SendKeyUp, and SendChar events.
|
||||
void wxApp::MacCreateKeyEvent( wxKeyEvent& event, wxWindow* focus , long keymessage , long modifiers , long when , short wherex , short wherey , wxChar uniChar )
|
||||
{
|
||||
short keycode, keychar ;
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/object.h"
|
||||
#include "wx/string.h"
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/app.h"
|
||||
@@ -30,7 +31,6 @@
|
||||
#include "wx/utils.h"
|
||||
#include "wx/module.h"
|
||||
#include "wx/log.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/event.h"
|
||||
|
||||
#include "wx/sckaddr.h"
|
||||
|
||||
@@ -14,13 +14,17 @@
|
||||
|
||||
#if wxUSE_CLIPBOARD
|
||||
|
||||
#include "wx/clipbrd.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/app.h"
|
||||
#include "wx/frame.h"
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/metafile.h"
|
||||
#include "wx/clipbrd.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/log.h"
|
||||
|
||||
#ifndef __DARWIN__
|
||||
|
||||
@@ -14,12 +14,13 @@
|
||||
|
||||
#if wxUSE_DATAOBJ
|
||||
|
||||
#include "wx/dataobj.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/intl.h"
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/log.h"
|
||||
#include "wx/dataobj.h"
|
||||
#include "wx/dcmemory.h"
|
||||
#include "wx/mstream.h"
|
||||
#include "wx/image.h"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: filedlg.cpp
|
||||
// Name: src/mac/carbon/filedlg.cpp
|
||||
// Purpose: wxFileDialog
|
||||
// Author: Stefan Csomor
|
||||
// Modified by:
|
||||
@@ -11,11 +11,15 @@
|
||||
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#include "wx/filedlg.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/app.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/dialog.h"
|
||||
#include "wx/filedlg.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/tokenzr.h"
|
||||
#include "wx/filename.h"
|
||||
|
||||
@@ -157,7 +161,7 @@ void MakeUserDataRec(OpenUserDataRec *myData , const wxString& filter )
|
||||
// an explanatory text, in that case the first part is name and extension at the same time
|
||||
|
||||
wxASSERT_MSG( filterIndex == 0 || !isName , wxT("incorrect format of format string") ) ;
|
||||
if ( current.IsEmpty() )
|
||||
if ( current.empty() )
|
||||
myData->extensions.Add( myData->name[filterIndex] ) ;
|
||||
else
|
||||
myData->extensions.Add( current.MakeUpper() ) ;
|
||||
@@ -179,7 +183,7 @@ void MakeUserDataRec(OpenUserDataRec *myData , const wxString& filter )
|
||||
// Remove leading '.'
|
||||
if (extension.length() && (extension.GetChar(0) == '.'))
|
||||
extension = extension.Mid( 1 );
|
||||
|
||||
|
||||
if (wxFileName::MacFindDefaultTypeAndCreator( extension, &fileType, &creator ))
|
||||
myData->filtermactypes.Add( (OSType)fileType );
|
||||
else
|
||||
@@ -364,7 +368,7 @@ int wxFileDialog::ShowModal()
|
||||
{
|
||||
// let the user select bundles/programs in dialogs
|
||||
dialogCreateOptions.optionFlags |= kNavSupportPackages;
|
||||
|
||||
|
||||
navFilterUPP = NewNavObjectFilterUPP(CrossPlatformFilterCallback);
|
||||
err = ::NavCreateGetFileDialog(
|
||||
&dialogCreateOptions,
|
||||
@@ -413,7 +417,7 @@ int wxFileDialog::ShowModal()
|
||||
thePath = wxMacFSRefToPath( &theFSRef, navReply.saveFileName );
|
||||
else
|
||||
thePath = wxMacFSRefToPath( &theFSRef );
|
||||
|
||||
|
||||
if (!thePath)
|
||||
{
|
||||
::NavDisposeReply(&navReply);
|
||||
@@ -436,4 +440,3 @@ int wxFileDialog::ShowModal()
|
||||
|
||||
return (err == noErr) ? wxID_OK : wxID_CANCEL;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: fontdlg.cpp
|
||||
// Name: src/mac/carbon/fontdlgosx.cpp
|
||||
// Purpose: wxFontDialog class.
|
||||
// Author: Ryan Norton
|
||||
// Modified by:
|
||||
@@ -9,6 +9,8 @@
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
// ===========================================================================
|
||||
// declarations
|
||||
// ===========================================================================
|
||||
@@ -17,11 +19,16 @@
|
||||
// headers
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#include "wx/cmndata.h"
|
||||
#include "wx/fontdlg.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/cmndata.h"
|
||||
#include "wx/fontutil.h"
|
||||
#include "wx/log.h"
|
||||
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
@@ -36,10 +43,9 @@
|
||||
#import <AppKit/AppKit.h>
|
||||
|
||||
#include "wx/mac/uma.h"
|
||||
#include "wx/intl.h"
|
||||
|
||||
@interface wxMacFontPanelAccView : NSView
|
||||
{
|
||||
{
|
||||
BOOL m_okPressed ;
|
||||
BOOL m_shouldClose ;
|
||||
NSButton* m_cancelButton ;
|
||||
@@ -58,13 +64,13 @@
|
||||
- (id)initWithFrame:(NSRect)rectBox
|
||||
{
|
||||
[super initWithFrame:rectBox];
|
||||
|
||||
|
||||
wxMacCFStringHolder cfOkString( wxT("OK"), wxLocale::GetSystemEncoding() );
|
||||
wxMacCFStringHolder cfCancelString( wxT("Cancel"), wxLocale::GetSystemEncoding() );
|
||||
|
||||
NSRect rectCancel = NSMakeRect( 10.0 , 10.0 , 82 , 24 );
|
||||
NSRect rectOK = NSMakeRect( 100.0 , 10.0 , 82 , 24 );
|
||||
|
||||
|
||||
NSButton* cancelButton = [[NSButton alloc] initWithFrame:rectCancel];
|
||||
[cancelButton setTitle:(NSString*)cfCancelString.Detach()];
|
||||
[cancelButton setBezelStyle:NSRoundedBezelStyle];
|
||||
@@ -72,7 +78,7 @@
|
||||
[cancelButton setAction:@selector(cancelPressed:)];
|
||||
[cancelButton setTarget:self];
|
||||
m_cancelButton = cancelButton ;
|
||||
|
||||
|
||||
NSButton* okButton = [[NSButton alloc] initWithFrame:rectOK];
|
||||
[okButton setTitle:(NSString*)cfOkString.Detach()];
|
||||
[okButton setBezelStyle:NSRoundedBezelStyle];
|
||||
@@ -86,7 +92,7 @@
|
||||
|
||||
[self addSubview:cancelButton];
|
||||
[self addSubview:okButton];
|
||||
|
||||
|
||||
[self resetFlags];
|
||||
return self;
|
||||
}
|
||||
@@ -94,7 +100,7 @@
|
||||
- (void)resetFlags
|
||||
{
|
||||
m_okPressed = NO ;
|
||||
m_shouldClose = NO ;
|
||||
m_shouldClose = NO ;
|
||||
}
|
||||
|
||||
- (IBAction)cancelPressed:(id)sender
|
||||
@@ -145,22 +151,22 @@ int RunMixedFontDialog(wxFontDialog* dialog)
|
||||
WindowRef carbonWindowRef = (WindowRef)[fontPanel windowRef] ;
|
||||
SetWindowModality(carbonWindowRef, kWindowModalityAppModal , 0) ;
|
||||
SetWindowGroup(carbonWindowRef , GetWindowGroupOfClass(kMovableModalWindowClass));
|
||||
|
||||
|
||||
[fontPanel setFloatingPanel:NO] ;
|
||||
[[fontPanel standardWindowButton:NSWindowCloseButton] setEnabled:NO] ;
|
||||
|
||||
|
||||
wxMacFontPanelAccView* accessoryView = (wxMacFontPanelAccView*) [fontPanel accessoryView] ;
|
||||
if ( accessoryView == nil)
|
||||
{
|
||||
NSRect rectBox = NSMakeRect( 0 , 0 , 192 , 40 );
|
||||
accessoryView = [[wxMacFontPanelAccView alloc] initWithFrame:rectBox];
|
||||
[fontPanel setAccessoryView:accessoryView];
|
||||
|
||||
|
||||
[fontPanel setDefaultButtonCell:[[accessoryView okButton] cell]] ;
|
||||
}
|
||||
|
||||
[accessoryView resetFlags];
|
||||
|
||||
|
||||
NSModalSession session = [NSApp beginModalSessionForWindow:fontPanel];
|
||||
|
||||
[NSApp runModalSession:session];
|
||||
@@ -171,7 +177,7 @@ int RunMixedFontDialog(wxFontDialog* dialog)
|
||||
[[fontPanel standardWindowButton:NSWindowCloseButton] setEnabled:YES] ;
|
||||
if( FPIsFontPanelVisible())
|
||||
FPShowHideFontPanel() ;
|
||||
|
||||
|
||||
if ( [accessoryView closedWithOk])
|
||||
{
|
||||
retval = wxID_OK ;
|
||||
@@ -223,7 +229,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxFontDialog, wxDialog)
|
||||
- (BOOL)windowShouldClose:(id)sender
|
||||
{
|
||||
m_bIsClosed = true;
|
||||
|
||||
|
||||
[NSApp abortModal];
|
||||
[NSApp stopModal];
|
||||
return YES;
|
||||
@@ -269,7 +275,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxFontDialog, wxDialog)
|
||||
{
|
||||
m_bIsClosed = true;
|
||||
m_bIsOpen = false;
|
||||
|
||||
|
||||
[NSApp abortModal];
|
||||
[NSApp stopModal];
|
||||
return YES;
|
||||
@@ -321,14 +327,14 @@ bool wxFontDialog::Create(wxWindow *parent, const wxFontData& data)
|
||||
m_fontData = data;
|
||||
|
||||
//
|
||||
// This is the key call - this initializes
|
||||
// events and window stuff for cocoa for carbon
|
||||
// applications.
|
||||
// This is the key call - this initializes
|
||||
// events and window stuff for cocoa for carbon
|
||||
// applications.
|
||||
//
|
||||
// This is also the only call here that is
|
||||
// 10.2+ specific (the rest is OSX only),
|
||||
// which, ironically, the carbon font
|
||||
// panel requires.
|
||||
// This is also the only call here that is
|
||||
// 10.2+ specific (the rest is OSX only),
|
||||
// which, ironically, the carbon font
|
||||
// panel requires.
|
||||
//
|
||||
bool bOK = NSApplicationLoad();
|
||||
|
||||
@@ -338,20 +344,20 @@ bool wxFontDialog::Create(wxWindow *parent, const wxFontData& data)
|
||||
|
||||
//Get the initial wx font
|
||||
wxFont& thewxfont = m_fontData.m_initialFont;
|
||||
|
||||
//if the font is valid set the default (selected) font of the
|
||||
|
||||
//if the font is valid set the default (selected) font of the
|
||||
//NSFontDialog to that font
|
||||
if (thewxfont.Ok())
|
||||
{
|
||||
NSFontTraitMask theMask = 0;
|
||||
|
||||
|
||||
if(thewxfont.GetStyle() == wxFONTSTYLE_ITALIC)
|
||||
theMask |= NSItalicFontMask;
|
||||
|
||||
|
||||
if(thewxfont.IsFixedWidth())
|
||||
theMask |= NSFixedPitchFontMask;
|
||||
|
||||
NSFont* theDefaultFont =
|
||||
NSFont* theDefaultFont =
|
||||
[[NSFontManager sharedFontManager] fontWithFamily:
|
||||
wxNSStringWithWxString(thewxfont.GetFaceName())
|
||||
traits:theMask
|
||||
@@ -359,7 +365,7 @@ bool wxFontDialog::Create(wxWindow *parent, const wxFontData& data)
|
||||
thewxfont.GetWeight() == wxLIGHT ? 0 : 5
|
||||
size: (float)(thewxfont.GetPointSize())
|
||||
];
|
||||
|
||||
|
||||
wxASSERT_MSG(theDefaultFont, wxT("Invalid default font for wxCocoaFontDialog!"));
|
||||
|
||||
//Apple docs say to call NSFontManager::setSelectedFont
|
||||
@@ -377,17 +383,17 @@ bool wxFontDialog::Create(wxWindow *parent, const wxFontData& data)
|
||||
alpha:1.0]
|
||||
];
|
||||
else
|
||||
[[NSColorPanel sharedColorPanel] setColor:[NSColor blackColor]];
|
||||
|
||||
[[NSColorPanel sharedColorPanel] setColor:[NSColor blackColor]];
|
||||
|
||||
//We're done - free up the pool
|
||||
[thePool release];
|
||||
|
||||
|
||||
return bOK;
|
||||
}
|
||||
|
||||
int wxFontDialog::ShowModal()
|
||||
{
|
||||
//Start the pool. Required for carbon interaction
|
||||
{
|
||||
//Start the pool. Required for carbon interaction
|
||||
//(For those curious, the only thing that happens
|
||||
//if you don't do this is a bunch of error
|
||||
//messages about leaks on the console,
|
||||
@@ -396,7 +402,7 @@ int wxFontDialog::ShowModal()
|
||||
thePool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
//Get the shared color and font panel
|
||||
NSFontPanel* theFontPanel = [NSFontPanel sharedFontPanel];
|
||||
NSFontPanel* theFontPanel = [NSFontPanel sharedFontPanel];
|
||||
NSColorPanel* theColorPanel = [NSColorPanel sharedColorPanel];
|
||||
|
||||
//Create and assign the delegates (cocoa event handlers) so
|
||||
@@ -406,17 +412,17 @@ int wxFontDialog::ShowModal()
|
||||
|
||||
wxWCODelegate* theCPDelegate = [[wxWCODelegate alloc] init];
|
||||
[theColorPanel setDelegate:theCPDelegate];
|
||||
|
||||
|
||||
//
|
||||
// Begin the modal loop for the font and color panels
|
||||
// Begin the modal loop for the font and color panels
|
||||
//
|
||||
// The idea is that we first make the font panel modal,
|
||||
// The idea is that we first make the font panel modal,
|
||||
// but if the color panel is opened, unless we stop the
|
||||
// modal loop the color panel opens behind the font panel
|
||||
// with no input acceptable to it - which makes it useless.
|
||||
//
|
||||
// So we set up delegates for both the color and font panels,
|
||||
// and the if the font panel opens the color panel, we
|
||||
// So we set up delegates for both the color and font panels,
|
||||
// and the if the font panel opens the color panel, we
|
||||
// stop the modal loop, and start a separate modal loop for
|
||||
// the color panel until the color panel closes, switching
|
||||
// back to the font panel modal loop once it does close.
|
||||
@@ -424,31 +430,31 @@ int wxFontDialog::ShowModal()
|
||||
do
|
||||
{
|
||||
//
|
||||
// Start the font panel modal loop
|
||||
// Start the font panel modal loop
|
||||
//
|
||||
NSModalSession session = [NSApp beginModalSessionForWindow:theFontPanel];
|
||||
for (;;)
|
||||
for (;;)
|
||||
{
|
||||
[NSApp runModalSession:session];
|
||||
|
||||
|
||||
//If the font panel is closed or the font panel
|
||||
//opened the color panel, break
|
||||
if ([theFPDelegate isClosed] || [theCPDelegate isOpen])
|
||||
break;
|
||||
}
|
||||
[NSApp endModalSession:session];
|
||||
|
||||
|
||||
//is the color panel open?
|
||||
if ([theCPDelegate isOpen])
|
||||
{
|
||||
//
|
||||
// Start the color panel modal loop
|
||||
// Start the color panel modal loop
|
||||
//
|
||||
NSModalSession session = [NSApp beginModalSessionForWindow:theColorPanel];
|
||||
for (;;)
|
||||
for (;;)
|
||||
{
|
||||
[NSApp runModalSession:session];
|
||||
|
||||
|
||||
//If the color panel is closed, return the font panel modal loop
|
||||
if ([theCPDelegate isClosed])
|
||||
break;
|
||||
@@ -459,50 +465,50 @@ int wxFontDialog::ShowModal()
|
||||
//out of its modal loop because the color panel was
|
||||
//opened) return the font panel modal loop
|
||||
}while([theFPDelegate isClosed] == NO);
|
||||
|
||||
|
||||
//free up the memory for the delegates - we don't need them anymore
|
||||
[theFPDelegate release];
|
||||
[theCPDelegate release];
|
||||
|
||||
|
||||
//Get the font the user selected
|
||||
NSFont* theFont = [theFontPanel panelConvertFont:[NSFont userFontOfSize:0]];
|
||||
|
||||
NSFont* theFont = [theFontPanel panelConvertFont:[NSFont userFontOfSize:0]];
|
||||
|
||||
//Get more information about the user's chosen font
|
||||
NSFontTraitMask theTraits = [[NSFontManager sharedFontManager] traitsOfFont:theFont];
|
||||
int theFontWeight = [[NSFontManager sharedFontManager] weightOfFont:theFont];
|
||||
int theFontSize = (int) [theFont pointSize];
|
||||
|
||||
|
||||
//Set the wx font to the appropriate data
|
||||
if(theTraits & NSFixedPitchFontMask)
|
||||
m_fontData.m_chosenFont.SetFamily(wxTELETYPE);
|
||||
|
||||
|
||||
m_fontData.m_chosenFont.SetFaceName(wxStringWithNSString([theFont familyName]));
|
||||
m_fontData.m_chosenFont.SetPointSize(theFontSize);
|
||||
m_fontData.m_chosenFont.SetStyle(theTraits & NSItalicFontMask ? wxFONTSTYLE_ITALIC : 0);
|
||||
m_fontData.m_chosenFont.SetWeight(theFontWeight < 5 ? wxLIGHT :
|
||||
theFontWeight >= 9 ? wxBOLD : wxNORMAL);
|
||||
|
||||
theFontWeight >= 9 ? wxBOLD : wxNORMAL);
|
||||
|
||||
//Get the shared color panel along with the chosen color and set the chosen color
|
||||
NSColor* theColor = [[theColorPanel color] colorUsingColorSpaceName:NSCalibratedRGBColorSpace];
|
||||
|
||||
|
||||
m_fontData.m_fontColour.Set((unsigned char) ([theColor redComponent] * 255.0),
|
||||
(unsigned char) ([theColor greenComponent] * 255.0),
|
||||
(unsigned char) ([theColor blueComponent] * 255.0));
|
||||
|
||||
//Friendly debug stuff
|
||||
#ifdef FONTDLGDEBUG
|
||||
wxPrintf(wxT("---Font Panel---\n--NS--\nSize:%f\nWeight:%i\nTraits:%i\n--WX--\nFaceName:%s\nPointSize:%i\nStyle:%i\nWeight:%i\nColor:%i,%i,%i\n---END Font Panel---\n"),
|
||||
|
||||
wxPrintf(wxT("---Font Panel---\n--NS--\nSize:%f\nWeight:%i\nTraits:%i\n--WX--\nFaceName:%s\nPointSize:%i\nStyle:%i\nWeight:%i\nColor:%i,%i,%i\n---END Font Panel---\n"),
|
||||
|
||||
(float) theFontSize,
|
||||
theFontWeight,
|
||||
theTraits,
|
||||
|
||||
|
||||
m_fontData.m_chosenFont.GetFaceName().c_str(),
|
||||
m_fontData.m_chosenFont.GetPointSize(),
|
||||
m_fontData.m_chosenFont.GetStyle(),
|
||||
m_fontData.m_chosenFont.GetWeight(),
|
||||
m_fontData.m_fontColour.Red(),
|
||||
m_fontData.m_fontColour.Green(),
|
||||
m_fontData.m_fontColour.Red(),
|
||||
m_fontData.m_fontColour.Green(),
|
||||
m_fontData.m_fontColour.Blue() );
|
||||
#endif
|
||||
|
||||
|
||||
@@ -14,16 +14,17 @@
|
||||
|
||||
#if wxUSE_FONTMAP
|
||||
|
||||
#include "wx/fontenum.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/font.h"
|
||||
#include "wx/font.h"
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/fontenum.h"
|
||||
#include "wx/fontutil.h"
|
||||
#include "wx/fontmap.h"
|
||||
#include "wx/fontutil.h"
|
||||
#include "wx/encinfo.h"
|
||||
#include "wx/intl.h"
|
||||
|
||||
#include "wx/mac/private.h"
|
||||
|
||||
@@ -161,4 +162,4 @@ bool wxFontEnumerator::EnumerateEncodings(const wxString& family)
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif // wxUSE_FONTMAP
|
||||
|
||||
@@ -32,9 +32,12 @@
|
||||
|
||||
#if wxUSE_MIMETYPE
|
||||
|
||||
#include "wx/mac/mimetype.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/dynarray.h"
|
||||
#include "wx/string.h"
|
||||
#include "wx/intl.h"
|
||||
|
||||
#if wxUSE_GUI
|
||||
#include "wx/icon.h"
|
||||
@@ -43,10 +46,8 @@
|
||||
|
||||
#include "wx/log.h"
|
||||
#include "wx/file.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/confbase.h"
|
||||
|
||||
#include "wx/mac/mimetype.h"
|
||||
#include "wx/mac/private.h"
|
||||
|
||||
// other standard headers
|
||||
@@ -818,7 +819,6 @@ pascal OSStatus MoreProcGetProcessTypeSignature(
|
||||
//
|
||||
|
||||
#include "wx/mac/corefoundation/cfstring.h"
|
||||
#include "wx/intl.h" //wxLocale for wxCFString
|
||||
|
||||
#define wxCF_RELEASE true
|
||||
#define wxCF_RETAIN false
|
||||
|
||||
@@ -11,9 +11,13 @@
|
||||
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#include "wx/app.h"
|
||||
#include "wx/msgdlg.h"
|
||||
#include "wx/intl.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/app.h"
|
||||
#include "wx/mac/uma.h"
|
||||
|
||||
|
||||
@@ -294,4 +298,3 @@ int wxMessageDialog::ShowModal()
|
||||
|
||||
return resultbutton;
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user