Warning fixes and deprecated method elimination from ABX.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24494 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1031,11 +1031,7 @@ bool wxBoolListValidator::OnRetrieveValue(wxProperty *property, wxPropertyListVi
|
||||
return FALSE;
|
||||
|
||||
wxString value(view->GetValueText()->GetValue());
|
||||
bool boolValue = FALSE;
|
||||
if (value == wxT("True"))
|
||||
boolValue = TRUE;
|
||||
else
|
||||
boolValue = FALSE;
|
||||
bool boolValue = (value == wxT("True"));
|
||||
property->GetValue() = (bool)boolValue;
|
||||
return TRUE;
|
||||
}
|
||||
@@ -1258,7 +1254,7 @@ bool wxStringListValidator::OnDoubleClick( wxProperty *property,
|
||||
wxChar *s = node->GetData();
|
||||
if (wxStrcmp(s, currentString) == 0)
|
||||
{
|
||||
wxChar *nextString = NULL;
|
||||
wxChar *nextString;
|
||||
if (node->GetNext())
|
||||
nextString = node->GetNext()->GetData();
|
||||
else
|
||||
|
||||
@@ -164,13 +164,13 @@ wxItemResource::wxItemResource()
|
||||
|
||||
wxItemResource::~wxItemResource()
|
||||
{
|
||||
wxNode *node = m_children.First();
|
||||
wxNode *node = m_children.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxItemResource *item = (wxItemResource *)node->Data();
|
||||
wxItemResource *item = (wxItemResource *)node->GetData();
|
||||
delete item;
|
||||
delete node;
|
||||
node = m_children.First();
|
||||
node = m_children.GetFirst();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -215,11 +215,10 @@ bool wxResourceTable::DeleteResource(const wxString& name)
|
||||
// See if any resource has this as its child; if so, delete from
|
||||
// parent's child list.
|
||||
BeginFind();
|
||||
wxNode *node = (wxNode *) NULL;
|
||||
node = Next();
|
||||
wxNode *node = Next();
|
||||
while (node != NULL)
|
||||
{
|
||||
wxItemResource *parent = (wxItemResource *)node->Data();
|
||||
wxItemResource *parent = (wxItemResource *)node->GetData();
|
||||
if (parent->GetChildren().Member(item))
|
||||
{
|
||||
parent->GetChildren().DeleteObject(item);
|
||||
@@ -314,7 +313,7 @@ void wxResourceTable::ClearTable()
|
||||
while (node)
|
||||
{
|
||||
wxNode *next = Next();
|
||||
wxItemResource *item = (wxItemResource *)node->Data();
|
||||
wxItemResource *item = (wxItemResource *)node->GetData();
|
||||
delete item;
|
||||
delete node;
|
||||
node = next;
|
||||
@@ -464,17 +463,17 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c
|
||||
wxStringList& stringList = childResource->GetStringValues();
|
||||
wxString *strings = (wxString *) NULL;
|
||||
int noStrings = 0;
|
||||
if (stringList.Number() > 0)
|
||||
if (stringList.GetCount() > 0)
|
||||
{
|
||||
noStrings = stringList.Number();
|
||||
noStrings = stringList.GetCount();
|
||||
strings = new wxString[noStrings];
|
||||
wxNode *node = stringList.First();
|
||||
wxStringListNode *node = stringList.GetFirst();
|
||||
int i = 0;
|
||||
while (node)
|
||||
{
|
||||
strings[i] = (wxChar *)node->Data();
|
||||
strings[i] = (wxChar *)node->GetData();
|
||||
i ++;
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
}
|
||||
control = new wxListBox(parent, id, pos, size,
|
||||
@@ -488,17 +487,17 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c
|
||||
wxStringList& stringList = childResource->GetStringValues();
|
||||
wxString *strings = (wxString *) NULL;
|
||||
int noStrings = 0;
|
||||
if (stringList.Number() > 0)
|
||||
if (stringList.GetCount() > 0)
|
||||
{
|
||||
noStrings = stringList.Number();
|
||||
noStrings = stringList.GetCount();
|
||||
strings = new wxString[noStrings];
|
||||
wxNode *node = stringList.First();
|
||||
wxStringListNode *node = stringList.GetFirst();
|
||||
int i = 0;
|
||||
while (node)
|
||||
{
|
||||
strings[i] = (wxChar *)node->Data();
|
||||
strings[i] = (wxChar *)node->GetData();
|
||||
i ++;
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
}
|
||||
control = new wxChoice(parent, id, pos, size,
|
||||
@@ -513,17 +512,17 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c
|
||||
wxStringList& stringList = childResource->GetStringValues();
|
||||
wxString *strings = (wxString *) NULL;
|
||||
int noStrings = 0;
|
||||
if (stringList.Number() > 0)
|
||||
if (stringList.GetCount() > 0)
|
||||
{
|
||||
noStrings = stringList.Number();
|
||||
noStrings = stringList.GetCount();
|
||||
strings = new wxString[noStrings];
|
||||
wxNode *node = stringList.First();
|
||||
wxStringListNode *node = stringList.GetFirst();
|
||||
int i = 0;
|
||||
while (node)
|
||||
{
|
||||
strings[i] = (wxChar *)node->Data();
|
||||
strings[i] = (wxChar *)node->GetData();
|
||||
i ++;
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
}
|
||||
control = new wxComboBox(parent, id, childResource->GetValue4(), pos, size,
|
||||
@@ -538,17 +537,17 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c
|
||||
wxStringList& stringList = childResource->GetStringValues();
|
||||
wxString *strings = (wxString *) NULL;
|
||||
int noStrings = 0;
|
||||
if (stringList.Number() > 0)
|
||||
if (stringList.GetCount() > 0)
|
||||
{
|
||||
noStrings = stringList.Number();
|
||||
noStrings = stringList.GetCount();
|
||||
strings = new wxString[noStrings];
|
||||
wxNode *node = stringList.First();
|
||||
wxStringListNode *node = stringList.GetFirst();
|
||||
int i = 0;
|
||||
while (node)
|
||||
{
|
||||
strings[i] = (wxChar *)node->Data();
|
||||
strings[i] = (wxChar *)node->GetData();
|
||||
i ++;
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
}
|
||||
control = new wxRadioBox(parent, (wxWindowID) id, wxString(childResource->GetTitle()), pos, size,
|
||||
@@ -587,10 +586,10 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c
|
||||
|
||||
bool wxResourceInterpretResources(wxResourceTable& table, wxExprDatabase& db)
|
||||
{
|
||||
wxNode *node = db.First();
|
||||
wxNode *node = db.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxExpr *clause = (wxExpr *)node->Data();
|
||||
wxExpr *clause = (wxExpr *)node->GetData();
|
||||
wxString functor(clause->Functor());
|
||||
|
||||
wxItemResource *item = (wxItemResource *) NULL;
|
||||
@@ -616,7 +615,7 @@ bool wxResourceInterpretResources(wxResourceTable& table, wxExprDatabase& db)
|
||||
table.DeleteResource(item->GetName());
|
||||
table.AddResource(item);
|
||||
}
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
@@ -1543,7 +1542,7 @@ bool wxReallocateResourceBuffer()
|
||||
|
||||
static bool wxEatWhiteSpace(FILE *fd)
|
||||
{
|
||||
int ch = 0;
|
||||
int ch;
|
||||
|
||||
while ((ch = getc(fd)) != EOF)
|
||||
{
|
||||
@@ -2391,10 +2390,10 @@ wxBitmap wxResourceCreateBitmap(const wxString& resource, wxResourceTable *table
|
||||
wxItemResource *optResource = (wxItemResource *) NULL;
|
||||
|
||||
// Try to find optimum bitmap for this platform/colour depth
|
||||
wxNode *node = item->GetChildren().First();
|
||||
wxNode *node = item->GetChildren().GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxItemResource *child = (wxItemResource *)node->Data();
|
||||
wxItemResource *child = (wxItemResource *)node->GetData();
|
||||
int platform = (int)child->GetValue2();
|
||||
int noColours = (int)child->GetValue3();
|
||||
/*
|
||||
@@ -2465,7 +2464,7 @@ wxBitmap wxResourceCreateBitmap(const wxString& resource, wxResourceTable *table
|
||||
default:
|
||||
break;
|
||||
}
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
// If no matching resource, fail.
|
||||
if (!optResource)
|
||||
@@ -2545,10 +2544,10 @@ wxIcon wxResourceCreateIcon(const wxString& resource, wxResourceTable *table)
|
||||
wxItemResource *optResource = (wxItemResource *) NULL;
|
||||
|
||||
// Try to find optimum icon for this platform/colour depth
|
||||
wxNode *node = item->GetChildren().First();
|
||||
wxNode *node = item->GetChildren().GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxItemResource *child = (wxItemResource *)node->Data();
|
||||
wxItemResource *child = (wxItemResource *)node->GetData();
|
||||
int platform = (int)child->GetValue2();
|
||||
int noColours = (int)child->GetValue3();
|
||||
/*
|
||||
@@ -2619,7 +2618,7 @@ wxIcon wxResourceCreateIcon(const wxString& resource, wxResourceTable *table)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
// If no matching resource, fail.
|
||||
if (!optResource)
|
||||
@@ -2686,13 +2685,13 @@ wxIcon wxResourceCreateIcon(const wxString& resource, wxResourceTable *table)
|
||||
wxMenu *wxResourceCreateMenu(wxItemResource *item)
|
||||
{
|
||||
wxMenu *menu = new wxMenu;
|
||||
wxNode *node = item->GetChildren().First();
|
||||
wxNode *node = item->GetChildren().GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxItemResource *child = (wxItemResource *)node->Data();
|
||||
wxItemResource *child = (wxItemResource *)node->GetData();
|
||||
if ((child->GetType() != wxT("")) && (child->GetType() == wxT("wxMenuSeparator")))
|
||||
menu->AppendSeparator();
|
||||
else if (child->GetChildren().Number() > 0)
|
||||
else if (child->GetChildren().GetCount() > 0)
|
||||
{
|
||||
wxMenu *subMenu = wxResourceCreateMenu(child);
|
||||
if (subMenu)
|
||||
@@ -2702,7 +2701,7 @@ wxMenu *wxResourceCreateMenu(wxItemResource *item)
|
||||
{
|
||||
menu->Append((int)child->GetValue1(), child->GetTitle(), child->GetValue4(), (child->GetValue2() != 0));
|
||||
}
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
return menu;
|
||||
}
|
||||
@@ -2717,14 +2716,14 @@ wxMenuBar *wxResourceCreateMenuBar(const wxString& resource, wxResourceTable *ta
|
||||
{
|
||||
if (!menuBar)
|
||||
menuBar = new wxMenuBar;
|
||||
wxNode *node = menuResource->GetChildren().First();
|
||||
wxNode *node = menuResource->GetChildren().GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxItemResource *child = (wxItemResource *)node->Data();
|
||||
wxItemResource *child = (wxItemResource *)node->GetData();
|
||||
wxMenu *menu = wxResourceCreateMenu(child);
|
||||
if (menu)
|
||||
menuBar->Append(menu, child->GetTitle());
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
return menuBar;
|
||||
}
|
||||
@@ -2876,7 +2875,7 @@ static int ungetc_string()
|
||||
|
||||
bool wxEatWhiteSpaceString(char *s)
|
||||
{
|
||||
int ch = 0;
|
||||
int ch;
|
||||
|
||||
while ((ch = getc_string(s)) != EOF)
|
||||
{
|
||||
@@ -2889,7 +2888,6 @@ bool wxEatWhiteSpaceString(char *s)
|
||||
break;
|
||||
case '/':
|
||||
{
|
||||
int prev_ch = ch;
|
||||
ch = getc_string(s);
|
||||
if (ch == EOF)
|
||||
{
|
||||
@@ -2900,7 +2898,7 @@ bool wxEatWhiteSpaceString(char *s)
|
||||
if (ch == '*')
|
||||
{
|
||||
// Eat C comment
|
||||
prev_ch = 0;
|
||||
int prev_ch = 0;
|
||||
while ((ch = getc_string(s)) != EOF)
|
||||
{
|
||||
if (ch == '/' && prev_ch == '*')
|
||||
@@ -3251,14 +3249,14 @@ bool wxLoadFromResource(wxWindow* thisWindow, wxWindow *parent, const wxString&
|
||||
}
|
||||
|
||||
// Now create children
|
||||
wxNode *node = resource->GetChildren().First();
|
||||
wxNode *node = resource->GetChildren().GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxItemResource *childResource = (wxItemResource *)node->Data();
|
||||
wxItemResource *childResource = (wxItemResource *)node->GetData();
|
||||
|
||||
(void) wxCreateItem(thisWindow, childResource, resource, table);
|
||||
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -1020,7 +1020,7 @@ void wxExprDatabase::Append(wxExpr *clause)
|
||||
if (expr)
|
||||
{
|
||||
long functor_key = hash_table->MakeKey(WXSTRINGCAST functor);
|
||||
long value_key = 0;
|
||||
long value_key;
|
||||
if (expr && expr->Type() == wxExprString)
|
||||
{
|
||||
value_key = hash_table->MakeKey(WXSTRINGCAST expr->StringValue());
|
||||
|
||||
@@ -465,7 +465,10 @@ void cbBarDragPlugin::ShowHint( bool prevWasInClient )
|
||||
|
||||
if ( mpSrcPane->mProps.mExactDockPredictionOn && mpCurPane )
|
||||
{
|
||||
bool success = mpLayout->RedockBar( mpDraggedBar, mHintRect, mpCurPane, FALSE );
|
||||
#ifdef __WXDEBUG__
|
||||
bool success =
|
||||
#endif
|
||||
mpLayout->RedockBar( mpDraggedBar, mHintRect, mpCurPane, FALSE );
|
||||
|
||||
wxASSERT( success ); // DBG::
|
||||
|
||||
@@ -519,7 +522,10 @@ void cbBarDragPlugin::ShowHint( bool prevWasInClient )
|
||||
|
||||
mpDraggedBar->mUMgrData.SetDirty( TRUE );
|
||||
|
||||
bool success = mpLayout->RedockBar( mpDraggedBar, mHintRect, mpCurPane, FALSE );
|
||||
#ifdef __WXDEBUG__
|
||||
bool success =
|
||||
#endif
|
||||
mpLayout->RedockBar( mpDraggedBar, mHintRect, mpCurPane, FALSE );
|
||||
|
||||
wxASSERT( success ); // DBG ::
|
||||
|
||||
|
||||
@@ -167,7 +167,7 @@ void cbSimpleCustomizationPlugin::OnMenuItemSelected( wxCommandEvent& event )
|
||||
|
||||
// "inverse" bar-visibility of the selected bar
|
||||
|
||||
int newState = 0;
|
||||
int newState;
|
||||
|
||||
if ( pBar->mState == wxCBAR_HIDDEN )
|
||||
{
|
||||
|
||||
@@ -87,6 +87,9 @@
|
||||
|
||||
// some ascii-art, still can't get these *nice* cursors working on wx... :-(
|
||||
|
||||
/*
|
||||
// FIXME:: see places where _gHorizCursorImg is used
|
||||
|
||||
static const char* _gHorizCursorImg[] =
|
||||
{
|
||||
"............XX....XX............",
|
||||
@@ -126,6 +129,7 @@ static const char* _gVertCursorImg[] =
|
||||
"...............XXX..............",
|
||||
"................X..............."
|
||||
};
|
||||
*/
|
||||
|
||||
// helper inline functions
|
||||
|
||||
@@ -446,6 +450,8 @@ void wxFrameLayout::ShowFloatedWindows( bool show )
|
||||
|
||||
wxFrameLayout::~wxFrameLayout()
|
||||
{
|
||||
size_t i;
|
||||
|
||||
UnhookFromFrame();
|
||||
|
||||
if ( mpUpdatesMgr )
|
||||
@@ -474,7 +480,6 @@ wxFrameLayout::~wxFrameLayout()
|
||||
|
||||
// destroy contents of arrays and lists
|
||||
|
||||
size_t i = 0;
|
||||
for ( i = 0; i != MAX_PANES; ++i )
|
||||
{
|
||||
if ( mPanes[i] )
|
||||
@@ -691,7 +696,10 @@ void wxFrameLayout::SetBarState( cbBarInfo* pBar, int newState, bool updateNow )
|
||||
cbDockPane* pPane;
|
||||
cbRowInfo* pRow;
|
||||
|
||||
bool success = LocateBar( pBar, &pRow, &pPane );
|
||||
#ifdef __WXDEBUG__
|
||||
bool success =
|
||||
#endif
|
||||
LocateBar( pBar, &pRow, &pPane );
|
||||
|
||||
wxASSERT( success ); // DBG::
|
||||
|
||||
@@ -773,7 +781,7 @@ void wxFrameLayout::InverseVisibility( cbBarInfo* pBar )
|
||||
|
||||
// "inverse" bar-visibility of the selected bar
|
||||
|
||||
int newState = 0;
|
||||
int newState;
|
||||
|
||||
if ( pBar->mState == wxCBAR_HIDDEN )
|
||||
{
|
||||
@@ -1012,7 +1020,6 @@ void wxFrameLayout::RecalcLayout( bool repositionBarsNow )
|
||||
|
||||
int frmWidth, frmHeight;
|
||||
mpFrame->GetClientSize( &frmWidth, &frmHeight );
|
||||
int paneHeight = 0;
|
||||
|
||||
int curY = 0;
|
||||
int curX = 0;
|
||||
@@ -1028,7 +1035,7 @@ void wxFrameLayout::RecalcLayout( bool repositionBarsNow )
|
||||
pPane->SetPaneWidth( frmWidth );
|
||||
pPane->RecalcLayout();
|
||||
|
||||
paneHeight = pPane->GetPaneHeight();
|
||||
int paneHeight = pPane->GetPaneHeight();
|
||||
|
||||
rect.x = curX;
|
||||
rect.y = curY;
|
||||
@@ -1362,11 +1369,6 @@ void wxFrameLayout::ForwardMouseEvent( wxMouseEvent& event,
|
||||
cbMotionEvent evt( pos, pToPane );
|
||||
FirePluginEvent( evt );
|
||||
}
|
||||
else
|
||||
{
|
||||
int avoidCompilerWarning = 0;
|
||||
wxASSERT(avoidCompilerWarning); // DBG::
|
||||
}
|
||||
} // wxFrameLayout::ForwardMouseEvent()
|
||||
|
||||
|
||||
@@ -2235,7 +2237,7 @@ void cbDockPane::PaintRowBackground ( cbRowInfo* pRow, wxDC& dc )
|
||||
|
||||
void cbDockPane::PaintRowDecorations( cbRowInfo* pRow, wxDC& dc )
|
||||
{
|
||||
size_t i = 0;
|
||||
size_t i;
|
||||
|
||||
// decorations first
|
||||
for ( i = 0; i != pRow->mBars.Count(); ++i )
|
||||
@@ -2271,9 +2273,9 @@ void cbDockPane::PaintPaneDecorations( wxDC& dc )
|
||||
|
||||
void cbDockPane::PaintPane( wxDC& dc )
|
||||
{
|
||||
PaintPaneBackground( dc );
|
||||
size_t i;
|
||||
|
||||
size_t i = 0;
|
||||
PaintPaneBackground( dc );
|
||||
|
||||
// first decorations
|
||||
for ( i = 0; i != mRows.Count(); ++i )
|
||||
@@ -2625,9 +2627,9 @@ bool cbDockPane::HasNotFixedBarsRight( cbBarInfo* pBar )
|
||||
|
||||
void cbDockPane::CalcLengthRatios( cbRowInfo* pInRow )
|
||||
{
|
||||
int totalWidth = 0;
|
||||
size_t i;
|
||||
|
||||
size_t i = 0;
|
||||
int totalWidth = 0;
|
||||
|
||||
// calc current-maximal-total-length of all maximized bars
|
||||
|
||||
@@ -2781,7 +2783,7 @@ void cbDockPane::InitLinksForRows()
|
||||
|
||||
void cbDockPane::DoInsertBar( cbBarInfo* pBar, int rowNo )
|
||||
{
|
||||
cbRowInfo* pRow = NULL;
|
||||
cbRowInfo* pRow;
|
||||
|
||||
if ( rowNo == -1 || rowNo >= (int)mRows.Count() )
|
||||
{
|
||||
|
||||
@@ -374,7 +374,7 @@ void wxDynamicToolBar::SizeToolWindows()
|
||||
bStateCheckDone = TRUE;
|
||||
|
||||
size_t j;
|
||||
wxDynToolInfo *pInfo = NULL;
|
||||
wxDynToolInfo *pInfo;
|
||||
wxDynToolInfo *pPrevInfo = NULL;
|
||||
int nVertSeparators = 0;
|
||||
|
||||
|
||||
@@ -41,9 +41,6 @@ void wxFrameView::OnIdle( wxIdleEvent& event)
|
||||
|
||||
if ( mDoToolUpdates )
|
||||
{
|
||||
int o = 0; //glt
|
||||
++o;
|
||||
|
||||
// TBD::
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,10 +69,7 @@ wxNode* GarbageCollector::FindItemNode( void* pForObj )
|
||||
pNode = pNode->GetNext();
|
||||
}
|
||||
|
||||
int avoidCompilerWarning = 0;
|
||||
wxASSERT(avoidCompilerWarning); // DBG:: item should be present
|
||||
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
wxNode* GarbageCollector::FindReferenceFreeItemNode()
|
||||
|
||||
@@ -294,7 +294,7 @@ void cbPaneDrawPlugin::OnMouseMove( cbMotionEvent& event )
|
||||
return;
|
||||
}
|
||||
|
||||
wxCursor* pCurs = NULL;
|
||||
wxCursor* pCurs;
|
||||
|
||||
if ( testResult == CB_UPPER_ROW_HANDLE_HITTED ||
|
||||
testResult == CB_LOWER_ROW_HANDLE_HITTED)
|
||||
|
||||
@@ -226,21 +226,11 @@ void cbRowDragPlugin::OnMouseMove( cbMotionEvent& event )
|
||||
|
||||
if ( mpPane->IsHorizontal() )
|
||||
{
|
||||
// DBG::
|
||||
wxPoint p = event.mPos;
|
||||
wxPoint d = mDragOrigin;
|
||||
// int dif = event.mPos.x - mDragOrigin.x;
|
||||
|
||||
// row is dragged up or down;
|
||||
ShowDraggedRow( pos.y - mDragOrigin.y );
|
||||
}
|
||||
else
|
||||
{
|
||||
// DBG::
|
||||
wxPoint p = event.mPos;
|
||||
wxPoint d = mDragOrigin;
|
||||
// int dif = event.mPos.x - mDragOrigin.x;
|
||||
|
||||
// row is dragged left or right
|
||||
ShowDraggedRow( pos.x - mDragOrigin.x );
|
||||
}
|
||||
|
||||
@@ -219,8 +219,8 @@ void cbRowLayoutPlugin::AdjustLengthOfInserted( cbRowInfo* WXUNUSED(pRow), cbBar
|
||||
void cbRowLayoutPlugin::FitBarsToRange( int from, int till,
|
||||
cbBarInfo* pTheBar, cbRowInfo* pRow )
|
||||
{
|
||||
cbBarInfo* pFromBar = NULL;
|
||||
cbBarInfo* pTillBar = NULL;
|
||||
cbBarInfo* pFromBar;
|
||||
cbBarInfo* pTillBar;
|
||||
|
||||
if ( pTheBar->mBounds.x > from )
|
||||
{
|
||||
@@ -400,11 +400,11 @@ void cbRowLayoutPlugin::RecalcLengthRatios( cbRowInfo* pRow )
|
||||
|
||||
void cbRowLayoutPlugin::ApplyLengthRatios( cbRowInfo* pRow )
|
||||
{
|
||||
size_t i;
|
||||
double pcntSum = 0;
|
||||
|
||||
// FOR NOW:: all-in-one
|
||||
|
||||
size_t i = 0;
|
||||
for ( i = 0; i != pRow->mBars.Count(); ++i )
|
||||
{
|
||||
if ( !pRow->mBars[i]->IsFixed() )
|
||||
@@ -1109,8 +1109,6 @@ void cbRowLayoutPlugin::OnResizeRow( cbResizeRowEvent& event )
|
||||
// FIXME:: Next line not used.
|
||||
//int newHeight = pTheRow->mRowHeight;
|
||||
|
||||
int freeSpc = 0;
|
||||
|
||||
if ( forUpperHandle )
|
||||
{
|
||||
// calculate available free space from above,
|
||||
@@ -1120,8 +1118,6 @@ void cbRowLayoutPlugin::OnResizeRow( cbResizeRowEvent& event )
|
||||
|
||||
while( pRow )
|
||||
{
|
||||
freeSpc += pRow->mRowHeight - event.mpPane->GetMinimalRowHeight( pRow );
|
||||
|
||||
pRow = pRow->mpPrev;
|
||||
}
|
||||
}
|
||||
@@ -1134,8 +1130,6 @@ void cbRowLayoutPlugin::OnResizeRow( cbResizeRowEvent& event )
|
||||
|
||||
while( pRow )
|
||||
{
|
||||
freeSpc += pRow->mRowHeight - mpPane->GetMinimalRowHeight( pRow );
|
||||
|
||||
pRow = pRow->mpNext;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2064,7 +2064,7 @@ void wxShape::ReadRegions(wxExpr *clause)
|
||||
wxChar regionNameBuf[20];
|
||||
wxChar textNameBuf[20];
|
||||
|
||||
wxExpr *regionExpr = NULL;
|
||||
wxExpr *regionExpr;
|
||||
wxExpr *textExpr = NULL;
|
||||
wxSprintf(regionNameBuf, _T("region%d"), regionNo);
|
||||
wxSprintf(textNameBuf, _T("text%d"), regionNo);
|
||||
@@ -2896,8 +2896,7 @@ wxRealPoint wxShape::CalcSimpleAttachment(const wxRealPoint& pt1, const wxRealPo
|
||||
// Return the zero-based position in m_lines of line.
|
||||
int wxShape::GetLinePosition(wxLineShape* line)
|
||||
{
|
||||
size_t i = 0;
|
||||
for (i = 0; i < m_lines.GetCount(); i++)
|
||||
for (size_t i = 0; i < m_lines.GetCount(); i++)
|
||||
if ((wxLineShape*) (m_lines.Item(i)->GetData()) == line)
|
||||
return i;
|
||||
|
||||
|
||||
@@ -203,15 +203,12 @@ bool PolylineHitTest(double n, double xvec[], double yvec[],
|
||||
double line_ratio;
|
||||
double other_ratio;
|
||||
|
||||
// char buf[300];
|
||||
for (i = 1; i < n; i++)
|
||||
{
|
||||
oglCheckLineIntersection(x1, y1, x2, y2, lastx, lasty, xvec[i], yvec[i],
|
||||
&line_ratio, &other_ratio);
|
||||
if (line_ratio != 1.0)
|
||||
isAHit = TRUE;
|
||||
// sprintf(buf, "Line ratio = %.2f, other ratio = %.2f\n", line_ratio, other_ratio);
|
||||
// ClipsErrorFunction(buf);
|
||||
lastx = xvec[i];
|
||||
lasty = yvec[i];
|
||||
|
||||
@@ -226,13 +223,8 @@ bool PolylineHitTest(double n, double xvec[], double yvec[],
|
||||
&line_ratio, &other_ratio);
|
||||
if (line_ratio != 1.0)
|
||||
isAHit = TRUE;
|
||||
// sprintf(buf, "Line ratio = %.2f, other ratio = %.2f\n", line_ratio, other_ratio);
|
||||
// ClipsErrorFunction(buf);
|
||||
|
||||
if (line_ratio < min_ratio)
|
||||
min_ratio = line_ratio;
|
||||
}
|
||||
// ClipsErrorFunction("\n");
|
||||
return isAHit;
|
||||
}
|
||||
|
||||
|
||||
@@ -449,7 +449,6 @@ wxShape *wxShapeCanvas::FindShape(double x, double y, int *attachment, wxClassIn
|
||||
// Check for division in case line straddles divisions (i.e. is not wholly contained).
|
||||
if (!nearest_object || !(object->IsKindOf(CLASSINFO(wxDivisionShape)) || WhollyContains(object, nearest_object)))
|
||||
{
|
||||
nearest = dist;
|
||||
nearest_object = object;
|
||||
nearest_attachment = temp_attachment;
|
||||
current = NULL;
|
||||
|
||||
@@ -693,11 +693,7 @@ void wxCompositeShape::ReadConstraints(wxExpr *clause, wxExprDatabase *database)
|
||||
haveConstraints = FALSE;
|
||||
break;
|
||||
}
|
||||
int cType = 0;
|
||||
double cXSpacing = 0.0;
|
||||
double cYSpacing = 0.0;
|
||||
wxString cName = wxEmptyString;
|
||||
long cId = 0;
|
||||
wxShape *m_constrainingObject = NULL;
|
||||
wxList m_constrainedObjects;
|
||||
|
||||
@@ -712,11 +708,11 @@ void wxCompositeShape::ReadConstraints(wxExpr *clause, wxExprDatabase *database)
|
||||
wxExpr *constrainingExpr = constraintExpr->Nth(5);
|
||||
wxExpr *constrainedExpr = constraintExpr->Nth(6);
|
||||
|
||||
cType = (int)typeExpr->IntegerValue();
|
||||
cXSpacing = xExpr->RealValue();
|
||||
cYSpacing = yExpr->RealValue();
|
||||
int cType = (int)typeExpr->IntegerValue();
|
||||
double cXSpacing = xExpr->RealValue();
|
||||
double cYSpacing = yExpr->RealValue();
|
||||
cName = nameExpr->StringValue();
|
||||
cId = idExpr->IntegerValue();
|
||||
long cId = idExpr->IntegerValue();
|
||||
|
||||
wxExpr *objExpr1 = database->HashFind(_T("node_image"), constrainingExpr->IntegerValue());
|
||||
if (objExpr1 && objExpr1->GetClientData())
|
||||
@@ -1180,8 +1176,8 @@ void wxDivisionShape::MakeMandatoryControlPoints()
|
||||
double maxX, maxY;
|
||||
|
||||
GetBoundingBoxMax(&maxX, &maxY);
|
||||
double x, y;
|
||||
int direction;
|
||||
double x = 0.0 , y = 0.0;
|
||||
int direction = 0;
|
||||
/*
|
||||
if (m_leftSide)
|
||||
{
|
||||
@@ -1585,8 +1581,7 @@ public:
|
||||
};
|
||||
|
||||
BEGIN_EVENT_TABLE(OGLPopupDivisionMenu, wxMenu)
|
||||
EVT_CUSTOM_RANGE(wxEVT_COMMAND_MENU_SELECTED,
|
||||
DIVISION_MENU_SPLIT_HORIZONTALLY,
|
||||
EVT_MENU_RANGE(DIVISION_MENU_SPLIT_HORIZONTALLY,
|
||||
DIVISION_MENU_EDIT_BOTTOM_EDGE,
|
||||
OGLPopupDivisionMenu::OnMenu)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
@@ -243,18 +243,8 @@ bool wxDividedShape::GetAttachmentPosition(int attachment, double *x, double *y,
|
||||
// Left or right.
|
||||
else
|
||||
{
|
||||
int i = 0;
|
||||
bool isLeft = FALSE;
|
||||
if (attachment < (n+1))
|
||||
{
|
||||
i = attachment-1;
|
||||
isLeft = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
i = (totalNumberAttachments - attachment - 1);
|
||||
isLeft = TRUE;
|
||||
}
|
||||
bool isLeft = !(attachment < (n+1));
|
||||
int i = (isLeft) ? (totalNumberAttachments - attachment - 1) : (attachment-1);
|
||||
wxNode *node = GetRegions().Item(i);
|
||||
if (node)
|
||||
{
|
||||
|
||||
@@ -89,8 +89,7 @@ void wxDrawnShape::SetSize(double w, double h, bool WXUNUSED(recursive))
|
||||
scaleY = 1.0;
|
||||
else scaleY = h/GetHeight();
|
||||
|
||||
int i = 0;
|
||||
for (i = 0; i < 4; i++)
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
if (m_metafiles[i].IsValid())
|
||||
m_metafiles[i].Scale(scaleX, scaleY);
|
||||
@@ -242,8 +241,7 @@ void wxDrawnShape::WriteAttributes(wxExpr *clause)
|
||||
clause->AddAttributeValue(_T("save_metafile"), (long)m_saveToFile);
|
||||
if (m_saveToFile)
|
||||
{
|
||||
int i = 0;
|
||||
for (i = 0; i < 4; i++)
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
if (m_metafiles[i].IsValid())
|
||||
m_metafiles[i].WriteAttributes(clause, i);
|
||||
@@ -262,8 +260,7 @@ void wxDrawnShape::ReadAttributes(wxExpr *clause)
|
||||
|
||||
if (m_saveToFile)
|
||||
{
|
||||
int i = 0;
|
||||
for (i = 0; i < 4; i++)
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
m_metafiles[i].ReadAttributes(clause, i);
|
||||
}
|
||||
@@ -280,8 +277,7 @@ void wxDrawnShape::Copy(wxShape& copy)
|
||||
|
||||
wxDrawnShape& drawnCopy = (wxDrawnShape&) copy;
|
||||
|
||||
int i = 0;
|
||||
for (i = 0; i < 4; i++)
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
m_metafiles[i].Copy(drawnCopy.m_metafiles[i]);
|
||||
}
|
||||
@@ -1261,8 +1257,7 @@ bool wxOpPolyDraw::GetPerimeterPoint(double x1, double y1,
|
||||
double *xpoints = new double[n];
|
||||
double *ypoints = new double[n];
|
||||
|
||||
int i = 0;
|
||||
for (i = 0; i < n; i++)
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
wxRealPoint *point = & (m_points[i]);
|
||||
xpoints[i] = point->x + xOffset;
|
||||
|
||||
@@ -115,8 +115,7 @@ void wxLineShape::MakeLineControlPoints(int n)
|
||||
}
|
||||
m_lineControlPoints = new wxList;
|
||||
|
||||
int i = 0;
|
||||
for (i = 0; i < n; i++)
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
wxRealPoint *point = new wxRealPoint(-999, -999);
|
||||
m_lineControlPoints->Append((wxObject*) point);
|
||||
@@ -598,7 +597,7 @@ void wxLineShape::DrawArrow(wxDC& dc, wxArrowHead *arrow, double xOffset, bool p
|
||||
double positionOnLineX, positionOnLineY;
|
||||
|
||||
// Position of start point of line, at the end of which we draw the arrow.
|
||||
double startPositionX, startPositionY;
|
||||
double startPositionX = 0.0 , startPositionY = 0.0;
|
||||
|
||||
switch (arrow->GetPosition())
|
||||
{
|
||||
@@ -691,7 +690,7 @@ void wxLineShape::DrawArrow(wxDC& dc, wxArrowHead *arrow, double xOffset, bool p
|
||||
double y3 = positionOnLineY;
|
||||
double d = -arrow->GetYOffset(); // Negate so +offset is above line
|
||||
|
||||
double theta = 0.0;
|
||||
double theta;
|
||||
if (x3 == x1)
|
||||
theta = (double)(myPi/2.0);
|
||||
else
|
||||
@@ -2036,9 +2035,9 @@ bool wxLineShape::AddArrowOrdered(wxArrowHead *arrow, wxList& referenceList, int
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
wxArrowHead *currArrow = (wxArrowHead *)currNode->GetData();
|
||||
while (refNode && currNode)
|
||||
{
|
||||
wxArrowHead *currArrow = (wxArrowHead *)currNode->GetData();
|
||||
refArrow = (wxArrowHead *)refNode->GetData();
|
||||
|
||||
// Matching: advance current arrow pointer
|
||||
@@ -2318,7 +2317,7 @@ int wxLineShape::GetAlignmentType(bool isEnd)
|
||||
wxRealPoint *wxLineShape::GetNextControlPoint(wxShape *nodeObject)
|
||||
{
|
||||
int n = m_lineControlPoints->GetCount();
|
||||
int nn = 0;
|
||||
int nn;
|
||||
if (m_to == nodeObject)
|
||||
{
|
||||
// Must be END of line, so we want (n - 1)th control point.
|
||||
|
||||
@@ -33,18 +33,6 @@
|
||||
|
||||
static char _buf[1024]; // a temp buffer to use inplace of wxBuffer, which is deprecated.
|
||||
|
||||
static char hexArray[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B',
|
||||
'C', 'D', 'E', 'F' };
|
||||
|
||||
static void DecToHex(int dec, char *buf)
|
||||
{
|
||||
int firstDigit = (int)(dec/16.0);
|
||||
int secondDigit = (int)(dec - (firstDigit*16.0));
|
||||
buf[0] = hexArray[firstDigit];
|
||||
buf[1] = hexArray[secondDigit];
|
||||
buf[2] = 0;
|
||||
}
|
||||
|
||||
// 16-bit unsigned integer
|
||||
static unsigned int getshort(FILE *fp)
|
||||
{
|
||||
@@ -64,7 +52,7 @@ static int getsignedshort(FILE *fp)
|
||||
int testRes = ((unsigned int) c) + (((unsigned int) c1) << 8);
|
||||
#endif
|
||||
unsigned long res1 = ((unsigned int) c) + (((unsigned int) c1) << 8);
|
||||
int res = 0;
|
||||
int res;
|
||||
if (res1 > 32767)
|
||||
res = (int)(res1 - 65536);
|
||||
else
|
||||
|
||||
@@ -231,7 +231,7 @@ bool wxDiagram::SaveFile(const wxString& filename)
|
||||
|
||||
if (!shape->IsKindOf(CLASSINFO(wxControlPoint)))
|
||||
{
|
||||
wxExpr *expr = NULL;
|
||||
wxExpr *expr;
|
||||
if (shape->IsKindOf(CLASSINFO(wxLineShape)))
|
||||
expr = new wxExpr(_T("line"));
|
||||
else
|
||||
@@ -239,7 +239,7 @@ bool wxDiagram::SaveFile(const wxString& filename)
|
||||
|
||||
OnShapeSave(*database, *shape, *expr);
|
||||
}
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
OnDatabaseSave(*database);
|
||||
|
||||
@@ -308,14 +308,14 @@ bool wxDiagram::LoadFile(const wxString& filename)
|
||||
OnHeaderLoad(database, *header);
|
||||
|
||||
// Scan through all clauses and register the ids
|
||||
wxNode *node = database.First();
|
||||
wxNode *node = database.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxExpr *clause = (wxExpr *)node->GetData();
|
||||
long id = -1;
|
||||
clause->GetAttributeValue(_T("id"), id);
|
||||
wxRegisterId(id);
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
|
||||
ReadNodes(database);
|
||||
@@ -534,13 +534,13 @@ bool wxDiagram::OnShapeSave(wxExprDatabase& db, wxShape& shape, wxExpr& expr)
|
||||
|
||||
if (shape.IsKindOf(CLASSINFO(wxCompositeShape)))
|
||||
{
|
||||
wxNode *node = shape.GetChildren().First();
|
||||
wxNode *node = shape.GetChildren().GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxShape *childShape = (wxShape *)node->GetData();
|
||||
wxExpr *childExpr = new wxExpr(_T("shape"));
|
||||
OnShapeSave(db, *childShape, *childExpr);
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -360,7 +360,6 @@ void oglGetCentredTextExtent(wxDC& dc, wxList *text_list,
|
||||
long current_width = 0;
|
||||
|
||||
wxNode *current = text_list->GetFirst();
|
||||
int i = 0;
|
||||
while (current)
|
||||
{
|
||||
wxShapeTextLine *line = (wxShapeTextLine *)current->GetData();
|
||||
@@ -369,7 +368,6 @@ void oglGetCentredTextExtent(wxDC& dc, wxList *text_list,
|
||||
if (current_width > max_width)
|
||||
max_width = current_width;
|
||||
current = current->GetNext();
|
||||
i ++;
|
||||
}
|
||||
|
||||
*actual_height = n*char_height;
|
||||
|
||||
Reference in New Issue
Block a user