This commit is contained in:
JulianSmart
2015-05-26 12:17:38 +01:00
61 changed files with 29187 additions and 17308 deletions

View File

@@ -838,7 +838,7 @@ struct wxPrintfConvSpecParser
for ( unsigned n = 0; n < numAsterisks; n++ ) for ( unsigned n = 0; n < numAsterisks; n++ )
{ {
if ( nargs++ == wxMAX_SVNPRINTF_ARGUMENTS ) if ( ++nargs == wxMAX_SVNPRINTF_ARGUMENTS )
break; break;
// TODO: we need to support specifiers of the form "%2$*1$s" // TODO: we need to support specifiers of the form "%2$*1$s"
@@ -870,6 +870,11 @@ struct wxPrintfConvSpecParser
spec = &specs[nargs]; spec = &specs[nargs];
} }
// If we hit the maximal number of arguments inside the inner
// loop, break out of the outer one as well.
if ( nargs == wxMAX_SVNPRINTF_ARGUMENTS )
break;
} }
@@ -890,7 +895,7 @@ struct wxPrintfConvSpecParser
// this conversion specifier is tied to the pos-th argument... // this conversion specifier is tied to the pos-th argument...
pspec[spec->m_pos] = spec; pspec[spec->m_pos] = spec;
if ( nargs++ == wxMAX_SVNPRINTF_ARGUMENTS ) if ( ++nargs == wxMAX_SVNPRINTF_ARGUMENTS )
break; break;
} }

View File

@@ -229,7 +229,14 @@ wxPG_DESCRIPTION = 0x00002000,
/** wxPropertyGridManager only: don't show an internal border around the /** wxPropertyGridManager only: don't show an internal border around the
property grid. Recommended if you use a header. property grid. Recommended if you use a header.
*/ */
wxPG_NO_INTERNAL_BORDER = 0x00004000 wxPG_NO_INTERNAL_BORDER = 0x00004000,
/** A mask which can be used to filter (out) all styles.
*/
wxPG_WINDOW_STYLE_MASK = wxPG_AUTO_SORT|wxPG_HIDE_CATEGORIES|wxPG_BOLD_MODIFIED|
wxPG_SPLITTER_AUTO_CENTER|wxPG_TOOLTIPS|wxPG_HIDE_MARGIN|
wxPG_STATIC_SPLITTER|wxPG_LIMITED_EDITING|wxPG_TOOLBAR|
wxPG_DESCRIPTION|wxPG_NO_INTERNAL_BORDER
}; };
#if wxPG_COMPATIBILITY_1_4 #if wxPG_COMPATIBILITY_1_4
@@ -344,7 +351,11 @@ wxPG_EX_ALWAYS_ALLOW_FOCUS = 0x00100000,
/** A mask which can be used to filter (out) all extra styles. /** A mask which can be used to filter (out) all extra styles.
*/ */
wxPG_EX_WINDOW_STYLE_MASK = 0x1FFFF000 wxPG_EX_WINDOW_STYLE_MASK = wxPG_EX_INIT_NOCAT|wxPG_EX_NO_FLAT_TOOLBAR|wxPG_EX_MODE_BUTTONS|
wxPG_EX_HELP_AS_TOOLTIPS|wxPG_EX_NATIVE_DOUBLE_BUFFERING|wxPG_EX_AUTO_UNSPECIFIED_VALUES|
wxPG_EX_WRITEONLY_BUILTIN_ATTRIBUTES|wxPG_EX_HIDE_PAGE_BUTTONS|wxPG_EX_MULTIPLE_SELECTION|
wxPG_EX_ENABLE_TLP_TRACKING|wxPG_EX_NO_TOOLBAR_DIVIDER|wxPG_EX_TOOLBAR_SEPARATOR|
wxPG_EX_ALWAYS_ALLOW_FOCUS
}; };
#if wxPG_COMPATIBILITY_1_4 #if wxPG_COMPATIBILITY_1_4
@@ -983,7 +994,7 @@ public:
*/ */
unsigned int GetColumnCount() const unsigned int GetColumnCount() const
{ {
return (unsigned int) m_pState->m_colWidths.size(); return m_pState->GetColumnCount();
} }
/** Returns colour of empty space below properties. */ /** Returns colour of empty space below properties. */

View File

@@ -526,9 +526,7 @@ public:
*/ */
wxPGProperty* GetSelection() const wxPGProperty* GetSelection() const
{ {
if ( m_selection.size() == 0 ) return m_selection.empty()? NULL: m_selection[0];
return NULL;
return m_selection[0];
} }
void DoSetSelection( wxPGProperty* prop ) void DoSetSelection( wxPGProperty* prop )

View File

@@ -9,19 +9,27 @@
expected_abi_file="expected_abi" expected_abi_file="expected_abi"
actual_abi_file="actual_abi" actual_abi_file="actual_abi"
if [[ "$(uname)" == "Darwin" ]]; then
file_mask=*.dylib
nm_options="-g -U"
else
file_mask=*.so
nm_options="-D -g --defined-only"
fi
if [[ "$1" == "--generate" ]]; then if [[ "$1" == "--generate" ]]; then
# IMPORTANT: we need a shared build of wxWidgets to proceed # IMPORTANT: we need a shared build of wxWidgets to proceed
if [[ $(echo *.so) == "*.so" ]]; then if [[ $(echo $file_mask) == "$file_mask" ]]; then
echo "No shared objects (*.so) were found... aborting" echo "No shared objects ($file_mask) were found... aborting"
exit 1 exit 1
fi fi
# generated the "expected ABI" for later comparison # generated the "expected ABI" for later comparison
rm -f $expected_abi_file rm -f $expected_abi_file
for library in *.so; do for library in $file_mask; do
# NOTE: don't use -C option as otherwise cut won't work correctly # NOTE: don't use -C option as otherwise cut won't work correctly
nm -D -g --defined-only $library | cut -d ' ' -f 3 | sort >>$expected_abi_file nm $nm_options $library | cut -d ' ' -f 3 | sort >>$expected_abi_file
done done
echo "Expected wxWidgets ABI generated in \"$expected_abi_file\"..." echo "Expected wxWidgets ABI generated in \"$expected_abi_file\"..."
@@ -37,15 +45,15 @@ elif [[ -z "$1" ]]; then
echo "Comparing actual ABI with the expected ABI (loading it from \"$expected_abi_file\")..." echo "Comparing actual ABI with the expected ABI (loading it from \"$expected_abi_file\")..."
# IMPORTANT: we need a shared build of wxWidgets to do the check # IMPORTANT: we need a shared build of wxWidgets to do the check
if [[ $(echo *.so) == "*.so" ]]; then if [[ $(echo $file_mask) == "*$file_mask" ]]; then
echo "No shared objects (*.so) were found... aborting" echo "No shared objects ($file_mask) were found... aborting"
exit 1 exit 1
fi fi
rm -f $actual_abi_file rm -f $actual_abi_file
for library in *.so; do for library in $file_mask; do
# NOTE: don't use -C option as otherwise cut won't work correctly # NOTE: don't use -C option as otherwise cut won't work correctly
nm -D -g --defined-only $library | cut -d ' ' -f 3 | sort >>$actual_abi_file nm $nm_options $library | cut -d ' ' -f 3 | sort >>$actual_abi_file
done done
result=`diff -u $expected_abi_file $actual_abi_file` result=`diff -u $expected_abi_file $actual_abi_file`

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

1388
locale/diff.txt Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -438,13 +438,25 @@ wxFontEncodingArray wxEncodingConverter::GetPlatformEquivalents(wxFontEncoding e
{ {
#if defined(__WINDOWS__) #if defined(__WINDOWS__)
platform = wxPLATFORM_WINDOWS; platform = wxPLATFORM_WINDOWS;
#elif defined(__WXGTK__) || defined(__WXMOTIF__)
platform = wxPLATFORM_UNIX;
#elif defined(__WXMAC__) #elif defined(__WXMAC__)
platform = wxPLATFORM_MAC; platform = wxPLATFORM_MAC;
#else
platform = wxPLATFORM_UNIX;
#endif #endif
} }
switch ( platform )
{
case wxPLATFORM_UNIX:
case wxPLATFORM_WINDOWS:
case wxPLATFORM_MAC:
break;
default:
wxFAIL_MSG(wxS("Invalid platform specified"));
return wxFontEncodingArray();
}
int i, clas, e ; int i, clas, e ;
const wxFontEncoding *f; const wxFontEncoding *f;
wxFontEncodingArray arr; wxFontEncodingArray arr;

View File

@@ -802,7 +802,7 @@ wxString wxNativeFontInfo::ToUserString() const
if ( GetStrikethrough() ) if ( GetStrikethrough() )
{ {
desc << _("strikethrough"); desc << _(" strikethrough");
} }
switch ( GetWeight() ) switch ( GetWeight() )

View File

@@ -26,6 +26,7 @@
#include "wx/gifdecod.h" #include "wx/gifdecod.h"
#include "wx/stream.h" #include "wx/stream.h"
#include "wx/anidecod.h" // wxImageArray #include "wx/anidecod.h" // wxImageArray
#include "wx/scopedarray.h"
#define GIF89_HDR "GIF89a" #define GIF89_HDR "GIF89a"
#define NETSCAPE_LOOP "NETSCAPE2.0" #define NETSCAPE_LOOP "NETSCAPE2.0"
@@ -116,53 +117,31 @@ static bool wxGIFHandler_BufferedOutput(wxOutputStream *, wxUint8 *buf, int c);
bool wxGIFHandler::LoadFile(wxImage *image, wxInputStream& stream, bool wxGIFHandler::LoadFile(wxImage *image, wxInputStream& stream,
bool verbose, int index) bool verbose, int index)
{ {
wxGIFDecoder *decod; wxGIFDecoder decod;
wxGIFErrorCode error; switch ( decod.LoadGIF(stream) )
bool ok = true; {
case wxGIF_OK:
break;
// image->Destroy();
decod = new wxGIFDecoder();
error = decod->LoadGIF(stream);
if ((error != wxGIF_OK) && (error != wxGIF_TRUNCATED))
{
if (verbose)
{
switch (error)
{
case wxGIF_INVFORMAT: case wxGIF_INVFORMAT:
if ( verbose )
wxLogError(_("GIF: error in GIF image format.")); wxLogError(_("GIF: error in GIF image format."));
break;
case wxGIF_MEMERR:
wxLogError(_("GIF: not enough memory."));
break;
default:
wxLogError(_("GIF: unknown error!!!"));
break;
}
}
delete decod;
return false; return false;
}
if ((error == wxGIF_TRUNCATED) && verbose) case wxGIF_MEMERR:
{ if ( verbose )
wxLogError(_("GIF: not enough memory."));
return false;
case wxGIF_TRUNCATED:
if ( verbose )
wxLogError(_("GIF: data stream seems to be truncated.")); wxLogError(_("GIF: data stream seems to be truncated."));
// go on; image data is OK // go on; image data is OK
break;
} }
if (ok) return decod.ConvertToImage(index != -1 ? (size_t)index : 0, image);
{
ok = decod->ConvertToImage(index != -1 ? (size_t)index : 0, image);
}
else
{
wxLogError(_("GIF: Invalid gif index."));
}
delete decod;
return ok;
} }
bool wxGIFHandler::SaveFile(wxImage *image, bool wxGIFHandler::SaveFile(wxImage *image,
@@ -218,6 +197,8 @@ bool wxGIFHandler::DoSaveFile(const wxImage& image, wxOutputStream *stream,
int width = image.GetWidth(); int width = image.GetWidth();
int height = image.GetHeight(); int height = image.GetHeight();
wxCHECK_MSG( width && height, false, wxS("can't save 0-sized file") );
int width_even = width + ((width % 2) ? 1 : 0); int width_even = width + ((width % 2) ? 1 : 0);
if (first) if (first)
@@ -265,7 +246,7 @@ bool wxGIFHandler::DoSaveFile(const wxImage& image, wxOutputStream *stream,
} }
const wxUint8 *src = image.GetData(); const wxUint8 *src = image.GetData();
wxUint8 *eightBitData = new wxUint8[width]; wxScopedArray<wxUint8> eightBitData(width);
SetupCompress(stream, 8); SetupCompress(stream, 8);
@@ -285,15 +266,13 @@ bool wxGIFHandler::DoSaveFile(const wxImage& image, wxOutputStream *stream,
src+=3; src+=3;
} }
ok = CompressLine(stream, eightBitData, width); ok = CompressLine(stream, eightBitData.get(), width);
if (!ok) if (!ok)
{ {
break; break;
} }
} }
delete [] eightBitData;
wxDELETE(m_hashTable); wxDELETE(m_hashTable);
return ok; return ok;

View File

@@ -1680,6 +1680,8 @@ wxCairoContext::wxCairoContext( wxGraphicsRenderer* renderer, const wxPrinterDC&
cairo_t* cr = static_cast<cairo_t*>(impl->GetCairoContext()); cairo_t* cr = static_cast<cairo_t*>(impl->GetCairoContext());
if (cr) if (cr)
Init(cairo_reference(cr)); Init(cairo_reference(cr));
else
m_context = NULL;
#endif #endif
wxSize sz = dc.GetSize(); wxSize sz = dc.GetSize();
m_width = sz.x; m_width = sz.x;

View File

@@ -414,6 +414,7 @@ private:
case Field_Max: case Field_Max:
wxFAIL_MSG( "Invalid field" ); wxFAIL_MSG( "Invalid field" );
return;
} }
UpdateText(); UpdateText();

View File

@@ -174,6 +174,10 @@ wxDateTimeWidgetImpl::CreateDateTimePicker(wxDateTimePickerCtrl* wxpeer,
{ {
[v setDateValue: NSDateFromWX(dt)]; [v setDateValue: NSDateFromWX(dt)];
} }
else
{
[v setDateValue: [NSDate date]];
}
wxDateTimeWidgetImpl* c = new wxDateTimeWidgetCocoaImpl(wxpeer, v); wxDateTimeWidgetImpl* c = new wxDateTimeWidgetCocoaImpl(wxpeer, v);
#if !wxOSX_USE_NATIVE_FLIPPED #if !wxOSX_USE_NATIVE_FLIPPED

View File

@@ -1770,7 +1770,7 @@ void wxPropertyGrid::CorrectEditorWidgetSizeX()
// Use fixed selColumn 1 for main editor widgets // Use fixed selColumn 1 for main editor widgets
int newSplitterx = m_pState->DoGetSplitterPosition(0); int newSplitterx = m_pState->DoGetSplitterPosition(0);
int newWidth = newSplitterx + m_pState->m_colWidths[1]; int newWidth = newSplitterx + m_pState->GetColumnWidth(1);
if ( m_wndEditor2 ) if ( m_wndEditor2 )
{ {

View File

@@ -457,7 +457,7 @@ bool wxPropertyGridManager::Create( wxWindow *parent,
m_pPropGrid = CreatePropertyGrid(); m_pPropGrid = CreatePropertyGrid();
bool res = wxPanel::Create( parent, id, pos, size, bool res = wxPanel::Create( parent, id, pos, size,
(style&0xFFFF0000)|wxWANTS_CHARS, (style & wxWINDOW_STYLE_MASK)|wxWANTS_CHARS,
name ); name );
Init2(style); Init2(style);
@@ -515,7 +515,7 @@ void wxPropertyGridManager::Init1()
wxCLIP_CHILDREN) wxCLIP_CHILDREN)
// Which flags can be passed to underlying wxPropertyGrid. // Which flags can be passed to underlying wxPropertyGrid.
#define wxPG_MAN_PASS_FLAGS_MASK (0xFFF0|wxTAB_TRAVERSAL) #define wxPG_MAN_PASS_FLAGS_MASK (wxPG_WINDOW_STYLE_MASK|wxTAB_TRAVERSAL)
// //
// Initialize after parent etc. set // Initialize after parent etc. set
@@ -526,7 +526,7 @@ void wxPropertyGridManager::Init2( int style )
if ( m_iFlags & wxPG_FL_INITIALIZED ) if ( m_iFlags & wxPG_FL_INITIALIZED )
return; return;
m_windowStyle |= (style&0x0000FFFF); m_windowStyle |= (style & wxPG_WINDOW_STYLE_MASK);
wxSize csz = GetClientSize(); wxSize csz = GetClientSize();
@@ -575,7 +575,7 @@ void wxPropertyGridManager::Init2( int style )
m_pPropGrid->SetId(useId); m_pPropGrid->SetId(useId);
m_pPropGrid->m_iFlags |= wxPG_FL_IN_MANAGER; m_pPropGrid->SetInternalFlag(wxPG_FL_IN_MANAGER);
m_pState = m_pPropGrid->m_pState; m_pState = m_pPropGrid->m_pState;
@@ -690,7 +690,7 @@ void wxPropertyGridManager::DoThaw()
void wxPropertyGridManager::SetWindowStyleFlag( long style ) void wxPropertyGridManager::SetWindowStyleFlag( long style )
{ {
int oldWindowStyle = GetWindowStyleFlag(); long oldWindowStyle = GetWindowStyleFlag();
wxWindow::SetWindowStyleFlag( style ); wxWindow::SetWindowStyleFlag( style );
m_pPropGrid->SetWindowStyleFlag( (m_pPropGrid->GetWindowStyleFlag()&~(wxPG_MAN_PASS_FLAGS_MASK)) | m_pPropGrid->SetWindowStyleFlag( (m_pPropGrid->GetWindowStyleFlag()&~(wxPG_MAN_PASS_FLAGS_MASK)) |
@@ -1122,10 +1122,11 @@ bool wxPropertyGridManager::IsPropertySelected( wxPGPropArg id ) const
wxPGProperty* wxPropertyGridManager::GetPageRoot( int index ) const wxPGProperty* wxPropertyGridManager::GetPageRoot( int index ) const
{ {
wxASSERT( index >= 0 ); wxCHECK_MSG( (index >= 0) && (index < (int)m_arrPages.size()),
wxASSERT( index < (int)m_arrPages.size() ); NULL,
wxT("invalid page index") );
return m_arrPages[index]->GetStatePtr()->m_properties; return m_arrPages[index]->GetRoot();
} }
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
@@ -1260,7 +1261,7 @@ void wxPropertyGridManager::UpdateDescriptionBox( int new_splittery, int new_wid
use_hei--; use_hei--;
// Fix help control positions. // Fix help control positions.
int cap_hei = m_pPropGrid->m_fontHeight; int cap_hei = m_pPropGrid->GetFontHeight();
int cap_y = new_splittery+m_splitterHeight+5; int cap_y = new_splittery+m_splitterHeight+5;
int cnt_y = cap_y+cap_hei+3; int cnt_y = cap_y+cap_hei+3;
int sub_cap_hei = cap_y+cap_hei-use_hei; int sub_cap_hei = cap_y+cap_hei-use_hei;
@@ -1350,7 +1351,7 @@ void wxPropertyGridManager::RecalculatePositions( int width, int height )
} }
// Check if beyond minimum. // Check if beyond minimum.
int nspy_min = propgridY + m_pPropGrid->m_lineHeight; int nspy_min = propgridY + m_pPropGrid->GetRowHeight();
if ( new_splittery < nspy_min ) if ( new_splittery < nspy_min )
new_splittery = nspy_min; new_splittery = nspy_min;
@@ -1632,7 +1633,7 @@ void wxPropertyGridManager::RecreateControls()
if ( m_windowStyle & wxPG_DESCRIPTION ) if ( m_windowStyle & wxPG_DESCRIPTION )
{ {
// Has help box. // Has help box.
m_pPropGrid->m_iFlags |= (wxPG_FL_NOSTATUSBARHELP); m_pPropGrid->SetInternalFlag(wxPG_FL_NOSTATUSBARHELP);
if ( !m_pTxtHelpCaption ) if ( !m_pTxtHelpCaption )
{ {
@@ -1642,7 +1643,7 @@ void wxPropertyGridManager::RecreateControls()
wxDefaultPosition, wxDefaultPosition,
wxDefaultSize, wxDefaultSize,
wxALIGN_LEFT|wxST_NO_AUTORESIZE); wxALIGN_LEFT|wxST_NO_AUTORESIZE);
m_pTxtHelpCaption->SetFont( m_pPropGrid->m_captionFont ); m_pTxtHelpCaption->SetFont(m_pPropGrid->GetCaptionFont());
m_pTxtHelpCaption->SetCursor( *wxSTANDARD_CURSOR ); m_pTxtHelpCaption->SetCursor( *wxSTANDARD_CURSOR );
} }
if ( !m_pTxtHelpContent ) if ( !m_pTxtHelpContent )
@@ -1661,7 +1662,7 @@ void wxPropertyGridManager::RecreateControls()
else else
{ {
// No help box. // No help box.
m_pPropGrid->m_iFlags &= ~(wxPG_FL_NOSTATUSBARHELP); m_pPropGrid->ClearInternalFlag(wxPG_FL_NOSTATUSBARHELP);
if ( m_pTxtHelpCaption ) if ( m_pTxtHelpCaption )
m_pTxtHelpCaption->Destroy(); m_pTxtHelpCaption->Destroy();
@@ -1726,7 +1727,7 @@ void wxPropertyGridManager::OnToolbarClick( wxCommandEvent &event )
if ( id == m_categorizedModeToolId ) if ( id == m_categorizedModeToolId )
{ {
// Categorized mode. // Categorized mode.
if ( m_pPropGrid->m_windowStyle & wxPG_HIDE_CATEGORIES ) if ( m_pPropGrid->HasFlag(wxPG_HIDE_CATEGORIES) )
{ {
if ( !m_pPropGrid->HasInternalFlag(wxPG_FL_CATMODE_AUTO_SORT) ) if ( !m_pPropGrid->HasInternalFlag(wxPG_FL_CATMODE_AUTO_SORT) )
m_pPropGrid->m_windowStyle &= ~wxPG_AUTO_SORT; m_pPropGrid->m_windowStyle &= ~wxPG_AUTO_SORT;
@@ -1736,7 +1737,7 @@ void wxPropertyGridManager::OnToolbarClick( wxCommandEvent &event )
else if ( id == m_alphabeticModeToolId ) else if ( id == m_alphabeticModeToolId )
{ {
// Alphabetic mode. // Alphabetic mode.
if ( !(m_pPropGrid->m_windowStyle & wxPG_HIDE_CATEGORIES) ) if ( !m_pPropGrid->HasFlag(wxPG_HIDE_CATEGORIES) )
{ {
if ( m_pPropGrid->HasFlag(wxPG_AUTO_SORT) ) if ( m_pPropGrid->HasFlag(wxPG_AUTO_SORT) )
m_pPropGrid->SetInternalFlag(wxPG_FL_CATMODE_AUTO_SORT); m_pPropGrid->SetInternalFlag(wxPG_FL_CATMODE_AUTO_SORT);
@@ -1867,8 +1868,8 @@ void wxPropertyGridManager::SetSplitterLeft( bool subProps, bool allPages )
for ( i=0; i<GetPageCount(); i++ ) for ( i=0; i<GetPageCount(); i++ )
{ {
int maxW = m_pState->GetColumnFitWidth(dc, m_arrPages[i]->m_properties, 0, subProps ); int maxW = m_pState->GetColumnFitWidth(dc, m_arrPages[i]->DoGetRoot(), 0, subProps );
maxW += m_pPropGrid->m_marginWidth; maxW += m_pPropGrid->GetMarginWidth();
if ( maxW > highest ) if ( maxW > highest )
highest = maxW; highest = maxW;
m_pState->m_dontCenterSplitter = true; m_pState->m_dontCenterSplitter = true;
@@ -1894,8 +1895,8 @@ void wxPropertyGridManager::SetPageSplitterLeft(int page, bool subProps)
wxClientDC dc(this); wxClientDC dc(this);
dc.SetFont(m_pPropGrid->GetFont()); dc.SetFont(m_pPropGrid->GetFont());
int maxW = m_pState->GetColumnFitWidth(dc, m_arrPages[page]->m_properties, 0, subProps ); int maxW = m_pState->GetColumnFitWidth(dc, m_arrPages[page]->DoGetRoot(), 0, subProps );
maxW += m_pPropGrid->m_marginWidth; maxW += m_pPropGrid->GetMarginWidth();
SetPageSplitterPosition( page, maxW ); SetPageSplitterPosition( page, maxW );
#if wxUSE_HEADERCTRL #if wxUSE_HEADERCTRL
@@ -1965,7 +1966,7 @@ void wxPropertyGridManager::OnResize( wxSizeEvent& WXUNUSED(event) )
RecalculatePositions(width, height); RecalculatePositions(width, height);
if ( m_pPropGrid && m_pPropGrid->m_parent ) if ( m_pPropGrid && m_pPropGrid->GetParent() )
{ {
int pgWidth, pgHeight; int pgWidth, pgHeight;
m_pPropGrid->GetClientSize(&pgWidth, &pgHeight); m_pPropGrid->GetClientSize(&pgWidth, &pgHeight);
@@ -1977,7 +1978,7 @@ void wxPropertyGridManager::OnResize( wxSizeEvent& WXUNUSED(event) )
if ( page != m_pPropGrid->GetState() ) if ( page != m_pPropGrid->GetState() )
{ {
page->OnClientWidthChange(pgWidth, page->OnClientWidthChange(pgWidth,
pgWidth - page->m_width, pgWidth - page->GetVirtualWidth(),
true); true);
} }
} }
@@ -2014,7 +2015,7 @@ void wxPropertyGridManager::OnMouseMove( wxMouseEvent &event )
// Calculate drag limits // Calculate drag limits
int bottom_limit = m_height - m_splitterHeight + 1; int bottom_limit = m_height - m_splitterHeight + 1;
int top_limit = m_pPropGrid->m_lineHeight; int top_limit = m_pPropGrid->GetRowHeight();
#if wxUSE_TOOLBAR #if wxUSE_TOOLBAR
if ( m_pToolbar ) top_limit += m_pToolbar->GetSize().y; if ( m_pToolbar ) top_limit += m_pToolbar->GetSize().y;
#endif #endif

View File

@@ -327,10 +327,12 @@ bool wxPropertyGrid::Create( wxWindow *parent,
style |= wxWANTS_CHARS; style |= wxWANTS_CHARS;
wxControl::Create(parent, id, pos, size, wxControl::Create(parent, id, pos, size,
style | wxScrolledWindowStyle, (style & wxWINDOW_STYLE_MASK) | wxScrolledWindowStyle,
wxDefaultValidator, wxDefaultValidator,
name); name);
m_windowStyle |= (style & wxPG_WINDOW_STYLE_MASK);
Init2(); Init2();
return true; return true;
@@ -720,7 +722,7 @@ bool wxPropertyGrid::DoAddToSelection( wxPGProperty* prop, int selFlags )
wxArrayPGProperty& selection = m_pState->m_selection; wxArrayPGProperty& selection = m_pState->m_selection;
if ( !selection.size() ) if ( selection.empty() )
{ {
return DoSelectProperty(prop, selFlags); return DoSelectProperty(prop, selFlags);
} }
@@ -933,7 +935,7 @@ bool wxPropertyGrid::AddToSelectionFromInputEvent( wxPGProperty* prop,
void wxPropertyGrid::DoSetSelection( const wxArrayPGProperty& newSelection, void wxPropertyGrid::DoSetSelection( const wxArrayPGProperty& newSelection,
int selFlags ) int selFlags )
{ {
if ( newSelection.size() > 0 ) if ( !newSelection.empty() )
{ {
if ( !DoSelectProperty(newSelection[0], selFlags) ) if ( !DoSelectProperty(newSelection[0], selFlags) )
return; return;
@@ -1200,13 +1202,13 @@ wxSize wxPropertyGrid::DoGetBestSize() const
// make it too small neither // make it too small neither
int numLines = wxMin int numLines = wxMin
( (
wxMax(m_pState->m_properties->GetChildCount(), 3), wxMax(m_pState->DoGetRoot()->GetChildCount(), 3),
10 10
); );
wxClientDC dc(const_cast<wxPropertyGrid *>(this)); wxClientDC dc(const_cast<wxPropertyGrid *>(this));
int width = m_marginWidth; int width = m_marginWidth;
for ( unsigned int i = 0; i < m_pState->m_colWidths.size(); i++ ) for ( unsigned int i = 0; i < m_pState->GetColumnCount(); i++ )
{ {
width += m_pState->GetColumnFitWidth(dc, m_pState->DoGetRoot(), i, true); width += m_pState->GetColumnFitWidth(dc, m_pState->DoGetRoot(), i, true);
} }
@@ -1645,7 +1647,7 @@ bool wxPropertyGrid::EnsureVisible( wxPGPropArg id )
wxPGProperty* parent = p->GetParent(); wxPGProperty* parent = p->GetParent();
wxPGProperty* grandparent = parent->GetParent(); wxPGProperty* grandparent = parent->GetParent();
if ( grandparent && grandparent != m_pState->m_properties ) if ( grandparent && grandparent != m_pState->DoGetRoot() )
Expand( grandparent ); Expand( grandparent );
Expand( parent ); Expand( parent );
@@ -1848,7 +1850,7 @@ wxPGProperty* wxPropertyGrid::DoGetItemAtY( int y ) const
return NULL; return NULL;
unsigned int a = 0; unsigned int a = 0;
return m_pState->m_properties->GetItemAtY(y, m_lineHeight, &a); return m_pState->DoGetRoot()->GetItemAtY(y, m_lineHeight, &a);
} }
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
@@ -2008,7 +2010,7 @@ void wxPropertyGrid::DrawItems( wxDC& dc,
if ( !itemsRect ) if ( !itemsRect )
{ {
tempItemsRect = wxRect(0, topItemY, tempItemsRect = wxRect(0, topItemY,
m_pState->m_width, m_pState->GetVirtualWidth(),
bottomItemY); bottomItemY);
itemsRect = &tempItemsRect; itemsRect = &tempItemsRect;
} }
@@ -2021,7 +2023,7 @@ void wxPropertyGrid::DrawItems( wxDC& dc,
// items added check // items added check
if ( m_pState->m_itemsAdded ) PrepareAfterItemsAdded(); if ( m_pState->m_itemsAdded ) PrepareAfterItemsAdded();
if ( m_pState->m_properties->GetChildCount() > 0 ) if ( m_pState->DoGetRoot()->GetChildCount() > 0 )
{ {
// paintFinishY and drawBottomY are in buffer/physical space // paintFinishY and drawBottomY are in buffer/physical space
int paintFinishY = DoDrawItems(dc, itemsRect); int paintFinishY = DoDrawItems(dc, itemsRect);
@@ -2076,7 +2078,7 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc,
wxCHECK_MSG( !m_pState->m_itemsAdded, itemsRect->y, wxCHECK_MSG( !m_pState->m_itemsAdded, itemsRect->y,
"no items added" ); "no items added" );
wxASSERT( m_pState->m_properties->GetChildCount() ); wxASSERT( m_pState->DoGetRoot()->GetChildCount() );
int lh = m_lineHeight; int lh = m_lineHeight;
@@ -2172,6 +2174,7 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc,
const wxPGProperty* firstSelected = GetSelection(); const wxPGProperty* firstSelected = GetSelection();
const wxPropertyGridPageState* state = m_pState; const wxPropertyGridPageState* state = m_pState;
const wxArrayInt& colWidths = state->m_colWidths; const wxArrayInt& colWidths = state->m_colWidths;
const unsigned int colCount = state->GetColumnCount();
// TODO: Only render columns that are within clipping region. // TODO: Only render columns that are within clipping region.
@@ -2205,7 +2208,7 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc,
wxPGProperty* nextP = visPropArray[0]; wxPGProperty* nextP = visPropArray[0];
int gridWidth = state->m_width; int gridWidth = state->GetVirtualWidth();
y = firstItemTopY; y = firstItemTopY;
for ( unsigned int arrInd=1; for ( unsigned int arrInd=1;
@@ -2226,7 +2229,7 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc,
int greyDepthX = greyDepth - xRelMod; int greyDepthX = greyDepth - xRelMod;
// Use basic depth if in non-categoric mode and parent is base array. // Use basic depth if in non-categoric mode and parent is base array.
if ( !(windowStyle & wxPG_HIDE_CATEGORIES) || p->GetParent() != m_pState->m_properties ) if ( !(windowStyle & wxPG_HIDE_CATEGORIES) || p->GetParent() != m_pState->DoGetRoot() )
{ {
textMarginHere += ((p->GetDepth()-1)*m_subgroup_extramargin); textMarginHere += ((p->GetDepth()-1)*m_subgroup_extramargin);
} }
@@ -2267,7 +2270,7 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc,
unsigned int si; unsigned int si;
int sx = x; int sx = x;
for ( si=0; si<colWidths.size(); si++ ) for ( si = 0; si < colCount; si++ )
{ {
sx += colWidths[si]; sx += colWidths[si];
dc.DrawLine( sx, y, sx, y2 ); dc.DrawLine( sx, y, sx, y2 );
@@ -2405,14 +2408,14 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc,
// Calculate cellRect.x for the last cell // Calculate cellRect.x for the last cell
unsigned int ci = 0; unsigned int ci = 0;
int cellX = x + 1; int cellX = x + 1;
for ( ci=0; ci<colWidths.size(); ci++ ) for ( ci = 0; ci < colCount; ci++ )
cellX += colWidths[ci]; cellX += colWidths[ci];
cellRect.x = cellX; cellRect.x = cellX;
// Draw cells from back to front so that we can easily tell if the // Draw cells from back to front so that we can easily tell if the
// cell on the right was empty from text // cell on the right was empty from text
bool prevFilled = true; bool prevFilled = true;
ci = colWidths.size(); ci = colCount;
do do
{ {
ci--; ci--;
@@ -2546,7 +2549,7 @@ wxRect wxPropertyGrid::GetPropertyRect( const wxPGProperty* p1, const wxPGProper
wxRect r; wxRect r;
if ( m_width < 10 || m_height < 10 || if ( m_width < 10 || m_height < 10 ||
!m_pState->m_properties->GetChildCount() || !m_pState->DoGetRoot()->GetChildCount() ||
p1 == NULL ) p1 == NULL )
return wxRect(0,0,0,0); return wxRect(0,0,0,0);
@@ -2582,7 +2585,7 @@ wxRect wxPropertyGrid::GetPropertyRect( const wxPGProperty* p1, const wxPGProper
} }
} }
return wxRect(0,visTop-vy,m_pState->m_width,visBottom-visTop); return wxRect(0,visTop-vy,m_pState->GetVirtualWidth(),visBottom-visTop);
} }
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
@@ -2773,7 +2776,7 @@ void wxPropertyGrid::SwitchState( wxPropertyGridPageState* pNewState )
if ( HasVirtualWidth() ) if ( HasVirtualWidth() )
{ {
int minWidth = pgWidth; int minWidth = pgWidth;
if ( pNewState->m_width < minWidth ) if ( pNewState->GetVirtualWidth() < minWidth )
{ {
pNewState->m_width = minWidth; pNewState->m_width = minWidth;
pNewState->CheckColumnWidths(); pNewState->CheckColumnWidths();
@@ -2787,7 +2790,7 @@ void wxPropertyGrid::SwitchState( wxPropertyGridPageState* pNewState )
// pNewState->m_fSplitterX = -1.0; // pNewState->m_fSplitterX = -1.0;
pNewState->OnClientWidthChange(pgWidth, pNewState->OnClientWidthChange(pgWidth,
pgWidth - pNewState->m_width); pgWidth - pNewState->GetVirtualWidth());
} }
m_propHover = NULL; m_propHover = NULL;
@@ -3751,7 +3754,7 @@ wxRect wxPropertyGrid::GetEditorWidgetRect( wxPGProperty* p, int column ) const
{ {
int itemy = p->GetY2(m_lineHeight); int itemy = p->GetY2(m_lineHeight);
int splitterX = m_pState->DoGetSplitterPosition(column-1); int splitterX = m_pState->DoGetSplitterPosition(column-1);
int colEnd = splitterX + m_pState->m_colWidths[column]; int colEnd = splitterX + m_pState->GetColumnWidth(column);
int imageOffset = 0; int imageOffset = 0;
int vx, vy; // Top left corner of client int vx, vy; // Top left corner of client
@@ -4063,10 +4066,7 @@ bool wxPropertyGrid::DoSelectProperty( wxPGProperty* p, unsigned int flags )
wxArrayPGProperty prevSelection = m_pState->m_selection; wxArrayPGProperty prevSelection = m_pState->m_selection;
wxPGProperty* prevFirstSel; wxPGProperty* prevFirstSel;
if ( prevSelection.size() > 0 ) prevFirstSel = prevSelection.empty()? NULL: prevSelection[0];
prevFirstSel = prevSelection[0];
else
prevFirstSel = NULL;
if ( prevFirstSel && prevFirstSel->HasFlag(wxPG_PROP_BEING_DELETED) ) if ( prevFirstSel && prevFirstSel->HasFlag(wxPG_PROP_BEING_DELETED) )
prevFirstSel = NULL; prevFirstSel = NULL;
@@ -4581,7 +4581,7 @@ void wxPropertyGrid::RecalculateVirtualSize( int forceXPos )
m_iFlags |= wxPG_FL_RECALCULATING_VIRTUAL_SIZE; m_iFlags |= wxPG_FL_RECALCULATING_VIRTUAL_SIZE;
int x = m_pState->m_width; int x = m_pState->GetVirtualWidth();
int y = m_pState->m_virtualHeight; int y = m_pState->m_virtualHeight;
int width, height; int width, height;
@@ -4656,9 +4656,8 @@ void wxPropertyGrid::OnResize( wxSizeEvent& event )
if ( !m_doubleBuffer ) if ( !m_doubleBuffer )
{ {
// Create double buffer bitmap to draw on, if none // Create double buffer bitmap to draw on, if none
int w = (width>250)?width:250; int w = wxMax(width, 250);
int h = height + dblh; int h = wxMax(height + dblh, 400);
h = (h>400)?h:400;
m_doubleBuffer = new wxBitmap( w, h ); m_doubleBuffer = new wxBitmap( w, h );
} }
else else
@@ -5035,7 +5034,7 @@ bool wxPropertyGrid::HandleMouseMove( int x, unsigned int y,
if ( m_dragStatus > 0 ) if ( m_dragStatus > 0 )
{ {
if ( x > (m_marginWidth + wxPG_DRAG_MARGIN) && if ( x > (m_marginWidth + wxPG_DRAG_MARGIN) &&
x < (m_pState->m_width - wxPG_DRAG_MARGIN) ) x < (m_pState->GetVirtualWidth() - wxPG_DRAG_MARGIN) )
{ {
int newSplitterX = x - m_dragOffset; int newSplitterX = x - m_dragOffset;
@@ -6249,7 +6248,7 @@ void wxPGChoicesData::Clear()
void wxPGChoicesData::CopyDataFrom( wxPGChoicesData* data ) void wxPGChoicesData::CopyDataFrom( wxPGChoicesData* data )
{ {
wxASSERT( m_items.size() == 0 ); wxASSERT( m_items.empty() );
m_items = data->m_items; m_items = data->m_items;
} }

View File

@@ -1036,7 +1036,7 @@ bool wxPropertyGridInterface::RestoreEditableState( const wxString& src, int res
{ {
if ( restoreStates & SelectionState ) if ( restoreStates & SelectionState )
{ {
if ( values.size() > 0 ) if ( !values.empty() )
{ {
if ( pageState->IsDisplayed() ) if ( pageState->IsDisplayed() )
{ {

View File

@@ -764,7 +764,7 @@ wxPGProperty* wxPropertyGridPageState::DoGetItemAtY( int y ) const
return NULL; return NULL;
unsigned int a = 0; unsigned int a = 0;
return m_properties->GetItemAtY(y, GetGrid()->m_lineHeight, &a); return m_properties->GetItemAtY(y, GetGrid()->GetRowHeight(), &a);
} }
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
@@ -849,7 +849,7 @@ int wxPropertyGridPageState::GetColumnFullWidth( wxClientDC &dc, wxPGProperty *p
int wxPropertyGridPageState::DoGetSplitterPosition( int splitterColumn ) const int wxPropertyGridPageState::DoGetSplitterPosition( int splitterColumn ) const
{ {
int n = GetGrid()->m_marginWidth; int n = GetGrid()->GetMarginWidth();
int i; int i;
for ( i=0; i<=splitterColumn; i++ ) for ( i=0; i<=splitterColumn; i++ )
n += m_colWidths[i]; n += m_colWidths[i];
@@ -961,7 +961,7 @@ void wxPropertyGridPageState::SetSplitterLeft( bool subProps )
if ( maxW > 0 ) if ( maxW > 0 )
{ {
maxW += pg->m_marginWidth; maxW += pg->GetMarginWidth();
DoSetSplitterPosition( maxW ); DoSetSplitterPosition( maxW );
} }
@@ -974,7 +974,7 @@ wxSize wxPropertyGridPageState::DoFitColumns( bool WXUNUSED(allowGridResize) )
wxClientDC dc(pg); wxClientDC dc(pg);
dc.SetFont(pg->GetFont()); dc.SetFont(pg->GetFont());
int marginWidth = pg->m_marginWidth; int marginWidth = pg->GetMarginWidth();
int accWid = marginWidth; int accWid = marginWidth;
int maxColWidth = 500; int maxColWidth = 500;
@@ -1051,7 +1051,7 @@ void wxPropertyGridPageState::CheckColumnWidths( int widthChange )
} }
} }
int colsWidth = pg->m_marginWidth; int colsWidth = pg->GetMarginWidth();
for ( i=0; i<m_colWidths.size(); i++ ) for ( i=0; i<m_colWidths.size(); i++ )
colsWidth += m_colWidths[i]; colsWidth += m_colWidths[i];
@@ -1224,7 +1224,7 @@ void wxPropertyGridPageState::DoSetColumnProportion( unsigned int column,
// Returns column index, -1 for margin // Returns column index, -1 for margin
int wxPropertyGridPageState::HitTestH( int x, int* pSplitterHit, int* pSplitterHitOffset ) const int wxPropertyGridPageState::HitTestH( int x, int* pSplitterHit, int* pSplitterHitOffset ) const
{ {
int cx = GetGrid()->m_marginWidth; int cx = GetGrid()->GetMarginWidth();
int col = -1; int col = -1;
int prevSplitter = -1; int prevSplitter = -1;
@@ -1381,11 +1381,7 @@ void wxPropertyGridPageState::DoRemoveFromSelection( wxPGProperty* prop )
wxArrayPGProperty sel = m_selection; wxArrayPGProperty sel = m_selection;
sel.erase( sel.begin() + i ); sel.erase( sel.begin() + i );
wxPGProperty* newFirst; wxPGProperty* newFirst = sel.empty()? NULL: sel[0];
if ( sel.size() )
newFirst = sel[0];
else
newFirst = NULL;
pg->DoSelectProperty(newFirst, pg->DoSelectProperty(newFirst,
wxPG_SEL_DONT_SEND_EVENT); wxPG_SEL_DONT_SEND_EVENT);

View File

@@ -1207,7 +1207,7 @@ wxEnumProperty::wxEnumProperty( const wxString& label, const wxString& name,
{ {
SetIndex(0); SetIndex(0);
if ( &labels && labels.size() ) if ( &labels && !labels.empty() )
{ {
m_choices.Set(labels, values); m_choices.Set(labels, values);
@@ -1595,7 +1595,7 @@ wxFlagsProperty::wxFlagsProperty( const wxString& label, const wxString& name,
{ {
m_oldChoicesData = NULL; m_oldChoicesData = NULL;
if ( &labels && labels.size() ) if ( &labels && !labels.empty() )
{ {
m_choices.Set(labels,values); m_choices.Set(labels,values);

View File

@@ -2407,7 +2407,6 @@ bool wxRichTextParagraphLayoutBox::Layout(wxDC& dc, wxRichTextDrawingContext& co
// Check the bottom edge of any floating object // Check the bottom edge of any floating object
if (wxRichTextBuffer::GetFloatingLayoutMode() && GetFloatCollector() && GetFloatCollector()->HasFloats()) if (wxRichTextBuffer::GetFloatingLayoutMode() && GetFloatCollector() && GetFloatCollector()->HasFloats())
{ {
int bottom = GetFloatCollector()->GetLastRectBottom();
// The floating objects are positioned relative to entire buffer, not this box // The floating objects are positioned relative to entire buffer, not this box
int maxFloatHeight = GetFloatCollector()->GetLastRectBottom() - GetPosition().y - topMargin; int maxFloatHeight = GetFloatCollector()->GetLastRectBottom() - GetPosition().y - topMargin;
if (maxFloatHeight > maxHeight) if (maxFloatHeight > maxHeight)

View File

@@ -192,7 +192,6 @@ void* wxJoystickThread::Entry()
} }
} }
close(m_device);
return NULL; return NULL;
} }
@@ -231,7 +230,8 @@ wxJoystick::~wxJoystick()
ReleaseCapture(); ReleaseCapture();
if (m_thread) if (m_thread)
m_thread->Delete(); // It's detached so it will delete itself m_thread->Delete(); // It's detached so it will delete itself
m_device = -1; if (m_device != -1)
close(m_device);
} }