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++ )
{
if ( nargs++ == wxMAX_SVNPRINTF_ARGUMENTS )
if ( ++nargs == wxMAX_SVNPRINTF_ARGUMENTS )
break;
// TODO: we need to support specifiers of the form "%2$*1$s"
@@ -870,6 +870,11 @@ struct wxPrintfConvSpecParser
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...
pspec[spec->m_pos] = spec;
if ( nargs++ == wxMAX_SVNPRINTF_ARGUMENTS )
if ( ++nargs == wxMAX_SVNPRINTF_ARGUMENTS )
break;
}

View File

@@ -229,7 +229,14 @@ wxPG_DESCRIPTION = 0x00002000,
/** wxPropertyGridManager only: don't show an internal border around the
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
@@ -344,7 +351,11 @@ wxPG_EX_ALWAYS_ALLOW_FOCUS = 0x00100000,
/** 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
@@ -983,7 +994,7 @@ public:
*/
unsigned int GetColumnCount() const
{
return (unsigned int) m_pState->m_colWidths.size();
return m_pState->GetColumnCount();
}
/** Returns colour of empty space below properties. */

View File

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

View File

@@ -9,19 +9,27 @@
expected_abi_file="expected_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
# IMPORTANT: we need a shared build of wxWidgets to proceed
if [[ $(echo *.so) == "*.so" ]]; then
echo "No shared objects (*.so) were found... aborting"
if [[ $(echo $file_mask) == "$file_mask" ]]; then
echo "No shared objects ($file_mask) were found... aborting"
exit 1
fi
# generated the "expected ABI" for later comparison
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
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
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\")..."
# IMPORTANT: we need a shared build of wxWidgets to do the check
if [[ $(echo *.so) == "*.so" ]]; then
echo "No shared objects (*.so) were found... aborting"
if [[ $(echo $file_mask) == "*$file_mask" ]]; then
echo "No shared objects ($file_mask) were found... aborting"
exit 1
fi
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
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
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__)
platform = wxPLATFORM_WINDOWS;
#elif defined(__WXGTK__) || defined(__WXMOTIF__)
platform = wxPLATFORM_UNIX;
#elif defined(__WXMAC__)
platform = wxPLATFORM_MAC;
#else
platform = wxPLATFORM_UNIX;
#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 ;
const wxFontEncoding *f;
wxFontEncodingArray arr;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -457,7 +457,7 @@ bool wxPropertyGridManager::Create( wxWindow *parent,
m_pPropGrid = CreatePropertyGrid();
bool res = wxPanel::Create( parent, id, pos, size,
(style&0xFFFF0000)|wxWANTS_CHARS,
(style & wxWINDOW_STYLE_MASK)|wxWANTS_CHARS,
name );
Init2(style);
@@ -515,7 +515,7 @@ void wxPropertyGridManager::Init1()
wxCLIP_CHILDREN)
// 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
@@ -526,7 +526,7 @@ void wxPropertyGridManager::Init2( int style )
if ( m_iFlags & wxPG_FL_INITIALIZED )
return;
m_windowStyle |= (style&0x0000FFFF);
m_windowStyle |= (style & wxPG_WINDOW_STYLE_MASK);
wxSize csz = GetClientSize();
@@ -575,7 +575,7 @@ void wxPropertyGridManager::Init2( int style )
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;
@@ -690,7 +690,7 @@ void wxPropertyGridManager::DoThaw()
void wxPropertyGridManager::SetWindowStyleFlag( long style )
{
int oldWindowStyle = GetWindowStyleFlag();
long oldWindowStyle = GetWindowStyleFlag();
wxWindow::SetWindowStyleFlag( style );
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
{
wxASSERT( index >= 0 );
wxASSERT( index < (int)m_arrPages.size() );
wxCHECK_MSG( (index >= 0) && (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--;
// 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 cnt_y = cap_y+cap_hei+3;
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.
int nspy_min = propgridY + m_pPropGrid->m_lineHeight;
int nspy_min = propgridY + m_pPropGrid->GetRowHeight();
if ( new_splittery < nspy_min )
new_splittery = nspy_min;
@@ -1632,7 +1633,7 @@ void wxPropertyGridManager::RecreateControls()
if ( m_windowStyle & wxPG_DESCRIPTION )
{
// Has help box.
m_pPropGrid->m_iFlags |= (wxPG_FL_NOSTATUSBARHELP);
m_pPropGrid->SetInternalFlag(wxPG_FL_NOSTATUSBARHELP);
if ( !m_pTxtHelpCaption )
{
@@ -1642,7 +1643,7 @@ void wxPropertyGridManager::RecreateControls()
wxDefaultPosition,
wxDefaultSize,
wxALIGN_LEFT|wxST_NO_AUTORESIZE);
m_pTxtHelpCaption->SetFont( m_pPropGrid->m_captionFont );
m_pTxtHelpCaption->SetFont(m_pPropGrid->GetCaptionFont());
m_pTxtHelpCaption->SetCursor( *wxSTANDARD_CURSOR );
}
if ( !m_pTxtHelpContent )
@@ -1661,7 +1662,7 @@ void wxPropertyGridManager::RecreateControls()
else
{
// No help box.
m_pPropGrid->m_iFlags &= ~(wxPG_FL_NOSTATUSBARHELP);
m_pPropGrid->ClearInternalFlag(wxPG_FL_NOSTATUSBARHELP);
if ( m_pTxtHelpCaption )
m_pTxtHelpCaption->Destroy();
@@ -1726,7 +1727,7 @@ void wxPropertyGridManager::OnToolbarClick( wxCommandEvent &event )
if ( id == m_categorizedModeToolId )
{
// 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) )
m_pPropGrid->m_windowStyle &= ~wxPG_AUTO_SORT;
@@ -1736,7 +1737,7 @@ void wxPropertyGridManager::OnToolbarClick( wxCommandEvent &event )
else if ( id == m_alphabeticModeToolId )
{
// Alphabetic mode.
if ( !(m_pPropGrid->m_windowStyle & wxPG_HIDE_CATEGORIES) )
if ( !m_pPropGrid->HasFlag(wxPG_HIDE_CATEGORIES) )
{
if ( m_pPropGrid->HasFlag(wxPG_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++ )
{
int maxW = m_pState->GetColumnFitWidth(dc, m_arrPages[i]->m_properties, 0, subProps );
maxW += m_pPropGrid->m_marginWidth;
int maxW = m_pState->GetColumnFitWidth(dc, m_arrPages[i]->DoGetRoot(), 0, subProps );
maxW += m_pPropGrid->GetMarginWidth();
if ( maxW > highest )
highest = maxW;
m_pState->m_dontCenterSplitter = true;
@@ -1894,8 +1895,8 @@ void wxPropertyGridManager::SetPageSplitterLeft(int page, bool subProps)
wxClientDC dc(this);
dc.SetFont(m_pPropGrid->GetFont());
int maxW = m_pState->GetColumnFitWidth(dc, m_arrPages[page]->m_properties, 0, subProps );
maxW += m_pPropGrid->m_marginWidth;
int maxW = m_pState->GetColumnFitWidth(dc, m_arrPages[page]->DoGetRoot(), 0, subProps );
maxW += m_pPropGrid->GetMarginWidth();
SetPageSplitterPosition( page, maxW );
#if wxUSE_HEADERCTRL
@@ -1965,7 +1966,7 @@ void wxPropertyGridManager::OnResize( wxSizeEvent& WXUNUSED(event) )
RecalculatePositions(width, height);
if ( m_pPropGrid && m_pPropGrid->m_parent )
if ( m_pPropGrid && m_pPropGrid->GetParent() )
{
int pgWidth, pgHeight;
m_pPropGrid->GetClientSize(&pgWidth, &pgHeight);
@@ -1977,7 +1978,7 @@ void wxPropertyGridManager::OnResize( wxSizeEvent& WXUNUSED(event) )
if ( page != m_pPropGrid->GetState() )
{
page->OnClientWidthChange(pgWidth,
pgWidth - page->m_width,
pgWidth - page->GetVirtualWidth(),
true);
}
}
@@ -2014,7 +2015,7 @@ void wxPropertyGridManager::OnMouseMove( wxMouseEvent &event )
// Calculate drag limits
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 ( m_pToolbar ) top_limit += m_pToolbar->GetSize().y;
#endif

View File

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

View File

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

View File

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

View File

@@ -1207,7 +1207,7 @@ wxEnumProperty::wxEnumProperty( const wxString& label, const wxString& name,
{
SetIndex(0);
if ( &labels && labels.size() )
if ( &labels && !labels.empty() )
{
m_choices.Set(labels, values);
@@ -1595,7 +1595,7 @@ wxFlagsProperty::wxFlagsProperty( const wxString& label, const wxString& name,
{
m_oldChoicesData = NULL;
if ( &labels && labels.size() )
if ( &labels && !labels.empty() )
{
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
if (wxRichTextBuffer::GetFloatingLayoutMode() && GetFloatCollector() && GetFloatCollector()->HasFloats())
{
int bottom = GetFloatCollector()->GetLastRectBottom();
// The floating objects are positioned relative to entire buffer, not this box
int maxFloatHeight = GetFloatCollector()->GetLastRectBottom() - GetPosition().y - topMargin;
if (maxFloatHeight > maxHeight)

View File

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